diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:34:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:34:54 +0000 |
commit | 0915b3ef56dfac3113cce55a59a5765dc94976be (patch) | |
tree | a8fea11d50b4f083e1bf0f90025ece7f0824784a /etc/initsystem/CMakeLists.txt | |
parent | Initial commit. (diff) | |
download | icinga2-0915b3ef56dfac3113cce55a59a5765dc94976be.tar.xz icinga2-0915b3ef56dfac3113cce55a59a5765dc94976be.zip |
Adding upstream version 2.13.6.upstream/2.13.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | etc/initsystem/CMakeLists.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/etc/initsystem/CMakeLists.txt b/etc/initsystem/CMakeLists.txt new file mode 100644 index 0000000..eb0f9f2 --- /dev/null +++ b/etc/initsystem/CMakeLists.txt @@ -0,0 +1,44 @@ +# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ + + +if(NOT WIN32) + configure_file(icinga2.sysconfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.sysconfig @ONLY) + get_filename_component(ICINGA2_SYSCONFIGFILE_NAME ${ICINGA2_SYSCONFIGFILE} NAME) + get_filename_component(ICINGA2_SYSCONFIGFILE_DIR ${ICINGA2_SYSCONFIGFILE} PATH) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.sysconfig + DESTINATION ${ICINGA2_SYSCONFIGFILE_DIR} + RENAME ${ICINGA2_SYSCONFIGFILE_NAME} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) + + configure_file(prepare-dirs.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/prepare-dirs @ONLY) + configure_file(safe-reload.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/safe-reload @ONLY) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/prepare-dirs ${CMAKE_CURRENT_BINARY_DIR}/initsystem/safe-reload + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/icinga2 + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + + # required for packaging on Gentoo, see Bug #6498 + option (INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT + "Force install both the systemd service definition file and the SysV initscript in parallel, regardless of how USE_SYSTEMD is set. Only use this for special packaging purposes and if you know what you are doing" OFF) + + if (NOT USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT) + configure_file(icinga2.init.d.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2 @ONLY) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2 + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + endif() + + if (USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT) + configure_file(icinga2.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service @ONLY) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service + DESTINATION ${DESTDIR}/usr/lib/systemd/system + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) + endif() +endif() |