Add ebuild for FRRouting - Quagga fork with some additional features
This commit is contained in:
parent
40a44fe1d7
commit
515e475c99
2
net-misc/frr/Manifest
Normal file
2
net-misc/frr/Manifest
Normal file
@ -0,0 +1,2 @@
|
||||
DIST frr-2.0.tar.xz 2505972 SHA256 201567ddf9e89bb2f639c0ee6a8166a8c8e8458bc35d0cf5891982ec3b18d5bc SHA512 1b0aecd6c746afc16615baf2a8a66afe41050b4fffb434e55441287e3994c9197b3898a0362d4641a077981a8836c6b5592e995cd47218d695ec901c37f215ea WHIRLPOOL 186cb60f316b30cf9bafeb9a4017dc8102be1e0911a85650c09685c451d5b6d00dea0fa615f4f419b3c42bd904a2d2bff96ea58f388da9bc997ea3622ba4ff7c
|
||||
DIST ht-20040304-classless-bgp.patch 1581 SHA256 39993890f9e31d662ed0564c732fb22392a901beb45b64261ffeadd9edf27887 SHA512 3df102d8ab88aaee1f109a2310602d6f734f2268252e5e42df752df7db7abeac526e969289481c4abfe905dcd41c35dee65196c48ac320fe9d083305451476e8 WHIRLPOOL cef99d64d52ab8c28bd672fb93dfbd8d716a31c76a5403496a6d104a5ff39531d6085134124d41fe4ff7adf895fa001cbe77b6e42846d849d6c108c81583d04e
|
22
net-misc/frr/files/frr-2.0-ipctl-forwarding.patch
Normal file
22
net-misc/frr/files/frr-2.0-ipctl-forwarding.patch
Normal file
@ -0,0 +1,22 @@
|
||||
Fix for missing definitions on some Hardened configurations
|
||||
Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=437292
|
||||
|
||||
diff -Naur quagga-0.99.16.orig/zebra/ipforward_sysctl.c quagga-0.99.16/zebra/ipforward_sysctl.c
|
||||
--- quagga-0.99.16.orig/zebra/ipforward_sysctl.c 2010-03-11 12:11:32.000000000 -0500
|
||||
+++ quagga-0.99.16/zebra/ipforward_sysctl.c 2010-03-11 12:11:39.000000000 -0500
|
||||
@@ -31,6 +31,15 @@
|
||||
|
||||
#define MIB_SIZ 4
|
||||
|
||||
+/* Fix for recent (2.6.14) kernel headers */
|
||||
+#ifndef IPCTL_FORWARDING
|
||||
+ #define IPCTL_FORWARDING NET_IPV4_FORWARD
|
||||
+#endif
|
||||
+
|
||||
+#ifndef IP6CTL_FORWARDING
|
||||
+ #define IP6CTL_FORWARDING NET_IPV6_FORWARDING
|
||||
+#endif
|
||||
+
|
||||
extern struct zebra_privs_t zserv_privs;
|
||||
|
||||
/* IPv4 forwarding control MIB. */
|
43
net-misc/frr/files/frr.init
Normal file
43
net-misc/frr/files/frr.init
Normal file
@ -0,0 +1,43 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
: ${CFGFILE:=/etc/frr/${SVCNAME}.conf}
|
||||
|
||||
pidfile=/run/frr/${SVCNAME}.pid
|
||||
|
||||
command=/usr/sbin/${SVCNAME}
|
||||
command_args="-d -f ${CFGFILE} ${EXTRA_OPTS} --pid_file ${pidfile}"
|
||||
|
||||
get_service_config() {
|
||||
[ -e "$CFGFILE" ] || return
|
||||
|
||||
awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
|
||||
}
|
||||
|
||||
depend() {
|
||||
config "$CFGFILE"
|
||||
|
||||
[ ${SVCNAME} = "zebra" ] && need net || need zebra
|
||||
|
||||
[ "$(get_service_config log)" = "syslog" ] && \
|
||||
use logger
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ ! -e "${CFGFILE}" ] ; then
|
||||
eerror "Before starting ${SVCNAME} you have to configure it, by creating"
|
||||
eerror "a ${CFGFILE} file."
|
||||
eerror ""
|
||||
eerror "A sample file has been installed in `echo /usr/share/doc/frr-*/samples/${SVCNAME}.conf.sample*`"
|
||||
return 1
|
||||
fi
|
||||
|
||||
checkpath -d -m 0750 -o quagga:quagga /run/frr
|
||||
|
||||
if [ ${SVCNAME} = "zebra" ]; then
|
||||
ebegin "Cleaning up stale zebra routes..."
|
||||
ip route flush proto zebra
|
||||
eend $?
|
||||
fi
|
||||
}
|
26
net-misc/frr/files/frr.pam
Normal file
26
net-misc/frr/files/frr.pam
Normal file
@ -0,0 +1,26 @@
|
||||
#%PAM-1.0
|
||||
#
|
||||
|
||||
##### if running frr as root:
|
||||
# Only allow root (and possibly wheel) to use this because enable access
|
||||
# is unrestricted.
|
||||
auth sufficient pam_rootok.so
|
||||
|
||||
# Uncomment the following line to implicitly trust users in the "wheel" group.
|
||||
#auth sufficient pam_wheel.so trust use_uid
|
||||
# Uncomment the following line to require a user to be in the "wheel" group.
|
||||
#auth required pam_wheel.so use_uid
|
||||
###########################################################
|
||||
|
||||
# If using frr privileges and with a seperate group for vty access, then
|
||||
# access can be controlled via the vty access group, and pam can simply
|
||||
# check for valid user/password, eg:
|
||||
#
|
||||
# only allow local users.
|
||||
#auth required pam_securetty.so
|
||||
#auth include system-auth
|
||||
#auth required pam_nologin.so
|
||||
#account include system-auth
|
||||
#password include system-auth
|
||||
#session include system-auth
|
||||
#session optional pam_console.so
|
16
net-misc/frr/files/systemd/bgpd.service
Normal file
16
net-misc/frr/files/systemd/bgpd.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=BGP routing daemon
|
||||
Documentation=man:bgpd(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/bgpd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/bgpd.pid
|
||||
ExecStart=/usr/sbin/bgpd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
1
net-misc/frr/files/systemd/frr.conf
Normal file
1
net-misc/frr/files/systemd/frr.conf
Normal file
@ -0,0 +1 @@
|
||||
d /run/frr 0750 quagga quagga
|
16
net-misc/frr/files/systemd/isisd.service
Normal file
16
net-misc/frr/files/systemd/isisd.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=IS-IS routing daemon
|
||||
Documentation=man:isis(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/isisd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/isisd.pid
|
||||
ExecStart=/usr/sbin/isisd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
net-misc/frr/files/systemd/ldpd.service
Normal file
16
net-misc/frr/files/systemd/ldpd.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=LDP daemon
|
||||
Documentation=man:ldpd(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/ldpd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/ldpd.pid
|
||||
ExecStart=/usr/sbin/ldpd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
net-misc/frr/files/systemd/nhrpd.service
Normal file
16
net-misc/frr/files/systemd/nhrpd.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=NHRP daemon
|
||||
Documentation=man:nhrpd(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/nhrpd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/nhrpd.pid
|
||||
ExecStart=/usr/sbin/nhrpd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
net-misc/frr/files/systemd/ospf6d.service
Normal file
16
net-misc/frr/files/systemd/ospf6d.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=OSPF routing daemon for IPv6
|
||||
Documentation=man:ospfd(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/ospf6d.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/ospf6d.pid
|
||||
ExecStart=/usr/sbin/ospf6d -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
net-misc/frr/files/systemd/ospfd.service
Normal file
16
net-misc/frr/files/systemd/ospfd.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=OSPF routing daemon
|
||||
Documentation=man:ospfd(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/ospfd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/ospfd.pid
|
||||
ExecStart=/usr/sbin/ospfd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
17
net-misc/frr/files/systemd/pimd.service
Normal file
17
net-misc/frr/files/systemd/pimd.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=PIM-SSM routing daemon
|
||||
Documentation=man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/pimd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/pimd.pid
|
||||
ExecStart=/usr/sbin/pimd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
SuccessExitStatus=1
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
net-misc/frr/files/systemd/ripd.service
Normal file
16
net-misc/frr/files/systemd/ripd.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=RIP routing daemon
|
||||
Documentation=man:ripd(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/ripd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/ripd.pid
|
||||
ExecStart=/usr/sbin/ripd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
net-misc/frr/files/systemd/ripngd.service
Normal file
16
net-misc/frr/files/systemd/ripngd.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=RIP routing daemon for IPv6
|
||||
Documentation=man:ripngd(8) man:zebra(8)
|
||||
BindsTo=zebra.service
|
||||
After=network.target zebra.service
|
||||
ConditionPathExists=/etc/frr/ripngd.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/ripngd.pid
|
||||
ExecStart=/usr/sbin/ripngd -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
net-misc/frr/files/systemd/zebra.service
Normal file
16
net-misc/frr/files/systemd/zebra.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=GNU Zebra routing manager
|
||||
Documentation=man:zebra(8)
|
||||
After=network.target
|
||||
ConditionPathExists=/etc/frr/zebra.conf
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/frr/zebra.pid
|
||||
ExecStartPre=/bin/ip route flush proto zebra
|
||||
ExecStart=/usr/sbin/zebra -d
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
135
net-misc/frr/frr-2.0.ebuild
Normal file
135
net-misc/frr/frr-2.0.ebuild
Normal file
@ -0,0 +1,135 @@
|
||||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
CLASSLESS_BGP_PATCH=ht-20040304-classless-bgp.patch
|
||||
|
||||
inherit autotools eutils flag-o-matic multilib pam readme.gentoo-r1 systemd tmpfiles user
|
||||
|
||||
DESCRIPTION="Free Range Routing Protocol Suite, fork of Quagga"
|
||||
HOMEPAGE="https://frrouting.org/"
|
||||
SRC_URI="https://github.com/FRRouting/frr/releases/download/${P}/${P}.tar.xz
|
||||
bgpclassless? ( http://hasso.linux.ee/stuff/patches/quagga/${CLASSLESS_BGP_PATCH} )"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
IUSE="bgpclassless caps fpm doc elibc_glibc ipv6 multipath nhrpd ospfapi pam protobuf +readline snmp tcp-zebra"
|
||||
|
||||
COMMON_DEPEND="
|
||||
!!net-misc/quagga
|
||||
dev-libs/json-c:0=
|
||||
caps? ( sys-libs/libcap )
|
||||
nhrpd? ( net-dns/c-ares:0= )
|
||||
protobuf? ( dev-libs/protobuf-c:0= )
|
||||
readline? (
|
||||
sys-libs/readline:0=
|
||||
pam? ( sys-libs/pam )
|
||||
)
|
||||
snmp? ( net-analyzer/net-snmp )
|
||||
!elibc_glibc? ( dev-libs/libpcre )"
|
||||
DEPEND="${COMMON_DEPEND}
|
||||
sys-apps/gawk
|
||||
sys-devel/libtool:2"
|
||||
RDEPEND="${COMMON_DEPEND}
|
||||
sys-apps/iproute2"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-2.0-ipctl-forwarding.patch"
|
||||
)
|
||||
|
||||
DISABLE_AUTOFORMATTING=1
|
||||
DOC_CONTENTS="Sample configuration files can be found in /usr/share/doc/${PF}/samples
|
||||
You have to create config files in /etc/frr before
|
||||
starting one of the daemons.
|
||||
|
||||
You can pass additional options to the daemon by setting the EXTRA_OPTS
|
||||
variable in their respective file in /etc/conf.d"
|
||||
|
||||
pkg_setup() {
|
||||
enewgroup quagga
|
||||
enewuser quagga -1 -1 /var/empty quagga
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# Classless prefixes for BGP
|
||||
# http://hasso.linux.ee/doku.php/english:network:quagga
|
||||
use bgpclassless && eapply -p0 "${DISTDIR}/${CLASSLESS_BGP_PATCH}"
|
||||
|
||||
eapply "${PATCHES[@]}"
|
||||
eapply_user
|
||||
eautoreconf
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
append-flags -fno-strict-aliasing
|
||||
|
||||
# do not build PDF docs
|
||||
export ac_cv_prog_PDFLATEX=no
|
||||
export ac_cv_prog_LATEXMK=no
|
||||
|
||||
econf \
|
||||
--enable-exampledir=/usr/share/doc/${PF}/samples \
|
||||
--enable-irdp \
|
||||
--enable-isisd \
|
||||
--enable-ldpd \
|
||||
--enable-pimd \
|
||||
--enable-user=quagga \
|
||||
--enable-group=quagga \
|
||||
--enable-vty-group=quagga \
|
||||
--with-pkg-extra-version="-gentoo" \
|
||||
--sysconfdir=/etc/frr \
|
||||
--localstatedir=/run/frr \
|
||||
--disable-static \
|
||||
$(use_enable caps capabilities) \
|
||||
$(usex snmp '--enable-snmp' '' '' '') \
|
||||
$(use_enable !elibc_glibc pcreposix) \
|
||||
$(use_enable fpm) \
|
||||
$(use_enable tcp-zebra) \
|
||||
$(use_enable doc) \
|
||||
$(usex multipath $(use_enable multipath) '' '=0' '') \
|
||||
$(usex ospfapi '--enable-opaque-lsa --enable-ospf-te --enable-ospfclient' '' '' '') \
|
||||
$(use_enable readline vtysh) \
|
||||
$(use_with pam libpam) \
|
||||
$(use_enable nhrpd) \
|
||||
$(use_enable protobuf) \
|
||||
$(use_enable ipv6 ripngd) \
|
||||
$(use_enable ipv6 ospf6d) \
|
||||
$(use_enable ipv6 rtadv)
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
prune_libtool_files
|
||||
readme.gentoo_create_doc
|
||||
|
||||
keepdir /etc/frr
|
||||
fowners root:quagga /etc/frr
|
||||
fperms 0770 /etc/frr
|
||||
|
||||
# Install systemd-related stuff, bug #553136
|
||||
dotmpfiles "${FILESDIR}/systemd/frr.conf"
|
||||
systemd_dounit "${FILESDIR}/systemd/zebra.service"
|
||||
|
||||
# install zebra as a file, symlink the rest
|
||||
newinitd "${FILESDIR}"/frr.init zebra
|
||||
|
||||
for service in bgpd isisd ospfd ldpd pimd ripd $(use ipv6 && echo ospf6d ripngd) $(use nhrpd && echo nhrpd); do
|
||||
dosym zebra /etc/init.d/${service}
|
||||
systemd_dounit "${FILESDIR}/systemd/${service}.service"
|
||||
done
|
||||
|
||||
use readline && use pam && newpamd "${FILESDIR}/frr.pam" frr
|
||||
|
||||
insinto /etc/logrotate.d
|
||||
newins redhat/frr.logrotate frr
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Path for PIDs before first reboot should be created here, bug #558194
|
||||
tmpfiles_process frr.conf
|
||||
|
||||
readme.gentoo_print_elog
|
||||
}
|
41
net-misc/frr/metadata.xml
Normal file
41
net-misc/frr/metadata.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>admin@pinkbyte.ru</email>
|
||||
<name>Sergey Popov</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="bgpclassless">
|
||||
Apply unofficial patch to enable classless prefixes for BGP. Patch and information to be found
|
||||
at http://hasso.linux.ee/doku.php/english:network:quagga
|
||||
</flag>
|
||||
<flag name="fpm">
|
||||
Enable Forwarding Plane Manager support
|
||||
</flag>
|
||||
<flag name="multipath">
|
||||
Enable multipath routes support for any number of routes
|
||||
</flag>
|
||||
<flag name="nhrpd">
|
||||
Build Next Hop Resolution Protocol daemon
|
||||
</flag>
|
||||
<flag name="ospfapi">
|
||||
Enable OSPFAPI support for client applications accessing the OSPF link state database
|
||||
</flag>
|
||||
<flag name="pam">
|
||||
Add support for PAM (via <pkg>sys-libs/pam</pkg>) to the Quagga Virtual Terminal Interface
|
||||
Shell (vtysh); if the readline USE flag is disabled, this flag is ignored
|
||||
</flag>
|
||||
<flag name="protobuf">
|
||||
Enable support for <pkg>dev-libs/protobuf</pkg>
|
||||
</flag>
|
||||
<flag name="readline">
|
||||
Enable support for <pkg>sys-libs/readline</pkg> to provide the Quagga Virtual Terminal
|
||||
Interface Shell (vtysh)
|
||||
</flag>
|
||||
<flag name="tcp-zebra">
|
||||
Enable TCP zserv interface on port 2600 for Zebra/protocol-daemon communication. Unix domain
|
||||
sockets are chosen otherwise
|
||||
</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
Loading…
Reference in New Issue
Block a user