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