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