[icinga-checkins] icinga.org: icinga2/next: Separate CMakeLists.txt for etc/initsystem.

git at icinga.org git at icinga.org
Mon Jun 16 08:57:49 CEST 2014


Module: icinga2
Branch: next
Commit: 3ac3c91499a9f39385aaac3ed4d32a544cc7c91d
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=3ac3c91499a9f39385aaac3ed4d32a544cc7c91d

Author: Gerd von Egidy <gerd at egidy.de>
Date:   Mon Jun 16 01:55:50 2014 +0200

Separate CMakeLists.txt for etc/initsystem.

Refs #6491

---

 etc/CMakeLists.txt            |   42 +----------------------------
 etc/initsystem/CMakeLists.txt |   58 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 41 deletions(-)

diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt
index e078e4d..8aba39d 100644
--- a/etc/CMakeLists.txt
+++ b/etc/CMakeLists.txt
@@ -75,46 +75,6 @@ else()
   )
 endif()
 
-if(NOT WIN32)
-  if(NOT DEFINED ICINGA2_SYSCONFIGFILE)
-    set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
-  endif()
-
-  configure_file(initsystem/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(
-    FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.sysconfig
-    DESTINATION ${ICINGA2_SYSCONFIGFILE_DIR}
-    RENAME ${ICINGA2_SYSCONFIGFILE_NAME}
-    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  )
-
-  install(
-    FILES initsystem/icinga2-prepare-dirs
-    DESTINATION ${CMAKE_INSTALL_SBINDIR}
-    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-  )
-
-  option (USE_SYSTEMD
-     "Configure icinga as native systemd service instead of a SysV initscript" OFF) 
-
-  if (NOT USE_SYSTEMD)
-  
-    configure_file(initsystem/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()
-    configure_file(initsystem/icinga2.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service @ONLY)
-    install(
-      FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service
-      DESTINATION ${DESTDIR}/usr/lib/systemd/system
-      PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-    )
-  endif()
-endif()
+add_subdirectory(initsystem)
 
 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
diff --git a/etc/initsystem/CMakeLists.txt b/etc/initsystem/CMakeLists.txt
new file mode 100644
index 0000000..f29c6dc
--- /dev/null
+++ b/etc/initsystem/CMakeLists.txt
@@ -0,0 +1,58 @@
+# 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)
+  if(NOT DEFINED ICINGA2_SYSCONFIGFILE)
+    set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
+  endif()
+
+  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(
+    FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.sysconfig
+    DESTINATION ${ICINGA2_SYSCONFIGFILE_DIR}
+    RENAME ${ICINGA2_SYSCONFIGFILE_NAME}
+    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+  )
+
+  install(
+    FILES icinga2-prepare-dirs
+    DESTINATION ${CMAKE_INSTALL_SBINDIR}
+    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+  )
+
+  option (USE_SYSTEMD
+     "Configure icinga as native systemd service instead of a SysV initscript" OFF) 
+
+  if (NOT USE_SYSTEMD)
+  
+    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()
+    configure_file(icinga2.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service @ONLY)
+    install(
+      FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service
+      DESTINATION ${DESTDIR}/usr/lib/systemd/system
+      PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+    )
+  endif()
+endif()



More information about the icinga-checkins mailing list