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