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