#
# Conditional build:
%bcond_without gd # without statusmap and trends, which require gd library
+# reeenable when http://tracker.nagios.org/view.php?id=51 is fixed
+%bcond_with tests
#
Summary: Host/service/network monitoring program
Summary(pl.UTF-8): Program do monitorowania serwerów/usług/sieci
Summary(pt_BR.UTF-8): Programa para monitoração de máquinas e serviços
Name: nagios
-Version: 3.0
+Version: 3.1.2
Release: 1
License: GPL v2
Group: Networking
Source0: http://dl.sourceforge.net/nagios/%{name}-%{version}.tar.gz
-# Source0-md5: 2e7b82622d187d88a3b94f48b8549630
+# Source0-md5: f3c60428cba14264c709749182b8d93e
Source1: %{name}-apache.conf
Source2: %{name}.init
Source3: %{name}.sysconfig
Source4: http://www.nagios.org/images/favicon.ico
# Source4-md5: 1c4201c7da53d6c7e48251d3a9680449
-Source5: %{name}-config-20050514.tar.bz2
-# Source5-md5: a2883c65377ef7beb55d48af85ec7ef7
+Source5: %{name}-config-20071217.tar.bz2
+# Source5-md5: c50e60b73f86b8bfbc36f486d583f67b
Source6: %{name}-lighttpd.conf
Patch0: %{name}-resources.patch
Patch1: %{name}-iconv-in-libc.patch
Patch2: %{name}-webapps.patch
+Patch3: %{name}-cgi-http_charset.patch
+Patch4: %{name}-cmd-typo.patch
URL: http://www.nagios.org/
BuildRequires: autoconf
BuildRequires: automake
Requires(triggerpostun): sed >= 4.0
Requires: %{name}-common = %{version}-%{release}
Requires: /bin/mail
-Requires: nagios-plugins
Requires: rc-scripts
Requires: sh-utils
Provides: nagios-core
Summary: Default Nagios theme
Summary(pl.UTF-8): Domyślny motyw Nagiosa
Group: Applications/WWW
+Requires: webserver(php)
Requires: nagios-cgi = %{version}-%{release}
Provides: nagios-theme
Obsoletes: nagios-theme
%patch0 -p0
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
sed -i -e '
s,".*/var/rw/nagios.cmd,"%{_localstatedir}/rw/nagios.cmd,
%{__aclocal}
%{__autoconf}
%configure \
+ --datarootdir=%{_datadir} \
--with-nagios-user=%{name} \
--with-nagios-grp=%{name} \
--with-command-user=%{name} \
--with-command-grp=%{name} \
--with-lockfile=%{_localstatedir}/%{name}.pid \
--with-ping_command='/bin/ping -n %%s -c %%d' \
- --enable-event-broker \
- %{!?with_gd:--disable-statusmap --disable-trends}
+ %{!?with_gd:--disable-statusmap --disable-trends} \
+ %{?with_tests:--enable-libtap} \
+ --enable-event-broker
%{__make} all
+%{?with_tests:%{__make} test}
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_webapps}/%{_webapp}} \
fi
%pre common
-if [ "`getgid netsaint`" = "72" ]; then
+if [ "`getgid netsaint 2>/dev/null`" = "72" ]; then
/usr/sbin/groupmod -n nagios netsaint
fi
%groupadd -g 72 nagios
%attr(770,root,nagios-data) %dir %{_localstatedir}
%attr(2770,root,nagios-data) %dir %{_localstatedir}/rw
%attr(660,nagios,nagios-data) %ghost %{_localstatedir}/rw/nagios.cmd
+%attr(2770,root,nagios-data) %dir %{_localstatedir}/spool
+%attr(2770,root,nagios-data) %dir %{_localstatedir}/spool/checkresults
%attr(664,root,nagios) %ghost %{_localstatedir}/objects.cache
%attr(664,root,nagios) %ghost %{_localstatedir}/*.dat
%attr(664,root,nagios) %ghost %{_localstatedir}/%{name}.tmp
%attr(755,root,root) %{_sbindir}/*.cgi
%dir %{_datadir}
+%dir %{_datadir}/includes
%dir %{_datadir}/images
%dir %{_datadir}/stylesheets
%{_datadir}/favicon.ico
%files theme-default
%defattr(644,root,root,755)
-%{_datadir}/*.html
+%{_datadir}/*.php
+%{_datadir}/includes/*
%{_datadir}/images/*
%{_datadir}/stylesheets/*