]>
Commit | Line | Data |
---|---|---|
fea1e605 ER |
1 | # TODO |
2 | # - BR deps for -perf | |
3 | # - asciidoc used at install stage of perf (should build doc in build section) | |
4 | # - different packages for perf-slang and perf-gtk | |
49fba13a ER |
5 | # |
6 | # Conditional build: | |
7 | %bcond_without verbose # verbose build (V=1) | |
fea1e605 | 8 | %bcond_with perf # perf tools (unfinished) |
49fba13a ER |
9 | |
10 | %define rel 0.1 | |
11 | %define basever 3.6 | |
12 | %define postver .6 | |
13 | Summary: Assortment of tools for the Linux kernel | |
14 | Name: kernel-tools | |
15 | Version: %{basever}%{postver} | |
16 | Release: %{rel} | |
17 | License: GPL v2 | |
fea1e605 | 18 | Group: Applications/System |
49fba13a ER |
19 | Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz |
20 | # Source0-md5: 1a1760420eac802c541a20ab51a093d1 | |
21 | %if "%{postver}" != ".0" | |
22 | Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2 | |
23 | # Patch0-md5: 363e730147333182616cc687345e7fe2 | |
24 | %endif | |
25 | BuildRequires: tar >= 1:1.22 | |
26 | BuildRequires: xz | |
fea1e605 ER |
27 | %if %{with perf} |
28 | BuildRequires: asciidoc | |
a1c57a8e | 29 | BuildRequires: newt-devel |
fea1e605 | 30 | BuildRequires: rpm-pythonprov |
a1c57a8e | 31 | BuildRequires: slang-devel |
fea1e605 ER |
32 | BuildRequires: xmlto |
33 | # provides perf.h which util/parse-events.l loads via ../perf.h, and -I/usr/include/slang makes it being loaded first | |
34 | BuildConflicts: Firebird-devel | |
35 | %endif | |
49fba13a ER |
36 | Requires: %{name}-libs = %{version}-%{release} |
37 | Provides: cpufreq-utils = 1:009-0.6.p1 | |
38 | Provides: cpufrequtils = 1:009-0.6.p1 | |
39 | Provides: cpupowerutils = 1:009-0.6.p1 | |
40 | Obsoletes: cpufreq-utils < 1:009-0.6.p1 | |
41 | Obsoletes: cpufrequtils < 1:009-0.6.p1 | |
42 | Obsoletes: cpupowerutils < 1:009-0.6.p1 | |
43 | Obsoletes: cpuspeed < 1:1.5-16 | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
60972f76 ER |
46 | %define makeopts CC="%{__cc}" %{?with_verbose:V=1} |
47 | ||
49fba13a ER |
48 | %description |
49 | This package contains the tools/ directory from the kernel source and | |
50 | the supporting documentation. | |
51 | ||
4bc5704a JK |
52 | %package cpupower |
53 | Summary: cpupower - Shows and sets processor power related values | |
54 | Group: Applications/System | |
55 | ||
56 | %description cpupower | |
60972f76 ER |
57 | cpupower is a collection of tools to examine and tune power saving |
58 | related features of your processor. | |
4bc5704a JK |
59 | |
60 | %package cpupower-libs | |
61 | Summary: cpupower libraries | |
49fba13a ER |
62 | License: GPL v2 |
63 | Group: Libraries | |
64 | ||
4bc5704a JK |
65 | %description cpupower-libs |
66 | cpupower libraries. | |
49fba13a | 67 | |
4bc5704a | 68 | %package cpupower-libs-devel |
60972f76 | 69 | Summary: Development files for the cpupower libraries |
49fba13a ER |
70 | License: GPL v2 |
71 | Group: Development/Libraries | |
72 | Requires: kernel-tools = %{version}-%{release} | |
73 | Requires: kernel-tools-libs = %{version}-%{release} | |
74 | Provides: cpupowerutils-devel = 1:009-0.6.p1 | |
75 | Provides: kernel-tools-devel | |
76 | Obsoletes: cpupowerutils-devel < 1:009-0.6.p1 | |
77 | ||
4bc5704a JK |
78 | %description cpupower-libs-devel |
79 | Development files for the cpupower libraries. | |
49fba13a | 80 | |
fea1e605 ER |
81 | %package perf |
82 | Summary: perf tool | |
83 | Group: Applications/System | |
84 | ||
85 | %description perf | |
86 | Perf is a profiler tool for Linux 2.6+ based systems that abstracts | |
87 | away CPU hardware differences in Linux performance measurements and | |
88 | presents a simple commandline interface. Perf is based on the | |
89 | perf_events interface exported by recent versions of the Linux kernel. | |
90 | ||
49fba13a ER |
91 | %prep |
92 | %setup -qc | |
93 | cd linux-%{basever} | |
94 | ||
95 | %if "%{postver}" != ".0" | |
96 | %patch0 -p1 | |
97 | %endif | |
98 | ||
99 | %build | |
100 | cd linux-%{basever} | |
101 | ||
102 | # cpupower | |
103 | %{__make} -C tools/power/cpupower \ | |
60972f76 | 104 | %{makeopts} \ |
49fba13a ER |
105 | CPUFREQ_BENCH=false |
106 | ||
107 | %ifarch %{ix86} | |
108 | %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \ | |
60972f76 | 109 | %{makeopts} \ |
49fba13a ER |
110 | %endif |
111 | ||
112 | %ifarch %{x8664} | |
113 | %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \ | |
60972f76 | 114 | %{makeopts} |
49fba13a ER |
115 | %endif |
116 | ||
117 | %ifarch %{ix86} %{x8664} | |
118 | %{__make} -C tools/power/x86/x86_energy_perf_policy \ | |
60972f76 | 119 | %{makeopts} |
49fba13a | 120 | %{__make} -C tools/power/x86/turbostat \ |
60972f76 | 121 | %{makeopts} |
49fba13a ER |
122 | %endif |
123 | ||
fea1e605 ER |
124 | %if %{with perf} |
125 | # perf slang version | |
126 | PWD=${PWD:-$(pwd)} | |
127 | install -d $PWD/perf-{slang,gtk} | |
128 | %{__make} -C tools/perf \ | |
129 | O=$PWD/perf-slang \ | |
130 | NO_GTK2=1 \ | |
60972f76 | 131 | %{makeopts} \ |
fea1e605 ER |
132 | prefix=%{_prefix} \ |
133 | perfexecdir=%{_datadir}/perf-core \ | |
134 | template_dir=%{_datadir}/perf-core/templates | |
135 | ||
136 | # perf gtk version | |
137 | %{__make} -C tools/perf \ | |
138 | O=$PWD/perf-gtk \ | |
60972f76 | 139 | %{makeopts} \ |
fea1e605 ER |
140 | prefix=%{_prefix} \ |
141 | perfexecdir=%{_datadir}/perf-core \ | |
142 | template_dir=%{_datadir}/perf-core/templates | |
143 | %endif | |
144 | ||
dd28be58 JK |
145 | # gen_init_cpio |
146 | %{__make} -C usr gen_init_cpio \ | |
60972f76 | 147 | %{makeopts} \ |
dd28be58 | 148 | |
49fba13a ER |
149 | %install |
150 | rm -rf $RPM_BUILD_ROOT | |
151 | cd linux-%{basever} | |
152 | ||
153 | %{__make} -C tools/power/cpupower install \ | |
154 | DESTDIR=$RPM_BUILD_ROOT \ | |
155 | libdir=%{_libdir} \ | |
156 | mandir=%{_mandir} \ | |
157 | CPUFREQ_BENCH=false | |
158 | ||
159 | %find_lang cpupower | |
160 | mv cpupower.lang .. | |
161 | ||
162 | %ifarch %{ix86} | |
163 | cd tools/power/cpupower/debug/i386 | |
164 | install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode | |
165 | install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode | |
166 | cd - | |
167 | %endif | |
168 | %ifarch %{x8664} | |
169 | cd tools/power/cpupower/debug/x86_64 | |
170 | install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode | |
171 | install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode | |
172 | cd - | |
173 | %endif | |
174 | ||
175 | %ifarch %{ix86} %{x8664} | |
176 | install -d $RPM_BUILD_ROOT%{_mandir}/man8 | |
177 | # broken makefile, install manually | |
178 | %if 0 | |
179 | %{__make} install \ | |
180 | -C tools/power/x86/x86_energy_perf_policy \ | |
181 | DESTDIR=$RPM_BUILD_ROOT | |
182 | %else | |
183 | cd tools/power/x86/x86_energy_perf_policy | |
184 | install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir} | |
185 | install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
186 | cd - | |
187 | %endif | |
188 | ||
189 | # broken makefile, install manually | |
190 | %if 0 | |
191 | %{__make} install \ | |
192 | -C tools/power/x86/turbostat \ | |
193 | DESTDIR=$RPM_BUILD_ROOT | |
194 | %else | |
195 | cd tools/power/x86/turbostat | |
196 | install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat | |
197 | install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
fea1e605 ER |
198 | cd - |
199 | %endif | |
49fba13a | 200 | %endif |
fea1e605 ER |
201 | |
202 | %if %{with perf} | |
203 | # perf slang | |
204 | PWD=${PWD:-$(pwd)} | |
205 | # perf slang version | |
206 | %{__make} -j1 install install-man \ | |
207 | -C tools/perf \ | |
208 | O=$PWD/perf-slang \ | |
209 | NO_GTK2=1 \ | |
210 | CC="%{__cc}" \ | |
211 | %{?with_verbose:V=1} \ | |
212 | prefix=%{_prefix} \ | |
213 | perfexecdir=%{_datadir}/perf-core \ | |
214 | template_dir=%{_datadir}/perf-core/templates \ | |
215 | DESTDIR=$RPM_BUILD_ROOT | |
216 | ||
217 | # perf gtk | |
218 | %{__make} -j1 install install-man \ | |
219 | -C tools/perf \ | |
220 | O=$PWD/perf-gtk \ | |
221 | CC="%{__cc}" \ | |
222 | %{?with_verbose:V=1} \ | |
223 | prefix=%{_prefix} \ | |
224 | perfexecdir=%{_datadir}/perf-core \ | |
225 | template_dir=%{_datadir}/perf-core/templates \ | |
226 | DESTDIR=$RPM_BUILD_ROOT | |
49fba13a ER |
227 | %endif |
228 | ||
dd28be58 | 229 | # gen_init_cpio |
60972f76 | 230 | install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio |
dd28be58 | 231 | |
49fba13a ER |
232 | %clean |
233 | rm -rf $RPM_BUILD_ROOT | |
234 | ||
4bc5704a JK |
235 | %post cpupower-libs -p /sbin/ldconfig |
236 | %postun cpupower-libs -p /sbin/ldconfig | |
49fba13a | 237 | |
4bc5704a | 238 | %files |
49fba13a | 239 | %defattr(644,root,root,755) |
49fba13a ER |
240 | %ifarch %{ix86} %{x8664} |
241 | %attr(755,root,root) %{_bindir}/centrino-decode | |
242 | %attr(755,root,root) %{_bindir}/powernow-k8-decode | |
243 | %endif | |
49fba13a ER |
244 | %ifarch %{ix86} %{x8664} |
245 | %attr(755,root,root) %{_bindir}/turbostat | |
246 | %attr(755,root,root) %{_bindir}/x86_energy_perf_policy | |
247 | %{_mandir}/man8/turbostat* | |
248 | %{_mandir}/man8/x86_energy_perf_policy* | |
249 | %endif | |
dd28be58 | 250 | %attr(755,root,root) %{_bindir}/gen_init_cpio |
49fba13a | 251 | |
4bc5704a JK |
252 | %files cpupower -f cpupower.lang |
253 | %defattr(644,root,root,755) | |
254 | %attr(755,root,root) %{_bindir}/cpupower | |
255 | %{_mandir}/man[1-8]/cpupower* | |
256 | ||
257 | %files cpupower-libs | |
49fba13a ER |
258 | %defattr(644,root,root,755) |
259 | %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.* | |
260 | %ghost %{_libdir}/libcpupower.so.0 | |
261 | ||
4bc5704a | 262 | %files cpupower-libs-devel |
49fba13a ER |
263 | %defattr(644,root,root,755) |
264 | %{_libdir}/libcpupower.so | |
265 | %{_includedir}/cpufreq.h | |
fea1e605 ER |
266 | |
267 | %if %{with perf} | |
268 | %files perf | |
269 | %defattr(644,root,root,755) | |
270 | %attr(755,root,root) %{_bindir}/perf | |
271 | %{_mandir}/man1/perf*.1* | |
272 | %dir %{_datadir}/perf-core | |
273 | %attr(755,root,root) %{_datadir}/perf-core/perf-archive | |
274 | ||
275 | %dir %{_datadir}/perf-core/scripts | |
276 | ||
277 | %dir %{_datadir}/perf-core/scripts/perl | |
278 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util | |
279 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib | |
280 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf | |
281 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace | |
282 | %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm | |
283 | %dir %{_datadir}/perf-core/scripts/perl/bin | |
284 | %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/* | |
285 | %{_datadir}/perf-core/scripts/perl/*.pl | |
286 | ||
287 | %dir %{_datadir}/perf-core/scripts/python | |
288 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util | |
289 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib | |
290 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf | |
291 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace | |
292 | %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py | |
293 | %dir %{_datadir}/perf-core/scripts/python/bin | |
294 | %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/* | |
295 | %{_datadir}/perf-core/scripts/python/*.py | |
296 | %endif |