#!/bin/bash
#
# v1.2.1 Build 1
# -Modify /etc/rc.d/init.d/halt
# -Customize enlightenment menu for security server
#
# -Added admsmb - ftp://freelsd.net/
# -Added admsnmp - ftp://freelsd.net/
# -Added autopsy - http://www.sleuthkit.org/
# -Added bfbtester - http://bfbtester.sourceforge.net/
# -Added bruth - http://bruth.sourceforge.net/
# -Added bsed - http://www1.bell-labs.com/project/wwexptools/bsed/
# -Added ccrypt - http://quasar.mathstat.uottawa.ca/~selinger/ccrypt/
# -Added cflow - http://net.doit.wisc.edu/~plonka/Cflow/
# -Added cgrep - http://www1.bell-labs.com/project/wwexptools/cgrep/
# -Added cheops - http://www.marko.net/cheops/
# -Added cscope - http://cscope.sourceforge.net/
# -Added curl - http://freshmeat.net/projects/curl/
# -Added Dillo - http://www.dillo.org/
# -Added disco - http://www.altmode.com/disco/
# -Added echoping - http://echoping.sourceforge.net/
# -Added ettercap-gtk - http://www.dnetc.org/?s=ettercap
# -Added foremost - http://foremost.sourceforge.net/
# -Added hlfl - http://www.hlfl.org/
# -Added ipsorc - http://sorcerer.mirrors.pair.com/sources/ipsorcery/1.7.5/
# -Added isnprober - ftp://ftp.ubizen.com/tools/isnprober-1.01.tgz
# -Added itunnel - http://fux0r.phathookups.com/tools/covert-channels/itunnel/
# -Added knocker - http://knocker.sourceforge.net/
# -Added gtk-knocker - http://knocker.sourceforge.net/
# -Added l2tpd - http://freshmeat.net/projects/l2tpd/
# -Added binary of lde - http://freshmeat.net/projects/lde/
# -Added LinNeighborhood - http://www.bnro.de/~schmidjo/
# -Added ltrace - http://freshmeat.net/projects/ltrace/?topic_id=846%2C47
# -Added macchanger - http://freshmeat.net/projects/macchanger/
# -Added md5deep - http://md5deep.sourceforge.net/
# -Added mtr - http://freshmeat.net/projects/mtr/
# -Added nstreams - http://freshmeat.net/projects/nstreams/
# -Added ntfsprogs - ntfsdriver - http://linux-ntfs.sourceforge.net/, ntfstools - http://linux-ntfs.sourceforge.net/
# -Added onesixtyone - http://freshmeat.net/projects/onesixtyone/
# -Added pasmal - https://sourceforge.net/projects/pasmal/
# -Added pptpd -
# -Added pwl9x - http://freshmeat.net/projects/pwl9x/
# -Added rats - http://www.cisecurity.org/bench_cisco.html
# -Added rda - http://md5sa.com/downloads/rda/index.htm
# -Added rdesktop - http://www.rdesktop.org/
# -Added revinetd - http://sourceforge.net/projects/revinetd/
# -Added scanerrlog - http://freshmeat.net/projects/scanerrlog/
# -Added scanlogd - http://www.openwall.com/scanlogd/
# -Added scli - http://www.ibr.cs.tu-bs.de/projects/scli/
# -Added slogdump - http://www.md5sa.com/downloads/slogdump/
# -Added rrdtool - http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
# -Added snapscreenshot - http://freshmeat.net/projects/snapscreenshot/
# -Added splint - http://lclint.cs.virginia.edu/
# -Added ssldump - http://freshmeat.net/projects/ssldump/
# -Added tcptraceroute - http://freshmeat.net/projects/tcptraceroute/
# -Added thcrut - www.thc.org/thc-rut/
# -Added transproxy - http://freshmeat.net/projects/transproxy/
# -Added tsocks - http://freshmeat.net/projects/tsocks/
# -Added valgrind - http://developer.kde.org/~sewardj/
# -Added vnc - http://www.uk.research.att.com/vnc/
# -Added DNSSEC walker - http://josefsson.org/walker/
# -Added warscan - http://razor.bindview.com/tools/desc/WarScan_readme.html
# -Added angst - http://angst.sourceforge.net/
# -Added clamav - http://clamav.elektrapro.com/
# -Added farpd - http://packages.debian.org/unstable/net/farpd.html 
# -Added login_hacker - http://www.thc.org/
# -Added mysql - Fix gpsdrive to work
# -Added mrtg - http://mrtg.hdl.com/mrtg.html
# -Added vlad - http://razor.bindview.com/tools/vlad/index.shtml
# -Added icmpinfo - http://www.openbsd.org/2.8_packages/sparc/icmpinfo-1.11.tgz-long.html
# -Added vomit - http://vomit.xtdnet.nl/
# -Added tcpslice - http://sourceforge.net/projects/tcpslice/
# -Added rarpd - http://packages.debian.org/testing/net/rarpd.html
# -Added wipe - http://freshmeat.net/projects/wipe/ (Need to download source)
# -Added icmpush - http://freshmeat.net/projects/icmpush/
# -Added swatch - http://swatch.sourceforge.net/
# -Added tk and updated tcl to 8.4.5
###
#arptool - http://users.hotlink.com.br/lincoln/arptool/ (compiling problems)
#atmelwlandriver - http://atmelwlandriver.sourceforge.net/news.html (don't feel like trying right now)
#bass - http://www.securityfocus.com/tools/394 (don't know if source code is legit)
#cryptcat - http://sourceforge.net/projects/cryptcat/ (compiling problems)
#etherape - http://freshmeat.net/projects/etherape/ (needed gnome libraries)
#gkismet - http://gkismet.sourceforge.net/  (needs gtk library)
#gpa - http://www.gnupg.org/(en)/related_software/gpa/index.html
#grenzgaenger
#gtkrecover - http://freshmeat.net/projects/gtkrecover/
#     http://freshmeat.net/redir/gtkrecover/3903/url_homepage/recover
#idsa / idsaguardgtk - http://jade.cs.uct.ac.za/idsa/
# lcrzoex (aka netwox) - http://freshmeat.net/projects/lcrzoex/
#ntreg - http://razor.bindview.com/tools/index.shtml (Doesn't compile.  Looking for filldir function)
#mieliekoek.pl - http://packetstormsecurity.nl/UNIX/security/mieliekoek.pl
#nast - http://www.aimsniff.com/about.html
#numby
#obiwan
#objobf - http://freshmeat.net/projects/objobf/
#ol2mbox -  http://freshmeat.net/redir/libpst/20789/url_homepage/ol2mbox
#photorec - http://www.cgsecurity.org/index.html?photorec.html
#pv - http://packages.debian.org/unstable/utils/pv.html
#redir
#scansort - http://www.geocities.com/SouthBeach/Pier/3193/scansort.html (look like a windows file)
#secpanel - http://freshmeat.net/projects/secpanel/ (requires 'wish')
#sharefuzz - http://freshmeat.net/projects/sharefuzz/
#shiva - http://freshmeat.net/projects/shiva/ (Java.  Not doing this right now)
#smokeping - http://people.ee.ethz.ch/~oetiker/webtools/smokeping/ (Needs a web server)
#snort - http://www.snort.org/
#speak-freely
#spike -  http://freshmeat.net/projects/spike/
#spikeproxy - http://www.immunitysec.com/spikeproxy_downloads.html
#testdisk - http://www.cgsecurity.org/index.html?testdisk.html (need libreiserfs)
#wellenreiter - http://www.wellenreiter.net/ (need to download more files)
#zodiac  http://www.team-teso.net/projects/zodiac/ (compiling problems)
#fenris - http://razor.bindview.com/tools/fenris/ (glibc is still stripped)
#
#
#
#
# v1.2.0 Build 1
# -Kernel 2.4.24 now being used.
# -Added java
# -Added mozilla
#
#
#
# v1.1.1 Build 1
# -Added biew
# -Added idswakeup
# -Added secure_delete
# -Added /readme directory
# -Added chkrootkit
# -Added dos2unix
# -Added gnupg
# -Added fatback
# -Added macrobber
# -Added httptunnel
# -Added midnight commander
# -Added memfetch
# -Added paketto
# -Added vmap
# -Added libmcrypt
# -Added libmhash
# -Added libjpeg
# -Added steghide
# -Added stegdetect
# -Added pptp
# -Added cabextract
# -Added cmospwd
# -Added aide
# -Added dlint
# -Added netsed
# -Added scanssh
# -Added recover
# -Added libxml2
# -Added hammerhead
# -Added pnscan
# -Added sendip
# -Added socat
# -Added tcpflow
# -Added dcfldd
# -Added dnswalk
# -Added dcetest
# -Added tcptrace
# -Added argus
# -Added arping
# -Added ddrescue
# -Added darkstat
# -Added sing
# -Added hackbot
#
#
# v1.1.0 Build 2
# -Brought the serviceprovider build function up-to-date
#
#
#
# v1.1.0 Build 1
# -So in the end it was the SMP that was giving me problems with
#  the wireless drivers. I guess they aren't ready for SMP yet.
# -Now kernel 2.4.23 is out, so I'm moving onto that.
#  Added function makekernel2423 
#  Added function makefreeswan204with2423
#  Added function installkernelheaders2423
#  Added function makeacx100binary20030716with2423
#  Added function makelinuxmanpages2423
#  Added function makerp35with2423
#  Added function makeiptables129with2423
# -Added linux-wlan-ng drivers 0.2.1 pre9
# -Added sniffit 0.3.5
# -Added IPTraf 2.7.0
# -Added SleuthKit 1.66
# -Added fping 2.4b2ipv6
# -Added raccess 0.7
#
#
#
# v1.0.1 Build 9
# -Well, kernel 2.4.22 and 2.4.21 flopped big time when trying
#  to work with the acx100 drivers.  I know 2.4.20 works, so
#  I'm going back to that.
#
#
# v1.0.1 Build 8
# -Added PCI Utilities version 2.1.11
# -Changed kernel back to 2.4.21 because 2.4.22 seems to have some
#  wireless difficulties.
# -Added detection of various 3com cards and SiS900 network cards
# -Added pcmcia utilities 3.2.5
#
#
#
# v1.0.1 Build 7
# -Added testing routines for security server
#
# v1.0.1 Build 6
# -General clean and beautification
#
#
# v1.0.1 Build 5
# -Move all packages out of /usr/local and create an init script
# that finds the first ext2 partition with the label /usr/local
# and mounts it.   Also in same init script, a section that
# finds the first ext2 partition with the label /etc and mounts it.
# 
# -Changed tct to version 1.12
# -Added startup script and system config file for gpsd
# -Added mpg123 for music on those long, lonely forensic analysis jobs...
# -Added sharutils 4.2.1
# -Added madwifi-20030802 for supporting my Orinoco Gold b/g 
# -Added syslog-ng 1.5.26
# -Changed the acx100 binary drivers to 20030716
# -Changed the acx100 source drivers to 0.1h
# -Added strace 4.4.98
# -Modified libgmp build so that it is optimized for 386, and then
# the user can modify ld.so.conf as needed to point to the other gmp
# directories.
# -Added ip 2.2.47 (freeswan could never actually work without this...duh!)
# -Removed openssh and stunnel default private keys
#
#
#
# 
# v1.0.1 Build 4
# Changed pine to version 4.58
# Changed linux kernel to version  2.4.22
# Changed xinetd to version 2.3.12
# Changed freeswan to version 2.03
# Changed nmap to version 3.48
# Changed nbtscan to version 1.51
# Changed stunnel to version 4.04
# Changed screen to version 4.01
# Changed ethereal to version 0.9.15
# Changed net-snmp to version 5.0.9
# Changed ngrep to version 1.41
# Changed bind to version 9.2.2p3
# Changed ettercap to version 0.6.b
# Changed lsof to version 4.68
# Changed openssh to version 3.7.1p2
# Changed samba to version 3.0.0
# Changed openssl to version 0.9.7c
# Changed tcpreplay to version 1.4.5
# Changed nessus to version 2.0.8a
# Changed amap to version 4.3
# Changed hydra to version 2.4
#
#
#
# v1.0.1 Build 3
# Changed man to version 1.5m2
# Changed procps to version 3.1.13
# Changed gawk to version 3.1.3
# Changed e2fsprogs to version 1.34
# Changed file to version 4.05
# Changed gettext to version 0.12.1
# Changed bin86 to version 0.16.13
# Changed psmisc to version 21.3
# Changed automake to version 1.7.7
# Changed perl to version 5.8.1
# Changed which to version 2.16
# Changed lilo to version 22.5.7.2
# Changed whois to version 4.6.7
# Changed nasm to version 0.98.38
#
#
# v1.0.1 Build 2
# Changed findutils to version 4.1.20
# Changed texinfo to version 4.6
# Changed util-linux to version 2.12
#
#
# v1.0.1 Build 1
# Changed binutils to 2.14 version
#
# v1.0.0
# Initial build that works 
#


#Sat Jul 19 00:15:38, added command to not build static 
#library for libgtk-1.2.9

TPMSRCDIR=/mnt/ms/drivee/thepacketmaster
TPMSRC=$TPMSRCDIR/thepacketmaster-src.tar
TPMBUILD=/var/tmp/tpm
TPMSTATIC=$TPMBUILD/static
TPMBUILDLOGFILE=/buildlog.txt
TPMBUILDLOG=$TPMBUILD$TPMBUILDLOGFILE
#Turn off debugging symbols
CC="gcc -s"
export TPMBUILD TPMSTATIC CC

#This is required for X-windows to install properly
export HOME="/root"



###
###
### This section is the beginning of all the various new make functions.
###
### These functions build the package and then clean up the unnecessary files.
### If any errors are encountered, the function should exit with a -1 value.
### 
###


cleanpine458() {
	rm -vf /usr/bin/pine /usr/bin/pilot /usr/bin/pico 
	rm -vf /usr/bin/mtest /usr/bin/imapd /usr/bin/rpdump
	rm -vf /usr/bin/rpload /usr/bin/mailutil /usr/bin/ipop2d
	rm -vf /usr/bin/ipop3d
	rm -vf /license/pine-CPYRIGHT
}

makepine458() {
	logmessage2 "Making pine..."
	if [ ! -f $TPMSRCDIR/pine4.58.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pine4.58.tar.gz
	cd pine4.58
	./build SSLDIR=/usr/ssl EXTRACFLAGS=-s slx
	cp bin/* /usr/bin/
	cp CPYRIGHT /license/pine-CPYRIGHT
	cd ..
	if [ ! -f /usr/bin/pine ] ; then exit; fi
	if [ ! -f /usr/bin/pilot ] ; then exit; fi
	if [ ! -f /usr/bin/pico ] ; then exit; fi
	rm -rf pine4.58
	logmessage2 "Done pine"
}

makewget191() {
	logmessage2 "Making wget..."
	cp $TPMSRCDIR/wget-1.9.1.tar.gz /
	if [ ! -f wget-1.9.1.tar.gz ] ; then exit; fi
	tar -zxvf wget-1.9.1.tar.gz
	cd wget-1.9.1
	./configure --prefix=/usr --with-ssl=/usr/ssl
	if [ $? -ne 0 ]; then echo "Error configuring wget"; exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making wget"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing wget"; exit -1; fi
	cd ..
	if [ ! -f /usr/bin/wget ] ; then exit; fi
	rm -rf wget-1.9.1.tar.gz wget-1.9.1
	logmessage2 "Done wget"
}

#James, if you're changing the kernel, don't forget the routines
# installkernelheaders, makefreeswan, makeacx100,  makemadwifi, makerp
# makeiptables, makelinuxmanpages
makekernel2424() {
	echo "Make kernel..."
	if [ ! -f linux-2.4.24.tar.gz ] ; then exit -1; fi
	if [ ! -f config-2424-20040105  ] ; then exit -1; fi
	tar -zxvf linux-2.4.24.tar.gz
	chown -R 0:0 linux-2.4.24
	cd linux-2.4.24
	cp COPYING /license/linux-COPYING
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper"; exit -1; fi
	make clean
	if [ $? -ne 0 ]; then echo "Error making clean"; exit -1; fi
	cp ../config-2424-20040105 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then echo "Error making oldconfig"; exit -1; fi
	make dep
	if [ $? -ne 0 ]; then echo "Error making dep"; exit -1; fi
	make bzImage
	if [ $? -ne 0 ]; then echo "Error making bzImage"; exit -1; fi
	make modules
	if [ $? -ne 0 ]; then echo "Error making modules"; exit -1; fi
	make modules_install
	if [ $? -ne 0 ]; then echo "Error installing modules"; exit -1; fi
	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	cd ..
	depmod -a 2.4.24

	#rm -rf linux-2.4.24
	echo "Done"
}

#James, if you're changing the kernel, don't forget the routines
# installkernelheaders, makefreeswan, makeacx100,  makemadwifi, makerp
# makeiptables, makelinuxmanpages
makekernel2423() {
	echo "Make kernel..."
	if [ ! -f linux-2.4.23.tar.gz ] ; then exit -1; fi
	if [ ! -f config-2423-20031130  ] ; then exit -1; fi
	tar -zxvf linux-2.4.23.tar.gz
	chown -R 0:0 linux-2.4.23
	cd linux-2.4.23
	cp COPYING /license/linux-COPYING
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper"; exit -1; fi
	make clean
	if [ $? -ne 0 ]; then echo "Error making clean"; exit -1; fi
	cp ../config-2423-20031130 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then echo "Error making oldconfig"; exit -1; fi
	make dep
	if [ $? -ne 0 ]; then echo "Error making dep"; exit -1; fi
	make bzImage
	if [ $? -ne 0 ]; then echo "Error making bzImage"; exit -1; fi
	make modules
	if [ $? -ne 0 ]; then echo "Error making modules"; exit -1; fi
	make modules_install
	if [ $? -ne 0 ]; then echo "Error installing modules"; exit -1; fi
	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	cd ..
	depmod -a 2.4.23

	#rm -rf linux-2.4.23
	echo "Done"
}




#James, if you're changing the kernel, don't forget the routines
# installkernelheaders, makefreeswan, makeacx100,  makemadwifi, makerp
# makeiptables, makelinuxmanpages
makekernel2422() {
	echo "Make kernel..."
	if [ ! -f linux-2.4.22.tar.gz ] ; then exit -1; fi
	if [ ! -f config1-20031118  ] ; then exit -1; fi
	tar -zxvf linux-2.4.22.tar.gz
	chown -R 0:0 linux-2.4.22
	cd linux-2.4.22
	cp COPYING /license/linux-COPYING
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper"; exit -1; fi
	make clean
	if [ $? -ne 0 ]; then echo "Error making clean"; exit -1; fi
	cp ../config1-20031118 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then echo "Error making oldconfig"; exit -1; fi
	make dep
	if [ $? -ne 0 ]; then echo "Error making dep"; exit -1; fi
	make bzImage
	if [ $? -ne 0 ]; then echo "Error making bzImage"; exit -1; fi
	make modules
	if [ $? -ne 0 ]; then echo "Error making modules"; exit -1; fi
	make modules_install
	if [ $? -ne 0 ]; then echo "Error installing modules"; exit -1; fi
	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	cd ..
	depmod -a 2.4.22

	rm -rf linux-2.4.22
	echo "Done"
}


#James, if you're changing the kernel, don't forget the routines
# installkernelheaders, makefreeswan, makeacx100,  makemadwifi, makerp
# makeiptables, makelinuxmanpages
makekernel2421() {
	echo "Make kernel..."
	if [ ! -f iw241_we16-6.diff ] ; then exit; fi
	if [ ! -f linux-2.4.21.tar.gz ] ; then exit -1; fi
	if [ ! -f config-2421-20031122  ] ; then exit -1; fi
	tar -zxvf linux-2.4.21.tar.gz
	chown -R 0:0 linux-2.4.21
	cd linux-2.4.21
	patch -Np1 -i ../iw241_we16-6.diff
	cp COPYING /license/linux-COPYING
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper"; exit -1; fi
	make clean
	if [ $? -ne 0 ]; then echo "Error making clean"; exit -1; fi
	cp ../config-2421-20031122 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then echo "Error making oldconfig"; exit -1; fi
	make dep
	if [ $? -ne 0 ]; then echo "Error making dep"; exit -1; fi
	make bzImage
	if [ $? -ne 0 ]; then echo "Error making bzImage"; exit -1; fi
	make modules
	if [ $? -ne 0 ]; then echo "Error making modules"; exit -1; fi
	make modules_install
	if [ $? -ne 0 ]; then echo "Error installing modules"; exit -1; fi
	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	cd ..
	depmod -a 2.4.21

	rm -rf linux-2.4.21
	echo "Done"
}


#James, if you're changing the kernel, don't forget the routines
# installkernelheaders, makefreeswan, makeacx100,  makemadwifi, makerp
# makeiptables, makelinuxmanpages
makekernel2420() {
	echo "Make kernel..."
	if [ ! -f linux-2.4.20.tar.gz ] ; then exit -1; fi
	tar -zxvf linux-2.4.20.tar.gz
	chown -R 0:0 linux-2.4.20
	cd linux-2.4.20
	cp COPYING /license/linux-COPYING
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper"; exit -1; fi
	make clean
	if [ $? -ne 0 ]; then echo "Error making clean"; exit -1; fi
	cp ../config-2420-20031124 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then echo "Error making oldconfig"; exit -1; fi
	make dep
	if [ $? -ne 0 ]; then echo "Error making dep"; exit -1; fi
	make bzImage
	if [ $? -ne 0 ]; then echo "Error making bzImage"; exit -1; fi
	make modules
	if [ $? -ne 0 ]; then echo "Error making modules"; exit -1; fi
	make modules_install
	if [ $? -ne 0 ]; then echo "Error installing modules"; exit -1; fi
	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	cd ..
	depmod -a 2.4.20

	rm -rf linux-2.4.20
	echo "Done"
}



cleanxinetd2312() {
	rm -vf /etc/xinetd.conf /usr/sbin/itox /usr/sbin/xinetd
	rm -vf /usr/sbin/xconv.pl /usr/man/man5/xinetd.conf.5
	rm -vf /usr/man/man8/xinetd.log.8 /usr/man/man8/xinetd.8
	rm -vf /usr/man/man8/itox.8 /usr/man/man8/xconv.pl.8
}

makexinetd2312() {
	logmessage2 "Building xinetd..."

	if [ ! -f $TPMSRCDIR/xinetd-2.3.12.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/xinetd-2.3.12.tar.gz
	cd xinetd-2.3.12
	./configure --prefix=/usr --sysconfdir=/etc
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/sbin/xinetd ] ; then exit; fi

	cat > /etc/xinetd.conf << "EOF"
#
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
        instances               = 60
        log_type                = SYSLOG authpriv
        log_on_success          = HOST PID
        log_on_failure          = HOST
}

includedir /etc/xinetd.d
EOF

	mkdir /etc/xinetd.d/ /var/tftpboot

	cat > /etc/xinetd.d/tftp << "EOF"
service tftp
{
	disable 		= yes
        socket_type             = dgram
        wait                    = yes
        user                    = nobody
        server                  = /usr/libexec/tftpd
        server_args             = -l /var/tftpboot
        log_on_success          += HOST DURATION PID TRAFFIC
        log_on_failure          += HOST
        nice                    = 10
}
EOF

	cat > /etc/rc.d/init.d/xinetd << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  start|--start)
	/usr/sbin/xinetd
	;;


  stop|--stop)
	pkill xinetd
	;;

  *)
	echo "Usage: xinetd {start|stop}" >&2
	exit 2
esac

exit 0
EOF
	chmod 755 /etc/rc.d/init.d/xinetd
	cd ../
	rm -rf xinetd-2.3.12
	logmessage2 "Done xinetd"
}


#Directories:
#	/usr/lib/ipsec
#	/usr/libexec/ipsec
#	/usr/man/man3
#	/usr/man/man5
#	/usr/man/man8
#	/usr/sbin/ipsec
#	/usr/share/doc/freeswan
#
makefreeswan204with2422() {
	logmessage2 "Making freeswan..."
	cp $TPMSRCDIR/iw240_we15-6.diff /
	cp $TPMSRCDIR/freeswan-2.04.tar.gz /
	cp $TPMSRCDIR/linux-2.4.22.tar.gz /
	cp $TPMSRCDIR/config1-20031118 /

	if [ ! -f iw240_we15-6.diff ] ; then exit; fi
	if [ ! -f freeswan-2.04.tar.gz ] ; then exit; fi
	if [ ! -f linux-2.4.22.tar.gz ] ; then exit; fi
	if [ ! -f config1-20031118 ] ; then exit; fi
	cleanfreeswan203

	cat > freeswan.patch << "EOF"
diff -uNr freeswan-2.04.orig/Makefile.inc freeswan-2.04/Makefile.in
--- freeswan-2.04.orig/Makefile.inc	2003-11-14 01:15:52.000000000 +0000
+++ freeswan-2.04/Makefile.inc	2003-11-14 01:16:10.000000000 +0000
@@ -62,7 +62,7 @@
 DESTDIR?=
 
 # "local" part of tree, used in building other pathnames
-INC_USRLOCAL=/usr/local
+INC_USRLOCAL=/usr
 
 # PUBDIR is where the "ipsec" command goes; beware, many things define PATH
 # settings which are assumed to include it (or at least, to include *some*
EOF


	tar -zxvf freeswan-2.04.tar.gz
	mkdir -p /usr/src
	rm /usr/src/linux
	ln -s /linux-2.4.22 /usr/src/linux

	tar -zxvf linux-2.4.22.tar.gz
	chown -R 0:0 linux-2.4.22
	cd linux-2.4.22
	patch -Np1 -i ../iw240_we15-6.diff
	make mrproper 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make clean
	cp ../config1-20031118 ./.config
	make oldconfig 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make oldconfig"; exit; fi
	make dep 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make dep"; exit; fi

	cd ../freeswan-2.04
	cp LICENSE /license/freeswan-LICENSE
	cp linux/crypto/ciphers/des/COPYRIGHT /license/libdes-LICENSE
	patch -Np1 -i ../freeswan.patch
	make oldmod 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make oldmod"; exit; fi

	cd ../linux-2.4.22
	make modules 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules"; exit; fi
	make modules_install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules_install"; exit; fi
	make bzImage 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make bzImage"; exit; fi

	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	/sbin/lilo
	cd ..

	depmod -a 2.4.22

	rm -f /etc/ipsec.secret
	rm -f /etc/rc.d/rc0.d/K68ipsec
	rm -f /etc/rc.d/rc1.d/K68ipsec
	rm -f /etc/rc.d/rc2.d/S47ipsec
	rm -f /etc/rc.d/rc3.d/S47ipsec
	rm -f /etc/rc.d/rc4.d/S47ipsec
	rm -f /etc/rc.d/rc5.d/S47ipsec
	rm -f /etc/rc.d/rc6.d/K68ipsec
	rm -rf freeswan-2.04 freeswan-2.04.tar.gz freeswan.patch
	rm -f iw240_we15-6.diff config1-20031118 linux-2.4.22.tar.gz

	logmessage2 "Done freeswan"
}

#Directories:
#	/usr/lib/ipsec
#	/usr/libexec/ipsec
#	/usr/man/man3
#	/usr/man/man5
#	/usr/man/man8
#	/usr/sbin/ipsec
#	/usr/share/doc/freeswan
#
makefreeswan204with2421() {
	logmessage2 "Making freeswan..."
	cp $TPMSRCDIR/iw241_we16-6.diff /
	cp $TPMSRCDIR/freeswan-2.04.tar.gz /
	cp $TPMSRCDIR/linux-2.4.21.tar.gz /
	cp $TPMSRCDIR/config-2421-20031122 /

	if [ ! -f iw241_we16-6.diff ] ; then exit; fi
	if [ ! -f freeswan-2.04.tar.gz ] ; then exit; fi
	if [ ! -f linux-2.4.21.tar.gz ] ; then exit; fi
	if [ ! -f config-2421-20031122 ] ; then exit; fi
	cleanfreeswan203

	cat > freeswan.patch << "EOF"
diff -uNr freeswan-2.04.orig/Makefile.inc freeswan-2.04/Makefile.in
--- freeswan-2.04.orig/Makefile.inc	2003-11-14 01:15:52.000000000 +0000
+++ freeswan-2.04/Makefile.inc	2003-11-14 01:16:10.000000000 +0000
@@ -62,7 +62,7 @@
 DESTDIR?=
 
 # "local" part of tree, used in building other pathnames
-INC_USRLOCAL=/usr/local
+INC_USRLOCAL=/usr
 
 # PUBDIR is where the "ipsec" command goes; beware, many things define PATH
 # settings which are assumed to include it (or at least, to include *some*
EOF


	tar -zxvf freeswan-2.04.tar.gz
	mkdir -p /usr/src
	rm /usr/src/linux
	ln -s /linux-2.4.21 /usr/src/linux

	tar -zxvf linux-2.4.21.tar.gz
	chown -R 0:0 linux-2.4.21
	cd linux-2.4.21
	patch -Np1 -i ../iw241_we16-6.diff
	if [ $? -ne 0 ]; then logmessage2 "Error patching linux kernel for wireless extensions"; exit; fi
	make mrproper 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make clean
	cp ../config-2421-20031122 ./.config
	make oldconfig 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make oldconfig"; exit; fi
	make dep 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make dep"; exit; fi

	cd ../freeswan-2.04
	cp LICENSE /license/freeswan-LICENSE
	cp linux/crypto/ciphers/des/COPYRIGHT /license/libdes-LICENSE
	patch -Np1 -i ../freeswan.patch
	make oldmod 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make oldmod"; exit; fi

	cd ../linux-2.4.21
	make modules 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules"; exit; fi
	make modules_install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules_install"; exit; fi
	make bzImage 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make bzImage"; exit; fi

	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	/sbin/lilo

	#Reinstall the kernel headers to get any changes that may have
	# occured
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	logmessage2 "Done re-installing kernel headers" 

	cd ..

	depmod -a 2.4.21

	rm -f /etc/ipsec.secret
	rm -f /etc/rc.d/rc0.d/K68ipsec
	rm -f /etc/rc.d/rc1.d/K68ipsec
	rm -f /etc/rc.d/rc2.d/S47ipsec
	rm -f /etc/rc.d/rc3.d/S47ipsec
	rm -f /etc/rc.d/rc4.d/S47ipsec
	rm -f /etc/rc.d/rc5.d/S47ipsec
	rm -f /etc/rc.d/rc6.d/K68ipsec
	rm -rf freeswan-2.04 freeswan-2.04.tar.gz freeswan.patch
	rm -f iw241_we16-6.diff config-2421-20031122 linux-2.4.21.tar.gz

	logmessage2 "Done freeswan"
}

#Directories:
#	/usr/lib/ipsec
#	/usr/libexec/ipsec
#	/usr/man/man3
#	/usr/man/man5
#	/usr/man/man8
#	/usr/sbin/ipsec
#	/usr/share/doc/freeswan
#
makefreeswan204with2420() {
	logmessage2 "Making freeswan..."

	if [ ! -f $TPMSRCDIR/freeswan-2.04.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/linux-2.4.20.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/config-2420-20031124 ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/iw240_we15-6.diff ] ; then exit; fi

	logmessage2 "Patching freeswan to use /usr"
	cat > freeswan.patch << "EOF"
diff -uNr freeswan-2.04.orig/Makefile.inc freeswan-2.04/Makefile.in
--- freeswan-2.04.orig/Makefile.inc	2003-11-14 01:15:52.000000000 +0000
+++ freeswan-2.04/Makefile.inc	2003-11-14 01:16:10.000000000 +0000
@@ -62,7 +62,7 @@
 DESTDIR?=
 
 # "local" part of tree, used in building other pathnames
-INC_USRLOCAL=/usr/local
+INC_USRLOCAL=/usr
 
 # PUBDIR is where the "ipsec" command goes; beware, many things define PATH
 # settings which are assumed to include it (or at least, to include *some*
EOF

	logmessage2 "Unpacking freeswan"

	tar -zxvf $TPMSRCDIR/freeswan-2.04.tar.gz
	mkdir -p /usr/src
	rm /usr/src/linux
	ln -s /linux-2.4.20 /usr/src/linux

	logmessage2 "Unpacking kernel"

	tar -zxvf $TPMSRCDIR/linux-2.4.20.tar.gz
	chown -R 0:0 linux-2.4.20
	cd linux-2.4.20
	patch -Np1 -i $TPMSRCDIR/iw240_we15-6.diff
	if [ $? -ne 0 ]; then logmessage2 "Error patching linux kernel for wireless extensions"; exit; fi
	make mrproper 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make clean
	cp $TPMSRCDIR/config-2420-20031124 ./.config
	make oldconfig 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make oldconfig"; exit; fi
	make dep 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make dep"; exit; fi

	cd ../freeswan-2.04
	cp LICENSE /license/freeswan-LICENSE
	cp linux/crypto/ciphers/des/COPYRIGHT /license/libdes-LICENSE
	patch -Np1 -i ../freeswan.patch
	make oldmod 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make oldmod"; exit; fi

	cd ../linux-2.4.20
	make modules 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules"; exit; fi
	make modules_install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules_install"; exit; fi
	make bzImage 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make bzImage"; exit; fi

	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	/sbin/lilo

	#Reinstall the kernel headers to get any changes that may have
	# occured
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	logmessage2 "Done re-installing kernel headers" 

	cd ..

	depmod -a 2.4.20

	rm -f /etc/ipsec.secret
	rm -f /etc/rc.d/rc0.d/K68ipsec
	rm -f /etc/rc.d/rc1.d/K68ipsec
	rm -f /etc/rc.d/rc2.d/S47ipsec
	rm -f /etc/rc.d/rc3.d/S47ipsec
	rm -f /etc/rc.d/rc4.d/S47ipsec
	rm -f /etc/rc.d/rc5.d/S47ipsec
	rm -f /etc/rc.d/rc6.d/K68ipsec
	rm -rf freeswan-2.04 freeswan.patch

	logmessage2 "Done freeswan"
}

#Directories:
#	/usr/lib/ipsec
#	/usr/libexec/ipsec
#	/usr/man/man3
#	/usr/man/man5
#	/usr/man/man8
#	/usr/sbin/ipsec
#	/usr/share/doc/freeswan
#
makefreeswan204with2423() {
	logmessage2 "Making freeswan..."
	rm -rf linux-2.4.23

	if [ ! -f $TPMSRCDIR/freeswan-2.04.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/linux-2.4.23.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/config-2423-20031130 ] ; then exit; fi

	logmessage2 "Patching freeswan to use /usr"
	cat > freeswan.patch << "EOF"
diff -uNr freeswan-2.04.orig/Makefile.inc freeswan-2.04/Makefile.in
--- freeswan-2.04.orig/Makefile.inc	2003-11-14 01:15:52.000000000 +0000
+++ freeswan-2.04/Makefile.inc	2003-11-14 01:16:10.000000000 +0000
@@ -62,7 +62,7 @@
 DESTDIR?=
 
 # "local" part of tree, used in building other pathnames
-INC_USRLOCAL=/usr/local
+INC_USRLOCAL=/usr
 
 # PUBDIR is where the "ipsec" command goes; beware, many things define PATH
 # settings which are assumed to include it (or at least, to include *some*
EOF

	logmessage2 "Unpacking freeswan"

	tar -zxvf $TPMSRCDIR/freeswan-2.04.tar.gz
	mkdir -p /usr/src
	rm /usr/src/linux
	ln -s /linux-2.4.23 /usr/src/linux

	logmessage2 "Unpacking kernel"

	tar -zxvf $TPMSRCDIR/linux-2.4.23.tar.gz
	chown -R 0:0 linux-2.4.23
	cd linux-2.4.23
	#patch -Np1 -i ../iw240_we15-6.diff
	if [ $? -ne 0 ]; then logmessage2 "Error patching linux kernel for wireless extensions"; exit; fi
	make mrproper 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make clean
	cp $TPMSRCDIR/config-2423-20031130 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make oldconfig"; exit; fi
	make dep 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make dep"; exit; fi

	cd ../freeswan-2.04
	cp LICENSE /license/freeswan-LICENSE
	cp linux/crypto/ciphers/des/COPYRIGHT /license/libdes-LICENSE
	patch -Np1 -i ../freeswan.patch
	make oldmod 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make oldmod"; exit; fi

	cd ../linux-2.4.23
	make modules 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules"; exit; fi
	make modules_install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules_install"; exit; fi
	make bzImage 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make bzImage"; exit; fi

	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	/sbin/lilo

	#Reinstall the kernel headers to get any changes that may have
	# occured
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	logmessage2 "Done re-installing kernel headers" 

	cd ..

	depmod -a 2.4.23

	rm -f /etc/ipsec.secret
	rm -f /etc/rc.d/rc0.d/K68ipsec
	rm -f /etc/rc.d/rc1.d/K68ipsec
	rm -f /etc/rc.d/rc2.d/S47ipsec
	rm -f /etc/rc.d/rc3.d/S47ipsec
	rm -f /etc/rc.d/rc4.d/S47ipsec
	rm -f /etc/rc.d/rc5.d/S47ipsec
	rm -f /etc/rc.d/rc6.d/K68ipsec
	rm -rf freeswan-2.04 freeswan.patch

	logmessage2 "Done freeswan"
}

#Directories:
#	/usr/lib/ipsec
#	/usr/libexec/ipsec
#	/usr/man/man3
#	/usr/man/man5
#	/usr/man/man8
#	/usr/sbin/ipsec
#	/usr/share/doc/freeswan
#
makefreeswan204with2424() {
	logmessage2 "Making freeswan..."
	rm -rf linux-2.4.24

	if [ ! -f $TPMSRCDIR/freeswan-2.04.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/linux-2.4.24.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/config-2424-20040105 ] ; then exit; fi

	logmessage2 "Patching freeswan to use /usr"
	cat > freeswan.patch << "EOF"
diff -uNr freeswan-2.04.orig/Makefile.inc freeswan-2.04/Makefile.in
--- freeswan-2.04.orig/Makefile.inc	2003-11-14 01:15:52.000000000 +0000
+++ freeswan-2.04/Makefile.inc	2003-11-14 01:16:10.000000000 +0000
@@ -62,7 +62,7 @@
 DESTDIR?=
 
 # "local" part of tree, used in building other pathnames
-INC_USRLOCAL=/usr/local
+INC_USRLOCAL=/usr
 
 # PUBDIR is where the "ipsec" command goes; beware, many things define PATH
 # settings which are assumed to include it (or at least, to include *some*
EOF

	logmessage2 "Unpacking freeswan"

	tar -zxvf $TPMSRCDIR/freeswan-2.04.tar.gz
	mkdir -p /usr/src
	rm /usr/src/linux
	ln -s /linux-2.4.24 /usr/src/linux

	logmessage2 "Unpacking kernel"

	tar -zxvf $TPMSRCDIR/linux-2.4.24.tar.gz
	chown -R 0:0 linux-2.4.24
	cd linux-2.4.24
	#patch -Np1 -i ../iw240_we15-6.diff
	if [ $? -ne 0 ]; then logmessage2 "Error patching linux kernel for wireless extensions"; exit; fi
	make mrproper 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make clean
	cp $TPMSRCDIR/config-2424-20040105 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make oldconfig"; exit; fi
	make dep 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "makefreeswan: Problem with make dep"; exit; fi

	cd ../freeswan-2.04
	cp LICENSE /license/freeswan-LICENSE
	cp linux/crypto/ciphers/des/COPYRIGHT /license/libdes-LICENSE
	patch -Np1 -i ../freeswan.patch
	make oldmod 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make oldmod"; exit; fi

	cd ../linux-2.4.24
	make modules 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules"; exit; fi
	make modules_install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make modules_install"; exit; fi
	make bzImage 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem with make bzImage"; exit; fi

	if [ ! -f arch/i386/boot/bzImage ] ; then exit; fi
	
	cp arch/i386/boot/bzImage  /boot/
	cp System.map /boot/
	/sbin/lilo

	#Reinstall the kernel headers to get any changes that may have
	# occured
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	logmessage2 "Done re-installing kernel headers" 

	cd ..

	depmod -a 2.4.24

	rm -f /etc/ipsec.secret
	rm -f /etc/rc.d/rc0.d/K68ipsec
	rm -f /etc/rc.d/rc1.d/K68ipsec
	rm -f /etc/rc.d/rc2.d/S47ipsec
	rm -f /etc/rc.d/rc3.d/S47ipsec
	rm -f /etc/rc.d/rc4.d/S47ipsec
	rm -f /etc/rc.d/rc5.d/S47ipsec
	rm -f /etc/rc.d/rc6.d/K68ipsec
	rm -rf freeswan-2.04 freeswan.patch

	logmessage2 "Done freeswan"
}



cleannmap348() {
	rm -rvf /usr/bin/nmap /usr/man/man1/nmap.1 \
	/usr/share/nmap/nmap-os-fingerprints \
	/usr/share/nmap/nmap-service-probes /usr/share/nmap/nmap-rpc \
	/usr/share/nmap/nmap-services /usr/share/nmap/nmap-protocols 

}

# NMap 3.48
# 1,912KB
makenmap348() {
	logmessage2 "Making nmap..."
	cp $TPMSRCDIR/nmap-3.48.tgz /
	cleannmap348

	if [ ! -f nmap-3.48.tgz ] ; then exit; fi
	tar -zxvf nmap-3.48.tgz
	cd nmap-3.48
	./configure --prefix=/usr --sysconfdir=/etc/nmap --without-nmapfe
	make
	make install
	cd ../
	if [ ! -f /usr/bin/nmap ] ; then exit; fi
	rm -rf nmap-3.48
	logmessage2 "Done nmap"
}


cleannbtscan151() {
	rm -rvf /usr/bin/nbtscan
	rm -vf /license/nbtscan-README
}

# NBTScan 1.5
# 92KB
makenbtscan151() {
	logmessage2 "Making nbtscan..."
	cp $TPMSRCDIR/nbtscan-1.5.1.tar.gz /
	if [ ! -f nbtscan-1.5.1.tar.gz ] ; then exit; fi
	tar -zxvf nbtscan-1.5.1.tar.gz
	cd nbtscan-1.5.1a
	./configure --prefix=/usr
	make
	cp nbtscan /usr/bin
	cp README /readme/nbtscan-README
	cd ..
	if [ ! -f /usr/bin/nbtscan ] ; then exit; fi
	rm -rf nbtscan-1.5.1a
	logmessage2 "Done nbtscan"
}


cleanstunnel404() {
	rm -rvf /etc/stunnel
	rm -vf /license/stunnel-COPYING /license/COPYRIGHT.GPL

	rm -vf /usr/lib/libstunnel.so /usr/lib/libstunnel.la
	rm -vf /usr/man/man8/stunnel.8 /usr/man/man8/stunnel.pl.8
	rm -vf /usr/sbin/stunnel
	rm -rvf /usr/var/stunnel /usr/share/doc/stunnel
}

makestunnel404() {
	logmessage2 "Making stunnel..."
	if [ ! -f $TPMSRCDIR/stunnel-4.04.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/stunnel-4.04.tar.gz
	cd stunnel-4.04
	./configure --prefix=/usr --sysconfdir=/etc

	cat > install.responses << "EOF"
PL
Some-State
Some-City
Stunnel Developers Ltd

localhost
EOF
	cat install.responses |	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cp COPYING /license/stunnel-COPYING
	cp COPYRIGHT.GPL /license/
	cp tools/stunnel.cnf /etc/stunnel/stunnel.cnf
	cd ../
	rm -f /etc/stunnel/stunnel.pem

	if [ ! -f /usr/sbin/stunnel ] ; then exit; fi
	rm -rf stunnel-4.04
	logmessage2 "Done stunnel"
}

cleanscreen401() {
	rm -rvf /usr/share/screen
	rm -vf /usr/bin/screen /usr/bin/screen-4.0.1
	rm -vf /usr/man/man1/screen.1
	cd /usr/info
	rm -vf dir screen.info screen.info-1 screen.info-2 screen.info-3 \
	screen.info-4 screen.info-5
	cd /
}

makescreen401() {
	logmessage2 "Building screen"
	if [ ! -f $TPMSRCDIR/screen-4.0.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/screen-4.0.1.tar.gz
	cd screen-4.0.1
	./configure --prefix=/usr
	make
	make install
	cd ../
	if [ ! -f /usr/bin/screen ] ; then exit; fi
	rm -rf screen-4.0.1
	logmessage2 "Done screen"
}


cleanethereal0915() {
	rm -rvf /usr/lib/ethereal
	rm -rvf /usr/share/ethereal
	cd /usr/bin
	rm -vf editcap idl2eth mergecap tethereal text2pcap
	cd /usr/man/man1
	rm -vf editcap.1 idl2eth.1 mergecap.1 tethereal.1 text2pcap.1
	cd /
}


# Ethereal 0.9.15
# 40,936KB
makeethereal0915() {
	logmessage2 "Making ethereal..."
	if [ ! -f $TPMSRCDIR/ethereal-0.9.15.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ethereal-0.9.15.tar.gz
	cd ethereal-0.9.15
	./configure --prefix=/usr --enable-static=no
	make
	make install
	if [ ! -x /usr/bin/tethereal ] ; then exit; fi
	if [ ! -x /usr/bin/ethereal ] ; then exit; fi
	
	cd ../
	#Can't remove the directory, because it is needed by kismet
	#rm -rf ethereal-0.9.15
	logmessage2 "Done ethereal"
}



# Net-SNMP 5.0.9
# 6,796KB
makenetsnmp509() {
	logmessage2 "Making netsnmp..."
	if [ ! -f $TPMSRCDIR/net-snmp-5.0.9.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/net-snmp-5.0.9.tar.gz
	cd net-snmp-5.0.9


	./configure --prefix=/usr --datadir=/etc --enable-static=no --with-defaults
	make
	make install
 
	if [ ! -x /usr/bin/snmpwalk ] ; then exit; fi
	cp COPYING /license/netsnmp-COPYING
	cd ../
	rm -rf net-snmp-5.0.9
	logmessage2 "Done net-snmp"
}



cleanngrep141() {
	rm -rvf /etc/ngrep
	rm -vf /license/ngrep-COPYRIGHT
	rm -vf /usr/bin/ngrep /usr/man/man8/ngrep.8
}

# NGrep 1.41
# 164KB
makengrep141() {
	logmessage2 "Making ngrep..."
	cleanngrep141
	cp $TPMSRCDIR/ngrep-1.41.tar.bz2 /
	if [ ! -f ngrep-1.41.tar.bz2 ] ; then exit; fi
	bunzip2 -c ngrep-1.41.tar.bz2 | tar -xv
	cd ngrep-1.41
	./configure --prefix=/usr --sysconfdir=/etc/ngrep
	make
	make install
	cd ../
	if [ ! -f /usr/bin/ngrep ] ; then exit; fi
	rm -rf ngrep-1.41
	logmessage2 "Done ngrep"
}


cleanbind922p3() {
	rm -rvf /etc/bind
	rm -vf /usr/bin/dig /usr/bin/host /usr/bin/isc-config.sh
	rm -vf /usr/bin/nslookup /usr/bin/nsupdate
	rm -rvf /usr/include/dns /usr/include/dst /usr/include/isc
	rm -rvf /usr/include/isccc /usr/include/isccfg /usr/include/lwres
	rm -vf /usr/lib/libdns.a /usr/lib/libisc.a /usr/lib/libisccc.a
	rm -vf /usr/lib/libisccfg.a /usr/lib/liblwres.a
	rm -vf /usr/man/man1/dig.1 /usr/man/man1/host.1
	rm -vf /usr/man/man3/lwres* /usr/man/man5/rndc.conf.5
	cd /usr/man/man8/
	rm -vf dnssec-keygen.8 dnssec-makekeyset.8 dnssec-signkey.8 \
	dnssec-signzone.8 lwresd.8 named-checkconf.8 named-checkzone.8 \
	named.8 nsupdate.8 rndc-confgen.8 rndc.8
	cd /usr/sbin
	rm -vf dnssec-keygen dnssec-makekeyset dnssec-signkey \
	dnssec-signzone lwresd named named-checkconf named-checkzone \
	rndc rndc-confgen
	rm -vf /license/bind-COPYRIGHT
	cd /
}

# Bind 9.2.2P3
# 19,216KB
makebind922p3() {
	logmessage2 "Making bind..."
	if [ ! -f $TPMSRCDIR/bind-9.2.2-P3.tar.gz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/bind-9.2.2-P3.tar.gz
	cd bind-9.2.2-P3
	./configure --prefix=/usr --sysconfdir=/etc/bind --with-openssl=/usr/ssl --enable-static=no
	make
	make install
	ldconfig
	cp COPYRIGHT /license/bind-COPYRIGHT
	cd ../
	if [ ! -f /usr/sbin/named ] ; then exit; fi
	rm -rf bind-9.2.2-P3
	mkdir /etc/bind
	logmessage2 "Done bind"
}



cleanettercap06b() {

	rm -rvf /usr/share/doc/ettercap /usr/share/ettercap
	rm -vf /usr/man/man8/ettercap.8 /usr/sbin/ettercap
	rm -rvf /etc/ettercap
	rm -vf /license/ettercap-README	
}

# Ettercap 0.6.B
# 1,200KB
makeettercap06b() {
	logmessage2 "Making ettercap..."
	cleanettercap06b
	if [ ! -f $TPMSRCDIR/ettercap-0.6.b.tar.gz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ettercap-0.6.b.tar.gz
	cd ettercap-0.6.b
	./configure --prefix=/usr --sysconfdir=/etc/ettercap --enable-https --enable-plugins --with-openssl=/usr/ssl
	make
	make install
	make plug-ins_install
	cp README /readme/ettercap-README
	cd ../
	if [ ! -f /usr/sbin/ettercap ] ; then exit; fi
	rm -rf ettercap-0.6.b
	logmessage2 "Done ettercap"
}


cleanlsof468() {
	rm -vf /usr/bin/lsof /usr/man/man8/lsof.8
}

# LSOF 4.68
# 164KB
makelsof468() {
	logmessage2 "Making lsof..."	
	if [ ! -f $TPMSRCDIR/lsof_4.68.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/lsof_4.68.tar.gz
	cd lsof_4.68
	tar -xvf lsof_4.68_src.tar
	cd lsof_4.68_src
	LSOF_CC="gcc -s";export LSOF_CC
	./Configure -n linux
	make
	mkdir -p /usr/bin
	mkdir -p /usr/man/man8
	install -m 4777 -o root -g sys lsof /usr/bin
	install -m 444 lsof.8 /usr/man/man8
	cd ../..
	if [ ! -f /usr/bin/lsof ] ; then exit; fi
	rm -rf lsof_4.68
	logmessage2 "Done lsof"
}


cleanopenssh371p2() {
	rm -vf /usr/sbin/sshd
	rm -vf /etc/ssh* /etc/moduli
	rm -vf /license/openssh-LICENCE
}

# OpenSSH 3.7.1p2
# 1,188KB
makeopenssh371p2() {
	logmessage2 "Making openssh..."
	if [ ! -f $TPMSRCDIR/openssh-3.7.1p2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/openssh-3.7.1p2.tar.gz
	cd openssh-3.7.1p2
	./configure --prefix=/usr --sysconfdir=/etc --with-ssl-dir=/usr/ssl
	make
	if [ $? -ne 0 ] ; then echo "Problem with openssh"; exit; fi
	rm -f /etc/ssh_config /etc/sshd_config /etc/moduli 
	rm -f /etc/ssh_host_key /etc/ssh_host_dsa_key /etc/ssh_host_rsa_key
	make install
	cp LICENCE /license/openssh-LICENCE
	cd ..
	sed "s/^#PermitRootLogin yes/PermitRootLogin no/" /etc/sshd_config >/etc/sshd_config.new
	sed "s/^#Protocol 2,1/Protocol 2/" /etc/sshd_config.new >/etc/sshd_config

	rm -f /etc/ssh_host_*
	rm -rf openssh-3.7.1p2
	logmessage2 "Done openssh"
}


cleansamba300() {
	rm -rvf /etc/samba
}

# Samba 3.0.0
# 33,184KB
makesamba300() {
	logmessage2 "Making samba..."
	if [ ! -f $TPMSRCDIR/samba-3.0.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/samba-3.0.0.tar.gz
	cd samba-3.0.0/source
	./configure --prefix=/usr --sysconfdir=/etc/samba --localstatedir=/var --with-configdir=/etc/samba --with-smbmount --with-privatedir=/etc/samba/private
	make
	make install
	cd ../..
	if [ ! -f /usr/sbin/smbd ] ; then exit; fi
	mkdir -p /etc/samba/private

	cat > /etc/samba/smb.conf << "EOF"
[global]
	netbios name=ThePacketMaster
	server string=ThePacketMaster
	workgroup=WORKGROUP
	log file=/var/log/samba.log
	encrypt passwords=yes
	wins support=yes
	guest account=nobody
	security=user
	map to guest=Bad User
	interfaces = *

#[tmp]
#	path=/tmp
#	read only=no
#	guest ok=yes
#
EOF
	rm -rf samba-3.0.0
	logmessage2 "Done samba"
}


cleaninetutilstftp() {
	rm -f /usr/bin/tftp
	cd /usr/info
	rm -f dir inetutils.info inetutils.info-1 inetutils.info-2 inetutils.info-3
	rm -f /usr/libexec/tftpd
	cd /usr/man/man1
	rm -f ftp.1 logger.1 rcp.1 rlogin.1 rsh.1 talk.1 telnet.1 tftp.1
	rm -f /usr/man/man5/syslog.conf.5
	cd /usr/man/man8
	rm -f ftpd.8 inetd.8 ping.8 rexecd.8 rlogind.8 rshd.8 syslogd.8
	rm -f talkd.8 telnetd.8 tftpd.8
	cd /
}

makeinetutilstftp() {
	logmessage2 "Building inetutils tftp..."
	if [ ! -f $TPMSRCDIR/inetutils-1.4.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/inetutils-1.4.2.tar.gz
	cd inetutils-1.4.2
	./configure --disable-ftpd --disable-inetd --disable-rexecd --disable-rlogind --disable-rshd --disable-syslogd --disable-talkd --disable-telnetd --disable-uucpd --disable-ftp --disable-ping --disable-rcp --disable-rlogin --disable-rsh --disable-logger --disable-talk --disable-telnet --disable-whois --disable-ifconfig  --prefix=/usr
	make
	make install
	cd ../
	if [ ! -f /usr/bin/tftp ] ; then exit; fi
	rm -rf inetutils-1.4.2
	logmessage2 "Done inetutils tftp"
}


cleanopenssl097c() {
	rm -rvf /usr/ssl
	rm -vf /license/openssl-LICENSE
}

makeopenssl097c() {
	logmessage2 "Making openssl..."
	if [ ! -f $TPMSRCDIR/openssl-0.9.7c.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/openssl-0.9.7c.tar.gz
	cd openssl-0.9.7c
	./config shared 386 --prefix=/usr/ssl --openssldir=/etc/ssl
	make
	make test
	make install
	ldconfig
	rmdir /etc/ssl/lib
	mv /etc/ssl/misc /usr/ssl/misc
	mv /etc/ssl/man /usr/ssl/man
	cp LICENSE /license/openssl-LICENSE
	cd ..
	if [ ! -f /usr/ssl/bin/openssl ] ; then exit; fi
	if [ ! -d /etc/ssl/certs ] ; then exit; fi
	if [ ! -d /etc/ssl/private ] ; then exit; fi
	rm -rf openssl-0.9.7c
	logmessage2 "Done openssl"
}


cleantcpreplay145() {
	cd /usr/bin
	rm -f capinfo pcapmerge tcpprep 
	cd /usr/man/man1/
	rm -f capinfo.1 pcapmerge.1 tcpprep.1
	rm -f /usr/man/man8/tcpreplay.8
	rm -f /usr/sbin/tcpreplay
	rm -vf /license/tcpreplay-LICENSE
	cd /
}

maketcpreplay145() {
	logmessage2 "Making tcpreplay..."
	cleantcpreplay145
	if [ ! -f $TPMSRCDIR/tcpreplay-1.4.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tcpreplay-1.4.5.tar.gz
	cd tcpreplay-1.4.5
	./configure --prefix=/usr
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cp Docs/LICENSE /license/tcpreplay-LICENSE
	cd ../

	if [ ! -f /usr/sbin/tcpreplay ] ; then exit; fi
	rm -rf tcpreplay-1.4.5
	logmessage2 "Done tcpreplay"
}





# Nessus 2.0.9
makenessus209() {
	logmessage2 "Making nessus..."
	if [ ! -f $TPMSRCDIR/libnasl-2.0.9.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/nessus-core-2.0.9.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/nessus-libraries-2.0.9.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/nessus-plugins-2.0.9.tar.gz ] ; then exit; fi


	mkdir nessus
	cd nessus
	tar -zxvf $TPMSRCDIR/libnasl-2.0.9.tar.gz
	tar -zxvf $TPMSRCDIR/nessus-core-2.0.9.tar.gz
	tar -zxvf $TPMSRCDIR/nessus-libraries-2.0.9.tar.gz
	tar -zxvf $TPMSRCDIR/nessus-plugins-2.0.9.tar.gz

	cd nessus-libraries

	if [ "x$1" = "xwithoutx" ] ; then
		logmessage2 "Making nessus-libraries without X"
		./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --sharedstatedir=/etc --enable-static=no
	else
		logmessage2 "Making nessus-libraries with X"
		./configure --prefix=/usr --with-x --localstatedir=/var --sysconfdir=/etc --sharedstatedir=/etc --enable-static=no
	fi
	if [ $? -ne 0 ]; then logmessage2 "Error configuring nessus-libraries"; exit; fi

	make
	if [ $? -ne 0 ]; then logmessage2 "Error making nessus-libraries"; exit; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error installing nessus-libraries"; exit; fi
	ldconfig
	if [ ! -f /usr/bin/nessus-config ] ; then exit; fi
	if [ ! -f /usr/lib/libnessus.so ] ; then exit; fi
	logmessage2 "Finished making nessus libraries"

	cd ../libnasl
	./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --sharedstatedir=/etc --enable-static=no
	if [ $? -ne 0 ]; then logmessage2 "Error configuring libnasl"; exit; fi
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making libnasl"; exit; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error installing libnasl"; exit; fi
	ldconfig
	if [ ! -f /usr/bin/nasl-config ] ; then exit; fi
	if [ ! -f /usr/lib/libnasl.so ] ; then exit; fi
	logmessage2 "Finished making nasl libraries"

	cd ../nessus-core
	if [ "x$1" = "xwithoutx" ] ; then
		logmessage2 "Making nessus-libraries without X"
		./configure --prefix=/usr --without-x --localstatedir=/var --sysconfdir=/etc --sharedstatedir=/etc --enable-static=no --disable-gtk
	else
		logmessage2 "Making nessus-libraries with X"
		./configure --prefix=/usr --with-x --localstatedir=/var --sysconfdir=/etc --sharedstatedir=/etc --enable-static=no
	fi
	if [ $? -ne 0 ]; then logmessage2 "Error configuring nessus core"; exit; fi
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making nessus core"; exit; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error installing nessus core"; exit; fi
	ldconfig
	if [ ! -f /usr/bin/nessus-mkcert-client ] ; then exit; fi
	cp doc/WARNING.En /readme/nessus-core.WARNING.En
	logmessage2 "Finished making nessus core"

	cd ../nessus-plugins
	./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --sharedstatedir=/etc --enable-static=no
	if [ $? -ne 0 ]; then logmessage2 "Error configuring nessus plugins"; exit; fi
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making nessus plugins"; exit; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error isntalling nessus plugins"; exit; fi
	ldconfig
	if [ ! -f /usr/lib/nessus/plugins_factory/libtool ] ; then exit; fi
	logmessage2 "Finished making nessus plugins"
	

	cd ../../
	rm -rf nessus
	/usr/sbin/nessus-mkcert -q
	/usr/sbin/nessusd &
	sleep 5
	pkill nessusd
	rm -rf /var/nessus/CA /etc/nessus/CA
	logmessage2 "Done nessus"
}


cleanamap43() {
	cd /usr/bin
	rm -f amap amapcrap appdefs.resp appdefs.rpc appdefs.trig
	rm -f /usr/man/man1/amap.1
	cd /
}

makeamap43() {
	cleanamap43
	logmessage2 "Making amap..."
	cp $TPMSRCDIR/amap-4.3.tar.gz ./
	if [ ! -f amap-4.3.tar.gz ] ; then exit; fi
	tar -zxvf amap-4.3.tar.gz

	cat > amap.amap.h.patch << "EOF"
--- amap-4.3.orig/amap.h	2003-08-26 21:03:39.000000000 +0000
+++ amap-4.3/amap.h	2003-11-02 18:42:11.000000000 +0000
@@ -29,7 +29,7 @@
   #warning "PREFIX definition found, installing to this prefix directory location"
   #define AMAP_PREFIX         PREFIX
  #else
-  #define AMAP_PREFIX         "/usr/local"
+  #define AMAP_PREFIX         "/usr"
  #endif
 #endif
 
EOF

	cat > amap.makefile.patch << "EOF"
--- amap-4.3.orig/Makefile	2003-12-20 10:03:23.000000000 +0000
+++ amap-4.3/Makefile	2003-12-20 10:04:28.000000000 +0000
@@ -3,7 +3,7 @@
 XLIBPATHS= -L/usr/ssl/lib -L/lib
 XIPATHS=-I/usr/ssl/include
 MANDIR=/usr/share/man/man1/
-PREFIX=/usr/local
+PREFIX=/usr/
 
 CC=gcc
 LIB=-lpcre -L./pcre-3.9/ -I./pcre-3.9/
EOF


	cd amap-4.3
	./configure
	patch -Np1 -i ../amap.amap.h.patch
	if [ $? -ne 0 ]; then exit; fi
	patch -Np1 -i ../amap.makefile.patch
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	echo "Finished make"
	make install
	if [ $? -ne 0 ]; then exit; fi
	echo "Finished make install"
	cd ../
	if [ ! -f /usr/bin/amap ] ; then exit; fi
	rm -rf amap-4.3 amap.patch amap-4.3.tar.gz
	logmessage2 "Done amap"
}

cleanhydra24() {
	rm -vf /usr/bin/hydra /license/LICENCE.HYDRA
}

makehydra24() {
	cleanhydra24
	logmessage2 "Making hydra..."
	cp $TPMSRCDIR/hydra-2.4.tar.gz ./
	if [ ! -f hydra-2.4.tar.gz ] ; then exit; fi
	tar -zxvf hydra-2.4.tar.gz
	cd hydra-2.4
	./configure --prefix=/usr
        make
	if [ $? -ne 0 ]; then logmessage2 "hydra make failed" ;exit; fi
        make install
	if [ $? -ne 0 ]; then logmessage2 "hydra make install failed" ;exit; fi
	cp LICENCE.HYDRA /license/LICENCE.HYDRA
	cd ../
	if [ ! -f /usr/bin/hydra ] ; then logmessage2 "hydra not found" ;exit; fi
	rm -rf hydra-2.4 hydra-2.4.tar.gz
	logmessage2 "Done hydra"
}



makenasm09838() {
	echo "TPM: Building nasm..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f nasm-0.98.38.tar.gz ] ; then exit -1; fi
	tar -zxvf nasm-0.98.38.tar.gz
	cd nasm-0.98.38
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring nasm";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making nasm";exit -1 ; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing nasm";exit -1; fi
	cd ..
	if [ ! -f /usr/bin/nasm ] ; then exit -1; fi
	rm -rf nasm-0.98.38 nasm-0.98.38.tar.gz
	echo "TPM: Done nasm" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

cleanwhois467() {
	rm -vf /usr/bin/whois
}

makewhois467() {
	logmessage2 "Making whois..."
	if [ ! -f $TPMSRCDIR/whois_4.6.7.tar.gz ] ; then exit -1; fi
	tar -zxvf $TPMSRCDIR/whois_4.6.7.tar.gz
	cd whois-4.6.7
	make
	if [ $? -ne 0 ]; then echo "Error making whois";exit -1; fi
	make prefix=/usr install
	if [ $? -ne 0 ]; then echo "Error installing whois";exit -1; fi
	cd ../
	if [ ! -f /usr/bin/whois ] ; then exit -1; fi
	rm -rf whois-4.6.7
	logmessage2 "Done whois"
}



makelilo22572() {
	echo "TPM: Building lilo..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f lilo-22.5.7.2.tar.gz ] ; then exit -1; fi
	tar -zxvf lilo-22.5.7.2.tar.gz
	cd lilo-22.5.7.2
	make
	if [ $? -ne 0 ]; then echo "Error making lilo";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing lilo";exit -1; fi
	cd ..
	if [ ! -f /sbin/lilo ] ; then exit -1; fi
	rm -rf lilo-22.5.7.2 lilo-22.5.7.2.tar.gz
	echo "TPM: Done lilo" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makewhich216() {
	echo "TPM: Building which..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f which-2.16.tar.gz ] ; then exit -1; fi
	tar -zxvf which-2.16.tar.gz
	cd which-2.16
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring which"; exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making which"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing which"; exit -1; fi
	cd ..
	if [ ! -f /usr/bin/which ] ; then exit -1; fi
	rm -rf which-2.16 which-2.16.tar.gz
	echo "TPM: Done which" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makeperl581() {
	echo "TPM: Building perl..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f perl-5.8.1.tar.gz ] ; then exit -1; fi
	tar -zxvf perl-5.8.1.tar.gz
	cd perl-5.8.1
	./configure.gnu --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring perl";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making perl";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing perl";exit -1; fi
	cd ..
	if [ ! -f /usr/bin/perl ] ; then exit -1; fi
	rm -rf perl-5.8.1 perl-5.8.1.tar.gz
	echo "TPM: Done perl" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makeautomake177() {
	echo "TPM: Building automake..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f automake-1.7.7.tar.gz ] ; then exit -1; fi
	tar -zxvf automake-1.7.7.tar.gz
	cd automake-1.7.7
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring automake";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing automake";exit -1; fi
	ln -s automake-1.7 /usr/share/automake
	cd ..
	if [ ! -f /usr/bin/automake ] ; then exit -1; fi
	rm -rf automake-1.7.7 automake-1.7.7.tar.gz
	echo "TPM: Done automake" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makepsmisc213() {
	echo "TPM: Building psmisc..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f psmisc-21.3.tar.gz ] ; then exit -1; fi
	tar -zxvf psmisc-21.3.tar.gz
	cd psmisc-21.3
	./configure --prefix=/usr --exec-prefix=/
	if [ $? -ne 0 ]; then echo "Error configuring psmisc"; exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making psmisc"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing psmisc"; exit -1; fi
	rm /bin/pidof
	ln -s killall /bin/pidof
	cd ..
	if [ ! -f /bin/killall ] ; then exit -1; fi
	rm -rf psmisc-21.3 psmisc-21.3.tar.gz
	echo "TPM: Done psmisc" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makebin8601613() {
	echo "TPM: Building bin86..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f bin86-0.16.13.tar.gz ] ; then exit -1; fi
	tar -zxvf bin86-0.16.13.tar.gz
	cd bin86-0.16.13
	make
	if [ $? -ne 0 ]; then echo "Error making bin86";exit -1; fi
	make PREFIX=/usr install
	if [ $? -ne 0 ]; then echo "Error installing bin86";exit -1; fi
	cd ..
	if [ ! -f /usr/bin/as86 ] ; then exit -1; fi
	rm -rf bin86-0.16.13 bin86-0.16.13.tar.gz
	echo "TPM: Done bin86" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makegettext0121() {
	echo "TPM: Building gettext..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f gettext-0.12.1.tar.gz ] ; then exit -1; fi
	tar -zxvf gettext-0.12.1.tar.gz
	cd gettext-0.12.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring gettext";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making gettext";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing gettext";exit -1; fi
	cd ..
	if [ ! -f /usr/bin/gettext ] ; then exit -1; fi
	rm -rf gettext-0.12.1 gettext-0.12.1.tar.gz
	echo "TPM: Done gettext" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makefile405() {
	echo "TPM: Building file..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f file-4.05.tar.gz ] ; then exit -1; fi
	tar -zxvf file-4.05.tar.gz
	cd file-4.05
	./configure --prefix=/usr --datadir=/usr/share/misc
	if [ $? -ne 0 ]; then echo "Error configuring file";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making file";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing file"; exit -1; fi
	cd ..
	if [ ! -f /usr/bin/file ] ; then exit -1; fi
	rm -rf file-4.05 file-4.05.tar.gz
	echo "TPM: Done file" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makee2fsprogs134() {
	echo "TPM: Building e2fsprogs..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f e2fsprogs-1.34.tar.gz ] ; then exit -1; fi
	tar -zxvf e2fsprogs-1.34.tar.gz
	mkdir e2fsprogs-build
	cd e2fsprogs-build
	../e2fsprogs-1.34/configure --prefix=/usr --with-root-prefix="" --enable-elf-shlibs
	if [ $? -ne 0 ]; then echo "Error configuring e2fsprogs";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making e2fsprogs";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing e2fsprogs";exit -1; fi
	make install-libs
	if [ $? -ne 0 ]; then echo "Error installing e2fsprogs lib";exit -1; fi
	install-info /usr/share/info/libext2fs.info /usr/share/info/dir
	cd ..
	if [ ! -f /sbin/e2fsck ] ; then exit -1; fi
	rm -rf e2fsprogs-1.34 e2fsprogs-build e2fsprogs-1.34.tar.gz
	echo "TPM: Done e2fsprogs" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}



makeprocps3113() {
	echo "TPM: Building procps..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f procps-3.1.13.tar.gz ] ; then exit -1; fi
	tar -zxvf procps-3.1.13.tar.gz
	cd procps-3.1.13
	#patch -Np1 -i ../procps-3.1.5.patch
	make
	if [ $? -ne 0 ]; then echo "Error making procps"; exit -1; fi
	make XSCPT="" install
	if [ $? -ne 0 ]; then echo "Error installing procps"; exit -1; fi
	cd ..
	if [ ! -f /usr/bin/free ] ; then exit -1; fi
	rm -rf procps-3.1.13.tar.gz procps-3.1.13
	echo "TPM: Done procps" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeman15m2() {
	echo "TPM: Building man..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f man-1.5m2.tar.gz ] ; then exit -1; fi
	tar -zxvf man-1.5m2.tar.gz
	cd man-1.5m2
	PATH=$PATH:/usr/bin:/bin ./configure -default -confdir=/etc
	if [ $? -ne 0 ]; then echo "Error configuring man";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making man";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing man";exit -1; fi
	cd ..
	if [ ! -f /usr/bin/man ] ; then exit -1; fi
	rm -rf man-1.5m2 man-1.5m2.tar.gz
	echo "TPM: Done man" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makestaticgawk313() {
	logmessage "Building static gawk..."
	if [ ! -f gawk-3.1.3.tar.gz ] ; then exit -1; fi
	tar -zxvf gawk-3.1.3.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd gawk-3.1.3
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticgawk";exit -1; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticgawk";exit -1; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticgawk";exit -1; fi
	cd ..
	rm -rf gawk-3.1.3 gawk-3.1.3.tar.gz
	logmessage "Done gawk"
}

makegawk313() {
	echo "TPM: Building gawk..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f gawk-3.1.3.tar.gz ] ; then exit -1; fi
	if [ ! -f gawk-3.1.3.patch ] ; then exit -1; fi
	tar -zxvf gawk-3.1.3.tar.gz
	cd gawk-3.1.3
	patch -Np1 -i ../gawk-3.1.3.patch
	./configure --prefix=/usr --libexecdir=/usr/bin
	if [ $? -ne 0 ]; then echo "Error configuring gawk";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making gawk";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing gawk";exit -1; fi
	cd ..

	rm -rf gawk-3.1.3 gawk-3.1.3.tar.gz gawk-3.1.3.patch
	echo "TPM: Done gawk" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makestaticfindutils4120() {
	logmessage "Building static findutils..."
	cp $TPMSRCDIR/findutils-4.1.20.tar.gz ./
	if [ ! -f findutils-4.1.20.tar.gz ] ; then exit -1; fi
	tar -zxvf findutils-4.1.20.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd findutils-4.1.20
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticfindutils";exit -1; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticfindutils";exit -1; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticfindutils";exit -1; fi
	cd ..
	rm -rf findutils-4.1.20 findutils-4.1.20.tar.gz
	logmessage "Done findutils"
}

makefindutils4120() {
	echo "TPM: Building findutils..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f findutils-4.1.20.tar.gz ] ; then exit -1; fi
	tar -zxvf findutils-4.1.20.tar.gz
	cd findutils-4.1.20
	./configure --prefix=/usr 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error configuring findutils";exit -1; fi
	make libexecdir=/usr/bin localstatedir=/var/lib/misc 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making findutils";exit -1 ; fi
	make libexecdir=/usr/bin localstatedir=/var/lib/misc install
	if [ $? -ne 0 ]; then echo "Error installing findutils";exit -1 ; fi
	cd ..
	rm -rf findutils-4.1.20 findutils-4.1.20.tar.gz
	echo "TPM: Done findutils" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makestatictexinfo46() {
	logmessage "Building texinfo..."
	cp $TPMSRCDIR/texinfo-4.6.tar.gz ./
	if [ ! -f texinfo-4.6.tar.gz ] ; then exit -1; fi
	tar -zxvf texinfo-4.6.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd texinfo-4.6
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring statictexinfo";exit -1; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error building statictexinfo";exit -1; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing statictexinfo";exit -1; fi
	cd ..
	rm -rf texinfo-4.6 texinfo-4.6.tar.gz
	logmessage "Done texinfo"
}

maketexinfo46() {
	echo "TPM: Building texinfo..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f texinfo-4.6.tar.gz ] ; then exit -1; fi
	tar -zxvf texinfo-4.6.tar.gz
	cd texinfo-4.6
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring texinfo";exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making texinfo";exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing texinfo";exit -1; fi
	make TEXMF=/usr/share/texmf install-tex
	if [ $? -ne 0 ]; then echo "Error installing texmf";exit -1; fi
	cd ..
	if [ ! -f /usr/bin/info ] ; then exit -1; fi
	rm -rf texinfo-4.6 texinfo-4.6.tar.gz
	echo "TPM: Done texinfo" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makestaticutillinux212() {
	logmessage "Building static utillinux..."
	if [ ! -f util-linux-2.12.tar.gz ] ; then exit -1; fi
	tar -zxvf util-linux-2.12.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd util-linux-2.12
	LDFLAGS="-static" ./configure 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticutillinux";exit -1; fi
	make -C lib 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticutillinux";exit -1; fi
	make -C mount mount umount 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticutillinux";exit -1; fi
	cp mount/{mount,umount} $TPMSTATIC/bin 
	cd ..
	rm -rf util-linux-2.12 util-linux-2.12.tar.gz
	logmessage "Done utillinux"
}

makeutillinux212() {
	echo "TPM: Building utillinux..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	cp $TPMSRCDIR/util-linux-2.12.tar.gz ./	
	if [ ! -f util-linux-2.12.tar.gz ] ; then exit -1; fi
	tar -zxvf util-linux-2.12.tar.gz
	cd util-linux-2.12
	cp hwclock/hwclock.c{,.backup}
	sed 's%etc/adjtime%var/lib/hwclock/adjtime%' hwclock/hwclock.c.backup > hwclock/hwclock.c
	mkdir -p /var/lib/hwclock
	./configure
	if [ $? -ne 0 ]; then echo "Error configuring utillinux"; exit -1; fi
	make HAVE_SLN=yes
	if [ $? -ne 0 ]; then echo "Error making utillinux"; exit -1; fi
	make HAVE_SLN=yes install
	if [ $? -ne 0 ]; then echo "Error installing utillinux"; exit -1; fi
	cd ..
	ln /usr/bin/whereis /usr/bin/which
	if [ ! -f /bin/mount ] ; then exit -1; fi
	rm -rf util-linux-2.12.tar.gz util-linux-2.12
	echo "TPM: Done utillinux" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


###
###
### This section is the beginning of all the various make functions
###
###

makestaticroot() {
	logmessage "TPM: Making directory $TPMSTATIC..."
	cd $TPMBUILD
	mkdir $TPMSTATIC
	cd $TPMSTATIC
	mkdir bin boot dev etc home lib mnt root sbin tmp usr var proc
	cd var; mkdir lock log run spool
	cd ../usr; mkdir bin include lib local sbin share src
	cd share/; mkdir man; cd man
	mkdir man1 man2 man3 man4 man5 man6 man7 man8 man9
	cd ../..; ln -s share/man man
	cd $TPMBUILD


	cat > README.txt << "EOF"
ThePacketMaster Linux Security Server v1.2.1
Copyright 2003


*********
* Legal *
*********

ThePacketMaster Linux Security Server IS PROVIDED ``AS IS'' AND WITHOUT
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR ANY PARTICULAR
PURPOSE.

IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA, OR PROFITS OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.


*********
* About *
*********

ThePacketMaster Linux Security Server is meant for use as a penetration 
testing tools for vulnerability assessments.  I created this distribution 
as a tool for scanning my own networks.  You should never use this, or any 
penetration testing tool on any networks without the administrator's 
consent and full knowledge of what is being done.


************
* Contents *
************

All software packages including in this distribution are covered under the 
GPL.  All associated licenses for each piece of software is kept under the
/license directory.  Many software packages just come with the standard 
GPL license, so I have included it only once in the /license directory.

Since space is at a premium on CDs, I have only included binaries on the 
CD, not source code.  If you need the source code for any of the packages, 
or anything else regarding a particular package, please check the list 
below for the home page of the package.




This distribution includes:
ethereal	(GUI and text based packet sniffer)
hping2		(network connectivity tester)
hunt		(packet sniffer/connection hijacker)
john		(password cracker)
crack		(password cracker)
chntpw		(Windows password changer)
lsof		(list open files per process)
minicom		(terminal communication program)
nbtscan		(NetBIOS over TCP/IP scanner)
nessus		(Vulnerability scanner)
netcat		(TCP "swiss-army" connection tool)
ngrep		(packet matching sniffer)
nikto		(Perl program for web server vulnerability scanning)
nmap		(Port scanner)
ntop		(network performance monitor, with web GUI)
openssh		(SSH client and daemon)
rp-pppoe	(Roaring Penguin PPPoE client for DSL)
samba		(SMB-based file sharing server and client)
tcpdump		(text-only packet sniffer)
tct		(The Coroner's Toolkit, computer forensics)
bind		(for name service)
cdrtools	(making ISO images and recording CDs)
p0f		(passive OS fingerprinting)
acrobat		(sometimes you might need a PDF)
opera		(you'll have to purchase a license to get rid of the ads)
screen		(in case you need to lock the text screen)
setiathome	(since this is shareware, please contribute some CPU 
		cycles to my favorite distributed project, using my 
		account of course)

fragroute	(traffic interceptor/modifier)
http://www.monkey.org/~dugsong/fragroute/

sara		(security scanner)
http://www-arc.com/sara/sara.html

*********
* NOTES *
*********

Password Crackers
-----------------
I have included both major password crackers, Crack and John the Ripper.  
In my experience, both have their advantages.  John the Ripper is 
generally quicker in its first two phases producing weak or dictionary 
based passwords very quickly.  The third phase is brute force, and you'll 
be waiting the next 1,000 years before that finishs.

Crack seems to have better password mangling rules and while it takes
longer to run, generally you can get the more difficult weak passwords
cracked without resorting to brute force.

Crack 
----- 

While Crack is included on this CD, it is not compiled.  This is because
Crack has to be compiled differently for use with different password file
formats, such as Standard crypt and MD5 password files.  Also, Crack only
writes its files to its home directory which is in /usr/c50a/, and
therefore read-only, so it must be copied to a RAM drive in order to
function properly.  I have created an initialization script to set up
Crack for different situations.  Simply execute /etc/init.d/crack with
either the argument 'standard' or 'md5' and it will copy the
/usr/c50a directory to /var/c50a/ and compile Crack with the
appropriate settings.  You can then run it as you wish.  Also, I have
included a 500,000 word dictionary, /usr/c50a/dict/1/dictionary.  
This dictionary is compiled in by default.

 
John the Ripper
---------------

John the Ripper comes with a very small dictionary to start off with, and
of course it is in a read-only directory which the program wants to write
to.  If you wish to run John, I have created an initialization script,
/etc/init.d/john.  This will copy the directory /usr/john to 
/var/john-1.6 and also substitute the password.lst file with a 500,000 
word dictionary I have included in /usr/c50a/dict/1/dictionary.

ACX100
------
For those users that have purchased cards such as the D-Link 650+, which 
uses the infamous TI chipset, I have included 2 versions of the driver.  
The first is the linux driver acx100sta, which can be loaded by simply 
typing 'modprobe acx100sta'.  If this doesn't work for you, I have also 
included the acx100_pci driver which is based on source code from the 
open source acx100 project.  This driver requires the Windows binaries to 
be downloaded into a directory (such as /var/tmp) and then typing 
'modprobe acx100_pci firmware_dir=/var/tmp'. 

If you do need to download the Windows drivers, a quick command to do it 
is:
 wget ftp://ftp.dlink.com/Wireless/dwl520+/Driver/dwl520+_driver_302.zip

Then unzip the file and copy the appropriate files to /var/tmp (or any 
other directory you would prefer):
 cp Win2000/WLANGEN.BIN Win2000/RADIO0d.BIN Win2000/RADIO11.BIN /var/tmp

For more information, please look in the file: /license/acx100-README
EOF



}

makeroot() {

	echo "Making / directory structure" 
	cd /
	mkdir bin boot dev etc home lib mnt root sbin tmp usr var proc opt license readme

	echo "Making /etc directory structure"
	cd /etc; mkdir opt

	echo "Making /var directory structure"
	cd /var; mkdir lock log run spool opt mail tmp cache lib local empty

	echo "Making /usr directory structure"
	cd /usr; mkdir bin home include lib local sbin share src

	echo "Making /usr/share directory structure"
	cd /usr/share/; mkdir man misc; cd man
	mkdir man1 man2 man3 man4 man5 man6 man7 man8 man9

	echo "Making /usr/local directory structure"
	cd /usr/local; mkdir bin games include lib man sbin share src

	cd ../..; ln -s share/man man
	ln -s ../var/tmp /usr

	echo "Adjusting permissions"
	cd /
	chmod 0750 /root
	chmod 1777 /tmp /var/tmp

	echo "Mounting /proc"
	mount proc /proc -t proc

	echo "Touch /etc/mtab"
	touch /etc/mtab

	echo "Creating passwd and group files"
	cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/:/bin/false
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/adm:
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
uucp:x:10:14:uucp:/var/spool/uucp:
smmsp:x:25:25:smmsp:/usr/home/partimage:/bin/false
clamav:x:92:92:clamav:/var/clamav:/bin/false
www:x:93:93:www:/usr/home/www:/bin/false
partimag:x:94:94:partimage:/usr/home/partimage:/bin/sh
sshd:x:95:95:sshd:/usr/home/sshd:/bin/false
ntop:x:96:96:ntop:/usr/home/ntop:/bin/false
mysql:x:97:97:mysql:/usr/home/mysql:/bin/false
kismet:x:98:98:kismet:/usr/home/kismet:/bin/bash
nobody:x:99:99:nobody:/:/bin/false
EOF

	cat > /etc/group << "EOF"
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
mail:x:12:mail
uucp:x:14:uucp
utmp:x:22:
smmsp:x:25:
clamav:x:92:
www:x:93:
partimag:x:94:
sshd:x:95:
ntop:x:96:
mysql:x:97:
kismet:x:98:
nobody:x:99:
EOF

	
	
	
}

makestaticbinutils() {
	logmessage "Building static binutils..."
	cp $TPMSRCDIR/binutils-2.14.tar.gz ./
	if [ ! -f binutils-2.14.tar.gz ] ; then exit -1; fi
	tar -zxvf binutils-2.14.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd binutils-2.14
	./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticbinutils";exit -1; fi
	make configure-host
	if [ $? -ne 0 ]; then echo "Error making configure-host staticbinutils"; exit -1; fi
	make LDFLAGS="-all-static" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticbinutils"; exit -1; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticbinutils";exit -1; fi
	cd ..
	rm -rf binutils-2.14
	logmessage "Done binutils"
}


makestaticsed() {
	logmessage "Building static sed..."
	if [ ! -f sed-4.0.7.tar.gz ] ; then exit -1; fi
	tar -zxvf sed-4.0.7.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd sed-4.0.7
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticsed";exit -1; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticsed";exit -1; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticsed";exit -1; fi
	cd ..
	rm -rf sed-4.0.7
	logmessage "Done sed"
}

makestaticgrep() {
	logmessage "Building static grep..."
	if [ ! -f grep-2.5.1.tar.gz ] ; then exit; fi
	tar -zxvf grep-2.5.1.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd grep-2.5.1
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-perl-regexp --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticgrep";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticgrep";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticgrep";exit; fi
	cd ..
	rm -rf grep-2.5.1
	logmessage "Done grep"
}

makestaticfindutils() {
	logmessage "Building static findutils..."
	if [ ! -f findutils-4.1.tar.gz ] ; then exit; fi
	tar -zxvf findutils-4.1.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd findutils-4.1
	patch -Np1 -i ../findutils-4.1.patch
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticfindutils";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticfindutils";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticfindutils";exit; fi
	cd ..
	rm -rf findutils-4.1
	logmessage "Done findutils"
}

makestatictar() {
	logmessage "Building static tar..."
	if [ ! -f tar-1.13.tar.gz ] ; then exit; fi
	tar -zxvf tar-1.13.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd tar-1.13
	LDFLAGS="-static" ./configure  --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring statictar";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making statictar";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing statictar";exit; fi
	cd ..
	rm -rf tar-1.13
	logmessage "Done tar"
}

makestaticgzip() {
	logmessage "Building static gzip..."
	if [ ! -f gzip-1.2.4.tar.gz ] ; then exit; fi
	tar -zxvf gzip-1.2.4.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd gzip-1.2.4
	./configure --prefix=$TPMSTATIC 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticgzip";exit; fi
	make LDFLAGS="-static" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticgzip";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticgzip";exit; fi
	cd ..
	rm -rf gzip-1.2.4
	logmessage "Done gzip"
}

makestaticpatch() {
	logmessage "Building static patch..."
	if [ ! -f patch-2.5.4.tar.gz ] ; then exit; fi
	tar -zxvf patch-2.5.4.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd patch-2.5.4
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticpatch";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticpatch";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticpatch";exit; fi
	cd ..
	rm -rf patch-2.5.4
	logmessage "Done patch"
}

makestaticgawk() {
	logmessage "Building static gawk..."
	if [ ! -f gawk-3.1.1.tar.gz ] ; then exit; fi
	tar -zxvf gawk-3.1.1.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd gawk-3.1.1
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticgawk";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticgawk";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticgawk";exit; fi
	cd ..
	rm -rf gawk-3.1.1
	logmessage "Done gawk"
}

makestaticcoreutils() {
	logmessage "Building static coreutils..."
	if [ ! -f coreutils-5.0.tar.gz ] ; then exit; fi
	tar -zxvf coreutils-5.0.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd coreutils-5.0
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticcoreutils";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticcoreutils";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticcoreutils";exit; fi
	cd ..
	rm -rf coreutils-5.0
	logmessage "Done coreutils"
}

makestaticgcc() {
	logmessage "Building static gcc..."
	if [ ! -f gcc-core-3.2.3.tar.gz ] ; then exit; fi
	tar -zxvf gcc-core-3.2.3.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	mkdir gcc-build
	cd gcc-build
	../gcc-3.2.3/configure --prefix=$TPMSTATIC --disable-nls --disable-shared \
		--with-as=$TPMSTATIC/bin/as --with-ld=$TPMSTATIC/bin/ld 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticgcc" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG; exit; fi
	make BOOT_LDFLAGS="-static" bootstrap 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticgcc" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG; exit; fi
	make prefix=$TPMSTATIC install-no-fixedincludes 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticgcc" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG ; exit; fi
	ln -s gcc $TPMSTATIC/bin/cc
	cd ..
	rm -rf gcc-build gcc-3.2.3
	logmessage "Done gcc"
}

makestaticmake() {
	logmessage "Building static make..."
	if [ ! -f make-3.80.tar.gz ] ; then exit; fi
	tar -zxvf make-3.80.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd make-3.80
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticmake";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticmake";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticmake";exit; fi
	cd ..
	rm -rf make-3.80
	logmessage "Done make"
}

makestaticutillinux() {
	logmessage "Building static utillinux..."
	if [ ! -f util-linux-2.11z.tar.gz ] ; then exit; fi
	tar -zxvf util-linux-2.11z.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd util-linux-2.11z
	LDFLAGS="-static" ./configure 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticutillinux";exit; fi
	make -C lib 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticutillinux";exit; fi
	make -C mount mount umount 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticutillinux";exit; fi
	cp mount/{mount,umount} $TPMSTATIC/bin 
	cd ..
	rm -rf util-linux-2.11z
	logmessage "Done utillinux"
}


makestaticbash() {
	logmessage "Building static bash..."
	if [ ! -f bash-2.05b.tar.gz ] ; then exit; fi
	tar -zxvf bash-2.05b.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd bash-2.05b
	./configure --enable-static-link --prefix=$TPMSTATIC --with-curses 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticbash";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticbash";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticbash";exit; fi
	cd ..
	rm -rf bash-2.05b
	logmessage "Done bash"
}

makestaticdiffutils() {
	logmessage "Building static diffutils..."
	if [ ! -f diffutils-2.8.1.tar.gz ] ; then exit; fi
	tar -zxvf diffutils-2.8.1.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd diffutils-2.8.1
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring staticdiffutils";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticdiffutils";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticdiffutils";exit; fi
	cd ..
	rm -rf diffutils-2.8.1
	logmessage "Done diffutils"
}

makestaticbzip2() {
	logmessage "Building static bzip..."
	if [ ! -f bzip2-1.0.2.tar.gz ] ; then exit; fi
	tar -zxvf bzip2-1.0.2.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd bzip2-1.0.2
	make CC="gcc -static -s" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error making staticbzip2";exit; fi
	make PREFIX=$TPMSTATIC install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing staticbzip2";exit; fi
	cd ..
	rm -rf bzip2-1.0.2
	logmessage "Done bzip2"
}

makestatictexinfo() {
	logmessage "Building static texinfo..."
	if [ ! -f texinfo-4.5.tar.gz ] ; then exit; fi
	tar -zxvf texinfo-4.5.tar.gz 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd texinfo-4.5
	LDFLAGS="-static" ./configure --prefix=$TPMSTATIC --disable-nls 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error configuring statictexinfo";exit; fi
	make 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error building statictexinfo";exit; fi
	make install 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	if [ $? -ne 0 ]; then echo "Error installing statictexinfo";exit; fi
	cd ..
	rm -rf texinfo-4.5
	logmessage "Done texinfo"
}

makemanpages() {
	echo "Making man pages"
	if [ ! -f man-pages-1.56.tar.gz ] ; then exit; fi
	tar -zxvf  man-pages-1.56.tar.gz
	cd man-pages-1.56
	echo "Installing man pages..."
	make install
	if [ $? -ne 0 ]; then echo "Error installing man pages";exit; fi
	cd ..
	rm -rf man-pages-1.56
	echo "Done"
}

makeglibc() {
	logmessage2 "Making glibc"
	if [ ! -f glibc-2.3.1.tar.gz ] ; then exit -1; fi
	if [ ! -f glibc-linuxthreads-2.3.1.tar.gz ] ; then exit -1; fi
	tar -zxvf glibc-2.3.1.tar.gz

	cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

publickey: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: db files

# End /etc/nsswitch.conf

EOF


	cd glibc-2.3.1
	tar -zxvf ../glibc-linuxthreads-2.3.1.tar.gz
	###Edit login/Makefile and change root to 0
	###Edit malloc/Makefile and change
	###patch -Np1 -i ../glibc-2.3.1-root-perl.patch
	touch /etc/ld.so.conf
	mkdir ../glibc-build
	cd ../glibc-build
	../glibc-2.3.1/configure --prefix=/usr --disable-profile --enable-add-ons --libexecdir=/usr/bin
	if [ $? -ne 0 ]; then logmessage2 "Error configuring glibc";exit -1; fi
	echo "cross-compiling = no" > configparms
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making glibc";exit -1; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error installing glibc";exit -1; fi
	###Adding locales sucks up over 17MB, so I'm not putting this in
	###make localedata/install-locales
	###if [ $? -ne 0 ]; then logmessage2 "Error installing glibc locales";exit -1; fi
	cd ../
	rm -rf glibc-build glibc-2.3.1
	logmessage2 "Done glibc"
}

makegcc33() {
	logmessage2 "TPM: Building gcc..."
	if [ ! -f gcc-3.3.tar.gz ] ; then exit -1; fi
	tar -zxvf gcc-3.3.tar.gz
	rm -rf gcc-build
	mkdir gcc-build
	cd gcc-build
	../gcc-3.3/configure --prefix=/usr --enable-shared \
		--enable-threads=posix --with-slibdir=/lib \
		--enable-__cxa_atexit --enable-clocale=gnu \
		--disable-libgcj --disable-multilib \
		--enable-languages=c,c++,objc
	make bootstrap
	if [ $? -ne 0 ]; then echo "Error making gcc bootstrap";exit -1; fi
	make install-no-fixedincludes
	if [ $? -ne 0 ]; then echo "Error installing gcc";exit -1; fi
	ln -s ../usr/bin/cpp /lib
	ln -s ../bin/cpp /usr/lib
	ln -s gcc /usr/bin/cc

	if [ ! -f /lib/cpp ] ; then exit -1; fi
	if [ ! -f /usr/lib/cpp ] ; then exit -1; fi

 	cd ..

	rm -rf gcc-build gcc-3.3
	logmessage2 "TPM: Done building gcc"
}

makegcc331() {
	logmessage2 "TPM: Building gcc..."
	if [ ! -f gcc-3.3.1.tar.gz ] ; then exit -1; fi
	tar -zxvf gcc-3.3.1.tar.gz
	rm -rf gcc-build
	mkdir gcc-build
	cd gcc-build
	../gcc-3.3.1/configure --prefix=/usr --enable-shared \
		--enable-threads=posix --with-slibdir=/lib \
		--enable-__cxa_atexit --enable-clocale=gnu \
		--disable-libgcj --disable-multilib \
		--enable-languages=c,c++,objc
	make bootstrap
	if [ $? -ne 0 ]; then echo "Error making gcc bootstrap";exit -1; fi
	make install-no-fixedincludes
	if [ $? -ne 0 ]; then echo "Error installing gcc";exit -1; fi
	ln -s ../usr/bin/cpp /lib
	ln -s ../bin/cpp /usr/lib
	ln -s gcc /usr/bin/cc

	if [ ! -f /lib/cpp ] ; then exit -1; fi
	if [ ! -f /usr/lib/cpp ] ; then exit -1; fi

 	cd ..

	rm -rf gcc-build gcc-3.3.1
	logmessage2 "TPM: Done building gcc"
}

makegcc332() {
	logmessage2 "TPM: Building gcc..."
	if [ ! -f gcc-3.3.2.tar.gz ] ; then exit -1; fi
	tar -zxvf gcc-3.3.2.tar.gz
	rm -rf gcc-build
	mkdir gcc-build
	cd gcc-build
	../gcc-3.3.2/configure --prefix=/usr --enable-shared \
		--enable-threads=posix --with-slibdir=/lib \
		--enable-__cxa_atexit --enable-clocale=gnu \
		--disable-libgcj --disable-multilib \
		--enable-languages=c,c++,objc
	make bootstrap
	if [ $? -ne 0 ]; then echo "Error making gcc bootstrap";exit -1; fi
	make install-no-fixedincludes
	if [ $? -ne 0 ]; then echo "Error installing gcc";exit -1; fi
	ln -s ../usr/bin/cpp /lib
	ln -s ../bin/cpp /usr/lib
	ln -s gcc /usr/bin/cc

	if [ ! -f /lib/cpp ] ; then exit -1; fi
	if [ ! -f /usr/lib/cpp ] ; then exit -1; fi

 	cd ..

	rm -rf gcc-build gcc-3.3.2
	logmessage2 "TPM: Done building gcc"
}



makegcc323() {
	logmessage2 "TPM: Building gcc..."
	if [ ! -f gcc-3.2.3.tar.gz ] ; then exit -1; fi
	tar -zxvf gcc-3.2.3.tar.gz
	rm -rf gcc-build
	mkdir gcc-build
	cd gcc-build
	../gcc-3.2.3/configure --prefix=/usr --enable-shared \
		--enable-threads=posix --with-slibdir=/lib \
		--enable-__cxa_atexit --enable-clocale=gnu \
		--disable-libgcj --disable-multilib \
		--enable-languages=c,c++,objc
	make bootstrap
	if [ $? -ne 0 ]; then echo "Error making gcc bootstrap";exit -1; fi
	make install-no-fixedincludes
	if [ $? -ne 0 ]; then echo "Error installing gcc";exit -1; fi
	ln -s ../usr/bin/cpp /lib
	ln -s ../bin/cpp /usr/lib
	ln -s gcc /usr/bin/cc
 	cd ..

	rm -rf gcc-build gcc-3.2.3
	logmessage2 "TPM: Done building gcc"
}


makezlib114() {
	echo "TPM: Building zlib..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f zlib-1.1.4.tar.gz ] ; then exit; fi
	tar -zxvf zlib-1.1.4.tar.gz
	cd /zlib-1.1.4
	CFLAGS="$CFLAGS -fPIC" ./configure --prefix=/usr --shared
	if [ $? -ne 0 ]; then echo "Error configuring zlib";exit; fi
	make LIBS="libz.so.1.1.4 libz.a"
	if [ $? -ne 0 ]; then echo "Error making zlib";exit; fi
	echo "Installing"
	make LIBS="libz.so.1.1.4 libz.a" install
	if [ $? -ne 0 ]; then echo "Error installing zlib";exit; fi
	mv /usr/lib/libz.so.* /lib
	ln -sf ../../lib/libz.so.1 /usr/lib/libz.so
	cp zlib.3 /usr/share/man/man3
	cd ..
	rm -rf zlib-1.1.4
	echo "TPM: Done zlib" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makedevs() {
	echo "TPM: Building /dev..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f MAKEDEV-1.7 ] ; then exit -1; fi
	cp MAKEDEV-1.7 /dev/MAKEDEV
	cd /dev
	chmod 754 MAKEDEV
	./MAKEDEV -v generic
	cd ..
	echo "TPM: Done making devs" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


#This is just a template
makestatic() {
	echo ""
}



dochroot() {
	echo $TPMBUILD
	mkdir $TPMBUILD/bin 2>> /dev/null 1>> /dev/null

	#So this script can continue to function
	ln -s /static/bin/bash $TPMBUILD/bin/bash 2>> /dev/null 1>> /dev/null
	ln -s /static/bin/bash $TPMBUILD/bin/sh 2>> /dev/null 1>> /dev/null

	echo "TPM: Executing chroot..." 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	chroot $TPMBUILD /static/bin/env -i HOME=/root TERM=$TERM PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin:/static/bin /static/bin/bash --login ./build-static-bootstrap.sh afterchroot
	if [ $? -ne 0 ]; then echo "Error during dochroot";exit; fi
}

dochroot2() {
	echo "Executing chroot again..." 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	chroot $TPMBUILD /usr/bin/env -i HOME=/root TERM=$TERM PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin bin/bash --login ./build-static-bootstrap.sh afterchroot2
	if [ $? -ne 0 ]; then echo "Error during dochroot2";exit; fi
}

installkernelheaders2424() {
	echo "TPM: Installing linux headers..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.24.tar.gz ] ; then exit -1; fi
	tar -zxvf linux-2.4.24.tar.gz >> $TPMBUILDLOGFILE
	chown -R 0:0 linux-2.4.24
	ln -s /static/bin/pwd /bin/pwd
	cd linux-2.4.24
	make mrproper 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making mrproper";exit -1; fi
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	cd ..

	echo "TPM: Done installing kernel headers" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


installkernelheaders2423() {
	echo "TPM: Installing linux headers..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.23.tar.gz ] ; then exit -1; fi
	tar -zxvf linux-2.4.23.tar.gz >> $TPMBUILDLOGFILE
	chown -R 0:0 linux-2.4.23
	ln -s /static/bin/pwd /bin/pwd
	cd linux-2.4.23
	make mrproper 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making mrproper";exit -1; fi
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	cd ..

	echo "TPM: Done installing kernel headers" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

installkernelheaders2422() {
	echo "TPM: Installing linux headers..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.22.tar.gz ] ; then exit -1; fi
	tar -zxvf linux-2.4.22.tar.gz >> $TPMBUILDLOGFILE
	chown -R 0:0 linux-2.4.22
	ln -s /static/bin/pwd /bin/pwd
	cd linux-2.4.22
	make mrproper 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making mrproper";exit -1; fi
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	cd ..

	echo "TPM: Done installing kernel headers" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


installkernelheaders2421() {
	echo "TPM: Installing linux headers..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.21.tar.gz ] ; then exit -1; fi
	tar -zxvf linux-2.4.21.tar.gz >> $TPMBUILDLOGFILE
	chown -R 0:0 linux-2.4.21
	ln -s /static/bin/pwd /bin/pwd
	cd linux-2.4.21
	make mrproper 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making mrproper";exit -1; fi
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	cd ..

	echo "TPM: Done installing kernel headers" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

installkernelheaders2420() {
	echo "TPM: Installing linux headers..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.20.tar.gz ] ; then exit -1; fi
	tar -zxvf linux-2.4.20.tar.gz >> $TPMBUILDLOGFILE
	chown -R 0:0 linux-2.4.20
	ln -s /static/bin/pwd /bin/pwd
	cd linux-2.4.20
	make mrproper 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making mrproper";exit -1; fi
	make include/linux/version.h 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making kernel headers";exit -1; fi
	make symlinks 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making symbolic links for kernel headers";exit -1; fi
	cp -HR include/asm /usr/include
	cp -R include/asm-generic /usr/include
	cp -R include/linux /usr/include
	touch /usr/include/linux/autoconf.h
	cd ..

	echo "TPM: Done installing kernel headers" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makefindutils() {
	echo "TPM: Building findutils..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f findutils-4.1.tar.gz ] ; then exit; fi
	tar -zxvf findutils-4.1.tar.gz
	cd findutils-4.1
	patch -Np1 -i ../findutils-4.1.patch
	patch -Np1 -i ../findutils-4.1-segfault.patch
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring findutils";exit; fi
	make libexecdir=/usr/bin localstatedir=/var/lib/misc 
	if [ $? -ne 0 ]; then echo "Error making findutils";exit; fi
	make libexecdir=/usr/bin localstatedir=/var/lib/misc install
	if [ $? -ne 0 ]; then echo "Error installing findutils";exit; fi
	cd ..
	rm -rf findutils-4.1
	echo "TPM: Done findutils" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makegawk() {
	echo "TPM: Building gawk..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f gawk-3.1.2.tar.gz ] ; then exit; fi
	tar -zxvf gawk-3.1.2.tar.gz
	cd gawk-3.1.2
	patch -Np1 -i ../gawk-3.1.2.patch
	./configure --prefix=/usr --libexecdir=/usr/bin
	if [ $? -ne 0 ]; then echo "Error configuring gawk";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making gawk";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing gawk";exit; fi
	cd ..

	rm -rf gawk-3.1.2
	echo "TPM: Done gawk" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makencurses() {
	echo "TPM: Building ncurses..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f ncurses-5.3.tar.gz ] ; then exit; fi
	tar -zxvf ncurses-5.3.tar.gz
	cd ncurses-5.3
	./configure --prefix=/usr --with-shared
	if [ $? -ne 0 ]; then echo "Error configuring ncurses";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making ncurses";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing ncurses";exit; fi
	chmod 755 /usr/lib/*.5.3
	mv /usr/lib/libncurses.so.5* /lib

	ln -sf libncurses.a /usr/lib/libcurses.a &&
	ln -sf ../../lib/libncurses.so.5 /usr/lib/libncurses.so &&
	ln -sf ../../lib/libncurses.so.5 /usr/lib/libcurses.so
	cd ..

	rm -rf ncurses-5.3
	echo "TPM: Done ncurses" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makevim() {
	echo "TPM: Building vim..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f vim-6.1.tar.gz ] ; then exit; fi
	tar -zxvf vim-6.1.tar.gz
	cd vim61
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring vim";exit; fi
	make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\"
	if [ $? -ne 0 ]; then echo "Error making vim";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing vim";exit; fi
	ln -s vim /usr/bin/vi
	cat > /root/.vimrc << "EOF"
" Begin /root/.vimrc

set nocompatible
set bs=2

" End /root/.vimrc
EOF

	cd ..
	rm -rf vim61
	echo "TPM: Done vim" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makem4() {
	echo "TPM: Building m4..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f m4-1.4.tar.gz ] ; then exit; fi
	tar -zxvf m4-1.4.tar.gz
	cd m4-1.4
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring m4";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making m4";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing m4";exit; fi
	cd ..
	rm -rf m4-1.4
	echo "TPM: Done m4" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makebison() {
	echo "TPM: Building bison..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f bison-1.875.tar.gz ] ; then exit; fi
	tar -zxvf bison-1.875.tar.gz
	cd bison-1.875
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring bison";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making bison";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing bison";exit; fi
	cd ..
	rm -rf bison-1.875
	echo "TPM: Done bison" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

cleanoldbison() {
	rm -rvf /usr/local/bison-1.35
}

makeoldbison() {
	logmessage2 "Building bison..."
	if [ ! -f $TPMSRCDIR/bison-1.35.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/bison-1.35.tar.gz
	cd bison-1.35
	./configure --prefix=/usr/local/bison-1.35
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ..
	rm -rf bison-1.35
	cat > /usr/local/bison-1.35/bin/yacc << "EOF"
#! /bin/sh
exec /usr/local/bison-1.35/bin/bison -y "$@"
EOF
	chmod 755 /usr/local/bison-1.35/bin/yacc
	logmessage2 "Done oldbison"
}

makeless() {
	echo "TPM: Building less..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f less-381.tar.gz ] ; then exit; fi
	tar -zxvf less-381.tar.gz
	cd less-381
	./configure --prefix=/usr --bindir=/bin --sysconfdir=/etc
	if [ $? -ne 0 ]; then echo "Error configuring less";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making less";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing less";exit; fi
	cd ..
	rm -rf less-381
	echo "TPM: Done less" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makegroff() {
	echo "TPM: Building groff..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f groff-1.18.1.tar.gz ] ; then exit; fi
	tar -zxvf groff-1.18.1.tar.gz
	cd groff-1.18.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring groff";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making groff";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing groff";exit; fi
	ln -s soelim /usr/bin/zsoelim
	ln -s eqn /usr/bin/geqn
	ln -s tbl /usr/bin/gtbl
	cd ..
	rm -rf groff-1.18.1
	echo "TPM: Done groff" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makecoreutils() {
	echo "TPM: Building coreutils..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f coreutils-5.0.tar.gz ] ; then exit; fi
	tar -zxvf coreutils-5.0.tar.gz
	cd coreutils-5.0
	patch -Np1 -i ../coreutils-5.0-hostname.patch
	./configure --prefix=/usr --bindir=/bin
	if [ $? -ne 0 ]; then echo "Error configuring coreutils";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making coreutils";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing coreutils";exit; fi
	cd ..

	mv /usr/bin/{basename,date,echo,false,pwd} /bin
	mv /usr/bin/{sleep,stty,su,test,true,uname} /bin
	mv /usr/bin/{chgrp,chmod,chown,cp,dd,df,ln,ls,mkdir} /bin
	mv /usr/bin/{mknod,mv,rm,rmdir,sync,touch} /bin
	mv /bin/chroot /usr/sbin

	ln -s test /bin/[
	ln -s ../../bin/install /usr/bin

	rm -rf coreutils-5.0
	echo "TPM: Done coreutils" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makesed() {
	echo "TPM: Building sed..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f sed-4.0.7.tar.gz ] ; then exit; fi
	tar -zxvf sed-4.0.7.tar.gz
	cd sed-4.0.7
	./configure --prefix=/usr --bindir=/bin
	if [ $? -ne 0 ]; then echo "Error configuring sed";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making sed";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing sed";exit; fi
	cd ..
	if [ ! -f /bin/sed ] ; then exit; fi
	rm -rf sed-4.0.7
	echo "TPM: Done sed" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makeflex() {
	echo "TPM: Building flex..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f flex-2.5.4a.tar.gz ] ; then exit; fi
	tar -zxvf flex-2.5.4a.tar.gz
	cd flex-2.5.4
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring flex";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making flex";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing flex";exit; fi
	ln -s libfl.a /usr/lib/libl.a
	cat > /usr/bin/lex  << "EOF"
#!/bin/sh
# Begin /usr/bin/lex

exec /usr/bin/flex -l "$@"

#End /usr/bin/lex
EOF
	chmod 755 /usr/bin/lex
	cd ..
	if [ ! -f /usr/bin/flex ] ; then exit; fi
	rm -rf flex-2.5.4
	echo "TPM: Done flex" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makebinutils() {
	echo "Building binutils..."
	if [ ! -f binutils-2.14.tar.gz ] ; then exit; fi
	tar -zxvf binutils-2.14.tar.gz
	cd binutils-2.14
	#patch -Np1 -i ../binutils-2.13.2-2.13.2.1.patch
	./configure --enable-shared --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring binutils";exit; fi
	make tooldir=/usr
	if [ $? -ne 0 ]; then echo "Error making binutils";exit; fi
	make tooldir=/usr install
	if [ $? -ne 0 ]; then echo "Error installing binutils";exit; fi
	make tooldir=/usr install-info
	if [ $? -ne 0 ]; then echo "Error installing binutils info";exit; fi
	cp  ../binutils-2.14/include/libiberty.h /usr/include
	cd ..
	if [ ! -f /usr/bin/as ] ; then exit; fi
	rm -rf binutils-2.14
	echo "Done"
}

makegettext() {
	echo "TPM: Building gettext..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f gettext-0.11.5.tar.gz ] ; then exit; fi
	tar -zxvf gettext-0.11.5.tar.gz
	cd gettext-0.11.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring gettext";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making gettext";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing gettext";exit; fi
	cd ..
	if [ ! -f /usr/bin/gettext ] ; then exit; fi
	rm -rf gettext-0.11.5
	echo "TPM: Done gettext" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makenettools() {
	ln -s /bin/env /usr/bin/env
	echo "TPM: Building nettools..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f net-tools-1.60.tar.gz ] ; then exit; fi
	tar -zxvf net-tools-1.60.tar.gz
	cd net-tools-1.60

	cat > install.responses << "EOF"
n
y
y
y
y
y
n
n
n
y
n
n
n
y
n
y
y
y
n
y
n
n
n
y
y
y
y
n
n
y
n
n
y
y
y
EOF
	cat install.responses |	make
	if [ $? -ne 0 ]; then echo "Error making nettools";exit; fi
	make update
	if [ $? -ne 0 ]; then echo "Error updating nettools";exit; fi
	cd ..
	if [ ! -f /sbin/ifconfig ] ; then exit; fi
	rm -rf net-tools-1.60
	echo "TPM: Done nettools" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeperl() {
	echo "TPM: Building perl..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	mount 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	ls -ld /dev 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	ls -l /dev/null 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f perl-5.8.0.tar.gz ] ; then exit; fi
	tar -zxvf perl-5.8.0.tar.gz
	cd perl-5.8.0
	./configure.gnu --prefix=/usr 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error configuring perl" ; exit -1; fi
	make
#	make 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error making perl"; exit -1; fi
	make install 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then echo "Error installing perl";exit -1; fi
	cd ..
	if [ ! -f /usr/bin/perl ] ; then exit -1; fi
	rm -rf perl-5.8.0
	echo "TPM: Done perl" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

maketexinfo() {
	echo "TPM: Building texinfo..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f texinfo-4.5.tar.gz ] ; then exit; fi
	tar -zxvf texinfo-4.5.tar.gz
	cd texinfo-4.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring texinfo";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making texinfo";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing texinfo";exit; fi
	make TEXMF=/usr/share/texmf install-tex
	if [ $? -ne 0 ]; then echo "Error installing texmf";exit; fi
	cd ..
	if [ ! -f /usr/bin/info ] ; then exit; fi
	rm -rf texinfo-4.5
	echo "TPM: Done texinfo" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeautoconf() {
	echo "TPM: Building autoconf..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f autoconf-2.57.tar.gz ] ; then exit; fi
	tar -zxvf autoconf-2.57.tar.gz
	cd autoconf-2.57
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring autoconf";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making autoconf";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing autoconf";exit; fi
	cd ..
	if [ ! -f /usr/bin/autoconf ] ; then exit; fi
	rm -rf autoconf-2.57
	echo "TPM: Done autoconf" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeautomake() {
	echo "TPM: Building automake..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f automake-1.7.3.tar.gz ] ; then exit; fi
	tar -zxvf automake-1.7.3.tar.gz
	cd automake-1.7.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring automake";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing automake";exit; fi
	ln -s automake-1.7 /usr/share/automake
	cd ..
	if [ ! -f /usr/bin/automake ] ; then exit; fi
	rm -rf automake-1.7.3
	echo "TPM: Done automake" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makebash() {
	echo "TPM: Building bash..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f bash-2.05b.tar.gz ] ; then exit; fi
	tar -zxvf bash-2.05b.tar.gz
	cd bash-2.05b
	./configure --prefix=/usr --bindir=/bin
	if [ $? -ne 0 ]; then echo "Error configuring bash";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making bash";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing bash";exit; fi
	cd ..
	if [ ! -f /bin/bash ] ; then exit; fi
	rm -rf bash-2.05b
	echo "TPM: Done bash" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makefile() {
	echo "TPM: Building file..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f file-4.02.tar.gz ] ; then exit; fi
	tar -zxvf file-4.02.tar.gz
	cd file-4.02
	./configure --prefix=/usr --datadir=/usr/share/misc
	if [ $? -ne 0 ]; then echo "Error configuring file";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making file";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing file";exit; fi
	cd ..
	if [ ! -f /usr/bin/file ] ; then exit; fi
	rm -rf file-4.02
	echo "TPM: Done file" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makelibtool() {
	echo "TPM: Building libtool..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f libtool-1.5.tar.gz ] ; then exit; fi
	tar -zxvf libtool-1.5.tar.gz
	cd libtool-1.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring libtool";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making libtool";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing libtool";exit; fi
	cd ..
	if [ ! -f /usr/bin/libtool ] ; then exit; fi
	rm -rf libtool-1.5
	echo "TPM: Done libtool" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makebin86() {
	echo "TPM: Building bin86..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f bin86-0.16.11.tar.gz ] ; then exit; fi
	tar -zxvf bin86-0.16.11.tar.gz
	cd bin86-0.16.11
	make
	if [ $? -ne 0 ]; then echo "Error making bin86";exit; fi
	make PREFIX=/usr install
	if [ $? -ne 0 ]; then echo "Error installing bin86";exit; fi
	cd ..
	if [ ! -f /usr/bin/as86 ] ; then exit; fi
	rm -rf bin86-0.16.11
	echo "TPM: Done bin86" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makebzip2() {
	echo "TPM: Building bzip2..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f bzip2-1.0.2.tar.gz ] ; then exit; fi
	tar -zxvf bzip2-1.0.2.tar.gz
	cd bzip2-1.0.2
	make -f Makefile-libbz2_so
	if [ $? -ne 0 ]; then echo "Error making libbz2";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making bzip2";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing bzip2";exit; fi
	cp bzip2-shared /bin/bzip2
	cp -a libbz2.so* /lib
	ln -s ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
	rm /usr/bin/{bunzip2,bzcat,bzip2}
	mv /usr/bin/{bzip2recover,bzless,bzmore} /bin
	ln -s bzip2 /bin/bunzip2
	ln -s bzip2 /bin/bzcat
	cd ..
	if [ ! -f /bin/bunzip2 ] ; then exit; fi
	rm -rf bzip2-1.0.2
	echo "TPM: Done bzip2" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeed() {
	echo "TPM: Building ed..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f ed-0.2.tar.gz ] ; then exit; fi
	tar -zxvf ed-0.2.tar.gz
	cd ed-0.2
	patch -Np1 -i ../ed-0.2.patch
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring ed";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making ed";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing ed";exit; fi
	mv /usr/bin/{ed,red} /bin
	cd ..
	if [ ! -f /bin/ed ] ; then exit; fi
	rm -rf ed-0.2
	echo "TPM: Done ed" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makekbd() {
	echo "TPM: Building kbd..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f kbd-1.08.tar.gz ] ; then exit; fi
	tar -zxvf kbd-1.08.tar.gz
	cd kbd-1.08
	patch -Np1 -i ../kbd-1.08.patch
	./configure
	if [ $? -ne 0 ]; then echo "Error configuring kbd";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making kbd";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing kbd";exit; fi
	cd ..
	if [ ! -f /usr/bin/dumpkeys ] ; then exit; fi
	rm -rf kbd-1.08
	echo "TPM: Done kbd" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makediffutils() {
	echo "TPM: Building diffutils..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f diffutils-2.8.1.tar.gz ] ; then exit; fi
	tar -zxvf diffutils-2.8.1.tar.gz
	cd diffutils-2.8.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring diffutils";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making diffutils";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing diffutils";exit; fi
	cd ..
	if [ ! -f /usr/bin/diff ] ; then exit; fi
	rm -rf diffutils-2.8.1
	echo "TPM: Done diffutils" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makee2fsprogs() {
	echo "TPM: Building e2fsprogs..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f e2fsprogs-1.33.tar.gz ] ; then exit; fi
	tar -zxvf e2fsprogs-1.33.tar.gz
	mkdir e2fsprogs-build
	cd e2fsprogs-build
	../e2fsprogs-1.33/configure --prefix=/usr --with-root-prefix="" --enable-elf-shlibs
	if [ $? -ne 0 ]; then echo "Error configuring e2fsprogs";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making e2fsprogs";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing e2fsprogs";exit; fi
	make install-libs
	if [ $? -ne 0 ]; then echo "Error installing e2fsprogs lib";exit; fi
	install-info /usr/share/info/libext2fs.info /usr/share/info/dir
	cd ..
	if [ ! -f /sbin/e2fsck ] ; then exit; fi
	rm -rf e2fsprogs-1.33 e2fsprogs-build
	echo "TPM: Done e2fsprogs" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makegrep() {
	echo "TPM: Building grep..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f grep-2.5.1.tar.gz ] ; then exit; fi
	tar -zxvf grep-2.5.1.tar.gz
	cd grep-2.5.1
	./configure --prefix=/usr --bindir=/bin
	if [ $? -ne 0 ]; then echo "Error configuring grep";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making grep";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing grep";exit; fi
	cd ..
	if [ ! -f /bin/grep ] ; then exit; fi
	rm -rf grep-2.5.1
	echo "TPM: Done grep" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makegzip() {
	echo "TPM: Building gzip..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f gzip-1.2.4.tar.gz ] ; then exit; fi
	tar -zxvf gzip-1.2.4.tar.gz
	cd gzip-1.2.4
	patch -Np1 -i ../gzip-1.2.4b.patch
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring gzip";exit; fi
	cp gzexe.in{,.backup}
	sed 's%"BINDIR"%/bin%' gzexe.in.backup > gzexe.in
	make
	if [ $? -ne 0 ]; then echo "Error making gzip";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing gzip";exit; fi
	mv /usr/bin/gzip /bin
	rm /usr/bin/{gunzip,zcat}
	ln -s gzip /bin/gunzip
	ln -s gzip /bin/zcat
	ln -s gunzip /bin/uncompress
	cd ..
	if [ ! -f /bin/gzip ] ; then exit; fi
	rm -rf gzip-1.2.4
	echo "TPM: Done gzip" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

cleanzip() {
	rm -vf /usr/bin/zip /usr/bin/unzip /license/unzip-LICENSE
}

makezip() {
	logmessage2 "Building zip..."
	if [ ! -f $TPMSRCDIR/unzip550.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/zip23.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/zip23.tar.gz
	tar -zxvf $TPMSRCDIR/unzip550.tar.gz
	cd unzip-5.50
	cp unix/Makefile ./
	make generic CC="gcc -s" prefix=/usr	
	make install prefix=/usr
	cp LICENSE /license/unzip-LICENSE
	cd ..

	cd zip-2.3
	make -f unix/Makefile generic_gcc CC="gcc -s" prefix=/usr
	make -f unix/Makefile install prefix=/usr
	cp LICENSE /license/zip-LICENSE
	cd ..

	if [ ! -f /usr/bin/zip ] ; then exit; fi
	if [ ! -f /usr/bin/unzip ] ; then exit; fi
	rm -rf unzip-5.50 zip-2.3
	logmessage2 "Done zip"
}


makeacrobat() {
	logmessage2 "Building acrobat..."
	if [ ! -f linux-507.tar.gz ] ; then exit; fi
	mkdir acrobat-5.07
	cd acrobat-5.07
	tar -zxvf ../linux-507.tar.gz
	cat > install.responses << "EOF"
:n
accept
/usr/local/Acrobat5
y
EOF
	cat install.responses | ./INSTALL
	cd ..

	if [ ! -f /usr/local/Acrobat5/bin/acroread ] ; then exit; fi
	rm -rf acrobat-5.07
	ln -s Acrobat5 /usr/local/acrobat
	logmessage2 "Done"
}


makesetiathome() {
	echo "Building Seti @ Home..."
	if [ ! -f $TPMSRCDIR/setiathome-3.08.i686-pc-linux-gnu.tar ] ; then exit; fi
	cd /usr
	tar -xvf $TPMSRCDIR/setiathome-3.08.i686-pc-linux-gnu.tar
	mv setiathome-3.08.i686-pc-linux-gnu setiathome

	cd ../../..
	if [ ! -f /usr/setiathome/setiathome ] ; then exit; fi

	cat > /usr/setiathome/user_info.sah << "EOF"
type=user info
id=4616580
key=1842001379
email_addr=seti@thepacketmaster.com
name=ThePacketMaster
url=http://www.thepacketmaster.com
country=
postal_code=
show_name=yes
show_email=no
venue=0
register_time= 2452840.56979 (Sun Jul 20 01:40:29 2003)
last_wu_time=       0.00000
last_result_time=       0.00000
nwus=0
nresults=0
total_cpu=0.000000
params_index=0
EOF

	cat > /usr/bin/thanks << "EOF"
cd /root
if [ ! -e /root/setiathome ] ; then 
	cp -R /usr/setiathome/ ./
fi
cd /root/setiathome
./setiathome&
EOF
	chmod 755 /usr/bin/thanks
	echo "Done"
}

makeman() {
	echo "TPM: Building man..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f man-1.5l.tar.gz ] ; then exit; fi
	tar -zxvf man-1.5l.tar.gz
	cd man-1.5l
	patch -Np1 -i ../man-1.5k-manpath.patch
	patch -Np1 -i ../man-1.5k-pager.patch
	patch -Np1 -i ../man-1.5k-80cols.patch
	PATH=$PATH:/usr/bin:/bin ./configure -default -confdir=/etc
	if [ $? -ne 0 ]; then echo "Error configuring man";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making man";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing man";exit; fi
	cd ..
	if [ ! -f /usr/bin/man ] ; then exit; fi
	rm -rf man-1.5l
	echo "TPM: Done man" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makelilo() {
	echo "TPM: Building lilo..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f lilo-22.5.3.tar.gz ] ; then exit; fi
	tar -zxvf lilo-22.5.3.tar.gz
	cd lilo-22.5.3
	make
	if [ $? -ne 0 ]; then echo "Error making lilo";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing lilo";exit; fi
	cd ..
	if [ ! -f /sbin/lilo ] ; then exit; fi
	rm -rf lilo-22.5.3 lilo-22.5.3.tar
	echo "TPM: Done lilo" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makemake() {
	echo "TPM: Building make..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f make-3.80.tar.gz ] ; then exit; fi
	tar -zxvf make-3.80.tar.gz
	cd make-3.80
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring make";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making make";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing make";exit; fi
	chgrp root /usr/bin/make
	chmod 755 /usr/bin/make
	cd ..
	if [ ! -f /usr/bin/make ] ; then exit; fi
	rm -rf make-3.80
	echo "TPM: Done make" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makewhich() {
	echo "TPM: Building which..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f which-2.14.tar.gz ] ; then exit; fi
	tar -zxvf which-2.14.tar.gz
	cd which-2.14
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring which"; exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making which"; exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing which"; exit; fi
	cd ..
	if [ ! -f /usr/bin/which ] ; then exit; fi
	rm -rf which-2.14
	echo "TPM: Done which" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makenasm() {
	echo "TPM: Building nasm..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f nasm-0.98.36.tar.gz ] ; then exit; fi
	tar -zxvf nasm-0.98.36.tar.gz
	cd nasm-0.98.36
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring nasm";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making nasm";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing nasm";exit; fi
	cd ..
	if [ ! -f /usr/bin/nasm ] ; then exit; fi
	rm -rf nasm-0.98.36.tar nasm-0.98.36
	echo "TPM: Done nasm" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makemodutils() {
	echo "TPM: Building modutils..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f modutils-2.4.25.tar.gz ] ; then exit; fi
	tar -zxvf modutils-2.4.25.tar.gz
	cd modutils-2.4.25
	./configure
	if [ $? -ne 0 ]; then echo "Error configuring modutils";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making modutils";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing modutils";exit; fi
	cd ..
	if [ ! -f /sbin/depmod ] ; then exit; fi
	rm -rf modutils-2.4.25 modutils-2.4.25.tar
	echo "TPM: Done modutils" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makenetkitbase() {
	echo "TPM: Building netkitbase..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f netkit-base-0.17.tar.gz ] ; then exit; fi
	tar -zxvf netkit-base-0.17.tar.gz
	cd netkit-base-0.17
	./configure
	if [ $? -ne 0 ]; then echo "Error configuring netkitbase";exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making netkitbase";exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing netkitbase";exit; fi
	cp etc.sample/{services,protocols} /etc
	echo -e "imaps\t993/tcp\t# IMAP over SSL\n" >>/etc/services
	echo -e "imaps\t993/udp\t# IMAP over SSL\n" >>/etc/services
	cd ..
	if [ ! -f /bin/ping ] ; then exit; fi
	rm -rf netkit-base-0.17 netkit-base-0.17.tar
	echo "TPM: Done netkitbase" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

cleannetkittftp() {
	rm -vf /usr/bin/tftp
}

makenetkittftp() {
	logmessage2 "Building netkittftp..."
	cleannetkittftp
	if [ ! -f netkit-tftp-0.17.tar.gz ] ; then exit; fi
	tar -zxvf netkit-tftp-0.17.tar.gz
	cd netkit-tftp-0.17
	./configure
	make
	make install
	cd ..
	if [ ! -f /usr/bin/tftp ] ; then exit; fi
	rm -rf netkit-tftp-0.17
	logmessage2 "Done netkittftp"
}

cleannetkitftp() {
	rm -vf /usr/bin/ftp
}

makenetkitftp() {
	logmessage2 "Building netkitftp..."
	if [ ! -f $TPMSRCDIR/netkit-ftp-0.17.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/netkit-ftp-0.17.tar.gz
	cd netkit-ftp-0.17
	./configure
	make
	make install
	cd ..
	if [ ! -f /usr/bin/ftp ] ; then exit; fi
	rm -rf netkit-ftp-0.17
	logmessage2 "Done netkitftp"
}

cleanwuftpd() {
	rm -vf /etc/ftpaccess /etc/ftpconversions
	rm -vf /usr/sbin/ftprestart
	rm -vf /usr/sbin/ckconfig
	rm -vf /usr/sbin/ftpshut
	rm -vf /usr/sbin/in.ftpd
	rm -vf /usr/sbin/privatepw
}

makewuftpd() {
	logmessage2 "Building wuftpd..."
	makeoldbison

	OLDPATH=$PATH
	PATH=/usr/local/bison-1.35/bin:$PATH
	if [ ! -f $TPMSRCDIR/wu-ftpd-2.6.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/wu-ftpd-2.6.2.tar.gz
	cd wu-ftpd-2.6.2
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ..
	if [ ! -f /usr/sbin/in.ftpd ] ; then exit; fi
	rm -rf wu-ftpd-2.6.2.tar wu-ftpd-2.6.2
	PATH=$OLDPATH
	rm -rvf /usr/local/bison-1.35


	cat > /etc/rc.d/init.d/ftpd << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  start|--start)
	/usr/sbin/in.ftpd -SaliI
	;;


  stop|--stop)
	pkill in.ftpd
	;;

  *)
	echo "Usage: ftpd {start|stop}" >&2
	exit 2
esac

exit 0
EOF
	chmod 755 /etc/rc.d/init.d/ftpd


	logmessage2 "Done wuftpd"
}

makeapache2046() {
	logmessage2 "Building apache..."

	if [ ! -f $TPMSRCDIR/httpd-2.0.46.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/httpd-2.0.46.tar.gz
	cd httpd-2.0.46
	./configure --prefix=/usr --sysconfdir=/etc/httpd --with-ssl=/usr/ssl \
	--enable-ssl --enable-module=so \
	2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/bin/apachectl ] ; then exit; fi
	cd ../
	rm -rf httpd-2.0.46
	logmessage2 "Done apache"

}

makemodssl2816for1329() {
	logmessage2 "Building mod_ssl..."

	if [ ! -d /apache_1.3.29 ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/mod_ssl-2.8.16-1.3.29.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mod_ssl-2.8.16-1.3.29.tar.gz
	cd mod_ssl-2.8.16-1.3.29
	./configure --with-apache=../apache_1.3.29
	if [ ! -d /apache_1.3.29/src/modules/ssl ] ; then exit; fi
	cd ../
	rm -rf mod_ssl-2.8.16-1.3.29
	logmessage2 "Done mod_ssl"

}


makemodthrottle312for1329() {
	logmessage2 "Building mod_throttle..."

	if [ ! -d /apache_1.3.29 ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/mod_throttle312.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mod_throttle312.tgz
	cd mod_throttle-3.1.2
	make install
	if [ $? -ne 0 ]; then exit; fi

	if [ ! -f /usr/libexec/mod_throttle.so ] ; then exit; fi
	cd ../
	rm -rf mod_throttle-3.1.2
	logmessage2 "Done mod_throttle"

}

makemm130() {
	logmessage2 "Building mm..."

	if [ ! -f $TPMSRCDIR/mm-1.3.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mm-1.3.0.tar.gz
	cd mm-1.3.0
	./configure --disable-shared --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/lib/libmm.a ] ; then exit; fi
	cd ../
	rm -rf mm-1.3.0
	logmessage2 "Done mm"

}

makeapache1329() {
	logmessage2 "Building apache..."

	if [ ! -f $TPMSRCDIR/apache_1.3.29.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/apache_1.3.29.tar.gz
	makemodssl2816for1329
	cd apache_1.3.29
	SSL_BASE=/usr/ssl EAPI_MM=/usr ./configure --prefix=/usr --sysconfdir=/etc/httpd \
		--logfiledir=/var/log/httpd --runtimedir=/var/run \
		--localstatedir=/var/run \
		--enable-module=so --enable-module=ssl --enable-suexec \
		--suexec-caller=www --enable-module=rewrite \
		--suexec-docroot=/usr/home/ --suexec-uidmin=500 \
		--suexec-gidmin=500 \
		--suexec-logfile=/var/log/httpd/apache_suexec_log \
		--suexec-safepath=/usr/bin:/bin:/usr/local/bin/
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/bin/apachectl ] ; then exit; fi
	cd ../
	makemodthrottle312for1329
	rm -rf apache_1.3.29
	logmessage2 "Done apache"

}


makecurl7108() {
	logmessage2 "Building curl..."

	if [ ! -f $TPMSRCDIR/curl-7.10.8.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/curl-7.10.8.tar.gz
	cd curl-7.10.8
	./configure --prefix=/usr --with-ssl=/usr/ssl
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/bin/curl ] ; then exit; fi
	cd ../
	rm -rf curl-7.10.8
	logmessage2 "Done curl"

}

makecyrussasl2117() {
	logmessage2 "Building Cyrus SASL..."

	if [ ! -f $TPMSRCDIR/cyrus-sasl-2.1.17.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cyrus-sasl-2.1.17.tar.gz
	cd cyrus-sasl-2.1.17
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ../
	if [ ! -f /usr/lib/libsasl2.a ] ; then exit; fi
	rm -rf cyrus-sasl-2.1.17
	logmessage2 "Done Cyrus SASL"

}

makecyrussasl1528() {
	logmessage2 "Building Cyrus SASL..."

	if [ ! -f $TPMSRCDIR/cyrus-sasl-1.5.28.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cyrus-sasl-1.5.28.tar.gz
	cd cyrus-sasl-1.5.28
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ../
	if [ ! -f /usr/lib/libsasl.so ] ; then exit; fi
	rm -rf cyrus-sasl-1.5.28
	logmessage2 "Done Cyrus SASL"

}

makesendmail81210() {
	logmessage2 "Building sendmail..."

	if [ ! -f $TPMSRCDIR/sendmail.8.12.10.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/sendmail.8.12.10.tar.gz
	cd sendmail-8.12.10
	cat > devtools/Site/site.config.m4 << "EOF"
dnl Stuff for TLS
define(`confSTDIO_TYPE', `portable')
APPENDDEF(`confINCDIRS', `-I/usr/ssl/include')
APPENDDEF(`confLIBDIRS', `-L/usr/ssl/lib')
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto')
APPENDDEF(`confENVDEF', `-DSASL')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl')
APPENDDEF(`confLIBDIRS', `-L/usr/lib')
APPENDDEF(`confINCDIRS', `-I/usr/include')
EOF
	cd sendmail
	sh Build 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem building sendmail"; exit -1; fi
	cd ../
	logmessage2 "sendmail successfully build, now configuring sendmail.cf"

	cat > cf/cf/config.mc << "EOF"
divert(-1)
dnl This is the sendmail macro config file. If you make changes to this file,
dnl you need the sendmail-cf rpm installed and then have to generate a
dnl new /etc/sendmail.cf by running the following command:
dnl
dnl        m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
dnl
#include(`/usr/share/sendmail-cf/m4/cf.m4')
VERSIONID(`linux setup for Red Hat Linux')dnl
OSTYPE(`linux')
define(`confDEF_USER_ID',``8:12'')dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/sendmail.st')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl

TRUST_AUTH_MECH(`PLAIN LOGIN')dnl
define(`confAUTH_MECHANISMS', `PLAIN LOGIN')dnl
define(`confAUTH_OPTIONS', `A')dnl

define(`confTO_QUEUEWARN', `4h')dnl
define(`confTO_QUEUERETURN', `5d')dnl
define(`confQUEUE_LA', `12')dnl
define(`confREFUSE_LA', `18')dnl
FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail)dnl
FEATURE(`access_db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')dnl
define(`confCACERT_PATH', `CERT_DIR')dnl
define(`confCACERT', `CERT_DIR/cacert.pem')dnl
define(`confSERVER_CERT', `CERT_DIR/cert.pem')dnl
define(`confSERVER_KEY', `CERT_DIR/key.pem')dnl
define(`confCLIENT_CERT', `CERT_DIR/cert.pem')dnl
define(`confCLIENT_KEY', `CERT_DIR/key.pem')dnl
define(`confLOGLEVEL', `14') dnl
EOF

	cd cf/cf
	rm -f config.cf
	sh Build config.cf
	if [ $? -ne 0 ]; then logmessage2 "Problem building config.cf"; exit -1; fi
	cp config.cf /etc/mail/sendmail.cf
	cd ../../
	logmessage2 "Built sendmail.cf"

	mkdir -p /usr/man/man8 /usr/man/man5 /usr/man/man1 /etc/mail/certs
	cd sendmail
	sh Build install 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then logmessage2 "Problem installing sendmail"; exit -1; fi
	cd ../../
	chown smmsp:smmsp /var/spool/clientmqueue
	chmod 770 /var/spool/clientmqueue
	chown root:bin /var/spool/mqueue
	chmod 700 /var/spool/mqueue

	if [ ! -f /usr/sbin/sendmail ] ; then exit; fi
	rm -rf sendmail-8.12.10
	logmessage2 "Done sendmail"

}


makemodssl() {
	logmessage2 "Building modssl..."

	if [ ! -f $TPMSRCDIR/ ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/curl-7.10.8.tar.gz
	cd curl-7.10.8
	./configure --prefix=/usr --with-ssl=/usr/ssl
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/bin/curl ] ; then exit; fi
	cd ../
	rm -rf curl-7.10.8
	logmessage2 "Done curl"

}

makentp420() {
	logmessage2 "Building ntp..."

	if [ ! -f $TPMSRCDIR/ntp-4.2.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ntp-4.2.0.tar.gz
	cd ntp-4.2.0
	#./configure --prefix=/usr --sysconfdir=/etc 
	./configure --prefix=/usr --sysconfdir=/etc --with-openssl-libdir=/usr/ssl/lib --with-openssl-incdir=/usr/ssl/include
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ../
	if [ ! -f /usr/bin/ntpd ] ; then exit; fi
	rm -rf ntp-4.2.0
	logmessage2 "Done ntp"

}

makentp412() {
	logmessage2 "Building ntp..."

	if [ ! -f $TPMSRCDIR/ntp-4.1.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ntp-4.1.2.tar.gz
	cd ntp-4.1.2
	./configure --prefix=/usr --sysconfdir=/etc 
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ../
	if [ ! -f /usr/bin/ntpd ] ; then exit; fi
	rm -rf ntp-4.1.2
	logmessage2 "Done ntp"

}

makepdflib403() {
	logmessage2 "Building PDF lib..."

	if [ ! -f $TPMSRCDIR/pdflib-4.0.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pdflib-4.0.3.tar.gz
	cd pdflib-4.0.3
	./configure --prefix=/usr  --enable-php 2>> $TPMBUILDLOGFILE  1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/bin/pdflib-config ] ; then exit; fi
	if [ ! -f /usr/lib/libpdf.so ] ; then exit; fi
	if [ ! -f /usr/lib/libpdf.a ] ; then exit; fi
	cd ../
	rm -rf pdflib-4.0.3
	logmessage2 "Done PDF lib"

}

makephp434() {
	logmessage2 "Building php..."

	if [ ! -f $TPMSRCDIR/php-4.3.4.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/php-4.3.4.tar.bz2 | tar -xv
	cd php-4.3.4
	# Should be configured for mysql, ssl, *Zend*, pdflib, XML support,
	# curl, bzip2, *jpeg*, zlib, gdbm, db4
	./configure --prefix=/usr --with-openssl=/usr/ssl --with-mysql \
	--with-curl --with-gdbm --with-bz2 --with-zlib --with-db4 \
	--with-pdflib --without-apache --enable-track-vars \
	--enable-force-cgi-redirect \
	2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/bin/php ] ; then exit; fi
	cd ../
	rm -rf php-4.3.4
	logmessage2 "Done php"

}

makexmlparser234() {
	logmessage2 "Building XML Parser..."

	if [ ! -f $TPMSRCDIR/XML-Parser-2.34.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/XML-Parser-2.34.tar.gz
	cd XML-Parser-2.34
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/XML/Parser.pm ] ; then exit; fi
	cd ../
	rm -rf XML-Parser-2.34
	logmessage2 "Done XML Parser"

}

cleanxinetd() {
	rm -vf /etc/xinetd.conf /usr/sbin/itox /usr/sbin/xinetd
	rm -vf /usr/sbin/xconv.pl /usr/man/man5/xinetd.conf.5
	rm -vf /usr/man/man8/xinetd.log.8 /usr/man/man8/xinetd.8
	rm -vf /usr/man/man8/itox.8 /usr/man/man8/xconv.pl.8
	rm -vf /etc/xinetd.conf
}

makexinetd() {
	cleanxinetd
	logmessage2 "Building xinetd..."

	if [ ! -f xinetd-2.3.11.tar.gz ] ; then exit; fi
	tar -zxvf xinetd-2.3.11.tar.gz
	cd xinetd-2.3.11
	./configure --prefix=/usr --sysconfdir=/etc
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/sbin/xinetd ] ; then exit; fi

	cat > /etc/xinetd.conf << "EOF"
#
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
        instances               = 60
        log_type                = SYSLOG authpriv
        log_on_success          = HOST DURATION PID
        log_on_failure          = HOST
}

includedir /etc/xinetd.d
EOF

	mkdir /etc/xinetd.d/ /var/tftpboot

	cat > /etc/xinetd.d/tftp << "EOF"
service tftp
{
	disable 		= yes
        socket_type             = dgram
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = /var/tftpboot
        log_on_success          += HOST DURATION PID
        log_on_failure          += HOST
        nice                    = 10
}
EOF

	cat > /etc/rc.d/init.d/xinetd << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  start|--start)
	/usr/sbin/xinetd
	;;


  stop|--stop)
	pkill xinetd
	;;

  *)
	echo "Usage: xinetd {start|stop}" >&2
	exit 2
esac

exit 0
EOF
	chmod 755 /etc/rc.d/init.d/xinetd
	cd ../
	rm -rf xinetd-2.3.11
	logmessage2 "Done xinetd"
}


makemysql4013() {
	logmessage2 "Building mysql..."

	if [ ! -f $TPMSRCDIR/mysql-4.0.13.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mysql-4.0.13.tar.gz
	cd mysql-4.0.13

	./configure --prefix=/usr --sysconfdir=/etc/mysql --enable-static=no --with-mysqld-user=mysql --localstatedir=/var/mysql
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/libexec/mysqld ] ; then exit; fi
	scripts/mysql_install_db --force
	chown -R mysql /var/mysql
	chgrp -R mysql /var/mysql
	cp support-files/my-medium.cnf /etc/my.cnf
	cd ../

	cat > /etc/rc.d/init.d/mysqld << "EOF"
#!/bin/sh
. /etc/init.d/functions

DATADIR="/var/mysql"

case "$1" in
  start|--start)
	if [ ! -d $DATADIR/mysql ]; then
		mkdir -p $DATADIR/mysql
		echo "Performing setup of mysql"
		mysql_install_db --force --datadir=$DATADIR
		chown -R mysql:mysql $DATADIR
	fi
	/usr/bin/mysqld_safe --user=mysql --skip-innodb --datadir=$DATADIR&
	;;


  stop|--stop)
	/usr/bin/mysqladmin shutdown
	;;

  *)
	echo "Usage: mysql {start|stop}" >&2
	exit 2
esac

exit 0
EOF
	chmod 755 /etc/rc.d/init.d/mysqld
	rm -rf mysql-4.0.13
	logmessage2 "Done"
}


cleannetkittelnet() {
	rm -vf /usr/bin/telnet
}

makenetkittelnet() {
	logmessage2 "Building netkittelnet..."
	if [ ! -f $TPMSRCDIR/netkit-telnet-0.17.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/netkit-telnet_0.17-20.diff ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/netkit-telnet-0.17.tar.gz
	cd netkit-telnet-0.17
	patch -Np1 -i $TPMSRCDIR/netkit-telnet_0.17-20.diff
	./configure
	cd telnet
	make
	make install
	cd ../..
	if [ ! -f /usr/bin/telnet ] ; then exit; fi
	rm -rf netkit-telnet-0.17
	logmessage2 "Done netkitcombo"
}

#makenetkitcombo() {
#	echo "Building netkitcombo..."
#	gunzip -c netkit-ftp-0.17.tar.gz > netkit-ftp-0.17.tar
#	gunzip -c netkit-telnet-0.17.tar.gz > netkit-telnet-0.17.tar
#	gunzip -c netkit-tftp-0.17.tar.gz > netkit-tftp-0.17.tar
#	gunzip -c bsd-finger-0.17.tar.gz > bsd-finger-0.17.tar
#
#
#
#}

makenetkitcombo() {
	gunzip -c netkit-combo-0.17.tar.gz > netkit-combo-0.17.tar
	if [ ! -f netkit-combo-0.17.tar ] ; then exit; fi
	tar -xvf netkit-combo-0.17.tar
	cd netkit-combo-0.17
	./configure
	make
	make install
	cp etc.sample/{services,protocols} /etc
	cd ..
	if [ ! -f /bin/ping ] ; then exit; fi
	rm -rf netkit-base-0.17 netkit-base-0.17.tar
	echo "Done"
}
makepatch() {
	echo "TPM: Building patch..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f patch-2.5.4.tar.gz ] ; then exit; fi
	tar -zxvf patch-2.5.4.tar.gz
	cd patch-2.5.4
	CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/usr
	if [ $? -ne 0 ]; then echo "Error configuring patch"; exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making patch"; exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing patch"; exit; fi
	cd ..
	if [ ! -f /usr/bin/patch ] ; then exit; fi
	rm -rf patch-2.5.4.tar patch-2.5.4
	echo "TPM: Done patch" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeprocinfo() {
	echo "TPM: Building procinfo..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f procinfo-18.tar.gz ] ; then exit; fi
	tar -zxvf procinfo-18.tar.gz
	cd procinfo-18
	make LDLIBS=-lncurses
	if [ $? -ne 0 ]; then echo "Error making procinfo"; exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing procinfo"; exit; fi
	cd ..
	if [ ! -f /usr/bin/lsdev ] ; then exit; fi
	rm -rf procinfo-18 procinfo-18.tar
	echo "TPM: Done procinfo" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeprocps() {
	echo "TPM: Building procps..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f procps-3.1.8.tar.gz ] ; then exit; fi
	tar -zxvf procps-3.1.8.tar.gz
	cd procps-3.1.8
	patch -Np1 -i ../procps-3.1.5.patch
	make
	if [ $? -ne 0 ]; then echo "Error making procps"; exit; fi
	make XSCPT="" install
	if [ $? -ne 0 ]; then echo "Error installing procps"; exit; fi
	cd ..
	if [ ! -f /usr/bin/free ] ; then exit; fi
	rm -rf procps-3.1.8.tar procps-3.1.8
	echo "TPM: Done procps" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makepsmisc() {
	echo "TPM: Building psmisc..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f psmisc-21.2.tar.gz ] ; then exit; fi
	tar -zxvf psmisc-21.2.tar.gz
	cd psmisc-21.2
	./configure --prefix=/usr --exec-prefix=/
	if [ $? -ne 0 ]; then echo "Error configuring psmisc"; exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making psmisc"; exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing psmisc"; exit; fi
	ln -s killall /bin/pidof
	cd ..
	if [ ! -f /bin/killall ] ; then exit; fi
	rm -rf psmisc-21.2.tar psmisc-21.2
	echo "TPM: Done psmisc" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makeshadow() {
	echo "TPM: Building shadow..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f shadow-4.0.3.tar.gz ] ; then exit; fi
	tar -zxvf shadow-4.0.3.tar.gz
	cd shadow-4.0.3
	./configure --prefix=/usr --libdir=/usr/lib --enable-shared
	if [ $? -ne 0 ]; then echo "Error configuring shadow"; exit; fi
	make
	if [ $? -ne 0 ]; then echo "Error making shadow"; exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing shadow"; exit; fi
	cp etc/{limits,login.access} /etc
	sed 's%/var/spool/mail%/var/mail%' etc/login.defs.linux > /etc/login.defs
	ln -s vipw /usr/sbin/vigr
	rm /bin/vipw
	mv /bin/sg /usr/bin
	mv /usr/lib/lib{shadow,misc}.so.0* /lib
	ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
	ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so
	rm /bin/groups
	/usr/sbin/pwconv
	cd ..
	if [ ! -f /usr/bin/passwd ] ; then exit; fi
	rm -rf shadow-4.0.3 shadow-4.0.3.tar
	echo "TPM: Done shadow" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makesysklogd() {
	echo "TPM: Building sysklogd..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f sysklogd-1.4.1.tar.gz ] ; then exit; fi
	tar -zxvf sysklogd-1.4.1.tar.gz
	cd sysklogd-1.4.1
	make
	if [ $? -ne 0 ]; then echo "Error making sysklogd"; exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing sysklogd"; exit; fi
	cat > /etc/syslog.conf << "EOF"
# Begin /etc/syslog.conf

auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
EOF

	

	cd ..
	if [ ! -f /usr/sbin/syslogd ] ; then exit; fi
	rm -rf sysklogd-1.4.1
	echo "TPM: Done sysklogd" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makesysvinit() {
	echo "TPM: Building sysvinit..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f sysvinit-2.85.tar.gz ] ; then exit; fi
	tar -zxvf sysvinit-2.85.tar.gz
	cd sysvinit-2.85/src
	#cp src/init.c{,.backup}
	#sed 's/Sending processes/Sending processes started by init/g' src/init.c.backup > src/init.c
	make
	if [ $? -ne 0 ]; then echo "Error making sysvinit"; exit; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing sysvinit"; exit; fi
	cat > /etc/inittab << "EOF"
# Begin /etc/inittab
id:3:initdefault:
si::sysinit:/etc/rc.d/rc.sysinit
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now
#tty1:linux:/sbin/getty 9600 tty1
1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
# End /etc/inittab
EOF
	
	cd ../..
	if [ ! -f /sbin/init ] ; then exit; fi
	rm -rf sysvinit-2.85 sysvinit-2.85.tar
	echo "TPM: Done sysvinit" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

maketar() {
	echo "TPM: Building tar..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f tar-1.13.tar.gz ] ; then exit; fi
	tar -zxvf tar-1.13.tar.gz
	cd tar-1.13
	./configure --prefix=/usr --bindir=/bin --libexecdir=/usr/bin
	if [ $? -ne 0 ]; then echo "Error configuring tar"; exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making tar"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing tar"; exit -1; fi
	cd ..
	if [ ! -f /bin/tar ] ; then exit; fi
	rm -rf tar-1.13.tar.gz tar-1.13
	echo "TPM: Done tar" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

cleanlynx() {
	rm -vf /usr/bin/lynx /license/lynx-COPYHEADER
}

makelynx() {
	logmessage2 "Making lynx..."
	if [ ! -f $TPMSRCDIR/lynx2.8.4.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/lynx2.8.4.tar.gz
	cd lynx2-8-4
	rm config.cache
	make clean
	./configure --prefix=/usr --with-ssl=/usr/ssl/lib
	make
	make install
	cp COPYHEADER /license/lynx-COPYHEADER
	cd ..
	if [ ! -f /usr/bin/lynx ] ; then exit; fi
	rm -rf lynx2-8-4
	logmessage2 "Done lynx"
}



cleanlibpcap() {
	rm -vf /usr/lib/libpcap.a
	rm -vf /usr/include/net/bpf.h
	rm -vf /usr/include/pcap-namedb.h
	rm -vf /usr/include/pcap.h
	rm -vf /usr/man/man3/pcap.3

	rm -vf /license/libpcap-LICENSE
}

# libpcap 0.7.2
# 200KB
makelibpcap072() {
	logmessage2 "Making libpcap"
	if [ ! -f $TPMSRCDIR/libpcap-0.7.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libpcap-0.7.2.tar.gz
	cd libpcap-0.7.2
	./configure --prefix=/usr
	if [ $? -ne 0 ] ; then echo "Error configuring libpcap"; exit-1; fi
	make
	if [ $? -ne 0 ] ; then echo "Error making libpcap"; exit -1; fi
	make install
	if [ $? -ne 0 ] ; then echo "Error installing libpcap"; exit -1; fi
	cp LICENSE /license/libpcap-LICENSE
	cd ..
	if [ ! -f /usr/lib/libpcap.a ] ; then exit; fi

	logmessage2 "Done libpcap"
}

cleantcpdump() {
	rm -rvf /usr/sbin/tcpdump /usr/man/man1/tcpdump.1
	rm -vf /license/tcpdump-LICENSE
}

# TCPDump 3.7.2
# 448KB
maketcpdump() {
	logmessage2 "Making tcpdump..."
	if [ ! -f $TPMSRCDIR/tcpdump-3.7.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tcpdump-3.7.2.tar.gz
	cd tcpdump-3.7.2
	./configure --prefix=/usr
	make
	make install
	cp LICENSE /license/tcpdump-LICENSE
	cd ..
	if [ ! -f /usr/sbin/tcpdump ] ; then exit; fi
	rm -rf tcpdump-3.7.2
	rm -rf libpcap-0.7.2
	logmessage2 "Done tcpdump"
}


cleanhping2() {
	rm -rvf /usr/sbin/hping /usr/sbin/hping2
}

# hping 2.0.0-rc2
# 436KB
# Files:
# /usr/sbin/hping2
makehping2() {
	logmessage2 "Making hping2"
	if [ ! -f $TPMSRCDIR/hping2.0.0-rc2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/hping2.0.0-rc2.tar.gz
	cd hping2-rc2
	MANPATH="/usr/man" ./configure
	make
	make strip
	make install
	cd ..
	if [ ! -f /usr/sbin/hping2 ] ; then exit; fi
	rm -rf hping2-rc2
	logmessage2 "Done hping2"
}

cleangdbm() {
	rm -rvf /usr/lib/libgdbm*
}

# GDBM 1.8.3
# 864KB
makegdbm() {
	logmessage2 "Making gdbm..."
	if [ ! -f $TPMSRCDIR/gdbm-1.8.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gdbm-1.8.3.tar.gz
	cd gdbm-1.8.3
	./configure --prefix=/usr --enable-static=no
	make
	make progs
	make install
	make install-compat
	ldconfig
	cd ..
	if [ ! -f /usr/lib/libgdbm.la ] ; then exit; fi
	rm -rf gdbm-1.8.3
	logmessage2 "Done gdbm"
}

cleanntop() {
	rm -rvf /usr/local/ntop-2.2 /usr/local/ntop /etc/ntop /var/ntop
	rm -vf /etc/rc.d/init.d/ntop
}

# NTop 2.2
# 10,508KB
makentop() {
	logmessage2 "Making ntop..."
	if [ ! -f ntop-2.2.tgz ] ; then exit; fi
	tar -zxvf ntop-2.2.tgz
	cd ntop-2.2
	cd gdchart0.94c
	./configure --prefix=/usr
	cd gd-1.8.3/libpng-1.2.4
	cp scripts/makefile.linux Makefile
	make
	cd ../../zlib-1.1.4/
	./configure --prefix=/usr
	make
	cd ..
	make
	make install
	cd ../ntop
	./configure --prefix=/usr --sysconfdir=/etc --enable-sslv3 --enable-sslwatchdog --with-ossl-root=/usr/ssl --enable-static=no
	make
	make install
	cd ../..
	if [ ! -f /usr/bin/ntop ] ; then exit; fi
	rm -rf ntop-2.2
	mkdir /var/ntop

	cat > /etc/rc.d/init.d/ntop << "EOF"
#!/bin/sh
cd /usr/bin
./ntop -P /var/ntop -w 3000 -W 3001
EOF
	ldconfig
	chmod 755 /etc/rc.d/init.d/ntop

	logmessage2 "Done ntop"
}

cleantraceroute() {
	rm -vf /usr/sbin/traceroute
}

maketraceroute() {
	logmessage2 "Making traceroute..."
	if [ ! -f $TPMSRCDIR/traceroute-1.4a12.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/traceroute-1.4a12.tar.gz
	cd traceroute-1.4a12
	./configure --prefix=/usr
	make
	make install
	cd ..
	if [ ! -f /usr/sbin/traceroute ] ; then exit; fi
	rm -rf traceroute-1.4a12
	logmessage2 "Done traceroute"
}



# CDRTools 2.00.3
# 3520KB
makecdrtools() {
	logmessage2 "Making cdrtools..."
	if [ ! -f $TPMSRCDIR/cdrtools-2.00.3.tar.gz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cdrtools-2.00.3.tar.gz
	cd cdrtools-2.00.3
	make COPTX=-s LDOPTX=-s
	make INS_BASE=/usr install
	cd ..
	if [ ! -f /usr/bin/cdrecord ] ; then exit; fi
	rm -rf cdrtools-2.00.3
	logmessage2 "Done cdrtools"
}


# John The Ripper 1.6
# 1,184KB
makejohntheripper() {
	logmessage2 "Making johntheripper..."
	if [ ! -f john-1.6.tar.gz ] ; then exit; fi
	tar -zxvf john-1.6.tar.gz
	mv john-1.6 john
	cd john/src
	make linux-x86-any-elf
	mkdir -p /usr/john/bin
	cd ../run
	cp * /usr/john/bin
	cd ../..
	if [ ! -f /usr/john/bin/john ] ; then exit; fi
	cat > /etc/rc.d/init.d/john << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  *)
	cd /usr/
	cp -R john /var
	cp /usr/c50a/dict/1/dictionary /var/john/bin/password.lst

	;;

	exit 0
esac

exit 0
EOF
	chmod 755 /etc/rc.d/init.d/john
	rm -rf john
 
	logmessage2 "Done johntheripper"
}

cleancrack() {
	rm -rvf /usr/c50a
	rm -vf /license/Crack-LICENCE
}

makecrack() {
	logmessage2 "Making crack..."
	cleancrack
	if [ ! -f crack5.0.tar.gz ] ; then exit; fi
	tar -zxvf crack5.0.tar.gz
	cd c50a

	cat > Crack << "EOF"
#!/bin/sh
###
# This program was written by and is copyright Alec Muffett 1991,
# 1992, 1993, 1994, 1995, and 1996, and is provided as part of the
# Crack v5.0 Password Cracking package.
#
# The copyright holder disclaims all responsibility or liability with
# respect to its usage or its effect upon hardware or computer
# systems, and maintains copyright as set out in the "LICENCE"
# document which accompanies distributions of Crack v5.0 and upwards.
###
# User-configurable junk for Crack
###

# nice, generic path (RedHat Linux, Solaris1, Solaris2)
CRACK_PATH=/usr/local/bin:/usr/ccs/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/ucb:/usr/etc:$PATH

# compiler options for crack 5.0
#
# -DUSE_BZERO        /* add this to C5FLAGS if you don't have memset() */
# -DUSE_MALLOC_H
# -DUSE_PWD_H
# -DUSE_SIGNAL_H
# -DUSE_STDLIB_H
# -DUSE_STRINGS_H
# -DUSE_STRING_H
# -DUSE_SYS_TYPES_H
# -DUSE_UNISTD_H
# -DMAXWORDLEN=      /* ignore if you don't read the code */
# -DNUMWORDS=        /* ignore if you don't read the code */
# -DSTRINGSIZE=      /* ignore if you don't read the code */

# this set tested on:
# - solaris 2.5
# - redhat linux 4.0
# - digital unix v4.0

C5FLAGS="-DUSE_STRING_H -DUSE_STDLIB_H -DUSE_SIGNAL_H -DUSE_SYS_TYPES_H -DUSE_UNISTD_H -DUSE_PWD_H"

#
# now pick your compiler
#

# vanilla unix cc
CC=cc
CFLAGS="-g -O $C5FLAGS"
LIBS=-lcrypt # uncomment only if necessary to use stdlib crypt(), eg: NetBSD MD5

# gcc 2.7.2
#CC=gcc
#CFLAGS="-g -O2 -Wall $C5FLAGS"
#LIBS=-lcrypt # uncomment only if necessary to use stdlib crypt(), eg: NetBSD MD5

# digital unix v4.0, CFLAGS for ev4/ev5 chipsets (pick one)
#CC=cc
#CFLAGS="-O4 -fast -tune ev4 $C5FLAGS"
#CFLAGS="-O4 -fast -tune ev5 $C5FLAGS"
#LIBS=

# Uncomment the next two lines if a) you are running Crack in
# networking mode, and b) your environment's operating system will not
# necessarily run binaries compiled on other revs of the same
# operating system which have the same architecture and the same
# *MAJOR* revision number.
#
# eg: if you have Foonix 2.0 boxes as well as Foonix 2.1 boxes; in
# this example, the major revision number is "2".  If the Foonix 2.1
# O/S will not run Foonix 2.0 binaries for some reason, or vice-versa,
# then uncomment these lines.

#STRICT_OSREV=yes
#export STRICT_OSREV

# Uncomment and/or modify on HP/UX or similar where the UCB "rsh"
# command has been renamed.  See scripts/crack-rsh also
#CRACK_RSH=remsh
#CRACK_RCP=rcp

###########################################################
###########################################################
#################### THAT'S ALL, FOLKS ####################
#### NOW GO CONFIGURE YOUR CRYPT ALGORITHM, EG: LIBDES ####
###########################################################
###########################################################

###
# security
###

umask 077
export CRACK_PATH                       # So it can be picked up later
PATH=$CRACK_PATH                        # For temporary use...
export PATH

###
# Defaults
###

usage="Usage: Crack [options] [bindir] [[-fmt format] files]..."

version="5.0a"                          # version string
deffmt=trad                             # for default trad2spf
dodie=""                                # for verbose usage/die
debug="false"                           # ...guess...
node=`uname -n`                         # more portable then `hostname`

###
# home base
###

CRACK_HOME=`echo $0 | sed -e 's/Crack$//'`

if [ "$CRACK_HOME" = "" ]
then
	CRACK_HOME=.
fi

if cd $CRACK_HOME
then
	CRACK_HOME=`pwd`
else
	echo "Fatal Error: $CRACK_HOME: cannot chdir" 1>&2
	exit 1
fi

export CRACK_HOME

###
# sanity check
###

if [ ! -f "$CRACK_HOME/Crack" ]
then
	echo "Fatal Error: $CRACK_HOME: something weird going down" 1>&2
	exit 1
fi

###
# Hierarchy
###

for dir in run run/bin
do
	test -d $dir || mkdir $dir || exit 1
done

###
# Flagwaving
###

echo "Crack $version: The Password Cracker."
echo "(c) Alec Muffett, 1991, 1992, 1993, 1994, 1995, 1996"
echo "System:" `uname -a 2>/dev/null`
echo "Home: $CRACK_HOME"
echo "Invoked: $0 $*"

###
# Parse Arguments
###

argbackup1="$*"

while [ "x$1" != "x" ]
do
	case $1 in
		-fmt)
			$debug && echo "beginning of filespecs detected"
			break
			;;

		-recover)
			echo "Option: $1 enabled"
			recover=true
			shift
			;;

		-keep)
			echo "Option: $1 enabled"
			keep=true
			shift
			;;

		-debug)
			echo "Option: $1 enabled"
			debug=true
			set -x
			shift
			;;

		-network)
			echo "Option: $1 enabled"
			networkflag=$1
			shift
			;;

		-remote)
			echo "Option: $1 enabled"
			remoteflag=$1
			shift
			;;

		-makeonly)
			echo "Option: $1 enabled"
			makeonlyflag=$1
			shift
			;;

		-makedict*)
			echo "Option: $1 enabled"
			makedictflag="-makedict"
			shift
			;;

		-fgnd)
			echo "Option: $1 enabled"
			fgndflag=$1
			shift
			;;

		-mail)                                  # pass to cracker
			echo "Option: $1 enabled"
			mailflag=$1
			shift
			;;

		-nice)                                  # pass to cracker
			echo "Option: $1 enabled"
			if [ "$2" = "" ]
			then
				echo "Crack: -nice needs an argument" 1>&2
				exit 1
			fi
			niceflag="$1 $2"
			shift 2
			;;

		-from)                                  # pass to cracker
			echo "Option: $1 enabled"
			if [ "$2" = "" ]
			then
				echo "Crack: -from needs an argument" 1>&2
				exit 1
			fi
			fromflag="$1 $2"
			shift 2
			;;

		-kill)                                  # pass to cracker
			echo "Option: $1 enabled"
			if [ "$2" = "" ]
			then
				echo "Crack: -kill needs an argument" 1>&2
				exit 1
			fi
			killflag="$2"
			shift 2
			;;

		-*)
			echo "Crack: unrecognised argument $1" 1>&2
			dodie=yes
			shift
			;;

		*)
			$debug && echo "End of options detected."
			break
			;;
	esac
done

if [ "x$dodie" != "x" ]
then
	echo $usage 1>&2
	exit 1
fi

###
# Sanity test bindir - written in gruntscript for clarity.
###

bdname=`scripts/binstamp 2>/dev/null`

if [ "x$bdname" = "x" ]
then
	echo "Crack: error: cannot continue as binstamp returned empty string" 1>&2
	exit 0
fi

echo "Stamp: $bdname"
echo ""


if [ "x$1" != "x" ]
then
	if [ "$1" = "-fmt" ]            # use generic name
	then
		bindir=run/bin/$bdname
	elif [ -d run/bin/$1 ]          # have been here before
	then
		bindir=run/bin/$1
		shift
	elif [ ! -f $1 ]                # use specified name
	then
		bindir=run/bin/$1
		shift
	else                            # use generic name
		bindir=run/bin/$bdname
	fi
else                                    # supporting "-makeonly"
	if [ "$makeonlyflag" != "" ]
	then
		bindir=run/bin/$bdname

	elif [ "$makedictflag" != "" ]
	then
		bindir=run/bin/$bdname

	elif [ "$remoteflag" != "" ]
	then
		bindir=run/bin/$bdname
	else
		echo $usage 1>&2
		exit 1
	fi
fi

###
# Reset PATH in advance
###

PATH=$CRACK_HOME/scripts:$CRACK_HOME/$bindir:$PATH
export PATH

###
# Make the binaries
###

echo "Crack: making utilities in $bindir"

if [ ! -d $bindir ] # small redundancy, big benefit
then
	mkdir $bindir || exit 1
fi

make clean || exit 1

make ARGS="\"XDIR=../../$bindir\" \"XCFLAGS=$CFLAGS\" \"XCC=$CC\" \"XLIBS=$LIBS\"" utils || exit 1

###
# Make Only ?
###

if [ "x$makeonlyflag" != "x" ]
then
	echo "Crack: makeonly done"
	exit 0
fi

###
# Make the dictionary passes
###

dp=run/dict
dplf=$dp/.dictmade

if [ ! -f $dplf ]
then
	test -d $dp && rm -rf $dp

	echo "Crack: making dictionary groups, please be patient..."
	mkdictgrps $dp || exit 1

	echo "Crack: Created new dictionaries..."
	date > $dplf
else
	echo "Crack: The dictionaries seem up to date..."
fi

###
# Make Dict Only ?
###

if [ "x$makedictflag" != "x" ]
then
	echo "Crack: makedict done"
	exit 0
fi

###
# We're on a roll...
###

# F-files are feedback
crackin=run/I$node.$$           # I-files are input to the cracker
crackfb=run/D.boot.$$           # D-files are data from the cracker/fb
crackout=run/D$node.$$
crackerr=run/E$node.$$          # E-files are errors from the cracker

if [ "x$killflag" = "x" ]
then
	crackkf=run/K$node.$$   # K-files are kill file for 'plaster'
else
	crackkf=$killflag
fi

if [ "x$mailflag" != "x" ]
then
	crackmf=run/M$node.$$   # M-files are for mail commands
fi


###
# SPF
###

# The SPF scripts are frontend processors for creating "Single
# Password Format" files which Crack can work on, from any of a
# variety of possible inputs.

# if your target system uses a non-traditional passwd-file format (eg:
# /etc/master.passwd in FreeBSD) then you can use/write a spf script
# (eg: freebsd2spf) to convert the data, and invoke it thusly:

# Crack -fmt freebsd /etc/master.passwd

# If your system has shadow passwords but the core of the password
# data is held in a "traditional" format and uses the standard
# crypt(), function it is recommended that you coerce your data into a
# BSD format file to feed into Crack, by using one of the supplied
# "shadmrg" scripts, or by your own means.

# if your target system is running a non-traditional crypt()
# algorithm, you will have to modify the ELCID code, too.

if [ "x$remoteflag" = "x" ]
then
	echo "Crack: Sorting out and merging feedback, please be patient..."
	fbmerge

	echo "Crack: Merging password files..."
	argbackup2="$*"

	(
		cat run/F-merged        # first the feedback

		while [ "x$1" != "x" ]
		do
			if [ "$1" = "-fmt" ]
			then
				shift || exit 1
				deffmt=$1

			elif [ "$deffmt" = "spf" ]
			then
				cat $1 1>&3 # skip the sort
			else
				${deffmt}2spf $1
			fi

			shift
		done |
		crack-sort -t: +1
	) 3>&1 |
	fbfilt $crackfb $crackmf > $crackin # remove feedback-guessable users

	if [ "x$crackmf" != "x" ]
	then
		if [ -s $crackmf ]
		then
			echo "Crack: mailing nastygrams..."
			sh -x $crackmf
		fi
		rm -f $crackmf
	fi

	if [ "x$recover" = "x" ]
	then
	    echo "Crack: Creating gecos-derived dictionaries"
	    mkgecosd $dp $crackin
	else
	    echo "Crack: -recover: using existing gecos-derived dictionaries"
	fi
else
	echo "Crack: reading data from stdin..."
	cat > $crackin # has already been thru fbfilt on master
	ls -l $crackin
fi

###
# Launch it...
###

flags="$fromflag $niceflag $mailflag"

if [ "x$networkflag" != "x" ]
then
	if [ "x$remoteflag" != "x" ]
	then
		echo "Error: cannot -network AND -remote" 1>&2
		exit 1
	elif [ "x$fgndflag" != "x" ]
	then
		echo "Error: cannot -network AND -foreground" 1>&2
		exit 1
	fi

	echo "Crack: launching: netcrack $flags"
	netcrack $flags <$crackin

elif [ "x$fgndflag" != "x" ]
then
	echo "Crack: exec: cracker -kill $crackkf $flags"
	exec cracker $flags <$crackin
else
	echo "Crack: launching: cracker -kill $crackkf $flags"
	exec 3>&- 4>&- 5>&- 6>&- 7>&- 8>&- 9>&-
	nohup cracker -kill $crackkf $flags <$crackin >$crackout 2>$crackerr &
fi

if [ "x$keep" = "x" ]
then
	sleep 3
	rm $crackin             # Aye, some things never change...
fi

###
# Exit
###

echo "Done"

exit 0
EOF
	cp LICENCE /license/Crack-LICENCE
	cd ..
	mv c50a /usr/
 	mv /dictionary /usr/c50a/dict/1/
	mv /crack5.0.README /usr/c50a


	logmessage2 "Done crack"
}



makep0f() {
	logmessage2 "Making p0f..."
	if [ ! -f p0f-1.8.3.tgz ] ; then exit; fi
	tar -zxvf p0f-1.8.3.tgz
	cd p0f-1.8.3
	make 
	mkdir -p /usr/bin
	mkdir -p /usr/sbin
	mkdir -p /usr/man/man1
	mkdir -p /usr/share/doc/p0f
        cp p0f.fp /etc
        cp p0f.init /etc/init.d/p0f
	cp COPYING CREDITS ChangeLog README README.windows /usr/share/doc/p0f
	cp p0f /usr/sbin
        cp p0frep  /usr/bin
	cp p0f.1 /usr/man/man1/
	gzip -f9 /usr/man/man1/p0f.1
        chmod 755 /etc/init.d/p0f /usr/sbin/p0f /usr/bin/p0frep
	cd ../

	if [ ! -f /usr/sbin/p0f ] ; then exit; fi

	rm -rf p0f-1.8.3
	logmessage2 "Done p0f"
}

cleandb() {
	rm -rvf /usr/lib/libdb.a
	rm -vf /license/db-LICENSE
}

makedb4() {
	logmessage2 "Making db..."
	if [ ! -f $TPMSRCDIR/db-4.1.25.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/db-4.1.25.tar.gz
	cd db-4.1.25/build_unix
	../dist/configure --prefix=/usr --enable-compat185
	make
	make install
	cd ../
	cp LICENSE /license/db-LICENSE
	cd ..
	if [ ! -f /usr/lib/libdb.a ] ; then exit; fi
	rm -rf db-4.1.25
	logmessage2 "Done db"
}

makedb3() {
	logmessage2 "Making db3..."
	cleandb
	if [ ! -f $TPMSRCDIR/db-3.3.11.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/db-3.3.11.tar.gz
	cd db-3.3.11/build_unix
	../dist/configure --prefix=/usr --enable-compat185
	make
	make install
	cd ../
	cp LICENSE /license/db-LICENSE
	cd ..
	if [ ! -f /usr/lib/libdb-3.3.a ] ; then exit; fi
	rm -rf db-3.3.11
	logmessage2 "Done db3"
}


#Files:
#	arpspoof
#	dnsspoof
#	dsniff
#	filesnarf
#	macof
#	mailsnarf
#	msgsnarf
#	sshmitm
#	tcpkill
#	tcpnice
#	urlsnarf
#	webmitm

makedsniff() {
	logmessage2 "Making dsniff..."
	if [ ! -f dsniff-2.3.tar.gz ] ; then exit; fi
	tar -zxvf dsniff-2.3.tar.gz

	#Make libnet, but don't install.  It is just needed to link with dsniff
	if [ ! -f libnet-1.0.2a.tar.gz ] ; then exit; fi
	tar -zxvf libnet-1.0.2a.tar.gz
	cd Libnet-1.0.2a
	LIBNET_CONFIG_CFLAGS=-I/Libnet-1.0.2a/include ./configure --prefix=/usr
	make
	#make install
	cp doc/COPYING /license/libnet-1.0.2a-COPYING
	cd ..
	echo "Done"

	#Since the /usr/lib appears first on the command line, the
	# latest libnet will be used, which won't compile with dsniff. 
	# So rearrange the order of the library flags
	cat > dsniff.patch << "EOF"
diff -uNr dsniff-2.3.orig/Makefile.in dsniff-2.3/Makefile.in
--- dsniff.orig/Makefile.in	2003-11-12 21:42:28.000000000 +0000
+++ dsniff-2.3/Makefile.in	2003-11-12 21:44:53.000000000 +0000
@@ -94,46 +94,46 @@
 	$(RANLIB) $@
 
 dsniff: $(HDRS) $(SRCS) $(OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB) $(DBLIB) $(SSLLIB)
+	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(LNETLIB) $(NIDSLIB) $(PCAPLIB) $(DBLIB) $(SSLLIB)
 
 arpspoof: arpspoof.o arp.o
-	$(CC) $(LDFLAGS) -o $@ arpspoof.o arp.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ arpspoof.o arp.o $(LIBS) $(LNETLIB) $(PCAPLIB)
 
 dnsspoof: dnsspoof.o pcaputil.o
-	$(CC) $(LDFLAGS) -o $@ dnsspoof.o pcaputil.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ dnsspoof.o pcaputil.o $(LIBS) $(LNETLIB) $(PCAPLIB)
 
 filesnarf: nfs_prot.o filesnarf.o pcaputil.o rpc.o
-	$(CC) $(LDFLAGS) -o $@ filesnarf.o nfs_prot.o pcaputil.o rpc.o $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ filesnarf.o nfs_prot.o pcaputil.o rpc.o $(LIBS) $(LNETLIB) $(NIDSLIB) $(PCAPLIB)
 
 macof: macof.o
-	$(CC) $(LDFLAGS) -o $@ macof.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ macof.o $(LIBS) $(LNETLIB) $(PCAPLIB)
 
 mailsnarf: mailsnarf.o buf.o pcaputil.o
-	$(CC) $(LDFLAGS) -o $@ mailsnarf.o buf.o pcaputil.o $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ mailsnarf.o buf.o pcaputil.o $(LIBS) $(LNETLIB) $(NIDSLIB) $(PCAPLIB)
 
 msgsnarf: msgsnarf.o buf.o pcaputil.o
-	$(CC) $(LDFLAGS) -o $@ msgsnarf.o buf.o pcaputil.o $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ msgsnarf.o buf.o pcaputil.o $(LIBS) $(LNETLIB) $(NIDSLIB) $(PCAPLIB)
 
 sshmitm: sshmitm.o buf.o hex.o record.o ssh.o sshcrypto.o
 	$(CC) $(LDFLAGS) -o $@ sshmitm.o buf.o hex.o record.o ssh.o sshcrypto.o $(LIBS) $(LNETLIB) $(DBLIB) $(SSLLIB)
 
 tcpkill: tcpkill.o pcaputil.o
-	$(CC) $(LDFLAGS) -o $@ tcpkill.o pcaputil.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ tcpkill.o pcaputil.o $(LIBS) $(LNETLIB) $(PCAPLIB)
 
 tcpnice: tcpnice.o pcaputil.o
-	$(CC) $(LDFLAGS) -o $@ tcpnice.o pcaputil.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ tcpnice.o pcaputil.o $(LIBS) $(LNETLIB) $(PCAPLIB)
 
 tcphijack: tcphijack.o pcaputil.o
-	$(CC) $(LDFLAGS) -o $@ tcphijack.o pcaputil.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ tcphijack.o pcaputil.o $(LIBS) $(LNETLIB) $(PCAPLIB)
 
 urlsnarf: urlsnarf.o base64.o buf.o pcaputil.o
-	$(CC) $(LDFLAGS) -o $@ urlsnarf.o base64.o buf.o pcaputil.o $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB)
+	$(CC) $(LDFLAGS) -o $@ urlsnarf.o base64.o buf.o pcaputil.o $(LIBS) $(LNETLIB) $(NIDSLIB) $(PCAPLIB)
 
 webmitm: webmitm.o base64.o buf.o decode_http.o record.o
 	$(CC) $(LDFLAGS) -o $@ webmitm.o base64.o buf.o decode_http.o record.o $(LIBS) $(LNETLIB) $(DBLIB) $(SSLLIB)
 
 webspy: webspy.o base64.o buf.o remote.o
-	$(CC) $(LDFLAGS) -o $@ webspy.o base64.o buf.o remote.o $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB) $(X11LIB)
+	$(CC) $(LDFLAGS) -o $@ webspy.o base64.o buf.o remote.o $(LIBS) $(LNETLIB) $(NIDSLIB) $(PCAPLIB) $(X11LIB)
 
 install:
 	test -d $(install_prefix)$(sbindir) || \
EOF

	cd dsniff-2.3
	patch -Np1 -i ../dsniff.patch

	./configure --prefix=/usr --with-libnet=/Libnet-1.0.2a --with-openssl=/usr/ssl


	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cp LICENSE /license/dsniff-LICENSE
	cd ../
	if [ ! -f /usr/sbin/dsniff ] ; then exit; fi
	rm -rf dsniff-2.3 Libnet-1.0.2a dsniff.patch
	logmessage2 "Done dsniff"
}


makexprobe2() {
	logmessage2 "Making xprobe2..."
	if [ ! -f $TPMSRCDIR/xprobe2-0.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/xprobe2-0.1.tar.gz

	cd xprobe2-0.1
	./configure --prefix=/usr --sysconfdir=/etc
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../
	if [ ! -f /usr/bin/xprobe2 ] ; then exit; fi
	rm -rf xprobe2-0.1 xprobe2.patch
	logmessage2 "Done xprobe2"
}




cleanwirelesstools() {
	rm -vf /usr/sbin/iwconfig /usr/sbin/iwspy /usr/sbin/iwpriv 
	rm -vf /usr/man/man8/iwconfig.8 /usr/man/man8/iwspy.8 /usr/man/man8/iwpriv.8
}

makewirelesstools() {
	logmessage2 "Making wirelesstools..."
	cleanwirelesstools
	cp $TPMSRCDIR/wireless_tools.26.tar.gz /
	if [ ! -f wireless_tools.26.tar.gz ] ; then exit; fi
	tar -zxvf wireless_tools.26.tar.gz
	cd wireless_tools.26
###http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
	make 
	if [ $? -ne 0 ]; then exit; fi
	cp iwconfig iwspy iwpriv iwevent iwgetid iwlist /usr/sbin
	cp iwconfig.8 iwspy.8 iwpriv.8 iwevent.8 /usr/man/man8
	cp iwgetid.8 iwlist.8 /usr/man/man8
	cd ../

	if [ ! -f /usr/sbin/iwconfig ] ; then exit; fi
	rm -rf wireless_tools.26
	logmessage2 "Done wirelesstools"
}

makewirelesstools26() {
	logmessage2 "Making wirelesstools..."
	cleanwirelesstools
	if [ ! -f wireless_tools.26.tar.gz ] ; then exit; fi
	tar -zxvf wireless_tools.26.tar.gz
	cd wireless_tools.26
###http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
	make
	if [ $? -ne 0 ]; then exit; fi
	cp iwconfig iwspy iwpriv /usr/sbin
	cp iwconfig.8 iwspy.8 iwpriv.8 /usr/man/man8
	cd ../

	if [ ! -f /usr/sbin/iwconfig ] ; then exit; fi
	rm -rf wireless_tools.26
	logmessage2 "Done wirelesstools"
}

cleangpsdrive() {
	rm -vf /usr/bin/friendsd
	rm -vf /usr/bin/garble
	rm -vf /usr/bin/geo-code
	rm -vf /usr/bin/geo-nearest
	rm -vf /usr/bin/geocache2way
	rm -vf /usr/bin/gpsd
	rm -vf /usr/bin/gpsdrive
	rm -vf /usr/bin/gpsfetchmap
	rm -vf /usr/bin/gpsfetchmap.pl
	rm -vf /usr/bin/gpspoint2gpsdrive.pl
	rm -vf /usr/bin/gpssql_backup.sh
	rm -vf /usr/bin/gpssql_restore.sh
	rm -vf /usr/bin/wpcvt
	rm -vf /usr/bin/wpget
	rm -vf /usr/lib/libfly.la
	rm -vf /usr/lib/libfly.so
	rm -vf /usr/lib/libfly.so.2
	rm -vf /usr/lib/libfly.so.2.0.0
	rm -vf /usr/lib/libnautic.la
	rm -vf /usr/lib/libnautic.so
	rm -vf /usr/lib/libnautic.so.2
	rm -vf /usr/lib/libnautic.so.2.0.0
	rm -vf /usr/man/man1/gpsdrive.1
	rm -vf /usr/man/de/man1/gpsdrive.1
	rm -vf /usr/man/es/man1/gpsdrive.1
	rm -rvf /usr/share/gpsdrive
	rm -vf /usr/share/locale/da/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/de/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/es/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/fr/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/gr/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/hu/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/it/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/nl/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/no/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/pt_BR/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/sk/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/sv/LC_MESSAGES/gpsdrive.mo
	rm -vf /usr/share/locale/tr/LC_MESSAGES/gpsdrive.mo
	rm -rvf /etc/gpsdrive
}

makegpsdrive132() {
	logmessage2 "Making gpsdrive..."
	if [ ! -f $TPMSRCDIR/gpsdrive-1.32.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gpsdrive-1.32.tar.gz
	cd gpsdrive-1.32
	./configure --prefix=/usr --sysconfdir=/etc/gpsdrive --enable-static=no
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/bin/gpsdrive ] ; then exit; fi
	rm -rf gpsdrive-1.32
	logmessage2 "Done"
}

cleangdkpixbuf() {
	rm -vf /usr/bin/gdk-pixbuf-config
	rm -rvf /usr/include/gdk-pixbuf-1.0
	rm -vf /usr/lib/gdk-pixbuf /usr/lib/libgdk_pixbuf.la \
	/usr/lib/libgdk_pixbuf_xlib.la /usr/lib/gdk_pixbufConf.sh \
	/usr/lib/libgdk_pixbuf.so /usr/lib/libgdk_pixbuf_xlib.so \
	/usr/lib/gdk_pixbuf_xlibConf.sh /usr/lib/libgdk_pixbuf.so.2 \
	/usr/lib/libgdk_pixbuf_xlib.so.2 /usr/lib/gnomecanvaspixbufConf.sh \
	/usr/lib/libgdk_pixbuf.so.2.0.0 /usr/lib/libgdk_pixbuf_xlib.so.2.0.0
	rm -rvf /usr/share/gnome/html/gdk-pixbuf
	rm -vf /usr/share/aclocal/gdk-pixbuf.m4
}

makegdkpixbuf() {
	logmessage2 "Making gdkpixbuf..."
	if [ ! -f $TPMSRCDIR/gdk-pixbuf-0.22.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gdk-pixbuf-0.22.0.tar.gz
	cd gdk-pixbuf-0.22.0
	./configure --prefix=/usr --enable-static=no
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/bin/gdk-pixbuf-config ] ; then exit; fi
	rm -rf gdk-pixbuf-0.22.0
	logmessage2 "Done gdkpixbuf"
}


cleankismet() {
	rm -vf /usr/bin/kismet
	rm -vf /usr/bin/kismet_client
	rm -vf /usr/bin/kismet_hopper
	rm -vf /usr/bin/kismet_monitor
	rm -vf /usr/bin/kismet_server
	rm -vf /usr/bin/kismet_unmonitor
	rm -rvf /etc/kismet /usr/share/kismet
	rm -vf /usr/man/man1/kismet.1
	rm -vf /usr/man/man1/kismet_hopper.1
	rm -vf /usr/man/man1/kismet_monitor.1
	rm -vf /usr/man/man5/kismet.conf.5
	rm -vf /usr/man/man5/kismet_ui.conf.5
	rm -vf /etc/kismet.conf /etc/kismet_ui.conf
}


# Needs Expat XML 
# and Magick-config
makekismet301() {
	logmessage2 "Making kismet..."
	cp $TPMSRCDIR/kismet-3.0.1.tar.gz ./
	if [ ! -f kismet-3.0.1.tar.gz ] ; then exit; fi
	tar -zxvf kismet-3.0.1.tar.gz
	cd kismet-3.0.1
	./configure --prefix=/usr --sysconfdir=/etc --with-ethereal=/ethereal-0.9.15
	if [ $? -ne 0 ]; then exit; fi
	make dep
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/bin/kismet ] ; then exit; fi
	rm -rf kismet-3.0.1 kismet-3.0.1.tar.gz 
	rm -rf ethereal-0.9.15
	logmessage2 "Done kismet"
}

makeexpat1957() {
	logmessage2 "Making expat..."
	cp $TPMSRCDIR/expat-1.95.7.tar.gz ./
	if [ ! -f expat-1.95.7.tar.gz ] ; then exit; fi
	tar -zxvf expat-1.95.7.tar.gz
	cd expat-1.95.7
	./configure --prefix=/usr --sysconfdir=/etc --with-ethereal=/ethereal-0.9.15
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/lib/libexpat.a ] ; then exit; fi
	rm -rf expat-1.95.7 expat-1.95.7.tar.gz
	logmessage2 "Done expat"
}

makeimagemagick55713() {
	logmessage2 "Making image magick..."
	if [ ! -f $TPMSRCDIR/ImageMagick-5.5.7-13.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ImageMagick-5.5.7-13.tar.gz
	cd ImageMagick-5.5.7
	./configure --prefix=/usr --sysconfdir=/etc
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/lib/libMagick.a ] ; then exit; fi
	rm -rf ImageMagick-5.5.7
	logmessage2 "Done image magick"
}

cleangtkmm() {
	echo
	rm -vf /usr/bin/gtkmm-config
	rm -vf /usr/bin/gtkmmconvert
	rm -vf /usr/include/gdk--.h
	rm -vf /usr/include/glib--.h
	rm -vf /usr/include/gtk--.h
	rm -rvf /usr/include/gdk--
	rm -rvf /usr/include/gtk--
	rm -rvf /usr/lib/gtkmm
	rm -vf /usr/lib/libgdkmm-1.2.so.1
	rm -vf /usr/lib/libgdkmm-1.2.so.1.1.2
	rm -vf /usr/lib/libgdkmm.la
	rm -vf /usr/lib/libgdkmm.so
	rm -vf /usr/lib/libgtkmm-1.2.so.0
	rm -vf /usr/lib/libgtkmm-1.2.so.0.3.4
	rm -vf /usr/lib/libgtkmm.la
	rm -vf /usr/lib/libgtkmm.so
	rm -vf /usr/share/aclocal/gtk--.m4
}

makegtkmm() {

	logmessage2 "Making gtkmm..."
	cleangtkmm
	if [ ! -f gtkmm-1.2.10.tar.gz ] ; then exit; fi
	tar -zxvf gtkmm-1.2.10.tar.gz
	cd gtkmm-1.2.10
	./configure --prefix=/usr/ --sysconfdir=/etc  --enable-static=no
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/bin/gtkmm-config ] ; then exit; fi
	rm -rf gtkmm-1.2.10
	logmessage2 "Done gtkmm"
}

cleanlibxml2() {
	rm -vf /usr/bin/xml2-config
	rm -vf /usr/bin/xmlcatalog
	rm -vf /usr/bin/xmllint
	rm -rvf /usr/include/libxml2
	rm -vf /usr/lib/libxml2.a
	rm -vf /usr/lib/libxml2.la
	rm -vf /usr/lib/libxml2.so
	rm -vf /usr/lib/libxml2.so.2
	rm -vf /usr/lib/libxml2.so.2.5.8
	rm -vf /usr/lib/pkgconfig/libxml-2.0.pc
	rm -vf /usr/lib/xml2Conf.sh
	rm -vf /usr/man/man1/xml2-config.1
	rm -vf /usr/man/man1/xmlcatalog.1
	rm -vf /usr/man/man1/xmllint.1
	rm -vf /usr/man/man3/libxml.3
	rm -vf /usr/share/aclocal/libxml.m4
	rm -rvf /usr/share/doc/libxml2-2.5.8
}

makelibxml2() {
	logmessage2 "Making libxml2..."
	cleanlibxml2
	if [ ! -f libxml2-2.5.8.tar.gz ] ; then exit; fi
	tar -zxvf libxml2-2.5.8.tar.gz

	cd libxml2-2.5.8
	./configure --prefix=/usr --sysconfdir=/etc  --enable-static=no
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ../

	if [ ! -f /usr/lib/libxml2.so ] ; then exit; fi
	rm -rf libxml2-2.5.8
	logmessage2 "Done libxml2"
}

cleanlibxslt() {
	rm -vf /usr/bin/xslt-config
	rm -vf /usr/bin/xsltproc
	rm -rvf /usr/include/libexslt
	rm -rvf /usr/include/libxslt
	rm -vf /usr/lib/libexslt.a
	rm -vf /usr/lib/libexslt.la
	rm -vf /usr/lib/libexslt.so
	rm -vf /usr/lib/libexslt.so.0
	rm -vf /usr/lib/libexslt.so.0.7.20
	rm -vf /usr/lib/libxslt.a
	rm -vf /usr/lib/libxslt.la
	rm -vf /usr/lib/libxslt.so
	rm -vf /usr/lib/libxslt.so.1
	rm -vf /usr/lib/libxslt.so.1.0.30
	rm -vf /usr/lib/libxsltbreakpoint.a
	rm -vf /usr/lib/libxsltbreakpoint.la
	rm -vf /usr/lib/libxsltbreakpoint.so
	rm -vf /usr/lib/libxsltbreakpoint.so.1
	rm -vf /usr/lib/libxsltbreakpoint.so.1.0.8
	rm -vf /usr/lib/pkgconfig/libxslt.pc
	rm -vf /usr/lib/xsltConf.sh
	rm -vf /usr/man/man1/xsltproc.1
	rm -vf /usr/man/man4/libexslt.4
	rm -vf /usr/man/man4/libxslt.4
	rm -vf /usr/share/aclocal/libxslt.m4
	rm -rvf /usr/share/doc/libxslt-1.0.30
}

makelibxslt() {
	logmessage2 "Making libxslt..."
	cleanlibxslt
	if [ ! -f libxslt-1.0.30.tar.gz ] ; then exit; fi
	tar -zxvf libxslt-1.0.30.tar.gz

	cd libxslt-1.0.30
	./configure --prefix=/usr --sysconfdir=/etc  --enable-static=no
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ../

	if [ ! -f /usr/lib/libxslt.so ] ; then exit; fi
	rm -rf libxslt-1.0.30
	logmessage2 "Done libxslt"
}


cleanlibfwbuilder() {
	rm -vf /usr/bin/libfwbuilder-config
	rm -rvf /usr/include/fwcompiler
	rm -vf /usr/lib/libfwcompiler.a
	rm -vf /usr/lib/libfwcompiler.so
	rm -vf /usr/lib/libfwcompiler.so.5
	rm -vf /usr/lib/libfwcompiler.so.5.0.0
	rm -rvf /usr/share/libfwbuilder /usr/share/doc/libfwbuilder-1.0.0
}

makelibfwbuilder() {
	logmessage2 "Making libfwbuilder..."
	cleanlibfwbuilder
	if [ ! -f libfwbuilder-1.0.0.tar.gz ] ; then exit; fi
	tar -zxvf libfwbuilder-1.0.0.tar.gz
	
	cd libfwbuilder-1.0.0
	./autogen.sh --prefix=/usr --sysconfdir=/etc  --enable-static=no
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ../

	if [ ! -f /usr/lib/libfwcompiler.so ] ; then exit; fi
	rm -rf libfwbuilder-1.0.0
	logmessage2 "Done libfwbuilder"
}

cleanfwbuilder() {
	rm -vf /usr/bin/fwb_install
	rm -vf /usr/bin/fwb_ipf
	rm -vf /usr/bin/fwb_ipfw
	rm -vf /usr/bin/fwb_ipt
	rm -vf /usr/bin/fwb_pf
	rm -vf /usr/bin/fwblookup
	rm -vf /usr/bin/fwbuilder
	rm -rvf /usr/share/bug-buddy
	rm -rvf /usr/share/fwbuilder
	rm -rvf /usr/share/doc/fwbuilder-1.0.10
	rm -vf /usr/share/locale/br/LC_MESSAGES/fwbuilder.mo
	rm -vf /usr/share/locale/de/LC_MESSAGES/fwbuilder.mo
	rm -vf /usr/share/locale/fr/LC_MESSAGES/fwbuilder.mo
	rm -vf /usr/share/locale/ru/LC_MESSAGES/fwbuilder.mo
	rm -vf /usr/share/locale/tr/LC_MESSAGES/fwbuilder.mo
	rm -vf /usr/share/man/man1/fwb_install.1
	rm -vf /usr/share/man/man1/fwb_ipfw.1
	rm -vf /usr/share/man/man1/fwb_pf.1
	rm -vf /usr/share/man/man1/fwbuilder.1
	rm -vf /usr/share/man/man1/fwb_ipf.1
	rm -vf /usr/share/man/man1/fwb_ipt.1
	rm -vf /usr/share/man/man1/fwblookup.1
	rm -rvf /usr/share/pixmaps/fwbuilder
}

makefwbuilder() {
	logmessage2 "Making fwbuilder..."
	cleanfwbuilder
	if [ ! -f fwbuilder-1.0.10.tar.gz ] ; then exit; fi
	tar -zxvf fwbuilder-1.0.10.tar.gz

	cd fwbuilder-1.0.10
	./autogen.sh --prefix=/usr --sysconfdir=/etc 
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/bin/fwbuilder ] ; then exit; fi
	rm -rf fwbuilder-1.0.10
	logmessage2 "Done fwbuilder"
}


cleanlibsigc() {
	rm -vf /usr/bin/sigc-config
	rm -rvf /usr/lib/sigc++-1.0 /usr/include/sigc++-1.0
	rm -vf /usr/lib/libsigc-1.0.so.0
	rm -vf /usr/lib/libsigc-1.0.so.0.0.0
	rm -vf /usr/lib/libsigc.a
	rm -vf /usr/lib/libsigc.la
	rm -vf /usr/lib/libsigc.so
	rm -vf /usr/share/aclocal/sigc++.m4
}

makelibsigc() {
	logmessage2 "Making libsigc..."
	cleanlibsigc
	if [ ! -f libsigc++-1.0.4.tar.gz ] ; then exit; fi
	tar -zxvf libsigc++-1.0.4.tar.gz
	cd libsigc++-1.0.4
	./configure --prefix=/usr --sysconfdir=/etc --enable-static=no
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/bin/sigc-config ] ; then exit; fi
	rm -rf libsigc++-1.0.4
	logmessage2 "Done libsigc"
}


cleangpsd() {
	rm -rvf /usr/sbin/gpsd /usr/lib/libgpsd.a
}

makegpsd() {
	echo "Making gpsd..."
	if [ ! -f $TPMSRCDIR/gpsd-1.07.tar.gz ] ; then exit -1; fi
	tar -zxvf $TPMSRCDIR/gpsd-1.07.tar.gz
	cd gpsd-1.07
	./configure --prefix=/usr --sysconfdir=/etc/gpsd
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	cp gpsd /usr/sbin/
	cp libgpsd.a /usr/lib
	cd ../

	cat > /etc/init.d/gpsd << "EOF"
#!/bin/sh
. /etc/init.d/functions

#Default values
DEVICE="/dev/cua/0"
BPS="4800"
 
#Load values from config
. /etc/sysconfig/gps

case "$1" in
  start|--start)
	gpsd -p $DEVICE -s $BPS
	;;


  stop|--stop)
	pkill gpsd
	;;

  *)
	echo "Usage: gpsd {start|stop}" >&2
	exit 2
esac

exit 0
EOF

	cat > /etc/sysconfig/SAMPLE.gps << "EOF"
DEVICE="/dev/cua/0"
BPS="4800"
EOF

	chmod 755 /etc/init.d/gpsd
	if [ ! -f /usr/sbin/gpsd ] ; then exit; fi
	rm -rf gpsd-1.07
	echo "Done"
}

makeacx100binary20030626with2422() {

	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030626.tgz ./
	if [ ! -f acx100_bin_20030626.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030626.tgz
	cd Acx100Drv
	mkdir 2.4.22
	cp 2.4.21-0.13mdk/acx100sta-2.4.21-0.13mdk.o 2.4.22/acx100sta-2.4.22.o
	cd 2.4.22


	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.22.o

	cp acx100sta-2.4.22.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o ] ; then exit; fi
	rm -rf Acx100Drv
	logmessage2 "Done"
}

makeacx100binary20030626with2420for2421() {

	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030626.tgz ./
	if [ ! -f acx100_bin_20030626.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030626.tgz
	cd Acx100Drv
	mkdir 2.4.21
	cp 2.4.20-8/acx100sta-2.4.20-8.o 2.4.21/acx100sta-2.4.21.o
	cd 2.4.21

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.21.o

	cp acx100sta-2.4.21.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626-2.4.20-8.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626-2.4.20-8.o ] ; then exit; fi
	rm -rf Acx100Drv
	logmessage2 "Done"
}

makeacx100binary20030626with2420() {
	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030626.tgz ./
	if [ ! -f acx100_bin_20030626.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030626.tgz
	cd Acx100Drv
	mkdir 2.4.20
	cp 2.4.20-8/acx100sta-2.4.20-8.o 2.4.20/acx100sta-2.4.20.o
	cd 2.4.20

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.20.o

	cp acx100sta-2.4.20.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626-2.4.20-8.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626-2.4.20-8.o ] ; then exit; fi
	rm -rf Acx100Drv
	logmessage2 "Done"
}

makeacx100binary20030626with2421() {

	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030626.tgz ./
	if [ ! -f acx100_bin_20030626.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030626.tgz
	cd Acx100Drv
	mkdir 2.4.21
	cp 2.4.21-0.13mdk/acx100sta-2.4.21-0.13mdk.o 2.4.21/acx100sta-2.4.21.o
	cd 2.4.21


	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.21.o

	cp acx100sta-2.4.21.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030626.o ] ; then exit; fi
	rm -rf Acx100Drv
	logmessage2 "Done"

}

cleanacx100binary() {
	rm -vf /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
}

makeacx100binary20030716() {
	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030716.tgz ./
	if [ ! -f acx100_bin_20030716.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030716.tgz
	cd Acx100Drv
	mkdir 2.4.22
	cp 2.4.21-0.13mdk/acx100sta-2.4.21-0.13mdk.o 2.4.22/acx100sta-2.4.22.o
	cd 2.4.22

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.22.o

	cp acx100sta-2.4.22.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ] ; then exit; fi
	rm -rf Acx100Drv acx100_bin_20030716.tgz
	logmessage2 "Done"
}

makeacx100binary20030716with2424() {
	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030716.tgz ./
	if [ ! -f acx100_bin_20030716.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030716.tgz
	cd Acx100Drv
	mkdir 2.4.24
	cp 2.4.21-0.13mdk/acx100sta-2.4.21-0.13mdk.o 2.4.24/acx100sta-2.4.24.o
	cd 2.4.24

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.24.o

	cp acx100sta-2.4.24.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ] ; then exit; fi
	rm -rf Acx100Drv acx100_bin_20030716.tgz
	logmessage2 "Done"
}

makeacx100binary20030716with2423() {
	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030716.tgz ./
	if [ ! -f acx100_bin_20030716.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030716.tgz
	cd Acx100Drv
	mkdir 2.4.23
	cp 2.4.21-0.13mdk/acx100sta-2.4.21-0.13mdk.o 2.4.23/acx100sta-2.4.23.o
	cd 2.4.23

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.23.o

	cp acx100sta-2.4.23.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ] ; then exit; fi
	rm -rf Acx100Drv acx100_bin_20030716.tgz
	logmessage2 "Done"
}

makeacx100binary20030716with2420for2421() {
	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030716.tgz ./
	if [ ! -f acx100_bin_20030716.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030716.tgz
	cd Acx100Drv
	mkdir 2.4.21
	cp 2.4.20-8/acx100sta-2.4.20-8.o 2.4.21/acx100sta-2.4.21.o
	cd 2.4.21

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.21.o

	cp acx100sta-2.4.21.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030716-2.4.20-8.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta20030716-2.4.20-8.o ] ; then exit; fi
	rm -rf Acx100Drv acx100_bin_20030716.tgz
	logmessage2 "Done"
}


makeacx100binary20030716with2420() {
	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030716.tgz ./
	if [ ! -f acx100_bin_20030716.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030716.tgz
	cd Acx100Drv
	mkdir 2.4.20
	cp 2.4.20-8/acx100sta-2.4.20-8.o 2.4.20/acx100sta-2.4.20.o
	cd 2.4.20

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.20.o

	cp acx100sta-2.4.20.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ] ; then exit; fi
	rm -rf Acx100Drv acx100_bin_20030716.tgz
	logmessage2 "Done"
}


makeacx100binary20030716with2421() {
	logmessage2 "Making acx100 binary..."
	cp $TPMSRCDIR/acx100_bin_20030716.tgz ./
	if [ ! -f acx100_bin_20030716.tgz ] ; then exit; fi
	tar -zxvf acx100_bin_20030716.tgz
	cd Acx100Drv
	mkdir 2.4.21
	cp 2.4.21-0.13mdk/acx100sta-2.4.21-0.13mdk.o 2.4.21/acx100sta-2.4.21.o
	cd 2.4.21

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.21.o

	cp acx100sta-2.4.21.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ] ; then exit; fi
	rm -rf Acx100Drv acx100_bin_20030716.tgz
	logmessage2 "Done"
}


makemadwifi20030802() {
	logmessage2 "Making madwifi source..."
	cp $TPMSRCDIR/madwifi-20030802.tgz ./
	if [ ! -f madwifi-20030802.tgz ] ; then exit; fi
	tar -zxvf madwifi-20030802.tgz
	cd madwifi-20030802
	make 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit -1; fi	
	make install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /lib/modules/`uname -r`/net/ath_hal.o ] ; then exit; fi
	if [ ! -f /lib/modules/`uname -r`/net/ath_pci.o ] ; then exit; fi
	if [ ! -f /lib/modules/`uname -r`/net/wlan.o ] ; then exit; fi
	rm -rf madwifi-20030802 madwifi-20030802.tgz
	logmessage2 "Done madwifi"
}

makemadwificvs20031124() {
	logmessage2 "Making madwifi source..."
	cp $TPMSRCDIR/madwifi-20031124.tar.gz ./
	if [ ! -f madwifi-20031124.tar.gz ] ; then exit; fi
	tar -zxvf madwifi-20031124.tar.gz
	cd madwifi
	make 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit -1; fi	
	make install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /lib/modules/`uname -r`/net/ath_hal.o ] ; then exit; fi
	if [ ! -f /lib/modules/`uname -r`/net/ath_pci.o ] ; then exit; fi
	if [ ! -f /lib/modules/`uname -r`/net/wlan.o ] ; then exit; fi
	rm -rf madwifi madwifi-20031124.tar.gz
	logmessage2 "Done madwifi"
}

makewlanng021pre9() {
	logmessage2 "Making wlan-ng..."
	cp $TPMSRCDIR/linux-wlan-ng-0.2.1-pre9.tar.gz ./
	if [ ! -f linux-wlan-ng-0.2.1-pre9.tar.gz ] ; then exit; fi
	tar -zxvf linux-wlan-ng-0.2.1-pre9.tar.gz
	cd linux-wlan-ng-0.2.1-pre9
	echo "y\ny\ny\ny\n/linux-2.4.23\n\n\n\n\n\n" | make config
	if [ $? -ne 0 ]; then exit -1; fi	
	make all
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	mv /usr/local/man/man1/* /usr/man/man1	
	cd ..

	if [ ! -f /lib/modules/`uname -r`/pcmcia/prism2_cs.o ] ; then exit; fi
	if [ ! -f /lib/modules/`uname -r`/net/p80211.o ] ; then exit; fi
	if [ ! -f /sbin/wlanctl-ng ] ; then exit; fi
	if [ ! -f /sbin/wland ] ; then exit; fi
	if [ ! -f /sbin/nwepgen ] ; then exit; fi
	if [ ! -f /sbin/wlancfg ] ; then exit; fi

	rm -rf linux-wlan-ng-0.2.1-pre9.tar.gz linux-wlan-ng-0.2.1-pre9
	logmessage2 "Done wlan-ng"
}

makepcmcia() {
	logmessage2 "Making pcmcia..."
	cp $TPMSRCDIR/pcmcia-cs-3.2.5.tar.gz ./
	if [ ! -f pcmcia-cs-3.2.5.tar.gz ] ; then exit; fi
	tar -zxvf pcmcia-cs-3.2.5.tar.gz
	cd pcmcia-cs-3.2.5

	cat > config.mk << "EOF"
LINUX=/linux-2.4.21
PREFIX=
KCC=cc
UCC=cc
LD=ld
KFLAGS=
UFLAGS=
PCDEBUG=
USE_PM=y
UNSAFE_TOOLS=y
CONFIG_CARDBUS=y
# CONFIG_PNP_BIOS is not defined
UTS_RELEASE=2.4.21
UTS_VERSION=#1 SMP Sun Nov 23 00:00:05 Local time zone must be set--see zic
LINUX_VERSION_CODE=132117

MODDIR=/lib/modules/2.4.21

# Options from current kernel
CONFIG_PCMCIA=y
CONFIG_SMP=y
# CONFIG_PREEMPT is not defined
# CONFIG_HIGHMEM is not defined
CONFIG_PCI=y
# CONFIG_PM is not defined
CONFIG_SCSI=y
# CONFIG_IEEE1394 is not defined
CONFIG_INET=y
CONFIG_NET_PCMCIA_RADIO=y
CONFIG_TR=y
# CONFIG_NET_FASTROUTE is not defined
# CONFIG_NET_DIVERT is not defined
CONFIG_MODVERSIONS=y
# CONFIG_DEBUG_KERNEL is not defined
# CONFIG_PREEMPT is not defined
CONFIG_PROC_FS=y
CONFIG_X86_L1_CACHE_BYTES=32
CONFIG_X86_L1_CACHE_SHIFT=5
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_PCI_QUIRKS=y
# CONFIG_EISA is not defined
# CONFIG_X86_CMPXCHG is not defined
# CONFIG_X86_PAE is not defined
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not defined
ARCH=i386
HOST_ARCH=i386
AFLAGS=
CONFIG_ISA=y
CONFIG_UID16=y

CPPFLAGS=-I../include/static -I$(LINUX)/include -I../include
WFLAG=-Wa,--no-warn
HAS_PROC_BUS=y
DO_IDE=y
DO_ORINOCO=y
# NEW_AIC7XXX is not defined
RC_DIR=/etc/rc.d
# HAS_FORMS is not defined
# HAS_XAW is not defined
# HAS_GTK is not defined
HAS_WORDEXP=y
MANDIR=/usr/share/man/
XMANDIR=/usr/X11R6/man
EOF

	cat > config.in << "EOF"
#
# Automatically generated by 'make config' -- don't edit!
#
LINUX="/linux-2.4.21"
PREFIX=""
KCC="cc"
UCC="cc"
LD="ld"
KFLAGS=""
UFLAGS=""
PCDEBUG=""
USE_PM=y
UNSAFE_TOOLS=y
CONFIG_CARDBUS=y
# CONFIG_PNP_BIOS is not defined
CONF_SRC=1
UTS_RELEASE="2.4.21"
UTS_VERSION="#1 SMP Sun Nov 23 00:00:05 Local time zone must be set--see zic"
LINUX_VERSION_CODE=132117

MODDIR="/lib/modules/2.4.21"

# Options from current kernel
CHECK="/proc/version"
CKSUM="2535672511 120"
CONFIG_PCMCIA=y
CONFIG_SMP=y
# CONFIG_PREEMPT is not defined
# CONFIG_HIGHMEM is not defined
CONFIG_PCI=y
# CONFIG_PM is not defined
CONFIG_SCSI=y
# CONFIG_IEEE1394 is not defined
CONFIG_INET=y
CONFIG_NET_PCMCIA_RADIO=y
CONFIG_TR=y
# CONFIG_NET_FASTROUTE is not defined
# CONFIG_NET_DIVERT is not defined
CONFIG_MODVERSIONS=y
# CONFIG_DEBUG_KERNEL is not defined
# CONFIG_PREEMPT is not defined
CONFIG_PROC_FS=y
CONFIG_X86_L1_CACHE_BYTES=32
CONFIG_X86_L1_CACHE_SHIFT=5
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_PCI_QUIRKS=y
# CONFIG_EISA is not defined
# CONFIG_X86_CMPXCHG is not defined
# CONFIG_X86_PAE is not defined
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not defined
ARCH="i386"
HOST_ARCH="i386"
AFLAGS=""
CONFIG_ISA=y
CONFIG_UID16=y

HAS_PROC_BUS=y
# NEW_AIC7XXX is not defined
RC_DIR="/etc/rc.d"
# HAS_FORMS is not defined
# HAS_XAW is not defined
# HAS_GTK is not defined
HAS_WORDEXP=y
MANDIR="/usr/share/man/"
XMANDIR="/usr/X11R6/man"
EOF
	make all
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /sbin/cardctl ] ; then exit; fi
	if [ ! -f /sbin/cardmgr ] ; then exit; fi
	rm -rf pcmcia-cs-3.2.5.tar.gz pcmcia-cs-3.2.5
	logmessage2 "Done pcmcia"
}

makepciutils2111() {
	logmessage2 "Making PCI utilities..."
	cp $TPMSRCDIR/pciutils-2.1.11.tar.gz ./
	if [ ! -f pciutils-2.1.11.tar.gz ] ; then exit; fi
	tar -zxvf pciutils-2.1.11.tar.gz
	cd pciutils-2.1.11
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	make PREFIX=/usr ROOT=/usr install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/sbin/lspci ] ; then exit; fi
	if [ ! -f /usr/sbin/setpci ] ; then exit; fi
	rm -rf pciutils-2.1.11 pciutils-2.1.11.tar.gz
	logmessage2 "Done PCI utilities"
}


makesniffit035() {
	logmessage2 "Making sniffit..."
	cp $TPMSRCDIR/sniffit.0.3.5.tar.gz ./
	if [ ! -f sniffit.0.3.5.tar.gz ] ; then exit; fi
	tar -zxvf sniffit.0.3.5.tar.gz
	cd sniffit.0.3.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	cp sniffit /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/bin/sniffit ] ; then exit; fi
	rm -rf sniffit.0.3.5 sniffit.0.3.5.tar.gz
	logmessage2 "Done sniffit"
}

makepython232() {
	logmessage2 "Making python..."
	if [ ! -f $TPMSRCDIR/Python-2.3.2.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Python-2.3.2.tgz
	cd Python-2.3.2
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/bin/python ] ; then exit; fi
	rm -rf Python-2.3.2
	logmessage2 "Done python"
}

makefping24b2ipv6() {
	logmessage2 "Making fping..."
	cp $TPMSRCDIR/fping-2.4b2_to-ipv6.tar.gz ./
	if [ ! -f fping-2.4b2_to-ipv6.tar.gz ] ; then exit; fi
	tar -zxvf fping-2.4b2_to-ipv6.tar.gz
	cd fping-2.4b2_to-ipv6
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/sbin/fping ] ; then exit; fi
	rm -rf fping-2.4b2_to-ipv6.tar.gz fping-2.4b2_to-ipv6
	logmessage2 "Done fping"
}

makeraccess07() {
	logmessage2 "Making raccess..."
	cp $TPMSRCDIR/raccess-0.7.tar.gz ./
	if [ ! -f raccess-0.7.tar.gz ] ; then exit; fi
	tar -zxvf raccess-0.7.tar.gz
	cd raccess-0.7
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/bin/raccess ] ; then exit; fi
	rm -rf raccess-0.7 raccess-0.7.tar.gz
	logmessage2 "Done raccess"
}

makesleuthkit166() {
	logmessage2 "Making sleuthkit..."
	cp $TPMSRCDIR/sleuthkit-1.66.tar.gz ./
	if [ ! -f sleuthkit-1.66.tar.gz ] ; then exit; fi
	tar -zxvf sleuthkit-1.66.tar.gz
	cd sleuthkit-1.66
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	rm bin/file
	cp bin/* /usr/bin
	cp man/man1/* /usr/man/man1
	cp man/man4/* /usr/man/man4
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/bin/dcalc ] ; then exit; fi
	if [ ! -f /usr/bin/dcat ] ; then exit; fi
	if [ ! -f /usr/bin/dls ] ; then exit; fi
	if [ ! -f /usr/bin/dstat ] ; then exit; fi
	if [ ! -f /usr/bin/ffind ] ; then exit; fi
	if [ ! -f /usr/bin/file ] ; then exit; fi
	if [ ! -f /usr/bin/fls ] ; then exit; fi
	if [ ! -f /usr/bin/fsstat ] ; then exit; fi
	if [ ! -f /usr/bin/hfind ] ; then exit; fi
	if [ ! -f /usr/bin/icat ] ; then exit; fi
	if [ ! -f /usr/bin/ifind ] ; then exit; fi
	if [ ! -f /usr/bin/ils ] ; then exit; fi
	if [ ! -f /usr/bin/istat ] ; then exit; fi
	if [ ! -f /usr/bin/mactime ] ; then exit; fi
	if [ ! -f /usr/bin/md5 ] ; then exit; fi
	if [ ! -f /usr/bin/mmls ] ; then exit; fi
	if [ ! -f /usr/bin/sha1 ] ; then exit; fi
	if [ ! -f /usr/bin/sorter ] ; then exit; fi
	rm -rf sleuthkit-1.66.tar.gz sleuthkit-1.66
	logmessage2 "Done sleuthkit"
}

makeautopsy175() {
	logmessage2 "Making autopsy..."
	if [ ! -f $TPMSRCDIR/autopsy-1.75.tar.gz ] ; then exit; fi

	cat > autopsy.patch << "EOF"
--- autopsy-1.75.orig/configure	2003-11-15 17:39:56.000000000 +0000
+++ /etc/autopsy/configure	2004-01-14 18:42:25.000000000 +0000
@@ -151,13 +151,13 @@
 
 conf='conf.pl'
 
-if (test -f $conf) then
-  echo "A configuration file already exists, overwrite? (y/n):";
-  read rep;
-  if (test "$rep" = "n") then
+#if (test -f $conf) then
+#  echo "A configuration file already exists, overwrite? (y/n):";
+#  read rep;
+#  if (test "$rep" = "n") then
     exit 0;
-  fi
-fi
+#  fi
+#fi
 
 # echo ''
 # echo '---------------------------------------------------------------'
EOF


	cd /etc
	tar -zxvf $TPMSRCDIR/autopsy-1.75.tar.gz
	mv autopsy-1.75 autopsy
	cd autopsy
	cat > conf.pl << "EOF"
# Autopsy configuration settings

# when set to 1, the server will stop after it receives no
# connections for STIMEOUT seconds. 
$USE_STIMEOUT = 0;
$STIMEOUT = 3600;

# number of seconds that child waits for input from client
$CTIMEOUT = 15;

# Set to 1 for cookie authentication
$USE_COOKIE = 1;
# set to 1 to save the cookie value in a file (for scripting)
$SAVE_COOKIE = 1;

# set to 1 to log errors and audit trail, 0 for none
$USE_LOG = 1;
# set to 1 to allow investigators to make notes, 0 to not
$USE_NOTES = 1;

$INSTALLDIR = '/etc/autopsy/';

# Default directory names
$IMGDIR = 'images';
$DATADIR ='output';
$LOGDIR = 'logs';
$REPDIR = 'reports';


# System Utilities
$STRINGS_EXE = '/usr/bin/strings';
$GREP_EXE = '/bin/grep';


# Directories
$TASKDIR = '/usr/bin/';
$NSRLDB = '';
$LOCKDIR = '/var/local/autopsy';
EOF

	patch -Np1 -i ../../autopsy.patch

	make
	if [ $? -ne 0 ]; then exit -1; fi
	mv autopsy /usr/bin
	mv autopsyfunc.pm /usr/lib/perl5/site_perl/5.8.1/i686-linux/
	mv man/man1/autopsy.1 /usr/man/man1
	rm -rf man
	rm [A-Z]* configure 
	cd ..
	chown -R root:root autopsy
	cd ..

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/autopsyfunc.pm ] ; then exit; fi
	if [ ! -f /usr/bin/autopsy ] ; then exit; fi
	rm -f autopsy.patch
	logmessage2 "Done autopsy"
}


makeiptraf270() {
	logmessage2 "Making IPTraf..."
	cp $TPMSRCDIR/iptraf-2.7.0.tar.gz ./
	if [ ! -f iptraf-2.7.0.tar.gz ] ; then exit; fi
	tar -zxvf iptraf-2.7.0.tar.gz

	cat > iptraf.patch << "EOF"
diff -uNr iptraf-2.7.0.orig/src//Makefile iptraf-2.7.0/src//Makefile
--- iptraf-2.7.0.orig/src//Makefile	2002-05-11 07:27:36.000000000 +0000
+++ iptraf-2.7.0/src//Makefile	2003-12-01 22:50:11.000000000 +0000
@@ -68,7 +68,7 @@
 # installation target directory.  The iptraf and rvnamed programs get
 # stored here.  iptraf also exec's rvnamed from this directory.
 
-TARGET		= /usr/local/bin
+TARGET		= /usr/bin
 
 # The IPTraf working directory; if you change this.  Starting with this
 # version, this definition overrides dirs.h.
EOF

	cd iptraf-2.7.0
	patch -Np1 -i ../iptraf.patch
	cd src
	make clean
	make
	if [ $? -ne 0 ]; then exit -1; fi
	echo "n\n" | make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ../..

	if [ ! -f /usr/bin/iptraf ] ; then exit; fi
	if [ ! -f /usr/bin/rvnamed ] ; then exit; fi
	rm -rf iptraf-2.7.0.tar.gz iptraf-2.7.0
	logmessage2 "Done IPTraf"
}

makemktemp() {
	logmessage2 "Making mktemp..."
	cp $TPMSRCDIR/mktemp-1.5.tar.gz ./
	if [ ! -f mktemp-1.5.tar.gz ] ; then exit; fi
	tar -zxvf mktemp-1.5.tar.gz
	cd mktemp-1.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..
	if [ ! -f /usr/bin/mktemp ] ; then exit; fi

	rm -rf mktemp-1.5 mktemp-1.5.tar.gz
	logmessage2 "Done mktemp"
}

#Forget this one.  Requires too many supporting libraries that 
# I don't want to compile in right now.
makepartimage062() {
	logmessage2 "Making partimage..."

	cp $TPMSRCDIR/partimage-0.6.2.tar.bz2 ./

	if [ ! -f partimage-0.6.2.tar.bz2 ] ; then exit; fi


	bunzip2 -c partimage-0.6.2.tar.bz2 | tar -xv
	cd partimage-0.6.2
	./configure --prefix=/usr --enable-ssl=/usr/ssl --sysconfdir=/etc
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/sbin/partimaged ] ; then exit; fi

	rm -rf partimage-0.6.2 partimage-0.6.2.tar.bz2
	logmessage2 "Done partimage"
}

makenewt050() {
	logmessage2 "Making newt..."

	cp $TPMSRCDIR/newt-0.50.tar.gz ./

	if [ ! -f newt-0.50.tar.gz ] ; then exit; fi

	tar -zxvf newt-0.50.tar.gz

	cat > newt.patch << "EOF"
diff -uNr newt.orig/Makefile.in newt/Makefile.in
--- newt-0.50.orig/Makefile.in	1999-08-02 15:37:34.000000000 +0000
+++ newt-0.50/Makefile.in	2003-12-01 22:40:45.000000000 +0000
@@ -30,8 +30,8 @@
 libdir = $(prefix)/lib
 bindir = $(prefix)/bin
 ARCHNAME = $(shell uname -m | sed 's/i.86/i386/')
-pythondir = $(prefix)/lib/python1.5
-pythonbindir = $(prefix)/lib/python1.5/lib-dynload
+pythondir = $(prefix)/lib/python2.3
+pythonbindir = $(prefix)/lib/python2.3/lib-dynload
 
 #--------------------------------------
 
@@ -61,7 +61,7 @@
 	gcc --shared -o _snackmodule.so snackmodule.o -L . $(LIBNEWTSH)
 
 snackmodule.o:   snackmodule.c
-	gcc -I/usr/include/python1.5 -fPIC $(CFLAGS) -c snackmodule.c
+	gcc -I/usr/include/python2.3 -fPIC $(CFLAGS) -c snackmodule.c
 
 whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
 	gcc -g -o whiptail $(NDIALOGOBJS) -L . $(LIBNEWTSH) $(LIBS) -lpopt
EOF
	cd newt-0.50

	patch -Np1 -i ../newt.patch

	./configure --prefix=/usr
	make
	make install
	if [ ! -f /usr/lib/libnewt.a ] ; then exit; fi
	cd ..

	logmessage2 "Done making newt"

	rm -rf newt-0.50
	logmessage2 "Done newt"
}

makepopt17() {
	logmessage2 "Making popt..."

	cp $TPMSRCDIR/popt-1.7.tar.gz ./

	if [ ! -f popt-1.7.tar.gz ] ; then exit; fi

	tar -zxvf popt-1.7.tar.gz
	cd popt-1.7
	./configure --prefix=/usr
	make
	make install
	if [ ! -f /usr/lib/libpopt.a ] ; then exit; fi
	cd ..

	logmessage2 "Done making popt"

	rm -rf popt-1.7.tar.gz popt-1.7
	logmessage2 "Done popt"
}

makeslang149() {
	logmessage2 "Making slang..."

	cp $TPMSRCDIR/slang-1.4.9.tar.gz ./
	if [ ! -f slang-1.4.9.tar.gz ] ; then exit; fi
	tar -zxvf slang-1.4.9.tar.gz
	cd slang-1.4.9
	./configure --prefix=/usr
	make
	make install
	if [ ! -f /usr/lib/libslang.a ] ; then exit; fi
	cd ..
	logmessage2 "Done making slang"

	rm -rf slang-1.4.9.tar.gz slang-1.4.9
}

maketcl845() {
	logmessage2 "Making tcl..."


	if [ ! -f $TPMSRCDIR/tcl8.4.5-src.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/tk8.4.5-src.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/tcl8.4.5-src.tar.gz
	tar -zxvf $TPMSRCDIR/tk8.4.5-src.tar.gz
	cd tcl8.4.5/unix
	./configure --prefix=/usr --disable-shared
	make
	make install
	ln -s /usr/lib/libtcl8.4.a /usr/lib/libtcl.a
	if [ ! -f /usr/lib/libtcl8.4.a ] ; then exit; fi
	if [ ! -f /usr/lib/libtcl.a ] ; then exit; fi

	cd ../..
	logmessage2 "Done making tcl"

	cd tk8.4.5/unix
	./configure --prefix=/usr --disable-shared
	make
	make install
	ln -s /usr/lib/libtk8.4.a /usr/lib/libtk.a
	if [ ! -f /usr/lib/libtk8.4.a ] ; then exit; fi
	if [ ! -f /usr/lib/libtk.a ] ; then exit; fi
	if [ ! -f /usr/bin/wish8.4 ] ; then exit; fi

	cd ../..
	logmessage2 "Done making tk"

	rm -rf tcl8.4.5 tk8.4.5
}

maketcl844() {
	logmessage2 "Making tcl..."

	cp $TPMSRCDIR/tcl8.4.4-src.tar.gz ./

	if [ ! -f tcl8.4.4-src.tar.gz ] ; then exit; fi

	tar -zxvf tcl8.4.4-src.tar.gz
	cd tcl8.4.4/unix
	./configure --prefix=/usr --disable-shared
	make
	make install
	ln -s /usr/lib/libtcl8.4.a /usr/lib/libtcl.a
	if [ ! -f /usr/lib/libtcl8.4.a ] ; then exit; fi
	if [ ! -f /usr/lib/libtcl.a ] ; then exit; fi

	cd ../..
	logmessage2 "Done making tcl"

	rm -rf tcl8.4.4 tcl8.4.4-src.tar.gz
}



makebiew550() {
	logmessage2 "Making biew..."

	if [ ! -f $TPMSRCDIR/biew-550.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/biew-550.tar.bz2 | tar -xv


	cat > biewos.patch << "EOF"
diff -uNr biew-550.orig/biewlib/sysdep/generic/unix/os_dep.c biew-550/biewlib/sysdep/generic/unix/os_dep.c
--- biew-550.orig/biewlib/sysdep/generic/unix/os_dep.c	2002-01-04 08:23:28.000000000 +0000
+++ biew-550/biewlib/sysdep/generic/unix/os_dep.c	2003-12-09 19:47:34.000000000 +0000
@@ -39,7 +39,7 @@
 #include "console.h"
 
 #ifndef	PREFIX
-#define	PREFIX	"/usr/local"
+#define	PREFIX	"/usr"
 #endif
 
 #ifndef	DATADIR
EOF

	cat > biew.patch << "EOF"
diff -uNr biew-550.orig/makefile biew-550/makefile >/output.txt
--- biew-550.orig/makefile	2001-12-30 17:05:47.000000000 +0000
+++ biew-550/makefile	2003-12-09 19:33:25.000000000 +0000
@@ -33,7 +33,7 @@
 # Please select target operation system. Valid values are:
 # dos, os2, win32, linux, unix, beos
 #---------------------------------------------------------
-TARGET_OS=unix
+TARGET_OS=linux
 
 # Please add any host specific flags here
 # (like -fcall-used-R -fcall-saved-R -mrtd -mregparm=3 -mreg-alloc=  e.t.c ;-):
@@ -59,11 +59,11 @@
 # Try it if you have problems with compilation due to assembler errors.
 # Note that it is not the same as specifying TARGET_PLATFORM=generic.
 #------------------------------------------------------------------------------
-HOST_CFLAGS=
+HOST_CFLAGS=-s
 
 # Please add any host specific linker flags here
 #------------------------------------------------------------------------------
-HOST_LDFLAGS=
+HOST_LDFLAGS=-s
 
 ###########################################################################
 # Here comes Unix-specific configuration, see unix.txt for details.
@@ -75,7 +75,7 @@
 # Please select if you want to use mouse. Valid values are:
 # n(default), y
 #----------------------------------------------------------
-USE_MOUSE=n
+USE_MOUSE=y
 
 # You can set compilation level:
 # max_debug  - To enable debugging, profiling, checking memory usage and more
@@ -83,7 +83,7 @@
 # normal     - Default for most platforms and gcc versions.
 # advance    - Use it only with the latest gcc version.
 #----------------------------------------------------------------------
-compilation=normal
+compilation=advance
 
 # Happy hacking :)
 ##########################################################################
EOF

	cd biew-550
	patch -Np1 -i ../biew.patch
	patch -Np1 -i ../biewos.patch

	make
	cp biew /usr/bin/biew
	mkdir -p /usr/share/biew
	cp bin_rc/biew.hlp /usr/share/biew/
	cp bin_rc/skn/* /usr/share/biew/
	if [ ! -f /usr/bin/biew ] ; then exit; fi
	cd ..

	rm -rf biew-550 biew.patch biewos.patch
	logmessage2 "Done biew"
}


makeidswakeup10() {
	logmessage2 "Making idswakeup..."

	if [ ! -f $TPMSRCDIR/IDSwakeup-1.0.tgz ] ; then exit; fi

	if [ ! -f $TPMSRCDIR/libnet-1.0.2a.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libnet-1.0.2a.tar.gz
	cd Libnet-1.0.2a
	LIBNET_CONFIG_CFLAGS=-I/Libnet-1.0.2a/include ./configure --prefix=/usr/libnet-1.0.2a
	make
	cd ..
	echo "Done"


	tar -zxvf $TPMSRCDIR/IDSwakeup-1.0.tgz

	cat > idswakeup.patch << "EOF"
diff -uNr IDSwakeup-1.0.orig/Makefile IDSwakeup-1.0/Makefile
--- IDSwakeup-1.0.orig/Makefile	2003-12-09 20:01:12.000000000 +0000
+++ IDSwakeup-1.0/Makefile	2000-10-13 10:25:32.000000000 +0000
@@ -2,8 +2,8 @@
 RM = /bin/rm
 CPPFLAGS =
 #CFLAGS = -O2 -g -Wall -pedantic 
-CFLAGS = -O2
-LDFLAGS =
+CFLAGS = -O2 -s
+LDFLAGS = -L/Libnet-1.0.2a/lib
 HEADERS =
 SRCS = iwu.c
 OBJS = iwu.o
EOF
	cd IDSwakeup-1.0
	patch -Np1 -i ../idswakeup.patch
	make
	cp iwu IDSwakeup /usr/bin/
	cp LICENSE /license/idswakeup-LICENSE
	cp README /readme/idswakeup-README
	if [ ! -f /usr/bin/iwu ] ; then exit; fi
	cd ..

	rm -rf IDSwakeup-1.0 Libnet-1.0.2a idswakeup.patch
	logmessage2 "Done idswakeup"
}


makesecuredelete31() {
	logmessage2 "Making securedelete..."

	if [ ! -f $TPMSRCDIR/secure_delete-3.1.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/secure_delete-3.1.tar.gz

	cat > securedelete.patch << "EOF"
diff -uNr secure_delete-3.1.orig/Makefile secure_delete-3.1/Makefile
--- secure_delete-3.1.orig/Makefile	2003-10-29 21:07:06.000000000 +0000
+++ secure_delete-3.1/Makefile	2003-12-09 20:08:04.000000000 +0000
@@ -1,8 +1,8 @@
 CC=gcc
 OPT=-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 #OPT=-Wall -D_DEBUG_ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-INSTALL_DIR=/usr/local/bin
-MAN_DIR=/usr/local/man
+INSTALL_DIR=/usr/bin
+MAN_DIR=/usr/man
 DOC_DIR=/usr/share/doc/secure_delete
 OPT_MOD=-D__KERNEL__ -DMODULE -fomit-frame-pointer -fno-strict-aliasing -pipe -mpreferred-stack-boundary=2
 #LD_MOD=-r
EOF
	cd secure_delete-3.1
	patch -Np1 -i ../securedelete.patch
	make
	make install
	if [ ! -f /usr/bin/sdel ] ; then exit; fi
	if [ ! -f /usr/bin/srm ] ; then exit; fi
	if [ ! -f /usr/bin/sfill ] ; then exit; fi
	if [ ! -f /usr/bin/sswap ] ; then exit; fi
	if [ ! -f /usr/bin/smem ] ; then exit; fi
	if [ ! -f /usr/bin/the_cleaner.sh ] ; then exit; fi
	cd ..

	rm -rf secure_delete-3.1 securedelete.patch
	logmessage2 "Done securedelete"
}


makechkrootkit042b() {
	logmessage2 "Making chkrootkit..."

	if [ ! -f $TPMSRCDIR/chkrootkit-0.42b.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/chkrootkit-0.42b.tar.gz
	cd chkrootkit-0.42b
	make sense
	cp COPYRIGHT /license/chkrootkit-COPYRIGHT
	cp README /readme/chkrootkit-README
	cp check_wtmpx chkdirs chklastlog chkproc chkrootkit chkwtmp ifpromisc /usr/bin
	if [ ! -f /usr/bin/check_wtmpx ] ; then exit; fi
	if [ ! -f /usr/bin/chkdirs ] ; then exit; fi
	if [ ! -f /usr/bin/chklastlog ] ; then exit; fi
	if [ ! -f /usr/bin/chkproc ] ; then exit; fi
	if [ ! -f /usr/bin/chkrootkit ] ; then exit; fi
	if [ ! -f /usr/bin/chkwtmp ] ; then exit; fi
	if [ ! -f /usr/bin/ifpromisc ] ; then exit; fi
	cd ..

	rm -rf chkrootkit-0.42b
	logmessage2 "Done chkrootkit"
}


#Still working on this
makecryptcat() {
	logmessage2 "Making cryptcat..."

	if [ ! -f $TPMSRCDIR/cryptcat_linux.tar ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cryptcat_linux.tar

	cd cryptcat
	echo -e "\n" >> farm9crypt.h
	make linux
	cp cryptcat /usr/bin

	if [ ! -f /usr/bin/cryptcat ] ; then exit; fi
	cd ..

	rm -rf cryptcat
	logmessage2 "Done chkrootkit"
}

makegnupg123() {
	logmessage2 "Making gnupg..."

	if [ ! -f $TPMSRCDIR/gnupg-1.2.3.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/gnupg-1.2.3.tar.bz2 | tar -xv

	cd gnupg-1.2.3
	./configure --prefix=/usr --sysconfdir=/etc/gnupg
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -d /usr/libexec/gnupg ] ; then exit; fi
	if [ ! -f /usr/bin/gpgsplit ] ; then exit; fi
	if [ ! -f /usr/bin/gpg ] ; then exit; fi
	if [ ! -f /usr/bin/gpgv ] ; then exit; fi
	cd ..

	rm -rf gnupg-1.2.3
	logmessage2 "Done gnupg"
}


makememfetch() {
	logmessage2 "Making memfetch..."

	if [ ! -f $TPMSRCDIR/memfetch.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/memfetch.tgz

	cd memfetch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp -f memfetch mffind.pl /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/memfetch ] ; then exit; fi
	cd ..

	rm -rf memfetch
	logmessage2 "Done memfetch"
}

makemc460() {
	logmessage2 "Making mc..."

	if [ ! -f $TPMSRCDIR/mc-4.6.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mc-4.6.0.tar.gz

	cd mc-4.6.0
	./configure --prefix=/usr --sysconfdir=/etc/mc --with-mcfs
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/mc ] ; then exit; fi
	cd ..

	rm -rf mc-4.6.0
	logmessage2 "Done mc"
}

makepaketto110() {
	logmessage2 "Making paketto..."

	if [ ! -f $TPMSRCDIR/paketto-1.10.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/paketto-1.10.tar.gz

	cd paketto-1.10
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	
	if [ ! -f /usr/sbin/lc ] ; then exit; fi
	if [ ! -f /usr/sbin/paratrace ] ; then exit; fi
	if [ ! -f /usr/sbin/scanrand ] ; then exit; fi
	if [ ! -f /usr/bin/phentropy ] ; then exit; fi
	if [ ! -f /usr/sbin/minewt ] ; then exit; fi
	cd ..

	rm -rf paketto-1.10
	logmessage2 "Done paketto"
}


#http://pptpclient.sourceforge.net/
makepptp131() {
	logmessage2 "Making pptp..."

	if [ ! -f $TPMSRCDIR/pptp-linux-1.3.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pptp-linux-1.3.1.tar.gz

	cd pptp-linux-1.3.1
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	echo "# client        server  secret                  IP addresses" >/etc/ppp/chap-secrets	
	if [ ! -f /usr/sbin/pptp ] ; then exit; fi
	cd ..

	rm -rf pptp-linux-1.3.1
	logmessage2 "Done pptp"
}

#http://pptpclient.sourceforge.net/
#Home page http://poptop.lineo.com/
#Check out http://www.vibrationresearch.com/pptpd/example.html
makepptpd113() {
	logmessage2 "Making pptpd..."

	if [ ! -f $TPMSRCDIR/pptpd-1.1.3-20030409.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pptpd-1.1.3-20030409.tar.gz

	cd poptop
	./configure --prefix=/usr --sysconfdir=/etc --with-pppd-ip-alloc
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	
	cp samples/pptpd.conf /etc/pptpd.conf
	cp samples/options.pptpd /etc/ppp/
	cp samples/chap-secrets /etc/ppp/
	if [ ! -f /usr/sbin/pptpd ] ; then exit; fi
	if [ ! -f /usr/sbin/pptpctrl ] ; then exit; fi
	cd ..

	rm -rf poptop
	logmessage2 "Done pptpd"
}

makevmap06() {
	logmessage2 "Making vmap..."

	if [ ! -f $TPMSRCDIR/vmap-0.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/vmap-0.6.tar.gz


	cat > vmap.patch << "EOF"
diff -uNr vmap-0.6.old/Makefile vmap-0.6/Makefile
--- vmap-0.6.old/Makefile	2003-08-09 07:49:08.000000000 +0000
+++ vmap-0.6/Makefile	2003-12-11 10:40:48.000000000 +0000
@@ -2,7 +2,7 @@
 DFLAGS=-Wall -g -DDEBUG
 CFLAGS=-O2 -Wall
 LIBS=
-PREFIX=/usr/local
+PREFIX=/usr
 OBJS=vmap-mod.o vmap-ftp.o  vmap-smtp.o vmap-pop3.o vmap-imap.o vmap-named.o vmap-http.o
 
 all:		vmap
EOF

	cat > vmap.c.patch << "EOF"
diff -uNr vmap-0.6.old/vmap.c vmap-0.6/vmap.c
--- vmap-0.6.old/vmap.c	2003-08-09 09:06:50.000000000 +0000
+++ vmap-0.6/vmap.c	2003-12-11 11:16:51.000000000 +0000
@@ -351,7 +351,7 @@
 	i = 0;
 	if (strcmp(service, "ftp") == 0) {
 		i = 1;
-		if ((cfp = fopen("./commands/ftp", "r")) == NULL)
+		if ((cfp = fopen("/usr/share/vmap/commands/ftp", "r")) == NULL)
 		       	bail("File with FTP commands not found!");
 		countcommand = countlines(cfp);
 		if (countcommand == 0)
@@ -363,7 +363,7 @@
 
 	if (strcmp(service, "smtp") == 0) {
 		i=1;
-		if ((cfp = fopen("./commands/smtp", "r")) == NULL)
+		if ((cfp = fopen("/usr/share/vmap/commands/smtp", "r")) == NULL)
 			bail("File with SMTP commands not found!");
 		countcommand = countlines(cfp);
 		if (countcommand == 0)
@@ -375,7 +375,7 @@
 
 	if (strcmp(service, "pop3") == 0) {
 		i=1;
-		if ((cfp = fopen("./commands/pop3", "r")) == NULL)
+		if ((cfp = fopen("/usr/share/vmap/commands/pop3", "r")) == NULL)
 			bail("File with POP3 commands not found!");
 		countcommand = countlines(cfp);
 		if (countcommand == 0)
@@ -387,7 +387,7 @@
 	
 	if (strcmp(service, "imap") == 0) {
 		i=1;
-		if ((cfp = fopen("./commands/imap", "r")) == NULL)
+		if ((cfp = fopen("/usr/share/vmap/commands/imap", "r")) == NULL)
 			bail("File with IMAP commands not found!");
 		countcommand = countlines(cfp);
 		if (countcommand == 0)
@@ -399,7 +399,7 @@
 	
 	if (strcmp(service, "http") == 0) {
 		i=1;
-		if ((cfp = fopen("./commands/http", "r")) == NULL)
+		if ((cfp = fopen("/usr/share/vmap/commands/http", "r")) == NULL)
 			bail("File with HTTP commands not found!");
 		countcommand = countlines(cfp);
 		if (countcommand == 0)
@@ -424,9 +424,9 @@
 	
         /* Check if we fingerprint with or without login */
         if (login != NULL)
-                sprintf(service_dir, "%s/wl", service);
+                sprintf(service_dir, "/usr/share/vmap/%s/wl", service);
         else
-                sprintf(service_dir, "%s/wo", service);
+                sprintf(service_dir, "/usr/share/vmap/%s/wo", service);
 
         if (gather != NULL)
                 save_to_file(reply_ptr, service_dir, gather);
EOF

	cd vmap-0.6
	patch -Np1 -i ../vmap.patch
	patch -Np1 -i ../vmap.c.patch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp vmap /usr/bin
	mkdir -p /usr/share/vmap
	cp -R commands /usr/share/vmap
	cp -R ftp http imap/ pop3/ smtp/ /usr/share/vmap/
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/vmap ] ; then exit; fi
	cd ..

	rm -rf vmap-0.6 vmap.patch vmap.c.patch
	logmessage2 "Done vmap"
}

makecmospwd43() {
	logmessage2 "Making cmospwd..."

	if [ ! -f $TPMSRCDIR/cmospwd-4.3.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cmospwd-4.3.tgz

	cd cmospwd-4.3
	gcc -o cmospwd cmospwd.c
	if [ $? -ne 0 ]; then exit -1; fi
	cp cmospwd /usr/bin
	cp cmospwd.txt /readme/cmospwd-README
	

	if [ ! -f /usr/bin/cmospwd ] ; then exit; fi
	cd ..

	rm -rf cmospwd-4.3
	logmessage2 "Done cmospwd"
}

makerarpd11() {
	logmessage2 "Making rarpd..."

	if [ ! -f $TPMSRCDIR/rarpd-1.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/rarpd-1.1.tar.gz



	cd rarpd-1.1
	#Added -DNEW_LIBNET_INTERFACE to CFLAGS in Makefile.in and re arrange order of CFLAGS
	CFLAGS="-DNEW_LIBNET_INTERFACE" LIBS="-L/Libnet-1.0.2a/lib -lnet" ./configure --prefix=/usr --with-pcap=/usr --with-libnet=/Libnet-1.0.2a 
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /sbin/rarpd ] ; then exit; fi
	cd ..

	rm -rf rarpd-1.1
	logmessage2 "Done rarpd"
}

makedlint140() {
	logmessage2 "Making dlint..."

	if [ ! -f $TPMSRCDIR/dlint1.4.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/dlint1.4.0.tar.gz

	cat > dlint.Makefile.patch << "EOF"
diff -uNr dlint1.4.0.orig/Makefile dlint1.4.0/Makefile
--- dlint1.4.0.orig/Makefile	2000-11-19 15:07:40.000000000 +0000
+++ dlint1.4.0/Makefile	2003-12-14 16:00:38.000000000 +0000
@@ -5,7 +5,7 @@
 VERSION=1.4.0
 
 # Basic area to install things in:
-DEST=$(DESTROOT)/usr/local
+DEST=$(DESTROOT)/usr
 
 BIN=$(DEST)/bin
 MANEXT=1
EOF

	cat > dlint.dlint.patch << "EOF"
diff -uNr dlint1.4.0.orig/dlint dlint1.4.0/dlint
--- dlint1.4.0.orig/dlint	2000-11-19 15:42:33.000000000 +0000
+++ dlint1.4.0/dlint	2003-12-14 15:58:57.000000000 +0000
@@ -65,7 +65,7 @@
 
 # RR filter from DiG output format to all FQDN on every line format.
 # Change this path for your site!  See Makefile.
-rrfilt="/usr/local/bin/digparse"
+rrfilt="/usr/bin/digparse"
 
 # ------------- END CONFIGURATIONS -------------------------

EOF


	cd dlint1.4.0
	patch -Np1 -i ../dlint.dlint.patch
	patch -Np1 -i ../dlint.Makefile.patch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/dlint ] ; then exit; fi
	if [ ! -f /usr/bin/digparse ] ; then exit; fi
	cd ..

	rm -rf dlint1.4.0 dlint.Makefile.patch dlint.dlint.patch
	logmessage2 "Done dlint"
}

makeaide010() {
	logmessage2 "Making aide..."

	if [ ! -f $TPMSRCDIR/aide-0.10.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/aide-0.10.tar.gz

	cd aide-0.10
	./configure --prefix=/usr --sysconfdir=/etc
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/aide ] ; then exit; fi
	cd ..

	rm -rf aide-0.10
	logmessage2 "Done aide"
}


makedriftnet016() {
	logmessage2 "Making driftnet..."

	if [ ! -f $TPMSRCDIR/driftnet-0.1.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/driftnet-0.1.6.tar.gz

	cd driftnet-0.1.6
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp driftnet /usr/bin
	

	if [ ! -f /usr/bin/driftnet ] ; then exit; fi
	cd ..

	rm -rf driftnet-0.1.6
	logmessage2 "Done driftnet"
}

makelibungif410() {
	logmessage2 "Making libungif..."

	if [ ! -f $TPMSRCDIR/libungif-4.1.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libungif-4.1.0.tar.gz

	cd libungif-4.1.0
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libungif.a ] ; then exit; fi
	cd ..

	rm -rf libungif-4.1.0
	logmessage2 "Done libungif"
}

makeairsnort023a() {
	logmessage2 "Making airsnort..."

	if [ ! -f $TPMSRCDIR/airsnort-0.2.3a.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/airsnort-0.2.3a.tar.gz

	cd airsnort-0.2.3a
	./autogen.sh
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}

makeairsnort022a() {
	logmessage2 "Making airsnort..."

	if [ ! -f $TPMSRCDIR/airsnort-0.2.2a.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/airsnort-0.2.2a.tar.gz

	cd airsnort-0.2.2a 
	./autogen.sh --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/airsnort ] ; then exit; fi
	cd ..

	rm -rf airsnort-0.2.2a
	logmessage2 "Done airsnort"
}

makenetsed001() {
	logmessage2 "Making netsed..."

	if [ ! -f $TPMSRCDIR/netsed.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/netsed.tgz

	cd netsed
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp netsed /usr/bin/netsed
	if [ $? -ne 0 ]; then exit -1; fi
	
	if [ ! -f /usr/bin/netsed ] ; then exit; fi
	cd ..

	rm -rf netsed
	logmessage2 "Done netsed"
}

makescanssh16b() {
	logmessage2 "Making scanssh..."

	if [ ! -f $TPMSRCDIR/scanssh-1.6b.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/scanssh-1.6b.tar.gz

	cd scanssh
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/scanssh ] ; then exit; fi
	cd ..

	rm -rf scanssh
	logmessage2 "Done scanssh"
}

makeisic005() {
	logmessage2 "Making isic..."

	if [ ! -f $TPMSRCDIR/isic-0.05.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/isic-0.05.tgz


	cat > isic.patch << "EOF"
diff -uNr isic-0.05.orig/Makefile.in isic-0.05/Makefile.in
--- isic-0.05.orig/Makefile.in	2000-01-29 19:11:29.000000000 +0000
+++ isic-0.05/Makefile.in	2003-12-15 13:23:52.000000000 +0000
@@ -2,12 +2,12 @@
 # To build for Trinux, add '-static' to LDFLAGS
 # and 'strip *sic' after they compile
 
-PREFIX ?= /usr/local
+PREFIX ?= /usr
 
 CC	= @CC@
-DEFS	= @DEFS@ `libnet-config --defines`
-CFLAGS	= @CFLAGS@ `libnet-config --cflags`
-LIBS	= @LIBS@ `libnet-config --libs`
+DEFS	= @DEFS@ -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -DLIBNET_LIL_ENDIAN
+CFLAGS	= @CFLAGS@ -I/Libnet-1.0.2a/include
+LIBS	= @LIBS@ -L/Libnet-1.0.2a/lib -lnet
 LDFLAGS	= @LDFLAGS@
 
 INSTALL	= @INSTALL@
EOF

	#Make libnet, but don't install.  It is just needed to link with isic
	if [ ! -f libnet-1.0.2a.tar.gz ] ; then exit; fi
	tar -zxvf libnet-1.0.2a.tar.gz
	cd Libnet-1.0.2a
	LIBNET_CONFIG_CFLAGS=-I/Libnet-1.0.2a/include ./configure --prefix=/usr
	make
	cp doc/COPYING /license/libnet-1.0.2a-COPYING
	cd ..
	echo "Done"


	cd isic-0.05
	patch -Np1 -i ../isic.patch

	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/isic ] ; then exit; fi
	cd ..

	rm -rf isic-0.05 isic.patch Libnet-1.0.2a
	logmessage2 "Done isic"
}

makerecover13c() {
	logmessage2 "Making recover..."

	if [ ! -f $TPMSRCDIR/recover-1.3c.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/recover-1.3c.tar.gz

	cd recover-1.3c
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/recover ] ; then exit; fi
	cd ..

	rm -rf recover-1.3c
	logmessage2 "Done recover"
}

makescli029() {
	logmessage2 "Making scli..."

	if [ ! -f $TPMSRCDIR/scli-0.2.9.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/scli-0.2.9.tar.gz

	cd scli-0.2.9
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/scli ] ; then exit; fi
	cd ..

	rm -rf scli-0.2.9
	logmessage2 "Done scli"
}

makescli0212() {
	logmessage2 "Making scli..."

	if [ ! -f $TPMSRCDIR/scli-0.2.12.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/scli-0.2.12.tar.gz

	cd scli-0.2.12
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/scli ] ; then exit; fi
	cd ..

	rm -rf scli-0.2.12
	logmessage2 "Done scli"
}

makereadline43() {
	logmessage2 "Making readline..."

	if [ ! -f $TPMSRCDIR/readline-4.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/readline-4.3.tar.gz

	cd readline-4.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libreadline.a ] ; then exit; fi
	cd ..

	rm -rf readline-4.3
	logmessage2 "Done readline"
}


makelibxml263() {
	logmessage2 "Making libxml..."

	if [ ! -f $TPMSRCDIR/libxml2-2.6.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libxml2-2.6.3.tar.gz

	cd libxml2-2.6.3
	./configure --prefix=/usr --sysconfdir=/etc --includedir=/usr/include
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	if [ $? -ne 0 ]; then exit -1; fi
	#mv /usr/include/libxml2/libxml/* /usr/include
	#rm -rf /usr/include/libxml2/libxml/

	if [ ! -f /usr/bin/xml2-config ] ; then exit; fi
	if [ ! -f /usr/bin/xmlcatalog ] ; then exit; fi
	if [ ! -f /usr/bin/xmllint ] ; then exit; fi
	if [ ! -f /usr/lib/libxml2.a ] ; then exit; fi
	if [ ! -f /usr/include/libxml2/libxml/xmlversion.h ] ; then exit; fi
	cd ..

	rm -rf libxml2-2.6.3
	logmessage2 "Done libxml"
}

makehammerhead213() {
	logmessage2 "Making hammerhead..."

	if [ ! -f $TPMSRCDIR/hammerhead-2.1.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/hammerhead-2.1.3.tar.gz

	cd hammerhead-2.1.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/hammerhead ] ; then exit; fi
	cd ..

	rm -rf hammerhead-2.1.3
	logmessage2 "Done hammerhead"
}


makepnscan111() {
	logmessage2 "Making pnscan..."

	if [ ! -f $TPMSRCDIR/pnscan-1.11.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pnscan-1.11.tar.gz


	cat > pnscan.patch << "EOF"
diff -uNr pnscan-1.11.orig/Makefile pnscan-1.11/Makefile
--- pnscan-1.11.orig/Makefile	2002-03-25 16:39:14.000000000 +0000
+++ pnscan-1.11/Makefile	2003-12-14 19:06:24.000000000 +0000
@@ -1,6 +1,6 @@
 # Makefile for pnscan
 
-DESTDIR=/usr/local
+DESTDIR=/usr
 
 BINDIR=$(DESTDIR)/bin
 MANDIR=$(DESTDIR)/man
EOF


	cd pnscan-1.11
	patch -Np1 -i ../pnscan.patch
	make lnx
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/pnscan ] ; then exit; fi
	cd ..

	rm -rf pnscan-1.11
	logmessage2 "Done pnscan"
}

makeetherape090() {
	logmessage2 "Making etherape..."

	if [ ! -f $TPMSRCDIR/etherape-0.9.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/etherape-0.9.0.tar.gz

	cd etherape-0.9.0
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/etherape ] ; then exit; fi
	cd ..

	rm -rf etherape-0.9.0
	logmessage2 "Done etherape"
}

makesendip25() {
	logmessage2 "Making sendip..."

	if [ ! -f $TPMSRCDIR/sendip-2.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/sendip-2.5.tar.gz

	cat > sendip.patch << "EOF"
diff -uNr sendip-2.5.orig/Makefile sendip-2.5/Makefile
--- sendip-2.5.orig/Makefile	2002-10-12 17:28:00.000000000 +0000
+++ sendip-2.5/Makefile	2003-12-14 19:48:16.000000000 +0000
@@ -1,5 +1,5 @@
 #configureable stuff
-PREFIX ?= /usr/local
+PREFIX ?= /usr
 BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man/man1
 LIBDIR ?= $(PREFIX)/lib/sendip
EOF


	cd sendip-2.5
	patch -Np1 -i ../sendip.patch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/sendip ] ; then exit; fi
	cd ..

	rm -rf sendip-2.5 sendip.patch
	logmessage2 "Done sendip"
}

makesocat1322() {
	logmessage2 "Making socat..."

	if [ ! -f $TPMSRCDIR/socat-1.3.2.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/socat-1.3.2.2.tar.gz

	cd socat-1.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/socat ] ; then exit; fi
	if [ ! -f /usr/bin/procan ] ; then exit; fi
	if [ ! -f /usr/bin/filan ] ; then exit; fi
	cd ..

	rm -rf socat-1.3
	logmessage2 "Done socat"
}

maketcpflow021() {
	logmessage2 "Making tcpflow..."

	if [ ! -f $TPMSRCDIR/tcpflow-0.21.tar.gz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tcpflow-0.21.tar.gz 

	cd tcpflow-0.21
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/tcpflow ] ; then exit; fi
	cd ..

	rm -rf tcpflow-0.21
	logmessage2 "Done tcpflow"
}

makebing104() {
	logmessage2 "Making bing..."

	if [ ! -f $TPMSRCDIR/bing-1.0.4.tar.gz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/bing-1.0.4.tar.gz 

	cd bing-1.0.4
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/bing ] ; then exit; fi
	cd ..

	rm -rf bing-1.0.4.tar.gz 
	logmessage2 "Done bing"
}

makebing113() {
	logmessage2 "Making bing..."

	if [ ! -f $TPMSRCDIR/bing-1.1.3.tar.gz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/bing-1.1.3.tar.gz 

	cd bing-1.1.3
	make
	if [ $? -ne 0 ]; then exit -1; fi
	install -m 644 -o root -g root unix/bing.8 /usr/man/man8
	install -m 4555 -o root -g root bing /usr/bin
	

	if [ ! -f /usr/bin/bing ] ; then exit; fi
	cd ..

	rm -rf bing-1.1.3
	logmessage2 "Done bing"
}

makedcfldd10() {
	logmessage2 "Making dcfldd..."

	if [ ! -f $TPMSRCDIR/dcfldd-1.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/dcfldd-1.0.tar.gz

	cd dcfldd-1.0
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/dcfldd ] ; then exit; fi
	cd ..

	rm -rf dcfldd-1.0
	logmessage2 "Done dcfldd"
}


makeperluri130() {
	logmessage2 "Making URI..."
	if [ ! -f $TPMSRCDIR/URI-1.30.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/URI-1.30.tar.gz
	cd URI-1.30
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/URI.pm ] ; then exit; fi
	cd ..
	rm -rf URI-1.30
	logmessage2 "Done URI"
}

makeperldatecalc53() {
	logmessage2 "Making Date::Calc..."
	if [ ! -f $TPMSRCDIR/Date-Calc-5.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Date-Calc-5.3.tar.gz
	cd Date-Calc-5.3
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Date/Calc.pm ] ; then exit; fi
	cd ..
	rm -rf Date-Calc-5.3
	logmessage2 "Done Date::Calc"
}

makeperltimedate116() {
	logmessage2 "Making TimeDate..."
	if [ ! -f $TPMSRCDIR/TimeDate-1.16.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/TimeDate-1.16.tar.gz
	cd TimeDate-1.16
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/Date/Parse.pm ] ; then exit; fi
	cd ..
	rm -rf TimeDate-1.16
	logmessage2 "Done TimeDate"
}

makeperliotty102() {
	logmessage2 "Making IO::tty..."
	if [ ! -f $TPMSRCDIR/IO-Tty-1.02.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/IO-Tty-1.02.tar.gz
	cd IO-Tty-1.02
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/IO/Pty.pm ] ; then exit; fi
	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/IO/Tty.pm ] ; then exit; fi
	cd ..
	rm -rf IO-Tty-1.02
	logmessage2 "Done IO::tty"
}

makeperltimehires155() {
	logmessage2 "Making Time::HiRes..."
	if [ ! -f $TPMSRCDIR/Time-HiRes-1.55.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Time-HiRes-1.55.tar.gz
	cd Time-HiRes-1.55
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/5.8.1/i686-linux/Time/HiRes.pm ] ; then exit; fi
	cd ..
	rm -rf Time-HiRes-1.55
	logmessage2 "Done Time::HiRes"
}

makeperlfilespec087() {
	logmessage2 "Making File::Spec..."
	if [ ! -f $TPMSRCDIR/File-Spec-0.87.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/File-Spec-0.87.tar.gz
	cd File-Spec-0.87
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/5.8.1/File/Spec.pm ] ; then exit; fi
	cd ..
	rm -rf File-Spec-0.87
	logmessage2 "Done File::Spec"
}

makeperlexpect115() {
	logmessage2 "Making Expect..."
	if [ ! -f $TPMSRCDIR/Expect-1.15.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Expect-1.15.tar.gz
	cd Expect-1.15
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/Expect.pm ] ; then exit; fi
	cd ..
	rm -rf Expect-1.15
	logmessage2 "Done Expect"
}

makeperlnetsnmp412() {
	logmessage2 "Making Net::SNMP..."
	if [ ! -f $TPMSRCDIR/Net-SNMP-4.1.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Net-SNMP-4.1.2.tar.gz
	cd Net-SNMP-4.1.2
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -d /usr/lib/perl5/site_perl/5.8.1/Net/SNMP/ ] ; then exit; fi
	cd ..
	rm -rf Net-SNMP-4.1.2
	logmessage2 "Done Net::SNMP"
}

makeperlmimebase64300() {
	logmessage2 "Making MIME::Base64..."
	if [ ! -f $TPMSRCDIR/MIME-Base64-3.00.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/MIME-Base64-3.00.tar.gz
	cd MIME-Base64-3.00
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/5.8.1/i686-linux/auto/MIME/Base64/Base64.so ] ; then exit; fi
	if [ ! -f /usr/lib/perl5/5.8.1/i686-linux/MIME/Base64.pm ] ; then exit; fi
	cd ..
	rm -rf MIME-Base64-3.00
	logmessage2 "Done MIME::Base64"
}

makeperlhtmlparser335() {
	logmessage2 "Making HTML..."
	if [ ! -f $TPMSRCDIR/HTML-Parser-3.35.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/HTML-Parser-3.35.tar.gz
	cd HTML-Parser-3.35
	echo -e "\n" | perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/URI.pm ] ; then exit; fi
	cd ..
	rm -rf HTML-Parser-3.35
	logmessage2 "Done URI"
}

makeperlhtmltagset303() {
	logmessage2 "Making HTML::Tagset..."
	if [ ! -f $TPMSRCDIR/HTML-Tagset-3.03.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/HTML-Tagset-3.03.tar.gz
	cd HTML-Tagset-3.03
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/HTML/Tagset.pm ] ; then exit; fi
	cd ..
	rm -rf HTML-Tagset-3.03
	logmessage2 "Done  HTML::Tagset"
}

makeperldigestmd5233() {
	logmessage2 "Making Digest::MD5..."
	if [ ! -f $TPMSRCDIR/Digest-MD5-2.33.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Digest-MD5-2.33.tar.gz
	cd Digest-MD5-2.33
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/5.8.1/i686-linux/Digest/MD5.pm ] ; then exit; fi
	cd ..
	rm -rf Digest-MD5-2.33
	logmessage2 "Done Digest::MD5"
}

makeperldigesthmac101() {
	logmessage2 "Making Digest::HMAC..."
	if [ ! -f $TPMSRCDIR/Digest-HMAC-1.01.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Digest-HMAC-1.01.tar.gz
	cd Digest-HMAC-1.01
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/Digest/HMAC.pm ] ; then exit; fi
	cd ..
	rm -rf Digest-HMAC-1.01
	logmessage2 "Done Digest::HMAC"
}

makeperldigestsha1207() {
	logmessage2 "Making Digest::SHA1..."
	if [ ! -f $TPMSRCDIR/Digest-SHA1-2.07.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Digest-SHA1-2.07.tar.gz
	cd Digest-SHA1-2.07
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Digest/SHA1.pm ] ; then exit; fi
	cd ..
	rm -rf Digest-SHA1-2.07
	logmessage2 "Done Digest::SHA1"
}

makeperlcryptdes203() {
	logmessage2 "Making Crypt::DES..."
	if [ ! -f $TPMSRCDIR/Crypt-DES-2.03.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Crypt-DES-2.03.tar.gz
	cd Crypt-DES-2.03
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; logmessage2 "Problem with make"; fi
	make install
	if [ $? -ne 0 ]; then exit -1; logmessage2 "Problem with make install";  fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Crypt/DES.pm ] ; then exit -1; logmessage2 "Can't find DES.pm"; fi
	cd ..
	rm -rf Crypt-DES-2.03
	logmessage2 "Done Digest::SHA1"
}


makeperlcryptcbc208() {
	logmessage2 "Making Crypt::CBC..."
	if [ ! -f $TPMSRCDIR/Crypt-CBC-2.08.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Crypt-CBC-2.08.tar.gz
	cd Crypt-CBC-2.08
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/Crypt/CBC.pm ] ; then exit; fi
	cd ..
	rm -rf Crypt-CBC-2.08
	logmessage2 "Done Crypt::CBC"
}


makeperlcryptssleay051() {
	logmessage2 "Making Crypt::SSLeay..."
	if [ ! -f $TPMSRCDIR/Crypt-SSLeay-0.51.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Crypt-SSLeay-0.51.tar.gz
	cd Crypt-SSLeay-0.51
	echo -e "/usr/ssl\n" | perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Crypt/SSLeay.pm ] ; then exit; fi
	cd ..
	rm -rf Crypt-SSLeay-0.51
	logmessage2 "Done Crypt::SSLeay"

}

makeperliosocketssl095() {
	logmessage2 "Making IO::Socket::SSL..."
	if [ ! -f $TPMSRCDIR/IO-Socket-SSL-0.95.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/IO-Socket-SSL-0.95.tar.gz
	cd IO-Socket-SSL-0.95
	echo -e "/usr/ssl\n" | perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/IO/Socket/SSL.pm ] ; then exit; fi
	cd ..
	rm -rf IO-Socket-SSL-0.95
	logmessage2 "Done IO::Socket::SSL"
}

makeperllibnet117() {
	logmessage2 "Making Libnet..."
	if [ ! -f $TPMSRCDIR/libnet-1.17.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libnet-1.17.tar.gz
	cd libnet-1.17
	echo -e "\n" | perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/5.8.1/Net/FTP.pm ] ; then exit; fi
	if [ ! -f /usr/lib/perl5/5.8.1/Net/Domain.pm ] ; then exit; fi
	cd ..
	rm -rf libnet-1.17
	logmessage2 "Done Libnet"
}



makeperlnetdns045() {
	logmessage2 "Making Net::DNS..."

	if [ ! -f $TPMSRCDIR/Net-DNS-0.45.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/Net-DNS-0.45.tar.gz
	cd Net-DNS-0.45

	echo -e "n\n" | perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi



	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Net/DNS.pm ] ; then exit; fi
	cd ..

	rm -rf Net-DNS-0.45
	logmessage2 "Done Net::DNS"
}


makeperlnetdns044() {
	logmessage2 "Making Net::DNS..."

	if [ ! -f $TPMSRCDIR/Net-DNS-0.44.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/Net-DNS-0.44.tar.gz
	cd Net-DNS-0.44

	echo -e "n\n" | perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi



	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Net/DNS.pm ] ; then exit; fi
	cd ..

	rm -rf Net-DNS-0.44
	logmessage2 "Done Net::DNS"
}


makeperllibwww576() {
	logmessage2 "Making libwww-perl..."
	if [ ! -f $TPMSRCDIR/libwww-perl-5.76.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libwww-perl-5.76.tar.gz
	cd libwww-perl-5.76
	perl Makefile.PL -n
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/LWP.pm ] ; then exit; fi
	cd ..
	rm -rf libwww-perl-5.76
	logmessage2 "Done libwww-perl"
}


makednswalk202() {
	logmessage2 "Making dnswalk..."

	if [ ! -f $TPMSRCDIR/dnswalk-2.0.2.tar.gz ] ; then exit; fi

	cat > dnswalk.makereports.patch << "EOF"
diff -uNr dnswalk-2.0.2.orig/makereports dnswalk-2.0.2/makereports
--- dnswalk-2.0.2.orig/makereports	1997-08-11 13:52:37.000000000 +0000
+++ dnswalk-2.0.2/makereports	2003-12-15 11:01:42.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/contrib/bin/perl
+#!/usr/bin/perl
 # This takes output from dnswalk and makes a "rep.orts" directory
 # with one file per contact.  Great for sending mail to all the admins.
EOF


	cat > dnswalk.dnswalk.patch << "EOF"
diff -uNr dnswalk-2.0.2.orig/dnswalk dnswalk-2.0.2/dnswalk
--- dnswalk-2.0.2.orig/dnswalk	1997-10-06 13:24:00.000000000 +0000
+++ dnswalk-2.0.2/dnswalk	2003-12-15 11:01:34.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/contrib/bin/perl
+#!/usr/bin/perl
 #
 # dnswalk    Walk through a DNS tree, pulling out zone data and
 # dumping it in a directory tree
EOF

	mkdir dnswalk-2.0.2
	cd dnswalk-2.0.2
	tar -zxvf $TPMSRCDIR/dnswalk-2.0.2.tar.gz
	
	patch -Np1 -i ../dnswalk.makereports.patch
	patch -Np1 -i ../dnswalk.dnswalk.patch

	cp dnswalk do-dnswalk makereports sendreports /usr/bin
	cp dnswalk.1 /usr/man/man.1
	cp dnswalk.errors /readme/

	if [ ! -f /usr/bin/dnswalk ] ; then exit; fi
	cd ..

	rm -rf dnswalk-2.0.2 dnswalk.makereports.patch dnswalk.dnswalk.patch
	logmessage2 "Done dnswalk"
}

makedcetest12() {
	logmessage2 "Making dcetest..."

	if [ ! -f $TPMSRCDIR/dcetest.tar ] ; then exit; fi
	tar -xvf $TPMSRCDIR/dcetest.tar

	cd dcetest
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp dcetest /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/dcetest ] ; then exit; fi
	cd ..

	rm -rf dcetest
	logmessage2 "Done dcetest"
}

maketcptrace661() {
	logmessage2 "Making tcptrace..."

	if [ ! -f $TPMSRCDIR/tcptrace-6.6.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tcptrace-6.6.1.tar.gz

	cat > tcptrace.patch << "EOF"
diff -uNr tcptrace-6.6.1.orig/Makefile.in tcptrace-6.6.1/Makefile.in
--- tcptrace-6.6.1.orig/Makefile.in	2003-08-20 18:08:46.000000000 +0000
+++ tcptrace-6.6.1/Makefile.in	2003-12-14 20:32:44.000000000 +0000
@@ -125,8 +125,8 @@
 # 
 ################################################################## 
 # Pathname of directory to install the binary
-BINDIR = /usr/local/bin
-MANDIR = /usr/local/man/
+BINDIR = /usr/bin
+MANDIR = /usr/man/
 
 
 ################################################################## 
EOF

	cd tcptrace-6.6.1
	patch -Np1 -i ../tcptrace.patch

	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/tcptrace ] ; then exit; fi
	cd ..

	rm -rf tcptrace-6.6.1 tcptrace.patch
	logmessage2 "Done tcptrace"
}

makeargus205() {
	logmessage2 "Making argus..."

	if [ ! -f $TPMSRCDIR/argus-2.0.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/argus-2.0.5.tar.gz

	cd argus-2.0.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp -v bin/ra* /usr/bin
	cp -v bin/argusbug /usr/bin
	cp -v bin/argus_linux /usr/sbin/argus
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/ra ] ; then exit; fi
	if [ ! -f /usr/sbin/argus ] ; then exit; fi
	if [ ! -f /usr/bin/argusbug ] ; then exit; fi
	cd ..

	rm -rf argus-2.0.5
	logmessage2 "Done argus"
}

makearping202() {
	logmessage2 "Making arping..."

	if [ ! -f $TPMSRCDIR/arping-2.02.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/arping-2.02.tar.gz

	cat > arping.patch << "EOF"
diff -uNr arping-2.02.orig/Makefile arping-2.02/Makefile
--- arping-2.02.orig/Makefile	2003-08-07 20:11:36.000000000 +0000
+++ arping-2.02/Makefile	2003-12-14 21:14:53.000000000 +0000
@@ -73,8 +73,8 @@
 	make USE_NETIF=0 SOLARIS=1 arping1-make
 
 install:
-	install -c arping /usr/local/bin/arping
-	install arping.8 /usr/local/man/man8/arping.8
+	install -c arping /usr/bin/arping
+	install arping.8 /usr/man/man8/arping.8
 
 arping.o: arping.c
 	$(CC) -Wall $(CFLAGS) -c `libnet-config --defines` `libnet-config --cflags` arping.c
EOF

	cd arping-2.02
	patch -Np1 -i ../arping.patch

	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/arping ] ; then exit; fi
	cd ..

	rm -rf arping-2.02 arping.patch
	logmessage2 "Done arping"
}

makeddrescue103() {
	logmessage2 "Making dd_rescue..."

	if [ ! -f $TPMSRCDIR/dd_rescue-1.03.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/dd_rescue-1.03.tar.gz

	cd dd_rescue
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /bin/dd_rescue ] ; then exit; fi
	cd ..

	rm -rf dd_rescue
	logmessage2 "Done dd_rescue"
}


makedarkstat26() {
	logmessage2 "Making darkstat..."

	if [ ! -f $TPMSRCDIR/darkstat-2.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/darkstat-2.6.tar.gz

	cd darkstat-2.6
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/darkstat ] ; then exit; fi
	cd ..

	rm -rf darkstat-2.6
	logmessage2 "Done darkstat"
}

makesing11() {
	logmessage2 "Making sing..."

	if [ ! -f $TPMSRCDIR/SING-1.1.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/SING-1.1.tgz

	cd SING-1.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/sing ] ; then exit; fi
	cd ..

	rm -rf SING-1.1
	logmessage2 "Done sing"
}

makehackbot221() {
	logmessage2 "Making hackbot..."

	if [ ! -f $TPMSRCDIR/hackbot-2.21.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/hackbot-2.21.tgz


	cat > hackbot.patch << "EOF"
diff -uNr hackbot.orig/Makefile hackbot/Makefile
--- hackbot.orig/Makefile	2002-12-19 10:49:16.000000000 +0000
+++ hackbot/Makefile	2003-12-14 21:51:14.000000000 +0000
@@ -3,9 +3,9 @@
 FINGDB = ./fingerprint.db
 GOOGLEDB = ./google.db
 SRCMAN = ./hackbot.1.gz
-DESTPL = /usr/local/bin/
-DESTDB = /usr/local/etc/
-DESTMAN = /usr/local/man/man1/
+DESTPL = /usr/bin/
+DESTDB = /usr/etc/
+DESTMAN = /usr/man/man1/
 MKDIR = `which mkdir`
 CP = `which cp`

EOF

	cd hackbot
	patch -Np1 -i ../hackbot.patch

	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/hackbot.pl ] ; then exit; fi
	cd ..

	rm -rf hackbot hackbot.patch
	logmessage2 "Done hackbot"
}

makeairsnort010() {
	logmessage2 "Making airsnort..."

	if [ ! -f $TPMSRCDIR/airsnort-0.1.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/airsnort-0.1.0.tar.gz

	cd airsnort-0.1.0
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp capture crack gencases decrypt /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/capture ] ; then exit; fi
	if [ ! -f /usr/bin/crack ] ; then exit; fi
	if [ ! -f /usr/bin/gencases ] ; then exit; fi
	if [ ! -f /usr/bin/decrypt ] ; then exit; fi
	cd ..

	rm -rf airsnort-0.1.0
	logmessage2 "Done fatback"
}

makescreamingcobra104() {
	logmessage2 "Making screaming cobra..."

	if [ ! -f $TPMSRCDIR/screamingCobra-1.04.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/screamingCobra-1.04.tar.gz

	cd screamingCobra-1.04
	cp screamingCobra.pl /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/screamingCobra.pl ] ; then exit; fi
	cd ..

	rm -rf screamingCobra-1.04
	logmessage2 "Done screaming cobra"
}

makefluxbox0114() {
	logmessage2 "Making fluxbox..."

	if [ ! -f $TPMSRCDIR/fluxbox-0.1.14.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/fluxbox-0.1.14.tar.gz

	cd fluxbox-0.1.14
	./configure --prefix=/usr --enable-gnome
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fluxbox ] ; then exit; fi
	cd ..

	rm -rf fluxbox-0.1.14
	logmessage2 "Done fluxbox"
}

makexfce401() {
	logmessage2 "Making xfce..."

	if [ ! -f $TPMSRCDIR/xfce-4.0.1-src.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/xfce-4.0.1-src.tar.bz2 | tar -xv

	cd xfce-4.0.1
	./configure --prefix=/usr --datadir=/usr/share --sysconfdir=/etc \
	--with-gtk-prefix=/usr --with-glib-prefix=/usr

	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/xfwm ] ; then exit; fi
	cd ..

	rm -rf xfce-4.0.1
	logmessage2 "Done xfce"
}

makexfce3818() {
	logmessage2 "Making xfce..."

	if [ ! -f $TPMSRCDIR/xfce-3.8.18.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/xfce-3.8.18.tar.gz

	cd xfce-3.8.18
	#sed 's/\/usr\/local/\/usr/' configure >configure.new
	#cp configure.new configure

	./configure --prefix=/usr --datadir=/usr/share --sysconfdir=/etc \
	--with-gtk-prefix=/usr --with-glib-prefix=/usr

	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/xfwm ] ; then exit; fi
	cd ..

	rm -rf xfce-3.8.18
	logmessage2 "Done xfce"
}

tpmsscustomizeenlightenment0166() {
	logmessage2 "Customizing enlightenment..."


	cd /usr/share/enlightenment/scripts

	cat > e_gen_menu.patch << "EOF"
diff -uNr scripts.orig/e_gen_menu scripts/e_gen_menu
--- scripts.orig/e_gen_menu	2004-01-26 08:03:09.000000000 +0000
+++ scripts/e_gen_menu	2004-01-26 08:06:38.000000000 +0000
@@ -72,6 +72,7 @@
 @MainMenu = (
 	"t:User Menus",
 	"m:User Application list:user_apps.menu",
+	"m:ThePacketMaster:tpm.menu",
 	"m:GNOME:menus_GNOME/index.menu",
 	"m:KDE:menus_KDE/index.menu",
 	"m:Other:menus_Other/index.menu",
@@ -85,7 +86,7 @@
 	"x:Eterm:Eterm",
 	"x:XTerm:xterm",
 	"x:RXVT:rxvt",
-	"x:Mozilla:mozilla",
+	"x:Mozilla:/usr/mozilla/mozilla",
 	"x:Electric Eyes:ee",
 	"x:The GIMP:gimp",
 	"x:XV:xv",
@@ -94,6 +95,25 @@
 	"x:XMMS:xmms"
 );
 
+@TPMMenu = (
+	"t:ThePacketMaster Menu",
+	"m:Network Scanners:net_scanners.menu",
+	"m:Sniffers:sniffers.menu",
+);
+       
+@NetworkScannersMenu = (
+	"t:Network Scanner Application List",
+	"x:AirSnort:airsnort",
+	"x:Nessus:nessus",
+);
+
+@SniffersMenu = (
+	"t:Sniffers Application List",
+	"x:Ethereal:ethereal",
+	"x:Driftnet:driftnet",
+);
+
+
 # Make : separated directory list, check that they exist
 sub MkDirList {
 	local $ll = shift;
@@ -394,6 +414,9 @@
 # Make the menus
 MakeMenu("file.menu", \@MainMenu);
 MakeMenu("user_apps.menu", \@UserAppsMenu);
+MakeMenu("tpm.menu", \@TPMMenu);  
+MakeMenu("net_scanners.menu", \@NetworkScannersMenu);
+MakeMenu("sniffers.menu", \@SniffersMenu);
 MakeEppsMenu("epplets.menu");
 MakeAppsMenu("GNOME");
 MakeAppsMenu("KDE");
EOF

	patch -Np1 -i e_gen_menu.patch
	if [ $? -ne 0 ]; then exit -1; fi
	rm e_gen_menu.patch

	cd /
	logmessage2 "Done customizing enlightenment"
}

makeenlightenment0166() {
	logmessage2 "Making enlightenment..."

	if [ ! -f $TPMSRCDIR/enlightenment-0.16.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/enlightenment-0.16.6.tar.gz

	cd enlightenment-0.16.6
	./configure --prefix=/usr --enable-fsstd
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/enlightenment ] ; then exit; fi
	cd ..

	mv /etc/X11/xinit/xinitrc /etc/X11/xinit/xinitrc.twm
	cat > /etc/X11/xinit/xinitrc << "EOF"
#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

exec enlightenment
EOF


	cp $TPMSRCDIR/tpm-tux-640x480-x.jpg /usr/share/enlightenment/themes/BrushedMetal-Tigert/backgrounds/images/tpm-tux-640x480-x.jpg

	cat > /usr/share/enlightenment/themes/BrushedMetal-Tigert/backgrounds/backgrounds.cfg << "EOF"
/* 
for theme makers here's a bunch of pre-defined macros to create backgrounds 
with various alignments, scaling and configs - they do what they say they do

SET_SOLID("red rgeeb blue")
this will set the rgb value for a solid color (r,g and b 0-255) - if there is
no backgorund image or overlay image ONLY this solid colro will be displayed.
if the backgroudn image is not tiled wherever there is no background image 
displayed this solid color will be displayed

ADD_BACKGROUND_TILED(file)
ADD_BACKGROUND_SCALED(file)
ADD_BACKGROUND_TILED_SCALED_VERTICALLY(file)
ADD_BACKGROUND_TILED_SCALED_HORIZONTALLY(file)
ADD_BACKGROUND_CENTERED(file)
ADD_BACKGROUND_TILED_CENTER(file)
ADD_BACKGROUND_SCALED_RETAIN_ASPECT(file)
ADD_BACKGROUND_TILED_SCALED_RETAIN_ASPECT(file)
ADD_BACKGROUND_SCALED_RETAIN_ASPECT_ALIGN_RIGHT(file)
ADD_BACKGROUND_SCALED_RETAIN_ASPECT_ALIGN_LEFT(file)
ADD_BACKGROUND_SCALED_RETAIN_ASPECT_ALIGN_TOP(file)
ADD_BACKGROUND_SCALED_RETAIN_ASPECT_ALIGN_BOTTOM(file)

that's for the background layer - you can ALSO add an overlay image on top of 
the background or solid color.

ADD_OVERLAY_IMAGE_CENTERED(file)
ADD_OVERLAY_IMAGE_TOP_LEFT(file)
ADD_OVERLAY_IMAGE_TOP_RIGHT(file)
ADD_OVERLAY_IMAGE_BOTTOM_LEFT(file)
ADD_OVERLAY_IMAGE_BOTTOM_RIGHT(file)
ADD_OVERLAY_IMAGE_BOTTOM_MIDDLE(file)
ADD_OVERLAY_IMAGE_TOP_MIDDLE(file)
ADD_OVERLAY_IMAGE_LEFT_MIDDLE(file)
ADD_OVERLAY_IMAGE_RIGHT_MIDDLE(file)
ADD_OVERLAY_IMAGE_SCALED(file)
ADD_OVERLAY_IMAGE_ASPECT(file)

so you can set the solid, then a backgoudn if you want one then an overlay if 
you want one
*/

BEGIN_BACKGROUND("DEFAULT_TPM")
ADD_OVERLAY_IMAGE_CENTERED("backgrounds/images/tpm-tux-640x480-x.jpg")
SET_SOLID("0 0 0")
ON_DESKTOP("0")
ON_DESKTOP("1")
ON_DESKTOP("2")
ON_DESKTOP("3")
ON_DESKTOP("4")
ON_DESKTOP("5")
ON_DESKTOP("6")
ON_DESKTOP("7")
ON_DESKTOP("8")
ON_DESKTOP("9")
ON_DESKTOP("10")
ON_DESKTOP("11")
ON_DESKTOP("12")
ON_DESKTOP("13")
ON_DESKTOP("14")
ON_DESKTOP("15")
ON_DESKTOP("16")
ON_DESKTOP("17")
ON_DESKTOP("18")
ON_DESKTOP("19")
ON_DESKTOP("20")
ON_DESKTOP("21")
ON_DESKTOP("22")
ON_DESKTOP("23")
ON_DESKTOP("24")
ON_DESKTOP("25")
ON_DESKTOP("26")
ON_DESKTOP("27")
ON_DESKTOP("28")
ON_DESKTOP("29")
ON_DESKTOP("30")
ON_DESKTOP("31")
END_BACKGROUND

/* default desktop bg for desktop 0 */
BEGIN_BACKGROUND("GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_DARK_BRUSHED")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED_SCALED_VERTICALLY("backgrounds/images/dark_vertical_gradient_brushed.png")
END_BACKGROUND

/* default desktop bg for desktop 1 */
BEGIN_BACKGROUND("GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_LIGHT_BRUSHED")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED_SCALED_VERTICALLY("backgrounds/images/light_vertical_gradient_brushed.png")
END_BACKGROUND

/* default desktop bg for desktops 2 - 31 */
BEGIN_BACKGROUND("DEFAULT_BRUSHED_METAL_BG")
SET_SOLID("30 90 90")
END_BACKGROUND

/* extra backgroudns defined - but not assigned toa  desktop - users can */
/* select these if they want */

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_LIGHT_BRUSHED")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/light_brushed.png")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_DARK_BRUSHED")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/dark_brushed.png")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_SMALL_PEBBLES")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/small_turquoise_pebbles.jpg")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_LARGE_PEBBLES")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/turqouise_bg.jpg")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_TREEMOON")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_SCALED_RETAIN_ASPECT_ALIGN_RIGHT("backgrounds/images/turquoise_treemoon.jpg")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_LEATHER")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/turquoise_leather.jpg")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_SLATE_TILES")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/turquoise_tiles.jpg")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_WRINGLES")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/turquoise_wrinkles.jpg")
END_BACKGROUND

BEGIN_BACKGROUND("TILED_BRUSHED_METAL_BG_GARAGE_FLOOR")
  SET_SOLID("30 90 90")
  ADD_BACKGROUND_TILED("backgrounds/images/turquoise_garage_floor.jpg")
END_BACKGROUND
EOF

	rm -rf enlightenment-0.16.6
	logmessage2 "Done enlightenment"
}



makelibtiff357() {
	logmessage2 "Making libtiff..."

	if [ ! -f $TPMSRCDIR/tiff-v3.5.7.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tiff-v3.5.7.tar.gz

	cd tiff-v3.5.7
	rm -rf /usr/local/man
	echo -e "\n" | ./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libtiff.a ] ; then exit; fi
	cd ..

	rm -rf tiff-v3.5.7
	logmessage2 "Done libtiff"
}

makefnlib05() {
	logmessage2 "Making fnlib..."

	if [ ! -f $TPMSRCDIR/fnlib-0.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/fnlib-0.5.tar.gz

	cd fnlib-0.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libFnlib.so.0.5.0 ] ; then exit; fi
	if [ ! -f /usr/lib/libFnlib.a ] ; then exit; fi
	cd ..

	rm -rf fnlib-0.5
	logmessage2 "Done fnlib"
}

makeimlib1914() {
	logmessage2 "Making imlib..."

	if [ ! -f $TPMSRCDIR/imlib-1.9.14.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/imlib-1.9.14.tar.gz

	cd imlib-1.9.14
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libgdk_imlib.so.1.9.14 ] ; then exit; fi
	if [ ! -f /usr/lib/libgdk_imlib.a ] ; then exit; fi
	if [ ! -f /usr/lib/libimlib-bmp.a ] ; then exit; fi
	if [ ! -f /usr/lib/libimlib-ppm.a ] ; then exit; fi
	if [ ! -f /usr/lib/libimlib-xpm.a ] ; then exit; fi
	if [ ! -f /usr/lib/libimlib-gif.a ] ; then exit; fi
	cd ..

	rm -rf imlib-1.9.14
	logmessage2 "Done imlib"
}

makelibgnome2() {
	logmessage2 "Making libgnome2..."

	if [ ! -f $TPMSRCDIR/libgnome-2.0.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libgnome-2.0.6.tar.gz

	cd libgnome-2.0.6
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libgnome2.a ] ; then exit; fi
	cd ..

	rm -rf libgnome-2.0.6
	logmessage2 "Done libgnome2"
}

makelibidl082() {
	logmessage2 "Making libIDL..."

	if [ ! -f $TPMSRCDIR/libIDL-0.8.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libIDL-0.8.2.tar.gz

	cd libIDL-0.8.2
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libIDL-2.so.0.0.0 ] ; then exit; fi
	cd ..

	rm -rf libIDL-0.8.2
	logmessage2 "Done libIDL"
}

makeorbit292() {
	logmessage2 "Making orbit..."

	if [ ! -f $TPMSRCDIR/ORBit2-2.9.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ORBit2-2.9.2.tar.gz

	cd ORBit2-2.9.2
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/ ] ; then exit; fi
	cd ..

	rm -rf ORBit2-2.9.2
	logmessage2 "Done orbit"
}

makegconf121() {
	logmessage2 "Making gconf..."

	if [ ! -f $TPMSRCDIR/GConf-1.2.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/GConf-1.2.1.tar.gz

	cd GConf-1.2.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libgconf-2.so.4.1.0 ] ; then exit; fi
	cd ..

	rm -rf GConf-1.2.1
	logmessage2 "Done gconf"
}


makelinc055() {
	logmessage2 "Making linc..."

	if [ ! -f $TPMSRCDIR/linc-0.5.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/linc-0.5.5.tar.gz

	cd linc-0.5.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f liblinc.so.1.0.0 ] ; then exit; fi
	cd ..

	rm -rf linc-0.5.5
	logmessage2 "Done linc"
}

makelibbonobo251() {
	logmessage2 "Making libbonobo..."

	if [ ! -f $TPMSRCDIR/libbonobo-2.5.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libbonobo-2.5.1.tar.gz

	cd libbonobo-2.5.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f libbonobo-activation.so.4.0.0 ] ; then exit; fi
	cd ..

	rm -rf libbonobo-2.5.1.tar.gz
	logmessage2 "Done libbonobo"
}


makegnomemimedata240() {
	logmessage2 "Making gnome-mime-data..."

	if [ ! -f $TPMSRCDIR/gnome-mime-data-2.4.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gnome-mime-data-2.4.0.tar.gz

	cd gnome-mime-data-2.4.0
	./configure --prefix=/usr --disable-nls
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/pkgconfig/gnome-mime-data-2.0.pc ] ; then exit; fi
	cd ..

	rm -rf gnome-mime-data-2.4.0
	logmessage2 "Done gnome-mime-data"
}


makegnomevfs253() {
	logmessage2 "Making gnomevfs..."

	if [ ! -f $TPMSRCDIR/gnome-vfs-2.5.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gnome-vfs-2.5.3.tar.gz

	cd gnome-vfs-2.5.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/ ] ; then exit; fi
	cd ..

	rm -rf gnome-vfs-2.5.3.tar.gz
	logmessage2 "Done gnomevfs"
}


makecloop2001() {
	logmessage2 "Making cloop..."

	if [ ! -f $TPMSRCDIR/cloop_2.00-1.tar.gz ; then exit; fi
	tar -zxvf $TPMSRCDIR/cloop_2.00-1.tar.gz

	cd cloop-2.00
	make KERNEL_DIR=/linux-2.4.24
	if [ $? -ne 0 ]; then exit -1; fi

	mkdir -p /lib/modules/misc
	cp cloop.o /lib/modules/misc/
	cp create_compressed_fs /usr/bin/
	cp extract_compressed_fs /usr/bin/
	depmod -a	
	if [ ! -f /lib/modules/misc/cloop.o ] ; then exit; fi
	if [ ! -f /usr/bin/create_compressed_fs ] ; then exit; fi
	if [ ! -f /usr/bin/extract_compressed_fs ] ; then exit; fi
	cp README /readme/cloop-README
	cd ..

	rm -rf cloop-2.00
	logmessage2 "Done cloop"
}

makegd2015() {
	logmessage2 "Making gd..."

	if [ ! -f $TPMSRCDIR/gd-2.0.15.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gd-2.0.15.tar.gz

	cd gd-2.0.15
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/bin/pngtogd2 ] ; then exit; fi
	if [ ! -f /usr/bin/webpng ] ; then exit; fi
	if [ ! -f /usr/bin/pngtogd ] ; then exit; fi
	if [ ! -f /usr/bin/gd2topng ] ; then exit; fi
	if [ ! -f /usr/bin/gd2copypal ] ; then exit; fi
	if [ ! -f /usr/bin/gdtopng ] ; then exit; fi
	if [ ! -f /usr/bin/annotate ] ; then exit; fi
	if [ ! -f /usr/bin/gdparttopng ] ; then exit; fi
	cd ..

	rm -rf gd-2.0.15
	logmessage2 "Done gd"
}

makeqpopper405() {
	logmessage2 "Making qpopper..."

	if [ ! -f $TPMSRCDIR/qpopper4.0.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/qpopper4.0.5.tar.gz

	mkdir /etc/qpopper	
	cd qpopper4.0.5
	./configure --with-openssl=/usr/ssl --prefix=/usr --enable-debugging --sysconfdir=/etc/qpopper
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	cat > /etc/qpopper/qpopper.conf << "EOF"
set fast-update=true
set log-facility=mail
set log-login="(v%0) POP login by user \%1\ at (%2) %3"
set reverse-lookup=false
set server-mode=true
set spool-dir=/var/spool/mail
set statistics=false
set tls-private-key-file=/etc/qpopper/popd.pem
set tls-server-cert-file=/etc/qpopper/popd.pem
set tls-support=stls
#set tracefile=/var/log/qpopper.trace
set trim-domain=true
set user-options=true
EOF

	cat > /etc/qpopper/popd.conf << "EOF"
#
# SSLeay example configuration file.
# This is mostly being used for generation of certificate requests.
#
####################################################################
[ req ]
default_bits            = 1024
distinguished_name      = req_distinguished_name

[ req_distinguished_name ]
countryName                     = Country Name (2 letter code)
countryName_value               = CA

stateOrProvinceName             = State or Province Name (full name)
stateOrProvinceName_value       = Your State or Provice

localityName                    = Locality Name (eg, city)
localityName_value              = Your City

organizationName                = Organization Name (eg, company)
organizationName_value          = Your Name

commonName                      = Common Name (eg, YOUR name)
commonName_value                = 192.168.1.1

emailAddress                    = Email Address
emailAddress_value              = root@yourdomainname.com
EOF

	cat > /etc/xinetd.d/qpopper << "EOF"
# default: on
# description: POP3 service
service pop3
{
        socket_type             = stream
        wait                    = no
        user                    = root
        server                  = /usr/sbin/popper
        server_args             = -f /etc/qpopper/qpopper.conf
        log_on_success          += HOST DURATION PID
        log_on_failure          += HOST
        nice                    = 10
}
EOF


	chmod 600 /etc/qpopper/qpopper.conf
	chmod 644 /etc/xinetd.d/qpopper

	cat > /etc/rc.d/init.d/mkpopcert << "EOF"
/usr/ssl/bin/openssl req -new -x509 -nodes -out /etc/qpopper/popd.pem -keyout /etc/qpopper/popd.pem -days 3650 -config /etc/qpopper/popd.cnf
EOF
	chmod 755 /etc/rc.d/init.d/mkpopcert



	if [ ! -f /usr/sbin/popper ] ; then exit; fi
	if [ ! -d /etc/qpopper ] ; then exit; fi
	if [ ! -f /etc/qpopper/qpopper.conf ] ; then exit; fi
	cd ..

	rm -rf qpopper4.0.5
	logmessage2 "Done qpopper"
}

makeimapd2002d() {
	logmessage2 "Making imapd..."

	if [ ! -f $TPMSRCDIR/imap-2002d.tar.Z ] ; then exit; fi
	uncompress -c  $TPMSRCDIR/imap-2002d.tar.Z |tar -xv

	cd imap-2002d
	echo -e "y\n" | make slx SSLTYPE=unix SSLDIR=/usr/ssl
	if [ $? -ne 0 ]; then exit -1; fi
	cp imapd/imapd /usr/sbin/imapd	

	cat > /etc/xinetd.d/imapd << "EOF"
# default: on
# description: The imapd server serves IMAP connections.
service imap2
{
	socket_type		= stream
	wait			= no
	user			= root
	server			= /usr/sbin/imapd
#	server_args		=
	log_on_success		+= HOST DURATION PID
	log_on_failure		+= HOST
	nice			= 10
}
EOF

	cat > /etc/xinetd.d/imapsd << "EOF"
# default: on
# description: The imapd server serves IMAP connections.
service imaps
{
	socket_type		= stream
	wait			= no
	user			= root
	server			= /usr/sbin/imapd
#	server_args		=
	log_on_success		+= HOST DURATION PID
	log_on_failure		+= HOST
	nice			= 10
}
EOF

	cat > /etc/ssl/imapd.cnf << "EOF"
#
# SSLeay example configuration file.
# This is mostly being used for generation of certificate requests.
#
####################################################################
[ req ]
default_bits            = 1024
distinguished_name      = req_distinguished_name

[ req_distinguished_name ]
countryName                     = Country Name (2 letter code)
countryName_value               = CA

stateOrProvinceName             = State or Province Name (full name)
stateOrProvinceName_value       = Your State or Provice

localityName                    = Locality Name (eg, city)
localityName_value              = Your City

organizationName                = Organization Name (eg, company)
organizationName_value          = Your Name

commonName                      = Common Name (eg, YOUR name)
commonName_value                = 192.168.1.1

emailAddress                    = Email Address
emailAddress_value              = root@yourdomainname.com
EOF


	chmod 600 /etc/ssl/imapd.cnf

	cat > /etc/rc.d/init.d/mkimapcert << "EOF"
/usr/ssl/bin/openssl req -new -x509 -nodes -out /etc/ssl/imapd.pem -keyout /etc/ssl/imapd.pem -days 3650 -config /etc/ssl/imapd.cnf
EOF
	chmod 755 /etc/rc.d/init.d/mkimapcert


	if [ ! -f /usr/sbin/imapd ] ; then exit; fi
	cd ..

	rm -rf imap-2002d
	logmessage2 "Done imapd"
}

makewebalizer20110() {
	logmessage2 "Making webalizer..."

	if [ ! -f $TPMSRCDIR/webalizer-2.01-10-src.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/webalizer-2.01-10-src.tgz

	cd webalizer-2.01-10
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/webalizer ] ; then exit; fi
	cd ..

	rm -rf webalizer-2.01-10
	logmessage2 "Done webalizer"
}

#Not really needed
makephpmyadmin254() {
	logmessage2 "Making phpmyadmin..."

	if [ ! -f $TPMSRCDIR/phpMyAdmin-2.5.4-php.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/phpMyAdmin-2.5.4-php.tar.gz

	cd fatback-1.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}

makeperldbdmysql29003() {
	logmessage2 "Making DBD::mysql..."

	if [ ! -f $TPMSRCDIR/DBD-mysql-2.9003.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/DBD-mysql-2.9003.tar.gz

	cd DBD-mysql-2.9003
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Mysql.pm ] ; then exit; fi
	cd ..

	rm -rf DBD-mysql-2.9003
	logmessage2 "Done DBD::mysql"
}

makeperlnetssleay125() {
	logmessage2 "Making Net::SSLeay..."

	if [ ! -f $TPMSRCDIR/Net_SSLeay.pm-1.25.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Net_SSLeay.pm-1.25.tar.gz

	cd Net_SSLeay.pm-1.25
	perl Makefile.PL /usr/ssl
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Net/SSLeay.pm ] ; then exit; fi
	cd ..

	rm -rf Net_SSLeay.pm-1.25
	logmessage2 "Done Net::SSLeay"
}

makeperldbi139() {
	logmessage2 "Making DBI..."

	if [ ! -f $TPMSRCDIR/DBI-1.39.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/DBI-1.39.tar.gz

	cd DBI-1.39
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/DBI.pm ] ; then exit; fi
	cd ..

	rm -rf DBI-1.39
	logmessage2 "Done DBI"
}


makewebmin1121() {
	logmessage2 "Making webmin..."

	if [ ! -f $TPMSRCDIR/webmin-1.121.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/webmin-1.121.tar.gz

	cat > webmin.patch << "EOF"
diff -uNr webmin-1.121.orig/setup.sh webmin-1.121/setup.sh
--- webmin-1.121.orig/setup.sh	2003-11-08 23:37:54.000000000 +0000
+++ webmin-1.121/setup.sh	2003-12-23 11:26:15.000000000 +0000
@@ -3,6 +3,18 @@
 # This script should be run after the webmin archive is unpacked, in order
 # to setup the various config files
 
+config_dir=/etc/webmin
+var_dir=/var/webmin
+perl=/usr/bin/perl
+os_type='generic-linux'
+os_version='2.4'
+real_os_type='Generic Linux'
+real_os_version='2.4'
+port=10000
+login='admin'
+ssl=1
+atboot=1
+
 # Find install directory
 LANG=
 export LANG
EOF


	cat > webmin.init.patch << "EOF"
diff -uNr init.d.orig/webmin init.d/webmin
--- init.d.orig/webmin	2003-12-23 22:03:41.000000000 +0000
+++ init.d/webmin	2003-12-23 22:32:01.000000000 +0000
@@ -1,6 +1,26 @@
 #!/bin/sh
 # Start/stop Webmin
 
+if [ ! -e /etc/webmin/miniserv.pem ] ; then
+	echo "Generating SSL certificate for webmin"
+	host=`hostname`
+	/usr/ssl/bin/openssl req -newkey rsa:512 -x509 -nodes -out /etc/webmin/miniserv.pem -keyout /etc/webmin/miniserv.pem -days 1825 >/dev/null 2>&1 <<EOF
+.
+.
+.
+Webmin Webserver on $host
+.
+*
+root@$host
+EOF
+	if [ $? -ne 0 ] ; then
+		echo "Unable to generate SSL certificate for webmin"
+		exit -1
+	fi
+
+fi
+
+
 case "$1" in
 'start')
 	/etc/webmin/start >/dev/null 2>&1 </dev/null
EOF


	cd webmin-1.121
	patch -Np1 -i ../webmin.patch

	echo -e "\n\n" | ./setup.sh /usr/webmin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -d /usr/webmin ] ; then exit; fi
	if [ ! -f /etc/rc.d/init.d/webmin ] ; then exit; fi
	if [ ! -f /usr/webmin/miniserv.pl ] ; then exit; fi
	if [ ! -d /etc/webmin ] ; then exit; fi
	if [ ! -d /var/webmin ] ; then exit; fi
	cd ..

	#Remove certificates, since people should
	# generate their own.
	/etc/init.d/webmin stop
	rm -f /etc/webmin/miniserv.pem
	rm -f /etc/rc.d/rc2.d/S99webmin
	rm -f /etc/rc.d/rc3.d/S99webmin
	rm -f /etc/rc.d/rc5.d/S99webmin

	cd /etc/rc.d/init.d/
	patch -Np1 -i /webmin.init.patch
	cd /

	rm -rf webmin-1.121 webmin.init.patch webmin.patch
	logmessage2 "Done webmin" 
}

makecron401b1() {
	logmessage2 "Making cron..."

	if [ ! -f $TPMSRCDIR/cron_4.0_b1.shar ] ; then exit; fi

	mkdir cron_4.0_b1
	cd cron_4.0_b1
	sh $TPMSRCDIR/cron_4.0_b1.shar
	make
	if [ $? -ne 0 ]; then exit -1; fi
	dos2unix putman.sh
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/crontab ] ; then exit; fi
	if [ ! -f /usr/sbin/cron ] ; then exit; fi
	cd ..

	rm -rf cron_4.0_b1
	logmessage2 "Done cron"
}

makepwdutils24() {
	logmessage2 "Making pwdutils..."

	if [ ! -f $TPMSRCDIR/pwdutils-2.4.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pwdutils-2.4.tar.gz

	cd pwdutils-2.4
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/useradd ] ; then exit; fi
	cd ..

	rm -rf pwdutils-2.4
	logmessage2 "Done pwdutils"
}

makejava14203() {
	logmessage2 "Making java..."

	if [ ! -f $TPMSRCDIR/j2re-1_4_2_03-linux-i586.bin ] ; then exit; fi

	mkdir /usr/java
	cd /usr/java
	cat > /usr/bin/more << "EOF"
cat $1
EOF
	chmod 755 /usr/bin/more
	echo -e "yes\n" | $TPMSRCDIR/j2re-1_4_2_03-linux-i586.bin -localinstall
	if [ $? -ne 0 ]; then exit -1; fi
	
	rm /usr/bin/more	

	if [ ! -d /usr/java/j2re1.4.2_03 ] ; then exit; fi
	if [ ! -d /etc/.java ] ; then exit; fi
	if [ ! -x /usr/java/j2re1.4.2_03/bin/java ] ; then exit; fi
	cd ..

	logmessage2 "Done java"
}


makemozilla131() {
	logmessage2 "Making mozilla..."

	if [ ! -f $TPMSRCDIR/mozilla-i686-pc-linux-gnu-1.5.tar.gz ] ; then exit; fi
	cd /usr
	tar -zxvf $TPMSRCDIR/mozilla-i686-pc-linux-gnu-1.5.tar.gz

	if [ ! -f /usr/mozilla/mozilla ] ; then exit; fi
	cd /usr/mozilla/plugins/
	ln -s /usr/java/j2re1.4.2_03/plugin/i386/ns610-gcc32/libjavaplugin_oji.so
	cd /

	logmessage2 "Done mozilla"
}


makeadmsmb02() {
	logmessage2 "Making admsmb..."

	if [ ! -f $TPMSRCDIR/ADMsmb-v0.2.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ADMsmb-v0.2.tgz

	cd ADM-SAMBA-CLIENT
	BASEDIR=/usr make
	if [ $? -ne 0 ]; then exit -1; fi
	cp ADM-smb /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/ADM-smb ] ; then exit; fi
	cd ..

	rm -rf ADM-SAMBA-CLIENT
	logmessage2 "Done admsmb"
}


makeadmsnmp01() {
	logmessage2 "Making admsnmp..."

	if [ ! -f $TPMSRCDIR//ADMsnmp.0.1.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR//ADMsnmp.0.1.tgz

	cd ADMsnmp
	gcc -o ADM-snmp snmp.c
	if [ $? -ne 0 ]; then exit -1; fi
	cp ADM-snmp /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/ADM-snmp ] ; then exit; fi
	cd ..

	rm -rf ADMsnmp
	logmessage2 "Done admsnmp"
}

makeangst04b() {
	logmessage2 "Making angst..."

	#Make libnet, but don't install.  It is just needed to link with dsniff
	if [ ! -f $TPMSRCDIR/libnet-1.0.2a.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libnet-1.0.2a.tar.gz
	cd Libnet-1.0.2a
	OLDPATH=$PATH
	PATH=/Libnet-1.0.2a/:$PATH
	export PATH
	LIBNET_CONFIG_CFLAGS=-I/Libnet-1.0.2a/include ./configure --prefix=/usr
	make
	#make install
	cp doc/COPYING /license/libnet-1.0.2a-COPYING
	cd ..
	echo "Done"

	if [ ! -f $TPMSRCDIR/angst-0.4b.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/angst-0.4b.tar.gz

	cat > angst.patch << "EOFF"
diff -uNr angst-0.4b.orig/Makefile.linux angst-0.4b/Makefile.linux
--- angst-0.4b.orig/Makefile.linux	2001-02-08 13:44:12.000000000 +0000
+++ angst-0.4b/Makefile.linux	2004-01-14 17:45:01.000000000 +0000
@@ -10,8 +10,8 @@
 INSTALL_SBIN = /usr/bin/install -c -s -o root -g bin -m 555
 INSTALL_MAN = /usr/bin/install -c -o root -g bin -m 444
 CFLAGS = -O2 -Wall
-INCLUDE = -I/usr/local/include
-LIBS = -L/usr/local/lib `libnet-config --libs` -lpcap
+INCLUDE = -I/Libnet-1.0.2a/include/ -I/usr/include
+LIBS = -L/Libnet-1.0.2a/lib -L/usr/lib -lnet -lpcap
 DEFINE = `libnet-config --defines` -DLINUX #-DDEBUG
 OBJS = main.o active.o enable.o help.o host.o pcap.o signal.o util.o missing/strlcat.o missing/strlcpy.o
 
@@ -27,15 +27,15 @@
 	rm -f angst *.o missing/*.o *.core core
 
 install:
-	$(INSTALL_DIR) -d /usr/local/sbin
-	rm -f /usr/local/sbin/angst
-	$(INSTALL_SBIN) -m 550 angst /usr/local/sbin
-	$(INSTALL_DIR) -d /usr/local/man/man8
-	rm -f /usr/local/man/man8/angst.8
-	$(INSTALL_MAN) angst.8 /usr/local/man/man8
+	$(INSTALL_DIR) -d /usr/sbin
+	rm -f /usr/sbin/angst
+	$(INSTALL_SBIN) -m 550 angst /usr/sbin
+	$(INSTALL_DIR) -d /usr/man/man8
+	rm -f /usr/man/man8/angst.8
+	$(INSTALL_MAN) angst.8 /usr/man/man8
 
 uninstall:
-	rm -f /usr/local/sbin/angst
-	rm -f /usr/local/man/man8/angst.8
+	rm -f /usr/sbin/angst
+	rm -f /usr/man/man8/angst.8
 
 # EOF
EOFF


	cd angst-0.4b
	patch -Np1 -i ../angst.patch
	make -f Makefile.linux
	if [ $? -ne 0 ]; then exit -1; fi
	make -f Makefile.linux  install
	if [ $? -ne 0 ]; then exit -1; fi
	cp LICENSE /license/angst-LICENSE

	if [ ! -f /usr/sbin/angst ] ; then exit; fi
	cd ..

	PATH=$OLDPATH;export PATH
	rm -rf  angst-0.4b angst.patch
	logmessage2 "Done angst"
}


makearptool01() {
	logmessage2 "Making arptool..."

	if [ ! -f $TPMSRCDIR/arptool.c ] ; then exit; fi

	gcc -o /usr/bin/arptool $TPMSRCDIR/arptool.c
	if [ $? -ne 0 ]; then exit -1; fi
	
	if [ ! -f /usr/bin/arptool ] ; then exit; fi
	cd ..

	logmessage2 "Done arptool"
}

makebfbtester201() {
	logmessage2 "Making bfbtester..."

	if [ ! -f $TPMSRCDIR/bfbtester-2.0.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/bfbtester-2.0.1.tar.gz

	cd bfbtester-2.0.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/bfbtester ] ; then exit; fi
	cd ..

	rm -rf bfbtester-2.0.1
	logmessage2 "Done bfbtester"
}


makebruth() {
	logmessage2 "Making bruth..."

	if [ ! -f $TPMSRCDIR/bruth-orig.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/bruth-orig.tar.gz

	cd bruth
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp bruth /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/bruth ] ; then exit; fi
	cd ..

	rm -rf bruth
	logmessage2 "Done bruth"
}


makebsed10() {
	logmessage2 "Making bsed..."

	if [ ! -f $TPMSRCDIR//bsedsrc.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR//bsedsrc.tar.gz 

	cd bsedsrc
	make bsed
	if [ $? -ne 0 ]; then exit -1; fi
	cp bsed /usr/bin
	cp bsed.1 /usr/man/man1
	

	if [ ! -f /usr/bin/bsed ] ; then exit; fi
	cd ..

	rm -rf bsedsrc
	logmessage2 "Done bsed"
}


makelinneighborhood065() {
	logmessage2 "Making LinNeighborhood..."

	if [ ! -f $TPMSRCDIR/LinNeighborhood-0.6.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/LinNeighborhood-0.6.5.tar.gz

	cd LinNeighborhood-0.6.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/LinNeighborhood ] ; then exit; fi
	cd ..

	rm -rf LinNeighborhood-0.6.5
	logmessage2 "Done LinNeighborhood"
}


makegkismet005() {
	logmessage2 "Making gkismet..."

	if [ ! -f $TPMSRCDIR/gkismet-0.0.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gkismet-0.0.5.tar.gz

	cat > gkismet.patch << "EOF"
diff -uNr gkismet-0.0.5.orig/Makefile gkismet-0.0.5/Makefile >/output.txt
--- gkismet-0.0.5.orig/Makefile	2003-08-04 05:13:49.000000000 +0000
+++ gkismet-0.0.5/Makefile	2004-01-14 20:46:26.000000000 +0000
@@ -3,7 +3,7 @@
 #
 
 # Change to install to a different directory
-PREFIX=/usr/local
+PREFIX=/usr
 
 # Owner/group for the installation
 USER=root
EOF

	cd gkismet-0.0.5
	patch -Np1 -i ../gkismet.patch
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/gkismet ] ; then exit; fi
	cd ..

	rm -rf gkismet-0.0.5 gkismet.patch
	logmessage2 "Done gkismet"
}

makeknocker071() {
	logmessage2 "Making knocker..."

	if [ ! -f $TPMSRCDIR/knocker-0.7.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/knocker-0.7.1.tar.gz

	cd knocker-0.7.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/knocker ] ; then exit; fi
	cd ..

	rm -rf knocker-0.7.1
	logmessage2 "Done knocker"
}

makegtkknocker066() {
	logmessage2 "Making gtk-knocker..."

	if [ ! -f $TPMSRCDIR/gtk-knocker-0.6.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gtk-knocker-0.6.6.tar.gz

	cd gtk-knocker-0.6.6
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/gtk-knocker ] ; then exit; fi
	cd ..

	rm -rf gtk-knocker-0.6.6
	logmessage2 "Done gtk-knocker"
}


makeccrypt16() {
	logmessage2 "Making ccrypt..."

	if [ ! -f $TPMSRCDIR/ccrypt-1.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ccrypt-1.6.tar.gz

	cd ccrypt-1.6
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/ccrypt ] ; then exit; fi
	cd ..

	rm -rf ccrypt-1.6
	logmessage2 "Done ccrypt"
}


makecflow1051() {
	logmessage2 "Making Cflow..."

	if [ ! -f $TPMSRCDIR/Cflow-1.051.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Cflow-1.051.tar.gz

	cd Cflow-1.051
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Cflow.pm ] ; then exit; fi
	if [ ! -f /usr/bin/flowdumper ] ; then exit; fi
	cd ..

	rm -rf Cflow-1.051
	logmessage2 "Done Cflow"
}


makecgrep813() {
	logmessage2 "Making cgrep..."

	if [ ! -f $TPMSRCDIR/cgrepsrc.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cgrepsrc.tar.gz

	cd cgrepsrc
	tar -zxvf cgrep-8.13.tar.gz
	cd cgrep-8.13
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/cgrep ] ; then exit; fi
	cd ../..

	rm -rf cgrepsrc
	logmessage2 "Done cgrep"
}


makecheops061() {
	logmessage2 "Making cheops..."

	if [ ! -f $TPMSRCDIR/cheops-0.61.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cheops-0.61.tar.gz

	cd cheops-0.61
	./configure --prefix=/usr 
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/cheops ] ; then exit; fi
	cd ..

	rm -rf cheops-0.61
	logmessage2 "Done cheops"
}


makecscope155() {
	logmessage2 "Making cscope..."

	if [ ! -f $TPMSRCDIR/cscope-15.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cscope-15.5.tar.gz

	cd cscope-15.5
	./configure --prefix=/usr --with-flex
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/cscope ] ; then exit; fi
	cd ..

	rm -rf cscope-15.5
	logmessage2 "Done cscope"
}


makedillo073() {
	logmessage2 "Making dillo..."

	if [ ! -f $TPMSRCDIR/dillo-0.7.3.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/dillo-0.7.3.tar.bz2  |tar -xv

	cd dillo-0.7.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/dillo ] ; then exit; fi
	cd ..

	rm -rf dillo-0.7.3
	logmessage2 "Done dillo"
}

makedisco12() {
	logmessage2 "Making disco..."

	if [ ! -f $TPMSRCDIR/disco-1.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/disco-1.2.tar.gz

	cd disco
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/disco ] ; then exit; fi
	cd ..

	rm -rf disco
	logmessage2 "Done disco"
}

makeechoping510() {
	logmessage2 "Making echoping..."

	if [ ! -f $TPMSRCDIR/echoping-5.1.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/echoping-5.1.0.tar.gz

	cd echoping-5.1.0
	./configure --prefix=/usr --with-ssl=/usr/ssl
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/echoping ] ; then exit; fi
	cd ..

	rm -rf echoping-5.1.0
	logmessage2 "Done echoping"
}

makefenris() {
	logmessage2 "Making fenris..."

	if [ ! -f $TPMSRCDIR/fenris.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/fenris.tgz

	cd fenris
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fenris ] ; then exit; fi
	cd ..

	rm -rf fenris
	logmessage2 "Done fenris"
}

makeforemost069() {
	logmessage2 "Making foremost..."

	if [ ! -f $TPMSRCDIR/foremost-0.69.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/foremost-0.69.tar.gz

	cat > foremost.patch << "EOF"
diff -uNr foremost-0.69.orig/Makefile foremost-0.69/Makefile
--- foremost-0.69.orig/Makefile	2004-01-09 13:45:23.000000000 +0000
+++ foremost-0.69/Makefile	2004-01-15 08:03:08.000000000 +0000
@@ -14,8 +14,8 @@
 #---------------------------------------------------------------------
 
 # Where foremost gets installed
-BIN = /usr/local/bin
-MAN = /usr/local/man/man1
+BIN = /usr/bin
+MAN = /usr/man/man1
 
 # This should be commented out when debugging is done
 #CC_OPTS += -D__DEBUG -ggdb
EOF


	cd foremost-0.69
	#patch -Np1 -i ../foremost.patch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	install -Dm 755 foremost /usr/bin/foremost
	if [ $? -ne 0 ]; then exit -1; fi
	install -Dm 644 foremost.1 /usr/man/man1/foremost.1
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/foremost ] ; then exit; fi
	cd ..

	rm -rf foremost-0.69
	logmessage2 "Done foremost"
}


makehlfl0601() {
	logmessage2 "Making hlfl..."

	if [ ! -f $TPMSRCDIR/hlfl-0.60.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/hlfl-0.60.1.tar.gz

	cd hlfl-0.60.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/hlfl ] ; then exit; fi
	cd ..

	rm -rf hlfl-0.60.1
	logmessage2 "Done hlfl"
}


makeicmpush22() {
	logmessage2 "Making icmpush..."

	if [ ! -f $TPMSRCDIR/icmpush22.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/icmpush22.tgz

	cat > packet.patch << "EOF"
diff -uNr icmpush-2.2.orig/packet.h icmpush-2.2/packet.h
--- icmpush-2.2.orig/packet.h	1999-02-17 01:49:10.000000000 +0000
+++ icmpush-2.2/packet.h	2004-01-26 11:13:31.000000000 +0000
@@ -29,4 +29,4 @@
                  u_long garbage;
                };
  
- #endif
\ No newline at end of file
+ #endif
EOF


	cat > compat.patch << "EOF"
diff -uNr icmpush-2.2.orig/compat.h icmpush-2.2/compat.h
--- icmpush-2.2.orig/compat.h	1999-02-17 01:41:44.000000000 +0000
+++ icmpush-2.2/compat.h	2004-01-26 11:13:27.000000000 +0000
@@ -176,4 +176,4 @@
 
 #define IP_MF 0x2000   /* IP More Fragments flag */
 
-#endif
\ No newline at end of file
+#endif
EOF

	cat > help.patch << "EOF"
diff -uNr icmpush-2.2.orig/help.c icmpush-2.2/help.c
--- icmpush-2.2.orig/help.c	1999-02-17 10:05:52.000000000 +0000
+++ icmpush-2.2/help.c	2004-01-26 12:58:51.000000000 +0000
@@ -65,5 +65,5 @@
   fprintf(stdout,"  -ptr  byte       Incorrect byte on an ICMP Parameter Problem.\n"); 
   fprintf(stdout,"  -c  code|num|max ICMP code. See the man page for details.\n\n");  
 #endif
-  exit(0);
+
 } 
EOF

	cat > icmpush.patch << "EOF"
diff -uNr icmpush-2.2.orig/icmpush.c icmpush-2.2/icmpush.c
--- icmpush-2.2.orig/icmpush.c	1999-02-17 09:24:21.000000000 +0000
+++ icmpush-2.2/icmpush.c	2004-01-26 13:12:28.000000000 +0000
@@ -40,6 +40,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
+#include <time.h>
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
EOF


	cd icmpush-2.2
	patch -Np1 -i ../packet.patch
	patch -Np1 -i ../compat.patch
	patch -Np1 -i ../help.patch
	patch -Np1 -i ../icmpush.patch
	make linuz
	if [ $? -ne 0 ]; then exit -1; fi
	cp icmpush /usr/bin/
	cp icmpush.8 /usr/man/man8
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/icmpush ] ; then exit; fi
	cd ..

	rm -rf icmpush-2.2 packet.patch compat.patch help.patch icmpush.patch

	logmessage2 "Done icmpush"
}


makegtkrecover03() {
	logmessage2 "Making gtkrecover..."

	if [ ! -f $TPMSRCDIR/gtkrecover-0.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gtkrecover-0.3.tar.gz

	cd gtkrecover-0.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/gtkrecover ] ; then exit; fi
	cd ..

	rm -rf gtkrecover-0.3
	logmessage2 "Done gtkrecover"
}

makeipsorc175() {
	logmessage2 "Making ipsorc..."

	if [ ! -f $TPMSRCDIR/ipsorc-1.7.5.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/ipsorc-1.7.5.tar.bz2  |tar -xv

	cd ipsorc-1.7.5
	make all
	if [ $? -ne 0 ]; then exit -1; fi
	make con-install
	if [ $? -ne 0 ]; then exit -1; fi
	make gtk-install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/magic ] ; then exit; fi
	if [ ! -f /usr/sbin/ipmagic ] ; then exit; fi
	cd ..

	rm -rf ipsorc-1.7.5
	logmessage2 "Done ipsorc"
}

makeisnprober101() {
	logmessage2 "Making isnprober..."

	if [ ! -f $TPMSRCDIR/isnprober-1.01.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/isnprober-1.01.tgz

	cd isnprober-1.01
	cp isnprober /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/isnprober ] ; then exit; fi
	cd ..

	rm -rf isnprober-1.01
	logmessage2 "Done isnprober"
}


makeperlnetrawip01() {
	logmessage2 "Making Net-RawIP..."

	if [ ! -f $TPMSRCDIR/Net-RawIP-0.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Net-RawIP-0.1.tar.gz

	cd Net-RawIP-0.1
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Net/RawIP.pm ] ; then exit; fi
	cd ..

	rm -rf Net-RawIP-0.1
	logmessage2 "Done Net-RawIP"
}

makeitunnel12() {
	logmessage2 "Making itunnel..."

	if [ ! -f $TPMSRCDIR/itunnel-1_2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/itunnel-1_2.tar.gz

	cd itunnel-1.2
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp it /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/it ] ; then exit; fi
	cd ..

	rm -rf itunnel-1.2
	logmessage2 "Done itunnel"
}

makel2tpd069() {
	logmessage2 "Making l2tpd..."

	if [ ! -f $TPMSRCDIR/l2tpd-0.69.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/l2tpd-0.69.tar.gz

	cd l2tpd-0.69
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp l2tpd /usr/sbin/
	cp l2tpd.8 /usr/man/man8/
	

	if [ ! -f /usr/sbin/l2tpd ] ; then exit; fi
	cd ..

	rm -rf l2tpd-0.69
	logmessage2 "Done l2tpd"
}

#encountered compile problems, see details inside function
makenetwag560() {
	logmessage2 "Making netwib..."

	if [ ! -f $TPMSRCDIR/netwib-5.6.0-src.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/netwib-5.6.0-src.tgz

	cat > netwib.patch << "EOF"
diff -uNr netwib-5.6.0-src.orig/src/config.dat netwib-5.6.0-src/src/config.dat
--- netwib-5.6.0-src.orig/src/config.dat	2003-12-14 19:43:19.000000000 +0000
+++ netwib-5.6.0-src/src/config.dat	2004-01-15 09:22:17.000000000 +0000
@@ -66,7 +66,7 @@
 
 ##########################################################################
 ### directories [should not need to be modified]
-NETWIBDEF_INSTPREFIX=/usr/local
+NETWIBDEF_INSTPREFIX=/usr
 NETWIBDEF_INSTINCLUDE=${NETWIBDEF_INSTPREFIX}/include
 NETWIBDEF_INSTLIB=${NETWIBDEF_INSTPREFIX}/lib
 NETWIBDEF_INSTBIN=${NETWIBDEF_INSTPREFIX}/bin
EOF


	cd netwib-5.6.0-src
	patch -Np1 -i ../../netwib.patch

	cd src
	./genemake
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	
exit
#When trying to compile netwib/net/debug.o
#In file included from /usr/include/linux/igmp.h:19,
#                 from /usr/include/netinet/igmp.h:26,
#                 from /usr/include/libnet.h:83,
#                 from netwib/net/debug.c:52:
#/usr/include/asm/byteorder.h:38: syntax error before "__u64"
#/usr/include/asm/byteorder.h:38: syntax error before "val"
#/usr/include/asm/byteorder.h: In function `___arch__swab64':
#/usr/include/asm/byteorder.h:42: syntax error before "__u64"
#/usr/include/asm/byteorder.h: At top level:
#/usr/include/asm/byteorder.h:44: syntax error before '.' token
#/usr/include/asm/byteorder.h:52: syntax error before string constant


	cd ../..
	cd 
	if [ ! -f  ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}

makelde260() {
	logmessage2 "Making lde..."

	if [ ! -f $TPMSRCDIR/lde-2.6.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/lde-2.6.0.tar.gz

	cd lde
	./configure --prefix=/usr --with-gpm
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/lde ] ; then exit; fi
	cd ..

	rm -rf lde
	logmessage2 "Done lde"
}

makeldebinary260() {
	logmessage2 "Making lde..."

	if [ ! -f $TPMSRCDIR/lde-i386.gz ] ; then exit; fi
	gunzip -c $TPMSRCDIR/lde-i386.gz >/usr/sbin/lde

	chmod 755 /usr/sbin/lde
	if [ ! -x /usr/sbin/lde ] ; then exit; fi
	cd ..

	logmessage2 "Done lde"
}


makeltrace0331() {
	logmessage2 "Making ltrace..."

	if [ ! -f $TPMSRCDIR/ltrace_0.3.31.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ltrace_0.3.31.tar.gz

	cd ltrace-0.3.31
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/ltrace ] ; then exit; fi
	cd ..

	rm -rf ltrace-0.3.31
	logmessage2 "Done ltrace"
}


makentreg() {
	logmessage2 "Making ntreg..."

	if [ ! -f $TPMSRCDIR/ntreg.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ntreg.tar.gz

	cd ntreg
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}

makemacchanger140() {
	logmessage2 "Making macchanger..."

	if [ ! -f $TPMSRCDIR/macchanger-1.4.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/macchanger-1.4.0.tar.gz

	cd macchanger-1.4.0
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/macchanger ] ; then exit; fi
	cd ..

	rm -rf  macchanger-1.4.0
	logmessage2 "Done macchanger"
}


makemd5deep016() {
	logmessage2 "Making md5deep..."

	if [ ! -f $TPMSRCDIR/md5deep-0.16.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/md5deep-0.16.tar.gz

	cd md5deep-0.16
	make linux
	if [ $? -ne 0 ]; then exit -1; fi
	install -Dm 755 md5deep /usr/bin/md5deep
	install -Dm 644 md5deep.1 /usr/man/man1/md5deep.1
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/md5deep ] ; then exit; fi
	cd ..

	rm -rf md5deep-0.16
	logmessage2 "Done md5deep"
}

makerat21() {
	logmessage2 "Making rat..."

	if [ ! -f $TPMSRCDIR/rat_2_1.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/Test-Simple-0.47.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/TermReadKey-2.21.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/Net-Telnet-Cisco-1.10.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/Net-Telnet-3.03.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/rat_2_1.tar.gz
	tar -zxvf $TPMSRCDIR/Test-Simple-0.47.tar.gz
	tar -zxvf $TPMSRCDIR/TermReadKey-2.21.tar.gz
	tar -zxvf $TPMSRCDIR/Net-Telnet-Cisco-1.10.tar.gz
	tar -zxvf $TPMSRCDIR/Net-Telnet-3.03.tar.gz

	cd Test-Simple-0.47
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	if [ ! -f /usr/lib/perl5/5.8.1/Test/Builder.pm ] ; then exit; fi
	cd ../

	cd TermReadKey-2.21
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/i686-linux/Term/ReadKey.pm ] ; then exit; fi
	cd ../


	cd Net-Telnet-3.03
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/Net/Telnet.pm ] ; then exit; fi
	cd ../


	cd Net-Telnet-Cisco-1.10
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/Net/Telnet/Cisco.pm ] ; then exit; fi
	cd ../

	cd rat_2_1_RC3
	perl Makefile.PL PREFIX=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/rat ] ; then exit; fi
	cd ..

	rm -rf  rat_2_1_RC3 Net-Telnet-Cisco-1.10 TermReadKey-2.21 Test-Simple-0.47 Net-Telnet-3.03
	logmessage2 "Done rat"
}


makevnc337() {
	logmessage2 "Making VNC..."

	if [ ! -f $TPMSRCDIR/vnc-3.3.7-unixsrc.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/vnc-3.3.7-unixsrc.tar.gz

	cd vnc-3.3.7-unixsrc
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cd Xvnc
	make World
	if [ $? -ne 0 ]; then exit -1; fi
	cd ..
	./vncinstall /usr/bin /usr/man
	if [ $? -ne 0 ]; then exit -1; fi
	mkdir -p /usr/vnc/classes
	cp classes/* /usr/vnc/classes
	

	if [ ! -f /usr/bin/vncviewer ] ; then exit; fi
	if [ ! -f /usr/bin/vncpasswd ] ; then exit; fi
	if [ ! -f /usr/bin/Xvnc ] ; then exit; fi
	cd ..

	rm -rf vnc-3.3.7-unixsrc
	logmessage2 "Done VNC"
}


makerdesktop130() {
	logmessage2 "Making rdesktop..."

	if [ ! -f $TPMSRCDIR/rdesktop-1.3.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/rdesktop-1.3.0.tar.gz

	cd rdesktop
	./configure --prefix=/usr --with-openssl=/usr/ssl
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/rdesktop ] ; then exit; fi
	cd ..

	rm -rf rdesktop
	logmessage2 "Done rdesktop"
}



makemtr054() {
	logmessage2 "Making mtr..."

	if [ ! -f $TPMSRCDIR/mtr-0.54.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mtr-0.54.tar.gz

	cd mtr-0.54
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/mtr ] ; then exit; fi
	cd ..

	rm -rf mtr-0.54
	logmessage2 "Done mtr"
}


makenstreams100() {
	logmessage2 "Making nstreams..."

	if [ ! -f $TPMSRCDIR/nstreams-1.0.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/nstreams-1.0.0.tar.gz

	cd nstreams
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/nstreams ] ; then exit; fi
	cd ..

	rm -rf nstreams
	logmessage2 "Done nstreams"
}


makentfsprogs182() {
	logmessage2 "Making ntfsprogs..."

	if [ ! -f $TPMSRCDIR/ntfsprogs-1.8.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ntfsprogs-1.8.2.tar.gz

	cd ntfsprogs-1.8.2
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/mkntfs ] ; then exit; fi
	if [ ! -f /usr/sbin/ntfslabel ] ; then exit; fi
	if [ ! -f /usr/sbin/ntfsundelete ] ; then exit; fi
	if [ ! -f /usr/sbin/ntfsresize ] ; then exit; fi
	if [ ! -f /usr/sbin/ntfsclone ] ; then exit; fi
	if [ ! -f /usr/bin/ntfsfix ] ; then exit; fi
	if [ ! -f /usr/bin/ntfscluster ] ; then exit; fi
	if [ ! -f /usr/bin/ntfsinfo ] ; then exit; fi
	if [ ! -f /usr/bin/ntfsls ] ; then exit; fi
	if [ ! -f /usr/bin/ntfscat ] ; then exit; fi
	cd ..

	rm -rf ntfsprogs-1.8.2
	logmessage2 "Done ntfsprogs"
}


makeonesixtyone032() {
	logmessage2 "Making onesixtyone..."

	if [ ! -f $TPMSRCDIR/onesixtyone-0.3.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/onesixtyone-0.3.2.tar.gz

	cd onesixtyone-0.3.2
	gcc -o onesixtyone onesixtyone.c
	if [ $? -ne 0 ]; then exit -1; fi
	cp onesixtyone /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/onesixtyone ] ; then exit; fi
	cd ..

	rm -rf onesixtyone-0.3.2
	logmessage2 "Done onesixtyone"
}


makepasmal05() {
	logmessage2 "Making pasmal..."

	if [ ! -f $TPMSRCDIR/pasmal0.5.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pasmal0.5.tgz

	cd pasmal
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /sbin/pasmal ] ; then exit; fi
	cd ..

	rm -rf pasmal
	logmessage2 "Done pasmal"
}


makepwl9x007() {
	logmessage2 "Making pwl..."

	if [ ! -f $TPMSRCDIR/pwl9x-0.07-dev.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/pwl9x-0.07-dev.tar.gz

	cd pwl9x
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp pwl9x /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/pwl9x ] ; then exit; fi
	cd ..

	rm -rf pwl9x
	logmessage2 "Done pwl9x"
}



makerda021c() {
	logmessage2 "Making rda..."

	if [ ! -f $TPMSRCDIR/rda-0.2.1c.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/rda-0.2.1c.tgz


	cat > rda.patch << "EOF"
diff -uNr rda-0.2.1c.orig/Makefile rda-0.2.1c/Makefile
--- rda-0.2.1c.orig/Makefile	2002-10-04 11:23:39.000000000 +0000
+++ rda-0.2.1c/Makefile	2004-01-16 14:17:54.000000000 +0000
@@ -2,7 +2,7 @@
 
 # Makefile for rda
 
-prefix = /usr/local
+prefix = /usr
 
 CC = gcc
 CFLAGS = -Wall -DCOLOR -I./include
EOF

	cd rda-0.2.1c
	patch -Np1 -i ../rda.patch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/rda ] ; then exit; fi
	cd ..

	rm -rf rda.patch rda-0.2.1c
	logmessage2 "Done rda"
}


makerevinetd09() {
	logmessage2 "Making revinetd..."

	if [ ! -f $TPMSRCDIR/revinetd-0.9.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/revinetd-0.9.tar.gz

	cd revinetd-0.9
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp revinetd /usr/sbin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/revinetd ] ; then exit; fi
	cd ..

	rm -rf revinetd-0.9
	logmessage2 "Done revinetd"
}


makescanerrlog201() {
	logmessage2 "Making scanerrlog..."

	if [ ! -f $TPMSRCDIR/scanerrlog-2.01.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/scanerrlog-2.01.tar.gz

	cd scanerrlog-2.01
	python setup.py install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/scanerrlog.py ] ; then exit; fi
	cd ..

	rm -rf scanerrlog-2.01
	logmessage2 "Done scanerrlog"
}

makejaxml301() {
	logmessage2 "Making jaxml..."

	if [ ! -f $TPMSRCDIR/jaxml-3.01.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/jaxml-3.01.tar.gz

	cd jaxml-3.01
	python setup.py install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f  /usr/lib/python2.3/site-packages/jaxml.py ] ; then exit; fi
	cd ..

	rm -rf jaxml-3.01
	logmessage2 "Done jaxml"
}



makereportlab118() {
	logmessage2 "Making ReportLab..."

	if [ ! -f $TPMSRCDIR/ReportLab_1_18.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ReportLab_1_18.tgz

	cd reportlab
	python setup.py install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -d  /usr/lib/python2.3/reportlab ] ; then exit; fi
	cd ..

	rm -rf reportlab
	logmessage2 "Done reportlab"
}


makescanlogd22() {
	logmessage2 "Making scanlogd..."

	if [ ! -f $TPMSRCDIR/scanlogd-2.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/scanlogd-2.2.tar.gz

	cat > scanlogd.patch << "EOF"
diff -uNr scanlogd-2.2.orig/Makefile scanlogd-2.2/Makefile
--- scanlogd-2.2.orig/Makefile	2000-11-10 02:47:04.000000000 +0000
+++ scanlogd-2.2/Makefile	2004-01-16 15:18:49.000000000 +0000
@@ -7,8 +7,8 @@
 PCAP_H = -I/usr/include/pcap
 PCAP_L = -lpcap
 
-NIDS_H = -I/usr/local/include
-NIDS_L = -L/usr/local/lib -lnids -lnet -lpcap
+NIDS_H = -I/usr/include
+NIDS_L = -L/usr/lib -lnids -lnet -lpcap
 
 PROJ = scanlogd
 
EOF

	cd scanlogd-2.2
	patch -Np1 -i ../scanlogd.patch
	make linux
	if [ $? -ne 0 ]; then exit -1; fi
	cp scanlogd /usr/sbin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/scanlogd ] ; then exit; fi
	cd ..

	rm -rf scanlogd-2.2 scanlogd.patch
	logmessage2 "Done scanlogd"
}


makeshiva031() {
	logmessage2 "Making shiva..."

	if [ ! -f $TPMSRCDIR/shiva-0.3.1-src.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/shiva-0.3.1-src.tar.gz

	cd shiva-0.3.1-src





	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}

makeslogdump12() {
	logmessage2 "Making slogdump..."

	if [ ! -f $TPMSRCDIR/slogdump-1.2.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/slogdump-1.2.tgz

	cd slogdump-1.2
	gcc -Wall   -c -o slogdump.o slogdump.c
	gcc  -o slogdump slogdump.o -lpcap
	if [ $? -ne 0 ]; then exit -1; fi
	cp slogdump /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/slogdump ] ; then exit; fi
	cd ..

	rm -rf slogdump-1.2
	logmessage2 "Done slogdump"
}


makesmokeping125() {
	logmessage2 "Making smokeping..."

	if [ ! -f $TPMSRCDIR/smokeping-1.25.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/smokeping-1.25.tar.gz

	cd smokeping-1.25
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}


makerrdtool1046() {
	logmessage2 "Making rrdtool..."

	if [ ! -f $TPMSRCDIR/rrdtool-1.0.46.tar.gz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/rrdtool-1.0.46.tar.gz 

	cd rrdtool-1.0.46
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	make site-perl-install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/rrdtool ] ; then exit; fi
	cd ..

	rm -rf rrdtool-1.0.46
	logmessage2 "Done rrdtool"
}


makesnapscreenshot10142() {
	logmessage2 "Making snapscreenshot..."

	if [ ! -f $TPMSRCDIR/snapscreenshot-1.0.14.2.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/snapscreenshot-1.0.14.2.tar.bz2 |tar -xv

	cd snapscreenshot-1.0.14.2
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp snapscreenshot /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/snapscreenshot ] ; then exit; fi
	cd ..

	rm -rf snapscreenshot-1.0.14.2        
	logmessage2 "Done snapscreenshot"
}


makespike28() {
	logmessage2 "Making spike..."

	if [ ! -f $TPMSRCDIR/SPIKE2.8.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/SPIKE2.8.tgz

	cd SPIKE/v2.8/src
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/ ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}

makesplint311() {
	logmessage2 "Making splint..."

	if [ ! -f $TPMSRCDIR/splint-3.1.1.src.tgz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/splint-3.1.1.src.tgz 

	cd splint-3.1.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/splint ] ; then exit; fi
	cd ..

	rm -rf splint-3.1.1
	logmessage2 "Done splint"
}


makessldump09b3() {
	logmessage2 "Making ssldump..."

	if [ ! -f $TPMSRCDIR/ssldump-0.9b3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ssldump-0.9b3.tar.gz

	cd ssldump-0.9b3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/ssldump ] ; then exit; fi
	cd ..

	rm -rf ssldump-0.9b3
	logmessage2 "Done ssldump"
}


maketcptraceroute15b4() {
	logmessage2 "Making tcptraceroute..."

	if [ ! -f $TPMSRCDIR/tcptraceroute-1.5beta4.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tcptraceroute-1.5beta4.tar.gz

	cd tcptraceroute-1.5beta4
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/tcptraceroute ] ; then exit; fi
	cd ..

	rm -rf tcptraceroute-1.5beta4
	logmessage2 "Done tcptraceroute"
}


maketestdisk51() {
	logmessage2 "Making testdisk..."

	if [ ! -f $TPMSRCDIR/testdisk-5.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/testdisk-5.1.tar.gz

	cd testdisk
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}


makethcrut125() {
	logmessage2 "Making thcrut..."

	if [ ! -f $TPMSRCDIR/thcrut-1.2.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/thcrut-1.2.5.tar.gz

	cd thcrut-1.2.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	
	if [ ! -f /usr/bin/thcrut ] ; then exit; fi
	cd ..

	rm -rf thcrut-1.2.5
	logmessage2 "Done thcrut"
}

maketransproxy15() {
	logmessage2 "Making transproxy..."

	if [ ! -f $TPMSRCDIR/transproxy-1.5.tgz  ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/transproxy-1.5.tgz 


	cat > transproxy.patch << "EOF"
diff -uNr transproxy-1.5.orig/Makefile transproxy-1.5/Makefile
--- transproxy-1.5.orig/Makefile	2002-12-02 11:35:51.000000000 +0000
+++ transproxy-1.5/Makefile	2004-01-16 23:46:03.000000000 +0000
@@ -64,7 +64,7 @@
 #OPTIONS += -DHAVE_GETOPT_H
 
 # You may need to touch PREFIX, CC and CFLAGS.
-PREFIX = /usr/local
+PREFIX = /usr
 INSTALL_PROGRAM = install -c -m 555 -o bin -g bin
 INSTALL_MAN = install -c -m 444 -o bin -g bin
 
EOF


	cd transproxy-1.5
	patch -Np1 -i ../transproxy.patch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/tproxy ] ; then exit; fi
	cd ..

	rm -rf transproxy-1.5
	logmessage2 "Done transproxy"
}


maketsocks18() {
	logmessage2 "Making tsocks..."

	if [ ! -f $TPMSRCDIR/tsocks-1.8beta5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tsocks-1.8beta5.tar.gz

	cd tsocks-1.8
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/tsocks ] ; then exit; fi
	cd ..

	rm -rf tsocks-1.8
	logmessage2 "Done tsocks"
}

makevalgrind210() {
	logmessage2 "Making valgrind..."

	if [ ! -f $TPMSRCDIR/valgrind-2.1.0.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/valgrind-2.1.0.tar.bz2 | tar -xv

	cd valgrind-2.1.0
	./configure --prefix=/usr --with-x
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/valgrind ] ; then exit; fi
	cd ..

	rm -rf valgrind-2.1.0
	logmessage2 "Done valgrind"
}

makevlad092() {
	logmessage2 "Making vlad..."

	if [ ! -f $TPMSRCDIR/vlad-0.9.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/vlad-0.9.2.tar.gz

	cd vlad-0.9.2
	mkdir -p /usr/share/vlad
	cp -R * /usr/share/vlad
	if [ $? -ne 0 ]; then exit -1; fi
	mv /usr/share/vlad/*.pl /usr/bin
	
	if [ ! -f /usr/bin/vlad.pl ] ; then exit; fi
	cd ..

	rm -rf vlad-0.9.2
	logmessage2 "Done vlad"
}


makewalker32() {
	logmessage2 "Making walker..."

	if [ ! -f $TPMSRCDIR/walker-3.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/walker-3.2.tar.gz

	cd walker-3.2
	install -Dm 755 walker /usr/bin/walker
	install -Dm 644 walker /usr/man/man1/walker

	if [ ! -f /usr/bin/walker ] ; then exit; fi
	cd ..

	rm -rf walker-3.2
	logmessage2 "Done walker"
}


makeperlnetdnssec011() {
	logmessage2 "Building Perl Module Net::DNSSEC..."

	if [ ! -f $TPMSRCDIR/Net-DNS-SEC-0.11.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Net-DNS-SEC-0.11.tar.gz
	cd Net-DNS-SEC-0.11
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	if [ ! -f /usr/lib/perl5/site_perl/5.8.1/Net/DNS/SEC.pm ] ; then exit; fi
	cd ../
	rm -rf Net-DNS-SEC-0.11
	logmessage2 "Done Perl Module Net::DNSSEC"

}

makewarscan072() {
	logmessage2 "Making warscan..."

	if [ ! -f $TPMSRCDIR/warscan-0.7.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/warscan-0.7.2.tar.gz

	cd warscan-0.7.2
	install -Dm 755 warscan /usr/bin/warscan

	if [ ! -f /usr/bin/warscan ] ; then exit; fi
	cd ..

	rm -rf warscan-0.7.2
	logmessage2 "Done warscan"
}


makewellenreiter() {
	logmessage2 "Making Wellenreiter..."

	if [ ! -f $TPMSRCDIR/Wellenreiter-v1.9.tar.gz ] ; then exit; fi

	cd wellenreiter
	tar -zxvf $TPMSRCDIR/Wellenreiter-v1.9.tar.gz
	install -Dm 755 warscan /usr/bin/w

	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}



makezodiac049() {
	logmessage2 "Making zodiac..."

	if [ ! -f $TPMSRCDIR/zodiac-0.4.9.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/zodiac-0.4.9.tar.gz

	cd zodiac
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}

makeclamav065() {
	logmessage2 "Making clamav..."

	if [ ! -f $TPMSRCDIR/clamav-0.65.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/clamav-0.65.tar.gz

	cd clamav-0.65
	./configure --prefix=/usr  --with-dbdir=/var/clamav
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/clamd ] ; then exit; fi
	cd ..

	rm -rf clamav-0.65
	logmessage2 "Done clamav"
}


makegtkperl07009() {
	logmessage2 "Making Gtk perl..."

	if [ ! -f $TPMSRCDIR/Gtk-Perl-0.7009.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/Gtk-Perl-0.7009.tar.gz

	cd Gtk-Perl-0.7009
	perl Makefile.PL --without-gnomeprint --without-gnome --without-glade --without-applets
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatbak ] ; then exit; fi
	cd ..

	rm -rf Gtk-Perl-0.7009
	logmessage2 "Done Gtkperl"
}


makefarpd02() {
	logmessage2 "Making farpd..."

	if [ ! -f $TPMSRCDIR/farpd_0.2.orig.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/farpd_0.2.orig.tar.gz

	cd farpd-0.2
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/arpd ] ; then exit; fi
	cd ..

	rm -rf farpd-0.2
	logmessage2 "Done farpd"
}

makeloginhacker11() {
	logmessage2 "Making login_hacker..."

	if [ ! -f $TPMSRCDIR/login_hacker-1.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/login_hacker-1.1.tar.gz

	cd login_hacker-1.1
	cp chatscript-connect.skeleton* /etc/minicom
	if [ $? -ne 0 ]; then exit -1; fi
	cp type*.scr /etc/minicom
	if [ $? -ne 0 ]; then exit -1; fi
	cp login_hacker /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	cp ppp_check /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	cp LICENCE* /license/

	if [ ! -f /usr/bin/ppp_check ] ; then exit; fi
	if [ ! -f /usr/bin/login_hacker ] ; then exit; fi
	cd ..

	rm -rf login_hacker-1.1
	logmessage2 "Done login_hacker"
}


makeicmpinfo111() {
	logmessage2 "Making icmpinfo..."

	if [ ! -f $TPMSRCDIR/icmpinfo-1.11.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/icmpinfo-1.11.tar.gz

	cat > icmpinfo.patch << "EOF"
diff -uNr icmpinfo-1.11.orig/Makefile icmpinfo-1.11/Makefile
--- icmpinfo-1.11.orig/Makefile	1995-08-17 10:44:54.000000000 +0000
+++ icmpinfo-1.11/Makefile	2004-01-26 08:53:20.000000000 +0000
@@ -14,6 +14,7 @@
 
 # To override default compiler flags :
 #CFLAGS=-O2 -s
+CFLAGS=-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -Ulinux
 
 # To change default compiler
 #CC=gcc
EOF

	cd icmpinfo-1.11
	patch -Np1 -i ../icmpinfo.patch
	make
	if [ $? -ne 0 ]; then exit -1; fi
	cp icmpinfo /usr/bin
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/icmpinfo ] ; then exit; fi
	cd ..

	rm -rf icmpinfo-1.11 icmpinfo.patch
	logmessage2 "Done icmpinfo"
}


makevomit02c() {
	logmessage2 "Making vomit..."

	if [ ! -f $TPMSRCDIR/vomit-0.2c.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/vomit-0.2c.tar.gz

	cd vomit-0.2c
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/vomit ] ; then exit; fi
	cd ..

	rm -rf vomit-0.2c
	logmessage2 "Done vomit"
}

maketcpslice11a3() {
	logmessage2 "Making tcpslice..."

	if [ ! -f $TPMSRCDIR/tcpslice.tar.Z ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tcpslice.tar.Z


	cat > tcpslice.patch << "EOF"
diff -uNr tcpslice-1.1a3.orig/tcpslice.c tcpslice-1.1a3/tcpslice.c
--- tcpslice-1.1a3.orig/tcpslice.c	1997-01-24 21:36:09.000000000 +0000
+++ tcpslice-1.1a3/tcpslice.c	2004-01-26 09:35:58.000000000 +0000
@@ -32,6 +32,7 @@
 
 #include <sys/types.h>
 #include <sys/time.h>
+#include <time.h>
 #include <sys/file.h>
 #include <sys/stat.h>
 
EOF

	cd tcpslice-1.1a3
	patch -Np1 -i ../tcpslice.patch
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/sbin/tcpslice ] ; then exit; fi
	cd ..

	rm -rf tcpslice-1.1a3
	logmessage2 "Done tcpslice"
}




makewipe220() {
	logmessage2 "Making wipe..."

	if [ ! -f $TPMSRCDIR/wipe-2.2.0.tar.bz2 ] ; then exit; fi
	bunzip2 -c $TPMSRCDIR/wipe-2.2.0.tar.bz2 |tar -xv

	cd wipe-2.2.0
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/wipe ] ; then exit; fi
	cd ..

	rm -rf wipe-2.2.0
	logmessage2 "Done wipe"
}


makeswatch308() {
	logmessage2 "Making swatch..."

	if [ ! -f $TPMSRCDIR/swatch-3.0.8.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/swatch-3.0.8.tar.gz

	cd swatch-3.0.8
	perl Makefile.PL
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/swatch ] ; then exit; fi
	cd ..

	rm -rf swatch-3.0.8
	logmessage2 "Done swatch"
}


#James working here
makefatback13() {
	logmessage2 "Making fatback..."

	if [ ! -f $TPMSRCDIR/fatback-1.3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/fatback-1.3.tar.gz

	cd fatback-1.3
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/fatback ] ; then exit; fi
	cd ..

	rm -rf fatback-1.3
	logmessage2 "Done fatback"
}


makecabextract06() {
	logmessage2 "Making cabextract..."

	if [ ! -f $TPMSRCDIR/cabextract-0.6.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/cabextract-0.6.tar.gz

	cd cabextract-0.6 
	./configure --prefix=/usr --without-x
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/cabextract ] ; then exit; fi
	cd ..

	rm -rf cabextract-0.6
	logmessage2 "Done cabextract"
}

makelibmcrypt257() {
	logmessage2 "Making libmcrypt..."

	if [ ! -f $TPMSRCDIR/libmcrypt-2.5.7.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/libmcrypt-2.5.7.tar.gz 

	cd libmcrypt-2.5.7
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/libmcrypt-config ] ; then exit; fi
	if [ ! -f /usr/lib/libmcrypt.so.4.4.7 ] ; then exit; fi
	cd ..

	rm -rf libmcrypt-2.5.7
	logmessage2 "Done libmcrypt"
}

makelibjpeg6b() {
	logmessage2 "Making libjpeg..."

	if [ ! -f $TPMSRCDIR/jpegsrc.v6b.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/jpegsrc.v6b.tar.gz

	cd jpeg-6b
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	cp libjpeg.a /usr/lib/
	cp jpeglib.h jerror.h jconfig.h jmorecfg.h /usr/include
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libjpeg.a ] ; then exit; fi
	if [ ! -f /usr/bin/jpegtran ] ; then exit; fi
	if [ ! -f /usr/bin/cjpeg ] ; then exit; fi
	if [ ! -f /usr/bin/djpeg ] ; then exit; fi
	if [ ! -f /usr/bin/rdjpgcom ] ; then exit; fi
	if [ ! -f /usr/bin/wrjpgcom ] ; then exit; fi
	cd ..

	rm -rf jpeg-6b
	logmessage2 "Done libjpeg"
}

makelibmhash0818() {
	logmessage2 "Making libmhash..."

	if [ ! -f $TPMSRCDIR/mhash-0.8.18.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mhash-0.8.18.tar.gz

	cd mhash-0.8.18
	./configure --prefix=/usr --enable-static
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/lib/libmhash.so.2.0.0 ] ; then exit; fi
	if [ ! -f /usr/lib/libmhash.a ] ; then exit; fi
	cd ..

	rm -rf mhash-0.8.18
	logmessage2 "Done libmhash"
}


makesteghide051() {
	logmessage2 "Making steghide..."

	if [ ! -f $TPMSRCDIR/steghide-0.5.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/steghide-0.5.1.tar.gz


	cat > steghide.patch << "EOF"
diff -uNr steghide-0.5.1.orig/src/Makefile.in steghide-0.5.1/src/Makefile.in
--- steghide-0.5.1.orig/src/Makefile.in	2003-10-15 08:01:29.000000000 +0000
+++ steghide-0.5.1/src/Makefile.in	2003-12-11 14:31:27.000000000 +0000
@@ -190,7 +190,7 @@
 WavPCMSampleValue.cc error.cc main.cc msg.cc SMDConstructionHeuristic.cc
 
 localedir = $(datadir)/locale
-LIBTOOL = $(SHELL) libtool
+LIBTOOL = libtool
 MAINTAINERCLEANFILES = Makefile.in
 subdir = src
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
EOF

	cd steghide-0.5.1
	patch -Np1 -i ../steghide.patch
	
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/steghide ] ; then exit; fi
	cd ..

	rm -rf steghide.patch steghide-0.5.1
	logmessage2 "Done steghide"
}

makestegdetect05() {
	logmessage2 "Making stegdetect..."

	if [ ! -f $TPMSRCDIR/stegdetect-0.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/stegdetect-0.5.tar.gz

	cd stegdetect
	
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/stegdetect ] ; then exit; fi
	cd ..

	rm -rf stegdetect
	logmessage2 "Done stegdetect"
}

makehttptunnel305() {
	logmessage2 "Making httptunnel..."

	if [ ! -f $TPMSRCDIR/httptunnel-3.0.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/httptunnel-3.0.5.tar.gz

	cd httptunnel-3.0.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi
	

	if [ ! -f /usr/bin/htc ] ; then exit; fi
	if [ ! -f /usr/bin/hts ] ; then exit; fi
	cd ..

	rm -rf httptunnel-3.0.5
	logmessage2 "Done httptunnel"
}

makemacrobber100() {
	logmessage2 "Making macrobber..."

	if [ ! -f $TPMSRCDIR/mac-robber-1.00.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mac-robber-1.00.tar.gz

	cd mac-robber-1.00
	make all
	if [ $? -ne 0 ]; then exit -1; fi
	cp mac-robber /usr/bin/

	if [ ! -f /usr/bin/mac-robber ] ; then exit; fi
	cd ..

	rm -rf mac-robber-1.00
	logmessage2 "Done macrobber"
}

#ftp://sunsite.unc.edu/pub/Linux/utils/text
makedos2unix() {
	logmessage2 "Making dos2unix..."

	if [ ! -f $TPMSRCDIR/dos2unix-3.0.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/dos2unix-3.0.tar.gz

	cd dos2unix-3.0
	gcc -O dos2unix.c -o dos2unix
	install -m 755 dos2unix /usr/bin
	install -m 644 dos2unix.1 /usr/man/man1
	cd /usr/bin
	ln -s dos2unix mac2unix
	cd /usr/man/man1
	ln -s dos2unix.1 mac2unix.1
	cd /
	rm -rf dos2unix-3.0

	logmessage2 "Done dos2unix"
}



#For some reason, this doesn't want to compile with the 2.4.23 headers
# so I borrow the 2.4.20 headers
makeiproute2247with2420() {
	logmessage2 "Making iproute..."
	if [ ! -f $TPMSRCDIR/iproute2-2.4.7-now-ss010824.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/config-2420-20031124 ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/linux-2.4.20.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/linux-2.4.20.tar.gz

	tar -zxvf $TPMSRCDIR/linux-2.4.20.tar.gz
	chown -R 0:0 linux-2.4.20
	cd linux-2.4.20
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper"; exit -1; fi
	make clean
	if [ $? -ne 0 ]; then echo "Error making clean"; exit -1; fi
	cp $TPMSRCDIR/config-2420-20031124 ./.config
	make oldconfig
	if [ $? -ne 0 ]; then echo "Error making oldconfig"; exit -1; fi
	make dep
	if [ $? -ne 0 ]; then echo "Error making dep"; exit -1; fi
	cd ..

	tar -zxvf $TPMSRCDIR/iproute2-2.4.7-now-ss010824.tar.gz


	cat > iproute.patch << "EOF"
diff -uNr iproute2.orig/Makefile iproute2/Makefile
--- iproute2.orig/Makefile	2001-08-02 06:37:03.000000000 +0000
+++ iproute2/Makefile	2003-12-07 23:04:31.000000000 +0000
@@ -1,5 +1,5 @@
 # Path to parent kernel include files directory
-KERNEL_INCLUDE=/usr/src/linux/include
+KERNEL_INCLUDE=/linux-2.4.20/include
 LIBC_INCLUDE=/usr/include
 
 DEFINES= -DRESOLVE_HOSTNAMES
@@ -27,7 +27,7 @@
   GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
 endif
 
-CC = gcc
+CC = gcc -s
 CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -Werror -g
 CFLAGS = $(CCOPTS) $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(DEFINES) 
EOF

	cd iproute2
	patch -Np1 -i ../iproute.patch	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	cp ip/ip /usr/sbin/ip
	cp ip/rtmon /usr/sbin/rtmon
	cp tc/tc /usr/sbin/tc
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/sbin/ip ] ; then exit; fi
	rm -rf iproute.patch iproute2-2.4.7-now-ss010824.tar.gz iproute2
	logmessage2 "Done iproute"
}

makestrace4498() {
	logmessage2 "Making strace..."
	cp $TPMSRCDIR/strace-4.4.98.tar.bz2 ./
	if [ ! -f strace-4.4.98.tar.bz2 ] ; then exit; fi
	bunzip2 -c strace-4.4.98.tar.bz2 | tar -xv
	cd strace-4.4.98
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi	
	make
	if [ $? -ne 0 ]; then exit -1; fi	
	make install
	if [ $? -ne 0 ]; then exit -1; fi	
	cd ..

	if [ ! -f /usr/bin/strace ] ; then exit; fi
	rm -rf strace-4.4.98 strace-4.4.98.tar.bz2
	logmessage2 "Done strace"
}

makexoranalyze() {
	logmessage2 "Making xor analyze..."
	cp $TPMSRCDIR/xor-analyze-0.5.tar.gz ./
	if [ ! -f xor-analyze-0.5.tar.gz ] ; then exit; fi
	tar -zxvf xor-analyze-0.5.tar.gz
	cd xor-analyze-0.5
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making xor analyze"; exit -1; fi	
	cp xor-enc /usr/bin/xor-enc
	cp xor-analyze /usr/bin/xor-analyze
	ln -s /usr/bin/xor-enc /usr/bin/xor-dec
	cd ..

	if [ ! -f /usr/bin/xor-analyze ] ; then exit; fi
	rm -rf xor-analyze-0.5 xor-analyze-0.5.tar.gz
	logmessage2 "Done xor-analyze"
}

makesharutils421() {
	logmessage2 "Making sharutils..."
	cp $TPMSRCDIR/sharutils-4.2.1.tar.gz ./
	if [ ! -f sharutils-4.2.1.tar.gz ] ; then exit; fi
	tar -zxvf sharutils-4.2.1.tar.gz
	cd sharutils-4.2.1
	./configure --prefix=/usr --disable-nls
	if [ $? -ne 0 ]; then logmessage2 "Error configuring sharutils"; exit -1; fi
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making sharutils"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error installing sharutils"; exit -1; fi
	cd ..

	if [ ! -f /usr/bin/uuencode ] ; then exit -1; fi
	if [ ! -f /usr/bin/uudecode ] ; then exit -1; fi
	rm -rf sharutils-4.2.1 sharutils-4.2.1.tar.gz
	logmessage2 "Done sharutils"
}

makesyslogng1526() {
	logmessage2 "Making syslog-ng..."
	cp $TPMSRCDIR/libol-0.3.9.tar.gz ./
	cp $TPMSRCDIR/syslog-ng-1.5.26.tar.gz ./
	if [ ! -f syslog-ng-1.5.26.tar.gz ] ; then exit; fi
	if [ ! -f libol-0.3.9.tar.gz ] ; then exit; fi
	tar -zxvf libol-0.3.9.tar.gz
	tar -zxvf syslog-ng-1.5.26.tar.gz
	cd libol-0.3.9
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then logmessage2 "Error configuring libol"; exit -1; fi
	make
	if [ $? -ne 0 ]; then logmessage2 "Error make libol"; exit -1; fi
	cd ..
	cd syslog-ng-1.5.26
	./configure --prefix=/usr --with-libol=/libol-0.3.9
	if [ $? -ne 0 ]; then logmessage2 "Error configuring syslog-ng"; exit -1; fi
	make
	if [ $? -ne 0 ]; then logmessage2 "Error make syslog-ng"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error installing syslog-ng"; exit -1; fi
	cd ..

	if [ ! -f /usr/sbin/syslog-ng ] ; then exit -1; fi
	
	rm -rf syslog-ng-1.5.26 syslog-ng-1.5.26.tar.gz
	rm -rf libol-0.3.9.tar.gz libol-0.3.9
	logmessage2 "Done syslog-ng"
}

makemrtg2105() {
	logmessage2 "Making mrtg..."
	if [ ! -f $TPMSRCDIR/mrtg-2.10.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mrtg-2.10.5.tar.gz
	cd mrtg-2.10.5
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/bin/mrtg ] ; then exit; fi
	cp doc/unix-guide.txt /readme/mrtg-unix-guide.txt
	cd ../
	rm -rf mrtg-2.10.5
	logmessage2 "Done mrtg"
}

makemrtg21013() {
	logmessage2 "Making mrtg..."
	if [ ! -f $TPMSRCDIR/mrtg-2.10.13.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/mrtg-2.10.13.tar.gz
	cd mrtg-2.10.13
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit -1; fi
	make
	if [ $? -ne 0 ]; then exit -1; fi
	make install
	if [ $? -ne 0 ]; then exit -1; fi

	if [ ! -f /usr/bin/mrtg ] ; then exit; fi
	cp doc/unix-guide.txt /readme/mrtg-unix-guide.txt
	cd ../
	rm -rf mrtg-2.10.13
	logmessage2 "Done mrtg"
}

cleanacx100source() {
	rm -vf /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
}


makeacx100source01b() {

	echo "Making acx100 source..."
	cp $TPMSRCDIR/acx100-0.1b_030706.tar.gz /
	cp $TPMSRCDIR/acx100_bin_20030626.tgz /
	if [ ! -f acx100-0.1b_030706.tar.gz ] ; then exit; fi
	if [ ! -f acx100_bin_20030626.tgz ] ; then exit; fi
	tar -zxvf acx100-0.1b_030706.tar.gz
	tar -zxvf acx100_bin_20030626.tgz
	cd  acx100-0.1b_030706

	mkdir 2.4.22
	cp 2.4.21-0.13mdk/acx100sta-2.4.20-8.o 2.4.20/acx100sta-2.4.20.o        
	cd 2.4.20

	echo -ne "kernel_version="`uname -r`"\0" >version
	objcopy --remove-section=.modinfo --add-section=.modinfo=version acx100sta-2.4.20.o

	cp acx100sta-2.4.20.o acx100sta.o
	chmod +x acx100sta.o

	cp -f acx100sta.o /lib/modules/`uname -r`/kernel/drivers/net/
	#/sbin/insmod /lib/modules/2.4.20/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ../..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ] ; then exit; fi
	rm -rf Acx100Drv acx100_bin_20030626.tgz acx100-0.1b_030706.tar.gz
	echo "Done"
}

makeacx100source01h() {

	logmessage2 "Making acx100 source..."
	makeacx100binary20030626
	makeacx100binary20030716

	cp $TPMSRCDIR/acx100-0.1h.tar.gz ./
	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ] ; then exit; fi
	
	if [ ! -f acx100-0.1h.tar.gz ] ; then exit; fi
	tar -zxvf acx100-0.1h.tar.gz
	cd  acx100/firmware
	cp /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o ./acx100_pci.o
	make extract_firmware
	if [ $? -ne 0 ]; then logmessage2 "Error extracting acx100 binary" ; exit; fi	
	cd ..
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making acx100 source" ; exit; fi	

	cp -f src/acx100_pci.o /lib/modules/`uname -r`/kernel/drivers/net/
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100_pci.o ] ; then exit; fi
	rm -rf acx100 acx100-0.1h.tar.gz
	logmessage2 "Done acx100 source"
}

makeacx100source02pre6() {

	logmessage2 "Making acx100 source..."
	makeacx100binary20030716

	cp $TPMSRCDIR/acx100-0.2.0pre6.tar.gz ./
	cp $TPMSRCDIR/dwl520+_driver_302.zip ./
	
	if [ ! -f acx100-0.2.0pre6.tar.gz ] ; then exit; fi
	if [ ! -f dwl520+_driver_302.zip ] ; then exit; fi
	tar -zxvf acx100-0.2.0pre6.tar.gz
	mkdir acx100-0.2.0pre6/firmware/temp
	cd acx100-0.2.0pre6/firmware/temp
	unzip ../../../dwl520+_driver_302.zip
	cp Win2000/WLANGEN.BIN Win2000/RADIO0d.BIN Win2000/RADIO11.BIN ../
	cd ..
	rm -rf temp
	cd ..

	cp README /license/acx100-README	
	make
	if [ $? -ne 0 ]; then logmessage2 "Error making acx100 source" ; exit; fi	

	cp -f src/acx100_pci.o /lib/modules/`uname -r`/kernel/drivers/net/
	#/sbin/insmod /lib/modules/`uname -r`/kernel/drivers/net/acx100sta.o
	#if [ $? -ne 0 ]; then exit; fi	
	cd ..

	if [ ! -f /lib/modules/`uname -r`/kernel/drivers/net/acx100_pci.o ] ; then exit; fi
	rm -rf acx100-0.2.0pre6 acx100-0.2.0pre6.tar.gz dwl520+_driver_302.zip
	logmessage2 "Done acx100 source"
}


makelibevent() {
	echo "Making libevent..."
	if [ ! -f libevent-0.7a.tar.gz ] ; then exit; fi
	tar -zxvf libevent-0.7a.tar.gz
	cd libevent-0.7a
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cd ../

	if [ ! -f /usr/lib/libevent.a ] ; then exit; fi
	rm -rf libevent-0.7a
	echo "Done"
}

cleanfragroute() {
	rm -vf  /usr/sbin/fragroute /usr/sbin/fragtest
	rm -rvf /etc/fragroute/
	rm -vf /license/fragroute-LICENSE
}

makefragroute() {
	cleanfragroute
	makelibevent
	logmessage2 "Making fragroute..."
	if [ ! -f fragroute-1.2.tar.gz ] ; then exit; fi
	tar -zxvf fragroute-1.2.tar.gz
	cd fragroute-1.2

	./configure --prefix=/usr --sysconfdir=/etc/fragroute

	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	cp LICENSE /license/fragroute-LICENSE
	cd ../

	if [ ! -f /usr/sbin/fragroute ] ; then exit; fi
	if [ ! -f /usr/sbin/fragtest ] ; then exit; fi
	rm -rf fragroute-1.2
	logmessage2 "Done fragroute"
}

cleantcsh() {
	rm -f /usr/bin/tcsh /usr/man/man1/tcsh.1
}

maketcsh() {
	logmessage2 "Making tcsh..."
	if [ ! -f $TPMSRCDIR/tcsh-6.12.00.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/tcsh-6.12.00.tar.gz
	cd tcsh-6.12.00

	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	make install.man
	if [ $? -ne 0 ]; then exit; fi
	cd ../

	if [ ! -f /usr/bin/tcsh ] ; then exit; fi
	ln -s tcsh /usr/bin/csh
	rm -rf tcsh-6.12.00
	logmessage2 "Done tcsh"
}

cleanarpwatch() {
	rm -rvf /usr/sbin/arpsnmp /usr/sbin/arpwatch	
}

makearpwatch() {
	logmessage2 "Making arpwatch..."
	if [ ! -f $TPMSRCDIR/arpwatch.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/arpwatch.tar.gz
	cd arpwatch-2.1a11
	./configure --prefix=/usr
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	make install-man
	cd ../

	if [ ! -f /usr/sbin/arpwatch ] ; then exit; fi
	rm -rf arpwatch-2.1a11
	logmessage2 "Done arpwatch"
}


makesara() {
	logmessage2 "Making sara..."
	if [ ! -f $TPMSRCDIR/sara-4.2.1b.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/sara-4.2.1b.tgz
	cd sara-4.2.1b
	./configure --prefix=/usr
	make
	if [ $? -ne 0 ]; then exit; fi
	cp COPYING /license/sara-COPYING
	cp bin/* /usr/bin
	cp lib/* /usr/lib
	cd ../
	mv sara-4.2.1b /usr

	if [ ! -f /usr/sara-4.2.1b/sara ] ; then exit; fi
	logmessage2 "Done sara"
}




cleansvgatextmode() {
	rm -vf /usr/sbin/SVGATextMode /usr/sbin/stm/SVGATextMode
	rm -vf /usr/sbin/grabmode /usr/sbin/clockprobe
        rm -vf /usr/man/man8/SVGATextMode.8.gz
        rm -vf /usr/man/man8/stm.8.gz
        rm -vf /usr/man/man5/TextConfig.5.gz
        rm -vf /usr/man/man8/grabmode.8.gz
        rm -vf /usr/man/man8/clockprobe.8.gz

}

makesvgatextmode() {
	cleansvgatextmode
	echo "Making svgatextmode..."
	if [ ! -f SVGATextMode-1.10-src.tar.gz ] ; then exit; fi
	tar -zxvf SVGATextMode-1.10-src.tar.gz

	cd SVGATextMode-1.10
	OLDPATH=$PATH
	PATH=/usr/local/bison-1.35/bin:$PATH;export PATH
	make
	if [ $? -ne 0 ]; then exit; fi
	echo "Finished make"
	make install
	if [ $? -ne 0 ]; then exit; fi
	echo "Finished make install"
	cd ../
	PATH=$OLDPATH;export PATH
	if [ ! -f /usr/sbin/SVGATextMode ] ; then exit; fi
	rm -rf SVGATextMode-1.10
	echo "Done"
}


#Files:
# /usr/bin/chntpw
#Directories:
# /usr/docs/chntpw
makechntpw() {
	logmessage2 "Making chntpw..."
	if [ ! -f chntpw-source-030126.zip ] ; then exit; fi

	cat > chntpw.patch << "EOF"
diff -uNr chntpw.orig/chntpw.c chntpw/chntpw.c
--- chntpw.orig/chntpw.c	2003-01-26 20:09:07.000000000 +0000
+++ chntpw/chntpw.c	2003-06-30 16:58:09.000000000 +0000
@@ -105,7 +105,6 @@
 
 void str_to_key(unsigned char *str,unsigned char *key)
 {
-	void des_set_odd_parity(des_cblock *);
 	int i;
 
 	key[0] = str[0]>>1;
EOF
	mkdir chntpw
	cd chntpw
	unzip ../chntpw-source-030126.zip
	patch -Np1 -i ../chntpw.patch

	gcc -c -DUSEOPENSSL -g -L/usr/ssl/lib -I. -I/usr/ssl/include -I/usr/include -Wall chntpw.c 
	if [ $? -ne 0 ]; then exit; fi
	gcc -c -DUSEOPENSSL -g -L/usr/ssl/lib -I. -I/usr/ssl/include -I/usr/include -Wall ntreg.c
	if [ $? -ne 0 ]; then exit; fi
	gcc -DUSEOPENSSL -g -L/usr/ssl/lib -I. \
-I/usr/ssl/include -I/usr/include -Wall -nostdlib -o chntpw chntpw.o \
ntreg.o -L/usr/lib \
/usr/ssl/lib/libcrypto.a /usr/lib/crt1.o /usr/lib/crti.o \
/usr/lib/libc.so /usr/lib/crtn.o

	if [ ! -f ./chntpw ] ; then exit; fi
	mkdir -p /usr/docs/chntpw
	cp chntpw /usr/bin
	cp *.txt /usr/docs/chntpw/
	cp COPYING.txt /license/chntpw-COPYING.txt
	cd ../
	rm -rf chntpw chntpw.patch
	logmessage2 "Done chntpw"
}




cleandig() {
	
	rm -vf /license/bind-COPYRIGHT
}

# Dig (comes with Bind 9.2.2)
# 
makedig() {
	echo "Making dig..."
	cleandig
	if [ ! -f bind-9.2.2.tar.gz  ] ; then exit; fi
	tar -zxvf bind-9.2.2.tar.gz
	cd bind-9.2.2
	./configure --prefix=/usr --sysconfdir=/etc/bind --with-openssl=/usr/ssl
	make
	cd bin/dig
	make install
	cd ../..
	cp COPYRIGHT /license/bind-COPYRIGHT
	cd ../
	if [ ! -f /usr/bin/dig ] ; then exit; fi
	rm -rf bind-9.2.2
	mkdir /etc/bind
	echo "Done"
}


# Nikto 1.23
# 620KB
makenikto() {
	logmessage2 "Making nikto..."
	if [ ! -f nikto-current.tar.gz  ] ; then exit; fi
	tar -zxvf nikto-current.tar.gz
	cp nikto-1.23/docs/LICENSE.txt /license/nikto-LICENSE.txt
	mv nikto-1.23 /usr/nikto
	logmessage2 "Done nikto"
}

cleannetcat() {
	rm -rf /usr/bin/nc
}

# NetCat 1.10
# 464KB
makenetcat() {
	logmessage2 "Making netcat..."
	if [ ! -f $TPMSRCDIR/nc110.tgz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/netcat-1.10.patch ] ; then exit; fi
	mkdir netcat-1.10
	cd netcat-1.10
	tar -zxvf $TPMSRCDIR/nc110.tgz
	patch -Np1 -i $TPMSRCDIR/netcat-1.10.patch
	make linux
	cp nc /usr/bin
	cd ..
	if [ ! -f /usr/bin/nc ] ; then exit; fi
	rm -rf netcat-1.10
	logmessage2 "Done netcat"
}

cleandhcpcd() {
	rm -rvf /etc/dhcpc /sbin/dhcpcd
}

makedhcpcd() {
	logmessage2 "Making dhcpcd..."
	if [ ! -f $TPMSRCDIR/dhcpcd-1.3.22-pl4.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/dhcpcd-1.3.22-pl4.tar.gz
	cd dhcpcd-1.3.22-pl4
	./configure --prefix=/
	make
	make install
	cd ..
	if [ ! -d /etc/dhcpc ] ; then exit; fi
	if [ ! -f /sbin/dhcpcd ] ; then exit; fi
	rm -rf dhcpcd-1.3.22-pl4
	logmessage2 "Done dhcpcd"
}

cleanminicom() {
	rm -rvf /etc/minicom
	rm -vf /license/minicom-COPYING
}

# Make minicom 2.1
# 636KB
makeminicom() {
	logmessage2 "Making minicom..."
	if [ ! -f $TPMSRCDIR/minicom-2.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/minicom-2.1.tar.gz
	cd minicom-2.1
	./configure --prefix=/usr --sysconfdir=/etc/minicom --localstatedir=/var
	make
	make install
	cp COPYING /license/minicom-COPYING

	cd ..
	if [ ! -f /usr/bin/minicom ] ; then exit; fi
	rm -rf minicom-2.1
	mkdir /etc/minicom
	cat > /etc/minicom/minirc._dev_cua_0 << "EOF"
# Machine-generated file - use "minicom -s" to change parameters.
pr port             /dev/cua/0
pu baudrate         9600
pu bits             8
pu parity           N
pu stopbits         1
pu minit            
pu mreset           
pu mdialpre         
pu mdialsuf         
pu mdialpre2        
pu mdialsuf2        
pu mdialpre3        
pu mdialsuf3        
pu mconnect         CONNECT
pu rtscts           No 
EOF

	cat > /etc/minicom/minirc._dev_cua_1 << "EOF"
# Machine-generated file - use "minicom -s" to change parameters.
pr port             /dev/cua/1
pu baudrate         9600
pu bits             8
pu parity           N
pu stopbits         1
pu minit            
pu mreset           
pu mdialpre         
pu mdialsuf         
pu mdialpre2        
pu mdialsuf2        
pu mdialpre3        
pu mdialsuf3        
pu mconnect         CONNECT
pu rtscts           No 
EOF

	logmessage2 "Done minicom"
}



makeppp242b3() {
	logmessage2 "Making ppp..."
	if [ ! -f $TPMSRCDIR/ppp-2.4.2b3.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/ppp-2.4.2b3.tar.gz
	cd ppp-2.4.2b3

	./configure
	make
	make install
	cd ..
	if [ ! -f /usr/sbin/pppd ] ; then exit; fi

	cat > /etc/ppp/pap-secrets << "EOF"
#User                   #Server         #Password       #IP
#bxxxxx@sympatico.ca     *               my_password     *
EOF

	cat > /etc/rc.d/init.d/pppd << "EOF"
#!/bin/sh
. /etc/rc.d/init.d/functions


case "$1" in
  start|--start)
	if [ ! -e /dev/ppp ] ; then
		mknod /dev/ppp c 108 0
	fi
	/usr/sbin/pppd
	;;


  stop|--stop)
	pkill pppd
	;;


  *)
	echo "Usage: pppd {start|stop}" >&2
	exit 2
esac

exit 0
EOF
	chmod 4755 /usr/sbin/pppd
	rm -rf ppp-2.4.2b3
	logmessage2 "Done ppp"
}

makeppp241() {
        logmessage2 "Making ppp..."
        if [ ! -f ppp-2.4.1.tar.gz ] ; then exit; fi
        tar -zxvf ppp-2.4.1.tar.gz
        cd ppp-2.4.1

        ./configure
        make
        make install
        cd ..
        if [ ! -f /usr/sbin/pppd ] ; then exit; fi
        rm -rf ppp-2.4.1.tar
        logmessage2 "Done ppp"
}


cleanrp() {
	rm -vf /etc/ppp/plugins/rp-pppoe.so /etc/ppp/plugins/README
	rm -vf /etc/ppp/pppoe-server-options
	rm -vf /etc/ppp/pppoe.conf
}

# rp-pppoe 3.5
# 276KB
makerp() {
	makeppp242b3
	logmessage2 "Making roaring pengiun..."
	if [ ! -f rp-pppoe-3.5.tar.gz ] ; then exit; fi
	tar -zxvf rp-pppoe-3.5.tar.gz
	cd rp-pppoe-3.5/src

	#With the 2.4.22 header files, the kernel mode ppp won't compile
	./configure --prefix=/usr --enable-plugin=/ppp-2.4.2b3
	#./configure --prefix=/usr --enable-plugin="/ppp-2.4.2b3 -I/linux-2.4.20/include"
	if [ $? -ne 0 ] ; then echo "Error configuring roaring pengiun"; exit -1; fi
	make
	if [ $? -ne 0 ] ; then echo "Error making roaring pengiun"; exit -1; fi
	make install
	if [ $? -ne 0 ] ; then echo "Error installing roaring pengiun"; exit -1; fi

	#Edit /etc/ppp/pppoe.conf to include this line:
	#/etc/ppp/pppoe.conf
	cd ../..
	if [ ! -f /usr/sbin/pppoe ] ; then exit; fi
	rm -rf rp-pppoe-3.5
	rm -rf ppp-2.4.1 ppp-2.4.2b3

	logmessage2 "Done roaring pengiun"
	#adsl-setup
}

# rp-pppoe 3.5
# 276KB
#
#Due to problems compiling with 2.4.23, I have not compiled kernel plugins
makerp35with2423() {
	logmessage2 "Making roaring pengiun..."
	if [ ! -f $TPMSRCDIR/rp-pppoe-3.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/rp-pppoe-3.5.tar.gz
	cd rp-pppoe-3.5/src

	#With the 2.4.22 header files, the kernel mode ppp won't compile
	./configure --prefix=/usr
	#./configure --prefix=/usr --enable-plugin=/ppp-2.4.2b3
	#./configure --prefix=/usr --enable-plugin="/ppp-2.4.2b3 -I/linux-2.4.20/include"
	if [ $? -ne 0 ] ; then echo "Error configuring roaring pengiun"; exit -1; fi
	make
	if [ $? -ne 0 ] ; then echo "Error making roaring pengiun"; exit -1; fi
	make install
	if [ $? -ne 0 ] ; then echo "Error installing roaring pengiun"; exit -1; fi

	#Edit /etc/ppp/pppoe.conf to include this line:
	#/etc/ppp/pppoe.conf
	cd ../..
	if [ ! -f /usr/sbin/pppoe ] ; then exit; fi
	rm -rf rp-pppoe-3.5
	rm -rf ppp-2.4.1 ppp-2.4.2b3

	logmessage2 "Done roaring pengiun"
	#adsl-setup
}

# rp-pppoe 3.5
# 276KB
makerp35with2421() {
	makeppp242b3
	logmessage2 "Making roaring pengiun..."
	if [ ! -f $TPMSRCDIR/rp-pppoe-3.5.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/rp-pppoe-3.5.tar.gz
	cd rp-pppoe-3.5/src

	#With the 2.4.22 header files, the kernel mode ppp won't compile
	#./configure --prefix=/usr --enable-plugin=/ppp-2.4.2b3
	./configure --prefix=/usr --enable-plugin="/ppp-2.4.2b3 -I/linux-2.4.20/include"
	if [ $? -ne 0 ] ; then echo "Error configuring roaring pengiun"; exit -1; fi
	make
	if [ $? -ne 0 ] ; then echo "Error making roaring pengiun"; exit -1; fi
	make install
	if [ $? -ne 0 ] ; then echo "Error installing roaring pengiun"; exit -1; fi

	#Edit /etc/ppp/pppoe.conf to include this line:
	#/etc/ppp/pppoe.conf
	cd ../..
	if [ ! -f /usr/sbin/pppoe ] ; then exit; fi
	rm -rf rp-pppoe-3.5
	rm -rf ppp-2.4.1 ppp-2.4.2b3

	logmessage2 "Done roaring pengiun"
	#adsl-setup
}

# rp-pppoe 3.5
makerp35with2420() {
	makeppp242b3
	logmessage2 "Making roaring pengiun..."
	if [ ! -f rp-pppoe-3.5.tar.gz ] ; then exit; fi
	tar -zxvf rp-pppoe-3.5.tar.gz
	cd rp-pppoe-3.5/src

	./configure --prefix=/usr --enable-plugin=/ppp-2.4.2b3
	if [ $? -ne 0 ] ; then echo "Error configuring roaring pengiun"; exit -1; fi
	make
	if [ $? -ne 0 ] ; then echo "Error making roaring pengiun"; exit -1; fi
	make install
	if [ $? -ne 0 ] ; then echo "Error installing roaring pengiun"; exit -1; fi

	#Edit /etc/ppp/pppoe.conf to include this line:
	#/etc/ppp/pppoe.conf
	cd ../..
	if [ ! -f /usr/sbin/pppoe ] ; then exit; fi
	rm -rf rp-pppoe-3.5
	rm -rf ppp-2.4.1 ppp-2.4.2b3

	logmessage2 "Done roaring pengiun"
	#adsl-setup
}

cleangmp() {
	rm -vf /usr/lib/libgmp.la /usr/lib/libgmp.so
	rm -vf /usr/lib/libgmp.so.3 /usr/lib/libgmp.so.3.3.2

	rm -vf /license/COPYING.LIB
}

# GMP 4.1.2
# 4,732KB
#
# I've compiled several versions of libgmp.  The default is for the 386
# so the CD will work for anyone right away.  However, to get a 
# performance boost, I'll have an init script detect the processor and
# update the ldconfig to point to the appropriate directory.
#
makegmp() {
	logmessage2 "Making gmp..."
	if [ ! -f $TPMSRCDIR/gmp-4.1.2.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gmp-4.1.2.tar.gz

	logmessage2 "Making gmp for i386..."
	cd gmp-4.1.2
	./configure --prefix=/usr --libdir=/usr/lib/libgmp-i386 --host=i386-pc-linux-gnu --enable-static=yes 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make
	make install
	cp COPYING.LIB /license
	cd ../
	if [ ! -f /usr/lib/libgmp-i386/libgmp.so.3.3.2 ] ; then exit; fi
	rm -rf gmp-4.1.2

	logmessage2 "Making gmp for i486..."
	tar -zxvf $TPMSRCDIR/gmp-4.1.2.tar.gz
	cd gmp-4.1.2
	./configure --prefix=/usr --libdir=/usr/lib/libgmp-i486 --host=i486-pc-linux-gnu --enable-static=no 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make
	make install
	cp COPYING.LIB /license
	cd ../
	if [ ! -f /usr/lib/libgmp-i486/libgmp.so.3.3.2 ] ; then exit; fi


	logmessage2 "Making gmp for pentium..."
	tar -zxvf $TPMSRCDIR/gmp-4.1.2.tar.gz
	cd gmp-4.1.2
	./configure --prefix=/usr --libdir=/usr/lib/libgmp-pentium --host=pentium-pc-linux-gnu --enable-static=no 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make
	make install
	cp COPYING.LIB /license
	cd ../
	if [ ! -f /usr/lib/libgmp-pentium/libgmp.so.3.3.2 ] ; then exit; fi


	logmessage2 "Making gmp for pentium4..."
	tar -zxvf $TPMSRCDIR/gmp-4.1.2.tar.gz
	cd gmp-4.1.2
	./configure --prefix=/usr --libdir=/usr/lib/libgmp-pentium4 --host=pentium4-pc-linux-gnu --enable-static=no 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	make
	make install
	cp COPYING.LIB /license
	cd ../
	if [ ! -f /usr/lib/libgmp-pentium4/libgmp.so.3.3.2 ] ; then exit; fi



	ln -s /usr/lib/libgmp-i386/libgmp.a /usr/lib
	rm -rf gmp-4.1.2
	ldconfig
	logmessage2 "Done gmp"
}

cleaniptables() {
	rm -vf /usr/sbin/iptables	
}

makeiptables129with2424() {
	logmessage2 "Making iptables..."
	
	bunzip2 -c $TPMSRCDIR/iptables-1.2.9.tar.bz2 > iptables-1.2.9.tar
	if [ ! -f iptables-1.2.9.tar ] ; then exit; fi
	tar -xvf iptables-1.2.9.tar
	cd iptables-1.2.9
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.24
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.24 install

	if [ ! -f /usr/sbin/iptables ] ; then exit; fi
	cd ../
	rm -rf iptables-1.2.9 iptables-1.2.9.tar 
	logmessage2 "Done iptables"
}


makeiptables129with2423() {
	logmessage2 "Making iptables..."
	
	bunzip2 -c $TPMSRCDIR/iptables-1.2.9.tar.bz2 > iptables-1.2.9.tar
	if [ ! -f iptables-1.2.9.tar ] ; then exit; fi
	tar -xvf iptables-1.2.9.tar
	cd iptables-1.2.9
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.23
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.23 install

	if [ ! -f /usr/sbin/iptables ] ; then exit; fi
	cd ../
	rm -rf iptables-1.2.9 iptables-1.2.9.tar 
	logmessage2 "Done iptables"
}

makeiptables() {
	logmessage2 "Making iptables..."
	cleaniptables
	bunzip2 -c iptables-1.2.8.tar.bz2 > iptables-1.2.8.tar
	if [ ! -f iptables-1.2.8.tar ] ; then exit; fi
	tar -xvf iptables-1.2.8.tar
	cd iptables-1.2.8
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.22
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.22 install

	if [ ! -f /usr/sbin/iptables ] ; then exit; fi
	cd ../
	rm -rf iptables-1.2.8 iptables-1.2.8.tar 
	logmessage2 "Done iptables"
}

makeiptableswith2420() {
	logmessage2 "Making iptables..."
	cleaniptables
	bunzip2 -c iptables-1.2.8.tar.bz2 > iptables-1.2.8.tar
	if [ ! -f iptables-1.2.8.tar ] ; then exit; fi
	tar -xvf iptables-1.2.8.tar
	cd iptables-1.2.8
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.20
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.20 install

	if [ ! -f /usr/sbin/iptables ] ; then exit; fi
	cd ../
	rm -rf iptables-1.2.8 iptables-1.2.8.tar 
	logmessage2 "Done iptables"
}

makeiptables128with2421() {
	logmessage2 "Making iptables..."
	cleaniptables
	bunzip2 -c iptables-1.2.8.tar.bz2 > iptables-1.2.8.tar
	if [ ! -f iptables-1.2.8.tar ] ; then exit; fi
	tar -xvf iptables-1.2.8.tar
	cd iptables-1.2.8
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.21
	make BINDIR=/usr/sbin LIBDIR=/usr/lib MANDIR=/usr/man KERNEL_DIR=/linux-2.4.21 install

	if [ ! -f /usr/sbin/iptables ] ; then exit; fi
	cd ../
	rm -rf iptables-1.2.8 iptables-1.2.8.tar 
	logmessage2 "Done iptables"
}

cleanfinger() {
	rm -vf /usr/bin/finger
}

makefinger() {
	logmessage2 "Making finger..."
	if [ ! -f $TPMSRCDIR/bsd-finger-0.17.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/bsd-finger-0.17.patch ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/bsd-finger-0.17.tar.gz
	cd bsd-finger-0.17
	patch -Np1 -i $TPMSRCDIR/bsd-finger-0.17.patch
	./configure
	make
	make install
	cd ../
	if [ ! -f /usr/bin/finger ] ; then exit; fi
	rm -rf bsd-finger-0.17
	logmessage2 "Done finger"
}

cleanwhois() {
	rm -vf /usr/bin/whois
}

makewhois() {
	echo "Making whois..."
	cleanwhois
	if [ ! -f whois_4.6.5.tar.gz ] ; then exit; fi
	tar -zxvf whois_4.6.5.tar.gz
	cd whois-4.6.5
	make
	make prefix=/usr install
	cd ../
	if [ ! -f /usr/bin/whois ] ; then exit; fi
	rm -rf whois-4.6.5
	echo "Done"
}


# TCT 1.12
maketct112() {
	logmessage2 "Making tct..."
	if [ ! -f $TPMSRCDIR/tct-1.12.tar.gz ] ; then exit; fi
	cd /usr
	tar -zxvf $TPMSRCDIR/tct-1.12.tar.gz
	cd tct-1.12
	make
	cp LICENSE /license/tct-LICENSE
	cd /
	if [ ! -f /usr/tct-1.12/bin/unrm ] ; then exit; fi
	logmessage2 "Done tct"
}

cleanhunt() {
	rm -rvf /usr/bin/hunt	
}

# Hunt 1.5
# 112KB
makehunt() {
	logmessage2 "Making hunt..."
	cleanhunt
	if [ ! -f hunt-1.5.tgz ] ; then exit; fi
	tar -zxvf hunt-1.5.tgz
	cd hunt-1.5
	make
	if [ ! -x hunt ] ; then exit; fi
	cp hunt /usr/bin
	cd ../
	rm -rf hunt-1.5
	logmessage2 "Done hunt"
}


cleannetsnmp() {
	rm -vf /usr/bin/encode_keychange
	rm -vf /usr/bin/fixproc
	rm -vf /usr/bin/ipf-mod.pl
	rm -vf /usr/bin/mib2c
	rm -vf /usr/bin/net-snmp-config
	rm -vf /usr/bin/snmpbulkget
	rm -vf /usr/bin/snmpbulkwalk
	rm -vf /usr/bin/snmpcheck
	rm -vf /usr/bin/snmpconf
	rm -vf /usr/bin/snmpdelta
	rm -vf /usr/bin/snmpdf
	rm -vf /usr/bin/snmpget
	rm -vf /usr/bin/snmpgetnext
	rm -vf /usr/bin/snmpinform
	rm -vf /usr/bin/snmpnetstat
	rm -vf /usr/bin/snmpset
	rm -vf /usr/bin/snmpstatus
	rm -vf /usr/bin/snmptable
	rm -vf /usr/bin/snmptest
	rm -vf /usr/bin/snmptranslate
	rm -vf /usr/bin/snmptrap
	rm -vf /usr/bin/snmpusm
	rm -vf /usr/bin/snmpvacm
	rm -vf /usr/bin/snmpwalk
	rm -vf /usr/bin/tkmib
	rm -vf /usr/bin/traptoemail
	rm -rvf /usr/include/net-snmp
	rm -vf /usr/lib/libnetsnmp.la
	rm -vf /usr/lib/libnetsnmp.so
	rm -vf /usr/lib/libnetsnmp.so.5
	rm -vf /usr/lib/libnetsnmp.so.5.0.8
	rm -vf /usr/lib/libnetsnmpagent.la
	rm -vf /usr/lib/libnetsnmpagent.so
	rm -vf /usr/lib/libnetsnmpagent.so.5
	rm -vf /usr/lib/libnetsnmpagent.so.5.0.8
	rm -vf /usr/lib/libnetsnmphelpers.la
	rm -vf /usr/lib/libnetsnmphelpers.so
	rm -vf /usr/lib/libnetsnmphelpers.so.5
	rm -vf /usr/lib/libnetsnmphelpers.so.5.0.8
	rm -vf /usr/lib/libnetsnmpmibs.la
	rm -vf /usr/lib/libnetsnmpmibs.so
	rm -vf /usr/lib/libnetsnmpmibs.so.5
	rm -vf /usr/lib/libnetsnmpmibs.so.5.0.8
	rm -vf /usr/sbin/snmpd
	rm -vf /usr/sbin/snmptrapd
	rm -vf /usr/man/man1/mib2c.1
	rm -vf /usr/man/man1/snmpbulkget.1
	rm -vf /usr/man/man1/snmpbulkwalk.1
	rm -vf /usr/man/man1/snmpcmd.1
	rm -vf /usr/man/man1/snmpconf.1
	rm -vf /usr/man/man1/snmpdelta.1
	rm -vf /usr/man/man1/snmpdf.1
	rm -vf /usr/man/man1/snmpget.1
	rm -vf /usr/man/man1/snmpgetnext.1
	rm -vf /usr/man/man1/snmpinform.1
	rm -vf /usr/man/man1/snmpnetstat.1
	rm -vf /usr/man/man1/snmpset.1
	rm -vf /usr/man/man1/snmpstatus.1
	rm -vf /usr/man/man1/snmptable.1
	rm -vf /usr/man/man1/snmptest.1
	rm -vf /usr/man/man1/snmptranslate.1
	rm -vf /usr/man/man1/snmptrap.1
	rm -vf /usr/man/man1/snmpusm.1
	rm -vf /usr/man/man1/snmpwalk.1
	rm -vf /usr/man/man3/add_mibdir.3
	rm -vf /usr/man/man3/add_module_replacement.3
	rm -vf /usr/man/man3/default_store.3
	rm -vf /usr/man/man3/get_module_node.3
	rm -vf /usr/man/man3/init_mib.3
	rm -vf /usr/man/man3/init_mib_internals.3
	rm -vf /usr/man/man3/mib_api.3
	rm -vf /usr/man/man3/netsnmp_agent.3
	rm -vf /usr/man/man3/netsnmp_bulk_to_next.3
	rm -vf /usr/man/man3/netsnmp_debug.3
	rm -vf /usr/man/man3/netsnmp_example_scalar_int.3
	rm -vf /usr/man/man3/netsnmp_handler.3
	rm -vf /usr/man/man3/netsnmp_instance.3
	rm -vf /usr/man/man3/netsnmp_library.3
	rm -vf /usr/man/man3/netsnmp_mib_handler_methods.3
	rm -vf /usr/man/man3/netsnmp_mib_utilities.3
	rm -vf /usr/man/man3/netsnmp_mode_end_call.3
	rm -vf /usr/man/man3/netsnmp_multiplexer.3
	rm -vf /usr/man/man3/netsnmp_old_api.3
	rm -vf /usr/man/man3/netsnmp_read_only.3
	rm -vf /usr/man/man3/netsnmp_scalar.3
	rm -vf /usr/man/man3/netsnmp_serialize.3
	rm -vf /usr/man/man3/netsnmp_table.3
	rm -vf /usr/man/man3/netsnmp_table_array.3
	rm -vf /usr/man/man3/netsnmp_table_data.3
	rm -vf /usr/man/man3/netsnmp_table_dataset.3
	rm -vf /usr/man/man3/netsnmp_table_iterator.3
	rm -vf /usr/man/man3/netsnmp_todo.3
	rm -vf /usr/man/man3/netsnmp_watcher.3
	rm -vf /usr/man/man3/print_description.3
	rm -vf /usr/man/man3/print_mib.3
	rm -vf /usr/man/man3/print_objid.3
	rm -vf /usr/man/man3/print_value.3
	rm -vf /usr/man/man3/print_variable.3
	rm -vf /usr/man/man3/read_all_mibs.3
	rm -vf /usr/man/man3/read_config.3
	rm -vf /usr/man/man3/read_mib.3
	rm -vf /usr/man/man3/read_module.3
	rm -vf /usr/man/man3/read_module_node.3
	rm -vf /usr/man/man3/read_objid.3
	rm -vf /usr/man/man3/shutdown_mib.3
	rm -vf /usr/man/man3/snmp_agent_api.3
	rm -vf /usr/man/man3/snmp_alarm.3
	rm -vf /usr/man/man3/snmp_api.3
	rm -vf /usr/man/man3/snmp_api_errstring.3
	rm -vf /usr/man/man3/snmp_close.3
	rm -vf /usr/man/man3/snmp_error.3
	rm -vf /usr/man/man3/snmp_free_pdu.3
	rm -vf /usr/man/man3/snmp_open.3
	rm -vf /usr/man/man3/snmp_perror.3
	rm -vf /usr/man/man3/snmp_read.3
	rm -vf /usr/man/man3/snmp_select_info.3
	rm -vf /usr/man/man3/snmp_send.3
	rm -vf /usr/man/man3/snmp_sess_api.3
	rm -vf /usr/man/man3/snmp_sess_async_send.3
	rm -vf /usr/man/man3/snmp_sess_close.3
	rm -vf /usr/man/man3/snmp_sess_error.3
	rm -vf /usr/man/man3/snmp_sess_init.3
	rm -vf /usr/man/man3/snmp_sess_open.3
	rm -vf /usr/man/man3/snmp_sess_perror.3
	rm -vf /usr/man/man3/snmp_sess_read.3
	rm -vf /usr/man/man3/snmp_sess_select_info.3
	rm -vf /usr/man/man3/snmp_sess_send.3
	rm -vf /usr/man/man3/snmp_sess_session.3
	rm -vf /usr/man/man3/snmp_sess_timeout.3
	rm -vf /usr/man/man3/snmp_set_mib_warnings.3
	rm -vf /usr/man/man3/snmp_set_save_descriptions.3
	rm -vf /usr/man/man3/snmp_timeout.3
	rm -vf /usr/man/man3/snmp_trap_api.3
	rm -vf /usr/man/man5/snmp.conf.5
	rm -vf /usr/man/man5/snmp_config.5
	rm -vf /usr/man/man5/snmpd.conf.5
	rm -vf /usr/man/man5/snmptrapd.conf.5
	rm -vf /usr/man/man5/variables.5
	rm -vf /usr/man/man8/snmpd.8
	rm -vf /usr/man/man8/snmptrapd.8

	rm -vf /license/netsnmp-COPYING /var/log/snmpd.log
	rm -rvf /var/net-snmp
}

# Net-SNMP 5.0.8
# 6,796KB
makenetsnmp() {
	logmessage2 "Making netsnmp..."
	cleannetsnmp
	if [ ! -f net-snmp-5.0.8.tar.gz ] ; then exit; fi
	tar -zxvf net-snmp-5.0.8.tar.gz
	cd net-snmp-5.0.8


	./configure --prefix=/usr --datadir=/etc --enable-static=no --with-defaults
	make
	make install
 
	if [ ! -x /usr/bin/snmpwalk ] ; then exit; fi
	cp COPYING /license/netsnmp-COPYING
	cd ../
	rm -rf net-snmp-5.0.8
	logmessage2 "Done net-snmp"
}


# Nemesis 1.4b1 & Libnet 1.0.2a
# 168KB
# Files:
#	/usr/bin/nemesis
#	/usr/man/man1/.....
makenemesis() {
	echo "Making libnet..."
	if [ ! -f nemesis-1.4beta1.tar.gz ] ; then exit; fi

	if [ ! -f libnet-1.0.2a.tar.gz ] ; then exit; fi
	#Make libnet, but don't install.  It is just needed to link with nemesis
	tar -zxvf libnet-1.0.2a.tar.gz
	cd Libnet-1.0.2a
	LIBNET_CONFIG_CFLAGS=-I/Libnet-1.0.2a/include ./configure --prefix=/usr
	make
	cp doc/COPYING /license/libnet-1.0.2a-COPYING
	cd ..
	echo "Done"

	echo "Making nemesis..."

	tar -zxvf nemesis-1.4beta1.tar.gz
	cd nemesis-1.4beta1
	

	PATH="/Libnet-1.0.2a/:$PATH" ./configure --prefix=/usr --with-libnet-includes=/Libnet-1.0.2a/include --with-libnet-libraries=/Libnet-1.0.2a/lib

	make
	make install
 
	if [ ! -x /usr/bin/nemesis ] ; then exit; fi
	cp COPYING /license/nemesis-COPYING
	cd ../
	rm -rf nemesis-1.4beta1 Libnet-1.0.2a
	echo "Done"
}


makelibnet110() {
	logmessage2 "Making libnet..."

	if [ ! -f $TPMSRCDIR/libnet.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/libnet.tar.gz
	cd Libnet-latest

	./configure --prefix=/usr
	make
	make install
	cd ../

	if [ ! -e /usr/lib/libnet.a ] ; then exit; fi

	logmessage2 "Done libnet"
}


makelibdnet() {
	logmessage2 "Making libdnet..."

	if [ ! -f libdnet-1.7.tar.gz ] ; then exit; fi
	tar -zxvf libdnet-1.7.tar.gz
	cd libdnet-1.7

	./configure --prefix=/usr
	make
	make install
	cp LICENSE /license/libdnet-LICENSE
	cd ..

	if [ ! -e /usr/lib/libdnet.a ] ; then exit; fi
	cd ../
	rm -rf libdnet-1.7
	logmessage2 "Done libdnet..."
}

cleanlibnids() {
	echo 
}

makelibnids() {
	logmessage2 "Making libnids..."

	if [ ! -f libnids-1.17rc1.tar.gz ] ; then exit; fi

	tar -zxvf libnids-1.17rc1.tar.gz
	cd libnids-1.17

	./configure --prefix=/usr --enable-shared --with-libnet=/Libnet-latest --with-libpcap=/libpcap-0.7.2
	if [ $? -ne 0 ] ; then echo "Error configuring libnids"; exit -1; fi
	make
	if [ $? -ne 0 ] ; then echo "Error making libnids"; exit -1; fi
	make install
	if [ $? -ne 0 ] ; then echo "Error installing libnids"; exit -1; fi
	cd ..

	if [ ! -e /usr/lib/libnids.a ] ; then exit; fi
	cd ../
	rm -rf libnids-1.17
	logmessage2 "Done libnids"
}

#Files:
#	/usr/sbin/packit
#	/usr/man/man8/packit.8
makepackit() {
	logmessage2 "Making packit..."
	if [ ! -f packit-0.5.0.tgz ] ; then exit -1; fi
	tar -zxvf packit-0.5.0.tgz
	cd packit-0.5.0

	./configure --prefix=/usr 
	make
	make install
 
	if [ ! -x /usr/sbin/packit ] ; then exit -1; fi
	
	cd ../
	rm -rf packit-0.5.0
	logmessage2 "Done packit"
}


#Files:
#	/usr/sbin/firewalk
makefirewalk() {
	logmessage2 "Making firewalk..."

	if [ ! -f firewalk.tar.gz ] ; then exit; fi
	tar -zxvf firewalk.tar.gz
	cd Firewalk

	./configure --prefix=/usr  
	make
	make install
 
	if [ ! -x /usr/sbin/firewalk ] ; then exit; fi
	cp SOURCE /license/firewalk-SOURCE
	cd ../
	rm -rf Firewalk
	logmessage2 "Done firewalk"
}



# pkgconfig 0.15.0
# 412KB
makepkgconfig() {
	logmessage2 "Making pkgconfig..."

	if [ ! -f pkgconfig-0.15.0.tar.gz ] ; then exit; fi
	tar -zxvf pkgconfig-0.15.0.tar.gz
	cd pkgconfig-0.15.0
	./configure --prefix=/usr
	make
	make install
	if [ ! -e /usr/bin/pkg-config ] ; then exit; fi
	cd ../
	rm -rf pkgconfig-0.15.0
	logmessage2 "Done pkgconfig"
}

cleanglib() {
	rm -vf /usr/include/glib.h /usr/include/gmodule.h
	rm -rvf /usr/include/glib /usr/include/glib-1.2 
	rm -rvf /usr/include/glib-2.0
	rm -vf /usr/include/glib-object.h
	rm -vf /usr/bin/glib-config /usr/bin/glib-genmarshal
	rm -vf /usr/bin/glib-gettextize
	rm -vf /usr/bin/glib-mkenums /usr/bin/gobject-query
	rm -rvf /usr/lib/glib /usr/include/glib-2.0
	rm -vf /usr/info/dir /usr/info/glib.info
	rm -vf /usr/man/man1/glib-config.1
	rm -vf /usr/man/man1/glib-genmarshal.1
	rm -vf /usr/man/man1/glib-mkenums.1
	rm -rvf /usr/share/glib-2.0 /usr/share/gtk-doc
	rm -vf /usr/share/aclocal/glib-2.0.m4 /usr/share/aclocal/glib.m4
	rm -vf /usr/share/aclocal/glib-gettext.m4 
	rm -rvf /usr/lib/glib
	rm -rvf /usr/lib/glib-2.0
	rm -vf /usr/lib/pkgconfig/glib.pc
	rm -vf /usr/lib/pkgconfig/gmodule.pc
	rm -vf /usr/lib/pkgconfig/gthread.pc
	rm -vf /usr/lib/pkgconfig/glib-2.0.pc
	rm -vf /usr/lib/pkgconfig/gmodule-2.0.pc
	rm -vf /usr/lib/pkgconfig/gobject-2.0.pc
	rm -vf /usr/lib/pkgconfig/gthread-2.0.pc
	rm -vf /usr/lib/libglib-2.0.la /usr/lib/libgmodule-2.0.so.0
	rm -vf /usr/lib/libgthread-2.0.la 
	rm -vf /usr/lib/libglib-2.0.so /usr/lib/libgmodule-2.0.so.0.200.1  
	rm -vf /usr/lib/libgthread-2.0.so /usr/lib/libglib-2.0.so.0 
	rm -vf /usr/lib/libgobject-2.0.la /usr/lib/libgthread-2.0.so.0
	rm -vf /usr/lib/libglib-2.0.so.0.200.1 /usr/lib/libgobject-2.0.so
	rm -vf /usr/lib/libgthread-2.0.so.0.200.1
	rm -vf /usr/lib/libgmodule-2.0.la /usr/lib/libgobject-2.0.so.0
	rm -vf /usr/lib/libgmodule-2.0.so /usr/lib/libgobject-2.0.so.0.200.1
	rm -vf /usr/lib/libglib-1.2.so.0 /usr/lib/libgmodule-1.2.so.0      
	rm -vf /usr/lib/libgthread-1.2.so.0 /usr/lib/libglib-1.2.so.0.0.9 
	rm -vf /usr/lib/libgmodule-1.2.so.0.0.9 
	rm -vf /usr/lib/libgthread-1.2.so.0.0.9 /usr/lib/libglib.a 
	rm -vf /usr/lib/libgmodule.a /usr/lib/libgthread.a 
	rm -vf /usr/lib/libglib.la /usr/lib/libgmodule.la 
	rm -vf /usr/lib/libgthread.la /usr/lib/libglib.so 
	rm -vf /usr/lib/libgmodule.so /usr/lib/libgthread.so	
}

makeglib() {
	logmessage2 "Making glib..."

	if [ ! -f $TPMSRCDIR/glib-2.2.1.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/glib-1.2.9.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/glib-2.2.1.tar.gz
	cd glib-2.2.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	rm -rf /usr/include/glib.h /usr/include/gmodule.h
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ..

	tar -zxvf $TPMSRCDIR/glib-1.2.9.tar.gz
	cd glib-1.2.9
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi

	if [ ! -e /usr/include/glib-2.0/glib.h ] ; then exit; fi
	if [ ! -e /usr/bin/glib-config ] ; then exit; fi
	mv /usr/include/glib-2.0/* /usr/include
	if [ ! -e /usr/include/glib.h ] ; then exit; fi	
	cd ../
	rm -rf glib-2.2.1 glib-1.2.9
	logmessage2 "Done glib"
}



makegtk() {
	#remove Thai from /pango-1.2.2/modules/Makefile
	logmessage2 "Making gtk..."

	if [ ! -f $TPMSRCDIR/pango-1.2.2.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/gtk+-2.2.1.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/atk-1.2.0.tar.gz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/gtk+-1.2.9.tar.gz ] ; then exit; fi

	tar -zxvf $TPMSRCDIR/atk-1.2.0.tar.gz
	cd atk-1.2.0
	./configure --prefix=/usr
	make
	make install
	if [ ! -f /usr/lib/pkgconfig/atk.pc ] ; then exit -1 ; fi

	cd ..
	tar -zxvf $TPMSRCDIR/pango-1.2.2.tar.gz
	cd pango-1.2.2
	./configure  --prefix=/usr
	make
	make install
	if [ ! -f /usr/lib/pkgconfig/pango.pc ] ; then exit -1 ; fi

	cd ..
	tar -zxvf $TPMSRCDIR/gtk+-2.2.1.tar.gz
	cd gtk+-2.2.1
	./configure --with-libtiff --with-libjpeg --prefix=/usr
	make
	make install
	if [ ! -f /usr/lib/pkgconfig/gdk-x11-2.0.pc ] ; then exit ; fi


	cd ..
	tar -zxvf $TPMSRCDIR/gtk+-1.2.9.tar.gz
	cd gtk+-1.2.9
	./configure --enable-shared=yes --enable-static=no  --prefix=/usr
	make
	make install
	if [ ! -f /usr/lib/pkgconfig/gtk+.pc ] ; then exit ; fi

	cd ../
	rm -rf gtk+-2.2.1 atk-1.2.0 pango-1.2.2 gtk+-1.2.9
	logmessage2 "Done gtk"
}


cleangpm() {
	rm -vf /etc/rc.d/init.d/gpm /etc/sysconfig/mouse
	rm -vf /etc/rc.d/rc0.d/K10gpm
	rm -vf /etc/rc.d/rc1.d/K10gpm
	rm -vf /etc/rc.d/rc2.d/K10gpm
	rm -vf /etc/rc.d/rc3.d/S70gpm
	rm -vf /etc/rc.d/rc4.d/S70gpm
	rm -vf /etc/rc.d/rc5.d/S70gpm
	rm -vf /etc/rc.d/rc6.d/K10gpm


}

# Make GPM 1.20.1
# 564KB
makegpm() {
	logmessage2 "Making gpm..."
	if [ ! -f $TPMSRCDIR/gpm-1.20.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/gpm-1.20.1.tar.gz
	cd gpm-1.20.1
	./configure --prefix=/usr
	make
	make install

	cat > /etc/rc.d/init.d/gpm << "EOF"
#!/bin/sh
. /etc/init.d/functions

PATH=$PATH:/usr/sbin

if [ -f /etc/sysconfig/mouse ]
        then
        . /etc/sysconfig/mouse
fi

if [ -z "$MDEVICE" ] || [ -z "$PROTOCOL" ]
        then
        echo "Please create an /etc/sysconfig/mouse file containing"
        echo "MDEVICE and PROTOCOL values"
        exit 1;
fi

case "$1" in
        start)
                echo "Starting gpm..."
                gpm -m $MDEVICE -t $PROTOCOL
                ;;
        stop)
                echo "Stopping gpm..."
                gpm
                ;;
        restart)
                $0 stop
                sleep 1
                $0 start
                ;;
        *)
                echo "Usage: $0 {start|stop|restart}"
                exit 1
                ;;
esac
EOF

	chmod 755 /etc/rc.d/init.d/gpm

	cd /etc/rc.d/init.d
	ln -sf ../init.d/gpm ../rc0.d/K10gpm
	ln -sf ../init.d/gpm ../rc1.d/K10gpm
	ln -sf ../init.d/gpm ../rc2.d/K10gpm
	ln -sf ../init.d/gpm ../rc3.d/S70gpm
	ln -sf ../init.d/gpm ../rc4.d/S70gpm
	ln -sf ../init.d/gpm ../rc5.d/S70gpm
	ln -sf ../init.d/gpm ../rc6.d/K10gpm


	cat > /etc/sysconfig/mouse << "EOF"
# start /etc/sysconfig/mouse
#MDEVICE could be /dev/cua/0 (serial) /dev/misc/psaux (PS/2)
MDEVICE=/dev/misc/psaux
#Discover protocols by running gpm -t -help
PROTOCOL=imps2
# end /etc/sysconfig/mouse
EOF
	cd /
	if [ ! -f /usr/sbin/gpm ] ; then exit; fi
	rm -rf gpm-1.20.1

	logmessage2 "Done gpm"
}

cleanexpat() {
	rm -vf /usr/bin/xmlwf
	rm -vf /usr/lib/libexpat.a /usr/lib/libexpat.la
	rm -vf /usr/lib/libexpat.so /usr/lib/libexpat.so.0
	rm -vf /usr/lib/libexpat.so.0.4.0
	rm -vf /usr/include/expat.h /usr/man/man1/xmlwf.1
}

makeexpat() {
	echo "Making expat..."
	if [ ! -f expat-1.95.6.tar.gz ] ; then exit; fi
	tar -zxvf expat-1.95.6.tar.gz
	cd expat-1.95.6
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ..
	if [ ! -f  ] ; then exit; fi
	rm -rf expat-1.95.6
	echo "Done"
}

cleanfontconfig() {
	rm -vf /usr/bin/fc-cache /usr/bin/fc-list /usr/bin/fc-match
	rm -rvf /usr/include/fontconfig /usr/share/doc/fontconfig
	rm -vf /usr/lib/libfontconfig.a
	rm -vf /usr/lib/libfontconfig.la
	rm -vf /usr/lib/libfontconfig.so
	rm -vf /usr/lib/libfontconfig.so.1
	rm -vf /usr/lib/libfontconfig.so.1.0.4
	rm -vf /usr/lib/pkgconfig/fontconfig.pc
	rm -rvf /etc/fonts	
}

makefontconfig() {
	cleanfontconfig
	echo "Making fontconfig..."
	if [ ! -f fontconfig-2.2.90.tar.gz ] ; then exit; fi
	tar -zxvf fontconfig-2.2.90.tar.gz
	cd fontconfig-2.2.90
	./configure --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ..
	if [ ! -f /usr/lib/libfontconfig.a ] ; then exit; fi
	rm -rf fontconfig-2.2.90
	echo "Done"
}

cleanfreetype() {
	rm -vf /usr/bin/freetype-config
	rm -vf /usr/include/ft2build.h
	rm -rvf /usr/include/freetype2
	rm -vf /usr/lib/libfreetype.a
	rm -vf /usr/lib/libfreetype.la
	rm -vf /usr/lib/libfreetype.so
	rm -vf /usr/lib/libfreetype.so.6
	rm -vf /usr/lib/libfreetype.so.6.3.3
	rm -vf /usr/share/aclocal/freetype2.m4
}

makefreetype214() {
	cleanfreetype
	echo "Making freetype..."
	if [ ! -f  $TPMSRCDIR/freetype-2.1.4.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/freetype-2.1.4.tar.gz
	cd freetype-2.1.4
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ..
	if [ ! -f /usr/bin/freetype-config ] ; then exit; fi
	rm -rf freetype-2.1.4
	echo "Done"
}

makefreetype131() {
	echo "Making freetype 1.3.1..."
	if [ ! -f  $TPMSRCDIR/freetype-1.3.1.tar.gz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/freetype-1.3.1.tar.gz
	cd freetype-1.3.1
	./configure --prefix=/usr
	if [ $? -ne 0 ]; then exit; fi
	make
	if [ $? -ne 0 ]; then exit; fi
	make install
	if [ $? -ne 0 ]; then exit; fi
	cd ..
	if [ ! -f /usr/lib/libttf.so.2.2.0 ] ; then exit; fi
	if [ ! -f /usr/bin/ftview ] ; then exit; fi
	if [ ! -f /usr/bin/fttimer ] ; then exit; fi
	if [ ! -f /usr/bin/ftlint ] ; then exit; fi
	if [ ! -f /usr/bin/ftdump ] ; then exit; fi
	if [ ! -f /usr/bin/ftzoom ] ; then exit; fi

	rm -rf freetype-1.3.1
	echo "Done"
}

makelibpng125() {
	logmessage2 "Making libpng..."
	if [ ! -f $TPMSRCDIR/libpng-1.2.5.tar.gz ] ; then exit; fi
	tar -xzvf $TPMSRCDIR/libpng-1.2.5.tar.gz
	cd libpng-1.2.5
	cp scripts/makefile.linux ./makefile
	make
	make install prefix=/usr
	cd ..
	if [ ! -f /usr/lib/libpng12.so ] ; then exit; fi
	rm -rf libpng-1.2.5
	logmessage2 "Done libpng"
}

cleanX() {
	rm -rvf /usr/X11R6 /etc/X11
	rm -vf /usr/bin/X11 /usr/lib/X11 /usr/include/X11
}

#No changes: Size=133MB
#
#Set:
#define HasGcc2 YES
#define HasSharedLibraries YES
#define ForceNormalLib NO
#define GzipFontCompression YES
#Size=
#

makeX() {
	logmessage2 "Making X11..."
	if [ ! -f $TPMSRCDIR/X430src-1.tgz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/X430src-2.tgz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/X430src-3.tgz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/X430src-4.tgz ] ; then exit; fi
	if [ ! -f $TPMSRCDIR/X430src-5.tgz ] ; then exit; fi
	tar -zxvf $TPMSRCDIR/X430src-1.tgz
	tar -zxvf $TPMSRCDIR/X430src-2.tgz
	tar -zxvf $TPMSRCDIR/X430src-3.tgz
	tar -zxvf $TPMSRCDIR/X430src-4.tgz
	tar -zxvf $TPMSRCDIR/X430src-5.tgz
	cd xc/config/util
	make -f Makefile.ini lndir
	cp lndir /usr/bin
	cd ../../

	cat > /xc/config/cf/site.def << "EOF"
XCOMM site:  $TOG: site.sample /main/r64_final/1 1998/02/05 16:28:49 kaleb $

/***************************************************************************
 *                                                                         *
 *			   SITE-SPECIFIC DEFINITIONS                       *
 *                                                                         *
 * This file contains two halves, one included before the vendor-specific  *
 * configuration file (.cf file), and one included after the .cf file.     *
 * The before-half should be protected by #ifdef BeforeVendorCF, and the   *
 * after-half should be protected by #ifdef AfterVendorCF.                 *
 *                                                                         *
 * The before-half should only set things that the .cf file depends on.    *
 * For the .cf files shipped in this release, the main variables in this   *
 * category are HasGcc, HasGcc2, HasCplusplus, OSMajorVersion,             *
 * OSMinorVersion, and OSTeenyVersion.                                     *
 *                                                                         *
 * The after-half should contain all other definitions.  For example,      *
 * place your ProjectRoot definition here.                                 *
 *                                                                         *
 * OS Major and Minor version numbers should be changed directly in the    *
 * .cf file, not overridden in site.def.                                   *
 *                                                                         *
 ***************************************************************************/
XCOMM site:  $XFree86: xc/config/cf/site.def,v 3.25 2002/02/27 00:51:12 dawes Exp $

/* if you want host-specific customization, this is one way to do it */
/*
#ifndef SiteIConfigFiles
#define SiteIConfigFiles $(IRULESRC)/host.def
#define LocalConfigFiles host.def
#endif
*/


#ifdef BeforeVendorCF

/*
 * Include this for easy XFree86 customisations
 */
#ifndef SiteIConfigFiles
#define SiteIConfigFiles $(IRULESRC)/xf86site.def $(IRULESRC)/host.def
#endif

#include <host.def>

#include <xf86site.def>

/* On systems where cpp doesn't correctly expand macros in include directives
 * the two following macros need to be defined directly (where "X11" is
 * really whatever the TopLevelProject macro is defined to be).
 */
# if defined(AIXArchitecture) || defined(SVR4Architecture) || \
     defined(SCOArchitecture) || defined(Win32Architecture) || \
     defined(UXPArchitecture) || defined(SunArchitecture) || \
     defined(DynixPtxArchitecture) || defined(i386IscArchitecture)
#  ifndef ProjectRulesFile
#   define ProjectRulesFile	<X11.rules>
#  endif
#  ifndef ProjectTmplFile
#   define ProjectTmplFile	<X11.tmpl>
#  endif
# endif


#ifndef HasGcc2
#define HasGcc2 YES
#endif

#define HasSharedLibraries YES
#define ForceNormalLib NO
#define GzipFontCompression YES

#endif /* BeforeVendorCF */

#ifdef AfterVendorCF

#ifndef ProjectRoot
#define ProjectRoot /usr/X11R6
#endif

/*
 * On some platforms, some things may be installed outside of ProjectRoot
 * by default.  To disable this, uncomment the following line.
 *
#define NothingOutsideProjectRoot YES
 */

/*
 * Set EtcX11Directory if you want config file links installed under
 * ProjectRoot rather than in /etc/X11.  See also HasVarDirectory,
 * UseEtcX11 and UseSeparateConfDir.
 *
#define EtcX11Directory ProjectRoot/etc
 */


/* Only set HasXdmAuth to YES if you have a Wraphelp.c file. */
/* #define HasXdmAuth YES */

/*
#if defined(SunArchitecture) && defined(SparcArchitecture)
#define HasCodeCenter	YES
#ifndef SVR4Architecture
#define HasTestCenter	YES
#endif
#endif
*/

/*
#ifdef __hp9000s800
#define HasCodeCenter	YES
#endif
*/

/*
#if defined(SunArchitecture) && defined(SparcArchitecture) && !defined(SVR4Architecture)
#define HasPurify	YES
#endif
*/

/*
#define HasSentinel	YES
*/

/*
#undef DefaultUserPath
#define DefaultUserPath /bin:/usr/bin:$(BINDIR):/usr/ucb:/usr/local/bin
*/


/* You do NOT need SetUID if you only run the server under xdm */
/* You MAY need SetUID if users run the server by hand or under xinit */
/* Consult your system administrator before making the X server setuid */
/*
#if defined(SunArchitecture) && OSMajorVersion > 4
#define InstallXserverSetUID YES
#endif
*/

/* You do NOT need SetUID if you only run the server under xdm */
/* You MAY need SetUID if users run the server by hand or under xinit */
/* Consult your system administrator before making the X server setuid */
/*
#ifdef XFree86Version
#define InstallXserverSetUID YES
#endif
*/

#include <host.def>

#define HasSharedLibraries YES
#define ForceNormalLib NO
#define GzipFontCompression YES

#endif /* AfterVendorCF */
EOF
	#Edit xc/config/cf/site.def
	make WORLDOPTS= World 2>&1 |tee x.log

	#Do the make install
	if [ $? -ne 0 ]; then logmessage2 "Error making World"; exit; fi
	make install
	if [ $? -ne 0 ]; then logmessage2 "Error making install"; exit; fi
	make install.man
	if [ $? -ne 0 ]; then logmessage2 "Error making install.man"; exit; fi
	cd ..
	rm -rf xc
	if [ ! -d /usr/X11R6 ] ; then exit; fi
	if [ ! -f /usr/X11R6/bin/xf86cfg ] ; then exit; fi
	if [ ! -f /usr/X11R6/bin/startx ] ; then exit; fi
	ln -s /usr/X11R6/bin /usr/bin/X11
	ln -s /usr/X11R6/lib/X11 /usr/lib/X11
	ln -s /usr/X11R6/include/X11 /usr/include/X11
	ldconfig
	mv /usr/X11R6/lib/libz.a /usr/X11R6/lib/libz.a.old
	logmessage2 "Done X11"
}



cleanpine() {
	rm -vf /usr/bin/pine /usr/bin/pilot /usr/bin/pico 
	rm -vf /license/pine-CPYRIGHT
}

makepine() {
	echo "Making pine..."
	cleanpine
	if [ ! -f pine.tar.gz ] ; then exit; fi
	tar -zxvf pine.tar.gz
	cd pine4.55
	./build slx
	cp bin/* /usr/bin/
	cp CPYRIGHT /license/pine-CPYRIGHT
	cd ..
	if [ ! -f /usr/bin/pine ] ; then exit; fi
	if [ ! -f /usr/bin/pilot ] ; then exit; fi
	if [ ! -f /usr/bin/pico ] ; then exit; fi
	rm -rf pine4.55
	echo "Done"
}

makeutillinux() {
	echo "TPM: Building utillinux..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f util-linux-2.11z.tar.gz ] ; then exit; fi
	tar -zxvf util-linux-2.11z.tar.gz
	cd util-linux-2.11z
	cp hwclock/hwclock.c{,.backup}
	sed 's%etc/adjtime%var/lib/hwclock/adjtime%' hwclock/hwclock.c.backup > hwclock/hwclock.c
	mkdir -p /var/lib/hwclock
	./configure
	if [ $? -ne 0 ]; then echo "Error configuring utillinux"; exit; fi
	make HAVE_SLN=yes
	if [ $? -ne 0 ]; then echo "Error making utillinux"; exit; fi
	make HAVE_SLN=yes install
	if [ $? -ne 0 ]; then echo "Error installing utillinux"; exit; fi
	cd ..
	ln /usr/bin/whereis /usr/bin/which
	if [ ! -f /bin/mount ] ; then exit; fi
	rm -rf util-linux-2.11z.tar util-linux-2.11z
	echo "TPM: Done utillinux" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makelinuxmanpages2424() {
	echo "TPM: Make linux man pages..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.24.tar.gz ] ; then exit; fi
	tar -zxvf linux-2.4.24.tar.gz
	chown -R 0:0 linux-2.4.24
	cd linux-2.4.24
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper linuxmanpages"; exit; fi
	make mandocs
	if [ $? -ne 0 ]; then echo "Error installing mandocs"; exit; fi
	cp -a Documentation/man /usr/share/man/man9
	cd ..
	rm -rf linux-2.4.24
	echo "TPM: Done linux man pages" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makelinuxmanpages2423() {
	echo "TPM: Make linux man pages..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.23.tar.gz ] ; then exit; fi
	tar -zxvf linux-2.4.23.tar.gz
	chown -R 0:0 linux-2.4.23
	cd linux-2.4.23
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper linuxmanpages"; exit; fi
	make mandocs
	if [ $? -ne 0 ]; then echo "Error installing mandocs"; exit; fi
	cp -a Documentation/man /usr/share/man/man9
	cd ..
	rm -rf linux-2.4.23
	echo "TPM: Done linux man pages" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makelinuxmanpages2422() {
	echo "TPM: Make linux man pages..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.22.tar.gz ] ; then exit; fi
	tar -zxvf linux-2.4.22.tar.gz
	chown -R 0:0 linux-2.4.22
	cd linux-2.4.22
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper linuxmanpages"; exit; fi
	make mandocs
	if [ $? -ne 0 ]; then echo "Error installing mandocs"; exit; fi
	cp -a Documentation/man /usr/share/man/man9
	cd ..
	rm -rf linux-2.4.22
	echo "TPM: Done linux man pages" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


makelinuxmanpages2421() {
	echo "TPM: Make linux man pages..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.21.tar.gz ] ; then exit; fi
	tar -zxvf linux-2.4.21.tar.gz
	chown -R 0:0 linux-2.4.21
	cd linux-2.4.21
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper linuxmanpages"; exit; fi
	make mandocs
	if [ $? -ne 0 ]; then echo "Error installing mandocs"; exit; fi
	cp -a Documentation/man /usr/share/man/man9
	cd ..
	rm -rf linux-2.4.21
	echo "TPM: Done linux man pages" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

makelinuxmanpages2420() {
	echo "TPM: Make linux man pages..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f linux-2.4.20.tar.gz ] ; then exit; fi
	tar -zxvf linux-2.4.20.tar.gz
	chown -R 0:0 linux-2.4.20
	cd linux-2.4.20
	make mrproper
	if [ $? -ne 0 ]; then echo "Error making mrproper linuxmanpages"; exit; fi
	make mandocs
	if [ $? -ne 0 ]; then echo "Error installing mandocs"; exit; fi
	cp -a Documentation/man /usr/share/man/man9
	cd ..
	rm -rf linux-2.4.20
	echo "TPM: Done linux man pages" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}



makempg123() {
	logmessage2 "TPM: Make mpg123..."
	cp $TPMSRCDIR/mpg123-0.59r.tar.gz ./
	if [ ! -f mpg123-0.59r.tar.gz ] ; then exit; fi
	tar -zxvf mpg123-0.59r.tar.gz

	cat > mpg123.patch << "EOF"
diff -uNr mpg123-0.59r.orig/Makefile mpg123-0.59r/Makefile
--- mpg123-0.59r.orig/Makefile	1999-06-15 20:39:06.000000000 +0000
+++ mpg123-0.59r/Makefile	2003-11-15 11:29:42.000000000 +0000
@@ -4,7 +4,7 @@
 
 # Where to install binary and manpage on "make install":
 
-PREFIX=/usr/local
+PREFIX=/usr
 BINDIR=$(PREFIX)/bin
 MANDIR=$(PREFIX)/man
 SECTION=1
EOF
	
	cd mpg123-0.59r
	patch -Np1 -i ../mpg123.patch
	make linux
	if [ $? -ne 0 ]; then echo "Error making mpg123"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing mpg123"; exit -1; fi
	cd ..
	rm -rf mpg123-0.59r.tar.gz mpg123-0.59r mpg123.patch
	logmessage2 "TPM: Done making mpg123"
}

makeglibcagain() {
	echo "TPM: Making glibc again..." 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	if [ ! -f glibc-2.3.1.tar.gz ] ; then exit -1; fi
	if [ ! -f glibc-linuxthreads-2.3.1.tar.gz ] ; then exit -1; fi
	tar -zxvf glibc-2.3.1.tar.gz

	cd glibc-2.3.1
	tar -zxvf ../glibc-linuxthreads-2.3.1.tar.gz
	mkdir ../glibc-build
	cd ../glibc-build
	../glibc-2.3.1/configure --prefix=/usr --disable-profile --enable-add-ons --libexecdir=/usr/bin 
	if [ $? -ne 0 ]; then echo "Error configuring glibc again"; exit -1; fi
	make
	if [ $? -ne 0 ]; then echo "Error making glibc again"; exit -1; fi
	make install
	if [ $? -ne 0 ]; then echo "Error installing glibc again"; exit -1; fi
	make -C ../glibc-2.3.1/linuxthreads/man
	if [ $? -ne 0 ]; then echo "Error making glibc man again"; exit -1; fi
	make -C ../glibc-2.3.1/linuxthreads/man install
	if [ $? -ne 0 ]; then echo "Error installing glibc man again"; exit -1; fi
	if [ ! -f /usr/lib/libc.a ] ; then exit -1; fi
	cd ../..

	rm -rf glibc-build glibc-2.3.1
	echo "TPM: Done glibc again" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}


createliloconf()
{
	echo "Creating lilo.conf..."
	cat > /etc/lilo.conf << "EOF"
boot = /dev/ide/host0/bus0/target1/lun0/disc
prompt          # always expect prompt
timeout = 150   # wait 15 seconds
vga = normal    # force sane state
lba32           # 'linear' is deprecated
delay = 30      # delay 3 seconds if there is a stored command line
read-only       # initailly mount roots r/o
image = /boot/bzImage
  label = linux
  root = /dev/ide/host0/bus0/target1/lun0/part1
  append="reboot=bios,warm;devfs=mount"
EOF

}

makeinstallbootblock()
{
	echo "Install boot block..."
	#cat /proc/partitions
	#echo "Press Enter to Continue"
	#read A
	mount devfs /dev -t devfs

	lilo -t -C /etc/lilo.conf
	echo ""
	echo "Test Done"
	echo ""
	echo "Starting real Boot Block Install"
	echo ""
	echo ""
	lilo -C /etc/lilo.conf

}


#
# This function creates these files:
#   /etc/fstab
#   /etc/hosts
#   /etc/issue
#   /etc/motd
#   /etc/mtab
#   /etc/ld.so.conf
#   /etc/login.defs
#   /etc/man.conf
#   /etc/profile
#   /etc/shells
#   /etc/rc.d/rc
#   /etc/rc.d/rc.sysinit
#   /etc/rc.d/rc.iso
#   /etc/rc.d/init.d/discovermodules
#   /etc/rc.d/init.d/functions
#   /etc/rc.d/init.d/gpm
#   /etc/rc.d/init.d/halt
#   /etc/rc.d/init.d/iptables
#   /etc/rc.d/init.d/mountcdrom
#   /etc/rc.d/init.d/mountdos
#   /etc/rc.d/init.d/nessusd
#   /etc/rc.d/init.d/network
#   /etc/rc.d/init.d/ntop
#   /etc/rc.d/init.d/openssh
#   /etc/rc.d/init.d/pppoe
#   /etc/rc.d/init.d/samba
#   /etc/rc.d/init.d/syslogd
#   /etc/rc.d/init.d/wireless
#   /etc/sysconfig/SAMPLE.iptables
#   /etc/sysconfig/SAMPLE.network
#   /etc/sysconfig/mouse
#   /etc/sysconfig/network-scripts
#   /etc/sysconfig/rd
#
makeetcfiles() {
	echo "TPM: Installing etc files" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
	###cd myetcfiles
	###cp -R * ../etc
	touch /dev/.devfsd
	mkdir -p /etc/rc.d
	cd /etc/rc.d
	mkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d init.d
	mkdir -p /etc/sysconfig/network-scripts
	ln -s /etc/rc.d/init.d/ /etc/init.d

	cat > /etc/shells << "EOF"
/bin/sh
/bin/bash
/bin/tcsh
EOF

	cat > /etc/issue << "EOF"
ThePacketMaster Linux
Kernel \r on an \m
EOF

	cat > /etc/rc.d/rc << "EOF"
#!/bin/bash

echo "******************************"
echo "Executing /etc/rc.d/rc"
echo "******************************"

echo "Entering Runlevel $1"

runlevel=$1

for i in /etc/rc$runlevel.d/K*; do
        $i stop
done

for i in /etc/rc$runlevel.d/S*; do
        $i start
done

#Debug
if [ -e /etc/watchboot ]; then
echo "Press Enter to Continue"
read A
fi

echo "*****************************"
echo "Finished /etc/rc.d/rc"
echo "*****************************"
EOF

	cat > /etc/rc.d/init.d/wireless << "EOF"
EOF


	cat > /etc/rc.d/init.d/halt << "EOF"
. /etc/init.d/functions

echo
echo $0
echo

echo "Sending all processes, not being run by init, the TERM signal"
/sbin/killall5 -15
sleep 5
echo "Okay, last call...sending all processes, not being run by the, the KILL signal"
/sbin/killall5 -9

if [ -e /etc/watchboot ]; then
	W="y"
	echo "Press Enter to continue"
	read -t 15 -s -n 1 A
fi

rm -f /etc/watchboot

if [ "x$W" = "xy" ]; then
	echo "Showing /etc/watchboot"
	ls -l /etc/watchboot
	echo "Press Enter to continue"
	read -t 15 -s -n 1 A
fi


echo "Unmounting all non-system mounts"
remaining=`cat /proc/mounts | awk '!/( \/dev | \/proc | \/ )/ { print $2 }'`
for i in "$remaining"; do
        echo "umounting $i"
        umount $i
done

if [ "x$W" = "xy" ]; then
	echo "Press Enter to continue"
	read -t 15 -s -n 1 A
fi

echo "Using halt -w to write record to /var/log/wtmp"
halt -w



#This remounts the root directory as read-only
#For the future: This should also check if /etc has it's own mount
# and remount it read-only
mount -n -o remount,ro /
if [ $? -ne 0 ]; then 
	echo "Trying to mount / read-only again"
	/sbin/killall5 -9
	sleep 5
	mount -n -o remount,ro /
fi

if [ "x$W" = "xy" ]; then
	ps -ef
	mount
	echo "Press Enter to continue"
	read -t 15 -s -n 1 A
fi


#Sync the file system
sync;sync;sync

if [ "x$W" = "xy" ]; then
	echo "Press Enter to continue"
	read -t 15 -s -n 1 A
fi

case "$0" in
	*halt)
		echo "System is stopped.  You may turn off the power."
	        ;;
	*reboot)
		echo "System is rebooting..."
		reboot -i -d
	        ;;
	*)
		echo "System is stopped.  You may turn off the power."
	        ;;
esac
 

EOF

	cat > /etc/ld.so.conf << "EOF"
/lib
/usr/lib
/usr/lib/libgmp-i386
/usr/ssl/lib
/usr/X11R6/lib
#/usr/local/lib
EOF
	ldconfig


	cat > /etc/login.defs << "EOF"
#
# /etc/login.defs - Configuration control definitions for the login package.
#
#	$Id: login.defs.linux,v 1.12 2000/08/26 18:27:10 marekm Exp $
#
# Three items must be defined:  MAIL_DIR, ENV_SUPATH, and ENV_PATH.
# If unspecified, some arbitrary (and possibly incorrect) value will
# be assumed.  All other items are optional - if not specified then
# the described action or option will be inhibited.
#
# Comment lines (lines beginning with "#") and blank lines are ignored.
#
# Modified for Linux.  --marekm

#
# Delay in seconds before being allowed another attempt after a login failure
#
FAIL_DELAY		3

#
# Enable additional passwords upon dialup lines specified in /etc/dialups.
#
DIALUPS_CHECK_ENAB	yes

#
# Enable logging and display of /var/log/faillog login failure info.
#
FAILLOG_ENAB		yes

#
# Enable display of unknown usernames when login failures are recorded.
#
LOG_UNKFAIL_ENAB	no

#
# Enable logging of successful logins
#
LOG_OK_LOGINS		no

#
# Enable logging and display of /var/log/lastlog login time info.
#
LASTLOG_ENAB		yes

#
# Enable checking and display of mailbox status upon login.
#
# Disable if the shell startup files already check for mail
# ("mailx -e" or equivalent).
#
MAIL_CHECK_ENAB		yes

#
# Enable additional checks upon password changes.
#
OBSCURE_CHECKS_ENAB	yes

#
# Enable checking of time restrictions specified in /etc/porttime.
#
PORTTIME_CHECKS_ENAB	yes

#
# Enable setting of ulimit, umask, and niceness from passwd gecos field.
#
QUOTAS_ENAB		yes

#
# Enable "syslog" logging of su activity - in addition to sulog file logging.
# SYSLOG_SG_ENAB does the same for newgrp and sg.
#
SYSLOG_SU_ENAB		yes
SYSLOG_SG_ENAB		yes

#
# If defined, either full pathname of a file containing device names or
# a ":" delimited list of device names.  Root logins will be allowed only
# upon these devices.
#
CONSOLE		/etc/securetty
#CONSOLE	console:tty01:tty02:tty03:tty04

#
# If defined, all su activity is logged to this file.
#
#SULOG_FILE	/var/log/sulog

#
# If defined, ":" delimited list of "message of the day" files to
# be displayed upon login.
#
MOTD_FILE	/etc/motd
#MOTD_FILE	/etc/motd:/usr/lib/news/news-motd

#
# If defined, this file will be output before each login prompt.
#
#ISSUE_FILE	/etc/issue

#
# If defined, file which maps tty line to TERM environment parameter.
# Each line of the file is in a format something like "vt100  tty01".
#
#TTYTYPE_FILE	/etc/ttytype

#
# If defined, login failures will be logged here in a utmp format.
# last, when invoked as lastb, will read /var/log/btmp, so...
#
FTMP_FILE	/var/log/btmp

#
# If defined, name of file whose presence which will inhibit non-root
# logins.  The contents of this file should be a message indicating
# why logins are inhibited.
#
NOLOGINS_FILE	/etc/nologin

#
# If defined, the command name to display when running "su -".  For
# example, if this is defined as "su" then a "ps" will display the
# command is "-su".  If not defined, then "ps" would display the
# name of the shell actually being run, e.g. something like "-sh".
#
SU_NAME		su

#
# *REQUIRED*
#   Directory where mailboxes reside, _or_ name of file, relative to the
#   home directory.  If you _do_ define both, MAIL_DIR takes precedence.
#   QMAIL_DIR is for Qmail
#
#QMAIL_DIR	Maildir
MAIL_DIR	/var/mail
#MAIL_FILE	.mail

#
# If defined, file which inhibits all the usual chatter during the login
# sequence.  If a full pathname, then hushed mode will be enabled if the
# user's name or shell are found in the file.  If not a full pathname, then
# hushed mode will be enabled if the file exists in the user's home directory.
#
HUSHLOGIN_FILE	.hushlogin
#HUSHLOGIN_FILE	/etc/hushlogins

#
# If defined, the presence of this value in an /etc/passwd "shell" field will
# disable logins for that user, although "su" will still be allowed.
#
# XXX this does not seem to be implemented yet...  --marekm
# no, it was implemented but I ripped it out ;-) -- jfh
NOLOGIN_STR	NOLOGIN

#
# If defined, either a TZ environment parameter spec or the
# fully-rooted pathname of a file containing such a spec.
#
#ENV_TZ		TZ=CST6CDT
#ENV_TZ		/etc/tzname

#
# If defined, an HZ environment parameter spec.
#
# for Linux/x86
ENV_HZ		HZ=100
# For Linux/Alpha...
#ENV_HZ		HZ=1024

#
# *REQUIRED*  The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH	PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/ssl/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
ENV_PATH	PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/ssl/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin


#
# Terminal permissions
#
#	TTYGROUP	Login tty will be assigned this group ownership.
#	TTYPERM		Login tty will be set to this permission.
#
# If you have a "write" program which is "setgid" to a special group
# which owns the terminals, define TTYGROUP to the group number and
# TTYPERM to 0620.  Otherwise leave TTYGROUP commented out and assign
# TTYPERM to either 622 or 600.
#
TTYGROUP	tty
TTYPERM		0600

#
# Login configuration initializations:
#
#	ERASECHAR	Terminal ERASE character ('\010' = backspace).
#	KILLCHAR	Terminal KILL character ('\025' = CTRL/U).
#	UMASK		Default "umask" value.
#	ULIMIT		Default "ulimit" value.
#
# The ERASECHAR and KILLCHAR are used only on System V machines.
# The ULIMIT is used only if the system supports it.
# (now it works with setrlimit too; ulimit is in 512-byte units)
#
# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
#
ERASECHAR	0177
KILLCHAR	025
UMASK		022
#ULIMIT		2097152

#
# Password aging controls:
#
#	PASS_MAX_DAYS	Maximum number of days a password may be used.
#	PASS_MIN_DAYS	Minimum number of days allowed between password changes.
#	PASS_MIN_LEN	Minimum acceptable password length.
#	PASS_WARN_AGE	Number of days warning given before a password expires.
#
PASS_MAX_DAYS	99999
PASS_MIN_DAYS	0
PASS_MIN_LEN	5
PASS_WARN_AGE	7

#
# If "yes", the user must be listed as a member of the first gid 0 group
# in /etc/group (called "root" on most Linux systems) to be able to "su"
# to uid 0 accounts.  If the group doesn't exist or is empty, no one
# will be able to "su" to uid 0.
#
SU_WHEEL_ONLY	no

#
# If compiled with cracklib support, where are the dictionaries
#
CRACKLIB_DICTPATH	/var/cache/cracklib/cracklib_dict

#
# Min/max values for automatic uid selection in useradd
#
UID_MIN			 1000
UID_MAX			60000

#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN			  100
GID_MAX			60000

#
# Max number of login retries if password is bad
#
LOGIN_RETRIES		5

#
# Max time in seconds for login
#
LOGIN_TIMEOUT		60

#
# Maximum number of attempts to change password if rejected (too easy)
#
PASS_CHANGE_TRIES	5

#
# Warn about weak passwords (but still allow them) if you are root.
#
PASS_ALWAYS_WARN	yes

#
# Number of significant characters in the password for crypt().
# Default is 8, don't change unless your crypt() is better.
# Ignored if MD5_CRYPT_ENAB set to "yes".
#
#PASS_MAX_LEN		8

#
# Require password before chfn/chsh can make any changes.
#
CHFN_AUTH		yes

#
# Which fields may be changed by regular users using chfn - use
# any combination of letters "frwh" (full name, room number, work
# phone, home phone).  If not defined, no changes are allowed.
# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
# 
CHFN_RESTRICT		rwh

#
# Password prompt (%s will be replaced by user name).
#
# XXX - it doesn't work correctly yet, for now leave it commented out
# to use the default which is just "Password: ".
#LOGIN_STRING		"%s's Password: "

#
# Only works if compiled with MD5_CRYPT defined:
# If set to "yes", new passwords will be encrypted using the MD5-based
# algorithm compatible with the one used by recent releases of FreeBSD.
# It supports passwords of unlimited length and longer salt strings.
# Set to "no" if you need to copy encrypted passwords to other systems
# which don't understand the new algorithm.  Default is "no".
#
#MD5_CRYPT_ENAB	no

#
# List of groups to add to the user's supplementary group set
# when logging in on the console (as determined by the CONSOLE
# setting).  Default is none.
#
# Use with caution - it is possible for users to gain permanent
# access to these groups, even when not logged in on the console.
# How to do it is left as an exercise for the reader...
#
#CONSOLE_GROUPS		floppy:audio:cdrom

#
# Should login be allowed if we can't cd to the home directory?
# Default in no.
#
DEFAULT_HOME	yes

#
# If this file exists and is readable, login environment will be
# read from it.  Every line should be in the form name=value.
#
ENVIRON_FILE	/etc/environment

#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
#USERDEL_CMD	/usr/sbin/userdel_local

#
# If defined, either full pathname of a file containing device names or
# a ":" delimited list of device names.  No password is required to log in
# as a non-root user on these devices.
#
#NO_PASSWORD_CONSOLE tty1:tty2:tty3:tty4:tty5:tty6

#
# When prompting for password without echo, getpass() can optionally
# display a random number (in the range 1 to GETPASS_ASTERISKS) of '*'
# characters for each character typed.  This feature is designed to
# confuse people looking over your shoulder when you enter a password :-).
# Also, the new getpass() accepts both Backspace (8) and Delete (127)
# keys to delete previous character (to cope with different terminal
# types), Control-U to delete all characters, and beeps when there are
# no more characters to delete, or too many characters entered.
#
# Setting GETPASS_ASTERISKS to 1 results in more traditional behaviour -
# exactly one '*' displayed for each character typed.
#
# Setting GETPASS_ASTERISKS to 0 disables the '*' characters (Backspace,
# Delete, Control-U and beep continue to work as described above).
#
# Setting GETPASS_ASTERISKS to -1 reverts to the traditional getpass()
# without any new features.  This is the default.
#
#GETPASS_ASTERISKS 1

#
# Enable setting of the umask group bits to be the same as owner bits
# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
# the same as gid, and username is the same as the primary group name.
#
# This also enables userdel to remove user groups if no members exist.
#
USERGROUPS_ENAB yes
EOF

	cat > /etc/man.conf << "EOF"
#
# Generated automatically from man.conf.in by the
# configure script.
#
# man.conf from man-1.5l
#
# For more information about this file, see the man pages man(1)
# and man.conf(5).
#
# This file is read by man to configure the default manpath (also used
# when MANPATH contains an empty substring), to find out where the cat
# pages corresponding to given man pages should be stored,
# and to map each PATH element to a manpath element.
# It may also record the pathname of the man binary. [This is unused.]
# The format is:
#
# MANBIN		pathname
# MANPATH		manpath_element	[corresponding_catdir]
# MANPATH_MAP		path_element	manpath_element
#
# If no catdir is given, it is assumed to be equal to the mandir
# (so that this dir has both man1 etc. and cat1 etc. subdirs).
# This is the traditional Unix setup.
# Certain versions of the FSSTND recommend putting formatted versions
# of /usr/.../man/manx/page.x into /var/catman/.../catx/page.x.
# The keyword FSSTND will cause this behaviour.
# Certain versions of the FHS recommend putting formatted versions of
# /usr/.../share/man/[locale/]manx/page.x into
# /var/cache/man/.../[locale/]catx/page.x.
# The keyword FHS will cause this behaviour (and overrides FSSTND).
# Explicitly given catdirs override.
#
# FSSTND
FHS
#
# This file is also read by man in order to find how to call nroff, less, etc.,
# and to determine the correspondence between extensions and decompressors.
#
# MANBIN		/usr/local/bin/man
#
# Every automatically generated MANPATH includes these fields
#
MANPATH	/usr/man
MANPATH /usr/share/man
MANPATH	/usr/local/man
MANPATH	/usr/ssl/man

#
# Uncomment if you want to include one of these by default
#
#MANPATH /opt/teTeX/man
#MANPATH /usr/lib/perl5/man
#MANPATH /usr/share/perl5/man
#MANPATH /usr/share/tcl-8.0/man
#MANPATH /usr/share/tk-8.0/man
#MANPATH /usr/share/tix-4.1/man
#MANPATH /usr/share/coas/man
#MANPATH /usr/kerberos/man
#
# Set up PATH to MANPATH mapping
#
# If people ask for "man foo" and have "/dir/bin/foo" in their PATH
# and the docs are found in "/dir/man", then no mapping is required.
#
# The below mappings are superfluous when the right hand side is
# in the mandatory manpath already, but will keep man from statting
# lots of other nearby files and directories.
#
MANPATH_MAP	/bin			/usr/share/man
MANPATH_MAP	/sbin			/usr/share/man
MANPATH_MAP	/usr/bin		/usr/share/man
MANPATH_MAP	/usr/sbin		/usr/share/man
MANPATH_MAP	/usr/local/bin		/usr/local/man
MANPATH_MAP	/usr/local/sbin		/usr/local/man
MANPATH_MAP	/usr/X11R6/bin		/usr/X11R6/man
MANPATH_MAP	/usr/bin/X11		/usr/X11R6/man
MANPATH_MAP	/usr/bin/mh		/usr/share/man
#
# NOAUTOPATH keeps man from automatically adding directories that look like
# manual page directories to the path.
#
#NOAUTOPATH
#
# NOCACHE keeps man from creating cache pages ("cat pages")
# (generally one enables/disable cat page creation by creating/deleting
# the directory they would live in - man never does mkdir)
# 
#NOCACHE
#
# Useful paths - note that COL should not be defined when
# NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
# not only is it superfluous, but it actually damages the output.
# For use with utf-8, NROFF should be "nroff -mandoc" without -T option.
# (Maybe - but today I need -Tlatin1 to prevent double conversion to utf8.)
#
# If you have a new troff (version 1.18.1?) and its colored output
# causes problems, add the -c option to TROFF, NROFF, JNROFF.
#
TROFF		/usr/bin/groff -Tps -mandoc
NROFF		/usr/bin/nroff -Tlatin1 -mandoc
JNROFF		/usr/bin/groff -Tnippon -mandocj
EQN		/usr/bin/geqn -Tps
NEQN		/usr/bin/geqn -Tlatin1
JNEQN		/usr/bin/geqn -Tnippon
TBL		/usr/bin/gtbl
# COL		
REFER		/usr/bin/refer
PIC		/usr/bin/pic
VGRIND		
GRAP		
PAGER		/bin/less -isR
CAT		/bin/cat
#
# The command "man -a xyzzy" will show all man pages for xyzzy.
# When CMP is defined man will try to avoid showing the same
# text twice. (But compressed pages compare unequal.)
#
CMP		/usr/bin/cmp -s
#
# Compress cat pages
#
COMPRESS	/bin/bzip2
COMPRESS_EXT	.bz2
#
# Default manual sections (and order) to search if -S is not specified
# and the MANSECT environment variable is not set.
#
MANSECT		1:8:2:3:4:5:6:7:9:tcl:n:l:p:o
#
# Default options to use when man is invoked without options
# This is mainly for the benefit of those that think -a should be the default
# Note that some systems have /usr/man/allman, causing pages to be shown twice.
#
#MANDEFOPTIONS	-a
#
# Decompress with given decompressor when input file has given extension
# The command given must act as a filter.
#
.gz		/bin/gunzip -c
.bz2		/bin/bzip2 -c -d
.z		
.Z		/bin/zcat
.F		
.Y		
EOF

	cat > /etc/rc.d/init.d/gpm << "EOF"
#!/bin/sh
. /etc/init.d/functions

if [ -f /etc/sysconfig/mouse ]
        then
        . /etc/sysconfig/mouse
fi

if [ -z "$MDEVICE" ] || [ -z "$PROTOCOL" ]
        then
        echo "Please create an /etc/sysconfig/mouse file containing"
        echo "MDEVICE and PROTOCOL values"
        exit 1;
fi

case "$1" in
        start)
                echo "Starting gpm..."
                gpm -m $MDEVICE -t $PROTOCOL
                ;;
        stop)
                echo "Stopping gpm..."
                gpm -k
		pkill -9 gpm
                ;;
        *)
                echo "Usage: $0 {start|stop}"
                exit 1
                ;;
esac
EOF

	cat > /etc/rc.d/init.d/iptables << "EOF"
#!/bin/sh

. /etc/rc.d/init.d/functions

if [ ! -x /etc/sysconfig/iptables ]; then
	echo "/etc/sysconfig/iptables does not exist.  Will not activate filtering"
	exit 0
fi

CONFIG=/etc/sysconfig/iptables

if [ ! -x /usr/sbin/iptables ]; then
        exit 0
fi


modprobe iptable_filter
modprobe ip_conntrack

echo "Applying firewall rules..."
grep -v "^[[:space:]]*#" $CONFIG | /usr/sbin/iptables-restore -c


#Commmand line reminders
#iptables -A INPUT 
#iptables -A OUTPUT  -p tcp -j ACCEPT
#iptables -A OUTPUT  -p tcp -j ACCEPT
#iptables -A OUTPUT -s 192.168.1.1/32 -p tcp -j ACCEPT
#
#ip-sysctl sets the state table size
EOF

	cat > /etc/rc.d/init.d/nessusd << "EOF"
#!/bin/bash

. /etc/init.d/functions

case "$1" in
  start|--start)
	echo "Starting nessusd"
	if [ ! -d /etc/nessus/CA -o ! -d /etc/nessus/CA ]; then
		/usr/sbin/nessus-mkcert -q
	fi
	/usr/sbin/nessusd &
	;;


  stop|--stop)
	pkill nessusd
	;;

  *)
	echo "Usage: nessusd {start|stop}" >&2
	exit 2
esac

exit 0
EOF

	cat > /etc/rc.d/init.d/ntop << "EOF"
#!/bin/sh
. /etc/init.d/functions




case "$1" in
  start|--start)
	if [ ! -e /var/ntop/ntop_pw.db ] ; then
		echo "The ntop password file does not exist."
		echo "Please at least set the ntop admin password"
		echo "before trying to run ntop."
		exit 2
	fi
	cd /usr/bin
	./ntop -d -P /var/ntop -w 3000 -W 3001
	;;

  setpass|--setpass)
	if [ ! -e /var/ntop/ntop_pw.db ] ; then
		cd /usr/bin
		./ntop -P /var/ntop --set-admin-password
	fi
	;;


  stop|--stop)
	pkill ntop
	;;

  *)
	echo "Usage: ntop {start|stop|setpass}" >&2
	exit 2
esac

exit 0
EOF

	cat > /etc/rc.d/init.d/crack << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  standard|--standard)
	cd /usr
	cp -R c50a /var
	cd /var/c50a

	./Crack -makeonly
	if [ ! -f ./run/bin/linux-2-unknown/cracker ] ; then exit; fi
	rm -rf ./run/dict
	./Crack -makedict
	if [ ! -f ./run/bin/linux-2-unknown/cracker ] ; then exit; fi

	;;


  md5|--md5)
	cd /usr
	cp -R c50a /var
	cd /var/c50a

	mv src/libdes src/libdes,orig
	cd src/util
	cp elcid.c,bsd elcid.c
	cd ../..

	./Crack -makeonly
	if [ ! -f ./run/bin/linux-2-unknown/cracker ] ; then exit; fi
	rm -rf ./run/dict
	cp ../dictionary ./dict/1/
	./Crack -makedict
	if [ ! -f ./run/bin/linux-2-unknown/cracker ] ; then exit; fi
	;;

  *)
	echo "Usage: crack {standard|md5}" >&2
	exit 2
esac

exit 0
EOF

	cat > /etc/rc.d/init.d/john << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  *)
	cd /usr
	cp -R john-1.6 /var
	cp /usr/c50a/dict/1/dictionary /var/john-1.6/bin/password.lst

	;;

	exit 0
esac

exit 0
EOF

	cat > /etc/rc.d/init.d/openssh << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  start|--start)
	if [ ! -e /etc/ssh_host_dsa_key ] ; then
		ssh-keygen -t dsa -N "" -f /etc/ssh_host_dsa_key
	fi
	if [ ! -e /etc/ssh_host_rsa_key ] ; then
		ssh-keygen -t rsa -N "" -f /etc/ssh_host_rsa_key
	fi
	if [ ! -e /etc/ssh_host_key ] ; then
		ssh-keygen -t rsa1 -N "" -f /etc/ssh_host_key
	fi

	/usr/sbin/sshd
	;;


  stop|--stop)
	pkill sshd
	;;

  *)
	echo "Usage: openssh {start|stop}" >&2
	exit 2
esac

exit 0
EOF

	cat > /etc/rc.d/init.d/pppoe << "EOF"
#!/bin/sh
. /etc/rc.d/init.d/functions


case "$1" in
  start|--start)
	modprobe pppoe
	adsl-start
	;;


  stop|--stop)
	adsl-stop
	;;

  status|--status)
	adsl-status
	;;

  *)
	echo "Usage: pppoe {start|stop|status}" >&2
	exit 2
esac

exit 0
EOF


	cat > /etc/rc.d/init.d/functions << "EOF"
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
EOF

	cat > /etc/rc.d/rc.iso << "EOF"
#!/bin/bash
#
# /etc/rc.iso - run once at boot time
#
# Taken in part from Miquel van Smoorenburg's bcheckrc.
#


echo "************************"
echo "Started /etc/rc.d/rc.iso"
echo "************************"

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "Directory of /dev"
ls -ld /dev
#ls -l /dev |more
echo "4050: Press Enter to Continue"
read A
#sleep 5
fi

#if [ "x$WATCHBOOT" = "xy" ]; then 
#echo "Enter a Command"
#echo -n ">"
#read A
#while [ "x$A" != "x" ]; do
#$A
#echo "Enter a Command"
#echo -n ">"
#read A
#done
#fi

#These 3 lines are not needed since the RAM disk support 
#is built into the kernel
#rmmod rd
#insmod rd rd_size=60000
#lsmod

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4100: Press Enter to Continue"
read A
#sleep 5
fi


###
### This is the start of the section to mount /etc
###

#Create the /etc partition (16MB)
echo "Creating /etc"
mke2fs -F -i 1024 -q /dev/rd/2 `grep -E -v "^#|^ *$" /etc/sysconfig/rd |grep "/etc" |cut -f2`

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4150: Press Enter to Continue"
read A
#sleep 5
fi

echo "Mounting /mnt/etc"
mount -n /dev/rd/2 /mnt/etc -o defaults,rw

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4200: Press Enter to Continue"
read A
#sleep 5
fi

cd /archive/etc
cp -R * /mnt/etc
echo "Unmounting /mnt/etc, Mounting /etc"
umount /mnt/etc

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4250: Press Enter to Continue"
read A
#sleep 5
fi

mount -n /dev/rd/2 /etc -o defaults,rw

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4300: Press Enter to Continue"
read A
#sleep 5
fi

rm /etc/mtab
ln -s /proc/mounts /etc/mtab

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "Directory of /etc"
ls -l /etc
echo "4350: Press Enter to Continue"
read A
#sleep 5
fi

###
### This is the end of the section to mount /etc
###




###
### This is the start of the section to mount /var
###

#Create the /var partition (32MB)
echo "Creating /var"
mke2fs -F -i 1024 -q /dev/rd/1 `grep -E -v "^#|^ *$" /etc/sysconfig/rd |grep "/var" |cut -f2`
#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4400: Press Enter to Continue"
read A
#sleep 5
fi

if [ "x$WATCHBOOT" = "xy" ]; then 
echo "Directory listing of /var"
ls -l /var
echo "4450: Press Enter to Continue"
read A
fi

echo "Mount RAM disk onto /var"
mount -n -o defaults,rw /dev/rd/1 /var 
#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4500: Press Enter to Continue"
read A
fi

if [ "x$WATCHBOOT" = "xy" ]; then 
#sleep 5
echo "Directory of /var"
ls -l /var
echo "4550: Press Enter to Continue"
read A
#sleep 5
fi

cd /var
mkdir -p lock/subsys spool/anacron spool/cron spool/at spool/mqueue spool/mail
mkdir -p run/netreport
mkdir -p log/httpd ntop nessus/logs nessus/CA nessus/jobs nessus/users
mkdir mysql john
mkdir empty webmin
mkdir tmp
mkdir lib
ln -s spool/mail
#Change all the ownerships
chown -R root:root lock run log mysql spool tmp lib
chown daemon:daemon spool/at
chown ntop:nobody ntop
chown mysql:mysql mysql
chgrp uucp lock
chgrp mail spool/mqueue spool/mail
#Change all the permissions
chmod 755 run log mysql spool lib
chmod -R 775 lock
chmod 777 spool/mail
chmod 700 spool/cron spool/at
chmod 775 run/netreport
chmod 1777 tmp
touch log/wtmp log/lastlog run/utmp
chmod 664 log/wtmp run/utmp
chown root:utmp /var/log/wtmp /var/run/utmp
chmod 644 log/lastlog



#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "Directory of /var"
ls -l /var
echo "4600: Press Enter to Continue"
read A
#sleep 5
fi

###
### This is the end of the section to mount /var
###



echo "Creating entries in /etc/mtab"
mount -f /dev/rd/2 /etc -o defaults,rw
mount -f /dev/rd/1 /var -o defaults,rw
#mount -f /dev/rd/3 /dev -o defaults,rw
mount -f /dev/rd/3 /dev -o defaults,rw


###
### This is the start of the section to mount /mnt/floppy 
### and to copy configuration data from the floppy
###
if [ "x$CONFIGFLOPPY" = "xy" ]; then
echo "Trying to mount floppy disk"
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4650: Press Enter to Continue"
read A
#sleep 5
fi

insmod fat
insmod vfat

#Try mounting floppy for soft config files
mount -t auto -o ro /dev/floppy/0 /mnt/floppy

if [ $? -eq 0 ] ; then 
cd /mnt/floppy 

AP=`ls profile[0-9].tgz |grep -c profile`
if [ $AP -ne 0 ] ; then
	echo "The following configuration profiles are available:"
	echo ""
	ls profile[0-9].tgz |cut -d. -f1
	echo ""
	if [ -e /mnt/floppy/profile0.tgz ] ; then
		echo "Select a profile or wait 10 seconds to use profile 0"
	else
		echo "Select a profile or wait 10 seconds to use a blank profile"
	fi

	cd /
	while [ "x" = "x" ]; do
	PROFILE=""
	read -t 10 -s -n 1 PROFILE
	if [ "x$PROFILE" != "x" ] ; then
		if [ -e /mnt/floppy/profile$PROFILE.tgz ] ; then
			echo "Using profile $PROFILE"
			tar -zxvf /mnt/floppy/profile$PROFILE.tgz
			chown 0:0 /etc/shadow
			chmod 400 /etc/shadow
			chown 0:0 /etc/samba/smb.conf
			chmod 644 /etc/samba/smb.conf
			chown 0:0 /etc/samba/private/secrets.tdb
			chmod 600 /etc/samba/private/secrets.tdb
			chown -R 0:0 /etc/sysconfig
			chmod 755 /etc/sysconfig/*
			chmod -R 644 /etc/sysconfig/*
			chown -R 0:0 /etc/ppp
			chmod -R 700 /etc/ppp/*
			chown 0:0 /etc/ipsec.conf
			chmod 755 /etc/ipsec.conf
			chown -R 0:0 /etc/ipsec.d
			chmod -R 755 /etc/ipsec.d
			chown -R 0:0 /etc/minicom
			chmod 755 /etc/minicom
			chmod -R 644 /etc/minicom/*
			break
		else
			echo "That profile does not exist"
		fi
	else
		if [ -e /mnt/floppy/profile0.tgz ] ; then
			echo "Continuing with profile 0"
			tar -zxvf /mnt/floppy/profile0.tgz
			chown 0:0 /etc/shadow
			chmod 400 /etc/shadow
			chown 0:0 /etc/samba/smb.conf
			chmod 644 /etc/samba/smb.conf
			chown 0:0 /etc/samba/private/secrets.tdb
			chmod 600 /etc/samba/private/secrets.tdb
			chown -R 0:0 /etc/sysconfig
			chmod 755 /etc/sysconfig/*
			chmod -R 644 /etc/sysconfig/*
			chown -R 0:0 /etc/ppp
			chmod -R 700 /etc/ppp/*
			chown 0:0 /etc/ipsec.conf
			chmod 755 /etc/ipsec.conf
			chown -R 0:0 /etc/ipsec.d
			chmod -R 755 /etc/ipsec.d
			chown -R 0:0 /etc/minicom
			chmod 755 /etc/minicom
			chmod -R 644 /etc/minicom/*
		else
			echo "Continuing with a blank profile"
		fi
		break
	fi
	done
fi
fi
###
### This is the end of the section to mount /mnt/floppy 
### and to copy configuration data from the floppy
###


###
### This is the start of the section to unmount /mnt/floppy 
### if it is currently mounted
###

remaining=`cat /proc/mounts | awk '/( \/mnt\/floppy )/ { print $2 }'`
for i in "$remaining"; do
        umount $i
done
fi

###
### This is the end of the section to unmount /mnt/floppy 
### if it is currently mounted
###


###
### This is the start of the section to mount /root
###

#Create the /root partition for the root user
echo "Creating /root"
mke2fs -F -i 1024 -q /dev/rd/3 `grep -E -v "^#|^ *$" /etc/sysconfig/rd |grep "/root" |cut -f2`
echo "Mounting /mnt/etc"
mount /dev/rd/3 /root -o defaults,rw

###
### This is the end of the section to mount /root
###



#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "4700: Press Enter to Continue"
read A
#sleep 5
fi

#Debug
if [ "x$WATCHBOOT" = "xy" ]; then 
echo "Current file systems mounted"
mount
df -k
echo "4750: Press Enter to Continue"
read A
#sleep 10
fi


echo "*****************************"
echo "Finished /etc/rc.d/rc.iso"
echo "*****************************"


EOF

	cat > /etc/rc.d/rc.sysinit << "EOF"
#!/bin/bash
PATH="/usr/bin:/bin:/sbin:/usr/sbin:/usr/ssl/bin:/usr/X11R6/bin";export PATH
ln -s /dev/vc/1 /dev/tty1
ln -s /dev/vc/2 /dev/tty2
ln -s /dev/vc/3 /dev/tty3
ln -s /dev/vc/4 /dev/tty4
ln -s /dev/vc/5 /dev/tty5
ln -s /dev/vc/6 /dev/tty6

ln -s /dev/misc/psaux /dev/mouse


for (( i=10 ; i>0 ; i-- )) ; do
echo -en "Load config from floppy? [$i seconds] (y/N)   \r"
read -t 1 -s -n 1 CONFIGFLOPPY
if [ "x$CONFIGFLOPPY" = "xY" ]; then
        CONFIGFLOPPY=y
fi
if [ "x$CONFIGFLOPPY" = "xN" ]; then
        CONFIGFLOPPY=n
fi
if [ "x$CONFIGFLOPPY" = "xy" ]; then
        i=0
fi
if [ "x$CONFIGFLOPPY" = "xn" ]; then
        i=0
fi
done
echo "                                              "
export CONFIGFLOPPY

for (( i=10 ; i>0 ; i-- )) ; do
echo -en "Watch bootup steps? [$i seconds] (y/N)   \r"
read -t 1 -s -n 1 WATCHBOOT
if [ "x$WATCHBOOT" = "xY" ]; then
        WATCHBOOT=y
fi
if [ "x$WATCHBOOT" = "xN" ]; then
        WATCHBOOT=n
fi
if [ "x$WATCHBOOT" = "xy" ]; then
        i=0
fi
if [ "x$WATCHBOOT" = "xn" ]; then
        i=0
fi
done
echo "                                              "
export WATCHBOOT


if [ "x$WATCHBOOT" = "xy" ]; then
echo "*******************" >/dev/tty1
echo "Testing tty devices" >/dev/tty1
echo "*******************" >/dev/tty1

echo "You should have seen a test message just above"
echo "1000: Press Enter to Continue"
read A
fi


echo "****************************"
echo "Started /etc/rc.d/rc.sysinit"
echo "****************************"

if [ "x$WATCHBOOT" = "xy" ]; then
echo "Here is /dev"
ls -lR /dev
echo "2000: Press Enter to Continue"
read A
fi


echo "Mounting /proc"
mount -n -t proc /proc /proc

if [ "x$WATCHBOOT" = "xy" ]; then
cat /proc/mounts
echo "2500: Press Enter to Continue"
read A
fi


echo "Mounting /proc/bus/usb"
mount -t usbdevfs none /proc/bus/usb


ROOTFS=`grep "^\/dev\/root" /proc/mounts  |cut -d" " -f3`
echo "Root FS: $ROOTFS"

if [ "x$WATCHBOOT" = "xy" -a "x$ROOTFS" != "xiso9660" ]; then
echo "3000: Do you want to mount / as read-write (Press 'y' for yes, or press Enter to Continue"
read A
fi

if [ -e /stillbuilding.txt ]; then
        A=y
fi

if [ "x$A" = "xy" ] ; then
	fsck -y /dev/root
	#Remount root as read-write
	mount -n -o remount,rw /

	if [ "x$WATCHBOOT" = "xy" ]; then
		echo "4000: Both / and /proc should be mounted now.  Press Enter to Continue"
		read A
	fi

	mount -f remount,rw /

	if [ ! -d /usr/bin ] ; then
		mount /dev/ide/host0/bus0/target1/lun0/part2 /usr
	fi

else
	if [ ! -d /usr/bin ] ; then
		if [ -e /tpmusr.cloop ]; then
			modprobe cloop file=/tpmusr.cloop
			mount -o ro /dev/cloop/0 /usr
		else 
			mount -o ro /dev/ide/host0/bus0/target1/lun0/part2 /usr
		fi
	fi

	. /etc/rc.d/rc.iso
fi

grep "^root:" /etc/shadow |cut -d: -f2 |grep "^\!"
if [ $? -eq 0 ]; then
        echo "*******************************"
        echo "*                             *"
        echo "*     The root account is     *"
        echo "*     currently locked.       *"
        echo "*                             *"
        echo "*  You must enter a password  *"
        echo "*      before proceeding.     *"
        echo "*                             *"
        echo "*******************************"
	passwd root
fi


mount -f /proc

if [ "x$WATCHBOOT" = "xy" ]; then
	touch /etc/watchboot
	touch /etc/interactiveboot
fi

if [ -e /etc/watchboot ]; then
echo "Here are the current mounts"
mount
echo "5000: Press Enter to Continue"
read A
fi


#if [ -e /etc/watchboot ]; then
#echo "Enter a Command (or blank to continue)"
#echo -n ">"
#read A
#while [ "x$A" != "x" ]; do
#$A
#echo "Enter a Command (or blank to continue)"
#echo -n ">"
#read A
#done
#fi

echo "*****************************"
echo "Finished /etc/rc.d/rc.sysinit"
echo "*****************************"
EOF


	cat > /etc/rc.d/init.d/discovermodules << "EOF"
#!/bin/sh

. /etc/init.d/functions

if [ -e /etc/interactiveboot ]; then
        echo "Automatically load ethernet modules?"
        read A
        if [ "x$A" = "xn" -o "x$A" = "xN" ]; then
                exit 0
        fi
fi

INDEX=`cat /proc/pci |grep "Ethernet controller:" |wc -l`
ETHERNETS=`cat /proc/pci |grep "Ethernet controller:" |cut -d":" -f2 |tr " " "_"`
LIST=""

if [ -e /etc/watchboot ]; then
	echo "101000: Press Enter to Continue"
	read A
fi

for I in $ETHERNETS; do 
	logger -p kern.info "Ethernet controller: $I"

	case "$I" in
		*[Vv][Ii][Aa]*)
			echo "Adding VIA to probe list"
			LIST="via-rhine $LIST"
        	        ;;
	        *[Ll][Ii][Nn][Kk][Ss][Yy][Ss]*)
			echo "Adding Linksys to probe list"
			LIST="tulip $LIST"
			;;

	        *3[Cc]501*)
			echo "Adding 3c501 to probe list"
			LIST="3c501 $LIST"
			;;

	        *3[Cc]503*)
			echo "Adding 3c503 to probe list"
			LIST="3c503 $LIST"
			;;

	        *3[Cc]505*)
			echo "Adding 3c505 to probe list"
			LIST="3c505 $LIST"
			;;

	        *3[Cc]507*)
			echo "Adding 3c507 to probe list"
			LIST="3c507 $LIST"
			;;

	        *3[Cc]509*)
			echo "Adding 3c509 to probe list"
			LIST="3c509 $LIST"
			;;

	        *3[Cc]515*)
			echo "Adding 3c515 to probe list"
			LIST="3c515 $LIST"
			;;

	        *3[Cc]590*|*3[Cc]592*|*3[Cc]595*|*3[Cc]597*)
			echo "Adding 3c59x to probe list"
			LIST="3c59x $LIST"
			;;

	        *3[Cc]905*|*3[Cc]900*|*3[Cc]980*|*3[Cc][Ss][Oo][Hh][Oo]100*)
			echo "Adding 3c59x to probe list"
			LIST="3c59x $LIST"
			;;

	        *3[Cc]55[56]*|*3[Cc]575*|*3[Cc]450*|*3[Cc]920*|*3[Cc]982*)
			echo "Adding 3c59x to probe list"
			LIST="3c59x $LIST"
			;;

		*3[Cc][Oo][Mm]*)
			echo "Adding 3Com to probe list"
			LIST="3c501 3c503 3c505 3c507 3c509 3c515 3c59x 3c589 3c574 $LIST"
	                ;;

		*82557*)
			echo "Adding Intel Ethernet Pro 100 to probe list"
			LIST="eepro100 $LIST"
	                ;;			

		*8139*)
			echo "Adding RealTek RTL-8139 to probe list"
			LIST="8139too $LIST"
	                ;;			

		*82596*)
			echo "Adding 82596 to probe list"
			LIST="82596 $LIST"
	                ;;			

		*[Rr][Tt][Ll]8002*)
			echo "Adding Realtek Parallel to probe list"
			LIST="atp $LIST"
	                ;;			


		*[Dd][Ll]2000*)
			echo "Adding D-Link DL2000 to probe list"
			LIST="dl2k $LIST"
	                ;;			


		*[Nn][Ee]2000*)
			echo "Adding PCI NE2000 to probe list"
			LIST="ne2k-pci ne $LIST"
	                ;;			

		*[Nn][Ee]1000*)
			echo "Adding NE1000/NE2000 ISA/PnP to probe list"
			LIST="ne ne2k-pci $LIST"
	                ;;			

		*[Ww][Dd]80[01]3*)
			echo "Adding SMC Elite to probe list"
			LIST="wd $LIST"
	                ;;			

		*[Ww]89[Cc]840*)
			echo "Adding Winbond W89c840 to probe list"
			LIST="winbond-840 $LIST"
	                ;;			


		*[Uu][Ll][Tt][Rr][Aa]*)
			echo "Adding SMC Ultra to probe list"
			LIST="smc-ultra $LIST"
	                ;;			

		*[Pp][Cc][Nn][Ee][Tt]*)
			echo "Adding PCNet 32"
			LIST="pcnet32 $LIST"
	                ;;			

		*[Ss][Ii][Ss]900*)
			echo "Adding SiS900"
			LIST="sis900 $LIST"
			;;

		*)
			continue
			;;
	esac
done
echo "Probing Ethernet modules"

if [ "x$LIST" = "x" ] ; then
	LIST="3c501 3c503 3c505 3c507 3c509 3c515 3c59x via-rhine eepro100 tulip smc9194 smc-ultra wd ne2k-pci 8139too sis900 acenic dl2k e1000 ns83820 3c589 3c574 smc91c92 xirc2ps_cs"
fi


I=0
for DEVICE in $LIST ; do
	if [ -e /etc/watchboot ]; then
		echo "101050: Press Enter to Continue"
		read A
	fi

	echo -n "Probing for $DEVICE..."
	logger -p kern.info "Attempting to load module $DEVICE..."
	modprobe -q -s $DEVICE 2> /dev/null 1>/dev/null
	if [ $? -eq 0 ] ; then
		echo "Found and loading"
		insmod $DEVICE
		logger -p kern.info "Successfully loaded module $DEVICE"
		let I++
		if [ $I -ge $INDEX ]; then break; fi
	else
		logger -p kern.info "Could not load module $DEVICE"
		echo "Not Found"
	fi
done

#LIST=`ls -1 /lib/modules/2.4.22/kernel/drivers/net | awk -F. '{ print $1 }'`
EOF

	cat > /etc/rc.d/init.d/mountcdrom << "EOF"
#!/bin/sh

. /etc/init.d/functions

if [ -e /etc/interactiveboot ]; then
        echo "Automatically mount all IDE CDROMs?"
        read A
        if [ "x$A" = "xn" -o "x$A" = "xN" ]; then
                exit 0
        fi
fi


#This command retrieves all the IDE CDROM names
DISCS=`find /dev/ide -name cd`

#The first DOS mount would be 'c' drive, and in ASCII 'c' is 99
NEXTMOUNT=0


#Next, examine each IDE hard drive's partition table
# and try to mount any CDROMs
for CDROM in $DISCS ; do
	CDPATH=`echo "$NEXTMOUNT" | awk '{printf "/mnt/cdrom%d",$1}' `
	echo "Mounting $CDROM on $CDPATH"
	if [ ! -d  $CDPATH ] ; then
		echo "Creating mount point $CDPATH"
		mkdir -p $CDPATH
	fi
	mount $CDROM $CDPATH
	let NEXTMOUNT++
	if [ $NEXTMOUNT -gt 9 ] ; then exit ; fi
done
EOF

	cat > /etc/rc.d/init.d/mountswap << "EOF"
#!/bin/sh

. /etc/init.d/functions

swapon -a

EOF


	cat > /etc/rc.d/init.d/mountext2 << "EOF"
#!/bin/sh

. /etc/init.d/functions

#This command retrieves all the IDE hard drive names
DISCS=`find /dev/ide -name disc`

USRHOME=0
USRLOCAL=0
ETC=0

#Next, examine each IDE hard drive's partition table
# and try to mount any ext2 partitions
for PART in $DISCS ; do
	BASENAME=`dirname $PART`
	cd $BASENAME
	LINUXPARTS=`sfdisk -d disc | grep -i "Id=83" | awk '{ print $1 }'`
	for PARTTOMOUNT in $LINUXPARTS ; do
		LABEL=`e2label $BASENAME/$PARTTOMOUNT`
		if [ "x$LABEL" = "x/usr/local" ]; then
			if [ $USRLOCAL -eq 0 ]; then
				echo "mounting /usr/local"
				mount $BASENAME/$PARTTOMOUNT /usr/local
				USRLOCAL=1
			fi
		fi

		if [ "x$LABEL" = "x/etc" ]; then
			if [ $ETC -eq 0 ]; then
				echo "mounting /etc"
				mount $BASENAME/$PARTTOMOUNT /etc
				ETC=1
			fi
		fi

		if [ "x$LABEL" = "x/usr/home" ]; then
			if [ $USRHOME -eq 0 ]; then
				echo "mounting /usr/home"
				mount $BASENAME/$PARTTOMOUNT /usr/home
				USRHOME=1
			fi
		fi

	done
done
EOF

	cat > /etc/rc.d/init.d/discoverusb << "EOF"
#!/bin/sh

. /etc/init.d/functions

#USBINFO=`cat /proc/bus/usb/devices`
#echo ">>>$USBINFO"

9<>/proc/bus/usb/devices /etc/rc.d/init.d/probeusb
EOF


	cat > /etc/rc.d/init.d/probeusb << "EOF"
#!/bin/sh

. /etc/init.d/functions

workonlast() {
	echo 
	echo "Detected..."
	echo "Product: $PROD"
	echo "Bus: $BUS"
	echo "Manufacturer: $MAN"
	echo "Vendor: $VEND"
	echo "Serial Number: $SER"
}

PROD=""
BUS=""
MAN=""
VEND=""
SER=""

read -u 9 A
while [ "x$A" != "x" ]; do 
	case "$A" in
		T:*)
			if [ "x$BUS" != "x" ]; then
				workonlast
			fi
			PROD=""
			BUS="$A"
			MAN=""
			VEND=""
			SER=""
        	        ;;
		P:*)
			VEND="$A"
			;;
		S:*Product=*)
			PROD="$A"
			;;
		S:*SerialNumber=*)
			SER="$A"
			;;
		S:*Manufacturer=*)
			MAN="$A"
			;;
		*)
			;;
	esac
	

	read -u 9 A
done 
workonlast

EOF

	cat > /etc/rc.d/init.d/mountdos << "EOF"
#!/bin/sh

. /etc/init.d/functions

if [ -e /etc/interactiveboot ]; then
        echo "Automatically mount all DOS/NTFS partitions from IDE hard drives?"
        read A
        if [ "x$A" = "xn" -o "x$A" = "xN" ]; then
                exit 0
        fi
fi


#This command retrieves all the IDE hard drive names
DISCS=`find /dev/ide -name disc`

#The first DOS mount would be 'c' drive, and in ASCII 'c' is 99
NEXTMOUNT=99


#Next, examine each IDE hard drive's partition table
# and try to mount any Microsoft partitions
for PART in $DISCS ; do
	DRIVEDEV=`dirname $PART`
	cd $DRIVEDEV
	DOSPARTS=`sfdisk -l disc |egrep "FAT|NTFS" | awk '{ print $1 }'`
	for PARTTOMOUNT in $DOSPARTS ; do
		DOSPATH=`echo "$NEXTMOUNT" | awk '{printf "/mnt/ms/drive%c",$1}' `
		echo "Mounting $PARTTOMOUNT on $DOSPATH"
		if [ ! -d  $DOSPATH ] ; then
			echo "Creating mount point $DOSPATH"
			mkdir -p $DOSPATH
		fi
		mount $DRIVEDEV/$PARTTOMOUNT $DOSPATH
		let NEXTMOUNT++
		if [ $NEXTMOUNT -gt 122 ] ; then exit ; fi
	done
done
EOF


	cat > /etc/rc.d/init.d/ifup << "EOF"
#!/bin/sh

. $1

if [ "x$ONBOOT" = "xno" ] ; then
	echo "Interface $DEVICE will not be activated."
	exit -1
fi

if [ "x$WIRELESS" = "xyes" ] ; then
	echo -n "Trying to set up wireless on $DEVICE"
	CMDLINE="$DEVICE"

	if [ "x$WIRELESS_NICK" != "x" ] ; then
		CMDLINE="$CMDLINE nick \"$WIRELESS_NICK\""
	fi

	if [ "x$WIRELESS_MODE" != "x" ] ; then
		CMDLINE="$CMDLINE mode \"$WIRELESS_MODE\""
	fi

	if [ "x$WIRELESS_CHANNEL" != "x" ] ; then
		CMDLINE="$CMDLINE channel \"$WIRELESS_CHANNEL\""
	fi

	CMDLINEANYESSID="$CMDLINE essid any"
	if [ "x$WIRELESS_ESSID" != "x" ] ; then
		CMDLINE="$CMDLINE essid \"$WIRELESS_ESSID\""
	fi

	iwconfig $CMDLINE
	sleep 2
fi


echo -n "Trying to activate $DEVICE..."
ifconfig $DEVICE 2>>/dev/null 1>>/dev/null
if [ $? -ne 0 ] ; then
	echo "could not activate"
	exit -1
fi
echo "activated!"



if [ "x$WIRELESS" = "xyes" ] ; then
	if [ "x$WIRELESS_KEY" != "x" ] ; then
		iwconfig $DEVICE key $WIRELESS_KEY
		iwconfig $DEVICE key restricted
	fi

	iwconfig $CMDLINEANYESSID
	sleep 10

	iwconfig $CMDLINE
fi



# Check if DHCP should be used for interface
if [ "x$BOOTPROTO" = "xdhcp" ] ; then
	echo -n "Looking for DHCP address..."
	if dhcpcd -t 5 $DEVICE ; then
		echo "found DHCP address"
		let ACTIVEIP++
	else
		echo "Could not find DHCP address"
	fi
	exit -1
fi

# At this point, BOOTPROTO is assumed to be static,
# So try to use the IP configuration information
if [ "x$IPADDR" = "x" ] ; then
	if [ "x$IPADDR_START" = "x" ] ; then
		echo "No IP address specified for $DEVICE"
		exit -1
	else 
		if [ "x$CLONENUM_START" = "x" ] ; then
			CLONENUM=1
		else
			CLONENUM=$CLONENUM_START
		fi
		CMDLINE=""
	fi
else
	CMDLINE="$DEVICE $IPADDR"			
	CLONENUM=0
fi


if [ "x$NETMASK" != "x" ] ; then
	CMDLINE="$CMDLINE netmask $NETMASK"
fi

if [ "x$BROADCAST" != "x" ] ; then
	CMDLINE="$CMDLINE broadcast $BROADCAST"
fi


if [ $CLONENUM -gt 0 ] ; then
	NETADDR=`echo $IPADDR_START |cut -d. -f1-3`
	HOSTADDR=`echo $IPADDR_START |cut -d. -f4`
	ENDADDR=`echo $IPADDR_END |cut -d. -f4`
	
	for ((  ; HOSTADDR <= ENDADDR ; HOSTADDR++ )) ; do
		echo "ifconfig $DEVICE:$CLONENUM $NETADDR.$HOSTADDR"
		ifconfig $DEVICE:$CLONENUM $NETADDR.$HOSTADDR
		let CLONENUM++

	done
	
else 
	echo "ifconfig $CMDLINE"
	ifconfig $CMDLINE
	if [ $? -ne 0 ] ; then
		exit -1
	fi
fi


exit 0	
EOF
	cat > /etc/rc.d/init.d/network << "EOF"
#!/bin/sh

. /etc/init.d/functions

# Check if th /etc/sysconfig/network file exists
if [ ! -e /etc/sysconfig/network ] ; then
	echo
	echo "/etc/sysconfig/network does not exist. Networking will not be enabled."
	echo
	exit
fi

. /etc/sysconfig/network

# If the NETWORKING variable in /etc/sysconfig/network 
# is not yes, do not enable networking
if [ "x$NETWORKING" != "xyes" ] ; then
	echo 
	echo "Networking has been disabled in /etc/sysconfig/network"
	echo 
	exit
fi


# This script tries to automatically determine the
# appropriate network configuration.
# First, it will try to find a DHCP server and get an IP address.
# If that doesn't work...

ifconfig lo 127.0.0.1

#First, make sure dhcpcd is not already running
pkill dhcpcd
route delete default


#Now, go through the most likely devices and try to configure them



ACTIVEIP=0
IFCFGSCRIPTS=`ls -1 /etc/sysconfig/network-scripts/ifcfg-*`
for I in $IFCFGSCRIPTS ; do
	/etc/rc.d/init.d/ifup $I

	if [ $? -eq 0 ] ; then
		let ACTIVEIP++
	fi

	
done

echo "Active IPs $ACTIVEIP"
if [ "x$GATEWAY" != "x" -a $ACTIVEIP -ne 0  ] ; then
	echo "Adding default route"
	route add default gw $GATEWAY
fi

EOF

	cat > /etc/hosts << "EOF"
127.0.0.1	localhost	
EOF

	cat > /etc/motd << "EOF"








************************************************************
*                                                          *
* ThePacketMaster Linux Security Server v1.2.1             *
*                                                          *
* For information regarding this Linux distribution, and   *
* appropriate usage, please read the /README.txt file.     *
*                                                          *
* While this software is distributed under the GPL and     *
* free to anyone, please feel free to thank the author by  *
* donating some CPU cycles to my favorite distributed      *
* computing project, seti@home.  All you have to do is get *
* a Internet connection and type 'thanks' on the           *
* command line.                                            *
*                                                          *
*                                        ThePacketMaster   *
*                                                          *
************************************************************
EOF


	cat > /etc/rc.d/init.d/syslogd << "EOF"
#!/bin/bash

. /etc/init.d/functions

case "$1" in
  start|--start)
	echo "Starting syslogd"
	/usr/sbin/syslogd

	if [ -e /etc/watchboot ]; then
		echo "102050: Press any key to continue"
		read A
	fi

	;;


  stop|--stop)
	pkill syslogd
	;;

  *)
	echo "Usage: syslogd {start|stop}" >&2
	exit 2
esac

logger -p kern.info "ThePacketMaster Linux Security Server v1.2.1"

exit 0
EOF

	cat > /etc/rc.d/init.d/samba << "EOF"
#!/bin/sh
. /etc/init.d/functions


case "$1" in
  start|--start)
	/usr/sbin/smbd
	/usr/sbin/nmbd
	;;


  stop|--stop)
	pkill smbd
	pkill nmbd
	;;

  *)
	echo "Usage: samba {start|stop}" >&2
	exit 2
esac

exit 0
EOF


	cat > /etc/profile << "EOF"
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/X11R6/lib/pkgconfig:/usr/ssl/lib/pkgconfig:/usr/local/lib/pkgconfig/"
export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/lib/libgmp-i386:/usr/ssl/lib:/usr/X11R6/lib"
EOF

	cat > /etc/sysconfig/SAMPLE.iptables << "EOF"
# Generated by iptables-save v1.2.8 on Sat Jun  7 01:08:30 2003
*filter
:INPUT ACCEPT [48:4716]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [63:4812]
COMMIT
# Completed on Sat Jun  7 01:08:30 2003
EOF

	cat > /etc/sysconfig/SAMPLE.network << "EOF"
#NETWORKING=no
NETWORKING=yes
#HOSTNAME=thepacketmaster
GATEWAY=192.168.1.1
EOF

	cat > /etc/sysconfig/mouse << "EOF"
# start /etc/sysconfig/mouse
#MDEVICE could be /dev/cua/0 (serial) /dev/misc/psaux (PS/2)
MDEVICE=/dev/misc/psaux
#Discover protocols by running gpm -t -help
PROTOCOL=imps2
# end /etc/sysconfig/mouse
EOF

	cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << "EOF"
DEVICE=eth0
ONBOOT=no

###
### For a DHCP configuration use this section
###
#BOOTPROTO=dhcp

###
### For a static configuration use this section
###
#BOOTPROTO=static
#BROADCAST=192.168.1.255
#IPADDR=192.168.1.1
#NETMASK=255.255.255.0
#NETWORK=192.168.1.0

###
### If this is a wireless connection, use this section too
###
#WIRELESS=yes
#WIRELESS_MODULE=acx100sta
#WIRELESS_MODE=2
#WIRELESS_ESSID=12345678
#WIRELESS_CHANNEL=6
#WIRELESS_KEY=s:nottest123
#WIRELESS_RATE=
#WIRELESS_NICK=
#
EOF

	cat > /etc/sysconfig/network-scripts/ifcfg-eth1 << "EOF"
DEVICE=eth1
ONBOOT=no

###
### For a DHCP configuration use this section
###
#BOOTPROTO=dhcp

###
### For a static configuration use this section
###
#BOOTPROTO=static
#BROADCAST=192.168.1.255
#IPADDR=192.168.1.2
#NETMASK=255.255.255.0
#NETWORK=192.168.1.0

###
### If this is a wireless connection, use this section too
###
#WIRELESS=yes
#WIRELESS_MODULE=acx100sta
#WIRELESS_MODE=2
#WIRELESS_ESSID=12345678
#WIRELESS_CHANNEL=6
#WIRELESS_KEY=s:nottest123
#WIRELESS_RATE=
#WIRELESS_NICK=
#
EOF

	cat > /etc/sysconfig/network-scripts/ifcfg-eth2 << "EOF"
DEVICE=eth2
ONBOOT=no

###
### For a DHCP configuration use this section
###
#BOOTPROTO=dhcp

###
### For a static configuration use this section
###
#BOOTPROTO=static
#BROADCAST=192.168.1.255
#IPADDR=192.168.1.1
#NETMASK=255.255.255.0
#NETWORK=192.168.1.0

###
### If this is a wireless connection, use this section too
###
#WIRELESS=yes
#WIRELESS_MODULE=acx100sta
#WIRELESS_MODE=2
#WIRELESS_ESSID=12345678
#WIRELESS_CHANNEL=6
#WIRELESS_KEY=s:nottest123
#WIRELESS_RATE=
#WIRELESS_NICK=
#
EOF

	cat > /etc/sysconfig/network-scripts/ifcfg-eth3 << "EOF"
DEVICE=eth3
ONBOOT=no

###
### For a DHCP configuration use this section
###
#BOOTPROTO=dhcp

###
### For a static configuration use this section
###
#BOOTPROTO=static
#BROADCAST=192.168.1.255
#IPADDR=192.168.1.1
#NETMASK=255.255.255.0
#NETWORK=192.168.1.0

###
### If this is a wireless connection, use this section too
###
#WIRELESS=yes
#WIRELESS_MODULE=acx100sta
#WIRELESS_MODE=2
#WIRELESS_ESSID=12345678
#WIRELESS_CHANNEL=6
#WIRELESS_KEY=s:nottest123
#WIRELESS_RATE=
#WIRELESS_NICK=
#
EOF

	cat > /etc/sysconfig/rd << "EOF"
#This file contains settings to control
#the size of the ramdisks that are used
#for ThePacketMaster Linux
/etc	16384
/var	32768
/root	4096
EOF




	cat > /etc/fstab << "EOF"
none            /proc                   proc    defaults        0 0
none            /dev/shm                tmpfs   defaults        0 0
none            /dev/pts                devpts  gid=5,mode=620  0 0
EOF
	chmod 755 /etc/rc.d/init.d/*
	chmod 755 /etc/rc.d/rc*

	rm /etc/mtab	
	ln -s /proc/mounts /etc/mtab

	cd /etc/rc.d/rc3.d
	ln -s ../init.d/discovermodules S00discovermodules
	ln -s ../init.d/syslogd S05syslogd
	#ln -s ../init.d/mountswap S09mountswap
	ln -s ../init.d/mountdos S10mountdos
	ln -s ../init.d/mountcdrom S11mountcdrom
	#ln -s ../init.d/network S30network
	#ln -s ../init.d/iptables S60iptables

	cd /etc/rc.d/rc2.d
	ln -s ../init.d/discovermodules S00discovermodules
	ln -s ../init.d/mountdos S10mountdos
	ln -s ../init.d/mountcdrom S11mountcdrom

	cd /etc/rc.d/rc6.d
	rm -f /etc/rc.d/rc6.d/*
	ln -s ../init.d/killall S00killall
	ln -s ../init.d/halt S01reboot
	ls -1

	cd /etc/rc.d/rc0.d
	ln -s ../init.d/halt S01halt

	cd /etc/rc.d/rc1.d
	ln -s ../init.d/halt S01halt

	
	cd /etc
	rm -f rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d
	ln -s rc.d/rc0.d
	ln -s rc.d/rc1.d
	ln -s rc.d/rc2.d
	ln -s rc.d/rc3.d
	ln -s rc.d/rc4.d
	ln -s rc.d/rc5.d
	ln -s rc.d/rc6.d
	echo "TPM: Done making etc files" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
}

cleanuppackages() {

	#Clean up left over packages and the linux kernel
	cd /
	rm -f *.gz *.diff *.patch *.tgz *.bz2 *.zip *.tar
	rm -rf Libnet-1.0.2a
	rm -rf config* linux-2.4.*
	depmod -ae

	logmessage2 "Stripping debugging symbols"
	logdiskusage2

	find /usr/X11R6/bin -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /usr/sbin"
	logdiskusage2
	find /usr/X11R6/lib -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /usr/sbin"
	logdiskusage2
	find /usr/sbin -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /usr/sbin"
	logdiskusage2

	find /usr/bin -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /usr/bin"
	logdiskusage2
	find /usr/lib -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /usr/lib"
	logdiskusage2
	find /bin -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /bin"
	logdiskusage2
	find /sbin -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /sbin"
	logdiskusage2
	find /lib -type f -exec strip --strip-debug '{}' ';'
	logmessage2 "Done stripping /lib"
	logdiskusage2


	createarchivedirectory
}

createarchivedirectory() {
	echo "TPM: Creating archive directory" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE

	if [ ! -d /archive ]; then mkdir /archive; fi
	cd /archive
	rm -vrf /archive/etc
	cp -R /etc ./
	rm -vf /archive/etc/watchboot
	rm -vf /archive/etc/dhcpc/*

	cat > /archive/etc/shadow << "EOF"
root:!:12207:0:99999:7:::
EOF

	pwconv
	echo "TPM: Done creating archive directory" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE

}


compressmanpages() {
	logmessage2 "Compressing man pages..."
	cd /usr/share/man
	find ./ -name "*.[1-9]" -exec gzip -f -9 {} \;
	cd /usr/share/man/man1
	rm as86_encap.1 ex.1 pftp.1 red.1 reset.1 rview.1 rvim.1 view.1 
	ln -s as86.1.gz as86_encap.1.gz
	ln -s vim.1.gz ex.1.gz
	ln -s ftp.1.gz pftp.1.gz
	ln -s ed.1.gz red.1.gz
	ln -s tset.1.gz reset.1.gz
	ln -s vim.1.gz rview.1.gz
	ln -s vim.1.gz rvim.1.gz
	ln -s vim.1.gz view.1.gz

	cd /usr/share/man/man8
	rm tftpd.8 fingerd.8

	ln -s in.tftpd.8.gz tftpd.8.gz
	ln -s in.fingerd.8.gz fingerd.8.gz
	cd /

	find /usr/local/man -type f -name "*.[1-9]" -exec gzip -f -9 {} \;
	find /usr/ssl/man -type f -name "*.[1-9]" -exec gzip -f -9 {} \;
	find /usr/share/man -type f -name "*.[1-9]" -exec gzip -f -9 {} \;
	logmessage2 "Done compressing man pages..."

}


cleanstaticlibs() {
	find /usr/lib -name "*.a" -exec tar -rvf /tpmstaticlibs.tar {} \;
	find /usr/local -type f -name "*.a" -exec tar -rvf /tpmstaticlibs.tar {} \;
	find /usr/X11R6/ -name "*.a" -maxdepth 2 -exec tar -rvf /tpmstaticlibs.tar {} \;

	find /usr/lib -name "*.a" -exec rm -v {} \;
	find /usr/local -type f -name "*.a" -exec rm -v {} \;
	find /usr/X11R6/ -name "*.a" -maxdepth 2 -exec rm -v {} \;
}


setrootpasswd() {
	echo "TPM: Setting the root password" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE

	cat > /etc/shadow << "EOF"	
root:G9B/.wGBX3DmY:12250:0:99999:7:::
bin:x:12250:0:99999:7:::
daemon:x:12250:0:99999:7:::
adm:x:12250:0:99999:7:::
sync:x:12250:0:99999:7:::
shutdown:x:12250:0:99999:7:::
halt:x:12250:0:99999:7:::
uucp:x:12250:0:99999:7:::
sshd:x:12250:0:99999:7:::
nobody:x:12250:0:99999:7:::
ntop:x:12250:0:99999:7:::
mysql:x:12250:0:99999:7:::
EOF
	echo "TPM: Done setting the root password" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE

}


###
###
### This section is the beginning of all the package moving and cleanup
### functions.  These functions copy the source packages from the 
### source drive to the build partition and remove unnecessary files after
### they have been used.
### 
###

extractrootpackages() {
	cd $TPMSRCDIR
	cp binutils-2.14.tar.gz sed-4.0.7.tar.gz \
	grep-2.5.1.tar.gz findutils-4.1.tar.gz findutils-4.1.patch \
	tar-1.13.tar.gz gzip-1.2.4.tar.gz patch-2.5.4.tar.gz \
	gawk-3.1.3.tar.gz gawk-3.1.3.patch \
	coreutils-5.0.tar.gz gcc-core-3.2.3.tar.gz \
	make-3.80.tar.gz util-linux-2.11z.tar.gz bash-2.05b.tar.gz \
	diffutils-2.8.1.tar.gz bzip2-1.0.2.tar.gz texinfo-4.5.tar.gz \
	util-linux-2.12.tar.gz findutils-4.1.20.tar.gz texinfo-4.6.tar.gz \
	$TPMBUILD

}

extractserviceprovider() {
	cd $TPMSRCDIR
	cp openssl-0.9.7b.tar.gz \
	netkit-tftp-0.17.tar.gz netkit-ftp-0.17.tar.gz \
	netkit-telnet-0.17.tar.gz minicom-2.1.tar.gz \
	rp-pppoe-3.5.tar.gz netkit-telnet_0.17-20.diff /

	cp pine.tar.gz lynx2.8.4.tar.gz lsof_4.67.tar.gz \
	libpcap-0.7.2.tar.gz \
	cdrtools-2.00.3.tar.gz db-4.1.25.tar.gz /

	cp bind-9.2.2.tar.gz bsd-finger-0.17.tar.gz \
	nc110.tgz netcat-1.10.patch bsd-finger-0.17.patch /

	cp whois_4.6.7.tar.gz net-snmp-5.0.8.tar.gz \
	linux-2.4.22.tar.gz iptables-1.2.8.tar.bz2 \
	linux-2.4.21.tar.gz linux-2.4.20.tar.gz /

	cp arpwatch.tar.gz stunnel-3.24.tar.gz \ 
	bison-1.35.tar.gz /

}

extractafterchrootpackages() {
	echo "TPM: Extracting afterchroot packages..." 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd $TPMSRCDIR

	cp linux-2.4.22.tar.gz MAKEDEV-1.7 linux-2.4.21.tar.gz \
	linux-2.4.24.tar.gz \
	glibc-2.3.1.tar.gz glibc-linuxthreads-2.3.1.tar.gz \
	gcc-3.2.3.tar.gz zlib-1.1.4.tar.gz gawk-3.1.3.patch \
	gcc-3.3.1.tar.gz iw241_we16-6.diff linux-2.4.20.tar.gz \
	gawk-3.1.3.tar.gz ncurses-5.3.tar.gz vim-6.1.tar.gz \
	m4-1.4.tar.gz bison-1.875.tar.gz less-381.tar.gz groff-1.18.1.tar.gz \
	coreutils-5.0.tar.gz coreutils-5.0-hostname.patch sed-4.0.7.tar.gz \
	flex-2.5.4a.tar.gz gettext-0.12.1.tar.gz net-tools-1.60.tar.gz \
	perl-5.8.1.tar.gz autoconf-2.57.tar.gz \
	automake-1.7.7.tar.gz bash-2.05b.tar.gz file-4.05.tar.gz \
	findutils-4.1.20.tar.gz texinfo-4.6.tar.gz util-linux-2.12.tar.gz \
	$TPMBUILD

	cp libtool-1.5.tar.gz bin86-0.16.13.tar.gz \
	bzip2-1.0.2.tar.gz ed-0.2.tar.gz ed-0.2.patch \
	kbd-1.08.tar.gz kbd-1.08.patch diffutils-2.8.1.tar.gz \
	e2fsprogs-1.34.tar.gz grep-2.5.1.tar.gz man-pages-1.56.tar.gz \
	gzip-1.2.4.tar.gz gzip-1.2.4b.patch man-1.5m2.tar.gz \
	binutils-2.14.tar.gz \
	nasm-0.98.38.tar.gz lilo-22.5.7.2.tar.gz make-3.80.tar.gz \
	modutils-2.4.25.tar.gz netkit-base-0.17.tar.gz $TPMBUILD

	cp patch-2.5.4.tar.gz procinfo-18.tar.gz \
	procps-3.1.13.tar.gz psmisc-21.3.tar.gz \
	shadow-4.0.3.tar.gz sysklogd-1.4.1.tar.gz sysvinit-2.85.tar.gz \
	tar-1.13.tar.gz util-linux-2.11z.tar.gz \
	which-2.16.tar.gz $TPMBUILD

}

extractsecurityserver() {
	cd $TPMSRCDIR
	cp openssl-0.9.7b.tar.gz \
	netkit-tftp-0.17.tar.gz netkit-ftp-0.17.tar.gz \
	netkit-telnet-0.17.tar.gz minicom-2.1.tar.gz \
	rp-pppoe-3.5.tar.gz netkit-telnet_0.17-20.diff /

	cp pine.tar.gz lynx2.8.4.tar.gz lsof_4.67.tar.gz \
	libpcap-0.7.2.tar.gz ntop-2.2.tgz \
	cdrtools-2.00.3.tar.gz john-1.6.tar.gz db-4.1.25.tar.gz /

	cp ettercap-0.6.a.tar.gz nmap-3.27.tar.bz2 \
	nikto-current.tar.gz bind-9.2.2.tar.gz ngrep-1.40.1.tar.gz \
	p0f-1.8.3.tgz nbtscan-1.5.tar.gz bsd-finger-0.17.tar.gz \
	nc110.tgz netcat-1.10.patch bsd-finger-0.17.patch /

	cp whois_4.6.7.tar.gz tct-1.11.tar.gz hunt-1.5.tgz \
	libnasl-2.0.5.tar.gz nessus-core-2.0.5.tar.gz \
	nessus-libraries-2.0.5.tar.gz nessus-plugins-2.0.5.tar.gz \
	net-snmp-5.0.8.tar.gz \
	libnet-1.0.2a.tar.gz nemesis-1.4beta1.tar.gz \
	linux-2.4.22.tar.gz iptables-1.2.8.tar.bz2 \
	linux-2.4.21.tar.gz linux-2.4.20.tar.gz linux-2.4.24.tar.gz /

	cp crack5.0.tar.gz crack5.0.README dictionary \
	libnet.tar.gz packit-0.5.0.tgz firewalk.tar.gz \
	libdnet-1.7.tar.gz dsniff-2.3.tar.gz amap-2.7.tar.gz \
	libnids-1.17rc1.tar.gz chntpw-source-030126.zip \
	fragroute-1.2.tar.gz libevent-0.7a.tar.gz arpwatch.tar.gz \
	stunnel-3.24.tar.gz /

	cp \
	bison-1.35.tar.gz hydra-2.2.tar.gz \
	SVGATextMode-1.10-src.tar.gz wireless_tools.26.tar.gz \
	acx100_bin_20030626.tgz \
	iw240_we15-6.diff pkgconfig-0.15.0.tar.gz /
	
	cd /
}

extractsecurityworkstation() {
	echo "TPM: Extracting packages for security workstation" 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	cd $TPMSRCDIR
	cp openssl-0.9.7b.tar.gz \
	netkit-tftp-0.17.tar.gz netkit-ftp-0.17.tar.gz \
	netkit-telnet-0.17.tar.gz minicom-2.1.tar.gz \
	rp-pppoe-3.5.tar.gz netkit-telnet_0.17-20.diff /

	cp pine.tar.gz lynx2.8.4.tar.gz lsof_4.67.tar.gz \
	libpcap-0.7.2.tar.gz ntop-2.2.tgz \
	cdrtools-2.00.3.tar.gz john-1.6.tar.gz db-4.1.25.tar.gz /

	cp ettercap-0.6.a.tar.gz nmap-3.27.tar.bz2 \
	nikto-current.tar.gz bind-9.2.2.tar.gz ngrep-1.40.1.tar.gz \
	p0f-1.8.3.tgz nbtscan-1.5.tar.gz bsd-finger-0.17.tar.gz \
	nc110.tgz netcat-1.10.patch bsd-finger-0.17.patch /

	cp whois_4.6.7.tar.gz tct-1.11.tar.gz hunt-1.5.tgz \
	libnasl-2.0.5.tar.gz nessus-core-2.0.5.tar.gz \
	nessus-libraries-2.0.5.tar.gz nessus-plugins-2.0.5.tar.gz \
	net-snmp-5.0.8.tar.gz \
	libnet-1.0.2a.tar.gz nemesis-1.4beta1.tar.gz \
	linux-2.4.22.tar.gz linux-2.4.21.tar.gz
	iptables-1.2.8.tar.bz2 linux-2.4.20.tar.gz linux-2.4.23.tar.gz /

	cp crack5.0.tar.gz crack5.0.README dictionary \
	libnet.tar.gz packit-0.5.0.tgz firewalk.tar.gz \
	libdnet-1.7.tar.gz dsniff-2.3.tar.gz amap-2.7.tar.gz \
	libnids-1.17rc1.tar.gz chntpw-source-030126.zip \
	fragroute-1.2.tar.gz libevent-0.7a.tar.gz arpwatch.tar.gz \
	stunnel-3.24.tar.gz /

	cp \
	bison-1.35.tar.gz hydra-2.2.tar.gz \
	SVGATextMode-1.10-src.tar.gz wireless_tools.26.tar.gz \
	acx100_bin_20030626.tgz /

	cp libpng-1.2.5.tar.gz X430src-1.tgz X430src-2.tgz \
	X430src-3.tgz X430src-4.tgz X430src-5.tgz \
	pkgconfig-0.15.0.tar.gz \
	pango-1.2.2.tar.gz  gtk+-2.2.1.tar.gz atk-1.2.0.tar.gz \
	gtk+-1.2.9.tar.gz opera-7.11-20030515.1-static-qt.i386.tar.gz \
	linux-507.tar.gz gpsdrive-1.32.tar.gz iw240_we15-6.diff /

	cp libsigc++-1.0.4.tar.gz gtkmm-1.2.10.tar.gz \
	libxml2-2.5.8.tar.gz libxslt-1.0.30.tar.gz \
	libfwbuilder-1.0.0.tar.gz fwbuilder-1.0.10.tar.gz \
	xinetd-2.3.11.tar.gz gdk-pixbuf-0.22.0.tar.gz \
	gpsdrive-1.32.tar.gz /

	echo "TPM: Done extracting packages for security workstation" 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE

}


extractafterchroot2packages() {
	echo "TPM: Extracting afterchroot2 packages..." 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd $TPMBUILD
#	cp $TPMSRCDIR/config ./
#	cp $TPMSRCDIR/config2 ./
#	cp $TPMSRCDIR/linux-2.4.22.tar.gz ./
#	cp $TPMSRCDIR/linux-2.4.21.tar.gz ./
	cp $TPMSRCDIR/linux-2.4.20.tar.gz ./
	cp $TPMSRCDIR/linux-2.4.24.tar.gz ./
	cp $TPMSRCDIR/config1-20031118  ./
	cp $TPMSRCDIR/config-2421-20031122  ./
	cp $TPMSRCDIR/config-2420-20031123  ./
	cp $TPMSRCDIR/config-2420-20031124  ./
	cp $TPMSRCDIR/config-2423-20031130  ./
	cp $TPMSRCDIR/config-2424-20040105  ./
	cp $TPMSRCDIR/iw241_we16-6.diff  ./
}




cleanup() {
	echo "TPM: Cleaning up file system" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE

	rm -f /bin/sh
	ln -s bash /bin/sh
	mkdir -p /mnt/ms/drivec
	mkdir /mnt/ms/drived
	mkdir /mnt/ms/drivee
	mkdir /mnt/ms/drivef
	mkdir /mnt/ms/driveg
	mkdir /mnt/ms/driveh
	mkdir /mnt/ms/drivei
	mkdir /mnt/ms/drivej
	mkdir /mnt/ms/drivek
	mkdir /mnt/ms/drivel
	mkdir /mnt/ms/drivem
	mkdir /mnt/ms/driven
	mkdir /mnt/ms/driveo
	mkdir /mnt/ms/drivep
	mkdir /mnt/ms/driveq
	mkdir /mnt/ms/driver
	mkdir /mnt/ms/drives
	mkdir /mnt/ms/drivet
	mkdir /mnt/ms/driveu
	mkdir /mnt/ms/drivev
	mkdir /mnt/ms/drivew
	mkdir /mnt/ms/drivex
	mkdir /mnt/ms/drivey
	mkdir /mnt/ms/drivez
	mkdir /mnt/floppy
	mkdir /mnt/cdrom0
	mkdir /mnt/cdrom1
	mkdir /mnt/cdrom2
	mkdir /mnt/cdrom3
	mkdir -p /mnt/etc
	mkdir -p /archive/etc
	ln -s /usr/share/locale /usr/lib/locale
	rm -rf /tmp
	ln -s /var/tmp /tmp

}

cleanupbeforesecurityserver() {
	cleantcsh
	cleanopenssl
	cleandhcpcd
	cleansamba
	cleannetkittftp
	cleannetkitftp
	cleannetkittelnet
	cleanminicom
	cleangpm
	cleanrp
	cleanzip
	cleanopenssh
	cleanscreen
	cleanlynx
	cleanlibnids
	cleanlibnet
	cleanlibpcap
	cleantcpdump
	cleanlsof
	cleanhping2
	cleangdbm
 	cleanntop
	cleantraceroute
	cleanjohntheripper
	cleanettercap
	cleannmap
	cleannikto
	cleanbind
	cleanngrep
	cleanp0f
	cleannbtscan
	cleanfinger
	cleannetcat
	cleanwhois
	cleantct
	cleanhunt
	cleannessus
	cleanethereal
	cleannetsnmp
	cleannemesis
	cleansetiathome
	cleangmp
	cleanfreeswan
	cleaniptables
	cleancrack
	cleanpackit
	cleanlibdnet
	cleanfirewalk
	cleandb
	cleanamap
	cleanchntpw
	cleanxprobe2
	cleantcpreplay
	cleanstunnel
	cleanarpwatch
	cleanlibevent
	cleanfragroute
	cleansara
	cleanoldbison
	cleanwuftpd
	cleanhydra
	cleanpine
	cleanwirelesstools
	cleanacx100binary
	cleangpsd
	cleankismet
	cleanglib
	cleanfontconfig


}


cleanupbeforesecurityworkstation() {
	echo "TPM: Removing any previously existing security workstation packages" 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
	cleantcsh
	cleanopenssl
	cleandhcpcd
	cleansamba
	cleannetkittftp
	cleannetkitftp
	cleannetkittelnet
	cleanminicom
	cleangpm
	cleanrp
	cleanzip
	cleanopenssh
	cleanscreen
	cleanlynx
	cleanlibnids
	cleanlibnet
	cleanlibpcap
	cleantcpdump
	cleanlsof
	cleanhping2
	cleangdbm
 	cleanntop
	cleantraceroute
	cleanjohntheripper
	cleanettercap
	cleannmap
	cleannikto
	cleanbind
	cleanngrep
	cleanp0f
	cleannbtscan
	cleanfinger
	cleannetcat
	cleanwhois
	cleantct
	cleanhunt
	cleannessus
	cleanethereal
	cleannetsnmp
	cleannemesis
	cleansetiathome
	cleangmp
	cleanfreeswan
	cleaniptables
	cleancrack
	cleanpackit
	cleanlibdnet
	cleanfirewalk
	cleandb
	cleanamap
	cleanchntpw
	cleanxprobe2
	cleantcpreplay
	cleanstunnel
	cleanarpwatch
	cleanlibevent
	cleanfragroute
	cleansara
	cleanoldbison
	cleanwuftpd
	cleanhydra
	cleanpine
	cleanwirelesstools
	cleanacx100binary
	cleangpsd
	cleankismet
	echo "TPM: Done removing any previously existing security workstation packages" 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
}

cleanrootpackages() {
	echo "TPM: Clean root packages..." 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	cd $TPMBUILD
	rm -vf binutils-2.14.tar.gz sed-4.0.7.tar.gz \
	grep-2.5.1.tar.gz findutils-4.1.tar.gz findutils-4.1.patch \
	tar-1.13.tar.gz gzip-1.2.4.tar.gz patch-2.5.4.tar.gz \
	gawk-3.1.3.tar.gz gawk-3.1.3.patch \
	coreutils-5.0.tar.gz gcc-core-3.2.3.tar.gz \
	make-3.80.tar.gz util-linux-2.11z.tar.gz bash-2.05b.tar.gz \
	diffutils-2.8.1.tar.gz bzip2-1.0.2.tar.gz texinfo-4.5.tar.gz \
	
}


cleanafterchrootpackages() {
	cd $TPMBUILD
	rm -vf linux-2.4.22.tar.gz MAKEDEV-1.7 \
	glibc-2.3.1.tar.gz glibc-linuxthreads-2.3.1.tar.gz \
	gcc-3.2.3.tar.gz zlib-1.1.4.tar.gz findutils-4.1.tar.gz \
	findutils-4.1.patch findutils-4.1-segfault.patch \
	gawk-3.1.3.tar.gz gawk-3.1.3.patch \
	ncurses-5.3.tar.gz vim-6.1.tar.gz \
	m4-1.4.tar.gz bison-1.875.tar.gz less-381.tar.gz groff-1.18.1.tar.gz \
	coreutils-5.0.tar.gz coreutils-5.0-hostname.patch sed-4.0.7.tar.gz \
	flex-2.5.4a.tar.gz gettext-0.12.1.tar.gz net-tools-1.60.tar.gz \
	perl-5.8.1.tar.gz texinfo-4.5.tar.gz autoconf-2.57.tar.gz \
	automake-1.7.7.tar.gz bash-2.05b.tar.gz file-4.05.tar.gz

	rm -vf libtool-1.5.tar.gz bin86-0.16.13.tar.gz \
	bzip2-1.0.2.tar.gz ed-0.2.tar.gz ed-0.2.patch \
	kbd-1.08.tar.gz kbd-1.08.patch diffutils-2.8.1.tar.gz \
	e2fsprogs-1.34.tar.gz grep-2.5.1.tar.gz man-pages-1.56.tar.gz \
	gzip-1.2.4.tar.gz gzip-1.2.4b.patch man-1.5l.tar.gz \
	man-1.5k-manpath.patch man-1.5k-pager.patch man-1.5k-80cols.patch \
	binutils-2.14.tar.gz \
	nasm-0.98.38.tar.gz lilo-22.5.7.2.tar.gz make-3.80.tar.gz \
	modutils-2.4.25.tar.gz netkit-base-0.17.tar.gz 

	rm -vf patch-2.5.4.tar.gz procinfo-18.tar.gz \
	procps-3.1.13.tar.gz psmisc-21.3.tar.gz \
	shadow-4.0.3.tar.gz sysklogd-1.4.1.tar.gz sysvinit-2.85.tar.gz \
	tar-1.13.tar.gz util-linux-2.11z.tar.gz \
	which-2.16.tar.gz 

}

cleanafterchroot2packages() {
	echo "TPM: Cleaning afterchroot2 packages..." 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	rm -vf linux-2.4.22.tar.gz config
}


cleanupbeforeserviceprovider() {
	cleantcsh
	cleanopenssl
	cleandhcpcd
	cleansamba
	cleannetkittftp
	cleannetkitftp
	cleannetkittelnet
	cleanminicom
	cleangpm
	cleanrp
	cleanzip
	cleanopenssh
	cleanscreen
	cleanlynx
	cleanlibpcap
	cleantcpdump
	cleanlsof
	cleangdbm
	cleantraceroute
	cleanbind
	cleanfinger
	cleannetcat
	cleanwhois
	cleannetsnmp
	cleansetiathome
	cleangmp
	cleanfreeswan
	cleaniptables
	cleanstunnel
	cleanarpwatch
	cleanoldbison
	cleanwuftpd
	cleanpine
	cleanxinetd

	#cleansendmail
	#cleanqpopper
	#cleanimapd
	#cleancurl
	#cleanxmlparser
	#cleanpdflib-4.0.3
	#cleanphp
	#cleanzend
	#cleanntp

}

createcompressedusr() {
	mkisofs -R -o /tpmusr.iso /usr
	create_compressed_fs /tpmusr.iso 65536 > /tpmusr.cloop
	rm -f /tpmusr.iso
}


testdrivers() {

	if [ -e /lib/modules/2.4.20/kernel/drivers/block/loop.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/block/loop.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/aztcd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/aztcd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/cdu31a.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/cdu31a.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/cm206.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/cm206.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/gscd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/gscd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/isp16.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/isp16.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/mcd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/mcd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/mcdx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/mcdx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/optcd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/optcd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/sbpcd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/sbpcd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/sjcd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/sjcd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/cdrom/sonycd535.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/cdrom/sonycd535.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/atixlmouse.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/atixlmouse.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/busmouse.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/busmouse.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/cyclades.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/cyclades.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/i8k.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/i8k.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/logibusmouse.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/logibusmouse.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/mk712.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/mk712.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/msbusmouse.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/msbusmouse.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/n_hdlc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/n_hdlc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/nvram.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/nvram.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/pc110pad.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/pc110pad.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/qpmouse.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/qpmouse.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/char/toshiba.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/char/toshiba.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/input/input.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/input/input.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/input/keybdev.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/input/keybdev.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/input/mousedev.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/input/mousedev.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/3c501.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/3c501.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/3c503.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/3c503.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/3c505.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/3c505.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/3c507.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/3c507.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/3c509.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/3c509.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/3c515.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/3c515.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/3c59x.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/3c59x.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/8139too.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/8139too.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/82596.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/82596.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/acenic.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/acenic.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/aironet4500_card.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/aironet4500_card.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/aironet4500_core.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/aironet4500_core.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/aironet4500_proc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/aironet4500_proc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/arlan-proc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/arlan-proc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/arlan.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/arlan.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/at1700.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/at1700.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/atp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/atp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/bsd_comp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/bsd_comp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/cs89x0.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/cs89x0.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/de4x5.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/de4x5.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/de600.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/de600.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/de620.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/de620.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/depca.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/depca.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/dgrs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/dgrs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/dl2k.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/dl2k.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/dmfe.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/dmfe.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/dummy.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/dummy.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/e2100.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/e2100.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/eepro.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/eepro.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/eepro100.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/eepro100.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/eexpress.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/eexpress.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/epic100.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/epic100.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/eth16i.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/eth16i.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ewrk3.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ewrk3.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/fealnx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/fealnx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/hp-plus.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/hp-plus.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/hp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/hp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/hp100.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/hp100.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/lance.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/lance.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/lp486e.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/lp486e.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/mii.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/mii.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/natsemi.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/natsemi.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ne.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ne.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ne2k-pci.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ne2k-pci.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ni5010.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ni5010.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ni52.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ni52.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ni65.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ni65.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ns83820.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ns83820.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcnet32.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcnet32.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ppp_async.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ppp_async.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ppp_deflate.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ppp_deflate.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ppp_generic.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ppp_generic.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/ppp_synctty.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/ppp_synctty.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pppoe.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pppoe.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pppox.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pppox.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/sis900.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/sis900.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/slhc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/slhc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/slip.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/slip.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/smc-ultra.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/smc-ultra.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/smc9194.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/smc9194.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/starfire.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/starfire.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/strip.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/strip.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/sundance.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/sundance.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tc35815.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tc35815.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tlan.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tlan.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/via-rhine.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/via-rhine.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wavelan.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wavelan.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/winbond-840.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/winbond-840.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/e100/e100.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/e100/e100.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/e1000/e1000.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/e1000/e1000.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/3c574_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/3c574_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/3c589_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/3c589_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/aironet4500_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/aironet4500_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/netwave_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/netwave_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/ray_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/ray_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/smc91c92_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/smc91c92_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/wavelan_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/wavelan_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/pcmcia/xirc2ps_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/pcmcia/xirc2ps_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/3c359.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/3c359.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/abyss.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/abyss.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/ibmtr.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/ibmtr.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/lanstreamer.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/lanstreamer.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/olympic.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/olympic.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/smctr.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/smctr.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/tms380tr.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/tms380tr.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/tmsisa.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/tmsisa.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tokenring/tmspci.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tokenring/tmspci.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/tulip/tulip.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/tulip/tulip.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wireless/airo.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wireless/airo.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wireless/airo_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wireless/airo_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wireless/hermes.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wireless/hermes.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco_cs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco_cs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco_pci.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco_pci.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco_plx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/wireless/orinoco_plx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/acx100sta.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/acx100sta.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/net/acx100_pci.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/net/acx100_pci.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/3w-xxxx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/3w-xxxx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/53c7,8xx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/53c7,8xx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/AM53C974.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/AM53C974.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/BusLogic.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/BusLogic.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/NCR53c406a.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/NCR53c406a.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/a100u2w.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/a100u2w.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/advansys.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/advansys.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/aha152x.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/aha152x.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/aha1542.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/aha1542.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/aha1740.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/aha1740.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/atp870u.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/atp870u.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/cpqfc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/cpqfc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/dmx3191d.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/dmx3191d.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/dpt_i2o.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/dpt_i2o.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/dtc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/dtc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/eata.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/eata.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/eata_dma.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/eata_dma.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/eata_pio.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/eata_pio.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/fdomain.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/fdomain.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/g_NCR5380.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/g_NCR5380.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/gdth.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/gdth.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/in2000.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/in2000.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/initio.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/initio.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/ips.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/ips.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/megaraid.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/megaraid.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/ncr53c8xx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/ncr53c8xx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/pas16.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/pas16.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/pci2000.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/pci2000.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/pci2220i.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/pci2220i.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/psi240i.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/psi240i.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/qla1280.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/qla1280.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/qlogicfas.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/qlogicfas.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/qlogicfc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/qlogicfc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/qlogicisp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/qlogicisp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/seagate.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/seagate.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/sim710.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/sim710.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/sym53c416.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/sym53c416.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/t128.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/t128.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/tmscsim.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/tmscsim.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/u14-34f.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/u14-34f.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/ultrastor.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/ultrastor.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/wd7000.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/wd7000.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/scsi/sym53c8xx_2/sym53c8xx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/scsi/sym53c8xx_2/sym53c8xx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/ac97.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/ac97.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/ac97_codec.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/ac97_codec.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/aci.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/aci.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/ad1816.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/ad1816.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/ad1848.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/ad1848.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/adlib_card.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/adlib_card.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/ali5455.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/ali5455.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/awe_wave.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/awe_wave.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/btaudio.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/btaudio.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/cs4232.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/cs4232.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/cs46xx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/cs46xx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/es1370.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/es1370.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/es1371.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/es1371.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/esssolo1.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/esssolo1.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/forte.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/forte.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/gus.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/gus.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/i810_audio.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/i810_audio.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/maestro.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/maestro.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/maestro3.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/maestro3.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/maui.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/maui.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/mpu401.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/mpu401.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/nm256_audio.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/nm256_audio.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/opl3.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/opl3.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/opl3sa.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/opl3sa.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/opl3sa2.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/opl3sa2.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/pas2.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/pas2.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/rme96xx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/rme96xx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/sb.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/sb.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/sb_lib.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/sb_lib.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/sgalaxy.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/sgalaxy.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/sonicvibes.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/sonicvibes.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/sound.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/sound.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/soundcore.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/soundcore.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/sscape.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/sscape.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/trident.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/trident.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/trix.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/trix.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/uart401.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/uart401.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/uart6850.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/uart6850.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/v_midi.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/v_midi.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/wavefront.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/wavefront.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/ymfpci.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/ymfpci.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/sound/cs4281/cs4281.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/sound/cs4281/cs4281.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/usb/hid.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/usb/hid.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/usb/printer.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/usb/printer.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/usb/usbkbd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/usb/usbkbd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/drivers/usb/usbmouse.o ]; then echo "Driver /lib/modules/2.4.20/kernel/drivers/usb/usbmouse.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/ext3/ext3.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/ext3/ext3.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/fat/fat.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/fat/fat.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/jbd/jbd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/jbd/jbd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/lockd/lockd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/lockd/lockd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/msdos/msdos.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/msdos/msdos.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nfs/nfs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nfs/nfs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nfsd/nfsd.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nfsd/nfsd.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nls/nls_cp437.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nls/nls_cp437.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nls/nls_cp850.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nls/nls_cp850.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nls/nls_cp863.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nls/nls_cp863.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nls/nls_iso8859-1.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nls/nls_iso8859-1.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nls/nls_iso8859-15.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nls/nls_iso8859-15.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/nls/nls_utf8.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/nls/nls_utf8.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/ntfs/ntfs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/ntfs/ntfs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/smbfs/smbfs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/smbfs/smbfs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/ufs/ufs.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/ufs/ufs.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/fs/vfat/vfat.o ]; then echo "Driver /lib/modules/2.4.20/kernel/fs/vfat/vfat.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/8021q/8021q.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/8021q/8021q.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/appletalk/appletalk.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/appletalk/appletalk.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/bridge/bridge.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/bridge/bridge.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/core/pktgen.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/core/pktgen.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/arp_tables.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/arp_tables.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/arptable_filter.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/arptable_filter.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_conntrack.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_conntrack.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_conntrack_ftp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_conntrack_ftp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_conntrack_irc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_conntrack_irc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_nat_ftp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_nat_ftp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_nat_irc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_nat_irc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_tables.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ip_tables.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_DSCP.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_DSCP.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ECN.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ECN.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_LOG.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_LOG.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_MARK.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_MARK.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_MASQUERADE.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_MASQUERADE.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_MIRROR.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_MIRROR.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_REDIRECT.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_REDIRECT.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_REJECT.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_REJECT.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_TCPMSS.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_TCPMSS.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_TOS.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_TOS.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ULOG.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ULOG.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ah.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ah.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_conntrack.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_conntrack.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_dscp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_dscp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ecn.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ecn.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_esp.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_esp.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_helper.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_helper.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_length.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_length.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_limit.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_limit.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_mac.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_mac.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_mark.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_mark.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_multiport.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_multiport.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_owner.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_owner.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_pkttype.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_pkttype.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_state.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_state.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_tcpmss.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_tcpmss.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_tos.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_tos.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ttl.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_ttl.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_unclean.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_unclean.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/iptable_filter.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/iptable_filter.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/iptable_mangle.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/iptable_mangle.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv4/netfilter/iptable_nat.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv4/netfilter/iptable_nat.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/ipv6.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/ipv6.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6_tables.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6_tables.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_LOG.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_LOG.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_MARK.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_MARK.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_eui64.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_eui64.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_length.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_length.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_limit.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_limit.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_mac.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_mac.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_mark.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_mark.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_multiport.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_multiport.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_owner.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6t_owner.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6table_filter.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6table_filter.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6table_mangle.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipv6/netfilter/ip6table_mangle.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/ipx/ipx.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/ipx/ipx.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/net/sunrpc/sunrpc.o ]; then echo "Driver /lib/modules/2.4.20/kernel/net/sunrpc/sunrpc.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/lib/zlib_deflate/zlib_deflate.o ]; then echo "Driver /lib/modules/2.4.20/kernel/lib/zlib_deflate/zlib_deflate.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/lib/zlib_inflate/zlib_inflate.o ]; then echo "Driver /lib/modules/2.4.20/kernel/lib/zlib_inflate/zlib_inflate.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/kernel/arch/i386/kernel/cpuid.o ]; then echo "Driver /lib/modules/2.4.20/kernel/arch/i386/kernel/cpuid.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/net/ath_hal.o ]; then echo "Driver /lib/modules/2.4.20/net/ath_hal.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/net/wlan.o ]; then echo "Driver /lib/modules/2.4.20/net/wlan.o is missing"; exit -1; fi
	if [ -e /lib/modules/2.4.20/net/ath_pci.o ]; then echo "Driver /lib/modules/2.4.20/net/ath_pci.o is missing"; exit -1; fi



}


testnetworkinit() {
	#Test network initialization scripts
	cat > /etc/sysconfig/network << "EOF"
NETWORKING=yes
GATEWAY=192.168.200.1
EOF

	cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << "EOF"
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.200.50
NETMASK=255.255.255.0
NETWORK=192.168.200.0
BROADCAST=192.168.200.255
EOF

	/etc/init.d/network

	ifconfig eth0 |grep -c "192\.168\.200\.50"
	if [ $? -ne 0 ]; then echo "eth0 IP address was not set." ;exit -1; fi

	ifconfig lo |grep -c "127\.0\.0\.1"
	if [ $? -ne 0 ]; then echo "Loopback IP address was not set." ;exit -1; fi

	ping -c 5 192.168.200.50
	if [ $? -ne 0 ]; then echo "Could not ping 192.168.200.50" ;exit -1; fi

	ping -c 5 127.0.0.1
	if [ $? -ne 0 ]; then echo "Could not ping 127.0.0.1" ;exit -1; fi


	echo "Network initialization test: [ SUCCESSFUL ]"

}

testdhcpcd() {
	dhcpcd eth0
	if [ $? -ne 0 ]; then echo "Unable to get dhcp address for eth0" ;exit -1; fi

	pgrep dhcpcd
	if [ $? -ne 0 ]; then echo "dhcpcd not running" ;exit -1; fi

	ifconfig eth0 |grep -c "inet addr:"
	if [ $? -ne 0 ]; then echo "eth0 IP address was not set by dhcpcd." ;exit -1; fi

	pkill dhcpcd
	if [ $? -ne 0 ]; then echo "Unable to kill dhcpcd process" ;exit -1; fi
}


testopenssh() {
	if [ -e /var/tmp/testuser ]; then
		echo "Clearing previous /var/tmp/testuser"
		rm -rf /var/tmp/testuser
		if [ $? -ne 0 ]; then echo "failed to remove directory" ;exit -1; fi
	fi
	mkdir -p /var/tmp/testuser/.ssh
	
	/etc/init.d/openssh start
	if [ $? -ne 0 ]; then echo "openssh init script failed to start openssh" ;exit -1; fi

	pgrep -lf sshd
	if [ $? -ne 0 ]; then echo "openssh process not running" ;exit -1; fi

	lsof |grep sshd |grep TCP |grep ":22"
	if [ $? -ne 0 ]; then echo "openssh process not listening" ;exit -1; fi

	echo "testuser:x:1000:1000:testuser:/var/tmp/testuser:/bin/bash" >>/etc/passwd
	pwconv
	if [ $? -ne 0 ]; then echo "Unable to initialize shadow for testuser" ;exit -1; fi

	echo "testuser:x:1000:" >>/etc/group

	chown -R testuser:testuser /var/tmp/testuser
	if [ $? -ne 0 ]; then exit -1; fi

	passwd -l testuser
	if [ $? -ne 0 ]; then exit -1; fi

	echo -e "\n\n" | ssh-keygen -t rsa -f /var/tmp/testuser/.ssh/identity -N ""
	if [ $? -ne 0 ]; then echo "testuser ssh-keygen failed" ;exit -1; fi

	cp /var/tmp/testuser/.ssh/identity.pub /var/tmp/testuser/.ssh/authorized_keys
	if [ $? -ne 0 ]; then exit -1; fi

	cd /var/tmp/testuser
	if [ $? -ne 0 ]; then echo "could not change to /var/tmp/testuser" ;exit -1; fi


	scp -i /var/tmp/testuser/.ssh/identity testuser@testhost:/README.txt /var/tmp/testuser/
	if [ $? -ne 0 ]; then echo "scp failed" ;exit -1; fi

	if [ ! -e /var/tmp/testuser/README.txt ]; then echo "scp failed to copy file"; exit -1; fi

	/etc/init.d/openssh stop
	if [ $? -ne 0 ]; then echo "openssh init script failed to stop openssh" ;exit -1; fi

	pgrep -lf sshd
	if [ $? -eq 0 ]; then echo "openssh process is still running" ;exit -1; fi

	echo "OpenSSH test: [ SUCCESSFUL ]"

}

###
###
### This section is the beginning of all the various log functions
###
###

# This log function should be used in other functions that are not
# running in a chroot
logmessage() {
	THEDATE=`date "+%Y/%m/%d %H:%M:%S"`	
	echo "$1"
	echo "TPM: $THEDATE $1" 2>> $TPMBUILDLOG 1>> $TPMBUILDLOG
}

# This log function should be used in other functions that are running
# in a chroot
logmessage2() {
	THEDATE=`date "+%Y/%m/%d %H:%M:%S"`	
	echo "$1"
	echo "TPM: $THEDATE $1" 2>> $TPMBUILDLOGFILE 1>> $TPMBUILDLOGFILE
}

logdiskusage() {
	USAGE=`df -kP --sync / |tail -1 | awk '{print $3}'`
	logmessage "TPM: Current disk usage: $USAGE" 
}

logdiskusage2() {
	USAGE=`df -kP --sync / |tail -1 | awk '{print $3}'`
	logmessage2 "Current disk usage: $USAGE" 
}


###
###
### This section is the beginning of all the main execution code
###
###


if [ "x$1" = "xroot" ]; then
	cd $TPMBUILD
	rm buildlog.txt
	echo "Please tail $TPMBUILD/buildlog.txt to watch building..."
	echo "TPM: Extracting packages to build..." 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	logmessage "Starting to building the root linux distro"

	if [ "x$2" != "x" ]; then
		logmessage "Creating stillbuilding.txt"
		echo "$2" > stillbuilding.txt
	fi

	extractrootpackages
	makestaticroot
	makestaticbinutils
	makestaticsed
	makestaticgrep
	makestaticfindutils4120
	makestatictar
	makestaticgzip
	makestaticpatch
	makestaticgawk313
	makestaticcoreutils
	makestaticgcc
	makestaticmake
	makestaticutillinux212
	makestaticbash
	makestaticdiffutils
	makestaticbzip2
	makestatictexinfo46
	cleanrootpackages
	echo "TPM: Done making static packages!" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	extractafterchrootpackages
	dochroot
	cleanafterchrootpackages
	echo "TPM: Done making regular packages!" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	extractafterchroot2packages
	dochroot2
	cleanafterchroot2packages
	echo "TPM: Done making kernel!" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	rm -rvf /var/tmp/tpm/static
	echo "TPM: Removed /static directory" 2>>$TPMBUILDLOG 1>>$TPMBUILDLOG
	logmessage "Done building the root linux distro"


elif [ "x$1" = "xafterchroot" ]; then
	echo "afterchroot"
	CC="gcc -s"
	export CC
	cd /

	if [ "x$2" = "x" ]; then
		makeroot
		umount /proc
		umount /dev
		mount proc /proc -t proc
		mount devfs /dev -t devfs

		installkernelheaders2424
		###makedevs
		makeglibc
		exec /static/bin/bash --login ./build-static-bootstrap.sh afterchroot afterglibc
	elif [ "x$2" = "xafterglibc" ]; then
		echo "TPM: Successfully re-executed bash" 2>>$TPMBUILDLOGFILE 1>>$TPMBUILDLOGFILE
		logdiskusage
		makegcc323
		logdiskusage
		makezlib114
		logdiskusage
		makefindutils4120
		logdiskusage
		makegawk313
		logdiskusage
		makencurses
		logdiskusage
		makevim
		logdiskusage
		makem4
		logdiskusage
		makebison
		logdiskusage
		makeless
		logdiskusage
		makegroff
		logdiskusage
		makecoreutils
		logdiskusage
		makesed
		logdiskusage
		makeflex
		logdiskusage
		makegettext0121
		logdiskusage
		makenettools
		logdiskusage
		makeperl581
		logdiskusage
		maketexinfo46
		logdiskusage
		makeautoconf
		logdiskusage
		makeautomake177
		logdiskusage
		makebash
		logdiskusage
		makefile405
		logdiskusage
		makelibtool
		logdiskusage
		makebin8601613
		logdiskusage
		makebzip2
		logdiskusage
		makeed
		logdiskusage
		makekbd
		logdiskusage
		makediffutils
		logdiskusage
		makee2fsprogs134
		logdiskusage
		makegrep
		logdiskusage
		makemanpages
		logdiskusage
		makegzip
		logdiskusage
		makeman15m2
		logdiskusage
		makebinutils
		logdiskusage
		makenasm09838
		logdiskusage
		makelilo22572
		logdiskusage
		makemake
		logdiskusage
		makemodutils
		logdiskusage
		makenetkitbase
		logdiskusage
		makepatch
		logdiskusage
		makeprocinfo
		logdiskusage
		makeprocps3113
		logdiskusage
		makepsmisc213
		logdiskusage
		makeshadow
		logdiskusage
		makesysklogd
		logdiskusage
		makesysvinit
		logdiskusage
		maketar
		logdiskusage
		makeutillinux212
		logdiskusage
		makewhich216
		logdiskusage
		makelinuxmanpages2423
		logdiskusage
		makeglibcagain
		logdiskusage

		umount /proc
		umount /dev
		exit 0
	else
		exit -1
	fi

elif [ "x$1" = "xafterchroot2" ]; then
	CC="gcc -s"; export CC
	umount /dev
	umount /proc
	mount proc /proc -t proc
	mount devfs /dev -t devfs	

	cd /
	touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
	chmod 644 /var/run/utmp /var/log/{btmp,lastlog,wtmp}
	makekernel2424
	createliloconf
	makeinstallbootblock
	makeetcfiles
	setrootpasswd
	cleanup
	createarchivedirectory
	rm -f /lib/cpp
	ln -s /usr/bin/cpp /lib

	umount /proc
	umount /dev
	exit 0

elif [ "x$1" = "xsecurityserver" ]; then
	#Turn off debugging symbols
	CC="gcc -s"

	#This is required for X-windows to install properly
	export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/ssl/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin"

	logmessage2 "Starting to make the security server!" 

	rm -f /stillbuilding.txt /etc/rc.d/rc3.d/S99continuebuild

	cat > /etc/issue << "EOF"
ThePacketMaster Linux Security Server v1.2.1
Kernel \r on an \m
EOF


	#To clean up existing directories
	#cleanupbeforesecurityserver
	extractsecurityserver

	logdiskusage2
	maketcsh
	logdiskusage2
	makeiproute2247with2420
	logdiskusage2
	makeppp242b3
	logdiskusage2
	makerp35with2423

	logdiskusage2
 	makesharutils421
	logdiskusage2
	makeopenssl097c
	logdiskusage2
	makedhcpcd
	logdiskusage2
	makesamba300
	logdiskusage2
	makeinetutilstftp
	logdiskusage2
	makenetkitftp
	logdiskusage2
	makenetkittelnet
	logdiskusage2
	makeminicom
	logdiskusage2
	makegpm
	logdiskusage2
	makemktemp
	logdiskusage2
	makezip
	logdiskusage2
	makestrace4498
	logdiskusage2
	makeopenssh371p2
	logdiskusage2
	makescreen401
	logdiskusage2
	makepine458
	logdiskusage2
	makelynx
	logdiskusage2
	makewget191
	logdiskusage2
	makelibpcap072
	logdiskusage2
	makelibnet110
	logdiskusage2
	makelibnids
	logdiskusage2
	maketcpdump

	###Must be done separate from makelibnet, because this is used 
	###by libnids.  This must also be done after maketcpdump
	rm -rf Libnet-latest libpcap-0.7.2

	logdiskusage2
	makelsof468
	logdiskusage2
	makehping2
	logdiskusage2
	makegdbm
	logdiskusage2
 	makentop
	logdiskusage2
	maketraceroute
	logdiskusage2
	makecdrtools
	logdiskusage2
	makejohntheripper
	logdiskusage2
	makenmap348
	logdiskusage2
	makenikto
	logdiskusage2
	makebind922p3
	logdiskusage2
	makengrep141
	logdiskusage2
	makep0f
	logdiskusage2
	makenbtscan151
	logdiskusage2
	makefinger
	logdiskusage2
	makenetcat
	logdiskusage2
	makewhois467
	logdiskusage2
	maketct112
	logdiskusage2
	makehunt
	logdiskusage2


	#This section makes all the X-Windows stuff
	makelibjpeg6b
	logdiskusage2
	makelibtiff357
	logdiskusage2
	makelibpng125
	logdiskusage2
	makelibungif410
	logdiskusage2
	makeX
	logdiskusage2
	makepkgconfig
	logdiskusage2
	makeglib
	logdiskusage2
	makegtk
	logdiskusage2
	makegdkpixbuf
	logdiskusage2
	makeimagemagick55713
	logdiskusage2

	#Make Enlightment X-Windows manager
	makeimlib1914
	logdiskusage2
	makefnlib05
	logdiskusage2
	makefreetype131
	logdiskusage2
	makeenlightenment0166
	tpmsscustomizeenlightenment0166
	logdiskusage2


	makeettercap06b
	logdiskusage2
	makenessus209
	#makenessus209 withoutx
	logdiskusage2


	makeethereal0915
	logdiskusage2
	makenetsnmp509
	logdiskusage2

	#nemesis requires libnet 1.0.2a
	makenemesis

	logdiskusage2
	makesetiathome
	logdiskusage2
	makegmp
	logdiskusage2
	makefreeswan204with2424
	logdiskusage2
	makecloop2001
	logdiskusage2
	makeiptables129with2424
	logdiskusage2
	makecrack
	logdiskusage2
	makepackit
	logdiskusage2
	makelibdnet
	logdiskusage2
	makefirewalk
	logdiskusage2
	makedb4
	logdiskusage2
	
	#dsniff requires libnet 1.0.2a, openssl, libnids, libpcap, and libdb
	makedsniff

	logdiskusage2
	makeamap43
	logdiskusage2
	makechntpw
	logdiskusage2
	makexprobe2
	logdiskusage2
	maketcpreplay145
	logdiskusage2
	makearpwatch
	logdiskusage2
	makefragroute
	logdiskusage2
	makesara
	logdiskusage2
	###Because of sloppy YACC rules in WU-FTPD,
	###I have compiled bison 1.35, just to get it to work
	makewuftpd
	logdiskusage2
	makehydra24
	logdiskusage2
	makestunnel404
	logdiskusage2
	makexinetd2312
	logdiskusage2
	makegpsd
	logdiskusage2


	makedos2unix
	logdiskusage2
	makebiew550
	logdiskusage2
	makeidswakeup10
	logdiskusage2
	makesecuredelete31
	logdiskusage2
	makechkrootkit042b
	logdiskusage2
	makegnupg123
	logdiskusage2
	makefatback13
	logdiskusage2
	makemacrobber100
	logdiskusage2
	makehttptunnel305
	logdiskusage2
	makemc460
	logdiskusage2
	makememfetch
	logdiskusage2
	makepaketto110
	logdiskusage2
	makevmap06
	logdiskusage2
	makelibmcrypt257
	logdiskusage2
	makelibmhash0818
	logdiskusage2
	makesteghide051
	logdiskusage2
	makestegdetect05
	logdiskusage2
	makepptp131
	logdiskusage2
	makecabextract06
	logdiskusage2
	makecmospwd43
	logdiskusage2
	makeaide010
	logdiskusage2
	makedlint140
	logdiskusage2
	makenetsed001
	logdiskusage2
	makescanssh16b
	logdiskusage2
	makerecover13c
	logdiskusage2
	makelibxml263
	logdiskusage2
	makehammerhead213
	logdiskusage2
	makepnscan111
	logdiskusage2
	makesendip25
	logdiskusage2
	logdiskusage2
	makesocat1322
	logdiskusage2
	maketcpflow021
	logdiskusage2
	makedcfldd10
	logdiskusage2
	makednswalk202
	logdiskusage2
	makedcetest12
	logdiskusage2
	maketcptrace661
	logdiskusage2
	makeargus205
	logdiskusage2
	makearping202
	logdiskusage2
	makeddrescue103
	logdiskusage2
	makedarkstat26
	logdiskusage2
	makesing11
	logdiskusage2
	makehackbot221
	logdiskusage2
	makedriftnet016
	logdiskusage2
	makebing113
	logdiskusage2
	makescreamingcobra104
	logdiskusage2


	#Make all the Perl Modules
	makeperlnetrawip01
	logdiskusage2
	makeperlnetdns045
	logdiskusage2
	makeperlnetdnssec011
	logdiskusage2
	makeperluri130
	logdiskusage2
	makeperlmimebase64300
	logdiskusage2
	makeperlhtmltagset303
	logdiskusage2
	makeperlhtmlparser335
	logdiskusage2
	makeperldigestmd5233
	logdiskusage2
	makeperlcryptssleay051
	logdiskusage2
	makeperliosocketssl095
	logdiskusage2
	makeperllibnet117
	logdiskusage2
	makeperllibwww576
	logdiskusage2
	makeperldigesthmac101
	logdiskusage2
	makeperldigestsha1207
	logdiskusage2
	makeperlcryptcbc208
	logdiskusage2
	makeperlcryptdes203
	logdiskusage2
	makeperlnetsnmp412
	logdiskusage2
	makeperliotty102
	logdiskusage2
	makeperlexpect115
	logdiskusage2
	makeperlfilespec087
	logdiskusage2
	makeperltimehires155
	logdiskusage2
	makeperldatecalc53
	logdiskusage2
	makeperltimedate116
	logdiskusage2





	makeisic005
	logdiskusage2




	makexoranalyze
	logdiskusage2
	makesyslogng1526
	logdiskusage2
	makepciutils2111
	logdiskusage2


	### Hey, it can get a little boring doing work in a quiet room
	makempg123
	logdiskusage2


	makesniffit035
	logdiskusage2
	makeiptraf270
	logdiskusage2
	makesleuthkit166
	logdiskusage2
	makefping24b2ipv6
	logdiskusage2
	makeraccess07
	logdiskusage2

	makepython232
	logdiskusage2


	makeslang149
	logdiskusage2
	maketcl845
	logdiskusage2
	makepopt17
	logdiskusage2
	makenewt050
	logdiskusage2
	makepartimage062
	logdiskusage2

	makejava14203
	logdiskusage2
	makemozilla131
	logdiskusage2


	makeadmsmb02
	logdiskusage2
	makeadmsnmp01
	logdiskusage2
	makeautopsy175
	logdiskusage2
	makebfbtester201
	logdiskusage2
	makebruth
	logdiskusage2
	makebsed10
	logdiskusage2
	makelinneighborhood065
	logdiskusage2
	makeknocker071
	logdiskusage2
	makegtkknocker066
	logdiskusage2
	makeccrypt16
	logdiskusage2
	makecflow1051
	logdiskusage2
	makecgrep813
	logdiskusage2
	makecheops061
	logdiskusage2
	makecscope155
	logdiskusage2
	makecurl7108
	logdiskusage2
	makedillo073
	logdiskusage2
	makedisco12
	logdiskusage2
	makeechoping510
	logdiskusage2
	makeforemost069
	logdiskusage2
	makehlfl0601
	logdiskusage2
	makeipsorc175
	logdiskusage2
	makeisnprober101
	logdiskusage2
	makeitunnel12
	logdiskusage2
	makel2tpd069
	logdiskusage2
	makeldebinary260
	logdiskusage2
	makeltrace0331
	logdiskusage2
	makemacchanger140
	logdiskusage2
	makemd5deep016
	logdiskusage2
	makerat21
	logdiskusage2
	makevnc337
	logdiskusage2
	makerdesktop130
	logdiskusage2
	makemtr054
	logdiskusage2
	makenstreams100
	logdiskusage2
	makentfsprogs182
	logdiskusage2
	makeonesixtyone032
	logdiskusage2
	makepasmal05
	logdiskusage2
	makepptpd113
	logdiskusage2
	makepwl9x007
	logdiskusage2
	makerda021c
	logdiskusage2
	makerevinetd09
	logdiskusage2
	makejaxml301
	logdiskusage2
	makereportlab118
	logdiskusage2
	makescanerrlog201
	logdiskusage2
	makescanlogd22
	logdiskusage2
	makereadline43
	logdiskusage2
	makescli0212
	logdiskusage2
	makeslogdump12
	logdiskusage2
	makerrdtool1046
	logdiskusage2
	makesnapscreenshot10142
	logdiskusage2
	makesplint311
	logdiskusage2
	makessldump09b3
	logdiskusage2
	maketcptraceroute15b4
	logdiskusage2
	makethcrut125
	logdiskusage2
	maketransproxy15
	logdiskusage2
	maketsocks18
	logdiskusage2
	makevalgrind210
	logdiskusage2
	makewalker32
	logdiskusage2
	makewarscan072
	logdiskusage2
	makeangst04b
	logdiskusage2
	makeclamav065
	logdiskusage2
	makemysql4013
	logdiskusage2
	makefarpd02
	logdiskusage2
	makeloginhacker11
	makegd2015
	logdiskusage2
	makemrtg21013
	logdiskusage2
	makevlad092
	logdiskusage2
	makeicmpinfo111
	logdiskusage2
	makevomit02c
	logdiskusage2
	maketcpslice11a3
	logdiskusage2
	makerarpd11
	logdiskusage2
	makewipe220
	logdiskusage2
	makeicmpush22
	logdiskusage2
	makeswatch308

	logmessage2 "Done making security server!" 
	echo "wireless" > /stillbuilding.txt


	#Untested or not used
	#makefontconfig
	#compressmanpages
	#makesvgatextmode
	#cleanstaticlibs
	#For X-Windows
	#makeacrobat
	#makespike
	#maketcpwrappers
	#makehoneyd
	#makenetkitcombo
	#makesendmail81210
	#makelibwhisker
	#todo
	#add user sshd and bin and ntop
	#LD_LIBRARY_PATH



elif [ "x$1" = "xwireless" ]; then

	#This is required for X-windows to install properly
	export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/ssl/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin"

	rm -f /stillbuilding.txt /etc/rc.d/rc3.d/S99continuebuild

	### This section is where all the 
	### wardriv, ummm... wireless utils are made
	makewirelesstools
	logdiskusage2
	makeacx100binary20030716with2424
	makeacx100source02pre6
	logdiskusage2
	makemadwificvs20031124
	logdiskusage2
	makewlanng021pre9
	logdiskusage2
	makeexpat1957
	logdiskusage2
	makekismet301
	logdiskusage2
	makegpsdrive132
	logdiskusage2
	makeairsnort022a
	logdiskusage2

	cleanuppackages
	createcompressedusr



elif [ "x$1" = "xsecurityworkstation" ]; then

	rm -f /stillbuilding.txt /etc/rc.d/rc3.d/S99continuebuild

	#Turn off debugging symbols
	CC="gcc -s"
	echo ""

	cat > /etc/issue << "EOF"
ThePacketMaster Linux Security Workstation v1.0.0
Kernel \r on an \m
EOF



	cat > /etc/motd << "EOF"








************************************************************
*                                                          *
* ThePacketMaster Linux Security Workstation v1.0.0        *
*                                                          *
* For information regarding this Linux distribution, and   *
* appropriate usage, please read the /README.txt file.     *
*                                                          *
* While this software is distributed under the GPL and     *
* free to anyone, please feel free to thank the author by  *
* donating some CPU cycles to my favorite distributed      *
* computing project, seti@home.  All you have to do is get *
* a Internet connection and type 'thanks' on the           *
* command line.                                            *
*                                                          *
*                                        ThePacketMaster   *
*                                                          *
************************************************************
EOF




	#To clean up existing directories
	cleanupbeforesecurityworkstation
	extractsecurityworkstation

	logdiskusage2
	maketcsh
	logdiskusage2
	makeopenssl097c		#7608 KB
	logdiskusage2
	makedhcpcd
	logdiskusage2
	makesamba300		#20924 KB might get rid of this
	logdiskusage2
	makeinetutilstftp
	#makenetkittftp
	logdiskusage2
	makenetkitftp
	logdiskusage2
	makenetkittelnet
	logdiskusage2
	makeminicom		#660 KB
	logdiskusage2
	makegpm
	logdiskusage2
	makeppp242b3
	logdiskusage2
	makerp35with2423
	logdiskusage2
	makezip
	logdiskusage2
	makeopenssh371p2		#1272 KB
	logdiskusage2
	makescreen401			#1044 KB
	logdiskusage2
	makepine458
	logdiskusage2
	makelynx			
	logdiskusage2
	makelibpcap072			#216 KB
	logdiskusage2

	makelibnet			#2356 KB get rid
	makelibnids			#488 KB get rid
	###Must be done separate from makelibnet, because this is used 
	###by libnids
	rm -rf Libnet-latest libpcap-0.7.2
	logdiskusage2

	makelsof468			#236 KB
	logdiskusage2
	maketraceroute
	logdiskusage2
	makecdrtools			#3124 KB
	logdiskusage2
	makedig
	logdiskusage2
	makefinger
	logdiskusage2
	makenetcat			#464 KB
	logdiskusage2
	makewhois467
	logdiskusage2
	makenetsnmp509			#2868 KB might get rid of this
	logdiskusage2
	makesetiathome			#264 KB
	logdiskusage2
	makegmp			#1912 KB
	logdiskusage2
	makefreeswan204with2420
	makeiptables128with2420
	logdiskusage2


	makechntpw
	logdiskusage2
	makearpwatch			#164 KB
	logdiskusage2
	#Because of sloppy YACC rules in WU-FTPD,
	#I have compiled bison 1.35, just to get it to work
	makewuftpd			#356 KB
	logdiskusage2
	makestunnel404			#108 KB
	logdiskusage2
	makexinetd2312
	logdiskusage2


	#For X-Windows
	makelibpng125
	logdiskusage2
	makeX
	logdiskusage2
	makepkgconfig
	logdiskusage2
	makeglib
	logdiskusage2
	makegtk
	logdiskusage2
	makenessus209
	logdiskusage2
	makeethereal0915			#13312 KB
	logdiskusage2
	###makeacrobat (probably won't include due to license)
	


	#Wireless stuff
	makewirelesstools
	logdiskusage2
	makeacx100source01h
	logdiskusage2
	makegdkpixbuf
	logdiskusage2
	makegpsdrive132
	logdiskusage2
	makeexpat1957
	logdiskusage2
	makeimagemagick55713
	logdiskusage2
	makekismet301
	logdiskusage2

	#All this to get fwbuilder, it better be good!
	makelibsigc
	logdiskusage2
	makegtkmm
	logdiskusage2
	makelibxml263
	logdiskusage2
	makelibxslt
	logdiskusage2
	makelibfwbuilder
	logdiskusage2
	makefwbuilder
	logdiskusage2


	#cleanstaticlibs


	compressmanpages
	logdiskusage2

	ldconfig


	#todo
	#add user sshd and bin and ntop
	#LD_LIBRARY_PATH
	#

	logmessage2 "Done making security workstation!" 

elif [ "x$1" = "xserviceprovider" ]; then
#atd
#automount
#awk (yes, in root install)
#bash (yes, in root install)
#bbd (part of bb, will not be included)
#bb-network.sh (part of bb, will not be included)
#bbrun (part of bb, will not be included)
#bdflush (yes, built into kernel)
#CMD
#crond (yes)
#gpm (yes)
#httpd (yes)
#in.ftpd (yes)
#init (yes, in root install)
#keventd (yes, built into kernel)
#khubd (yes, built into kernel)
#klogd 
#kreclaimd
#kswapd (yes, built into kernel)
#kupdated (yes, built into kernel)
#mingetty (yes, agetty instead)
#miniserv.pl (yes)
#mysqld (yes)
#named (yes)
#ntpd (yes)
#ps (yes, in root install)
#runbb.sh (part of bb, will not be included)
#run-parts 
#sa1
#sadc
#sendmail (yes)
#sh (yes, bash in root install)
#sleep (yes)
#snmpd (yes)
#sshd (yes)
#su (yes)
#syslogd (yes, in root install)
#xfs (no X-windows on TPM server)
#xinetd (yes)

	rm -f /stillbuilding.txt /etc/rc.d/rc3.d/S99continuebuild

	#Turn off debugging symbols
	CC="gcc -s"
	logmessage2 "Starting to make the service provider!"

	cat > /etc/issue << "EOF"
ThePacketMaster Linux Service Provider v1.2.1
Kernel \r on an \m
EOF


	#To clean up existing directories
	#cleanupbeforeserviceprovider
	#extractserviceprovider

	logdiskusage2
	maketcsh
	logdiskusage2





	makeopenssl097c
	logdiskusage2
	makeppp242b3
	logdiskusage2
	makerp35with2423
	logdiskusage2
	
	makedhcpcd
	logdiskusage2
	makesamba300
	logdiskusage2
	makeinetutilstftp

	logdiskusage2
	makenetkitftp
	logdiskusage2
	makenetkittelnet
	logdiskusage2
	makeminicom
	logdiskusage2
	makegpm
	logdiskusage2
	makezip
	logdiskusage2
	makeopenssh371p2
	logdiskusage2
	makescreen401
	logdiskusage2
	makepine458
	logdiskusage2
	makelynx
	logdiskusage2
	makelibpcap072
	###Must be done separate from makelibnet, because this is used 
	###by libnids in other installs
	rm -rf libpcap-0.7.2

	maketcpdump
	logdiskusage2
	makelsof468
	logdiskusage2
	makegdbm
	logdiskusage2
	maketraceroute
	logdiskusage2
	makecdrtools
	logdiskusage2
	makebind922p3
	logdiskusage2
	makefinger
	logdiskusage2
	makenetcat
	logdiskusage2
	makewhois467
	logdiskusage2
	makenetsnmp509
	logdiskusage2
	makegmp
	logdiskusage2
	makefreeswan204with2423
	logdiskusage2
	makecloop2001
	logdiskusage2
	makeiptables129with2423
	logdiskusage2
	makestunnel404
	logdiskusage2
	makearpwatch
	logdiskusage2

	makedos2unix
	logdiskusage2
	
	makelibmhash0818
	logdiskusage2
	makeaide010
	logdiskusage2
	makelibpng125
	logdiskusage2
	makegd2015
	logdiskusage2
	makemrtg21013
	logdiskusage2
	makepython232
	logdiskusage2

	#Because of sloppy YACC rules in WU-FTPD,
	#I have compiled bison 1.35, just to get it to work
	makewuftpd
	logdiskusage2

	makemm130
	logdiskusage2

	makeapache1329
	logdiskusage2

	makexinetd2312
	logdiskusage2

	makemysql4013
	logdiskusage2

	makedb3
	logdiskusage2
	makecyrussasl1528
	logdiskusage2
	makesendmail81210
	logdiskusage2
	makeqpopper405
	logdiskusage2
	makeimapd2002d
	logdiskusage2


	makecurl7108
	logdiskusage2
	makeexpat1957
	logdiskusage2
	makexmlparser234
	logdiskusage2
	makepdflib403
	logdiskusage2
	makedb4
	logdiskusage2
	makephp434
	logdiskusage2
	#makezend

	makentp412
	logdiskusage2

	#
	#makephpmyadmin
	makewebalizer20110
	logdiskusage2


	#Perl librarys
	makeperldbi139
	logdiskusage2
	makeperldbdmysql29003
	logdiskusage2
	makeperlnetssleay125
	logdiskusage2


	makewebmin1121
	logdiskusage2

	makestrace4498
	logdiskusage2
	makegnupg123
	logdiskusage2

	makecron401b1
	logdiskusage2


	cd /

	#compressmanpages

	#Untested or not used


	#todo
	#add user sshd and bin and ntop
	#LD_LIBRARY_PATH
	#
	logmessage2 "Done making service provider!" 


elif [ "x$1" = "xmisc" ]; then
	echo "Building miscellaneous stuff..."

	cleanuppackages
	createcompressedusr


	exit

	makeperliosocket
	makeperlsocket
	

	exit
	makeangst04b
	makearptool01
	makegkismet005
	makeetherape090
	makegtkrecover03
	makegtkperl07009
	makenetwag560
	makelde260
	exit

	cleanuppackages
	createcompressedusr

	exit
	makememgrep

	exit
	createarchivedirectory
	exit
	createcompressedusr

	exit
	cleanuppackages
	
	exit

	makepwdutils24
	
	#makelibidl082
	#makeorbit292
	#makelinc055
	#makegconf121
	#makelibbonobo
	#makegnomemimedata240

	makegnomevfs253
	#makelibgnome2

	#Needs libgnome

	exit



	#Possible window managers
	#Afterstep
	#Blackbox

	#CTWM
	#- Optional 3D window titles and border (ala Motif).
	#- Shaped, colored icons.
	#- Multiple icons for clients based on the icon name.
	#- Windows can belong to several workspaces.
	#- A map of your workspaces to move quickly windows between
	#  different workspaces.
	#- Animations : icons, root backgrounds and buttons can be animated.
	#- Pinnable and sticky menus.














	#makesiege258

	#makeethereal010

	#Requires libglade-2.0 libgnomeui-2.0
	#makeetherape090

	#Could not run libxml test program, even though libxml is 
	# installed.
	#makelibxml263
	#makescli029

	#maketcpwrappers
	#makepptpd113
	#makecryptcat
	#makesk13b






elif [ "x$1" = "xsatestsecser" ]; then
	echo "Stand alone test of TPM security server"

	echo -e "192.168.200.50\ttesthost\t" >>/etc/hosts
	testnetworkinit
	testopenssh


elif [ "x$1" = "xtestsecurityserver" ]; then
	echo "Testing TPM security server..."

	testdhcpcd
	testnetworkinit
	testopenssh

elif [ "x$1" = "xfinished" ]; then
	echo "Cleaning up this distro for release..."

	cleanuppackages
	createcompressedusr

fi



#Extra stuff
#makesvgatextmode
#makespike
#maketcpwrappers
#makehoneyd
#makenetkitcombo
#makesendmail81210
#makelibwhisker


if [ -e stillbuilding.txt ]; then
	cat > etc/rc.d/rc3.d/S99continuebuild << "EOF"
cd /
nohup ./build-static-bootstrap.sh `cat /stillbuilding.txt` &
EOF
	chmod 755 etc/rc.d/rc3.d/S99continuebuild
	logmessage "Restarting to continue build"
	logmessage2 "Restarting to continue build"
	shutdown -r now
fi

