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