]>
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 | |
f872612c JB |
7 | %bcond_without python3 # CPython 3.x module |
8 | # | |
9 | Summary: RPC library and framework | |
10 | Summary(pl.UTF-8): Biblioteka i szkielet RPC | |
11 | Name: grpc | |
ed9729ac JB |
12 | Version: 1.47.0 |
13 | Release: 1 | |
f872612c JB |
14 | License: Apache v2.0 |
15 | Group: Libraries | |
16 | #Source0Download: https://github.com/grpc/grpc/releases | |
17 | Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz | |
ed9729ac | 18 | # Source0-md5: ba6736177699865450206452a9ae49e0 |
10fa4b74 JB |
19 | Source1: https://github.com/census-instrumentation/opencensus-proto/archive/v0.3.0/opencensus-proto-0.3.0.tar.gz |
20 | # Source1-md5: 0b208800a68548cbf2d4bff763c050a2 | |
f872612c | 21 | Patch1: %{name}-sphinx.patch |
321e5c15 JB |
22 | Patch2: %{name}-x32.patch |
23 | Patch3: %{name}-libdir.patch | |
c3c2ad9f | 24 | Patch5: %{name}-system-openssl.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 | |
ed9729ac JB |
29 | BuildRequires: gcc >= 6:4.7 |
30 | BuildRequires: libstdc++-devel >= 6:7 | |
f872612c | 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 | |
f872612c | 38 | %if %{with python3} |
a1ffe626 | 39 | BuildRequires: python3-Cython >= 0.29.8 |
ed9729ac | 40 | BuildRequires: python3-modules >= 1:3.6 |
f872612c JB |
41 | %endif |
42 | %if %{with apidocs} | |
43 | BuildRequires: python3-Sphinx >= 1.8.1 | |
44 | BuildRequires: python3-six >= 1.10 | |
45 | %endif | |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
47 | ||
ed9729ac JB |
48 | # Libs rquire non-function grpc_core::ExecCtx::exec_ctx_ and grpc_core::ApplicationCallbackExecCtx::callback_exec_ctx_ symbols. |
49 | # Wildcard '+' chars to workaround escape incompatibilities between rpm versions. | |
50 | %define skip_post_check_so libgrpc...so.* libgrpc.._unsecure.so.* | |
f872612c JB |
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 | |
f872612c | 80 | BuildArch: noarch |
f872612c JB |
81 | |
82 | %description apidocs | |
83 | API documentation for gRPC library. | |
84 | ||
85 | %description apidocs -l pl.UTF-8 | |
86 | Dokumentacja API biblioteki gRPC. | |
87 | ||
f872612c JB |
88 | %package -n python3-grpcio |
89 | Summary: HTTP/2 based RPC framework | |
90 | Summary(pl.UTF-8): Szkielet RPC oparty na HTTP/2 | |
91 | Group: Libraries/Python | |
92 | ||
93 | %description -n python3-grpcio | |
94 | gRPC is a modern, open source, high-performance remote procedure call | |
95 | (RPC) framework that can run anywhere. gRPC enables client and server | |
96 | applications to communicate transparently, and simplifies the building | |
97 | of connected systems. | |
98 | ||
99 | %description -n python3-grpcio -l pl.UTF-8 | |
100 | gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych | |
101 | wywołań procedur (RPC - Remote Procedure Call). Pozwala na | |
102 | przezroczystą komunikację klienta i serwera, upraszcza tworzenie | |
103 | systemów połączonych. | |
104 | ||
53fc12f4 | 105 | %package -n python3-grpcio-apidocs |
f872612c JB |
106 | Summary: API documentation for Python gRPC library |
107 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona gRPC | |
108 | Group: Documentation | |
f872612c | 109 | BuildArch: noarch |
f872612c | 110 | |
53fc12f4 | 111 | %description -n python3-grpcio-apidocs |
f872612c JB |
112 | API documentation for Python gRPC library. |
113 | ||
53fc12f4 | 114 | %description -n python3-grpcio-apidocs -l pl.UTF-8 |
f872612c JB |
115 | Dokumentacja API biblioteki Pythona gRPC. |
116 | ||
117 | %prep | |
118 | %setup -q | |
f872612c | 119 | %patch1 -p1 |
321e5c15 JB |
120 | %patch2 -p1 |
121 | %patch3 -p1 | |
c3c2ad9f | 122 | %patch5 -p1 |
f872612c | 123 | |
ed9729ac JB |
124 | %{__rm} doc/.gitignore |
125 | ||
10fa4b74 JB |
126 | # simulate download_archive result |
127 | %{__tar} xf %{SOURCE1} -C third_party/opencensus-proto --strip-components=1 opencensus-proto-0.3.0/src | |
128 | ||
f872612c JB |
129 | %build |
130 | install -d build | |
131 | cd build | |
132 | %cmake .. \ | |
53fc12f4 | 133 | -DCMAKE_CXX_STANDARD=17 \ |
f872612c JB |
134 | -DgRPC_INSTALL_CMAKEDIR:PATH=%{_lib}/cmake/grpc \ |
135 | -DgRPC_INSTALL_LIBDIR:PATH=%{_lib} \ | |
136 | -DgRPC_ABSL_PROVIDER=package \ | |
137 | -DgRPC_CARES_PROVIDER=package \ | |
138 | -DgRPC_PROTOBUF_PROVIDER=package \ | |
d528a95f | 139 | -DgRPC_RE2_PROVIDER=package \ |
f872612c JB |
140 | -DgRPC_SSL_PROVIDER=package \ |
141 | -DgRPC_ZLIB_PROVIDER=package | |
142 | ||
143 | %{__make} | |
144 | cd .. | |
145 | ||
146 | export GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 | |
147 | export GRPC_PYTHON_BUILD_SYSTEM_CARES=1 | |
148 | export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 | |
d528a95f | 149 | export GRPC_PYTHON_BUILD_SYSTEM_RE2=1 |
f872612c JB |
150 | export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 |
151 | ||
f872612c JB |
152 | %if %{with python3} |
153 | %if %{with apidocs} | |
154 | export GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD=1 | |
155 | %endif | |
156 | %py3_build | |
157 | %endif | |
158 | ||
159 | %if %{with apidocs} | |
160 | sphinx-build-3 -b html doc/python/sphinx doc/python/sphinx/_build/html | |
161 | %endif | |
162 | ||
163 | %install | |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | ||
166 | %{__make} -C build install \ | |
167 | DESTDIR=$RPM_BUILD_ROOT | |
168 | ||
169 | export GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 | |
170 | export GRPC_PYTHON_BUILD_SYSTEM_CARES=1 | |
171 | export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 | |
d528a95f | 172 | export GRPC_PYTHON_BUILD_SYSTEM_RE2=1 |
f872612c JB |
173 | export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 |
174 | ||
f872612c JB |
175 | %if %{with python3} |
176 | %py3_install | |
177 | %endif | |
178 | ||
179 | install -d $RPM_BUILD_ROOT%{_docdir} | |
180 | cp -pr doc $RPM_BUILD_ROOT%{_docdir}/%{name}-apidocs-%{version} | |
ed9729ac | 181 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-apidocs-%{version}/python/sphinx |
f872612c JB |
182 | |
183 | %clean | |
184 | rm -rf $RPM_BUILD_ROOT | |
185 | ||
186 | %post -p /sbin/ldconfig | |
187 | %postun -p /sbin/ldconfig | |
188 | ||
189 | %files | |
190 | %defattr(644,root,root,755) | |
191 | %doc AUTHORS CONCEPTS.md MAINTAINERS.md NOTICE.txt README.md TROUBLESHOOTING.md | |
192 | %attr(755,root,root) %{_bindir}/grpc_cpp_plugin | |
193 | %attr(755,root,root) %{_bindir}/grpc_csharp_plugin | |
194 | %attr(755,root,root) %{_bindir}/grpc_node_plugin | |
195 | %attr(755,root,root) %{_bindir}/grpc_objective_c_plugin | |
196 | %attr(755,root,root) %{_bindir}/grpc_php_plugin | |
197 | %attr(755,root,root) %{_bindir}/grpc_python_plugin | |
198 | %attr(755,root,root) %{_bindir}/grpc_ruby_plugin | |
199 | %attr(755,root,root) %{_libdir}/libgpr.so.*.*.* | |
ed9729ac | 200 | %attr(755,root,root) %ghost %{_libdir}/libgpr.so.25 |
f872612c | 201 | %attr(755,root,root) %{_libdir}/libgrpc.so.*.*.* |
ed9729ac | 202 | %attr(755,root,root) %ghost %{_libdir}/libgrpc.so.25 |
f872612c | 203 | %attr(755,root,root) %{_libdir}/libgrpc_plugin_support.so.*.*.* |
ed9729ac | 204 | %attr(755,root,root) %ghost %{_libdir}/libgrpc_plugin_support.so.1.47 |
f872612c | 205 | %attr(755,root,root) %{_libdir}/libgrpc_unsecure.so.*.*.* |
ed9729ac | 206 | %attr(755,root,root) %ghost %{_libdir}/libgrpc_unsecure.so.25 |
f872612c | 207 | %attr(755,root,root) %{_libdir}/libgrpc++.so.*.*.* |
ed9729ac | 208 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++.so.1.47 |
f872612c | 209 | %attr(755,root,root) %{_libdir}/libgrpc++_alts.so.*.*.* |
ed9729ac | 210 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_alts.so.1.47 |
f872612c | 211 | %attr(755,root,root) %{_libdir}/libgrpc++_error_details.so.*.*.* |
ed9729ac | 212 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_error_details.so.1.47 |
f872612c | 213 | %attr(755,root,root) %{_libdir}/libgrpc++_reflection.so.*.*.* |
ed9729ac | 214 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_reflection.so.1.47 |
f872612c | 215 | %attr(755,root,root) %{_libdir}/libgrpc++_unsecure.so.*.*.* |
ed9729ac | 216 | %attr(755,root,root) %ghost %{_libdir}/libgrpc++_unsecure.so.1.47 |
f872612c | 217 | %attr(755,root,root) %{_libdir}/libgrpcpp_channelz.so.*.*.* |
ed9729ac | 218 | %attr(755,root,root) %ghost %{_libdir}/libgrpcpp_channelz.so.1.47 |
f872612c JB |
219 | # TODO: use system libs instead |
220 | %attr(755,root,root) %{_libdir}/libaddress_sorting.so.*.*.* | |
ed9729ac | 221 | %attr(755,root,root) %ghost %{_libdir}/libaddress_sorting.so.25 |
f872612c | 222 | %attr(755,root,root) %{_libdir}/libupb.so.*.*.* |
ed9729ac | 223 | %attr(755,root,root) %ghost %{_libdir}/libupb.so.25 |
f872612c JB |
224 | %{_datadir}/grpc |
225 | ||
226 | %files devel | |
227 | %defattr(644,root,root,755) | |
228 | %attr(755,root,root) %{_libdir}/libgpr.so | |
229 | %attr(755,root,root) %{_libdir}/libgrpc.so | |
230 | %attr(755,root,root) %{_libdir}/libgrpc_plugin_support.so | |
231 | %attr(755,root,root) %{_libdir}/libgrpc_unsecure.so | |
232 | %attr(755,root,root) %{_libdir}/libgrpc++.so | |
233 | %attr(755,root,root) %{_libdir}/libgrpc++_alts.so | |
234 | %attr(755,root,root) %{_libdir}/libgrpc++_error_details.so | |
235 | %attr(755,root,root) %{_libdir}/libgrpc++_reflection.so | |
236 | %attr(755,root,root) %{_libdir}/libgrpc++_unsecure.so | |
237 | %attr(755,root,root) %{_libdir}/libgrpcpp_channelz.so | |
238 | %attr(755,root,root) %{_libdir}/libaddress_sorting.so | |
239 | %attr(755,root,root) %{_libdir}/libupb.so | |
240 | %{_includedir}/grpc | |
241 | %{_includedir}/grpc++ | |
242 | %{_includedir}/grpcpp | |
243 | %{_libdir}/cmake/grpc | |
244 | %{_pkgconfigdir}/gpr.pc | |
245 | %{_pkgconfigdir}/grpc.pc | |
246 | %{_pkgconfigdir}/grpc_unsecure.pc | |
247 | %{_pkgconfigdir}/grpc++.pc | |
248 | %{_pkgconfigdir}/grpc++_unsecure.pc | |
249 | ||
250 | %files apidocs | |
251 | %defattr(644,root,root,755) | |
252 | %{_docdir}/%{name}-apidocs-%{version} | |
253 | ||
f872612c JB |
254 | %if %{with python3} |
255 | %files -n python3-grpcio | |
256 | %defattr(644,root,root,755) | |
257 | %dir %{py3_sitedir}/grpc | |
258 | %{py3_sitedir}/grpc/*.py | |
259 | %{py3_sitedir}/grpc/__pycache__ | |
260 | %dir %{py3_sitedir}/grpc/_cython | |
261 | %attr(755,root,root) %{py3_sitedir}/grpc/_cython/cygrpc.cpython-*.so | |
262 | %{py3_sitedir}/grpc/_cython/__init__.py | |
263 | %{py3_sitedir}/grpc/_cython/__pycache__ | |
264 | %{py3_sitedir}/grpc/_cython/_credentials | |
265 | %{py3_sitedir}/grpc/_cython/_cygrpc | |
d528a95f | 266 | %{py3_sitedir}/grpc/aio |
f872612c JB |
267 | %{py3_sitedir}/grpc/beta |
268 | %{py3_sitedir}/grpc/experimental | |
269 | %{py3_sitedir}/grpc/framework | |
270 | %{py3_sitedir}/grpcio-%{version}-py*.egg-info | |
271 | %endif | |
272 | ||
273 | %if %{with apidocs} | |
53fc12f4 | 274 | %files -n python3-grpcio-apidocs |
f872612c JB |
275 | %defattr(644,root,root,755) |
276 | %doc doc/python/sphinx/_build/html/{_static,*.html,*.js} | |
277 | %endif |