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

VERSION=10.18.12
PROGNAME="netpbm $VERSION"
DESC="\
netpbm (graphics conversion utilities)                                 \n\
                                                                       \n\
The netpbm package contains a library and tools for converting between \n\
many different graphics formats."

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

compile() {
   tar -yxvf $CWD/netpbm-$VERSION.tar.bz2
   cd netpbm-$VERSION/
   chown -R root.root .
   find . -perm 777 -exec chmod 755 {} \;
   find . -perm 664 -exec chmod 644 {} \;
   find . -perm 660 -exec chmod 644 {} \;
   if [ ! -e Makefile.config ]; then
     zcat $CWD/netpbm.config.diff.gz | patch -p1 --verbose
   fi
   make -i # netpbm looks for vga.h and we don't have it
}

install() {
   mkdir /package-netpbm
   make -i package pkgdir=/package-netpbm/usr

   mkdir -p /package-netpbm/usr/doc/netpbm-$VERSION
   cp -a README doc/COPYRIGHT.PATENT doc/GPL_LICENSE.txt doc/HISTORY doc/copyright_summary \
       /package-netpbm/usr/doc/netpbm-$VERSION

   ( cd /package-netpbm/usr
     mv link/* lib/
     rm -r link
     # Here we have another dummy who thinks man pages are obsolete.
     # Start by ditching the bogus empty man pages:
     rm -r man
     # Then add the extensive man pages that existed in the source
     # tarball until the current maintainer decided to remove them:
     tar -yxvf $CWD/netpbm-manpages.tar.bz2
     # Finally, remove the perl script man replacement that truly *is* useless:
     rm -f bin/doc.url bin/manweb
     # This stuff is also pretty useless:
     rm -r misc README VERSION pkginfo
   )
}

attributes() {
   chown -R root.bin $PKG/package-netpbm/usr/bin
}

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

   cd $CTL
   cat $CWD/slack-desc > slack-desc
   sed -e 's%package-netpbm/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

