#!/bin/sh
# Set initial variables:

VERSION=7.2.2

CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi
if [ ! -d $TMP ]; then
  mkdir -p $TMP # location to build the source
fi

cd $TMP
tar xjvf $CWD/apsfilter-$VERSION.tar.bz2
cd apsfilter
chown -R root.root .
# This updates the syntax for the version of hpijs that we use:
zcat $CWD/apsfilter.ijs.diff.gz | patch -p1
CFLAGS="-O2 -march=i386 -mcpu=i686" ./configure --prefix=/usr --sysconfdir=/etc
make
make install
rm -rf /usr/doc/apsfilter-$VERSION
mv /usr/doc/apsfilter /usr/doc/apsfilter-$VERSION
mkdir -p /install
cat $CWD/slack-desc > /install/slack-desc
