[icinga-checkins] icinga.org: icinga2/feature/parallel-systemd-initd-6498: add new cmake option INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT requested for Gentoo packaging

git at icinga.org git at icinga.org
Tue Jun 24 03:03:12 CEST 2014


Module: icinga2
Branch: feature/parallel-systemd-initd-6498
Commit: 4d3ff6a567654e0861e3098d17afab7e64de35a5
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=4d3ff6a567654e0861e3098d17afab7e64de35a5

Author: Gerd von Egidy <gerd at egidy.de>
Date:   Tue Jun 24 03:02:00 2014 +0200

add new cmake option INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT requested for Gentoo packaging

Refs #6498

---

 INSTALL                       |    4 ++++
 etc/initsystem/CMakeLists.txt |   11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/INSTALL b/INSTALL
index 5329fb1..99e8789 100644
--- a/INSTALL
+++ b/INSTALL
@@ -131,6 +131,10 @@ variables are supported:
 		defaults to CMAKE_INSTALL_PREFIX/etc/sysconfig/icinga2
 - 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
+- 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
 
diff --git a/etc/initsystem/CMakeLists.txt b/etc/initsystem/CMakeLists.txt
index f29c6dc..b7810e0 100644
--- a/etc/initsystem/CMakeLists.txt
+++ b/etc/initsystem/CMakeLists.txt
@@ -39,15 +39,20 @@ if(NOT WIN32)
   option (USE_SYSTEMD
      "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)
     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
     )
-  else()
+  endif()
+
+  if (USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT)
     configure_file(icinga2.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service @ONLY)
     install(
       FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service



More information about the icinga-checkins mailing list