SwordArMor-gentoo-overlay/net-misc/routinator/routinator-0.14.0.ebuild
Alarig Le Lay b4d109ef26
net-misc/routinator: rust min ver fix
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
2024-12-16 11:33:30 +01:00

83 lines
2.1 KiB
Bash

# 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
RUST_MIN_VER="1.71.1" # actually 1.70
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
"
RESTRICT="mirror"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="aspa rta"
S="${WORKDIR}/${PN}-${MY_PV}"
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=(
$(usev rta)
)
cargo_src_configure
}
src_install() {
newinitd "${FILESDIR}/${PN}-initd" ${PN}
newconfd "${FILESDIR}/${PN}-confd" ${PN}
cargo_src_install
}
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
}