commit:     74c773ea1fb402863d6a8b5060987837d0da0b8a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 11 08:29:35 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 11 08:31:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74c773ea

net-analyzer/scapy: add 2.5.0

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-analyzer/scapy/Manifest                        |  1 +
 .../scapy/files/scapy-2.5.0-no-install-tests.patch | 11 +++
 net-analyzer/scapy/scapy-2.5.0.ebuild              | 79 ++++++++++++++++++++++
 3 files changed, 91 insertions(+)

diff --git a/net-analyzer/scapy/Manifest b/net-analyzer/scapy/Manifest
index 0eaf45391ac4..c28b42baf09f 100644
--- a/net-analyzer/scapy/Manifest
+++ b/net-analyzer/scapy/Manifest
@@ -1 +1,2 @@
 DIST scapy-2.4.5.tar.gz 3323309 BLAKE2B 
af94b3ec6324c4544aca25f63bcca8aa60a3b1cbbf132d3ed07b5bc73b95e4298bf250e65157bdb7851226fd0ac039367892a9a14d844e5815832ad4ab556819
 SHA512 
b5ccd689f7bd4fbbb86921a35360b94ec7a738b494f16e4764828689835296016bc476825add798406e4d32761d8df90b41ce7e38049afdabf98397b1bf5982a
+DIST scapy-2.5.0.tar.gz 6082895 BLAKE2B 
2673de913d46532760dce93914916b909a4706d846e1e699c16f35b738cac8a073e23b194f9ed4647ade41170a04849ebd33ab3d0ba5b7f09fea8fa527e14c5d
 SHA512 
4e5cacff0bbf6fd991ea24f4680049d042082fae4b349c8082078e6f01b38c09bb5c8276bfba15d4a88a1eb5af92c505848ec98556b10eecbd803f134a5b244a

diff --git a/net-analyzer/scapy/files/scapy-2.5.0-no-install-tests.patch 
b/net-analyzer/scapy/files/scapy-2.5.0-no-install-tests.patch
new file mode 100644
index 000000000000..be6d8fbd638a
--- /dev/null
+++ b/net-analyzer/scapy/files/scapy-2.5.0-no-install-tests.patch
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -33,7 +33,7 @@ def get_long_description():
+ setup(
+     name='scapy',
+     version=__import__('scapy').VERSION,
+-    packages=find_packages(),
++    packages=find_packages(exclude=["test", "test.*"]),
+     data_files=[('share/man/man1', ["doc/scapy.1"])],
+     package_data={
+         'scapy': ['VERSION'],

diff --git a/net-analyzer/scapy/scapy-2.5.0.ebuild 
b/net-analyzer/scapy/scapy-2.5.0.ebuild
new file mode 100644
index 000000000000..f1784cc3ed4b
--- /dev/null
+++ b/net-analyzer/scapy/scapy-2.5.0.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+inherit distutils-r1 readme.gentoo-r1
+
+DESCRIPTION="A Python interactive packet manipulation program for mastering 
the network"
+HOMEPAGE="https://scapy.net/ https://github.com/secdev/scapy";
+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"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       test? (
+               dev-python/python-zstandard[${PYTHON_USEDEP}]
+       )
+"
+
+DOC_CONTENTS="
+Scapy has optional support for the following packages:
+
+       dev-python/cryptography
+       dev-python/ipython
+       dev-python/matplotlib
+       dev-python/pyx
+       media-gfx/graphviz
+       net-analyzer/tcpdump
+       net-analyzer/tcpreplay
+       net-libs/libpcap
+       virtual/imagemagick-tools
+
+       See also ""${EPREFIX}/usr/share/doc/${PF}/installation.rst""
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.5.0-no-install-tests.patch
+)
+
+src_prepare() {
+       if ! [[ -f ${PN}/VERSION ]]; then
+               echo ${PV} > ${PN}/VERSION || die
+       else
+               die
+       fi
+
+       # 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
+
+       distutils-r1_src_prepare
+}
+
+python_test() {
+       # https://github.com/secdev/scapy/blob/master/tox.ini
+       "${EPYTHON}" -m scapy.tools.UTscapy -c ./test/configs/linux.utsc -N || 
die
+}
+
+src_install() {
+       distutils-r1_src_install
+
+       dodoc -r doc/${PN}/*
+       DISABLE_AUTOFORMATTING=1 readme.gentoo_create_doc
+}

Reply via email to