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