summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e564be4f1464f407e41ddaf786709502e69e2a72 (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
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Ronald van Haren <ronald.archlinux.org>
# Contributor: Judd Vinet <jvinet@zeroflux.org>

pkgname=iproute2-git
pkgver=4.2.0.r44.g8fe9839
pkgrel=1
pkgdesc='IP Routing Utilities - git checkout'
arch=('i686' 'x86_64')
license=('GPL2')
url="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
depends=('glibc' 'iptables' 'libmnl')
makedepends=('git' 'linux-atm')
optdepends=('linux-atm: ATM support')
provides=('iproute2')
conflicts=('iproute2' 'iproute')
backup=('etc/iproute2/ematch_map' 'etc/iproute2/rt_dsfield' 'etc/iproute2/rt_protos' \
	'etc/iproute2/rt_realms' 'etc/iproute2/rt_scopes' 'etc/iproute2/rt_tables')
source=('git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git')
sha256sums=('SKIP')

pkgver() {
	cd iproute2/

	if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
		printf '%s.r%s.g%s' \
			"$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG})" \
			"$(git rev-list --count ${GITTAG}..)" \
			"$(git log -1 --format='%h')"
	else
		printf '0.r%s.g%s' \
			"$(git rev-list --count master)" \
			"$(git log -1 --format='%h')"
	fi
}

prepare() {
	cd iproute2/

	# do not treat warnings as errors
	sed -i 's/-Werror//' Makefile
}

build() {
	cd iproute2/

	./configure
}

package() {
	cd iproute2/

	make DESTDIR="${pkgdir}" SBINDIR="/usr/bin/" install
}