summaryrefslogblamecommitdiff
path: root/system/iproute2/APKBUILD
blob: afebbb5cfa722cd6e57ee9a6dd9d390024a54840 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                    
                
             
        

                                                                  
          
                      

                               

                                                                            


                                                                              
                               







































                                                                 

                                                                                                                                                                    
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=iproute2
pkgver=4.17.0
pkgrel=0
pkgdesc="IP configuration, routing, and traffic control utilities"
url="https://wiki.linuxfoundation.org/networking/iproute2"
arch="all"
license="GPL-2.0-only"
depends=""
install="$pkgname.post-install"
makedepends="bison flex bash libelf-dev libmnl-dev libcap-dev"
# the testsuite in this package seems to be geared towards kernel developers
options="!check"
subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
source="http://kernel.org/pub/linux/utils/net/iproute2/iproute2-$pkgver.tar.xz
        fix-uapi-garbage.patch"

prepare() {
	default_prepare
	cd "$builddir"

	sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
	sed -i 's:/usr/local:/usr:' tc/m_ipt.c include/iptables.h
	sed -i -e 's:=/share:=/usr/share:' \
		-e 's:-Werror::' Makefile
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make CCOPTS="-D_GNU_SOURCE $CFLAGS" LIBDIR=/lib
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install
}

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

	rmdir -p "$pkgdir"/usr/share 2>/dev/null || true
}

sha512sums="ccd7fb70afd58f1fcd4e17c38a24607207da853c4d6118fda423efa6e51faad3ad03c4d6d58a579c40ef9c68aaf13b1c455e12b0c36e155712d3d4db3c2ff4b5  iproute2-4.17.0.tar.xz
d9b40539f4ac074f20b0bb10381de9c3b64aadf612f0d599814cdb632fe97c76c9b4730406b08a6e53739670ca51ea0f699862156247cf20c3b7f4c78394fa46  fix-uapi-garbage.patch"