pgadmin4/pkg/mac/codesign-dmg.sh

30 lines
683 B
Bash
Raw Normal View History

2019-03-21 09:02:19 -05:00
#!/bin/bash
2019-03-21 09:02:19 -05: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
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}
codesign --sign "${DEVELOPER_ID}" --verbose --force "${DMG_IMAGE}"
# Verify it worked
echo Verifying the signature
codesign --verify --verbose --force "${DMG_IMAGE}"
RETURN_STATUS=$?
2019-03-21 09:02:19 -05:00
if [ ${RETURN_STATUS} -ne 0 ]; then
echo ERROR: Code signing did not work
2016-10-04 07:51:28 -05:00
exit 1
else
echo ${DMG_IMAGE} successfully signed
fi