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

                                                    
                
            
        

                                                                  
          

                                                                            
                      
          
                                                                                 
                                                                   
                                                                               
                              


                       







                                                                 










                                                       














                                                              

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

prepare() {
	default_prepare

	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() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make CCOPTS="-D_GNU_SOURCE $CFLAGS" LIBDIR=/lib
}

package() {
	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="5c8319b040bd0ba98cf1225b2a77efafc662741344c53877ee38cf108ca01906b03328e4f9b00b7557e301c6e64bca4e42e92af477b4d657bcbff5120c0c4e87  iproute2-5.1.0.tar.xz
3585c70d110749e0bdba7f1bbdc32c7d635147026fbb9662f63dfcca2405e8a45cc990cb6ad38b6405cde23a1535a59ff854387ae1649b4241597ec71f445e20  devlink-sysinfo.patch"