From 441536f292e143df78935f084a70982c1027350a Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 5 Apr 2018 16:41:10 +0200 Subject: [PATCH] Use VERSION instead of icinga2.spec --- CMakeLists.txt | 10 +++++----- INSTALL.md | 4 ++-- RELEASE.md | 2 +- VERSION | 2 ++ icinga2.spec | 23 ----------------------- 5 files changed, 10 insertions(+), 31 deletions(-) create mode 100644 VERSION delete mode 100644 icinga2.spec diff --git a/CMakeLists.txt b/CMakeLists.txt index 248f86730..56b095af8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ option (USE_SYSTEMD 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) @@ -72,7 +72,7 @@ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.Exceptions" ICINGA2_LICENSE_ADDIT 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) @@ -85,10 +85,10 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/icinga-version.h.force) 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() diff --git a/INSTALL.md b/INSTALL.md index c7b5db363..6c3b9aa0b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -188,7 +188,7 @@ See [FindMySQL.cmake](third-party/cmake/FindPostgreSQL.cmake) for the implementa 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`. @@ -232,7 +232,7 @@ rpmdev-setuptree 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 diff --git a/RELEASE.md b/RELEASE.md index 9cfb6d638..70b02f9e4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -29,7 +29,7 @@ git log --use-mailmap | grep '^Author:' | cut -f2- -d' ' | sort | uniq > AUTHORS 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 diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..ca98ab6df --- /dev/null +++ b/VERSION @@ -0,0 +1,2 @@ +Version: 2.8.2 +Revision: 1 diff --git a/icinga2.spec b/icinga2.spec deleted file mode 100644 index 0580aa4a1..000000000 --- a/icinga2.spec +++ /dev/null @@ -1,23 +0,0 @@ -#/****************************************************************************** -# * 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