summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--brpc.spec161
-rw-r--r--sources2
3 files changed, 93 insertions, 71 deletions
diff --git a/.gitignore b/.gitignore
index 43cba1b..cb94427 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/brpc-1.16.0.tar.gz
+/apache-brpc-1.18.0-src.tar.gz
diff --git a/brpc.spec b/brpc.spec
index bd28da7..d564665 100644
--- a/brpc.spec
+++ b/brpc.spec
@@ -1,93 +1,119 @@
-# bRPC - Industrial-grade RPC framework using C++ Language.
#
-# Adapted from the src-openeuler/brpc reference spec (1.14.1) to the 1.16.0
-# upstream (gitcode/boostkit fork). Both shared (libbrpc.so) and static
-# (libbrpc.a) libraries are built; -DBUILD_SHARED_LIBS=ON is required because
-# upstream only builds the shared library when that switch is enabled.
-# Note: BoringSSL / MesaLink / GLOG / RDMA / thrift are optional upstream
-# switches kept off by default, so they are intentionally not build requires.
-Name: brpc
-Version: 1.16.0
-Release: 1%{?dist}
-Summary: Industrial-grade RPC framework using C++ Language.
-
-License: Apache-2.0
-URL: https://gitcode.com/boostkit/brpc
-Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
-
-BuildRequires: cmake
-BuildRequires: gcc
-BuildRequires: gcc-c++
-BuildRequires: make
-BuildRequires: ninja-build
-BuildRequires: gflags-devel
-BuildRequires: protobuf-devel
-# Use openEuler's official abseil-cpp-devel (provides cmake(absl) +
-# pkgconfig(absl_*)); it is also the abseil provider requiring by protobuf-devel.
-# A separately-packaged "absl-devel" collides with abseil-cpp-devel over the
-# same /usr/lib64/pkgconfig/absl_*.pc files, so reference the official name.
-BuildRequires: abseil-cpp-devel
-BuildRequires: leveldb-devel
-BuildRequires: openssl-devel
-BuildRequires: zlib-devel
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+Name: brpc
+Version: 1.18.0
+Release: 1%{?dist}
+Summary: Industrial-grade RPC framework using C++ Language.
+
+Group: Development
+License: Apache2
+URL: https://github.com/apache/brpc
+Source0: https://downloads.apache.org/brpc/%{version}/apache-brpc-%{version}-src.tar.gz
+
+# https://access.redhat.com/solutions/519993
+%global _filter_GLIBC_PRIVATE 1
+%global __filter_GLIBC_PRIVATE 1
+
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 8
+%global use_devtoolset 0
+%else
+%global use_devtoolset 1
+%endif
+
+%if 0%{?use_devtoolset}
+BuildRequires: devtoolset-8-gcc-c++
+%define __strip /opt/rh/devtoolset-8/root/usr/bin/strip
+%endif
+
+BuildRequires: cmake
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: gflags-devel >= 2.1
+BuildRequires: protobuf-devel >= 2.4
+BuildRequires: leveldb-devel
+BuildRequires: openssl-devel
%description
Apache bRPC is an Industrial-grade RPC framework using C++ Language,
which is often used in high performance systems such as Search, Storage,
Machine learning, Advertisement, Recommendation etc.
-%package devel
-Summary: The %{name} headers and shared development libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
+%package tools
+Summary: The %{name} tools.
+Requires: %{name} = %{version}-%{release}
+%description tools
+The %{name} tools.
+%package devel
+Summary: The %{name} headers and shared development libraries
+Requires: %{name} = %{version}-%{release}
%description devel
Headers and shared object symbolic links for the %{name} library.
%package static
-Summary: The %{name} static development libraries
-Requires: %{name}-devel = %{version}-%{release}
-
+Summary: The %{name} static development libraries
+Requires: brpc-devel = %{version}-%{release}
%description static
Static %{name} libraries.
-%package tools
-Summary: The %{name} tools.
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-%description tools
-The %{name} tools.
-
%prep
-%autosetup -n %{name}-%{version}
+%setup -n apache-%{name}-%{version}-src
%build
-# Invoke the cmake binary directly instead of the CMake RPM macros so the
-# build is portable across builders (including minimal smoke workers that do
-# not ship the cmake macro package). NOTE: never spell out the cmake macro
-# name (percent-cmake) in a comment -- rpm expands it even inside comments and
-# the multi-line expansion escapes the comment, injecting a bogus cmake call.
-cmake -S . -B build \
- -DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DCMAKE_INSTALL_LIBDIR=%{_lib} \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DBUILD_SHARED_LIBS=ON \
- -DBUILD_UNIT_TESTS=OFF \
- -DBUILD_BRPC_TOOLS=ON \
- -DDOWNLOAD_GTEST=OFF \
- -DWITH_GLOG=OFF
-cmake --build build --parallel
+%if 0%{?use_devtoolset}
+. /opt/rh/devtoolset-8/enable
+%endif
+
+%if 0%{?fedora} >= 33 || 0%{?rhel} >= 8
+%{cmake} -DBUILD_BRPC_TOOLS:BOOLEAN=ON -DDOWNLOAD_GTEST:BOOLEAN=OFF
+%{cmake_build}
+%else
+mkdir -p %{_target_platform}
+pushd %{_target_platform}
+
+%{cmake} -DBUILD_BRPC_TOOLS:BOOLEAN=ON -DDOWNLOAD_GTEST:BOOLEAN=OFF ..
+make %{?_smp_mflags}
+
+popd
+%endif
%install
-DESTDIR=%{buildroot} cmake --install build
+rm -rf $RPM_BUILD_ROOT
+
+%if 0%{?fedora} >= 33 || 0%{?rhel} >= 8
+%{cmake_install}
+%else
+pushd %{_target_platform}
+%make_install
+popd
+%endif
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%clean
+rm -rf $RPM_BUILD_ROOT
%files
-%license LICENSE
-%doc README.md CHANGES.md NOTICE
%{_libdir}/libbrpc.so
+%files tools
+%{_bindir}/*
+
%files devel
%{_includedir}/*
%{_libdir}/pkgconfig/*
@@ -95,9 +121,4 @@ DESTDIR=%{buildroot} cmake --install build
%files static
%{_libdir}/libbrpc.a
-%files tools
-%{_bindir}/*
-
%changelog
-* Fri Nov 27 2026 openEuler Builder <builder@openeuler.org> - 1.16.0-1
-- Update to 1.16.0
diff --git a/sources b/sources
index 5578759..905ea89 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-71b445b4c9f155e3dbd974e08c6b2a5f brpc-1.16.0.tar.gz
+90cd56a224b0f5424fd11a3f7d302556 apache-brpc-1.18.0-src.tar.gz