Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2022-09-07 21:11:15 +0300
committerRobert Adam <dev@robert-adam.de>2022-09-10 18:28:34 +0300
commitd2c7289592e0e22e290c5af1fdb76dd394bb6639 (patch)
tree0f110984da171aa627b358a3c8170c98a6c737c0
parentcd068fe3eec4713916257295626e2aebf6c6ed7f (diff)
BUILD(cmake): Install user-wrapper script and service file
-rw-r--r--auxiliary_files/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/auxiliary_files/CMakeLists.txt b/auxiliary_files/CMakeLists.txt
index 14f6e70a7..5c2a6addc 100644
--- a/auxiliary_files/CMakeLists.txt
+++ b/auxiliary_files/CMakeLists.txt
@@ -54,6 +54,18 @@ if(server)
# Fallback value, in case it could not be fetched via pkg-config
set(SYSUSERS_DIR "${CMAKE_INSTALL_SYSCONFDIR}/sysconfig.d")
endif()
+ get_pkgconf_variable(
+ OUTPUT_VARIABLE SYSTEMD_SERVICE_DIR
+ MODULE systemd
+ VARIABLE_NAME systemd_system_unit_dir
+ QUIET
+ )
+ if(NOT SYSTEMD_SERVICE_DIR)
+ # Default to /etc/systemd/system - This is not where packages ought to install their service files (rather
+ # it's where an admin is supposed to add their system files), but this seems to be the most consistent
+ # path across different platforms, so we use it anyway.
+ set(SYSTEMD_SERVICE_DIR "${CMAKE_INSTALL_SYSCONFDIR}/systemd/system")
+ endif()
delayed_configure_files(
TARGET mumble-server
@@ -77,6 +89,9 @@ if(server)
install(FILES "mumble-server.ini" DESTINATION "${MUMBLE_INSTALL_SYSCONFDIR}" COMPONENT mumble_server)
install(FILES "config_files/mumble-server.sysusers" DESTINATION "${SYSUSERS_DIR}" COMPONENT mumble_server RENAME "mumble-server.conf")
+
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mumble-server.service" DESTINATION "${SYSTEMD_SERVICE_DIR}" COMPONENT mumble_server)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mumble-server-user-wrapper" DESTINATION "${MUMBLE_INSTALL_EXECUTABLEDIR}" COMPONENT mumble_server)
endif()
endif()