]>
Commit | Line | Data |
---|---|---|
8c5fde43 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
8b3d71bd | 7 | |
99daff2c | 8 | %define module zope.deferredimport |
322e8459 JB |
9 | Summary: Defer Python module import |
10 | Summary(pl.UTF-8): Opóźnianie importu modułów Pythona | |
99daff2c | 11 | Name: python-%{module} |
8c5fde43 | 12 | Version: 4.4 |
feaa54a0 | 13 | Release: 3 |
8c5fde43 | 14 | License: ZPL v2.1 |
3dce3665 | 15 | Group: Libraries/Python |
8c5fde43 JB |
16 | Source0: https://files.pythonhosted.org/packages/source/z/zope.deferredimport/zope.deferredimport-%{version}.tar.gz |
17 | # Source0-md5: 05db5a4e2129966e510f9b73368cb7d6 | |
18 | URL: https://www.zope.dev/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python >= 1:2.7 | |
21 | BuildRequires: python-devel >= 1:2.7 | |
72159618 | 22 | BuildRequires: python-setuptools |
8c5fde43 JB |
23 | %if %{with tests} |
24 | BuildRequires: python-zope.proxy | |
25 | BuildRequires: python-zope.testrunner | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3 >= 1:3.5 | |
30 | BuildRequires: python3-devel >= 1:3.5 | |
31 | BuildRequires: python3-setuptools | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-zope.proxy | |
34 | BuildRequires: python3-zope.testrunner | |
35 | %endif | |
36 | %endif | |
322e8459 | 37 | BuildRequires: rpm-pythonprov |
8c5fde43 JB |
38 | BuildRequires: rpmbuild(macros) >= 1.714 |
39 | %if %{with doc} | |
40 | BuildRequires: sphinx-pdg | |
41 | %endif | |
42 | Requires: python-modules >= 1:2.7 | |
43 | Obsoletes: Zope-DeferredImport < 3.6.0 | |
ca417181 | 44 | BuildArch: noarch |
2a1d1a85 | 45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
47 | %description | |
322e8459 JB |
48 | Defer Python module import. |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | Opóźnianie importu modułów Pythona. | |
2a1d1a85 | 52 | |
8c5fde43 JB |
53 | %package -n python3-%{module} |
54 | Summary: Defer Python module import | |
55 | Summary(pl.UTF-8): Opóźnianie importu modułów Pythona | |
56 | Group: Libraries/Python | |
57 | Requires: python3-modules >= 1:3.5 | |
58 | ||
59 | %description -n python3-%{module} | |
60 | Defer Python module import. | |
61 | ||
62 | %description -n python3-%{module} -l pl.UTF-8 | |
63 | Opóźnianie importu modułów Pythona. | |
64 | ||
65 | %package apidocs | |
66 | Summary: API documentation for Python zope.deferredimport module | |
67 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona zope.deferredimport | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for Python zope.deferredimport module. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API modułu Pythona zope.deferredimport. | |
75 | ||
2a1d1a85 | 76 | %prep |
99daff2c | 77 | %setup -q -n %{module}-%{version} |
2a1d1a85 | 78 | |
79 | %build | |
8c5fde43 | 80 | %if %{with python2} |
48e73741 | 81 | %py_build |
2a1d1a85 | 82 | |
8c5fde43 JB |
83 | %if %{with tests} |
84 | PYTHONPATH=$(pwd)/src \ | |
85 | zope-testrunner-2 --test-path=src -v | |
86 | %endif | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %py3_build | |
91 | ||
92 | %if %{with tests} | |
93 | PYTHONPATH=$(pwd)/src \ | |
94 | zope-testrunner-3 --test-path=src -v | |
95 | %endif | |
96 | %endif | |
97 | ||
98 | %if %{with doc} | |
99 | PYTHONPATH=$(pwd)/src \ | |
100 | %{__make} -C docs html | |
101 | %endif | |
102 | ||
2a1d1a85 | 103 | %install |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
8c5fde43 JB |
106 | %if %{with python2} |
107 | %py_install | |
2a1d1a85 | 108 | |
322e8459 | 109 | %py_postclean |
8c5fde43 JB |
110 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/zope/deferredimport/tests.* |
111 | %endif | |
112 | ||
113 | %if %{with python3} | |
114 | %py3_install | |
115 | ||
116 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/zope/deferredimport/tests.* | |
117 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/zope/deferredimport/__pycache__/tests.* | |
118 | %endif | |
2a1d1a85 | 119 | |
120 | %clean | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
8c5fde43 | 123 | %if %{with python2} |
2a1d1a85 | 124 | %files |
125 | %defattr(644,root,root,755) | |
42f8689f | 126 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
ca417181 JR |
127 | %{py_sitescriptdir}/zope/deferredimport |
128 | %{py_sitescriptdir}/zope.deferredimport-*.egg-info | |
129 | %{py_sitescriptdir}/zope.deferredimport-*-nspkg.pth | |
8c5fde43 JB |
130 | %endif |
131 | ||
132 | %if %{with python3} | |
133 | %files -n python3-%{module} | |
134 | %defattr(644,root,root,755) | |
42f8689f | 135 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
8c5fde43 JB |
136 | %{py3_sitescriptdir}/zope/deferredimport |
137 | %{py3_sitescriptdir}/zope.deferredimport-*.egg-info | |
138 | %{py3_sitescriptdir}/zope.deferredimport-*-nspkg.pth | |
139 | %endif | |
140 | ||
141 | %if %{with doc} | |
142 | %files apidocs | |
143 | %defattr(644,root,root,755) | |
21a1d321 | 144 | %doc docs/_build/html/{_sources,_static,*.html,*.js} |
8c5fde43 | 145 | %endif |