#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-bsdlpr 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/_bsdlpr.tar.gz echo "+=========+" echo "| BSD lpr |" echo "+=========+" cd $TMP tar xzvf $CWD/lpr_5.9.orig.tar.gz cd lpr-5.9.orig zcat $CWD/lpr_5.9-26.diff.gz | patch -p1 cp Makefile.orig Makefile zcat $CWD/lpr_5.9.slack.diff.gz | patch # On libc5, this patch breaks everything: ( cd lpd ; cp lpd.c.orig lpd.c ) make cd lpc cat lpc > $PKG/usr/sbin/lpc cat lpc.8 | gzip -9c > $PKG/usr/man/man8/lpc.8.gz cd ../filters cat lpf > $PKG/usr/sbin/lpf cd ../lpd cat lpd > $PKG/usr/sbin/bsdlpd cat lpd.8 | gzip -9c > $PKG/usr/man/man8/lpd.8.gz cd ../lpq cat lpq > $PKG/usr/bin/lpq cat lpq.1 | gzip -9c > $PKG/usr/man/man1/lpq.1.gz cd ../lpr cat lpr > $PKG/usr/bin/lpr cat lpr.1 | gzip -9c > $PKG/usr/man/man1/lpr.1.gz cd ../lprm cat lprm > $PKG/usr/bin/lprm cat lprm.1 | gzip -9c > $PKG/usr/man/man1/lprm.1.gz cd ../lptest cat lptest > $PKG/usr/sbin/lptest cat lptest.1 | gzip -9c > $PKG/usr/man/man1/lptest.1.gz cd ../pac cat pac > $PKG/usr/sbin/pac cat pac.8 | gzip -9c > $PKG/usr/man/man8/pac.8.gz cd .. cat printcap.5 | gzip -9c > $PKG/usr/man/man5/printcap.5.gz strip $PKG/usr/bin/* strip $PKG/usr/sbin/* # Build the package: cd $PKG tar czvf $TMP/bsdlpr.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 $TMP/lpr-5.9.orig rm -rf $PKG fi