Skip to content

Commit

Permalink
Install and pack brpc tools (#2096)
Browse files Browse the repository at this point in the history
  • Loading branch information
wasphin authored Jan 20, 2023
1 parent 3dbc372 commit 4433290
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
17 changes: 13 additions & 4 deletions package/rpm/brpc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Summary: Industrial-grade RPC framework using C++ Language.
Group: Development
License: Apache2
URL: https://github.com/apache/brpc
Source0: apache-brpc-%{version}-incubating-src.tar.gz
Source0: https://downloads.apache.org/brpc/%{version}/apache-brpc-%{version}-src.tar.gz

# https://access.redhat.com/solutions/519993
%global _filter_GLIBC_PRIVATE 1
Expand Down Expand Up @@ -55,6 +55,12 @@ 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 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}
Expand All @@ -68,21 +74,21 @@ Requires: brpc-devel = %{version}-%{release}
Static %{name} libraries.

%prep
%setup -n apache-%{name}-%{version}-incubating-src
%setup -n apache-%{name}-%{version}-src

%build
%if 0%{?use_devtoolset}
. /opt/rh/devtoolset-8/enable
%endif

%if 0%{?fedora} >= 33 || 0%{?rhel} >= 8
%{cmake} -DBUILD_BRPC_TOOLS:BOOLEAN=OFF -DDOWNLOAD_GTEST:BOOLEAN=OFF
%{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=OFF -DDOWNLOAD_GTEST:BOOLEAN=OFF ..
%{cmake} -DBUILD_BRPC_TOOLS:BOOLEAN=ON -DDOWNLOAD_GTEST:BOOLEAN=OFF ..
make %{?_smp_mflags}

popd
Expand All @@ -105,6 +111,9 @@ rm -rf $RPM_BUILD_ROOT
%files
%{_libdir}/libbrpc.so

%files tools
%{_bindir}/*

%files devel
%{_includedir}/*
%{_libdir}/pkgconfig/*
Expand Down
1 change: 1 addition & 0 deletions tools/parallel_http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@

add_executable(parallel_http parallel_http.cpp)
target_link_libraries(parallel_http brpc-static ${DYNAMIC_LIB})
install(TARGETS parallel_http RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1 change: 1 addition & 0 deletions tools/rpc_press/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
file(GLOB SOURCES "${PROJECT_SOURCE_DIR}/tools/rpc_press/*.cpp")
add_executable(rpc_press ${SOURCES})
target_link_libraries(rpc_press brpc-static ${DYNAMIC_LIB})
install(TARGETS rpc_press RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1 change: 1 addition & 0 deletions tools/rpc_replay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
file(GLOB SOURCES "${PROJECT_SOURCE_DIR}/tools/rpc_replay/*.cpp")
add_executable(rpc_replay ${SOURCES})
target_link_libraries(rpc_replay brpc-static ${DYNAMIC_LIB})
install(TARGETS rpc_replay RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1 change: 1 addition & 0 deletions tools/rpc_view/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_executable(rpc_view rpc_view.cpp ${PROTO_SRC})
target_link_libraries(rpc_view brpc-static ${DYNAMIC_LIB})
install(TARGETS rpc_view RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1 change: 1 addition & 0 deletions tools/trackme_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@

add_executable(trackme_server trackme_server.cpp)
target_link_libraries(trackme_server brpc-static ${DYNAMIC_LIB})
install(TARGETS trackme_server RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

0 comments on commit 4433290

Please sign in to comment.