mcelog/mcelog.spec
Thomas Renninger 85d54dd1f7 - Updated to latest git HEAD:
commit c7bf28088f056925c04d4fd5768504c59bbf19c4
    Author: Robin Holt <robinmholt@gmail.com>
    Date:   Mon Sep 16 04:30:02 2013 -0500
  Because upstream does not use proper tags/revisions, I now
  versioned this one mcelog-1.1

OBS-URL: https://build.opensuse.org/package/show/Base:System/mcelog?expand=0&rev=29
2013-10-15 17:03:51 +00:00

120 lines
3.1 KiB
RPMSpec

#
# spec file for package mcelog
#
# Copyright (c) 2013 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/
#
Name: mcelog
Summary: Log Machine Check Events
License: GPL-2.0+
Group: System/Monitoring
Version: 1.1
Release: 0
ExclusiveArch: ix86 x86_64
BuildRequires: libesmtp-devel
Requires: logrotate
PreReq: %insserv_prereq %fillup_prereq
Source: mcelog-%{version}.tar.bz2
Source1: mcelog.service
Source2: mcelog.sysconfig
Source3: mcelog.systemd
Source6: README.email_setup
Patch1: email.patch
Patch2: mcelog_invert_prefill_db_warning.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %suse_version > 1220
%define _unitdir /usr/lib/systemd
%else
%define _unitdir /lib/systemd
%endif
%description
mcelog retrieves machine check events from an x86-64 kernel in a cron
job, decodes them, and logs them to /var/log/mcelog.
A machine check event is a hardware error detected by the CPU.
It should run on any x86-64 system.
In addition, it allows decoding machine check kernel panic messages.
Authors:
--------
Andi Kleen <andi@firstfloor.org>
%prep
%setup
%patch1 -p1
%patch2 -p1
%build
export SUSE_ASNEEDED=0
make CFLAGS="$RPM_OPT_FLAGS"
%install
export prefix=$RPM_BUILD_ROOT/usr
export etcprefix=$RPM_BUILD_ROOT
make -e install
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m755 %SOURCE1 $RPM_BUILD_ROOT/etc/init.d/mcelog
ln -s /etc/init.d/mcelog $RPM_BUILD_ROOT/usr/sbin/rcmcelog
install -m644 mcelog.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/mcelog
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 %SOURCE2 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mcelog
mkdir -p $RPM_BUILD_ROOT/%_docdir/%name
install -m 644 %SOURCE6 $RPM_BUILD_ROOT/%_docdir/%name/README.email_setup
install -m 644 lk10-mcelog.pdf $RPM_BUILD_ROOT/%_docdir/%name/lk10-mcelog.pdf
install -D -m 0644 %SOURCE3 %{buildroot}%{_unitdir}/system/mcelog.service
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ -c /dev/mcelog ];then
%{fillup_and_insserv -y mcelog}
fi
%preun
%{stop_on_removal mcelog}
%postun
%{restart_on_update mcelog}
%insserv_cleanup
%files
%defattr (-,root,root,755)
%{_mandir}/man8/*
/usr/sbin/mcelog
%config /etc/logrotate.d/mcelog
/etc/init.d/mcelog
%dir /etc/mcelog
%config /etc/mcelog/mcelog.conf
/var/adm/fillup-templates/sysconfig.mcelog
/etc/mcelog/*trigger
/usr/sbin/rcmcelog
%dir %{_unitdir}
%dir %{_unitdir}/system
%{_unitdir}/system/mcelog.service
%_docdir/%name
%changelog