]> git.pld-linux.org Git - packages/mcelog.git/blob - mcelog.spec
e403f6230f05f1c1fbbb17ab7841046459021a53
[packages/mcelog.git] / mcelog.spec
1 %define         subver  20130601
2 %define         rel     1
3 Summary:        x86-64/x86 Machine Check Exceptions collector and decoder
4 Summary(pl.UTF-8):      Narzędzie do zbierania i dekodowania wyjątków MCE na platformie x86-64/x86
5 Name:           mcelog
6 Version:        1.0
7 Release:        1.%{subver}.%{rel}
8 License:        GPL v2
9 Group:          Applications/System
10 #Source0:       http://www.kernel.org/pub/linux/utils/cpu/mce/%{name}-%{version}%{subver}.tar.gz
11 Source0:        https://github.com/andikleen/mcelog/tarball/master/%{name}-%{version}-%{subver}.tgz
12 # Source0-md5:  c48d3d3296ad0d5cbdf661e44375ea64
13 Source1:        %{name}.logrotate
14 Source2:        %{name}.cron
15 Source3:        %{name}.init
16 Source4:        %{name}.sysconfig
17 Patch1:         %{name}-FHS.patch
18 Patch2:         bashism.patch
19 URL:            https://github.com/andikleen/mcelog.git
20 BuildRequires:  rpmbuild(macros) >= 1.228
21 Requires(post,preun):   /sbin/chkconfig
22 Requires:       rc-scripts
23 Suggests:       crondaemon
24 ExclusiveArch:  %{ix86} %{x8664}
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         statdir         /var/lib/misc
28
29 %description
30 mcelog is the user space backend for logging machine check errors
31 reported by the hardware to the kernel. The kernel does the immediate
32 actions (like killing processes etc.) and mcelog decodes the logs the
33 errors.
34
35 Starting with version 2.6.4 for x86-64 and 2.6.32 for x86, the Linux
36 kernel no longer decodes and logs recoverable Machine Check Exception
37 events to the kernel log on its own. It is recommended that mcelog
38 runs on all those machines.
39
40 Instead, the MCE data is kept in a buffer which can be read from
41 userpace via the /dev/mcelog device node. You need this tool to
42 collect and decode those events; it will log the decoded MCE events
43 into /var/log/mcelog.
44
45 %description -l pl.UTF-8
46 mcelog to program do logowania błędów sprzętowych Machine Check
47 Exception zgłaszanych przez sprzęt (x86 i x86-64) do jądra. Jądro
48 podejmuje natychmiastowe akcje (takie jak odłączanie procesorów), a
49 mcelog dekoduje logi tych błędów.
50
51 Począwszy od wersji 2.6.4 dla x86-64 i 2.6.32 dla x86 jądro Linuksa
52 już samodzielnie nie dekoduje ani nie loguje niekrytycznych zdarzeń
53 MCE - zaleca się uruchamianie mceloga na tych wszystkich maszynach.
54
55 Zamiast logowania przez jądro, dane MCE są przechowywane w buforze,
56 który może być czytany z przestrzeni użytkownika poprzez urządzenie
57 /dev/mcelog. To narzędzie jest potrzebne do zbierania i dekodowania
58 tych zdarzeń; loguje ono zdekodowane zdarzenia MCE do /var/log/mcelog.
59
60 %prep
61 %setup -qc
62 mv andikleen-mcelog-*/* .
63 %patch1 -p1
64 %patch2 -p1
65
66 %build
67 %{__make} \
68         CC="%{__cc}" \
69         CFLAGS="%{rpmcflags} -fpie -pie"
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,{cron,logrotate}.d},/var/log,%{statdir}}
74
75 %{__make} install \
76         prefix=$RPM_BUILD_ROOT%{_prefix} \
77         etcprefix=$RPM_BUILD_ROOT
78
79 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
80 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
81 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
82 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
83
84 :> $RPM_BUILD_ROOT%{statdir}/memory-errors
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %post
90 /sbin/chkconfig --add %{name}
91 %service %{name} restart
92
93 %preun
94 if [ "$1" = "0" ]; then
95         %service -q %{name} stop
96         /sbin/chkconfig --del %{name}
97 fi
98
99 %files
100 %defattr(644,root,root,755)
101 %doc CHANGES README TODO TODO-diskdb mce.pdf
102 %attr(755,root,root) %{_sbindir}/mcelog
103 %attr(640,root,root) /etc/cron.d/mcelog
104 %attr(754,root,root) /etc/rc.d/init.d/%{name}
105 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
106 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mcelog
107 %dir %{_sysconfdir}/%{name}
108 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
109 # do replace on upgrade, in fact, these should be moved to /lib/mcelog as they
110 # all support foo.local invocation at the end
111 %attr(755,root,root) %config %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*-trigger
112 %attr(640,root,root) %ghost %{statdir}/memory-errors
113 %{_mandir}/man8/mcelog.8*
This page took 0.136858 seconds and 2 git commands to generate.