commit 7a6e0d9fbbae7f6973862dabe6e7f78cd6a2d408 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:51:59 2019 -0400 Package init diff --git a/0001-cxx-Arg-List-Too-Long.patch b/0001-cxx-Arg-List-Too-Long.patch new file mode 100644 index 0000000..8bcdd3a --- /dev/null +++ b/0001-cxx-Arg-List-Too-Long.patch @@ -0,0 +1,55 @@ +diff --git a/Makefile b/Makefile +index 736583fd93..9bbf162987 100644 +--- a/Makefile ++++ b/Makefile +@@ -2962,6 +2962,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 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX1), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX1), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX2), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX2), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX3), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX3), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX4), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 ++ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX4), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 + + 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 \ ++ ++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 \ + include/grpcpp/support/sync_stream.h \ + include/grpcpp/support/time.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 \ ++ ++PUBLIC_HEADERS_CXX1 += \ + include/grpcpp/alarm.h \ + include/grpcpp/channel.h \ + include/grpcpp/client_context.h \ +@@ -6953,6 +6967,8 @@ PUBLIC_HEADERS_CXX += \ + include/grpc++/impl/codegen/stub_options.h \ + include/grpc++/impl/codegen/sync_stream.h \ + include/grpc++/impl/codegen/time.h \ ++ ++PUBLIC_HEADERS_CXX4 += \ + include/grpcpp/impl/codegen/async_generic_service.h \ + include/grpcpp/impl/codegen/async_stream.h \ + include/grpcpp/impl/codegen/async_unary_call.h \ diff --git a/0001-enforce-system-crypto-policies.patch b/0001-enforce-system-crypto-policies.patch new file mode 100644 index 0000000..10f41d7 --- /dev/null +++ b/0001-enforce-system-crypto-policies.patch @@ -0,0 +1,41 @@ +From dfd09ced8657f7b3eac79038418fc5a452c396d6 Mon Sep 17 00:00:00 2001 +From: Sergey Avseyev +Date: Wed, 28 Nov 2018 18:53:22 +0300 +Subject: [PATCH] enforce system crypto policies + +--- + test/core/handshake/client_ssl.cc | 3 +-- + test/core/handshake/server_ssl_common.cc | 3 +-- + 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 +--- a/test/core/handshake/client_ssl.cc ++++ b/test/core/handshake/client_ssl.cc +@@ -161,8 +161,7 @@ static void server_thread(void* arg) { + // Set the cipher list to match the one expressed in + // src/core/tsi/ssl_transport_security.c. + const char* cipher_list = +- "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-" +- "SHA384:ECDHE-RSA-AES256-GCM-SHA384"; ++ "PROFILE=SYSTEM"; + if (!SSL_CTX_set_cipher_list(ctx, cipher_list)) { + 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 +--- 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, + // Set the cipher list to match the one expressed in + // src/core/tsi/ssl_transport_security.c. + const char* cipher_list = +- "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-" +- "SHA384:ECDHE-RSA-AES256-GCM-SHA384"; ++ "PROFILE=SYSTEM"; + if (!SSL_CTX_set_cipher_list(ctx, cipher_list)) { + ERR_print_errors_fp(stderr); + gpr_log(GPR_ERROR, "Couldn't set server cipher list."); +-- +2.19.1 + diff --git a/0002-patch-from-15532.patch b/0002-patch-from-15532.patch new file mode 100644 index 0000000..5f43394 --- /dev/null +++ b/0002-patch-from-15532.patch @@ -0,0 +1,43 @@ +From d75addf6b5ef94ba9f6b5684523a587c6dc35ccb Mon Sep 17 00:00:00 2001 +From: Sergey Avseyev +Date: Fri, 16 Nov 2018 15:03:30 +0300 +Subject: [PATCH] patch from #15532 + +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 8469a5fd50..0d06d1fc29 100644 +--- a/Makefile ++++ b/Makefile +@@ -348,7 +348,7 @@ HOST_LD ?= $(LD) + HOST_LDXX ?= $(LDXX) + + CFLAGS += -std=c99 -Wsign-conversion -Wconversion $(W_SHADOW) $(W_EXTRA_SEMI) +-CXXFLAGS += -std=c++11 ++CXXFLAGS += -std=c++11 -Wno-class-memaccess -Wno-ignored-qualifiers -Wno-stringop-truncation -Wno-sizeof-pointer-div + ifeq ($(SYSTEM),Darwin) + CXXFLAGS += -stdlib=libc++ + endif +@@ -7899,7 +7899,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 +-$(LIBBORINGSSL_OBJS): CFLAGS += -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-unknown-pragmas -Wno-implicit-function-declaration -Wno-unused-variable -Wno-sign-compare -Wno-implicit-fallthrough $(NO_W_EXTRA_SEMI) ++$(LIBBORINGSSL_OBJS): CFLAGS += -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-unknown-pragmas -Wno-implicit-function-declaration -Wno-unused-variable -Wno-sign-compare -Wno-implicit-fallthrough -Wno-cast-function-type $(NO_W_EXTRA_SEMI) + + $(LIBDIR)/$(CONFIG)/libboringssl.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBBORINGSSL_OBJS) + $(E) "[AR] Creating $@" +@@ -10094,7 +10094,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,) +-$(LIBARES_OBJS): CFLAGS += -Wno-sign-conversion $(if $(subst Darwin,,$(SYSTEM)),,-Wno-shorten-64-to-32) $(if $(subst MINGW32,,$(SYSTEM)),-Wno-invalid-source-encoding,) ++$(LIBARES_OBJS): CFLAGS += -Wno-sign-conversion -Wno-sizeof-pointer-memaccess -Wno-stringop-overflow $(if $(subst Darwin,,$(SYSTEM)),,-Wno-shorten-64-to-32) $(if $(subst MINGW32,,$(SYSTEM)),-Wno-invalid-source-encoding,) + + $(LIBDIR)/$(CONFIG)/libares.a: $(LIBARES_OBJS) + $(E) "[AR] Creating $@" +-- +2.19.1 + diff --git a/0003-Do-not-build-the-Ruby-plugin.patch b/0003-Do-not-build-the-Ruby-plugin.patch new file mode 100644 index 0000000..399816d --- /dev/null +++ b/0003-Do-not-build-the-Ruby-plugin.patch @@ -0,0 +1,43 @@ +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/grpc-add-secure-compile-option-in-Makefile.patch b/grpc-add-secure-compile-option-in-Makefile.patch new file mode 100644 index 0000000..469adeb --- /dev/null +++ b/grpc-add-secure-compile-option-in-Makefile.patch @@ -0,0 +1,18 @@ +diff --git a/Makefile b/Makefile +index d4ed255..1172aa1 100644 +--- a/Makefile ++++ b/Makefile +@@ -456,6 +456,10 @@ LDFLAGS += $(EXTRA_LDFLAGS) + DEFINES += $(EXTRA_DEFINES) + LDLIBS += $(EXTRA_LDLIBS) + ++CFLAGS += -fPIE ++CPPFLAGS += -fstack-protector-strong ++LDFLAGS += -pie ++ + HOST_CPPFLAGS = $(CPPFLAGS) + HOST_CFLAGS = $(CFLAGS) + HOST_CXXFLAGS = $(CXXFLAGS) +-- +2.19.1 + diff --git a/grpc.spec b/grpc.spec new file mode 100644 index 0000000..3566fbf --- /dev/null +++ b/grpc.spec @@ -0,0 +1,115 @@ +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 + +%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 plugins +Summary: Compiler plugins for gRPC protoc +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: protobuf-compiler + +%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 +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} +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-grpcio +Python3 bindings for gRPC. + +%prep +%autosetup -p1 + +sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:;s:$(prefix)/lib:$(prefix)/%{_lib}:;s:^GTEST_LIB =.*::' Makefile + +%build +%make_build shared plugins + +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 CFLAGS="%optflags" +%py3_build + +%install +%make_install prefix="%{buildroot}%{_prefix}" +make install-grpc-cli prefix="%{buildroot}%{_prefix}" +%delete_la_and_a +%py3_install + +%ldconfig_post +%ldconfig_postun + +%files +%doc README.md +%license LICENSE +%{_libdir}/*.so.1* +%{_libdir}/*.so.7* +%{_datadir}/grpc + +%files plugins +%{_bindir}/grpc_*_plugin + +%files cli +%{_bindir}/grpc_cli + +%files devel +%{_libdir}/*.so +%{_libdir}/pkgconfig/* +%{_includedir}/grpc +%{_includedir}/grpc++ +%{_includedir}/grpcpp + +%files -n python3-grpcio +%{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 +- Package init diff --git a/v1.17.1.tar.gz b/v1.17.1.tar.gz new file mode 100644 index 0000000..142c905 Binary files /dev/null and b/v1.17.1.tar.gz differ