54e5d4e7 |
1 | #!/bin/sh |
2 | |
eb935f91 |
3 | # Build a Unix source distribution from the Puzzles SVN area. |
4 | # |
5 | # Pass a numeric argument to have the archive tagged as that SVN |
6 | # revision. Otherwise, the script will work it out itself by |
7 | # calling `svnversion', or failing that it will not version-tag the |
8 | # archive at all. |
9 | |
10 | case "$#" in |
11 | 0) |
12 | # Ignore errors; if we can't get a version, we'll have a blank |
13 | # string. |
14 | rev=`svnversion . 2>/dev/null` |
15 | if test "x$rev" = "xexported"; then rev=; fi |
16 | ;; |
17 | *) |
18 | case "$1" in *[!0-9]*) echo "Malformed revision number '$1'">&2;exit 1;;esac |
19 | rev="$1" |
20 | ;; |
21 | esac |
22 | |
23 | if test "x$rev" != "x"; then |
24 | arcsuffix="-r$rev" |
25 | ver="-DREVISION=$rev" |
26 | else |
27 | arcsuffix= |
28 | ver= |
29 | fi |
30 | |
54e5d4e7 |
31 | perl mkfiles.pl |
32 | |
33 | mkdir tmp.$$ |
eb935f91 |
34 | mkdir tmp.$$/puzzles$arcsuffix |
54e5d4e7 |
35 | |
e91825f8 |
36 | # Build Windows Help and text versions of the manual for convenience. |
37 | halibut --winhelp=puzzles.hlp --text=puzzles.txt puzzles.but |
38 | |
d0e5f156 |
39 | # Build a text version of the HACKING document. |
10254186 |
40 | halibut --text=HACKING devel.but |
d0e5f156 |
41 | |
8379e6f5 |
42 | for i in *.c *.m *.h *.R *.but *.plist *.icns LICENCE README Recipe \ |
d0e5f156 |
43 | mkfiles.pl Makefile Makefile.* \ |
44 | HACKING puzzles.txt puzzles.hlp puzzles.cnt; do |
eb935f91 |
45 | ln -s ../../$i tmp.$$/puzzles$arcsuffix |
46 | if test "x$ver" != "x"; then |
47 | md5sum $i >> tmp.$$/puzzles$arcsuffix/manifest |
48 | fi |
54e5d4e7 |
49 | done |
50 | |
eb935f91 |
51 | if test "x$ver" != "x"; then |
52 | echo "$ver" >> tmp.$$/puzzles$arcsuffix/version.def |
53 | fi |
54 | |
55 | tar -C tmp.$$ -chzf - puzzles$arcsuffix > ../puzzles$arcsuffix.tar.gz |
54e5d4e7 |
56 | |
57 | rm -rf tmp.$$ |