2 # - fix tests - zope.testing upgrade needed ?
4 %bcond_with doc # don't build doc
5 %bcond_with tests # do not perform "make test"
6 %bcond_without python2 # CPython 2.x module
7 %bcond_without python3 # CPython 3.x module
9 %define module zc.lockfile
10 %define egg_name zc.lockfile
11 %define pypi_name zc.lockfile
12 Summary: Basic inter-process locks
13 Summary(pl.UTF-8): Podstawowe blokady pomiędzy procesami
14 Name: python-%{pypi_name}
18 Group: Libraries/Python
19 Source0: https://files.pythonhosted.org/packages/source/z/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
20 # Source0-md5: 163f0293d53a84f608f9008d9c0afc60
21 URL: https://pypi.python.org/pypi/%{pypi_name}
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.714
25 BuildRequires: python-modules
26 BuildRequires: python-setuptools
27 BuildRequires: python-zope.exceptions
28 BuildRequires: python-zope.testing
31 BuildRequires: python3-modules
32 BuildRequires: python3-setuptools
33 BuildRequires: python3-zope.exceptions
34 BuildRequires: python3-zope.testing
37 # when using /usr/bin/env or other in-place substitutions
38 #BuildRequires: sed >= 4.0
39 # replace with other requires if defined in setup.py
40 Requires: python-modules
41 Requires: python-zope.exceptions
42 Requires: python-zope.testing
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 %description -l pl.UTF-8
50 %package -n python3-%{pypi_name}
53 Group: Libraries/Python
54 Requires: python3-modules
55 Requires: python3-zope.exceptions
56 Requires: python3-zope.testing
58 %description -n python3-%{pypi_name}
60 %description -n python3-%{pypi_name} -l pl.UTF-8
63 Summary: API documentation for Python %{module} module
64 Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
68 API documentation for Pythona %{module} module.
70 %description apidocs -l pl.UTF-8
71 Dokumentacja API modułu Pythona %{module}.
74 %setup -q -n %{pypi_name}-%{version}
78 %py_build %{?with_tests:test}
82 %py3_build %{?with_tests:test}
88 rm -rf _build/html/_sources
92 rm -rf $RPM_BUILD_ROOT
97 # when files are installed in other way that standard 'setup.py
98 # they need to be (re-)compiled
99 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
100 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
101 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
111 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
116 %doc CHANGES.txt doc.txt README.txt
117 %dir %{py_sitescriptdir}/zc
118 %{py_sitescriptdir}/zc/lockfile
119 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
120 %{py_sitescriptdir}/*.pth
124 %files -n python3-%{pypi_name}
125 %defattr(644,root,root,755)
126 %doc CHANGES.txt doc.txt README.txt
127 %dir %{py3_sitescriptdir}/zc
128 %{py3_sitescriptdir}/zc/lockfile
129 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
130 %{py3_sitescriptdir}/*.pth
135 %defattr(644,root,root,755)
136 %doc docs/_build/html/*