From 6a7f4f8d0365d1a250143736002491d675804e6f Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 21 May 2014 10:29:44 +0200 Subject: [PATCH] Fix revision in version string. Fixes #6231 --- CMakeLists.txt | 14 ++++++++++---- icinga2.spec | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8a47f6c4..89e1c3a27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,10 +48,16 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/icinga-version.h.force) else() if(NOT ICINGA2_GIT_VERSION_INFO OR GIT_VERSION MATCHES "-NOTFOUND$") file(STRINGS icinga2.spec SPEC_VERSION REGEX "^Version:") - string(LENGTH "${SPEC_VERSION}" SPEC_LENGTH) - math(EXPR SPEC_LENGTH "${SPEC_LENGTH} - 9") - string(SUBSTRING ${SPEC_VERSION} 9 ${SPEC_LENGTH} SPEC_VERSION) - set(GIT_VERSION "r${SPEC_VERSION}") + string(LENGTH "${SPEC_VERSION}" SPEC_VERSION_LENGTH) + math(EXPR SPEC_VERSION_LENGTH "${SPEC_VERSION_LENGTH} - 9") + string(SUBSTRING ${SPEC_VERSION} 9 ${SPEC_VERSION_LENGTH} SPEC_VERSION) + + file(STRINGS icinga2.spec SPEC_REVISION REGEX "^%define revision ") + string(LENGTH "${SPEC_REVISION}" SPEC_REVISION_LENGTH) + math(EXPR SPEC_REVISION_LENGTH "${SPEC_REVISION_LENGTH} - 17") + string(SUBSTRING ${SPEC_REVISION} 17 ${SPEC_REVISION_LENGTH} SPEC_REVISION) + + set(GIT_VERSION "r${SPEC_VERSION}-${SPEC_REVISION}") endif() configure_file(icinga-version.h.cmake icinga-version.h) endif() diff --git a/icinga2.spec b/icinga2.spec index ecc6d587f..355f5ad5d 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -17,7 +17,7 @@ # * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * # ******************************************************************************/ -%define revision 1 +%define revision 1.beta1 %if "%{_vendor}" == "redhat" %define el5_boost_version 141 @@ -54,7 +54,7 @@ Summary: Network monitoring application Name: icinga2 -Version: 2.0.0.beta1 +Version: 2.0.0 Release: %{revision}%{?dist} License: GPLv2+ Group: Applications/System