]> git.pld-linux.org Git - packages/crash.git/blob - crash.spec
- updated to 7.1.8
[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:        7.1.8
29 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
30 License:        GPL v2+
31 Group:          Libraries
32 Source0:        http://people.redhat.com/anderson/%{pname}-%{version}.tar.gz
33 # Source0-md5:  daf5fb52567cfcac99d3a5890edbc707
34 # git clone https://code.google.com/p/eppic
35 Source1:        eppic.tar.xz
36 # Source1-md5:  a9f80ad71de9d6f5b77534a7ebdbed8e
37 Patch0:         %{pname}-x32.patch
38 Patch1:         gdb-glibc.patch
39 URL:            http://people.redhat.com/anderson/
40 BuildRequires:  rpmbuild(macros) >= 1.701
41 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
42 %if %{with userspace}
43 BuildRequires:  ncurses-devel
44 BuildRequires:  readline-devel
45 BuildRequires:  xz-devel
46 BuildRequires:  zlib-devel
47 %endif
48 ExclusiveArch:  %{ix86} %{x8664} x32 alpha arm ia64 ppc64 s390 s390x
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 The core analysis suite is a self-contained tool that can be used to
53 investigate either live systems, kernel core dumps created from the
54 netdump and diskdump packages offered by Red Hat, the LKCD kernel
55 patch or the mcore kernel patch available from Mission Critical Linux.
56
57 %description -l pl.UTF-8
58 Narzędzie do analizy zrzutów pamięci to samodzielny program służący do
59 badania systemów działających, zrzutów pamięci jądra utworzonych przez
60 pakiety Red Hata netdump lub diskdump, łatę jądra LKCD lub łatę jądra
61 mcore dostępną w Mission Critical Linuksie.
62
63 %package devel
64 Summary:        Header files for core analysis suite
65 Summary(pl.UTF-8):      Plik nagłówkowy narzędzia do analizy zrzutów pamięci
66 Group:          Development/Libraries
67 # doesn't require base
68
69 %description devel
70 Header files for core analysis suite.
71
72 %description devel -l pl.UTF-8
73 Plik nagłówkowy narzędzia do analizy zrzutów pamięci.
74
75 %define kernel_pkg()\
76 %package -n kernel%{_alt_kernel}-char-crash\
77 Summary:        Memory driver for live system crash sessions\
78 Summary(pl.UTF-8):      Sterownik pamięci dla sesji crash na żywym systemie\
79 Release:        %{rel}@%{_kernel_ver_str}\
80 Group:          Base/Kernel\
81 Requires(post,postun):  /sbin/depmod\
82 %requires_releq_kernel\
83 Requires(postun):       %releq_kernel\
84 \
85 %description -n kernel%{_alt_kernel}-char-crash\
86 This package contains /dev/crash memory driver for live system crash\
87 sessions, which may be used when /dev/mem and /proc/kcore are\
88 unavailable.\
89 \
90 %description -n kernel%{_alt_kernel}-char-crash -l pl.UTF-8\
91 Ten pakiet zawiera sterownik pamięci /dev/crash do sesji crash na\
92 żywym systemie. Może być używany do analizy, kiedy /dev/mem i\
93 /proc/kcore nie są dostępne.\
94 \
95 %if %{with kernel}\
96 %files -n kernel%{_alt_kernel}-char-crash\
97 %defattr(644,root,root,755)\
98 %doc memory_driver/README\
99 /lib/modules/%{_kernel_ver}/kernel/drivers/char/crash.ko*\
100 %endif\
101 \
102 %post   -n kernel%{_alt_kernel}-char-crash\
103 %depmod %{_kernel_ver}\
104 \
105 %postun -n kernel%{_alt_kernel}-char-crash\
106 %depmod %{_kernel_ver}\
107 %{nil}
108
109 %define build_kernel_pkg()\
110 %build_kernel_modules -C memory_driver -m crash\
111 %install_kernel_modules -D installed -m memory_driver/crash -d kernel/drivers/char\
112 %{nil}
113
114 %{?with_kernel:%{expand:%create_kernel_packages}}
115
116 %prep
117 %setup -q -a1 -n %{pname}-%{version}
118 %patch0 -p1
119 # apply after unpacking gdb-7.6
120 cat %{PATCH1} >> gdb-7.6.patch
121
122 %{__mv} eppic extensions
123
124 %build
125 %{?with_kernel:%{expand:%build_kernel_packages}}
126
127 %if %{with userspace}
128 export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses"
129 %{__make} -j1 all extensions \
130         ARCH="%{_target_cpu}" \
131         CC="%{__cc}" \
132         CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
133 %endif
134
135 %install
136 rm -rf $RPM_BUILD_ROOT
137
138 %if %{with kernel}
139 install -d $RPM_BUILD_ROOT
140 cp -a installed/* $RPM_BUILD_ROOT
141 %endif
142
143 %if %{with userspace}
144 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash}
145
146 %{__make} install \
147         DESTDIR=$RPM_BUILD_ROOT
148
149 # omitted by make install
150 install extensions/*.so $RPM_BUILD_ROOT%{_libdir}/crash/extensions
151 cp -p crash.8 $RPM_BUILD_ROOT%{_mandir}/man8
152 cp -p defs.h $RPM_BUILD_ROOT%{_includedir}/crash
153 %endif
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %if %{with userspace}
159 %files
160 %defattr(644,root,root,755)
161 %doc README
162 %attr(755,root,root) %{_bindir}/crash
163 %dir %{_libdir}/crash
164 %dir %{_libdir}/crash/extensions
165 %attr(755,root,root) %{_libdir}/crash/extensions/dminfo.so
166 %attr(755,root,root) %{_libdir}/crash/extensions/echo.so
167 %attr(755,root,root) %{_libdir}/crash/extensions/eppic.so
168 %attr(755,root,root) %{_libdir}/crash/extensions/snap.so
169 %attr(755,root,root) %{_libdir}/crash/extensions/trace.so
170 %{_mandir}/man8/crash.8*
171
172 %files devel
173 %defattr(644,root,root,755)
174 %{_includedir}/crash
175 %endif
This page took 0.042867 seconds and 3 git commands to generate.