chiark / gitweb /
Er, except that I already had a makedist.sh. Transferred new version
authorSimon Tatham <anakin@pobox.com>
Sun, 15 May 2005 10:58:09 +0000 (10:58 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 15 May 2005 10:58:09 +0000 (10:58 +0000)
code into that!

[originally from svn r5783]

Recipe
makedist.sh
mkunxarc.sh [deleted file]

diff --git a/Recipe b/Recipe
index c79f9a9c58fc4c180c715dab7086ae1ca9d96af6..6b101949f79ddd951e624a7b93d279f9edd5189f 100644 (file)
--- a/Recipe
+++ b/Recipe
@@ -104,7 +104,7 @@ version.o: FORCE;
 FORCE:
        if test -z "$(VER)" && test -f manifest && md5sum -c manifest; then \
                $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c; \
-       elif test -z "$(VER)" && svnversion . >&/dev/null; then \
+       elif test -z "$(VER)" && test -d .svn && svnversion . >&/dev/null; then \
                $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c; \
        else \
                $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c; \
@@ -119,7 +119,7 @@ version.o: FORCE;
 FORCE:
        if test -z "$(VER)" && test -f manifest && (md5 -r `awk '{print $$2}' manifest` | diff -w manifest -); then \
                $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c; \
-       elif test -z "$(VER)" && svnversion . >&/dev/null; then \
+       elif test -z "$(VER)" && test -d .svn && svnversion . >&/dev/null; then \
                $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c; \
        else \
                $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c; \
index f858dea8cdec333454df0781274c71d8da53cef3..ee832758e6aaba440f5c98e567688e583d27fe9b 100755 (executable)
@@ -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.$$
diff --git a/mkunxarc.sh b/mkunxarc.sh
deleted file mode 100755 (executable)
index 8b6265b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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