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