File icinga.spec of Package icinga.9111

#
# spec file for package icinga
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%if 0%{?suse_version} >= 1230
%define using_systemd 1
%else
%define using_sysvinit 1
%endif

Name:           icinga
Version:        1.13.3
Release:        0

Summary:        Host/service/network monitoring program
License:        GPL-2.0
Group:          System/Monitoring
Url:            http://www.icinga.org/
Source0:        http://github.com/Icinga/icinga-core/releases/download/v%{version}/%{name}-%{version}.tar.gz

Source1:        rc%{name}
Source2:        rcido2db
Source3:        %{name}.sysconfig
Source4:        suse.de-%{name}
Source5:        icinga-rpmlintrc
Source6:        icinga.8
Source7:        icingastats.8
Source8:        ido2db.8
Source9:        mini_epn_icinga.8
Source10:       README.SUSE
Source11:       README.SUSE.idoutils
Source12:       update_icinga_paths.sh
Source14:       new_mini_epn.8
Source15:       mini_epn.8
Source16:       log2ido.8
Source17:       icinga-favicon.ico
Source18:       icinga-exec-start-pre
Source19:       ido2db-exec-start-pre
# PATCH-FIX-OPENSUSE icinga-workaround-131-apache-conf-issue.patch
Patch0:         icinga-workaround-131-apache-conf-issue.patch
# PATCH-FIX-OPENSUSE icinga-fix-systemd-services.patch
Patch1:         icinga-fix-systemd-services.patch
# PATCH-FIX-UPSTREAM icinga-1.11.7-fix-bashisms.patch ledest@gmail.com
Patch2:         icinga-1.11.7-fix-bashisms.patch
# PATCH-FIX-UPSTREAM CVE-2015-8010: icinga: XSS in Icinga Classic-UI
Patch3:         icinga-CVE-2015-8010.patch
Provides:       monitoring_daemon
BuildRequires:  apache2-devel
BuildRequires:  nagios-rpm-macros >= 0.10
%if 0%{?suse_version} >= 1110
BuildRequires:  fdupes
%endif
%if 0%{?suse_version} > 1310
BuildRequires:  util-linux-systemd
%endif
BuildRequires:  freetype2-devel
BuildRequires:  gd-devel > 1.8
BuildRequires:  iputils
BuildRequires:  krb5-devel
BuildRequires:  libdbi-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libopenssl-devel
BuildRequires:  libpng-devel
BuildRequires:  mailx
BuildRequires:  net-snmp-devel
BuildRequires:  net-tools
BuildRequires:  openssl
BuildRequires:  pcre-devel
BuildRequires:  zlib-devel
%if 0%{?using_systemd}
BuildRequires:  systemd
Source100:      icinga_sysvinit_compat
%endif
Requires:       net-tools
Requires(pre):  %fillup_prereq
Requires(pre):  %insserv_prereq
Requires(pre):  /bin/logger
Requires(pre):  fileutils
Requires(pre):  gawk
Requires(pre):  grep
Requires(pre):  pwdutils
Requires(pre):  sed
%if 0%{?suse_version} < 1140
Requires:       perl = %{perl_version}
%else
%{perl_requires}
%endif
%{?libperl_requires}
%if 0%{?using_systemd}
%{?systemd_requires}
%endif
Requires:       mailx
Recommends:     monitoring-tools
Recommends:     %{name}-plugins-eventhandlers
Recommends:     %{name}-www
Recommends:     cron
Recommends:     logrotate
Recommends:     nagios-plugins
Recommends:     net-snmp
Recommends:     openssl
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define         apacheconfdir  %{_sysconfdir}/apache2/conf.d
%define         apachegroup    www
# Macro that print mesages to syslog at package (un)install time
%define         logmsg logger -t %{name}/rpm

%description
Icinga is a program that will monitor hosts and services on your
network. It has the ability to email or page you when a problem arises
and when a problem is resolved. Icinga is written in C and is
designed to run under Linux (and some other *NIX variants) as a
background process, intermittently running checks on various services
that you specify.

The actual service checks are performed by separate "plugin" programs
which return the status of the checks to Icinga. The plugins are
available at http://sourceforge.net/projects/icingaplug

This package provide core programs for icinga. The web interface,
documentation, and development files are built as separate packages

%package www
Summary:        Provides the HTML and CGI files for the Icinga web interface
Group:          System/Monitoring
Provides:       %{name}-classicui
Provides:       monitoring_webfrontend
Requires:       %{name}-classicui-config = %{version}
Requires:       %{name}-doc = %{version}
Requires(pre):  apache2

%description www
Icinga is a program that will monitor hosts and services on your
network. It has the ability to email or page you when a problem arises
and when a problem is resolved. Icinga is written in C and is
designed to run under Linux (and some other *NIX variants) as a
background process, intermittently running checks on various services
that you specify.

Several CGI programs are included with Icinga in order to allow you
to view the current service status, problem history, notification
history, and log file via the web. This package provides the HTML and
CGI files for the Icinga web interface. In addition, HTML
documentation is included in this package

%package www-config
Summary:        Classic UI configuration for %{name}
Group:          System/Monitoring
Provides:       %{name}-classicui-config
Conflicts:      icinga2-classicui-config
Requires(pre):  apache2

%description www-config
This packages contains the classic ui configuration for %{name}.

%package devel
Summary:        Provides include files that Icinga-related applications may compile against
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
Icinga is a program that will monitor hosts and services on your
network. It has the ability to email or page you when a problem arises
and when a problem is resolved. Icinga is written in C and is
designed to run under Linux (and some other *NIX variants) as a
background process, intermittently running checks on various services
that you specify.

This package provides include files that Icinga-related applications
may compile against.

%package -n monitoring-tools
Summary:        Provides mini_epn for Icinga and Nagios
Group:          System/Monitoring
Requires:       monitoring_daemon
Provides:       icinga-monitoring-tools = %{version}-%{release}
Obsoletes:      icinga-monitoring-tools < %{version}-%{release}
%if 0%{?suse_version} < 1140
Requires:       perl = %{perl_version}
%else
%{perl_requires}
%endif

%description -n monitoring-tools
This package provides the programs mini_epn and new_mini_epn
for Icinga and Nagios.

%package idoutils
Summary:        Provides the IDOUtils functionality for Icinga
Group:          System/Monitoring
Requires:       %{name}-idoutils-drivers-dbd >= %{version}
Requires(pre):  %{name} = %{version}

%description idoutils
Icinga is a program that will monitor hosts and services on your
network. It has the ability to email or page you when a problem arises
and when a problem is resolved. Icinga is written in C and is
designed to run under Linux (and some other *NIX variants) as a
background process, intermittently running checks on various services
that you specify.

This package provides the IDOUtils extensions for Icinga

%package idoutils-mysql
Summary:        IDOUtils drivers for MySQL
Group:          System/Monitoring
Requires:       %{name}-idoutils = %{version}
Requires:       libdbi-drivers-dbd-mysql
Requires:       perl(DBD::mysql)
Recommends:     mysql
Recommends:     mysql-client
Provides:       %{name}-idoutils-drivers-dbd = %{version}
Conflicts:      idoutils-oracle
Conflicts:      idoutils-pgsql

%description idoutils-mysql
This package requires all needed packages for using IDOUtils with MySQL.

%package idoutils-oracle
Summary:        IDOUtils drivers for Oracle
Group:          System/Monitoring
Requires:       %{name}-idoutils = %{version}
Recommends:     oracle-client
Provides:       %{name}-idoutils-drivers-dbd = %{version}
Conflicts:      idoutils-pgsql
Conflicts:      idoutils-mysql

%description idoutils-oracle
This package requires all needed packages for using IDOUtils with OracleDB.

%package idoutils-pgsql
Summary:        IDOUtils drivers for PostgreSQL
Group:          System/Monitoring
Requires:       %{name}-idoutils = %{version}
Requires:       libdbi-drivers-dbd-pgsql
Recommends:     postgresql
Recommends:     postgresql-libs
Provides:       %{name}-idoutils-drivers-dbd = %{version}
Conflicts:      idoutils-mysql
Conflicts:      idoutils-oracle

%description idoutils-pgsql
This package requires all needed packages for using IDOUtils with PostgreSQL.

%package doc
Summary:        Online documentation for %{name}
Group:          System/Monitoring
Recommends:     %{name}-web = %{version}

%description doc
This package provides the online documentation for %{name}.

%package plugins-eventhandlers
Summary:        Eventhandlers for %{name}
Group:          System/Monitoring
Recommends:     %{name} = %{version}

%description plugins-eventhandlers
Eventhandlers for %{name}. Providing different scripts for distributed
monitoring, redundancy and disabling and enabling service checks and
notifications.

%package plugins-downtimes
Summary:        Recurring Downtimes Management for %{name}
Group:          System/Monitoring
Requires:       %{name} = %{version}
Requires:       perl-Date-Calc

%description plugins-downtimes
Provides scripts to manage recurring downtimes for %{name}.
http://docs.icinga.org/latest/en/recurring_downtimes.html

%prep
%setup -q
%if 0%{?suse_version} == 1310
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
export PATH_TO_TRACEROUTE="%{_sbindir}/traceroute"
%configure \
    --prefix="%{icinga_datadir}" \
    --exec-prefix="%{_sbindir}" \
    --bindir="%{_sbindir}" \
    --datadir="%{icinga_datadir}" \
    --datarootdir="%{icinga_datadir}" \
    --libexecdir="%{icinga_plugindir}" \
    --localstatedir="%{icinga_localstatedir}"  \
    --libdir="%{icinga_libdir}" \
    --sbindir="%{icinga_cgidir}" \
    --sysconfdir="%{icinga_sysconfdir}" \
    --with-command-user="%{icinga_command_user}" \
    --with-command-group="%{icinga_command_group}" \
    --with-gd-lib="%{_libdir}" \
    --with-gd-inc="%{_includedir}" \
    --with-htmurl="/%{name}" \
    --with-cgiurl="/%{name}/cgi-bin" \
    --with-mainurl="/%{name}/cgi-bin/status.cgi?allunhandledproblems" \
    --with-init-dir="%{_initrddir}" \
    --with-lockfile="%{icinga_lockfile}" \
    --with-icinga-user="%{icinga_user}" \
    --with-icinga-group="%{icinga_group}" \
    --with-httpd-conf="%{apacheconfdir}" \
    --with-log-dir="%{icinga_logdir}" \
    --with-perlcache \
    --enable-cgi-log \
    --enable-event-broker \
    --enable-embedded-perl \
    --enable-idoutils \
    --enable-ssl \
    --with-cgi-log-dir="%{icinga_cgi_logdir}" \
    --with-plugin-dir="%{icinga_plugindir}" \
    --with-eventhandler-dir="%{icinga_eventhandlerdir}" \
    --with-p1-file-dir="%{icinga_datadir}" \
    --with-checkresult-dir="%{icinga_checkresultdir}" \
    --with-ext-cmd-file-dir="%{icinga_cmd_filedir}" \
    --with-http-auth-file="%{icinga_http_authfile}" \
    --with-icinga-chkfile="%{icinga_chkfile}" \
    --with-ido2db-lockfile="%{icinga_ido2db_lockfile}" \
    --with-ido-sockfile="%{icinga_ido2db_socketfile}" \
    --with-idomod-tmpfile="%{icinga_idomod_tmpfile}" \
    --with-state-dir="%{icinga_spooldir}" \
    --with-temp-file="%{icinga_tempfile}" \
    --with-temp-dir="%{icinga_tempdir}"

make %{?_smp_mflags} all

# make daemonchk.cgi and event handlers
pushd contrib 1>/dev/null
for f in `find . -type f` ; do
    sed -i "s=/usr/local/icinga/var/status.dat=%{icinga_spooldir}/status.dat=; \
        s=/usr/local/icinga/var/icinga.lock=%{icinga_ido2db_lockfile}=; \
        s=NscaBin\=\"/usr/local/icinga/libexec/send_nsca\"=NscaBin\=/usr/bin/send_nsca=; \
        s=/usr/local/icinga/libexec/eventhandlers/=%{icinga_eventhandlerdir}/=; \
        s=/usr/local/nagios/libexec/eventhandlers/=%{icinga_eventhandlerdir}/=; \
        s=\$icinga/etc/=%{icinga_sysconfdir}/=; \
        s=/usr/local/icinga/etc/=%{icinga_sysconfdir}/=" ${f}
done
popd 1>/dev/null
make %{?_smp_mflags} -C contrib

%install
make \
    install-unstripped \
%if 0%{?using_systemd}
    install-systemd \
%else
    install-init \
%endif
    install-commandmode \
    install-idoutils \
    install-config \
    install-webconf \
    install-eventhandlers \
    install-downtimes \
    DESTDIR=%{buildroot} \
    INSTALL_OPTS="" \
    INSTALL_OPTS_WEB="" \
    COMMAND_OPTS="" \
    INIT_OPTS=""

make install -C contrib \
    DESTDIR=%{buildroot} \
    INSTALL_OPTS=""

# make SUSE readmes available
cp %{SOURCE10} ./
cp %{SOURCE11} ./

# replace placeholders in the update_icinga_paths.sh script
sed -i "s=%%{logmsg}=%{logmsg}=; \
        s=%%{icinga_lockfile}=%{icinga_lockfile}=; \
        s=%%{icinga_sysconfdir}=%{icinga_sysconfdir}=; \
        s=%%{icinga_eventhandlerdir}=%{icinga_eventhandlerdir}=; \
        s=%%{icinga_spooldir}=%{icinga_spooldir}=; \
        s=%%{icinga_ido2db_lockfile}=%{icinga_ido2db_lockfile}=; \
        s=%%{icinga_ido2db_socketfile}=%{icinga_ido2db_socketfile}=; \
        s=%%{icinga_cmdfile}=%{icinga_cmdfile}=" %{SOURCE12}
# make update_icinga_paths.sh script available
chmod +x %{SOURCE12}
mkdir -p ./examples
cp %{SOURCE12} ./examples

# make unsupported mysql db creation script available
pushd module/idoutils/db 1>/dev/null
mkdir -p examples
cp scripts/create_mysqldb.sh examples/
popd 1>/dev/null

# move idoutils sample configs to final name
mv "%{buildroot}%{icinga_sysconfdir}/ido2db.cfg-sample" "%{buildroot}%{icinga_sysconfdir}/ido2db.cfg"
mv "%{buildroot}%{icinga_sysconfdir}/idomod.cfg-sample" "%{buildroot}%{icinga_sysconfdir}/idomod.cfg"
mv "%{buildroot}%{icinga_sysconfdir}/modules/idoutils.cfg-sample" "%{buildroot}%{icinga_sysconfdir}/modules/idoutils.cfg"

# fix resource.cfg eventhandler path - otherwise it creates problem with the update_config_files script
sed -i "s|/usr/lib/nagios/plugins/eventhandlers|%{icinga_eventhandlerdir}|g" "%{buildroot}%{icinga_sysconfdir}/resource.cfg"

# remove unnecessary files from www log directory
rm "%{buildroot}/%{icinga_cgi_logdir}/"{.htaccess,index.htm}

# remove setuid from %%{icinga_cmd_filedir}
chmod -s "%{buildroot}%{icinga_cmd_filedir}"

# install logrotate rule
install -D -m 0644 icinga.logrotate %{buildroot}%{icinga_logrotatefile}

# install sample htpasswd file
install -D -m 0644 icinga.htpasswd %{buildroot}%{icinga_http_authfile}

# create icinga localstatedir
install -d -m 0755 %{buildroot}%{icinga_localstatedir}

# install eventhandlers
cp -r contrib/eventhandlers/* "%{buildroot}%{icinga_eventhandlerdir}"

# install downtimes (move to previous location)
mv "%{buildroot}%{icinga_plugindir}/downtimes" "%{buildroot}%{icinga_libdir}/"
rm -rf "%{buildroot}/var/lib/nagios"

# install headers for development package
install -d -m0755 "%{buildroot}%{_includedir}/%{name}/"
install -m0644 include/{config,snprintf,cgiutils,locations}.h "%{buildroot}%{_includedir}/%{name}"

# REST of special SUSE stuff here, if needed....
# init-scripts
# remove the default init script as SUSE uses an adapted one
%if 0%{?using_systemd}
install -D -m0755 %{SOURCE100} %{buildroot}%{_sbindir}/rc%{name}
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rcido2db
install -D -m0755 %{SOURCE18} "%{buildroot}%{icinga_libdir}/icinga-exec-start-pre"
install -D -m0755 %{SOURCE19} "%{buildroot}%{icinga_libdir}/ido2db-exec-start-pre"
# remove systemd sysconfig file because we use our own
rm "%{buildroot}%{_sysconfdir}/sysconfig/%{name}"
%else
ln -sf ../../%{_initrddir}/%{name} "%{buildroot}%{_sbindir}/rc%{name}"
ln -sf ../../%{_initrddir}/ido2db "%{buildroot}%{_sbindir}/rcido2db"
install -D -m0755 %{SOURCE1} "%{buildroot}%{_initrddir}/%{name}"
install -D -m0755 %{SOURCE2} "%{buildroot}%{_initrddir}/ido2db"
%endif
# sysconfig script
install -D -m 0644 %{SOURCE3} "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"
# install cronjob (gzip' the logfiles)
install -D -m 0640 %{SOURCE4} "%{buildroot}%{_sysconfdir}/cron.weekly/%{name}"
%if 0%{?suse_version} >= 1110
  %fdupes -s %{buildroot}
%endif

# fix documentation
rm "sample-config/"*.in
rm "sample-config/modules/"*.in
rm "sample-config/template-object/"*.in
rm "module/idoutils/config/"*.in

# install manpages from Debian
install -d -m0755 "%{buildroot}%{_mandir}/man8/"
install -m644 %{SOURCE6}  "%{buildroot}%{_mandir}/man8/"
install -m644 %{SOURCE7}  "%{buildroot}%{_mandir}/man8/"
install -m644 %{SOURCE8}  "%{buildroot}%{_mandir}/man8/"
install -m644 %{SOURCE9}  "%{buildroot}%{_mandir}/man8/"
install -m644 %{SOURCE14} "%{buildroot}%{_mandir}/man8/"
install -m644 %{SOURCE15} "%{buildroot}%{_mandir}/man8/"
install -m644 %{SOURCE16} "%{buildroot}%{_mandir}/man8/"

# install favicon.ico
install -m644 %{SOURCE17} "%{buildroot}/%{icinga_datadir}/favicon.ico"

%pre
%if 0%{?using_systemd}
%service_add_pre %{name}.service
%endif
# add icinga user and groups
groupadd -r %{icinga_group} 2>/dev/null || :
groupadd -r %{icinga_command_group} 2>/dev/null || :
/usr/sbin/useradd -c %{icinga_user} -s /sbin/nologin -r -d %{icinga_localstatedir} -G %{icinga_command_group} -g %{icinga_group} %{icinga_user} 2> /dev/null || :

%post
if [ ${1:-0} -gt 1 ]
then
# On Update
    %{_defaultdocdir}/%{name}/examples/update_icinga_paths.sh %{name}
else
# On installation
  # First installation: create an alias for the default nagiosadmin user
  if [ -r etc/aliases ]; then
    if ! grep -q "^%{name}:" etc/aliases; then
        echo "%{name}:	root" >> etc/aliases
        %{logmsg} "Added alias for user %{name} to /etc/aliases"
        if [ -x usr/bin/newaliases ]; then
            usr/bin/newaliases >/dev/null 2>&1 || true
        else
            %{logmsg} "Cannot execute newaliases. Please run it manually."
        fi
    fi
  fi
fi

%if 0%{?using_systemd}
%service_add_post %{name}.service
%fillup_only
%else
%{fillup_and_insserv %{name}}
%endif

%preun
%if 0%{?using_systemd}
%service_del_preun %{name}.service
%else
%stop_on_removal %{name}
%endif

%postun
%if 0%{?using_systemd}
%service_del_postun %{name}.service
%else
%restart_on_update %{name}
%{insserv_cleanup}
%endif

%post www
# If apache is installed, and we can find the apache user, set a shell var
if [ -f etc/apache2/uid.conf ]; then
    wwwusr=$(awk '/^[ \t]*User[ \t]+[a-zA-Z0-9]+/ {print $2}' etc/apache2/uid.conf)
else
    wwwusr=$(awk '/^[ \t]*User[ \t]+[a-zA-Z0-9]+/ {print $2}' etc/apache2/*.conf)
fi
if [ -z "$wwwusr" ]; then # otherwise, use the default
    wwwusr=%{icinga_command_user}
fi
# if apache user is not in cmdgrp, add it
if /usr/bin/id -Gn $wwwusr 2>/dev/null | /bin/grep -q %{icinga_command_group} > /dev/null 2>&1 ; then
    : # $wwwusr (default: %%{icinga_command_user}) is already in %%{icinga_command_group} group
else
    # modify apache user, adding it to cmdgrp
    %if 0%{?suse_version} > 1220
        usermod -a -G %{icinga_command_group} $wwwusr
    %else
        groupmod -A $wwwusr %{icinga_command_group} 2>/dev/null
    %endif
    %{logmsg} "User $wwwusr added to group %{icinga_command_group} so sending commands to Icinga from the command CGI is possible."
fi
if [ ${1:-0} -eq 1 ]
then
    # this is the initial installation: enable icinga
    test -x %{_sbindir}/a2enflag && %{_sbindir}/a2enflag ICINGA >/dev/null
    %if 0%{?using_systemd}
      %{_bindir}/systemctl try-restart apache2
    %else
      %restart_on_update apache2
    %endif
fi

%postun www
if [ "$1" = "0" ]; then
    # deinstallation of the package - remove the apache flag
    test -x %{_sbindir}/a2disflag && %{_sbindir}/a2disflag ICINGA >/dev/null
    %if 0%{?using_systemd}
      %{_bindir}/systemctl try-restart apache2
    %else
      %restart_on_update apache2
    %endif
fi

%post idoutils
%if 0%{?using_systemd}
%service_add_post ido2db.service
%else
%{fillup_and_insserv ido2db}
%endif

if [ ${1:-0} -gt 1 ]
then
# On Update
    %{_defaultdocdir}/%{name}/examples/update_icinga_paths.sh %{name}-idoutils
fi

%{logmsg} "icinga-idoutils installed: Don't forget to install/upgrade your db schema, check /usr/share/doc/packages/icinga-idoutils/README.SUSE.idoutils"

%if 0%{?using_systemd}
%pre idoutils
%service_add_pre ido2db.service
%endif

%preun idoutils
%if 0%{?using_systemd}
%service_del_preun ido2db.service
%else
%stop_on_removal ido2db
%endif

%postun idoutils
%if 0%{?using_systemd}
%service_del_postun ido2db.service
%else
%restart_on_update ido2db
%insserv_cleanup
%endif

%files
%defattr(-,root,root)
%doc README LICENSE Changelog UPGRADING LEGAL sample-config/ README.SUSE examples
%{_mandir}/man8/icinga*.8*
%{_sbindir}/%{name}
%attr(0755,root,%{icinga_group}) %{_sbindir}/icingastats
%if 0%{?using_systemd}
%attr(0755,root,root) %{_sbindir}/rc%{name}
%{icinga_libdir}/icinga-exec-start-pre
%exclude %{icinga_libdir}/ido2db-exec-start-pre
%{_unitdir}/icinga.service
%else
%{_sbindir}/rc%{name}
%{_initrddir}/%{name}
%endif
%{icinga_datadir}/p1.pl
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
%attr(0755,root,root) %config %{_sysconfdir}/cron.weekly/%{name}
%dir %{icinga_libdir}
%dir %{icinga_sysconfdir}
%dir %{icinga_sysconfdir}/modules
%config(noreplace) %{icinga_sysconfdir}/icinga.cfg
%dir %{icinga_sysconfdir}/objects
%dir %{_sysconfdir}/%{name}/conf.d
%config(noreplace) %{icinga_logrotatefile}
%config(noreplace) %{icinga_sysconfdir}/objects/commands.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/contacts.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/notifications.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/localhost.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/printer.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/switch.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/templates.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/timeperiods.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/windows.cfg
%config(noreplace) %attr(0640,icinga,icinga) %{icinga_sysconfdir}/resource.cfg
%defattr(-,%{icinga_user},%{icinga_group})
%dir %{icinga_logdir}
%dir %{icinga_logdir}/archives
%dir %{icinga_localstatedir}
%dir %{icinga_spooldir}
%dir %{icinga_spooldir}/checkresults
%ghost %{icinga_cmd_filedir}

%files -n monitoring-tools
%defattr(-,root,root)
%{_sbindir}/mini_epn
%{_sbindir}/new_mini_epn
%{_mandir}/man8/mini_epn.8*
%{_mandir}/man8/new_mini_epn.8*
%{_mandir}/man8/mini_epn_icinga.8*

%files www
%defattr(-,root,root)
%dir %{icinga_cgidir}/
%{icinga_cgidir}/avail.cgi
%{icinga_cgidir}/cmd.cgi
%{icinga_cgidir}/config.cgi
%{icinga_cgidir}/extinfo.cgi
%{icinga_cgidir}/histogram.cgi
%{icinga_cgidir}/history.cgi
%{icinga_cgidir}/notifications.cgi
%{icinga_cgidir}/outages.cgi
%{icinga_cgidir}/showlog.cgi
%{icinga_cgidir}/status.cgi
%{icinga_cgidir}/statusmap.cgi
%{icinga_cgidir}/summary.cgi
%{icinga_cgidir}/tac.cgi
%{icinga_cgidir}/trends.cgi
%dir %{icinga_datadir}
%{icinga_datadir}/favicon.ico
%{icinga_datadir}/images
%{icinga_datadir}/index.html
%{icinga_datadir}/js
%{icinga_datadir}/main.html
%{icinga_datadir}/media
%{icinga_datadir}/menu.html
%{icinga_datadir}/robots.txt
%{icinga_datadir}/ssi
%{icinga_datadir}/stylesheets
%{icinga_datadir}/jquery-ui
%{icinga_datadir}/jquery-ui-addon
%attr(0775,%{icinga_command_user},%{icinga_command_group}) %dir %{icinga_cgi_logdir}

%files www-config
%defattr(-,root,root,-)
%config(noreplace) %{apacheconfdir}/%{name}.conf
%config(noreplace) %{icinga_sysconfdir}/cgi.cfg
%config(noreplace) %{icinga_sysconfdir}/cgiauth.cfg
%config(noreplace) %attr(0640,root,%{apachegroup}) %{icinga_http_authfile}

%files idoutils
%defattr(-,root,root)
%doc module/idoutils/db/queries UPGRADING module/idoutils/db/README module/idoutils/config README.SUSE.idoutils
%{_mandir}/man8/ido2db.8*
%{_mandir}/man8/log2ido.8*
%config(noreplace) %{icinga_sysconfdir}/ido2db.cfg
%config(noreplace) %{icinga_sysconfdir}/idomod.cfg
%config(noreplace) %{icinga_sysconfdir}/modules/idoutils.cfg
%config(noreplace) %{icinga_sysconfdir}/modules/flapjack.cfg
%config(noreplace) %{icinga_sysconfdir}/modules/livestatus.cfg
%config(noreplace) %{icinga_sysconfdir}/modules/mod_gearman.cfg
%config(noreplace) %{icinga_sysconfdir}/modules/pnp4nagios.cfg
%config(noreplace) %{icinga_sysconfdir}/objects/ido2db_check_proc.cfg
%{_sbindir}/rcido2db
%if 0%{?using_systemd}
%{_unitdir}/ido2db.service
%{icinga_libdir}/ido2db-exec-start-pre
%else
%{_initrddir}/ido2db
%endif
%{_sbindir}/ido2db
%{_sbindir}/log2ido
%{icinga_libdir}/idomod.so

%files idoutils-mysql
%defattr(-,root,root)
%doc module/idoutils/db/mysql module/idoutils/db/examples

%files idoutils-oracle
%defattr(-,root,root)
%doc module/idoutils/db/oracle

%files idoutils-pgsql
%defattr(-,root,root)
%doc module/idoutils/db/pgsql

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/

%files doc
%defattr(-,root,root)
%doc %{icinga_datadir}/docs

%files plugins-eventhandlers
%defattr(0755,root,root)
%{icinga_eventhandlerdir}

%files plugins-downtimes
%defattr(0755,root,root)
%{icinga_libdir}/downtimes

%changelog
openSUSE Build Service is sponsored by