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