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
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
15 %undefine with_libunwind
20 Summary: Assortment of tools for the Linux kernel
21 Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa
23 Version: %{basever}%{postver}
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
36 URL: http://www.kernel.org/
38 BuildRequires: gcc-multilib-32
39 BuildRequires: gcc-multilib-x32
41 BuildRequires: gettext-tools
42 BuildRequires: pciutils-devel
43 BuildRequires: rpmbuild(macros) >= 1.647
44 BuildRequires: tar >= 1:1.22
47 BuildRequires: asciidoc
48 BuildRequires: audit-libs-devel
49 BuildRequires: binutils-devel
51 BuildRequires: docbook-dtd45-xml
52 BuildRequires: docbook-style-xsl
53 BuildRequires: elfutils-devel
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
63 BuildRequires: gtk+2-devel >= 2.0
64 BuildRequires: pkgconfig
67 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 # otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
70 %define _enable_debug_packages 0
72 %define makeopts CC="%{__cc}" %{?with_verbose:V=1}
75 This package contains the software from tools/ subdirectory from Linux
76 kernel source and the supporting documentation.
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ę.
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: cpupowerutils = 1:009-0.6.p1
90 Obsoletes: cpupowerutils < 1:009-0.6.p1
91 Obsoletes: cpuspeed < 1:1.5-16
94 cpupower is a collection of tools to examine and tune power saving
95 related features of your processor.
97 %description cpupower -l pl.UTF-8
98 cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
99 związanych z oszczędzaniem energii.
101 %package cpupower-libs
102 Summary: cpupower library
103 Summary(pl.UTF-8): Biblioteka cpupower
106 %description cpupower-libs
109 %description cpupower-libs -l pl.UTF-8
112 %package cpupower-libs-devel
113 Summary: Development files for the cpupower library
114 Summary(pl.UTF-8): Pliki programistyczne biblioteki cpupower
115 Group: Development/Libraries
116 Requires: %{name} = %{version}-%{release}
117 Requires: %{name}-cpupower-libs = %{version}-%{release}
118 Provides: cpupowerutils-devel = 1:009-0.6.p1
119 Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
121 %description cpupower-libs-devel
122 Development files for the cpupower library.
124 %description cpupower-libs-devel -l pl.UTF-8
125 Pliki programistyczne biblioteki cpupower.
128 Summary: perf profiler tool
129 Summary(pl.UTF-8): Narzędzie profilujące perf
130 Group: Applications/System
133 Obsoletes: perf-slang
136 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
137 away CPU hardware differences in Linux performance measurements and
138 presents a simple commandline interface. Perf is based on the
139 perf_events interface exported by recent versions of the Linux kernel.
141 This package contains core files, scripts and text interface (TUI).
143 %description perf -l pl.UTF-8
144 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
145 odseparowujące od różnic sprzętowych między pomiarami wydajności w
146 zależności od procesora oraz udostępniające prosty interfejs linii
147 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
148 przez nowe wersje jądra Linuksa.
150 Ten pakiet zawiera podstawowe pliki, skrypty oraz interfejs tekstowy
154 Summary: perf profiler tool - VDSO 32-bit ABI reader
155 Summary(pl.UTF-8): Narzędzie profilujące perf - odczyt VDSO dla ABI 32-bitowego
156 Group: Applications/System
157 Requires: %{name}-perf = %{version}-%{release}
159 %description perf-vdso32
160 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
161 away CPU hardware differences in Linux performance measurements and
162 presents a simple commandline interface. Perf is based on the
163 perf_events interface exported by recent versions of the Linux kernel.
165 This package contains perf-read-vdso32 tool for reading the 32-bit
166 compatibility VDSO in 64-bit mode.
168 %description perf-vdso32 -l pl.UTF-8
169 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
170 odseparowujące od różnic sprzętowych między pomiarami wydajności w
171 zależności od procesora oraz udostępniające prosty interfejs linii
172 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
173 przez nowe wersje jądra Linuksa.
175 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
176 binariów 32-bitowych w trybie 64-bitowym.
178 %package perf-vdsox32
179 Summary: perf profiler tool - VDSO x32 ABI reader
180 Summary(pl.UTF-8): Narzędzie profilujące perf - odczyt VDSO dla ABI x32
181 Group: Applications/System
182 Requires: %{name}-perf = %{version}-%{release}
184 %description perf-vdsox32
185 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
186 away CPU hardware differences in Linux performance measurements and
187 presents a simple commandline interface. Perf is based on the
188 perf_events interface exported by recent versions of the Linux kernel.
190 This package contains perf-read-vdso32 tool for reading the x32 mode
191 32-bit compatibility VDSO in 64-bit mode.
193 %description perf-vdsox32 -l pl.UTF-8
194 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
195 odseparowujące od różnic sprzętowych między pomiarami wydajności w
196 zależności od procesora oraz udostępniające prosty interfejs linii
197 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
198 przez nowe wersje jądra Linuksa.
200 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
201 binariów ABI x32 w trybie 64-bitowym.
204 Summary: perf profiler tool (GTK+ 2 GUI)
205 Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+ 2)
206 Group: X11/Applications
207 Requires: %{name}-perf = %{version}-%{release}
209 %description perf-gtk
210 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
211 away CPU hardware differences in Linux performance measurements and
212 presents a simple commandline interface. Perf is based on the
213 perf_events interface exported by recent versions of the Linux kernel.
215 This package contains GTK+ 2 based GUI.
217 %description perf-gtk -l pl.UTF-8
218 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
219 odseparowujące od różnic sprzętowych między pomiarami wydajności w
220 zależności od procesora oraz udostępniające prosty interfejs linii
221 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
222 przez nowe wersje jądra Linuksa.
224 Ten pakiet zawiera graficzny interfejs oparty na GTK+ 2.
226 %package -n bash-completion-perf
227 Summary: Bash completion for perf command
228 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
229 Group: Applications/Shells
230 Requires: %{name}-perf
231 Requires: bash-completion
232 %if "%{_rpmversion}" >= "5"
236 %description -n bash-completion-perf
237 Bash completion for perf command.
239 %description -n bash-completion-perf -l pl.UTF-8
240 Bashowe uzupełnianie parametrów dla polecenia perf.
246 %if "%{postver}" != ".0"
252 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
257 # Simple Disk Sleep Monitor
258 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
261 %{__make} -C tools/power/cpupower \
263 CPUFREQ_BENCH=false \
264 OPTIMIZATION="%{rpmcflags}" \
268 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
270 CFLAGS="%{rpmcflags}"
274 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
276 CFLAGS="%{rpmcflags}"
279 %ifarch %{ix86} %{x8664} x32
280 %{__make} -C tools/power/x86/x86_energy_perf_policy \
282 CFLAGS="%{rpmcflags}"
283 CFLAGS="%{rpmcflags}" \
284 %{__make} -C tools/power/x86/turbostat \
288 # page-types, slabinfo
289 %{__make} -C tools/vm page-types slabinfo \
291 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
294 %{__make} -C tools/perf all man \
298 %{!?with_gtk:NO_GTK2=1} \
299 %{!?with_libunwind:NO_LIBUNWIND=1} \
301 CFLAGS_OPTIMIZE="%{rpmcflags}" \
304 perfexecdir=%{_datadir}/perf-core \
306 template_dir=%{_datadir}/perf-core/templates
310 %{__make} -C usr gen_init_cpio \
312 CFLAGS="%{rpmcflags}"
315 rm -rf $RPM_BUILD_ROOT
318 install -d $RPM_BUILD_ROOT%{_sbindir}
320 %{__make} -C tools/power/cpupower install \
321 DESTDIR=$RPM_BUILD_ROOT \
329 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
330 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
331 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
334 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
337 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
340 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
341 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
342 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
344 %ifarch %{ix86} %{x8664} x32
345 install -d $RPM_BUILD_ROOT%{_mandir}/man8
347 -C tools/power/x86/x86_energy_perf_policy \
348 DESTDIR=$RPM_BUILD_ROOT
351 -C tools/power/x86/turbostat \
352 DESTDIR=$RPM_BUILD_ROOT
356 %{__make} -j1 install install-man \
361 %{!?with_gtk:NO_GTK2=1} \
362 %{!?with_libunwind:NO_LIBUNWIND=1} \
364 CFLAGS_OPTIMIZE="%{rpmcflags}" \
366 %{?with_verbose:V=1} \
368 perfexecdir=%{_datadir}/perf-core \
369 template_dir=%{_datadir}/perf-core/templates \
371 DESTDIR=$RPM_BUILD_ROOT
373 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
374 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
376 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
380 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
383 rm -rf $RPM_BUILD_ROOT
385 %post cpupower-libs -p /sbin/ldconfig
386 %postun cpupower-libs -p /sbin/ldconfig
389 %systemd_post cpupower.service
392 %systemd_preun cpupower.service
398 %defattr(644,root,root,755)
399 %attr(755,root,root) %{_bindir}/gen_init_cpio
400 %attr(755,root,root) %{_bindir}/slabinfo
401 %attr(755,root,root) %{_sbindir}/dslm
402 %attr(755,root,root) %{_sbindir}/page-types
403 %ifarch %{ix86} %{x8664} x32
404 %attr(755,root,root) %{_bindir}/centrino-decode
405 %attr(755,root,root) %{_bindir}/powernow-k8-decode
407 %ifarch %{ix86} %{x8664} x32
408 %attr(755,root,root) %{_bindir}/turbostat
409 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
410 %{_mandir}/man8/turbostat.8*
411 %{_mandir}/man8/x86_energy_perf_policy.8*
414 %files cpupower -f cpupower.lang
415 %defattr(644,root,root,755)
416 %attr(755,root,root) %{_bindir}/cpupower
417 %{_mandir}/man1/cpupower*.1*
418 %{systemdunitdir}/cpupower.service
419 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
424 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
426 %files cpupower-libs-devel
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_libdir}/libcpupower.so
429 %{_includedir}/cpufreq.h
433 %defattr(644,root,root,755)
434 %attr(755,root,root) %{_bindir}/perf
435 %attr(755,root,root) %{_bindir}/trace
436 %{_mandir}/man1/perf*.1*
437 %dir %{_datadir}/perf-core
438 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
439 %attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
441 %dir %{_datadir}/perf-core/scripts
443 %dir %{_datadir}/perf-core/scripts/perl
444 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
445 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
446 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
447 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
448 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
449 %dir %{_datadir}/perf-core/scripts/perl/bin
450 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
451 %{_datadir}/perf-core/scripts/perl/*.pl
453 %dir %{_datadir}/perf-core/scripts/python
454 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
455 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
456 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
457 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
458 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
459 %dir %{_datadir}/perf-core/scripts/python/bin
460 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
461 %{_datadir}/perf-core/scripts/python/*.py*
463 %dir %{_libdir}/traceevent
464 %dir %{_libdir}/traceevent/plugins
465 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{_bindir}/perf-read-vdso32
473 %defattr(644,root,root,755)
474 %attr(755,root,root) %{_bindir}/perf-read-vdsox32
479 %defattr(644,root,root,755)
480 %attr(755,root,root) %{_libdir}/libperf-gtk.so
483 %files -n bash-completion-perf
484 %defattr(644,root,root,755)
485 /etc/bash_completion.d/perf