2023-03-07 10:17:21 +01:00
|
|
|
# Copyright 2020-2023 Gentoo Authors
|
2022-06-28 00:24:30 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=8
|
|
|
|
|
|
|
|
inherit autotools fcaps
|
|
|
|
|
|
|
|
DESCRIPTION="A routing daemon implementing OSPF, RIPv2 & BGP for IPv4 & IPv6"
|
|
|
|
HOMEPAGE="https://bird.network.cz"
|
|
|
|
SRC_URI="ftp://bird.network.cz/pub/${PN}/${P}.tar.gz"
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
|
|
|
|
SLOT="0"
|
2024-12-16 12:06:58 +01:00
|
|
|
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~x64-macos"
|
2023-04-24 21:54:24 +02:00
|
|
|
IUSE="bmp +client custom-cflags debug libssh"
|
2022-06-28 00:24:30 +02:00
|
|
|
|
|
|
|
RDEPEND="
|
2023-03-07 10:17:21 +01:00
|
|
|
client? (
|
|
|
|
sys-libs/ncurses:=
|
|
|
|
sys-libs/readline:=
|
|
|
|
)
|
2022-06-28 00:24:30 +02:00
|
|
|
filecaps? (
|
|
|
|
acct-group/bird
|
|
|
|
acct-user/bird
|
|
|
|
)
|
|
|
|
libssh? ( net-libs/libssh:= )"
|
|
|
|
BDEPEND="
|
|
|
|
sys-devel/bison
|
|
|
|
sys-devel/flex
|
|
|
|
sys-devel/m4
|
|
|
|
"
|
|
|
|
|
|
|
|
FILECAPS=(
|
|
|
|
CAP_NET_ADMIN usr/sbin/bird
|
|
|
|
CAP_NET_BIND_SERVICE usr/sbin/bird
|
|
|
|
CAP_NET_RAW usr/sbin/bird
|
|
|
|
)
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
default
|
|
|
|
eautoreconf
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
2023-04-24 21:54:24 +02:00
|
|
|
# This export makes compilation and test phases verbose
|
|
|
|
export VERBOSE=1
|
|
|
|
|
2024-12-16 12:06:58 +01:00
|
|
|
protocols="aggregator babel bfd bgp l3vpn mrt ospf perf pipe radv rip rpki static"
|
2023-04-24 21:54:24 +02:00
|
|
|
if use bmp; then
|
|
|
|
protocols="${protocols} bmp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
local myargs=(
|
|
|
|
--localstatedir="${EPREFIX}/var"
|
|
|
|
--with-protocols="${protocols}"
|
|
|
|
$(use_enable client)
|
|
|
|
$(use_enable debug)
|
2022-06-28 00:24:30 +02:00
|
|
|
$(use_enable libssh)
|
2023-04-24 21:54:24 +02:00
|
|
|
)
|
|
|
|
|
2023-07-14 14:57:03 +02:00
|
|
|
# lto must be enabled by default as bird is mono-threaded and use several
|
|
|
|
# optimisations to be fast, as it may very likely be exposed to several
|
|
|
|
# thounsand BGP updates per seconds
|
|
|
|
# Although, we make it possible to deactivate it if wanted
|
|
|
|
use custom-cflags && myargs+=( bird_cv_c_lto=no )
|
|
|
|
|
2023-04-24 21:54:24 +02:00
|
|
|
econf "${myargs[@]}"
|
2022-06-28 00:24:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
if use client; then
|
|
|
|
dobin birdc
|
|
|
|
fi
|
2023-03-07 10:17:21 +01:00
|
|
|
|
2022-06-28 00:24:30 +02:00
|
|
|
dobin birdcl
|
|
|
|
dosbin bird
|
2023-03-07 10:17:21 +01:00
|
|
|
|
2022-06-28 00:24:30 +02:00
|
|
|
newinitd "${FILESDIR}/initd-${PN}-2" ${PN}
|
|
|
|
newconfd "${FILESDIR}/confd-${PN}-2" ${PN}
|
2023-03-07 10:17:21 +01:00
|
|
|
|
2022-06-28 00:24:30 +02:00
|
|
|
dodoc doc/bird.conf.example
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
use filecaps && \
|
|
|
|
einfo "If you want to run bird as non-root, edit"
|
|
|
|
einfo "'${EROOT}/etc/conf.d/bird' and set BIRD_GROUP and BIRD_USER with"
|
|
|
|
einfo "the wanted username."
|
|
|
|
}
|