]>
Commit | Line | Data |
---|---|---|
f872612c JB |
1 | # TODO: |
2 | # - system address_sorting and upb? | |
3 | # - use shared grpc core in python modules | |
4 | # | |
5 | # Conditional build: | |
6 | %bcond_without apidocs # (Python) API docs build | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
9 | # | |
10 | Summary: RPC library and framework | |
11 | Summary(pl.UTF-8): Biblioteka i szkielet RPC | |
12 | Name: grpc | |
d528a95f | 13 | Version: 1.32.0 |
f872612c JB |
14 | Release: 1 |
15 | License: Apache v2.0 | |
16 | Group: Libraries | |
17 | #Source0Download: https://github.com/grpc/grpc/releases | |
18 | Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz | |
d528a95f | 19 | # Source0-md5: e2afa783e763d5f6bc09b664b907ff25 |
f872612c JB |
20 | Patch0: %{name}-system-absl.patch |
21 | Patch1: %{name}-sphinx.patch | |
321e5c15 JB |
22 | Patch2: %{name}-x32.patch |
23 | Patch3: %{name}-libdir.patch | |
d528a95f | 24 | Patch4: %{name}-system-re2.patch |
f872612c JB |
25 | URL: https://grpc.io/ |
26 | BuildRequires: abseil-cpp-devel | |
27 | BuildRequires: c-ares-devel >= 1.13.0 | |
28 | BuildRequires: cmake >= 3.5.1 | |
29 | BuildRequires: libstdc++-devel >= 6:4.7 | |
30 | BuildRequires: openssl-devel | |
321e5c15 | 31 | BuildRequires: protobuf-devel >= 3.12 |
f872612c JB |
32 | BuildRequires: rpm-pythonprov |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
34 | BuildRequires: zlib-devel | |
35 | %if %{with python2} | |
36 | BuildRequires: python-Cython >= 0.23 | |
37 | BuildRequires: python-modules >= 1:2.7 | |
38 | %endif | |
39 | %if %{with python3} | |
40 | BuildRequires: python3-Cython >= 0.23 | |
41 | BuildRequires: python3-modules >= 1:3.5 | |
42 | %endif | |
43 | %if %{with apidocs} | |
44 | BuildRequires: python3-Sphinx >= 1.8.1 | |
45 | BuildRequires: python3-six >= 1.10 | |
46 | %endif | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | # require non-function grpc_core::ExecCtx::exec_ctx_ and grpc_core::ApplicationCallbackExecCtx::callback_exec_ctx_ symbols | |
50 | %define skip_post_check_so libgrpc\\+\\+.so.* libgrpc\\+\\+_unsecure.so.* | |
51 | ||
52 | %description | |
53 | gRPC is a modern, open source, high-performance remote procedure call | |
54 | (RPC) framework that can run anywhere. gRPC enables client and server | |
55 | applications to communicate transparently, and simplifies the building | |
56 | of connected systems. | |
57 | ||
58 | %description -l pl.UTF-8 | |
59 | gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych | |
60 | wywołań procedur (RPC - Remote Procedure Call). Pozwala na | |
61 | przezroczystą komunikację klienta i serwera, upraszcza tworzenie | |
62 | systemów połączonych. | |
63 | ||
64 | %package devel | |
65 | Summary: Header files for gRPC library | |
66 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki gRPC | |
67 | Group: Development/Libraries | |
68 | Requires: %{name} = %{version}-%{release} | |
69 | ||
70 | %description devel | |
71 | Header files for gRPC library. | |
72 | ||
73 | %description devel -l pl.UTF-8 | |
74 | Pliki nagłówkowe biblioteki gRPC. | |
75 | ||
76 | %package apidocs | |
77 | Summary: API documentation for gRPC library | |
78 | Summary(pl.UTF-8): Dokumentacja API biblioteki gRPC | |
79 | Group: Documentation | |
80 | %if "%{_rpmversion}" >= "4.6" | |
81 | BuildArch: noarch | |
82 | %endif | |
83 | ||
84 | %description apidocs | |
85 | API documentation for gRPC library. | |
86 | ||
87 | %description apidocs -l pl.UTF-8 | |
88 | Dokumentacja API biblioteki gRPC. | |
89 | ||
90 | %package -n python-grpcio | |
91 | Summary: HTTP/2 based RPC framework | |
92 | Summary(pl.UTF-8): Szkielet RPC oparty na HTTP/2 | |
93 | Group: Libraries/Python | |
94 | ||
95 | %description -n python-grpcio | |
96 | gRPC is a modern, open source, high-performance remote procedure call | |
97 | (RPC) framework that can run anywhere. gRPC enables client and server | |
98 | applications to communicate transparently, and simplifies the building | |
99 | of connected systems. | |
100 | ||
101 | %description -n python-grpcio -l pl.UTF-8 | |
102 | gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych | |
103 | wywołań procedur (RPC - Remote Procedure Call). Pozwala na | |
104 | przezroczystą komunikację klienta i serwera, upraszcza tworzenie | |
105 | systemów połączonych. | |
106 | ||
107 | %package -n python3-grpcio | |
108 | Summary: HTTP/2 based RPC framework | |
109 | Summary(pl.UTF-8): Szkielet RPC oparty na HTTP/2 | |
110 | Group: Libraries/Python | |
111 | ||
112 | %description -n python3-grpcio | |
113 | gRPC is a modern, open source, high-performance remote procedure call | |
114 | (RPC) framework that can run anywhere. gRPC enables client and server | |
115 | applications to communicate transparently, and simplifies the building | |
116 | of connected systems. | |
117 | ||
118 | %description -n python3-grpcio -l pl.UTF-8 | |
119 | gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych | |
120 | wywołań procedur (RPC - Remote Procedure Call). Pozwala na | |
121 | przezroczystą komunikację klienta i serwera, upraszcza tworzenie | |
122 | systemów połączonych. | |
123 | ||
124 | %package -n python-grpcio-apidocs | |
125 | Summary: API documentation for Python gRPC library | |
126 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona gRPC | |
127 | Group: Documentation | |
128 | %if "%{_rpmversion}" >= "4.6" | |
129 | BuildArch: noarch | |
130 | %endif | |
131 | ||
132 | %description -n python-grpcio-apidocs | |
133 | API documentation for Python gRPC library. | |
134 | ||
135 | %description -n python-grpcio-apidocs -l pl.UTF-8 | |
136 | Dokumentacja API biblioteki Pythona gRPC. | |
137 | ||
138 | %prep | |
139 | %setup -q | |
140 | %patch0 -p1 | |
141 | %patch1 -p1 | |
321e5c15 JB |
142 | %patch2 -p1 |
143 | %patch3 -p1 | |
d528a95f | 144 | %patch4 -p1 |
f872612c JB |
145 | |
146 | %build | |
147 | install -d build | |
148 | cd build | |
149 | %cmake .. \ | |
150 | -DgRPC_INSTALL_CMAKEDIR:PATH=%{_lib}/cmake/grpc \ | |
151 | -DgRPC_INSTALL_LIBDIR:PATH=%{_lib} \ | |
152 | -DgRPC_ABSL_PROVIDER=package \ | |
153 | -DgRPC_CARES_PROVIDER=package \ | |
154 | -DgRPC_PROTOBUF_PROVIDER=package \ | |
d528a95f | 155 | -DgRPC_RE2_PROVIDER=package \ |
f872612c JB |
156 | -DgRPC_SSL_PROVIDER=package \ |
157 | -DgRPC_ZLIB_PROVIDER=package | |
158 | ||
159 | %{__make} | |
160 | cd .. | |
161 | ||
162 | export GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 | |
163 | export GRPC_PYTHON_BUILD_SYSTEM_CARES=1 | |
164 | export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 | |
d528a95f | 165 | export GRPC_PYTHON_BUILD_SYSTEM_RE2=1 |
f872612c JB |
166 | export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 |
167 | ||
168 | %if %{with python2} | |
169 | %py_build | |
170 | %endif | |
171 | ||
172 | %if %{with python3} | |
173 | %if %{with apidocs} | |
174 | export GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD=1 | |
175 | %endif | |
176 | %py3_build | |
177 | %endif | |
178 | ||
179 | %if %{with apidocs} | |
180 | sphinx-build-3 -b html doc/python/sphinx doc/python/sphinx/_build/html | |
181 | %endif | |
182 | ||
183 | %install | |
184 | rm -rf $RPM_BUILD_ROOT | |
185 | ||
186 | %{__make} -C build install \ | |
187 | DESTDIR=$RPM_BUILD_ROOT | |
188 | ||
189 | export GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 | |
190 | export GRPC_PYTHON_BUILD_SYSTEM_CARES=1 | |
191 | export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 | |
d528a95f | 192 | export GRPC_PYTHON_BUILD_SYSTEM_RE2=1 |
f872612c JB |
193 | export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 |
194 | ||
195 | %if %{with python2} | |
196 | %py_install | |
197 | ||
198 | %py_postclean | |
199 | %endif | |
200 | ||
201 | %if %{with python3} | |
202 | %py3_install | |
203 | %endif | |
204 | ||
205 | install -d $RPM_BUILD_ROOT%{_docdir} | |
206 | cp -pr doc $RPM_BUILD_ROOT%{_docdir}/%{name}-apidocs-%{version} | |
207 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-apidocs-%{version}/{csharp,python/sphinx,.gitignore} | |
208 | ||
209 | %clean | |
210 | rm -rf $RPM_BUILD_ROOT | |
211 | ||
212 | %post -p /sbin/ldconfig | |
213 | %postun -p /sbin/ldconfig | |
214 | ||
215 | %files | |
216 | %defattr(644,root,root,755) | |
217 | %doc AUTHORS CONCEPTS.md MAINTAINERS.md NOTICE.txt README.md TROUBLESHOOTING.md | |
218 | %attr(755,root,root) %{_bindir}/grpc_cpp_plugin | |
219 | %attr(755,root,root) %{_bindir}/grpc_csharp_plugin | |
220 | %attr(755,root,root) %{_bindir}/grpc_node_plugin | |
221 | %attr(755,root,root) %{_bindir}/grpc_objective_c_plugin | |
222 | %attr(755,root,root) %{_bindir}/grpc_php_plugin | |
223 | %attr(755,root,root) %{_bindir}/grpc_python_plugin | |
224 | %attr(755,root,root) %{_bindir}/grpc_ruby_plugin | |
225 | %attr(755,root,root) %{_libdir}/libgpr.so.*.*.* | |
d528a95f | 226 | %attr(755,root,root) %ghost %{_libdir}/libgpr.so.12 |
f872612c | 227 | %attr(755,root,root) %{_libdir}/libgrpc.so.*.*.* |
d528a95f | 228 | %attr(755,root,root) %ghost %{_libdir}/libgrpc.so.12 |
f872612c JB |
229 | %attr(755,root,root) %{_libdir}/libgrpc_plugin_support.so.*.*.* |
230 | %attr(755,root,root) %ghost %{_libdir}/libgrpc_plugin_support.so.1 | |
231 | %attr(755,root,root) %{_libdir}/libgrpc_unsecure.so.*.*.* | |
d528a95f | 232 | %attr(755,root,root) %ghost %{_libdir}/libgrpc_unsecure.so.12 |
f872612c JB |
233 | %attr(755,root,root) %{_libdir}/libgrpc++.so.*.*.* |
234 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++.so.1 | |
235 | %attr(755,root,root) %{_libdir}/libgrpc++_alts.so.*.*.* | |
236 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_alts.so.1 | |
237 | %attr(755,root,root) %{_libdir}/libgrpc++_error_details.so.*.*.* | |
238 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_error_details.so.1 | |
239 | %attr(755,root,root) %{_libdir}/libgrpc++_reflection.so.*.*.* | |
240 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_reflection.so.1 | |
241 | %attr(755,root,root) %{_libdir}/libgrpc++_unsecure.so.*.*.* | |
242 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_unsecure.so.1 | |
243 | %attr(755,root,root) %{_libdir}/libgrpcpp_channelz.so.*.*.* | |
244 | %attr(755,root,root) %ghost %{_libdir}/libgrpcpp_channelz.so.1 | |
245 | # TODO: use system libs instead | |
246 | %attr(755,root,root) %{_libdir}/libaddress_sorting.so.*.*.* | |
d528a95f | 247 | %attr(755,root,root) %ghost %{_libdir}/libaddress_sorting.so.12 |
f872612c | 248 | %attr(755,root,root) %{_libdir}/libupb.so.*.*.* |
d528a95f | 249 | %attr(755,root,root) %ghost %{_libdir}/libupb.so.12 |
f872612c JB |
250 | %{_datadir}/grpc |
251 | ||
252 | %files devel | |
253 | %defattr(644,root,root,755) | |
254 | %attr(755,root,root) %{_libdir}/libgpr.so | |
255 | %attr(755,root,root) %{_libdir}/libgrpc.so | |
256 | %attr(755,root,root) %{_libdir}/libgrpc_plugin_support.so | |
257 | %attr(755,root,root) %{_libdir}/libgrpc_unsecure.so | |
258 | %attr(755,root,root) %{_libdir}/libgrpc++.so | |
259 | %attr(755,root,root) %{_libdir}/libgrpc++_alts.so | |
260 | %attr(755,root,root) %{_libdir}/libgrpc++_error_details.so | |
261 | %attr(755,root,root) %{_libdir}/libgrpc++_reflection.so | |
262 | %attr(755,root,root) %{_libdir}/libgrpc++_unsecure.so | |
263 | %attr(755,root,root) %{_libdir}/libgrpcpp_channelz.so | |
264 | %attr(755,root,root) %{_libdir}/libaddress_sorting.so | |
265 | %attr(755,root,root) %{_libdir}/libupb.so | |
266 | %{_includedir}/grpc | |
267 | %{_includedir}/grpc++ | |
268 | %{_includedir}/grpcpp | |
269 | %{_libdir}/cmake/grpc | |
270 | %{_pkgconfigdir}/gpr.pc | |
271 | %{_pkgconfigdir}/grpc.pc | |
272 | %{_pkgconfigdir}/grpc_unsecure.pc | |
273 | %{_pkgconfigdir}/grpc++.pc | |
274 | %{_pkgconfigdir}/grpc++_unsecure.pc | |
275 | ||
276 | %files apidocs | |
277 | %defattr(644,root,root,755) | |
278 | %{_docdir}/%{name}-apidocs-%{version} | |
279 | ||
280 | %if %{with python2} | |
281 | %files -n python-grpcio | |
282 | %defattr(644,root,root,755) | |
283 | %dir %{py_sitedir}/grpc | |
284 | %{py_sitedir}/grpc/*.py[co] | |
285 | %dir %{py_sitedir}/grpc/_cython | |
286 | %attr(755,root,root) %{py_sitedir}/grpc/_cython/cygrpc.so | |
287 | %{py_sitedir}/grpc/_cython/__init__.py[co] | |
288 | %{py_sitedir}/grpc/_cython/_credentials | |
289 | %{py_sitedir}/grpc/_cython/_cygrpc | |
d528a95f | 290 | %{py_sitedir}/grpc/aio |
f872612c JB |
291 | %{py_sitedir}/grpc/beta |
292 | %{py_sitedir}/grpc/experimental | |
293 | %{py_sitedir}/grpc/framework | |
294 | %{py_sitedir}/grpcio-%{version}-py*.egg-info | |
295 | %endif | |
296 | ||
297 | %if %{with python3} | |
298 | %files -n python3-grpcio | |
299 | %defattr(644,root,root,755) | |
300 | %dir %{py3_sitedir}/grpc | |
301 | %{py3_sitedir}/grpc/*.py | |
302 | %{py3_sitedir}/grpc/__pycache__ | |
303 | %dir %{py3_sitedir}/grpc/_cython | |
304 | %attr(755,root,root) %{py3_sitedir}/grpc/_cython/cygrpc.cpython-*.so | |
305 | %{py3_sitedir}/grpc/_cython/__init__.py | |
306 | %{py3_sitedir}/grpc/_cython/__pycache__ | |
307 | %{py3_sitedir}/grpc/_cython/_credentials | |
308 | %{py3_sitedir}/grpc/_cython/_cygrpc | |
d528a95f | 309 | %{py3_sitedir}/grpc/aio |
f872612c JB |
310 | %{py3_sitedir}/grpc/beta |
311 | %{py3_sitedir}/grpc/experimental | |
312 | %{py3_sitedir}/grpc/framework | |
313 | %{py3_sitedir}/grpcio-%{version}-py*.egg-info | |
314 | %endif | |
315 | ||
316 | %if %{with apidocs} | |
317 | %files -n python-grpcio-apidocs | |
318 | %defattr(644,root,root,755) | |
319 | %doc doc/python/sphinx/_build/html/{_static,*.html,*.js} | |
320 | %endif |