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