]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools.spec
- typo
[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 \
ae4c1fd4 250 %{!?with_gtk:NO_GTK2=1} \
5a8bbd03 251 %{!?with_libunwind:NO_LIBUNWIND=1} \
60972f76 252 %{makeopts} \
fb1ff9fc 253 CFLAGS_OPTIMIZE="%{rpmcflags}" \
d0e13ec9 254 WERROR=0 \
fea1e605
ER
255 prefix=%{_prefix} \
256 perfexecdir=%{_datadir}/perf-core \
4f4642fc 257 lib=%{_lib} \
fea1e605 258 template_dir=%{_datadir}/perf-core/templates
bc35d286 259%endif
fea1e605 260
dd28be58
JK
261# gen_init_cpio
262%{__make} -C usr gen_init_cpio \
60972f76 263 %{makeopts} \
fb1ff9fc 264 CFLAGS="%{rpmcflags}"
dd28be58 265
49fba13a
ER
266%install
267rm -rf $RPM_BUILD_ROOT
b1f08c11 268
49fba13a 269cd linux-%{basever}
b1f08c11 270install -d $RPM_BUILD_ROOT%{_sbindir}
49fba13a 271
bd620db3 272%{__make} -C tools/power/cpupower install \
49fba13a
ER
273 DESTDIR=$RPM_BUILD_ROOT \
274 libdir=%{_libdir} \
275 mandir=%{_mandir} \
276 CPUFREQ_BENCH=false
277
278%find_lang cpupower
279mv cpupower.lang ..
280
f57fcd71
ER
281install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
282cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
283cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
284
bedc6c43 285%ifarch %{ix86} x32
701b458f 286install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
49fba13a 287%endif
bedc6c43 288%ifarch %{x8664} x32
701b458f 289install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
49fba13a
ER
290%endif
291
b1f08c11 292install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
f111fe43 293install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
b1f08c11 294install -p dslm $RPM_BUILD_ROOT%{_sbindir}
701b458f 295
bedc6c43 296%ifarch %{ix86} %{x8664} x32
49fba13a
ER
297install -d $RPM_BUILD_ROOT%{_mandir}/man8
298# broken makefile, install manually
299%if 0
300%{__make} install \
301 -C tools/power/x86/x86_energy_perf_policy \
302 DESTDIR=$RPM_BUILD_ROOT
303%else
304cd tools/power/x86/x86_energy_perf_policy
305install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
b1f08c11 306cp -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
49fba13a
ER
307cd -
308%endif
309
310# broken makefile, install manually
311%if 0
312%{__make} install \
313 -C tools/power/x86/turbostat \
314 DESTDIR=$RPM_BUILD_ROOT
315%else
316cd tools/power/x86/turbostat
b1f08c11 317cp -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
fea1e605 318cd -
b4d3d8ff 319install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
fea1e605 320%endif
49fba13a 321%endif
fea1e605
ER
322
323%if %{with perf}
fea1e605
ER
324%{__make} -j1 install install-man \
325 -C tools/perf \
ae4c1fd4 326 %{!?with_gtk:NO_GTK2=1} \
5a8bbd03 327 %{!?with_libunwind:NO_LIBUNWIND=1} \
fea1e605 328 CC="%{__cc}" \
fb1ff9fc 329 CFLAGS_OPTIMIZE="%{rpmcflags}" \
6e9d46c8 330 WERROR=0 \
fea1e605
ER
331 %{?with_verbose:V=1} \
332 prefix=%{_prefix} \
333 perfexecdir=%{_datadir}/perf-core \
334 template_dir=%{_datadir}/perf-core/templates \
4f4642fc 335 lib=%{_lib} \
fea1e605 336 DESTDIR=$RPM_BUILD_ROOT
db5f9ac9
JB
337
338%py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
339%py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
a8b28c3a 340
4b352448 341%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
49fba13a
ER
342%endif
343
dd28be58 344# gen_init_cpio
60972f76 345install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
dd28be58 346
49fba13a
ER
347%clean
348rm -rf $RPM_BUILD_ROOT
349
4bc5704a
JK
350%post cpupower-libs -p /sbin/ldconfig
351%postun cpupower-libs -p /sbin/ldconfig
49fba13a 352
f57fcd71
ER
353%post cpupower
354%systemd_post cpupower.service
355
356%preun cpupower
357%systemd_preun cpupower.service
358
359%postun cpupower
360%systemd_reload
361
4bc5704a 362%files
49fba13a 363%defattr(644,root,root,755)
701b458f
JB
364%attr(755,root,root) %{_bindir}/gen_init_cpio
365%attr(755,root,root) %{_bindir}/slabinfo
b1f08c11 366%attr(755,root,root) %{_sbindir}/dslm
f111fe43 367%attr(755,root,root) %{_sbindir}/page-types
bedc6c43 368%ifarch %{ix86} %{x8664} x32
49fba13a
ER
369%attr(755,root,root) %{_bindir}/centrino-decode
370%attr(755,root,root) %{_bindir}/powernow-k8-decode
371%endif
bedc6c43 372%ifarch %{ix86} %{x8664} x32
49fba13a
ER
373%attr(755,root,root) %{_bindir}/turbostat
374%attr(755,root,root) %{_bindir}/x86_energy_perf_policy
bd620db3
JB
375%{_mandir}/man8/turbostat.8*
376%{_mandir}/man8/x86_energy_perf_policy.8*
49fba13a
ER
377%endif
378
4bc5704a
JK
379%files cpupower -f cpupower.lang
380%defattr(644,root,root,755)
381%attr(755,root,root) %{_bindir}/cpupower
bd620db3 382%{_mandir}/man1/cpupower*.1*
f57fcd71
ER
383%{systemdunitdir}/cpupower.service
384%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
4bc5704a
JK
385
386%files cpupower-libs
49fba13a
ER
387%defattr(644,root,root,755)
388%attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
bd620db3 389%attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
49fba13a 390
4bc5704a 391%files cpupower-libs-devel
49fba13a 392%defattr(644,root,root,755)
bd620db3 393%attr(755,root,root) %{_libdir}/libcpupower.so
49fba13a 394%{_includedir}/cpufreq.h
fea1e605
ER
395
396%if %{with perf}
ae4c1fd4 397%files perf
fea1e605 398%defattr(644,root,root,755)
35be6466 399%attr(755,root,root) %{_bindir}/perf
bedc6c43 400%ifarch %{x8664}
4f4642fc 401%attr(755,root,root) %{_bindir}/perf-read-vdso32
bedc6c43
JR
402%attr(755,root,root) %{_bindir}/perf-read-vdsox32
403%endif
ae4c1fd4 404%attr(755,root,root) %{_bindir}/trace
fea1e605
ER
405%{_mandir}/man1/perf*.1*
406%dir %{_datadir}/perf-core
407%attr(755,root,root) %{_datadir}/perf-core/perf-archive
4f4642fc 408%attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
fea1e605
ER
409
410%dir %{_datadir}/perf-core/scripts
411
412%dir %{_datadir}/perf-core/scripts/perl
413%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
414%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
415%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
416%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
417%{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
418%dir %{_datadir}/perf-core/scripts/perl/bin
419%attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
420%{_datadir}/perf-core/scripts/perl/*.pl
421
422%dir %{_datadir}/perf-core/scripts/python
423%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
424%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
425%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
426%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
db5f9ac9 427%{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
fea1e605
ER
428%dir %{_datadir}/perf-core/scripts/python/bin
429%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
db5f9ac9
JB
430%{_datadir}/perf-core/scripts/python/*.py*
431
eb373af4
AM
432%dir %{_libdir}/traceevent
433%dir %{_libdir}/traceevent/plugins
434%attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
435
bc35d286 436%if %{with gtk}
db5f9ac9
JB
437%files perf-gtk
438%defattr(644,root,root,755)
ae4c1fd4 439%attr(755,root,root) %{_libdir}/libperf-gtk.so
bc35d286 440%endif
db5f9ac9 441
db5f9ac9
JB
442%files -n bash-completion-perf
443%defattr(644,root,root,755)
444/etc/bash_completion.d/perf
fea1e605 445%endif
This page took 2.184271 seconds and 4 git commands to generate.