[icinga-checkins] icinga.org: icinga2/feature/choco: Improve support for building the chocolatey package

git at icinga.org git at icinga.org
Wed Aug 31 13:54:12 CEST 2016


Module: icinga2
Branch: feature/choco
Commit: 302b2919dd7fa64e85123014dded889c687b2930
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=302b2919dd7fa64e85123014dded889c687b2930

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Wed Aug 31 13:41:13 2016 +0200

Improve support for building the chocolatey package

---

 CMakeLists.txt                                     |    1 +
 choco/CMakeLists.txt                               |   26 ++++++++++++++++++++
 .../chocolateyInstall.ps1.cmake                    |    0
 {tools => choco}/chocolateyUninstall.ps1           |    0
 icinga2.nuspec => choco/icinga2.nuspec             |    4 +--
 5 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 504b0eb..7282d17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -281,6 +281,7 @@ add_subdirectory(itl)
 add_subdirectory(doc)
 add_subdirectory(agent)
 add_subdirectory(plugins)
+add_subdirectory(choco)
 
 if(MSVC)
   add_subdirectory(icinga-installer)
diff --git a/choco/CMakeLists.txt b/choco/CMakeLists.txt
new file mode 100644
index 0000000..673f24c
--- /dev/null
+++ b/choco/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Icinga 2
+# Copyright (C) 2012-2016 Icinga Development Team (https://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)
+  find_program(CHOCO_BINARY choco)
+
+  configure_file(chocolateyInstall.ps1.cmake chocolateyInstall.ps1)
+
+  add_custom_target(choco-pkg ALL choco pack
+    DEPENDS icinga2.nuspec ${CMAKE_CURRENT_BINARY_DIR}/chocolateyInstall.ps1 chocolateyUninstall.ps1
+  )
+endif()
diff --git a/tools/chocolateyInstall.ps1 b/choco/chocolateyInstall.ps1.cmake
similarity index 100%
rename from tools/chocolateyInstall.ps1
rename to choco/chocolateyInstall.ps1.cmake
diff --git a/tools/chocolateyUninstall.ps1 b/choco/chocolateyUninstall.ps1
similarity index 100%
rename from tools/chocolateyUninstall.ps1
rename to choco/chocolateyUninstall.ps1
diff --git a/icinga2.nuspec b/choco/icinga2.nuspec
similarity index 86%
rename from icinga2.nuspec
rename to choco/icinga2.nuspec
index 59a274c..0c2d5bb 100755
--- a/icinga2.nuspec
+++ b/choco/icinga2.nuspec
@@ -18,7 +18,7 @@
     <iconUrl>https://www.icinga.org/wp-content/uploads/2015/05/icinga_icon_128x128.png</iconUrl>
   </metadata>
   <files>
-    <file src="tools\chocolateyInstall.ps1" target="tools" />
-    <file src="tools\chocolateyUninstall.ps1" target="tools" />
+    <file src="${CMAKE_CURRENT_BUILD_DIR}/chocolateyInstall.ps1" target="tools" />
+    <file src="${CMAKE_CURRENT_SOURCE_DIR}/chocolateyUninstall.ps1" target="tools" />
   </files>
 </package>



More information about the icinga-checkins mailing list