]>
Commit | Line | Data |
---|---|---|
fd3c6536 | 1 | # |
fd3c6536 JB |
2 | # Conditional build: |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_with tests # test target | |
6 | ||
7 | %define module template | |
8 | Summary: subunit - streaming protocol for test results | |
9 | Summary(pl.UTF-8): subunit - protokół strumieniowy do wyników testów | |
10 | Name: python-subunit | |
11 | Version: 1.2.0 | |
12 | Release: 1 | |
13 | License: Apache v2.0 or BSD | |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.python.org/simple/python-subunit/ | |
16 | Source0: https://pypi.python.org/packages/source/p/python-subunit/%{name}-%{version}.tar.gz | |
17 | # Source0-md5: 3305455dfe22e2b8666531909c026a2f | |
18 | URL: https://pypi.python.org/pypi/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.6 | |
24 | BuildRequires: python-testtools >= 0.9.34 | |
25 | %if %{with tests} | |
26 | BuildRequires: python-fixtures | |
27 | BuildRequires: python-hypothesis | |
28 | BuildRequires: python-testscenarios | |
29 | %endif | |
30 | %endif | |
31 | %if %{with python3} | |
32 | BuildRequires: python3-extras | |
33 | BuildRequires: python3-modules >= 1:3.2 | |
34 | BuildRequires: python3-testtools >= 0.9.34 | |
35 | %if %{with tests} | |
36 | BuildRequires: python3-fixtures | |
37 | BuildRequires: python3-hypothesis | |
38 | BuildRequires: python3-testscenarios | |
39 | %endif | |
40 | %endif | |
41 | Requires: python-extras | |
42 | Requires: python-modules >= 1:2.6 | |
43 | Requires: python-testtools >= 0.9.34 | |
44 | BuildArch: noarch | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | Subunit is a streaming protocol for test results. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | Subunit to protokół strumieniowy przeznaczony do wyników testów. | |
52 | ||
53 | %package -n python3-subunit | |
54 | Summary: subunit - streaming protocol for test results | |
55 | Summary(pl.UTF-8): subunit - protokół strumieniowy do wyników testów | |
56 | Group: Libraries/Python | |
57 | Requires: python3-extras | |
58 | Requires: python3-modules >= 1:3.2 | |
59 | Requires: python3-testtools >= 0.9.34 | |
60 | ||
61 | %description -n python3-subunit | |
62 | Subunit is a streaming protocol for test results. | |
63 | ||
64 | %description -n python3-subunit -l pl.UTF-8 | |
65 | Subunit to protokół strumieniowy przeznaczony do wyników testów. | |
66 | ||
67 | %prep | |
68 | %setup -q | |
69 | ||
70 | %build | |
71 | %if %{with python2} | |
72 | %py_build %{?with_tests:test} | |
73 | %endif | |
74 | ||
75 | %if %{with python3} | |
76 | %py3_build %{?with_tests:test} | |
77 | %endif | |
78 | ||
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %if %{with python3} | |
83 | %py3_install | |
84 | ||
85 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/subunit/tests | |
86 | ||
87 | for f in $RPM_BUILD_ROOT%{_bindir}/* ; do | |
88 | %{__mv} "$f" "${f}-3" | |
89 | done | |
90 | %endif | |
91 | ||
92 | %if %{with python2} | |
93 | %py_install | |
94 | ||
95 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/subunit/tests | |
96 | %py_postclean | |
97 | ||
c2540c56 | 98 | for f in $RPM_BUILD_ROOT%{_bindir}/*[!3]; do |
fd3c6536 JB |
99 | %{__mv} "$f" "${f}-2" |
100 | ln -sf $(basename $f)-2 "$f" | |
101 | done | |
102 | %endif | |
103 | ||
104 | %clean | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %files | |
109 | %defattr(644,root,root,755) | |
110 | %doc NEWS README.rst | |
111 | %attr(755,root,root) %{_bindir}/subunit-1to2 | |
112 | %attr(755,root,root) %{_bindir}/subunit-2to1 | |
113 | %attr(755,root,root) %{_bindir}/subunit-filter | |
114 | %attr(755,root,root) %{_bindir}/subunit-ls | |
115 | %attr(755,root,root) %{_bindir}/subunit-notify | |
116 | %attr(755,root,root) %{_bindir}/subunit-output | |
117 | %attr(755,root,root) %{_bindir}/subunit-stats | |
118 | %attr(755,root,root) %{_bindir}/subunit-tags | |
119 | %attr(755,root,root) %{_bindir}/subunit2csv | |
120 | %attr(755,root,root) %{_bindir}/subunit2gtk | |
121 | %attr(755,root,root) %{_bindir}/subunit2junitxml | |
122 | %attr(755,root,root) %{_bindir}/subunit2pyunit | |
123 | %attr(755,root,root) %{_bindir}/tap2subunit | |
124 | %attr(755,root,root) %{_bindir}/subunit-1to2-2 | |
125 | %attr(755,root,root) %{_bindir}/subunit-2to1-2 | |
126 | %attr(755,root,root) %{_bindir}/subunit-filter-2 | |
127 | %attr(755,root,root) %{_bindir}/subunit-ls-2 | |
128 | %attr(755,root,root) %{_bindir}/subunit-notify-2 | |
129 | %attr(755,root,root) %{_bindir}/subunit-output-2 | |
130 | %attr(755,root,root) %{_bindir}/subunit-stats-2 | |
131 | %attr(755,root,root) %{_bindir}/subunit-tags-2 | |
132 | %attr(755,root,root) %{_bindir}/subunit2csv-2 | |
133 | %attr(755,root,root) %{_bindir}/subunit2gtk-2 | |
134 | %attr(755,root,root) %{_bindir}/subunit2junitxml-2 | |
135 | %attr(755,root,root) %{_bindir}/subunit2pyunit-2 | |
136 | %attr(755,root,root) %{_bindir}/tap2subunit-2 | |
137 | %{py_sitescriptdir}/subunit | |
138 | %{py_sitescriptdir}/python_subunit-%{version}-py*.egg-info | |
139 | %endif | |
140 | ||
141 | %if %{with python3} | |
142 | %files -n python3-subunit | |
143 | %defattr(644,root,root,755) | |
144 | %doc NEWS README.rst | |
145 | %attr(755,root,root) %{_bindir}/subunit-1to2-3 | |
146 | %attr(755,root,root) %{_bindir}/subunit-2to1-3 | |
147 | %attr(755,root,root) %{_bindir}/subunit-filter-3 | |
148 | %attr(755,root,root) %{_bindir}/subunit-ls-3 | |
149 | %attr(755,root,root) %{_bindir}/subunit-notify-3 | |
150 | %attr(755,root,root) %{_bindir}/subunit-output-3 | |
151 | %attr(755,root,root) %{_bindir}/subunit-stats-3 | |
152 | %attr(755,root,root) %{_bindir}/subunit-tags-3 | |
153 | %attr(755,root,root) %{_bindir}/subunit2csv-3 | |
154 | %attr(755,root,root) %{_bindir}/subunit2gtk-3 | |
155 | %attr(755,root,root) %{_bindir}/subunit2junitxml-3 | |
156 | %attr(755,root,root) %{_bindir}/subunit2pyunit-3 | |
157 | %attr(755,root,root) %{_bindir}/tap2subunit-3 | |
158 | %{py3_sitescriptdir}/subunit | |
159 | %{py3_sitescriptdir}/python_subunit-%{version}-py*.egg-info | |
160 | %endif |