Sebastian Kuschel reports that pfd_closing can be called for a socket
[u/mdw/putty] / Buildscr
index 1709131..e9dc295 100644 (file)
--- a/Buildscr
+++ b/Buildscr
@@ -5,20 +5,24 @@ module putty
 
 # Set up the arguments for the main make command.
 set Makever -DSVN_REV=$(revision)
+ifneq "$(!numeric $(revision))" "yes" set Makever $(Makever) -DMODIFIED
 ifneq "$(RELEASE)" "" set Makever $(Makever) -DRELEASE=$(RELEASE)
+ifneq "$(PRERELEASE)" "" set Makever $(Makever) -DPRERELEASE=$(PRERELEASE)
 ifneq "$(date)" "" set Makever $(Makever) -DSNAPSHOT=$(date)
 set Makeargs VER="$(Makever)"
-ifneq "$(XFLAGS)" "" set Makeargs $(makeargs) XFLAGS="$(XFLAGS)"
-ifneq "$(MAKEARGS)" "" set Makeargs $(makeargs) $(MAKEARGS)
+ifneq "$(XFLAGS)" "" set Makeargs $(Makeargs) XFLAGS="$(XFLAGS)"
+ifneq "$(MAKEARGS)" "" set Makeargs $(Makeargs) $(MAKEARGS)
 
 # Set up the version string for the docs build.
 set Docmakeargs VERSION="PuTTY revision $(revision)"
 ifneq "$(RELEASE)" "" set Docmakeargs VERSION="PuTTY release $(RELEASE)"
-ifneq "$(date)" "" set Docmakeaargs VERSION="PuTTY development snapshot $(date)"
+ifneq "$(PRERELEASE)" "" set Docmakeargs VERSION="PuTTY pre-release $(PRERELEASE):r$(revision)"
+ifneq "$(date)" "" set Docmakeargs VERSION="PuTTY development snapshot $(date)"
 
 # Set up the version string for the Unix source archive.
 set Unxver r$(revision)
 ifneq "$(RELEASE)" "" set Unxver $(RELEASE)
+ifneq "$(PRERELEASE)" "" set Unxver $(PRERELEASE)pre $(revision)
 ifneq "$(date)" "" set Unxver $(date)
 
 # Set up the various version strings for the installer.
@@ -32,16 +36,15 @@ ifneq "$(RELEASE)" "" set Iname PuTTY version $(RELEASE)
 ifneq "$(RELEASE)" "" set Ivertext Release $(RELEASE)
 ifneq "$(RELEASE)" "" set Irev 0
 ifneq "$(RELEASE)" "" set Ifilename putty-$(RELEASE)-installer.exe
+ifneq "$(PRERELEASE)" "" set Iversion $(PRERELEASE):r$(revision)
+ifneq "$(PRERELEASE)" "" set Iname PuTTY pre-release $(PRERELEASE):r$(revision)
+ifneq "$(PRERELEASE)" "" set Ivertext Pre-release $(PRERELEASE):r$(revision)
+ifneq "$(PRERELEASE)" "" set Ifilename putty-$(PRERELEASE)-pre$(revision)-installer.exe
 ifneq "$(date)" "" set Iversion $(date):r$(revision)
 ifneq "$(date)" "" set Iname PuTTY development snapshot $(date):r$(revision)
 ifneq "$(date)" "" set Ivertext Development snapshot $(date):r$(revision)
 ifneq "$(date)" "" set Ifilename putty-$(date)-installer.exe
 
-# Set up the version string for the installer.
-set Iversion r$(revision)
-ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
-ifneq "$(date)" "" set Iversion $(date):r$(revision)
-
 in putty do ./mksrcarc.sh
 in putty do ./mkunxarc.sh $(Unxver)
 in putty do perl mkfiles.pl
@@ -55,6 +58,9 @@ in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(VersionInfoTextVersi
 in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVersion=).*$$/$$1$$a/' '$(Iversion)' putty.iss
 in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;$$a=~s/M//;}s/^(VersionInfoVersion=\d+\.\d+\.)\d+(\.\d+)\r?$$/$$1$$a$$2/' '$(Irev)' putty.iss
 
+# Windowsify LICENCE, since it's going in the Windows installer.
+in putty do perl -i~ -pe 'y/\015//d;s/$$/\015/' LICENCE
+
 delegate windows
   # FIXME: Cygwin alternative?
   in putty/windows do cmd /c vcvars32 \& nmake -f Makefile.vc $(Makeargs)
@@ -73,32 +79,42 @@ in putty/doc do make $(Docmakeargs)
 in putty/windows do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../doc/putty.chm ../doc/putty.hlp ../doc/putty.cnt
 in putty/doc do zip puttydoc.zip *.html
 
-deliver putty/windows/*.exe x86/$@
-deliver putty/windows/putty.zip x86/$@
-deliver putty/windows/Output/setup.exe x86/$(Ifilename)
-deliver putty/doc/puttydoc.zip $@
-deliver putty/doc/putty.chm $@
-deliver putty/doc/putty.hlp $@
-deliver putty/doc/putty.cnt $@
-deliver putty/doc/puttydoc.txt $@
-deliver putty/doc/*.html htmldoc/$@
-deliver putty/putty-src.zip $@
-deliver putty/*.tar.gz $@
-
-# Building the md5sums file is most easily done in the destination
-# directory.
-in-dest . do md5sum `\find * -type f -print` > md5sums
+# Deliver the actual PuTTY release directory into a subdir `putty'.
+deliver putty/windows/*.exe putty/x86/$@
+deliver putty/windows/putty.zip putty/x86/$@
+deliver putty/windows/Output/setup.exe putty/x86/$(Ifilename)
+deliver putty/doc/puttydoc.zip putty/$@
+deliver putty/doc/putty.chm putty/$@
+deliver putty/doc/putty.hlp putty/$@
+deliver putty/doc/putty.cnt putty/$@
+deliver putty/doc/puttydoc.txt putty/$@
+deliver putty/doc/*.html putty/htmldoc/$@
+deliver putty/putty-src.zip putty/$@
+deliver putty/*.tar.gz putty/$@
 
-# Now deliver the map files _after_ we do that, so we don't md5sum
-# them gratuitously.
+# Deliver the map files alongside the `proper' release deliverables.
 deliver putty/windows/*.map maps-x86/$@
 
+# Deliver sign.sh, so that whoever has just built PuTTY (the
+# snapshot scripts or me, depending) can conveniently sign it with
+# whatever key they want.
+deliver putty/sign.sh $@
+
+# Create files of cryptographic checksums, which will be signed along
+# with the files they verify. We've provided MD5 checksums for a
+# while, but now MD5 is looking iffy, we're expanding our selection.
+#
+# Creating these files is most easily done in the destination
+# directory, where all the files we're delivering are already in their
+# final relative layout.
+in-dest putty do a=`\find * -type f -print`; md5sum $$a > md5sums && sha1sum $$a > sha1sums && sha256sum $$a > sha256sums && sha512sum $$a > sha512sums
+
 # And construct .htaccess files. One in the top-level directory,
 # setting the MIME types for Windows help files and providing an
 # appropriate link to the source archive:
-in-dest . do echo "AddType application/octet-stream .chm" >> .htaccess
-in-dest . do echo "AddType application/octet-stream .hlp" >> .htaccess
-in-dest . do echo "AddType application/octet-stream .cnt" >> .htaccess
-in-dest . do set -- putty*.tar.gz; for k in '' .DSA .RSA; do echo RedirectMatch temp '(.*/)'putty.tar.gz$$k '$$1'"$$1$$k" >> .htaccess; done
+in-dest putty do echo "AddType application/octet-stream .chm" >> .htaccess
+in-dest putty do echo "AddType application/octet-stream .hlp" >> .htaccess
+in-dest putty do echo "AddType application/octet-stream .cnt" >> .htaccess
+in-dest putty do set -- putty*.tar.gz; for k in '' .DSA .RSA; do echo RedirectMatch temp '(.*/)'putty.tar.gz$$k\$$ '$$1'"$$1$$k" >> .htaccess; done
 # And one in the x86 directory, providing a link for the installer.
-in-dest x86 do set -- putty*installer.exe; for k in '' .DSA .RSA; do echo RedirectMatch temp '(.*/)'putty-installer.exe$$k '$$1'"$$1$$k" >> .htaccess; done
+in-dest putty/x86 do set -- putty*installer.exe; for k in '' .DSA .RSA; do echo RedirectMatch temp '(.*/)'putty-installer.exe$$k\$$ '$$1'"$$1$$k" >> .htaccess; done