2 # - libeppic if anything else (but crash extension) wants to use it
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)
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}
18 %if %{without userspace}
19 # nothing to be placed to debuginfo package
20 %define _enable_debug_packages 0
25 Summary: Core Analysis Suite
26 Summary(pl.UTF-8): Zestaw narzędzi do analizy zrzutów pamięci
27 Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
29 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
32 Source0: http://people.redhat.com/anderson/%{pname}-%{version}.tar.gz
33 # Source0-md5: daf5fb52567cfcac99d3a5890edbc707
34 # git clone https://code.google.com/p/eppic
36 # Source1-md5: a9f80ad71de9d6f5b77534a7ebdbed8e
37 Patch0: %{pname}-x32.patch
38 Patch1: gdb-glibc.patch
39 URL: http://people.redhat.com/anderson/
40 BuildRequires: rpmbuild(macros) >= 1.701
41 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
43 BuildRequires: ncurses-devel
44 BuildRequires: readline-devel
45 BuildRequires: xz-devel
46 BuildRequires: zlib-devel
48 ExclusiveArch: %{ix86} %{x8664} x32 alpha arm ia64 ppc64 s390 s390x
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
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.
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
70 Header files for core analysis suite.
72 %description devel -l pl.UTF-8
73 Plik nagłówkowy narzędzia do analizy zrzutów pamięci.
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}\
81 Requires(post,postun): /sbin/depmod\
82 %requires_releq_kernel\
83 Requires(postun): %releq_kernel\
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\
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.\
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*\
102 %post -n kernel%{_alt_kernel}-char-crash\
103 %depmod %{_kernel_ver}\
105 %postun -n kernel%{_alt_kernel}-char-crash\
106 %depmod %{_kernel_ver}\
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\
114 %{?with_kernel:%{expand:%create_kernel_packages}}
117 %setup -q -a1 -n %{pname}-%{version}
119 # apply after unpacking gdb-7.6
120 cat %{PATCH1} >> gdb-7.6.patch
122 %{__mv} eppic extensions
125 %{?with_kernel:%{expand:%build_kernel_packages}}
127 %if %{with userspace}
128 export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses"
129 %{__make} -j1 all extensions \
130 ARCH="%{_target_cpu}" \
132 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
136 rm -rf $RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT
140 cp -a installed/* $RPM_BUILD_ROOT
143 %if %{with userspace}
144 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash}
147 DESTDIR=$RPM_BUILD_ROOT
149 # omitted by make install
150 install extensions/*.so $RPM_BUILD_ROOT%{_libdir}/crash/extensions
151 cp -p crash.8 $RPM_BUILD_ROOT%{_mandir}/man8
152 cp -p defs.h $RPM_BUILD_ROOT%{_includedir}/crash
156 rm -rf $RPM_BUILD_ROOT
158 %if %{with userspace}
160 %defattr(644,root,root,755)
162 %attr(755,root,root) %{_bindir}/crash
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
167 %attr(755,root,root) %{_libdir}/crash/extensions/eppic.so
168 %attr(755,root,root) %{_libdir}/crash/extensions/snap.so
169 %attr(755,root,root) %{_libdir}/crash/extensions/trace.so
170 %{_mandir}/man8/crash.8*
173 %defattr(644,root,root,755)