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