Fix revision in version string.

Fixes #6231
This commit is contained in:
Michael Friedrich 2014-05-21 10:29:44 +02:00
parent 006ab285bc
commit 6a7f4f8d03
2 changed files with 12 additions and 6 deletions

View File

@ -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()

View File

@ -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