|
@@ -0,0 +1,736 @@
+#/******************************************************************************
+# * Icinga 2 *
+# * Copyright (C) 2012-2017 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. *
+# ******************************************************************************/
+
+%define revision 1
+
+# make sure that _rundir is working on older systems
+%if ! %{defined _rundir}
+%define _rundir %{_localstatedir}/run
+%endif
+%if ! %{defined _fillupdir}
+ %define _fillupdir %{_localstatedir}/adm/fillup-templates
+%endif
+
+%define _libexecdir %{_prefix}/lib/
+%define plugindir %{_libdir}/nagios/plugins
+
+%if "%{_vendor}" == "redhat"
+%define apachename httpd
+%define apacheconfdir %{_sysconfdir}/httpd/conf.d
+%define apacheuser apache
+%define apachegroup apache
+
+%if 0%{?el5}%{?el6}%{?amzn}
+%define use_systemd 0
+%define use_selinux 0
+%if %(uname -m) != "x86_64"
+%define march_flag -march=i686
+%endif
+%else
+# fedora and el>=7
+%define use_systemd 1
+%define use_selinux 1
+%if 0%{?fedora} >= 24
+# for installing limits.conf on systemd >= 228
+%define configure_systemd_limits 1
+%else
+%define configure_systemd_limits 0
+%endif
+%endif
+%endif
+
+%if "%{_vendor}" == "suse"
+%define plugindir %{_libexecdir}/nagios/plugins
+%define apachename apache2
+%define apacheconfdir %{_sysconfdir}/apache2/conf.d
+%define apacheuser wwwrun
+%define apachegroup www
+%if 0%{?suse_version} >= 1310
+%define use_systemd 1
+%if 0%{?sle_version} >= 120200 || 0%{?suse_version} > 1320
+# for installing limits.conf on systemd >= 228
+%define configure_systemd_limits 1
+%else
+%define configure_systemd_limits 0
+%endif
+%else
+%define use_systemd 0
+%endif
+%endif
+%if 0%{?use_systemd}
+BuildRequires: systemd-devel
+Requires: systemd
+%endif
+
+%define icinga_user icinga
+%define icinga_group icinga
+%define icingacmd_group icingacmd
+
+%define logmsg logger -t %{name}/rpm
+
+Summary: Network monitoring application
+%if "%{_vendor}" == "suse"
+License: GPL-2.0-or-later
+%else
+License: GPLv2+
+%endif # suse
+Group: System/Monitoring
+Name: icinga2
+Version: 2.10.5
+Release: %{revision}%{?dist}
+Url: https://www.icinga.com/
+Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
+Patch0: https://patch-diff.githubusercontent.com/raw/Icinga/icinga2/pull/7152.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Requires: %{name}-bin = %{version}-%{release}
+Requires: %{name}-common = %{version}-%{release}
+
+Conflicts: %{name}-common < %{version}-%{release}
+
+%description
+Meta package for Icinga 2 Core, DB IDO and Web.
+
+%package bin
+Summary: Icinga 2 binaries and libraries
+Group: System/Monitoring
+
+Requires: %{name}-bin = %{version}-%{release}
+
+%if "%{_vendor}" == "suse"
+Provides: monitoring_daemon
+Recommends: monitoring-plugins
+%if 0%{?suse_version} >= 1310
+BuildRequires: libyajl-devel
+%endif
+%endif
+BuildRequires: libedit-devel
+BuildRequires: ncurses-devel
+%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210
+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")
+# 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 --
+%else
+BuildRequires: gcc-c++
+BuildRequires: libstdc++-devel
+%endif
+BuildRequires: openssl-devel
+%endif
+BuildRequires: bison
+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
+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%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 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
+Obsoletes: %{name}-libs <= 2.10.0
+Conflicts: %{name}-libs <= 2.10.0
+
+%description bin
+Icinga 2 is a general-purpose network monitoring application.
+This subpackage provides the binaries for Icinga 2 Core.
+
+%package common
+Summary: Common Icinga 2 configuration
+Group: System/Monitoring
+%if (0%{?amzn} || 0%{?fedora} || 0%{?rhel})
+Requires(pre): shadow-utils
+Requires(post): shadow-utils
+%endif
+BuildRequires: logrotate
+%if "%{_vendor}" == "suse"
+PreReq: permissions
+Provides: group(%{icinga_group})
+Provides: group(%{icingacmd_group})
+Provides: user(%{icinga_user})
+Requires(pre): shadow
+Requires(post): shadow
+# Coreutils is added because of autoyast problems reported
+Requires(pre): coreutils
+Requires(post): coreutils
+%if 0%{?suse_version} >= 1200
+BuildRequires: monitoring-plugins-common
+Requires: monitoring-plugins-common
+%else
+Recommends: monitoring-plugins-common
|