#! /bin/sh

APS_BASEDIR=`grep APS_BASEDIR /etc/printcap | cut -d ':' -f 2`

if [ ! $APS_BASEDIR ]; then
	echo "you must install apsfilter first before installing a2ps"
	exit 1
else
	echo "installing a2ps in $APS_BASEDIR/bin"
	sleep 1
fi

BINDIR=$APS_BASEDIR/bin

cp xa2ps $BINDIR/a2ps
chmod 555 $BINDIR/a2ps

if [ -d /usr/local/man/man1 ]; then
	cp a2ps.1 /usr/local/man/man1 \
	&& echo "installing a2ps.1 /usr/local/man/man1"
elif [ -d /usr/share/man/man1 ]; then
	cp a2ps.1 /usr/share/man/man1 \
	&& echo "installing a2ps.1 /usr/share/man/man1"
elif [ -d /usr/man/man1 ]; then
	cp a2ps.1 /usr/man/man1 \
	&& echo "installing a2ps.1 /usr/man/man1"
fi
