pgadmin4/pkg/mac/codesign-binaries.sh

38 lines
912 B
Bash
Raw Normal View History

#!/bin/sh
BUNDLE="$1"
if ! test -d "${BUNDLE}" ; then
echo "${BUNDLE} is no bundle!" >&2
exit 1
fi
# Get the config
source codesign.conf
2020-01-03 04:14:13 -06:00
if [ -z "${DEVELOPER_ID}" ] ; then
echo "Developer ID Application not found in codesign.conf" >&2
exit 1
fi
2020-01-03 04:14:13 -06:00
if [ -z "${DEVELOPER_BUNDLE_ID}" ]; then
echo "Developer Bundle Identifier not found in codesign.conf" >&2
fi
echo Signing ${BUNDLE} binaries
2020-01-03 04:32:18 -06:00
IFS=$'\n'
for i in $(find "${BUNDLE}" -type f)
do
2020-01-03 04:14:13 -06:00
file "${i}" | grep -E "Mach-O executable|Mach-O 64-bit executable|Mach-O 64-bit bundle"
if [ $? -eq 0 ] ; then
2020-02-04 09:21:05 -06:00
codesign --deep --verify --verbose --timestamp --options runtime -i "${DEVELOPER_BUNDLE_ID" --sign "${DEVELOPER_ID}" "$"
fi
done
echo Signing ${BUNDLE} libraries
2020-01-03 04:32:18 -06:00
for i in $(find "${BUNDLE}" -type f -name "*.dylib*")
do
2020-02-04 09:21:05 -06:00
codesign --deep --verify --verbose --timestamp --options runtime -i "${DEVELOPER_BUNDLE_ID" --sign "${DEVELOPER_ID}" "$"
done