1%global c_so_version 19 2%global cpp_so_version 1.41 3 4Name: grpc 5Version: 1.41.1 6Release: 4 7Summary: A modern, open source high performance RPC framework that can run in any environment 8License: ASL 2.0 9URL: https://www.grpc.io 10Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz 11 12Patch0006: repair-pkgconfig-path.patch 13Patch0007: add-secure-compile-option-in-Makefile.patch 14Patch0010: backport-grpc-1.41.1-python-grpcio-use-system-abseil.patch 15 16BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler 17BuildRequires: openssl-devel c-ares-devel gtest-devel zlib-devel gperftools-devel 18BuildRequires: python3-devel python3-setuptools python3-Cython 19BuildRequires: cmake >= 3.13.0 20BuildRequires: pkgconfig(re2) 21BuildRequires: abseil-cpp-devel 22Requires: protobuf-compiler 23 24%description 25gRPC is a modern open source high performance RPC framework that can run in any environment. 26It can efficiently connect services in and across data centers with pluggable support for 27load balancing, tracing, health checking and authentication. It is also applicable in last 28mile of distributed computing to connect devices, mobile applications and browsers to backend services. 29 30%package devel 31Summary: gRPC library development files 32Requires: %{name} = %{version}-%{release} 33Requires: pkgconfig(re2) 34Requires: abseil-cpp-devel 35 36%description devel 37Development headers and files for gRPC libraries. 38 39%package plugins 40Summary: Protocol buffers compiler plugins for gRPC 41# License: same as base package 42Requires: grpc = %{version}-%{release} 43Requires: protobuf-compiler 44 45%description plugins 46Plugins to the protocol buffers compiler to generate gRPC sources. 47 48%package -n python3-grpcio 49Summary: Python3 language bindings for gRPC 50Requires: %{name} = %{version}-%{release} 51%{?python_provide:%python_provide python3-%{pypi_name}} 52 53%description -n python3-grpcio 54Python3 bindings for gRPC. 55 56%prep 57%autosetup -p1 -n %{name}-%{version} 58sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:' Makefile 59sed -i 's:$(prefix)/lib:$(prefix)/%{_lib}:' Makefile 60sed -i 's:^GTEST_LIB =.*::' Makefile 61 62%build 63mkdir -p cmake/build 64cd cmake/build 65cmake ../../ -DgRPC_INSTALL=ON\ 66 -DgRPC_CARES_PROVIDER=package \ 67 -DgRPC_PROTOBUF_PROVIDER=package \ 68 -DgRPC_SSL_PROVIDER=package \ 69 -DgRPC_ZLIB_PROVIDER=package \ 70 -DgRPC_RE2_PROVIDER=package \ 71 -DgRPC_ABSL_PROVIDER=package \ 72 -DgRPC_INSTALL_LIBDIR=%{buildroot}%{_libdir} \ 73 -DgRPC_INSTALL_BINDIR=%{buildroot}%{_bindir} \ 74 -DgRPC_INSTALL_INCLUDEDIR=%{buildroot}%{_includedir} \ 75 -DgRPC_INSTALL_CMAKEDIR=%{buildroot}%{_prefix}/lib/cmake/%{name} \ 76 -DgRPC_INSTALL_SHAREDIR=%{buildroot}%{_datadir}/%{name} \ 77 -DgRPC_INSTALL_PKGCONFIGDIR=%{buildroot}%{_libdir}/pkgconfig \ 78 -DCMAKE_INSTALL_PREFIX=%{_prefix} \ 79 -DBUILD_SHARED_LIBS=ON \ 80 -DCMAKE_VERBOSE_MAKEFILE=ON 81make -j24 V=1 82 83# build python module 84export GRPC_PYTHON_BUILD_WITH_CYTHON=True 85export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True 86export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True 87export GRPC_PYTHON_BUILD_SYSTEM_CARES=True 88export GRPC_PYTHON_BUILD_SYSTEM_RE2=True 89export GRPC_PYTHON_BUILD_SYSTEM_ABSL=True 90export CFLAGS="%optflags" 91cd ../.. 92%py3_build 93 94%install 95cd cmake/build 96make install/local 97rm -rf %{buildroot}%{_prefix}/lib 98 99%delete_la_and_a 100cd ../.. 101%py3_install 102 103%ldconfig_scriptlets 104 105%files 106%defattr(-,root,root) 107%doc README.md 108%license LICENSE 109 110%{_datadir}/%{name} 111%{_libdir}/libaddress_sorting.so.%{c_so_version}* 112%{_libdir}/libgpr.so.%{c_so_version}* 113%{_libdir}/libgrpc.so.%{c_so_version}* 114%{_libdir}/libgrpc_unsecure.so.%{c_so_version}* 115%{_libdir}/libupb.so.%{c_so_version}* 116%{_libdir}/libgrpc++.so.%{cpp_so_version}* 117%{_libdir}/libgrpc++_alts.so.%{cpp_so_version}* 118%{_libdir}/libgrpc++_error_details.so.%{cpp_so_version}* 119%{_libdir}/libgrpc++_reflection.so.%{cpp_so_version}* 120%{_libdir}/libgrpc++_unsecure.so.%{cpp_so_version}* 121%{_libdir}/libgrpc_plugin_support.so.%{cpp_so_version}* 122%{_libdir}/libgrpcpp_channelz.so.%{cpp_so_version}* 123 124%files plugins 125%{_bindir}/grpc_*_plugin 126 127%files devel 128%defattr(-,root,root) 129%{_libdir}/*.so 130%{_libdir}/pkgconfig/* 131%{_includedir}/grpc 132%{_includedir}/grpc++ 133%{_includedir}/grpcpp 134 135%files -n python3-grpcio 136%defattr(-,root,root) 137%{python3_sitearch}/grpc 138%{python3_sitearch}/grpcio-%{version}-py?.?.egg-info 139 140%changelog 141* Thu Oct 20 2022 zhouyihang<zhouyihang3@h-partners.com> - 1.41.1-4 142- Type:bugfix 143- ID:NA 144- SUG:NA 145- DESC: add some secure compilation options 146 147* Sat Apr 16 2022 xingwei<xingwei14@h-partners.com> - 1.41.1-3 148- Type:enhancement 149- ID:NA 150- SUG:NA 151- DESC: remove gflags 152 153* Tue Mar 22 2022 gaihuiying <eaglegai@163.com> - 1.41.1-2 154- Type:bugfix 155- ID:NA 156- SUG:NA 157- DESC:delete useless so files 158 159* Mon Dec 27 2021 gaihuiying <gaihuiying1@huawei.com> - 1.41.1-1 160- Type:requirement 161- ID:NA 162- SUG:NA 163- DESC:update grpc to 1.41.1 164 165* Mon Jul 19 2021 lijingyuan <lijingyuan3@huawei.com> - 1.31.0-6 166- Type:requirement 167- ID:NA 168- SUG:NA 169- DESC:cancel gdb in buildrequires 170 171* Tue Jul 06 2021 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-5 172- Type:requirement 173- ID:NA 174- SUG:NA 175- DESC:separate abseil-cpp from grpc source 176 177* Wed Jun 23 2021 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-4 178- Type:requirement 179- ID:NA 180- SUG:NA 181- DESC:delete benchmark and googletest sources in grpc and rebase to 1.31.0-4 182 183* Wed Dec 09 2020 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-2 184- Type:requirement 185- ID:NA 186- SUG:NA 187- DESC:separate re2 from grpc source 188 189* Fri Aug 28 2020 liuxin <liuxin264@huawei.com> - 1.31.0-1 190- Type:requirement 191- ID:NA 192- SUG:NA 193- DESC:update grpc version to 1.31.0 194 195* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 1.28.1-3 196- rebuild for package build and clarify last changelog info 197 198* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-2 199- Type:rebuild 200- ID:NA 201- SUG:NA 202- DESC:update to 1.28.2 203 204* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-1 205- Type:requirement 206- ID:NA 207- SUG:NA 208- DESC:update to 1.28.1 209 210* Fri Mar 20 2020 songnannan <songnannan2@huawei.com> - 1.22.0-3 211- add gdb in buildrequires 212 213* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.22.0-2 214- Delete unused patch 215 216* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.22.0-1 217- Package init 218