]> git.pld-linux.org Git - packages/kernel-tools.git/blob - kernel-tools.spec
d5ce3e21997ee6a55f85692ad0afc9c425211f23
[packages/kernel-tools.git] / kernel-tools.spec
1 # TODO
2 # - unpackaged: /etc/bash_completion.d/perf
3 # - verify BR deps for -perf
4 # - different packages for perf-slang and perf-gtk
5 # - optflags
6
7 #
8 # Conditional build:
9 %bcond_without  verbose         # verbose build (V=1)
10 %bcond_with     perf            # perf tools (unfinished)
11
12 %define         rel             0.5
13 %define         basever 3.7
14 %define         postver .1
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:  21223369d682bcf44bcdfe1521095983
24 %if "%{postver}" != ".0"
25 Patch0:         http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
26 # Patch0-md5:   c391dc1a1b4dae81aaef6f08a0594813
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:  bison
38 BuildRequires:  docbook-style-xsl
39 BuildRequires:  elfutils-devel
40 BuildRequires:  flex
41 BuildRequires:  gtk+2-devel >= 2.0
42 BuildRequires:  libunwind-devel >= 0.99
43 BuildRequires:  newt-devel
44 BuildRequires:  perl-devel >= 5.1
45 BuildRequires:  pkgconfig
46 BuildRequires:  python-devel
47 BuildRequires:  rpm-pythonprov
48 BuildRequires:  slang-devel
49 BuildRequires:  xmlto
50 %endif
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %define         makeopts        CC="%{__cc}" %{?with_verbose:V=1}
54
55 %description
56 This package contains the software from tools/ subdirectory from Linux
57 kernel source and the supporting documentation.
58
59 %description -l pl.UTF-8
60 Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
61 Linuksa oraz związaną z nim dokumentację.
62
63 %package cpupower
64 Summary:        cpupower - Shows and sets processor power related values
65 Summary(pl.UTF-8):      cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
66 Group:          Applications/System
67 Requires(post,preun,postun):    systemd-units >= 38
68 Requires:       systemd-units >= 0.38
69 Provides:       cpufreq-utils = 1:009-0.6.p1
70 Provides:       cpufrequtils = 1:009-0.6.p1
71 Provides:       cpupowerutils = 1:009-0.6.p1
72 Obsoletes:      cpufreq-utils < 1:009-0.6.p1
73 Obsoletes:      cpufrequtils < 1:009-0.6.p1
74 Obsoletes:      cpupowerutils < 1:009-0.6.p1
75 Obsoletes:      cpuspeed < 1:1.5-16
76 Requires:       %{name}-cpupower-libs = %{version}-%{release}
77
78 %description cpupower
79 cpupower is a collection of tools to examine and tune power saving
80 related features of your processor.
81
82 %description cpupower -l pl.UTF-8
83 cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
84 związanych z oszczędzaniem energii.
85
86 %package cpupower-libs
87 Summary:        cpupower library
88 Summary(pl.UTF-8):      Biblioteka cpupower
89 Group:          Libraries
90
91 %description cpupower-libs
92 cpupower library.
93
94 %description cpupower-libs -l pl.UTF-8
95 Biblioteka cpupower.
96
97 %package cpupower-libs-devel
98 Summary:        Development files for the cpupower library
99 Summary(pl.UTF-8):      Pliki programistyczne biblioteki cpupower
100 Group:          Development/Libraries
101 Requires:       %{name} = %{version}-%{release}
102 Requires:       %{name}-cpupower-libs = %{version}-%{release}
103 Provides:       cpupowerutils-devel = 1:009-0.6.p1
104 Obsoletes:      cpupowerutils-devel < 1:009-0.6.p1
105
106 %description cpupower-libs-devel
107 Development files for the cpupower library.
108
109 %description cpupower-libs-devel -l pl.UTF-8
110 Pliki programistyczne biblioteki cpupower.
111
112 %package perf
113 Summary:        perf profiler tool
114 Summary(pl.UTF-8):      Narzędzie profilujące perf
115 Group:          Applications/System
116
117 %description perf
118 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
119 away CPU hardware differences in Linux performance measurements and
120 presents a simple commandline interface. Perf is based on the
121 perf_events interface exported by recent versions of the Linux kernel.
122
123 %description perf -l pl.UTF-8
124 Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
125 odseparowujące od różnic sprzętowych między pomiarami wydajności w
126 zależności od procesora oraz udostępniające prosty interfejs linii
127 poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
128 przez nowe wersje jądra Linuksa.
129
130 %prep
131 %setup -qc
132 cd linux-%{basever}
133
134 %if "%{postver}" != ".0"
135 %patch0 -p1
136 %endif
137
138 %build
139 cd linux-%{basever}
140
141 # cpupower
142 %{__make} -C tools/power/cpupower \
143         %{makeopts} \
144         CPUFREQ_BENCH=false
145
146 %ifarch %{ix86}
147 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
148         %{makeopts} \
149 %endif
150
151 %ifarch %{x8664}
152 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
153         %{makeopts}
154 %endif
155
156 %ifarch %{ix86} %{x8664}
157 %{__make} -C tools/power/x86/x86_energy_perf_policy \
158         %{makeopts}
159 %{__make} -C tools/power/x86/turbostat \
160         %{makeopts}
161 %endif
162
163 %if %{with perf}
164 # perf slang version
165 PWD=${PWD:-$(pwd)}
166 install -d $PWD/perf-{slang,gtk}
167 %{__make} -C tools/perf all man \
168         O=$PWD/perf-slang \
169         NO_GTK2=1 \
170         %{makeopts} \
171         prefix=%{_prefix} \
172         perfexecdir=%{_datadir}/perf-core \
173         template_dir=%{_datadir}/perf-core/templates
174
175 # perf gtk version
176 %{__make} -C tools/perf all man \
177         O=$PWD/perf-gtk \
178         %{makeopts} \
179         prefix=%{_prefix} \
180         perfexecdir=%{_datadir}/perf-core \
181         template_dir=%{_datadir}/perf-core/templates
182 %endif
183
184 # gen_init_cpio
185 %{__make} -C usr gen_init_cpio \
186         %{makeopts} \
187
188 %install
189 rm -rf $RPM_BUILD_ROOT
190 cd linux-%{basever}
191
192 %{__make} -C tools/power/cpupower install \
193         DESTDIR=$RPM_BUILD_ROOT \
194         libdir=%{_libdir} \
195         mandir=%{_mandir} \
196         CPUFREQ_BENCH=false
197
198 %find_lang cpupower
199 mv cpupower.lang ..
200
201 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
202 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
203 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
204
205 %ifarch %{ix86}
206 cd tools/power/cpupower/debug/i386
207 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
208 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
209 cd -
210 %endif
211 %ifarch %{x8664}
212 cd tools/power/cpupower/debug/x86_64
213 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
214 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
215 cd -
216 %endif
217
218 %ifarch %{ix86} %{x8664}
219 install -d $RPM_BUILD_ROOT%{_mandir}/man8
220 # broken makefile, install manually
221 %if 0
222 %{__make} install \
223         -C tools/power/x86/x86_energy_perf_policy \
224         DESTDIR=$RPM_BUILD_ROOT
225 %else
226 cd tools/power/x86/x86_energy_perf_policy
227 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
228 install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
229 cd -
230 %endif
231
232 # broken makefile, install manually
233 %if 0
234 %{__make} install \
235         -C tools/power/x86/turbostat \
236         DESTDIR=$RPM_BUILD_ROOT
237 %else
238 cd tools/power/x86/turbostat
239 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
240 install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
241 cd -
242 %endif
243 %endif
244
245 %if %{with perf}
246 # perf slang
247 PWD=${PWD:-$(pwd)}
248 # perf slang version
249 %{__make} -j1 install install-man \
250         -C tools/perf \
251         O=$PWD/perf-slang \
252         NO_GTK2=1 \
253         CC="%{__cc}" \
254         %{?with_verbose:V=1} \
255         prefix=%{_prefix} \
256         perfexecdir=%{_datadir}/perf-core \
257         template_dir=%{_datadir}/perf-core/templates \
258         DESTDIR=$RPM_BUILD_ROOT
259
260 # perf gtk
261 %{__make} -j1 install install-man \
262         -C tools/perf \
263         O=$PWD/perf-gtk \
264         CC="%{__cc}" \
265         %{?with_verbose:V=1} \
266         prefix=%{_prefix} \
267         perfexecdir=%{_datadir}/perf-core \
268         template_dir=%{_datadir}/perf-core/templates \
269         DESTDIR=$RPM_BUILD_ROOT
270 %endif
271
272 # gen_init_cpio
273 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
274
275 %clean
276 rm -rf $RPM_BUILD_ROOT
277
278 %post   cpupower-libs -p /sbin/ldconfig
279 %postun cpupower-libs -p /sbin/ldconfig
280
281 %post cpupower
282 %systemd_post cpupower.service
283
284 %preun cpupower
285 %systemd_preun cpupower.service
286
287 %postun cpupower
288 %systemd_reload
289
290 %files
291 %defattr(644,root,root,755)
292 %ifarch %{ix86} %{x8664}
293 %attr(755,root,root) %{_bindir}/centrino-decode
294 %attr(755,root,root) %{_bindir}/powernow-k8-decode
295 %endif
296 %ifarch %{ix86} %{x8664}
297 %attr(755,root,root) %{_bindir}/turbostat
298 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
299 %{_mandir}/man8/turbostat.8*
300 %{_mandir}/man8/x86_energy_perf_policy.8*
301 %endif
302 %attr(755,root,root) %{_bindir}/gen_init_cpio
303
304 %files cpupower -f cpupower.lang
305 %defattr(644,root,root,755)
306 %attr(755,root,root) %{_bindir}/cpupower
307 %{_mandir}/man1/cpupower*.1*
308 %{systemdunitdir}/cpupower.service
309 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
310
311 %files cpupower-libs
312 %defattr(644,root,root,755)
313 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
314 %attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
315
316 %files cpupower-libs-devel
317 %defattr(644,root,root,755)
318 %attr(755,root,root) %{_libdir}/libcpupower.so
319 %{_includedir}/cpufreq.h
320
321 %if %{with perf}
322 %files perf
323 %defattr(644,root,root,755)
324 %attr(755,root,root) %{_bindir}/perf
325 %{_mandir}/man1/perf*.1*
326 %dir %{_datadir}/perf-core
327 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
328
329 %dir %{_datadir}/perf-core/scripts
330
331 %dir %{_datadir}/perf-core/scripts/perl
332 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
333 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
334 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
335 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
336 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
337 %dir %{_datadir}/perf-core/scripts/perl/bin
338 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
339 %{_datadir}/perf-core/scripts/perl/*.pl
340
341 %dir %{_datadir}/perf-core/scripts/python
342 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
343 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
344 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
345 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
346 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py
347 %dir %{_datadir}/perf-core/scripts/python/bin
348 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
349 %{_datadir}/perf-core/scripts/python/*.py
350 %endif
This page took 0.124226 seconds and 2 git commands to generate.