82 lines
2.1 KiB
Bash
82 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
|
|
|
|
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
|
|
|| ( >=dev-lang/rust-1.70 >=dev-lang/rust-bin-1.70 )
|
|
"
|
|
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
|
|
}
|