Summary(pt_BR.UTF-8): Programa para monitoração de máquinas e serviços
Name: nagios
Version: 3.2.0
-Release: 1
+Release: 6
License: GPL v2
Group: Networking
Source0: http://dl.sourceforge.net/nagios/%{name}-%{version}.tar.gz
Source3: %{name}.sysconfig
Source4: http://www.nagios.org/images/favicon.ico
# Source4-md5: 1c4201c7da53d6c7e48251d3a9680449
-Source5: %{name}-config-20090803.tar.bz2
-# Source5-md5: e4c42ebadecef32cfe14cc3085f5bae4
+Source5: %{name}-config-20090914.tar.bz2
+# Source5-md5: 605f1cd28c00db961dad6f529d849f16
Source6: %{name}-lighttpd.conf
Patch0: %{name}-resources.patch
Patch1: %{name}-iconv-in-libc.patch
%endif
BuildRequires: rpmbuild(macros) >= 1.268
BuildRequires: sed >= 4.0
-BuildRequires: tar >= 1:1.15.1
Requires(post,preun): /sbin/chkconfig
Requires: %{name}-common = %{version}-%{release}
-Requires: /bin/mail
-Requires: nagios-notify >= 0.13
Requires: rc-scripts
Requires: sh-utils
+Suggests: nagios-notify >= 0.13
Provides: nagios-core
Obsoletes: netsaint
Conflicts: iputils-ping < 1:ss020124
Requires(pre): /usr/sbin/groupmod
Requires(pre): /usr/sbin/useradd
Requires(pre): /usr/sbin/usermod
-Provides: group(nagios)
Provides: group(nagcmd)
+Provides: group(nagios)
Provides: user(nagios)
%description common
%patch4 -p1
%patch5 -p1
-find -name .cvsignore | xargs rm
+find -name .cvsignore -o -name .gitignore | xargs rm
mv nagios-config-*/objects/*.cfg sample-config/template-object
mv nagios-config-*/*.cfg sample-config
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+
sed -i -e '
s,".*/var/rw/nagios.cmd,"%{_localstatedir}/rw/nagios.cmd,
s,".*/libexec/eventhandlers,"%{_libdir}/%{name}/eventhandlers,
%endif
install -d $RPM_BUILD_ROOT%{_includedir}/%{name}
-install include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
+cp -a include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
%{__make} install-unstripped \
DESTDIR=$RPM_BUILD_ROOT \
INIT_OPTS="" \
COMMAND_OPTS=""
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
-install %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}
+install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}
# install templated configuration files
for a in nagios.cfg resource.cfg commands.cfg contactgroups.cfg contacts.cfg templates.cfg timeperiods.cfg; do
done
# webserver files
-install apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
-install apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
-install lighttpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
+cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
+cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
+cp -a lighttpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
cp -a sample-config/cgi.cfg $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
> $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/passwd
echo 'nagios:' > $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/group
%files
%defattr(644,root,root,755)
%doc Changelog README* UPGRADING INSTALLING LICENSE
-%attr(640,root,nagcmd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nagios.cfg
-%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/[!n]*.cfg
+%attr(750,root,nagios) %dir %{_sysconfdir}/objects
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.cfg
%attr(754,root,root) /etc/rc.d/init.d/%{name}
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%files common
%defattr(644,root,root,755)
%attr(750,root,nagcmd) %dir %{_sysconfdir}
-%attr(2750,root,nagios) %dir %{_sysconfdir}/plugins
-%attr(2750,root,nagios) %dir %{_sysconfdir}/objects
+%attr(750,root,nagios) %dir %{_sysconfdir}/plugins
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/plugins
%dir %{_libdir}/%{name}/eventhandlers