2024-12-16 10:52:05 +01:00
|
|
|
# Copyright 2020-2021 Gentoo Authors
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
# Auto-Generated by cargo-ebuild 0.2.0
|
|
|
|
|
|
|
|
EAPI=8
|
|
|
|
|
2024-12-16 11:33:09 +01:00
|
|
|
RUST_MIN_VER="1.71.1" # actually 1.70
|
|
|
|
|
2024-12-16 10:52:05 +01:00
|
|
|
CRATES=" "
|
|
|
|
|
|
|
|
inherit cargo
|
|
|
|
|
|
|
|
MY_PV=${PV/_/-}
|
|
|
|
|
|
|
|
DESCRIPTION="An RPKI relying party software"
|
|
|
|
HOMEPAGE="https://github.com/NLnetLabs/routinator"
|
|
|
|
MY_GITHUB_AUTHOR="NLnetLabs"
|
|
|
|
SRC_URI="
|
|
|
|
https://github.com/${MY_GITHUB_AUTHOR}/${PN}/archive/refs/tags/v${MY_PV}.tar.gz -> ${P}.tar.gz
|
|
|
|
https://herbizarre.swordarmor.fr/garbage/${P}-vendor.tar.xz
|
|
|
|
"
|
2024-12-16 11:55:42 +01:00
|
|
|
S="${WORKDIR}/${PN}-${MY_PV}"
|
2024-12-16 10:52:05 +01:00
|
|
|
LICENSE="BSD"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64"
|
|
|
|
IUSE="aspa rta"
|
|
|
|
|
|
|
|
DEPEND="
|
|
|
|
acct-group/routinator
|
|
|
|
acct-user/routinator
|
|
|
|
"
|
|
|
|
RDEPEND="${DEPEND}"
|
|
|
|
|
|
|
|
src_unpack() {
|
|
|
|
default
|
|
|
|
cargo_gen_config
|
|
|
|
ln -s "${WORKDIR}/vendor/" "${WORKDIR}/${P}/vendor" || die
|
|
|
|
sed -i "${ECARGO_HOME}/config.toml" -e '/source.crates-io/d' || die
|
|
|
|
sed -i "${ECARGO_HOME}/config.toml" -e '/replace-with = "gentoo"/d' || die
|
|
|
|
sed -i "${ECARGO_HOME}/config.toml" -e '/local-registry = "\/nonexistent"/d' || die
|
|
|
|
cat "${WORKDIR}/vendor/vendor-config.toml" >> "${ECARGO_HOME}/config.toml" || die
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
local myfeatures=(
|
2024-12-16 12:41:49 +01:00
|
|
|
$(usev aspa)
|
2024-12-16 10:52:05 +01:00
|
|
|
$(usev rta)
|
|
|
|
)
|
|
|
|
|
|
|
|
cargo_src_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
newinitd "${FILESDIR}/${PN}-initd" ${PN}
|
|
|
|
|
|
|
|
cargo_src_install
|
2024-12-16 11:55:42 +01:00
|
|
|
|
|
|
|
doman doc/routinator.1
|
2024-12-16 12:41:49 +01:00
|
|
|
|
|
|
|
insinto /etc
|
|
|
|
doins "${FILESDIR}/${PN}.conf"
|
2024-12-16 10:52:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
einfo ""
|
|
|
|
einfo "ARIN TAL is disabled by default because the ARIN Relying Party"
|
|
|
|
einfo "Agreement must be accepted beforehead. Read"
|
|
|
|
einfo "https://www.arin.net/resources/manage/rpki/rpa.pdf and if you agree"
|
|
|
|
einfo "with it, run"
|
|
|
|
einfo ""
|
|
|
|
einfo " su -s /bin/sh -c '${EROOT}/usr/bin/routinator --base-dir=/var/lib/routinator init -f --accept-arin-rpa' routinator"
|
|
|
|
einfo ""
|
|
|
|
einfo "as root to enable it."
|
|
|
|
einfo "If you changed values in /etc/conf.d/routinator please update it"
|
|
|
|
einfo "accordinadly in the command line."
|
|
|
|
einfo ""
|
|
|
|
|
|
|
|
# https://github.com/NLnetLabs/routinator/pull/510
|
|
|
|
# https://github.com/NLnetLabs/routinator/pull/543
|
|
|
|
if [ "${PV}" = "0.9.0" ]; then
|
|
|
|
su -l routinator -s /bin/sh -c \
|
|
|
|
"${EROOT}/usr/bin/routinator --base-dir=/var/lib/routinator init"
|
|
|
|
fi
|
|
|
|
}
|