# Maintainer: Natanael Copa pkgname=iproute2 pkgver=4.6.0 _realver=$pkgver pkgrel=2 pkgdesc="IP Routing Utilities" url="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2" arch="all" license="GPL2" depends= install="$pkgname.post-install" makedepends="bison flex bash iptables-dev libelf-dev" subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp" source="http://kernel.org/pub/linux/utils/net/iproute2/iproute2-$pkgver.tar.xz musl-fixes.patch" _builddir="$srcdir"/$pkgname-$_realver prepare() { cd "$_builddir" local i for i in $source; do case $i in *.patch) msg "$i"; patch -p0 -i "$srcdir"/$i || return 1;; esac done sed -i '/^TARGETS=/s: arpd : :' misc/Makefile sed -i 's:/usr/local:/usr:' tc/m_ipt.c include/iptables.h || return 1 sed -i -e 's:=/share:=/usr/share:' \ -e 's:-Werror::' Makefile || return 1 } build() { cd "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --localstatedir=/var \ || return 1 make CCOPTS="-D_GNU_SOURCE $CFLAGS" LIBDIR=/lib || return 1 } package() { cd "$_builddir" make -j1 DESTDIR="$pkgdir" install || return 1 } bashcomp() { depends="" pkgdesc="Bash completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel bash-completion" arch="noarch" mkdir -p "$subpkgdir"/usr/share/ mv "$pkgdir"/usr/share/bash-completion \ "$subpkgdir"/usr/share || return 1 rmdir -p "$pkgdir"/usr/share 2>/dev/null || true } md5sums="d015e437e4f744d51d3a1a53341826d5 iproute2-4.6.0.tar.xz 9a957abdc5267f386e0a6fee6e59ee44 musl-fixes.patch" sha256sums="74fc6a8ad085be095a159f8158bbaf385b42af9e101619f233f1ae466829d406 iproute2-4.6.0.tar.xz 73771a6cee68aef892eeb4c2f243931db69abaabd7b13d20f2eb62a8be2c0f9d musl-fixes.patch" sha512sums="1e3868ced65012da6724744eb15e6bb8e2c5bf8d7a46cf2b655526de1a9e1224c7b7e9bd4a88e40516b5648955987eb9001600ca5afbd507bc664f92b51ede9f iproute2-4.6.0.tar.xz 2684a3b9ea8b32ebfbe7c329c01e4f1371ed1ecb6c0ed8c074677c1ba31be72f937c6850473c075b61ff41ca67d4d9f339501fefe7d1bd4118ba33663824647e musl-fixes.patch"