]> git.pld-linux.org Git - packages/python-zope.testrunner.git/blob - python-zope.testrunner.spec
5154f208f32cf83b7f2ca6e6a42d8c3cd9dbb93b
[packages/python-zope.testrunner.git] / python-zope.testrunner.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_with     tests   # unit tests (running fails?)
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 Summary:        Flexible test runner with layer support
9 Summary(pl.UTF-8):      Elastyczne uruchamianie testów z obsługą warstw
10 Name:           python-zope.testrunner
11 Version:        5.1
12 Release:        1
13 License:        ZPL v2.1
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/zope.testrunner/
16 Source0:        https://files.pythonhosted.org/packages/source/z/zope.testrunner/zope.testrunner-%{version}.tar.gz
17 # Source0-md5:  5c10b7bda7803c34140a657715049fc9
18 URL:            https://www.zope.org/
19 %if %{with python2}
20 BuildRequires:  python >= 1:2.7
21 BuildRequires:  python-devel >= 1:2.7
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-six
25 BuildRequires:  python-zope.exceptions
26 BuildRequires:  python-zope.interface
27 BuildRequires:  python-zope.testing
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3 >= 1:3.5
32 BuildRequires:  python3-devel >= 1:3.5
33 BuildRequires:  python3-setuptools
34 %if %{with tests}
35 BuildRequires:  python3-six
36 BuildRequires:  python3-zope.exceptions
37 BuildRequires:  python3-zope.interface
38 BuildRequires:  python3-zope.testing
39 %endif
40 %endif
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.714
43 %if %{with doc}
44 BuildRequires:  python3-sphinxcontrib-programoutput
45 BuildRequires:  sphinx-pdg-3
46 %endif
47 Requires:       python-modules >= 1:2.7
48 Requires:       python-zope-base
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 This package provides a flexible test runner with layer support.
53
54 %description -l pl.UTF-8
55 Ten pakiet zapewnia elastyczne uruchamianie testów z obsługą warstw.
56
57 %package -n python3-zope.testrunner
58 Summary:        Flexible test runner with layer support
59 Summary(pl.UTF-8):      Elastyczne uruchamianie testów z obsługą warstw
60 Group:          Libraries/Python
61 Requires:       python3-modules >= 1:3.5
62 Requires:       python3-zope-base
63
64 %description -n python3-zope.testrunner
65 This package provides a flexible test runner with layer support.
66
67 %description -n python3-zope.testrunner -l pl.UTF-8
68 Ten pakiet zapewnia elastyczne uruchamianie testów z obsługą warstw.
69
70 %package -n python3-zope.testrunner-examples
71 Summary:        Example tests for zope.testrunner
72 Summary(pl.UTF-8):      Przykładowe testy dla szkieletu zope.testrunner
73 Group:          Development/Tools
74 Requires:       python3-zope.testruner = %{version}-%{release}
75
76 %description -n python3-zope.testrunner-examples
77 Example tests for zope.testrunner.
78
79 %description -n python3-zope.testrunner-examples -l pl.UTF-8
80 Przykładowe testy dla szkieletu zope.testrunner.
81
82 %package apidocs
83 Summary:        API documentation for Python zope.testrunner module
84 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona zope.testrunner
85 Group:          Documentation
86
87 %description apidocs
88 API documentation for Python zope.testrunner module.
89
90 %description apidocs -l pl.UTF-8
91 Dokumentacja API modułu Pythona zope.testrunner.
92
93 %prep
94 %setup -q -n zope.testrunner-%{version}
95
96 %build
97 %if %{with python2}
98 %py_build %{?with_tests:test}
99 %endif
100
101 %if %{with python3}
102 %py3_build %{?with_tests:test}
103 %endif
104
105 %if %{with doc}
106 PYTHONPATH=$(pwd)/src \
107 sphinx-build-3 -b html docs docs/_build/html
108 %endif
109
110 %install
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %py_install \
115         --install-purelib=%{py_sitedir}
116
117 %py_postclean
118 # python2 test examples are useless because of postclean
119 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/zope/testrunner/tests
120
121 %{__mv} $RPM_BUILD_ROOT%{_bindir}/zope-testrunner{,-2}
122 %endif
123
124 %if %{with python3}
125 %py3_install \
126         --install-purelib=%{py3_sitedir}
127
128 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/testrunner/tests/*.{py,rst}
129 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/zope/testrunner/tests/__pycache__
130 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/zope/testrunner/tests/testrunner-ex*/__pycache__
131 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/zope/testrunner/tests/testrunner-ex*/*/__pycache__
132 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/zope/testrunner/tests/testrunner-ex*/*/*/__pycache__
133
134 %{__mv} $RPM_BUILD_ROOT%{_bindir}/zope-testrunner{,-3}
135 %endif
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %if %{with python2}
141 %files
142 %defattr(644,root,root,755)
143 %doc CHANGES.rst COPYRIGHT.rst LICENSE.md README.rst
144 %attr(755,root,root) %{_bindir}/zope-testrunner-2
145 %{py_sitedir}/zope/testrunner
146 %{py_sitedir}/zope.testrunner-%{version}-py*.egg-info
147 %{py_sitedir}/zope.testrunner-%{version}-py*-nspkg.pth
148 %endif
149
150 %if %{with python3}
151 %files -n python3-zope.testrunner
152 %defattr(644,root,root,755)
153 %doc CHANGES.rst COPYRIGHT.rst LICENSE.md README.rst
154 %attr(755,root,root) %{_bindir}/zope-testrunner-3
155 %dir %{py3_sitedir}/zope/testrunner
156 %{py3_sitedir}/zope/testrunner/*.py
157 %{py3_sitedir}/zope/testrunner/__pycache__
158 %{py3_sitedir}/zope.testrunner-%{version}-py*.egg-info
159 %{py3_sitedir}/zope.testrunner-%{version}-py*-nspkg.pth
160
161 %files -n python3-zope.testrunner-examples
162 %defattr(644,root,root,755)
163 %dir %{py3_sitedir}/zope/testrunner/tests
164 %{py3_sitedir}/zope/testrunner/tests/testrunner-ex*
165 %endif
166
167 %if %{with doc}
168 %files apidocs
169 %defattr(644,root,root,755)
170 %doc docs/_build/html/{_modules,_static,*.html,*.js}
171 %endif
This page took 0.085507 seconds and 2 git commands to generate.