From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BC2401382C5 for ; Wed, 20 May 2020 01:06:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CA1E4E0833; Wed, 20 May 2020 01:06:20 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A0D98E0833 for ; Wed, 20 May 2020 01:06:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F0DBF34F199 for ; Wed, 20 May 2020 01:06:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8C78A230 for ; Wed, 20 May 2020 01:06:16 +0000 (UTC) From: "Patrick McLean" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Patrick McLean" Message-ID: <1589936769.de4fcd8eb8aa91102dfe549b36f78b9491229f83.chutzpah@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/exabgp/, net-misc/exabgp/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/exabgp/exabgp-4.2.7-r1.ebuild net-misc/exabgp/exabgp-4.2.7.ebuild net-misc/exabgp/files/exabgp-4.2.7-paths.patch net-misc/exabgp/files/exabgp.confd net-misc/exabgp/files/exabgp.initd net-misc/exabgp/files/exabgp.logrotate net-misc/exabgp/files/exabgp.tmpfiles X-VCS-Directories: net-misc/exabgp/ net-misc/exabgp/files/ X-VCS-Committer: chutzpah X-VCS-Committer-Name: Patrick McLean X-VCS-Revision: de4fcd8eb8aa91102dfe549b36f78b9491229f83 X-VCS-Branch: master Date: Wed, 20 May 2020 01:06:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 307dcdef-a1c6-418d-851b-442c0faac2bb X-Archives-Hash: 7a97a76befda46cc0da0b74bf8cb8fb2 commit: de4fcd8eb8aa91102dfe549b36f78b9491229f83 Author: Patrick McLean sony com> AuthorDate: Wed May 20 01:02:50 2020 +0000 Commit: Patrick McLean gentoo org> CommitDate: Wed May 20 01:06:09 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de4fcd8e net-misc/exabgp-4.2.7-r1: revbump, add init script, logrotate, etc Copyright: Sony Interactive Entertainment Inc. Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Patrick McLean gentoo.org> ...{exabgp-4.2.7.ebuild => exabgp-4.2.7-r1.ebuild} | 17 ++++++- net-misc/exabgp/files/exabgp-4.2.7-paths.patch | 8 +-- net-misc/exabgp/files/exabgp.confd | 10 ++++ net-misc/exabgp/files/exabgp.initd | 59 ++++++++++++++++++++++ net-misc/exabgp/files/exabgp.logrotate | 5 ++ net-misc/exabgp/files/exabgp.tmpfiles | 3 ++ 6 files changed, 97 insertions(+), 5 deletions(-) diff --git a/net-misc/exabgp/exabgp-4.2.7.ebuild b/net-misc/exabgp/exabgp-4.2.7-r1.ebuild similarity index 69% rename from net-misc/exabgp/exabgp-4.2.7.ebuild rename to net-misc/exabgp/exabgp-4.2.7-r1.ebuild index a5eec248b4f..8714af508f9 100644 --- a/net-misc/exabgp/exabgp-4.2.7.ebuild +++ b/net-misc/exabgp/exabgp-4.2.7-r1.ebuild @@ -4,7 +4,7 @@ EAPI=7 PYTHON_COMPAT=( python3_{6,7,8} ) DISTUTILS_USE_SETUPTOOLS=rdepend -inherit distutils-r1 +inherit tmpfiles systemd distutils-r1 DESCRIPTION="The BGP swiss army knife of networking" HOMEPAGE="https://github.com/Exa-Networks/exabgp" @@ -35,3 +35,18 @@ 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" ${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 +} diff --git a/net-misc/exabgp/files/exabgp-4.2.7-paths.patch b/net-misc/exabgp/files/exabgp-4.2.7-paths.patch index 57f3a50748d..0744a00d693 100644 --- a/net-misc/exabgp/files/exabgp-4.2.7-paths.patch +++ b/net-misc/exabgp/files/exabgp-4.2.7-paths.patch @@ -3,11 +3,11 @@ index 58d47087..a4266d05 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def filesOf(directory): - - + + data_files = [ - ('etc/exabgp/examples', filesOf('etc/exabgp')), -+ ('/etc/exabgp/examples', filesOf('etc/exabgp')), ++ ('share/exabgp/examples', filesOf('etc/exabgp')), ] - + if platform.system() != 'NetBSD': diff --git a/net-misc/exabgp/files/exabgp.confd b/net-misc/exabgp/files/exabgp.confd new file mode 100644 index 00000000000..2586be12393 --- /dev/null +++ b/net-misc/exabgp/files/exabgp.confd @@ -0,0 +1,10 @@ +# /etc/conf.d/exabgp + +# arguments to pass to exabgp +#EXABGP_ARGS="/etc/exabgp/exabgp.conf" + +# user to run exabgp as +#EXABGP_USER=exabgp + +# group to run exabgp as +#EXABGP_GROUP=exabgp diff --git a/net-misc/exabgp/files/exabgp.initd b/net-misc/exabgp/files/exabgp.initd new file mode 100644 index 00000000000..e220108d826 --- /dev/null +++ b/net-misc/exabgp/files/exabgp.initd @@ -0,0 +1,59 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 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=" + --uid=${EXABGP_USER:-exabgp} + --gid=${EXABGP_GROUP:-exabgp} + --caps='cap_net_admin+epi cap_setuid+ep-i cap_setgid+ep-i' + -- -c \"/usr/bin/exabgp ${EXABGP_ARGS}\"" +command_background="yes" +pidfile="/run/exabgp/${RC_SVCNAME}.pid" +start_stop_daemon_args=" + --stdout /var/log/${RC_SVCNAME}/exabgp.log + --stderr /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,out} || 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" +} diff --git a/net-misc/exabgp/files/exabgp.logrotate b/net-misc/exabgp/files/exabgp.logrotate new file mode 100644 index 00000000000..0616196211a --- /dev/null +++ b/net-misc/exabgp/files/exabgp.logrotate @@ -0,0 +1,5 @@ +/var/log/exabgp/*.log { + missingok + compress + copytruncate +} diff --git a/net-misc/exabgp/files/exabgp.tmpfiles b/net-misc/exabgp/files/exabgp.tmpfiles new file mode 100644 index 00000000000..7415d342e27 --- /dev/null +++ b/net-misc/exabgp/files/exabgp.tmpfiles @@ -0,0 +1,3 @@ +f /run/exabgp 0755 exabgp exabgp - - +p /run/exabgp.in 0600 exabgp exabgp - - +p /run/exabgp.out 0600 exabgp exabgp - -