From d5e71c38dbd6bbb47e76c99fd398d6c3a44feb08 Mon Sep 17 00:00:00 2001 From: JinWang An Date: Fri, 3 Dec 2021 11:24:52 +0900 Subject: [PATCH] Bump to grpc 1.42.0 Change-Id: Id4ca0580e3de33260c54113fc4cd3488d0c35477 Signed-off-by: JinWang An --- packaging/grpc.manifest | 5 ++ packaging/grpc.spec | 132 ++++++++++++++++++++++++++++++++ packaging/support_lib64_directory.patch | 34 ++++++++ 3 files changed, 171 insertions(+) create mode 100644 packaging/grpc.manifest create mode 100644 packaging/grpc.spec create mode 100644 packaging/support_lib64_directory.patch diff --git a/packaging/grpc.manifest b/packaging/grpc.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/grpc.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/grpc.spec b/packaging/grpc.spec new file mode 100644 index 0000000..d311631 --- /dev/null +++ b/packaging/grpc.spec @@ -0,0 +1,132 @@ +# +# spec file for package grpc +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define lname libgrpc +%define src_install_dir /usr/src/%{name} +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: grpc +Version: 1.42.0 +Release: 0 +Summary: HTTP/2-based Remote Procedure Call implementation +License: Apache-2.0 +Group: Development/Tools/Building +Url: http://grpc.io/ +Source: https://github.com/grpc/grpc/archive/v%{version}.tar.gz +Source1001: grpc.manifest +Source10: support_lib64_directory.patch + +BuildRequires: python-cython +BuildRequires: python-devel +BuildRequires: python-setuptools +# BuildRequires: python-rpm-macros +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: pkg-config +BuildRequires: pkgconfig(libcares) +BuildRequires: pkgconfig(openssl1.1) >= 1.0.1 +BuildRequires: pkgconfig(protobuf) >= 3.5 +BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(re2) +BuildRequires: abseil-cpp-devel + +%description +The reference implementation of the gRPC protocol, done on top of +HTTP/2 with support for synchronous and asynchronous calls. gRPC uses +Protocol Buffers as the Interface Definition Language by default. + +%package -n %lname +Summary: HTTP/2-based Remote Procedure Call implementation +Group: System/Libraries + +%description -n %lname +The reference implementation of the gRPC protocol, done on top of +HTTP/2 with support for synchronous and asynchronous calls. gRPC uses +Protocol Buffers as the Interface Definition Language by default. + +%package devel +Summary: Development files for grpc, a HTTP/2 Remote Procedure Call implementation +Group: Development/Tools/Building +Requires: abseil-cpp-devel +Requires: %lname = %version +Requires: pkgconfig(libcares) +Requires: pkgconfig(protobuf) +Requires: pkgconfig(re2) + +%description devel +This subpackage contains libraries and header files for developing +applications that want to make use of the gRPC reference implementation. + +%prep +%setup -q +cp %{SOURCE1001} . +%{__patch} -p1 < %{SOURCE10} + +%build +CFLAGS+=" -Wno-error -Wno-unused-parameter" +CXXFLAGS+=" -Wno-error -Wno-unused-parameter" + + +mkdir -p cmake/build +cd cmake/build +%{__cmake} ../.. -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_C_FLAGS="%{optflags} -fPIC" \ + -DCMAKE_CXX_FLAGS="%{optflags} -fPIC" \ + -DCMAKE_EXE_LINKER_FLAGS=" -pie" \ + -DINCLUDE_INSTALL_DIR=%{_includedir} \ + -DLIB_INSTALL_DIR=%{_libdir} \ + -DBUILD_SHARED_LIBS=ON \ + -DgRPC_INSTALL=ON \ + -DgRPC_ABSL_PROVIDER=package \ + -DgRPC_CARES_PROVIDER=package \ + -DgRPC_RE2_PROVIDER=package \ + -DgRPC_PROTOBUF_PROVIDER=package \ + -DgRPC_SSL_PROVIDER=package \ + -DgRPC_ZLIB_PROVIDER=package + +%{__make} %{?_smp_mflags} + +%install +cd cmake/build +%{__make} install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p" + +rm -rf %{buildroot}%{_libdir}/cmake +rm -rf %{buildroot}%{_datadir}/grpc/roots.pem + +%post -n %lname -p /sbin/ldconfig +%postun -n %lname -p /sbin/ldconfig + +%files -n %lname +%defattr(-,root,root) +%_libdir/libaddress_sorting.so.* +%_libdir/libupb.so.* +%_libdir/libgpr*.so.* +%_libdir/libgrpc*.so.* + +%files devel +%defattr(-,root,root) +%license LICENSE +%_bindir/* +%_includedir/* +%_libdir/pkgconfig/gpr.pc +%_libdir/pkgconfig/grpc++.pc +%_libdir/pkgconfig/grpc.pc +%_libdir/pkgconfig/grpc++_unsecure.pc +%_libdir/pkgconfig/grpc_unsecure.pc +%_libdir/*.so + +%changelog diff --git a/packaging/support_lib64_directory.patch b/packaging/support_lib64_directory.patch new file mode 100644 index 0000000..e32b9b9 --- /dev/null +++ b/packaging/support_lib64_directory.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 82488660..9a88bba0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -38,9 +38,9 @@ set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") + project(${PACKAGE_NAME} LANGUAGES C CXX) + + set(gRPC_INSTALL_BINDIR "bin" CACHE STRING "Installation directory for executables") +-set(gRPC_INSTALL_LIBDIR "lib" CACHE STRING "Installation directory for libraries") ++set(gRPC_INSTALL_LIBDIR "${LIB_INSTALL_DIR}" CACHE STRING "Installation directory for libraries") + set(gRPC_INSTALL_INCLUDEDIR "include" CACHE STRING "Installation directory for headers") +-set(gRPC_INSTALL_CMAKEDIR "lib/cmake/${PACKAGE_NAME}" CACHE STRING "Installation directory for cmake config files") ++set(gRPC_INSTALL_CMAKEDIR "${LIB_INSTALL_DIR}/cmake/${PACKAGE_NAME}" CACHE STRING "Installation directory for cmake config files") + set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for root certificates") + + # Options +@@ -17262,7 +17262,7 @@ function(generate_pkgconfig name description version requires + "${output_filepath}" + @ONLY) + install(FILES "${output_filepath}" +- DESTINATION "lib/pkgconfig/") ++ DESTINATION "${LIB_INSTALL_DIR}/pkgconfig/") + endfunction() + + # gpr .pc file +@@ -17280,7 +17280,7 @@ generate_pkgconfig( + "gRPC" + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" +- "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" ++ "gpr openssl1.1 absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" + "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" + "" + "grpc.pc") -- 2.7.4