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