add new cmake option INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT requested for Gentoo packaging

fixes #6498

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
This commit is contained in:
Gerd von Egidy 2014-06-24 03:02:00 +02:00 committed by Gunnar Beutner
parent 582824e291
commit 933e2480fc
2 changed files with 12 additions and 3 deletions

View File

@ -131,6 +131,10 @@ variables are supported:
defaults to CMAKE_INSTALL_PREFIX/etc/sysconfig/icinga2 defaults to CMAKE_INSTALL_PREFIX/etc/sysconfig/icinga2
- CMAKE_INSTALL_LOCALSTATEDIR: The state directory; defaults to CMAKE_INSTALL_PREFIX/var - CMAKE_INSTALL_LOCALSTATEDIR: The state directory; defaults to CMAKE_INSTALL_PREFIX/var
- USE_SYSTEMD=ON|OFF: Use systemd or a classic SysV initscript; defaults to OFF - USE_SYSTEMD=ON|OFF: Use systemd or a classic SysV initscript; defaults to OFF
- INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON|OFF 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.
Defaults to OFF
### Building Icinga 2 RPMs ### Building Icinga 2 RPMs

View File

@ -39,15 +39,20 @@ if(NOT WIN32)
option (USE_SYSTEMD option (USE_SYSTEMD
"Configure icinga as native systemd service instead of a SysV initscript" OFF) "Configure icinga as native systemd service instead of a SysV initscript" OFF)
if (NOT USE_SYSTEMD) # 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) configure_file(icinga2.init.d.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2)
install( install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2 FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
) )
else() endif()
if (USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT)
configure_file(icinga2.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service @ONLY) configure_file(icinga2.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service @ONLY)
install( install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service