Merge github#363: sys-process/atop: add systemd support
[gentoo.git] / net-misc / bird / bird-1.3.9.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 DESCRIPTION="A routing daemon implementing OSPF, RIPv2 & BGP for IPv4 or IPv6"
8 HOMEPAGE="http://bird.network.cz"
9 SRC_URI="ftp://bird.network.cz/pub/${PN}/${P}.tar.gz"
10 LICENSE="GPL-2"
11
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="debug ipv6"
15
16 RDEPEND="sys-libs/ncurses
17         sys-libs/readline"
18 DEPEND="sys-devel/flex
19         sys-devel/bison
20         sys-devel/m4"
21
22 src_prepare() {
23         mkdir ipv6
24         tar c --exclude ipv6 . | tar x -C ipv6
25 }
26
27 src_configure() {
28         econf \
29                 --enable-client \
30                 --disable-ipv6 \
31                 --localstatedir="${EPREFIX}/var" \
32                 $(use_enable debug)
33
34         if use ipv6; then
35                 cd ipv6
36                 econf \
37                         --enable-client \
38                         --enable-ipv6 \
39                         --localstatedir="${EPREFIX}/var" \
40                         $(use_enable debug)
41         fi
42 }
43
44 src_compile() {
45         emake
46         if use ipv6; then
47                 cd ipv6
48                 emake
49         fi
50 }
51
52 src_install() {
53         if use ipv6; then
54                 newbin ipv6/birdc birdc6
55                 newsbin ipv6/bird bird6
56                 newinitd "${FILESDIR}/initd-v6-${PN}-1.3.8" bird6
57         fi
58         dobin birdc
59         dosbin bird
60         newinitd "${FILESDIR}/initd-v4-${PN}-1.3.8" bird
61         dodoc doc/bird.conf.example
62 }