summaryrefslogtreecommitdiff
path: root/system/iproute2/APKBUILD
blob: bf0266e6552452acf781ac3ca5184fb56efe44e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=iproute2
pkgver=4.19.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="https://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="47c750da2247705b1b1d1621f58987333e54370d0fff2f24106194022de793ff35dfd67fd1be127ce019008705702092d31dac49abf930a7c0dc5c7e7c0665b8  iproute2-4.19.0.tar.xz
d9b40539f4ac074f20b0bb10381de9c3b64aadf612f0d599814cdb632fe97c76c9b4730406b08a6e53739670ca51ea0f699862156247cf20c3b7f4c78394fa46  fix-uapi-garbage.patch"