]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools.spec
gen_init_cpio added
[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
dd28be58
JK
142# gen_init_cpio
143%{__make} -C usr gen_init_cpio \
144 CC="%{__cc}" \
145 %{?with_verbose:V=1}
146
49fba13a
ER
147%install
148rm -rf $RPM_BUILD_ROOT
149cd linux-%{basever}
150
151%{__make} -C tools/power/cpupower install \
152 DESTDIR=$RPM_BUILD_ROOT \
153 libdir=%{_libdir} \
154 mandir=%{_mandir} \
155 CPUFREQ_BENCH=false
156
157%find_lang cpupower
158mv cpupower.lang ..
159
160%ifarch %{ix86}
161cd tools/power/cpupower/debug/i386
162install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
163install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
164cd -
165%endif
166%ifarch %{x8664}
167cd tools/power/cpupower/debug/x86_64
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
173%ifarch %{ix86} %{x8664}
174install -d $RPM_BUILD_ROOT%{_mandir}/man8
175# broken makefile, install manually
176%if 0
177%{__make} install \
178 -C tools/power/x86/x86_energy_perf_policy \
179 DESTDIR=$RPM_BUILD_ROOT
180%else
181cd tools/power/x86/x86_energy_perf_policy
182install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
183install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
184cd -
185%endif
186
187# broken makefile, install manually
188%if 0
189%{__make} install \
190 -C tools/power/x86/turbostat \
191 DESTDIR=$RPM_BUILD_ROOT
192%else
193cd tools/power/x86/turbostat
194install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
195install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
fea1e605
ER
196cd -
197%endif
49fba13a 198%endif
fea1e605
ER
199
200%if %{with perf}
201# perf slang
202PWD=${PWD:-$(pwd)}
203# perf slang version
204%{__make} -j1 install install-man \
205 -C tools/perf \
206 O=$PWD/perf-slang \
207 NO_GTK2=1 \
208 CC="%{__cc}" \
209 %{?with_verbose:V=1} \
210 prefix=%{_prefix} \
211 perfexecdir=%{_datadir}/perf-core \
212 template_dir=%{_datadir}/perf-core/templates \
213 DESTDIR=$RPM_BUILD_ROOT
214
215# perf gtk
216%{__make} -j1 install install-man \
217 -C tools/perf \
218 O=$PWD/perf-gtk \
219 CC="%{__cc}" \
220 %{?with_verbose:V=1} \
221 prefix=%{_prefix} \
222 perfexecdir=%{_datadir}/perf-core \
223 template_dir=%{_datadir}/perf-core/templates \
224 DESTDIR=$RPM_BUILD_ROOT
49fba13a
ER
225%endif
226
dd28be58
JK
227# gen_init_cpio
228install usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
229
49fba13a
ER
230%clean
231rm -rf $RPM_BUILD_ROOT
232
233%post libs -p /sbin/ldconfig
234%postun libs -p /sbin/ldconfig
235
236%files -f cpupower.lang
237%defattr(644,root,root,755)
238%attr(755,root,root) %{_bindir}/cpupower
239%ifarch %{ix86} %{x8664}
240%attr(755,root,root) %{_bindir}/centrino-decode
241%attr(755,root,root) %{_bindir}/powernow-k8-decode
242%endif
243%{_mandir}/man[1-8]/cpupower*
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*
249%endif
dd28be58 250%attr(755,root,root) %{_bindir}/gen_init_cpio
49fba13a
ER
251
252%files libs
253%defattr(644,root,root,755)
254%attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
255%ghost %{_libdir}/libcpupower.so.0
256
257%files libs-devel
258%defattr(644,root,root,755)
259%{_libdir}/libcpupower.so
260%{_includedir}/cpufreq.h
fea1e605
ER
261
262%if %{with perf}
263%files perf
264%defattr(644,root,root,755)
265%attr(755,root,root) %{_bindir}/perf
266%{_mandir}/man1/perf*.1*
267%dir %{_datadir}/perf-core
268%attr(755,root,root) %{_datadir}/perf-core/perf-archive
269
270%dir %{_datadir}/perf-core/scripts
271
272%dir %{_datadir}/perf-core/scripts/perl
273%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
274%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
275%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
276%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
277%{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
278%dir %{_datadir}/perf-core/scripts/perl/bin
279%attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
280%{_datadir}/perf-core/scripts/perl/*.pl
281
282%dir %{_datadir}/perf-core/scripts/python
283%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
284%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
285%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
286%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
287%{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py
288%dir %{_datadir}/perf-core/scripts/python/bin
289%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
290%{_datadir}/perf-core/scripts/python/*.py
291%endif
This page took 0.989817 seconds and 4 git commands to generate.