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