]>
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 | ||
49fba13a ER |
142 | %install |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | cd linux-%{basever} | |
145 | ||
146 | %{__make} -C tools/power/cpupower install \ | |
147 | DESTDIR=$RPM_BUILD_ROOT \ | |
148 | libdir=%{_libdir} \ | |
149 | mandir=%{_mandir} \ | |
150 | CPUFREQ_BENCH=false | |
151 | ||
152 | %find_lang cpupower | |
153 | mv cpupower.lang .. | |
154 | ||
155 | %ifarch %{ix86} | |
156 | cd tools/power/cpupower/debug/i386 | |
157 | install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode | |
158 | install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode | |
159 | cd - | |
160 | %endif | |
161 | %ifarch %{x8664} | |
162 | cd tools/power/cpupower/debug/x86_64 | |
163 | install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode | |
164 | install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode | |
165 | cd - | |
166 | %endif | |
167 | ||
168 | %ifarch %{ix86} %{x8664} | |
169 | install -d $RPM_BUILD_ROOT%{_mandir}/man8 | |
170 | # broken makefile, install manually | |
171 | %if 0 | |
172 | %{__make} install \ | |
173 | -C tools/power/x86/x86_energy_perf_policy \ | |
174 | DESTDIR=$RPM_BUILD_ROOT | |
175 | %else | |
176 | cd tools/power/x86/x86_energy_perf_policy | |
177 | install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir} | |
178 | install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
179 | cd - | |
180 | %endif | |
181 | ||
182 | # broken makefile, install manually | |
183 | %if 0 | |
184 | %{__make} install \ | |
185 | -C tools/power/x86/turbostat \ | |
186 | DESTDIR=$RPM_BUILD_ROOT | |
187 | %else | |
188 | cd tools/power/x86/turbostat | |
189 | install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat | |
190 | install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
fea1e605 ER |
191 | cd - |
192 | %endif | |
49fba13a | 193 | %endif |
fea1e605 ER |
194 | |
195 | %if %{with perf} | |
196 | # perf slang | |
197 | PWD=${PWD:-$(pwd)} | |
198 | # perf slang version | |
199 | %{__make} -j1 install install-man \ | |
200 | -C tools/perf \ | |
201 | O=$PWD/perf-slang \ | |
202 | NO_GTK2=1 \ | |
203 | CC="%{__cc}" \ | |
204 | %{?with_verbose:V=1} \ | |
205 | prefix=%{_prefix} \ | |
206 | perfexecdir=%{_datadir}/perf-core \ | |
207 | template_dir=%{_datadir}/perf-core/templates \ | |
208 | DESTDIR=$RPM_BUILD_ROOT | |
209 | ||
210 | # perf gtk | |
211 | %{__make} -j1 install install-man \ | |
212 | -C tools/perf \ | |
213 | O=$PWD/perf-gtk \ | |
214 | CC="%{__cc}" \ | |
215 | %{?with_verbose:V=1} \ | |
216 | prefix=%{_prefix} \ | |
217 | perfexecdir=%{_datadir}/perf-core \ | |
218 | template_dir=%{_datadir}/perf-core/templates \ | |
219 | DESTDIR=$RPM_BUILD_ROOT | |
49fba13a ER |
220 | %endif |
221 | ||
222 | %clean | |
223 | rm -rf $RPM_BUILD_ROOT | |
224 | ||
225 | %post libs -p /sbin/ldconfig | |
226 | %postun libs -p /sbin/ldconfig | |
227 | ||
228 | %files -f cpupower.lang | |
229 | %defattr(644,root,root,755) | |
230 | %attr(755,root,root) %{_bindir}/cpupower | |
231 | %ifarch %{ix86} %{x8664} | |
232 | %attr(755,root,root) %{_bindir}/centrino-decode | |
233 | %attr(755,root,root) %{_bindir}/powernow-k8-decode | |
234 | %endif | |
235 | %{_mandir}/man[1-8]/cpupower* | |
236 | %ifarch %{ix86} %{x8664} | |
237 | %attr(755,root,root) %{_bindir}/turbostat | |
238 | %attr(755,root,root) %{_bindir}/x86_energy_perf_policy | |
239 | %{_mandir}/man8/turbostat* | |
240 | %{_mandir}/man8/x86_energy_perf_policy* | |
241 | %endif | |
242 | ||
243 | %files libs | |
244 | %defattr(644,root,root,755) | |
245 | %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.* | |
246 | %ghost %{_libdir}/libcpupower.so.0 | |
247 | ||
248 | %files libs-devel | |
249 | %defattr(644,root,root,755) | |
250 | %{_libdir}/libcpupower.so | |
251 | %{_includedir}/cpufreq.h | |
fea1e605 ER |
252 | |
253 | %if %{with perf} | |
254 | %files perf | |
255 | %defattr(644,root,root,755) | |
256 | %attr(755,root,root) %{_bindir}/perf | |
257 | %{_mandir}/man1/perf*.1* | |
258 | %dir %{_datadir}/perf-core | |
259 | %attr(755,root,root) %{_datadir}/perf-core/perf-archive | |
260 | ||
261 | %dir %{_datadir}/perf-core/scripts | |
262 | ||
263 | %dir %{_datadir}/perf-core/scripts/perl | |
264 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util | |
265 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib | |
266 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf | |
267 | %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace | |
268 | %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm | |
269 | %dir %{_datadir}/perf-core/scripts/perl/bin | |
270 | %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/* | |
271 | %{_datadir}/perf-core/scripts/perl/*.pl | |
272 | ||
273 | %dir %{_datadir}/perf-core/scripts/python | |
274 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util | |
275 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib | |
276 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf | |
277 | %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace | |
278 | %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py | |
279 | %dir %{_datadir}/perf-core/scripts/python/bin | |
280 | %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/* | |
281 | %{_datadir}/perf-core/scripts/python/*.py | |
282 | %endif |