File ppc64-diag.spec of Package ppc64-diag

#
# spec file for package ppc64-diag (Version 2.3.1)
#
# Copyright (c) 2009 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/
#


Url:            http://linux-diag.sourceforge.net/ppc64-diag/

Name:           ppc64-diag
Version:        2.3.1
Release:        8
Summary:        Linux for Power Platform Diagnostics
Group:          System/Monitoring
License:        Other uncritical OpenSource License; Eclipse Public License v1.0
ExclusiveArch:  ppc ppc64
BuildRequires:  librtas libservicelog-devel
Requires:       servicelog
Requires:       lsvpd
# autoselect the package on systems which have the /vdevice/IBM,sp node
# All pSeries POWER5 and later have this property
Supplements:    modalias(vio:TIBM*spS*)
PreReq:         %insserv_prereq
PreReq:         libservicelog
PreReq:         aaa_base
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        ppc64-diag-2.3.1.tar.bz2
Patch0:         ppc64-diag.event_severity.patch
Patch1:         ppc64-diag.rtas_errd.patch
Patch2:         ppc64-diag.register.patch

%description
Platform diagnostics for Linux for Power writes events reported by the
System p or System i platform firmware to the servicelog, provides
automated reponses to urgent events such as environmental conditions
and predictive failures, and provides notifications of the event to
system administrators or connected service frameworks.	Some error log
analysis parameters can be configured in
/etc/ppc64-diag/ppc64-diag.config.



Authors:
--------
    IBM Corporation

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
make

%install
make install DESTDIR=$RPM_BUILD_ROOT
chmod 644 $RPM_BUILD_ROOT/etc/ppc64-diag/servevent_parse.pl

%files
%defattr (-,root,root,-)
%doc COPYRIGHT
/usr/sbin/*
%dir /etc/ppc64-diag
%config /etc/ppc64-diag/*
%config /etc/rc.powerfail
%config %attr(755,root,root) /etc/init.d/rtas_errd
%if 1

%post
%{insserv_force_if_yast rtas_errd}
# get it going if outside a chroot
if test -f /proc/1/exe -a -d /proc/1/root; then
  if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
    /etc/init.d/rtas_errd start || :
  fi
fi

%preun
if test "$1" = "0" ; then
  rmdir -v /var/cache/ppc64-diag.registered || :
fi
%stop_on_removal rtas_errd

%postun
%restart_on_update rtas_errd
%{insserv_cleanup}
%else

%post
# Post-install script --------------------------------------------------
/etc/ppc64-diag/ppc64_diag_setup --register >/dev/null
if [ "$1" = "1" ]; then # first install
    /sbin/chkconfig --add rtas_errd
    /etc/init.d/rtas_errd start
elif [ "$1" = "2" ]; then # upgrade
    /etc/init.d/rtas_errd restart
fi

%preun
# Pre-uninstall script -------------------------------------------------
if [ "$1" = "0" ]; then # last uninstall
    /etc/init.d/rtas_errd stop
    /sbin/chkconfig --del rtas_errd
    /etc/ppc64-diag/ppc64_diag_setup --unregister >/dev/null
fi

%triggerin -- librtas
# trigger on librtas upgrades ------------------------------------------
if [ "$2" = "2" ]; then
    /etc/init.d/rtas_errd restart
fi
%endif

%changelog
* Fri Jan 16 2009 olh@suse.de
- fix Supplements string, it cant contain a comma, use * instead
  (bnc#456695)
* Mon Dec 08 2008 olh@suse.de
- do not autoinstall on Cell blades
- add prereq aaa_base to runlevel script in post install
- do not abort on errors
* Fri Dec 05 2008 olh@suse.de
- update Supplements to match only pSeries and Cell blades
* Fri Dec 05 2008 olh@suse.de
- add PreReq libservicelog to get servicelog.db (bnc#417532,bnc#449382)
* Mon Oct 27 2008 olh@suse.de
- use supplements instead of Enhances
* Mon Oct 27 2008 olh@suse.de
- register with servicelog during first install or first boot (bnc#417532)
* Fri Sep 26 2008 olh@suse.de
- add tage Enhances: kernel-ppc64
- make sure package gets selected/installed on a 64bit system
* Wed Sep 10 2008 olh@suse.de
- new ppc64-diag 2.3.1 package (bnc#417532)