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: 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
98 cpupower is a collection of tools to examine and tune power saving
99 related features of your processor.
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.
105 %package cpupower-libs
106 Summary: cpupower library
107 Summary(pl.UTF-8): Biblioteka cpupower
110 %description cpupower-libs
113 %description cpupower-libs -l pl.UTF-8
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
127 %description cpupower-libs-devel
128 Development files for the cpupower library.
130 %description cpupower-libs-devel -l pl.UTF-8
131 Pliki programistyczne biblioteki cpupower.
134 Summary: perf profiler tool
135 Summary(pl.UTF-8): Narzędzie profilujące perf
136 Group: Applications/System
139 Obsoletes: perf-slang
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.
147 This package contains core files, scripts and text interface (TUI).
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.
156 Ten pakiet zawiera podstawowe pliki, skrypty oraz interfejs tekstowy
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}
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.
171 This package contains perf-read-vdso32 tool for reading the 32-bit
172 compatibility VDSO in 64-bit mode.
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.
181 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
182 binariów 32-bitowych w trybie 64-bitowym.
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}
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.
196 This package contains perf-read-vdso32 tool for reading the x32 mode
197 32-bit compatibility VDSO in 64-bit mode.
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.
206 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
207 binariów ABI x32 w trybie 64-bitowym.
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}
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.
221 This package contains GTK+ 2 based GUI.
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.
230 Ten pakiet zawiera graficzny interfejs oparty na GTK+ 2.
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"
242 %description -n bash-completion-perf
243 Bash completion for perf command.
245 %description -n bash-completion-perf -l pl.UTF-8
246 Bashowe uzupełnianie parametrów dla polecenia perf.
252 %if "%{postver}" != ".0"
258 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
263 # Simple Disk Sleep Monitor
264 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
267 %{__make} -C tools/power/cpupower \
269 CPUFREQ_BENCH=false \
270 OPTIMIZATION="%{rpmcflags}" \
274 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
276 CFLAGS="%{rpmcflags}"
280 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
282 CFLAGS="%{rpmcflags}"
285 %ifarch %{ix86} %{x8664} x32
286 %{__make} -C tools/power/x86/x86_energy_perf_policy \
288 CFLAGS="%{rpmcflags}"
289 CFLAGS="%{rpmcflags}" \
290 %{__make} -C tools/power/x86/turbostat \
294 # page-types, slabinfo
295 %{__make} -C tools/vm page-types slabinfo \
297 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
300 %{__make} -C tools/perf all man \
304 %{!?with_gtk:NO_GTK2=1} \
305 %{!?with_libunwind:NO_LIBUNWIND=1} \
307 CFLAGS_OPTIMIZE="%{rpmcflags}" \
310 perfexecdir=%{_datadir}/perf-core \
312 template_dir=%{_datadir}/perf-core/templates
316 %{__make} -C usr gen_init_cpio \
318 CFLAGS="%{rpmcflags}"
321 rm -rf $RPM_BUILD_ROOT
324 install -d $RPM_BUILD_ROOT%{_sbindir}
326 %{__make} -C tools/power/cpupower install \
327 DESTDIR=$RPM_BUILD_ROOT \
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
340 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
343 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
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}
350 %ifarch %{ix86} %{x8664} x32
351 install -d $RPM_BUILD_ROOT%{_mandir}/man8
353 -C tools/power/x86/x86_energy_perf_policy \
354 DESTDIR=$RPM_BUILD_ROOT
357 -C tools/power/x86/turbostat \
358 DESTDIR=$RPM_BUILD_ROOT
362 %{__make} -j1 install install-man \
367 %{!?with_gtk:NO_GTK2=1} \
368 %{!?with_libunwind:NO_LIBUNWIND=1} \
370 CFLAGS_OPTIMIZE="%{rpmcflags}" \
372 %{?with_verbose:V=1} \
374 perfexecdir=%{_datadir}/perf-core \
375 template_dir=%{_datadir}/perf-core/templates \
377 DESTDIR=$RPM_BUILD_ROOT
379 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
380 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
382 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
386 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
389 rm -rf $RPM_BUILD_ROOT
391 %post cpupower-libs -p /sbin/ldconfig
392 %postun cpupower-libs -p /sbin/ldconfig
395 %systemd_post cpupower.service
398 %systemd_preun cpupower.service
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
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*
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
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
430 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
432 %files cpupower-libs-devel
433 %defattr(644,root,root,755)
434 %attr(755,root,root) %{_libdir}/libcpupower.so
435 %{_includedir}/cpufreq.h
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
447 %dir %{_datadir}/perf-core/scripts
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
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*
469 %dir %{_libdir}/traceevent
470 %dir %{_libdir}/traceevent/plugins
471 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{_bindir}/perf-read-vdso32
479 %defattr(644,root,root,755)
480 %attr(755,root,root) %{_bindir}/perf-read-vdsox32
485 %defattr(644,root,root,755)
486 %attr(755,root,root) %{_libdir}/libperf-gtk.so
489 %files -n bash-completion-perf
490 %defattr(644,root,root,755)
491 /etc/bash_completion.d/perf