Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > main-src > by-pkgid > 3121a7b81b723915fe42471776a2a5a3 > files > 6

mon-0.99.2-2mdk.src.rpm

%define version 0.99.2
%define moncgi_version 1.52
%define release 2mdk
%define name    mon
%define realname        Mon

Summary: A general-purpose resource monitoring system.
Name: %{name}
Version: %{version}
Release: %{release}
Source0: ftp://ftp.kernel.org/pub/software/admin/mon/%{name}-%{version}.tar.bz2
Source1: %{name}.cf
Source2: ftp://ftp.kernel.org/pub/software/admin/mon/contrib/cgi-bin/mon.cgi/%{name}.cgi-%{moncgi_version}.tar.bz2
Source3: ftp://ftp.kernel.org/pub/software/admin/mon/contrib/all-alerts.tar.bz2
#Patch0: mon-0.38.20-init.patch
Patch0: mon-0.99.1-init.patch
Url: http://www.kernel.org/software/mon/
License: GPL
Group: System/Servers
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root/
Prefix:         %{_prefix}
Requires: perl-Mon                  
Requires: perl-Period             
Requires: perl-TimeDate           
Requires: perl-Time-HiRes        
Requires: perl-Convert-BER      
Requires: perl-Net-Telnet       
Requires: perl-Authen-PAM

%description
Mon is a general-purpose resource monitoring system.  It can be used
to monitor network service availability, server problems,
environmental conditions (i.e., the temperature in a room) or other
things. Mon can be used to test the condition and/or to trigger an
action upon failure of the condition.  Mon keeps the testing and
action-taking tasks as separate, stand-alone programs.

Mon is very extensible.  Monitors and alerts are not a part of mon, but
the distribution comes with a handful of them to get you started. This
means that if a new service needs monitoring, or if a new alert is
required, the mon server will not need to be changed.

%prep
%setup -q -a 2 -a 3
%patch0 -p1

%build
%serverbuild
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -DUSE_VENDOR_CF_PATH=1"

%make -C mon.d

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/%{_bindir}
install -m 755 mon $RPM_BUILD_ROOT/%{_bindir}
install -m 755 clients/moncmd $RPM_BUILD_ROOT/%{_bindir}
install -m 755 clients/monshow $RPM_BUILD_ROOT/%{_bindir}
install -m 755 clients/skymon/skymon $RPM_BUILD_ROOT/%{_bindir}

# man
mkdir -p $RPM_BUILD_ROOT%{_mandir}/{man1,man8}
install -m 644 doc/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
install -m 644 doc/*.8 $RPM_BUILD_ROOT%{_mandir}/man8

mkdir -p $RPM_BUILD_ROOT/%{_libdir}/mon/alert.d
install -m 755 alert.d/* $RPM_BUILD_ROOT/%{_libdir}/mon/alert.d
find alerts/  -type f ! -regex ".*~" ! -regex ".*README"  -exec install -m 755 {} $RPM_BUILD_ROOT/%{_libdir}/mon/alert.d  \;

mkdir -p $RPM_BUILD_ROOT/%{_var}/lib/mon/state.d
mkdir -p $RPM_BUILD_ROOT/%{_var}/lib/mon/log.d

mkdir -p $RPM_BUILD_ROOT/%{_libdir}/mon/mon.d
install -m 755 mon.d/*.monitor $RPM_BUILD_ROOT/%{_libdir}/mon/mon.d
install -m 555 mon.d/dialin.monitor.wrap $RPM_BUILD_ROOT/%{_libdir}/mon/mon.d

#chmod 644 $RPM_BUILD_ROOT/%{_libdir}/mon/mon.d/{Makefile,*.c}

mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mon
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mon/mon.cf
install -m 644 etc/auth.cf $RPM_BUILD_ROOT%{_sysconfdir}/mon/auth.cf
echo "# user: passwd" > $RPM_BUILD_ROOT%{_sysconfdir}/mon/userfile


mkdir -p $RPM_BUILD_ROOT%{_initrddir}
cp -f etc/S99mon $RPM_BUILD_ROOT%{_initrddir}/mon

mkdir -p $RPM_BUILD_ROOT/%{_var}/www/cgi-bin/
mv mon.cgi-%{moncgi_version}/mon.cgi mon.cgi
install -m 755 mon.cgi $RPM_BUILD_ROOT/%{_var}/www/cgi-bin/

# doc
chmod 644 {README*,doc/README*}
echo "%doc `find alerts/  -type f ! -regex ".*~" -name "*README" | xargs`"> alerts.README

%clean
rm -rf $RPM_BUILD_ROOT

%post
%_post_service mon

%preun
%_preun_service mon

%files -f alerts.README
%defattr(-,root,root)
%doc CHANGES COPYING CREDITS COPYRIGHT README INSTALL TODO doc/README.* 
%doc KNOWN-PROBLEMS VERSION  utils mon.lsm
%doc etc/*.cf etc/example.m4 etc/example.monshowrc clients/{skymon,batch-example}
%doc mon.cgi-1.52/
%dir %config(noreplace) %{_sysconfdir}/mon
%config(noreplace) %{_sysconfdir}/mon/*.cf
%attr (0600,root,root) %config(noreplace) %{_sysconfdir}/mon/userfile
%config(noreplace) %{_initrddir}/mon
%{_mandir}/*/* 
%{_var}/www/cgi-bin/mon.cgi
%{_bindir}/mon
%{_bindir}/monshow
%{_bindir}/moncmd
%{_bindir}/skymon          
%{_libdir}/mon
%attr(02555,root,uucp) %{_libdir}/mon/mon.d/dialin.monitor.wrap
%dir %{_var}/lib/mon
%dir %{_var}/lib/mon/state.d
%dir %{_var}/lib/mon/log.d

%changelog
* Tue Mar 12 2002 Philippe Libat <philippe@mandrakesoft.com> 0.99.2-2mdk
- require

* Fri Dec 07 2001 Philippe Libat <philippe@mandrakesoft.com> 0.99.2-1mdk
- New version: 0.99.2
- add contrib/all-alerts

* Mon Aug 27 2001 Philippe Libat <philippe@mandrakesoft.com> 0.99.1-1mdk
- new version

* Tue May  8 2001 Guillaume Cottenceau <gc@mandrakesoft.com> 0.38.21-1mdk
- version 0.38.21

* Wed Sep 27 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-8mdk
- use post_service and preun_service macros
- use serverbuild macro

* Wed Sep 27 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-7mdk
- change Requires

* Fri Sep 22 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-6mdk
- change /home/httpd to /var/www

* Wed Sep 20 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-5mdk
- in mon.cf change statedir, logdir, dtlogfile location
- add preun condition

* Wed Sep 13 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-4mdk
- var/lib/mon/

* Tue Sep 12 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-3mdk
- start in background
- monitor ping

* Mon Sep 11 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-2mdk
- not active in post

* Thu Aug 31 2000 Philippe Libat <philippe@mandrakesoft.com> 0.38.20-1mdk
- upgraded to 0.38.20
- macroszifications.

* Fri Jun 30 2000 Nicolas Planel <nicolas@mandrakesoft.com>
- spec file for MandrakeSoft

* Tue Feb 15 2000 Tim Powers <timp@redhat.com>
- Requires: Mon should have been Requires: perl-Mon, fixed
- built for 6.2
- BuildArch is noarch

* Mon Feb 14 2000 Andrew Anderson <andrew@redhat.com>
- point the cgi script to localhost
- sample config file cleanup

* Sat Feb 12 2000 Andrew Anderson <andrew@redhat.com>
- Re-introduced dependancy for Mon
- cleaned up init script
- fix bogus /var/run/mon.pid directory

* Thu Nov 18 1999 Tim Powers <timp@redhat.com>
- updated to 0.38.15
- removed Requires: perl-Mon

* Mon Aug 16 1999 Bill Nottingham <notting@redhat.com>
- fix bogus requires.

* Fri Jul 23 1999 Cristian Gafton <gafton@redhat.com>
- make sure we don't end up owning dirs that aren't ours
- updated the Requires lines

* Mon Jul 19 1999 Tim Powers <timp@redhat.com>
- updated source to 0.38.13
- built for 6.1

* Thu Apr 15 1999 Michael Maher <mike@redhat.com>
- built package for 6.0
- pre release is out, but stayed with stable one

* Wed Sep 09 1998 Michael Maher <mike@redhat.com>
- built package