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 perf version
15 Summary: Assortment of tools for the Linux kernel
16 Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa
18 Version: %{basever}%{postver}
21 Group: Applications/System
22 Source0: https://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
23 # Source0-md5: 5c569ed649a0c9711879f333e90c5386
24 %if "%{postver}" != ".0"
25 Patch0: https://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
26 # Patch0-md5: 9da4b0f5e343455b8141bcfa47e88cf5
28 Source1: cpupower.service
29 Source2: cpupower.config
31 URL: http://www.kernel.org/
32 BuildRequires: gettext-tools
33 BuildRequires: pciutils-devel
34 BuildRequires: rpmbuild(macros) >= 1.647
35 BuildRequires: tar >= 1:1.22
38 BuildRequires: asciidoc
39 BuildRequires: audit-libs-devel
40 BuildRequires: binutils-devel
42 BuildRequires: docbook-dtd45-xml
43 BuildRequires: docbook-style-xsl
44 BuildRequires: elfutils-devel
46 BuildRequires: libunwind-devel >= 0.99
47 BuildRequires: perl-devel >= 5.1
48 BuildRequires: python-devel
49 BuildRequires: rpm-pythonprov
50 BuildRequires: slang-devel
53 BuildRequires: gtk+2-devel >= 2.0
54 BuildRequires: pkgconfig
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 # otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
60 %define _enable_debug_packages 0
62 %define makeopts CC="%{__cc}" %{?with_verbose:V=1}
65 This package contains the software from tools/ subdirectory from Linux
66 kernel source and the supporting documentation.
68 %description -l pl.UTF-8
69 Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
70 Linuksa oraz związaną z nim dokumentację.
73 Summary: cpupower - Shows and sets processor power related values
74 Summary(pl.UTF-8): cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
75 Group: Applications/System
76 Requires(post,preun,postun): systemd-units >= 38
77 Requires: %{name}-cpupower-libs = %{version}-%{release}
78 Requires: systemd-units >= 0.38
79 Provides: cpufreq-utils = 1:009-0.6.p1
80 Provides: cpufrequtils = 1:009-0.6.p1
81 Provides: cpupowerutils = 1:009-0.6.p1
82 Obsoletes: cpufreq-utils < 1:009-0.6.p1
83 Obsoletes: cpufrequtils < 1:009-0.6.p1
84 Obsoletes: cpupowerutils < 1:009-0.6.p1
85 Obsoletes: cpuspeed < 1:1.5-16
88 cpupower is a collection of tools to examine and tune power saving
89 related features of your processor.
91 %description cpupower -l pl.UTF-8
92 cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
93 związanych z oszczędzaniem energii.
95 %package cpupower-libs
96 Summary: cpupower library
97 Summary(pl.UTF-8): Biblioteka cpupower
100 %description cpupower-libs
103 %description cpupower-libs -l pl.UTF-8
106 %package cpupower-libs-devel
107 Summary: Development files for the cpupower library
108 Summary(pl.UTF-8): Pliki programistyczne biblioteki cpupower
109 Group: Development/Libraries
110 Requires: %{name} = %{version}-%{release}
111 Requires: %{name}-cpupower-libs = %{version}-%{release}
112 Provides: cpufrequtils-devel = 1:009-0.6.p1
113 Provides: cpupowerutils-devel = 1:009-0.6.p1
114 Obsoletes: cpufrequtils-devel < 1:009-0.6.p1
115 Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
117 %description cpupower-libs-devel
118 Development files for the cpupower library.
120 %description cpupower-libs-devel -l pl.UTF-8
121 Pliki programistyczne biblioteki cpupower.
124 Summary: perf profiler tool (core package)
125 Summary(pl.UTF-8): Narzędzie profilujące perf (podstawowe narzędzia)
126 Group: Applications/System
129 %description perf-core
130 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
131 away CPU hardware differences in Linux performance measurements and
132 presents a simple commandline interface. Perf is based on the
133 perf_events interface exported by recent versions of the Linux kernel.
135 This package contains core files and scripts.
137 %description perf-core -l pl.UTF-8
138 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
139 odseparowujące od różnic sprzętowych między pomiarami wydajności w
140 zależności od procesora oraz udostępniające prosty interfejs linii
141 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
142 przez nowe wersje jądra Linuksa.
144 Ten pakiet zawiera podstawowe pliki i skrypty.
147 Summary: perf profiler tool (GTK+ GUI)
148 Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+)
149 Group: X11/Applications
150 Requires: %{name}-perf-core = %{version}-%{release}
151 Provides: %{name}-perf = %{version}-%{release}
153 %description perf-gtk
154 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
155 away CPU hardware differences in Linux performance measurements and
156 presents a simple commandline interface. Perf is based on the
157 perf_events interface exported by recent versions of the Linux kernel.
159 This package contains GTK+ based GUI.
161 %description perf-gtk -l pl.UTF-8
162 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
163 odseparowujące od różnic sprzętowych między pomiarami wydajności w
164 zależności od procesora oraz udostępniające prosty interfejs linii
165 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
166 przez nowe wersje jądra Linuksa.
168 Ten pakiet zawiera graficzny interfejs oparty na GTK+.
171 Summary: perf profiler tool (Slang TUI)
172 Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs tekstowy Slang)
173 Group: X11/Applications
174 Requires: %{name}-perf-core = %{version}-%{release}
175 Provides: %{name}-perf = %{version}-%{release}
177 %description perf-slang
178 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
179 away CPU hardware differences in Linux performance measurements and
180 presents a simple commandline interface. Perf is based on the
181 perf_events interface exported by recent versions of the Linux kernel.
183 This package contains Slang based TUI.
185 %description perf-slang -l pl.UTF-8
186 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
187 odseparowujące od różnic sprzętowych między pomiarami wydajności w
188 zależności od procesora oraz udostępniające prosty interfejs linii
189 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
190 przez nowe wersje jądra Linuksa.
192 Ten pakiet zawiera tekstowy interfejs oparty na bibliotece Slang.
194 %package -n bash-completion-perf
195 Summary: Bash completion for perf command
196 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
197 Group: Applications/Shells
198 Requires: %{name}-perf
199 Requires: bash-completion
200 %if "%{_rpmversion}" >= "5"
204 %description -n bash-completion-perf
205 Bash completion for perf command.
207 %description -n bash-completion-perf -l pl.UTF-8
208 Bashowe uzupełnianie parametrów dla polecenia perf.
214 %if "%{postver}" != ".0"
218 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
223 # Simple Disk Sleep Monitor
224 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
227 %{__make} -C tools/power/cpupower \
229 CPUFREQ_BENCH=false \
230 OPTIMIZATION="%{rpmcflags}" \
234 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
236 CFLAGS="%{rpmcflags}"
240 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
242 CFLAGS="%{rpmcflags}"
245 %ifarch %{ix86} %{x8664}
246 %{__make} -C tools/power/x86/x86_energy_perf_policy \
248 CFLAGS="%{rpmcflags}"
249 CFLAGS="%{rpmcflags}" \
250 %{__make} -C tools/power/x86/turbostat \
254 # page-types, slabinfo
255 %{__make} -C tools/vm page-types slabinfo \
257 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
262 install -d $PWD/perf-{slang,gtk}
263 %{__make} -C tools/perf all man \
267 CFLAGS_OPTIMIZE="%{rpmcflags}" \
270 perfexecdir=%{_datadir}/perf-core \
271 template_dir=%{_datadir}/perf-core/templates
275 %{__make} -C tools/perf all man \
278 CFLAGS_OPTIMIZE="%{rpmcflags}" \
281 perfexecdir=%{_datadir}/perf-core \
282 template_dir=%{_datadir}/perf-core/templates
287 %{__make} -C usr gen_init_cpio \
289 CFLAGS="%{rpmcflags}"
292 rm -rf $RPM_BUILD_ROOT
295 install -d $RPM_BUILD_ROOT%{_sbindir}
297 %{__make} -C tools/power/cpupower install \
298 DESTDIR=$RPM_BUILD_ROOT \
306 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
307 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
308 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
311 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
314 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
317 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
318 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
319 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
321 %ifarch %{ix86} %{x8664}
322 install -d $RPM_BUILD_ROOT%{_mandir}/man8
323 # broken makefile, install manually
326 -C tools/power/x86/x86_energy_perf_policy \
327 DESTDIR=$RPM_BUILD_ROOT
329 cd tools/power/x86/x86_energy_perf_policy
330 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
331 cp -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
335 # broken makefile, install manually
338 -C tools/power/x86/turbostat \
339 DESTDIR=$RPM_BUILD_ROOT
341 cd tools/power/x86/turbostat
342 cp -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
344 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
352 %{__make} -j1 install install-man \
357 CFLAGS_OPTIMIZE="%{rpmcflags}" \
359 %{?with_verbose:V=1} \
361 perfexecdir=%{_datadir}/perf-core \
362 template_dir=%{_datadir}/perf-core/templates \
363 DESTDIR=$RPM_BUILD_ROOT
364 %{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,_slang}
368 %{__make} -j1 install install-man \
372 CFLAGS_OPTIMIZE="%{rpmcflags}" \
374 %{?with_verbose:V=1} \
376 perfexecdir=%{_datadir}/perf-core \
377 template_dir=%{_datadir}/perf-core/templates \
378 DESTDIR=$RPM_BUILD_ROOT
379 %{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,_gtk}
382 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
383 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
385 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
387 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/perf
391 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
394 rm -rf $RPM_BUILD_ROOT
396 %post cpupower-libs -p /sbin/ldconfig
397 %postun cpupower-libs -p /sbin/ldconfig
400 %systemd_post cpupower.service
403 %systemd_preun cpupower.service
409 %defattr(644,root,root,755)
410 %attr(755,root,root) %{_bindir}/gen_init_cpio
411 %attr(755,root,root) %{_bindir}/slabinfo
412 %attr(755,root,root) %{_sbindir}/dslm
413 %attr(755,root,root) %{_sbindir}/page-types
414 %ifarch %{ix86} %{x8664}
415 %attr(755,root,root) %{_bindir}/centrino-decode
416 %attr(755,root,root) %{_bindir}/powernow-k8-decode
418 %ifarch %{ix86} %{x8664}
419 %attr(755,root,root) %{_bindir}/turbostat
420 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
421 %{_mandir}/man8/turbostat.8*
422 %{_mandir}/man8/x86_energy_perf_policy.8*
425 %files cpupower -f cpupower.lang
426 %defattr(644,root,root,755)
427 %attr(755,root,root) %{_bindir}/cpupower
428 %{_mandir}/man1/cpupower*.1*
429 %{systemdunitdir}/cpupower.service
430 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
433 %defattr(644,root,root,755)
434 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
435 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
437 %files cpupower-libs-devel
438 %defattr(644,root,root,755)
439 %attr(755,root,root) %{_libdir}/libcpupower.so
440 %{_includedir}/cpufreq.h
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_bindir}/perf
446 %{_mandir}/man1/perf*.1*
447 %dir %{_datadir}/perf-core
448 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
450 %dir %{_datadir}/perf-core/scripts
452 %dir %{_datadir}/perf-core/scripts/perl
453 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
454 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
455 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
456 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
457 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
458 %dir %{_datadir}/perf-core/scripts/perl/bin
459 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
460 %{_datadir}/perf-core/scripts/perl/*.pl
462 %dir %{_datadir}/perf-core/scripts/python
463 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
464 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
465 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
466 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
467 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
468 %dir %{_datadir}/perf-core/scripts/python/bin
469 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
470 %{_datadir}/perf-core/scripts/python/*.py*
472 %dir %{_libdir}/traceevent
473 %dir %{_libdir}/traceevent/plugins
474 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
478 %defattr(644,root,root,755)
479 %attr(755,root,root) %{_bindir}/perf_gtk
483 %defattr(644,root,root,755)
484 %attr(755,root,root) %{_bindir}/perf_slang
486 %files -n bash-completion-perf
487 %defattr(644,root,root,755)
488 /etc/bash_completion.d/perf