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/v3.x/linux-%{basever}.tar.xz
28 # Source0-md5: d3fc8316d4d4d04b65cbc2d70799e763
29 Source1: cpupower.service
30 Source2: cpupower.config
31 %if "%{postver}" != ".0"
32 Patch0: https://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
33 # Patch0-md5: 1fec75551b2f55fced43df8394b1fd9a
36 URL: http://www.kernel.org/
38 BuildRequires: gcc-multilib-x32
40 BuildRequires: gettext-tools
41 BuildRequires: pciutils-devel
42 BuildRequires: rpmbuild(macros) >= 1.647
43 BuildRequires: tar >= 1:1.22
46 BuildRequires: asciidoc
47 BuildRequires: audit-libs-devel
48 BuildRequires: binutils-devel
50 BuildRequires: docbook-dtd45-xml
51 BuildRequires: docbook-style-xsl
52 BuildRequires: elfutils-devel
54 %{?with_libunwind:BuildRequires: libunwind-devel >= 0.99}
55 BuildRequires: numactl-devel
56 BuildRequires: perl-devel >= 5.1
57 BuildRequires: python-devel
58 BuildRequires: rpm-pythonprov
59 BuildRequires: slang-devel
62 BuildRequires: gtk+2-devel >= 2.0
63 BuildRequires: pkgconfig
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 # otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
69 %define _enable_debug_packages 0
71 %define makeopts CC="%{__cc}" %{?with_verbose:V=1}
74 This package contains the software from tools/ subdirectory from Linux
75 kernel source and the supporting documentation.
77 %description -l pl.UTF-8
78 Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
79 Linuksa oraz związaną z nim dokumentację.
82 Summary: cpupower - Shows and sets processor power related values
83 Summary(pl.UTF-8): cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
84 Group: Applications/System
85 Requires(post,preun,postun): systemd-units >= 38
86 Requires: %{name}-cpupower-libs = %{version}-%{release}
87 Requires: systemd-units >= 0.38
88 Provides: cpufreq-utils = 1:009-0.6.p1
89 Provides: cpufrequtils = 1:009-0.6.p1
90 Provides: cpupowerutils = 1:009-0.6.p1
91 Obsoletes: cpufreq-utils < 1:009-0.6.p1
92 Obsoletes: cpufrequtils < 1:009-0.6.p1
93 Obsoletes: cpupowerutils < 1:009-0.6.p1
94 Obsoletes: cpuspeed < 1:1.5-16
97 cpupower is a collection of tools to examine and tune power saving
98 related features of your processor.
100 %description cpupower -l pl.UTF-8
101 cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
102 związanych z oszczędzaniem energii.
104 %package cpupower-libs
105 Summary: cpupower library
106 Summary(pl.UTF-8): Biblioteka cpupower
109 %description cpupower-libs
112 %description cpupower-libs -l pl.UTF-8
115 %package cpupower-libs-devel
116 Summary: Development files for the cpupower library
117 Summary(pl.UTF-8): Pliki programistyczne biblioteki cpupower
118 Group: Development/Libraries
119 Requires: %{name} = %{version}-%{release}
120 Requires: %{name}-cpupower-libs = %{version}-%{release}
121 Provides: cpufrequtils-devel = 1:009-0.6.p1
122 Provides: cpupowerutils-devel = 1:009-0.6.p1
123 Obsoletes: cpufrequtils-devel < 1:009-0.6.p1
124 Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
126 %description cpupower-libs-devel
127 Development files for the cpupower library.
129 %description cpupower-libs-devel -l pl.UTF-8
130 Pliki programistyczne biblioteki cpupower.
133 Summary: perf profiler tool
134 Summary(pl.UTF-8): Narzędzie profilujące perf
135 Group: Applications/System
138 Obsoletes: perf-slang
141 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
142 away CPU hardware differences in Linux performance measurements and
143 presents a simple commandline interface. Perf is based on the
144 perf_events interface exported by recent versions of the Linux kernel.
146 This package contains core files, scripts and text interface (TUI).
148 %description perf -l pl.UTF-8
149 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
150 odseparowujące od różnic sprzętowych między pomiarami wydajności w
151 zależności od procesora oraz udostępniające prosty interfejs linii
152 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
153 przez nowe wersje jądra Linuksa.
155 Ten pakiet zawiera podstawowe pliki, skrypty oraz interfejs tekstowy
159 Summary: perf profiler tool (GTK+ 2 GUI)
160 Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+ 2)
161 Group: X11/Applications
162 Requires: %{name}-perf = %{version}-%{release}
164 %description perf-gtk
165 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
166 away CPU hardware differences in Linux performance measurements and
167 presents a simple commandline interface. Perf is based on the
168 perf_events interface exported by recent versions of the Linux kernel.
170 This package contains GTK+ 2 based GUI.
172 %description perf-gtk -l pl.UTF-8
173 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
174 odseparowujące od różnic sprzętowych między pomiarami wydajności w
175 zależności od procesora oraz udostępniające prosty interfejs linii
176 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
177 przez nowe wersje jądra Linuksa.
179 Ten pakiet zawiera graficzny interfejs oparty na GTK+ 2.
181 %package -n bash-completion-perf
182 Summary: Bash completion for perf command
183 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
184 Group: Applications/Shells
185 Requires: %{name}-perf
186 Requires: bash-completion
187 %if "%{_rpmversion}" >= "5"
191 %description -n bash-completion-perf
192 Bash completion for perf command.
194 %description -n bash-completion-perf -l pl.UTF-8
195 Bashowe uzupełnianie parametrów dla polecenia perf.
201 %if "%{postver}" != ".0"
207 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
212 # Simple Disk Sleep Monitor
213 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
216 %{__make} -C tools/power/cpupower \
218 CPUFREQ_BENCH=false \
219 OPTIMIZATION="%{rpmcflags}" \
223 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
225 CFLAGS="%{rpmcflags}"
229 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
231 CFLAGS="%{rpmcflags}"
234 %ifarch %{ix86} %{x8664} x32
235 %{__make} -C tools/power/x86/x86_energy_perf_policy \
237 CFLAGS="%{rpmcflags}"
238 CFLAGS="%{rpmcflags}" \
239 %{__make} -C tools/power/x86/turbostat \
243 # page-types, slabinfo
244 %{__make} -C tools/vm page-types slabinfo \
246 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
249 %{__make} -C tools/perf all man \
250 %{!?with_gtk:NO_GTK2=1} \
251 %{!?with_libunwind:NO_LIBUNWIND=1} \
253 CFLAGS_OPTIMIZE="%{rpmcflags}" \
256 perfexecdir=%{_datadir}/perf-core \
258 template_dir=%{_datadir}/perf-core/templates
262 %{__make} -C usr gen_init_cpio \
264 CFLAGS="%{rpmcflags}"
267 rm -rf $RPM_BUILD_ROOT
270 install -d $RPM_BUILD_ROOT%{_sbindir}
272 %{__make} -C tools/power/cpupower install \
273 DESTDIR=$RPM_BUILD_ROOT \
281 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
282 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
283 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
286 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
289 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
292 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
293 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
294 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
296 %ifarch %{ix86} %{x8664} x32
297 install -d $RPM_BUILD_ROOT%{_mandir}/man8
298 # broken makefile, install manually
301 -C tools/power/x86/x86_energy_perf_policy \
302 DESTDIR=$RPM_BUILD_ROOT
304 cd tools/power/x86/x86_energy_perf_policy
305 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
306 cp -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
310 # broken makefile, install manually
313 -C tools/power/x86/turbostat \
314 DESTDIR=$RPM_BUILD_ROOT
316 cd tools/power/x86/turbostat
317 cp -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
319 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
324 %{__make} -j1 install install-man \
326 %{!?with_gtk:NO_GTK2=1} \
327 %{!?with_libunwind:NO_LIBUNWIND=1} \
329 CFLAGS_OPTIMIZE="%{rpmcflags}" \
331 %{?with_verbose:V=1} \
333 perfexecdir=%{_datadir}/perf-core \
334 template_dir=%{_datadir}/perf-core/templates \
336 DESTDIR=$RPM_BUILD_ROOT
338 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
339 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
341 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
345 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
348 rm -rf $RPM_BUILD_ROOT
350 %post cpupower-libs -p /sbin/ldconfig
351 %postun cpupower-libs -p /sbin/ldconfig
354 %systemd_post cpupower.service
357 %systemd_preun cpupower.service
363 %defattr(644,root,root,755)
364 %attr(755,root,root) %{_bindir}/gen_init_cpio
365 %attr(755,root,root) %{_bindir}/slabinfo
366 %attr(755,root,root) %{_sbindir}/dslm
367 %attr(755,root,root) %{_sbindir}/page-types
368 %ifarch %{ix86} %{x8664} x32
369 %attr(755,root,root) %{_bindir}/centrino-decode
370 %attr(755,root,root) %{_bindir}/powernow-k8-decode
372 %ifarch %{ix86} %{x8664} x32
373 %attr(755,root,root) %{_bindir}/turbostat
374 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
375 %{_mandir}/man8/turbostat.8*
376 %{_mandir}/man8/x86_energy_perf_policy.8*
379 %files cpupower -f cpupower.lang
380 %defattr(644,root,root,755)
381 %attr(755,root,root) %{_bindir}/cpupower
382 %{_mandir}/man1/cpupower*.1*
383 %{systemdunitdir}/cpupower.service
384 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
389 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
391 %files cpupower-libs-devel
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_libdir}/libcpupower.so
394 %{_includedir}/cpufreq.h
398 %defattr(644,root,root,755)
399 %attr(755,root,root) %{_bindir}/perf
401 %attr(755,root,root) %{_bindir}/perf-read-vdso32
402 %attr(755,root,root) %{_bindir}/perf-read-vdsox32
404 %attr(755,root,root) %{_bindir}/trace
405 %{_mandir}/man1/perf*.1*
406 %dir %{_datadir}/perf-core
407 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
408 %attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
410 %dir %{_datadir}/perf-core/scripts
412 %dir %{_datadir}/perf-core/scripts/perl
413 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
414 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
415 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
416 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
417 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
418 %dir %{_datadir}/perf-core/scripts/perl/bin
419 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
420 %{_datadir}/perf-core/scripts/perl/*.pl
422 %dir %{_datadir}/perf-core/scripts/python
423 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
424 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
425 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
426 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
427 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
428 %dir %{_datadir}/perf-core/scripts/python/bin
429 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
430 %{_datadir}/perf-core/scripts/python/*.py*
432 %dir %{_libdir}/traceevent
433 %dir %{_libdir}/traceevent/plugins
434 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
438 %defattr(644,root,root,755)
439 %attr(755,root,root) %{_libdir}/libperf-gtk.so
442 %files -n bash-completion-perf
443 %defattr(644,root,root,755)
444 /etc/bash_completion.d/perf