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