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