#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-tcpip2 if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_tcpip2.tar.gz # Find the size of a file: filesize() { SIZE=`ls -l -d -G $1 | cut -b23-32` echo -n $SIZE } echo "+===============+" echo "| bootp-DD2.4.3 |" echo "+===============+" cd $TMP tar xzvf $CWD/bootp-DD2.4.3.tar.gz cd bootp-DD2.4.3 zcat $CWD/bootp-DD2.4.3.diff.gz | patch make strip bootpd bootpef bootpgw bootptest for file in bootpd bootpef bootpgw bootptest ; do cat $file > $PKG/usr/sbin/$file done gzip -9c bootptab.5 > $PKG/usr/man/man5/bootptab.5.gz for file in bootpd.8 bootpef.8 bootptest.8 ; do gzip -9c $file > $PKG/usr/man/man8/$file.gz done echo "+=================+" echo "| fetchmail-4.6.3 |" echo "+=================+" cd $TMP tar xzvf $CWD/fetchmail-4.6.3.tar.gz cd fetchmail-4.6.3 configure --prefix=/usr make CFLAGS=-O2 LDFLAGS=-s strip fetchmail cat fetchmail > $PKG/usr/bin/fetchmail #cat fetchmailconf > $PKG/usr/bin/fetchmailconf cat fetchmail.man | gzip -9c > $PKG/usr/man/man1/fetchmail.1.gz mkdir $PKG/usr/doc/fetchmail-4.6.3 cp -a COPYING FAQ FEATURES README NEWS NOTES $PKG/usr/doc/fetchmail-4.6.3 echo "+===============+" echo "| netwatch-0.7a |" echo "+===============+" cd $TMP tar xzvf $CWD/netwatch0.7a.src.tar.gz cd netwatch make strip netresolv netwatch cat netresolv > $PKG/usr/sbin/netresolv chown root.bin $PKG/usr/sbin/netresolv chmod 755 $PKG/usr/sbin/netresolv cat netwatch > $PKG/usr/sbin/netwatch chown root.bin $PKG/usr/sbin/netwatch chmod 755 $PKG/usr/sbin/netwatch cat netwatch.1 | gzip -9c > $PKG/usr/man/man1/netwatch.1.gz mkdir -p $PKG/usr/doc/netwatch cp -a BUGS CHANGES README README.performance TODO netwatch0.7a.lsm \ $PKG/usr/doc/netwatch chown root.root $PKG/usr/doc/netwatch/* chmod 644 $PKG/usr/doc/netwatch/* echo "+================+" echo "| slattach-1.2.0 |" echo "+================+" cd $TMP tar xzvf $CWD/slattach-1.2.0.tar.gz cd slattach-1.2.0 make strip slattach cat slattach > $PKG/usr/sbin/slattach cat man/en_US.88591/slattach.8 | gzip -9c > $PKG/usr/man/man8/slattach.8.gz echo "+=================+" echo "| sliplogin-2.1.0 |" echo "+=================+" cd $TMP tar xzvf $CWD/sliplogin-2.1.0.tar.gz cd sliplogin-2.1.0 zcat $CWD/sliplogin-2.1.0.diff.gz | patch make strip sliplogin cat sliplogin > $PKG/usr/sbin/sliplogin cat sliplogin.8 | gzip -9c > $PKG/usr/man/man8/sliplogin.8.gz mkdir -p $PKG/etc-incoming/slip cp -a slip.login slip.hosts slip.route slip.passwd $PKG/etc-incoming/slip chown root.root $PKG/etc-incoming/slip/* chmod 640 $PKG/etc-incoming/slip/* echo "+======================+" echo "| ipfwadm-2.3.0.tar.gz |" echo "+======================+" cd $TMP tar xzvf $CWD/ipfwadm-2.3.0.tar.gz cd ipfwadm-2.3.0 zcat $CWD/ipfwadm-2.3.0.diff.gz | patch -p1 mkdir -p $PKG/usr/doc/ipfwadm-2.3.0 cp -a COPYING ChangeLog README ipfwadm.lsm $PKG/usr/doc/ipfwadm-2.3.0 chmod 644 $PKG/usr/doc/ipfwadm-2.3.0/* chown root.root $PKG/usr/doc/ipfwadm-2.3.0/* make strip ipfwadm cat ipfwadm > $PKG/sbin/ipfwadm-2.3.0 cat ipfwadm.8 | gzip -9c > $PKG/usr/man/man8/ipfwadm.8.gz cat ipfw.4 | gzip -9c > $PKG/usr/man/man4/ipfw.4.gz echo "+=======================+" echo "| ipchains-1.3.5.tar.gz |" echo "+=======================+" cd $TMP tar xzvf $CWD/ipchains-1.3.5.tar.gz cd ipchains-1.3.5 make strip ipchains cat ipchains > $PKG/sbin/ipchains cat ipchains.8 | gzip -9c > $PKG/usr/man/man8/ipchains.8.gz cat ipfw.4 | gzip -9c > $PKG/usr/man/man4/ipfw.4.gz mkdir -p $PKG/usr/doc/ipchains-1.3.5 cp -a COPYING HOWTO.txt README $PKG/usr/doc/ipchains-1.3.5 chmod 644 $PKG/usr/doc/ipchains-1.3.5/* chown root.root $PKG/usr/doc/ipchains-1.3.5/* echo "+===============================+" echo "| ipchains-scripts-1.0.2.tar.gz |" echo "+===============================+" cd $TMP tar xzvf $CWD/ipchains-scripts-1.0.2.tar.gz cd ipchains-scripts-1.0.2 zcat $CWD/ipchains-scripts-1.0.2.diff.gz | patch for file in ipchains-restore ipchains-save ipfwadm-wrapper ; do cat $file > $PKG/sbin/$file chmod 755 $PKG/sbin/$file chown root.bin $PKG/sbin/$file cat $file.8 | gzip -9c > $PKG/usr/man/man8/$file.8.gz done echo "+================+" echo "| yp-clients-2.2 |" echo "+================+" cd $TMP tar xzvf $CWD/ypclients-2.2-970318.tar.gz cd ypclients-2.2-970318 mkdir -p $PKG/usr/doc/yp-clients-2.2 cp -a yp-clients.lsm README yp.conf.example $PKG/usr/doc/yp-clients-2.2 ( cd $PKG/usr/doc/yp-clients-2.2 ; chmod 644 * ) ( cd $PKG/usr/doc/yp-clients-2.2 ; chown root.root * ) make ( cd ypbind ; make ) strip ypbind/ypbind ypcat/ypcat ypmatch/ypmatch \ yppasswd/yppasswd yppoll/yppoll ypset/ypset ypwhich/ypwhich cat ypbind/ypbind > $PKG/usr/sbin/ypbind cat ypcat/ypcat > $PKG/usr/bin/ypcat cat ypmatch/ypmatch > $PKG/usr/bin/ypmatch cat yppasswd/yppasswd > $PKG/usr/bin/yppasswd cat yppoll/yppoll > $PKG/usr/bin/yppoll cat ypset/ypset > $PKG/usr/bin/ypset cat ypwhich/ypwhich > $PKG/usr/bin/ypwhich echo "+==============+" echo "| ypserv-1.1.5 |" echo "+==============+" cd $TMP tar xzvf $CWD/ypserv-1.1.5.tar.gz cd ypserv mkdir -p $PKG/usr/doc/ypserv-1.1.5 cp -a COPYING ChangeLog README README.secure TODO $PKG/usr/doc/ypserv-1.1.5 ( cd $PKG/usr/doc/ypserv-1.1.5 ; chmod 644 * ) ( cd $PKG/usr/doc/ypserv-1.1.5 ; chown root.root * ) configure make strip makedbm mknetid revnetgroup ypxfr ypserv rpc.ypxfrd yppush for file in makedbm mknetid revnetgroup ypinit ypxfr ypxfr_1perday \ ypxfr_1perhour ypxfr_2perday ; do cat $file > $PKG/usr/libexec/yp/$file done for file in ypserv rpc.ypxfrd yppush ; do cat $file > $PKG/usr/sbin/$file done cat ypMakefile > $PKG/var/yp/Makefile for file in netgroup.5 ypserv.conf.5 ; do gzip -9c $file > $PKG/usr/man/man5/$file.gz done for file in ypserv.8 rpc.ypxfrd.8 ypxfrd.8 yppush.8 ypxfr.8 \ ypinit.8 revnetgroup.8 mknetid.8 ; do gzip -9c $file > $PKG/usr/man/man8/$file.gz done echo "+==============+" echo "| telnetsnoopd |" echo "+==============+" cd $TMP mkdir telnetsnoopd cd telnetsnoopd tar xzvf $CWD/telnetsnoopd-fixed.tar.gz make strip telnetsnoopd/telnetd cat telnetsnoopd/telnetd > $PKG/usr/sbin/in.telnetsnoopd echo "+================+" echo "| ttysnoop-0.12c |" echo "+================+" cd $TMP tar xzvf $CWD/ttysnoop-0.12c.tar.gz cd ttysnoop-0.12c zcat $CWD/ttysnoop-0.12c.diff.gz | patch mkdir -p $PKG/usr/doc/ttysnoop-0.12c cp -a README* $PKG/usr/doc/ttysnoop-0.12c chmod 644 $PKG/usr/doc/ttysnoop-0.12c/* chown root.root $PKG/usr/doc/ttysnoop-0.12c/* make strip ttysnoop ttysnoops cat ttysnoops > $PKG/bin/ttysnoops cat ttysnoop > $PKG/usr/sbin/ttysnoop cat ttysnoop.8 | gzip -9c > $PKG/usr/man/man8/ttysnoop.8.gz echo "+===============+" echo "| nntp-1.5.12.1 |" echo "+===============+" cd $TMP tar xzvf $CWD/nntp-1.5.12.1.tar.gz cd nntp-1.5.12.1 zcat $CWD/nntp-1.5.12.1.diff.gz | patch cp conf.h.dist conf.h make server cd server strip nntpd cat nntpd > $PKG/usr/sbin/in.nntpd cat ../doc/nntpd.8c | gzip -9c > $PKG/usr/man/man8/in.nntpd.8.gz echo "+=============+" echo "| ncftp-2.4.3 |" echo "+=============+" cd $TMP tar xzvf $CWD/ncftp-2.4.3.tar.gz cd ncftp-2.4.3 zcat $CWD/ncftp-2.4.3.diff.gz | patch configure --prefix=/usr --enable-readline make CFLAGS=-O2 LDFLAGS=-s strip ncftp cat ncftp > $PKG/usr/bin/ncftp cat ncftp.1 | gzip -9c > $PKG/usr/man/man1/ncftp.1.gz echo "+=============+" echo "| ytalk-3.0.2 |" echo "+=============+" cd $TMP tar xzvf $CWD/ytalk-3.0.2.tar.gz cd ytalk-3.0.2 make strip ytalk cat ytalk > $PKG/usr/bin/ytalk cat ytalk.1 | gzip -9c > $PKG/usr/man/man1/ytalk.1.gz # Build the package: cd $PKG tar czvf $TMP/tcpip2.tgz . # Warn of zero-length files: for file in `find . -type f -print` ; do if [ "`filesize $file`" = "0" ]; then echo "WARNING: zero length file $file" fi if [ "`filesize $file`" = "20" ]; then echo "WARNING: possible empty gzipped file $file" fi done # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then for dir in bootp-DD2.4.3 fetchmail-4.4.1 ipfwadm-2.3.0 \ ipchains-1.3.5.tar.gz ipchains-scripts-1.0.2 \ ncftp-2.4.3 nntp-1.5.12.1 package-tcpip2 slattach-1.2.0 \ sliplogin-2.1.0 telnetsnoopd ttysnoop-0.12c ypclients-2.2-970318 \ ypserv ytalk-3.0.2 netwatch ; do rm -rf $TMP/$dir done rm -rf $PKG fi