forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrpc.spec
46 lines (39 loc) · 1.21 KB
/
grpc.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
### RPM external grpc 1.35.0
Source: git+https://github.com/grpc/grpc.git?obj=master/v%{realversion}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Patch0: grpc-ssl-fix
Patch1: grpc-gcc11
BuildRequires: cmake ninja go
Requires: protobuf zlib pcre c-ares abseil-cpp re2
%define keep_archives true
%prep
%setup -n %{n}-%{realversion}
if [ ! -z "$OPENSSL_ROOT" ]; then
%patch0 -p1
fi
%patch1 -p1
%build
rm -rf ../build
mkdir ../build
cd ../build
OPENSSLROOT=""
if [ ! -z "$OPENSSL_ROOT" ]; then OPENSSLROOT=";${OPENSSL_ROOT}" ; fi
cmake ../%{n}-%{realversion} \
-G Ninja \
-DgRPC_INSTALL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_LIBDIR=lib \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DZLIB_ROOT=${ZLIB_ROOT} \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_PREFIX_PATH="${PCRE_ROOT};${PROTOBUF_ROOT};${ZLIB_ROOT}${OPENSSLROOT};${C_ARES_ROOT};${ABSEIL_CPP_ROOT};${RE2_ROOT}"
ninja -v %{makeprocesses}
%install
cd ../build
ninja -v %{makeprocesses} install