3 # Build a Unix source distribution from the PuTTY CVS area.
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.
12 case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac
13 arcsuffix="-`cat LATEST.VER`-$1"
28 set -- "${1%pre}" "$2"
29 case "$1" in *[!.0-9a-z~]*) echo "Malformed prerelease ID '$1'">&2;exit 1;;esac
30 case "$2" in *[!.0-9a-z~]*) echo "Malformed prerelease revision '$1'">&2;exit 1;;esac
31 autoconfver="$1~pre$2"
32 arcsuffix="-$autoconfver"
33 ver="-DPRERELEASE=$1 -DSVN_REV=$2"
34 docver="VERSION=\"PuTTY prerelease $1:r$2\""
37 case "$1" in *[!.0-9a-z~]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
40 docver="VERSION=\"PuTTY release $1\""
45 (cd doc && make -s ${docver:+"$docver"})
46 sh mkauto.sh 2>/dev/null
48 relver=`cat LATEST.VER`
49 arcname="putty$arcsuffix"
52 find . -name uxarc -prune -o \
54 -name .svn -prune -o \
56 -type d -exec mkdir uxarc/$arcname/{} \;
57 find . -name uxarc -prune -o \
59 -name .cvsignore -prune -o \
60 -name .svn -prune -o \
61 -name '*.zip' -prune -o \
62 -name '*.tar.gz' -prune -o \
63 -type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
64 if test "x$ver" != "x"; then
66 md5sum `find . -name '*.[ch]' -print` > manifest;
67 echo "$ver" > version.def)
69 tar -C uxarc -chzof $arcname.tar.gz $arcname