From bf7e9a8d24108a63adcf986b2e0491337b8db5b9 Mon Sep 17 00:00:00 2001 From: Sergey Avseyev Date: Dec 07 2018 08:01:19 +0000 Subject: Initial import (#1654324) --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f2cdaf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/grpc-1.17.0.tar.gz 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/grpc.spec b/grpc.spec new file mode 100644 index 0000000..50c6c95 --- /dev/null +++ b/grpc.spec @@ -0,0 +1,105 @@ +Name: grpc +Version: 1.17.0 +Release: 1%{?dist} +Summary: Modern, open source, high-performance remote procedure call (RPC) framework +License: ASL 2.0 +URL: https://www.grpc.io +Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz + +BuildRequires: gcc-c++ +BuildRequires: pkgconfig +BuildRequires: protobuf-devel +BuildRequires: protobuf-compiler +BuildRequires: openssl-devel +BuildRequires: c-ares-devel +BuildRequires: gflags-devel +BuildRequires: gtest-devel + +Patch0: 0001-enforce-system-crypto-policies.patch +# https://github.com/grpc/grpc/pull/15532 +Patch1: 0002-patch-from-15532.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. + +The main usage scenarios: + +* Efficiently connecting polyglot services in microservices style architecture +* Connecting mobile devices, browser clients to backend services +* Generating efficient client libraries + +Core Features that make it awesome: + +* Idiomatic client libraries in 10 languages +* Highly efficient on wire and with a simple service definition framework +* Bi-directional streaming with http/2 based transport +* Pluggable auth, tracing, load balancing and health checking + + +%package plugins +Summary: gRPC protocol buffers compiler plugins +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: protobuf-compiler + +%description plugins +Plugins to the protocol buffers compiler to generate gRPC sources. + +%package cli +Summary: gRPC protocol buffers cli +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description cli +Plugins to the protocol buffers compiler to generate gRPC sources. + +%package devel +Summary: gRPC library development files +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development headers and files for gRPC libraries. + +%prep +%autosetup -p1 +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 + +%install +make install prefix="%{buildroot}%{_prefix}" +make install-grpc-cli prefix="%{buildroot}%{_prefix}" +find %{buildroot} -type f -name '*.a' -exec rm -f {} \; + +%ldconfig_scriptlets + +%files +%doc README.md +%license LICENSE +%{_libdir}/*.so.1* +%{_libdir}/*.so.7* +%{_datadir}/grpc + +%files cli +%{_bindir}/grpc_cli + +%files plugins +%doc README.md +%license LICENSE +%{_bindir}/grpc_*_plugin + +%files devel +%{_libdir}/*.so +%{_libdir}/pkgconfig/* +%{_includedir}/grpc +%{_includedir}/grpc++ +%{_includedir}/grpcpp + +%changelog +* Fri Dec 07 2018 Sergey Avseyev - 1.17.0-1 +- Initial revision diff --git a/sources b/sources new file mode 100644 index 0000000..0387f88 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (grpc-1.17.0.tar.gz) = c1c6a1c668975e454abd36fa13550ffd40e04e752a2a5090541463c20683ad9382052d22874115f2772ad9c0dda74c4dfb1835176b07ea69a1b99186afeb5cf7