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