Mercurial > hg > easyhg
comparison deploy/osx/deploy.sh @ 366:ce4d06d87a39
Update deployment to handle the even more complicated situation in which we have to produce separate binaries for python 2.5 and 2.6-based systems (because we can't determine which extension to load otherwise, and they aren't compatible)
author | Chris Cannam |
---|---|
date | Wed, 23 Mar 2011 14:49:43 +0000 |
parents | aa852b477e4d |
children | 2d3f1e5d8638 |
comparison
equal
deleted
inserted
replaced
364:9bafea5ac56f | 366:ce4d06d87a39 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Execute this from the top-level directory of the project (the one | 3 # Execute this from the top-level directory of the project (the one |
4 # that contains the .app bundle). | 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) | |
5 | 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 exit 2 | |
13 fi | |
6 app=EasyMercurial | 14 app=EasyMercurial |
7 | 15 |
8 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` | 16 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` |
9 case "$version" in | 17 case "$version" in |
10 [0-9].[0-9]) bundleVersion="$version".0 ;; | 18 [0-9].[0-9]) bundleVersion="$version".0 ;; |
11 [0-9].[0-9].[0-9]) bundleVersion="$version" ;; | 19 [0-9].[0-9].[0-9]) bundleVersion="$version" ;; |
12 *) echo "Error: Version $version is neither two- nor three-part number" ;; | 20 *) echo "Error: Version $version is neither two- nor three-part number" ;; |
13 esac | 21 esac |
14 | 22 |
15 echo | 23 echo |
24 echo "Making target tree." | |
25 | |
26 volume="$app"-"$version" | |
27 target="$volume"/"$app".app | |
28 dmg="$dmg"-"$version".dmg | |
29 | |
30 mkdir "$volume" || exit 1 | |
31 | |
32 ln -s /Applications "$volume"/Applications | |
33 cp -rp "$source" "$target" | |
34 | |
35 echo "Done" | |
36 | |
16 echo "Writing version $bundleVersion in to bundle." | 37 echo "Writing version $bundleVersion in to bundle." |
17 echo "(This should be a three-part number: major.minor.point)" | 38 echo "(This should be a three-part number: major.minor.point)" |
18 | 39 |
19 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \ | 40 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \ |
20 > "$app".app/Contents/Info.plist | 41 > "$target"/Contents/Info.plist |
21 | 42 |
22 echo "Done: check $app.app/Contents/Info.plist for sanity please" | 43 echo "Done: check $target/Contents/Info.plist for sanity please" |
23 | |
24 bash deploy/osx/paths.sh "$app" | |
25 | 44 |
26 echo | 45 echo |
27 echo "Making dmg..." | 46 echo "Making dmg..." |
28 | 47 |
29 mkdir "$app"-"$version" && | 48 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" && |
30 ln -s /Applications "$app"-"$version"/Applications && | 49 rm -r "$volume" |
31 cp -rp "$app".app "$app"-"$version"/ && | |
32 hdiutil create -srcfolder "$app"-"$version" "$app"-"$version".dmg -volname "$app"-"$version" && | |
33 rm -r "$app"-"$version" | |
34 | 50 |
35 echo "Done" | 51 echo "Done" |