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