]> git.pld-linux.org Git - packages/grpc.git/blame - grpc.spec
- unconditional noarch subpackages
[packages/grpc.git] / grpc.spec
CommitLineData
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#
10Summary: RPC library and framework
11Summary(pl.UTF-8): Biblioteka i szkielet RPC
12Name: grpc
d528a95f 13Version: 1.32.0
c2f1a277 14Release: 3
f872612c
JB
15License: Apache v2.0
16Group: Libraries
17#Source0Download: https://github.com/grpc/grpc/releases
18Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz
d528a95f 19# Source0-md5: e2afa783e763d5f6bc09b664b907ff25
f872612c
JB
20Patch0: %{name}-system-absl.patch
21Patch1: %{name}-sphinx.patch
321e5c15
JB
22Patch2: %{name}-x32.patch
23Patch3: %{name}-libdir.patch
d528a95f 24Patch4: %{name}-system-re2.patch
c3c2ad9f 25Patch5: %{name}-system-openssl.patch
f872612c
JB
26URL: https://grpc.io/
27BuildRequires: abseil-cpp-devel
28BuildRequires: c-ares-devel >= 1.13.0
29BuildRequires: cmake >= 3.5.1
30BuildRequires: libstdc++-devel >= 6:4.7
31BuildRequires: openssl-devel
321e5c15 32BuildRequires: protobuf-devel >= 3.12
483a19e0
JB
33# with re2Config for cmake
34BuildRequires: re2-devel >= 20200801
f872612c
JB
35BuildRequires: rpm-pythonprov
36BuildRequires: rpmbuild(macros) >= 1.714
37BuildRequires: zlib-devel
38%if %{with python2}
39BuildRequires: python-Cython >= 0.23
40BuildRequires: python-modules >= 1:2.7
41%endif
42%if %{with python3}
43BuildRequires: python3-Cython >= 0.23
44BuildRequires: python3-modules >= 1:3.5
45%endif
46%if %{with apidocs}
47BuildRequires: python3-Sphinx >= 1.8.1
48BuildRequires: python3-six >= 1.10
49%endif
50BuildRoot: %{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
56gRPC is a modern, open source, high-performance remote procedure call
57(RPC) framework that can run anywhere. gRPC enables client and server
58applications to communicate transparently, and simplifies the building
59of connected systems.
60
61%description -l pl.UTF-8
62gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych
63wywołań procedur (RPC - Remote Procedure Call). Pozwala na
64przezroczystą komunikację klienta i serwera, upraszcza tworzenie
65systemów połączonych.
66
67%package devel
68Summary: Header files for gRPC library
69Summary(pl.UTF-8): Pliki nagłówkowe biblioteki gRPC
70Group: Development/Libraries
71Requires: %{name} = %{version}-%{release}
72
73%description devel
74Header files for gRPC library.
75
76%description devel -l pl.UTF-8
77Pliki nagłówkowe biblioteki gRPC.
78
79%package apidocs
80Summary: API documentation for gRPC library
81Summary(pl.UTF-8): Dokumentacja API biblioteki gRPC
82Group: Documentation
f872612c 83BuildArch: noarch
f872612c
JB
84
85%description apidocs
86API documentation for gRPC library.
87
88%description apidocs -l pl.UTF-8
89Dokumentacja API biblioteki gRPC.
90
91%package -n python-grpcio
92Summary: HTTP/2 based RPC framework
93Summary(pl.UTF-8): Szkielet RPC oparty na HTTP/2
94Group: Libraries/Python
95
96%description -n python-grpcio
97gRPC is a modern, open source, high-performance remote procedure call
98(RPC) framework that can run anywhere. gRPC enables client and server
99applications to communicate transparently, and simplifies the building
100of connected systems.
101
102%description -n python-grpcio -l pl.UTF-8
103gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych
104wywołań procedur (RPC - Remote Procedure Call). Pozwala na
105przezroczystą komunikację klienta i serwera, upraszcza tworzenie
106systemów połączonych.
107
108%package -n python3-grpcio
109Summary: HTTP/2 based RPC framework
110Summary(pl.UTF-8): Szkielet RPC oparty na HTTP/2
111Group: Libraries/Python
112
113%description -n python3-grpcio
114gRPC is a modern, open source, high-performance remote procedure call
115(RPC) framework that can run anywhere. gRPC enables client and server
116applications to communicate transparently, and simplifies the building
117of connected systems.
118
119%description -n python3-grpcio -l pl.UTF-8
120gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych
121wywołań procedur (RPC - Remote Procedure Call). Pozwala na
122przezroczystą komunikację klienta i serwera, upraszcza tworzenie
123systemów połączonych.
124
125%package -n python-grpcio-apidocs
126Summary: API documentation for Python gRPC library
127Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona gRPC
128Group: Documentation
f872612c 129BuildArch: noarch
f872612c
JB
130
131%description -n python-grpcio-apidocs
132API documentation for Python gRPC library.
133
134%description -n python-grpcio-apidocs -l pl.UTF-8
135Dokumentacja API biblioteki Pythona gRPC.
136
137%prep
138%setup -q
139%patch0 -p1
140%patch1 -p1
321e5c15
JB
141%patch2 -p1
142%patch3 -p1
d528a95f 143%patch4 -p1
c3c2ad9f 144%patch5 -p1
f872612c
JB
145
146%build
147install -d build
148cd 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}
160cd ..
161
162export GRPC_PYTHON_BUILD_SYSTEM_ABSL=1
163export GRPC_PYTHON_BUILD_SYSTEM_CARES=1
164export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
d528a95f 165export GRPC_PYTHON_BUILD_SYSTEM_RE2=1
f872612c
JB
166export 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}
174export GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD=1
175%endif
176%py3_build
177%endif
178
179%if %{with apidocs}
180sphinx-build-3 -b html doc/python/sphinx doc/python/sphinx/_build/html
181%endif
182
183%install
184rm -rf $RPM_BUILD_ROOT
185
186%{__make} -C build install \
187 DESTDIR=$RPM_BUILD_ROOT
188
189export GRPC_PYTHON_BUILD_SYSTEM_ABSL=1
190export GRPC_PYTHON_BUILD_SYSTEM_CARES=1
191export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
d528a95f 192export GRPC_PYTHON_BUILD_SYSTEM_RE2=1
f872612c
JB
193export 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
205install -d $RPM_BUILD_ROOT%{_docdir}
206cp -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
210rm -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
This page took 0.08409 seconds and 4 git commands to generate.