2 # - fix tests, needs: manuel and zope.testrunner
5 %bcond_with doc # don't build doc
6 %bcond_with tests # do not perform "make test"
7 %bcond_without python2 # CPython 2.x module
8 %bcond_without python3 # CPython 3.x module
11 # - 'module' should match the Python import path (first component?)
12 # - 'egg_name' should equal to Python egg name
13 # - 'pypi_name' must match the Python Package Index name
14 %define module ZConfig
15 %define egg_name %{module}
16 %define pypi_name %{module}
17 Summary: Structured Configuration Library
18 Summary(pl.UTF-8): Biblioteka ustrukturyzowanych plików konfiguracyjnych
19 Name: python-%{pypi_name}
23 Group: Libraries/Python
24 Source0: https://files.pythonhosted.org/packages/source/Z/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
25 # Source0-md5: 1f7206c3efaaed21e492153156107e89
26 URL: https://github.com/zopefoundation/ZConfig/
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.714
30 BuildRequires: python-modules
31 BuildRequires: python-setuptools
34 BuildRequires: python3-modules
35 BuildRequires: python3-setuptools
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
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %description -l pl.UTF-8
48 %package -n python3-%{pypi_name}
51 Group: Libraries/Python
52 Requires: python3-modules
54 %description -n python3-%{pypi_name}
56 %description -n python3-%{pypi_name} -l pl.UTF-8
59 Summary: API documentation for Python %{module} module
60 Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
64 API documentation for Pythona %{module} module.
66 %description apidocs -l pl.UTF-8
67 Dokumentacja API modułu Pythona %{module}.
70 %setup -q -n %{pypi_name}-%{version}
74 %py_build %{?with_tests:test}
78 %py3_build %{?with_tests:test}
84 rm -rf _build/html/_sources
88 rm -rf $RPM_BUILD_ROOT
93 # when files are installed in other way that standard 'setup.py
94 # they need to be (re-)compiled
95 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
96 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
97 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
107 rm -rf $RPM_BUILD_ROOT
111 %defattr(644,root,root,755)
112 %doc CHANGES.rst README.rst
113 %{py_sitescriptdir}/%{module}
114 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
118 %files -n python3-%{pypi_name}
119 %defattr(644,root,root,755)
120 %doc CHANGES.rst README.rst
121 %{py3_sitescriptdir}/%{module}
122 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
123 %attr(755,root,root) %{_bindir}/zconfig
124 %attr(755,root,root) %{_bindir}/zconfig_schema2html
129 %defattr(644,root,root,755)
130 %doc docs/_build/html/*