SwordArMor-gentoo-overlay/net-misc/bird/bird-2.0.7-r1.ebuild
Alarig Le Lay 325c3f980f
net-misc/bird: Backporting improvements from gh #15016
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
2020-08-30 00:28:41 +02:00

65 lines
1.3 KiB
Bash

# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit 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"
KEYWORDS="~amd64 ~arm64 ~x86 ~x64-macos"
IUSE="+client debug libssh"
RDEPEND="
client? ( sys-libs/ncurses:= )
client? ( sys-libs/readline:= )
filecaps? (
acct-group/bird
acct-user/bird
)
libssh? ( net-libs/libssh:= )"
BDEPEND="sys-devel/flex
sys-devel/bison
sys-devel/m4"
PATCHES=(
"${FILESDIR}/${P}-ipv6-rpki.patch"
"${FILESDIR}/${P}-attrs.c.patch"
)
FILECAPS=(
CAP_NET_ADMIN usr/sbin/bird
CAP_NET_BIND_SERVICE usr/sbin/bird
CAP_NET_RAW usr/sbin/bird
)
src_configure() {
econf \
--localstatedir="${EPREFIX}/var" \
$(use_enable client) \
$(use_enable debug) \
$(use_enable libssh)
}
src_install() {
if use client; then
dobin birdc
fi
dobin birdcl
dosbin bird
newinitd "${FILESDIR}/initd-${PN}-2" ${PN}
newconfd "${FILESDIR}/confd-${PN}-2" ${PN}
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."
}