]> git.pld-linux.org Git - packages/kernel-tools.git/blob - kernel-tools.spec
- package slabinfo
[packages/kernel-tools.git] / kernel-tools.spec
1 # TODO
2 # - optflags
3
4 #
5 # Conditional build:
6 %bcond_without  verbose         # verbose build (V=1)
7 %bcond_without  perf            # perf tools
8
9 %define         rel             0.5
10 %define         basever 3.7
11 %define         postver .1
12 Summary:        Assortment of tools for the Linux kernel
13 Summary(pl.UTF-8):      Zestaw narzędzi dla jądra Linuksa
14 Name:           kernel-tools
15 Version:        %{basever}%{postver}
16 Release:        %{rel}
17 License:        GPL v2
18 Group:          Applications/System
19 Source0:        http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
20 # Source0-md5:  21223369d682bcf44bcdfe1521095983
21 %if "%{postver}" != ".0"
22 Patch0:         http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
23 # Patch0-md5:   c391dc1a1b4dae81aaef6f08a0594813
24 %endif
25 Source1:        cpupower.service
26 Source2:        cpupower.config
27 URL:            http://www.kernel.org/
28 BuildRequires:  rpmbuild(macros) >= 1.647
29 BuildRequires:  tar >= 1:1.22
30 BuildRequires:  xz
31 %if %{with perf}
32 BuildRequires:  asciidoc
33 BuildRequires:  audit-libs-devel
34 BuildRequires:  binutils-devel
35 BuildRequires:  bison
36 BuildRequires:  docbook-style-xsl
37 BuildRequires:  elfutils-devel
38 BuildRequires:  flex
39 BuildRequires:  gtk+2-devel >= 2.0
40 BuildRequires:  libunwind-devel >= 0.99
41 BuildRequires:  newt-devel
42 BuildRequires:  perl-devel >= 5.1
43 BuildRequires:  pkgconfig
44 BuildRequires:  python-devel
45 BuildRequires:  rpm-pythonprov
46 BuildRequires:  slang-devel
47 BuildRequires:  xmlto
48 %endif
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %define         makeopts        CC="%{__cc}" %{?with_verbose:V=1}
52
53 %description
54 This package contains the software from tools/ subdirectory from Linux
55 kernel source and the supporting documentation.
56
57 %description -l pl.UTF-8
58 Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
59 Linuksa oraz związaną z nim dokumentację.
60
61 %package cpupower
62 Summary:        cpupower - Shows and sets processor power related values
63 Summary(pl.UTF-8):      cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
64 Group:          Applications/System
65 Requires(post,preun,postun):    systemd-units >= 38
66 Requires:       systemd-units >= 0.38
67 Provides:       cpufreq-utils = 1:009-0.6.p1
68 Provides:       cpufrequtils = 1:009-0.6.p1
69 Provides:       cpupowerutils = 1:009-0.6.p1
70 Obsoletes:      cpufreq-utils < 1:009-0.6.p1
71 Obsoletes:      cpufrequtils < 1:009-0.6.p1
72 Obsoletes:      cpupowerutils < 1:009-0.6.p1
73 Obsoletes:      cpuspeed < 1:1.5-16
74 Requires:       %{name}-cpupower-libs = %{version}-%{release}
75
76 %description cpupower
77 cpupower is a collection of tools to examine and tune power saving
78 related features of your processor.
79
80 %description cpupower -l pl.UTF-8
81 cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
82 związanych z oszczędzaniem energii.
83
84 %package cpupower-libs
85 Summary:        cpupower library
86 Summary(pl.UTF-8):      Biblioteka cpupower
87 Group:          Libraries
88
89 %description cpupower-libs
90 cpupower library.
91
92 %description cpupower-libs -l pl.UTF-8
93 Biblioteka cpupower.
94
95 %package cpupower-libs-devel
96 Summary:        Development files for the cpupower library
97 Summary(pl.UTF-8):      Pliki programistyczne biblioteki cpupower
98 Group:          Development/Libraries
99 Requires:       %{name} = %{version}-%{release}
100 Requires:       %{name}-cpupower-libs = %{version}-%{release}
101 Provides:       cpupowerutils-devel = 1:009-0.6.p1
102 Obsoletes:      cpupowerutils-devel < 1:009-0.6.p1
103
104 %description cpupower-libs-devel
105 Development files for the cpupower library.
106
107 %description cpupower-libs-devel -l pl.UTF-8
108 Pliki programistyczne biblioteki cpupower.
109
110 %package perf-core
111 Summary:        perf profiler tool (core package)
112 Summary(pl.UTF-8):      Narzędzie profilujące perf (podstawowe narzędzia)
113 Group:          Applications/System
114
115 %description perf-core
116 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
117 away CPU hardware differences in Linux performance measurements and
118 presents a simple commandline interface. Perf is based on the
119 perf_events interface exported by recent versions of the Linux kernel.
120
121 This package contains core files and scripts.
122
123 %description perf-core -l pl.UTF-8
124 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
125 odseparowujące od różnic sprzętowych między pomiarami wydajności w
126 zależności od procesora oraz udostępniające prosty interfejs linii
127 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
128 przez nowe wersje jądra Linuksa.
129
130 Ten pakiet zawiera podstawowe pliki i skrypty.
131
132 %package perf-gtk
133 Summary:        perf profiler tool (GTK+ GUI)
134 Summary(pl.UTF-8):      Narzędzie profilujące perf (interfejs graficzny GTK+)
135 Group:          X11/Applications
136 Requires:       %{name}-perf-core = %{version}-%{release}
137 Provides:       %{name}-perf = %{version}-%{release}
138
139 %description perf-gtk
140 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
141 away CPU hardware differences in Linux performance measurements and
142 presents a simple commandline interface. Perf is based on the
143 perf_events interface exported by recent versions of the Linux kernel.
144
145 This package contains GTK+ based GUI.
146
147 %description perf-gtk -l pl.UTF-8
148 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
149 odseparowujące od różnic sprzętowych między pomiarami wydajności w
150 zależności od procesora oraz udostępniające prosty interfejs linii
151 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
152 przez nowe wersje jądra Linuksa.
153
154 Ten pakiet zawiera graficzny interfejs oparty na GTK+.
155
156 %package perf-slang
157 Summary:        perf profiler tool (Slang TUI)
158 Summary(pl.UTF-8):      Narzędzie profilujące perf (interfejs tekstowy Slang)
159 Group:          X11/Applications
160 Requires:       %{name}-perf-core = %{version}-%{release}
161 Provides:       %{name}-perf = %{version}-%{release}
162
163 %description perf-slang
164 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
165 away CPU hardware differences in Linux performance measurements and
166 presents a simple commandline interface. Perf is based on the
167 perf_events interface exported by recent versions of the Linux kernel.
168
169 This package contains Slang based TUI.
170
171 %description perf-slang -l pl.UTF-8
172 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
173 odseparowujące od różnic sprzętowych między pomiarami wydajności w
174 zależności od procesora oraz udostępniające prosty interfejs linii
175 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
176 przez nowe wersje jądra Linuksa.
177
178 Ten pakiet zawiera tekstowy interfejs oparty na bibliotece Slang.
179
180 %package -n bash-completion-perf
181 Summary:        Bash completion for perf command
182 Summary(pl.UTF-8):      Bashowe uzupełnianie parametrów dla polecenia perf
183 Group:          Applications/Shells
184 Requires:       %{name}-perf = %{version}-%{release}
185 Requires:       bash-completion
186
187 %description -n bash-completion-perf
188 Bash completion for perf command.
189
190 %description -n bash-completion-perf -l pl.UTF-8
191 Bashowe uzupełnianie parametrów dla polecenia perf.
192
193 %prep
194 %setup -qc
195 cd linux-%{basever}
196
197 %if "%{postver}" != ".0"
198 %patch0 -p1
199 %endif
200
201 %build
202 cd linux-%{basever}
203
204 # cpupower
205 %{__make} -C tools/power/cpupower \
206         %{makeopts} \
207         CPUFREQ_BENCH=false
208
209 %ifarch %{ix86}
210 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
211         %{makeopts} \
212 %endif
213
214 %ifarch %{x8664}
215 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
216         %{makeopts}
217 %endif
218
219 %ifarch %{ix86} %{x8664}
220 %{__make} -C tools/power/x86/x86_energy_perf_policy \
221         %{makeopts}
222 %{__make} -C tools/power/x86/turbostat \
223         %{makeopts}
224 %endif
225
226 # slabinfo
227 %{__make} -C tools/vm \
228         CC="%{__cc}" \
229         CFLAGS="%{rpmcflags} -Wall -Wextra"
230
231 %if %{with perf}
232 # perf slang version
233 PWD=${PWD:-$(pwd)}
234 install -d $PWD/perf-{slang,gtk}
235 %{__make} -C tools/perf all man \
236         O=$PWD/perf-slang \
237         NO_GTK2=1 \
238         %{makeopts} \
239         prefix=%{_prefix} \
240         perfexecdir=%{_datadir}/perf-core \
241         template_dir=%{_datadir}/perf-core/templates
242
243 # perf gtk version
244 %{__make} -C tools/perf all man \
245         O=$PWD/perf-gtk \
246         %{makeopts} \
247         prefix=%{_prefix} \
248         perfexecdir=%{_datadir}/perf-core \
249         template_dir=%{_datadir}/perf-core/templates
250 %endif
251
252 # gen_init_cpio
253 %{__make} -C usr gen_init_cpio \
254         %{makeopts} \
255
256 %install
257 rm -rf $RPM_BUILD_ROOT
258 cd linux-%{basever}
259
260 %{__make} -C tools/power/cpupower install \
261         DESTDIR=$RPM_BUILD_ROOT \
262         libdir=%{_libdir} \
263         mandir=%{_mandir} \
264         CPUFREQ_BENCH=false
265
266 %find_lang cpupower
267 mv cpupower.lang ..
268
269 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
270 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
271 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
272
273 %ifarch %{ix86}
274 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
275 %endif
276 %ifarch %{x8664}
277 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
278 %endif
279
280 install tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
281
282 %ifarch %{ix86} %{x8664}
283 install -d $RPM_BUILD_ROOT%{_mandir}/man8
284 # broken makefile, install manually
285 %if 0
286 %{__make} install \
287         -C tools/power/x86/x86_energy_perf_policy \
288         DESTDIR=$RPM_BUILD_ROOT
289 %else
290 cd tools/power/x86/x86_energy_perf_policy
291 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
292 install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
293 cd -
294 %endif
295
296 # broken makefile, install manually
297 %if 0
298 %{__make} install \
299         -C tools/power/x86/turbostat \
300         DESTDIR=$RPM_BUILD_ROOT
301 %else
302 cd tools/power/x86/turbostat
303 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
304 install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
305 cd -
306 %endif
307 %endif
308
309 %if %{with perf}
310 # perf slang
311 PWD=${PWD:-$(pwd)}
312 # perf slang version
313 %{__make} -j1 install install-man \
314         -C tools/perf \
315         O=$PWD/perf-slang \
316         NO_GTK2=1 \
317         CC="%{__cc}" \
318         %{?with_verbose:V=1} \
319         prefix=%{_prefix} \
320         perfexecdir=%{_datadir}/perf-core \
321         template_dir=%{_datadir}/perf-core/templates \
322         DESTDIR=$RPM_BUILD_ROOT
323 %{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,-slang}
324
325 # perf gtk
326 %{__make} -j1 install install-man \
327         -C tools/perf \
328         O=$PWD/perf-gtk \
329         CC="%{__cc}" \
330         %{?with_verbose:V=1} \
331         prefix=%{_prefix} \
332         perfexecdir=%{_datadir}/perf-core \
333         template_dir=%{_datadir}/perf-core/templates \
334         DESTDIR=$RPM_BUILD_ROOT
335 %{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,-gtk}
336
337 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
338 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
339 %endif
340
341 # gen_init_cpio
342 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
343
344 %clean
345 rm -rf $RPM_BUILD_ROOT
346
347 %post   cpupower-libs -p /sbin/ldconfig
348 %postun cpupower-libs -p /sbin/ldconfig
349
350 %post cpupower
351 %systemd_post cpupower.service
352
353 %preun cpupower
354 %systemd_preun cpupower.service
355
356 %postun cpupower
357 %systemd_reload
358
359 %files
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_bindir}/gen_init_cpio
362 %attr(755,root,root) %{_bindir}/slabinfo
363 %ifarch %{ix86} %{x8664}
364 %attr(755,root,root) %{_bindir}/centrino-decode
365 %attr(755,root,root) %{_bindir}/powernow-k8-decode
366 %endif
367 %ifarch %{ix86} %{x8664}
368 %attr(755,root,root) %{_bindir}/turbostat
369 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
370 %{_mandir}/man8/turbostat.8*
371 %{_mandir}/man8/x86_energy_perf_policy.8*
372 %endif
373
374 %files cpupower -f cpupower.lang
375 %defattr(644,root,root,755)
376 %attr(755,root,root) %{_bindir}/cpupower
377 %{_mandir}/man1/cpupower*.1*
378 %{systemdunitdir}/cpupower.service
379 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
380
381 %files cpupower-libs
382 %defattr(644,root,root,755)
383 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
384 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
385
386 %files cpupower-libs-devel
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_libdir}/libcpupower.so
389 %{_includedir}/cpufreq.h
390
391 %if %{with perf}
392 %files perf-core
393 %defattr(644,root,root,755)
394 %{_mandir}/man1/perf*.1*
395 %dir %{_datadir}/perf-core
396 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
397
398 %dir %{_datadir}/perf-core/scripts
399
400 %dir %{_datadir}/perf-core/scripts/perl
401 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
402 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
403 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
404 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
405 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
406 %dir %{_datadir}/perf-core/scripts/perl/bin
407 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
408 %{_datadir}/perf-core/scripts/perl/*.pl
409
410 %dir %{_datadir}/perf-core/scripts/python
411 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
412 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
413 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
414 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
415 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
416 %dir %{_datadir}/perf-core/scripts/python/bin
417 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
418 %{_datadir}/perf-core/scripts/python/*.py*
419
420 %files perf-gtk
421 %defattr(644,root,root,755)
422 %attr(755,root,root) %{_bindir}/perf-gtk
423
424 %files perf-slang
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_bindir}/perf-slang
427
428 %files -n bash-completion-perf
429 %defattr(644,root,root,755)
430 /etc/bash_completion.d/perf
431 %endif
This page took 0.056032 seconds and 4 git commands to generate.