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