diff --git a/0001-cxx-Arg-List-Too-Long.patch b/0001-cxx-Arg-List-Too-Long.patch index 8bcdd3a01e7b5edf28cb9e27ca387e69be3472f0..715d775aad3bc2a799ce256ee2be86d33f52e954 100644 --- a/0001-cxx-Arg-List-Too-Long.patch +++ b/0001-cxx-Arg-List-Too-Long.patch @@ -1,8 +1,8 @@ diff --git a/Makefile b/Makefile -index 736583fd93..9bbf162987 100644 +index e8635eda2d..6ede6e34d2 100644 --- a/Makefile +++ b/Makefile -@@ -2962,6 +2962,14 @@ install-headers_cxx: +@@ -3009,6 +3009,14 @@ install-headers_cxx: $(E) "[INSTALL] Installing public C++ headers" $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 @@ -17,34 +17,34 @@ index 736583fd93..9bbf162987 100644 install-static: install-static_c install-static_cxx -@@ -5429,6 +5437,8 @@ PUBLIC_HEADERS_CXX += \ - include/grpc/impl/codegen/propagation_bits.h \ - include/grpc/impl/codegen/slice.h \ - include/grpc/impl/codegen/status.h \ +@@ -5518,6 +5526,8 @@ PUBLIC_HEADERS_CXX += \ + include/grpc++/support/stub_options.h \ + include/grpc++/support/sync_stream.h \ + include/grpc++/support/time.h \ + -+PUBLIC_HEADERS_CXX3 += \ - include/grpc++/impl/codegen/async_stream.h \ - include/grpc++/impl/codegen/async_unary_call.h \ - include/grpc++/impl/codegen/byte_buffer.h \ -@@ -5970,6 +5980,8 @@ PUBLIC_HEADERS_CXX += \ - include/grpcpp/support/stub_options.h \ ++PUBLIC_HEADERS_CXX1 += \ + include/grpcpp/alarm.h \ + include/grpcpp/alarm_impl.h \ + include/grpcpp/channel.h \ +@@ -5588,6 +5598,8 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/support/sync_stream.h \ include/grpcpp/support/time.h \ + include/grpcpp/support/validate_service_config.h \ + +PUBLIC_HEADERS_CXX2 += \ include/grpc/support/alloc.h \ include/grpc/support/atm.h \ include/grpc/support/atm_gcc_atomic.h \ -@@ -6823,6 +6835,8 @@ PUBLIC_HEADERS_CXX += \ - include/grpc++/support/stub_options.h \ - include/grpc++/support/sync_stream.h \ - include/grpc++/support/time.h \ +@@ -5639,6 +5651,8 @@ PUBLIC_HEADERS_CXX += \ + include/grpc/impl/codegen/propagation_bits.h \ + include/grpc/impl/codegen/slice.h \ + include/grpc/impl/codegen/status.h \ + -+PUBLIC_HEADERS_CXX1 += \ - include/grpcpp/alarm.h \ - include/grpcpp/channel.h \ - include/grpcpp/client_context.h \ -@@ -6953,6 +6967,8 @@ PUBLIC_HEADERS_CXX += \ ++PUBLIC_HEADERS_CXX3 += \ + include/grpc++/impl/codegen/async_stream.h \ + include/grpc++/impl/codegen/async_unary_call.h \ + include/grpc++/impl/codegen/byte_buffer.h \ +@@ -5669,6 +5683,8 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/impl/codegen/stub_options.h \ include/grpc++/impl/codegen/sync_stream.h \ include/grpc++/impl/codegen/time.h \ diff --git a/0001-enforce-system-crypto-policies.patch b/0001-enforce-system-crypto-policies.patch index 10f41d72a16a3363add2450b25089dcee89ae4c3..a5b979501fb632961910e79b54d9ab0f05efd5ec 100644 --- a/0001-enforce-system-crypto-policies.patch +++ b/0001-enforce-system-crypto-policies.patch @@ -1,6 +1,6 @@ -From dfd09ced8657f7b3eac79038418fc5a452c396d6 Mon Sep 17 00:00:00 2001 +From 7bf606ebe95c0eb0d9d7d55614b22ea6288d0598 Mon Sep 17 00:00:00 2001 From: Sergey Avseyev -Date: Wed, 28 Nov 2018 18:53:22 +0300 +Date: Sat, 21 Dec 2019 18:52:54 +0800 Subject: [PATCH] enforce system crypto policies --- @@ -9,7 +9,7 @@ Subject: [PATCH] enforce system crypto policies 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/core/handshake/client_ssl.cc b/test/core/handshake/client_ssl.cc -index 467df6e229..b31934e51b 100644 +index 467df6e..b31934e 100644 --- a/test/core/handshake/client_ssl.cc +++ b/test/core/handshake/client_ssl.cc @@ -161,8 +161,7 @@ static void server_thread(void* arg) { @@ -23,7 +23,7 @@ index 467df6e229..b31934e51b 100644 ERR_print_errors_fp(stderr); gpr_log(GPR_ERROR, "Couldn't set server cipher list."); diff --git a/test/core/handshake/server_ssl_common.cc b/test/core/handshake/server_ssl_common.cc -index 41b2829d8b..8b21ea7c73 100644 +index 41b2829..8b21ea7 100644 --- a/test/core/handshake/server_ssl_common.cc +++ b/test/core/handshake/server_ssl_common.cc @@ -167,8 +167,7 @@ bool server_ssl_test(const char* alpn_list[], unsigned int alpn_list_len, diff --git a/grpc-add-secure-compile-option-in-Makefile.patch b/0002-add-secure-compile-option-in-Makefile.patch similarity index 30% rename from grpc-add-secure-compile-option-in-Makefile.patch rename to 0002-add-secure-compile-option-in-Makefile.patch index 469adeb65935040c324f28fe65794dedc7391ea2..40010cb67df457efb5eb6565b90bb79d825af0a3 100644 --- a/grpc-add-secure-compile-option-in-Makefile.patch +++ b/0002-add-secure-compile-option-in-Makefile.patch @@ -1,18 +1,15 @@ diff --git a/Makefile b/Makefile -index d4ed255..1172aa1 100644 +index 6ede6e34d2..d6190ecde4 100644 --- a/Makefile +++ b/Makefile -@@ -456,6 +456,10 @@ LDFLAGS += $(EXTRA_LDFLAGS) +@@ -478,6 +478,10 @@ LDFLAGS += $(EXTRA_LDFLAGS) DEFINES += $(EXTRA_DEFINES) LDLIBS += $(EXTRA_LDLIBS) -+CFLAGS += -fPIE -+CPPFLAGS += -fstack-protector-strong -+LDFLAGS += -pie ++CFLAGS += -Wl,-z,now -fPIE -fPIC ++CPPFLAGS += -Wl,-z,now -fstack-protector-strong ++LDFLAGS += -Wl,-z,now -pie + - HOST_CPPFLAGS = $(CPPFLAGS) - HOST_CFLAGS = $(CFLAGS) - HOST_CXXFLAGS = $(CXXFLAGS) --- -2.19.1 - + HOST_CPPFLAGS += $(CPPFLAGS) + HOST_CFLAGS += $(CFLAGS) + HOST_CXXFLAGS += $(CXXFLAGS) diff --git a/0002-patch-from-15532.patch b/0002-patch-from-15532.patch index 5f43394e81015f8f6c0e2fd8ce06622d64896001..7d04671475a3183c53f5f09c93a7357bc70354ca 100644 --- a/0002-patch-from-15532.patch +++ b/0002-patch-from-15532.patch @@ -1,6 +1,6 @@ -From d75addf6b5ef94ba9f6b5684523a587c6dc35ccb Mon Sep 17 00:00:00 2001 +From 63c843f040cd5e9503bdcdf9b3285ef371bcadb6 Mon Sep 17 00:00:00 2001 From: Sergey Avseyev -Date: Fri, 16 Nov 2018 15:03:30 +0300 +Date: Sat, 21 Dec 2019 19:05:23 +0800 Subject: [PATCH] patch from #15532 --- @@ -8,7 +8,7 @@ Subject: [PATCH] patch from #15532 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile -index 8469a5fd50..0d06d1fc29 100644 +index 51a355b..9abd5df 100644 --- a/Makefile +++ b/Makefile @@ -348,7 +348,7 @@ HOST_LD ?= $(LD) @@ -20,7 +20,7 @@ index 8469a5fd50..0d06d1fc29 100644 ifeq ($(SYSTEM),Darwin) CXXFLAGS += -stdlib=libc++ endif -@@ -7899,7 +7899,7 @@ LIBBORINGSSL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename +@@ -8304,7 +8304,7 @@ LIBBORINGSSL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBBORINGSSL_OBJS): CPPFLAGS += -Ithird_party/boringssl/include -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX $(LIBBORINGSSL_OBJS): CXXFLAGS += -fno-rtti -fno-exceptions @@ -29,7 +29,7 @@ index 8469a5fd50..0d06d1fc29 100644 $(LIBDIR)/$(CONFIG)/libboringssl.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBBORINGSSL_OBJS) $(E) "[AR] Creating $@" -@@ -10094,7 +10094,7 @@ PUBLIC_HEADERS_C += \ +@@ -8548,7 +8548,7 @@ PUBLIC_HEADERS_C += \ LIBARES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBARES_SRC)))) $(LIBARES_OBJS): CPPFLAGS += -Ithird_party/cares -Ithird_party/cares/cares -fvisibility=hidden -D_GNU_SOURCE $(if $(subst Darwin,,$(SYSTEM)),,-Ithird_party/cares/config_darwin) $(if $(subst FreeBSD,,$(SYSTEM)),,-Ithird_party/cares/config_freebsd) $(if $(subst Linux,,$(SYSTEM)),,-Ithird_party/cares/config_linux) $(if $(subst OpenBSD,,$(SYSTEM)),,-Ithird_party/cares/config_openbsd) -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX $(if $(subst MINGW32,,$(SYSTEM)),-DHAVE_CONFIG_H,) diff --git a/0003-Do-not-build-the-Ruby-plugin.patch b/0003-Do-not-build-the-Ruby-plugin.patch deleted file mode 100644 index 399816dd85a0e3af5f569eb5bae50c3f80d7729b..0000000000000000000000000000000000000000 --- a/0003-Do-not-build-the-Ruby-plugin.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ad0cae3d6eb5a47e8ec0a52b78013e658aa1720b Mon Sep 17 00:00:00 2001 -From: Mathieu Bridon -Date: Mon, 17 Dec 2018 11:41:34 +0100 -Subject: [PATCH] Do not build the Ruby plugin - -Unfortunately, this can't build without protobuf 3.6, so we must disable -it for Fedora 28 and 29 which only have protobuf 3.5. ---- - Makefile | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/Makefile b/Makefile -index 066c191..09ad70a 100644 ---- a/Makefile -+++ b/Makefile -@@ -802,7 +802,7 @@ PC_LIBS_GRPCXX = - - CPPFLAGS := -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include $(CPPFLAGS) - --PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin $(BINDIR)/$(CONFIG)/grpc_ruby_plugin -+PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin - PROTOC_PLUGINS_DIR = $(BINDIR)/$(CONFIG) - - ifeq ($(HAS_SYSTEM_PROTOBUF),true) -@@ -3151,7 +3151,6 @@ install-plugins: $(PROTOC_PLUGINS) - $(Q) $(INSTALL) -d $(prefix)/bin - $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_python_plugin $(prefix)/bin/grpc_python_plugin - $(Q) $(INSTALL) -d $(prefix)/bin -- $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_ruby_plugin $(prefix)/bin/grpc_ruby_plugin - - install-grpc-cli: grpc_cli - $(E) "[INSTALL] Installing grpc cli" -@@ -7162,7 +7161,6 @@ LIBGRPC_PLUGIN_SUPPORT_SRC = \ - src/compiler/objective_c_generator.cc \ - src/compiler/php_generator.cc \ - src/compiler/python_generator.cc \ -- src/compiler/ruby_generator.cc \ - - PUBLIC_HEADERS_CXX += \ - include/grpc++/impl/codegen/config_protobuf.h \ --- -2.17.2 - diff --git a/v1.17.1.tar.gz b/grpc-1.22.0.tar.gz similarity index 62% rename from v1.17.1.tar.gz rename to grpc-1.22.0.tar.gz index 142c905592ce0836646fe97c28e4a1e06739c85c..6f230fa7852b6773c0b1275c508e366135a303b2 100644 Binary files a/v1.17.1.tar.gz and b/grpc-1.22.0.tar.gz differ diff --git a/grpc.spec b/grpc.spec index 3566fbf62ee412bef78e7503ff15f3e26d2c4707..9a244bc09d13b26e757afc8298c357b6479ca3d2 100644 --- a/grpc.spec +++ b/grpc.spec @@ -1,23 +1,26 @@ -Name: grpc -Version: 1.17.1 -Release: 5 -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}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version} - -BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler -BuildRequires: openssl-devel c-ares-devel gflags-devel gtest-devel zlib-devel gperftools-devel -BuildRequires: python3-devel python3-setuptools python3-Cython - -#patch0000 and patch0001 come from fedora -Patch0000: 0001-enforce-system-crypto-policies.patch -Patch0001: 0002-patch-from-15532.patch -# patch0002 comes from upstream community -Patch0002: 0003-Do-not-build-the-Ruby-plugin.patch -Patch9000: 0001-cxx-Arg-List-Too-Long.patch -Patch9001: grpc-add-secure-compile-option-in-Makefile.patch +Name: grpc +Version: 1.22.0 +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 + +Patch9000: 0001-cxx-Arg-List-Too-Long.patch +Patch9001: 0002-add-secure-compile-option-in-Makefile.patch + +Patch0001: 0001-enforce-system-crypto-policies.patch +Patch0002: 0002-patch-from-15532.patch + +BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler +BuildRequires: openssl-devel c-ares-devel gflags-devel gtest-devel zlib-devel gperftools-devel +BuildRequires: python3-devel python3-setuptools python3-Cython +Requires: protobuf-compiler + +Provides: %{name}-plugins = %{version}-%{release} +Provides: %{name}-cli = %{version}-%{release} +Obsoletes: %{name}-plugins < %{version}-%{release} +Obsoletes: %{name}-cli < %{version}-%{release} %description gRPC is a modern open source high performance RPC framework that can run in any environment. @@ -25,32 +28,16 @@ It can efficiently connect services in and across data centers with pluggable su 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 plugins -Summary: Compiler plugins for gRPC protoc -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: protobuf-compiler +%package devel +Summary: gRPC library development files +Requires: %{name} = %{version}-%{release} -%description plugins -With the gRPC plugin, you get generated gRPC client and server code, as well as the regular -protocol buffer code for populating, serializing, and retrievingyour message types. - -%package devel -Summary: gRPC library development files -Requires: %{name}%{?_isa} = %{version}-%{release} - -%description devel +%description devel Development headers and files for gRPC libraries. -%package cli -Summary: Cli for gRPC -Requires: %{name}%{?_isa} = %{version}-%{release} gflags - -%description cli -Provides normal cli for gRPC. - %package -n python3-grpcio -Summary: Python3 language bindings for gRPC -Requires: %{name}%{?_isa} = %{version}-%{release} +Summary: Python3 language bindings for gRPC +Requires: %{name} = %{version}-%{release} %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-grpcio @@ -58,12 +45,14 @@ Python3 bindings for gRPC. %prep %autosetup -p1 - -sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:;s:$(prefix)/lib:$(prefix)/%{_lib}:;s:^GTEST_LIB =.*::' Makefile +sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:' Makefile +sed -i 's:$(prefix)/lib:$(prefix)/%{_lib}:' Makefile +sed -i 's:^GTEST_LIB =.*::' Makefile %build %make_build shared plugins +# build python module export GRPC_PYTHON_BUILD_WITH_CYTHON=True export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True @@ -72,28 +61,27 @@ export CFLAGS="%optflags" %py3_build %install -%make_install prefix="%{buildroot}%{_prefix}" +make install prefix="%{buildroot}%{_prefix}" make install-grpc-cli prefix="%{buildroot}%{_prefix}" %delete_la_and_a %py3_install -%ldconfig_post -%ldconfig_postun +%ldconfig_scriptlets %files +%defattr(-,root,root) %doc README.md %license LICENSE -%{_libdir}/*.so.1* -%{_libdir}/*.so.7* -%{_datadir}/grpc -%files plugins +%{_bindir}/grpc_cli %{_bindir}/grpc_*_plugin -%files cli -%{_bindir}/grpc_cli +%{_libdir}/*.so.1* +%{_libdir}/*.so.7* +%{_datadir}/grpc %files devel +%defattr(-,root,root) %{_libdir}/*.so %{_libdir}/pkgconfig/* %{_includedir}/grpc @@ -101,15 +89,10 @@ make install-grpc-cli prefix="%{buildroot}%{_prefix}" %{_includedir}/grpcpp %files -n python3-grpcio +%defattr(-,root,root) %{python3_sitearch}/grpc %{python3_sitearch}/grpcio-%{version}-py?.?.egg-info %changelog -* Wed Sep 25 2019 wangli - 1.17.1-5 -- Type:enhancement -- ID:NA -- SUG:restart -- DESC:add secure compile option in Makefile - -* Sun Sep 15 2019 liyongqiang - 1.17.1-4 +* Sat Dec 21 2019 openEuler Buildteam - 1.22.0-1 - Package init