CWD=$(pwd)
if [ "$TMP" = "" ]; then
TMP=/tmp
fi
PKG=$TMP/package-iproute2
rm -rf $PKG
mkdir -p $PKG
mkdir -p $PKG/usr/man/man8
cd $TMP
rm -rf iproute2-$VERSION
tar xzvf $CWD/iproute2-$VERSION.tar.gz
cd iproute2-$VERSION
# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/man ]; then
( cd $PKG/usr/man
for manpagedir in $(find . -type d -name "man*") ; do
( cd $manpagedir
for eachpage in $( find . -type l -maxdepth 1) ; do
ln -s $( readlink $eachpage ).gz $eachpage.gz
rm $eachpage
done
gzip -9 *.?
)
done
)
fi
mv $PKG/usr/doc/iproute2 $PKG/usr/doc/iproute2-$VERSION
cp -a RE* \
$PKG/usr/doc/iproute2-$VERSION