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