]> git.pld-linux.org Git - packages/nagios-nrpe.git/blobdiff - nagios-nrpe.spec
up to 3.0
[packages/nagios-nrpe.git] / nagios-nrpe.spec
index 456ff7b03d0fd7d3691b10c23d9d8cf9f2762955..faaff082e94e4c005fa3c2d9ddfb7e8956ce9515 100644 (file)
@@ -1,15 +1,16 @@
 Summary:       Nagios remote plugin execution service/plugin
 Summary(pl.UTF-8):     Demon i wtyczka zdalnego wywoływania wtyczek Nagios
 Name:          nagios-nrpe
-Version:       2.15
-Release:       2
+Version:       3.0
+Release:       1
 License:       GPL v2
 Group:         Networking
 Source0:       http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz
-# Source0-md5: 3921ddc598312983f604541784b35a50
+# Source0-md5: e2e8e0bcd9a3924b0ea94e76500f147b
 Source1:       nrpe.init
 Source2:       nrpe-command.cfg
 Source3:       %{name}.tmpfiles
+Source4:       commands.cfg
 Patch0:                %{name}-config.patch
 Patch1:                nrpe_check_control.patch
 URL:           http://www.nagios.org/
@@ -18,7 +19,7 @@ BuildRequires:        openssl-tools
 BuildRequires: rpmbuild(macros) >= 1.647
 Requires(post,preun):  /sbin/chkconfig
 Requires:      nagios-common
-Requires:      rc-scripts
+Requires:      rc-scripts >= 0.4.1.26
 Provides:      nagios-core
 Obsoletes:     netsaint-nrpe
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -26,7 +27,6 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                _sysconfdir     /etc/nagios
 %define                _datadir        %{_prefix}/share/%{name}
 %define                _plugindir      %{_libdir}/nagios/plugins
-%define                _libexecdir     %{_plugindir}
 %define                _localstatedir  %{_var}/log/nagios
 %define                nsport          5666
 
@@ -74,6 +74,7 @@ na innych komputerach za pomocą demona nrpe.
        --with-nrpe-user=nagios \
        --with-nrpe-group=nagios \
        --enable-ssl \
+       --with-ssl-lib=%{_libdir} \
        --enable-command-args
 
 %{__make} all
@@ -87,6 +88,7 @@ install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/{plugins,nrpe.d},%{_l
        $RPM_BUILD_ROOT%{systemdtmpfilesdir}
 
 cp -p sample-config/nrpe.cfg $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.cfg
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.d
 sed -e 's,@plugindir@,%{_plugindir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/plugins/check_nrpe.cfg
 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
 install -p src/nrpe $RPM_BUILD_ROOT%{_sbindir}
@@ -106,6 +108,26 @@ if [ "$1" = "0" ] ; then
        /sbin/chkconfig --del nrpe
 fi
 
+%triggerpostun -- %{name} < 2.15-5
+# skip *this* trigger on downgrade
+[ $1 -le 1 ] && exit 0
+
+# ensure there's include_dir directive
+if ! grep -q '^include_dir=%{_sysconfdir}/nrpe.d' %{_sysconfdir}/nrpe.cfg; then
+       echo 'include_dir=%{_sysconfdir}/nrpe.d' >> %{_sysconfdir}/nrpe.cfg
+fi
+
+# check if need to migrate
+grep -q '^command\[' %{_sysconfdir}/nrpe.cfg || exit 0
+
+# move command definitions to separate file
+mv -f  %{_sysconfdir}/nrpe.d/commands.cfg{,.rpmnew}
+grep '^command\['  %{_sysconfdir}/nrpe.cfg > %{_sysconfdir}/nrpe.d/commands.cfg
+cp -f %{_sysconfdir}/nrpe.cfg{,.rpmsave}
+sed -i -e '/^command\[/d' %{_sysconfdir}/nrpe.cfg
+
+%service nrpe restart
+
 %triggerpostun -- %{name} < 2.6-1.1
 %{__sed} -i -e 's,/var/run/nrpe.pid,/var/run/nrpe/nrpe.pid,' %{_sysconfdir}/nrpe.cfg
 
@@ -118,9 +140,10 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc Changelog LEGAL README* SECURITY
+%doc Changelog LEGAL README* SECURITY.md
 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.cfg
 %attr(750,root,nagios) %dir %{_sysconfdir}/nrpe.d
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.d/commands.cfg
 %attr(755,root,root) %{_sbindir}/nrpe
 %attr(754,root,root) /etc/rc.d/init.d/nrpe
 %dir %attr(775,root,nagios) /var/run/nrpe
This page took 0.102139 seconds and 4 git commands to generate.