2011-07-18 02:17:53 +04:00
|
|
|
#!/bin/bash
|
2004-02-07 21:14:53 +03:00
|
|
|
|
|
|
|
# Build a Unix source distribution from the PuTTY CVS area.
|
|
|
|
#
|
|
|
|
# Pass an argument of the form `2004-02-08' to have the archive
|
|
|
|
# tagged as a development snapshot; of the form `0.54' to have it
|
2007-02-05 15:49:24 +03:00
|
|
|
# tagged as a release; of the form `r1234' to have it tagged as a
|
|
|
|
# custom build. Otherwise it'll be tagged as unidentified.
|
2004-02-07 21:14:53 +03:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
????-??-??)
|
|
|
|
case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac
|
Switch to using automake for the Unix autoconfigured build.
mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.
Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).
The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.
[originally from svn r9239]
2011-07-23 15:33:29 +04:00
|
|
|
autoconfver="`cat LATEST.VER`-$1"
|
|
|
|
arcsuffix="-$autoconfver"
|
2004-02-07 21:14:53 +03:00
|
|
|
ver="-DSNAPSHOT=$1"
|
2007-02-05 15:49:24 +03:00
|
|
|
docver=
|
|
|
|
;;
|
|
|
|
r*)
|
Switch to using automake for the Unix autoconfigured build.
mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.
Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).
The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.
[originally from svn r9239]
2011-07-23 15:33:29 +04:00
|
|
|
autoconfver="$1"
|
|
|
|
arcsuffix="-$autoconfver"
|
2011-07-18 02:17:53 +04:00
|
|
|
ver="-DSVN_REV=${1#r}"
|
2004-12-18 14:34:41 +03:00
|
|
|
docver=
|
2004-02-07 21:14:53 +03:00
|
|
|
;;
|
|
|
|
'')
|
Switch to using automake for the Unix autoconfigured build.
mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.
Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).
The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.
[originally from svn r9239]
2011-07-23 15:33:29 +04:00
|
|
|
autoconfver="X.XX" # got to put something in here!
|
2004-02-07 21:14:53 +03:00
|
|
|
arcsuffix=
|
|
|
|
ver=
|
2004-12-18 14:34:41 +03:00
|
|
|
docver=
|
2004-02-07 21:14:53 +03:00
|
|
|
;;
|
2011-11-26 21:35:21 +04:00
|
|
|
*pre)
|
|
|
|
set -- "${1%pre}" "$2"
|
|
|
|
case "$1" in *[!.0-9a-z~]*) echo "Malformed prerelease ID '$1'">&2;exit 1;;esac
|
|
|
|
case "$2" in *[!.0-9a-z~]*) echo "Malformed prerelease revision '$1'">&2;exit 1;;esac
|
|
|
|
autoconfver="$1~pre$2"
|
|
|
|
arcsuffix="-$autoconfver"
|
|
|
|
ver="-DPRERELEASE=$1 -DSVN_REV=$2"
|
|
|
|
docver="VERSION=\"PuTTY prerelease $1:r$2\""
|
|
|
|
;;
|
2004-02-07 21:14:53 +03:00
|
|
|
*)
|
2011-11-26 21:35:21 +04:00
|
|
|
case "$1" in *[!.0-9a-z~]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
|
Switch to using automake for the Unix autoconfigured build.
mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.
Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).
The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.
[originally from svn r9239]
2011-07-23 15:33:29 +04:00
|
|
|
autoconfver="$1"
|
|
|
|
arcsuffix="-$autoconfver"
|
2004-02-07 21:14:53 +03:00
|
|
|
ver="-DRELEASE=$1"
|
2004-12-18 14:34:41 +03:00
|
|
|
docver="VERSION=\"PuTTY release $1\""
|
2004-02-07 21:14:53 +03:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
perl mkfiles.pl
|
2004-12-18 14:34:41 +03:00
|
|
|
(cd doc && make -s ${docver:+"$docver"})
|
2004-02-07 21:14:53 +03:00
|
|
|
|
|
|
|
relver=`cat LATEST.VER`
|
|
|
|
arcname="putty$arcsuffix"
|
|
|
|
mkdir uxarc
|
|
|
|
mkdir uxarc/$arcname
|
2004-11-17 21:27:04 +03:00
|
|
|
find . -name uxarc -prune -o \
|
|
|
|
-name CVS -prune -o \
|
|
|
|
-name .svn -prune -o \
|
|
|
|
-name . -o \
|
2004-02-07 21:14:53 +03:00
|
|
|
-type d -exec mkdir uxarc/$arcname/{} \;
|
|
|
|
find . -name uxarc -prune -o \
|
|
|
|
-name CVS -prune -o \
|
|
|
|
-name .cvsignore -prune -o \
|
2004-11-16 21:01:39 +03:00
|
|
|
-name .svn -prune -o \
|
Switch to using automake for the Unix autoconfigured build.
mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.
Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).
The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.
[originally from svn r9239]
2011-07-23 15:33:29 +04:00
|
|
|
-name configure.ac -prune -o \
|
2004-02-07 21:14:53 +03:00
|
|
|
-name '*.zip' -prune -o \
|
|
|
|
-name '*.tar.gz' -prune -o \
|
|
|
|
-type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
|
|
|
|
if test "x$ver" != "x"; then
|
|
|
|
(cd uxarc/$arcname;
|
|
|
|
md5sum `find . -name '*.[ch]' -print` > manifest;
|
|
|
|
echo "$ver" > version.def)
|
|
|
|
fi
|
Switch to using automake for the Unix autoconfigured build.
mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.
Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).
The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.
[originally from svn r9239]
2011-07-23 15:33:29 +04:00
|
|
|
sed "s/^AC_INIT(putty,.*/AC_INIT(putty, $autoconfver)/" unix/configure.ac > uxarc/$arcname/unix/configure.ac
|
|
|
|
(cd uxarc/$arcname && sh mkauto.sh) 2>errors || { cat errors >&2; exit 1; }
|
|
|
|
|
2004-08-09 21:01:25 +04:00
|
|
|
tar -C uxarc -chzof $arcname.tar.gz $arcname
|
2004-02-07 21:14:53 +03:00
|
|
|
rm -rf uxarc
|