You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by xi...@apache.org on 2023/01/20 02:08:14 UTC

[brpc] branch master updated: Install and pack brpc tools (#2096)

This is an automated email from the ASF dual-hosted git repository.

xiaofeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 44332907 Install and pack brpc tools (#2096)
44332907 is described below

commit 44332907de0c3a2f9d6602ee754511bf64130ec8
Author: Xiaofeng Wang <wa...@gmail.com>
AuthorDate: Fri Jan 20 10:08:08 2023 +0800

    Install and pack brpc tools (#2096)
---
 package/rpm/brpc.spec               | 17 +++++++++++++----
 tools/parallel_http/CMakeLists.txt  |  1 +
 tools/rpc_press/CMakeLists.txt      |  1 +
 tools/rpc_replay/CMakeLists.txt     |  1 +
 tools/rpc_view/CMakeLists.txt       |  1 +
 tools/trackme_server/CMakeLists.txt |  1 +
 6 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/package/rpm/brpc.spec b/package/rpm/brpc.spec
index fa81bb97..b99a1eb4 100644
--- a/package/rpm/brpc.spec
+++ b/package/rpm/brpc.spec
@@ -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
@@ -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}
@@ -68,7 +74,7 @@ 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}
@@ -76,13 +82,13 @@ Static %{name} libraries.
 %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
@@ -105,6 +111,9 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %{_libdir}/libbrpc.so
 
+%files tools
+%{_bindir}/*
+
 %files devel
 %{_includedir}/*
 %{_libdir}/pkgconfig/*
diff --git a/tools/parallel_http/CMakeLists.txt b/tools/parallel_http/CMakeLists.txt
index 457d600c..7099f3e4 100644
--- a/tools/parallel_http/CMakeLists.txt
+++ b/tools/parallel_http/CMakeLists.txt
@@ -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})
diff --git a/tools/rpc_press/CMakeLists.txt b/tools/rpc_press/CMakeLists.txt
index e50e296b..bdcba5d5 100644
--- a/tools/rpc_press/CMakeLists.txt
+++ b/tools/rpc_press/CMakeLists.txt
@@ -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})
diff --git a/tools/rpc_replay/CMakeLists.txt b/tools/rpc_replay/CMakeLists.txt
index b1ec83b5..8278da28 100644
--- a/tools/rpc_replay/CMakeLists.txt
+++ b/tools/rpc_replay/CMakeLists.txt
@@ -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})
diff --git a/tools/rpc_view/CMakeLists.txt b/tools/rpc_view/CMakeLists.txt
index 92e54e30..55a3bc5e 100644
--- a/tools/rpc_view/CMakeLists.txt
+++ b/tools/rpc_view/CMakeLists.txt
@@ -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})
diff --git a/tools/trackme_server/CMakeLists.txt b/tools/trackme_server/CMakeLists.txt
index 5ccf9711..35d797e9 100644
--- a/tools/trackme_server/CMakeLists.txt
+++ b/tools/trackme_server/CMakeLists.txt
@@ -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})


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org