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