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