3 # - asciidoc used at install stage of perf (should build doc in build section)
4 # - different packages for perf-slang and perf-gtk
8 %bcond_without verbose # verbose build (V=1)
9 %bcond_with perf # perf tools (unfinished)
14 Summary: Assortment of tools for the Linux kernel
16 Version: %{basever}%{postver}
19 Group: Applications/System
20 Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
21 # Source0-md5: 1a1760420eac802c541a20ab51a093d1
22 %if "%{postver}" != ".0"
23 Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
24 # Patch0-md5: e222aa73f705b8874e1ba880f99593ce
26 Source1: cpupower.service
27 Source2: cpupower.config
28 BuildRequires: rpmbuild(macros) >= 1.647
29 BuildRequires: tar >= 1:1.22
32 BuildRequires: asciidoc
33 BuildRequires: newt-devel
34 BuildRequires: rpm-pythonprov
35 BuildRequires: slang-devel
37 # provides perf.h which util/parse-events.l loads via ../perf.h, and -I/usr/include/slang makes it being loaded first
38 BuildConflicts: Firebird-devel
40 Requires: %{name}-libs = %{version}-%{release}
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %define makeopts CC="%{__cc}" %{?with_verbose:V=1}
46 This package contains the tools/ directory from the kernel source and
47 the supporting documentation.
50 Summary: cpupower - Shows and sets processor power related values
51 Group: Applications/System
52 Requires(post,preun,postun): systemd-units >= 38
53 Requires: systemd-units >= 0.38
54 Provides: cpufreq-utils = 1:009-0.6.p1
55 Provides: cpufrequtils = 1:009-0.6.p1
56 Provides: cpupowerutils = 1:009-0.6.p1
57 Obsoletes: cpufreq-utils < 1:009-0.6.p1
58 Obsoletes: cpufrequtils < 1:009-0.6.p1
59 Obsoletes: cpupowerutils < 1:009-0.6.p1
60 Obsoletes: cpuspeed < 1:1.5-16
63 cpupower is a collection of tools to examine and tune power saving
64 related features of your processor.
66 %package cpupower-libs
67 Summary: cpupower libraries
71 %description cpupower-libs
74 %package cpupower-libs-devel
75 Summary: Development files for the cpupower libraries
77 Group: Development/Libraries
78 Requires: kernel-tools = %{version}-%{release}
79 Requires: kernel-tools-libs = %{version}-%{release}
80 Provides: cpupowerutils-devel = 1:009-0.6.p1
81 Provides: kernel-tools-devel
82 Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
84 %description cpupower-libs-devel
85 Development files for the cpupower libraries.
89 Group: Applications/System
92 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
93 away CPU hardware differences in Linux performance measurements and
94 presents a simple commandline interface. Perf is based on the
95 perf_events interface exported by recent versions of the Linux kernel.
101 %if "%{postver}" != ".0"
109 %{__make} -C tools/power/cpupower \
114 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
119 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
123 %ifarch %{ix86} %{x8664}
124 %{__make} -C tools/power/x86/x86_energy_perf_policy \
126 %{__make} -C tools/power/x86/turbostat \
133 install -d $PWD/perf-{slang,gtk}
134 %{__make} -C tools/perf \
139 perfexecdir=%{_datadir}/perf-core \
140 template_dir=%{_datadir}/perf-core/templates
143 %{__make} -C tools/perf \
147 perfexecdir=%{_datadir}/perf-core \
148 template_dir=%{_datadir}/perf-core/templates
152 %{__make} -C usr gen_init_cpio \
156 rm -rf $RPM_BUILD_ROOT
159 %{__make} -C tools/power/cpupower install \
160 DESTDIR=$RPM_BUILD_ROOT \
168 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
169 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
170 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
173 cd tools/power/cpupower/debug/i386
174 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
175 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
179 cd tools/power/cpupower/debug/x86_64
180 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
181 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
185 %ifarch %{ix86} %{x8664}
186 install -d $RPM_BUILD_ROOT%{_mandir}/man8
187 # broken makefile, install manually
190 -C tools/power/x86/x86_energy_perf_policy \
191 DESTDIR=$RPM_BUILD_ROOT
193 cd tools/power/x86/x86_energy_perf_policy
194 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
195 install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
199 # broken makefile, install manually
202 -C tools/power/x86/turbostat \
203 DESTDIR=$RPM_BUILD_ROOT
205 cd tools/power/x86/turbostat
206 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
207 install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
216 %{__make} -j1 install install-man \
221 %{?with_verbose:V=1} \
223 perfexecdir=%{_datadir}/perf-core \
224 template_dir=%{_datadir}/perf-core/templates \
225 DESTDIR=$RPM_BUILD_ROOT
228 %{__make} -j1 install install-man \
232 %{?with_verbose:V=1} \
234 perfexecdir=%{_datadir}/perf-core \
235 template_dir=%{_datadir}/perf-core/templates \
236 DESTDIR=$RPM_BUILD_ROOT
240 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
243 rm -rf $RPM_BUILD_ROOT
245 %post cpupower-libs -p /sbin/ldconfig
246 %postun cpupower-libs -p /sbin/ldconfig
249 %systemd_post cpupower.service
252 %systemd_preun cpupower.service
258 %defattr(644,root,root,755)
259 %ifarch %{ix86} %{x8664}
260 %attr(755,root,root) %{_bindir}/centrino-decode
261 %attr(755,root,root) %{_bindir}/powernow-k8-decode
263 %ifarch %{ix86} %{x8664}
264 %attr(755,root,root) %{_bindir}/turbostat
265 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
266 %{_mandir}/man8/turbostat*
267 %{_mandir}/man8/x86_energy_perf_policy*
269 %attr(755,root,root) %{_bindir}/gen_init_cpio
271 %files cpupower -f cpupower.lang
272 %defattr(644,root,root,755)
273 %attr(755,root,root) %{_bindir}/cpupower
274 %{_mandir}/man[1-8]/cpupower*
275 %{systemdunitdir}/cpupower.service
276 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
281 %ghost %{_libdir}/libcpupower.so.0
283 %files cpupower-libs-devel
284 %defattr(644,root,root,755)
285 %{_libdir}/libcpupower.so
286 %{_includedir}/cpufreq.h
290 %defattr(644,root,root,755)
291 %attr(755,root,root) %{_bindir}/perf
292 %{_mandir}/man1/perf*.1*
293 %dir %{_datadir}/perf-core
294 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
296 %dir %{_datadir}/perf-core/scripts
298 %dir %{_datadir}/perf-core/scripts/perl
299 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
300 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
301 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
302 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
303 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
304 %dir %{_datadir}/perf-core/scripts/perl/bin
305 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
306 %{_datadir}/perf-core/scripts/perl/*.pl
308 %dir %{_datadir}/perf-core/scripts/python
309 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
310 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
311 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
312 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
313 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py
314 %dir %{_datadir}/perf-core/scripts/python/bin
315 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
316 %{_datadir}/perf-core/scripts/python/*.py