ppc64-diag/ppc64-diag.spec
2012-02-15 18:09:32 +01:00

112 lines
4.3 KiB
RPMSpec

Name: ppc64-diag
Version: 2.4.2
Release: 5%{?dist}
Summary: Linux for Power Platform Diagnostics
URL: http://sourceforge.net/projects/linux-diag/files/ppc64-diag/
Group: System Environment/Base
License: EPL
ExclusiveArch: ppc ppc64
BuildRequires: libservicelog-devel, flex, perl, byacc, librtas-devel
BuildRequires: libvpd-devel, systemd-units
Requires: servicelog, lsvpd
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://downloads.sourceforge.net/project/linux-diag/ppc64-diag/%{version}/%{name}-%{version}.tar.gz
Source1: ppc64-diag.service
Patch0: ppc64-diag-2.4.2-messagecatalog-location.patch
Patch1: ppc64-diag-2.4.2-chkconfig.patch
Patch2: ppc64-diag-2.4.2-scriptlocation.patch
%description
Platform diagnostics for Linux for Power writes events reported by the
System p or System i platform firmware to the service log, provides automated
responses 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.
%prep
%setup -q
%patch0 -p1 -b .msg_loc
%patch1 -p1 -b .chkconfig
%patch2 -p1 -b .script_loc
%build
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
chmod 644 COPYRIGHT
rm -f $RPM_BUILD_ROOT/usr/share/doc/packages/ppc64-diag/COPYRIGHT
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/%{name}
mv -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/rtas_errd $RPM_BUILD_ROOT/%{_libexecdir}/%{name}/
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root,-)
%doc COPYRIGHT
%dir %{_sysconfdir}/%{name}
%{_mandir}/man8/*
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/ppc64-diag.config
%attr(755,root,root) %{_sbindir}/*
%dir %{_datadir}/%{name}
%dir %attr(755,root,root) %{_datadir}/%{name}/message_catalog/
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_migrate
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_mkrsrc
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_notify
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_servagent
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_setup
%attr(644,root,root) %{_libexecdir}/%{name}/servevent_parse.pl
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/cxgb3
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/e1000e
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/exceptions
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/gpfs
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/reporters
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/with_regex/*
%attr(755,root,root) %{_sysconfdir}/rc.powerfail
%attr(755,root,root) %{_libexecdir}/%{name}/rtas_errd
%attr(644,root,root) %{_unitdir}/ppc64-diag.service
%post
# Post-install script --------------------------------------------------
%{_libexecdir}/%{name}/ppc64_diag_setup --register >/dev/null
if [ "$1" = "2" ]; then # upgrade
%{_libexecdir}/%{name}/rtas_errd restart
fi
%preun
# Pre-uninstall script -------------------------------------------------
if [ "$1" = "0" ]; then # last uninstall
%{_libexecdir}/%{name}/rtas_errd stop
%{_libexecdir}/%{name}/ppc64_diag_setup --unregister >/dev/null
fi
%triggerin -- librtas
# trigger on librtas upgrades ------------------------------------------
if [ "$2" = "2" ]; then
%{_libexecdir}/%{name}/rtas_errd restart
fi
%changelog
* Wed Feb 15 2012 Karsten Hopp <karsten@redhat.com> 2.4.2-5
- don't strip binaries
* Thu Sep 22 2011 Karsten Hopp <karsten@redhat.com> 2.4.2-4
- fix preun and post install scriptlets
* Fri Sep 09 2011 Karsten Hopp <karsten@redhat.com> 2.4.2-3
- add buildrequirement systemd-units for _unitdir rpm macro
- move helper scripts to libexecdir/ppc64-diag
* Wed Sep 07 2011 Karsten Hopp <karsten@redhat.com> 2.4.2-2
- additional fixes for Fedora package review (bugzilla #736062)
* Wed Aug 17 2011 Karsten Hopp <karsten@redhat.com> 2.4.2-1
- initial Fedora version, based on IBM spec file with rpmlint cleanups
- move scripts to /usr/share/ppc-diag
- don't start service automatically after install