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