summaryrefslogtreecommitdiff
path: root/python3-scapy.spec
blob: 9ea700f60a4a0dc3d2c8b2455dc79a9e191d24fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# 构建系统:setuptools.build_meta + setup.py(pyproject.toml 存在但 build-backend=setuptools.build_meta)
# topdir: python-scapy-2.7.0(由 --transform 重命名,与 %%autosetup -n %%{name}-%%{version} 对齐)
%global pypi_name scapy

Name:           python-%{pypi_name}
Version:        2.7.0
Release:        1%{?dist}
Summary:        Interactive packet manipulation tool
License:        GPL-2.0-only
URL:            https://github.com/secdev/scapy
Source0:        https://github.com/secdev/scapy/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools >= 62.0.0

%description
Scapy is a powerful Python-based interactive packet manipulation program and
library. It is able to forge or decode packets of a wide number of protocols,
send them on the wire, capture them, store or read them using pcap files,
match requests and replies, and much more. It is designed to allow fast packet
prototyping by using default values that work.

%package -n python3-%{pypi_name}
Summary:        Interactive packet manipulation tool
Provides:       python-%{pypi_name}
Provides:       python3dist(%{pypi_name}) = %{version}

%description -n python3-%{pypi_name}
Scapy is a powerful Python-based interactive packet manipulation program and
library. It is able to forge or decode packets of a wide number of protocols,
send them on the wire, capture them, store or read them using pcap files,
match requests and replies, and much more. It is designed to allow fast packet
prototyping by using default values that work.

%package help
Summary:        Development documents and examples for %{pypi_name}
Requires:       python3-%{pypi_name}
Provides:       python3-%{pypi_name}-doc

%description help
Scapy is a powerful Python-based interactive packet manipulation program and
library. This package contains development documents and examples for Scapy.

%prep
%autosetup -n %{name}-%{version} -p1

%build
# scapy 版本通过 _version() 动态检测(SCAPY_VERSION 环境变量 > VERSION 文件 > git archive > git describe > 文件修改日期)。
# tarball 无 .git 元数据也无 VERSION 文件,须通过 SCAPY_VERSION 环境变量强制指定版本,否则回退到文件修改日期导致版本号错误。
export SCAPY_VERSION=%{version}
%py3_build

%install
export SCAPY_VERSION=%{version}
%py3_install

%files -n python3-%{pypi_name}
%license LICENSE
%{python3_sitelib}/scapy/
%{python3_sitelib}/scapy-%{version}*.egg-info/
%{_bindir}/scapy
%{_mandir}/man1/scapy.1*

%files help
%license LICENSE
%doc README.md

%changelog
* Tue Sep 29 2026 Python_Bot <Python_Bot@openeuler.org> - 2.7.0-1
- Initial package