Bump to grpc 1.20.1
[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.20.1
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 Source101:      0001-Change-install-command-at-Makefile.patch 
31 Source102:      0002-Migrate-to-openssl-1.1.patch
32 Source103:      0003-tizen_6_build-Rename-gettid-functions.patch
33 Source1001:     grpc.manifest
34 BuildRequires:  python-cython
35 BuildRequires:  python-devel
36 BuildRequires:  python-setuptools
37 # BuildRequires:  python-rpm-macros
38 BuildRequires:  cmake
39 BuildRequires:  gcc-c++
40 BuildRequires:  pkg-config
41 BuildRequires:  pkgconfig(libcares)
42 BuildRequires:  pkgconfig(openssl1.1) >= 1.0.1
43 BuildRequires:  pkgconfig(protobuf) >= 3.5
44 BuildRequires:  pkgconfig(zlib)
45 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
46
47 %description
48 The reference implementation of the gRPC protocol, done on top of
49 HTTP/2 with support for synchronous and asynchronous calls. gRPC uses
50 Protocol Buffers as the Interface Definition Language by default.
51
52 %package -n %lname
53 Summary:        HTTP/2-based Remote Procedure Call implementation
54 Group:          System/Libraries
55
56 %description -n %lname
57 The reference implementation of the gRPC protocol, done on top of
58 HTTP/2 with support for synchronous and asynchronous calls. gRPC uses
59 Protocol Buffers as the Interface Definition Language by default.
60
61 %package devel
62 Summary:        Development files for grpc, a HTTP/2 Remote Procedure Call implementation
63 Group:          Development/Tools/Building
64 Requires:       %lname = %version
65
66 %description devel
67 This subpackage contains libraries and header files for developing
68 applications that want to make use of the gRPC reference implementation.
69
70 %prep
71 %setup -q
72 cp %{SOURCE1001} .
73 %{__patch} -p1 < %{SOURCE101}
74 %{__patch} -p1 < %{SOURCE102}
75 %{__patch} -p1 < %{SOURCE103}
76
77 %build
78 make %{?_smp_mflags} STRIP=/bin/true V=1 VERBOSE=1 \
79         CFLAGS="%optflags -Wno-error" CXXFLAGS="%optflags -Wno-error"
80
81 %install
82 b="%buildroot"
83 make prefix="$b/%_prefix" STRIP=/bin/true V=1 VERBOSE=1 install
84 find "$b/%_includedir" -type f -exec chmod a-x {} +
85 pushd "$b/usr"
86 rm -fv lib/*.a share/grpc/*.pem
87 perl -i -pe 's{^prefix=.*}{prefix=%_prefix}' lib/pkgconfig/*.pc
88 perl -i -pe 's{^libdir=.*}{libdir=%_libdir}' lib/pkgconfig/*.pc
89 if test ! -d lib64 && test "%_lib" = lib64; then
90         mv lib lib64
91 fi
92 popd
93
94 %post   -n %lname -p /sbin/ldconfig
95 %postun -n %lname -p /sbin/ldconfig
96
97 %files -n %lname
98 %defattr(-,root,root)
99 %_libdir/libaddress_sorting.so.*
100 %_libdir/libgpr*.so.*
101 %_libdir/libgrpc*.so.*
102
103 %files devel
104 %defattr(-,root,root)
105 %license LICENSE
106 %_bindir/*
107 %_includedir/*
108 %_libdir/pkgconfig/*.pc
109 %_libdir/*.so
110
111 %changelog