3 # - asciidoc used at install stage of perf (should build doc in build section)
4 # - different packages for perf-slang and perf-gtk
7 %bcond_without verbose # verbose build (V=1)
8 %bcond_with perf # perf tools (unfinished)
13 Summary: Assortment of tools for the Linux kernel
15 Version: %{basever}%{postver}
18 Group: Applications/System
19 Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
20 # Source0-md5: 1a1760420eac802c541a20ab51a093d1
21 %if "%{postver}" != ".0"
22 Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
23 # Patch0-md5: 363e730147333182616cc687345e7fe2
25 BuildRequires: tar >= 1:1.22
28 BuildRequires: asciidoc
29 BuildRequires: newt-devel
30 BuildRequires: rpm-pythonprov
31 BuildRequires: slang-devel
33 # provides perf.h which util/parse-events.l loads via ../perf.h, and -I/usr/include/slang makes it being loaded first
34 BuildConflicts: Firebird-devel
36 Requires: %{name}-libs = %{version}-%{release}
37 Provides: cpufreq-utils = 1:009-0.6.p1
38 Provides: cpufrequtils = 1:009-0.6.p1
39 Provides: cpupowerutils = 1:009-0.6.p1
40 Obsoletes: cpufreq-utils < 1:009-0.6.p1
41 Obsoletes: cpufrequtils < 1:009-0.6.p1
42 Obsoletes: cpupowerutils < 1:009-0.6.p1
43 Obsoletes: cpuspeed < 1:1.5-16
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define makeopts CC="%{__cc}" %{?with_verbose:V=1}
49 This package contains the tools/ directory from the kernel source and
50 the supporting documentation.
53 Summary: cpupower - Shows and sets processor power related values
54 Group: Applications/System
57 cpupower is a collection of tools to examine and tune power saving
58 related features of your processor.
60 %package cpupower-libs
61 Summary: cpupower libraries
65 %description cpupower-libs
68 %package cpupower-libs-devel
69 Summary: Development files for the cpupower libraries
71 Group: Development/Libraries
72 Requires: kernel-tools = %{version}-%{release}
73 Requires: kernel-tools-libs = %{version}-%{release}
74 Provides: cpupowerutils-devel = 1:009-0.6.p1
75 Provides: kernel-tools-devel
76 Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
78 %description cpupower-libs-devel
79 Development files for the cpupower libraries.
83 Group: Applications/System
86 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
87 away CPU hardware differences in Linux performance measurements and
88 presents a simple commandline interface. Perf is based on the
89 perf_events interface exported by recent versions of the Linux kernel.
95 %if "%{postver}" != ".0"
103 %{__make} -C tools/power/cpupower \
108 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
113 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
117 %ifarch %{ix86} %{x8664}
118 %{__make} -C tools/power/x86/x86_energy_perf_policy \
120 %{__make} -C tools/power/x86/turbostat \
127 install -d $PWD/perf-{slang,gtk}
128 %{__make} -C tools/perf \
133 perfexecdir=%{_datadir}/perf-core \
134 template_dir=%{_datadir}/perf-core/templates
137 %{__make} -C tools/perf \
141 perfexecdir=%{_datadir}/perf-core \
142 template_dir=%{_datadir}/perf-core/templates
146 %{__make} -C usr gen_init_cpio \
150 rm -rf $RPM_BUILD_ROOT
153 %{__make} -C tools/power/cpupower install \
154 DESTDIR=$RPM_BUILD_ROOT \
163 cd tools/power/cpupower/debug/i386
164 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
165 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
169 cd tools/power/cpupower/debug/x86_64
170 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
171 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
175 %ifarch %{ix86} %{x8664}
176 install -d $RPM_BUILD_ROOT%{_mandir}/man8
177 # broken makefile, install manually
180 -C tools/power/x86/x86_energy_perf_policy \
181 DESTDIR=$RPM_BUILD_ROOT
183 cd tools/power/x86/x86_energy_perf_policy
184 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
185 install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
189 # broken makefile, install manually
192 -C tools/power/x86/turbostat \
193 DESTDIR=$RPM_BUILD_ROOT
195 cd tools/power/x86/turbostat
196 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
197 install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
206 %{__make} -j1 install install-man \
211 %{?with_verbose:V=1} \
213 perfexecdir=%{_datadir}/perf-core \
214 template_dir=%{_datadir}/perf-core/templates \
215 DESTDIR=$RPM_BUILD_ROOT
218 %{__make} -j1 install install-man \
222 %{?with_verbose:V=1} \
224 perfexecdir=%{_datadir}/perf-core \
225 template_dir=%{_datadir}/perf-core/templates \
226 DESTDIR=$RPM_BUILD_ROOT
230 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
233 rm -rf $RPM_BUILD_ROOT
235 %post cpupower-libs -p /sbin/ldconfig
236 %postun cpupower-libs -p /sbin/ldconfig
239 %defattr(644,root,root,755)
240 %ifarch %{ix86} %{x8664}
241 %attr(755,root,root) %{_bindir}/centrino-decode
242 %attr(755,root,root) %{_bindir}/powernow-k8-decode
244 %ifarch %{ix86} %{x8664}
245 %attr(755,root,root) %{_bindir}/turbostat
246 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
247 %{_mandir}/man8/turbostat*
248 %{_mandir}/man8/x86_energy_perf_policy*
250 %attr(755,root,root) %{_bindir}/gen_init_cpio
252 %files cpupower -f cpupower.lang
253 %defattr(644,root,root,755)
254 %attr(755,root,root) %{_bindir}/cpupower
255 %{_mandir}/man[1-8]/cpupower*
258 %defattr(644,root,root,755)
259 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
260 %ghost %{_libdir}/libcpupower.so.0
262 %files cpupower-libs-devel
263 %defattr(644,root,root,755)
264 %{_libdir}/libcpupower.so
265 %{_includedir}/cpufreq.h
269 %defattr(644,root,root,755)
270 %attr(755,root,root) %{_bindir}/perf
271 %{_mandir}/man1/perf*.1*
272 %dir %{_datadir}/perf-core
273 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
275 %dir %{_datadir}/perf-core/scripts
277 %dir %{_datadir}/perf-core/scripts/perl
278 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
279 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
280 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
281 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
282 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
283 %dir %{_datadir}/perf-core/scripts/perl/bin
284 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
285 %{_datadir}/perf-core/scripts/perl/*.pl
287 %dir %{_datadir}/perf-core/scripts/python
288 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
289 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
290 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
291 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
292 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py
293 %dir %{_datadir}/perf-core/scripts/python/bin
294 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
295 %{_datadir}/perf-core/scripts/python/*.py