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