grpc/grpc.spec

220 lines
6.6 KiB
RPMSpec
Raw Normal View History

2022-03-29 15:28:25 +08:00
%global c_so_version 19
%global cpp_so_version 1.41
2019-12-25 18:06:46 +08:00
Name: grpc
2022-03-29 15:28:25 +08:00
Version: 1.41.1
2022-03-30 10:27:54 +08:00
Release: 2
2019-12-25 18:06:46 +08:00
Summary: A modern, open source high performance RPC framework that can run in any environment
License: ASL 2.0
URL: https://www.grpc.io
Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz
2020-12-31 10:24:38 +08:00
Patch0006: repair-pkgconfig-path.patch
Patch0007: add-secure-compile-option-in-Makefile.patch
2022-03-29 15:28:25 +08:00
Patch0010: backport-grpc-1.41.1-python-grpcio-use-system-abseil.patch
2019-12-25 18:06:46 +08:00
2021-07-19 15:59:17 +08:00
BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler
2022-03-30 10:27:54 +08:00
BuildRequires: openssl-devel c-ares-devel gtest-devel zlib-devel gperftools-devel
2019-12-25 18:06:46 +08:00
BuildRequires: python3-devel python3-setuptools python3-Cython
2020-12-31 10:24:38 +08:00
BuildRequires: cmake >= 3.13.0
BuildRequires: pkgconfig(re2)
2021-07-06 14:17:48 +08:00
BuildRequires: abseil-cpp-devel
2022-03-29 15:28:25 +08:00
BuildRequires: grpc
2022-03-30 10:27:54 +08:00
Requires: protobuf-compiler
2019-09-30 10:51:59 -04:00
%description
gRPC is a modern open source high performance RPC framework that can run in any environment.
It can efficiently connect services in and across data centers with pluggable support for
load balancing, tracing, health checking and authentication. It is also applicable in last
mile of distributed computing to connect devices, mobile applications and browsers to backend services.
2019-12-25 18:06:46 +08:00
%package devel
Summary: gRPC library development files
Requires: %{name} = %{version}-%{release}
2020-12-31 10:24:38 +08:00
Requires: pkgconfig(re2)
2021-07-06 14:17:48 +08:00
Requires: abseil-cpp-devel
2019-09-30 10:51:59 -04:00
2019-12-25 18:06:46 +08:00
%description devel
2019-09-30 10:51:59 -04:00
Development headers and files for gRPC libraries.
2022-03-29 15:28:25 +08:00
%package plugins
Summary: Protocol buffers compiler plugins for gRPC
# License: same as base package
Requires: grpc = %{version}-%{release}
Requires: protobuf-compiler
%description plugins
Plugins to the protocol buffers compiler to generate gRPC sources.
2019-09-30 10:51:59 -04:00
%package -n python3-grpcio
2019-12-25 18:06:46 +08:00
Summary: Python3 language bindings for gRPC
Requires: %{name} = %{version}-%{release}
2019-09-30 10:51:59 -04:00
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-grpcio
Python3 bindings for gRPC.
%prep
2020-07-31 18:27:12 +08:00
%autosetup -p1 -n %{name}-%{version}
2019-12-25 18:06:46 +08:00
sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:' Makefile
sed -i 's:$(prefix)/lib:$(prefix)/%{_lib}:' Makefile
sed -i 's:^GTEST_LIB =.*::' Makefile
2019-09-30 10:51:59 -04:00
%build
2020-12-31 10:24:38 +08:00
mkdir -p cmake/build
cd cmake/build
cmake ../../ -DgRPC_INSTALL=ON\
-DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
2021-07-06 14:17:48 +08:00
-DgRPC_ABSL_PROVIDER=package \
2020-12-31 10:24:38 +08:00
-DgRPC_INSTALL_LIBDIR=%{buildroot}%{_libdir} \
-DgRPC_INSTALL_BINDIR=%{buildroot}%{_bindir} \
-DgRPC_INSTALL_INCLUDEDIR=%{buildroot}%{_includedir} \
-DgRPC_INSTALL_CMAKEDIR=%{buildroot}%{_prefix}/lib/cmake/%{name} \
-DgRPC_INSTALL_SHAREDIR=%{buildroot}%{_datadir}/%{name} \
-DgRPC_INSTALL_PKGCONFIGDIR=%{buildroot}%{_libdir}/pkgconfig \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DBUILD_SHARED_LIBS=ON
make -j24 V=1
2019-09-30 10:51:59 -04:00
2019-12-25 18:06:46 +08:00
# build python module
2019-09-30 10:51:59 -04:00
export GRPC_PYTHON_BUILD_WITH_CYTHON=True
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True
export GRPC_PYTHON_BUILD_SYSTEM_CARES=True
2020-12-31 10:24:38 +08:00
export GRPC_PYTHON_BUILD_SYSTEM_RE2=True
2021-07-06 14:17:48 +08:00
export GRPC_PYTHON_BUILD_SYSTEM_ABSL=True
2019-09-30 10:51:59 -04:00
export CFLAGS="%optflags"
2020-12-31 10:24:38 +08:00
cd ../..
2019-09-30 10:51:59 -04:00
%py3_build
%install
2020-12-31 10:24:38 +08:00
cd cmake/build
make install/local
rm -rf %{buildroot}%{_prefix}/lib
2020-07-31 18:27:12 +08:00
2022-03-29 15:28:25 +08:00
cp %{_libdir}/libgpr.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libgrpc++.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libgrpc++_reflection.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libgrpc.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libaddress_sorting.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libupb.so* %{buildroot}%{_libdir}/
2019-09-30 10:51:59 -04:00
%delete_la_and_a
2020-12-31 10:24:38 +08:00
cd ../..
2019-09-30 10:51:59 -04:00
%py3_install
2019-12-25 18:06:46 +08:00
%ldconfig_scriptlets
2019-09-30 10:51:59 -04:00
%files
2019-12-25 18:06:46 +08:00
%defattr(-,root,root)
2019-09-30 10:51:59 -04:00
%doc README.md
%license LICENSE
2020-12-31 10:24:38 +08:00
%{_datadir}/%{name}
2022-03-29 15:28:25 +08:00
%{_libdir}/libaddress_sorting.so.%{c_so_version}*
%{_libdir}/libgpr.so.%{c_so_version}*
%{_libdir}/libgrpc.so.%{c_so_version}*
%{_libdir}/libgrpc_unsecure.so.%{c_so_version}*
%{_libdir}/libupb.so.%{c_so_version}*
%{_libdir}/libgrpc++.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_alts.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_error_details.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_reflection.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_unsecure.so.%{cpp_so_version}*
%{_libdir}/libgrpc_plugin_support.so.%{cpp_so_version}*
%{_libdir}/libgrpcpp_channelz.so.%{cpp_so_version}*
%{_libdir}/libgpr.so*
%{_libdir}/libgrpc++.so*
%{_libdir}/libgrpc++_reflection.so*
%{_libdir}/libgrpc.so*
%{_libdir}/libaddress_sorting.so*
%{_libdir}/libupb.so*
%files plugins
%{_bindir}/grpc_*_plugin
2019-09-30 10:51:59 -04:00
%files devel
2019-12-25 18:06:46 +08:00
%defattr(-,root,root)
2019-09-30 10:51:59 -04:00
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_includedir}/grpc
%{_includedir}/grpc++
%{_includedir}/grpcpp
%files -n python3-grpcio
2019-12-25 18:06:46 +08:00
%defattr(-,root,root)
2019-09-30 10:51:59 -04:00
%{python3_sitearch}/grpc
2022-03-29 15:28:25 +08:00
%{python3_sitearch}/grpcio-%{version}-py*
2019-09-30 10:51:59 -04:00
%changelog
2022-03-30 10:27:54 +08:00
* Wed Mar 30 2022 xihaochen <xihaochen@h-partners.com> - 1.41.1-2
- Type:requirement
- ID:NA
- SUG:NA
- DESC:remove gflags
2022-03-29 15:28:25 +08:00
* Tue Mar 29 2022 xihaochen <xihaochen@h-partners.com> - 1.41.1-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update grpc to 1.41.1
2021-07-19 15:59:17 +08:00
* Mon Jul 19 2021 lijingyuan <lijingyuan3@huawei.com> - 1.31.0-6
- Type:requirement
- ID:NA
- SUG:NA
- DESC:cancel gdb in buildrequires
2021-07-06 14:17:48 +08:00
* Tue Jul 06 2021 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-5
- Type:requirement
- ID:NA
- SUG:NA
- DESC:separate abseil-cpp from grpc source
* Wed Jun 23 2021 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-4
- Type:requirement
- ID:NA
- SUG:NA
- DESC:delete benchmark and googletest sources in grpc and rebase to 1.31.0-4
2020-12-31 10:24:38 +08:00
* Wed Dec 09 2020 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-2
2020-07-31 18:27:12 +08:00
- Type:requirement
- ID:NA
- SUG:NA
2020-12-31 10:24:38 +08:00
- DESC:separate re2 from grpc source
* Mon Aug 28 2020 liuxin <liuxin264@huawei.com> - 1.31.0-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update grpc version to 1.31.0
* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 1.28.1-3
- rebuild for package build and clarify last changelog info
2020-07-31 18:27:12 +08:00
2020-12-31 10:24:38 +08:00
* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-2
- Type:rebuild
- ID:NA
- SUG:NA
- DESC:update to 1.28.2
* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update to 1.28.1
2020-06-09 15:42:57 +08:00
2020-03-20 11:44:40 +08:00
* Fri Mar 20 2020 songnannan <songnannan2@huawei.com> - 1.22.0-3
2020-12-31 10:24:38 +08:00
- add gdb in buildrequires
2020-03-20 11:44:40 +08:00
2020-01-11 16:45:03 +08:00
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.22.0-2
- Delete unused patch
2019-12-25 18:06:46 +08:00
* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.22.0-1
2019-09-30 10:51:59 -04:00
- Package init