# $Id: init.in,v 1.2 2002/03/09 00:48:14 mrsam Exp $
#
# 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

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
