#!/bin/sh

#	$Id: mksymlinks,v 1.1.1.1 1999/02/18 20:05:35 andreas Exp $

#
# mkfilter - make feature-filters for you printer
#

FILTER_DIR=$APS_BASEDIR/filter

PRINTER=$1
PAPER=$2
shift; shift
COLOR="$*"

if [ ! -d $FILTER_DIR ]; then
	echo "cannot find the directory for printerfilter (symlinks)"
	echo "creating $FILTER_DIR..."
	mkdir -p $FILTER_DIR
fi

cd $FILTER_DIR

set -x 

for color in $COLOR
do
    for method in auto ascii
    do
        if [ -f aps-${PRINTER}-${PAPER}-${method}-${color} ]; then
		rm -f aps-${PRINTER}-${PAPER}-${method}-${color}
	fi
        ln -s ../bin/apsfilter aps-${PRINTER}-${PAPER}-${method}-${color}
    done
done

# and now a raw filter to print data unprocessed ...

if [ -f aps-${PRINTER}-${PAPER}-raw ]; then
	rm -f aps-${PRINTER}-${PAPER}-raw
fi
ln -s ../bin/apsfilter ./aps-${PRINTER}-${PAPER}-raw
