commit:     10b993103c187687b4552c7bdc5596ed641ba4bc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 20 06:28:32 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 20 10:51:34 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10b99310

net-analyzer/scapy: add 2.6.1

Closes: https://bugs.gentoo.org/892051
Closes: https://bugs.gentoo.org/910000
Closes: https://bugs.gentoo.org/915645
Closes: https://bugs.gentoo.org/923088
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-analyzer/scapy/Manifest                        |  1 +
 .../scapy-2.6.1-missing-autorun-test-marker.patch  | 10 +++++
 .../scapy/files/scapy-2.6.1-skip-test.patch        | 20 +++++++++
 net-analyzer/scapy/scapy-2.5.0.ebuild              |  6 ++-
 .../{scapy-2.5.0.ebuild => scapy-2.6.1.ebuild}     | 47 ++++++++++++----------
 5 files changed, 60 insertions(+), 24 deletions(-)

diff --git a/net-analyzer/scapy/Manifest b/net-analyzer/scapy/Manifest
index db24ef0d9d37..1571662b2675 100644
--- a/net-analyzer/scapy/Manifest
+++ b/net-analyzer/scapy/Manifest
@@ -1 +1,2 @@
 DIST scapy-2.5.0.tar.gz 6082895 BLAKE2B 
2673de913d46532760dce93914916b909a4706d846e1e699c16f35b738cac8a073e23b194f9ed4647ade41170a04849ebd33ab3d0ba5b7f09fea8fa527e14c5d
 SHA512 
4e5cacff0bbf6fd991ea24f4680049d042082fae4b349c8082078e6f01b38c09bb5c8276bfba15d4a88a1eb5af92c505848ec98556b10eecbd803f134a5b244a
+DIST scapy-2.6.1.tar.gz 7048560 BLAKE2B 
5c930c3aa2d0a4d545cf64f10abd3aa962755e3fb712ea1613c4f49b159202a55e5ffadc527d429118958bad6e93f9626084d3ee974caaa6cb1733f05080d3f2
 SHA512 
4ab02f5b9dfcf329ee4f4837655066227b1e162e695d6cbe84ada4e2ff44589462a9843b0f16699ec974dcf6e0a81af3c5b088ceac48a679e9591f4cec0eedc8

diff --git 
a/net-analyzer/scapy/files/scapy-2.6.1-missing-autorun-test-marker.patch 
b/net-analyzer/scapy/files/scapy-2.6.1-missing-autorun-test-marker.patch
new file mode 100644
index 000000000000..76108598d758
--- /dev/null
+++ b/net-analyzer/scapy/files/scapy-2.6.1-missing-autorun-test-marker.patch
@@ -0,0 +1,10 @@
+--- a/test/regression.uts
++++ b/test/regression.uts
+@@ -1139,6 +1139,7 @@ ret = 
autorun_get_text_interactive_session("scapy_undefined")
+ assert "NameError" in ret[0]
+ 
+ = Test autorun with logging
++~ autorun
+ 
+ cmds = """log_runtime.info(hex_bytes("446166742050756e6b"))\n"""
+ ret = autorun_get_text_interactive_session(cmds)

diff --git a/net-analyzer/scapy/files/scapy-2.6.1-skip-test.patch 
b/net-analyzer/scapy/files/scapy-2.6.1-skip-test.patch
new file mode 100644
index 000000000000..bf71e22cdde9
--- /dev/null
+++ b/net-analyzer/scapy/files/scapy-2.6.1-skip-test.patch
@@ -0,0 +1,20 @@
+Fails in network-sandbox (probably because of the namespace + fake interface
+Portage makes).
+--- a/test/regression.uts
++++ b/test/regression.uts
+@@ -470,6 +470,7 @@ conf.ifaces.providers = _bkp_providers
+ conf.ifaces.reload()
+ 
+ = Test read_routes6() - default output
++~ netaccess
+ 
+ routes6 = read_routes6()
+ if WINDOWS:
+@@ -519,6 +520,7 @@ pkt.build()
+ 
+ 
+ = Test read_routes6() - check mandatory routes
++~ netaccess
+ 
+ import re
+ ll_route = re.compile(r"fe80:\d{0,2}:")

diff --git a/net-analyzer/scapy/scapy-2.5.0.ebuild 
b/net-analyzer/scapy/scapy-2.5.0.ebuild
index 34e252955a74..03b6dd459ae8 100644
--- a/net-analyzer/scapy/scapy-2.5.0.ebuild
+++ b/net-analyzer/scapy/scapy-2.5.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -65,7 +65,9 @@ src_prepare() {
        # Needs ipython
        rm test/scapy/layers/dhcp.uts || die
        # Import failure?
-       rm test/contrib/isotp_native_socket.uts test/contrib/isotpscan.uts || 
die
+       rm test/contrib/isotp_native_socket.uts \
+               test/contrib/isotpscan.uts \
+               test/contrib/isotp_soft_socket.uts || die
 
        distutils-r1_src_prepare
 }

diff --git a/net-analyzer/scapy/scapy-2.5.0.ebuild 
b/net-analyzer/scapy/scapy-2.6.1.ebuild
similarity index 61%
copy from net-analyzer/scapy/scapy-2.5.0.ebuild
copy to net-analyzer/scapy/scapy-2.6.1.ebuild
index 34e252955a74..687ae2c8f8c6 100644
--- a/net-analyzer/scapy/scapy-2.5.0.ebuild
+++ b/net-analyzer/scapy/scapy-2.6.1.ebuild
@@ -1,12 +1,10 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-# See https://github.com/secdev/scapy/pull/3958#discussion_r1161302244 on next
-# bump (>2.5.0)!
-
-PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
 inherit distutils-r1 readme.gentoo-r1
 
 DESCRIPTION="A Python interactive packet manipulation program for mastering 
the network"
@@ -15,7 +13,7 @@ 
SRC_URI="https://github.com/secdev/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 x86"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
 IUSE="test"
 RESTRICT="!test? ( test )"
 
@@ -43,36 +41,41 @@ Scapy has optional support for the following packages:
 "
 
 PATCHES=(
-       "${FILESDIR}"/${PN}-2.5.0-no-install-tests.patch
+       "${FILESDIR}"/${PN}-2.6.1-skip-test.patch
+       "${FILESDIR}"/${PN}-2.6.1-missing-autorun-test-marker.patch
 )
 
 src_prepare() {
-       if ! [[ -f ${PN}/VERSION ]]; then
-               echo ${PV} > ${PN}/VERSION || die
-       else
-               die
-       fi
+       export SCAPY_VERSION=${PV}
 
-       # Drop tests which need network
-       rm \
-               test/nmap.uts \
-               test/p0f.uts \
-               test/p0fv2.uts \
-               test/regression.uts \
-               test/scapy/layers/inet6.uts || die
        # Timed out
        rm test/tftp.uts || die
        # Needs ipython
        rm test/scapy/layers/dhcp.uts || die
-       # Import failure?
-       rm test/contrib/isotp_native_socket.uts test/contrib/isotpscan.uts || 
die
+       # Import failures
+       rm test/contrib/isotp_native_socket.uts \
+               test/contrib/isotpscan.uts \
+               test/contrib/isotp_soft_socket.uts || die
 
        distutils-r1_src_prepare
 }
 
 python_test() {
+       # 
https://scapy.readthedocs.io/en/latest/development.html#testing-with-utscapy
        # https://github.com/secdev/scapy/blob/master/tox.ini
-       "${EPYTHON}" -m scapy.tools.UTscapy -c ./test/configs/linux.utsc -N || 
die
+       #
+       # netaccess: network access, obviously
+       # tshark, tcpdump: hangs
+       # samba: needs rpcdump (and too heavy of a test dep)
+       # interact, autorun: tests fail
+       "${EPYTHON}" -m scapy.tools.UTscapy -c ./test/configs/linux.utsc -N \
+               -K netaccess \
+               -K tshark \
+               -K tcpdump \
+               -K samba \
+               -K interact \
+               -K autorun \
+               -K ci_only || die "Tests failed with ${EPYTHON}"
 }
 
 src_install() {

Reply via email to