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 doc elibc_glibc ipv6 multipath ospfapi pam protobuf +readline snmp tcp-zebra"
22 caps? ( sys-libs/libcap )
23 protobuf? ( dev-libs/protobuf-c:0= )
28 snmp? ( net-analyzer/net-snmp )
29 !elibc_glibc? ( dev-libs/libpcre )"
30 DEPEND="${COMMON_DEPEND}
33 RDEPEND="${COMMON_DEPEND}
37 "${FILESDIR}/${PN}-0.99.22.4-ipctl-forwarding.patch"
40 DISABLE_AUTOFORMATTING=1
41 DOC_CONTENTS="Sample configuration files can be found in /usr/share/doc/${PF}/samples
42 You have to create config files in /etc/quagga before
43 starting one of the daemons.
45 You can pass additional options to the daemon by setting the EXTRA_OPTS
46 variable in their respective file in /etc/conf.d"
50 enewuser quagga -1 -1 /var/empty quagga
54 # Classless prefixes for BGP
55 # http://hasso.linux.ee/doku.php/english:network:quagga
56 use bgpclassless && eapply -p0 "${DISTDIR}/${CLASSLESS_BGP_PATCH}"
58 eapply "${PATCHES[@]}"
64 append-flags -fno-strict-aliasing
66 # do not build PDF docs
67 export ac_cv_prog_PDFLATEX=no
68 export ac_cv_prog_LATEXMK=no
71 --enable-exampledir=/usr/share/doc/${PF}/samples \
74 --enable-isis-topology \
76 --enable-user=quagga \
77 --enable-group=quagga \
78 --enable-vty-group=quagga \
79 --with-cflags="${CFLAGS}" \
80 --with-pkg-extra-version="-gentoo" \
81 --sysconfdir=/etc/quagga \
82 --localstatedir=/run/quagga \
84 $(use_enable caps capabilities) \
85 $(usex snmp '--enable-snmp' '' '' '') \
86 $(use_enable !elibc_glibc pcreposix) \
87 $(use_enable tcp-zebra) \
89 $(usex multipath $(use_enable multipath) '' '=0' '') \
90 $(usex ospfapi '--enable-opaque-lsa --enable-ospf-te --enable-ospfclient' '' '' '') \
91 $(use_enable readline vtysh) \
92 $(use_with pam libpam) \
93 $(use_enable protobuf) \
94 $(use_enable ipv6 ripngd) \
95 $(use_enable ipv6 ospf6d) \
96 $(use_enable ipv6 rtadv)
102 readme.gentoo_create_doc
105 fowners root:quagga /etc/quagga
106 fperms 0770 /etc/quagga
108 # Path for PIDs before first reboot should be created here, bug #558194
110 fowners quagga:quagga /run/quagga
111 fperms 0770 /run/quagga
113 # Install systemd-related stuff, bug #553136
114 systemd_dotmpfilesd "${FILESDIR}/systemd/quagga.conf"
115 systemd_dounit "${FILESDIR}/systemd/zebra.service"
117 # install zebra as a file, symlink the rest
118 newinitd "${FILESDIR}"/quagga-services.init.3 zebra
120 for service in bgpd isisd ospfd pimd ripd $(use ipv6 && echo ospf6d ripngd); do
121 dosym zebra /etc/init.d/${service}
122 systemd_dounit "${FILESDIR}/systemd/${service}.service"
125 use readline && use pam && newpamd "${FILESDIR}/quagga.pam" quagga
127 insinto /etc/logrotate.d
128 newins redhat/quagga.logrotate quagga
132 readme.gentoo_print_elog