Chris@2374: #!/bin/bash Chris@2374: Chris@2374: set -eu Chris@2374: Chris@2374: app="Sonic Visualiser" Chris@2374: Chris@2374: version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` Chris@2374: Chris@2374: source="$app.app" Chris@2374: volume="$app"-"$version" Chris@2374: target="$volume"/"$app".app Chris@2374: dmg="$app"-"$version".dmg Chris@2374: Chris@2374: if [ -d "$volume" ]; then Chris@2374: echo "Target directory $volume already exists, not overwriting" Chris@2374: exit 2 Chris@2374: fi Chris@2374: Chris@2374: if [ -f "$dmg" ]; then Chris@2374: echo "Target disc image $dmg already exists, not overwriting" Chris@2374: exit 2 Chris@2374: fi Chris@2374: Chris@2374: echo Chris@2374: echo "(Re-)running deploy script..." Chris@2374: Chris@2374: deploy/osx/deploy.sh "$app" || exit 1 Chris@2374: Chris@2374: echo Chris@2374: echo "Making target tree." Chris@2374: Chris@2374: mkdir "$volume" || exit 1 Chris@2374: Chris@2374: ln -s /Applications "$volume"/Applications Chris@2374: cp README.md "$volume/README.txt" Chris@2374: cp README.OSC "$volume/README-OSC.txt" Chris@2374: cp COPYING "$volume/COPYING.txt" Chris@2374: cp CHANGELOG "$volume/CHANGELOG.txt" Chris@2374: cp CITATION "$volume/CITATION.txt" Chris@2374: cp -rp "$source" "$target" Chris@2374: Chris@2374: # update file timestamps so as to make the build date apparent Chris@2374: find "$volume" -exec touch \{\} \; Chris@2374: Chris@2374: echo "Done" Chris@2374: Chris@2374: echo Chris@2374: echo "Code-signing volume..." Chris@2374: Chris@2374: deploy/osx/sign.sh "$volume" || exit 1 Chris@2374: Chris@2374: echo "Done" Chris@2374: Chris@2374: echo Chris@2374: echo "Making dmg..." Chris@2374: Chris@2374: rm -f "$dmg" Chris@2374: Chris@2374: hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" -fs HFS+ && Chris@2374: rm -r "$volume" Chris@2374: Chris@2374: echo "Done" Chris@2374: Chris@2374: echo Chris@2374: echo "Signing dmg..." Chris@2374: Chris@2374: codesign -s "Developer ID Application: Chris Cannam" -fv "$dmg" Chris@2374: Chris@2374: echo Chris@2374: echo "Submitting dmg for notarization..." Chris@2374: Chris@2374: deploy/osx/notarize.sh "$dmg" || exit 1 Chris@2374: Chris@2374: echo "Done"