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