2013-10-22 13:14:25 +02:00
|
|
|
#/******************************************************************************
|
|
|
|
# * Icinga 2 *
|
2014-03-19 01:02:29 +01:00
|
|
|
# * Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org) *
|
2013-10-22 13:14:25 +02:00
|
|
|
# * *
|
|
|
|
# * 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. *
|
|
|
|
# ******************************************************************************/
|
|
|
|
|
2014-07-10 10:20:07 +02:00
|
|
|
%define revision 1
|
2013-10-08 14:45:35 +02:00
|
|
|
|
|
|
|
%if "%{_vendor}" == "redhat"
|
2013-10-07 17:34:05 +02:00
|
|
|
%define el5_boost_version 141
|
2013-10-07 19:13:27 +02:00
|
|
|
%define el5_boost_libs %{_libdir}/boost%{el5_boost_version}
|
|
|
|
%define el5_boost_includes /usr/include/boost%{el5_boost_version}
|
2013-10-14 10:25:18 +02:00
|
|
|
%define apachename httpd
|
2013-10-10 16:43:15 +02:00
|
|
|
%define apacheconfdir %{_sysconfdir}/httpd/conf.d
|
2013-10-13 19:15:52 +02:00
|
|
|
%define apacheuser apache
|
|
|
|
%define apachegroup apache
|
2014-06-15 17:17:21 +02:00
|
|
|
%if 0%{?el5}%{?el6}
|
|
|
|
%define use_systemd 0
|
|
|
|
%else
|
|
|
|
# fedora and el>=7
|
|
|
|
%define use_systemd 1
|
|
|
|
%endif
|
2013-10-08 14:45:35 +02:00
|
|
|
%endif
|
2014-06-15 17:17:21 +02:00
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
%if "%{_vendor}" == "suse"
|
2014-01-14 18:30:57 +01:00
|
|
|
# opensuse 13
|
|
|
|
%if 0%{?suse_version} >= 1310
|
|
|
|
%define opensuse_boost_version 1_53_0
|
|
|
|
%else
|
2013-10-08 14:45:35 +02:00
|
|
|
%define opensuse_boost_version 1_49_0
|
2014-01-14 18:30:57 +01:00
|
|
|
%endif
|
2013-10-09 15:04:07 +02:00
|
|
|
%define sles_boost_version 1_54_0
|
2013-10-14 10:25:18 +02:00
|
|
|
%define apachename apache2
|
2013-10-10 16:43:15 +02:00
|
|
|
%define apacheconfdir %{_sysconfdir}/apache2/conf.d
|
2013-10-13 19:15:52 +02:00
|
|
|
%define apacheuser wwwrun
|
|
|
|
%define apachegroup www
|
2014-06-15 17:17:21 +02:00
|
|
|
%define use_systemd 0
|
2013-10-08 14:45:35 +02:00
|
|
|
%endif
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2013-10-08 16:10:14 +02:00
|
|
|
%define icinga_user icinga
|
|
|
|
%define icinga_group icinga
|
|
|
|
%define icingacmd_group icingacmd
|
2014-03-10 14:11:27 +01:00
|
|
|
%define icingaweb2name icingaweb2
|
|
|
|
%define icingaweb2version 2.0.0
|
2013-10-08 16:10:14 +02:00
|
|
|
|
2013-10-10 16:43:15 +02:00
|
|
|
%define icingaclassicconfdir %{_sysconfdir}/icinga
|
|
|
|
|
2013-10-01 19:29:09 +02:00
|
|
|
%define logmsg logger -t %{name}/rpm
|
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
Summary: Network monitoring application
|
2013-11-03 13:45:26 +01:00
|
|
|
Name: icinga2
|
2014-07-10 10:20:07 +02:00
|
|
|
Version: 2.0.1
|
2013-10-01 19:29:09 +02:00
|
|
|
Release: %{revision}%{?dist}
|
|
|
|
License: GPLv2+
|
2012-05-26 23:12:46 +02:00
|
|
|
Group: Applications/System
|
2012-05-27 16:21:50 +02:00
|
|
|
Source: %{name}-%{version}.tar.gz
|
2012-05-26 14:42:03 +02:00
|
|
|
URL: http://www.icinga.org/
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
2014-03-10 14:11:27 +01:00
|
|
|
Requires: %{name}-bin = %{version}
|
|
|
|
#Requires: %{name}-ido-mysql = %{version}
|
|
|
|
#Requires: %{icingaweb2name} >= %{icingaweb2version}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Meta package for Icinga 2 Core, DB IDO and Web.
|
|
|
|
|
|
|
|
%package bin
|
|
|
|
Summary: Icinga 2 binaries and libraries
|
|
|
|
Group: Applications/System
|
|
|
|
|
2012-05-26 14:42:03 +02:00
|
|
|
BuildRequires: openssl-devel
|
|
|
|
BuildRequires: gcc-c++
|
2013-08-16 16:17:14 +02:00
|
|
|
BuildRequires: libstdc++-devel
|
2013-11-03 13:45:26 +01:00
|
|
|
BuildRequires: cmake
|
2013-12-18 12:54:49 +01:00
|
|
|
BuildRequires: flex >= 2.5.35
|
2013-08-28 18:14:13 +02:00
|
|
|
BuildRequires: bison
|
2014-05-21 09:39:23 +02:00
|
|
|
BuildRequires: make
|
2013-08-28 18:14:13 +02:00
|
|
|
|
2013-11-08 09:53:32 +01:00
|
|
|
# redhat
|
2013-10-01 19:29:09 +02:00
|
|
|
%if "%{_vendor}" == "redhat"
|
2013-10-07 17:34:05 +02:00
|
|
|
%if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5"
|
|
|
|
# el5 requires EPEL
|
2013-10-07 17:48:33 +02:00
|
|
|
BuildRequires: boost%{el5_boost_version}-devel
|
2013-10-07 18:03:48 +02:00
|
|
|
BuildRequires: boost%{el5_boost_version}
|
2013-10-07 17:48:33 +02:00
|
|
|
Requires: boost%{el5_boost_version}-program-options
|
|
|
|
Requires: boost%{el5_boost_version}-system
|
|
|
|
Requires: boost%{el5_boost_version}-test
|
|
|
|
Requires: boost%{el5_boost_version}-thread
|
2013-11-05 17:05:41 +01:00
|
|
|
Requires: boost%{el5_boost_version}-regex
|
2013-10-07 17:34:05 +02:00
|
|
|
%else
|
2013-10-01 19:29:09 +02:00
|
|
|
BuildRequires: boost-devel >= 1.41
|
2013-10-07 17:34:05 +02:00
|
|
|
Requires: boost-program-options >= 1.41
|
|
|
|
Requires: boost-system >= 1.41
|
|
|
|
Requires: boost-test >= 1.41
|
|
|
|
Requires: boost-thread >= 1.41
|
2013-11-05 17:05:41 +01:00
|
|
|
Requires: boost-regex >= 1.41
|
2013-10-07 18:03:48 +02:00
|
|
|
%endif
|
2013-10-01 19:29:09 +02:00
|
|
|
%endif
|
2013-11-08 09:53:32 +01:00
|
|
|
#redhat
|
2013-10-03 12:28:13 +02:00
|
|
|
|
2013-11-08 09:53:32 +01:00
|
|
|
# suse
|
2013-10-01 19:29:09 +02:00
|
|
|
%if "%{_vendor}" == "suse"
|
2013-11-08 09:53:32 +01:00
|
|
|
# sles
|
|
|
|
# note: sles_version macro is not set in SLES11 anymore
|
|
|
|
# note: sles service packs are not under version control
|
|
|
|
%if 0%{?suse_version} == 1110
|
|
|
|
BuildRequires: gcc-fortran
|
|
|
|
BuildRequires: libgfortran43
|
2013-10-09 16:11:31 +02:00
|
|
|
BuildRequires: boost-license%{sles_boost_version}
|
2013-10-09 15:04:07 +02:00
|
|
|
BuildRequires: boost-devel >= 1.41
|
2013-10-09 16:11:31 +02:00
|
|
|
Requires: boost-license%{sles_boost_version}
|
2013-10-09 15:04:07 +02:00
|
|
|
Requires: libboost_program_options%{sles_boost_version}
|
|
|
|
Requires: libboost_system%{sles_boost_version}
|
|
|
|
Requires: libboost_test%{sles_boost_version}
|
|
|
|
Requires: libboost_thread%{sles_boost_version}
|
2013-11-08 09:53:32 +01:00
|
|
|
Requires: libboost_regex%{sles_boost_version}
|
|
|
|
%endif
|
|
|
|
# opensuse
|
2013-11-06 17:26:14 +01:00
|
|
|
%if 0%{?suse_version} >= 1210
|
2013-10-01 19:29:09 +02:00
|
|
|
BuildRequires: boost-devel >= 1.41
|
|
|
|
Requires: libboost_program_options%{opensuse_boost_version}
|
|
|
|
Requires: libboost_system%{opensuse_boost_version}
|
|
|
|
Requires: libboost_test%{opensuse_boost_version}
|
|
|
|
Requires: libboost_thread%{opensuse_boost_version}
|
2013-11-05 17:05:41 +01:00
|
|
|
Requires: libboost_regex%{opensuse_boost_version}
|
2013-10-01 19:29:09 +02:00
|
|
|
%endif
|
2013-10-09 16:11:31 +02:00
|
|
|
%endif
|
2013-11-08 09:53:32 +01:00
|
|
|
# suse
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2014-06-15 17:17:21 +02:00
|
|
|
%if 0%{?use_systemd}
|
|
|
|
BuildRequires: systemd
|
|
|
|
Requires: systemd
|
|
|
|
%endif
|
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
Requires: %{name}-common = %{version}
|
2013-10-08 16:10:14 +02:00
|
|
|
|
2014-03-10 14:11:27 +01:00
|
|
|
%description bin
|
|
|
|
Icinga 2 is a general-purpose network monitoring application.
|
|
|
|
Provides binaries and libraries for Icinga 2 Core.
|
2012-05-26 14:42:03 +02:00
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
%package common
|
|
|
|
Summary: Common Icinga 2 configuration
|
|
|
|
Group: Applications/System
|
2013-10-08 16:10:14 +02:00
|
|
|
%if "%{_vendor}" == "redhat"
|
2013-10-08 14:45:35 +02:00
|
|
|
Requires(pre): shadow-utils
|
|
|
|
Requires(post): shadow-utils
|
2013-10-08 16:10:14 +02:00
|
|
|
%endif
|
2013-10-08 14:45:35 +02:00
|
|
|
|
|
|
|
%description common
|
|
|
|
Provides common directories, uid and gid among Icinga 2 related
|
|
|
|
packages.
|
|
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentation for Icinga 2
|
|
|
|
Group: Applications/System
|
2013-10-14 10:31:03 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2013-10-08 14:45:35 +02:00
|
|
|
|
|
|
|
%description doc
|
|
|
|
Documentation for Icinga 2
|
|
|
|
|
|
|
|
|
2013-10-01 19:29:09 +02:00
|
|
|
%package ido-mysql
|
2013-10-03 12:28:13 +02:00
|
|
|
Summary: IDO MySQL database backend for Icinga 2
|
2013-10-01 19:29:09 +02:00
|
|
|
Group: Applications/System
|
|
|
|
%if "%{_vendor}" == "suse"
|
|
|
|
BuildRequires: libmysqlclient-devel
|
2013-11-18 09:56:59 +01:00
|
|
|
%if 0%{?suse_version} >= 1210
|
2013-10-01 19:29:09 +02:00
|
|
|
Requires: libmysqlclient18
|
2013-11-18 09:56:59 +01:00
|
|
|
%else
|
|
|
|
Requires: libmysqlclient15
|
|
|
|
%endif
|
2013-10-01 19:29:09 +02:00
|
|
|
%endif
|
|
|
|
%if "%{_vendor}" == "redhat"
|
2013-10-07 17:53:53 +02:00
|
|
|
# el5 only provides mysql package
|
|
|
|
%if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5"
|
|
|
|
BuildRequires: mysql
|
|
|
|
%else
|
2013-10-03 14:27:06 +02:00
|
|
|
BuildRequires: mysql-libs
|
2013-10-03 14:32:35 +02:00
|
|
|
BuildRequires: mysql
|
2013-10-07 18:03:48 +02:00
|
|
|
%endif
|
2013-10-01 19:29:09 +02:00
|
|
|
BuildRequires: mysql-devel
|
|
|
|
Requires: mysql
|
|
|
|
%endif
|
2013-10-14 10:31:03 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2013-10-07 17:53:53 +02:00
|
|
|
%description ido-mysql
|
2013-10-01 19:29:09 +02:00
|
|
|
Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
|
|
|
|
IDOUtils schema >= 1.10
|
|
|
|
|
2013-11-05 09:54:51 +01:00
|
|
|
|
|
|
|
%package ido-pgsql
|
|
|
|
Summary: IDO PostgreSQL database backend for Icinga 2
|
|
|
|
Group: Applications/System
|
|
|
|
%if "%{_vendor}" == "suse"
|
|
|
|
BuildRequires: postgresql-libs
|
|
|
|
%endif
|
|
|
|
BuildRequires: postgresql-devel
|
|
|
|
Requires: postgresql-libs
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description ido-pgsql
|
|
|
|
Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
|
|
|
|
IDOUtils schema >= 1.10
|
|
|
|
|
|
|
|
|
2013-10-10 16:43:15 +02:00
|
|
|
%package classicui-config
|
|
|
|
Summary: Icinga 2 Classic UI Standalone configuration
|
|
|
|
Group: Applications/System
|
2014-03-10 14:11:27 +01:00
|
|
|
BuildRequires: %{apachename}
|
2013-10-14 10:25:18 +02:00
|
|
|
Requires: %{apachename}
|
2013-10-17 14:05:12 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2013-10-10 16:43:15 +02:00
|
|
|
Provides: icinga-classicui-config
|
|
|
|
Conflicts: icinga-gui-config
|
|
|
|
|
|
|
|
%description classicui-config
|
|
|
|
Icinga 1.x Classic UI Standalone configuration with locations
|
|
|
|
for Icinga 2.
|
|
|
|
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2012-05-26 14:42:03 +02:00
|
|
|
%prep
|
2012-05-27 16:21:50 +02:00
|
|
|
%setup -q -n %{name}-%{version}
|
2012-05-26 14:42:03 +02:00
|
|
|
|
|
|
|
%build
|
2013-11-03 13:45:26 +01:00
|
|
|
CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
|
2014-07-16 09:03:51 +02:00
|
|
|
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
|
2013-11-03 13:45:26 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DICINGA2_USER=%{icinga_user} \
|
|
|
|
-DICINGA2_GROUP=%{icinga_group} \
|
2014-07-16 09:03:51 +02:00
|
|
|
-DICINGA2_COMMAND_USER=%{icinga_user} \
|
|
|
|
-DICINGA2_COMMAND_GROUP=%{icingacmd_group}"
|
2013-11-03 13:45:26 +01:00
|
|
|
%if "%{_vendor}" == "redhat"
|
|
|
|
%if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5"
|
2013-12-18 12:54:49 +01:00
|
|
|
# Boost_VERSION 1.41.0 vs 101400 - disable build tests
|
|
|
|
# details in https://dev.icinga.org/issues/5033
|
2013-11-03 13:45:26 +01:00
|
|
|
CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost141 \
|
|
|
|
-DBOOST_INCLUDEDIR=/usr/include/boost141 \
|
2013-12-18 12:54:49 +01:00
|
|
|
-DBoost_ADDITIONAL_VERSIONS='1.41;1.41.0' \
|
|
|
|
-DBoost_NO_SYSTEM_PATHS=TRUE \
|
|
|
|
-DBUILD_TESTING=FALSE \
|
|
|
|
-DBoost_NO_BOOST_CMAKE=TRUE"
|
2014-05-27 09:26:38 +02:00
|
|
|
%endif
|
2013-11-03 13:45:26 +01:00
|
|
|
%endif
|
2014-06-15 17:17:21 +02:00
|
|
|
|
2014-07-16 09:03:51 +02:00
|
|
|
%if "%{_vendor}" != "suse"
|
2014-07-22 13:22:39 +02:00
|
|
|
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_libdir}/nagios/plugins"
|
2014-07-16 09:03:51 +02:00
|
|
|
%else
|
2014-07-22 13:22:39 +02:00
|
|
|
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_prefix}/lib/nagios/plugins"
|
2014-07-16 09:03:51 +02:00
|
|
|
%endif
|
|
|
|
|
2014-06-15 17:17:21 +02:00
|
|
|
%if 0%{?use_systemd}
|
|
|
|
CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
|
2013-11-03 13:45:26 +01:00
|
|
|
%endif
|
2013-12-18 12:54:49 +01:00
|
|
|
|
|
|
|
cmake $CMAKE_OPTS .
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2012-05-27 16:21:50 +02:00
|
|
|
make %{?_smp_mflags}
|
2012-05-26 14:42:03 +02:00
|
|
|
|
|
|
|
%install
|
2012-05-27 16:21:50 +02:00
|
|
|
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
|
2013-10-01 19:29:09 +02:00
|
|
|
make install \
|
2013-11-03 13:45:26 +01:00
|
|
|
DESTDIR="%{buildroot}"
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2013-10-10 16:43:15 +02:00
|
|
|
# install classicui config
|
|
|
|
install -D -m 0644 etc/icinga/icinga-classic.htpasswd %{buildroot}%{icingaclassicconfdir}/passwd
|
|
|
|
install -D -m 0644 etc/icinga/cgi.cfg %{buildroot}%{icingaclassicconfdir}/cgi.cfg
|
|
|
|
install -D -m 0644 etc/icinga/icinga-classic-apache.conf %{buildroot}%{apacheconfdir}/icinga.conf
|
|
|
|
|
2013-12-05 13:15:44 +01:00
|
|
|
# remove features-enabled symlinks
|
|
|
|
rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf
|
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
%clean
|
|
|
|
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
%pre common
|
2013-10-08 16:10:14 +02:00
|
|
|
getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
|
|
|
|
getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
|
|
|
|
getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /sbin/nologin -r -d %{_localstatedir}/spool/%{name} -G %{icingacmd_group} -g %{icinga_group} %{icinga_user}
|
2013-10-08 14:45:35 +02:00
|
|
|
exit 0
|
2012-05-26 14:42:03 +02:00
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
# all restart/feature actions belong to icinga2-bin
|
|
|
|
%post bin
|
2013-12-05 13:15:44 +01:00
|
|
|
# suse
|
2013-11-27 14:10:46 +01:00
|
|
|
%if 0%{?suse_version}
|
2014-06-10 13:46:45 +02:00
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
%fillup_and_insserv %{name}
|
2013-12-05 13:15:44 +01:00
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
# initial installation, enable default features
|
|
|
|
%{_sbindir}/icinga2-enable-feature checker notification mainlog
|
2013-12-05 13:15:44 +01:00
|
|
|
|
|
|
|
exit 0
|
2014-06-11 15:52:41 +02:00
|
|
|
|
2013-11-27 14:10:46 +01:00
|
|
|
%else
|
2014-06-10 13:46:45 +02:00
|
|
|
# rhel
|
2013-11-27 14:10:46 +01:00
|
|
|
|
2014-06-15 17:17:21 +02:00
|
|
|
%if 0%{?use_systemd}
|
2014-05-27 09:26:38 +02:00
|
|
|
%systemd_post %{name}.service
|
2014-06-15 17:17:21 +02:00
|
|
|
%else
|
|
|
|
/sbin/chkconfig --add %{name}
|
2014-05-27 09:26:38 +02:00
|
|
|
%endif
|
2013-12-05 13:15:44 +01:00
|
|
|
|
|
|
|
if [ ${1:-0} -eq 1 ]
|
|
|
|
then
|
|
|
|
# initial installation, enable default features
|
2014-05-27 07:27:12 +02:00
|
|
|
%{_sbindir}/icinga2-enable-feature checker notification mainlog
|
2013-12-05 13:15:44 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
2014-06-10 13:46:45 +02:00
|
|
|
%endif
|
|
|
|
# suse/rhel
|
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
%postun bin
|
2014-06-10 13:46:45 +02:00
|
|
|
# suse
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
%restart_on_update %{name}
|
2014-06-10 13:46:45 +02:00
|
|
|
%insserv_cleanup
|
|
|
|
|
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
# deinstallation of the package - remove enabled features
|
|
|
|
rm -rf %{_sysconfdir}/%{name}/features-enabled
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%else
|
|
|
|
# rhel
|
|
|
|
|
2014-06-15 17:17:21 +02:00
|
|
|
%if 0%{?use_systemd}
|
|
|
|
%systemd_postun_with_restart %{name}.service
|
|
|
|
%else
|
2013-11-27 14:10:46 +01:00
|
|
|
if [ "$1" -ge "1" ]; then
|
2014-06-11 15:52:41 +02:00
|
|
|
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
|
2013-11-27 14:10:46 +01:00
|
|
|
fi
|
2014-05-27 09:26:38 +02:00
|
|
|
%endif
|
2013-12-05 13:15:44 +01:00
|
|
|
|
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
# deinstallation of the package - remove enabled features
|
|
|
|
rm -rf %{_sysconfdir}/%{name}/features-enabled
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|
2014-06-10 13:46:45 +02:00
|
|
|
%endif
|
|
|
|
# suse / rhel
|
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
%preun bin
|
2014-06-10 13:46:45 +02:00
|
|
|
# suse
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
%stop_on_removal %{name}
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|
2014-06-10 13:46:45 +02:00
|
|
|
|
|
|
|
%else
|
|
|
|
# rhel
|
|
|
|
|
2014-06-15 17:17:21 +02:00
|
|
|
%if 0%{?use_systemd}
|
|
|
|
%systemd_preun %{name}.service
|
|
|
|
%else
|
2013-11-27 14:10:46 +01:00
|
|
|
if [ "$1" = "0" ]; then
|
2014-06-11 15:52:41 +02:00
|
|
|
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
|
|
|
/sbin/chkconfig --del %{name} || :
|
2013-11-27 14:10:46 +01:00
|
|
|
fi
|
2014-05-27 09:26:38 +02:00
|
|
|
%endif
|
2013-11-27 14:10:46 +01:00
|
|
|
|
2014-06-11 15:52:41 +02:00
|
|
|
exit 0
|
|
|
|
|
2013-11-27 14:10:46 +01:00
|
|
|
%endif
|
2014-06-10 13:46:45 +02:00
|
|
|
# suse / rhel
|
2013-11-27 14:10:46 +01:00
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
%post ido-mysql
|
2013-10-08 16:10:14 +02:00
|
|
|
if [ ${1:-0} -eq 1 ]
|
|
|
|
then
|
|
|
|
# initial installation, enable ido-mysql feature
|
2013-10-18 22:11:40 +02:00
|
|
|
%{_sbindir}/icinga2-enable-feature ido-mysql
|
2013-10-08 16:10:14 +02:00
|
|
|
fi
|
2013-10-08 14:45:35 +02:00
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
exit 0
|
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
%postun ido-mysql
|
2013-10-08 16:10:14 +02:00
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
# deinstallation of the package - remove feature
|
2013-10-18 22:11:40 +02:00
|
|
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-mysql
|
2013-10-08 16:10:14 +02:00
|
|
|
fi
|
2013-08-16 16:34:24 +02:00
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
exit 0
|
|
|
|
|
2013-11-05 09:54:51 +01:00
|
|
|
%post ido-pgsql
|
|
|
|
if [ ${1:-0} -eq 1 ]
|
|
|
|
then
|
|
|
|
# initial installation, enable ido-pgsql feature
|
|
|
|
%{_sbindir}/icinga2-enable-feature ido-pgsql
|
|
|
|
fi
|
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
exit 0
|
|
|
|
|
2013-11-05 09:54:51 +01:00
|
|
|
%postun ido-pgsql
|
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
# deinstallation of the package - remove feature
|
|
|
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-pgsql
|
|
|
|
fi
|
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
exit 0
|
|
|
|
|
2013-10-17 14:05:12 +02:00
|
|
|
%post classicui-config
|
|
|
|
if [ ${1:-0} -eq 1 ]
|
|
|
|
then
|
|
|
|
# initial installation, enable features
|
2014-05-27 07:27:12 +02:00
|
|
|
%{_sbindir}/icinga2-enable-feature statusdata compatlog command
|
2013-10-17 14:05:12 +02:00
|
|
|
fi
|
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
exit 0
|
|
|
|
|
2013-10-17 14:05:12 +02:00
|
|
|
%postun classicui-config
|
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
# deinstallation of the package - remove feature
|
2013-10-18 22:11:40 +02:00
|
|
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature statusdata
|
|
|
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature compatlog
|
|
|
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature command
|
2013-10-17 14:05:12 +02:00
|
|
|
fi
|
2012-05-26 14:42:03 +02:00
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
exit 0
|
|
|
|
|
2014-03-11 08:52:24 +01:00
|
|
|
%files
|
|
|
|
|
2014-03-11 08:26:24 +01:00
|
|
|
%files bin
|
2013-10-13 19:15:52 +02:00
|
|
|
%defattr(-,root,root,-)
|
2013-10-18 22:53:54 +02:00
|
|
|
%doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog
|
2014-06-15 17:17:21 +02:00
|
|
|
%if 0%{?use_systemd}
|
2014-06-15 20:08:05 +02:00
|
|
|
%attr(644,-,0) %{_unitdir}/%{name}.service
|
2014-06-15 17:17:21 +02:00
|
|
|
%else
|
|
|
|
%attr(755,-,-) %{_sysconfdir}/init.d/%{name}
|
2014-05-27 10:02:22 +02:00
|
|
|
%endif
|
2013-11-25 17:35:44 +01:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}
|
2013-10-08 16:10:14 +02:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
|
2014-04-13 18:54:17 +02:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d/hosts
|
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d/hosts/localhost
|
2013-10-08 16:10:14 +02:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
|
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-enabled
|
2013-11-27 09:45:04 +01:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts
|
2014-05-13 13:49:00 +02:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
|
2013-10-15 22:39:00 +02:00
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
|
2014-03-31 18:17:40 +02:00
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
|
2014-05-22 21:00:42 +02:00
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
|
2013-10-15 22:39:00 +02:00
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
|
2014-04-13 18:54:17 +02:00
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/*.conf
|
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/localhost/*.conf
|
2013-10-15 22:39:00 +02:00
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
|
2014-05-13 14:18:00 +02:00
|
|
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
|
2013-11-27 09:45:04 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/%{name}/scripts/*
|
2014-06-15 19:47:27 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
2013-10-21 11:25:16 +02:00
|
|
|
%{_sbindir}/%{name}
|
|
|
|
%{_bindir}/%{name}-build-ca
|
|
|
|
%{_bindir}/%{name}-build-key
|
2014-04-12 12:08:22 +02:00
|
|
|
%{_bindir}/%{name}-sign-key
|
2013-10-21 11:25:16 +02:00
|
|
|
%{_sbindir}/%{name}-enable-feature
|
|
|
|
%{_sbindir}/%{name}-disable-feature
|
2014-06-15 17:17:21 +02:00
|
|
|
%{_sbindir}/%{name}-prepare-dirs
|
2013-10-01 19:29:09 +02:00
|
|
|
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
|
2013-11-25 17:35:44 +01:00
|
|
|
%exclude %{_libdir}/%{name}/libdb_ido_pgsql*
|
2013-05-04 17:49:28 +02:00
|
|
|
%{_libdir}/%{name}
|
|
|
|
%{_datadir}/%{name}
|
2014-05-10 18:23:08 +02:00
|
|
|
%exclude %{_datadir}/%{name}/include
|
2013-05-04 17:49:28 +02:00
|
|
|
%{_mandir}/man8/%{name}.8.gz
|
2014-06-13 21:38:59 +02:00
|
|
|
%{_mandir}/man8/%{name}-enable-feature.8.gz
|
|
|
|
%{_mandir}/man8/%{name}-disable-feature.8.gz
|
|
|
|
%{_mandir}/man8/%{name}-build-ca.8.gz
|
|
|
|
%{_mandir}/man8/%{name}-build-key.8.gz
|
|
|
|
%{_mandir}/man8/%{name}-sign-key.8.gz
|
2014-06-15 20:23:03 +02:00
|
|
|
%{_mandir}/man8/%{name}-prepare-dirs.8.gz
|
2013-05-04 17:49:28 +02:00
|
|
|
|
2013-10-13 18:53:57 +02:00
|
|
|
%attr(0755,%{icinga_user},%{icinga_group}) %{_localstatedir}/cache/%{name}
|
|
|
|
%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}
|
|
|
|
%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/compat
|
2013-10-11 06:09:47 +02:00
|
|
|
%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
|
2013-11-25 17:35:44 +01:00
|
|
|
%attr(0755,%{icinga_user},%{icinga_group}) %ghost %{_localstatedir}/run/%{name}
|
2013-10-10 11:22:45 +02:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}
|
2013-08-16 16:58:31 +02:00
|
|
|
|
2013-11-25 17:35:44 +01:00
|
|
|
%attr(2755,%{icinga_user},%{icingacmd_group}) %ghost %{_localstatedir}/run/icinga2/cmd
|
2013-10-01 19:29:09 +02:00
|
|
|
|
2013-10-08 14:45:35 +02:00
|
|
|
%files common
|
2013-10-13 19:15:52 +02:00
|
|
|
%defattr(-,root,root,-)
|
2014-05-31 23:38:45 +02:00
|
|
|
%doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog tools/syntax
|
2014-06-13 09:47:26 +02:00
|
|
|
%config(noreplace) %attr(755,-,-) %{_sysconfdir}/logrotate.d/%{name}
|
2013-10-08 16:10:14 +02:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
|
2013-11-17 20:01:23 +01:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
|
2013-11-21 07:17:34 +01:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp
|
2014-05-10 18:23:08 +02:00
|
|
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include
|
|
|
|
%{_datadir}/%{name}/include
|
2013-10-08 14:45:35 +02:00
|
|
|
|
|
|
|
%files doc
|
2013-10-13 19:15:52 +02:00
|
|
|
%defattr(-,root,root,-)
|
2013-10-11 11:20:33 +02:00
|
|
|
%{_datadir}/doc/%{name}
|
|
|
|
%docdir %{_datadir}/doc/%{name}
|
2013-10-08 14:45:35 +02:00
|
|
|
|
2013-10-01 19:29:09 +02:00
|
|
|
%files ido-mysql
|
2013-10-13 19:15:52 +02:00
|
|
|
%defattr(-,root,root,-)
|
2013-10-18 22:53:54 +02:00
|
|
|
%doc components/db_ido_mysql/schema COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog
|
2013-10-01 19:29:09 +02:00
|
|
|
%{_libdir}/%{name}/libdb_ido_mysql*
|
2013-05-04 17:49:28 +02:00
|
|
|
|
2013-11-05 09:54:51 +01:00
|
|
|
%files ido-pgsql
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc components/db_ido_pgsql/schema COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog
|
|
|
|
%{_libdir}/%{name}/libdb_ido_pgsql*
|
|
|
|
|
2013-10-10 16:43:15 +02:00
|
|
|
%files classicui-config
|
2013-10-13 19:15:52 +02:00
|
|
|
%defattr(-,root,root,-)
|
2013-11-26 14:21:40 +01:00
|
|
|
%attr(0751,%{icinga_user},%{icinga_group}) %dir %{icingaclassicconfdir}
|
2013-10-10 16:43:15 +02:00
|
|
|
%config(noreplace) %{icingaclassicconfdir}/cgi.cfg
|
|
|
|
%config(noreplace) %{apacheconfdir}/icinga.conf
|
2013-10-14 00:24:13 +02:00
|
|
|
%config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd
|
2013-10-10 16:43:15 +02:00
|
|
|
|
2013-05-04 17:49:28 +02:00
|
|
|
|
|
|
|
%changelog
|