aboutsummaryrefslogtreecommitdiff
path: root/makedist.sh
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-05-15 10:58:09 +0000
committerSimon Tatham <anakin@pobox.com>2005-05-15 10:58:09 +0000
commit3dfeadd7389c0dc7b54be7ab3ad201ea6b98b5b4 (patch)
treeae5e5ea38e415d7ffe4ad5e0b690dfc44dd681bc /makedist.sh
parent1add9dcc1bd28f86d9e3f6582e0d43ecbcd88301 (diff)
downloadpuzzles-3dfeadd7389c0dc7b54be7ab3ad201ea6b98b5b4.zip
puzzles-3dfeadd7389c0dc7b54be7ab3ad201ea6b98b5b4.tar.gz
puzzles-3dfeadd7389c0dc7b54be7ab3ad201ea6b98b5b4.tar.bz2
puzzles-3dfeadd7389c0dc7b54be7ab3ad201ea6b98b5b4.tar.xz
Er, except that I already had a makedist.sh. Transferred new version
code into that! [originally from svn r5783]
Diffstat (limited to 'makedist.sh')
-rwxr-xr-xmakedist.sh41
1 files changed, 38 insertions, 3 deletions
diff --git a/makedist.sh b/makedist.sh
index f858dea..ee83275 100755
--- a/makedist.sh
+++ b/makedist.sh
@@ -1,9 +1,37 @@
#!/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`
+ if test "x$rev" = "xexported"; then rev=; fi
+ ;;
+ *)
+ 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
mkdir tmp.$$
-mkdir tmp.$$/puzzles
+mkdir tmp.$$/puzzles$arcsuffix
# Build Windows Help and text versions of the manual for convenience.
halibut --winhelp=puzzles.hlp --text=puzzles.txt puzzles.but
@@ -14,9 +42,16 @@ halibut --text=HACKING HACKING.but
for i in *.c *.m *.h *.but *.plist *.icns LICENCE README Recipe \
mkfiles.pl Makefile Makefile.* \
HACKING puzzles.txt puzzles.hlp puzzles.cnt; do
- ln -s ../../$i tmp.$$/puzzles
+ ln -s ../../$i tmp.$$/puzzles$arcsuffix
+ if test "x$ver" != "x"; then
+ md5sum $i >> tmp.$$/puzzles$arcsuffix/manifest
+ fi
done
-tar -C tmp.$$ -chzf - puzzles > ../puzzles.tar.gz
+if test "x$ver" != "x"; then
+ echo "$ver" >> tmp.$$/puzzles$arcsuffix/version.def
+fi
+
+tar -C tmp.$$ -chzf - puzzles$arcsuffix > ../puzzles$arcsuffix.tar.gz
rm -rf tmp.$$