If CODE_SIGN_IDENTITY is set use it to sign the app bundle and the
[metze/wireshark/wip.git] / packaging / macosx / osx-dmg.sh.in
index b565696eb5969a397daf4577adadf038b72ad3a5..920b6dab6c325613a3a6bfc0c46c4af14ae4d257 100755 (executable)
@@ -133,7 +133,8 @@ case `file $ws_bin` in
                architecture="PPC 32"
                ;;
        *)
-               echo "Cannot determine architecture"
+               echo "Cannot determine architecture of $ws_bin; file reports:"
+               file $ws_bin
                exit 1
                ;;
 esac
@@ -154,6 +155,12 @@ packagemaker --doc "Wireshark_package.pmdoc" \
     --version "$version" \
     --verbose || exit 1
 
+if [ -n "$CODE_SIGN_IDENTITY" ] ; then
+       echo -e "Signing the $pkg_file"
+       codesign --sign "$CODE_SIGN_IDENTITY" --verbose "$pkg_file" || exit 1
+       codesign --verify --verbose "$pkg_file" || exit 1
+fi
+
 echo -e "\nCREATE WIRESHARK DISK IMAGE\n"
 img_name="$pkg_title.dmg"
 
@@ -244,4 +251,10 @@ fi
 /usr/bin/hdiutil convert "$rw_name" -format UDZO -imagekey zlib-level=9 -o "$img_name" || exit 1
 rm -f "$rw_name"
 
+#if [ -n "$CODE_SIGN_IDENTITY" ] ; then
+#      echo -e "Signing the $img_name"
+#      codesign --sign "$CODE_SIGN_IDENTITY" --verbose "$img_name" || exit 1
+#      codesign --verify --verbose "$img_name" || exit 1
+#fi
+
 exit 0