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