]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools.spec
cpupower moved to subpackage, libs renamed
[packages/kernel-tools.git] / kernel-tools.spec
CommitLineData
fea1e605
ER
1# TODO
2# - BR deps for -perf
3# - asciidoc used at install stage of perf (should build doc in build section)
4# - different packages for perf-slang and perf-gtk
49fba13a
ER
5#
6# Conditional build:
7%bcond_without verbose # verbose build (V=1)
fea1e605 8%bcond_with perf # perf tools (unfinished)
49fba13a
ER
9
10%define rel 0.1
11%define basever 3.6
12%define postver .6
13Summary: Assortment of tools for the Linux kernel
14Name: kernel-tools
15Version: %{basever}%{postver}
16Release: %{rel}
17License: GPL v2
fea1e605 18Group: Applications/System
49fba13a
ER
19Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
20# Source0-md5: 1a1760420eac802c541a20ab51a093d1
21%if "%{postver}" != ".0"
22Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
23# Patch0-md5: 363e730147333182616cc687345e7fe2
24%endif
25BuildRequires: tar >= 1:1.22
26BuildRequires: xz
fea1e605
ER
27%if %{with perf}
28BuildRequires: asciidoc
29BuildRequires: rpm-pythonprov
30BuildRequires: xmlto
31# provides perf.h which util/parse-events.l loads via ../perf.h, and -I/usr/include/slang makes it being loaded first
32BuildConflicts: Firebird-devel
33%endif
49fba13a
ER
34Requires: %{name}-libs = %{version}-%{release}
35Provides: cpufreq-utils = 1:009-0.6.p1
36Provides: cpufrequtils = 1:009-0.6.p1
37Provides: cpupowerutils = 1:009-0.6.p1
38Obsoletes: cpufreq-utils < 1:009-0.6.p1
39Obsoletes: cpufrequtils < 1:009-0.6.p1
40Obsoletes: cpupowerutils < 1:009-0.6.p1
41Obsoletes: cpuspeed < 1:1.5-16
42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44%description
45This package contains the tools/ directory from the kernel source and
46the supporting documentation.
47
4bc5704a
JK
48%package cpupower
49Summary: cpupower - Shows and sets processor power related values
50Group: Applications/System
51
52%description cpupower
53cpupower is a collection of tools to examine and tune power saving related
54features of your processor.
55
56%package cpupower-libs
57Summary: cpupower libraries
49fba13a
ER
58License: GPL v2
59Group: Libraries
60
4bc5704a
JK
61%description cpupower-libs
62cpupower libraries.
49fba13a 63
4bc5704a
JK
64%package cpupower-libs-devel
65Summary: Development files for the cpupower libraries.
49fba13a
ER
66License: GPL v2
67Group: Development/Libraries
68Requires: kernel-tools = %{version}-%{release}
69Requires: kernel-tools-libs = %{version}-%{release}
70Provides: cpupowerutils-devel = 1:009-0.6.p1
71Provides: kernel-tools-devel
72Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
73
4bc5704a
JK
74%description cpupower-libs-devel
75Development files for the cpupower libraries.
49fba13a 76
fea1e605
ER
77%package perf
78Summary: perf tool
79Group: Applications/System
80
81%description perf
82Perf is a profiler tool for Linux 2.6+ based systems that abstracts
83away CPU hardware differences in Linux performance measurements and
84presents a simple commandline interface. Perf is based on the
85perf_events interface exported by recent versions of the Linux kernel.
86
49fba13a
ER
87%prep
88%setup -qc
89cd linux-%{basever}
90
91%if "%{postver}" != ".0"
92%patch0 -p1
93%endif
94
95%build
96cd linux-%{basever}
97
98# cpupower
99%{__make} -C tools/power/cpupower \
100 CC="%{__cc}" \
101 %{?with_verbose:V=1} \
102 CPUFREQ_BENCH=false
103
104%ifarch %{ix86}
105%{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
106 CC="%{__cc}" \
107 %{?with_verbose:V=1}
108%endif
109
110%ifarch %{x8664}
111%{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
112 CC="%{__cc}" \
113 %{?with_verbose:V=1}
114%endif
115
116%ifarch %{ix86} %{x8664}
117%{__make} -C tools/power/x86/x86_energy_perf_policy \
118 CC="%{__cc}" \
119 %{?with_verbose:V=1}
120%{__make} -C tools/power/x86/turbostat \
121 CC="%{__cc}" \
122 %{?with_verbose:V=1}
123%endif
124
fea1e605
ER
125%if %{with perf}
126# perf slang version
127PWD=${PWD:-$(pwd)}
128install -d $PWD/perf-{slang,gtk}
129%{__make} -C tools/perf \
130 O=$PWD/perf-slang \
131 NO_GTK2=1 \
132 CC="%{__cc}" \
133 %{?with_verbose:V=1} \
134 prefix=%{_prefix} \
135 perfexecdir=%{_datadir}/perf-core \
136 template_dir=%{_datadir}/perf-core/templates
137
138# perf gtk version
139%{__make} -C tools/perf \
140 O=$PWD/perf-gtk \
141 CC="%{__cc}" \
142 %{?with_verbose:V=1} \
143 prefix=%{_prefix} \
144 perfexecdir=%{_datadir}/perf-core \
145 template_dir=%{_datadir}/perf-core/templates
146%endif
147
dd28be58
JK
148# gen_init_cpio
149%{__make} -C usr gen_init_cpio \
150 CC="%{__cc}" \
151 %{?with_verbose:V=1}
152
49fba13a
ER
153%install
154rm -rf $RPM_BUILD_ROOT
155cd linux-%{basever}
156
157%{__make} -C tools/power/cpupower install \
158 DESTDIR=$RPM_BUILD_ROOT \
159 libdir=%{_libdir} \
160 mandir=%{_mandir} \
161 CPUFREQ_BENCH=false
162
163%find_lang cpupower
164mv cpupower.lang ..
165
166%ifarch %{ix86}
167cd tools/power/cpupower/debug/i386
168install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
169install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
170cd -
171%endif
172%ifarch %{x8664}
173cd tools/power/cpupower/debug/x86_64
174install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
175install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
176cd -
177%endif
178
179%ifarch %{ix86} %{x8664}
180install -d $RPM_BUILD_ROOT%{_mandir}/man8
181# broken makefile, install manually
182%if 0
183%{__make} install \
184 -C tools/power/x86/x86_energy_perf_policy \
185 DESTDIR=$RPM_BUILD_ROOT
186%else
187cd tools/power/x86/x86_energy_perf_policy
188install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
189install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
190cd -
191%endif
192
193# broken makefile, install manually
194%if 0
195%{__make} install \
196 -C tools/power/x86/turbostat \
197 DESTDIR=$RPM_BUILD_ROOT
198%else
199cd tools/power/x86/turbostat
200install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
201install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
fea1e605
ER
202cd -
203%endif
49fba13a 204%endif
fea1e605
ER
205
206%if %{with perf}
207# perf slang
208PWD=${PWD:-$(pwd)}
209# perf slang version
210%{__make} -j1 install install-man \
211 -C tools/perf \
212 O=$PWD/perf-slang \
213 NO_GTK2=1 \
214 CC="%{__cc}" \
215 %{?with_verbose:V=1} \
216 prefix=%{_prefix} \
217 perfexecdir=%{_datadir}/perf-core \
218 template_dir=%{_datadir}/perf-core/templates \
219 DESTDIR=$RPM_BUILD_ROOT
220
221# perf gtk
222%{__make} -j1 install install-man \
223 -C tools/perf \
224 O=$PWD/perf-gtk \
225 CC="%{__cc}" \
226 %{?with_verbose:V=1} \
227 prefix=%{_prefix} \
228 perfexecdir=%{_datadir}/perf-core \
229 template_dir=%{_datadir}/perf-core/templates \
230 DESTDIR=$RPM_BUILD_ROOT
49fba13a
ER
231%endif
232
dd28be58
JK
233# gen_init_cpio
234install usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
235
49fba13a
ER
236%clean
237rm -rf $RPM_BUILD_ROOT
238
4bc5704a
JK
239%post cpupower-libs -p /sbin/ldconfig
240%postun cpupower-libs -p /sbin/ldconfig
49fba13a 241
4bc5704a 242%files
49fba13a 243%defattr(644,root,root,755)
49fba13a
ER
244%ifarch %{ix86} %{x8664}
245%attr(755,root,root) %{_bindir}/centrino-decode
246%attr(755,root,root) %{_bindir}/powernow-k8-decode
247%endif
49fba13a
ER
248%ifarch %{ix86} %{x8664}
249%attr(755,root,root) %{_bindir}/turbostat
250%attr(755,root,root) %{_bindir}/x86_energy_perf_policy
251%{_mandir}/man8/turbostat*
252%{_mandir}/man8/x86_energy_perf_policy*
253%endif
dd28be58 254%attr(755,root,root) %{_bindir}/gen_init_cpio
49fba13a 255
4bc5704a
JK
256%files cpupower -f cpupower.lang
257%defattr(644,root,root,755)
258%attr(755,root,root) %{_bindir}/cpupower
259%{_mandir}/man[1-8]/cpupower*
260
261%files cpupower-libs
49fba13a
ER
262%defattr(644,root,root,755)
263%attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
264%ghost %{_libdir}/libcpupower.so.0
265
4bc5704a 266%files cpupower-libs-devel
49fba13a
ER
267%defattr(644,root,root,755)
268%{_libdir}/libcpupower.so
269%{_includedir}/cpufreq.h
fea1e605
ER
270
271%if %{with perf}
272%files perf
273%defattr(644,root,root,755)
274%attr(755,root,root) %{_bindir}/perf
275%{_mandir}/man1/perf*.1*
276%dir %{_datadir}/perf-core
277%attr(755,root,root) %{_datadir}/perf-core/perf-archive
278
279%dir %{_datadir}/perf-core/scripts
280
281%dir %{_datadir}/perf-core/scripts/perl
282%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
283%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
284%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
285%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
286%{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
287%dir %{_datadir}/perf-core/scripts/perl/bin
288%attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
289%{_datadir}/perf-core/scripts/perl/*.pl
290
291%dir %{_datadir}/perf-core/scripts/python
292%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
293%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
294%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
295%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
296%{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py
297%dir %{_datadir}/perf-core/scripts/python/bin
298%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
299%{_datadir}/perf-core/scripts/python/*.py
300%endif
This page took 0.06559 seconds and 4 git commands to generate.