]>
Commit | Line | Data |
---|---|---|
fd3c6536 | 1 | # |
fd3c6536 | 2 | # Conditional build: |
69bf9949 JB |
3 | %bcond_without python2 # CPython 2.x module and tools |
4 | %bcond_without python3 # CPython 3.x module and tools | |
cb33cc38 | 5 | %bcond_without tests # unit tests |
fd3c6536 | 6 | |
fd3c6536 JB |
7 | Summary: subunit - streaming protocol for test results |
8 | Summary(pl.UTF-8): subunit - protokół strumieniowy do wyników testów | |
9 | Name: python-subunit | |
44e9de92 | 10 | Version: 1.4.0 |
53ab5070 | 11 | Release: 4 |
fd3c6536 JB |
12 | License: Apache v2.0 or BSD |
13 | Group: Libraries/Python | |
cb33cc38 JB |
14 | #Source0Download: https://pypi.org/simple/python-subunit/ |
15 | Source0: https://files.pythonhosted.org/packages/source/p/python-subunit/%{name}-%{version}.tar.gz | |
44e9de92 | 16 | # Source0-md5: 30f1ab20651d94442dd9a7f8c9e8d633 |
cb33cc38 JB |
17 | Patch0: %{name}-tests.patch |
18 | URL: https://pypi.org/project/python-subunit/ | |
fd3c6536 JB |
19 | BuildRequires: rpm-pythonprov |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-extras | |
44e9de92 | 23 | BuildRequires: python-modules >= 1:2.7 |
fd3c6536 JB |
24 | BuildRequires: python-testtools >= 0.9.34 |
25 | %if %{with tests} | |
26 | BuildRequires: python-fixtures | |
27 | BuildRequires: python-hypothesis | |
28 | BuildRequires: python-testscenarios | |
cb33cc38 | 29 | BuildRequires: python-unittest2 |
fd3c6536 JB |
30 | %endif |
31 | %endif | |
32 | %if %{with python3} | |
33 | BuildRequires: python3-extras | |
44e9de92 | 34 | BuildRequires: python3-modules >= 1:3.5 |
fd3c6536 JB |
35 | BuildRequires: python3-testtools >= 0.9.34 |
36 | %if %{with tests} | |
37 | BuildRequires: python3-fixtures | |
38 | BuildRequires: python3-hypothesis | |
39 | BuildRequires: python3-testscenarios | |
cb33cc38 | 40 | %endif |
fd3c6536 | 41 | %endif |
44e9de92 | 42 | Requires: python-modules >= 1:2.7 |
fd3c6536 JB |
43 | BuildArch: noarch |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | Subunit is a streaming protocol for test results. | |
48 | ||
69bf9949 JB |
49 | This package contains Python 2.x modules. |
50 | ||
fd3c6536 JB |
51 | %description -l pl.UTF-8 |
52 | Subunit to protokół strumieniowy przeznaczony do wyników testów. | |
53 | ||
69bf9949 JB |
54 | Ten pakiet zawiera moduły Pythona 2.x. |
55 | ||
69bf9949 JB |
56 | %package -n subunit-python2 |
57 | Summary: Python 2 tools for subunit streaming protocol for test results | |
58 | Summary(pl.UTF-8): Narzędzia Pythona 2 dla protokołu strumieniowego do wyników testów subunit | |
59 | Group: Development/Tools | |
60 | Requires: python-subunit = %{version}-%{release} | |
61 | ||
62 | %description -n subunit-python2 | |
63 | Python 2 tools for subunit streaming protocol for test results. | |
64 | ||
65 | %description -n subunit-python2 -l pl.UTF-8 | |
66 | Narzędzia Pythona 2 dla protokołu strumieniowego do wyników testów | |
67 | subunit. | |
68 | ||
fd3c6536 JB |
69 | %package -n python3-subunit |
70 | Summary: subunit - streaming protocol for test results | |
71 | Summary(pl.UTF-8): subunit - protokół strumieniowy do wyników testów | |
72 | Group: Libraries/Python | |
fd3c6536 | 73 | Requires: python3-modules >= 1:3.2 |
fd3c6536 JB |
74 | |
75 | %description -n python3-subunit | |
76 | Subunit is a streaming protocol for test results. | |
77 | ||
69bf9949 JB |
78 | This package contains Python 2.x modules. |
79 | ||
fd3c6536 JB |
80 | %description -n python3-subunit -l pl.UTF-8 |
81 | Subunit to protokół strumieniowy przeznaczony do wyników testów. | |
82 | ||
69bf9949 JB |
83 | Ten pakiet zawiera moduły Pythona 2.x. |
84 | ||
85 | %package -n subunit-python3 | |
86 | Summary: Python 3 tools for subunit streaming protocol for test results | |
87 | Summary(pl.UTF-8): Narzędzia Pythona 3 dla protokołu strumieniowego do wyników testów subunit | |
88 | Group: Development/Tools | |
89 | Requires: python3-subunit = %{version}-%{release} | |
90 | ||
91 | %description -n subunit-python3 | |
92 | Python 3 tools for subunit streaming protocol for test results. | |
93 | ||
94 | %description -n subunit-python3 -l pl.UTF-8 | |
95 | Narzędzia Pythona 3 dla protokołu strumieniowego do wyników testów | |
96 | subunit. | |
97 | ||
7faa05ec JB |
98 | %package -n subunit-python |
99 | Summary: Python tools for subunit streaming protocol for test results | |
100 | Summary(pl.UTF-8): Pythonowe narzędzia dla protokołu strumieniowego do wyników testów subunit | |
101 | Group: Development/Tools | |
102 | %if %{with python3} | |
103 | Requires: subunit-python3 = %{version}-%{release} | |
104 | %else | |
105 | Requires: subunit-python2 = %{version}-%{release} | |
106 | %endif | |
107 | ||
108 | %description -n subunit-python | |
109 | Python tools for subunit streaming protocol for test results. | |
110 | ||
111 | %description -n subunit-python -l pl.UTF-8 | |
112 | Pythonowe narzędzia dla protokołu strumieniowego do wyników testów | |
113 | subunit. | |
114 | ||
fd3c6536 JB |
115 | %prep |
116 | %setup -q | |
cb33cc38 | 117 | %patch0 -p1 |
fd3c6536 JB |
118 | |
119 | %build | |
120 | %if %{with python2} | |
cb33cc38 JB |
121 | %py_build |
122 | ||
123 | %if %{with tests} | |
124 | PYTHONPATH=$(pwd)/python \ | |
125 | %{__python} -m subunit.run subunit.tests.test_suite | PYTHONPATH=$(pwd)/python %{__python} filters/subunit2pyunit | |
126 | %endif | |
fd3c6536 JB |
127 | %endif |
128 | ||
129 | %if %{with python3} | |
cb33cc38 JB |
130 | %py3_build |
131 | ||
132 | %if %{with tests} | |
133 | PYTHONPATH=$(pwd)/python \ | |
134 | %{__python3} -m subunit.run subunit.tests.test_suite | PYTHONPATH=$(pwd)/python %{__python3} filters/subunit2pyunit | |
135 | %endif | |
fd3c6536 JB |
136 | %endif |
137 | ||
138 | %install | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
fd3c6536 JB |
141 | %if %{with python2} |
142 | %py_install | |
143 | ||
144 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/subunit/tests | |
145 | %py_postclean | |
146 | ||
7faa05ec | 147 | for f in $RPM_BUILD_ROOT%{_bindir}/* ; do |
fd3c6536 | 148 | %{__mv} "$f" "${f}-2" |
7faa05ec | 149 | %if %{without python3} |
fd3c6536 | 150 | ln -sf $(basename $f)-2 "$f" |
7faa05ec JB |
151 | %endif |
152 | done | |
153 | %endif | |
154 | ||
155 | %if %{with python3} | |
156 | %py3_install | |
157 | ||
158 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/subunit/tests | |
159 | ||
160 | for f in $RPM_BUILD_ROOT%{_bindir}/* ; do | |
161 | if [ "${f%%-2}" = "$f" ]; then | |
162 | %{__mv} "$f" "${f}-3" | |
163 | ln -sf $(basename $f)-3 "$f" | |
164 | fi | |
fd3c6536 JB |
165 | done |
166 | %endif | |
167 | ||
168 | %clean | |
169 | rm -rf $RPM_BUILD_ROOT | |
170 | ||
171 | %if %{with python2} | |
172 | %files | |
173 | %defattr(644,root,root,755) | |
174 | %doc NEWS README.rst | |
69bf9949 JB |
175 | %{py_sitescriptdir}/subunit |
176 | %{py_sitescriptdir}/python_subunit-%{version}-py*.egg-info | |
177 | ||
69bf9949 JB |
178 | %files -n subunit-python2 |
179 | %defattr(644,root,root,755) | |
fd3c6536 JB |
180 | %attr(755,root,root) %{_bindir}/subunit-1to2-2 |
181 | %attr(755,root,root) %{_bindir}/subunit-2to1-2 | |
182 | %attr(755,root,root) %{_bindir}/subunit-filter-2 | |
183 | %attr(755,root,root) %{_bindir}/subunit-ls-2 | |
184 | %attr(755,root,root) %{_bindir}/subunit-notify-2 | |
185 | %attr(755,root,root) %{_bindir}/subunit-output-2 | |
186 | %attr(755,root,root) %{_bindir}/subunit-stats-2 | |
187 | %attr(755,root,root) %{_bindir}/subunit-tags-2 | |
188 | %attr(755,root,root) %{_bindir}/subunit2csv-2 | |
cb33cc38 | 189 | %attr(755,root,root) %{_bindir}/subunit2disk-2 |
fd3c6536 JB |
190 | %attr(755,root,root) %{_bindir}/subunit2gtk-2 |
191 | %attr(755,root,root) %{_bindir}/subunit2junitxml-2 | |
192 | %attr(755,root,root) %{_bindir}/subunit2pyunit-2 | |
193 | %attr(755,root,root) %{_bindir}/tap2subunit-2 | |
fd3c6536 JB |
194 | %endif |
195 | ||
196 | %if %{with python3} | |
197 | %files -n python3-subunit | |
198 | %defattr(644,root,root,755) | |
199 | %doc NEWS README.rst | |
69bf9949 JB |
200 | %{py3_sitescriptdir}/subunit |
201 | %{py3_sitescriptdir}/python_subunit-%{version}-py*.egg-info | |
202 | ||
203 | %files -n subunit-python3 | |
204 | %defattr(644,root,root,755) | |
fd3c6536 JB |
205 | %attr(755,root,root) %{_bindir}/subunit-1to2-3 |
206 | %attr(755,root,root) %{_bindir}/subunit-2to1-3 | |
207 | %attr(755,root,root) %{_bindir}/subunit-filter-3 | |
208 | %attr(755,root,root) %{_bindir}/subunit-ls-3 | |
209 | %attr(755,root,root) %{_bindir}/subunit-notify-3 | |
210 | %attr(755,root,root) %{_bindir}/subunit-output-3 | |
211 | %attr(755,root,root) %{_bindir}/subunit-stats-3 | |
212 | %attr(755,root,root) %{_bindir}/subunit-tags-3 | |
213 | %attr(755,root,root) %{_bindir}/subunit2csv-3 | |
cb33cc38 | 214 | %attr(755,root,root) %{_bindir}/subunit2disk-3 |
fd3c6536 JB |
215 | %attr(755,root,root) %{_bindir}/subunit2gtk-3 |
216 | %attr(755,root,root) %{_bindir}/subunit2junitxml-3 | |
217 | %attr(755,root,root) %{_bindir}/subunit2pyunit-3 | |
218 | %attr(755,root,root) %{_bindir}/tap2subunit-3 | |
fd3c6536 | 219 | %endif |
7faa05ec JB |
220 | |
221 | %files -n subunit-python | |
222 | %defattr(644,root,root,755) | |
223 | %attr(755,root,root) %{_bindir}/subunit-1to2 | |
224 | %attr(755,root,root) %{_bindir}/subunit-2to1 | |
225 | %attr(755,root,root) %{_bindir}/subunit-filter | |
226 | %attr(755,root,root) %{_bindir}/subunit-ls | |
227 | %attr(755,root,root) %{_bindir}/subunit-notify | |
228 | %attr(755,root,root) %{_bindir}/subunit-output | |
229 | %attr(755,root,root) %{_bindir}/subunit-stats | |
230 | %attr(755,root,root) %{_bindir}/subunit-tags | |
231 | %attr(755,root,root) %{_bindir}/subunit2csv | |
232 | %attr(755,root,root) %{_bindir}/subunit2disk | |
233 | %attr(755,root,root) %{_bindir}/subunit2gtk | |
234 | %attr(755,root,root) %{_bindir}/subunit2junitxml | |
235 | %attr(755,root,root) %{_bindir}/subunit2pyunit | |
236 | %attr(755,root,root) %{_bindir}/tap2subunit |