From 63a876cc78cbd471324d5e57be5be0928bfa14ec Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Tue, 22 Sep 2020 18:45:42 -0300 Subject: [PATCH] Allow -DWITH_SETCAP=OFF to disable setcap during make install (#1363) The debs don't want it (and so this will save needing to patch it out), nor do you need it if running via a systemd service file that sets the capabilities. --- daemon/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 1bf03e8aa..29a8ee4d0 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -35,7 +35,10 @@ else() endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") - install(CODE "execute_process(COMMAND setcap cap_net_admin,cap_net_bind_service=+eip ${CMAKE_INSTALL_PREFIX}/bin/lokinet)") + option(WITH_SETCAP "Enables setcap'ing the lokinet binary with the required capabilities during installation (requires root)" ON) + if(WITH_SETCAP) + install(CODE "execute_process(COMMAND setcap cap_net_admin,cap_net_bind_service=+eip ${CMAKE_INSTALL_PREFIX}/bin/lokinet)") + endif() endif() endif()