summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-06-20 02:57:22 +0000
committerCoprDistGit <infra@openeuler.org>2023-06-20 02:57:22 +0000
commitabfb6098a6be4cc99402fe3ba8d6c5c9c2205cb1 (patch)
tree70c5455a89b843425bef102fa69668d82292a0bb
parent548bcde539b9745dc1919efaa9519b30dacbbe22 (diff)
automatic import of grpcopeneuler23.03
-rw-r--r--.gitignore1
-rw-r--r--add-secure-compile-option-in-Makefile.patch32
-rw-r--r--grpc.spec224
-rw-r--r--repair-pkgconfig-path.patch34
-rw-r--r--sources1
5 files changed, 292 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..04fbf47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/grpc-1.50.1.tar.gz
diff --git a/add-secure-compile-option-in-Makefile.patch b/add-secure-compile-option-in-Makefile.patch
new file mode 100644
index 0000000..4926838
--- /dev/null
+++ b/add-secure-compile-option-in-Makefile.patch
@@ -0,0 +1,32 @@
+From:bitcoffee<854182924@qq.com>
+Reason:add-secure-compile-option-in-Makefile
+base on author:zhuchunyi commit:b00721fa
+diff -urN grpc/CMakeLists.txt grpc_new/CMakeLists.txt
+--- grpc/CMakeLists.txt 2020-08-24 09:14:14.361862041 +0800
++++ grpc_new/CMakeLists.txt 2020-08-27 15:36:51.498277936 +0800
+@@ -225,6 +226,9 @@
+ endif()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2")
++set(_gRPC_ALLTARGETS_LIBRARYIES "${_gRPC_ALLTARGETS_LIBRARYIES} -Wl,-z,relro -Wl,-z,now -pie")
+
+ if(gRPC_USE_PROTO_LITE)
+ set(_gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf-lite")
+
+diff --git a/Makefile b/Makefile
+index 6ede6e34d2..d6190ecde4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -478,6 +478,10 @@ LDFLAGS += $(EXTRA_LDFLAGS)
+ DEFINES += $(EXTRA_DEFINES)
+ LDLIBS += $(EXTRA_LDLIBS)
+
++CFLAGS += -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2
++CPPFLAGS += -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2
++LDFLAGS += -Wl,-z,relro -Wl,-z,now -pie
++
+ HOST_CPPFLAGS += $(CPPFLAGS)
+ HOST_CFLAGS += $(CFLAGS)
+ HOST_CXXFLAGS += $(CXXFLAGS)
diff --git a/grpc.spec b/grpc.spec
new file mode 100644
index 0000000..b0bc03b
--- /dev/null
+++ b/grpc.spec
@@ -0,0 +1,224 @@
+%global c_so_version 28
+%global cpp_so_version 1.50
+
+Name: grpc
+Version: 1.50.1
+Release: 1
+Summary: A modern, open source high performance RPC framework that can run in any environment
+License: ASL 2.0
+URL: https://www.grpc.io
+Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz
+
+Patch0006: repair-pkgconfig-path.patch
+Patch0007: add-secure-compile-option-in-Makefile.patch
+
+BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler
+BuildRequires: openssl-devel c-ares-devel gtest-devel zlib-devel gperftools-devel
+BuildRequires: python3-devel python3-setuptools python3-Cython
+BuildRequires: cmake >= 3.13.0
+BuildRequires: pkgconfig(re2)
+BuildRequires: abseil-cpp-devel
+Requires: protobuf-compiler
+
+%description
+gRPC is a modern open source high performance RPC framework that can run in any environment.
+It can efficiently connect services in and across data centers with pluggable support for
+load balancing, tracing, health checking and authentication. It is also applicable in last
+mile of distributed computing to connect devices, mobile applications and browsers to backend services.
+
+%package devel
+Summary: gRPC library development files
+Requires: %{name} = %{version}-%{release}
+Requires: pkgconfig(re2)
+Requires: abseil-cpp-devel
+
+%description devel
+Development headers and files for gRPC libraries.
+
+%package plugins
+Summary: Protocol buffers compiler plugins for gRPC
+# License: same as base package
+Requires: grpc = %{version}-%{release}
+Requires: protobuf-compiler
+
+%description plugins
+Plugins to the protocol buffers compiler to generate gRPC sources.
+
+%package -n python3-grpcio
+Summary: Python3 language bindings for gRPC
+Requires: %{name} = %{version}-%{release}
+%{?python_provide:%python_provide python3-%{pypi_name}}
+
+%description -n python3-grpcio
+Python3 bindings for gRPC.
+
+%prep
+%autosetup -p1 -n %{name}-%{version}
+sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:' Makefile
+sed -i 's:$(prefix)/lib:$(prefix)/%{_lib}:' Makefile
+sed -i 's:^GTEST_LIB =.*::' Makefile
+#avoid downloading
+mkdir %{_builddir}/%{name}-%{version}/third_party/opencensus-proto/src
+
+%build
+mkdir -p cmake/build
+cd cmake/build
+cmake ../../ -DgRPC_INSTALL=ON\
+ -DgRPC_CARES_PROVIDER=package \
+ -DgRPC_PROTOBUF_PROVIDER=package \
+ -DgRPC_SSL_PROVIDER=package \
+ -DgRPC_ZLIB_PROVIDER=package \
+ -DgRPC_RE2_PROVIDER=package \
+ -DgRPC_ABSL_PROVIDER=package \
+ -DgRPC_INSTALL_LIBDIR=%{buildroot}%{_libdir} \
+ -DgRPC_INSTALL_BINDIR=%{buildroot}%{_bindir} \
+ -DgRPC_INSTALL_INCLUDEDIR=%{buildroot}%{_includedir} \
+ -DgRPC_INSTALL_CMAKEDIR=%{buildroot}%{_prefix}/lib/cmake/%{name} \
+ -DgRPC_INSTALL_SHAREDIR=%{buildroot}%{_datadir}/%{name} \
+ -DgRPC_INSTALL_PKGCONFIGDIR=%{buildroot}%{_libdir}/pkgconfig \
+ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ -DBUILD_SHARED_LIBS=ON \
+ -DCMAKE_VERBOSE_MAKEFILE=ON
+make -j24 V=1
+
+# build python module
+export GRPC_PYTHON_BUILD_WITH_CYTHON=True
+export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True
+export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True
+export GRPC_PYTHON_BUILD_SYSTEM_CARES=True
+export GRPC_PYTHON_BUILD_SYSTEM_RE2=True
+export GRPC_PYTHON_BUILD_SYSTEM_ABSL=True
+export CFLAGS="%optflags"
+cd ../..
+%py3_build
+
+%install
+cd cmake/build
+make install/local
+rm -rf %{buildroot}%{_prefix}/lib
+
+%delete_la_and_a
+cd ../..
+%py3_install
+
+%ldconfig_scriptlets
+
+%files
+%defattr(-,root,root)
+%doc README.md
+%license LICENSE
+
+%{_datadir}/%{name}
+%{_libdir}/libaddress_sorting.so.%{c_so_version}*
+%{_libdir}/libgpr.so.%{c_so_version}*
+%{_libdir}/libgrpc.so.%{c_so_version}*
+%{_libdir}/libgrpc_unsecure.so.%{c_so_version}*
+%{_libdir}/libupb.so.%{c_so_version}*
+%{_libdir}/libgrpc++.so.%{cpp_so_version}*
+%{_libdir}/libgrpc++_alts.so.%{cpp_so_version}*
+%{_libdir}/libgrpc++_error_details.so.%{cpp_so_version}*
+%{_libdir}/libgrpc++_reflection.so.%{cpp_so_version}*
+%{_libdir}/libgrpc++_unsecure.so.%{cpp_so_version}*
+%{_libdir}/libgrpc_plugin_support.so.%{cpp_so_version}*
+%{_libdir}/libgrpcpp_channelz.so.%{cpp_so_version}*
+
+%files plugins
+%{_bindir}/grpc_*_plugin
+
+%files devel
+%defattr(-,root,root)
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*
+%{_includedir}/grpc
+%{_includedir}/grpc++
+%{_includedir}/grpcpp
+
+%files -n python3-grpcio
+%defattr(-,root,root)
+%{python3_sitearch}/grpc
+%{python3_sitearch}/grpcio-%{version}-py*
+
+%changelog
+* Fri Nov 11 2022 zhouyihang <zhouyihang3@h-partners.com> - 1.50.1-1
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:upgrade grpc to 1.50.1
+
+* Thu Oct 20 2022 zhouyihang <zhouyihang3@h-partners.com> - 1.41.1-4
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:add some secure compilation options
+
+* Sat Apr 16 2022 xingwei <xingwei14@h-partners.com> - 1.41.1-3
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:delete useless so files
+
+* Wed Mar 30 2022 xihaochen <xihaochen@h-partners.com> - 1.41.1-2
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:remove gflags
+
+* Tue Mar 29 2022 xihaochen <xihaochen@h-partners.com> - 1.41.1-1
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:update grpc to 1.41.1
+
+* Mon Jul 19 2021 lijingyuan <lijingyuan3@huawei.com> - 1.31.0-6
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:cancel gdb in buildrequires
+
+* Tue Jul 06 2021 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-5
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:separate abseil-cpp from grpc source
+
+* Wed Jun 23 2021 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-4
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:delete benchmark and googletest sources in grpc and rebase to 1.31.0-4
+
+* Wed Dec 09 2020 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-2
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:separate re2 from grpc source
+
+* Fri Aug 28 2020 liuxin <liuxin264@huawei.com> - 1.31.0-1
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:update grpc version to 1.31.0
+
+* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 1.28.1-3
+- rebuild for package build and clarify last changelog info
+
+* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-2
+- Type:rebuild
+- ID:NA
+- SUG:NA
+- DESC:update to 1.28.2
+
+* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-1
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:update to 1.28.1
+
+* Fri Mar 20 2020 songnannan <songnannan2@huawei.com> - 1.22.0-3
+- add gdb in buildrequires
+
+* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.22.0-2
+- Delete unused patch
+
+* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.22.0-1
+- Package init
diff --git a/repair-pkgconfig-path.patch b/repair-pkgconfig-path.patch
new file mode 100644
index 0000000..283a842
--- /dev/null
+++ b/repair-pkgconfig-path.patch
@@ -0,0 +1,34 @@
+From: bitcoffee<854182924@qq.com>
+Reason: pkgconfig install path write dead in the file, modify it
+diff -urN grpc/cmake/pkg-config-template.pc.in grpc_new/cmake/pkg-config-template.pc.in
+--- grpc/cmake/pkg-config-template.pc.in 2020-08-21 14:34:20.512037605 +0800
++++ grpc_new/cmake/pkg-config-template.pc.in 2020-08-27 20:47:46.372035834 +0800
+@@ -1,7 +1,7 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ includedir=${prefix}/include
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/lib64
+
+ Name: @PC_NAME@
+ Description: @PC_DESCRIPTION@
+diff -urN grpc/CMakeLists.txt grpc_new/CMakeLists.txt
+--- grpc/CMakeLists.txt 2020-08-24 09:14:14.361862041 +0800
++++ grpc_new/CMakeLists.txt 2020-08-27 14:50:00.371507303 +0800
+@@ -42,6 +42,7 @@
+ set(gRPC_INSTALL_CMAKEDIR "lib/cmake/${PACKAGE_NAME}" CACHE STRING "Installation directory for cmake config files")
+ set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for root certificates")
+ set(gRPC_BUILD_MSVC_MP_COUNT 0 CACHE STRING "The maximum number of processes for MSVC /MP option")
++set(gRPC_INSTALL_PKGCONFIGDIR "lib/pkgconfig" CACHE STRING "Installation directory for pkgconfig")
+
+ # Options
+ option(gRPC_BUILD_TESTS "Build tests" OFF)
+@@ -15666,7 +15667,7 @@
+ "${output_filepath}"
+ @ONLY)
+ install(FILES "${output_filepath}"
+- DESTINATION "${gRPC_INSTALL_LIBDIR}/pkgconfig")
++ DESTINATION ${gRPC_INSTALL_PKGCONFIGDIR})
+ endfunction()
+
+ # gpr .pc file
diff --git a/sources b/sources
new file mode 100644
index 0000000..98d19f0
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+4dcc2606d8bbd9dc9b433be816af6211 grpc-1.50.1.tar.gz