aboutsummaryrefslogtreecommitdiffstats
path: root/main/iproute2/APKBUILD
blob: a2b33853b354c5c6d0910f656fc4654db7ed5b2c (plain)
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
60
61
62
63
64
65
66
67
68
69
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=iproute2
pkgver=4.7.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"
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="d4b205830cdc2702f8a0cbd6232129cd  iproute2-4.7.0.tar.xz
9a957abdc5267f386e0a6fee6e59ee44  musl-fixes.patch"
sha256sums="8f60dbcfb33a79daae0638f53bdcaa4310c0aa59ae39af8a234020dc69bb7b92  iproute2-4.7.0.tar.xz
73771a6cee68aef892eeb4c2f243931db69abaabd7b13d20f2eb62a8be2c0f9d  musl-fixes.patch"
sha512sums="dd884b192ede7f165d565dce6819fb7280eda880d4d53e06a604ab20e7ce343ba37847750172fd52061892e9db3d18bd8ae13d37bd4410e50a8f704cb3fe4ece  iproute2-4.7.0.tar.xz
2684a3b9ea8b32ebfbe7c329c01e4f1371ed1ecb6c0ed8c074677c1ba31be72f937c6850473c075b61ff41ca67d4d9f339501fefe7d1bd4118ba33663824647e  musl-fixes.patch"