]>
Commit | Line | Data |
---|---|---|
a0bfcd09 JB |
1 | # TODO: process docs to HTML? |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without doc # Markdown documentation | |
5 | %bcond_without tests # unit tests | |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
8 | ||
9 | Summary: Fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols | |
10 | Summary(pl.UTF-8): Szybkie, proste tworzenie i analiza pakietów z definicjami podstawowych protokołów TCP/IP | |
11 | Name: python-dpkt | |
12 | Version: 1.9.7.2 | |
1f14d3f8 | 13 | Release: 3 |
a0bfcd09 JB |
14 | License: BSD |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/dpkt/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/d/dpkt/dpkt-%{version}.tar.gz | |
18 | # Source0-md5: ac3ace1c5ee12a74f12a863ac9082b59 | |
19 | URL: https://pypi.org/project/dpkt/ | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-pytest | |
25 | BuildRequires: python-pytest-cov | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.5 | |
30 | BuildRequires: python3-setuptools | |
31 | %if %{with tests} | |
32 | BuildRequires: python3-pytest | |
33 | BuildRequires: python3-pytest-cov | |
34 | %endif | |
35 | %endif | |
36 | BuildRequires: rpm-pythonprov | |
37 | BuildRequires: rpmbuild(macros) >= 1.714 | |
38 | Requires: python-modules >= 1:2.7 | |
39 | BuildArch: noarch | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | The dpkt project is a Python module for fast, simple packet parsing, | |
44 | with definitions for the basic TCP/IP protocols. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Projekt dpkt to moduł Pythona do szybkiego, prostego analizowania | |
48 | pakietów, wraz z definicjami podstawowych protokołów TCP/IP. | |
49 | ||
50 | %package -n python3-dpkt | |
51 | Summary: Fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols | |
52 | Summary(pl.UTF-8): Szybkie, proste tworzenie i analiza pakietów z definicjami podstawowych protokołów TCP/IP | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules >= 1:3.5 | |
55 | ||
56 | %description -n python3-dpkt | |
57 | The dpkt project is a Python module for fast, simple packet parsing, | |
58 | with definitions for the basic TCP/IP protocols. | |
59 | ||
60 | %description -n python3-dpkt -l pl.UTF-8 | |
61 | Projekt dpkt to moduł Pythona do szybkiego, prostego analizowania | |
62 | pakietów, wraz z definicjami podstawowych protokołów TCP/IP. | |
63 | ||
64 | %package apidocs | |
65 | Summary: API documentation for Python dpkt module | |
66 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona dpkt | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
70 | API documentation for Python dpkt module. | |
71 | ||
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API modułu Pythona dpkt. | |
74 | ||
75 | %prep | |
76 | %setup -q -n dpkt-%{version} | |
77 | ||
78 | %build | |
79 | %if %{with python2} | |
80 | %py_build | |
81 | ||
82 | %if %{with tests} | |
83 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
84 | PYTEST_PLUGINS="pytest_cov.plugin" \ | |
85 | %{__python} -m pytest dpkt | |
86 | %endif | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %py3_build | |
91 | ||
92 | %if %{with tests} | |
93 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
94 | PYTEST_PLUGINS="pytest_cov.plugin" \ | |
95 | %{__python3} -m pytest dpkt | |
96 | %endif | |
97 | %endif | |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
103 | %py_install | |
104 | ||
105 | %py_postclean | |
106 | %endif | |
107 | ||
108 | %if %{with python3} | |
109 | %py3_install | |
110 | %endif | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %if %{with python2} | |
116 | %files | |
117 | %defattr(644,root,root,755) | |
118 | %doc AUTHORS LICENSE README.md | |
119 | %{py_sitescriptdir}/dpkt | |
120 | %{py_sitescriptdir}/dpkt-%{version}-py*.egg-info | |
121 | %endif | |
122 | ||
123 | %if %{with python3} | |
124 | %files -n python3-dpkt | |
125 | %defattr(644,root,root,755) | |
126 | %doc AUTHORS LICENSE README.md | |
127 | %{py3_sitescriptdir}/dpkt | |
128 | %{py3_sitescriptdir}/dpkt-%{version}-py*.egg-info | |
129 | %endif | |
130 | ||
131 | %if %{with doc} | |
132 | %files apidocs | |
133 | %defattr(644,root,root,755) | |
134 | %doc docs/* | |
135 | %endif |