1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 CLASSLESS_BGP_PATCH=ht-20040304-classless-bgp.patch
8 inherit autotools eutils flag-o-matic multilib pam readme.gentoo-r1 systemd user
10 DESCRIPTION="A free routing daemon replacing Zebra supporting RIP, OSPF and BGP"
11 HOMEPAGE="http://quagga.net/"
12 SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz
13 bgpclassless? ( http://hasso.linux.ee/stuff/patches/quagga/${CLASSLESS_BGP_PATCH} )"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~s390 ~sparc ~x86"
19 IUSE="bgpclassless caps fpm doc elibc_glibc ipv6 multipath nhrpd ospfapi pam protobuf +readline snmp tcp-zebra"
22 caps? ( sys-libs/libcap )
23 nhrpd? ( net-dns/c-ares:0= )
24 protobuf? ( dev-libs/protobuf-c:0= )
29 snmp? ( net-analyzer/net-snmp )
30 !elibc_glibc? ( dev-libs/libpcre )"
31 DEPEND="${COMMON_DEPEND}
34 RDEPEND="${COMMON_DEPEND}
38 "${FILESDIR}/${PN}-0.99.22.4-ipctl-forwarding.patch"
41 DISABLE_AUTOFORMATTING=1
42 DOC_CONTENTS="Sample configuration files can be found in /usr/share/doc/${PF}/samples
43 You have to create config files in /etc/quagga before
44 starting one of the daemons.
46 You can pass additional options to the daemon by setting the EXTRA_OPTS
47 variable in their respective file in /etc/conf.d"
51 enewuser quagga -1 -1 /var/empty quagga
55 # Classless prefixes for BGP
56 # http://hasso.linux.ee/doku.php/english:network:quagga
57 use bgpclassless && eapply -p0 "${DISTDIR}/${CLASSLESS_BGP_PATCH}"
59 eapply "${PATCHES[@]}"
65 append-flags -fno-strict-aliasing
67 # do not build PDF docs
68 export ac_cv_prog_PDFLATEX=no
69 export ac_cv_prog_LATEXMK=no
72 --enable-exampledir=/usr/share/doc/${PF}/samples \
75 --enable-isis-topology \
77 --enable-user=quagga \
78 --enable-group=quagga \
79 --enable-vty-group=quagga \
80 --with-cflags="${CFLAGS}" \
81 --with-pkg-extra-version="-gentoo" \
82 --sysconfdir=/etc/quagga \
83 --localstatedir=/run/quagga \
85 $(use_enable caps capabilities) \
86 $(usex snmp '--enable-snmp' '' '' '') \
87 $(use_enable !elibc_glibc pcreposix) \
89 $(use_enable tcp-zebra) \
91 $(usex multipath $(use_enable multipath) '' '=0' '') \
92 $(usex ospfapi '--enable-opaque-lsa --enable-ospf-te --enable-ospfclient' '' '' '') \
93 $(use_enable readline vtysh) \
94 $(use_with pam libpam) \
96 $(use_enable protobuf) \
97 $(use_enable ipv6 ripngd) \
98 $(use_enable ipv6 ospf6d) \
99 $(use_enable ipv6 rtadv)
105 readme.gentoo_create_doc
108 fowners root:quagga /etc/quagga
109 fperms 0770 /etc/quagga
111 # Path for PIDs before first reboot should be created here, bug #558194
113 fowners quagga:quagga /run/quagga
114 fperms 0770 /run/quagga
116 # Install systemd-related stuff, bug #553136
117 systemd_dotmpfilesd "${FILESDIR}/systemd/quagga.conf"
118 systemd_dounit "${FILESDIR}/systemd/zebra.service"
120 # install zebra as a file, symlink the rest
121 newinitd "${FILESDIR}"/quagga-services.init.3 zebra
123 for service in bgpd isisd ospfd pimd ripd $(use ipv6 && echo ospf6d ripngd) $(use nhrpd && echo nhrpd); do
124 dosym zebra /etc/init.d/${service}
125 systemd_dounit "${FILESDIR}/systemd/${service}.service"
128 use readline && use pam && newpamd "${FILESDIR}/quagga.pam" quagga
130 insinto /etc/logrotate.d
131 newins redhat/quagga.logrotate quagga
135 readme.gentoo_print_elog