From 58305d336ab2888a03439123a30302aa92f83296 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Mon, 11 Mar 2019 15:20:33 +0100 Subject: [PATCH 01/17] ci: Add config for centos:7 --- .gitlab-ci.yml | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..95787dc --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,62 @@ +stages: + - build + - test + - upload + +variables: + DOCKER_IMAGE_BASE: registry.icinga.com/build-docker + ICINGA_BUILD_TYPE: snapshot + +.build: &build + stage: build + tags: + - docker + image: ${DOCKER_IMAGE_BASE}/${DOCKER_IMAGE} + script: + - icinga-build-package + cache: + key: "${CI_JOB_NAME}" + paths: + - ccache/ + artifacts: + paths: + - build/* + expire_in: 1 week + +.test: &test + stage: test + tags: + - docker + image: ${DOCKER_IMAGE_BASE}/${DOCKER_IMAGE} + script: + - find build/ + - icinga-build-test + +.upload: &upload + stage: upload + tags: + - docker + image: ${DOCKER_IMAGE_BASE}/upload + script: + - find build/ + - icinga-build-upload-aptly + only: + - tags + - master + +build/centos/7: + <<: *build + variables: + DOCKER_IMAGE: centos/7 + +test/centos/7: + <<: *test + variables: + DOCKER_IMAGE: centos/7 + dependencies: + - build/centos/7 + +upload/epel/7: + <<: *upload + dependencies: + - build/centos/7 From 554299e57e46a07a738c3b688004588add2419a9 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Mon, 11 Mar 2019 15:28:58 +0100 Subject: [PATCH 02/17] Remove el5 from spec --- icinga2.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index 89d0bbb..a47f50f 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -36,7 +36,7 @@ %define apacheuser apache %define apachegroup apache -%if 0%{?el5}%{?el6}%{?amzn} +%if 0%{?el6}%{?amzn} %define use_systemd 0 %define use_selinux 0 %if %(uname -m) != "x86_64" @@ -122,7 +122,7 @@ BuildRequires: gcc48-c++ BuildRequires: libopenssl1-devel BuildRequires: libstdc++48-devel %else -%if "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +%if "%{_vendor}" == "redhat" && (0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") # Requires devtoolset-2 scl BuildRequires: devtoolset-2-binutils BuildRequires: devtoolset-2-gcc-c++ @@ -139,8 +139,8 @@ BuildRequires: cmake BuildRequires: flex >= 2.5.35 BuildRequires: make -%if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") -# el5 and el6 require packages.icinga.com +%if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +# el6 require packages.icinga.com BuildRequires: boost153-devel %else %if 0%{?build_icinga_org} && "%{_vendor}" == "suse" && 0%{?suse_version} < 1310 @@ -153,7 +153,7 @@ BuildRequires: libboost_regex-devel >= 1.48 BuildRequires: libboost_system-devel >= 1.48 BuildRequires: libboost_thread-devel >= 1.48 %else -%if (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +%if (0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") # Requires EPEL repository BuildRequires: boost148-devel >= 1.48 %else @@ -324,7 +324,7 @@ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true" %endif %if "%{_vendor}" == "redhat" -%if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6" +%if 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6" %if 0%{?build_icinga_org} # Boost_VERSION 1.41.0 vs 101400 - disable build tests # details in https://dev.icinga.com/issues/5033 From 0235fa7cb6c8ff3414cd3c3f868f11ceb859e35d Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Mon, 11 Mar 2019 16:21:39 +0100 Subject: [PATCH 03/17] ci: Build branch feature/boost-asio --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95787dc..eaf269f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ stages: variables: DOCKER_IMAGE_BASE: registry.icinga.com/build-docker ICINGA_BUILD_TYPE: snapshot + ICINGA_BUILD_UPSTREAM_BRANCH: feature/boost-asio .build: &build stage: build From 519433f9bde7928a85b783de7d9d6a62b76d9313 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Mon, 11 Mar 2019 16:22:17 +0100 Subject: [PATCH 04/17] Update Boost handling in spec and require 1.66 --- icinga2.spec | 82 +++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 49 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index a47f50f..51778d6 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -80,6 +80,8 @@ %define logmsg logger -t %{name}/rpm +%define boost_min_version 1.66 + Summary: Network monitoring application %if "%{_vendor}" == "suse" License: GPL-2.0-or-later @@ -139,29 +141,26 @@ BuildRequires: cmake BuildRequires: flex >= 2.5.35 BuildRequires: make -%if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") -# el6 require packages.icinga.com -BuildRequires: boost153-devel -%else -%if 0%{?build_icinga_org} && "%{_vendor}" == "suse" && 0%{?suse_version} < 1310 -# sles 11 sp3 requires packages.icinga.com -BuildRequires: boost153-devel -%else -%if "%{_vendor}" == "suse" && 0%{?suse_version} > 1320 -BuildRequires: libboost_program_options-devel >= 1.48 -BuildRequires: libboost_regex-devel >= 1.48 -BuildRequires: libboost_system-devel >= 1.48 -BuildRequires: libboost_thread-devel >= 1.48 -%else -%if (0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") -# Requires EPEL repository -BuildRequires: boost148-devel >= 1.48 -%else -BuildRequires: boost-devel >= 1.48 -%endif -%endif -%endif -%endif +%if "%{_vendor}" == "suse" +%if 0%{?suse_version} > 1320 # SLES 15 and OpenSUSE +BuildRequires: libboost_program_options-devel >= %{boost_min_version} +BuildRequires: libboost_regex-devel >= %{boost_min_version} +BuildRequires: libboost_system-devel >= %{boost_min_version} +BuildRequires: libboost_thread-devel >= %{boost_min_version} +%else #suse_version > 1320 +BuildRequires: boost-devel >= %{boost_min_version} +%endif #suse_version > 1320 +%else # vendor == suse - assuming redhat or compatible +%if (0%{?el6} || 0%{?rhel} == 6) || (0%{?el7} || 0%{?rhel} == 7) +%define boost_library boost169 +%define boost_version 1.69 +# el6: Provided by packages.icinga.com +# el7: Provided from EPEL +BuildRequires: boost169-devel >= %{boost_min_version} +%else # el6 or el7 +BuildRequires: boost-devel >= %{boost_min_version} +%endif # el6 or el7 +%endif # vendor == suse %if 0%{?use_systemd} BuildRequires: systemd-devel @@ -323,34 +322,19 @@ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \ %if 0%{?fedora} CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true" %endif -%if "%{_vendor}" == "redhat" -%if 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6" -%if 0%{?build_icinga_org} -# Boost_VERSION 1.41.0 vs 101400 - disable build tests -# details in https://dev.icinga.com/issues/5033 -CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=%{_libdir}/boost153 \ - -DBOOST_INCLUDEDIR=/usr/include/boost153 \ - -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0'" -%else -CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=%{_libdir}/boost148 \ - -DBOOST_INCLUDEDIR=/usr/include/boost148 \ - -DBoost_ADDITIONAL_VERSIONS='1.48;1.48.0'" -%endif -CMAKE_OPTS="$CMAKE_OPTS \ - -DBoost_NO_SYSTEM_PATHS=TRUE \ - -DBUILD_TESTING=FALSE \ - -DBoost_NO_BOOST_CMAKE=TRUE" -%endif -%endif -%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1310 -CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=%{_libdir}/boost153 \ - -DBOOST_INCLUDEDIR=/usr/include/boost153 \ - -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \ +%if "%{?boost_library}" != "" +# Boost_NO_BOOST_CMAKE=ON - disable search for cmake +# Boost_NO_SYSTEM_PATHS=ON - only search in specified locations +CMAKE_OPTS="$CMAKE_OPTS + -DBoost_NO_BOOST_CMAKE=TRUE \ -DBoost_NO_SYSTEM_PATHS=TRUE \ - -DBUILD_TESTING=FALSE \ - -DBoost_NO_BOOST_CMAKE=TRUE" -%endif + -DBOOST_LIBRARYDIR=%{_libdir}/%{boost_library} \ + -DBOOST_INCLUDEDIR=/usr/include/%{boost_library} \ + -DBoost_ADDITIONAL_VERSIONS='%{boost_version};%{boost_version}.0'" +# TODO: does testing work now? +# -DBUILD_TESTING=FALSE" +%endif # boost_library %if 0%{?use_systemd} CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON" From dc895d630a318f1125cf488a5e1102ec1509889a Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 12 Mar 2019 13:51:44 +0100 Subject: [PATCH 05/17] Ensure SCL devtools are enabled for build --- icinga2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index 51778d6..20c1f53 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -352,7 +352,7 @@ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_BUILD_HOST_NAME:STRING=%_buildhost" %{?scl_enable} cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" . -make %{?_smp_mflags} +%{?scl_enable} make %{?_smp_mflags} %if 0%{?use_selinux} cd tools/selinux @@ -366,7 +366,7 @@ cd - %endif %install -make install \ +%{?scl_enable} make install \ DESTDIR="%{buildroot}" # install custom limits.conf for systemd From 85f1a19a57b2cbd9cf470e33552eedd928a3a67e Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 12 Mar 2019 15:21:53 +0100 Subject: [PATCH 06/17] el6: Explicitly link against librt The linker seems to have problems without. --- icinga2.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/icinga2.spec b/icinga2.spec index 20c1f53..8021fe5 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -323,6 +323,11 @@ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true" %endif +%if (0%{?el6} || 0%{?rhel} == 6) +# Explicitly link against rt, because ld doesn't detect it automatically +CMAKE_OPTS="$CMAKE_OPTS -DCMAKE_EXE_LINKER_FLAGS=-lrt" +%endif # el6 + %if "%{?boost_library}" != "" # Boost_NO_BOOST_CMAKE=ON - disable search for cmake # Boost_NO_SYSTEM_PATHS=ON - only search in specified locations From 8967de99ff87b8627242e345a86b373ea6409a03 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 12 Mar 2019 15:44:08 +0100 Subject: [PATCH 07/17] el6: Upgrade to devtools-7 --- icinga2.spec | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index 8021fe5..2e1a0d9 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -125,11 +125,12 @@ BuildRequires: libopenssl1-devel BuildRequires: libstdc++48-devel %else %if "%{_vendor}" == "redhat" && (0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") -# Requires devtoolset-2 scl -BuildRequires: devtoolset-2-binutils -BuildRequires: devtoolset-2-gcc-c++ -BuildRequires: devtoolset-2-libstdc++-devel -%define scl_enable scl enable devtoolset-2 -- +# Requires devtoolset-7 scl +%define scl_name devtoolset-7 +%define scl_enable scl enable %{scl_name} -- +BuildRequires: %{scl_name}-binutils +BuildRequires: %{scl_name}-gcc-c++ +BuildRequires: %{scl_name}-libstdc++-devel %else BuildRequires: gcc-c++ BuildRequires: libstdc++-devel From 8fc126f97a16c9f9ec6bf8e5039cb2d7602058b1 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 12 Mar 2019 16:09:18 +0100 Subject: [PATCH 08/17] Refactor boost handling * el6: Use new boost name * Allow configuration of rpath when required --- icinga2.spec | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index 2e1a0d9..0c0f211 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -143,26 +143,34 @@ BuildRequires: flex >= 2.5.35 BuildRequires: make %if "%{_vendor}" == "suse" -%if 0%{?suse_version} > 1320 # SLES 15 and OpenSUSE + %if 0%{?suse_version} > 1320 # SLES 15 and OpenSUSE + # TODO: multiple packages + %define boost_devel_pkg %nil BuildRequires: libboost_program_options-devel >= %{boost_min_version} BuildRequires: libboost_regex-devel >= %{boost_min_version} BuildRequires: libboost_system-devel >= %{boost_min_version} BuildRequires: libboost_thread-devel >= %{boost_min_version} -%else #suse_version > 1320 -BuildRequires: boost-devel >= %{boost_min_version} -%endif #suse_version > 1320 + %endif #suse_version > 1320 %else # vendor == suse - assuming redhat or compatible -%if (0%{?el6} || 0%{?rhel} == 6) || (0%{?el7} || 0%{?rhel} == 7) -%define boost_library boost169 -%define boost_version 1.69 -# el6: Provided by packages.icinga.com -# el7: Provided from EPEL -BuildRequires: boost169-devel >= %{boost_min_version} -%else # el6 or el7 -BuildRequires: boost-devel >= %{boost_min_version} -%endif # el6 or el7 + %if (0%{?el6} || 0%{?rhel} == 6) + # Provided by packages.icinga.com + %define boost_library icinga-boost169 + %define boost_version 1.69 + %define boost_devel_pkg icinga-boost169-devel + %define boost_rpath %{_libdir}/%{boost_library} + %endif # el6 + %if (0%{?el7} || 0%{?rhel} == 7) + # Provided by EPEL + %define boost_library boost169 + %define boost_version 1.69 + %define boost_devel_pkg boost169-devel + %endif # el7 %endif # vendor == suse +%if "%{?boost_devel_pkg}" != "%nil" +BuildRequires: %{?boost_devel_pkg}%{!?boost_devel_pkg:boost-devel} >= %{boost_min_version} +%endif # boost_devel_pkg + %if 0%{?use_systemd} BuildRequires: systemd-devel Requires: systemd @@ -329,6 +337,10 @@ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true" CMAKE_OPTS="$CMAKE_OPTS -DCMAKE_EXE_LINKER_FLAGS=-lrt" %endif # el6 +%if "%{?boost_rpath}" != "" +CMAKE_OPTS="$CMAKE_OPTS -DCMAKE_INSTALL_RPATH=%{boost_rpath}" +%endif # boost_rpath + %if "%{?boost_library}" != "" # Boost_NO_BOOST_CMAKE=ON - disable search for cmake # Boost_NO_SYSTEM_PATHS=ON - only search in specified locations From 0a92bac4276fc769e99ffab9bd273d6a938f0ffb Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 12 Mar 2019 16:51:06 +0100 Subject: [PATCH 09/17] ci: Add centos/6 builds --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eaf269f..fd0d7ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,3 +61,20 @@ upload/epel/7: <<: *upload dependencies: - build/centos/7 + +build/centos/6: + <<: *build + variables: + DOCKER_IMAGE: centos/6 + +test/centos/6: + <<: *test + variables: + DOCKER_IMAGE: centos/6 + dependencies: + - build/centos/6 + +upload/epel/6: + <<: *upload + dependencies: + - build/centos/6 From 46ae4538f3ee9f9fb1705ec41e2aef952967c716 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 12 Mar 2019 19:37:12 +0100 Subject: [PATCH 10/17] ci: Cache git upstream clone --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd0d7ab..1a8b99e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,7 @@ variables: key: "${CI_JOB_NAME}" paths: - ccache/ + - '*.git' artifacts: paths: - build/* From fbcf4cc075950791cdddb59a2caf5c138a598d4e Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Wed, 13 Mar 2019 10:42:34 +0100 Subject: [PATCH 11/17] Update boost dependencies for SUSE * Use icinga-boost packages for SLES 12 and OpenSUSE 42.3 * Update provide names --- icinga2.spec | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index 0c0f211..7b230f5 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -143,15 +143,31 @@ BuildRequires: flex >= 2.5.35 BuildRequires: make %if "%{_vendor}" == "suse" - %if 0%{?suse_version} > 1320 # SLES 15 and OpenSUSE - # TODO: multiple packages + %if 0%{?suse_version} >= 1315 + # SLES 12 and OpenSUSE 42 or later %define boost_devel_pkg %nil -BuildRequires: libboost_program_options-devel >= %{boost_min_version} -BuildRequires: libboost_regex-devel >= %{boost_min_version} -BuildRequires: libboost_system-devel >= %{boost_min_version} -BuildRequires: libboost_thread-devel >= %{boost_min_version} - %endif #suse_version > 1320 + # Using the split + # Provided by packages.icinga.com or OS, when boost is newer than %%{boost_min_version} +BuildRequires: libboost_program_options-devel-impl >= %{boost_min_version} +BuildRequires: libboost_regex-devel-impl >= %{boost_min_version} +BuildRequires: libboost_system-devel-impl >= %{boost_min_version} +BuildRequires: libboost_thread-devel-impl >= %{boost_min_version} +BuildRequires: libboost_test-devel-impl >= %{boost_min_version} + %if 0%{?suse_version} < 1320 + # before SLES 15 and OpenSUSE 15 + # Provided by packages.icinga.com + %define boost_library icinga-boost + %define boost_version 1.69 + %define boost_rpath %{_libdir}/%{boost_library} + %endif # suse_version < 1320 + %else # suse_version >= 1315 + # old boost devel name + %define boost_devel_pkg boost-devel + %endif # suse_version >= 1315 %else # vendor == suse - assuming redhat or compatible + # default boost devel package + %define boost_devel_pkg boost-devel + %if (0%{?el6} || 0%{?rhel} == 6) # Provided by packages.icinga.com %define boost_library icinga-boost169 @@ -167,8 +183,8 @@ BuildRequires: libboost_thread-devel >= %{boost_min_version} %endif # el7 %endif # vendor == suse -%if "%{?boost_devel_pkg}" != "%nil" -BuildRequires: %{?boost_devel_pkg}%{!?boost_devel_pkg:boost-devel} >= %{boost_min_version} +%if "%{?boost_devel_pkg}" != "" +BuildRequires: %{boost_devel_pkg} >= %{boost_min_version} %endif # boost_devel_pkg %if 0%{?use_systemd} From e139c8ed926a685ef20b9323c05f4e06e9f817e4 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Wed, 13 Mar 2019 10:42:58 +0100 Subject: [PATCH 12/17] Add new boost packages for Boost ASIO --- icinga2.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/icinga2.spec b/icinga2.spec index 7b230f5..494e0cd 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -148,6 +148,8 @@ BuildRequires: make %define boost_devel_pkg %nil # Using the split # Provided by packages.icinga.com or OS, when boost is newer than %%{boost_min_version} +BuildRequires: libboost_context-devel-impl >= %{boost_min_version} +BuildRequires: libboost_coroutine-devel-impl >= %{boost_min_version} BuildRequires: libboost_program_options-devel-impl >= %{boost_min_version} BuildRequires: libboost_regex-devel-impl >= %{boost_min_version} BuildRequires: libboost_system-devel-impl >= %{boost_min_version} From 508b69da7ad3978e4e8f297878505472fd267bb2 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Wed, 13 Mar 2019 11:08:46 +0100 Subject: [PATCH 13/17] Add %check to run unit tests --- icinga2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index 494e0cd..033d44c 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -368,8 +368,6 @@ CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=%{_libdir}/%{boost_library} \ -DBOOST_INCLUDEDIR=/usr/include/%{boost_library} \ -DBoost_ADDITIONAL_VERSIONS='%{boost_version};%{boost_version}.0'" -# TODO: does testing work now? -# -DBUILD_TESTING=FALSE" %endif # boost_library %if 0%{?use_systemd} @@ -449,6 +447,10 @@ install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir} install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc +%check +export CTEST_OUTPUT_ON_FAILURE=1 +make test + %pre %if "%{_vendor}" == "suse" %if 0%{?use_systemd} From 1feecef162671d977581134d5d16fc5bd8e84a9f Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Wed, 13 Mar 2019 11:15:12 +0100 Subject: [PATCH 14/17] ci: Add builds for SUSE SLES and openSUSE --- .gitlab-ci.yml | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a8b99e..d689090 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,6 +46,9 @@ variables: - tags - master +################################### +# EPEL +################################### build/centos/7: <<: *build variables: @@ -79,3 +82,94 @@ upload/epel/6: <<: *upload dependencies: - build/centos/6 + +################################### +# SLES +################################### +build/sles/15.0: + <<: *build + variables: + DOCKER_IMAGE: sles/15.0 + +test/sles/15.0: + <<: *test + variables: + DOCKER_IMAGE: sles/15.0 + dependencies: + - build/sles/15.0 + +upload/SUSE/15.0: + <<: *upload + dependencies: + - build/sles/15.0 + +build/sles/12.4: + <<: *build + variables: + DOCKER_IMAGE: sles/12.4 + +test/sles/12.4: + <<: *test + variables: + DOCKER_IMAGE: sles/12.4 + dependencies: + - build/sles/12.4 + +upload/SUSE/12.4: + <<: *upload + dependencies: + - build/sles/12.4 + +build/sles/12.3: + <<: *build + variables: + DOCKER_IMAGE: sles/12.3 + +test/sles/12.3: + <<: *test + variables: + DOCKER_IMAGE: sles/12.3 + dependencies: + - build/sles/12.3 + +upload/SUSE/12.3: + <<: *upload + dependencies: + - build/sles/12.3 + +################################### +# openSUSE +################################### +build/opensuse/15.0: + <<: *build + variables: + DOCKER_IMAGE: opensuse/15.0 + +test/opensuse/15.0: + <<: *test + variables: + DOCKER_IMAGE: opensuse/15.0 + dependencies: + - build/opensuse/15.0 + +upload/openSUSE/15.0: + <<: *upload + dependencies: + - build/opensuse/15.0 + +build/opensuse/42.3: + <<: *build + variables: + DOCKER_IMAGE: opensuse/42.3 + +test/opensuse/42.3: + <<: *test + variables: + DOCKER_IMAGE: opensuse/42.3 + dependencies: + - build/opensuse/42.3 + +upload/openSUSE/42.3: + <<: *upload + dependencies: + - build/opensuse/42.3 From 8bf85c3459c9e7d8a2fa4bf872054f3a09a821f6 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Wed, 13 Mar 2019 12:25:38 +0100 Subject: [PATCH 15/17] ci: Explicitly name icinga2.git for cache --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d689090..ed3cdcf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ variables: key: "${CI_JOB_NAME}" paths: - ccache/ - - '*.git' + - 'icinga2.git' artifacts: paths: - build/* From d09a215ee3ecd6c04163eb04cb84f956403696d0 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 14 Mar 2019 10:36:24 +0100 Subject: [PATCH 16/17] Support different provides for boost on SUSE --- icinga2.spec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/icinga2.spec b/icinga2.spec index 033d44c..b9432f9 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -146,22 +146,22 @@ BuildRequires: make %if 0%{?suse_version} >= 1315 # SLES 12 and OpenSUSE 42 or later %define boost_devel_pkg %nil - # Using the split - # Provided by packages.icinga.com or OS, when boost is newer than %%{boost_min_version} -BuildRequires: libboost_context-devel-impl >= %{boost_min_version} -BuildRequires: libboost_coroutine-devel-impl >= %{boost_min_version} -BuildRequires: libboost_program_options-devel-impl >= %{boost_min_version} -BuildRequires: libboost_regex-devel-impl >= %{boost_min_version} -BuildRequires: libboost_system-devel-impl >= %{boost_min_version} -BuildRequires: libboost_thread-devel-impl >= %{boost_min_version} -BuildRequires: libboost_test-devel-impl >= %{boost_min_version} %if 0%{?suse_version} < 1320 # before SLES 15 and OpenSUSE 15 # Provided by packages.icinga.com %define boost_library icinga-boost %define boost_version 1.69 %define boost_rpath %{_libdir}/%{boost_library} + # Note: the -impl suffix comes from current packages on OBS + %define boost_devel_suffix -impl %endif # suse_version < 1320 +BuildRequires: libboost_context-devel%{?boost_devel_suffix} >= %{boost_min_version} +BuildRequires: libboost_coroutine-devel%{?boost_devel_suffix} >= %{boost_min_version} +BuildRequires: libboost_program_options-devel%{?boost_devel_suffix} >= %{boost_min_version} +BuildRequires: libboost_regex-devel%{?boost_devel_suffix} >= %{boost_min_version} +BuildRequires: libboost_system-devel%{?boost_devel_suffix} >= %{boost_min_version} +BuildRequires: libboost_thread-devel%{?boost_devel_suffix} >= %{boost_min_version} +BuildRequires: libboost_test-devel%{?boost_devel_suffix} >= %{boost_min_version} %else # suse_version >= 1315 # old boost devel name %define boost_devel_pkg boost-devel From e93eec15e13d8987c00ca7a85b04b4a0f56389cb Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 14 Mar 2019 11:26:38 +0100 Subject: [PATCH 17/17] ci: Add Fedora builds --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed3cdcf..9261a2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,6 +83,43 @@ upload/epel/6: dependencies: - build/centos/6 +################################### +# Fedora +################################### +build/fedora/29: + <<: *build + variables: + DOCKER_IMAGE: fedora/29 + +test/fedora/29: + <<: *test + variables: + DOCKER_IMAGE: fedora/29 + dependencies: + - build/fedora/29 + +upload/fedora/29: + <<: *upload + dependencies: + - build/fedora/29 + +build/fedora/28: + <<: *build + variables: + DOCKER_IMAGE: fedora/28 + +test/fedora/28: + <<: *test + variables: + DOCKER_IMAGE: fedora/28 + dependencies: + - build/fedora/28 + +upload/fedora/28: + <<: *upload + dependencies: + - build/fedora/28 + ################################### # SLES ###################################