]> git.pld-linux.org Git - packages/kernel-tools.git/blob - kernel-tools.spec
- add define with common make opts
[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 %define         makeopts        CC="%{__cc}" %{?with_verbose:V=1}
47
48 %description
49 This package contains the tools/ directory from the kernel source and
50 the supporting documentation.
51
52 %package cpupower
53 Summary:        cpupower - Shows and sets processor power related values
54 Group:          Applications/System
55
56 %description cpupower
57 cpupower is a collection of tools to examine and tune power saving
58 related features of your processor.
59
60 %package cpupower-libs
61 Summary:        cpupower libraries
62 License:        GPL v2
63 Group:          Libraries
64
65 %description cpupower-libs
66 cpupower libraries.
67
68 %package cpupower-libs-devel
69 Summary:        Development files for the cpupower libraries
70 License:        GPL v2
71 Group:          Development/Libraries
72 Requires:       kernel-tools = %{version}-%{release}
73 Requires:       kernel-tools-libs = %{version}-%{release}
74 Provides:       cpupowerutils-devel = 1:009-0.6.p1
75 Provides:       kernel-tools-devel
76 Obsoletes:      cpupowerutils-devel < 1:009-0.6.p1
77
78 %description cpupower-libs-devel
79 Development files for the cpupower libraries.
80
81 %package perf
82 Summary:        perf tool
83 Group:          Applications/System
84
85 %description perf
86 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
87 away CPU hardware differences in Linux performance measurements and
88 presents a simple commandline interface. Perf is based on the
89 perf_events interface exported by recent versions of the Linux kernel.
90
91 %prep
92 %setup -qc
93 cd linux-%{basever}
94
95 %if "%{postver}" != ".0"
96 %patch0 -p1
97 %endif
98
99 %build
100 cd linux-%{basever}
101
102 # cpupower
103 %{__make} -C tools/power/cpupower \
104         %{makeopts} \
105         CPUFREQ_BENCH=false
106
107 %ifarch %{ix86}
108 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
109         %{makeopts} \
110 %endif
111
112 %ifarch %{x8664}
113 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
114         %{makeopts}
115 %endif
116
117 %ifarch %{ix86} %{x8664}
118 %{__make} -C tools/power/x86/x86_energy_perf_policy \
119         %{makeopts}
120 %{__make} -C tools/power/x86/turbostat \
121         %{makeopts}
122 %endif
123
124 %if %{with perf}
125 # perf slang version
126 PWD=${PWD:-$(pwd)}
127 install -d $PWD/perf-{slang,gtk}
128 %{__make} -C tools/perf \
129         O=$PWD/perf-slang \
130         NO_GTK2=1 \
131         %{makeopts} \
132         prefix=%{_prefix} \
133         perfexecdir=%{_datadir}/perf-core \
134         template_dir=%{_datadir}/perf-core/templates
135
136 # perf gtk version
137 %{__make} -C tools/perf \
138         O=$PWD/perf-gtk \
139         %{makeopts} \
140         prefix=%{_prefix} \
141         perfexecdir=%{_datadir}/perf-core \
142         template_dir=%{_datadir}/perf-core/templates
143 %endif
144
145 # gen_init_cpio
146 %{__make} -C usr gen_init_cpio \
147         %{makeopts} \
148
149 %install
150 rm -rf $RPM_BUILD_ROOT
151 cd linux-%{basever}
152
153 %{__make} -C tools/power/cpupower  install \
154         DESTDIR=$RPM_BUILD_ROOT \
155         libdir=%{_libdir} \
156         mandir=%{_mandir} \
157         CPUFREQ_BENCH=false
158
159 %find_lang cpupower
160 mv cpupower.lang ..
161
162 %ifarch %{ix86}
163 cd tools/power/cpupower/debug/i386
164 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
165 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
166 cd -
167 %endif
168 %ifarch %{x8664}
169 cd tools/power/cpupower/debug/x86_64
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
175 %ifarch %{ix86} %{x8664}
176 install -d $RPM_BUILD_ROOT%{_mandir}/man8
177 # broken makefile, install manually
178 %if 0
179 %{__make} install \
180         -C tools/power/x86/x86_energy_perf_policy \
181         DESTDIR=$RPM_BUILD_ROOT
182 %else
183 cd tools/power/x86/x86_energy_perf_policy
184 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
185 install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
186 cd -
187 %endif
188
189 # broken makefile, install manually
190 %if 0
191 %{__make} install \
192         -C tools/power/x86/turbostat \
193         DESTDIR=$RPM_BUILD_ROOT
194 %else
195 cd tools/power/x86/turbostat
196 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
197 install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
198 cd -
199 %endif
200 %endif
201
202 %if %{with perf}
203 # perf slang
204 PWD=${PWD:-$(pwd)}
205 # perf slang version
206 %{__make} -j1 install install-man \
207         -C tools/perf \
208         O=$PWD/perf-slang \
209         NO_GTK2=1 \
210         CC="%{__cc}" \
211         %{?with_verbose:V=1} \
212         prefix=%{_prefix} \
213         perfexecdir=%{_datadir}/perf-core \
214         template_dir=%{_datadir}/perf-core/templates \
215         DESTDIR=$RPM_BUILD_ROOT
216
217 # perf gtk
218 %{__make} -j1 install install-man \
219         -C tools/perf \
220         O=$PWD/perf-gtk \
221         CC="%{__cc}" \
222         %{?with_verbose:V=1} \
223         prefix=%{_prefix} \
224         perfexecdir=%{_datadir}/perf-core \
225         template_dir=%{_datadir}/perf-core/templates \
226         DESTDIR=$RPM_BUILD_ROOT
227 %endif
228
229 # gen_init_cpio
230 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
231
232 %clean
233 rm -rf $RPM_BUILD_ROOT
234
235 %post   cpupower-libs -p /sbin/ldconfig
236 %postun cpupower-libs -p /sbin/ldconfig
237
238 %files
239 %defattr(644,root,root,755)
240 %ifarch %{ix86} %{x8664}
241 %attr(755,root,root) %{_bindir}/centrino-decode
242 %attr(755,root,root) %{_bindir}/powernow-k8-decode
243 %endif
244 %ifarch %{ix86} %{x8664}
245 %attr(755,root,root) %{_bindir}/turbostat
246 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
247 %{_mandir}/man8/turbostat*
248 %{_mandir}/man8/x86_energy_perf_policy*
249 %endif
250 %attr(755,root,root) %{_bindir}/gen_init_cpio
251
252 %files cpupower -f cpupower.lang
253 %defattr(644,root,root,755)
254 %attr(755,root,root) %{_bindir}/cpupower
255 %{_mandir}/man[1-8]/cpupower*
256
257 %files cpupower-libs
258 %defattr(644,root,root,755)
259 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
260 %ghost %{_libdir}/libcpupower.so.0
261
262 %files cpupower-libs-devel
263 %defattr(644,root,root,755)
264 %{_libdir}/libcpupower.so
265 %{_includedir}/cpufreq.h
266
267 %if %{with perf}
268 %files perf
269 %defattr(644,root,root,755)
270 %attr(755,root,root) %{_bindir}/perf
271 %{_mandir}/man1/perf*.1*
272 %dir %{_datadir}/perf-core
273 %attr(755,root,root) %{_datadir}/perf-core/perf-archive
274
275 %dir %{_datadir}/perf-core/scripts
276
277 %dir %{_datadir}/perf-core/scripts/perl
278 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
279 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
280 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
281 %dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
282 %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
283 %dir %{_datadir}/perf-core/scripts/perl/bin
284 %attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
285 %{_datadir}/perf-core/scripts/perl/*.pl
286
287 %dir %{_datadir}/perf-core/scripts/python
288 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
289 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
290 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
291 %dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
292 %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py
293 %dir %{_datadir}/perf-core/scripts/python/bin
294 %attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
295 %{_datadir}/perf-core/scripts/python/*.py
296 %endif
This page took 0.124808 seconds and 4 git commands to generate.