# Maintainer: Natanael Copa pkgname=iproute2 pkgver=4.9.0 _realver=$pkgver pkgrel=0 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:noarch" 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" 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="44a8371a4b2c40e48e4c9f98cbd41391 iproute2-4.9.0.tar.xz ea8ff3227b0b90717e305e0cdd7c158f musl-fixes.patch" sha256sums="c0f30f043f7767cc1b2cd2197b08d4e9b2392c95823fabe30bbce308c30116c4 iproute2-4.9.0.tar.xz 57678dafb510bf1797240d0713d173c9aa2f7bf137471fe490d07daaf68dd5f7 musl-fixes.patch" sha512sums="0d974d7c001eac75def0d90b628e432d9847024843d02a6cd27266ff30e3f7a9c874fa91115da74db5f321c2e815b486a847059ca6df3aa8ea49432ffa39a889 iproute2-4.9.0.tar.xz bb8f1f76e0f0a33785ee884b05ad8242780f2069dd9362624ec03b9952d567cac612febd9928b59fd489d5032fb97f179de13676c044cc533cf5280de932ce86 musl-fixes.patch"