commit:     ae397e779e821f72550b8a0f91c9acc2033a583b
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Mon Nov 29 17:37:02 2021 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Mon Nov 29 17:37:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae397e77

net-misc/exabgp: Version bump

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 net-misc/exabgp/Manifest              |  1 +
 net-misc/exabgp/exabgp-4.2.16.ebuild  | 64 +++++++++++++++++++++++++++++++++++
 net-misc/exabgp/files/exabgp.initd-r2 | 64 +++++++++++++++++++++++++++++++++++
 3 files changed, 129 insertions(+)

diff --git a/net-misc/exabgp/Manifest b/net-misc/exabgp/Manifest
index 310718963b10..60dfd124da04 100644
--- a/net-misc/exabgp/Manifest
+++ b/net-misc/exabgp/Manifest
@@ -1 +1,2 @@
 DIST exabgp-4.2.11.tar.gz 2931753 BLAKE2B 
e5241619db24e2e82dfb42bc613d6b2c28efac205d2bedf732a665a5a9eff1b384833cb1fec3e68a285fc01269c2eaca55b311650e59bcda13d8f024e5294dc3
 SHA512 
61c143e90fd81323b03682ad46f2861576ab0328e2030259eff15bb9ef965477c514fb355112cbaf3dc138fb9f5582b6e1e1efb8d0d4313a9b9924ced156a155
+DIST exabgp-4.2.16.tar.gz 2933071 BLAKE2B 
bc66ece537cb175811233d26f3445e1bb3f7d4f8950bf0839ced014430db17a4df614661448f275fb3a890bb2af6b2459f938f830c82f03a586829e7fe31caca
 SHA512 
06731612df6f0f6623e8ad58c3b52fc4b5dee6b4bb3bb29cee272a4061ef087e2f98739a75cd07ae51e66fb633069926899882e6bab801010ad1db3333666471

diff --git a/net-misc/exabgp/exabgp-4.2.16.ebuild 
b/net-misc/exabgp/exabgp-4.2.16.ebuild
new file mode 100644
index 000000000000..b04278316850
--- /dev/null
+++ b/net-misc/exabgp/exabgp-4.2.16.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+inherit tmpfiles systemd distutils-r1
+
+DESCRIPTION="The BGP swiss army knife of networking"
+HOMEPAGE="https://github.com/Exa-Networks/exabgp";
+SRC_URI="https://github.com/Exa-Networks/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       acct-group/exabgp
+       acct-user/exabgp
+"
+BDEPEND="
+       test? (
+               dev-python/psutil[${PYTHON_USEDEP}]
+               dev-python/nose[${PYTHON_USEDEP}]
+               dev-python/six[${PYTHON_USEDEP}]
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/exabgp-4.2.7-paths.patch"
+       "${FILESDIR}/exabgp-4.2.10-ip-path.patch"
+       "${FILESDIR}/exabgp-4.2.11-healthcheck-allow-disable-metric.patch"
+       "${FILESDIR}/exabgp-4.2.11-healthcheck-fix-log-crash.patch"
+       "${FILESDIR}/exabgp-4.2.11-less-verbose-logging.patch"
+)
+
+python_test() {
+       ./qa/bin/parsing || die "tests fail with ${EPYTHON}"
+       nosetests -v ./qa/tests/*_test.py || die "tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+       distutils-r1_python_install_all
+
+       newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+       newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+       newtmpfiles "${FILESDIR}/exabgp.tmpfiles" ${PN}.conf
+       systemd_dounit etc/systemd/*
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+       keepdir /etc/exabgp
+
+       doman doc/man/*.?
+}
+
+pkg_postinst() {
+       tmpfiles_process ${PN}.conf
+}

diff --git a/net-misc/exabgp/files/exabgp.initd-r2 
b/net-misc/exabgp/files/exabgp.initd-r2
new file mode 100644
index 000000000000..30280b9cfbf7
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp.initd-r2
@@ -0,0 +1,64 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# default arguments
+: "${EXABGP_ARGS:=--env=/etc/${RC_SVCNAME}/exabgp.env 
/etc/${RC_SVCNAME}/exabgp.conf}"
+
+command="capsh"
+command_args="
+       --groups=${EXABGP_GROUP:=exabgp}
+       --user=${EXABGP_USER:=exabgp}
+       --caps='cap_net_admin+epi cap_setuid+ep-i cap_setgid+ep-i'
+       -- -c \"/usr/bin/exabgp ${EXABGP_ARGS}\""
+
+supervisor=supervise-daemon
+
+: "${pidfile:=/run/exabgp/${RC_SVCNAME}-supervisor.pid}"
+: "${output_log:=/var/log/${RC_SVCNAME}/exabgp.log}"
+: "${error_log:=/var/log/${RC_SVCNAME}/exabgp.log}"
+
+extra_started_commands="routes sessions"
+extra_commands="checkconfig"
+
+depend() {
+       need net
+}
+
+start_pre() {
+       checkpath -q -d -m 0755 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+               /run/exabgp || return
+
+       checkpath -q -p -m 0600 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+               /run/exabgp/${RC_SVCNAME}.in /run/exabgp/${RC_SVCNAME}.out || 
return
+
+       checkpath -q -d -m 0755 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+               "/var/log/${RC_SVCNAME}" || return
+
+       checkconfig || return
+}
+
+stop_pre() {
+       # don't restart if the configuration is bad
+       if [ "${RC_CMD}" = restart ]; then
+               checkconfig || return
+       fi
+}
+
+checkconfig() {
+       ebegin "Checking configuration for ${RC_SVCNAME}"
+       exabgp -t ${EXABGP_ARGS}
+       eend ${?} "Invalid configuration"
+}
+
+sessions() {
+       ebegin "Querying sessions"
+       exabgpcli --env /etc/${RC_SVCNAME}/exabgp.env show neighbor summary
+       eend ${?} "exabgpcli failed"
+}
+
+routes() {
+       ebegin "Querying routes"
+       exabgpcli --env /etc/${RC_SVCNAME}/exabgp.env show adj-rib out
+       eend ${?} "exabgpcli failed"
+}

Reply via email to