SwordArMor-gentoo-overlay/net-misc/stayrtr/stayrtr-0.6.1.ebuild
Alarig Le Lay f357e5fe94
net-misc/stayrtr: caps and init fix
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
2024-12-28 08:51:02 +01:00

45 lines
1.1 KiB
Bash

# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit fcaps go-module systemd
DESCRIPTION="RPKI-To-Router server implementation in Go"
HOMEPAGE="https://github.com/bgp/stayrtr"
SRC_URI="https://github.com/bgp/stayrtr/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz
https://herbizarre.swordarmor.fr/garbage/${P}-deps.tar.xz
"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
acct-user/${PN}
net-misc/rpki-client
"
DEPEND="${RDEPEND}"
FILECAPS=(
CAP_NET_ADMIN usr/bin/stayrtr
CAP_NET_BIND_SERVICE usr/bin/stayrtr
CAP_NET_RAW usr/bin/stayrtr
)
src_compile() {
ego build -trimpath -ldflags "-X main.version=${PV}" ${GOFLAGS} ./cmd/stayrtr/stayrtr.go
ego build -trimpath -ldflags "-X main.version=${PV}" ${GOFLAGS} ./cmd/rtrdump/rtrdump.go
ego build -trimpath -ldflags "-X main.version=${PV}" ${GOFLAGS} ./cmd/rtrmon/rtrmon.go
}
src_install() {
dobin stayrtr
dobin rtrdump
dobin rtrmon
newinitd "${FILESDIR}/${PN}-init.d" ${PN}
newconfd "${FILESDIR}/${PN}-conf.d" ${PN}
systemd_dounit "${FILESDIR}/${PN}.service"
}