]>
Commit | Line | Data |
---|---|---|
1bc0acd1 JK |
1 | # |
2 | # Conditional build: | |
2cf0ce46 | 3 | %bcond_without doc # Sphinx documentation |
1bc0acd1 JK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
5f7f3c21 | 6 | %bcond_without tests # unit tests |
1bc0acd1 | 7 | |
38545464 | 8 | %define module zope.interface |
1bc0acd1 JK |
9 | Summary: Python 'interface' concept implementation |
10 | Summary(pl.UTF-8): Implementacja interfejsów dla języka Python | |
11 | Name: python-%{module} | |
ac89e5f1 JB |
12 | # keep 5.x here for python2 support |
13 | Version: 5.5.2 | |
14 | Release: 1 | |
2cf0ce46 | 15 | License: ZPL v2.1 |
1bc0acd1 | 16 | Group: Libraries/Python |
5f7f3c21 | 17 | #Source0Download: https://pypi.org/simple/zope.interface/ |
9a4b2682 | 18 | Source0: https://files.pythonhosted.org/packages/source/z/zope.interface/zope.interface-%{version}.tar.gz |
ac89e5f1 | 19 | # Source0-md5: 5a383d71156ce6f89f59a86d957a8d65 |
2cf0ce46 | 20 | URL: https://zopeinterface.readthedocs.io/ |
1bc0acd1 | 21 | %if %{with python2} |
5f7f3c21 JB |
22 | BuildRequires: python >= 1:2.7 |
23 | BuildRequires: python-devel >= 1:2.7 | |
1bc0acd1 | 24 | BuildRequires: python-setuptools |
ac89e5f1 JB |
25 | %if %{with tests} |
26 | BuildRequires: python-coverage >= 5.0.3 | |
27 | BuildRequires: python-zope.event | |
28 | BuildRequires: python-zope.testing | |
29 | %endif | |
1bc0acd1 JK |
30 | %endif |
31 | %if %{with python3} | |
2cf0ce46 JB |
32 | BuildRequires: python3 >= 1:3.5 |
33 | BuildRequires: python3-devel >= 1:3.5 | |
1bc0acd1 | 34 | BuildRequires: python3-setuptools |
ac89e5f1 JB |
35 | %if %{with tests} |
36 | BuildRequires: python3-coverage >= 5.0.3 | |
37 | BuildRequires: python3-zope.event | |
38 | BuildRequires: python3-zope.testing | |
39 | %endif | |
1bc0acd1 | 40 | %endif |
2cf0ce46 JB |
41 | BuildRequires: rpm-pythonprov |
42 | BuildRequires: rpmbuild(macros) >= 1.714 | |
5f7f3c21 JB |
43 | %if %{with doc} |
44 | BuildRequires: python3-repoze.sphinx.autointerface | |
45 | BuildRequires: sphinx-pdg-3 | |
46 | %endif | |
47 | Requires: python-modules >= 1:2.7 | |
1bc0acd1 JK |
48 | Requires: python-zope-base |
49 | Provides: ZopeInterface | |
50 | Provides: Zope-Interface | |
bf1a3274 | 51 | Obsoletes: ZopeInterface < 3.4.0 |
ab1466e2 | 52 | Obsoletes: Zope-Interface < 4.1 |
1bc0acd1 JK |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
54 | ||
55 | %description | |
56 | Python 'interface' concept implementation. | |
57 | ||
58 | %description -l pl.UTF-8 | |
59 | Implementacja interfejsów (abstrakcyjnych reprezentacji klas) dla | |
60 | języka Python. | |
61 | ||
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 | |
2cf0ce46 | 66 | Requires: python3-modules >= 1:3.5 |
1bc0acd1 JK |
67 | Requires: python3-zope-base |
68 | ||
69 | %description -n python3-%{module} | |
70 | Python 'interface' concept implementation. | |
71 | ||
72 | %description -n python3-%{module} -l pl.UTF-8 | |
73 | Implementacja interfejsów (abstrakcyjnych reprezentacji klas) dla | |
74 | języka Python. | |
75 | ||
2cf0ce46 JB |
76 | %package apidocs |
77 | Summary: API documentation for Python zope.interface module | |
78 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona zope.interface | |
79 | Group: Documentation | |
38545464 | 80 | BuildArch: noarch |
2cf0ce46 JB |
81 | |
82 | %description apidocs | |
83 | API documentation for Python zope.interface module. | |
84 | ||
85 | %description apidocs -l pl.UTF-8 | |
86 | Dokumentacja API modułu Pythona zope.interface. | |
87 | ||
1bc0acd1 JK |
88 | %prep |
89 | %setup -q -n %{module}-%{version} | |
90 | ||
91 | %build | |
92 | %if %{with python2} | |
93 | %py_build %{?with_tests:test} | |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
97 | %py3_build %{?with_tests:test} | |
98 | %endif | |
99 | ||
5f7f3c21 JB |
100 | %if %{with doc} |
101 | PYTHONPATH=$(pwd)/src \ | |
102 | %{__make} -C docs html \ | |
2cf0ce46 | 103 | SPHINXBUILD=sphinx-build-3 |
5f7f3c21 JB |
104 | %endif |
105 | ||
1bc0acd1 JK |
106 | %install |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | %if %{with python2} | |
109 | %py_install | |
110 | ||
111 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/zope/interface/*.c | |
112 | ||
113 | %py_postclean | |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
117 | %py3_install | |
118 | ||
119 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/interface/*.c | |
120 | %endif | |
121 | ||
122 | %clean | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
125 | %if %{with python2} | |
126 | %files | |
127 | %defattr(644,root,root,755) | |
5f7f3c21 | 128 | %doc CHANGES.rst COPYRIGHT.txt README.rst |
1bc0acd1 JK |
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 | |
5f7f3c21 JB |
134 | %{py_sitedir}/zope.interface-%{version}-py*.egg-info |
135 | %{py_sitedir}/zope.interface-%{version}-py*-nspkg.pth | |
1bc0acd1 JK |
136 | %endif |
137 | ||
138 | %if %{with python3} | |
139 | %files -n python3-%{module} | |
140 | %defattr(644,root,root,755) | |
5f7f3c21 | 141 | %doc CHANGES.rst COPYRIGHT.txt README.rst |
1bc0acd1 JK |
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 | |
5f7f3c21 JB |
148 | %{py3_sitedir}/zope.interface-%{version}-py*.egg-info |
149 | %{py3_sitedir}/zope.interface-%{version}-py*-nspkg.pth | |
1bc0acd1 | 150 | %endif |
2cf0ce46 JB |
151 | |
152 | %if %{with doc} | |
153 | %files apidocs | |
154 | %defattr(644,root,root,755) | |
155 | %doc docs/_build/html/{_modules,_static,api,*.html,*.js} | |
156 | %endif |