aboutsummaryrefslogtreecommitdiffhomepage
path: root/build_tools/make_pkg.sh
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-13 23:09:40 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-13 23:13:18 -0700
commita81e70350bfa559de2b0fdd0af4824b83ac8cfb1 (patch)
treedc8601d6d532d04650d0542d3c687f7ee4f14aa7 /build_tools/make_pkg.sh
parent7f6f0ca1036133b25a23f2f7330b26f2d7727272 (diff)
Teach OS X package builder script to look up the version dynamically
Diffstat (limited to 'build_tools/make_pkg.sh')
-rwxr-xr-xbuild_tools/make_pkg.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh
index 1c4f70ee..2fb452ea 100755
--- a/build_tools/make_pkg.sh
+++ b/build_tools/make_pkg.sh
@@ -1,10 +1,23 @@
-#!/bin/sh -x
+#!/bin/sh
+
+VERSION=`sed -E -n 's/^.*PACKAGE_VERSION "([0-9.]+)"/\1/p' osx/config.h`
+if test -z "$VERSION" ; then
+ echo "Could not get version from osx/config.h"
+ exit 1
+fi
+
+echo "Version is $VERSION"
+
+set -x
make distclean
rm -Rf /tmp/fish_pkg
-mkdir -p /tmp/fish_pkg/root /tmp/fish_pkg/intermediates /tmp/fish_pkg/dst
+#Exit on error
+set -e
+
+mkdir -p /tmp/fish_pkg/root /tmp/fish_pkg/intermediates /tmp/fish_pkg/dst
xcodebuild install -scheme install_tree -configuration Release DSTROOT=/tmp/fish_pkg/root/
-pkgbuild --scripts build_tools/osx_package_scripts --root /tmp/fish_pkg/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' /tmp/fish_pkg/intermediates/fish.pkg
+pkgbuild --scripts build_tools/osx_package_scripts --root /tmp/fish_pkg/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" /tmp/fish_pkg/intermediates/fish.pkg
productbuild --package-path /tmp/fish_pkg/intermediates --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ ~/fish_built/fish.pkg