2019-02-25 15:09:36 +01:00
|
|
|
# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
|
2014-06-16 01:55:50 +02:00
|
|
|
|
2018-05-23 13:37:29 +02:00
|
|
|
|
2014-06-16 01:55:50 +02:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2018-05-23 13:37:29 +02:00
|
|
|
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)
|
2014-06-16 01:55:50 +02:00
|
|
|
install(
|
2018-05-23 13:37:29 +02:00
|
|
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/prepare-dirs ${CMAKE_CURRENT_BINARY_DIR}/initsystem/safe-reload
|
2014-11-27 14:33:26 +01:00
|
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/icinga2
|
2014-06-16 01:55:50 +02:00
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
|
|
|
|
2014-06-24 03:02:00 +02:00
|
|
|
# required for packaging on Gentoo, see Bug #6498
|
|
|
|
option (INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT
|
2018-01-19 09:18:52 +01:00
|
|
|
"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)
|
2014-06-24 03:02:00 +02:00
|
|
|
|
|
|
|
if (NOT USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT)
|
2018-05-23 13:37:29 +02:00
|
|
|
configure_file(icinga2.init.d.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2 @ONLY)
|
2014-06-16 01:55:50 +02:00
|
|
|
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
|
|
|
|
)
|
2014-06-24 03:02:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT)
|
2014-06-16 01:55:50 +02:00
|
|
|
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()
|