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