]> git.pld-linux.org Git - packages/python-subunit.git/blob - python-subunit.spec
8ae50d987d357291807c766ad81ce133a27fe2d1
[packages/python-subunit.git] / python-subunit.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module and tools
4 %bcond_without  python3 # CPython 3.x module and tools
5 %bcond_without  tests   # unit tests
6
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
10 Version:        1.4.0
11 Release:        1
12 License:        Apache v2.0 or BSD
13 Group:          Libraries/Python
14 #Source0Download: https://pypi.org/simple/python-subunit/
15 Source0:        https://files.pythonhosted.org/packages/source/p/python-subunit/%{name}-%{version}.tar.gz
16 # Source0-md5:  30f1ab20651d94442dd9a7f8c9e8d633
17 Patch0:         %{name}-tests.patch
18 URL:            https://pypi.org/project/python-subunit/
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-extras
23 BuildRequires:  python-modules >= 1:2.7
24 BuildRequires:  python-testtools >= 0.9.34
25 %if %{with tests}
26 BuildRequires:  python-fixtures
27 BuildRequires:  python-hypothesis
28 BuildRequires:  python-testscenarios
29 BuildRequires:  python-unittest2
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-extras
34 BuildRequires:  python3-modules >= 1:3.5
35 BuildRequires:  python3-testtools >= 0.9.34
36 %if %{with tests}
37 BuildRequires:  python3-fixtures
38 BuildRequires:  python3-hypothesis
39 BuildRequires:  python3-testscenarios
40 %endif
41 %endif
42 Requires:       python-modules >= 1:2.7
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
49 This package contains Python 2.x modules.
50
51 %description -l pl.UTF-8
52 Subunit to protokół strumieniowy przeznaczony do wyników testów.
53
54 Ten pakiet zawiera moduły Pythona 2.x.
55
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
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
73 Requires:       python3-modules >= 1:3.2
74
75 %description -n python3-subunit
76 Subunit is a streaming protocol for test results.
77
78 This package contains Python 2.x modules.
79
80 %description -n python3-subunit -l pl.UTF-8
81 Subunit to protokół strumieniowy przeznaczony do wyników testów.
82
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
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
115 %prep
116 %setup -q
117 %patch0 -p1
118
119 %build
120 %if %{with python2}
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
127 %endif
128
129 %if %{with python3}
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
136 %endif
137
138 %install
139 rm -rf $RPM_BUILD_ROOT
140
141 %if %{with python2}
142 %py_install
143
144 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/subunit/tests
145 %py_postclean
146
147 for f in $RPM_BUILD_ROOT%{_bindir}/* ; do
148         %{__mv} "$f" "${f}-2"
149 %if %{without python3}
150         ln -sf $(basename $f)-2 "$f"
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
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
175 %{py_sitescriptdir}/subunit
176 %{py_sitescriptdir}/python_subunit-%{version}-py*.egg-info
177
178 %files -n subunit-python2
179 %defattr(644,root,root,755)
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
189 %attr(755,root,root) %{_bindir}/subunit2disk-2
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
194 %endif
195
196 %if %{with python3}
197 %files -n python3-subunit
198 %defattr(644,root,root,755)
199 %doc NEWS README.rst
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)
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
214 %attr(755,root,root) %{_bindir}/subunit2disk-3
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
219 %endif
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
This page took 0.05636 seconds and 2 git commands to generate.