#
# Copyright 2002 Double Precision, Inc.  See COPYING for
# distribution information.
#
# Common initialization for shell-based filters

OUTDIR="$1"
TROFF=/usr/bin/troff
DPOST=/usr/bin/grops
TBL=/usr/bin/tbl
GS="/usr/bin/gs -P-"

prefix=/usr
exec_prefix=/usr
sysconfdir=/etc/courier

FAXRES="${FAXRES:-hi}"

if test "$FAXRES" = "lo"
then
    FAXRES="-r204x98"
else
    FAXRES="-r204x196"
fi

die() {
    echo "Unable to generate fax document - $1 not found" >&2
    exit 1
}

test -x $TROFF || die $TROFF
test -x $DPOST || die $DPOST
test -x $TBL || die $TBL

set -e
