2 Star 0 Fork 8

ocs-official-rebuild/grpc

forked from OpenCloudOS Stream/grpc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
grpc.spec 25.22 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2024-08-08 15:42 . Rebuilt for re2
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
%bcond_without bootstrap
%bcond_with third-party
%global _lto_cflags %{nil}
%global cpp_std 17
%global srcversion %(echo '%{version}' | sed -r 's/~rc/-pre/')
%global pyversion %(echo '%{version}' | tr -d '~')
%global c_so_version 33
%global cpp_so_version 1.56
# https://github.com/grpc/grpc/pull/32914
%global upb_version 23.0
%global gtest_url https://github.com/google/googletest
%global gtest_dir googletest-%{gtest_commit}
%global gtest_commit 0e402173c97aea7a00749e825b194bfede4f2e45
%if %{with third-party}
%global envoy_api_commit 9c42588c956220b48eb3099d186487c2f04d32ec
%global envoy_api_url https://github.com/envoyproxy/data-plane-api
%global envoy_api_dir data-plane-api-%{envoy_api_commit}
%global googleapis_commit 2f9af297c84c55c8b871ba4495e01ade42476c92
%global googleapis_url https://github.com/googleapis/googleapis
%global googleapis_dir googleapis-%{googleapis_commit}
%global opencensus_proto_version 0.3.0
%global opencensus_proto_url https://github.com/census-instrumentation/opencensus-proto
%global opencensus_proto_dir opencensus-proto-%{opencensus_proto_version}
%global xds_commit cb28da3451f158a947dfc45090fe92b07b243bc1
%global xds_url https://github.com/cncf/xds
%global xds_dir xds-%{xds_commit}
%endif
Summary: RPC library and framework
Name: grpc
Version: 1.56.2
Release: 5%{?dist}
License: Apache-2.0 AND BSD-3-Clause AND MIT
URL: https://www.grpc.io
Source0: https://github.com/grpc/grpc/archive/v%{srcversion}/grpc-%{srcversion}.tar.gz
Source1: grpc_cli.1
Source2: grpc_cli-ls.1
Source3: grpc_cli-call.1
Source4: grpc_cli-type.1
Source5: grpc_cli-parse.1
Source6: grpc_cli-tojson.1
Source7: grpc_cli-tobinary.1
Source8: grpc_cli-help.1
Source9: %{gtest_url}/archive/%{gtest_commit}/%{gtest_dir}.tar.gz
%if %{with third-party}
Source10: %{envoy_api_url}/archive/%{envoy_api_commit}/%{envoy_api_dir}.tar.gz
Source11: %{googleapis_url}/archive/%{googleapis_commit}/%{googleapis_dir}.tar.gz
Source12: %{opencensus_proto_url}/archive/v%{opencensus_proto_version}/%{opencensus_proto_dir}.tar.gz
Source13: %{xds_url}/archive/%{xds_commit}/%{xds_dir}.tar.gz
%endif
BuildRequires: gcc-c++ cmake ninja-build gtest
BuildRequires: protobuf-compiler curl abseil-cpp-devel xxhash-static chrpath ca-certificates symlinks pkgconfig(protobuf-lite)
BuildRequires: cmake(benchmark) cmake(gflags) cmake(c-ares) python3-devel python3dist(setuptools)
BuildRequires: pkgconfig(zlib) pkgconfig(protobuf) pkgconfig(re2) pkgconfig(openssl) pkgconfig(libxxhash)
BuildRequires: python3dist(six) >= 1.10
BuildRequires: python3-Cython
BuildRequires: python3dist(protobuf) >= 4.24.2
BuildRequires: python3dist(googleapis-common-protos) >= 1.5.5
%if %{without bootstrap}
BuildRequires: python3dist(xds-protos) >= 0.0.7
%endif
BuildRequires: python3dist(coverage) >= 4.0
BuildRequires: python3dist(oauth2client) >= 1.4.7
BuildRequires: python3dist(google-auth) >= 1.17.2
BuildRequires: python3dist(requests) >= 2.14.2
Patch3000: grpc-1.36.4-python-grpcio_tests-fixture-super.patch
Patch3001: grpc-1.48.0-python-grpcio_tests-skip-compression-tests.patch
Patch3003: grpc-1.45.0-python_wrapper-path.patch
Patch5000: skip-network-tests.patch
%if %{without third-party}
Patch5001: disable-to-download-external-proto-library.patch
%endif
Requires: grpc-data = %{version}-%{release}
Provides: bundled(upb) = %{upb_version}
Provides: bundled(utf8_range)
%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
This package provides the shared C core library.
%package data
Summary: Data for gRPC bindings
License: Apache-2.0
Requires: ca-certificates
BuildArch: noarch
%description data
Common data for gRPC bindings: currently, this contains only a symbolic link to
the system shared TLS certificates.
%package doc
Summary: Documentation and examples for gRPC
License: Apache-2.0
Provides: python-grpcio-doc = %{version}-%{release}
Provides: python-grpcio-admin-doc = %{version}-%{release}
Provides: python-grpcio-csds-doc = %{version}-%{release}
Provides: python-grpcio-channelz-doc = %{version}-%{release}
Provides: python-grpcio-health-checking-doc = %{version}-%{release}
Provides: python-grpcio-reflection-doc = %{version}-%{release}
Provides: python-grpcio-status-doc = %{version}-%{release}
Provides: python-grpcio-testing-doc = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation and examples for gRPC, including Markdown documentation sources
for the following:
C (core)
API
Internals
C++
API
Internals
Objective C
API
Internals
Python
grpcio
grpcio_admin
grpcio_csds
grpcio_channelz
grpcio_health_checking
grpcio_reflection
grpcio_status
grpcio_testing
For rendered HTML documentation, please see https://grpc.io/docs/.
%package cpp
Summary: C++ language bindings for gRPC
Requires: grpc = %{version}-%{release}
Requires: grpc-cpp = %{version}-%{release}
Provides: bundled(upb) = %{upb_version}
Provides: bundled(utf8_range)
%description cpp
C++ language bindings for gRPC.
%package plugins
Summary: Protocol buffers compiler plugins for gRPC
Requires: grpc = %{version}-%{release}
Requires: grpc-cpp = %{version}-%{release}
Requires: protobuf-compiler
Provides: bundled(upb) = %{upb_version}
Provides: bundled(utf8_range)
%description plugins
Plugins to the protocol buffers compiler to generate gRPC sources.
%package cli
Summary: Command-line tool for gRPC
Requires: grpc = %{version}-%{release}
Requires: grpc-cpp = %{version}-%{release}
Provides: bundled(upb) = %{upb_version}
Provides: bundled(utf8_range)
%description cli
The command line tool can do the following things:
Send unary rpc.
Attach metadata and display received metadata.
Handle common authentication to server.
Infer request/response types from server reflection result.
Find the request/response types from a given proto file.
Read proto request in text form.
Read request in wire form (for protobuf messages, this means serialized
binary form).
Display proto response in text form.
Write response in wire form to a file.
%package devel
Summary: Development files for gRPC library
Requires: grpc = %{version}-%{release}
Requires: grpc-cpp = %{version}-%{release}
Requires: grpc-plugins = %{version}-%{release}
Requires: kernel-headers abseil-cpp-devel cmake(c-ares)
Requires: pkgconfig(protobuf) pkgconfig(gmock) pkgconfig(re2) pkgconfig(zlib)
%description devel
Development headers and files for gRPC libraries (both C and C++).
%package -n python3-grpcio
Summary: Python language bindings for gRPC
Requires: grpc-data = %{version}-%{release}
Provides: bundled(upb) = %{upb_version}
Provides: bundled(utf8_range)
%description -n python3-grpcio
Python language bindings for gRPC (HTTP/2-based RPC framework).
%global grpcio_egg %{python3_sitearch}/grpcio-%{pyversion}-py%{python3_version}.egg-info
%{?python_extras_subpkg:%python_extras_subpkg -n python3-grpcio -i %{grpcio_egg} protobuf}
%package -n python3-grpcio-tools
Summary: Package for gRPC Python tools
Provides: bundled(upb) = %{upb_version}
Provides: bundled(utf8_range)
%description -n python3-grpcio-tools
Package for gRPC Python tools.
%if %{without bootstrap}
%package -n python3-grpcio-admin
Summary: A collection of admin services
License: Apache-2.0
BuildArch: noarch
%description -n python3-grpcio-admin
gRPC Python Admin Interface Package.
Debugging gRPC library can be a complex task. There are many configurations and
internal states, which will affect the behavior of the library. This Python
package will be the collection of admin services that are exposing debug
information. Currently, it includes:
* Channel tracing metrics (grpcio-channelz)
* Client Status Discovery Service (grpcio-csds)
Here is a snippet to create an admin server on "localhost:50051":
server = grpc.server(ThreadPoolExecutor())
port = server.add_insecure_port('localhost:50051')
grpc_admin.add_admin_servicers(self._server)
server.start()
Welcome to explore the admin services with CLI tool "grpcdebug":
https://github.com/grpc-ecosystem/grpcdebug.
For any issues or suggestions, please send to
https://github.com/grpc/grpc/issues.
%endif
%if %{without bootstrap}
%package -n python3-grpcio-csds
Summary: xDS configuration dump library
License: Apache-2.0
BuildArch: noarch
%description -n python3-grpcio-csds
gRPC Python Client Status Discovery Service package.
CSDS is part of the Envoy xDS protocol:
https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/status/v3/csds.proto.
It allows the gRPC application to programmatically expose the received traffic
configuration (xDS resources). Welcome to explore with CLI tool "grpcdebug":
https://github.com/grpc-ecosystem/grpcdebug.
For any issues or suggestions, please send to
https://github.com/grpc/grpc/issues.
%endif
%package -n python3-grpcio-channelz
Summary: Channel Level Live Debug Information Service for gRPC
License: Apache-2.0
BuildArch: noarch
%description -n python3-grpcio-channelz
gRPC Python Channelz package.
Channelz is a live debug tool in gRPC Python.
%package -n python3-grpcio-health-checking
Summary: Standard Health Checking Service for gRPC
License: Apache-2.0
BuildArch: noarch
%description -n python3-grpcio-health-checking
gRPC Python Health Checking.
Reference package for GRPC Python health checking.
%package -n python3-grpcio-reflection
Summary: Standard Protobuf Reflection Service for gRPC
License: Apache-2.0
BuildArch: noarch
%description -n python3-grpcio-reflection
gRPC Python Reflection package.
Reference package for reflection in GRPC Python.
%package -n python3-grpcio-status
Summary: Status proto mapping for gRPC
License: Apache-2.0
BuildArch: noarch
%description -n python3-grpcio-status
gRPC Python Status Proto.
Reference package for GRPC Python status proto mapping.
%package -n python3-grpcio-testing
Summary: Testing utilities for gRPC Python
License: Apache-2.0
BuildArch: noarch
%description -n python3-grpcio-testing
gRPC Python Testing Package.
Testing utilities for gRPC Python.
%prep
%autosetup -p1 -n grpc-%{srcversion}
cp -p third_party/utf8_range/LICENSE LICENSE-utf8_range
cat >> 'tools/distrib/python/grpcio_tools/protoc_lib_deps.py' <<'EOF'
del PROTOBUF_SUBMODULE_VERSION
PROTO_INCLUDE="%{_includedir}"
_unbundle_libs = {"abseil-cpp", "protobuf"}
_unbundle_prefixes = {f"third_party/{lib}" for lib in _unbundle_libs}
def _ok_prefix(path):
return not any(map(path.startswith, _unbundle_prefixes))
CC_FILES = list(filter(_ok_prefix, CC_FILES))
CC_INCLUDES = list(filter(_ok_prefix, CC_INCLUDES))
EOF
%setup -q -T -D -b 9 -n grpc-%{srcversion}
rm -rvf 'third_party/googletest'
mv '../%{gtest_dir}' 'third_party/googletest'
%if %{with third-party}
%setup -q -T -D -b 10 -n grpc-%{srcversion}
%setup -q -T -D -b 11 -n grpc-%{srcversion}
%setup -q -T -D -b 12 -n grpc-%{srcversion}
%setup -q -T -D -b 13 -n grpc-%{srcversion}
{
awk '$1 ~ /^(#|$)/ { next }; 1' <<'EOF'
../%{envoy_api_dir}/ third_party/envoy-api/
../%{googleapis_dir}/ third_party/googleapis/
../%{opencensus_proto_dir}/ third_party/opencensus-proto/
../%{xds_dir}/ third_party/xds/
EOF
} | while read -r fromdir todir
do
find "${fromdir}" -type f ! -name '*.proto' -print -delete
rm -rvf "${todir}"
mv "${fromdir}" "${todir}"
done
%endif
rm -rvf third_party/xxhash
find . -type f -perm /0111 \
-exec gawk '!/^#!/ { print FILENAME }; { nextfile }' '{}' '+' |
xargs -r chmod -v a-x
rm -rfv \
src/boringssl/boringssl_prefix_symbols.h \
third_party/cares/ares_build.h \
third_party/upb/third_party/lunit
echo '' > etc/roots.pem
rm -rvf examples/android src/android
rm -vf examples/node/package-lock.json
find . -type f -name .gitignore -print -delete
find . -type f -perm /0111 -exec gawk \
'/^#!\/usr\/bin\/env[[:blank:]]/ { print FILENAME }; { nextfile }' \
'{}' '+' |
xargs -r sed -r -i '1{s|^(#!/usr/bin/)env[[:blank:]]+([^[:blank:]]+)|\1\2|}'
sed -r -i 's/(std=c\+\+)14/\1%{cpp_std}/g' \
setup.py grpc.gyp Rakefile \
examples/cpp/*/Makefile \
examples/cpp/*/CMakeLists.txt \
tools/run_tests/artifacts/artifact_targets.py \
tools/distrib/python/grpcio_tools/setup.py
ln -s ../../../../third_party/ tools/distrib/python/grpcio_tools/third_party
from='^([[:blank:]]+)(def testTestsJsonUpToDate\()'
skip='@unittest.skip("JSON representations differ; cause not ascertained")'
sed -r -i "s/${from}/\\1${skip}\\n\\1\\2/" \
src/python/grpcio_tests/tests/_sanity/_sanity_test.py
%build
%global rmprefix %(echo $(($(wc -c <<<'%{_prefix}')+1)))
%cmake \
-DgRPC_INSTALL:BOOL=ON \
-DCMAKE_CXX_STANDARD:STRING=%{cpp_std} \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
-DgRPC_INSTALL_BINDIR:PATH=%(cut -b %{rmprefix}- <<<'%{_bindir}') \
-DgRPC_INSTALL_LIBDIR:PATH=%(cut -b %{rmprefix}- <<<'%{_libdir}') \
-DgRPC_INSTALL_INCLUDEDIR:PATH=%(cut -b %{rmprefix}- <<<'%{_includedir}') \
-DgRPC_INSTALL_CMAKEDIR:PATH=%(cut -b %{rmprefix}- <<<'%{_libdir}/cmake/grpc') \
-DgRPC_INSTALL_SHAREDIR:PATH=%(cut -b %{rmprefix}- <<<'%{_datadir}/grpc') \
-DgRPC_BUILD_TESTS:BOOL=ON \
-DgRPC_BUILD_CODEGEN:BOOL=ON \
-DgRPC_BUILD_CSHARP_EXT:BOOL=ON \
-DgRPC_BACKWARDS_COMPATIBILITY_MODE:BOOL=OFF \
-DgRPC_ZLIB_PROVIDER:STRING='package' \
-DgRPC_CARES_PROVIDER:STRING='package' \
-DgRPC_RE2_PROVIDER:STRING='package' \
-DgRPC_SSL_PROVIDER:STRING='package' \
-DgRPC_PROTOBUF_PROVIDER:STRING='package' \
-DgRPC_PROTOBUF_PACKAGE_TYPE:STRING='MODULE' \
-DgRPC_BENCHMARK_PROVIDER:STRING='package' \
-DgRPC_ABSL_PROVIDER:STRING='package' \
-DgRPC_USE_PROTO_LITE:BOOL=OFF \
-DgRPC_BUILD_GRPC_CPP_PLUGIN:BOOL=ON \
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN:BOOL=ON \
-DgRPC_BUILD_GRPC_NODE_PLUGIN:BOOL=ON \
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN:BOOL=ON \
-DgRPC_BUILD_GRPC_PHP_PLUGIN:BOOL=ON \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN:BOOL=ON \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN:BOOL=ON \
-GNinja
%cmake_build
PYROOT="${PWD}/%{_vpath_builddir}/pyroot"
if [ -n "${PYTHONPATH-}" ]; then PYTHONPATH="${PYTHONPATH}:"; fi
PYTHONPATH="${PYTHONPATH-}${PYROOT}%{python3_sitelib}"
PYTHONPATH="${PYTHONPATH}:${PYROOT}%{python3_sitearch}"
export PYTHONPATH
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 GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY='True'
export GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD='False'
export GRPC_PYTHON_CFLAGS="$(
pkg-config --cflags protobuf
) -std=c++%{cpp_std} -fvisibility=hidden -fno-wrapv -fno-exceptions"
export GRPC_PYTHON_LDFLAGS="$(pkg-config --libs protobuf)"
%py3_build
%{__python3} %{py_setup} %{?py_setup_args} install \
-O1 --skip-build --root "${PYROOT}"
pushd "tools/distrib/python/grpcio_tools/" >/dev/null
mkdir -p grpc_root/src
for srcdir in compiler
do
cp -rp "../../../../src/${srcdir}" "grpc_root/src/"
done
cp -rp '../../../../include' 'grpc_root/'
export GRPC_PYTHON_CFLAGS="-fno-wrapv -frtti $(pkg-config --cflags protobuf)"
export GRPC_PYTHON_LDFLAGS="$(pkg-config --libs protobuf) -lprotoc"
%py3_build
find . -type f -name protoc.py -execdir sed -r -i '1{/^#!/d}' '{}' '+'
%{__python3} %{py_setup} %{?py_setup_args} install \
-O1 --skip-build --root "${PYROOT}"
popd >/dev/null
for suffix in channelz %{?!with_bootstrap:csds admin} health_checking \
reflection status testing tests
do
pushd "src/python/grpcio_${suffix}/" >/dev/null
if ! echo "${suffix}" | grep -E "^(admin|csds)$" >/dev/null
then
%{__python3} %{py_setup} %{?py_setup_args} preprocess
fi
if ! echo "${suffix}" | grep -E "^(admin|csds|testing)$" >/dev/null
then
%{__python3} %{py_setup} %{?py_setup_args} build_package_protos
fi
%py3_build
%{__python3} %{py_setup} %{?py_setup_args} install \
-O1 --skip-build --root "${PYROOT}"
popd >/dev/null
done
%install
%cmake_install
install -t '%{buildroot}%{_bindir}' -p -D '%{_vpath_builddir}/grpc_cli'
chrpath --delete '%{buildroot}%{_bindir}/grpc_cli'
install -t '%{buildroot}%{_libdir}' -p \
'%{_vpath_builddir}/libgrpc++_test_config.so.%{cpp_so_version}'
chrpath --delete \
'%{buildroot}%{_libdir}/libgrpc++_test_config.so.%{cpp_so_version}'
install -d '%{buildroot}/%{_mandir}/man1'
install -t '%{buildroot}/%{_mandir}/man1' -p -m 0644 \
%{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} \
%{SOURCE6} %{SOURCE7} %{SOURCE8}
find %{buildroot} -type f -name '*.a' -print -delete
find %{buildroot}%{_includedir}/grpc* -type f -name '*.h' -perm /0111 \
-execdir chmod -v a-x '{}' '+'
pushd '%{buildroot}'
PYROOT="${PWD}"
popd
if [ -n "${PYTHONPATH-}" ]; then PYTHONPATH="${PYTHONPATH}:"; fi
PYTHONPATH="${PYTHONPATH-}${PYROOT}%{python3_sitelib}"
PYTHONPATH="${PYTHONPATH}:${PYROOT}%{python3_sitearch}"
export PYTHONPATH
%py3_install
pushd "tools/distrib/python/grpcio_tools/" >/dev/null
%py3_install
popd >/dev/null
for suffix in channelz %{?!with_bootstrap:csds admin} health_checking \
reflection status testing
do
pushd "src/python/grpcio_${suffix}/" >/dev/null
%py3_install
popd >/dev/null
done
%global sysbundle %{_sysconfdir}/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
install -D -t "%{buildroot}$(dirname '%{sysbundle}')" -m 0644 '%{sysbundle}'
find '%{buildroot}' -type f -name 'roots.pem' |
while read -r fn
do
ln -s -f "%{buildroot}%{sysbundle}" "${fn}"
symlinks -c -o "${fn}"
done
rm -rvf "%{buildroot}$(dirname '%{sysbundle}')"
install -D -t '%{buildroot}%{_pkgdocdir}' -m 0644 -p AUTHORS *.md
cp -rvp doc examples '%{buildroot}%{_pkgdocdir}'
%check
export NO_NETWORK_TESTS=1
PORT_SERVER_PORT="$(awk '
/_PORT_SERVER_PORT[[:blank:]]*=[[:blank:]]*[[:digit:]]+$/ { print $NF }
' tools/run_tests/python_utils/start_port_server.py)"
%ifnarch loongarch64
%ctest
%endif
{ sed -r -e '/^(#|$)/d' -e 's|^(.*)$|%{_vpath_builddir}/\1_test|' <<'EOF'
# Requires (or may require) network:
resolve_address_using_ares_resolver
resolve_address_using_ares_resolver_posix
resolve_address_using_native_resolver
resolve_address_using_native_resolver_posix
ssl_transport_security
flaky_network
client_ssl
%ifarch x86_64
examine_stack
stack_tracer
%endif
%ifarch aarch64 x86_64 ppc64le
grpc_tool
h2_ssl_cert
ssl_transport_security_utils
test_core_security_credentials
tls_key_export
%ifarch aarch64
# test/cpp/server/load_reporter/get_cpu_stats_test.cc:49: Failure
# Expected: (prev.first) <= (cur.first), actual: 255279564 vs 255279563
lb_get_cpu_stats
%endif
# Actual: "connections to all backends failing; last error: UNKNOWN: ipv4:127.0.0.1:26590: Invalid argument"
# test/cpp/end2end/xds/xds_fault_injection_end2end_test.cc:168
# test/cpp/end2end/xds/xds_end2end_test_lib.cc:914: Failure
xds_fault_injection_end2end
%endif
EOF
} | xargs -r chmod -v a-x
%ifnarch loongarch64
find %{_vpath_builddir} -type f -perm /0111 -name '*_test' | sort |
while read -r testexe
do
%{__python3} tools/run_tests/start_port_server.py
timeout -k 61m -v 60m "${testexe}"
done
curl "http://localhost:${PORT_SERVER_PORT}/quitquitquit" || :
pushd src/python/grpcio_tests
for suite in test_lite test_py3_only
do
env CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" \
LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \
PATH="%{buildroot}%{_bindir}:$PATH" \
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \
PYTHONDONTWRITEBYTECODE=1 \
timeout -k 31m -v 30m \
%{__python3} %{py_setup} %{?py_setup_args} "${suite}"
done
popd
%endif
foundgtest=0
if find %{buildroot} -type f -perm /0111 \
-execdir objdump --syms --dynamic-syms --demangle '{}' '+' 2>/dev/null |
grep -E '[^:]testing::'
then
exit 1
fi
%files
%license LICENSE NOTICE.txt LICENSE-utf8_range
%{_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}*
%files data
%license LICENSE NOTICE.txt
%dir %{_datadir}/grpc
%{_datadir}/grpc/roots.pem
%files doc
%license LICENSE NOTICE.txt
%{_pkgdocdir}
%files cpp
%{_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_authorization_provider.so.%{cpp_so_version}*
%{_libdir}/libgrpc_plugin_support.so.%{cpp_so_version}*
%{_libdir}/libgrpcpp_channelz.so.%{cpp_so_version}*
%files cli
%{_bindir}/grpc_cli
%{_libdir}/libgrpc++_test_config.so.%{cpp_so_version}
%{_mandir}/man1/grpc_cli.1*
%{_mandir}/man1/grpc_cli-*.1*
%files plugins
%{_bindir}/grpc_*_plugin
%files devel
%{_includedir}/grpc
%{_includedir}/grpc++
%{_includedir}/grpcpp
%{_libdir}/libaddress_sorting.so
%{_libdir}/libgpr.so
%{_libdir}/libgrpc.so
%{_libdir}/libgrpc_authorization_provider.so
%{_libdir}/libgrpc_unsecure.so
%{_libdir}/libupb.so
%{_libdir}/pkgconfig/gpr.pc
%{_libdir}/pkgconfig/grpc.pc
%{_libdir}/pkgconfig/grpc_unsecure.pc
%{_libdir}/cmake/grpc
%{_libdir}/libgrpc++.so
%{_libdir}/libgrpc++_alts.so
%{_libdir}/libgrpc++_error_details.so
%{_libdir}/libgrpc++_reflection.so
%{_libdir}/libgrpc++_unsecure.so
%{_libdir}/libgrpc_plugin_support.so
%{_libdir}/pkgconfig/grpc++.pc
%{_libdir}/pkgconfig/grpc++_unsecure.pc
%{_libdir}/libgrpcpp_channelz.so
%files -n python3-grpcio
%license LICENSE NOTICE.txt LICENSE-utf8_range
%{python3_sitearch}/grpc
%{python3_sitearch}/grpcio-%{pyversion}-py%{python3_version}.egg-info
%files -n python3-grpcio-tools
%license LICENSE NOTICE.txt LICENSE-utf8_range
%{python3_sitearch}/grpc_tools
%{python3_sitearch}/grpcio_tools-%{pyversion}-py%{python3_version}.egg-info
%if %{without bootstrap}
%files -n python3-grpcio-admin
%{python3_sitelib}/grpc_admin
%{python3_sitelib}/grpcio_admin-%{pyversion}-py%{python3_version}.egg-info
%endif
%files -n python3-grpcio-channelz
%{python3_sitelib}/grpc_channelz
%{python3_sitelib}/grpcio_channelz-%{pyversion}-py%{python3_version}.egg-info
%if %{without bootstrap}
%files -n python3-grpcio-csds
%{python3_sitelib}/grpc_csds
%{python3_sitelib}/grpcio_csds-%{pyversion}-py%{python3_version}.egg-info
%endif
%files -n python3-grpcio-health-checking
%{python3_sitelib}/grpc_health
%{python3_sitelib}/grpcio_health_checking-%{pyversion}-py%{python3_version}.egg-info
%files -n python3-grpcio-reflection
%{python3_sitelib}/grpc_reflection
%{python3_sitelib}/grpcio_reflection-%{pyversion}-py%{python3_version}.egg-info
%files -n python3-grpcio-status
%{python3_sitelib}/grpc_status
%{python3_sitelib}/grpcio_status-%{pyversion}-py%{python3_version}.egg-info
%files -n python3-grpcio-testing
%{python3_sitelib}/grpc_testing
%{python3_sitelib}/grpcio_testing-%{pyversion}-py%{python3_version}.egg-info
%changelog
* Thu Aug 08 2024 Rebuild Robot <rebot@opencloudos.org> - 1.56.2-5
- [Type] other
- [DESC] Rebuilt for re2
* Fri Jul 19 2024 Shuo Wang <abushwang@tencent.com> - 1.56.2-4
- disable GetCpuStatsTest due to failed occasionally
* Tue Jul 9 2024 Chunsheng Luo <luffyluo@tencent.com> - 1.56.2-3
- Rebuild for failed official build
* Mon Jul 1 2024 Pengda Dou <doupengda@loongson> - 1.56.2-2
- [Type] other
- [DESC] disable test for loongarch64
* Tue Sep 19 2023 Miaojun Dong <zoedong@tencent.com> - 1.56.2-1
- Bump version to 1.56.2
* Tue Sep 19 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 1.48.1-7
- Rebuilt for python 3.11
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 1.48.1-6
- Rebuilt for OpenCloudOS Stream 23.09
* Tue Sep 05 2023 cunshunxia <cunshunxia@tencent.com> - 1.48.1-5
- fix GetCpuStatsTest failed occasionally on arm.
* Mon Sep 04 2023 cunshunxia <cunshunxia@tencent.com> - 1.48.1-4
- build require Cython0 instead of Cython3.0
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 1.48.1-3
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 1.48.1-2
- Rebuilt for OpenCloudOS Stream 23
* Mon Dec 26 2022 Miaojun Dong <zoedong@tencent.com> - 1.48.1-1
- initial build
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-official-rebuild/grpc.git
git@gitee.com:ocs-official-rebuild/grpc.git
ocs-official-rebuild
grpc
grpc
master

搜索帮助