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