summaryrefslogtreecommitdiff
blob: ebdf7de5c1f36bf5ed7c15a1a844479d3e30535e (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
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="A routing daemon implementing OSPF, RIPv2 & BGP for IPv4 or IPv6"
HOMEPAGE="http://bird.network.cz"
SRC_URI="ftp://bird.network.cz/pub/${PN}/${P}.tar.gz"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86 ~x64-macos"
IUSE="+client debug ipv6"

RDEPEND="client? ( sys-libs/ncurses )
	client? ( sys-libs/readline )"
DEPEND="sys-devel/flex
	sys-devel/bison
	sys-devel/m4"

src_prepare() {
	eapply_user
	mkdir ipv6
	tar c --exclude ipv6 . | tar x -C ipv6
}

src_configure() {
	econf \
		--disable-ipv6 \
		--localstatedir="${EPREFIX}/var" \
		$(use_enable client) \
		$(use_enable debug)

	if use ipv6; then
		cd ipv6
		econf \
			--enable-ipv6 \
			--localstatedir="${EPREFIX}/var" \
			$(use_enable client) \
			$(use_enable debug)
	fi
}

src_compile() {
	emake
	if use ipv6; then
		cd ipv6
		emake
	fi
}

src_install() {
	if use ipv6; then
		if use client; then
			newbin ipv6/birdc birdc6
		fi
		newbin ipv6/birdcl birdcl6
		newsbin ipv6/bird bird6
		newinitd "${FILESDIR}/initd-v6-${PN}-1.3.8" bird6
	fi
	if use client; then
		dobin birdc
	fi
	dobin birdcl
	dosbin bird
	newinitd "${FILESDIR}/initd-v4-${PN}-1.3.8" bird
	dodoc doc/bird.conf.example
}