2 # - libeppic if anything else (but crash extension) wants to use it
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)
11 %undefine with_dist_kernel
14 # The goal here is to have main, userspace, package built once with
15 # simple release number, and only rebuild kernel packages with kernel
16 # version as part of release number, without the need to bump release
17 # with every kernel change.
18 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
19 %{error:kernel and userspace cannot be built at the same time on PLD builders}
23 %if "%{_alt_kernel}" != "%{nil}"
24 %if 0%{?build_kernels:1}
25 %{error:alt_kernel and build_kernels are mutually exclusive}
28 %undefine with_userspace
29 %global _build_kernels %{alt_kernel}
31 %global _build_kernels %{?build_kernels:,%{?build_kernels}}
34 %if %{without userspace}
35 # nothing to be placed to debuginfo package
36 %define _enable_debug_packages 0
39 %define kpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%kernel_pkg ; done)
40 %define bkpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%build_kernel_pkg ; done)
44 Summary: Core Analysis Suite
45 Summary(pl.UTF-8): Zestaw narzędzi do analizy zrzutów pamięci
46 Name: %{pname}%{_alt_kernel}
48 Release: %{rel}%{?with_kernel:@%{_kernel_ver_str}}
51 Source0: http://people.redhat.com/anderson/%{pname}-%{version}.tar.gz
52 # Source0-md5: 70d46467f9f2a7115a03cb698fe5125f
53 # git clone https://code.google.com/p/eppic
55 # Source1-md5: a9f80ad71de9d6f5b77534a7ebdbed8e
56 URL: http://people.redhat.com/anderson/
57 BuildRequires: rpmbuild(macros) >= 1.678
58 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
60 BuildRequires: ncurses-devel
61 BuildRequires: readline-devel
62 BuildRequires: xz-devel
63 BuildRequires: zlib-devel
65 ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc64 s390 s390x
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 The core analysis suite is a self-contained tool that can be used to
70 investigate either live systems, kernel core dumps created from the
71 netdump and diskdump packages offered by Red Hat, the LKCD kernel
72 patch or the mcore kernel patch available from Mission Critical Linux.
74 %description -l pl.UTF-8
75 Narzędzie do analizy zrzutów pamięci to samodzielny program służący do
76 badania systemów działających, zrzutów pamięci jądra utworzonych przez
77 pakiety Red Hata netdump lub diskdump, łatę jądra LKCD lub łatę jądra
78 mcore dostępną w Mission Critical Linuksie.
81 Summary: Header files for core analysis suite
82 Summary(pl.UTF-8): Plik nagłówkowy narzędzia do analizy zrzutów pamięci
83 Group: Development/Libraries
84 # doesn't require base
87 Header files for core analysis suite.
89 %description devel -l pl.UTF-8
90 Plik nagłówkowy narzędzia do analizy zrzutów pamięci.
93 %package -n kernel%{_alt_kernel}-char-crash\
94 Summary: Memory driver for live system crash sessions\
95 Summary(pl.UTF-8): Sterownik pamięci dla sesji crash na żywym systemie\
96 Release: %{rel}@%{_kernel_ver_str}\
98 Requires(post,postun): /sbin/depmod\
99 %if %{with dist_kernel}\
100 %requires_releq_kernel\
101 Requires(postun): %releq_kernel\
104 %description -n kernel%{_alt_kernel}-char-crash\
105 This package contains /dev/crash memory driver for live system crash\
106 sessions, which may be used when /dev/mem and /proc/kcore are\
109 %description -n kernel%{_alt_kernel}-char-crash -l pl.UTF-8\
110 Ten pakiet zawiera sterownik pamięci /dev/crash do sesji crash na\
111 żywym systemie. Może być używany do analizy, kiedy /dev/mem i\
112 /proc/kcore nie są dostępne.\
115 %files -n kernel%{_alt_kernel}-char-crash\
116 %defattr(644,root,root,755)\
117 %doc memory_driver/README\
118 /lib/modules/%{_kernel_ver}/kernel/drivers/char/crash.ko*\
121 %post -n kernel%{_alt_kernel}-char-crash\
122 %depmod %{_kernel_ver}\
124 %postun -n kernel%{_alt_kernel}-char-crash\
125 %depmod %{_kernel_ver}\
128 %define build_kernel_pkg()\
129 %build_kernel_modules -C memory_driver -m crash\
130 %install_kernel_modules -D installed -m memory_driver/crash -d kernel/drivers/char\
133 %{?with_kernel:%{expand:%kpkg}}
136 %setup -q -a1 -n %{pname}-%{version}
138 %{__mv} eppic extensions
141 %{?with_kernel:%{expand:%bkpkg}}
143 %if %{with userspace}
144 export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses"
145 %{__make} -j1 all extensions \
146 ARCH="%{_target_cpu}" \
148 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
152 rm -rf $RPM_BUILD_ROOT
155 install -d $RPM_BUILD_ROOT
156 cp -a installed/* $RPM_BUILD_ROOT
159 %if %{with userspace}
160 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash}
163 DESTDIR=$RPM_BUILD_ROOT
165 # omitted by make install
166 install extensions/*.so $RPM_BUILD_ROOT%{_libdir}/crash/extensions
167 cp -p crash.8 $RPM_BUILD_ROOT%{_mandir}/man8
168 cp -p defs.h $RPM_BUILD_ROOT%{_includedir}/crash
172 rm -rf $RPM_BUILD_ROOT
174 %if %{with userspace}
176 %defattr(644,root,root,755)
178 %attr(755,root,root) %{_bindir}/crash
179 %dir %{_libdir}/crash
180 %dir %{_libdir}/crash/extensions
181 %attr(755,root,root) %{_libdir}/crash/extensions/dminfo.so
182 %attr(755,root,root) %{_libdir}/crash/extensions/echo.so
183 %attr(755,root,root) %{_libdir}/crash/extensions/eppic.so
184 %attr(755,root,root) %{_libdir}/crash/extensions/snap.so
185 %attr(755,root,root) %{_libdir}/crash/extensions/trace.so
186 %{_mandir}/man8/crash.8*
189 %defattr(644,root,root,755)