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: https://github.com/crash-utility/crash/archive/%{version}/%{pname}-%{version}.tar.gz
33 # Source0-md5: 5d8513ded5c9517e713a75e712d72e3a
34 # git clone -b v5.0 https://github.com/lucchouina/eppic
36 # Source1-md5: a04143f6eb0d72c33cd53329dc1b4803
37 Source2: https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.xz
38 # Source2-md5: c044b7146903ec51c9d2337a29aee93b
39 Patch0: %{pname}-x32.patch
40 Patch1: only-patch-gdb.patch
41 URL: https://github.com/crash-utility/crash
42 BuildRequires: rpmbuild(macros) >= 1.701
43 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
45 BuildRequires: ncurses-devel
46 BuildRequires: readline-devel
47 BuildRequires: xz-devel
48 BuildRequires: zlib-devel
50 ExclusiveArch: %{ix86} %{x8664} x32 alpha arm ia64 ppc64 s390 s390x
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 The core analysis suite is a self-contained tool that can be used to
55 investigate either live systems, kernel core dumps created from the
56 netdump and diskdump packages offered by Red Hat, the LKCD kernel
57 patch or the mcore kernel patch available from Mission Critical Linux.
59 %description -l pl.UTF-8
60 Narzędzie do analizy zrzutów pamięci to samodzielny program służący do
61 badania systemów działających, zrzutów pamięci jądra utworzonych przez
62 pakiety Red Hata netdump lub diskdump, łatę jądra LKCD lub łatę jądra
63 mcore dostępną w Mission Critical Linuksie.
66 Summary: Header files for core analysis suite
67 Summary(pl.UTF-8): Plik nagłówkowy narzędzia do analizy zrzutów pamięci
68 Group: Development/Libraries
69 # doesn't require base
72 Header files for core analysis suite.
74 %description devel -l pl.UTF-8
75 Plik nagłówkowy narzędzia do analizy zrzutów pamięci.
78 %package -n kernel%{_alt_kernel}-char-crash\
79 Summary: Memory driver for live system crash sessions\
80 Summary(pl.UTF-8): Sterownik pamięci dla sesji crash na żywym systemie\
81 Release: %{rel}@%{_kernel_ver_str}\
83 Requires(post,postun): /sbin/depmod\
84 %requires_releq_kernel\
85 Requires(postun): %releq_kernel\
87 %description -n kernel%{_alt_kernel}-char-crash\
88 This package contains /dev/crash memory driver for live system crash\
89 sessions, which may be used when /dev/mem and /proc/kcore are\
92 %description -n kernel%{_alt_kernel}-char-crash -l pl.UTF-8\
93 Ten pakiet zawiera sterownik pamięci /dev/crash do sesji crash na\
94 żywym systemie. Może być używany do analizy, kiedy /dev/mem i\
95 /proc/kcore nie są dostępne.\
98 %files -n kernel%{_alt_kernel}-char-crash\
99 %defattr(644,root,root,755)\
100 %doc memory_driver/README\
101 /lib/modules/%{_kernel_ver}/kernel/drivers/char/crash.ko*\
104 %post -n kernel%{_alt_kernel}-char-crash\
105 %depmod %{_kernel_ver}\
107 %postun -n kernel%{_alt_kernel}-char-crash\
108 %depmod %{_kernel_ver}\
111 %define build_kernel_pkg()\
112 %build_kernel_modules -C memory_driver -m crash\
113 %install_kernel_modules -D installed -m memory_driver/crash -d kernel/drivers/char\
116 %{?with_kernel:%{expand:%create_kernel_packages}}
119 %setup -q -a1 -a2 -n %{pname}-%{version}
123 %{__mv} eppic extensions
126 %{?with_kernel:%{expand:%build_kernel_packages}}
128 %if %{with userspace}
129 export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses"
131 ARCH="%{_target_cpu}" \
133 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
135 %{__make} -j1 extensions \
136 ARCH="%{_target_cpu}" \
138 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
142 rm -rf $RPM_BUILD_ROOT
145 install -d $RPM_BUILD_ROOT
146 cp -a installed/* $RPM_BUILD_ROOT
149 %if %{with userspace}
150 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash}
153 DESTDIR=$RPM_BUILD_ROOT
155 # omitted by make install
156 install extensions/*.so $RPM_BUILD_ROOT%{_libdir}/crash/extensions
157 cp -p crash.8 $RPM_BUILD_ROOT%{_mandir}/man8
158 cp -p defs.h $RPM_BUILD_ROOT%{_includedir}/crash
162 rm -rf $RPM_BUILD_ROOT
164 %if %{with userspace}
166 %defattr(644,root,root,755)
168 %attr(755,root,root) %{_bindir}/crash
169 %dir %{_libdir}/crash
170 %dir %{_libdir}/crash/extensions
171 %attr(755,root,root) %{_libdir}/crash/extensions/dminfo.so
172 %attr(755,root,root) %{_libdir}/crash/extensions/echo.so
173 %attr(755,root,root) %{_libdir}/crash/extensions/eppic.so
174 %attr(755,root,root) %{_libdir}/crash/extensions/snap.so
175 %{_mandir}/man8/crash.8*
178 %defattr(644,root,root,755)