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

VERSION=2.6.7-ss040608
PROGNAME="iproute2 $VERSION"
DESC="\
iproute2 (IP routing utilities)                                        \n
                                                                       \n
These are tools used to administer many advanced IP routing features   \n
in the kernel.  See Configure.help in the kernel documentation         \n
(search for iproute2) for more information on which kernel options     \n
these tools are used with.                                             \n
                                                                       \n
These utilities were written by Alexey Kuznetsov."

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

compile() {
   tar -zxvf $CWD/iproute2-$VERSION.tar.gz
   cd iproute2-2.6.7/
   zcat $CWD/iproute2-2.6.7.arpd.ss.diff.gz | patch -p1 --verbose
   chown -R root.root .
   find . -perm 775 -exec chmod 755 {} \;
   find . -perm 444 -exec chmod 644 {} \;
   make
}

install() {
   make install DESTDIR=/package-iproute2
   cp -a man /package-iproute2/usr/
   mkdir -p /package-iproute2/usr/doc/iproute2-$VERSION
   cp -a RE* /package-iproute2/usr/doc/iproute2-$VERSION
   mv /package-iproute2/usr/doc/iproute2/* /package-iproute2/usr/doc/iproute2-$VERSION
   rmdir /package-iproute2/usr/doc/iproute2

   mkdir -p /package-iproute2/var/lib/arpd

   ( cd /package-iproute2/usr/man/man8
     rm -f *.gz
     gzip -9 *.8
     rm -rf tc-bfifo.8 ; ln -sf tc-pbfifo.8.gz tc-bfifo.8.gz
     rm -rf tc-pfifo.8 ; ln -sf tc-pbfifo.8.gz tc-pfifo.8.gz
   )

}

attributes() {
   chown -R root.bin $PKG/package-iproute2/sbin
}

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

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

