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