3 %bcond_without doc # Sphinx documentation
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
6 %bcond_without tests # unit tests
8 %define module zope.interface
9 Summary: Python 'interface' concept implementation
10 Summary(pl.UTF-8): Implementacja interfejsów dla języka Python
11 Name: python-%{module}
12 # keep 5.x here for python2 support
16 Group: Libraries/Python
17 #Source0Download: https://pypi.org/simple/zope.interface/
18 Source0: https://files.pythonhosted.org/packages/source/z/zope.interface/zope.interface-%{version}.tar.gz
19 # Source0-md5: 5a383d71156ce6f89f59a86d957a8d65
20 URL: https://zopeinterface.readthedocs.io/
22 BuildRequires: python >= 1:2.7
23 BuildRequires: python-devel >= 1:2.7
24 BuildRequires: python-setuptools
26 BuildRequires: python-coverage >= 5.0.3
27 BuildRequires: python-zope.event
28 BuildRequires: python-zope.testing
32 BuildRequires: python3 >= 1:3.5
33 BuildRequires: python3-devel >= 1:3.5
34 BuildRequires: python3-setuptools
36 BuildRequires: python3-coverage >= 5.0.3
37 BuildRequires: python3-zope.event
38 BuildRequires: python3-zope.testing
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 Requires: python-zope-base
49 Provides: ZopeInterface
50 Provides: Zope-Interface
51 Obsoletes: ZopeInterface < 3.4.0
52 Obsoletes: Zope-Interface < 4.1
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Python 'interface' concept implementation.
58 %description -l pl.UTF-8
59 Implementacja interfejsów (abstrakcyjnych reprezentacji klas) dla
62 %package -n python3-%{module}
63 Summary: Python 'interface' concept implementation
64 Summary(pl.UTF-8): Implementacja interfejsów dla języka Python
65 Group: Libraries/Python
66 Requires: python3-modules >= 1:3.5
67 Requires: python3-zope-base
69 %description -n python3-%{module}
70 Python 'interface' concept implementation.
72 %description -n python3-%{module} -l pl.UTF-8
73 Implementacja interfejsów (abstrakcyjnych reprezentacji klas) dla
77 Summary: API documentation for Python zope.interface module
78 Summary(pl.UTF-8): Dokumentacja API modułu Pythona zope.interface
83 API documentation for Python zope.interface module.
85 %description apidocs -l pl.UTF-8
86 Dokumentacja API modułu Pythona zope.interface.
89 %setup -q -n %{module}-%{version}
93 %py_build %{?with_tests:test}
97 %py3_build %{?with_tests:test}
101 PYTHONPATH=$(pwd)/src \
102 %{__make} -C docs html \
103 SPHINXBUILD=sphinx-build-3
107 rm -rf $RPM_BUILD_ROOT
111 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/zope/interface/*.c
119 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/interface/*.c
123 rm -rf $RPM_BUILD_ROOT
127 %defattr(644,root,root,755)
128 %doc CHANGES.rst COPYRIGHT.txt README.rst
129 %dir %{py_sitedir}/zope/interface
130 %{py_sitedir}/zope/interface/*.py[co]
131 %attr(755,root,root) %{py_sitedir}/zope/interface/_zope_interface_coptimizations.so
132 %{py_sitedir}/zope/interface/common
133 %{py_sitedir}/zope/interface/tests
134 %{py_sitedir}/zope.interface-%{version}-py*.egg-info
135 %{py_sitedir}/zope.interface-%{version}-py*-nspkg.pth
139 %files -n python3-%{module}
140 %defattr(644,root,root,755)
141 %doc CHANGES.rst COPYRIGHT.txt README.rst
142 %dir %{py3_sitedir}/zope/interface
143 %{py3_sitedir}/zope/interface/*.py
144 %{py3_sitedir}/zope/interface/__pycache__
145 %attr(755,root,root) %{py3_sitedir}/zope/interface/_zope_interface_coptimizations*.so
146 %{py3_sitedir}/zope/interface/common
147 %{py3_sitedir}/zope/interface/tests
148 %{py3_sitedir}/zope.interface-%{version}-py*.egg-info
149 %{py3_sitedir}/zope.interface-%{version}-py*-nspkg.pth
154 %defattr(644,root,root,755)
155 %doc docs/_build/html/{_modules,_static,api,*.html,*.js}