]> git.pld-linux.org Git - packages/kernel-tools.git/blob - kernel-tools.spec
O/P cpufrequtils-devel (present currently in th)
[packages/kernel-tools.git] / kernel-tools.spec
1 #
2 # Conditional build:
3 %bcond_without  verbose         # verbose build (V=1)
4 %bcond_without  perf            # perf tools
5
6 %define         rel             0.5
7 %define         basever 3.7
8 %define         postver .1
9 Summary:        Assortment of tools for the Linux kernel
10 Summary(pl.UTF-8):      Zestaw narzędzi dla jądra Linuksa
11 Name:           kernel-tools
12 Version:        %{basever}%{postver}
13 Release:        %{rel}
14 License:        GPL v2
15 Group:          Applications/System
16 Source0:        http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
17 # Source0-md5:  21223369d682bcf44bcdfe1521095983
18 %if "%{postver}" != ".0"
19 Patch0:         http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
20 # Patch0-md5:   c391dc1a1b4dae81aaef6f08a0594813
21 %endif
22 Source1:        cpupower.service
23 Source2:        cpupower.config
24 URL:            http://www.kernel.org/
25 BuildRequires:  rpmbuild(macros) >= 1.647
26 BuildRequires:  tar >= 1:1.22
27 BuildRequires:  xz
28 %if %{with perf}
29 BuildRequires:  asciidoc
30 BuildRequires:  audit-libs-devel
31 BuildRequires:  binutils-devel
32 BuildRequires:  bison
33 BuildRequires:  docbook-style-xsl
34 BuildRequires:  elfutils-devel
35 BuildRequires:  flex
36 BuildRequires:  gtk+2-devel >= 2.0
37 BuildRequires:  libunwind-devel >= 0.99
38 BuildRequires:  newt-devel
39 BuildRequires:  perl-devel >= 5.1
40 BuildRequires:  pkgconfig
41 BuildRequires:  python-devel
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  slang-devel
44 BuildRequires:  xmlto
45 %endif
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %define         makeopts        CC="%{__cc}" %{?with_verbose:V=1}
49
50 %description
51 This package contains the software from tools/ subdirectory from Linux
52 kernel source and the supporting documentation.
53
54 %description -l pl.UTF-8
55 Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
56 Linuksa oraz związaną z nim dokumentację.
57
58 %package cpupower
59 Summary:        cpupower - Shows and sets processor power related values
60 Summary(pl.UTF-8):      cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
61 Group:          Applications/System
62 Requires(post,preun,postun):    systemd-units >= 38
63 Requires:       %{name}-cpupower-libs = %{version}-%{release}
64 Requires:       systemd-units >= 0.38
65 Provides:       cpufreq-utils = 1:009-0.6.p1
66 Provides:       cpufrequtils = 1:009-0.6.p1
67 Provides:       cpupowerutils = 1:009-0.6.p1
68 Obsoletes:      cpufreq-utils < 1:009-0.6.p1
69 Obsoletes:      cpufrequtils < 1:009-0.6.p1
70 Obsoletes:      cpupowerutils < 1:009-0.6.p1
71 Obsoletes:      cpuspeed < 1:1.5-16
72
73 %description cpupower
74 cpupower is a collection of tools to examine and tune power saving
75 related features of your processor.
76
77 %description cpupower -l pl.UTF-8
78 cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
79 związanych z oszczędzaniem energii.
80
81 %package cpupower-libs
82 Summary:        cpupower library
83 Summary(pl.UTF-8):      Biblioteka cpupower
84 Group:          Libraries
85
86 %description cpupower-libs
87 cpupower library.
88
89 %description cpupower-libs -l pl.UTF-8
90 Biblioteka cpupower.
91
92 %package cpupower-libs-devel
93 Summary:        Development files for the cpupower library
94 Summary(pl.UTF-8):      Pliki programistyczne biblioteki cpupower
95 Group:          Development/Libraries
96 Requires:       %{name} = %{version}-%{release}
97 Requires:       %{name}-cpupower-libs = %{version}-%{release}
98 Provides:       cpufrequtils-devel = 1:009-0.6.p1
99 Provides:       cpupowerutils-devel = 1:009-0.6.p1
100 Obsoletes:      cpufrequtils-devel < 1:009-0.6.p1
101 Obsoletes:      cpupowerutils-devel < 1:009-0.6.p1
102
103 %description cpupower-libs-devel
104 Development files for the cpupower library.
105
106 %description cpupower-libs-devel -l pl.UTF-8
107 Pliki programistyczne biblioteki cpupower.
108
109 %package perf-core
110 Summary:        perf profiler tool (core package)
111 Summary(pl.UTF-8):      Narzędzie profilujące perf (podstawowe narzędzia)
112 Group:          Applications/System
113
114 %description perf-core
115 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
116 away CPU hardware differences in Linux performance measurements and
117 presents a simple commandline interface. Perf is based on the
118 perf_events interface exported by recent versions of the Linux kernel.
119
120 This package contains core files and scripts.
121
122 %description perf-core -l pl.UTF-8
123 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
124 odseparowujące od różnic sprzętowych między pomiarami wydajności w
125 zależności od procesora oraz udostępniające prosty interfejs linii
126 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
127 przez nowe wersje jądra Linuksa.
128
129 Ten pakiet zawiera podstawowe pliki i skrypty.
130
131 %package perf-gtk
132 Summary:        perf profiler tool (GTK+ GUI)
133 Summary(pl.UTF-8):      Narzędzie profilujące perf (interfejs graficzny GTK+)
134 Group:          X11/Applications
135 Requires:       %{name}-perf-core = %{version}-%{release}
136 Provides:       %{name}-perf = %{version}-%{release}
137
138 %description perf-gtk
139 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
140 away CPU hardware differences in Linux performance measurements and
141 presents a simple commandline interface. Perf is based on the
142 perf_events interface exported by recent versions of the Linux kernel.
143
144 This package contains GTK+ based GUI.
145
146 %description perf-gtk -l pl.UTF-8
147 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
148 odseparowujące od różnic sprzętowych między pomiarami wydajności w
149 zależności od procesora oraz udostępniające prosty interfejs linii
150 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
151 przez nowe wersje jądra Linuksa.
152
153 Ten pakiet zawiera graficzny interfejs oparty na GTK+.
154
155 %package perf-slang
156 Summary:        perf profiler tool (Slang TUI)
157 Summary(pl.UTF-8):      Narzędzie profilujące perf (interfejs tekstowy Slang)
158 Group:          X11/Applications
159 Requires:       %{name}-perf-core = %{version}-%{release}
160 Provides:       %{name}-perf = %{version}-%{release}
161
162 %description perf-slang
163 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
164 away CPU hardware differences in Linux performance measurements and
165 presents a simple commandline interface. Perf is based on the
166 perf_events interface exported by recent versions of the Linux kernel.
167
168 This package contains Slang based TUI.
169
170 %description perf-slang -l pl.UTF-8
171 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
172 odseparowujące od różnic sprzętowych między pomiarami wydajności w
173 zależności od procesora oraz udostępniające prosty interfejs linii
174 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
175 przez nowe wersje jądra Linuksa.
176
177 Ten pakiet zawiera tekstowy interfejs oparty na bibliotece Slang.
178
179 %package -n bash-completion-perf
180 Summary:        Bash completion for perf command
181 Summary(pl.UTF-8):      Bashowe uzupełnianie parametrów dla polecenia perf
182 Group:          Applications/Shells
183 Requires:       %{name}-perf = %{version}-%{release}
184 Requires:       bash-completion
185
186 %description -n bash-completion-perf
187 Bash completion for perf command.
188
189 %description -n bash-completion-perf -l pl.UTF-8
190 Bashowe uzupełnianie parametrów dla polecenia perf.
191
192 %prep
193 %setup -qc
194 cd linux-%{basever}
195
196 %if "%{postver}" != ".0"
197 %patch0 -p1
198 %endif
199
200 %build
201 cd linux-%{basever}
202
203 # cpupower
204 %{__make} -C tools/power/cpupower \
205         %{makeopts} \
206         CPUFREQ_BENCH=false \
207         OPTIMIZATION="%{rpmcflags}" \
208         STRIPCMD=true
209
210 %ifarch %{ix86}
211 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
212         CC="%{__cc}" \
213         CFLAGS="%{rpmcflags}"
214 %endif
215
216 %ifarch %{x8664}
217 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
218         CC="%{__cc}" \
219         CFLAGS="%{rpmcflags}"
220 %endif
221
222 %ifarch %{ix86} %{x8664}
223 %{__make} -C tools/power/x86/x86_energy_perf_policy \
224         CC="%{__cc}" \
225         CFLAGS="%{rpmcflags}"
226 %{__make} -C tools/power/x86/turbostat \
227         CC="%{__cc}" \
228         CFLAGS="%{rpmcflags} -Wall"
229 %endif
230
231 # slabinfo
232 %{__make} -C tools/vm \
233         CC="%{__cc}" \
234         CFLAGS="%{rpmcflags} -Wall -Wextra"
235
236 %if %{with perf}
237 # perf slang version
238 PWD=${PWD:-$(pwd)}
239 install -d $PWD/perf-{slang,gtk}
240 %{__make} -C tools/perf all man \
241         O=$PWD/perf-slang \
242         NO_GTK2=1 \
243         %{makeopts} \
244         CFLAGS_OPTIMIZE="%{rpmcflags}" \
245         prefix=%{_prefix} \
246         perfexecdir=%{_datadir}/perf-core \
247         template_dir=%{_datadir}/perf-core/templates
248
249 # perf gtk version
250 %{__make} -C tools/perf all man \
251         O=$PWD/perf-gtk \
252         %{makeopts} \
253         CFLAGS_OPTIMIZE="%{rpmcflags}" \
254         prefix=%{_prefix} \
255         perfexecdir=%{_datadir}/perf-core \
256         template_dir=%{_datadir}/perf-core/templates
257 %endif
258
259 # gen_init_cpio
260 %{__make} -C usr gen_init_cpio \
261         %{makeopts} \
262         CFLAGS="%{rpmcflags}"
263
264 %install
265 rm -rf $RPM_BUILD_ROOT
266 cd linux-%{basever}
267
268 %{__make} -C tools/power/cpupower install \
269         DESTDIR=$RPM_BUILD_ROOT \
270         libdir=%{_libdir} \
271         mandir=%{_mandir} \
272         CPUFREQ_BENCH=false
273
274 %find_lang cpupower
275 mv cpupower.lang ..
276
277 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
278 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
279 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
280
281 %ifarch %{ix86}
282 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
283 %endif
284 %ifarch %{x8664}
285 install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
286 %endif
287
288 install tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
289
290 %ifarch %{ix86} %{x8664}
291 install -d $RPM_BUILD_ROOT%{_mandir}/man8
292 # broken makefile, install manually
293 %if 0
294 %{__make} install \
295         -C tools/power/x86/x86_energy_perf_policy \
296         DESTDIR=$RPM_BUILD_ROOT
297 %else
298 cd tools/power/x86/x86_energy_perf_policy
299 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
300 install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
301 cd -
302 %endif
303
304 # broken makefile, install manually
305 %if 0
306 %{__make} install \
307         -C tools/power/x86/turbostat \
308         DESTDIR=$RPM_BUILD_ROOT
309 %else
310 cd tools/power/x86/turbostat
311 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
312 install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
313 cd -
314 %endif
315 %endif
316
317 %if %{with perf}
318 # perf slang
319 PWD=${PWD:-$(pwd)}
320 # perf slang version
321 %{__make} -j1 install install-man \
322         -C tools/perf \
323         O=$PWD/perf-slang \
324         NO_GTK2=1 \
325         CC="%{__cc}" \
326         CFLAGS_OPTIMIZE="%{rpmcflags}" \
327         %{?with_verbose:V=1} \
328         prefix=%{_prefix} \
329         perfexecdir=%{_datadir}/perf-core \
330         template_dir=%{_datadir}/perf-core/templates \
331         DESTDIR=$RPM_BUILD_ROOT
332 %{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,-slang}
333
334 # perf gtk
335 %{__make} -j1 install install-man \
336         -C tools/perf \
337         O=$PWD/perf-gtk \
338         CC="%{__cc}" \
339         CFLAGS_OPTIMIZE="%{rpmcflags}" \
340         %{?with_verbose:V=1} \
341         prefix=%{_prefix} \
342         perfexecdir=%{_datadir}/perf-core \
343         template_dir=%{_datadir}/perf-core/templates \
344         DESTDIR=$RPM_BUILD_ROOT
345 %{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,-gtk}
346
347 %py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
348 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
349 %endif
350
351 # gen_init_cpio
352 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
353
354 %clean
355 rm -rf $RPM_BUILD_ROOT
356
357 %post   cpupower-libs -p /sbin/ldconfig
358 %postun cpupower-libs -p /sbin/ldconfig
359
360 %post cpupower
361 %systemd_post cpupower.service
362
363 %preun cpupower
364 %systemd_preun cpupower.service
365
366 %postun cpupower
367 %systemd_reload
368
369 %files
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{_bindir}/gen_init_cpio
372 %attr(755,root,root) %{_bindir}/slabinfo
373 %ifarch %{ix86} %{x8664}
374 %attr(755,root,root) %{_bindir}/centrino-decode
375 %attr(755,root,root) %{_bindir}/powernow-k8-decode
376 %endif
377 %ifarch %{ix86} %{x8664}
378 %attr(755,root,root) %{_bindir}/turbostat
379 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
380 %{_mandir}/man8/turbostat.8*
381 %{_mandir}/man8/x86_energy_perf_policy.8*
382 %endif
383
384 %files cpupower -f cpupower.lang
385 %defattr(644,root,root,755)
386 %attr(755,root,root) %{_bindir}/cpupower
387 %{_mandir}/man1/cpupower*.1*
388 %{systemdunitdir}/cpupower.service
389 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
390
391 %files cpupower-libs
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
394 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
395
396 %files cpupower-libs-devel
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_libdir}/libcpupower.so
399 %{_includedir}/cpufreq.h
400
401 %if %{with perf}
402 %files perf-core
403 %defattr(644,root,root,755)
404 %{_mandir}/man1/perf*.1*
405 %dir %{_datadir}/perf-core
406 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
407
408 %dir %{_datadir}/perf-core/scripts
409
410 %dir %{_datadir}/perf-core/scripts/perl
411 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
412 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
413 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
414 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
415 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
416 %dir %{_datadir}/perf-core/scripts/perl/bin
417 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
418 %{_datadir}/perf-core/scripts/perl/*.pl
419
420 %dir %{_datadir}/perf-core/scripts/python
421 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
422 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
423 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
424 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
425 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
426 %dir %{_datadir}/perf-core/scripts/python/bin
427 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
428 %{_datadir}/perf-core/scripts/python/*.py*
429
430 %files perf-gtk
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{_bindir}/perf-gtk
433
434 %files perf-slang
435 %defattr(644,root,root,755)
436 %attr(755,root,root) %{_bindir}/perf-slang
437
438 %files -n bash-completion-perf
439 %defattr(644,root,root,755)
440 /etc/bash_completion.d/perf
441 %endif
This page took 0.099061 seconds and 3 git commands to generate.