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
161 Summary(pl.UTF-8): Narzędzie profilujące perf
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 %package perf-vdsox32
175 Summary: perf profiler tool
176 Summary(pl.UTF-8): Narzędzie profilujące perf
177 Group: Applications/System
178 Requires: %{name}-perf = %{version}-%{release}
180 %description perf-vdsox32
181 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
182 away CPU hardware differences in Linux performance measurements and
183 presents a simple commandline interface. Perf is based on the
184 perf_events interface exported by recent versions of the Linux kernel.
186 This package contains perf-read-vdso32 tool for reading the x32 mode
187 32-bit compatibility VDSO in 64-bit mode.
190 Summary: perf profiler tool (GTK+ 2 GUI)
191 Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+ 2)
192 Group: X11/Applications
193 Requires: %{name}-perf = %{version}-%{release}
195 %description perf-gtk
196 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
197 away CPU hardware differences in Linux performance measurements and
198 presents a simple commandline interface. Perf is based on the
199 perf_events interface exported by recent versions of the Linux kernel.
201 This package contains GTK+ 2 based GUI.
203 %description perf-gtk -l pl.UTF-8
204 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
205 odseparowujące od różnic sprzętowych między pomiarami wydajności w
206 zależności od procesora oraz udostępniające prosty interfejs linii
207 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
208 przez nowe wersje jądra Linuksa.
210 Ten pakiet zawiera graficzny interfejs oparty na GTK+ 2.
212 %package -n bash-completion-perf
213 Summary: Bash completion for perf command
214 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
215 Group: Applications/Shells
216 Requires: %{name}-perf
217 Requires: bash-completion
218 %if "%{_rpmversion}" >= "5"
222 %description -n bash-completion-perf
223 Bash completion for perf command.
225 %description -n bash-completion-perf -l pl.UTF-8
226 Bashowe uzupełnianie parametrów dla polecenia perf.
232 %if "%{postver}" != ".0"
238 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
243 # Simple Disk Sleep Monitor
244 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
247 %{__make} -C tools/power/cpupower \
249 CPUFREQ_BENCH=false \
250 OPTIMIZATION="%{rpmcflags}" \
254 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
256 CFLAGS="%{rpmcflags}"
260 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
262 CFLAGS="%{rpmcflags}"
265 %ifarch %{ix86} %{x8664} x32
266 %{__make} -C tools/power/x86/x86_energy_perf_policy \
268 CFLAGS="%{rpmcflags}"
269 CFLAGS="%{rpmcflags}" \
270 %{__make} -C tools/power/x86/turbostat \
274 # page-types, slabinfo
275 %{__make} -C tools/vm page-types slabinfo \
277 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
280 %{__make} -C tools/perf all man \
284 %{!?with_gtk:NO_GTK2=1} \
285 %{!?with_libunwind:NO_LIBUNWIND=1} \
287 CFLAGS_OPTIMIZE="%{rpmcflags}" \
290 perfexecdir=%{_datadir}/perf-core \
292 template_dir=%{_datadir}/perf-core/templates
296 %{__make} -C usr gen_init_cpio \
298 CFLAGS="%{rpmcflags}"
301 rm -rf $RPM_BUILD_ROOT
304 install -d $RPM_BUILD_ROOT%{_sbindir}
306 %{__make} -C tools/power/cpupower install \
307 DESTDIR=$RPM_BUILD_ROOT \
315 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
316 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
317 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
320 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
323 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
326 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
327 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
328 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
330 %ifarch %{ix86} %{x8664} x32
331 install -d $RPM_BUILD_ROOT%{_mandir}/man8
333 -C tools/power/x86/x86_energy_perf_policy \
334 DESTDIR=$RPM_BUILD_ROOT
337 -C tools/power/x86/turbostat \
338 DESTDIR=$RPM_BUILD_ROOT
342 %{__make} -j1 install install-man \
347 %{!?with_gtk:NO_GTK2=1} \
348 %{!?with_libunwind:NO_LIBUNWIND=1} \
350 CFLAGS_OPTIMIZE="%{rpmcflags}" \
352 %{?with_verbose:V=1} \
354 perfexecdir=%{_datadir}/perf-core \
355 template_dir=%{_datadir}/perf-core/templates \
357 DESTDIR=$RPM_BUILD_ROOT
359 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
360 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
362 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
366 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
369 rm -rf $RPM_BUILD_ROOT
371 %post cpupower-libs -p /sbin/ldconfig
372 %postun cpupower-libs -p /sbin/ldconfig
375 %systemd_post cpupower.service
378 %systemd_preun cpupower.service
384 %defattr(644,root,root,755)
385 %attr(755,root,root) %{_bindir}/gen_init_cpio
386 %attr(755,root,root) %{_bindir}/slabinfo
387 %attr(755,root,root) %{_sbindir}/dslm
388 %attr(755,root,root) %{_sbindir}/page-types
389 %ifarch %{ix86} %{x8664} x32
390 %attr(755,root,root) %{_bindir}/centrino-decode
391 %attr(755,root,root) %{_bindir}/powernow-k8-decode
393 %ifarch %{ix86} %{x8664} x32
394 %attr(755,root,root) %{_bindir}/turbostat
395 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
396 %{_mandir}/man8/turbostat.8*
397 %{_mandir}/man8/x86_energy_perf_policy.8*
400 %files cpupower -f cpupower.lang
401 %defattr(644,root,root,755)
402 %attr(755,root,root) %{_bindir}/cpupower
403 %{_mandir}/man1/cpupower*.1*
404 %{systemdunitdir}/cpupower.service
405 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
408 %defattr(644,root,root,755)
409 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
410 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
412 %files cpupower-libs-devel
413 %defattr(644,root,root,755)
414 %attr(755,root,root) %{_libdir}/libcpupower.so
415 %{_includedir}/cpufreq.h
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{_bindir}/perf
421 %attr(755,root,root) %{_bindir}/trace
422 %{_mandir}/man1/perf*.1*
423 %dir %{_datadir}/perf-core
424 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
425 %attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
427 %dir %{_datadir}/perf-core/scripts
429 %dir %{_datadir}/perf-core/scripts/perl
430 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
431 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
432 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
433 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
434 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
435 %dir %{_datadir}/perf-core/scripts/perl/bin
436 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
437 %{_datadir}/perf-core/scripts/perl/*.pl
439 %dir %{_datadir}/perf-core/scripts/python
440 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
441 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
442 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
443 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
444 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
445 %dir %{_datadir}/perf-core/scripts/python/bin
446 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
447 %{_datadir}/perf-core/scripts/python/*.py*
449 %dir %{_libdir}/traceevent
450 %dir %{_libdir}/traceevent/plugins
451 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
455 %defattr(644,root,root,755)
456 %attr(755,root,root) %{_bindir}/perf-read-vdso32
459 %defattr(644,root,root,755)
460 %attr(755,root,root) %{_bindir}/perf-read-vdsox32
465 %defattr(644,root,root,755)
466 %attr(755,root,root) %{_libdir}/libperf-gtk.so
469 %files -n bash-completion-perf
470 %defattr(644,root,root,755)
471 /etc/bash_completion.d/perf