Add a mechanism for using autoconf to detect the quirks of Unix systems
[u/mdw/putty] / mkunxarc.sh
CommitLineData
8b4e077f 1#!/bin/sh
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.
8
9case "$1" in
10 ????-??-??)
11 case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac
12 arcsuffix="-`cat LATEST.VER`-$1"
13 ver="-DSNAPSHOT=$1"
3b62690e 14 docver=
8b4e077f 15 ;;
16 '')
17 arcsuffix=
18 ver=
3b62690e 19 docver=
8b4e077f 20 ;;
21 *)
22 case "$1" in *[!.0-9a-z]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
23 arcsuffix="-$1"
24 ver="-DRELEASE=$1"
3b62690e 25 docver="VERSION=\"PuTTY release $1\""
8b4e077f 26 ;;
27esac
28
29perl mkfiles.pl
3b62690e 30(cd doc && make -s ${docver:+"$docver"})
76d3a838 31# Track down automake's copy of install-sh
32cp `aclocal --print-ac-dir | sed 's/aclocal$/automake/'`/install-sh unix/.
33(cd unix && autoreconf && rm -rf aclocal.m4 autom4te.cache)
8b4e077f 34
35relver=`cat LATEST.VER`
36arcname="putty$arcsuffix"
37mkdir uxarc
38mkdir uxarc/$arcname
2ce79856 39find . -name uxarc -prune -o \
40 -name CVS -prune -o \
41 -name .svn -prune -o \
42 -name . -o \
8b4e077f 43 -type d -exec mkdir uxarc/$arcname/{} \;
44find . -name uxarc -prune -o \
45 -name CVS -prune -o \
46 -name .cvsignore -prune -o \
4494be0a 47 -name .svn -prune -o \
8b4e077f 48 -name '*.zip' -prune -o \
49 -name '*.tar.gz' -prune -o \
50 -type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
51if test "x$ver" != "x"; then
52 (cd uxarc/$arcname;
53 md5sum `find . -name '*.[ch]' -print` > manifest;
54 echo "$ver" > version.def)
55fi
a8a420c5 56tar -C uxarc -chzof $arcname.tar.gz $arcname
8b4e077f 57rm -rf uxarc