set(HAVE_SYSTEMD ${USE_SYSTEMD})
-file(STRINGS icinga2.spec VERSION_LINE REGEX "^Version: ")
+file(STRINGS VERSION VERSION_LINE REGEX "^Version: ")
string(REPLACE "Version: " "" ICINGA2_VERSION ${VERSION_LINE})
include(GNUInstallDirs)
set(ICINGA2_LICENSE "${ICINGA2_LICENSE_GPL}\n\n---\n\n${ICINGA2_LICENSE_ADDITIONS}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" ${ICINGA2_LICENSE})
-file(STRINGS icinga2.spec SPEC_VERSION REGEX "^Version:")
+file(STRINGS VERSION SPEC_VERSION REGEX "^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)
configure_file(icinga-version.h.force ${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h COPYONLY)
else()
if(NOT ICINGA2_GIT_VERSION_INFO OR GIT_VERSION MATCHES "-NOTFOUND$")
- file(STRINGS icinga2.spec SPEC_REVISION REGEX "^%define revision ")
+ file(STRINGS VERSION SPEC_REVISION REGEX "^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)
+ math(EXPR SPEC_REVISION_LENGTH "${SPEC_REVISION_LENGTH} - 10")
+ string(SUBSTRING ${SPEC_REVISION} 10 ${SPEC_REVISION_LENGTH} SPEC_REVISION)
set(GIT_VERSION "r${SPEC_VERSION}-${SPEC_REVISION}")
endif()
CMake determines the Icinga 2 version number using `git describe` if the
source directory is contained in a Git repository. Otherwise the version number
-is extracted from the [icinga2.spec](icinga2.spec) file. This behavior can be
+is extracted from the [VERSION](VERSION) file. This behavior can be
overridden by creating a file called `icinga-version.h.force` in the source
directory. Alternatively the `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake
can be used to disable the usage of `git describe`.
Copy the icinga2.spec file to `rpmbuild/SPEC` or fetch the latest version:
```
-curl https://raw.githubusercontent.com/Icinga/icinga2/master/icinga2.spec -o $HOME/rpmbuild/SPECS/icinga2.spec
+curl https://raw.githubusercontent.com/Icinga/rpm-icinga2/master/icinga2.spec -o $HOME/rpmbuild/SPECS/icinga2.spec
```
Copy the tarball to `rpmbuild/SOURCES` e.g. by using the `spectool` binary
Update the version in the spec file:
```
-gsed -i "s/Version: .*/Version: $VERSION/g" icinga2.spec
+gsed -i "s/Version: .*/Version: $VERSION/g" VERSION
```
## Changelog
--- /dev/null
+Version: 2.8.2
+Revision: 1
+++ /dev/null
-#/******************************************************************************
-# * Icinga 2 *
-# * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
-# * *
-# * 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. *
-# ******************************************************************************/
-
-# The spec file was moved to https://github.com/Icinga/icinga-packaging
-
-%define revision 1
-Version: 2.8.2