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