               LPRng Installation 
          Patrick Powell <papowell@astart.com>
 * README.install,v 3.9 1997/12/31 19:30:10 papowell Exp *

CAVEATS and WARNINGS:

The LPRng software requires an ANSI C compiler and the
GNU Make software from the Free Software Foundation,
or a BSD 4.3/4.4 compatible make.
GNU Make is available at many FTP sites, such as:
  ftp://prep.ai.mit.edu/pub/gnu
  ftp://ftp.uu.net/pub/gnu

If you want to use the GNU gettext() facility for Internationalization,
please read ABOUT-NLS.LPRng - it contains directions on how to get the
various GNU packages.

If you are using the BSD Make,  you will need to use make -f Makefile.bsd
or rename the Makefile.bsd files as Makefile and edit them, replacing
the lines containing 'make -f Makefile.bsd' with just 'make'.

THE EXPRESS INSTALLATION INSTRUCTIONS

To compile and install LPRng,  you can use the following commands.

GNU Make:
    ./configure;
      #if you want internationalization, do:
      # ./configure --enable-nls 
    make clean all;
    su   # you must do the following commands as root
    make install
    # if  you have not installed LPRng before,
    # install default lpd.perms and lpd.conf file in /etc
    if [ ! -f /etc/lpd.perms ]; then make default; fi;
    # update permissions,  create files needed for LPRng, check
    # /etc/printcap file for problems. Do as root:
    ./src/checkpc -f

BSD Make:
    ./configure;
      #if you want internationalization, do:
      # ./configure --enable-nls 
    make -f Makefile.bsd clean all;
    su   # you must do the following commands as root
    make -f Makefile.bsd install
    # if  you have not installed LPRng before,
    # install default lpd.perms and lpd.conf file in /etc
    if [ ! -f /etc/lpd.perms ]; then make default; fi;
    # update permissions,  create files needed for LPRng, check
    # /etc/printcap file for problems. Do as root:
    ./src/checkpc -f

If you do not want to have the LPRng executables installed SUID root
(which could open some security loopholes),  then edit the src/Makefile
and comment out the indicated line:

	# comment out the next line to have LPRng installed non-setuid
	PERMS=$(SUID_ROOT_PERMS)

To run LPRng after installation,  you can do the following:

    # kill off the old server
    kill `ps -aux |grep lpd | awk '{print $2}'`
	# you should remove or rename the existing lpd binaries
    mv /usr/lib/lpd /usr/lib/lpd.old
    ln -s /usr/local/bin/lpd /usr/lib/lpd
	# you might want to track down the old lpr, lpq, lprm binaries
	find /usr -type file -name lp\* \; -print >/tmp/candidates
	find /sbin -type file -name lp\* \; -print >>/tmp/candidates
    # Examine the /tmp/candidates file, and remove or rename the
    # non-LPRng versions of the programs
	# remove or rename the candidate files
    lpd;    # start up LPD
    lpq;    # test it with LPQ

If you are running on Solaris, see the Solaris section in the
LPRng-HOWTO for further instructions on integration with the LP subsystem.

Don't forget to modify the /etc/rc.local or other system startup files
to start LPRng's lpd.  For UNIX SystemV or Linux like systems,  here is
a small sample file that will start up and shut down the lpd server.

#!/bin/sh
case "$1" in
  start)
        # Start daemons.
        /usr/bin/echo "Starting lpd: \c"; /usr/local/bin/lpd; /usr/bin/echo;
        ;;
  stop)
        # Stop daemons.
        /usr/bin/echo "Shutting down lpd: \c"
        server=`/usr/local/bin/lpc -Pany@localhost lpd \
        | awk '{for(i=1;i<=NF;++i){v=$i+0;if(v>1){ print v;exit;}}}'`
        if [ -n "$server" ]; then
            /usr/bin/echo " server pid $server";
            kill $server;
        else
            /usr/bin/echo " no server active";
        fi;
        ;;
  *)
        echo "Usage: lpd {start|stop}"
        exit 1
        ;;
esac


 
PRINTCAP FILES:

You will probably want to update your printcap files.  See
the LPRng-HOWTO for information on printcap files.
If you want to use existing or non-LPRng compatible filters,
try setting the :bkf:  (Berkeley LPD conformant filter) in the
printcap entry:

Example:

lp:bkf:\
  :if=/usr/libexec/psfilter
