acc3813
# In gtest 1.36, we must link against the system abseil-cpp. We get linker
acc3813
# errors here if we are not using C++17.
acc3813
acc3813
# However, gtest in Fedora uses the C++11 ABI, so we get linker errors building
acc3813
# the tests if we use C++17. We must therefore bundle a copy of gtest in the
acc3813
# source RPM rather than using the system copy. This is to be discouraged, but
acc3813
# there is no alternative in this case. It is not treated as a bundled library
acc3813
# because it is used only at build time, and is not installed.
acc3813
%global gtest_version 1.10.0
acc3813
%bcond_without system_gtest
acc3813
34ecf95
# The CMake build works, except grpc_cli is only built with the tests.
34ecf95
%bcond_with cmake
34ecf95
426ac1e
# Note that, in this spec file, building the tests requires using CMake.
34ecf95
%bcond_with core_tests
34ecf95
426ac1e
# A few failing Python “test_lite” tests are skipped without understanding.
426ac1e
# This lets us easily re-enable them to try to work toward a fix or a useful
426ac1e
# upstream bug report.
426ac1e
%bcond_with unexplained_failing_python_lite_tests
426ac1e
426ac1e
# A great many of these tests (over 20%) fail. Any help in understanding these
426ac1e
# well enough to fix them or report them upstream is welcome.
426ac1e
%bcond_with python_aio_tests
426ac1e
426ac1e
# Several of these still fail. We should try to work toward re-enabling this.
426ac1e
%bcond_with python_gevent_tests
426ac1e
87469ef
Name:           grpc
87469ef
Version:        1.26.0
986bbc8
Release:        15%{?dist}
87469ef
Summary:        RPC library and framework
87469ef
7adc2b7
# CMakeLists.txt: gRPC_CORE_SOVERSION
426ac1e
%global c_so_version 9
7adc2b7
# CMakeLists.txt: gRPC_CPP_SOVERSION
7adc2b7
%global cpp_so_version 1
7adc2b7
# CMakeLists.txt: gRPC_CSHARP_SOVERSION
7adc2b7
%global csharp_so_version 2
7adc2b7
87469ef
# The entire source is ASL 2.0 except the following:
87469ef
#
87469ef
# BSD:
87469ef
#   - third_party/upb/, except third_party/upb/third_party/lunit/
87469ef
#     * Potentially linked into any compiled subpackage (but not -doc,
87469ef
#       pure-Python subpackages, etc.)
87469ef
#   - third_party/address_sorting/
87469ef
#     * Potentially linked into any compiled subpackage (but not -doc,
87469ef
#       pure-Python subpackages, etc.)
87469ef
#
87469ef
# as well as the following which do not contribute to the base License field or
87469ef
# any subpackage License field for the reasons noted:
87469ef
#
87469ef
# MPLv2.0:
87469ef
#   - etc/roots.pem
87469ef
#     * Truncated to an empty file in prep; a symlink to the shared system
87469ef
#       certificates is used instead
87469ef
#   - src/android/test/interop/app/src/main/assets/roots.pem
87469ef
#     * Truncated to an empty file in prep
87469ef
# ISC:
87469ef
#   - src/boringssl/crypto_test_data.cc and src/boringssl/err_data.c
87469ef
#     * Removed in prep; not used when building with system OpenSSL
87469ef
# BSD:
87469ef
#   - src/objective-c/*.podspec and templates/src/objective-c/*.podspec.template
87469ef
#     * Unused since the Objective-C bindings are not currently built
87469ef
# MIT:
87469ef
#   - third_party/cares/ares_build.h
87469ef
#     * Removed in prep; header from system C-Ares used instead
87469ef
#   - third_party/rake-compiler-dock/
87469ef
#     * Removed in prep, since we build no containers
87469ef
#   - third_party/upb/third_party/lunit/
87469ef
#     * Removed in prep, since there is no obvious way to run the upb tests
87469ef
License:        ASL 2.0 and BSD
87469ef
URL:            https://www.%{name}.io
87469ef
%global forgeurl https://github.com/%{name}/%{name}/
87469ef
Source0:        %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz
acc3813
# Used only at build time (not a bundled library); see notes at definition of
acc3813
# gtest_version macro for explanation and justification.
6abb104
%global gtest_url https://github.com/google/googletest
6abb104
%global gtest_archivename googletest-release-%{gtest_version}
6abb104
Source1:        https://github.com/google/googletest/archive/release-%{gtest_version}/%{gtest_archivename}.tar.gz
87469ef
87469ef
# ~~~~ C (core) and C++ (cpp) ~~~~
87469ef
87469ef
BuildRequires:  gcc-c++
34ecf95
%if %{with cmake}
34ecf95
BuildRequires:  cmake
34ecf95
BuildRequires:  ninja-build
34ecf95
%else
87469ef
BuildRequires:  make
34ecf95
%endif
87469ef
BuildRequires:  chrpath
87469ef
5ab84a2
BuildRequires:  pkgconfig(zlib)
5ab84a2
BuildRequires:  cmake(gflags)
5ab84a2
BuildRequires:  pkgconfig(protobuf)
87469ef
BuildRequires:  protobuf-compiler
5ab84a2
5ab84a2
BuildRequires:  pkgconfig(openssl)
5ab84a2
BuildRequires:  cmake(c-ares)
34ecf95
34ecf95
%if %{with core_tests}
5ab84a2
BuildRequires:  cmake(benchmark)
acc3813
%if %{with system_gtest}
5ab84a2
BuildRequires:  cmake(gtest)
5ab84a2
BuildRequires:  pkgconfig(gmock)
5ab84a2
BuildRequires:  pkgconfig(libprofiler)
34ecf95
%endif
acc3813
%endif
87469ef
87469ef
# ~~~~ Python ~~~~
87469ef
87469ef
%global set_grpc_python_environment %{expand:
2d85140
export GRPC_PYTHON_BUILD_WITH_CYTHON='True'
2d85140
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL='True'
2d85140
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB='True'
2d85140
export GRPC_PYTHON_BUILD_SYSTEM_CARES='True'
2d85140
export GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY='True'
2d85140
export GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD='True'
2d85140
}
87469ef
87469ef
BuildRequires:  python3-devel
986bbc8
BuildRequires:  python3dist(setuptools)
986bbc8
986bbc8
# grpcio (setup.py) setup_requires (with
986bbc8
#     GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD):
986bbc8
BuildRequires:  python3dist(sphinx)
986bbc8
986bbc8
# grpcio (setup.py) setup_requires (with
986bbc8
#     GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD):
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
BuildRequires:  python3dist(six) >= 1.10
986bbc8
# grpcio (setup.py) install_requires also has:
986bbc8
#   six>=1.5.2
986bbc8
986bbc8
# grpcio (setup.py) setup_requires (with GRPC_PYTHON_BUILD_WITH_CYTHON, or
986bbc8
# absent generated sources); also needed for grpcio_tools
986bbc8
# (tools/distrib/python/grpcio_tools/setup.py)
87469ef
BuildRequires:  python3dist(cython)
986bbc8
986bbc8
# grpcio (setup.py) install_requires:
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
#   futures>=2.2.0; python_version<'3.2'
986bbc8
986bbc8
# grpcio (setup.py) install_requires:
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
#   enum34>=1.0.4; python_version<'3.4'
986bbc8
986bbc8
# grpcio_channelz (src/python/grpcio_channelz/setup.py) install_requires:
986bbc8
# grpcio_health_checking (src/python/grpcio_health_checking/setup.py)
986bbc8
#     install_requires:
986bbc8
# grpcio_reflection (src/python/grpcio_reflection/setup.py) install_requires:
986bbc8
# grpcio_status (src/python/grpcio_status/setup.py) install_requires:
986bbc8
# grpcio_testing (src/python/grpcio_testing/setup.py) install_requires:
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
BuildRequires:  python3dist(protobuf) >= 3.6.0
986bbc8
# grpcio_tools (tools/distrib/python/grpcio_tools/setup.py) install_requires
986bbc8
# also has:
986bbc8
#   protobuf>=3.5.0.post1
986bbc8
# which is written as
986bbc8
#   python3dist(protobuf) >= 3.5^post1
986bbc8
986bbc8
# grpcio_status (src/python/grpcio_status/setup.py) install_requires:
986bbc8
BuildRequires:  python3dist(googleapis-common-protos) >= 1.5.5
986bbc8
986bbc8
# Several packages have dependencies on grpcio or grpcio_tools—and grpcio-tests
986bbc8
# depends on all of the other Python packages—which are satisfied within this
986bbc8
# package.
986bbc8
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
BuildRequires:  python3dist(coverage) >= 4.0
986bbc8
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
BuildRequires:  python3dist(oauth2client) >= 1.4.7
986bbc8
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
BuildRequires:  python3dist(google-auth) >= 1.0.0
986bbc8
986bbc8
# grpcio_tests (src/python/grpcio_tests/setup.py) install_requires:
986bbc8
BuildRequires:  python3dist(requests) >= 2.4.12
986bbc8
934e38f
# Required for “test_gevent” tests:
934e38f
BuildRequires:  python3dist(gevent)
87469ef
87469ef
# ~~~~ Miscellaneous ~~~~
87469ef
87469ef
# https://bugzilla.redhat.com/show_bug.cgi?id=1893533
87469ef
%global _lto_cflags %{nil}
87469ef
119766d
# Reference documentation
119766d
BuildRequires:  doxygen
119766d
87469ef
BuildRequires:  ca-certificates
87469ef
# For converting absolute symlinks in the buildroot to relative ones
87469ef
BuildRequires:  symlinks
87469ef
87469ef
BuildRequires:  dos2unix
87469ef
2229437
# Apply Fedora system crypto policies. Since this is Fedora-specific, the patch
2229437
# is not suitable for upstream.
87469ef
# https://docs.fedoraproject.org/en-US/packaging-guidelines/CryptoPolicies/#_cc_applications
87469ef
Patch0:         %{name}-0001-enforce-system-crypto-policies.patch
34ecf95
# Make gRPC podspec template more robust
34ecf95
# https://github.com/grpc/grpc/pull/21445
87469ef
Patch3:         99f8a10aec994a8957fbb6787768b444ef34d6a2.patch
34ecf95
# Remove grpc sources from grpc++
34ecf95
# https://github.com/grpc/grpc/pull/21662
87469ef
Patch4:         72351f63fd650cc7acfcd2d0307e8e8e8f777283.patch
87469ef
# Backport upstream commit 9e0b427893b65b220faf8a31a6afdc67f6f41364 “Use !=
87469ef
# with literals”
87469ef
Patch6:         %{name}-1.26.0-python-SyntaxWarning.patch
87469ef
# Build python3-grpcio_tools against system protobuf packages instead of
87469ef
# expecting a git submodule. Must also add requisite linker flags using
87469ef
# GRPC_PYTHON_LDFLAGS.
87469ef
Patch8:         %{name}-1.26.0-python-grpcio_tools-use-system-protobuf.patch
87469ef
# In grpcio-tests, require enum34 for install only on those ancient Pythons
87469ef
# that require it; we are not using such a Python!
87469ef
Patch10:        %{name}-1.26.0-grpcio-tests-conditionalize-enum34.patch
53fe707
# Fix errors like:
53fe707
#   TypeError: super(type, obj): obj must be an instance or subtype of type
53fe707
# It is not clear why these occur.
53fe707
Patch11:        %{name}-1.26.0-python-grpcio_tests-fixture-super.patch
53fe707
# Skip tests requiring non-loopback network access when the
53fe707
# FEDORA_NO_NETWORK_TESTS environment variable is set.
53fe707
Patch12:        %{name}-1.26.0-grpcio_tests-make-network-tests-skippable.patch
53fe707
# Fix link errors in the core tests: the test library grpc_test_util_unsecure
53fe707
# does require the “secure” library “grpc”
53fe707
Patch13:        %{name}-1.26.0-core-tests-link-errors.patch
53fe707
# A handful of compression tests miss the compression ratio threshold. It seems
53fe707
# to be inconsistent which particular combinations fail in a particular test
53fe707
# run. It is not clear that this is a real problem. Any help in understanding
53fe707
# the actual cause well enough to fix this or usefully report it upstream is
53fe707
# welcome.
53fe707
Patch14:        %{name}-1.36.0-python-grpcio_tests-skip-compression-tests.patch
87469ef
87469ef
Requires:       %{name}-data = %{version}-%{release}
87469ef
87469ef
# Upstream https://github.com/protocolbuffers/upb does not support building
87469ef
# with anything other than Bazel, and Bazel is not likely to make it into
87469ef
# Fedora anytime soon due to its nightmarish collection of dependencies.
87469ef
# Monitor this at https://bugzilla.redhat.com/show_bug.cgi?id=1470842.
87469ef
# Therefore upb cannot be packaged for Fedora, and we must use the bundled copy.
87469ef
#
87469ef
# Note that upstream has never chosen a version, and it is not clear from which
87469ef
# commit the bundled copy was taken or forked.
87469ef
#
87469ef
# Note also that libupb is installed in the system-wide linker path, which will
87469ef
# be a problem if upb is ever packaged separately. We will cross that bridge if
87469ef
# we get there.
87469ef
Provides:       bundled(upb)
87469ef
87469ef
# Regarding third_party/address_sorting: this looks a bit like a bundled
87469ef
# library, but it is not. From a source file comment:
87469ef
#   This is an adaptation of Android's implementation of RFC 6724 (in Android’s
87469ef
#   getaddrinfo.c). It has some cosmetic differences from Android’s
87469ef
#   getaddrinfo.c, but Android’s getaddrinfo.c was used as a guide or example
87469ef
#   of a way to implement the RFC 6724 spec when this was written.
b3bb2c6
bf7e9a8
%description
bf7e9a8
gRPC is a modern open source high performance RPC framework that can run in any
bf7e9a8
environment. It can efficiently connect services in and across data centers
bf7e9a8
with pluggable support for load balancing, tracing, health checking and
bf7e9a8
authentication. It is also applicable in last mile of distributed computing to
bf7e9a8
connect devices, mobile applications and browsers to backend services.
bf7e9a8
bf7e9a8
The main usage scenarios:
bf7e9a8
56e498c
  • Efficiently connecting polyglot services in microservices style architecture
56e498c
  • Connecting mobile devices, browser clients to backend services
56e498c
  • Generating efficient client libraries
bf7e9a8
bf7e9a8
Core Features that make it awesome:
bf7e9a8
56e498c
  • Idiomatic client libraries in 10 languages
56e498c
  • Highly efficient on wire and with a simple service definition framework
56e498c
  • Bi-directional streaming with http/2 based transport
56e498c
  • Pluggable auth, tracing, load balancing and health checking
87469ef
87469ef
This package provides the shared C core library.
87469ef
87469ef
87469ef
%package data
87469ef
Summary:        Data for gRPC bindings
87469ef
License:        ASL 2.0
87469ef
BuildArch:      noarch
87469ef
87469ef
Requires:       ca-certificates
87469ef
87469ef
%description data
87469ef
Common data for gRPC bindings: currently, this contains only a symbolic link to
87469ef
the system shared TLS certificates.
87469ef
87469ef
87469ef
%package doc
87469ef
Summary:        Documentation and examples for gRPC
87469ef
License:        ASL 2.0
87469ef
BuildArch:      noarch
87469ef
119766d
Obsoletes:      python-grpcio-doc < 1.26.0-13
119766d
Provides:       python-grpcio-doc = %{version}-%{release}
119766d
Provides:       python-grpcio-channelz-doc = %{version}-%{release}
119766d
Provides:       python-grpcio-health-checking-doc = %{version}-%{release}
119766d
Provides:       python-grpcio-reflection-doc = %{version}-%{release}
119766d
Provides:       python-grpcio-status-doc = %{version}-%{release}
119766d
Provides:       python-grpcio-testing-doc = %{version}-%{release}
119766d
87469ef
%description doc
119766d
Documentation and examples for gRPC, including documentation for the following:
119766d
119766d
  • C (core)
119766d
    ○ API
119766d
    ○ Internals
119766d
  • C++
119766d
    ○ API
119766d
    ○ Internals
119766d
  • Objective C
119766d
    ○ API
119766d
    ○ Internals
119766d
  • Python
119766d
    ○ grpcio
119766d
    ○ grpcio_channelz
119766d
    ○ grpcio_health_checking
119766d
    ○ grpcio_reflection
119766d
    ○ grpcio_status
119766d
    ○ grpcio_testing
87469ef
87469ef
87469ef
%package cpp
87469ef
Summary:        C++ language bindings for gRPC
87469ef
# License:        same as base package
87469ef
Requires:       %{name}%{?_isa} = %{version}-%{release}
87469ef
87469ef
%description cpp
87469ef
C++ language bindings for gRPC.
bf7e9a8
bf7e9a8
bf7e9a8
%package plugins
87469ef
Summary:        Protocol buffers compiler plugins for gRPC
87469ef
# License:        same as base package
87469ef
Requires:       %{name}%{?_isa} = %{version}-%{release}
87469ef
Requires:       protobuf-compiler
bf7e9a8
bf7e9a8
%description plugins
bf7e9a8
Plugins to the protocol buffers compiler to generate gRPC sources.
bf7e9a8
87469ef
bf7e9a8
%package cli
87469ef
Summary:        Command-line tool for gRPC
87469ef
# License:        same as base package
87469ef
Requires:       %{name}%{?_isa} = %{version}-%{release}
bf7e9a8
bf7e9a8
%description cli
87469ef
The command line tool can do the following things:
87469ef
56e498c
  • Send unary rpc.
56e498c
  • Attach metadata and display received metadata.
56e498c
  • Handle common authentication to server.
56e498c
  • Infer request/response types from server reflection result.
56e498c
  • Find the request/response types from a given proto file.
56e498c
  • Read proto request in text form.
56e498c
  • Read request in wire form (for protobuf messages, this means serialized
87469ef
    binary form).
56e498c
  • Display proto response in text form.
56e498c
  • Write response in wire form to a file.
87469ef
bf7e9a8
bf7e9a8
%package devel
87469ef
Summary:        Development files for gRPC library
87469ef
# License:        same as base package
87469ef
Requires:       %{name}%{?_isa} = %{version}-%{release}
87469ef
Requires:       %{name}-cpp%{?_isa} = %{version}-%{release}
41172ba
Requires:       cmake-filesystem
bf7e9a8
bf7e9a8
%description devel
87469ef
Development headers and files for gRPC libraries (both C and C++).
87469ef
bf7e9a8
637ef64
%package -n python3-grpcio
87469ef
Summary:        Python language bindings for gRPC
87469ef
# License:        same as base package
5c54e16
%if 0%{?fedora} == 32
5c54e16
%py_provides python3-grpcio
5c54e16
%endif
87469ef
87469ef
# Note that the Python package has no runtime dependency on the base C library;
87469ef
# everything it needs is bundled.
87469ef
Requires:       %{name}-data = %{version}-%{release}
637ef64
637ef64
%description -n python3-grpcio
87469ef
Python language bindings for gRPC (HTTP/2-based RPC framework).
87469ef
87469ef
87469ef
%package -n python3-grpcio-tools
87469ef
Summary:       Package for gRPC Python tools
87469ef
# License:        same as base package
5c54e16
%if 0%{?fedora} == 32
5c54e16
%py_provides python3-grpcio-tools
5c54e16
%endif
87469ef
87469ef
%description -n python3-grpcio-tools
87469ef
Package for gRPC Python tools.
87469ef
87469ef
87469ef
%package -n python3-grpcio-channelz
87469ef
Summary:        Channel Level Live Debug Information Service for gRPC
87469ef
License:        ASL 2.0
87469ef
BuildArch:      noarch
5c54e16
%if 0%{?fedora} == 32
5c54e16
%py_provides python3-grpcio-channelz
5c54e16
%endif
87469ef
87469ef
%description -n python3-grpcio-channelz
87469ef
Channelz is a live debug tool in gRPC Python.
87469ef
87469ef
87469ef
%package -n python3-grpcio-health-checking
87469ef
Summary:        Standard Health Checking Service for gRPC
87469ef
License:        ASL 2.0
87469ef
BuildArch:      noarch
5c54e16
%if 0%{?fedora} == 32
5c54e16
%py_provides python3-grpcio-health-checking
5c54e16
%endif
87469ef
87469ef
%description -n python3-grpcio-health-checking
87469ef
Reference package for GRPC Python health checking.
87469ef
87469ef
87469ef
%package -n python3-grpcio-reflection
87469ef
Summary:        Standard Protobuf Reflection Service for gRPC
87469ef
License:        ASL 2.0
87469ef
BuildArch:      noarch
5c54e16
%if 0%{?fedora} == 32
5c54e16
%py_provides python3-grpcio-reflections
5c54e16
%endif
87469ef
87469ef
%description -n python3-grpcio-reflection
87469ef
Reference package for reflection in GRPC Python.
87469ef
87469ef
87469ef
%package -n python3-grpcio-status
87469ef
Summary:        Status proto mapping for gRPC
87469ef
License:        ASL 2.0
87469ef
BuildArch:      noarch
5c54e16
%if 0%{?fedora} == 32
5c54e16
%py_provides python3-grpcio-status
5c54e16
%endif
87469ef
87469ef
%description -n python3-grpcio-status
87469ef
Reference package for GRPC Python status proto mapping.
87469ef
87469ef
87469ef
%package -n python3-grpcio-testing
87469ef
Summary:        Testing utilities for gRPC Python
87469ef
License:        ASL 2.0
87469ef
BuildArch:      noarch
5c54e16
%if 0%{?fedora} == 32
5c54e16
%py_provides python3-grpcio-testing
5c54e16
%endif
87469ef
87469ef
%description -n python3-grpcio-testing
87469ef
Testing utilities for gRPC Python.
87469ef
87469ef
bf7e9a8
%prep
87469ef
%autosetup -p1
34ecf95
%if %{without cmake}
87469ef
sed -i \
87469ef
    -e 's:^prefix ?= .*:prefix ?= %{_prefix}:' \
87469ef
    -e 's:$(prefix)/lib:$(prefix)/%{_lib}:' \
87469ef
    -e 's:^GTEST_LIB =.*::' Makefile
34ecf95
%endif
87469ef
acc3813
%if %{without system_gtest}
acc3813
# Copy in the needed gtest/gmock implementations.
acc3813
%setup -q -T -D -b 1
acc3813
rm -rvf 'third_party/googletest'
6abb104
mv '../%{gtest_archivename}' 'third_party/googletest'
acc3813
%else
acc3813
# Patch CMakeLists for external gtest/gmock.
acc3813
#
acc3813
#  1. Create dummy sources, adding a typedef so the translation unit is not
acc3813
#     empty, rather than removing references to these sources from
acc3813
#     CMakeLists.txt. This is so that we do not end up with executables with no
acc3813
#     sources, only libraries, which is a CMake error.
acc3813
#  2. Either remove references to the corresponding include directories, or
acc3813
#     create the directories and leave them empty.
acc3813
#  3. “Stuff” the external library into the target_link_libraries() for each
acc3813
#     test by noting that GMock/GTest/GFlags are always used together.
acc3813
for gwhat in test mock
acc3813
do
acc3813
  mkdir -p "third_party/googletest/google${gwhat}/src" \
acc3813
      "third_party/googletest/google${gwhat}/include"
acc3813
  echo "typedef int dummy_${gwhat}_type;" \
acc3813
      > "third_party/googletest/google${gwhat}/src/g${gwhat}-all.cc"
acc3813
done
acc3813
sed -r -i 's/^([[:blank:]]*)(\$\{_gRPC_GFLAGS_LIBRARIES\})/'\
acc3813
'\1\2\n\1gtest\n\1gmock/' CMakeLists.txt
acc3813
%endif
acc3813
426ac1e
# Currently, the correct flags for linking against the gflags shared library
426ac1e
# are silently not found. Since the gflags dependency goes away in a later
426ac1e
# version of grpc, we just hack in the correct flags rather than taking the
426ac1e
# time to fix it properly.
426ac1e
sed -r -i 's/^([[:blank:]]*)(\$\{_gRPC_GFLAGS_LIBRARIES\})/'\
426ac1e
'\1gflags_shared/' CMakeLists.txt
9af26a9
87469ef
# Fix some of the weirdest accidentally-executable files
87469ef
find . -type f -name '*.md' -perm /0111 -execdir chmod -v a-x '{}' '+'
87469ef
87469ef
# Allow building Python documentation with a newer Sphinx; the upstream version
87469ef
# requirement is needlessly strict. (It is fine for upstream’s own purposes, as
87469ef
# they are happy to build documentation with a pinned old version.)
87469ef
sed -r -i "s/('Sphinx)~=.*'/\1'/" setup.py
87469ef
87469ef
# Remove unused sources that have licenses not in the License field, to ensure
87469ef
# they are not accidentally used in the build. See the comment above the base
87469ef
# package License field for more details.
87469ef
rm -rfv \
87469ef
    src/boringssl/*.c src/boringssl/*.cc \
87469ef
    third_party/cares/ares_build.h \
87469ef
    third_party/rake-compiler-dock \
87469ef
    third_party/upb/third_party/lunit
87469ef
# Since we are replacing roots.pem with a symlink to the shared system
87469ef
# certificates, we do not include its license (MPLv2.0) in any License field.
87469ef
# We remove its contents so that, if we make a packaging mistake, we will have
87469ef
# a bug but not an incorrect License field.
87469ef
echo '' > etc/roots.pem
87469ef
87469ef
# Remove Android sources and examples. We do not need these on Linux, and they
87469ef
# have some issues that will be flagged when reviewing the package, such as:
87469ef
#   - Another copy of the MPLv2.0-licensed certificate bundle from
87469ef
#     etc/roots.pem, in src/android/test/interop/app/src/main/assets/roots.pem
87469ef
#   - Pre-built jar files at
87469ef
#     src/android/test/interop/gradle/wrapper/gradle-wrapper.jar and
87469ef
#     examples/android/helloworld/gradle/wrapper/gradle-wrapper.jar
87469ef
rm -rvf examples/android src/android
87469ef
87469ef
# Remove unwanted .gitignore files, generally in examples. One could argue that
87469ef
# a sample .gitignore file is part of the example, but, well, we’re not going
87469ef
# to do that.
87469ef
find . -type f -name .gitignore -print -delete
87469ef
87469ef
# Find executables with /usr/bin/env shebangs in the examples, and fix them.
87469ef
find examples -type f -perm /0111 |
87469ef
  while read -r fn
87469ef
  do
87469ef
    if head -n 1 "${fn}" | grep -E '^#!/usr/bin/env[[:blank:]]'
87469ef
    then
87469ef
      sed -r -i '1{s|^(#!/usr/bin/)env[[:blank:]]+([^[:blank:]]+)|\1\2|}' \
87469ef
          "${fn}"
87469ef
    fi
87469ef
  done
87469ef
87469ef
# Fix some CRNL line endings:
87469ef
dos2unix \
87469ef
    examples/cpp/helloworld/CMakeLists.txt \
87469ef
    examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt
87469ef
# We leave those under examples/csharp alone.
87469ef
78adfdc
# Fix the install path for .pc files
78adfdc
# https://github.com/grpc/grpc/issues/25635
78adfdc
sed -r -i 's|lib(/pkgconfig)|\${gRPC_INSTALL_LIBDIR}\1|' CMakeLists.txt
78adfdc
426ac1e
%if %{without unexplained_failing_python_lite_tests}
426ac1e
%ifarch %{arm32}
426ac1e
# TODO figure out how to report this upstream in a useful/actionable way
426ac1e
sed -r -i "s/^([[:blank:]]*)(def test_concurrent_stream_stream)\\b/\
426ac1e
\\1@unittest.skip('May hang unexplainedly')\\n\\1\\2/" \
426ac1e
    'src/python/grpcio_tests/tests/testing/_client_test.py'
426ac1e
%endif
7789765
%ifarch %{ix86} %{arm32}
426ac1e
# These tests fail with:
426ac1e
#   OverflowError: Python int too large to convert to C ssize_t
426ac1e
# TODO figure out how to report this upstream in a useful/actionable way
426ac1e
sed -r -i \
426ac1e
    "s/^([[:blank:]]*)(def test(SSLSessionCacheLRU|SessionResumption))\\b/\
426ac1e
\\1@unittest.skip('Unexplained overflow error on 32-bit')\\n\\1\\2/" \
426ac1e
    'src/python/grpcio_tests/tests/unit/_auth_context_test.py' \
426ac1e
    'src/python/grpcio_tests/tests/unit/_session_cache_test.py'
426ac1e
%endif
426ac1e
426ac1e
# These will no longer be a problem on grpc 1.36:
426ac1e
sed -r -i \
426ac1e
    "s/^([[:blank:]]*)(class SecureServerSecureClient\(.*:)$/\
426ac1e
\\1@unittest.skip('Unexplained hang')\\n\\1\\2/" \
426ac1e
    'src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py'
426ac1e
sed -r -i \
426ac1e
    "s/^([[:blank:]]*)(def test_(stream_unary|unary_stream))\\b/\
426ac1e
\\1@unittest.skip('Unexplained hang')\\n\\1\\2/" \
426ac1e
    'src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py'
426ac1e
sed -r -i \
426ac1e
    "s/^([[:blank:]]*)(def test(Secure(No|Client)Cert|SessionResumption))\\b/\
426ac1e
\\1@unittest.skip('Invalid cert chain file')\\n\\1\\2/" \
426ac1e
    'src/python/grpcio_tests/tests/unit/_auth_context_test.py'
b41de1c
%ifnarch %{ix86} %{arm32}
426ac1e
# (otherwise this was already done above)
426ac1e
sed -r -i \
426ac1e
    "s/^([[:blank:]]*)(def testSSLSessionCacheLRU)\\b/\
426ac1e
\\1@unittest.skip('Invalid cert chain file')\\n\\1\\2/" \
426ac1e
    'src/python/grpcio_tests/tests/unit/_session_cache_test.py'
426ac1e
%endif
426ac1e
sed -r -i \
426ac1e
    "s/^([[:blank:]]*)(def test_(stream_stream|unary_unary|stub_context))\\b/\
426ac1e
\\1@unittest.skip('Invalid cert chain file')\\n\\1\\2/" \
426ac1e
    'src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py'
426ac1e
%endif
426ac1e
bf7e9a8
bf7e9a8
%build
87469ef
# ~~~~ C (core) and C++ (cpp) ~~~~
87469ef
34ecf95
%if %{with cmake}
34ecf95
# We could use either make or ninja as the backend; ninja is faster and has no
34ecf95
# disadvantages (except a small additional BR, given we already need Python)
34ecf95
%cmake \
e1dddac
    -DgRPC_INSTALL:BOOL=ON \
e1dddac
    -DgRPC_INSTALL_BINDIR:PATH=%{_bindir} \
e1dddac
    -DgRPC_INSTALL_LIBDIR:PATH=%{_libdir} \
e1dddac
    -DgRPC_INSTALL_INCLUDEDIR:PATH=%{_includedir} \
e1dddac
    -DgRPC_INSTALL_CMAKEDIR:PATH=%{_libdir}/cmake/%{name} \
e1dddac
    -DgRPC_INSTALL_SHAREDIR:PATH=%{_datadir}/%{name} \
34ecf95
    -DgRPC_BUILD_TESTS:BOOL=%{?with_core_tests:ON}%{?!with_core_tests:OFF} \
34ecf95
    -DgRPC_BUILD_CODEGEN:BOOL=ON \
e1dddac
    -DgRPC_BUILD_CSHARP_EXT:BOOL=ON \
34ecf95
    -DgRPC_BACKWARDS_COMPATIBILITY_MODE:BOOL=OFF \
34ecf95
    -DgRPC_ZLIB_PROVIDER:STRING='package' \
34ecf95
    -DgRPC_CARES_PROVIDER:STRING='package' \
34ecf95
    -DgRPC_SSL_PROVIDER:STRING='package' \
34ecf95
    -DgRPC_PROTOBUF_PROVIDER:STRING='package' \
34ecf95
    -DgRPC_PROTOBUF_PACKAGE_TYPE:STRING='MODULE' \
34ecf95
    -DgRPC_GFLAGS_PROVIDER:STRING='package' \
34ecf95
    -DgRPC_BENCHMARK_PROVIDER:STRING='package' \
e1dddac
    -DgRPC_USE_PROTO_LITE:BOOL=OFF \
e1dddac
    -DgRPC_BUILD_GRPC_CPP_PLUGIN:BOOL=ON \
e1dddac
    -DgRPC_BUILD_GRPC_CSHARP_PLUGIN:BOOL=ON \
e1dddac
    -DgRPC_BUILD_GRPC_NODE_PLUGIN:BOOL=ON \
e1dddac
    -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN:BOOL=ON \
e1dddac
    -DgRPC_BUILD_GRPC_PHP_PLUGIN:BOOL=ON \
e1dddac
    -DgRPC_BUILD_GRPC_PYTHON_PLUGIN:BOOL=ON \
e1dddac
    -DgRPC_BUILD_GRPC_RUBY_PLUGIN:BOOL=ON \
e1dddac
    -GNinja
34ecf95
%cmake_build
34ecf95
%else
87469ef
%set_build_flags
87469ef
# Default targets are: static shared plugins
bf7e9a8
%make_build shared plugins
34ecf95
%endif
bf7e9a8
87469ef
# ~~~~ Python ~~~~
87469ef
87469ef
# Since we will need all of the Python packages for the documentation build,
87469ef
# and there are some other interdependencies (e.g., many have setup_requires:
87469ef
# grpcio-tools), we do a temporary install of the built packages into a local
87469ef
# directory, and add it to the PYTHONPATH.
87469ef
PYROOT="${PWD}/%{_vpath_builddir}/pyroot"
87469ef
if [ -n "${PYTHONPATH-}" ]; then PYTHONPATH="${PYTHONPATH}:"; fi
87469ef
PYTHONPATH="${PYTHONPATH-}${PYROOT}%{python3_sitelib}"
87469ef
PYTHONPATH="${PYTHONPATH}:${PYROOT}%{python3_sitearch}"
87469ef
export PYTHONPATH
87469ef
87469ef
# ~~ grpcio ~~
87469ef
%set_grpc_python_environment
7796406
# We must set GRPC_PYTHON_CFLAGS to avoid unwanted defaults. We take the
7796406
# upstream flags except that we remove -std=c99, which is inapplicable to the
7796406
# C++ parts of the extension.
7796406
#
7796406
# We must set GRPC_PYTHON_LDFLAGS to avoid unwanted defaults. The upstream
7796406
# flags attempt to statically link libgcc, so we do not need any of them. Since
7796406
# we forcibly unbundle protobuf, we need to add linker flags for protobuf
7796406
# ourselves.
7796406
export GRPC_PYTHON_CFLAGS="-fvisibility=hidden -fno-wrapv -fno-exceptions $(
7796406
  pkg-config --cflags protobuf
7796406
)"
7796406
export GRPC_PYTHON_LDFLAGS="$(pkg-config --libs protobuf)"
87469ef
%py3_build
87469ef
%{__python3} %{py_setup} %{?py_setup_args} install \
87469ef
    -O1 --skip-build --root "${PYROOT}"
87469ef
87469ef
# ~~ grpcio-tools ~~
87469ef
pushd "tools/distrib/python/grpcio_tools/" >/dev/null
87469ef
# When copying more things in here, make sure the subpackage License field
87469ef
# stays correct. We need copies, not symlinks, so that the “graft” in
87469ef
# MANIFEST.in works.
87469ef
mkdir -p %{name}_root/src
87469ef
for srcdir in compiler
87469ef
do
87469ef
  cp -rp "../../../../src/${srcdir}" "%{name}_root/src/"
87469ef
done
87469ef
cp -rp '../../../../include' '%{name}_root/'
7796406
# We must set GRPC_PYTHON_CFLAGS and GRPC_PYTHON_LDFLAGS again; grpcio_tools
7796406
# does not have the same default upstream flags as grpcio does, and it needs to
7796406
# link the protobuf compiler library.
7796406
export GRPC_PYTHON_CFLAGS="-fno-wrapv -frtti $(pkg-config --cflags protobuf)"
7796406
export GRPC_PYTHON_LDFLAGS="$(pkg-config --libs protobuf) -lprotoc"
7796406
%py3_build
87469ef
# Remove unwanted shebang from grpc_tools.protoc source file, which will be
87469ef
# installed without an executable bit:
87469ef
find . -type f -name protoc.py -execdir sed -r -i '1{/^#!/d}' '{}' '+'
87469ef
%{__python3} %{py_setup} %{?py_setup_args} install \
87469ef
    -O1 --skip-build --root "${PYROOT}"
87469ef
popd >/dev/null
87469ef
87469ef
# ~~ pure-python modules grpcio-* ~~
7796406
for suffix in channelz health_checking reflection status testing tests
87469ef
do
87469ef
  echo "----> grpcio_${suffix} <----" 1>&2
87469ef
  pushd "src/python/grpcio_${suffix}/" >/dev/null
7796406
  %{__python3} %{py_setup} %{?py_setup_args} preprocess
7796406
  if [ "${suffix}" != 'testing' ]
7796406
  then
7796406
    %{__python3} %{py_setup} %{?py_setup_args} build_package_protos
7796406
  fi
87469ef
  %py3_build
87469ef
  %{__python3} %{py_setup} %{?py_setup_args} install \
87469ef
      -O1 --skip-build --root "${PYROOT}"
87469ef
  popd >/dev/null
87469ef
done
87469ef
87469ef
# ~~ documentation ~~
119766d
# Doxygen (reference: C/core, C++, objc)
119766d
./tools/doxygen/run_doxygen.sh
119766d
# Sphinx (Python)
87469ef
%{__python3} %{py_setup} %{?py_setup_args} doc
119766d
rm -vrf doc/build/.buildinfo doc/build/.doctrees
87469ef
637ef64
bf7e9a8
%install
87469ef
# ~~~~ C (core) and C++ (cpp) ~~~~
34ecf95
%if %{with cmake}
34ecf95
%cmake_install
dc22a8a
# For some reason, grpc_cli is not installed. Do it manually.
dc22a8a
install -t '%{buildroot}%{_bindir}' -p -D '%{_vpath_builddir}/%{name}_cli'
dc22a8a
# grpc_cli build does not respect CMAKE_INSTALL_RPATH
dc22a8a
# https://github.com/grpc/grpc/issues/25176
dc22a8a
chrpath --delete '%{buildroot}%{_bindir}/%{name}_cli'
34ecf95
%else
87469ef
export STRIP=/bin/true
87469ef
make install prefix='%{buildroot}%{_prefix}'
87469ef
make install-grpc-cli prefix='%{buildroot}%{_prefix}'
87469ef
chrpath --delete '%{buildroot}%{_bindir}/%{name}_cli'
34ecf95
%endif
87469ef
# Remove any static libraries that may have been installed against our wishes
87469ef
find %{buildroot} -type f -name '*.a' -print -delete
87469ef
# Fix wrong permissions on installed headers
87469ef
find %{buildroot}%{_includedir}/%{name}* -type f -name '*.h' -perm /0111 \
87469ef
    -execdir chmod -v a-x '{}' '+'
87469ef
87469ef
# ~~~~ Python ~~~~
87469ef
87469ef
# Since several packages have an install_requires: grpcio-tools, we must ensure
87469ef
# the buildroot Python site-packages directories are in the PYTHONPATH.
87469ef
pushd '%{buildroot}'
87469ef
PYROOT="${PWD}"
87469ef
popd
87469ef
if [ -n "${PYTHONPATH-}" ]; then PYTHONPATH="${PYTHONPATH}:"; fi
87469ef
PYTHONPATH="${PYTHONPATH-}${PYROOT}%{python3_sitelib}"
87469ef
PYTHONPATH="${PYTHONPATH}:${PYROOT}%{python3_sitearch}"
87469ef
export PYTHONPATH
87469ef
87469ef
# ~~ grpcio ~~
87469ef
%py3_install
87469ef
87469ef
# ~~ grpcio-tools ~~
87469ef
pushd "tools/distrib/python/grpcio_tools/" >/dev/null
637ef64
%py3_install
87469ef
popd >/dev/null
87469ef
87469ef
# ~~ pure-python modules grpcio-* ~~
87469ef
for suffix in channelz health_checking reflection status testing
87469ef
do
87469ef
  pushd "src/python/grpcio_${suffix}/" >/dev/null
87469ef
  %py3_install
87469ef
  popd >/dev/null
87469ef
done
91ffc30
# The grpcio_tests package should not be installed; it would provide top-level
91ffc30
# packages with generic names like “tests” or “tests_aio”.
87469ef
87469ef
# ~~~~ Miscellaneous ~~~~
87469ef
87469ef
# Replace copies of the certificate bundle with symlinks to the shared system
87469ef
# certificates. This has the following benefits:
87469ef
#   - Reduces duplication and save space
87469ef
#   - Respects system-wide administrative trust configuration
87469ef
#   - Keeps “MPLv2.0” from having to be added to a number of License fields
87469ef
%global sysbundle %{_sysconfdir}/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
87469ef
# We do not own this file; we temporarily install it in the buildroot so we do
87469ef
# not have dangling symlinks.
87469ef
install -D -t "%{buildroot}$(dirname '%{sysbundle}')" -m 0644 '%{sysbundle}'
87469ef
87469ef
find '%{buildroot}' -type f -name 'roots.pem' |
87469ef
  while read -r fn
87469ef
  do
87469ef
    ln -s -f "%{buildroot}%{sysbundle}" "${fn}"
87469ef
    symlinks -c -o "${fn}"
87469ef
  done
87469ef
13d2166
rm -rvf "%{buildroot}$(dirname '%{sysbundle}')"
13d2166
87469ef
# ~~ documentation and examples ~~
87469ef
87469ef
install -D -t '%{buildroot}%{_pkgdocdir}' -m 0644 -p AUTHORS *.md
119766d
cp -rp doc/ref examples '%{buildroot}%{_pkgdocdir}'
119766d
install -d '%{buildroot}%{_pkgdocdir}/python'
119766d
cp -rp doc/build '%{buildroot}%{_pkgdocdir}/python/html'
87469ef
87469ef
87469ef
%check
53fe707
export FEDORA_NO_NETWORK_TESTS=1
53fe707
34ecf95
%if %{with core_tests} && %{with cmake}
ee2d9c9
# Note that no tests are actually found by ctest:
34ecf95
%ctest
ee2d9c9
ee2d9c9
# Exclude tests that are known to hang. Assistance welcome in figuring out what
ee2d9c9
# is wrong with these, especially if the hangs persist in the latest upstream
ee2d9c9
# version. Note, however, that we are running the tests very differently from
ee2d9c9
# upstream, which uses scripts in tools/run_tests/ that rebuild the entire
ee2d9c9
# source and use Docker, so it is likely to be difficult to get help from
ee2d9c9
# upstream for any failures here. Note that some of these tests would never
ee2d9c9
# work in an environment without Internet access.
ee2d9c9
(
ee2d9c9
  cat <<'EOF'
ee2d9c9
address_sorting
ee2d9c9
alarm
ee2d9c9
algorithm
ee2d9c9
alts_concurrent_connectivity
ee2d9c9
backoff
ee2d9c9
badreq_bad_client
ee2d9c9
bad_server_response
ee2d9c9
bad_ssl_cert
ee2d9c9
bad_streaming_id_bad_client
ee2d9c9
bdp_estimator
ee2d9c9
bin_decoder
ee2d9c9
bin_encoder
ee2d9c9
buffer_list
ee2d9c9
byte_stream
ee2d9c9
cancel_ares_query
ee2d9c9
channel_create
ee2d9c9
channel_trace
ee2d9c9
channelz_service
ee2d9c9
channelz
ee2d9c9
chttp2_hpack_encoder
ee2d9c9
chttp2_settings_timeout
ee2d9c9
chttp2_varint
ee2d9c9
cli_call
ee2d9c9
client_callback_end2end
ee2d9c9
client_channel_stress
ee2d9c9
client_crash
ee2d9c9
client_interceptors_end2end
ee2d9c9
client_lb_end2end
ee2d9c9
close_fd
ee2d9c9
combiner
ee2d9c9
compression
ee2d9c9
concurrent_connectivity
ee2d9c9
connection_prefix_bad_client
ee2d9c9
connection_refused
ee2d9c9
context_list
ee2d9c9
cxx_byte_buffer
ee2d9c9
cxx_slice
ee2d9c9
delegating_channel
ee2d9c9
dns_resolver_connectivity
ee2d9c9
dns_resolver_cooldown_using_ares_resolver
ee2d9c9
dns_resolver_cooldown_using_native_resolver
ee2d9c9
dns_resolver
ee2d9c9
dualstack_socket
ee2d9c9
duplicate_header_bad_client
ee2d9c9
end2end
ee2d9c9
endpoint_pair
ee2d9c9
error
ee2d9c9
ev_epollex_linux
ee2d9c9
exception
ee2d9c9
fake_resolver
ee2d9c9
fake_transport_security
ee2d9c9
fd_conservation_posix
ee2d9c9
fd_posix
ee2d9c9
filter_end2end
ee2d9c9
fling_stream
ee2d9c9
fling
ee2d9c9
generic_end2end
ee2d9c9
goaway_server
ee2d9c9
grpc_b64
ee2d9c9
grpc_byte_buffer_reader
ee2d9c9
grpc_channel_args
ee2d9c9
grpc_channel_stack_builder
ee2d9c9
grpc_channel_stack
ee2d9c9
grpc_completion_queue
ee2d9c9
grpc_completion_queue_threading
ee2d9c9
grpc_control_plane_credentials
ee2d9c9
grpc_credentials
ee2d9c9
grpc_ipv6_loopback_available
ee2d9c9
grpc_json_token
ee2d9c9
grpc_jwt_verifier
ee2d9c9
grpclb_api
ee2d9c9
grpclb_end2end
ee2d9c9
grpc_security_connector
ee2d9c9
grpc_spiffe_security_connector
ee2d9c9
grpc_ssl_credentials
ee2d9c9
grpc_tool
ee2d9c9
h2_census_nosec
ee2d9c9
h2_census
ee2d9c9
h2_compress_nosec
ee2d9c9
h2_compress
ee2d9c9
h2_fakesec
ee2d9c9
h2_fd_nosec
ee2d9c9
h2_fd
ee2d9c9
h2_full_nosec
ee2d9c9
h2_full+pipe_nosec
ee2d9c9
h2_full+pipe
ee2d9c9
h2_full
ee2d9c9
h2_full+trace_nosec
ee2d9c9
h2_full+trace
ee2d9c9
h2_full+workarounds_nosec
ee2d9c9
h2_full+workarounds
ee2d9c9
h2_http_proxy_nosec
ee2d9c9
h2_http_proxy
ee2d9c9
h2_local_ipv4
ee2d9c9
h2_local_ipv6
ee2d9c9
h2_local_uds
ee2d9c9
h2_oauth2
ee2d9c9
h2_proxy_nosec
ee2d9c9
h2_proxy
ee2d9c9
h2_sockpair_1byte_nosec
ee2d9c9
h2_sockpair_1byte
ee2d9c9
h2_sockpair_nosec
ee2d9c9
h2_sockpair
ee2d9c9
h2_sockpair+trace_nosec
ee2d9c9
h2_sockpair+trace
ee2d9c9
h2_spiffe
ee2d9c9
h2_ssl_cert
ee2d9c9
h2_ssl_proxy
ee2d9c9
h2_ssl_session_reuse
ee2d9c9
h2_ssl
ee2d9c9
h2_uds_nosec
ee2d9c9
h2_uds
ee2d9c9
headers_bad_client
ee2d9c9
head_of_line_blocking_bad_client
ee2d9c9
health_service_end2end
ee2d9c9
hpack_parser
ee2d9c9
hpack_table
ee2d9c9
httpcli_format_request
ee2d9c9
httpcli
ee2d9c9
http_parser
ee2d9c9
httpscli
ee2d9c9
hybrid_end2end
ee2d9c9
initial_settings_frame_bad_client
ee2d9c9
init
ee2d9c9
inproc_callback
ee2d9c9
inproc
ee2d9c9
interop
ee2d9c9
invalid_call_argument
ee2d9c9
lame_client
ee2d9c9
large_metadata_bad_client
ee2d9c9
load_file
ee2d9c9
logical_thread
ee2d9c9
message_allocator_end2end
ee2d9c9
message_compress
ee2d9c9
minimal_stack_is_minimal
ee2d9c9
mock
ee2d9c9
mpmcqueue
ee2d9c9
multiple_server_queues
ee2d9c9
nonblocking
ee2d9c9
no_server
ee2d9c9
num_external_connectivity_watchers
ee2d9c9
out_of_bounds_bad_client
ee2d9c9
parse_address
ee2d9c9
parse_address_with_named_scope_id
ee2d9c9
percent_encoding
ee2d9c9
port_sharing_end2end
ee2d9c9
proto_server_reflection
ee2d9c9
raw_end2end
ee2d9c9
resolver_component
ee2d9c9
resource_quota
ee2d9c9
secure_channel_create
ee2d9c9
secure_endpoint
ee2d9c9
sequential_connectivity
ee2d9c9
server_builder_plugin
ee2d9c9
server_builder
ee2d9c9
server_chttp2
ee2d9c9
server_crash
ee2d9c9
server_early_return
ee2d9c9
server_interceptors_end2end
ee2d9c9
server_registered_method_bad_client
ee2d9c9
server_request_call
ee2d9c9
server
ee2d9c9
service_config_end2end
ee2d9c9
service_config
ee2d9c9
shutdown
ee2d9c9
simple_request_bad_client
ee2d9c9
slice_buffer
ee2d9c9
slice
ee2d9c9
sockaddr_resolver
ee2d9c9
ssl_transport_security
ee2d9c9
stats
ee2d9c9
status_conversion
ee2d9c9
stream_compression
ee2d9c9
streaming_throughput
ee2d9c9
stream_owned_slice
ee2d9c9
tcp_client_posix
ee2d9c9
tcp_posix
ee2d9c9
tcp_server_posix
ee2d9c9
thread_manager
ee2d9c9
threadpool
ee2d9c9
thread_stress
ee2d9c9
time_change
ee2d9c9
timer
ee2d9c9
transport_connectivity_state
ee2d9c9
transport_metadata
ee2d9c9
udp_server
ee2d9c9
unknown_frame_bad_client
ee2d9c9
uri_parser
ee2d9c9
window_overflow_bad_client
ee2d9c9
writes_per_rpc
ee2d9c9
xds_bootstrap
ee2d9c9
xds_end2end
ee2d9c9
EOF
ee2d9c9
) | sed -r 's|^(.*)$|%{_vpath_builddir}/\1_test|' | xargs chmod a-x
ee2d9c9
ee2d9c9
find %{_vpath_builddir} -type f -perm /0111 -name '*_test' |
ee2d9c9
  while read -r testexe
ee2d9c9
  do
ee2d9c9
    echo "==== $(date -u --iso-8601=ns): $(basename "${testexe}") ===="
ee2d9c9
    # We have tried to skip all tests that hang, but since this is a common
ee2d9c9
    # problem, we use timeout so that a test that does hang breaks the build in
ee2d9c9
    # a reasonable amount of time.
ee2d9c9
    timeout -k 11m -v 10m "${testexe}"
ee2d9c9
  done
34ecf95
%endif
87469ef
87469ef
pushd src/python/grpcio_tests
426ac1e
for suite in \
426ac1e
    test_lite \
426ac1e
    %{?with_python_aio_tests:test_aio} \
426ac1e
    %{?with_python_gevent_tests:test_gevent}
426ac1e
do
426ac1e
  # See the implementation of the %%pytest macro, upon which our environment
426ac1e
  # setup is based:
426ac1e
  env CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" \
426ac1e
      LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \
426ac1e
      PATH="%{buildroot}%{_bindir}:$PATH" \
426ac1e
      PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \
426ac1e
      PYTHONDONTWRITEBYTECODE=1 \
426ac1e
      %{__python3} %{py_setup} %{?py_setup_args} "${suite}"
426ac1e
done
87469ef
popd
bf7e9a8
acc3813
%if %{without system_gtest}
acc3813
# As a sanity check for our claim that gtest/gmock are not bundled, check
acc3813
# installed executables for symbols that appear to have come from gtest/gmock.
acc3813
foundgtest=0
acc3813
if find %{buildroot} -type f -perm /0111 \
acc3813
      -execdir objdump --syms --dynamic-syms --demangle '{}' '+' 2>/dev/null |
acc3813
    grep -E '[^:]testing::'
acc3813
then
acc3813
  echo 'Found traces of gtest/gmock' 1>&2
acc3813
  exit 1
acc3813
fi
acc3813
%endif
acc3813
bf7e9a8
bf7e9a8
%files
87469ef
%license LICENSE NOTICE.txt
87469ef
%{_libdir}/libaddress_sorting.so.%{c_so_version}*
87469ef
%{_libdir}/libgpr.so.%{c_so_version}*
87469ef
%{_libdir}/lib%{name}.so.%{c_so_version}*
87469ef
%{_libdir}/lib%{name}_cronet.so.%{c_so_version}*
87469ef
%{_libdir}/lib%{name}_unsecure.so.%{c_so_version}*
87469ef
%{_libdir}/libupb.so.%{c_so_version}*
87469ef
87469ef
87469ef
%files data
87469ef
%license LICENSE NOTICE.txt
87469ef
%dir %{_datadir}/%{name}
87469ef
%{_datadir}/%{name}/roots.pem
87469ef
87469ef
87469ef
%files doc
87469ef
%license LICENSE NOTICE.txt
87469ef
%{_pkgdocdir}
87469ef
87469ef
87469ef
%files cpp
87469ef
%{_libdir}/lib%{name}++.so.%{cpp_so_version}*
87469ef
%{_libdir}/lib%{name}++_error_details.so.%{cpp_so_version}*
87469ef
%{_libdir}/lib%{name}++_reflection.so.%{cpp_so_version}*
87469ef
%{_libdir}/lib%{name}++_unsecure.so.%{cpp_so_version}*
9ce49f9
87469ef
%{_libdir}/lib%{name}pp_channelz.so.%{cpp_so_version}*
87469ef
bf7e9a8
bf7e9a8
%files cli
87469ef
%{_bindir}/%{name}_cli
87469ef
bf7e9a8
bf7e9a8
%files plugins
87469ef
%{_bindir}/%{name}_*_plugin
87469ef
bf7e9a8
bf7e9a8
%files devel
3b94ecf
%{_libdir}/libaddress_sorting.so
3b94ecf
%{_libdir}/libgpr.so
87469ef
%{_libdir}/lib%{name}.so
87469ef
%{_libdir}/lib%{name}_cronet.so
87469ef
%{_libdir}/lib%{name}_unsecure.so
3b94ecf
%{_libdir}/libupb.so
87469ef
%{_includedir}/%{name}
87469ef
%{_libdir}/pkgconfig/gpr.pc
87469ef
%{_libdir}/pkgconfig/%{name}.pc
87469ef
%{_libdir}/pkgconfig/%{name}_unsecure.pc
87469ef
87469ef
%{_libdir}/lib%{name}++.so
87469ef
%{_libdir}/lib%{name}++_error_details.so
87469ef
%{_libdir}/lib%{name}++_reflection.so
87469ef
%{_libdir}/lib%{name}++_unsecure.so
87469ef
%{_includedir}/%{name}++
87469ef
%{_libdir}/pkgconfig/%{name}++.pc
87469ef
%{_libdir}/pkgconfig/%{name}++_unsecure.pc
87469ef
87469ef
%{_libdir}/lib%{name}pp_channelz.so
87469ef
%{_includedir}/%{name}pp
87469ef
bf7e9a8
637ef64
%files -n python3-grpcio
87469ef
%license LICENSE NOTICE.txt
637ef64
%{python3_sitearch}/grpc
aa731c9
%{python3_sitearch}/grpcio-%{version}-py%{python3_version}.egg-info
637ef64
87469ef
87469ef
%files -n python3-grpcio-tools
87469ef
%{python3_sitearch}/grpc_tools
87469ef
%{python3_sitearch}/grpcio_tools-%{version}-py%{python3_version}.egg-info
87469ef
87469ef
87469ef
%files -n python3-grpcio-channelz
87469ef
%{python3_sitelib}/grpc_channelz
87469ef
%{python3_sitelib}/grpcio_channelz-%{version}-py%{python3_version}.egg-info
87469ef
87469ef
87469ef
%files -n python3-grpcio-health-checking
87469ef
%{python3_sitelib}/grpc_health
87469ef
%{python3_sitelib}/grpcio_health_checking-%{version}-py%{python3_version}.egg-info
87469ef
87469ef
87469ef
%files -n python3-grpcio-reflection
87469ef
%{python3_sitelib}/grpc_reflection
87469ef
%{python3_sitelib}/grpcio_reflection-%{version}-py%{python3_version}.egg-info
87469ef
87469ef
87469ef
%files -n python3-grpcio-status
87469ef
%{python3_sitelib}/grpc_status
87469ef
%{python3_sitelib}/grpcio_status-%{version}-py%{python3_version}.egg-info
87469ef
87469ef
87469ef
%files -n python3-grpcio-testing
87469ef
%{python3_sitelib}/grpc_testing
87469ef
%{python3_sitelib}/grpcio_testing-%{version}-py%{python3_version}.egg-info
87469ef
87469ef
bf7e9a8
%changelog
13d2166
* Tue Apr 06 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.26.0-15
13d2166
- General:
13d2166
  * Do not use %%exclude for unpackaged files (RPM 4.17 compatibility)
986bbc8
- Python:
986bbc8
  * Stop using %%pyproject_buildrequires, since it is difficult to fit the
986bbc8
    pyproject-rpm-macros build and install macros into this package, and Miro
986bbc8
    Hrončok has advised that “mixing %%pyproject_buildrequires with
986bbc8
    %%py3_build/%%py3_install is generally not a supported way of building
986bbc8
    Python packages.”
986bbc8
6abb104
* Thu Mar 25 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.26.0-14
6abb104
- General:
6abb104
  * Improved googletest source URL (better tarball name)
6abb104
ee2d9c9
* Tue Mar 23 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.26.0-13
56e498c
- General:
56e498c
  * Replace * with • in descriptions
5ab84a2
  * Use cmake() dependencies first, and pkgconfig() dependencies second, where
5ab84a2
    available
9255a1a
  * Drop explicit pkgconfig BR
78adfdc
  * Fix the directory in which CMake installs pkgconfig files
e1dddac
  * Improved CMake options
119766d
  * Build the Doxygen reference manuals
41172ba
- C (core) and C++ (cpp):
41172ba
  * Let the -devel package require cmake-filesystem
acc3813
  * Allow building tests with our own copy of gtest/gmock, which will become
acc3813
    mandatory when we depend on abseil-cpp and switch to C++17
53fe707
  * Fix a link error in the core tests when using CMake
dc22a8a
  * Manually install grpc_cli (CMake)
3ac80ec
  * Add CMake files to the files list for the -devel package
ee2d9c9
  * Start running some of the core tests in %%check
53fe707
- Python:
53fe707
  * Add several patches required for the tests
934e38f
  * BR gevent for gevent_tests
7796406
  * Fix build; in particular, add missing preprocess and build_package_protos
7796406
    steps, without which the packages were missing generated proto modules and
7796406
    were not
7796406
    usable!
5c54e16
  * Add %%py_provides for Fedora 32
59c4bca
  * Drop python3dist(setuptools) BR, redundant with %%pyproject_buildrequires
119766d
  * Start running most of the Python tests in %%check
119766d
  * Merge the python-grpcio-doc subpackage into grpc-doc
56e498c
34ecf95
* Tue Feb 16 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.26.0-12
34ecf95
- C (core) and C++ (cpp):
34ecf95
  * Add CMake build support but do not enable it yet; there is still a problem
34ecf95
    where grpc_cli is only built with the tests, and a linking problem when
34ecf95
    building the tests
34ecf95
34ecf95
* Tue Feb 02 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.26.0-11
87469ef
- General:
87469ef
  * Update summaries and descriptions
87469ef
  * Update License fields to include licenses from bundled components
87469ef
  * Fix failure to respect Fedora build flags
87469ef
  * Use the system shared certificate bundle instead of shipping our own
87469ef
- CLI:
87469ef
  * No longer set rpath $ORIGIN
87469ef
- C (core) and C++ (cpp):
87469ef
  * Add c_so_version/cpp_so_version macros
87469ef
  * Split out C++ bindings and shared data into subpackages
87469ef
  * Drop obsolete ldconfig_scriptlets macro
87469ef
  * Stop stripping debugging symbols
87469ef
- Python:
87469ef
  * Use generated BR’s
87469ef
  * Build and package Python binding documentation
87469ef
  * Disable accommodations for older libc’s
87469ef
  * Patch out -std=gnu99 flag, which is inappropriate for C++
87469ef
  * Build additional Python packages grpcio_tools, gprcio_channelz,
87469ef
    grpcio_health_checking, grpcio_reflection, grpcio_status, and
87469ef
    grpcio_testing
87469ef
00c46bd
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-10
00c46bd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
00c46bd
42cea2c
* Thu Jan 14 08:46:34 CET 2021 Adrian Reber <adrian@lisas.de> - 1.26.0-9
42cea2c
- Rebuilt for protobuf 3.14
42cea2c
06f39c9
* Fri Nov 13 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 1.26.0-8
06f39c9
- build: disable LTO due to rh#1893533
06f39c9
9310245
* Thu Sep 24 2020 Adrian Reber <adrian@lisas.de> - 1.26.0-7
9310245
- Rebuilt for protobuf 3.13
9310245
7c4d8c0
* Mon Aug 03 2020 Gwyn Ciesla <gwync@protonmail.com> - 1.26.0-6
7c4d8c0
- Patches for https://github.com/grpc/grpc/pull/21669
7c4d8c0
fd56af7
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-5
fd56af7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
fd56af7
ef05f06
* Sun Jun 14 2020 Adrian Reber <adrian@lisas.de> - 1.26.0-4
ef05f06
- Rebuilt for protobuf 3.12
ef05f06
ae84ab8
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.26.0-3
ae84ab8
- Rebuilt for Python 3.9
ae84ab8
324b1af
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-2
324b1af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
324b1af
3b94ecf
* Wed Jan 15 2020 Sergey Avseyev <sergey.avseyev@gmail.com> - 1.26.0-1
3b94ecf
- Update to 1.26.0
3b94ecf
f302d3b
* Thu Dec 19 2019 Orion Poplawski <orion@nwra.com> - 1.20.1-5
f302d3b
- Rebuild for protobuf 3.11
f302d3b
4d76576
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.20.1-4
4d76576
- Rebuilt for Python 3.8.0rc1 (#1748018)
4d76576
751c424
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.20.1-3
751c424
- Rebuilt for Python 3.8
751c424
081b763
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.1-2
081b763
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
081b763
1f1b01a
* Fri May 17 2019 Sergey Avseyev <sergey.avseyev@gmail.com> - 1.20.1-1
1f1b01a
- Update to 1.20.1
1f1b01a
eabd20e
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.0-2
eabd20e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
eabd20e
4d8a3c0
* Wed Jan 16 2019 Sergey Avseyev <sergey.avseyev@gmail.com> - 1.18.0-1
4d8a3c0
- Update to 1.18.0
4d8a3c0
c9c00b2
* Mon Dec 17 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.17.1-3
c9c00b2
- Properly store patch in SRPM
c9c00b2
fe04497
* Mon Dec 17 2018 Sergey Avseyev <sergey.avseyev@gmail.com> - 1.17.1-2
fe04497
- Build without ruby plugin for Fedora < 30 (Thanks to Mathieu Bridon)
fe04497
637ef64
* Fri Dec 14 2018 Sergey Avseyev <sergey.avseyev@gmail.com> - 1.17.1-1
637ef64
- Update to 1.17.1 and package python bindings
637ef64
bf7e9a8
* Fri Dec 07 2018 Sergey Avseyev <sergey.avseyev@gmail.com> - 1.17.0-1
bf7e9a8
- Initial revision