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