]>
Commit | Line | Data |
---|---|---|
61472ea8 | 1 | # TODO: |
7d6e8030 | 2 | # - libeppic if anything else (but crash extension) wants to use it |
61472ea8 | 3 | # |
2025c975 JB |
4 | # Conditional build: |
5 | %bcond_without dist_kernel # allow non-distribution kernel | |
6 | %bcond_without kernel # don't build kernel modules | |
7 | %bcond_without userspace # don't build userspace programs | |
8 | %bcond_with verbose # verbose kernel module build (V=1) | |
9 | # | |
ff79030e JR |
10 | %if "%{_alt_kernel}" != "%{nil}" |
11 | %undefine with_userspace | |
12 | %endif | |
13 | ||
14 | %define rel 1 | |
15 | %define pname crash | |
61472ea8 JB |
16 | Summary: Core Analysis Suite |
17 | Summary(pl.UTF-8): Zestaw narzędzi do analizy zrzutów pamięci | |
18 | Name: crash | |
ff79030e JR |
19 | Version: %{pname}%{_alt_kernel} |
20 | Release: %{rel} | |
61472ea8 JB |
21 | License: GPL v2+ |
22 | Group: Libraries | |
ff79030e | 23 | Source0: http://people.redhat.com/anderson/%{pname}-%{version}.tar.gz |
61472ea8 | 24 | # Source0-md5: b59076aebaced87e9073328cb0a4f50a |
7d6e8030 JB |
25 | # git clone https://code.google.com/p/eppic |
26 | Source1: eppic.tar.xz | |
27 | # Source1-md5: a9f80ad71de9d6f5b77534a7ebdbed8e | |
ff79030e | 28 | Patch0: %{pname}-format.patch |
61472ea8 | 29 | URL: http://people.redhat.com/anderson/ |
2025c975 JB |
30 | %if %{with kernel} && %{with dist_kernel} |
31 | BuildRequires: kernel-module-build >= 2.6 | |
32 | %endif | |
33 | %if %{with userspace} | |
61472ea8 JB |
34 | BuildRequires: ncurses-devel |
35 | BuildRequires: readline-devel | |
36 | BuildRequires: xz-devel | |
37 | BuildRequires: zlib-devel | |
2025c975 | 38 | %endif |
61472ea8 JB |
39 | ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc64 s390 s390x |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | The core analysis suite is a self-contained tool that can be used to | |
44 | investigate either live systems, kernel core dumps created from the | |
45 | netdump and diskdump packages offered by Red Hat, the LKCD kernel | |
46 | patch or the mcore kernel patch available from Mission Critical Linux. | |
47 | ||
48 | %description -l pl.UTF-8 | |
49 | Narzędzie do analizy zrzutów pamięci to samodzielny program służący do | |
50 | badania systemów działających, zrzutów pamięci jądra utworzonych przez | |
51 | pakiety Red Hata netdump lub diskdump, łatę jądra LKCD lub łatę jądra | |
52 | mcore dostępną w Mission Critical Linuksie. | |
53 | ||
54 | %package devel | |
55 | Summary: Header files for core analysis suite | |
56 | Summary(pl.UTF-8): Plik nagłówkowy narzędzia do analizy zrzutów pamięci | |
57 | Group: Development/Libraries | |
58 | # doesn't require base | |
59 | ||
60 | %description devel | |
61 | Header files for core analysis suite. | |
62 | ||
63 | %description devel -l pl.UTF-8 | |
64 | Plik nagłówkowy narzędzia do analizy zrzutów pamięci. | |
65 | ||
2025c975 JB |
66 | %package -n kernel%{_alt_kernel}-char-crash |
67 | Summary: Memory driver for live system crash sessions | |
68 | Summary(pl.UTF-8): Sterownik pamięci dla sesji crash na żywym systemie | |
ff79030e | 69 | Release: %{rel}@%{_kernel_ver_str} |
2025c975 JB |
70 | Group: Base/Kernel |
71 | Requires(post,postun): /sbin/depmod | |
72 | %if %{with dist_kernel} | |
73 | %requires_releq_kernel | |
74 | Requires(postun): %releq_kernel | |
75 | %endif | |
76 | ||
77 | %description -n kernel%{_alt_kernel}-char-crash | |
78 | This package contains /dev/crash memory driver for live system crash | |
79 | sessions, which may be used when /dev/mem and /proc/kcore are | |
80 | unavailable. | |
81 | ||
82 | %description -n kernel%{_alt_kernel}-char-crash -l pl.UTF-8 | |
83 | Ten pakiet zawiera sterownik pamięci /dev/crash do sesji crash na | |
84 | żywym systemie. Może być używany do analizy, kiedy /dev/mem i | |
85 | /proc/kcore nie są dostępne. | |
86 | ||
61472ea8 | 87 | %prep |
ff79030e | 88 | %setup -q -a1 -n %{pname}-%{version} |
b41a0904 | 89 | %patch0 -p1 |
61472ea8 | 90 | |
7d6e8030 | 91 | %{__mv} eppic extensions |
61472ea8 JB |
92 | |
93 | %build | |
2025c975 JB |
94 | %if %{with kernel} |
95 | %build_kernel_modules -C memory_driver -m crash | |
96 | %endif | |
97 | ||
98 | %if %{with userspace} | |
61472ea8 JB |
99 | export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses" |
100 | %{__make} -j1 all extensions \ | |
101 | ARCH="%{_target_cpu}" \ | |
102 | CC="%{__cc}" \ | |
103 | CFLAGS="%{rpmcflags} -I/usr/include/ncurses" | |
2025c975 | 104 | %endif |
61472ea8 JB |
105 | |
106 | %install | |
107 | rm -rf $RPM_BUILD_ROOT | |
2025c975 JB |
108 | |
109 | %if %{with kernel} | |
110 | %install_kernel_modules -m memory_driver/crash -d kernel/drivers/char | |
111 | %endif | |
112 | ||
113 | %if %{with userspace} | |
6d83b7e9 | 114 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash} |
61472ea8 JB |
115 | |
116 | %{__make} install \ | |
117 | DESTDIR=$RPM_BUILD_ROOT | |
118 | ||
119 | # omitted by make install | |
6d83b7e9 | 120 | install extensions/*.so $RPM_BUILD_ROOT%{_libdir}/crash/extensions |
61472ea8 JB |
121 | cp -p crash.8 $RPM_BUILD_ROOT%{_mandir}/man8 |
122 | cp -p defs.h $RPM_BUILD_ROOT%{_includedir}/crash | |
2025c975 | 123 | %endif |
61472ea8 JB |
124 | |
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
2025c975 JB |
128 | %post -n kernel%{_alt_kernel}-char-crash |
129 | %depmod %{_kernel_ver} | |
130 | ||
131 | %postun -n kernel%{_alt_kernel}-char-crash | |
132 | %depmod %{_kernel_ver} | |
133 | ||
134 | %if %{with userspace} | |
61472ea8 JB |
135 | %files |
136 | %defattr(644,root,root,755) | |
137 | %doc README | |
138 | %attr(755,root,root) %{_bindir}/crash | |
6d83b7e9 JB |
139 | %dir %{_libdir}/crash |
140 | %dir %{_libdir}/crash/extensions | |
141 | %attr(755,root,root) %{_libdir}/crash/extensions/dminfo.so | |
142 | %attr(755,root,root) %{_libdir}/crash/extensions/echo.so | |
7d6e8030 | 143 | %attr(755,root,root) %{_libdir}/crash/extensions/eppic.so |
6d83b7e9 JB |
144 | %attr(755,root,root) %{_libdir}/crash/extensions/snap.so |
145 | %attr(755,root,root) %{_libdir}/crash/extensions/trace.so | |
61472ea8 JB |
146 | %{_mandir}/man8/crash.8* |
147 | ||
148 | %files devel | |
149 | %defattr(644,root,root,755) | |
150 | %{_includedir}/crash | |
2025c975 JB |
151 | %endif |
152 | ||
153 | %if %{with kernel} | |
154 | %files -n kernel%{_alt_kernel}-char-crash | |
155 | %defattr(644,root,root,755) | |
156 | %doc memory_driver/README | |
157 | /lib/modules/%{_kernel_ver}/kernel/drivers/char/crash.ko* | |
158 | %endif |