]>
Commit | Line | Data |
---|---|---|
01703bdf JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_with tests # unit tests (installed package required) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
a9bc96c3 | 8 | %define module zope.proxy |
13781963 | 9 | Summary: Mostly-transparent wrappers around another object |
ede1d7e1 | 10 | Summary(pl.UTF-8): Prawie przezroczyste obudowywanie innych obiektów |
a9bc96c3 | 11 | Name: python-%{module} |
01703bdf JB |
12 | Version: 4.5.0 |
13 | Release: 1 | |
14 | License: ZPL v2.1 | |
13781963 | 15 | Group: Libraries/Python |
01703bdf JB |
16 | Source0: https://files.pythonhosted.org/packages/source/z/zope.proxy/zope.proxy-%{version}.tar.gz |
17 | # Source0-md5: f18df4454bd57e7352be922f7a43dffb | |
18 | URL: https://www.zope.dev/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python >= 1:2.7 | |
21 | BuildRequires: python-devel >= 1:2.7 | |
ecacf43c | 22 | BuildRequires: python-setuptools |
01703bdf JB |
23 | %if %{with tests} |
24 | BuildRequires: python-zope.interface | |
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.interface | |
34 | BuildRequires: python3-zope.testrunner | |
35 | %endif | |
36 | %endif | |
ede1d7e1 | 37 | BuildRequires: rpm-pythonprov |
01703bdf JB |
38 | BuildRequires: rpmbuild(macros) >= 1.714 |
39 | %if %{with doc} | |
40 | BuildRequires: python3-repoze.sphinx.autointerface | |
41 | BuildRequires: sphinx-pdg-3 | |
42 | %endif | |
43 | Requires: python-modules >= 1:2.7 | |
44 | Obsoletes: Zope-Proxy < 3.5.0 | |
45 | BuildArch: noarch | |
1dd5fa5d | 46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
47 | ||
48 | %description | |
13781963 | 49 | Proxies are special objects which serve as mostly-transparent wrappers |
ede1d7e1 JB |
50 | around another object, intervening in the apparent behavior of the |
51 | wrapped object only when necessary to apply the policy (e.g., access | |
52 | checking, location brokering, etc.) for which the proxy is | |
53 | responsible. | |
54 | ||
55 | %description -l pl.UTF-8 | |
56 | Proxy to specjalne obiekty służące jako prawie przezroczyste | |
57 | obudowanie innego obiektu, wkraczające w zwykłe zachowanie | |
58 | obudowywanego obiektu tylko w razie potrzeby, aby zastosować politykę | |
59 | (np. kontrolę dostępu, pośredniczenie itp.), za którą odpowiada proxy. | |
1dd5fa5d | 60 | |
01703bdf JB |
61 | %package -n python3-%{module} |
62 | Summary: Mostly-transparent wrappers around another object | |
63 | Summary(pl.UTF-8): Prawie przezroczyste obudowywanie innych obiektów | |
64 | Group: Libraries/Python | |
65 | Requires: python3-modules >= 1:3.5 | |
66 | ||
67 | %description -n python3-%{module} | |
68 | Proxies are special objects which serve as mostly-transparent wrappers | |
69 | around another object, intervening in the apparent behavior of the | |
70 | wrapped object only when necessary to apply the policy (e.g., access | |
71 | checking, location brokering, etc.) for which the proxy is | |
72 | responsible. | |
73 | ||
74 | %description -n python3-%{module} -l pl.UTF-8 | |
75 | Proxy to specjalne obiekty służące jako prawie przezroczyste | |
76 | obudowanie innego obiektu, wkraczające w zwykłe zachowanie | |
77 | obudowywanego obiektu tylko w razie potrzeby, aby zastosować politykę | |
78 | (np. kontrolę dostępu, pośredniczenie itp.), za którą odpowiada proxy. | |
79 | ||
80 | %package apidocs | |
81 | Summary: API documentation for Python zope.proxy module | |
82 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona zope.proxy | |
83 | Group: Documentation | |
84 | ||
85 | %description apidocs | |
86 | API documentation for Python zope.proxy module. | |
87 | ||
88 | %description apidocs -l pl.UTF-8 | |
89 | Dokumentacja API modułu Pythona zope.proxy. | |
90 | ||
1dd5fa5d | 91 | %prep |
01703bdf | 92 | %setup -q -n %{module}-%{version} |
1dd5fa5d | 93 | |
94 | %build | |
01703bdf | 95 | %if %{with python2} |
d145681d | 96 | %py_build |
1dd5fa5d | 97 | |
01703bdf JB |
98 | %if %{with tests} |
99 | PYTHONPATH=$(pwd)/src \ | |
100 | zope-testrunner-2 --test-path=src -v | |
101 | %endif | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %py3_build | |
106 | ||
107 | %if %{with tests} | |
108 | PYTHONPATH=$(pwd)/src \ | |
109 | zope-testrunner-3 --test-path=src -v | |
110 | %endif | |
111 | %endif | |
112 | ||
113 | %if %{with doc} | |
114 | PYTHONPATH=$(pwd)/src \ | |
115 | %{__make} -C docs html \ | |
116 | SPHINXBUILD=sphinx-build-3 | |
117 | %endif | |
118 | ||
1dd5fa5d | 119 | %install |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
01703bdf | 122 | %if %{with python2} |
d145681d | 123 | %py_install |
1dd5fa5d | 124 | |
ede1d7e1 | 125 | %py_postclean |
01703bdf JB |
126 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/zope/proxy/*.[ch] |
127 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/zope/proxy/tests | |
128 | # or package to -devel? | |
129 | %{__rm} $RPM_BUILD_ROOT%{py_incdir}/zope.proxy/proxy.h | |
130 | %endif | |
131 | ||
132 | %if %{with python3} | |
133 | %py3_install | |
134 | ||
135 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/proxy/*.[ch] | |
136 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/zope/proxy/tests | |
137 | # or package to python3-%{module}-devel? | |
138 | %{__rm} $RPM_BUILD_ROOT%{py3_incdir}/zope.proxy/proxy.h | |
139 | %endif | |
1dd5fa5d | 140 | |
141 | %clean | |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
01703bdf | 144 | %if %{with python2} |
1dd5fa5d | 145 | %files |
146 | %defattr(644,root,root,755) | |
01703bdf | 147 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
cb65fed5 | 148 | %dir %{py_sitedir}/zope/proxy |
cb65fed5 JB |
149 | %{py_sitedir}/zope/proxy/*.py[co] |
150 | %attr(755,root,root) %{py_sitedir}/zope/proxy/_zope_proxy_proxy.so | |
ede1d7e1 JB |
151 | %{py_sitedir}/zope.proxy-*.egg-info |
152 | %{py_sitedir}/zope.proxy-*-nspkg.pth | |
01703bdf | 153 | %endif |
cb65fed5 JB |
154 | |
155 | # -devel? | |
156 | #%{py_incdir}/zope.proxy | |
01703bdf JB |
157 | |
158 | %if %{with python3} | |
159 | %files -n python3-%{module} | |
160 | %defattr(644,root,root,755) | |
161 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst | |
162 | %dir %{py3_sitedir}/zope/proxy | |
163 | %{py3_sitedir}/zope/proxy/*.py | |
164 | %{py3_sitedir}/zope/proxy/__pycache__ | |
165 | %attr(755,root,root) %{py3_sitedir}/zope/proxy/_zope_proxy_proxy.cpython-*.so | |
166 | %{py3_sitedir}/zope.proxy-*.egg-info | |
167 | %{py3_sitedir}/zope.proxy-*-nspkg.pth | |
168 | %endif | |
169 | ||
170 | %if %{with doc} | |
171 | %files apidocs | |
172 | %defattr(644,root,root,755) | |
173 | %doc docs/_build/html/{_modules,_static,*.html,*.js} | |
174 | %endif |