]> git.pld-linux.org Git - packages/crash.git/blob - crash.spec
- update gdb tarball
[packages/crash.git] / crash.spec
1 # TODO:
2 # - libeppic if anything else (but crash extension) wants to use it
3 #
4 # Conditional build:
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)
8
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
18 %if %{without userspace}
19 # nothing to be placed to debuginfo package
20 %define         _enable_debug_packages  0
21 %endif
22
23 %define         rel             1
24 %define         pname           crash
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}
28 Version:        8.0.4
29 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
30 License:        GPL v2+
31 Group:          Libraries
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
35 Source1:        eppic.tar.xz
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}}
44 %if %{with userspace}
45 BuildRequires:  ncurses-devel
46 BuildRequires:  readline-devel
47 BuildRequires:  xz-devel
48 BuildRequires:  zlib-devel
49 %endif
50 ExclusiveArch:  %{ix86} %{x8664} x32 alpha arm ia64 ppc64 s390 s390x
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
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\
84 %requires_releq_kernel\
85 Requires(postun):       %releq_kernel\
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
116 %{?with_kernel:%{expand:%create_kernel_packages}}
117
118 %prep
119 %setup -q -a1 -a2 -n %{pname}-%{version}
120 %patch0 -p1
121 %patch1 -p1
122
123 %{__mv} eppic extensions
124
125 %build
126 %{?with_kernel:%{expand:%build_kernel_packages}}
127
128 %if %{with userspace}
129 export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses"
130 %{__make} \
131         ARCH="%{_target_cpu}" \
132         CC="%{__cc}" \
133         CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
134
135 %{__make} -j1 extensions \
136         ARCH="%{_target_cpu}" \
137         CC="%{__cc}" \
138         CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143
144 %if %{with kernel}
145 install -d $RPM_BUILD_ROOT
146 cp -a installed/* $RPM_BUILD_ROOT
147 %endif
148
149 %if %{with userspace}
150 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash}
151
152 %{__make} install \
153         DESTDIR=$RPM_BUILD_ROOT
154
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
159 %endif
160
161 %clean
162 rm -rf $RPM_BUILD_ROOT
163
164 %if %{with userspace}
165 %files
166 %defattr(644,root,root,755)
167 %doc README
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*
176
177 %files devel
178 %defattr(644,root,root,755)
179 %{_includedir}/crash
180 %endif
This page took 0.103275 seconds and 4 git commands to generate.