Chris@232: #!/bin/bash Chris@232: Chris@232: # Execute this from the top-level directory of the project (the one Chris@232: # that contains the .app bundle). Chris@232: Chris@232: app=EasyMercurial Chris@232: Chris@232: version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` Chris@260: case "$version" in Chris@260: [0-9].[0-9]) bundleVersion="$version".0 ;; Chris@260: [0-9].[0-9].[0-9]) bundleVersion="$version" ;; Chris@260: *) echo "Error: Version $version is neither two- nor three-part number" ;; Chris@260: esac Chris@232: Chris@232: echo Chris@232: echo "Writing version $bundleVersion in to bundle." Chris@232: echo "(This should be a three-part number: major.minor.point)" Chris@232: Chris@232: perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \ Chris@232: > "$app".app/Contents/Info.plist Chris@232: Chris@335: echo "Done: check $app.app/Contents/Info.plist for sanity please" Chris@232: Chris@335: bash deploy/osx/paths.sh "$app" Chris@256: Chris@256: echo Chris@232: echo "Making dmg..." Chris@232: Chris@335: mkdir "$app"-"$version" && Chris@335: ln -s /Applications "$app"-"$version"/Applications && Chris@335: cp -rp "$app".app "$app"-"$version"/ && Chris@335: hdiutil create -srcfolder "$app"-"$version" "$app"-"$version".dmg -volname "$app"-"$version" && Chris@335: rm -r "$app"-"$version" Chris@232: Chris@232: echo "Done"