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