### this file is sourced not run
PKGVER=3.14.0
PKGBUILD=1
PKGARCH=x86_64

TARBALL=iproute2-$PKGVER.tar.xz
MD5SUM=bd9d7567bbb987c88120669f5e1a1092 
SRC_URL=http://distro.ibiblio.org/fatdog/source/710/clfs-packages-3.0.0.tar
BUNDLE=clfs-packages-3.0.0.tar

SLACKREQ=
SLACKDESC="iproute2: iproute2 $PKGVER (IPv4 networking utilities)  
iproute2:  
iproute2: The IPRoute2 package contains programs for basic and advanced 
iproute2: IPV4-based networking.  
iproute2: 
iproute2: 
iproute2: 
iproute2: 
iproute2: 
iproute2: 
iproute2:
"


### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/iproute2*
	patch -Np1 -i $SRC_DIR/iproute2-3.14.0-libdir-1.patch
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/iproute2*
	
	# don't build arpd (requires berkeley db)
	sed -i '/^TARGETS/s@arpd@@g' misc/Makefile
	sed -i '/ARPD/d' Makefile
	sed -i 's/arpd.8//' man/man8/Makefile

	make $MAKEFLAGS CC="gcc ${BUILD64}" LIBDIR=/usr/lib64	&&
	make LIBDIR=/usr/lib64 \
		DOCDIR=/usr/share/doc/iproute2-3.14.0 install &&

	pkg_build_slackdesc	
}
