2019-02-25 15:09:36 +01:00
|
|
|
# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
|
2013-11-03 13:45:26 +01:00
|
|
|
|
2014-11-19 07:20:37 +01:00
|
|
|
if(NOT WIN32)
|
|
|
|
configure_file(icinga2/constants.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2/constants.conf @ONLY)
|
|
|
|
endif()
|
2014-11-13 22:36:38 +01:00
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
configure_file(logrotate.d/icinga2.cmake ${CMAKE_CURRENT_BINARY_DIR}/logrotate.d/icinga2 @ONLY)
|
|
|
|
endif()
|
2013-11-03 13:45:26 +01:00
|
|
|
|
2014-11-19 07:20:37 +01:00
|
|
|
if(NOT WIN32)
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/icinga2/constants.conf ${ICINGA2_CONFIGDIR})
|
|
|
|
install_if_not_exists(icinga2/icinga2.conf ${ICINGA2_CONFIGDIR})
|
2014-11-19 07:20:37 +01:00
|
|
|
else()
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(${CMAKE_CURRENT_SOURCE_DIR}/icinga2/win32/constants.conf ${ICINGA2_CONFIGDIR})
|
|
|
|
install_if_not_exists(icinga2/win32/icinga2.conf ${ICINGA2_CONFIGDIR})
|
2014-11-19 07:20:37 +01:00
|
|
|
endif()
|
|
|
|
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(icinga2/zones.conf ${ICINGA2_CONFIGDIR})
|
|
|
|
install_if_not_exists(icinga2/conf.d/app.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/commands.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/downtimes.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/groups.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
2014-11-19 07:20:37 +01:00
|
|
|
|
|
|
|
if(NOT WIN32)
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(icinga2/conf.d/hosts.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/services.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
2014-11-19 07:20:37 +01:00
|
|
|
else()
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(icinga2/conf.d/win32/hosts.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/win32/services.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
2014-11-19 07:20:37 +01:00
|
|
|
endif()
|
|
|
|
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(icinga2/conf.d/notifications.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/templates.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/timeperiods.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/users.conf ${ICINGA2_CONFIGDIR}/conf.d)
|
|
|
|
install_if_not_exists(icinga2/features-available/api.conf ${ICINGA2_CONFIGDIR}/features-available)
|
|
|
|
install_if_not_exists(icinga2/features-available/debuglog.conf ${ICINGA2_CONFIGDIR}/features-available)
|
|
|
|
install_if_not_exists(icinga2/features-available/mainlog.conf ${ICINGA2_CONFIGDIR}/features-available)
|
2015-04-24 14:47:21 +02:00
|
|
|
if(NOT WIN32)
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(icinga2/features-available/syslog.conf ${ICINGA2_CONFIGDIR}/features-available)
|
2015-04-24 14:47:21 +02:00
|
|
|
endif()
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(icinga2/scripts/mail-host-notification.sh ${ICINGA2_CONFIGDIR}/scripts)
|
|
|
|
install_if_not_exists(icinga2/scripts/mail-service-notification.sh ${ICINGA2_CONFIGDIR}/scripts)
|
|
|
|
install_if_not_exists(icinga2/zones.d/README ${ICINGA2_CONFIGDIR}/zones.d)
|
2014-11-18 16:48:58 +01:00
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/logrotate.d/icinga2 ${LOGROTATE_DIR})
|
2014-11-18 16:48:58 +01:00
|
|
|
endif()
|
2014-04-18 12:14:21 +02:00
|
|
|
|
|
|
|
if(NOT WIN32)
|
2018-07-31 11:59:09 +02:00
|
|
|
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_CONFIGDIR}/features-enabled\")")
|
|
|
|
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/mainlog.conf \"\$ENV{DESTDIR}${ICINGA2_FULL_CONFIGDIR}/features-enabled/mainlog.conf\")")
|
2014-10-06 14:21:18 +02:00
|
|
|
|
2018-07-31 11:59:09 +02:00
|
|
|
install(FILES bash_completion.d/icinga2 DESTINATION ${BASHCOMPLETION_DIR})
|
2014-04-18 12:14:21 +02:00
|
|
|
else()
|
2018-07-31 11:59:09 +02:00
|
|
|
install_if_not_exists(icinga2/features-enabled/mainlog.conf ${ICINGA2_CONFIGDIR}/features-enabled)
|
2014-04-18 12:14:21 +02:00
|
|
|
endif()
|
2013-11-03 13:45:26 +01:00
|
|
|
|
2017-12-20 08:44:06 +01:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(Linux|Solaris|SunOS)")
|
2014-11-13 22:36:38 +01:00
|
|
|
add_subdirectory(initsystem)
|
|
|
|
endif()
|
2014-04-20 11:22:15 +02:00
|
|
|
|
|
|
|
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
|