IGNOREPATH=/etc:/home:/var:/dev:/boot:/root:/tmp:/usr/local:/bin:/sbin:/mnt:/usr/src
STRIPLIB=y
STRIPBIN=y

VERSION=3.5.11
PROGNAME="ifhp $VERSION"
DESC="\
ifhp (Almost Universal LPRng Print Filter)                             \n\
                                                                       \n\
ifhp is a highly versatile print filter for BSD based print spoolers.  \n\
It can be configured to handle text, PostScript, PJL, PCL, and raster  \n\
printers, supports conversion from one format to another, and can be   \n\
used as a stand-alone print utility.  It is the primary supported      \n\
print filter for the LPRng print spooler."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=ftp://ftp.gnu.org/pub/gnu/ifhp
PKGNAME=ifhp-$VERSION-s390-$BUILD
TAG=OPT

compile() {
   tar -zxvf $CWD/ifhp-$VERSION.tar.gz
   cd ifhp-$VERSION/

   # I had to go with -O1 here instead of -O2 because of some sort of error with
   # the vars.c file.
   CFLAGS=-O1 \
   ./configure --prefix=/usr \
               --enable-nls \
               --sysconfdir=/etc
   make
}

install() {
   make install DESTDIR=/package-ifhp

   mkdir -p /package-ifhp/usr/doc/ifhp-$VERSION
   cp -a BUGS CHANGES INSTALL LICENSE MIRRORS README README.GhostScriptSecurityProblem \
         README.UTILITYPROGRAMS VERSION \
       /package-ifhp/usr/doc/ifhp-$VERSION

   ( cd /package-ifhp/usr/man/man8
     rm -f *.gz
     gzip -9 *.8
   )

   rm -rf /package-ifhp/usr/libexec/filters/UTILS/ \
          /package-ifhp/usr/share
   rm /package-ifhp/etc/ifhp.conf.sample
   mv /package-ifhp/etc/ifhp.conf /package-ifhp/etc/ifhp.conf.new
}

attributes() {
   chmod 644 $PKG/package-ifhp/usr/man/man8/*
}

special() {
   cd $PKG
   mv package-ifhp/* ./
   rmdir package-ifhp

   cd $CTL
   cat $CWD/slack-desc > slack-desc

   cat $CWD/doinst.sh >> doinst.sh
   sed -e 's%package-ifhp/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

