diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-09-26 10:43:13 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2019-09-26 17:52:43 +0000 |
commit | af793b19d03b662288c908b627a462d07d5a76fc (patch) | |
tree | aebec4bbbc2c543ec28f0f2cbf7bdb400b9e0970 /packaging | |
parent | 2cb18634d8f828ee263cc4e302dd6b3c54f7141f (diff) |
macOS: Sign our .dmg.
Add osx-dmg.sh back and make it a simple wrapper around dmgbuild and
codesign.
Change-Id: I0baa21fd971aa1b06e1a6700881cd7625dffff35
Reviewed-on: https://code.wireshark.org/review/34629
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/macosx/osx-dmg.sh.in | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/packaging/macosx/osx-dmg.sh.in b/packaging/macosx/osx-dmg.sh.in new file mode 100755 index 0000000000..4982508feb --- /dev/null +++ b/packaging/macosx/osx-dmg.sh.in @@ -0,0 +1,68 @@ +#!/bin/bash +# +# The script creates a disk image using the dmgbuild utility and signs it. + +# Defaults +dmgbuild="@DMGBUILD_EXECUTABLE@" +version="@VERSION@" +settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/dmgbuild-settings.py" +architecture="Intel 64" + +# Help message +#---------------------------------------------------------- +help() +{ +echo -e " +Create a custom dmg file to distribute Wireshark + +USAGE + $0 + +OPTIONS + -h,--help + Display this help message. + +Icons are positioned and the background image is set in +arrange_dmg.applescript. +" +} + +# Parse command line arguments +while [ "$1" != "" ] +do + case $1 in + -h|--help) + help + exit 0 ;; + *) + echo "Invalid command line option" + exit 2 ;; + esac + shift 1 +done + +vol_name="Wireshark ${version}" +img_name="$vol_name $architecture.dmg" + +echo -e "\\nCREATE WIRESHARK DISK IMAGE\\n" + +"$dmgbuild" \ + --no-hidpi \ + -s "$settings_file" \ + "$vol_name" \ + "$img_name" || exit 1 + +echo -e "\\nSIGN WIRESHARK DISK IMAGE\\n" + +# TN2206, "Signing Disk Images" +if [ -n "$CODE_SIGN_IDENTITY" ] ; then + echo -e "Signing $img_name" + codesign \ + --sign "Developer ID Application: $CODE_SIGN_IDENTITY" \ + --timestamp \ + --verbose \ + "$img_name" + spctl --assess --type open --context context:primary-signature --verbose=2 "$img_name" || exit 1 +fi + +exit 0 |