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