Skip to content

Commit

Permalink
putty import
Browse files Browse the repository at this point in the history
  • Loading branch information
sztupy committed Oct 8, 2010
0 parents commit fcd53e1
Show file tree
Hide file tree
Showing 271 changed files with 146,307 additions and 0 deletions.
31 changes: 31 additions & 0 deletions BE_ALL.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Linking module for PuTTY proper: list the available backends
* including ssh.
*/

#include <stdio.h>
#include "putty.h"

/*
* This appname is not strictly in the right place, since Plink
* also uses this module. However, Plink doesn't currently use any
* of the dialog-box sorts of things that make use of appname, so
* it shouldn't do any harm here. I'm trying to avoid having to
* have tiny little source modules containing nothing but
* declarations of appname, for as long as I can...
*/
const char *const appname = "PuTTY";

#ifdef TELNET_DEFAULT
const int be_default_protocol = PROT_TELNET;
#else
const int be_default_protocol = PROT_SSH;
#endif

Backend *backends[] = {
&ssh_backend,
&telnet_backend,
&rlogin_backend,
&raw_backend,
NULL
};
32 changes: 32 additions & 0 deletions BE_ALL_S.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Linking module for PuTTY proper: list the available backends
* including ssh, plus the serial backend.
*/

#include <stdio.h>
#include "putty.h"

/*
* This appname is not strictly in the right place, since Plink
* also uses this module. However, Plink doesn't currently use any
* of the dialog-box sorts of things that make use of appname, so
* it shouldn't do any harm here. I'm trying to avoid having to
* have tiny little source modules containing nothing but
* declarations of appname, for as long as I can...
*/
const char *const appname = "PuTTY";

#ifdef TELNET_DEFAULT
const int be_default_protocol = PROT_TELNET;
#else
const int be_default_protocol = PROT_SSH;
#endif

Backend *backends[] = {
&ssh_backend,
&telnet_backend,
&rlogin_backend,
&raw_backend,
&serial_backend,
NULL
};
11 changes: 11 additions & 0 deletions BE_NONE.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Linking module for programs that do not support selection of backend
* (such as pscp or pterm).
*/

#include <stdio.h>
#include "putty.h"

Backend *backends[] = {
NULL
};
33 changes: 33 additions & 0 deletions BE_NOSSH.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Linking module for PuTTYtel: list the available backends not
* including ssh.
*/

#include <stdio.h>
#include "putty.h"

const int be_default_protocol = PROT_TELNET;

const char *const appname = "PuTTYtel";

Backend *backends[] = {
&telnet_backend,
&rlogin_backend,
&raw_backend,
NULL
};

/*
* Stub implementations of functions not used in non-ssh versions.
*/
void random_save_seed(void)
{
}

void random_destroy_seed(void)
{
}

void noise_ultralight(unsigned long data)
{
}
34 changes: 34 additions & 0 deletions BE_NOS_S.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Linking module for PuTTYtel: list the available backends not
* including ssh.
*/

#include <stdio.h>
#include "putty.h"

const int be_default_protocol = PROT_TELNET;

const char *const appname = "PuTTYtel";

Backend *backends[] = {
&telnet_backend,
&rlogin_backend,
&raw_backend,
&serial_backend,
NULL
};

/*
* Stub implementations of functions not used in non-ssh versions.
*/
void random_save_seed(void)
{
}

void random_destroy_seed(void)
{
}

void noise_ultralight(unsigned long data)
{
}
113 changes: 113 additions & 0 deletions BUILDSCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# -*- sh -*-
# Build script to construct a full distribution directory of PuTTY.

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 "$(date)" "" set Makever $(Makever) -DSNAPSHOT=$(date)
set Makeargs VER="$(Makever)"
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 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 "$(date)" "" set Unxver $(date)

# Set up the various version strings for the installer.
set Iversion r$(revision)
set Iname PuTTY revision $(revision)
set Ivertext Revision $(revision)
set Irev $(revision)
set Ifilename putty-$(Iversion)-installer.exe
ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
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 "$(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
in putty/doc do make $(Docmakeargs) putty.hlp
in putty/doc do make $(Docmakeargs) chm

# Munge the installer script locally so that it reports the version
# we're really building.
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVerName=).*$$/$$1$$a/' '$(Iname)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(VersionInfoTextVersion=).*$$/$$1$$a/' '$(Ivertext)' putty.iss
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)
# Ignore exit code from hhc, in favour of seeing whether the .chm
# file was created. (Yuck; but hhc appears to return non-zero
# exit codes on whim.)
in putty/doc do hhc putty.hhp; test -f putty.chm
in putty/windows do iscc putty.iss
return putty/windows/*.exe
return putty/windows/*.map
return putty/doc/putty.chm
return putty/windows/Output/setup.exe
enddelegate
in putty/doc do make mostlyclean
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 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/$@

# 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 $@

# Building the md5sums file is most easily done in the destination
# directory.
in-dest putty do md5sum `\find * -type f -print` > md5sums

# 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 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 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
Loading

0 comments on commit fcd53e1

Please sign in to comment.