2019-03-21 14:02:19 +00:00
|
|
|
#!/bin/bash
|
2016-10-04 12:50:16 +01:00
|
|
|
|
2019-03-21 14:02:19 +00:00
|
|
|
DMG_VOLUME_NAME=${APP_NAME}
|
|
|
|
|
DMG_NAME=`echo ${DMG_VOLUME_NAME} | sed 's/ //g' | awk '{print tolower($0)}'`
|
|
|
|
|
DMG_IMAGE=${DISTROOT}/${DMG_NAME}-${APP_LONG_VERSION}.dmg
|
2016-10-04 12:50:16 +01:00
|
|
|
|
|
|
|
|
if ! test -f "${DMG_IMAGE}" ; then
|
|
|
|
|
echo "${DMG_IMAGE} is no disk image!" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Get the config
|
|
|
|
|
source codesign.conf
|
|
|
|
|
|
|
|
|
|
SCRIPT_DIR=`pwd`
|
|
|
|
|
|
|
|
|
|
# Sign the .app
|
|
|
|
|
echo Signing ${DMG_IMAGE}
|
2020-02-05 14:00:18 +05:30
|
|
|
codesign --deep --force --verify --verbose --timestamp --options runtime -i "${DEVELOPER_BUNDLE_ID}" --sign "${DEVELOPER_ID}" "${DMG_IMAGE}"
|
2016-10-04 12:50:16 +01:00
|
|
|
|
|
|
|
|
# Verify it worked
|
|
|
|
|
echo Verifying the signature
|
|
|
|
|
codesign --verify --verbose --force "${DMG_IMAGE}"
|
|
|
|
|
RETURN_STATUS=$?
|
2019-03-21 14:02:19 +00:00
|
|
|
if [ ${RETURN_STATUS} -ne 0 ]; then
|
2016-10-04 12:50:16 +01:00
|
|
|
echo ERROR: Code signing did not work
|
2016-10-04 13:51:28 +01:00
|
|
|
exit 1
|
2016-10-04 12:50:16 +01:00
|
|
|
else
|
|
|
|
|
echo ${DMG_IMAGE} successfully signed
|
2020-02-04 15:21:05 +00:00
|
|
|
fi
|