]>
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} |
589e70ce | 28 | Version: 8.0.4 |
86186ee6 | 29 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
61472ea8 JB |
30 | License: GPL v2+ |
31 | Group: Libraries | |
589e70ce JR |
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 | |
7d6e8030 | 35 | Source1: eppic.tar.xz |
589e70ce | 36 | # Source1-md5: a04143f6eb0d72c33cd53329dc1b4803 |
c403d8ac JR |
37 | Source2: https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.xz |
38 | # Source2-md5: c044b7146903ec51c9d2337a29aee93b | |
8c6160c3 | 39 | Patch0: %{pname}-x32.patch |
589e70ce | 40 | Patch1: only-patch-gdb.patch |
6dc8016f | 41 | URL: https://github.com/crash-utility/crash |
7b110258 JR |
42 | BuildRequires: rpmbuild(macros) >= 1.701 |
43 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} | |
2025c975 | 44 | %if %{with userspace} |
61472ea8 JB |
45 | BuildRequires: ncurses-devel |
46 | BuildRequires: readline-devel | |
47 | BuildRequires: xz-devel | |
48 | BuildRequires: zlib-devel | |
2025c975 | 49 | %endif |
c94e3060 | 50 | ExclusiveArch: %{ix86} %{x8664} x32 alpha arm ia64 ppc64 s390 s390x |
61472ea8 JB |
51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
52 | ||
53 | %description | |
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. | |
58 | ||
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. | |
64 | ||
65 | %package devel | |
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 | |
70 | ||
71 | %description devel | |
72 | Header files for core analysis suite. | |
73 | ||
74 | %description devel -l pl.UTF-8 | |
75 | Plik nagłówkowy narzędzia do analizy zrzutów pamięci. | |
76 | ||
661e0f95 JR |
77 | %define kernel_pkg()\ |
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}\ | |
82 | Group: Base/Kernel\ | |
83 | Requires(post,postun): /sbin/depmod\ | |
661e0f95 JR |
84 | %requires_releq_kernel\ |
85 | Requires(postun): %releq_kernel\ | |
661e0f95 JR |
86 | \ |
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\ | |
90 | unavailable.\ | |
91 | \ | |
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.\ | |
96 | \ | |
97 | %if %{with kernel}\ | |
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*\ | |
102 | %endif\ | |
103 | \ | |
104 | %post -n kernel%{_alt_kernel}-char-crash\ | |
105 | %depmod %{_kernel_ver}\ | |
106 | \ | |
107 | %postun -n kernel%{_alt_kernel}-char-crash\ | |
108 | %depmod %{_kernel_ver}\ | |
109 | %{nil} | |
110 | ||
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\ | |
114 | %{nil} | |
115 | ||
7b110258 | 116 | %{?with_kernel:%{expand:%create_kernel_packages}} |
2025c975 | 117 | |
61472ea8 | 118 | %prep |
589e70ce | 119 | %setup -q -a1 -a2 -n %{pname}-%{version} |
c94e3060 | 120 | %patch0 -p1 |
589e70ce | 121 | %patch1 -p1 |
61472ea8 | 122 | |
7d6e8030 | 123 | %{__mv} eppic extensions |
61472ea8 JB |
124 | |
125 | %build | |
7b110258 | 126 | %{?with_kernel:%{expand:%build_kernel_packages}} |
2025c975 JB |
127 | |
128 | %if %{with userspace} | |
61472ea8 | 129 | export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses" |
589e70ce JR |
130 | %{__make} \ |
131 | ARCH="%{_target_cpu}" \ | |
132 | CC="%{__cc}" \ | |
133 | CFLAGS="%{rpmcflags} -I/usr/include/ncurses" | |
134 | ||
135 | %{__make} -j1 extensions \ | |
61472ea8 JB |
136 | ARCH="%{_target_cpu}" \ |
137 | CC="%{__cc}" \ | |
138 | CFLAGS="%{rpmcflags} -I/usr/include/ncurses" | |
2025c975 | 139 | %endif |
61472ea8 JB |
140 | |
141 | %install | |
142 | rm -rf $RPM_BUILD_ROOT | |
2025c975 JB |
143 | |
144 | %if %{with kernel} | |
661e0f95 JR |
145 | install -d $RPM_BUILD_ROOT |
146 | cp -a installed/* $RPM_BUILD_ROOT | |
2025c975 JB |
147 | %endif |
148 | ||
149 | %if %{with userspace} | |
6d83b7e9 | 150 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash} |
61472ea8 JB |
151 | |
152 | %{__make} install \ | |
153 | DESTDIR=$RPM_BUILD_ROOT | |
154 | ||
155 | # omitted by make install | |
6d83b7e9 | 156 | install extensions/*.so $RPM_BUILD_ROOT%{_libdir}/crash/extensions |
61472ea8 JB |
157 | cp -p crash.8 $RPM_BUILD_ROOT%{_mandir}/man8 |
158 | cp -p defs.h $RPM_BUILD_ROOT%{_includedir}/crash | |
2025c975 | 159 | %endif |
61472ea8 JB |
160 | |
161 | %clean | |
162 | rm -rf $RPM_BUILD_ROOT | |
163 | ||
2025c975 | 164 | %if %{with userspace} |
61472ea8 JB |
165 | %files |
166 | %defattr(644,root,root,755) | |
167 | %doc README | |
168 | %attr(755,root,root) %{_bindir}/crash | |
6d83b7e9 JB |
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 | |
7d6e8030 | 173 | %attr(755,root,root) %{_libdir}/crash/extensions/eppic.so |
6d83b7e9 | 174 | %attr(755,root,root) %{_libdir}/crash/extensions/snap.so |
61472ea8 JB |
175 | %{_mandir}/man8/crash.8* |
176 | ||
177 | %files devel | |
178 | %defattr(644,root,root,755) | |
179 | %{_includedir}/crash | |
2025c975 | 180 | %endif |