2014-06-16 01:55:50 +02:00
# Icinga 2
# Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)
#
# 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.
if ( NOT WIN32 )
2014-07-09 17:20:23 +02:00
set ( ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2" )
2014-06-16 01:55:50 +02:00
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 (
F I L E S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n i t s y s t e m / i c i n g a 2 . s y s c o n f i g
D E S T I N A T I O N $ { I C I N G A 2 _ S Y S C O N F I G F I L E _ D I R }
R E N A M E $ { I C I N G A 2 _ S Y S C O N F I G F I L E _ N A M E }
P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E G R O U P _ R E A D W O R L D _ R E A D
)
install (
2014-12-11 09:27:31 +01:00
F I L E S p r e p a r e - d i r s s a f e - r e l o a d
2014-11-27 14:33:26 +01:00
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / l i b / i c i n g a 2
2014-06-16 01:55:50 +02:00
P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E G R O U P _ R E A D G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E
)
option ( USE_SYSTEMD
" C o n f i g u r e i c i n g a a s n a t i v e s y s t e m d s e r v i c e i n s t e a d o f a S y s V i n i t s c r i p t " O F F )
2014-06-24 03:02:00 +02:00
# required for packaging on Gentoo, see Bug #6498
option ( INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT
" F o r c e i n s t a l l b o t h t h e s y s t e m d s e r v i c e d e f i n i t i o n f i l e a n d t h e S y s V i n i t s c r i p t i n p a r a l l e l , r e g a r d l e s s o f h o w U S E _ S Y S T E M D i s s e t . O n l y u s e t h i s f o r s p e c i a l p a c k a g i n g p u r p o s e s a n d i f y o u k n o w w h a t y o u a r e d o i n g " O F F )
if ( NOT USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT )
2014-06-16 01:55:50 +02:00
configure_file ( icinga2.init.d.cmake ${ CMAKE_CURRENT_BINARY_DIR } /initsystem/icinga2 )
install (
F I L E S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n i t s y s t e m / i c i n g a 2
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ S Y S C O N F D I R } / i n i t . d
P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E G R O U P _ R E A D G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E
)
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 (
F I L E S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n i t s y s t e m / i c i n g a 2 . s e r v i c e
D E S T I N A T I O N $ { D E S T D I R } / u s r / l i b / s y s t e m d / s y s t e m
P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E G R O U P _ R E A D W O R L D _ R E A D
)
endif ( )
endif ( )