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 %if "%{postver}" != ".0"
30 Patch0: https://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
31 # Patch0-md5: 1fec75551b2f55fced43df8394b1fd9a
33 Source1: cpupower.service
34 Source2: cpupower.config
35 URL: http://www.kernel.org/
36 BuildRequires: gettext-tools
37 BuildRequires: pciutils-devel
38 BuildRequires: rpmbuild(macros) >= 1.647
39 BuildRequires: tar >= 1:1.22
42 BuildRequires: asciidoc
43 BuildRequires: audit-libs-devel
44 BuildRequires: binutils-devel
46 BuildRequires: docbook-dtd45-xml
47 BuildRequires: docbook-style-xsl
48 BuildRequires: elfutils-devel
50 %{?with_libunwind:BuildRequires: libunwind-devel >= 0.99}
51 BuildRequires: numactl-devel
52 BuildRequires: perl-devel >= 5.1
53 BuildRequires: python-devel
54 BuildRequires: rpm-pythonprov
55 BuildRequires: slang-devel
58 BuildRequires: gtk+2-devel >= 2.0
59 BuildRequires: pkgconfig
62 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 # otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
65 %define _enable_debug_packages 0
67 %define makeopts CC="%{__cc}" %{?with_verbose:V=1}
70 This package contains the software from tools/ subdirectory from Linux
71 kernel source and the supporting documentation.
73 %description -l pl.UTF-8
74 Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
75 Linuksa oraz związaną z nim dokumentację.
78 Summary: cpupower - Shows and sets processor power related values
79 Summary(pl.UTF-8): cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
80 Group: Applications/System
81 Requires(post,preun,postun): systemd-units >= 38
82 Requires: %{name}-cpupower-libs = %{version}-%{release}
83 Requires: systemd-units >= 0.38
84 Provides: cpufreq-utils = 1:009-0.6.p1
85 Provides: cpufrequtils = 1:009-0.6.p1
86 Provides: cpupowerutils = 1:009-0.6.p1
87 Obsoletes: cpufreq-utils < 1:009-0.6.p1
88 Obsoletes: cpufrequtils < 1:009-0.6.p1
89 Obsoletes: cpupowerutils < 1:009-0.6.p1
90 Obsoletes: cpuspeed < 1:1.5-16
93 cpupower is a collection of tools to examine and tune power saving
94 related features of your processor.
96 %description cpupower -l pl.UTF-8
97 cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
98 związanych z oszczędzaniem energii.
100 %package cpupower-libs
101 Summary: cpupower library
102 Summary(pl.UTF-8): Biblioteka cpupower
105 %description cpupower-libs
108 %description cpupower-libs -l pl.UTF-8
111 %package cpupower-libs-devel
112 Summary: Development files for the cpupower library
113 Summary(pl.UTF-8): Pliki programistyczne biblioteki cpupower
114 Group: Development/Libraries
115 Requires: %{name} = %{version}-%{release}
116 Requires: %{name}-cpupower-libs = %{version}-%{release}
117 Provides: cpufrequtils-devel = 1:009-0.6.p1
118 Provides: cpupowerutils-devel = 1:009-0.6.p1
119 Obsoletes: cpufrequtils-devel < 1:009-0.6.p1
120 Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
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 (GTK+ 2 GUI)
156 Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+ 2)
157 Group: X11/Applications
158 Requires: %{name}-perf = %{version}-%{release}
160 %description perf-gtk
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 GTK+ 2 based GUI.
168 %description perf-gtk -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 graficzny interfejs oparty na GTK+ 2.
177 %package -n bash-completion-perf
178 Summary: Bash completion for perf command
179 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
180 Group: Applications/Shells
181 Requires: %{name}-perf
182 Requires: bash-completion
183 %if "%{_rpmversion}" >= "5"
187 %description -n bash-completion-perf
188 Bash completion for perf command.
190 %description -n bash-completion-perf -l pl.UTF-8
191 Bashowe uzupełnianie parametrów dla polecenia perf.
197 %if "%{postver}" != ".0"
201 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
206 # Simple Disk Sleep Monitor
207 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
210 %{__make} -C tools/power/cpupower \
212 CPUFREQ_BENCH=false \
213 OPTIMIZATION="%{rpmcflags}" \
217 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
219 CFLAGS="%{rpmcflags}"
223 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
225 CFLAGS="%{rpmcflags}"
228 %ifarch %{ix86} %{x8664}
229 %{__make} -C tools/power/x86/x86_energy_perf_policy \
231 CFLAGS="%{rpmcflags}"
232 CFLAGS="%{rpmcflags}" \
233 %{__make} -C tools/power/x86/turbostat \
237 # page-types, slabinfo
238 %{__make} -C tools/vm page-types slabinfo \
240 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
243 %{__make} -C tools/perf all man \
244 %{!?with_gtk:NO_GTK2=1} \
245 %{!?with_libunwind:NO_LIBUNWIND=1} \
247 CFLAGS_OPTIMIZE="%{rpmcflags}" \
250 perfexecdir=%{_datadir}/perf-core \
252 template_dir=%{_datadir}/perf-core/templates
256 %{__make} -C usr gen_init_cpio \
258 CFLAGS="%{rpmcflags}"
261 rm -rf $RPM_BUILD_ROOT
264 install -d $RPM_BUILD_ROOT%{_sbindir}
266 %{__make} -C tools/power/cpupower install \
267 DESTDIR=$RPM_BUILD_ROOT \
275 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
276 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
277 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
280 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
283 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
286 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
287 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
288 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
290 %ifarch %{ix86} %{x8664}
291 install -d $RPM_BUILD_ROOT%{_mandir}/man8
292 # broken makefile, install manually
295 -C tools/power/x86/x86_energy_perf_policy \
296 DESTDIR=$RPM_BUILD_ROOT
298 cd tools/power/x86/x86_energy_perf_policy
299 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
300 cp -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
304 # broken makefile, install manually
307 -C tools/power/x86/turbostat \
308 DESTDIR=$RPM_BUILD_ROOT
310 cd tools/power/x86/turbostat
311 cp -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
313 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
318 %{__make} -j1 install install-man \
320 %{!?with_gtk:NO_GTK2=1} \
321 %{!?with_libunwind:NO_LIBUNWIND=1} \
323 CFLAGS_OPTIMIZE="%{rpmcflags}" \
325 %{?with_verbose:V=1} \
327 perfexecdir=%{_datadir}/perf-core \
328 template_dir=%{_datadir}/perf-core/templates \
330 DESTDIR=$RPM_BUILD_ROOT
332 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
333 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
335 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
339 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
342 rm -rf $RPM_BUILD_ROOT
344 %post cpupower-libs -p /sbin/ldconfig
345 %postun cpupower-libs -p /sbin/ldconfig
348 %systemd_post cpupower.service
351 %systemd_preun cpupower.service
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_bindir}/gen_init_cpio
359 %attr(755,root,root) %{_bindir}/slabinfo
360 %attr(755,root,root) %{_sbindir}/dslm
361 %attr(755,root,root) %{_sbindir}/page-types
362 %ifarch %{ix86} %{x8664}
363 %attr(755,root,root) %{_bindir}/centrino-decode
364 %attr(755,root,root) %{_bindir}/powernow-k8-decode
366 %ifarch %{ix86} %{x8664}
367 %attr(755,root,root) %{_bindir}/turbostat
368 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
369 %{_mandir}/man8/turbostat.8*
370 %{_mandir}/man8/x86_energy_perf_policy.8*
373 %files cpupower -f cpupower.lang
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_bindir}/cpupower
376 %{_mandir}/man1/cpupower*.1*
377 %{systemdunitdir}/cpupower.service
378 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
383 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
385 %files cpupower-libs-devel
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_libdir}/libcpupower.so
388 %{_includedir}/cpufreq.h
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_bindir}/perf
394 %attr(755,root,root) %{_bindir}/perf-read-vdso32
395 %attr(755,root,root) %{_bindir}/trace
396 %{_mandir}/man1/perf*.1*
397 %dir %{_datadir}/perf-core
398 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
399 %attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
401 %dir %{_datadir}/perf-core/scripts
403 %dir %{_datadir}/perf-core/scripts/perl
404 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
405 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
406 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
407 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
408 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
409 %dir %{_datadir}/perf-core/scripts/perl/bin
410 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
411 %{_datadir}/perf-core/scripts/perl/*.pl
413 %dir %{_datadir}/perf-core/scripts/python
414 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
415 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
416 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
417 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
418 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
419 %dir %{_datadir}/perf-core/scripts/python/bin
420 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
421 %{_datadir}/perf-core/scripts/python/*.py*
423 %dir %{_libdir}/traceevent
424 %dir %{_libdir}/traceevent/plugins
425 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
429 %defattr(644,root,root,755)
430 %attr(755,root,root) %{_libdir}/libperf-gtk.so
433 %files -n bash-completion-perf
434 %defattr(644,root,root,755)
435 /etc/bash_completion.d/perf