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