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