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