]>
Commit | Line | Data |
---|---|---|
5f7f3c21 | 1 | # TODO: finish docs build (requires Sphinx repoze.sphinx.autointerface extension) |
1bc0acd1 JK |
2 | # |
3 | # Conditional build: | |
5f7f3c21 | 4 | %bcond_with doc # Sphinx documentation |
1bc0acd1 JK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
5f7f3c21 | 7 | %bcond_without tests # unit tests |
1bc0acd1 | 8 | |
1bc0acd1 JK |
9 | %define module zope.interface |
10 | Summary: Python 'interface' concept implementation | |
11 | Summary(pl.UTF-8): Implementacja interfejsów dla języka Python | |
12 | Name: python-%{module} | |
9a4b2682 | 13 | Version: 4.5.0 |
499f0372 | 14 | Release: 2 |
1bc0acd1 JK |
15 | License: ZPL 2.1 |
16 | Group: Libraries/Python | |
5f7f3c21 | 17 | #Source0Download: https://pypi.org/simple/zope.interface/ |
9a4b2682 JK |
18 | Source0: https://files.pythonhosted.org/packages/source/z/zope.interface/zope.interface-%{version}.tar.gz |
19 | # Source0-md5: 7b669cd692d817772c61d2e3ad0f1e71 | |
1bc0acd1 JK |
20 | URL: http://docs.zope.org/zope.interface/ |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.710 | |
23 | %if %{with python2} | |
5f7f3c21 JB |
24 | BuildRequires: python >= 1:2.7 |
25 | BuildRequires: python-devel >= 1:2.7 | |
1bc0acd1 | 26 | BuildRequires: python-setuptools |
5f7f3c21 | 27 | %{?with_tests:BuildRequires: python-zope.event} |
1bc0acd1 JK |
28 | %endif |
29 | %if %{with python3} | |
5f7f3c21 JB |
30 | BuildRequires: python3 >= 1:3.4 |
31 | BuildRequires: python3-devel >= 1:3.4 | |
1bc0acd1 | 32 | BuildRequires: python3-setuptools |
5f7f3c21 | 33 | %{?with_tests:BuildRequires: python3-zope.event} |
1bc0acd1 | 34 | %endif |
5f7f3c21 JB |
35 | %if %{with doc} |
36 | BuildRequires: python3-repoze.sphinx.autointerface | |
37 | BuildRequires: sphinx-pdg-3 | |
38 | %endif | |
39 | Requires: python-modules >= 1:2.7 | |
1bc0acd1 JK |
40 | Requires: python-zope-base |
41 | Provides: ZopeInterface | |
42 | Provides: Zope-Interface | |
43 | Obsoletes: ZopeInterface | |
44 | Obsoletes: Zope-Interface | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | Python 'interface' concept implementation. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | Implementacja interfejsów (abstrakcyjnych reprezentacji klas) dla | |
52 | języka Python. | |
53 | ||
54 | %package -n python3-%{module} | |
55 | Summary: Python 'interface' concept implementation | |
56 | Summary(pl.UTF-8): Implementacja interfejsów dla języka Python | |
57 | Group: Libraries/Python | |
5f7f3c21 | 58 | Requires: python3-modules >= 1:3.4 |
1bc0acd1 JK |
59 | Requires: python3-zope-base |
60 | ||
61 | %description -n python3-%{module} | |
62 | Python 'interface' concept implementation. | |
63 | ||
64 | %description -n python3-%{module} -l pl.UTF-8 | |
65 | Implementacja interfejsów (abstrakcyjnych reprezentacji klas) dla | |
66 | języka Python. | |
67 | ||
68 | %prep | |
69 | %setup -q -n %{module}-%{version} | |
70 | ||
71 | %build | |
72 | %if %{with python2} | |
73 | %py_build %{?with_tests:test} | |
74 | %endif | |
75 | ||
76 | %if %{with python3} | |
77 | %py3_build %{?with_tests:test} | |
78 | %endif | |
79 | ||
5f7f3c21 JB |
80 | %if %{with doc} |
81 | PYTHONPATH=$(pwd)/src \ | |
82 | %{__make} -C docs html \ | |
83 | SPHINXBUILD=sphinx-build-2 | |
84 | %endif | |
85 | ||
1bc0acd1 JK |
86 | %install |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | %if %{with python2} | |
89 | %py_install | |
90 | ||
91 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/zope/interface/*.c | |
92 | ||
93 | %py_postclean | |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
97 | %py3_install | |
98 | ||
99 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/interface/*.c | |
100 | %endif | |
101 | ||
102 | %clean | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %if %{with python2} | |
106 | %files | |
107 | %defattr(644,root,root,755) | |
5f7f3c21 | 108 | %doc CHANGES.rst COPYRIGHT.txt README.rst |
1bc0acd1 JK |
109 | %dir %{py_sitedir}/zope/interface |
110 | %{py_sitedir}/zope/interface/*.py[co] | |
111 | %attr(755,root,root) %{py_sitedir}/zope/interface/_zope_interface_coptimizations.so | |
112 | %{py_sitedir}/zope/interface/common | |
113 | %{py_sitedir}/zope/interface/tests | |
5f7f3c21 JB |
114 | %{py_sitedir}/zope.interface-%{version}-py*.egg-info |
115 | %{py_sitedir}/zope.interface-%{version}-py*-nspkg.pth | |
1bc0acd1 JK |
116 | %endif |
117 | ||
118 | %if %{with python3} | |
119 | %files -n python3-%{module} | |
120 | %defattr(644,root,root,755) | |
5f7f3c21 | 121 | %doc CHANGES.rst COPYRIGHT.txt README.rst |
1bc0acd1 JK |
122 | %dir %{py3_sitedir}/zope/interface |
123 | %{py3_sitedir}/zope/interface/*.py | |
124 | %{py3_sitedir}/zope/interface/__pycache__ | |
125 | %attr(755,root,root) %{py3_sitedir}/zope/interface/_zope_interface_coptimizations*.so | |
126 | %{py3_sitedir}/zope/interface/common | |
127 | %{py3_sitedir}/zope/interface/tests | |
5f7f3c21 JB |
128 | %{py3_sitedir}/zope.interface-%{version}-py*.egg-info |
129 | %{py3_sitedir}/zope.interface-%{version}-py*-nspkg.pth | |
1bc0acd1 | 130 | %endif |