#! /bin/sh

if [ -f %manprefix%/man1/psplpr.1.gz ]
then
    mansuffix=1.gz
elif [ -f %manprefix%/man1/psplpr.1.Z ]
then
    mansuffix=1.Z
else
    mansuffix=1
fi

update-alternatives --install %bindir%/pslpr pslpr %bindir%/npslpr 30 \
  --slave %manprefix%/man1/pslpr.$mansuffix pslpr.$mansuffix \
    %manprefix%/man1/npslpr.$mansuffix

for f in /etc/printcap
do
    if [ -f $f ]
    then
	cat <<EOF
You may have to edit your $f entries to add the type of your printer.
Please read the psplpr manual page for an example of a valid entry. Sorry
but there is no automated way to change this file at the moment.
EOF
    fi
done

echo Updating PPD directories in known locations...\ 
for d in `%bindir%/psplpr --ppdpath | tr ':' ' '`
do
    if [ -d $d ]
    then
        find $d -type d -print | xargs %bindir%/mkppddir
    fi
done

exit 0

