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