2013-11-03 13:45:26 +01:00
|
|
|
# Icinga 2
|
2017-01-10 15:54:22 +01:00
|
|
|
# Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
|
2013-11-03 13:45:26 +01:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
2014-10-13 13:43:05 +02:00
|
|
|
configure_file(icinga2/init.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2/init.conf @ONLY)
|
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-10-13 13:43:05 +02:00
|
|
|
install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/icinga2/init.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
|
2014-11-19 07:20:37 +01:00
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/icinga2/constants.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
|
2015-03-25 10:48:20 +01:00
|
|
|
install_if_not_exists(icinga2/icinga2.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
|
2014-11-19 07:20:37 +01:00
|
|
|
else()
|
|
|
|
install_if_not_exists(${CMAKE_CURRENT_SOURCE_DIR}/icinga2/win32/constants.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
|
2015-03-25 10:48:20 +01:00
|
|
|
install_if_not_exists(icinga2/win32/icinga2.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
|
2014-11-19 07:20:37 +01:00
|
|
|
endif()
|
|
|
|
|
2014-05-22 21:00:42 +02:00
|
|
|
install_if_not_exists(icinga2/zones.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
|
2015-09-22 18:18:29 +02:00
|
|
|
install_if_not_exists(icinga2/conf.d/app.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
2014-04-20 11:22:15 +02:00
|
|
|
install_if_not_exists(icinga2/conf.d/commands.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/downtimes.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/groups.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
2014-11-19 07:20:37 +01:00
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
install_if_not_exists(icinga2/conf.d/hosts.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
2015-03-25 10:48:20 +01:00
|
|
|
install_if_not_exists(icinga2/conf.d/services.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
2014-11-19 07:20:37 +01:00
|
|
|
else()
|
|
|
|
install_if_not_exists(icinga2/conf.d/win32/hosts.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
2015-03-25 10:48:20 +01:00
|
|
|
install_if_not_exists(icinga2/conf.d/win32/services.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
2014-11-19 07:20:37 +01:00
|
|
|
endif()
|
|
|
|
|
2014-05-22 22:14:17 +02:00
|
|
|
install_if_not_exists(icinga2/conf.d/notifications.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/templates.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/timeperiods.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
|
|
|
install_if_not_exists(icinga2/conf.d/users.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
2014-05-03 20:02:22 +02:00
|
|
|
install_if_not_exists(icinga2/features-available/api.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
|
2014-04-20 11:22:15 +02:00
|
|
|
install_if_not_exists(icinga2/features-available/debuglog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
|
|
|
|
install_if_not_exists(icinga2/features-available/mainlog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
|
2015-04-24 14:47:21 +02:00
|
|
|
if(NOT WIN32)
|
|
|
|
install_if_not_exists(icinga2/features-available/syslog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
|
|
|
|
endif()
|
2014-04-20 11:22:15 +02:00
|
|
|
install_if_not_exists(icinga2/scripts/mail-host-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts)
|
|
|
|
install_if_not_exists(icinga2/scripts/mail-service-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts)
|
2014-05-13 13:18:27 +02:00
|
|
|
install_if_not_exists(icinga2/zones.d/README ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/zones.d)
|
2014-11-18 16:48:58 +01:00
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/logrotate.d/icinga2 ${CMAKE_INSTALL_SYSCONFDIR}/logrotate.d)
|
|
|
|
endif()
|
2014-04-18 12:14:21 +02:00
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled\")")
|
|
|
|
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/mainlog.conf \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled/mainlog.conf\")")
|
2014-10-06 14:21:18 +02:00
|
|
|
|
|
|
|
install(
|
|
|
|
FILES bash_completion.d/icinga2
|
|
|
|
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/bash_completion.d
|
|
|
|
)
|
2014-04-18 12:14:21 +02:00
|
|
|
else()
|
2016-04-01 08:25:36 +02:00
|
|
|
install_if_not_exists(icinga2/features-enabled/mainlog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-enabled)
|
2014-04-18 12:14:21 +02:00
|
|
|
endif()
|
2013-11-03 13:45:26 +01:00
|
|
|
|
2014-11-13 22:36:38 +01:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
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)
|