Bump to grpc 1.35.0
[platform/upstream/grpc.git] / packaging / grpc.spec
1 #
2 # spec file for package grpc
3 #
4 # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
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 %define lname libgrpc
20 %define src_install_dir /usr/src/%{name}
21 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
22 Name:           grpc
23 Version:        1.35.0
24 Release:        0
25 Summary:        HTTP/2-based Remote Procedure Call implementation
26 License:        Apache-2.0
27 Group:          Development/Tools/Building
28 Url:            http://grpc.io/
29 Source:         https://github.com/grpc/grpc/archive/v%{version}.tar.gz
30 Source1001:     grpc.manifest
31 Source10:       support_lib64_directory.patch
32
33 BuildRequires:  python-cython
34 BuildRequires:  python-devel
35 BuildRequires:  python-setuptools
36 # BuildRequires:  python-rpm-macros
37 BuildRequires:  cmake
38 BuildRequires:  gcc-c++
39 BuildRequires:  pkg-config
40 BuildRequires:  pkgconfig(libcares)
41 BuildRequires:  pkgconfig(openssl1.1) >= 1.0.1
42 BuildRequires:  pkgconfig(protobuf) >= 3.5
43 BuildRequires:  pkgconfig(zlib)
44 BuildRequires:  pkgconfig(re2)
45 BuildRequires:  abseil-cpp-devel
46
47 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
48
49 %description
50 The reference implementation of the gRPC protocol, done on top of
51 HTTP/2 with support for synchronous and asynchronous calls. gRPC uses
52 Protocol Buffers as the Interface Definition Language by default.
53
54 %package -n %lname
55 Summary:        HTTP/2-based Remote Procedure Call implementation
56 Group:          System/Libraries
57
58 %description -n %lname
59 The reference implementation of the gRPC protocol, done on top of
60 HTTP/2 with support for synchronous and asynchronous calls. gRPC uses
61 Protocol Buffers as the Interface Definition Language by default.
62
63 %package devel
64 Summary:        Development files for grpc, a HTTP/2 Remote Procedure Call implementation
65 Group:          Development/Tools/Building
66 Requires:       %lname = %version
67
68 %description devel
69 This subpackage contains libraries and header files for developing
70 applications that want to make use of the gRPC reference implementation.
71
72 %prep
73 %setup -q
74 cp %{SOURCE1001} .
75 %{__patch} -p1 < %{SOURCE10}
76
77 %build
78 CFLAGS+=" -Wno-error -Wno-unused-parameter"
79 CXXFLAGS+=" -Wno-error -Wno-unused-parameter"
80
81
82 mkdir -p cmake/build
83 cd cmake/build
84 cmake ../.. -DCMAKE_INSTALL_PREFIX=%{_prefix}    \
85             -DINCLUDE_INSTALL_DIR=%{_includedir} \
86             -DLIB_INSTALL_DIR=%{_libdir}    \
87             -DBUILD_SHARED_LIBS=ON               \
88             -DgRPC_INSTALL=ON                    \
89             -DgRPC_ABSL_PROVIDER=package          \
90             -DgRPC_CARES_PROVIDER=package        \
91             -DgRPC_RE2_PROVIDER=package          \
92             -DgRPC_PROTOBUF_PROVIDER=package     \
93             -DgRPC_SSL_PROVIDER=package          \
94             -DgRPC_ZLIB_PROVIDER=package
95
96
97 make %{?_smp_mflags}
98
99 %install
100 cd cmake/build
101 make install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p"
102
103 rm -rf %{buildroot}%{_libdir}/cmake
104 rm -rf %{buildroot}%{_datadir}/grpc/roots.pem
105
106 %post   -n %lname -p /sbin/ldconfig
107 %postun -n %lname -p /sbin/ldconfig
108
109 %files -n %lname
110 %defattr(-,root,root)
111 %_libdir/libaddress_sorting.so.*
112 %_libdir/libupb.so.*
113 %_libdir/libgpr*.so.*
114 %_libdir/libgrpc*.so.*
115
116 %files devel
117 %defattr(-,root,root)
118 %license LICENSE
119 %_bindir/*
120 %_includedir/*
121 %_libdir/pkgconfig/*.pc
122 %_libdir/*.so
123
124 %changelog