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

VERSION=4.1.7
PROGNAME="GNU find utilties 4.1.7"
DESC="\
findutils (utilities to locate files)                                  \n\
                                                                       \n\
This package contains the GNU find and xargs programs.  The find and   \n\
xargs implementations comply with POSIX 1003.2.  They also support     \n\
some additional options, some borrowed from Unix and some unique to    \n\
GNU."

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

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

   CFLAGS=-O2 ./configure --prefix=/usr
 
   # the configure script won't behave, so we'll fix it manually
   ( cd locate/
     sed -e '/^localstatedir/ s#\$(prefix)/var#/var/spool/locate#' Makefile \
         > Makefile.new
     mv Makefile.new Makefile
   )
   make
}

install() {
   make install prefix=/package-findutils/usr

   rm /package-findutils/usr/bin/locate /package-findutils/usr/bin/updatedb
   rm -rf /package-findutils/usr/libexec
   rm -rf /package-findutils/usr/man/man5
   rm -rf /package-findutils/usr/var

   rm /package-findutils/usr/man/man1/locate.1
   rm /package-findutils/usr/man/man1/updatedb.1

   ( cd /package-findutils/usr/info
     rm -f *.gz
     gzip -9 *
   )
   ( cd /package-findutils/usr/man/man1
     rm -f *.gz
     gzip -9 *.1
   )
}

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

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

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

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

