add helper script to sign app bundle

This commit is contained in:
Daniel Molkentin 2012-10-10 16:56:19 +02:00
parent fee9616708
commit d52d32f1b3

20
admin/osx/sign_dmg.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh -x
[ "$#" -lt 2 ] && echo "Usage: sign_dmg.sh <dmg> <identity>" && exit
src_dmg=$1
tmp_dmg=writable_$1
signed_dmg=signed_$1
identity=$2
mount="/Volumes/$(basename $src_dmg|cut -d"-" -f1)"
test -e $tmp_dmg && rm -rf $tmp_dmg
hdiutil convert $src_dmg -format UDRW -o $tmp_dmg
open $tmp_dmg
sleep 2s
pushd $mount
codesign -s "$identity" $mount/*.app
popd
diskutil eject $mount
test -e $signed_dmg && rm -rf $signed_dmg
hdiutil convert $tmp_dmg -format UDBZ -o $signed_dmg