2 # - fix tests: ... skipped 'ZODB not available' , ZODB though depends on BTrees
6 %bcond_with doc # don't build doc
7 %bcond_without tests # do not perform "make test"
8 %bcond_without python2 # CPython 2.x module
9 %bcond_without python3 # CPython 3.x module
12 %define pypi_name %{module}
14 Summary: Scalable persistent object containers
15 Summary(pl.UTF-8): Skalowalne trwałe kontenery dla obiektów
16 Name: python-%{module}
20 Group: Libraries/Python
21 #Source0: https://files.pythonhosted.org/packages/source/B/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
22 #Source0: https://pypi.python.org/packages/source/B/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
23 Source0: https://pypi.python.org/packages/6a/e2/d8c2a5b4cbc493b1ccb440d61bf0f62b8a0cb1c7b5aa403d5e18847545b3/BTrees-%{version}.tar.gz
24 # Source0-md5: 6a0178e30b94cf0cc44ae62e93187ecc
25 URL: http://packages.python.org/BTrees
26 BuildRequires: rpm-pythonprov
27 # for the py_build, py_install macros
28 BuildRequires: rpmbuild(macros) >= 1.714
30 BuildRequires: python-devel
31 BuildRequires: python-persistent >= 4.0.4
32 #BuildRequires: python-setuptools
33 BuildRequires: python-transaction
36 BuildRequires: python3-devel
37 BuildRequires: python3-persistent >= 4.0.4
38 #BuildRequires: python3-setuptools
39 BuildRequires: python3-transaction
42 # when using /usr/bin/env or other in-place substitutions
43 #BuildRequires: sed >= 4.0
44 # replace with other requires if defined in setup.py
45 Requires: python-modules
46 %requires_eq python-persistent
47 Requires: python-transaction
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 %description -l pl.UTF-8
54 %package -n python3-%{module}
57 Group: Libraries/Python
58 Requires: python3-modules
59 %requires_eq python3-persistent
60 Requires: python3-transaction
62 %description -n python3-%{module}
64 %description -n python3-%{module} -l pl.UTF-8
67 Summary: %{module} API documentation
68 Summary(pl.UTF-8): Dokumentacja API %{module}
72 API documentation for %{module}.
74 %description apidocs -l pl.UTF-8
75 Dokumentacja API %{module}.
78 %setup -q -n %{module}-%{version}
82 %py_build %{?with_tests:test}
86 %py3_build %{?with_tests:test}
92 rm -rf _build/html/_sources
96 rm -rf $RPM_BUILD_ROOT
107 rm -rf $RPM_BUILD_ROOT
111 %defattr(644,root,root,755)
112 %doc CHANGES.rst README.rst
113 %dir %{py_sitedir}/%{module}
114 %{py_sitedir}/%{module}/*.py[co]
115 %{py_sitedir}/%{module}/*.[ch]
116 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
117 %{py_sitedir}/%{module}-%{version}-py*.egg-info
121 %files -n python3-%{module}
122 %defattr(644,root,root,755)
123 %doc CHANGES.rst README.rst
124 %dir %{py3_sitedir}/%{module}
125 %{py3_sitedir}/%{module}/*.py
126 %{py3_sitedir}/%{module}/*.[ch]
127 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
128 %{py3_sitedir}/%{module}/__pycache__
129 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
134 %defattr(644,root,root,755)
135 %doc docs/_build/html/*