Accepting request 833510 from home:badshah400:branches:devel:tools
* Update to version 1.32.0. * Use cmake to configure and cmake macros to build and install. * New BuildRequires: abseil-cpp-source and pkgconfig(re2); copy abseil-cpp-source contents into source's third_party dir and build it as a module (since we don't have the actual abseil-cpp library built for openSUSE. * Add grpc-find-re2-via-pkgconfig.patch to enable finding system Re2 library via pkg-config; taken from upstream PR gh#grpc/grpc#24088. * Split out new shared lib package libgrpc_plugin_support1 for supporting grpc plugins. OBS-URL: https://build.opensuse.org/request/show/833510 OBS-URL: https://build.opensuse.org/package/show/devel:tools/grpc?expand=0&rev=63
This commit is contained in:
53
grpc.spec
53
grpc.spec
@@ -16,11 +16,12 @@
|
||||
#
|
||||
|
||||
|
||||
%define lver 8
|
||||
%define lver 12
|
||||
%define lverp 1
|
||||
%define lverplugin 1
|
||||
%define src_install_dir /usr/src/%name
|
||||
Name: grpc
|
||||
Version: 1.25.0
|
||||
Version: 1.32.0
|
||||
Release: 0
|
||||
Summary: HTTP/2-based Remote Procedure Call implementation
|
||||
License: Apache-2.0
|
||||
@@ -28,6 +29,9 @@ Group: Development/Tools/Building
|
||||
URL: https://grpc.io/
|
||||
Source: https://github.com/grpc/grpc/archive/v%version.tar.gz
|
||||
Source2: %name-rpmlintrc
|
||||
# PATCH-FIX-UPSTREAM grpc-find-re2-via-pkgconfig.patch gh#grpc/grpc#24088 badshah400@gmail.com -- Attempt to find Re2 library via pkg-config; patch taken from upstream PR
|
||||
Patch0: grpc-find-re2-via-pkgconfig.patch
|
||||
BuildRequires: abseil-cpp-source
|
||||
BuildRequires: cmake
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
@@ -36,6 +40,7 @@ BuildRequires: zypper
|
||||
BuildRequires: pkgconfig(libcares)
|
||||
BuildRequires: pkgconfig(openssl) >= 1.0.1
|
||||
BuildRequires: pkgconfig(protobuf) >= 3.8.0
|
||||
BuildRequires: pkgconfig(re2)
|
||||
BuildRequires: pkgconfig(zlib)
|
||||
|
||||
%description
|
||||
@@ -69,11 +74,23 @@ The reference implementation of the gRPC protocol, done on top of
|
||||
HTTP/2 with support for synchronous and asynchronous calls. gRPC uses
|
||||
Protocol Buffers as the Interface Definition Language by default.
|
||||
|
||||
%package -n libgrpc_plugin_support%lverplugin
|
||||
Summary: HTTP/2-based Remote Procedure Call implementation - plugin support
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libgrpc_plugin_support%lverplugin
|
||||
The reference implementation of the gRPC protocol, done on top of
|
||||
HTTP/2 with support for synchronous and asynchronous calls. gRPC uses
|
||||
Protocol Buffers as the Interface Definition Language by default.
|
||||
|
||||
This package provides the shared library to support plugins for grpc.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for grpc, a HTTP/2 Remote Procedure Call implementation
|
||||
Group: Development/Tools/Building
|
||||
Requires: libgrpc%lver = %version
|
||||
Requires: libgrpc++%lverp = %version
|
||||
Requires: libgrpc-plugin-support%lverplugin = %version
|
||||
|
||||
%description devel
|
||||
This subpackage contains libraries and header files for developing
|
||||
@@ -89,6 +106,8 @@ This subpackage contains source code of the gRPC reference implementation.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
# Copy abseil-cpp source into empty third_party/abseil-cpp dir
|
||||
cp -r %_prefix/src/abseil-cpp/* third_party/abseil-cpp/
|
||||
|
||||
%build
|
||||
%define _lto_cflags %nil
|
||||
@@ -97,28 +116,37 @@ mkdir -p third_party/protobuf/src
|
||||
|
||||
export CFLAGS="%optflags -Wno-error"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
make %{?_smp_mflags} STRIP=/bin/true V=1 VERBOSE=1
|
||||
%cmake -DgRPC_INSTALL=ON \
|
||||
-DgRPC_ABSL_PROVIDER=module \
|
||||
-DgRPC_CARES_PROVIDER=package \
|
||||
-DgRPC_PROTOBUF_PROVIDER=package \
|
||||
-DgRPC_RE2_PROVIDER=package \
|
||||
-DgRPC_SSL_PROVIDER=package \
|
||||
-DgRPC_ZLIB_PROVIDER=package
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
b="%buildroot"
|
||||
# work around "Argument list too long"
|
||||
ln -s "%buildroot" "b"
|
||||
%make_install DESTDIR="b" prefix="b/%_prefix" STRIP=/bin/true V=1 VERBOSE=1
|
||||
%cmake_install
|
||||
|
||||
find "$b/%_includedir" -type f -exec chmod a-x {} +
|
||||
pushd "$b/usr"
|
||||
rm -fv lib/*.a share/grpc/*.pem
|
||||
perl -i -pe 's{^prefix=.*}{prefix=%_prefix}' lib/pkgconfig/*.pc
|
||||
perl -i -pe 's{^libdir=.*}{libdir=%_libdir}' lib/pkgconfig/*.pc
|
||||
if test ! -d lib64 && test "%_lib" = lib64; then
|
||||
mv lib lib64
|
||||
fi
|
||||
popd
|
||||
|
||||
# Install sources
|
||||
pushd %__builddir
|
||||
make clean
|
||||
rm -f "b" "a.out"
|
||||
find . -type f "(" -name "*.so" -o -name "*.o" -o -name ".git*" ")" -exec rm -rf {} +
|
||||
rm -f "b"
|
||||
find . -type f "(" -name "*.so" -o -name "*.o" -o -name ".git*" -o -name "*.bin" -o -name "*.out" ")" -exec rm -rf {} +
|
||||
popd
|
||||
# Don't include abseil-cpp in sources
|
||||
rm -fr third_party/abseil-cpp/*
|
||||
|
||||
mkdir -p "%buildroot/%src_install_dir"
|
||||
cp -r * "%buildroot/%src_install_dir"
|
||||
|
||||
@@ -128,22 +156,29 @@ cp -r * "%buildroot/%src_install_dir"
|
||||
%postun -n libgrpc%lver -p /sbin/ldconfig
|
||||
%post -n libgrpc++%lverp -p /sbin/ldconfig
|
||||
%postun -n libgrpc++%lverp -p /sbin/ldconfig
|
||||
%post -n libgrpc_plugin_support%lverplugin -p /sbin/ldconfig
|
||||
%postun -n libgrpc_plugin_support%lverplugin -p /sbin/ldconfig
|
||||
|
||||
%files -n libgrpc%lver
|
||||
%_libdir/libaddress_sorting.so.%{lver}*
|
||||
%_libdir/libgpr*.so.%{lver}*
|
||||
%_libdir/libgrpc*.so.%{lver}*
|
||||
%_libdir/libupb*.so.%{lver}*
|
||||
|
||||
%files -n libgrpc++%lverp
|
||||
%_libdir/libgrpc++*.so.%{lverp}*
|
||||
%_libdir/libgrpcpp_channelz.so.%{lverp}*
|
||||
|
||||
%files -n libgrpc_plugin_support%lverplugin
|
||||
%_libdir/libgrpc_plugin_support.so.%{lverplugin}*
|
||||
|
||||
%files devel
|
||||
%license LICENSE
|
||||
%_bindir/*
|
||||
%_includedir/*
|
||||
%_libdir/pkgconfig/*.pc
|
||||
%_libdir/*.so
|
||||
%_libdir/cmake/grpc/
|
||||
|
||||
%files source
|
||||
%src_install_dir
|
||||
|
Reference in New Issue
Block a user