aboutsummaryrefslogtreecommitdiff
path: root/mkunxarc.sh
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-05-15 10:52:23 +0000
committerSimon Tatham <anakin@pobox.com>2005-05-15 10:52:23 +0000
commit1add9dcc1bd28f86d9e3f6582e0d43ecbcd88301 (patch)
tree7d92178ddc8c5b0d940ccc9d78700bb132a862ce /mkunxarc.sh
parentc05b4697a8f87e08e52b8014186c647309976fc2 (diff)
downloadpuzzles-1add9dcc1bd28f86d9e3f6582e0d43ecbcd88301.zip
puzzles-1add9dcc1bd28f86d9e3f6582e0d43ecbcd88301.tar.gz
puzzles-1add9dcc1bd28f86d9e3f6582e0d43ecbcd88301.tar.bz2
puzzles-1add9dcc1bd28f86d9e3f6582e0d43ecbcd88301.tar.xz
Added automatic determination of the SVN revision number if a build
takes place in a checked-out copy. Also added mkunxarc.sh which does the same version determination before building its archive. [originally from svn r5782]
Diffstat (limited to 'mkunxarc.sh')
-rwxr-xr-xmkunxarc.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/mkunxarc.sh b/mkunxarc.sh
new file mode 100755
index 0000000..8b6265b
--- /dev/null
+++ b/mkunxarc.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# Build a Unix source distribution from the Puzzles SVN area.
+#
+# Pass a numeric argument to have the archive tagged as that SVN
+# revision. Otherwise, the script will work it out itself by
+# calling `svnversion', or failing that it will not version-tag the
+# archive at all.
+
+case "$#" in
+ 0)
+ # Ignore errors; if we can't get a version, we'll have a blank
+ # string.
+ rev=`svnversion . 2>/dev/null`
+ ;;
+ *)
+ case "$1" in *[!0-9]*) echo "Malformed revision number '$1'">&2;exit 1;;esac
+ rev="$1"
+ ;;
+esac
+
+if test "x$rev" != "x"; then
+ arcsuffix="-r$rev"
+ ver="-DREVISION=$rev"
+else
+ arcsuffix=
+ ver=
+fi
+
+perl mkfiles.pl
+make -s -f Makefile.doc
+
+arcname="puzzles$arcsuffix"
+mkdir uxarc
+mkdir uxarc/$arcname
+find . -name uxarc -prune -o \
+ -name CVS -prune -o \
+ -name '*.app' -prune -o \
+ -name '.[^.]*' -prune -o \
+ -name . -o \
+ -type d -exec mkdir uxarc/$arcname/{} \;
+find . -name uxarc -prune -o \
+ -name CVS -prune -o \
+ -name '.[^.]*' -prune -o \
+ -name '*.app' -prune -o \
+ -name '*.zip' -prune -o \
+ -name '*.tar.gz' -prune -o \
+ -type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
+if test "x$ver" != "x"; then
+ (cd uxarc/$arcname;
+ md5sum `find . -name '*.[ch]' -print` > manifest;
+ echo "$ver" > version.def)
+fi
+tar -C uxarc -chzof $arcname.tar.gz $arcname
+rm -rf uxarc