]> git.pld-linux.org Git - packages/kernel-tools.git/blob - kernel-tools.spec
- make sure to enable x86_64 features
[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 %ifarch %{x8664}
251         IS_X86_64=1 \
252 %endif
253         %{!?with_gtk:NO_GTK2=1} \
254         %{!?with_libunwind:NO_LIBUNWIND=1} \
255         %{makeopts} \
256         CFLAGS_OPTIMIZE="%{rpmcflags}" \
257         WERROR=0 \
258         prefix=%{_prefix} \
259         perfexecdir=%{_datadir}/perf-core \
260         lib=%{_lib} \
261         template_dir=%{_datadir}/perf-core/templates
262 %endif
263
264 # gen_init_cpio
265 %{__make} -C usr gen_init_cpio \
266         %{makeopts} \
267         CFLAGS="%{rpmcflags}"
268
269 %install
270 rm -rf $RPM_BUILD_ROOT
271
272 cd linux-%{basever}
273 install -d $RPM_BUILD_ROOT%{_sbindir}
274
275 %{__make} -C tools/power/cpupower install \
276         DESTDIR=$RPM_BUILD_ROOT \
277         libdir=%{_libdir} \
278         mandir=%{_mandir} \
279         CPUFREQ_BENCH=false
280
281 %find_lang cpupower
282 mv cpupower.lang ..
283
284 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
285 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
286 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
287
288 %ifarch %{ix86} x32
289 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
290 %endif
291 %ifarch %{x8664} x32
292 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
293 %endif
294
295 install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
296 install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
297 install -p dslm $RPM_BUILD_ROOT%{_sbindir}
298
299 %ifarch %{ix86} %{x8664} x32
300 install -d $RPM_BUILD_ROOT%{_mandir}/man8
301 # broken makefile, install manually
302 %if 0
303 %{__make} install \
304         -C tools/power/x86/x86_energy_perf_policy \
305         DESTDIR=$RPM_BUILD_ROOT
306 %else
307 cd tools/power/x86/x86_energy_perf_policy
308 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
309 cp -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
310 cd -
311 %endif
312
313 # broken makefile, install manually
314 %if 0
315 %{__make} install \
316         -C tools/power/x86/turbostat \
317         DESTDIR=$RPM_BUILD_ROOT
318 %else
319 cd tools/power/x86/turbostat
320 cp -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
321 cd -
322 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
323 %endif
324 %endif
325
326 %if %{with perf}
327 %{__make} -j1 install install-man \
328         -C tools/perf \
329 %ifarch %{x8664}
330         IS_X86_64=1 \
331 %endif
332         %{!?with_gtk:NO_GTK2=1} \
333         %{!?with_libunwind:NO_LIBUNWIND=1} \
334         CC="%{__cc}" \
335         CFLAGS_OPTIMIZE="%{rpmcflags}" \
336         WERROR=0 \
337         %{?with_verbose:V=1} \
338         prefix=%{_prefix} \
339         perfexecdir=%{_datadir}/perf-core \
340         template_dir=%{_datadir}/perf-core/templates \
341         lib=%{_lib} \
342         DESTDIR=$RPM_BUILD_ROOT
343
344 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
345 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
346
347 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
348 %endif
349
350 # gen_init_cpio
351 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
352
353 %clean
354 rm -rf $RPM_BUILD_ROOT
355
356 %post   cpupower-libs -p /sbin/ldconfig
357 %postun cpupower-libs -p /sbin/ldconfig
358
359 %post cpupower
360 %systemd_post cpupower.service
361
362 %preun cpupower
363 %systemd_preun cpupower.service
364
365 %postun cpupower
366 %systemd_reload
367
368 %files
369 %defattr(644,root,root,755)
370 %attr(755,root,root) %{_bindir}/gen_init_cpio
371 %attr(755,root,root) %{_bindir}/slabinfo
372 %attr(755,root,root) %{_sbindir}/dslm
373 %attr(755,root,root) %{_sbindir}/page-types
374 %ifarch %{ix86} %{x8664} x32
375 %attr(755,root,root) %{_bindir}/centrino-decode
376 %attr(755,root,root) %{_bindir}/powernow-k8-decode
377 %endif
378 %ifarch %{ix86} %{x8664} x32
379 %attr(755,root,root) %{_bindir}/turbostat
380 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
381 %{_mandir}/man8/turbostat.8*
382 %{_mandir}/man8/x86_energy_perf_policy.8*
383 %endif
384
385 %files cpupower -f cpupower.lang
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_bindir}/cpupower
388 %{_mandir}/man1/cpupower*.1*
389 %{systemdunitdir}/cpupower.service
390 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
391
392 %files cpupower-libs
393 %defattr(644,root,root,755)
394 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
395 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
396
397 %files cpupower-libs-devel
398 %defattr(644,root,root,755)
399 %attr(755,root,root) %{_libdir}/libcpupower.so
400 %{_includedir}/cpufreq.h
401
402 %if %{with perf}
403 %files perf
404 %defattr(644,root,root,755)
405 %attr(755,root,root) %{_bindir}/perf
406 %ifarch %{x8664}
407 %attr(755,root,root) %{_bindir}/perf-read-vdso32
408 %attr(755,root,root) %{_bindir}/perf-read-vdsox32
409 %endif
410 %attr(755,root,root) %{_bindir}/trace
411 %{_mandir}/man1/perf*.1*
412 %dir %{_datadir}/perf-core
413 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
414 %attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
415
416 %dir %{_datadir}/perf-core/scripts
417
418 %dir %{_datadir}/perf-core/scripts/perl
419 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
420 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
421 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
422 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
423 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
424 %dir %{_datadir}/perf-core/scripts/perl/bin
425 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
426 %{_datadir}/perf-core/scripts/perl/*.pl
427
428 %dir %{_datadir}/perf-core/scripts/python
429 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
430 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
431 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
432 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
433 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
434 %dir %{_datadir}/perf-core/scripts/python/bin
435 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
436 %{_datadir}/perf-core/scripts/python/*.py*
437
438 %dir %{_libdir}/traceevent
439 %dir %{_libdir}/traceevent/plugins
440 %attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
441
442 %if %{with gtk}
443 %files perf-gtk
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_libdir}/libperf-gtk.so
446 %endif
447
448 %files -n bash-completion-perf
449 %defattr(644,root,root,755)
450 /etc/bash_completion.d/perf
451 %endif
This page took 0.079442 seconds and 4 git commands to generate.