--- /dev/null
+#!/bin/bash
+
+if [[ "$GITDIR" == "" ]]; then
+ GITDIR=~/uod-development/jalview-builds/git/jalview
+fi;
+
+if [[ "$DEVELOPERID" == "" ]]; then
+ DEVELOPERID="Developer ID"
+fi;
+
+if [[ "$TMPDMG" == "" ]]; then
+ TMPDMG="signingDMG"
+fi;
+
+echo APPNAME $APPNAME like Jalview Test
+echo doing ARCH $ARCH
+echo using entitlements from $GITDIR
+echo using key $DEVELOPERID
+
+FAPPNAME="${APPNAME/ /\\ }"
+FAPPNAMEESC="${APPNAME/ /\\\\\\ }"
+FWAPP="${APPNAME/ [A-Za-z]*/}"
+ARCHNAME="${APPNAME// /_}-${APPVER//\./_}-macos-$ARCH-java_$JVER"
+DMGNAME="${APPNAME/ /_}-${APPVER//\./_}-macos-$ARCH-java_$JVER.dmg"
+VOLNAME="${APPNAME// /_}\\ Installer\\ \\(${APPVER//\./_}\\ $ARCH\\ $JVER\\)"
+VLNAME="${APPNAME// /_} Installer (${APPVER//\./_} $ARCH $JVER)"
+BORINGVLNAME="${APPNAME} Installer"
+
+
+
+echo "will mount $DMGNAME as $VOLNAME"
+if [[ -d $TMPDMG ]]; then
+ echo "'$TMPDMG' is in the way. Please delete it or set TMPDMG"
+ exit 1;
+fi
+
+if [[ -f $DMGNAME ]]; then
+ hdiutil attach $DMGNAME
+ ditto /Volumes/${FWAPP}* $TMPDMG
+ hdiutil eject /Volumes/${FWAPP}*
+ mkdir -p unsigned
+ mv -v $DMGNAME unsigned/
+ echo Moved $DMGNAME to unsigned/$DMGNAME
+ codesign --remove-signature --force --deep -vvvv -s "Developer ID" --options runtime --entitlements $GITDIR/utils/osx_signing/entitlements.txt $TMPDMG/${FWAPP}*.app/Contents/Resources/app/jre/Contents/MacOS/libjli.dylib
+
+ codesign --verify --deep -v ./$TMPDMG/${FWAPP}*.app/Contents/Resources/app/jre/Contents/MacOS/libjli.dylib
+
+ codesign --remove-signature --force --deep -vvvv -s "Developer ID" --options runtime --entitlements $GITDIR/utils/osx_signing/entitlements.txt $TMPDMG/${FWAPP}*.app/Contents/MacOS/JavaApplicationStub
+
+ hdiutil create -megabytes 260 -srcfolder ./$TMPDMG -volname "$BORINGVLNAME" $ARCHNAME.dmg
+
+ codesign --force --deep -vvvv -s "Developer ID" --options runtime --entitlements $GITDIR/utils/osx_signing/entitlements.txt $ARCHNAME.dmg
+
+ codesign --deep -vvvv $ARCHNAME.dmg
+
+ rm -Rf $TMPDMG
+else
+ echo Can\'t find $DMGNAME - dit you set APPNAME APPVER ARCH and JVER correctly ?
+fi
+
--- /dev/null
+#!/bin/bash
+
+if [[ "$GITDIR" == "" ]]; then
+ GITDIR=~/uod-development/jalview-builds/git/jalview
+fi;
+
+
+if [[ "$DEVELOPERID" == "" ]]; then
+ DEVELOPERID="Developer ID"
+fi;
+
+if [[ "$TMPDMG" == "" ]]; then
+ TMPDMG="staplingDMG"
+fi;
+
+
+echo APPNAME $APPNAME like Jalview Test
+echo doing ARCH $ARCH
+echo using entitlements from $GITDIR
+
+FAPPNAME="${APPNAME/ /\\ }"
+FAPPNAMEESC="${APPNAME/ /\\\\\\ }"
+FWAPP="${APPNAME/ [A-Za-z]*/}"
+ARCHNAME="${APPNAME// /_}-${APPVER//\./_}-macos-$ARCH-java_$JVER"
+DMGNAME="${APPNAME/ /_}-${APPVER//\./_}-macos-$ARCH-java_$JVER.dmg"
+VOLNAME="${APPNAME// /_}\\ Installer\\ \\(${APPVER//\./_}\\ $ARCH\\ $JVER\\)"
+VLNAME="${APPNAME// /_} Installer (${APPVER//\./_} $ARCH $JVER)"
+BORINGVLNAME="${APPNAME} Installer"
+echo "will mount $DMGNAME as $VOLNAME"
+
+if [[ -d $TMPDMG ]]; then
+ echo "'$TMPDMG' is in the way. Please delete it or set TMPDMG"
+ exit 1;
+fi
+
+if [[ -f $DMGNAME ]]; then
+ hdiutil attach $DMGNAME
+ ditto /Volumes/${FWAPP}* $TMPDMG
+ hdiutil eject /Volumes/${FWAPP}*
+ xcrun stapler staple $TMPDMG/${FWAPP}*.app
+ mkdir -p stapled
+ hdiutil create -megabytes 240 -srcfolder $TMPDMG -volname "$BORINGVLNAME" stapled/$DMGNAME
+ codesign --force --deep -vvvv -s "$DEVELOPERID" --options runtime --entitlements ${GITDIR}/utils/osx_signing/entitlements.txt stapled/$DMGNAME
+ codesign --deep -vvvv stapled/$DMGNAME
+ echo "Stapled DMG is in stapled/$DMGNAME"
+ rm -Rf $TMPDMG
+else
+ echo Can\'t find $DMGNAME - dit you set APPNAME APPVER ARCH and JVER correctly ?
+fi
+