annotate deploy/osx/deploy.sh @ 664:cfe684675e81

Workaround for disappearing menubar under Ubuntu
author Chris Cannam
date Mon, 01 Sep 2014 16:12:33 +0100
parents 5ac4e821ee7b
children 0f3e086066fc
rev   line source
Chris@232 1 #!/bin/bash
Chris@232 2
Chris@232 3 # Execute this from the top-level directory of the project (the one
Chris@366 4 # that contains the .app bundle). Supply the name of the .app bundle
Chris@366 5 # as argument (the target will use $app.app regardless, but we need
Chris@366 6 # to know the source)
Chris@232 7
Chris@366 8 source="$1"
Chris@366 9 dmg="$2"
Chris@366 10 if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then
Chris@366 11 echo "Usage: $0 <source.app> <target-dmg-basename>"
Chris@366 12 exit 2
Chris@366 13 fi
Chris@232 14 app=EasyMercurial
Chris@232 15
Chris@372 16 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' src/version.h`
Chris@260 17 case "$version" in
Chris@260 18 [0-9].[0-9]) bundleVersion="$version".0 ;;
Chris@260 19 [0-9].[0-9].[0-9]) bundleVersion="$version" ;;
Chris@260 20 *) echo "Error: Version $version is neither two- nor three-part number" ;;
Chris@260 21 esac
Chris@232 22
Chris@232 23 echo
Chris@366 24 echo "Making target tree."
Chris@366 25
Chris@366 26 volume="$app"-"$version"
Chris@366 27 target="$volume"/"$app".app
Chris@366 28 dmg="$dmg"-"$version".dmg
Chris@366 29
Chris@366 30 mkdir "$volume" || exit 1
Chris@366 31
Chris@366 32 ln -s /Applications "$volume"/Applications
Chris@577 33 cp COPYING "$volume/COPYING.txt"
Chris@490 34 cp -RPp "$source" "$target"
Chris@366 35
Chris@366 36 echo "Done"
Chris@366 37
Chris@232 38 echo "Writing version $bundleVersion in to bundle."
Chris@232 39 echo "(This should be a three-part number: major.minor.point)"
Chris@232 40
Chris@232 41 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \
Chris@366 42 > "$target"/Contents/Info.plist
Chris@232 43
Chris@366 44 echo "Done: check $target/Contents/Info.plist for sanity please"
Chris@256 45
Chris@256 46 echo
Chris@232 47 echo "Making dmg..."
Chris@232 48
Chris@366 49 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" &&
Chris@366 50 rm -r "$volume"
Chris@232 51
Chris@232 52 echo "Done"