]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - mkunxarc.sh
Merge r9365 (bump version number to 0.62).
[PuTTY.git] / mkunxarc.sh
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; 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     arcsuffix="-`cat LATEST.VER`-$1"
14     ver="-DSNAPSHOT=$1"
15     docver=
16     ;;
17   r*)
18     arcsuffix="-$1"
19     ver="-DSVN_REV=$1"
20     docver=
21     ;;
22   '')
23     arcsuffix=
24     ver=
25     docver=
26     ;;
27   *pre)
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\""
35     ;;
36   *)
37     case "$1" in *[!.0-9a-z~]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
38     arcsuffix="-$1"
39     ver="-DRELEASE=$1"
40     docver="VERSION=\"PuTTY release $1\""
41     ;;
42 esac
43
44 perl mkfiles.pl
45 (cd doc && make -s ${docver:+"$docver"})
46 sh mkauto.sh 2>/dev/null
47
48 relver=`cat LATEST.VER`
49 arcname="putty$arcsuffix"
50 mkdir uxarc
51 mkdir uxarc/$arcname
52 find . -name uxarc -prune -o \
53        -name CVS -prune -o \
54        -name .svn -prune -o \
55        -name . -o \
56        -type d -exec mkdir uxarc/$arcname/{} \;
57 find . -name uxarc -prune -o \
58        -name CVS -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
65   (cd uxarc/$arcname;
66    md5sum `find . -name '*.[ch]' -print` > manifest;
67    echo "$ver" > version.def)
68 fi
69 tar -C uxarc -chzof $arcname.tar.gz $arcname
70 rm -rf uxarc