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