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