#!/bin/sh
# test script for testing ifhp.conf

# variables:
# ifhp - location of the ifhp file to use
#   - if you are testing an INSTALLED version, set this
#     to the location of ifhp
# ifhp=${libexecdir}/filters/ifhp  # installed
# ifhp=./ifhp             # current directory
#
# out - output is sent here
#   this can be a file or a network connection, i.e. -
#    port 9100 on most jetdirect or other boxes.  It can even
#    be a bidirectional printer port.
# out=10.0.0.14%9100      # network printer connection
# out=/tmp/out            # output to a file
#
# config - configuration file
#    this can be blank to use the ${sysconfdir}/ifhp.conf file 
#    or you can specify a test configuration file. 
#    Note that you can set the test file up with
#
#      include /path.to.default.ifhp.conf
#      [ testentry ]
#      ....
# 
# debug  - set debug level and options
# debug=0 or 1  or 2 or 3 or 4 ... you get the idea
#             0 is NO debugging, 4 is extremely verboese
# debug="1 database"  # note the SPACE separator and quotes
# debug="1 database+2"
#       The database flag controls debug traceing of reading
#       the ifhp.conf database.  VERY verbose, and gets REALLY
#       verbose.  I kinda went overboard here...
# 
# file -  input file              
#       I usually use the UTILS/one.ps or UTILS/one.pcl file
#       or do 'echo hi >/tmp/hi' for a test file.
# model - set the model information
#   yeah yeah, I know... but you have to have
# model=ps
# model=hp5si
#
# options - you set the options you want to add here
# options=info=variables
# options="duplex,a4"    # you must have commas and quotes here
#

### configure information 
prefix=
exec_prefix=${prefix}
sysconfdir=${prefix}/etc
mandir=${prefix}/man
libexecdir=${exec_prefix}/libexec
FILTER_DIR=${libexecdir}/filters

### options here ####
ifhp=${libexecdir}/filters/ifhp
ifhp=./ifhp
out=10.0.0.14%9100
out=/tmp/out
debug=0  # no debugging
debug="1 database"  # example of database
debug=1 # simple debugging
config=${sysconfdir}/ifhp.conf
file=/tmp/hi
file=${libexecdir}/filters/UTILS/one.ps
file=${libexecdir}/filters/UTILS/one.pcl
options=""
#model=ps
model=
if [ -f "$out" ] ; then cp /dev/null $out ; fi
$ifhp "-Tdev=$out,trace,config=$config,debug=$debug,model=$model,$options" <$file 2>&1 | tee /tmp/log
