commit:     d720e4f889f86cc6d6344d72f934f10d5f1c1180
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 23 23:14:06 2024 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Apr 23 23:14:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d720e4f8

net-misc/exabgp: Revbump, fix bugs #929723, #923160, #910006

Closes: https://bugs.gentoo.org/929723
Closes: https://bugs.gentoo.org/923160
Closes: https://bugs.gentoo.org/910006
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 ...xabgp-4.2.21.ebuild => exabgp-4.2.21-r1.ebuild} | 10 +++--
 ...p.service-to-fix-socket-creation-on-start.patch | 38 ++++++++++++++++
 ...xabgp-4.2.21-patch-embedded-six-for-py312.patch | 52 ++++++++++++++++++++++
 3 files changed, 96 insertions(+), 4 deletions(-)

diff --git a/net-misc/exabgp/exabgp-4.2.21.ebuild 
b/net-misc/exabgp/exabgp-4.2.21-r1.ebuild
similarity index 80%
rename from net-misc/exabgp/exabgp-4.2.21.ebuild
rename to net-misc/exabgp/exabgp-4.2.21-r1.ebuild
index 23eb5f34e950..40fa0522f040 100644
--- a/net-misc/exabgp/exabgp-4.2.21.ebuild
+++ b/net-misc/exabgp/exabgp-4.2.21-r1.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{9..11} )
-DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
 inherit tmpfiles systemd distutils-r1
 
 DESCRIPTION="The BGP swiss army knife of networking"
@@ -34,12 +34,14 @@ PATCHES=(
        "${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"
+       
"${FILESDIR}/exabgp-4.2.21-exabgp.service-to-fix-socket-creation-on-start.patch"
+       "${FILESDIR}/exabgp-4.2.21-patch-embedded-six-for-py312.patch"
 )
 
 distutils_enable_tests pytest
 
 python_test() {
-       ./qa/bin/parsing || die "tests fail with ${EPYTHON}"
+       ./qa/bin/parsing || die "parsing tests fail with ${EPYTHON}"
        epytest
 }
 

diff --git 
a/net-misc/exabgp/files/exabgp-4.2.21-exabgp.service-to-fix-socket-creation-on-start.patch
 
b/net-misc/exabgp/files/exabgp-4.2.21-exabgp.service-to-fix-socket-creation-on-start.patch
new file mode 100644
index 000000000000..78d26f73f093
--- /dev/null
+++ 
b/net-misc/exabgp/files/exabgp-4.2.21-exabgp.service-to-fix-socket-creation-on-start.patch
@@ -0,0 +1,38 @@
+From: Vincent Bernat <[email protected]>
+Date: Sun, 2 May 2021 17:47:10 +0200
+Subject: Patch exabgp.service to fix socket creation on start
+
+Patch from Marco d'Itri.
+
+Closes: #886568.
+---
+ etc/systemd/exabgp.service | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/etc/systemd/exabgp.service b/etc/systemd/exabgp.service
+index 17ce886..b2da5ba 100644
+--- a/etc/systemd/exabgp.service
++++ b/etc/systemd/exabgp.service
+@@ -7,16 +7,13 @@ After=network.target
+ ConditionPathExists=/etc/exabgp/exabgp.conf
+ 
+ [Service]
+-#User=exabgp
+-#Group=exabgp
+ Environment=exabgp_daemon_daemonize=false
+-PermissionsStartOnly=true
+-ExecStartPre=-mkfifo /run/exabgp.in
+-ExecStartPre=-mkfifo /run/exabgp.out
+-ExecStartPre=chmod 600 /run/exabgp.in
+-ExecStartPre=chmod 600 /run/exabgp.out
+-ExecStartPre=chown exabgp.exabgp /run/exabgp.in
+-ExecStartPre=chown exabgp.exabgp /run/exabgp.out
++User=exabgp
++Group=exabgp
++RuntimeDirectory=exabgp
++RuntimeDirectoryMode=0750
++ExecStartPre=-/usr/bin/mkfifo /run/exabgp/exabgp.in
++ExecStartPre=-/usr/bin/mkfifo /run/exabgp/exabgp.out
+ ExecStart=/usr/sbin/exabgp /etc/exabgp/exabgp.conf
+ ExecReload=/bin/kill -USR1 $MAINPID
+ Restart=always

diff --git 
a/net-misc/exabgp/files/exabgp-4.2.21-patch-embedded-six-for-py312.patch 
b/net-misc/exabgp/files/exabgp-4.2.21-patch-embedded-six-for-py312.patch
new file mode 100644
index 000000000000..ccbf33021d87
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp-4.2.21-patch-embedded-six-for-py312.patch
@@ -0,0 +1,52 @@
+From: Vincent Bernat <[email protected]>
+Date: Mon, 1 Jan 2024 09:15:39 +0100
+Subject: Patch embedded six for Python 3.12
+
+Closes: #1058181
+---
+ lib/exabgp/vendoring/six.py | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/lib/exabgp/vendoring/six.py b/lib/exabgp/vendoring/six.py
+index 20e866a..5f8f3b0 100644
+--- a/lib/exabgp/vendoring/six.py
++++ b/lib/exabgp/vendoring/six.py
+@@ -71,6 +71,11 @@ def __len__(self):
+             MAXSIZE = int((1 << 63) - 1)
+         del X
+ 
++if PY34:
++    from importlib.util import spec_from_loader
++else:
++    spec_from_loader = None
++
+ 
+ def _add_doc(func, doc):
+     """Add documentation to a function."""
+@@ -182,6 +187,11 @@ def find_module(self, fullname, path=None):
+             return self
+         return None
+ 
++    def find_spec(self, fullname, path, target=None):
++        if fullname in self.known_modules:
++            return spec_from_loader(fullname, self)
++        return None
++
+     def __get_module(self, fullname):
+         try:
+             return self.known_modules[fullname]
+@@ -217,9 +227,13 @@ def get_code(self, fullname):
+         Required, if is_package is implemented"""
+         self.__get_module(fullname)  # eventually raises ImportError
+         return None
+-
+     get_source = get_code  # same as get_code
+ 
++    def create_module(self, spec):
++        return self.load_module(spec.name)
++
++    def exec_module(self, module):
++        pass
+ 
+ _importer = _SixMetaPathImporter(__name__)
+ 

Reply via email to