]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools.spec
add perf building and packaging (partly from arekm kernel.spec patch)
[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
48%package libs
49Summary: Libraries for the kernels-tools
50License: GPL v2
51Group: Libraries
52
53%description libs
54This package contains the libraries built from the tools/ directory
55from the kernel source.
56
57%package libs-devel
58Summary: Assortment of tools for the Linux kernel
59License: GPL v2
60Group: Development/Libraries
61Requires: kernel-tools = %{version}-%{release}
62Requires: kernel-tools-libs = %{version}-%{release}
63Provides: cpupowerutils-devel = 1:009-0.6.p1
64Provides: kernel-tools-devel
65Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
66
67%description libs-devel
68This package contains the development files for the tools/ directory
69from the kernel source.
70
fea1e605
ER
71%package perf
72Summary: perf tool
73Group: Applications/System
74
75%description perf
76Perf is a profiler tool for Linux 2.6+ based systems that abstracts
77away CPU hardware differences in Linux performance measurements and
78presents a simple commandline interface. Perf is based on the
79perf_events interface exported by recent versions of the Linux kernel.
80
49fba13a
ER
81%prep
82%setup -qc
83cd linux-%{basever}
84
85%if "%{postver}" != ".0"
86%patch0 -p1
87%endif
88
89%build
90cd linux-%{basever}
91
92# cpupower
93%{__make} -C tools/power/cpupower \
94 CC="%{__cc}" \
95 %{?with_verbose:V=1} \
96 CPUFREQ_BENCH=false
97
98%ifarch %{ix86}
99%{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
100 CC="%{__cc}" \
101 %{?with_verbose:V=1}
102%endif
103
104%ifarch %{x8664}
105%{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
106 CC="%{__cc}" \
107 %{?with_verbose:V=1}
108%endif
109
110%ifarch %{ix86} %{x8664}
111%{__make} -C tools/power/x86/x86_energy_perf_policy \
112 CC="%{__cc}" \
113 %{?with_verbose:V=1}
114%{__make} -C tools/power/x86/turbostat \
115 CC="%{__cc}" \
116 %{?with_verbose:V=1}
117%endif
118
fea1e605
ER
119%if %{with perf}
120# perf slang version
121PWD=${PWD:-$(pwd)}
122install -d $PWD/perf-{slang,gtk}
123%{__make} -C tools/perf \
124 O=$PWD/perf-slang \
125 NO_GTK2=1 \
126 CC="%{__cc}" \
127 %{?with_verbose:V=1} \
128 prefix=%{_prefix} \
129 perfexecdir=%{_datadir}/perf-core \
130 template_dir=%{_datadir}/perf-core/templates
131
132# perf gtk version
133%{__make} -C tools/perf \
134 O=$PWD/perf-gtk \
135 CC="%{__cc}" \
136 %{?with_verbose:V=1} \
137 prefix=%{_prefix} \
138 perfexecdir=%{_datadir}/perf-core \
139 template_dir=%{_datadir}/perf-core/templates
140%endif
141
49fba13a
ER
142%install
143rm -rf $RPM_BUILD_ROOT
144cd linux-%{basever}
145
146%{__make} -C tools/power/cpupower install \
147 DESTDIR=$RPM_BUILD_ROOT \
148 libdir=%{_libdir} \
149 mandir=%{_mandir} \
150 CPUFREQ_BENCH=false
151
152%find_lang cpupower
153mv cpupower.lang ..
154
155%ifarch %{ix86}
156cd tools/power/cpupower/debug/i386
157install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
158install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
159cd -
160%endif
161%ifarch %{x8664}
162cd tools/power/cpupower/debug/x86_64
163install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
164install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
165cd -
166%endif
167
168%ifarch %{ix86} %{x8664}
169install -d $RPM_BUILD_ROOT%{_mandir}/man8
170# broken makefile, install manually
171%if 0
172%{__make} install \
173 -C tools/power/x86/x86_energy_perf_policy \
174 DESTDIR=$RPM_BUILD_ROOT
175%else
176cd tools/power/x86/x86_energy_perf_policy
177install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
178install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
179cd -
180%endif
181
182# broken makefile, install manually
183%if 0
184%{__make} install \
185 -C tools/power/x86/turbostat \
186 DESTDIR=$RPM_BUILD_ROOT
187%else
188cd tools/power/x86/turbostat
189install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
190install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
fea1e605
ER
191cd -
192%endif
49fba13a 193%endif
fea1e605
ER
194
195%if %{with perf}
196# perf slang
197PWD=${PWD:-$(pwd)}
198# perf slang version
199%{__make} -j1 install install-man \
200 -C tools/perf \
201 O=$PWD/perf-slang \
202 NO_GTK2=1 \
203 CC="%{__cc}" \
204 %{?with_verbose:V=1} \
205 prefix=%{_prefix} \
206 perfexecdir=%{_datadir}/perf-core \
207 template_dir=%{_datadir}/perf-core/templates \
208 DESTDIR=$RPM_BUILD_ROOT
209
210# perf gtk
211%{__make} -j1 install install-man \
212 -C tools/perf \
213 O=$PWD/perf-gtk \
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
49fba13a
ER
220%endif
221
222%clean
223rm -rf $RPM_BUILD_ROOT
224
225%post libs -p /sbin/ldconfig
226%postun libs -p /sbin/ldconfig
227
228%files -f cpupower.lang
229%defattr(644,root,root,755)
230%attr(755,root,root) %{_bindir}/cpupower
231%ifarch %{ix86} %{x8664}
232%attr(755,root,root) %{_bindir}/centrino-decode
233%attr(755,root,root) %{_bindir}/powernow-k8-decode
234%endif
235%{_mandir}/man[1-8]/cpupower*
236%ifarch %{ix86} %{x8664}
237%attr(755,root,root) %{_bindir}/turbostat
238%attr(755,root,root) %{_bindir}/x86_energy_perf_policy
239%{_mandir}/man8/turbostat*
240%{_mandir}/man8/x86_energy_perf_policy*
241%endif
242
243%files libs
244%defattr(644,root,root,755)
245%attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
246%ghost %{_libdir}/libcpupower.so.0
247
248%files libs-devel
249%defattr(644,root,root,755)
250%{_libdir}/libcpupower.so
251%{_includedir}/cpufreq.h
fea1e605
ER
252
253%if %{with perf}
254%files perf
255%defattr(644,root,root,755)
256%attr(755,root,root) %{_bindir}/perf
257%{_mandir}/man1/perf*.1*
258%dir %{_datadir}/perf-core
259%attr(755,root,root) %{_datadir}/perf-core/perf-archive
260
261%dir %{_datadir}/perf-core/scripts
262
263%dir %{_datadir}/perf-core/scripts/perl
264%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
265%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
266%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
267%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
268%{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
269%dir %{_datadir}/perf-core/scripts/perl/bin
270%attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
271%{_datadir}/perf-core/scripts/perl/*.pl
272
273%dir %{_datadir}/perf-core/scripts/python
274%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
275%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
276%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
277%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
278%{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py
279%dir %{_datadir}/perf-core/scripts/python/bin
280%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
281%{_datadir}/perf-core/scripts/python/*.py
282%endif
This page took 0.082596 seconds and 4 git commands to generate.