]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools.spec
BR: pciutils-devel (for cpupower)
[packages/kernel-tools.git] / kernel-tools.spec
CommitLineData
bb6b0f50
ER
1# TODO:
2# - redefine: PACKAGE_BUGREPORT=cpufreq@vger.kernel.org
b1f08c11
ER
3# - add -n python-perf?
4# - without perf bcond does not work (it still builds it)
5# - add bcond to disable building docs (perf docs)
6# - install of perf compiles things over again
bb6b0f50 7
49fba13a
ER
8# Conditional build:
9%bcond_without verbose # verbose build (V=1)
db5f9ac9 10%bcond_without perf # perf tools
bc35d286 11%bcond_without gtk # gtk perf version
49fba13a 12
f111fe43
JK
13%define rel 1
14%define basever 3.10
15%define postver .18
49fba13a 16Summary: Assortment of tools for the Linux kernel
bd620db3 17Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa
49fba13a
ER
18Name: kernel-tools
19Version: %{basever}%{postver}
20Release: %{rel}
21License: GPL v2
fea1e605 22Group: Applications/System
49fba13a 23Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
f111fe43 24# Source0-md5: 4f25cd5bec5f8d5a7d935b3f2ccb8481
49fba13a 25%if "%{postver}" != ".0"
83e3cc6b 26Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
f111fe43 27# Patch0-md5: e39b75595bf61d758087e1ddecd01a12
49fba13a 28%endif
f57fcd71
ER
29Source1: cpupower.service
30Source2: cpupower.config
52583efa 31URL: http://www.kernel.org/
f57fcd71 32BuildRequires: rpmbuild(macros) >= 1.647
9596c3d3 33BuildRequires: pciutils-devel
49fba13a
ER
34BuildRequires: tar >= 1:1.22
35BuildRequires: xz
fea1e605
ER
36%if %{with perf}
37BuildRequires: asciidoc
52583efa 38BuildRequires: audit-libs-devel
db5f9ac9 39BuildRequires: binutils-devel
52583efa
JB
40BuildRequires: bison
41BuildRequires: docbook-style-xsl
42BuildRequires: elfutils-devel
43BuildRequires: flex
bc35d286 44%{?with_gtk:BuildRequires: gtk+2-devel >= 2.0}
52583efa 45BuildRequires: libunwind-devel >= 0.99
a1c57a8e 46BuildRequires: newt-devel
52583efa
JB
47BuildRequires: perl-devel >= 5.1
48BuildRequires: pkgconfig
49BuildRequires: python-devel
fea1e605 50BuildRequires: rpm-pythonprov
a1c57a8e 51BuildRequires: slang-devel
fea1e605 52BuildRequires: xmlto
fea1e605 53%endif
49fba13a
ER
54BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
60972f76
ER
56%define makeopts CC="%{__cc}" %{?with_verbose:V=1}
57
49fba13a 58%description
bd620db3
JB
59This package contains the software from tools/ subdirectory from Linux
60kernel source and the supporting documentation.
61
62%description -l pl.UTF-8
63Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
64Linuksa oraz związaną z nim dokumentację.
49fba13a 65
4bc5704a
JK
66%package cpupower
67Summary: cpupower - Shows and sets processor power related values
bd620db3 68Summary(pl.UTF-8): cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
4bc5704a 69Group: Applications/System
f57fcd71 70Requires(post,preun,postun): systemd-units >= 38
91fd1f55 71Requires: %{name}-cpupower-libs = %{version}-%{release}
f57fcd71 72Requires: systemd-units >= 0.38
2bd21e06
ER
73Provides: cpufreq-utils = 1:009-0.6.p1
74Provides: cpufrequtils = 1:009-0.6.p1
75Provides: cpupowerutils = 1:009-0.6.p1
76Obsoletes: cpufreq-utils < 1:009-0.6.p1
77Obsoletes: cpufrequtils < 1:009-0.6.p1
78Obsoletes: cpupowerutils < 1:009-0.6.p1
79Obsoletes: cpuspeed < 1:1.5-16
4bc5704a
JK
80
81%description cpupower
60972f76
ER
82cpupower is a collection of tools to examine and tune power saving
83related features of your processor.
4bc5704a 84
bd620db3
JB
85%description cpupower -l pl.UTF-8
86cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
87związanych z oszczędzaniem energii.
88
4bc5704a 89%package cpupower-libs
bd620db3
JB
90Summary: cpupower library
91Summary(pl.UTF-8): Biblioteka cpupower
49fba13a
ER
92Group: Libraries
93
4bc5704a 94%description cpupower-libs
bd620db3
JB
95cpupower library.
96
97%description cpupower-libs -l pl.UTF-8
98Biblioteka cpupower.
49fba13a 99
4bc5704a 100%package cpupower-libs-devel
bd620db3
JB
101Summary: Development files for the cpupower library
102Summary(pl.UTF-8): Pliki programistyczne biblioteki cpupower
49fba13a 103Group: Development/Libraries
178c4b31
ER
104Requires: %{name} = %{version}-%{release}
105Requires: %{name}-cpupower-libs = %{version}-%{release}
91fd1f55 106Provides: cpufrequtils-devel = 1:009-0.6.p1
49fba13a 107Provides: cpupowerutils-devel = 1:009-0.6.p1
91fd1f55 108Obsoletes: cpufrequtils-devel < 1:009-0.6.p1
49fba13a
ER
109Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
110
4bc5704a 111%description cpupower-libs-devel
bd620db3
JB
112Development files for the cpupower library.
113
114%description cpupower-libs-devel -l pl.UTF-8
115Pliki programistyczne biblioteki cpupower.
49fba13a 116
db5f9ac9
JB
117%package perf-core
118Summary: perf profiler tool (core package)
119Summary(pl.UTF-8): Narzędzie profilujące perf (podstawowe narzędzia)
fea1e605
ER
120Group: Applications/System
121
db5f9ac9 122%description perf-core
fea1e605
ER
123Perf is a profiler tool for Linux 2.6+ based systems that abstracts
124away CPU hardware differences in Linux performance measurements and
125presents a simple commandline interface. Perf is based on the
126perf_events interface exported by recent versions of the Linux kernel.
127
db5f9ac9
JB
128This package contains core files and scripts.
129
130%description perf-core -l pl.UTF-8
131Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
132odseparowujące od różnic sprzętowych między pomiarami wydajności w
133zależności od procesora oraz udostępniające prosty interfejs linii
134poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
135przez nowe wersje jądra Linuksa.
136
137Ten pakiet zawiera podstawowe pliki i skrypty.
138
139%package perf-gtk
140Summary: perf profiler tool (GTK+ GUI)
141Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+)
142Group: X11/Applications
143Requires: %{name}-perf-core = %{version}-%{release}
144Provides: %{name}-perf = %{version}-%{release}
145
146%description perf-gtk
147Perf is a profiler tool for Linux 2.6+ based systems that abstracts
148away CPU hardware differences in Linux performance measurements and
149presents a simple commandline interface. Perf is based on the
150perf_events interface exported by recent versions of the Linux kernel.
151
152This package contains GTK+ based GUI.
153
154%description perf-gtk -l pl.UTF-8
155Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
156odseparowujące od różnic sprzętowych między pomiarami wydajności w
157zależności od procesora oraz udostępniające prosty interfejs linii
158poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
159przez nowe wersje jądra Linuksa.
160
161Ten pakiet zawiera graficzny interfejs oparty na GTK+.
162
163%package perf-slang
164Summary: perf profiler tool (Slang TUI)
165Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs tekstowy Slang)
166Group: X11/Applications
167Requires: %{name}-perf-core = %{version}-%{release}
168Provides: %{name}-perf = %{version}-%{release}
169
170%description perf-slang
171Perf is a profiler tool for Linux 2.6+ based systems that abstracts
172away CPU hardware differences in Linux performance measurements and
173presents a simple commandline interface. Perf is based on the
174perf_events interface exported by recent versions of the Linux kernel.
175
176This package contains Slang based TUI.
177
178%description perf-slang -l pl.UTF-8
bd620db3
JB
179Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
180odseparowujące od różnic sprzętowych między pomiarami wydajności w
181zależności od procesora oraz udostępniające prosty interfejs linii
182poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
183przez nowe wersje jądra Linuksa.
184
db5f9ac9
JB
185Ten pakiet zawiera tekstowy interfejs oparty na bibliotece Slang.
186
187%package -n bash-completion-perf
188Summary: Bash completion for perf command
189Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
190Group: Applications/Shells
3385eb86 191Requires: %{name}-perf
db5f9ac9
JB
192Requires: bash-completion
193
194%description -n bash-completion-perf
195Bash completion for perf command.
196
197%description -n bash-completion-perf -l pl.UTF-8
198Bashowe uzupełnianie parametrów dla polecenia perf.
199
49fba13a
ER
200%prep
201%setup -qc
202cd linux-%{basever}
203
204%if "%{postver}" != ".0"
205%patch0 -p1
206%endif
207
208%build
209cd linux-%{basever}
210
b1f08c11
ER
211# Simple Disk Sleep Monitor
212%{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
213
49fba13a
ER
214# cpupower
215%{__make} -C tools/power/cpupower \
60972f76 216 %{makeopts} \
fb1ff9fc
JB
217 CPUFREQ_BENCH=false \
218 OPTIMIZATION="%{rpmcflags}" \
219 STRIPCMD=true
49fba13a
ER
220
221%ifarch %{ix86}
222%{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
fb1ff9fc
JB
223 CC="%{__cc}" \
224 CFLAGS="%{rpmcflags}"
49fba13a
ER
225%endif
226
227%ifarch %{x8664}
228%{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
fb1ff9fc
JB
229 CC="%{__cc}" \
230 CFLAGS="%{rpmcflags}"
49fba13a
ER
231%endif
232
233%ifarch %{ix86} %{x8664}
234%{__make} -C tools/power/x86/x86_energy_perf_policy \
fb1ff9fc
JB
235 CC="%{__cc}" \
236 CFLAGS="%{rpmcflags}"
49fba13a 237%{__make} -C tools/power/x86/turbostat \
fb1ff9fc 238 CC="%{__cc}" \
83e3cc6b 239 CFLAGS="%{rpmcflags} -Wall -I../../../../arch/x86/include/uapi/"
49fba13a
ER
240%endif
241
f111fe43
JK
242# page-types, slabinfo
243%{__make} -C tools/vm page-types slabinfo \
701b458f 244 CC="%{__cc}" \
f111fe43 245 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
701b458f 246
fea1e605
ER
247%if %{with perf}
248# perf slang version
249PWD=${PWD:-$(pwd)}
250install -d $PWD/perf-{slang,gtk}
52583efa 251%{__make} -C tools/perf all man \
fea1e605
ER
252 O=$PWD/perf-slang \
253 NO_GTK2=1 \
60972f76 254 %{makeopts} \
fb1ff9fc 255 CFLAGS_OPTIMIZE="%{rpmcflags}" \
d0e13ec9 256 WERROR=0 \
fea1e605
ER
257 prefix=%{_prefix} \
258 perfexecdir=%{_datadir}/perf-core \
259 template_dir=%{_datadir}/perf-core/templates
260
bc35d286 261%if %{with gtk}
fea1e605 262# perf gtk version
52583efa 263%{__make} -C tools/perf all man \
fea1e605 264 O=$PWD/perf-gtk \
60972f76 265 %{makeopts} \
fb1ff9fc 266 CFLAGS_OPTIMIZE="%{rpmcflags}" \
d0e13ec9 267 WERROR=0 \
fea1e605
ER
268 prefix=%{_prefix} \
269 perfexecdir=%{_datadir}/perf-core \
270 template_dir=%{_datadir}/perf-core/templates
271%endif
bc35d286 272%endif
fea1e605 273
dd28be58
JK
274# gen_init_cpio
275%{__make} -C usr gen_init_cpio \
60972f76 276 %{makeopts} \
fb1ff9fc 277 CFLAGS="%{rpmcflags}"
dd28be58 278
49fba13a
ER
279%install
280rm -rf $RPM_BUILD_ROOT
b1f08c11 281
49fba13a 282cd linux-%{basever}
b1f08c11 283install -d $RPM_BUILD_ROOT%{_sbindir}
49fba13a 284
bd620db3 285%{__make} -C tools/power/cpupower install \
49fba13a
ER
286 DESTDIR=$RPM_BUILD_ROOT \
287 libdir=%{_libdir} \
288 mandir=%{_mandir} \
289 CPUFREQ_BENCH=false
290
291%find_lang cpupower
292mv cpupower.lang ..
293
f57fcd71
ER
294install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
295cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
296cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
297
49fba13a 298%ifarch %{ix86}
701b458f 299install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
49fba13a
ER
300%endif
301%ifarch %{x8664}
701b458f 302install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
49fba13a
ER
303%endif
304
b1f08c11 305install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
f111fe43 306install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
b1f08c11 307install -p dslm $RPM_BUILD_ROOT%{_sbindir}
701b458f 308
49fba13a
ER
309%ifarch %{ix86} %{x8664}
310install -d $RPM_BUILD_ROOT%{_mandir}/man8
311# broken makefile, install manually
312%if 0
313%{__make} install \
314 -C tools/power/x86/x86_energy_perf_policy \
315 DESTDIR=$RPM_BUILD_ROOT
316%else
317cd tools/power/x86/x86_energy_perf_policy
318install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
b1f08c11 319cp -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
49fba13a
ER
320cd -
321%endif
322
323# broken makefile, install manually
324%if 0
325%{__make} install \
326 -C tools/power/x86/turbostat \
327 DESTDIR=$RPM_BUILD_ROOT
328%else
329cd tools/power/x86/turbostat
b1f08c11 330cp -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
fea1e605 331cd -
b4d3d8ff 332install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
fea1e605 333%endif
49fba13a 334%endif
fea1e605
ER
335
336%if %{with perf}
337# perf slang
338PWD=${PWD:-$(pwd)}
339# perf slang version
340%{__make} -j1 install install-man \
341 -C tools/perf \
342 O=$PWD/perf-slang \
343 NO_GTK2=1 \
344 CC="%{__cc}" \
fb1ff9fc 345 CFLAGS_OPTIMIZE="%{rpmcflags}" \
6e9d46c8 346 WERROR=0 \
fea1e605
ER
347 %{?with_verbose:V=1} \
348 prefix=%{_prefix} \
349 perfexecdir=%{_datadir}/perf-core \
350 template_dir=%{_datadir}/perf-core/templates \
351 DESTDIR=$RPM_BUILD_ROOT
4ca26053 352%{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,_slang}
fea1e605 353
bc35d286 354%if %{with gtk}
fea1e605
ER
355# perf gtk
356%{__make} -j1 install install-man \
357 -C tools/perf \
358 O=$PWD/perf-gtk \
359 CC="%{__cc}" \
fb1ff9fc 360 CFLAGS_OPTIMIZE="%{rpmcflags}" \
6e9d46c8 361 WERROR=0 \
fea1e605
ER
362 %{?with_verbose:V=1} \
363 prefix=%{_prefix} \
364 perfexecdir=%{_datadir}/perf-core \
365 template_dir=%{_datadir}/perf-core/templates \
366 DESTDIR=$RPM_BUILD_ROOT
4ca26053 367%{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,_gtk}
bc35d286 368%endif
db5f9ac9
JB
369
370%py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
371%py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
49fba13a
ER
372%endif
373
dd28be58 374# gen_init_cpio
60972f76 375install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
dd28be58 376
b4d3d8ff
ER
377rm -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
378
49fba13a
ER
379%clean
380rm -rf $RPM_BUILD_ROOT
381
4bc5704a
JK
382%post cpupower-libs -p /sbin/ldconfig
383%postun cpupower-libs -p /sbin/ldconfig
49fba13a 384
f57fcd71
ER
385%post cpupower
386%systemd_post cpupower.service
387
388%preun cpupower
389%systemd_preun cpupower.service
390
391%postun cpupower
392%systemd_reload
393
4bc5704a 394%files
49fba13a 395%defattr(644,root,root,755)
701b458f
JB
396%attr(755,root,root) %{_bindir}/gen_init_cpio
397%attr(755,root,root) %{_bindir}/slabinfo
b1f08c11 398%attr(755,root,root) %{_sbindir}/dslm
f111fe43 399%attr(755,root,root) %{_sbindir}/page-types
49fba13a
ER
400%ifarch %{ix86} %{x8664}
401%attr(755,root,root) %{_bindir}/centrino-decode
402%attr(755,root,root) %{_bindir}/powernow-k8-decode
403%endif
49fba13a
ER
404%ifarch %{ix86} %{x8664}
405%attr(755,root,root) %{_bindir}/turbostat
406%attr(755,root,root) %{_bindir}/x86_energy_perf_policy
bd620db3
JB
407%{_mandir}/man8/turbostat.8*
408%{_mandir}/man8/x86_energy_perf_policy.8*
49fba13a
ER
409%endif
410
4bc5704a
JK
411%files cpupower -f cpupower.lang
412%defattr(644,root,root,755)
413%attr(755,root,root) %{_bindir}/cpupower
bd620db3 414%{_mandir}/man1/cpupower*.1*
f57fcd71
ER
415%{systemdunitdir}/cpupower.service
416%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
4bc5704a
JK
417
418%files cpupower-libs
49fba13a
ER
419%defattr(644,root,root,755)
420%attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
bd620db3 421%attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
49fba13a 422
4bc5704a 423%files cpupower-libs-devel
49fba13a 424%defattr(644,root,root,755)
bd620db3 425%attr(755,root,root) %{_libdir}/libcpupower.so
49fba13a 426%{_includedir}/cpufreq.h
fea1e605
ER
427
428%if %{with perf}
db5f9ac9 429%files perf-core
fea1e605 430%defattr(644,root,root,755)
fea1e605
ER
431%{_mandir}/man1/perf*.1*
432%dir %{_datadir}/perf-core
433%attr(755,root,root) %{_datadir}/perf-core/perf-archive
434
435%dir %{_datadir}/perf-core/scripts
436
437%dir %{_datadir}/perf-core/scripts/perl
438%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
439%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
440%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
441%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
442%{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
443%dir %{_datadir}/perf-core/scripts/perl/bin
444%attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
445%{_datadir}/perf-core/scripts/perl/*.pl
446
447%dir %{_datadir}/perf-core/scripts/python
448%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
449%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
450%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
451%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
db5f9ac9 452%{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
fea1e605
ER
453%dir %{_datadir}/perf-core/scripts/python/bin
454%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
db5f9ac9
JB
455%{_datadir}/perf-core/scripts/python/*.py*
456
bc35d286 457%if %{with gtk}
db5f9ac9
JB
458%files perf-gtk
459%defattr(644,root,root,755)
4ca26053 460%attr(755,root,root) %{_bindir}/perf_gtk
bc35d286 461%endif
db5f9ac9
JB
462
463%files perf-slang
464%defattr(644,root,root,755)
4ca26053 465%attr(755,root,root) %{_bindir}/perf_slang
db5f9ac9
JB
466
467%files -n bash-completion-perf
468%defattr(644,root,root,755)
469/etc/bash_completion.d/perf
fea1e605 470%endif
This page took -7060.626759 seconds and 4 git commands to generate.