#!/bin/sh ### This is for Debian Linux: install in /usr/local/share (not lib) # Now that gcc and gmake are available, I can: set -xv V=LPRng-3.4.11 H=$HOME/ul/lib/$V L=/usr/local/share/$V if [ ! -f $V.tgz ]; then : " Main Web page: http://www.astart.com/LPRng/LPRng.html You need to obtain $V.tgz : The software may be obtained from ftp://ftp.astart.com/pub/LPRng/LPRng/ (Main site) Mirrors: http://mirror.aarnet.edu.au/pub/LPRng/LPRng/ ftp://ftp.sage-au.org.au/pub/printing/spooler/lprng/ " fi if [ ! -d $V ]; then gzip -cd $V.tgz | tar xf - fi : " Copying our patches ... " for F in $H/$V:*; do if [ "$F" = "$H/$V:*" ]; then continue; fi G=`echo $F | sed -e "s!^$H/!!" -e s!:!/!g` if [ ! -f $G ]; then echo "What to do with $F (there is no file $G)??" continue fi if cmp -s $F $G; then dumm=it_has_been_patched else echo "Patching $G ..." if [ ! -f "$G.orig" ]; then cp -ip $G $G.orig; fi # papowell likes 'chmod 400' on his sources... chmod u+w $G cp $F $G fi diff -c $G.orig $G done cd $V if [ ! -f Makefile ]; then ./configure --prefix=$L perl -i.bak -pe 's/(..INSTALLCMD)/-$1/' src/Makefile perl -i.bak -pe 's/(..INSTALLCMD)/-$1/' TESTSUPPORT/Makefile fi : " Building ... " make : " Make sure $L is owned by psz, and do this on the /usr/local machine. Installing ... " make install : " Copying etc files ... " mkdir $L/etc cp -p $H/etc/* $L/etc cp -p $H/BU* $L cp -p $H/*:* $L chmod 755 $L chmod 755 $L/* chmod 755 $L/man/man? chmod 644 $L/etc/* chmod 755 $L/etc/*filter ln -s ../../../bin/prf $L/etc/ifilter #ksh -c "cd $L/bin; ln -s ../sbin/* ." perl -i.bak -pe 's:/usr/local/lib/LPRng/:/usr/local/share/LPRng/:g' $L/etc/printcap $L/etc/lpd.conf : " Need to do the following as root: rm /usr/local/share/LPRng; ln -s $V /usr/local/share/LPRng chown -h -R root.bin $L #ksh -c 'cd $L; for n in sbin/lpc bin/lpq bin/lpr bin/lprm bin/lpstat; do mv -i \$n \$n.real; cc -o \$n -DREAL_PROG=\"\\\"$L/\$n.real\\\"\" /usr/local/share/root/sec_wrapper.c; chmod 0711 \$n.real; chown 0:0 \$n.real \$n; chmod 4711 \$n; done' ksh -c 'cd $L; for n in bin/lpc bin/lpq bin/lpr bin/lprm; do mv -i \$n \$n.real; cc -o \$n -DREAL_PROG=\"\\\"$L/\$n.real\\\"\" /usr/local/share/root/sec_wrapper.c; chmod 0711 \$n.real; chown 0:0 \$n.real \$n; chmod 4711 \$n; done' ksh -c 'for n in 1 5 8; do cd /usr/local/man/man\$n; ln -s ../../share/LPRng/man/man\$n/* .; done' You need to do (on each machine): ln -s /usr/local/share/LPRng/etc/lpd.conf /etc ln -s /usr/local/share/LPRng/etc/printcap /etc You may also want to do (on each machine): ksh -c 'for n in /usr/*bin/lp* /usr/*bin/cancel; do m=\${n##*/}; if [ -f /usr/local/share/LPRng/bin/\$m ]; then mv -i \$n \$n.DEC; ln -s /usr/local/share/LPRng/bin/\$m \$n; fi; done' "