diff --git a/CMakeLists.txt b/CMakeLists.txt index 504b0eb11..7282d17da 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/RELEASE.md b/RELEASE.md index 4d5f88f92..0ef999165 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,11 +41,9 @@ Update the [.mailmap](.mailmap) and [AUTHORS](AUTHORS) files: ## Version -Update the version number in the following files: +Update the version number in the following file: * [icinga2.spec]: Version: (.*) -* [icinga2.nuspec]: (.*) -* [tools/chocolateyInstall.ps1]: Icinga2-v(.*)-{x86,x86_64}.msi Example: diff --git a/choco/CMakeLists.txt b/choco/CMakeLists.txt new file mode 100644 index 000000000..d6e957520 --- /dev/null +++ b/choco/CMakeLists.txt @@ -0,0 +1,29 @@ +# 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(WIN32) + find_program(CHOCO_BINARY choco) + + configure_file(icinga2.nuspec.cmake icinga2.nuspec) + configure_file(chocolateyInstall.ps1.cmake chocolateyInstall.ps1) + + add_custom_target(choco-pkg ALL + COMMAND choco pack + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/icinga2.${SPEC_VERSION}.nupkg ${CMAKE_CURRENT_BINARY_DIR}/icinga2.nupkg + 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 57% rename from tools/chocolateyInstall.ps1 rename to choco/chocolateyInstall.ps1.cmake index 9618aa936..1888cf770 100755 --- a/tools/chocolateyInstall.ps1 +++ b/choco/chocolateyInstall.ps1.cmake @@ -1,7 +1,7 @@ $packageName = 'icinga2' $installerType = 'msi' -$url32 = 'http://packages.icinga.org/windows/Icinga2-v2.5.4-x86.msi' -$url64 = 'http://packages.icinga.org/windows/Icinga2-v2.5.4-x86_64.msi' +$url32 = 'http://packages.icinga.org/windows/Icinga2-v${SPEC_VERSION}-x86.msi' +$url64 = 'http://packages.icinga.org/windows/Icinga2-v${SPEC_VERSION}-x86_64.msi' $silentArgs = '/qn /norestart' $validExitCodes = @(0) 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.cmake similarity index 84% rename from icinga2.nuspec rename to choco/icinga2.nuspec.cmake index 59a274cb2..90280ee3d 100755 --- a/icinga2.nuspec +++ b/choco/icinga2.nuspec.cmake @@ -6,7 +6,7 @@ icinga2 Icinga2 - 2.5.4 + ${SPEC_VERSION} 2016 - The Icinga Project Icinga Development Team icinga2 - Monitoring Agent for Windows @@ -18,7 +18,7 @@ https://www.icinga.org/wp-content/uploads/2015/05/icinga_icon_128x128.png - - + +