summaryrefslogtreecommitdiff
path: root/source/n/iproute2/iproute2.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/iproute2/iproute2.SlackBuild')
-rwxr-xr-xsource/n/iproute2/iproute2.SlackBuild55
1 files changed, 34 insertions, 21 deletions
diff --git a/source/n/iproute2/iproute2.SlackBuild b/source/n/iproute2/iproute2.SlackBuild
index 2a97fd43..d9e8622c 100755
--- a/source/n/iproute2/iproute2.SlackBuild
+++ b/source/n/iproute2/iproute2.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +22,20 @@
# Build this against 2.6.x kernel source and headers...
-VERSION=2.6.29-1
-ARCH=${ARCH:-x86_64}
-NUMJOBS=${NUMJOBS:-" -j7 "}
-BUILD=${BUILD:-2}
+VERSION=2.6.33
+BUILD=${BUILD:-1}
+
+#NUMJOBS=${NUMJOBS:-" -j7 "}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -36,6 +46,9 @@ elif [ "$ARCH" = "s390" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
CWD=$(pwd)
@@ -49,16 +62,6 @@ rm -rf iproute2-$VERSION
tar xvf $CWD/iproute2-$VERSION.tar.bz2 || exit 1
cd iproute2-$VERSION
-# Fix up path to bdb
-zcat $CWD/iproute2.dbpath.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
-# Fix up iptables lib path
-zcat $CWD/iproute2.iptablespath.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
-if [ "$ARCH" = "x86_64" ]; then
- sed -i -e "s#/lib/tc#/lib${LIBDIRSUFFIX}/tc#" $(grep -lr '/lib/tc' *) || exit 1
- sed -i -e "s#/usr/lib/#/usr/lib${LIBDIRSUFFIX}/#" include/iptables.h || exit 1
- sed -i -e "s#/usr/lib/#/usr/lib${LIBDIRSUFFIX}/#" tc/m_ipt.c || exit 1
-fi
-
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -66,14 +69,23 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-export CFLAGS="$SLKCFLAGS"
-make $NUMJOBS DOCDIR=doc/iproute2-$VERSION MANDIR=man/ || exit 1
+# Fix up path to bdb and iptables libs
+zcat $CWD/iproute2-2.6.33-fixup_dbpath_and_iptablespath.diff.gz | sed \
+ -e "s,@LIBDIR@,/usr/lib${LIBDIRSUFFIX},g" \
+ -e "s,@VERSION@,$VERSION,g" | patch -p1 || exit 1
+
+# Use our custom SLKCFLAGS
+sed -i "s/-O2 /-O2 -fPIC /" Makefile
+
+./configure # This is okay, really :-)
+make $NUMJOBS || exit 1
-# This doesn't embed any $TMP or $PKG paths in anything
-# Have a look at what the Makefile does for why :)
mkdir -p $PKG/usr
-make install DOCDIR=doc/iproute2-$VERSION MANDIR=man/ DESTDIR=$PKG/usr/ \
- || exit 1
+make install LIBDIR=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG/usr/ || exit 1
+
+# I can't seem to make this go to the right place on x86_64, but all the
+# relevant stuff looks correct :/
+[ "$ARCH" = "x86_64" ] && mv $PKG/usr/lib $PKG/usr/lib${LIBDIRSUFFIX}
# This stuff has always been installed under /sbin rather than
# /usr/sbin, as the latter could possibly be network-mounted, and
@@ -96,6 +108,7 @@ done
# Remove junk:
[ -d $PKG/usr/usr ] && rm -r $PKG/usr/usr
+[ -d $PKG/usr/var ] && rm -r $PKG/usr/var
mkdir -p $PKG/var/lib/arpd