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