File safte-monitor.spec of Package safte-monitor

#
# spec file for package safte-monitor (Version 0.0.5)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           safte-monitor
Obsoletes:      saftemon
Summary:        Linux SAF-TE SCSI enclosure monitor
Version:        0.0.5
Release:        363
Url:            http://oss.metaparadigm.com/safte-monitor/
Source0:        %{name}-%{version}.tar.gz
Patch0:         %{name}-%{version}.diff
Patch1:         safte-monitor-fix.patch
Patch2:         safte-monitor.ioctl.patch
License:        GPL v2 or later
Group:          System/Monitoring
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %suse_version > 800
PreReq:         %fillup_prereq %insserv_prereq
%endif

%description
saftemon reads disk enclosure status information from SAF-TE (SCSI
Accessible Fault Tolerant Enclosures). SAF-TE is a component of SES
(SCSI Enclosure Services) which is common on most SCSI disk enclosures
these days. saftemon can monitor multiple SAF-TE devices and will
automatically detect them.

The information retrieved includes power supply, temperature, audible
alarm, drive faults, array critical/failed/rebuilding state and door
lock status. saftemon logs changes in the status of these enclosure
elements to syslog and can optionally execute an alert help program
with details of the component failure.



Authors:
--------
    Michael Clark <michael@metapardigm.com>

%prep
%setup -q
%patch -p1
%patch1 -p0
%patch2 -p1

%build
rm -f config.cache config.log config.status
CC=gcc CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr \
	--exec-prefix=/usr \
	--sysconfdir=/etc \
	--libexecdir=/usr/%{_lib} \
	--localstatedir=/var
make CC=gcc

%install
make DESTDIR=$RPM_BUILD_ROOT install
install -d $RPM_BUILD_ROOT/etc/init.d
install redhat/init.d/safte-monitor $RPM_BUILD_ROOT/etc/init.d/safte-monitor
install -d $RPM_BUILD_ROOT/usr/sbin
ln -s ../../etc/init.d/safte-monitor $RPM_BUILD_ROOT/usr/sbin/rcsafte-monitor
install -d $RPM_BUILD_ROOT/var/adm/fillup-templates
install redhat/sysconfig/safte-monitor $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.safte-monitor
install -d $RPM_BUILD_ROOT/etc/safte-monitor

%clean
rm -rf $RPM_BUILD_ROOT

%post
#chkconfig --add safte-monitor
%{fillup_and_insserv safte-monitor}

%postun
%insserv_cleanup

%files
%defattr(-,root,root)
%doc CHANGELOG README README.html mathopd-1.3pl7-lite/COPYING
%config /etc/init.d/safte-monitor
/var/adm/fillup-templates/sysconfig.safte-monitor
%config(noreplace) /etc/safte-monitor.conf
%config(noreplace) /etc/safte-monitor.passwd
%dir /etc/safte-monitor
%config /etc/safte-monitor/alert
/usr/bin/safte-monitor
/usr/sbin/rcsafte-monitor
/usr/lib/safte-monitor
%defattr(-,daemon,root)
/var/run/safte-monitor
/var/log/safte-monitor

%changelog
* Fri Aug 29 2008 cthiel@suse.de
- fix build script
* Fri Aug 10 2007 olh@suse.de
- update ioctl arguments, the size arg is not sizeof() anymore
* Mon Jun 18 2007 dmueller@suse.de
- fix init script dependencies
* Tue Sep 12 2006 ro@suse.de
- fix another case of non-void function returning void
* Tue Jul 04 2006 aj@suse.de
- Fix build.
* Sat May 27 2006 schwab@suse.de
- Use RPM_OPT_FLAGS.
- Don't strip binaries.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Jun 17 2005 meissner@suse.de
- use RPM_OPT_FLAGS, add include string.h in one place.
* Sun Jan 11 2004 adrian@suse.de
- build as user
* Tue Sep 02 2003 mmj@suse.de
- Add sysconfig metadata [#28930]
* Mon Jun 02 2003 ro@suse.de
- correctly install alert script
* Thu Feb 20 2003 mmj@suse.de
- Add sysconfig metadata [#22680]
- Only setup and patch in %%prep
* Fri Aug 30 2002 garloff@suse.de
- Add comment to SAFTEMONITOR_OPTIONS sysconfig variable (#18656)
* Mon Aug 19 2002 garloff@suse.de
- Add %%fillup_prereq and %%insserv_prereq (bug #17976)
* Wed Aug 07 2002 garloff@suse.de
- Renamed package to safte-monitor (trademark issues)
- Update to version 0.0.5
* Thu May 09 2002 garloff@suse.de
- Build package from saftemon-0.0.4
- Fix init script and sysconfig file to match SuSE conventions
- Move alert script to /etc/saftemon/alert
openSUSE Build Service is sponsored by