update to 1.2.3 [release 1.2.3-1mamba;Mon Dec 27 2021]

This commit is contained in:
Silvan Calarco 2024-01-06 07:12:49 +01:00
parent 1f12a41f4e
commit b56859daea

109
mon.spec
View File

@ -1,15 +1,15 @@
%define moncgi_version 1.52 %define moncgi_version 1.52
Name: mon Name: mon
Version: 1.2.0 Version: 1.2.3
Release: 3mamba Release: 1mamba
Summary: A scheduler and alert management tool used for monitoring service availability and triggering alerts upon failure detection Summary: A scheduler and alert management tool used for monitoring service availability and triggering alerts upon failure detection
Group: System/Servers Group: System/Servers
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.kernel.org/pub/software/admin/mon/html/ URL: https://mirrors.edge.kernel.org/pub/software/admin/mon/html/
Source0: http://www.giano.lkams.kernel.org/pub/software/admin/mon/mon-%{version}.tar.bz2 Source0: https://github.com/tj/mon.git/%{version}/mon-%{version}.tar.bz2
Source1: mon-initscript Source1: mon-initscript
Source2: mon-lvs.alert Source2: mon-lvs.alert
Source3: mon-bring-ha-down.alert Source3: mon-bring-ha-down.alert
@ -22,9 +22,20 @@ Patch0: mon-1.2.0-Makefile.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: libtirpc-devel BuildRequires: libperl
BuildRequires: perl(SNMP_Session)
BuildRequires: perl-Authen-Radius
BuildRequires: perl-HTML-Parser
BuildRequires: perl-HTTP-Cookies
BuildRequires: perl-HTTP-Message
BuildRequires: perl-Net-SSLeay
BuildRequires: perl-Net-Telnet
BuildRequires: perl-NetSNMP
BuildRequires: perl-ParallelUserAgent
BuildRequires: perl-URI
BuildRequires: perl-devel
BuildRequires: perl-libwww
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %description
mon is a general-purpose scheduler and alert management tool used for monitoring service availability and triggering alerts upon failure detection. mon is a general-purpose scheduler and alert management tool used for monitoring service availability and triggering alerts upon failure detection.
@ -35,32 +46,29 @@ Monitors and alerts are not a part of the core mon server, even though the distr
This means that if a new service needs monitoring, or if a new alert is necessary, the mon server does not need to be changed. This means that if a new service needs monitoring, or if a new alert is necessary, the mon server does not need to be changed.
This makes mon easily extensible. This makes mon easily extensible.
%debug_package
%prep %prep
%setup -q %setup -q
%patch0 -p1 #%patch0 -p1
## fix an incorrect autodiscovered -Dopt dependency
#%define __perl_requires %{_builddir}/%{name}-%{version}/perl_requires.sh
#cat > perl_requires.sh << _EOF
##! /bin/sh
#%{_prefix}/lib/rpm/find-requires %{buildroot} %{_target_cpu} | grep -v "\-Dopt"
#_EOF
#chmod +x perl_requires.sh
%build %build
%make -C mon.d LDLIBS="-ltirpc" %make
#-C mon.d LDLIBS="-ltirpc"
%install %install
[ "%{buildroot}" != / ] && rm -rf %{buildroot} [ "%{buildroot}" != / ] && rm -rf %{buildroot}
make -C mon.d install MONPATH=%{buildroot}%{_libdir}/mon #make -C mon.d install MONPATH=%{buildroot}%{_libdir}/mon
make install DESTDIR=%{buildroot} #make install DESTDIR=%{buildroot}
install -D -m0755 mon %{buildroot}%{_bindir}/mon
install -m 755 %{S:1} %{buildroot}%{_initrddir}/mon #install -m 755 %{S:1} %{buildroot}%{_initrddir}/mon
install -m 755 %{S:2} %{buildroot}%{_libdir}/mon/alert.d/lvs.alert install -D -m0644 %{S:2} %{buildroot}%{_prefix}/lib/mon/alert.d/lvs.alert
install -m 755 %{S:3} %{buildroot}%{_libdir}/mon/alert.d/bring-ha-down.alert install -D -m0644 %{S:3} %{buildroot}%{_prefix}/lib/mon/alert.d/bring-ha-down.alert
install -m 755 %{S:4} %{buildroot}%{_libdir}/mon/mon.d/squid.monitor install -D -m0644 %{S:4} %{buildroot}%{_prefix}/lib/mon/mon.d/squid.monitor
install -m 755 %{S:8} %{buildroot}%{_libdir}/mon/alert.d/bring-ha-up.alert install -D -m0644 %{S:8} %{buildroot}%{_prefix}/lib/mon/alert.d/bring-ha-up.alert
#sed -i "s|/usr/lib/sendmail|/usr/sbin/sendmail|" \ #sed -i "s|/usr/lib/sendmail|/usr/sbin/sendmail|" \
# %{buildroot}%{_libdir}/mon/alert.d/* # %{buildroot}%{_libdir}/mon/alert.d/*
@ -70,9 +78,9 @@ install -d %{buildroot}/var/log/mon
rm -f %{buildroot}%{_sysconfdir}/mon/S99mon rm -f %{buildroot}%{_sysconfdir}/mon/S99mon
# install additional monitors and alerts # install additional monitors and alerts
install -d %{buildroot}%{_libdir}/mon/examples install -d %{buildroot}%{_prefix}/lib/mon/examples
pushd %{buildroot}%{_libdir}/mon/examples pushd %{buildroot}%{_prefix}/lib/mon/examples
tar xzf %{S:5} tar xzf %{S:5}
tar xzf %{S:6} tar xzf %{S:6}
sed -i "s|/usr/local/bin/perl|/usr/bin/perl|" \ sed -i "s|/usr/local/bin/perl|/usr/bin/perl|" \
@ -84,45 +92,28 @@ popd
%clean %clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot} [ "%{buildroot}" != / ] && rm -rf %{buildroot}
%preun
if [ $1 -eq 0 ]; then
# erase
chkconfig mon
if [ $? -eq 0 ]; then
service mon stop
chkconfig --del mon
fi
fi
exit 0
%postun
if [ $1 -eq 1 ]; then
# upgrade
chkconfig mon
[ $? -eq 0 ] && service mon restart
fi
exit 0
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%dir %{_sysconfdir}/mon #%dir %{_sysconfdir}/mon
%config(noreplace) %{_sysconfdir}/mon/* #%config(noreplace) %{_sysconfdir}/mon/*
%{_initrddir}/mon %{_bindir}/mon
%dir %{_libdir}/mon %dir %{_prefix}/lib/mon
%dir %{_libdir}/mon/mon.d %dir %{_prefix}/lib/mon/mon.d
%{_libdir}/mon/mon.d/* %{_prefix}/lib/mon/mon.d/*
%dir %{_libdir}/mon/state.d #%dir %{_prefix}/lib/mon/state.d
%{_libdir}/mon/state.d/* #%{_prefix}/lib/mon/state.d/*
%dir %{_libdir}/mon/alert.d %dir %{_prefix}/lib/mon/alert.d
%{_libdir}/mon/alert.d/* %{_prefix}/lib/mon/alert.d/*
%{_libdir}/mon/mon %dir %{_prefix}/lib/mon/examples
%dir %{_libdir}/mon/examples %{_prefix}/lib/mon/examples/*
%{_libdir}/mon/examples/*
%dir /var/log/mon %dir /var/log/mon
%{_mandir}/man1/* #%{_mandir}/man1/*
%{_mandir}/man8/* #%{_mandir}/man8/*
%changelog %changelog
* Mon Dec 27 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.3-1mamba
- update to 1.2.3
* Mon Nov 19 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.0-3mamba * Mon Nov 19 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.0-3mamba
- remove monitor which requires obsoleted module perl-LWP-Parallel-UserAgent - remove monitor which requires obsoleted module perl-LWP-Parallel-UserAgent