File python-grpcio.spec of Package python-grpcio
92
1
#
2
# spec file for package python-grpcio
3
#
4
# Copyright (c) 2024 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%global modname grpcio
20
%{?sle15_python_module_pythons}
21
Name: python-grpcio
22
Version: 1.60.1
23
Release: 0
24
Summary: HTTP/2-based Remote Procedure Call implementation
25
License: Apache-2.0
26
Group: Development/Languages/Python
27
URL: https://grpc.io
28
Source: https://files.pythonhosted.org/packages/source/g/grpcio/grpcio-%{version}.tar.gz
29
# PATCH-FIX-UPSTREAM python-grpcio-cython3-compat.patch gh#grpc/grpc#33918 badshah400@gmail.com -- Fix noexcept errors upon compiling with Cython 3+
30
Patch0: python-grpcio-cython3-compat.patch
31
# PATCH-FIX-SLE xxhash-avoid-armv6-unaligned-access.patch alarrosa@suse.com -- do not expect unaligned accesses to work on armv6
32
Patch1: xxhash-avoid-armv6-unaligned-access.patch
33
# PATCH-FIX-SLE xxhash-ppc64le-gcc7.patch boo#1208794 alarrosa@suse.com -- fix build failure on ppc64le when using gcc 7
34
Patch2: xxhash-ppc64le-gcc7.patch
35
BuildRequires: %{python_module Cython >= 0.29.8}
36
BuildRequires: %{python_module devel >= 3.7}
37
BuildRequires: %{python_module pip}
38
BuildRequires: %{python_module setuptools}
39
BuildRequires: %{python_module wheel >= 0.29}
40
BuildRequires: abseil-cpp-devel >= 20220623.0
41
BuildRequires: ca-certificates
42
BuildRequires: fdupes
43
BuildRequires: gcc-c++
44
BuildRequires: pkgconfig
45
BuildRequires: python-rpm-macros
46
BuildRequires: pkgconfig(libcares)
47
BuildRequires: pkgconfig(openssl)
48
BuildRequires: pkgconfig(re2)
49
BuildRequires: pkgconfig(zlib)
50
Requires: ca-certificates
51
Recommends: python-enum34 >= 1.0.4
52
Recommends: python-futures >= 2.2.0
53
%python_subpackages
54
55
%description
56
gRPC is a remote procedure call (RPC) framework. gRPC enables client
57
and server applications to communicate, and enables the building of
58
connected systems.
59
60
%prep
61
%autosetup -N -n grpcio-%{version}
62
%patch0 -p1
63
pushd third_party/xxhash
64
%patch1 -p1
65
%patch2 -p1
66
popd
67
68
%build
69
export GRPC_BUILD_WITH_BORING_SSL_ASM=false
70
export GRPC_PYTHON_BUILD_SYSTEM_ABSL=true
71
export GRPC_PYTHON_BUILD_SYSTEM_CARES=true
72
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true
73
export GRPC_PYTHON_BUILD_SYSTEM_RE2=true
74
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=true
75
export GRPC_PYTHON_BUILD_WITH_CYTHON=true
76
export GRPC_PYTHON_CFLAGS="%{optflags}"
77
%pyproject_wheel
78
79
%install
80
%pyproject_install
81
%python_expand %fdupes %{buildroot}%{$python_sitearch}
82
# a symlink to the shared system certificates is used
83
%python_expand ln -sf %{_localstatedir}/lib/ca-certificates/ca-bundle.pem %{buildroot}%{$python_sitearch}/grpc/_cython/_credentials/roots.pem
84
85
%files %{python_files}
86
%doc README.md
87
%license LICENSE
88
%{python_sitearch}/grpc/
89
%{python_sitearch}/%{modname}-%{version}.dist-info
90
91
%changelog
92