From 7e03fbb2b47452b6dd4c3971fbafdfe171f64f5b Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 18 Dec 2013 12:54:49 +0100 Subject: [PATCH] Fix el5 build. Fixes #5033 --- CMakeLists.txt | 5 ++++- INSTALL | 8 +++++++- icinga2.spec | 12 +++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b34f66f6..4c613401b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. cmake_minimum_required(VERSION 2.6) +set(BOOST_MIN_VERSION "1.41.0") + project(icinga2) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -59,7 +61,8 @@ if(WIN32) add_definitions(-DBOOST_ALL_NO_LIB) endif() -find_package(Boost 1.41.0 COMPONENTS thread system program_options regex REQUIRED) +find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS thread system program_options regex REQUIRED) + link_directories(${Boost_LIBRARY_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) diff --git a/INSTALL b/INSTALL index f599bf8b7..325f4498b 100644 --- a/INSTALL +++ b/INSTALL @@ -26,11 +26,17 @@ parentheses): * Boost library and header files (boost-devel on RHEL, libboost-all-dev on Debian) * GNU bison (bison) -* GNU flex (flex) +* GNU flex (flex) >= 2.5.35 * optional: Doxygen (doxygen) * optional: MySQL (mysql-devel on RHEL, libmysqlclient-dev on Debian) * optional: Python (python-devel on RHEL, python-dev on Debian) +Note: RHEL5 ships an ancient flex version. Updated packages are available for +example from the repoforge buildtools repository. + +http://mirror.hs-esslingen.de/repoforge/redhat/el5/en/{i386,x86_64}/buildtools/ + + User Requirements ----------------- diff --git a/icinga2.spec b/icinga2.spec index 535c67e95..82412e4b8 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -60,7 +60,7 @@ BuildRequires: openssl-devel BuildRequires: gcc-c++ BuildRequires: libstdc++-devel BuildRequires: cmake -BuildRequires: flex +BuildRequires: flex >= 2.5.35 BuildRequires: bison BuildRequires: %{apachename} @@ -219,12 +219,18 @@ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \ -DICINGA2_COMMAND_GROUP=%{icingacmd_group}" %if "%{_vendor}" == "redhat" %if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" +# Boost_VERSION 1.41.0 vs 101400 - disable build tests +# details in https://dev.icinga.org/issues/5033 CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost141 \ -DBOOST_INCLUDEDIR=/usr/include/boost141 \ - -DBoost_ADDITIONAL_VERSIONS='1.41;1.41.0'" + -DBoost_ADDITIONAL_VERSIONS='1.41;1.41.0' \ + -DBoost_NO_SYSTEM_PATHS=TRUE \ + -DBUILD_TESTING=FALSE \ + -DBoost_NO_BOOST_CMAKE=TRUE" %endif %endif -cmake $CMAKE_OPTS . + +cmake $CMAKE_OPTS . make %{?_smp_mflags} -- 2.49.0