update to 3.2.1 [release 3.2.1-1mamba;Sun Oct 13 2019]

This commit is contained in:
Silvan Calarco 2024-01-06 07:30:53 +01:00
parent 7f3c04d77f
commit 4dc685801b

View File

@ -3,15 +3,16 @@
%define nrpegroup nrpe %define nrpegroup nrpe
Name: nagios-nrpe Name: nagios-nrpe
Version: 2.15 Version: 3.2.1
Release: 3mamba Release: 1mamba
Summary: Nagios Remote Plugin Executor (NRPE) Summary: Nagios Remote Plugin Executor (NRPE)
Group: Network/Monitoring Group: Network/Monitoring
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Davide Madrisan <davide.madrisan@gmail.com> Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://www.nagios.org URL: http://www.nagios.org
Source0: http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-%{version}/nrpe-%{version}.tar.gz #Source0: http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-%{version}/nrpe-%{version}.tar.gz
Source0: https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-%{version}/nrpe-%{version}.tar.gz
Source1: nagios-nrpe.sysconfig Source1: nagios-nrpe.sysconfig
Source2: nagios-commands-nrpe.cfg Source2: nagios-commands-nrpe.cfg
Source3: nrpe.service Source3: nrpe.service
@ -27,8 +28,9 @@ Patch5: nrpe-2.15-rundir.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: initscripts BuildRequires: libnsl-devel
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
BuildRequires: libwrap-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
Requires: initscripts Requires: initscripts
Provides: nrpe = %{?epoch:%epoch:}%{version}-%{release} Provides: nrpe = %{?epoch:%epoch:}%{version}-%{release}
@ -51,90 +53,100 @@ The plugin then uses the output and return code from the plugin execution on the
%prep %prep
%setup -q -n nrpe-%{version} %setup -q -n nrpe-%{version}
%patch0 -p1 #%patch0 -p1
%patch1 -p1 #%patch1 -p1
%patch2 -p1 #%patch2 -p1
%patch3 -p1 #%patch3 -p1
%patch4 -p1 #%patch4 -p1
%patch5 -p1 #%patch5 -p1
%build %build
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
%configure \ %configure \
--with-init-dir=%{_initrddir} \ --with-init-type=systemd \
--with-inetd-type=systemd \
--with-dist-type=debian \
--with-pkgsysconfdir=%{_sysconfdir}/nagios \
--with-objsysconfdir=%{_sysconfdir}/nagios/nrpe.d \
--with-nrpe-port=%{nrpeport} \ --with-nrpe-port=%{nrpeport} \
--with-nrpe-user=%{nrpeuser} \ --with-nrpe-user=%{nrpeuser} \
--with-nrpe-group=%{nrpegroup} \ --with-nrpe-group=%{nrpegroup} \
--bindir=%{_sbindir} \ --bindir=%{_sbindir} \
--libdir=/doesnt/matter/ \
--libexecdir=%{_libdir}/nagios/plugins \ --libexecdir=%{_libdir}/nagios/plugins \
--datadir=%{_datadir}/nagios \ --datadir=%{_datadir}/nagios \
--sysconfdir=%{_sysconfdir}/nagios \ --sysconfdir=%{_sysconfdir}/nagios \
--localstatedir=%{_localstatedir}/log/nagios \ --localstatedir=/run/nagios \
--enable-command-args --enable-command-args
%make %make all
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m0755 %{buildroot}%{_unitdir}
%makeinstall NAGIOS_INSTALL_OPTS= NRPE_INSTALL_OPTS= \
INIT_DIR=%{buildroot}%{_unitdir} INETD_DIR=%{buildroot}%{_unitdir} \
install-plugin install-inetd install-init install-config
install -d %{buildroot}%{_sysconfdir}/nagios/nrpe.d
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/nagios/conf.d/commands-nrpe.cfg
rm -f %{buildroot}%{_sbindir}/nrpe-uninstall
:<< _OBSOLETE
#install -D -p -m 0755 init-script %{buildroot}/%{_initrddir}/nrpe #install -D -p -m 0755 init-script %{buildroot}/%{_initrddir}/nrpe
install -D -p -m 0644 sample-config/nrpe.cfg %{buildroot}/%{_sysconfdir}/nagios/nrpe.cfg install -D -p -m 0644 sample-config/nrpe.cfg %{buildroot}/%{_sysconfdir}/nagios/nrpe.cfg
install -D -p -m 0755 src/nrpe %{buildroot}%{_sbindir}/nrpe install -D -p -m 0755 src/nrpe %{buildroot}%{_sbindir}/nrpe
install -D -p -m 0755 src/check_nrpe %{buildroot}%{_libdir}/nagios/plugins/check_nrpe install -D -p -m 0755 src/check_nrpe %{buildroot}%{_libdir}/nagios/plugins/check_nrpe
install -D -p -m 0644 %{S:1} %{buildroot}/%{_sysconfdir}/sysconfig/nrpe #install -D -p -m 0644 %{S:1} %{buildroot}/%{_sysconfdir}/sysconfig/nrpe
install -d %{buildroot}%{_sysconfdir}/nrpe.d
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/nagios/conf.d/commands-nrpe.cfg
install -D -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/nrpe.service install -D -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/nrpe.service
install -D -m0644 %{SOURCE4} %{buildroot}%{_unitdir}/nrpe.socket install -D -m0644 %{SOURCE4} %{buildroot}%{_unitdir}/nrpe.socket
install -D -m0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nrpe.conf install -D -m0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nrpe.conf
install -D -m0644 %{SOURCE6} %{buildroot}%{_unitdir}/nrpe@.service install -D -m0644 %{SOURCE6} %{buildroot}%{_unitdir}/nrpe@.service
_OBSOLETE
install -d %{buildroot}%{_sysconfdir}/sudoers.d install -d %{buildroot}%{_sysconfdir}/sudoers.d
cat > %{buildroot}%{_sysconfdir}/sudoers.d/nrpe << _EOF cat > %{buildroot}%{_sysconfdir}/sudoers.d/nrpe << _EOF
nrpe ALL=(root) NOPASSWD:%{_prefix}/lib/nagios/plugins/check_ide_smart nrpe ALL=(root) NOPASSWD:%{_libdir}/nagios/plugins/check_ide_smart
nrpe ALL=(root) NOPASSWD:%{_prefix}/lib/nagios/plugins/check_disk nrpe ALL=(root) NOPASSWD:%{_libdir}/nagios/plugins/check_disk
_EOF _EOF
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre %pre
getent group %{nrpegroup} >/dev/null || groupadd -r %{nrpegroup} if [ $1 -ge 1 ]; then
getent passwd %{nrpeuser} >/dev/null || \ /usr/sbin/groupadd -r %{nrpegroup} -g 65061 &>/dev/null || true
%{_sbindir}/useradd -c "Nagios NRPE user" -d %{_localstatedir}/run/nrpe \ /usr/sbin/useradd -u 65061 -c "Nagios NRPE user" -d /run/nrpe \
-r -g %{nrpegroup} -s /sbin/nologin %{nrpeuser} 2>/dev/null -r -g %{nrpegroup} -s /sbin/nologin %{nrpeuser} 2>/dev/null
exit 0 fi
%systemd_pre nrpe
:
%post %post
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
systemctl -q daemon-reload
%tmpfiles_create nrpe.conf %tmpfiles_create nrpe.conf
fi fi
%systemd_post nrpe
: :
%preun %preun
if [ $1 -eq 0 ]; then %systemd_preun nrpe
systemctl -q daemon-reload :
fi
%postun
%systemd_postun_with_restart nrpe
: :
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_sysconfdir}/sudoers.d/nrpe %{_sysconfdir}/sudoers.d/nrpe
%config(noreplace) %{_sysconfdir}/nagios/nrpe.cfg %config(noreplace) %{_sysconfdir}/nagios/nrpe.cfg
%config(noreplace) %{_sysconfdir}/sysconfig/nrpe
%{_sbindir}/nrpe %{_sbindir}/nrpe
%dir %{_sysconfdir}/nagios %dir %{_sysconfdir}/nagios/nrpe.d
%dir %{_sysconfdir}/nrpe.d
%{_unitdir}/nrpe.service %{_unitdir}/nrpe.service
%{_unitdir}/nrpe.socket
%{_unitdir}/nrpe@.service
%{_tmpfilesdir}/nrpe.conf %{_tmpfilesdir}/nrpe.conf
%doc LEGAL %doc LEGAL
#%doc README README.SSL SECURITY docs/NRPE.pdf
%files -n nagios-plugins-nrpe %files -n nagios-plugins-nrpe
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -142,6 +154,12 @@ fi
%{_libdir}/nagios/plugins/check_nrpe %{_libdir}/nagios/plugins/check_nrpe
%changelog %changelog
* Sun Oct 13 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.1-1mamba
- update to 3.2.1
* Sun Oct 13 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 2.15-4mamba
- rebuilt with openssl 1.1.1d
* Sun Dec 27 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.15-3mamba * Sun Dec 27 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.15-3mamba
- systemd support - systemd support