comparison deploy/osx/deploy.sh @ 62:092a69229347

Add OS/X deploy stuff
author Chris Cannam
date Thu, 18 Jul 2013 15:06:35 +0100
parents
children f9803dceab2a
comparison
equal deleted inserted replaced
61:85ac2e8e3872 62:092a69229347
1 #!/bin/bash
2
3 # Execute this from the top-level directory of the project (the one
4 # that contains the .app bundle). Supply the name of the .app bundle
5 # as argument (the target will use $app.app regardless, but we need
6 # to know the source)
7
8 source="$1"
9 dmg="$2"
10 if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then
11 echo "Usage: $0 <source.app> <target-dmg-basename>"
12 echo " e.g. $0 MyApplication.app MyApplication"
13 echo " Version number and .dmg will be appended automatically,"
14 echo " but the .app name must include .app"
15 exit 2
16 fi
17 app=`basename "$source" .app`
18
19 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
20 case "$version" in
21 [0-9].[0-9]) bundleVersion="$version".0 ;;
22 [0-9].[0-9].[0-9]) bundleVersion="$version" ;;
23 *) echo "Error: Version $version is neither two- nor three-part number" ;;
24 esac
25
26 echo
27 echo "Fixing up paths."
28
29 deploy/osx/paths.sh "$app"
30
31 echo
32 echo "Making target tree."
33
34 volume="$app"-"$version"
35 target="$volume"/"$app".app
36 dmg="$dmg"-"$version".dmg
37
38 mkdir "$volume" || exit 1
39
40 ln -s /Applications "$volume"/Applications
41 cp README README.OSC COPYING CHANGELOG "$volume/"
42 cp -rp "$source" "$target"
43
44 echo "Done"
45
46 echo "Writing version $bundleVersion in to bundle."
47 echo "(This should be a three-part number: major.minor.point)"
48
49 perl -p -e "s/TONY_VERSION/$bundleVersion/" deploy/osx/Info.plist \
50 > "$target"/Contents/Info.plist
51
52 echo "Done: check $target/Contents/Info.plist for sanity please"
53
54 deploy/osx/sign.sh "$volume" || exit 1
55
56 echo
57 echo "Making dmg..."
58
59 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" &&
60 rm -r "$volume"
61
62 echo "Done"