#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-proftpd 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/_proftpd.tar.gz echo "+===============+" echo "| proftpd-1.2.4 |" echo "+===============+" cd $TMP tar xyvf $CWD/proftpd-1.2.4.tar.bz2 cd proftpd-1.2.4 #zcat $CWD/proftpd-1.2.4.diff.gz | patch -p1 CFLAGS=-O2 ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var/run \ --with-modules=mod_readme:mod_linuxprivs:mod_ratio:mod_wrap \ i386-slackware-linux # This caused funny messages about "Quotas off" with every FTP command: # --with-modules=mod_readme:mod_linuxprivs:mod_ratio:mod_quota:mod_wrap make strip ftpcount ftpwho ftpshut proftpd cat ftpcount > $PKG/usr/bin/ftpcount cat ftpwho > $PKG/usr/bin/ftpwho cat ftpshut > $PKG/usr/sbin/ftpshut cat proftpd > $PKG/usr/sbin/proftpd cd src for file in *.{1,5,8} ; do cat $file | gzip -9c > $PKG/usr/man/man`echo $file | cut -f 2 -d .`/$file.gz done cd .. cat $CWD/etc/proftpd.conf > $PKG/etc-incoming/proftpd.conf cat $CWD/etc/ftpusers > $PKG/etc-incoming/ftpusers mkdir -p $PKG/usr/doc/proftpd-1.2.4 cp -a COPYING CREDITS ChangeLog INSTALL NEWS README* \ contrib/README.mod_wrap contrib/README.ratio \ $PKG/usr/doc/proftpd-1.2.4 cp -a contrib/README $PKG/usr/doc/proftpd-1.2.4/README.contrib cp -a doc sample-configurations $PKG/usr/doc/proftpd-1.2.4 chown -R root.root $PKG/usr/doc/proftpd-1.2.4 # Build the package: cd $PKG tar czvf $TMP/proftpd.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 rm -rf proftpd-1.2.4 rm -rf $PKG fi