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

VERSION=4.1.3
PROGNAME="GNU MP"
DESC="\
gmp (GNU multiple precision arithmetic library)                        \n\
                                                                       \n\
GNU MP is a library for arbitrary precision arithmetic, operating on   \n\
signed integers, rational numbers, and floating point numbers.  It has \n\
a rich set of functions, and the functions have a regular interface."

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

compile() {
   tar -yxvf $CWD/gmp-$VERSION.tar.bz2
   cd gmp-$VERSION/
   chown -R root.root .
   find . -perm 664 -exec chmod 644 {} \;
   find . -perm 600 -exec chmod 644 {} \;
   find . -perm 444 -exec chmod 644 {} \;
   find . -perm 400 -exec chmod 644 {} \;
   find . -perm 440 -exec chmod 644 {} \;
   find . -perm 777 -exec chmod 755 {} \;
   find . -perm 775 -exec chmod 755 {} \;
   find . -perm 511 -exec chmod 755 {} \;
   find . -perm 711 -exec chmod 755 {} \;
   find . -perm 555 -exec chmod 755 {} \;
   find . -perm 664 -exec chmod 644 {} \;
   CFLAGS=-O2 \
   ./configure --prefix=/usr \
               --with-gnu-ld \
               --enable-cxx \
               --enable-mpbsd \
               --build=s390-slackware-linux \
               --host=s390-slackware-linux \
               --target=s390-slackware-linux
   make
}

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

   mkdir -p /package-gmp/usr/doc/gmp-$VERSION
   cp -a AUTHORS COPYING COPYING.LIB NEWS README \
       /package-gmp/usr/doc/gmp-$VERSION

   ( cd /package-gmp/usr/info
     rm -f *.gz
     gzip -9 *
   )

}

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

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

