summaryrefslogtreecommitdiffstats
path: root/testing/bird/APKBUILD
blob: a94d08343d4821ebb98e87e432d5d62adc90d2bc (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
70
71
72
73
74
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=bird
pkgver=1.3.7
pkgrel=0
pkgdesc="BIRD Internet Routing Daemon"
url="http://bird.network.cz/"
arch="all"
license="GPLv2+"
depends=""
makedepends="bison flex ncurses-dev readline-dev"
install=""
subpackages="bird6"
source="ftp://bird.network.cz/pub/bird/bird-$pkgver.tar.gz
	bird.initd"

_builddir="$srcdir"/bird-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	# generate bird6.initd
	cd "$srcdir"
	sed -e 's/^name=.*/name=bird6/' bird.initd > bird6.initd
}

_build() {
	../configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		$@ \
		|| return 1
	make || return 1
}


build() {
	cd "$_builddir"
	mkdir -p ipv6 ipv4
	cd "$_builddir"/ipv6
	_build --enable-ipv6 || return 1
	cd "$_builddir"/ipv4
	_build || return 1
}

package() {
	cd "$_builddir"/ipv4
	make DESTDIR="$pkgdir" install || return 1
	cd "$_builddir"/ipv6
	make DESTDIR="$pkgdir" install || return 1
	for i in bird bird6; do
		install -Dm755 "$srcdir"/$i.initd "$pkgdir"/etc/init.d/$i \
			|| return 1
	done
}

bird6() {
	pkgdesc="BIRD Internet Routing Daemon for IPv6"
	mkdir -p "$subpkgdir"/etc \
		"$subpkgdir"/etc/init.d \
		"$subpkgdir"/usr/sbin || return 1
	mv "$pkgdir"/etc/*6.conf "$subpkgdir"/etc/ || return 1
	for i in etc/init.d usr/sbin; do
		mv "$pkgdir"/$i/*6 "$subpkgdir"/$i/ || return 1
	done
}

md5sums="c400b008ef834d9e7288dcdbe41b7c15  bird-1.3.7.tar.gz
4d58a7c5e495a4544b6e602a3ad658d3  bird.initd"