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