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