3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module persistent
9 Summary: Automatic persistence for Python objects
10 Summary(pl.UTF-8): Automatyczne trwałe obiekty w Pythonie
11 Name: python-%{module}
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/persistent/
17 Source0: https://files.pythonhosted.org/packages/source/p/persistent/%{module}-%{version}.tar.gz
18 # Source0-md5: dedb296b74082edf246fe48333065f46
19 Patch0: missing-header.patch
20 URL: https://www.zope.dev/
22 BuildRequires: python-cffi
23 BuildRequires: python-devel >= 1:2.7
24 BuildRequires: python-setuptools
26 BuildRequires: python-manuel
27 BuildRequires: python-zope.interface
28 BuildRequires: python-zope.testrunner
32 BuildRequires: python3-cffi
33 BuildRequires: python3-devel >= 1:3.5
34 BuildRequires: python3-setuptools
36 BuildRequires: python3-manuel
37 BuildRequires: python3-zope.interface
38 BuildRequires: python3-zope.testrunner
41 BuildRequires: rpm-pythonprov
42 BuildRequires: rpmbuild(macros) >= 1.714
44 BuildRequires: python3-repoze.sphinx.autointerface
45 BuildRequires: sphinx-pdg-3
47 Requires: python-modules >= 1:2.7
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 This package contains a generic persistence implementation for Python.
52 It forms the core protocol for making objects interact "transparently"
53 with a database such as the ZODB.
55 %description -l pl.UTF-8
56 Ten pakiet zawiera ogólną implementację trwałych danych dla Pythona.
57 Tworzy główny protokół, pozwalający obiektom w sposób przezroczysty
58 współpracować z bazą danych taką jak ZODB.
60 %package -n python3-%{module}
61 Summary: Automatic persistence for Python objects
62 Summary(pl.UTF-8): Automatyczne trwałe obiekty w Pythonie
63 Group: Libraries/Python
64 Requires: python3-modules >= 1:3.5
66 %description -n python3-%{module}
67 This package contains a generic persistence implementation for Python.
68 It forms the core protocol for making objects interact "transparently"
69 with a database such as the ZODB.
71 %description -n python3-%{module} -l pl.UTF-8
72 Ten pakiet zawiera ogólną implementację trwałych danych dla Pythona.
73 Tworzy główny protokół, pozwalający obiektom w sposób przezroczysty
74 współpracować z bazą danych taką jak ZODB.
77 Summary: API documentation for Python persistent module
78 Summary(pl.UTF-8): Dokumentacja API modułu Pythona persistent
82 API documentation for Python persistent module.
84 %description apidocs -l pl.UTF-8
85 Dokumentacja API modułu Pythona persistent.
88 %setup -q -n %{module}-%{version}
93 %py_build %{?with_tests:test}
97 %py3_build %{?with_tests:test}
102 %{__make} -C docs html \
103 SPHINXBUILD=sphinx-build-3
107 rm -rf $RPM_BUILD_ROOT
113 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/persistent/*.[ch]
114 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/persistent/tests
120 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/persistent/*.[ch]
121 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/persistent/tests
125 rm -rf $RPM_BUILD_ROOT
129 %defattr(644,root,root,755)
130 %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst
131 %dir %{py_sitedir}/persistent
132 %{py_sitedir}/persistent/*.py[co]
133 %attr(755,root,root) %{py_sitedir}/persistent/*.so
134 %{py_sitedir}/persistent-%{version}-py*.egg-info
135 %{py_incdir}/persistent
139 %files -n python3-%{module}
140 %defattr(644,root,root,755)
141 %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst
142 %dir %{py3_sitedir}/persistent
143 %{py3_sitedir}/persistent/*.py
144 %attr(755,root,root) %{py3_sitedir}/persistent/*.so
145 %{py3_sitedir}/persistent/__pycache__
146 %{py3_sitedir}/persistent-%{version}-py*.egg-info
147 %{py3_incdir}/persistent
152 %defattr(644,root,root,755)
153 %doc docs/_build/html/{_static,api,*.html,*.js}