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