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