mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
net-misc/exabgp: add 5.0.8
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
DIST exabgp-4.2.23.tar.gz 2935267 BLAKE2B 85b861e5ee318ecd6533386f8a298fdeabec161db9cba17f48957d1379ba0b30c3d9ea6c136e400c0ddf62595f7275d885d019bd6690fc7c58b65a112e6ce9e9 SHA512 03968997958dd1241c616b675bbea1e65d2660658205cf51f2bff6198c497a1379c949a61f9b93de4b91af2c0045eed54a94aa243fbca89c6d908bcb5811dc20
|
||||
DIST exabgp-4.2.25.tar.gz 2881687 BLAKE2B 15addb7761a25ebbb090299925c249c30d0ffbbdb6a9b4ea4fb04f2aa3253dcf36abc705b23b83fc46e0dffe3a6c899f789968e145e3abf2bdce02746c911d06 SHA512 24211bbde4657edf17d36d0109353b37db641e5412f51c360e337651e0a210082329451fdeed3952f824751229ccdec6fe86da99e575686ee484147a2bdf42aa
|
||||
DIST exabgp-5.0.8.tar.gz 3402753 BLAKE2B e8bd4144b62fc8000086207c9e59952ad973795077519fe20a5fce717e0d5597e595c350cf9024b09d45f10cee417f09bb3fb08d2a474cc2db4f03f9aee43423 SHA512 eeb7266509abec9ad365702036b4f5d9940f3e0bc192cc35b1a5daf4fe5fe176235cd910820f5b710c8c4b680ab422e9b2ce88ce19c2611732e12855ee678ffc
|
||||
|
||||
74
net-misc/exabgp/exabgp-5.0.8.ebuild
Normal file
74
net-misc/exabgp/exabgp-5.0.8.ebuild
Normal file
@@ -0,0 +1,74 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{{11..14},{13..14}t} )
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
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/pytest-asyncio[${PYTHON_USEDEP}]
|
||||
dev-python/hypothesis[${PYTHON_USEDEP}]
|
||||
dev-python/pytest-timeout[${PYTHON_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/exabgp-5.0.8-paths.patch"
|
||||
"${FILESDIR}/exabgp-5.0.8-ip-path.patch"
|
||||
"${FILESDIR}/exabgp-5.0.8-healthcheck-allow-disable-metric.patch"
|
||||
"${FILESDIR}/exabgp-5.0.8-less-verbose-logging.patch"
|
||||
)
|
||||
|
||||
EPYTEST_PLUGINS=(
|
||||
hypothesis
|
||||
pytest-asyncio
|
||||
pytest-timeout
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_prepare_all() {
|
||||
# remove performance tests
|
||||
rm -rf tests/performance || die
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
diff --git a/src/exabgp/application/healthcheck.py b/src/exabgp/application/healthcheck.py
|
||||
index 7a3a4d416..b14266688 100644
|
||||
--- a/src/exabgp/application/healthcheck.py
|
||||
+++ b/src/exabgp/application/healthcheck.py
|
||||
@@ -112,6 +112,7 @@ def setargs(parser):
|
||||
g.add_argument('--label', default=None, help='use the provided label to match setup ip addresses')
|
||||
g.add_argument('--label-exact-match', default=False, action='store_true', help='use the provided label to exactly match setup ip addresses, not a prefix match')
|
||||
g.add_argument('--start-ip', metavar='N', type=int, default=0, help='index of the first IP in the list of IP addresses')
|
||||
+ g.add_argument('--no-metric', type="store_true", default=False, help="don't send metrics when updating announcements")
|
||||
g.add_argument('--up-metric', metavar='M', type=int, default=100, help='first IP get the metric M when the service is up')
|
||||
g.add_argument('--down-metric', metavar='M', type=int, default=1000, help='first IP get the metric M when the service is down')
|
||||
g.add_argument('--disabled-metric', metavar='M', type=int, default=500, help='first IP get the metric M when the service is disabled')
|
||||
@@ -438,7 +439,8 @@ def loop(options):
|
||||
announce = f'route {ip} next-hop {options.next_hop or "self"}'
|
||||
|
||||
if action == 'announce':
|
||||
- announce = f'{announce} med {metric}'
|
||||
+ if not options.no_metric:
|
||||
+ announce = f'{announce} med {metric}'
|
||||
if options.local_preference >= 0:
|
||||
announce = f'{announce} local-preference {options.local_preference}'
|
||||
if options.community or options.disabled_community:
|
||||
13
net-misc/exabgp/files/exabgp-5.0.8-ip-path.patch
Normal file
13
net-misc/exabgp/files/exabgp-5.0.8-ip-path.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/exabgp/application/healthcheck.py b/src/exabgp/application/healthcheck.py
|
||||
index 66e5a252f..7a3a4d416 100644
|
||||
--- a/src/exabgp/application/healthcheck.py
|
||||
+++ b/src/exabgp/application/healthcheck.py
|
||||
@@ -231,7 +231,7 @@ def system_ips(ip_ifnames, label, label_only, label_exact_match):
|
||||
labelre = re.compile(r'.*\s+(?:' + '|'.join(ifnames) + r'):(?P<label>[^\\\s]+).*')
|
||||
for ifname in ifnames:
|
||||
cmd = subprocess.Popen(
|
||||
- f'/sbin/ip -o address show dev {ifname}'.split(), shell=False, stdout=subprocess.PIPE
|
||||
+ f'ip -o address show dev {ifname}'.split(), shell=False, stdout=subprocess.PIPE
|
||||
)
|
||||
output += [line for line in cmd.stdout]
|
||||
else:
|
||||
@@ -0,0 +1,33 @@
|
||||
diff --git a/src/exabgp/application/healthcheck.py b/src/exabgp/application/healthcheck.py
|
||||
index b14266688..61adc5beb 100644
|
||||
--- a/src/exabgp/application/healthcheck.py
|
||||
+++ b/src/exabgp/application/healthcheck.py
|
||||
@@ -204,6 +204,15 @@ def setup_logging(debug, silent, name, syslog_facility, syslog):
|
||||
enable_syslog = syslog and not debug
|
||||
# To syslog
|
||||
if enable_syslog:
|
||||
+ if isinstance(syslog_facility, int) or syslog_facility.isdigit():
|
||||
+ for log_facility, value in sorted(logging.handlers.SysLogHandler.facility_names.items(), key=lambda x: x[1]):
|
||||
+ if value >= int(syslog_facility):
|
||||
+ facility = log_facility
|
||||
+ break
|
||||
+ elif hasattr(logging.handlers.SysLogHandler, "LOG_{0}".format(syslog_facility.upper())):
|
||||
+ facility = getattr(logging.handlers.SysLogHandler, "LOG_{0}".format(syslog_facility.upper()))
|
||||
+ else:
|
||||
+ facility = logging.handlers.SysLogHandler.LOG_DAEMON
|
||||
facility = getattr(logging.handlers.SysLogHandler, f'LOG_{syslog_facility.upper()}')
|
||||
sh = logging.handlers.SysLogHandler(address=str(syslog_address()), facility=facility)
|
||||
if name:
|
||||
diff --git a/src/exabgp/reactor/api/command/announce.py b/src/exabgp/reactor/api/command/announce.py
|
||||
index 3f18a155f..c5e4942ab 100644
|
||||
--- a/src/exabgp/reactor/api/command/announce.py
|
||||
+++ b/src/exabgp/reactor/api/command/announce.py
|
||||
@@ -55,7 +55,7 @@ def announce_route(self, reactor, service, line, use_json):
|
||||
change.nlri.action = Action.ANNOUNCE
|
||||
reactor.configuration.inject_change(peers, change)
|
||||
peer_list = ', '.join(peers) if peers else 'all peers'
|
||||
- self.log_message(f'route added to {peer_list} : {change.extensive()}')
|
||||
+ self.log_message(f'route added to {peer_list} : {change.extensive()}', level=logging.WARNING)
|
||||
yield False
|
||||
|
||||
reactor.processes.answer_done(service)
|
||||
15
net-misc/exabgp/files/exabgp-5.0.8-paths.patch
Normal file
15
net-misc/exabgp/files/exabgp-5.0.8-paths.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 0e8708905..8f45402cd 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -32,8 +32,8 @@ def filesOf(directory):
|
||||
|
||||
|
||||
data_files = [
|
||||
- ('etc/exabgp/examples', filesOf('etc/exabgp')),
|
||||
- ('etc/exabgp/examples/run', filesOf('etc/exabgp/run')),
|
||||
+ ('share/exabgp/examples', filesOf('etc/exabgp')),
|
||||
+ ('share/exabgp/examples/run', filesOf('etc/exabgp/run')),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user