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