Switch to using automake for the Unix autoconfigured build.
[u/mdw/putty] / mkunxarc.sh
1 #!/bin/bash
2
3 # Build a Unix source distribution from the PuTTY CVS area.
4 #
5 # Pass an argument of the form `2004-02-08' to have the archive
6 # tagged as a development snapshot; of the form `0.54' to have it
7 # tagged as a release; of the form `r1234' to have it tagged as a
8 # custom build. Otherwise it'll be tagged as unidentified.
9
10 case "$1" in
11 ????-??-??)
12 case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac
13 autoconfver="`cat LATEST.VER`-$1"
14 arcsuffix="-$autoconfver"
15 ver="-DSNAPSHOT=$1"
16 docver=
17 ;;
18 r*)
19 autoconfver="$1"
20 arcsuffix="-$autoconfver"
21 ver="-DSVN_REV=${1#r}"
22 docver=
23 ;;
24 '')
25 autoconfver="X.XX" # got to put something in here!
26 arcsuffix=
27 ver=
28 docver=
29 ;;
30 *)
31 case "$1" in *[!.0-9a-z]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
32 autoconfver="$1"
33 arcsuffix="-$autoconfver"
34 ver="-DRELEASE=$1"
35 docver="VERSION=\"PuTTY release $1\""
36 ;;
37 esac
38
39 perl mkfiles.pl
40 (cd doc && make -s ${docver:+"$docver"})
41
42 relver=`cat LATEST.VER`
43 arcname="putty$arcsuffix"
44 mkdir uxarc
45 mkdir uxarc/$arcname
46 find . -name uxarc -prune -o \
47 -name CVS -prune -o \
48 -name .svn -prune -o \
49 -name . -o \
50 -type d -exec mkdir uxarc/$arcname/{} \;
51 find . -name uxarc -prune -o \
52 -name CVS -prune -o \
53 -name .cvsignore -prune -o \
54 -name .svn -prune -o \
55 -name configure.ac -prune -o \
56 -name '*.zip' -prune -o \
57 -name '*.tar.gz' -prune -o \
58 -type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
59 if test "x$ver" != "x"; then
60 (cd uxarc/$arcname;
61 md5sum `find . -name '*.[ch]' -print` > manifest;
62 echo "$ver" > version.def)
63 fi
64 sed "s/^AC_INIT(putty,.*/AC_INIT(putty, $autoconfver)/" unix/configure.ac > uxarc/$arcname/unix/configure.ac
65 (cd uxarc/$arcname && sh mkauto.sh) 2>errors || { cat errors >&2; exit 1; }
66
67 tar -C uxarc -chzof $arcname.tar.gz $arcname
68 rm -rf uxarc