2020-01-03 03:56:45 -06:00
|
|
|
#!/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
|
2020-01-03 03:56:45 -06:00
|
|
|
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
|
2020-01-03 03:56:45 -06:00
|
|
|
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)
|
2020-01-03 03:56:45 -06:00
|
|
|
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"
|
2020-01-03 03:56:45 -06:00
|
|
|
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}" "$"
|
2020-01-03 03:56:45 -06:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo Signing ${BUNDLE} libraries
|
2020-01-03 04:32:18 -06:00
|
|
|
for i in $(find "${BUNDLE}" -type f -name "*.dylib*")
|
2020-01-03 03:56:45 -06:00
|
|
|
do
|
2020-02-04 09:21:05 -06:00
|
|
|
codesign --deep --verify --verbose --timestamp --options runtime -i "${DEVELOPER_BUNDLE_ID" --sign "${DEVELOPER_ID}" "$"
|
2020-01-03 03:56:45 -06:00
|
|
|
done
|
|
|
|
|