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