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