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: 58b35794eee3b6d52ce7be39357801e7
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: 3a465c7cf55ec9dbf2d72d9292aa5fde
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
120 Conflicts: cpufrequtils-devel
122 %description cpupower-libs-devel
123 Development files for the cpupower library.
125 %description cpupower-libs-devel -l pl.UTF-8
126 Pliki programistyczne biblioteki cpupower.
129 Summary: perf profiler tool
130 Summary(pl.UTF-8): Narzędzie profilujące perf
131 Group: Applications/System
134 Obsoletes: perf-slang
137 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
138 away CPU hardware differences in Linux performance measurements and
139 presents a simple commandline interface. Perf is based on the
140 perf_events interface exported by recent versions of the Linux kernel.
142 This package contains core files, scripts and text interface (TUI).
144 %description perf -l pl.UTF-8
145 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
146 odseparowujące od różnic sprzętowych między pomiarami wydajności w
147 zależności od procesora oraz udostępniające prosty interfejs linii
148 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
149 przez nowe wersje jądra Linuksa.
151 Ten pakiet zawiera podstawowe pliki, skrypty oraz interfejs tekstowy
155 Summary: perf profiler tool - VDSO 32-bit ABI reader
156 Summary(pl.UTF-8): Narzędzie profilujące perf - odczyt VDSO dla ABI 32-bitowego
157 Group: Applications/System
158 Requires: %{name}-perf = %{version}-%{release}
160 %description perf-vdso32
161 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
162 away CPU hardware differences in Linux performance measurements and
163 presents a simple commandline interface. Perf is based on the
164 perf_events interface exported by recent versions of the Linux kernel.
166 This package contains perf-read-vdso32 tool for reading the 32-bit
167 compatibility VDSO in 64-bit mode.
169 %description perf-vdso32 -l pl.UTF-8
170 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
171 odseparowujące od różnic sprzętowych między pomiarami wydajności w
172 zależności od procesora oraz udostępniające prosty interfejs linii
173 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
174 przez nowe wersje jądra Linuksa.
176 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
177 binariów 32-bitowych w trybie 64-bitowym.
179 %package perf-vdsox32
180 Summary: perf profiler tool - VDSO x32 ABI reader
181 Summary(pl.UTF-8): Narzędzie profilujące perf - odczyt VDSO dla ABI x32
182 Group: Applications/System
183 Requires: %{name}-perf = %{version}-%{release}
185 %description perf-vdsox32
186 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
187 away CPU hardware differences in Linux performance measurements and
188 presents a simple commandline interface. Perf is based on the
189 perf_events interface exported by recent versions of the Linux kernel.
191 This package contains perf-read-vdso32 tool for reading the x32 mode
192 32-bit compatibility VDSO in 64-bit mode.
194 %description perf-vdsox32 -l pl.UTF-8
195 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
196 odseparowujące od różnic sprzętowych między pomiarami wydajności w
197 zależności od procesora oraz udostępniające prosty interfejs linii
198 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
199 przez nowe wersje jądra Linuksa.
201 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
202 binariów ABI x32 w trybie 64-bitowym.
205 Summary: perf profiler tool (GTK+ 2 GUI)
206 Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+ 2)
207 Group: X11/Applications
208 Requires: %{name}-perf = %{version}-%{release}
210 %description perf-gtk
211 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
212 away CPU hardware differences in Linux performance measurements and
213 presents a simple commandline interface. Perf is based on the
214 perf_events interface exported by recent versions of the Linux kernel.
216 This package contains GTK+ 2 based GUI.
218 %description perf-gtk -l pl.UTF-8
219 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
220 odseparowujące od różnic sprzętowych między pomiarami wydajności w
221 zależności od procesora oraz udostępniające prosty interfejs linii
222 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
223 przez nowe wersje jądra Linuksa.
225 Ten pakiet zawiera graficzny interfejs oparty na GTK+ 2.
227 %package -n bash-completion-perf
228 Summary: Bash completion for perf command
229 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
230 Group: Applications/Shells
231 Requires: %{name}-perf
232 Requires: bash-completion
233 %if "%{_rpmversion}" >= "5"
237 %description -n bash-completion-perf
238 Bash completion for perf command.
240 %description -n bash-completion-perf -l pl.UTF-8
241 Bashowe uzupełnianie parametrów dla polecenia perf.
247 %if "%{postver}" != ".0"
253 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
258 # Simple Disk Sleep Monitor
259 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
262 %{__make} -C tools/power/cpupower \
264 CPUFREQ_BENCH=false \
265 OPTIMIZATION="%{rpmcflags}" \
269 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
271 CFLAGS="%{rpmcflags}"
275 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
277 CFLAGS="%{rpmcflags}"
280 %ifarch %{ix86} %{x8664} x32
281 %{__make} -C tools/power/x86/x86_energy_perf_policy \
283 CFLAGS="%{rpmcflags}"
284 CFLAGS="%{rpmcflags}" \
285 %{__make} -C tools/power/x86/turbostat \
289 # page-types, slabinfo
290 %{__make} -C tools/vm page-types slabinfo \
292 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
295 %{__make} -C tools/perf all man \
299 %{!?with_gtk:NO_GTK2=1} \
300 %{!?with_libunwind:NO_LIBUNWIND=1} \
302 CFLAGS_OPTIMIZE="%{rpmcflags}" \
305 perfexecdir=%{_datadir}/perf-core \
307 template_dir=%{_datadir}/perf-core/templates
311 %{__make} -C usr gen_init_cpio \
313 CFLAGS="%{rpmcflags}"
316 rm -rf $RPM_BUILD_ROOT
319 install -d $RPM_BUILD_ROOT%{_sbindir}
321 %{__make} -C tools/power/cpupower install \
322 DESTDIR=$RPM_BUILD_ROOT \
330 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
331 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
332 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
335 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
338 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
341 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
342 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
343 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
345 %ifarch %{ix86} %{x8664} x32
346 install -d $RPM_BUILD_ROOT%{_mandir}/man8
348 -C tools/power/x86/x86_energy_perf_policy \
349 DESTDIR=$RPM_BUILD_ROOT
352 -C tools/power/x86/turbostat \
353 DESTDIR=$RPM_BUILD_ROOT
357 %{__make} -j1 install install-man \
362 %{!?with_gtk:NO_GTK2=1} \
363 %{!?with_libunwind:NO_LIBUNWIND=1} \
365 CFLAGS_OPTIMIZE="%{rpmcflags}" \
367 %{?with_verbose:V=1} \
369 perfexecdir=%{_datadir}/perf-core \
370 template_dir=%{_datadir}/perf-core/templates \
372 DESTDIR=$RPM_BUILD_ROOT
374 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
375 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
377 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
381 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
384 rm -rf $RPM_BUILD_ROOT
386 %post cpupower-libs -p /sbin/ldconfig
387 %postun cpupower-libs -p /sbin/ldconfig
390 %systemd_post cpupower.service
393 %systemd_preun cpupower.service
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
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*
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
423 %defattr(644,root,root,755)
424 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
425 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
427 %files cpupower-libs-devel
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{_libdir}/libcpupower.so
430 %{_includedir}/cpufreq.h
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
442 %dir %{_datadir}/perf-core/scripts
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
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*
464 %dir %{_libdir}/traceevent
465 %dir %{_libdir}/traceevent/plugins
466 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
470 %defattr(644,root,root,755)
471 %attr(755,root,root) %{_bindir}/perf-read-vdso32
474 %defattr(644,root,root,755)
475 %attr(755,root,root) %{_bindir}/perf-read-vdsox32
480 %defattr(644,root,root,755)
481 %attr(755,root,root) %{_libdir}/libperf-gtk.so
484 %files -n bash-completion-perf
485 %defattr(644,root,root,755)
486 /etc/bash_completion.d/perf