]> git.pld-linux.org Git - packages/kernel-tools.git/blob - kernel-tools.spec
- drop cpufreq*utils P/O (see gnome-applets.spec)
[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.2
19 %define         postver         .1
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:        2
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:  3d5ea06d767e2f35c999eeadafc76523
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:   3e1cc007d930f8760ef0730609dca035
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
121 %description cpupower-libs-devel
122 Development files for the cpupower library.
123
124 %description cpupower-libs-devel -l pl.UTF-8
125 Pliki programistyczne biblioteki cpupower.
126
127 %package perf
128 Summary:        perf profiler tool
129 Summary(pl.UTF-8):      Narzędzie profilujące perf
130 Group:          Applications/System
131 Suggests:       binutils
132 Obsoletes:      perf-core
133 Obsoletes:      perf-slang
134
135 %description perf
136 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
137 away CPU hardware differences in Linux performance measurements and
138 presents a simple commandline interface. Perf is based on the
139 perf_events interface exported by recent versions of the Linux kernel.
140
141 This package contains core files, scripts and text interface (TUI).
142
143 %description perf -l pl.UTF-8
144 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
145 odseparowujące od różnic sprzętowych między pomiarami wydajności w
146 zależności od procesora oraz udostępniające prosty interfejs linii
147 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
148 przez nowe wersje jądra Linuksa.
149
150 Ten pakiet zawiera podstawowe pliki, skrypty oraz interfejs tekstowy
151 (TUI).
152
153 %package perf-vdso32
154 Summary:        perf profiler tool - VDSO 32-bit ABI reader
155 Summary(pl.UTF-8):      Narzędzie profilujące perf - odczyt VDSO dla ABI 32-bitowego
156 Group:          Applications/System
157 Requires:       %{name}-perf = %{version}-%{release}
158
159 %description perf-vdso32
160 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
161 away CPU hardware differences in Linux performance measurements and
162 presents a simple commandline interface. Perf is based on the
163 perf_events interface exported by recent versions of the Linux kernel.
164
165 This package contains perf-read-vdso32 tool for reading the 32-bit
166 compatibility VDSO in 64-bit mode.
167
168 %description perf-vdso32 -l pl.UTF-8
169 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
170 odseparowujące od różnic sprzętowych między pomiarami wydajności w
171 zależności od procesora oraz udostępniające prosty interfejs linii
172 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
173 przez nowe wersje jądra Linuksa.
174
175 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
176 binariów 32-bitowych w trybie 64-bitowym.
177
178 %package perf-vdsox32
179 Summary:        perf profiler tool - VDSO x32 ABI reader
180 Summary(pl.UTF-8):      Narzędzie profilujące perf - odczyt VDSO dla ABI x32
181 Group:          Applications/System
182 Requires:       %{name}-perf = %{version}-%{release}
183
184 %description perf-vdsox32
185 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
186 away CPU hardware differences in Linux performance measurements and
187 presents a simple commandline interface. Perf is based on the
188 perf_events interface exported by recent versions of the Linux kernel.
189
190 This package contains perf-read-vdso32 tool for reading the x32 mode
191 32-bit compatibility VDSO in 64-bit mode.
192
193 %description perf-vdsox32 -l pl.UTF-8
194 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
195 odseparowujące od różnic sprzętowych między pomiarami wydajności w
196 zależności od procesora oraz udostępniające prosty interfejs linii
197 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
198 przez nowe wersje jądra Linuksa.
199
200 Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
201 binariów ABI x32 w trybie 64-bitowym.
202
203 %package perf-gtk
204 Summary:        perf profiler tool (GTK+ 2 GUI)
205 Summary(pl.UTF-8):      Narzędzie profilujące perf (interfejs graficzny GTK+ 2)
206 Group:          X11/Applications
207 Requires:       %{name}-perf = %{version}-%{release}
208
209 %description perf-gtk
210 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
211 away CPU hardware differences in Linux performance measurements and
212 presents a simple commandline interface. Perf is based on the
213 perf_events interface exported by recent versions of the Linux kernel.
214
215 This package contains GTK+ 2 based GUI.
216
217 %description perf-gtk -l pl.UTF-8
218 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
219 odseparowujące od różnic sprzętowych między pomiarami wydajności w
220 zależności od procesora oraz udostępniające prosty interfejs linii
221 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
222 przez nowe wersje jądra Linuksa.
223
224 Ten pakiet zawiera graficzny interfejs oparty na GTK+ 2.
225
226 %package -n bash-completion-perf
227 Summary:        Bash completion for perf command
228 Summary(pl.UTF-8):      Bashowe uzupełnianie parametrów dla polecenia perf
229 Group:          Applications/Shells
230 Requires:       %{name}-perf
231 Requires:       bash-completion
232 %if "%{_rpmversion}" >= "5"
233 BuildArch:      noarch
234 %endif
235
236 %description -n bash-completion-perf
237 Bash completion for perf command.
238
239 %description -n bash-completion-perf -l pl.UTF-8
240 Bashowe uzupełnianie parametrów dla polecenia perf.
241
242 %prep
243 %setup -qc
244 cd linux-%{basever}
245
246 %if "%{postver}" != ".0"
247 %patch0 -p1
248 %endif
249
250 %patch1 -p1
251
252 sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
253
254 %build
255 cd linux-%{basever}
256
257 # Simple Disk Sleep Monitor
258 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} Documentation/laptops/dslm.c -o dslm
259
260 # cpupower
261 %{__make} -C tools/power/cpupower \
262         %{makeopts} \
263         CPUFREQ_BENCH=false \
264         OPTIMIZATION="%{rpmcflags}" \
265         STRIPCMD=true
266
267 %ifarch %{ix86} x32
268 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
269         CC="%{__cc}" \
270         CFLAGS="%{rpmcflags}"
271 %endif
272
273 %ifarch %{x8664} x32
274 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
275         CC="%{__cc}" \
276         CFLAGS="%{rpmcflags}"
277 %endif
278
279 %ifarch %{ix86} %{x8664} x32
280 %{__make} -C tools/power/x86/x86_energy_perf_policy \
281         CC="%{__cc}" \
282         CFLAGS="%{rpmcflags}"
283 CFLAGS="%{rpmcflags}" \
284 %{__make} -C tools/power/x86/turbostat \
285         CC="%{__cc}"
286 %endif
287
288 # page-types, slabinfo
289 %{__make} -C tools/vm page-types slabinfo \
290         CC="%{__cc}" \
291         CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
292
293 %if %{with perf}
294 %{__make} -C tools/perf all man \
295 %ifarch %{x8664}
296         IS_X86_64=1 \
297 %endif
298         %{!?with_gtk:NO_GTK2=1} \
299         %{!?with_libunwind:NO_LIBUNWIND=1} \
300         %{makeopts} \
301         CFLAGS_OPTIMIZE="%{rpmcflags}" \
302         WERROR=0 \
303         prefix=%{_prefix} \
304         perfexecdir=%{_datadir}/perf-core \
305         lib=%{_lib} \
306         template_dir=%{_datadir}/perf-core/templates
307 %endif
308
309 # gen_init_cpio
310 %{__make} -C usr gen_init_cpio \
311         %{makeopts} \
312         CFLAGS="%{rpmcflags}"
313
314 %install
315 rm -rf $RPM_BUILD_ROOT
316
317 cd linux-%{basever}
318 install -d $RPM_BUILD_ROOT%{_sbindir}
319
320 %{__make} -C tools/power/cpupower install \
321         DESTDIR=$RPM_BUILD_ROOT \
322         libdir=%{_libdir} \
323         mandir=%{_mandir} \
324         CPUFREQ_BENCH=false
325
326 %find_lang cpupower
327 mv cpupower.lang ..
328
329 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
330 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
331 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
332
333 %ifarch %{ix86} x32
334 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
335 %endif
336 %ifarch %{x8664} x32
337 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
338 %endif
339
340 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
341 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
342 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
343
344 %ifarch %{ix86} %{x8664} x32
345 install -d $RPM_BUILD_ROOT%{_mandir}/man8
346 %{__make} install \
347         -C tools/power/x86/x86_energy_perf_policy \
348         DESTDIR=$RPM_BUILD_ROOT
349
350 %{__make} install \
351         -C tools/power/x86/turbostat \
352         DESTDIR=$RPM_BUILD_ROOT
353 %endif
354
355 %if %{with perf}
356 %{__make} -j1 install install-man \
357         -C tools/perf \
358 %ifarch %{x8664}
359         IS_X86_64=1 \
360 %endif
361         %{!?with_gtk:NO_GTK2=1} \
362         %{!?with_libunwind:NO_LIBUNWIND=1} \
363         CC="%{__cc}" \
364         CFLAGS_OPTIMIZE="%{rpmcflags}" \
365         WERROR=0 \
366         %{?with_verbose:V=1} \
367         prefix=%{_prefix} \
368         perfexecdir=%{_datadir}/perf-core \
369         template_dir=%{_datadir}/perf-core/templates \
370         lib=%{_lib} \
371         DESTDIR=$RPM_BUILD_ROOT
372
373 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
374 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
375
376 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
377 %endif
378
379 # gen_init_cpio
380 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
381
382 %clean
383 rm -rf $RPM_BUILD_ROOT
384
385 %post   cpupower-libs -p /sbin/ldconfig
386 %postun cpupower-libs -p /sbin/ldconfig
387
388 %post cpupower
389 %systemd_post cpupower.service
390
391 %preun cpupower
392 %systemd_preun cpupower.service
393
394 %postun cpupower
395 %systemd_reload
396
397 %files
398 %defattr(644,root,root,755)
399 %attr(755,root,root) %{_bindir}/gen_init_cpio
400 %attr(755,root,root) %{_bindir}/slabinfo
401 %attr(755,root,root) %{_sbindir}/dslm
402 %attr(755,root,root) %{_sbindir}/page-types
403 %ifarch %{ix86} %{x8664} x32
404 %attr(755,root,root) %{_bindir}/centrino-decode
405 %attr(755,root,root) %{_bindir}/powernow-k8-decode
406 %endif
407 %ifarch %{ix86} %{x8664} x32
408 %attr(755,root,root) %{_bindir}/turbostat
409 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
410 %{_mandir}/man8/turbostat.8*
411 %{_mandir}/man8/x86_energy_perf_policy.8*
412 %endif
413
414 %files cpupower -f cpupower.lang
415 %defattr(644,root,root,755)
416 %attr(755,root,root) %{_bindir}/cpupower
417 %{_mandir}/man1/cpupower*.1*
418 %{systemdunitdir}/cpupower.service
419 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
420
421 %files cpupower-libs
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
424 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
425
426 %files cpupower-libs-devel
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_libdir}/libcpupower.so
429 %{_includedir}/cpufreq.h
430
431 %if %{with perf}
432 %files perf
433 %defattr(644,root,root,755)
434 %attr(755,root,root) %{_bindir}/perf
435 %attr(755,root,root) %{_bindir}/trace
436 %{_mandir}/man1/perf*.1*
437 %dir %{_datadir}/perf-core
438 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
439 %attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
440
441 %dir %{_datadir}/perf-core/scripts
442
443 %dir %{_datadir}/perf-core/scripts/perl
444 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
445 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
446 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
447 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
448 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
449 %dir %{_datadir}/perf-core/scripts/perl/bin
450 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
451 %{_datadir}/perf-core/scripts/perl/*.pl
452
453 %dir %{_datadir}/perf-core/scripts/python
454 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
455 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
456 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
457 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
458 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
459 %dir %{_datadir}/perf-core/scripts/python/bin
460 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
461 %{_datadir}/perf-core/scripts/python/*.py*
462
463 %dir %{_libdir}/traceevent
464 %dir %{_libdir}/traceevent/plugins
465 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
466
467 %ifarch %{x8664}
468 %files perf-vdso32
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{_bindir}/perf-read-vdso32
471
472 %files perf-vdsox32
473 %defattr(644,root,root,755)
474 %attr(755,root,root) %{_bindir}/perf-read-vdsox32
475 %endif
476
477 %if %{with gtk}
478 %files perf-gtk
479 %defattr(644,root,root,755)
480 %attr(755,root,root) %{_libdir}/libperf-gtk.so
481 %endif
482
483 %files -n bash-completion-perf
484 %defattr(644,root,root,755)
485 /etc/bash_completion.d/perf
486 %endif
This page took 0.130808 seconds and 4 git commands to generate.