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