]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools.spec
there's no -libs now
[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
d579af5a 11%define rel 0.4
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
78Requires: kernel-tools = %{version}-%{release}
79Requires: kernel-tools-libs = %{version}-%{release}
80Provides: cpupowerutils-devel = 1:009-0.6.p1
81Provides: kernel-tools-devel
82Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
83
4bc5704a
JK
84%description cpupower-libs-devel
85Development files for the cpupower libraries.
49fba13a 86
fea1e605
ER
87%package perf
88Summary: perf tool
89Group: Applications/System
90
91%description perf
92Perf is a profiler tool for Linux 2.6+ based systems that abstracts
93away CPU hardware differences in Linux performance measurements and
94presents a simple commandline interface. Perf is based on the
95perf_events interface exported by recent versions of the Linux kernel.
96
49fba13a
ER
97%prep
98%setup -qc
99cd linux-%{basever}
100
101%if "%{postver}" != ".0"
102%patch0 -p1
103%endif
104
105%build
106cd linux-%{basever}
107
108# cpupower
109%{__make} -C tools/power/cpupower \
60972f76 110 %{makeopts} \
49fba13a
ER
111 CPUFREQ_BENCH=false
112
113%ifarch %{ix86}
114%{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
60972f76 115 %{makeopts} \
49fba13a
ER
116%endif
117
118%ifarch %{x8664}
119%{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
60972f76 120 %{makeopts}
49fba13a
ER
121%endif
122
123%ifarch %{ix86} %{x8664}
124%{__make} -C tools/power/x86/x86_energy_perf_policy \
60972f76 125 %{makeopts}
49fba13a 126%{__make} -C tools/power/x86/turbostat \
60972f76 127 %{makeopts}
49fba13a
ER
128%endif
129
fea1e605
ER
130%if %{with perf}
131# perf slang version
132PWD=${PWD:-$(pwd)}
133install -d $PWD/perf-{slang,gtk}
134%{__make} -C tools/perf \
135 O=$PWD/perf-slang \
136 NO_GTK2=1 \
60972f76 137 %{makeopts} \
fea1e605
ER
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 \
60972f76 145 %{makeopts} \
fea1e605
ER
146 prefix=%{_prefix} \
147 perfexecdir=%{_datadir}/perf-core \
148 template_dir=%{_datadir}/perf-core/templates
149%endif
150
dd28be58
JK
151# gen_init_cpio
152%{__make} -C usr gen_init_cpio \
60972f76 153 %{makeopts} \
dd28be58 154
49fba13a
ER
155%install
156rm -rf $RPM_BUILD_ROOT
157cd 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
166mv cpupower.lang ..
167
f57fcd71
ER
168install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
169cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
170cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
171
49fba13a
ER
172%ifarch %{ix86}
173cd tools/power/cpupower/debug/i386
174install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
175install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
176cd -
177%endif
178%ifarch %{x8664}
179cd tools/power/cpupower/debug/x86_64
180install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
181install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
182cd -
183%endif
184
185%ifarch %{ix86} %{x8664}
186install -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
193cd tools/power/x86/x86_energy_perf_policy
194install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
195install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
196cd -
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
205cd tools/power/x86/turbostat
206install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
207install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
fea1e605
ER
208cd -
209%endif
49fba13a 210%endif
fea1e605
ER
211
212%if %{with perf}
213# perf slang
214PWD=${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
49fba13a
ER
237%endif
238
dd28be58 239# gen_init_cpio
60972f76 240install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
dd28be58 241
49fba13a
ER
242%clean
243rm -rf $RPM_BUILD_ROOT
244
4bc5704a
JK
245%post cpupower-libs -p /sbin/ldconfig
246%postun cpupower-libs -p /sbin/ldconfig
49fba13a 247
f57fcd71
ER
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
4bc5704a 257%files
49fba13a 258%defattr(644,root,root,755)
49fba13a
ER
259%ifarch %{ix86} %{x8664}
260%attr(755,root,root) %{_bindir}/centrino-decode
261%attr(755,root,root) %{_bindir}/powernow-k8-decode
262%endif
49fba13a
ER
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
dd28be58 269%attr(755,root,root) %{_bindir}/gen_init_cpio
49fba13a 270
4bc5704a
JK
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*
f57fcd71
ER
275%{systemdunitdir}/cpupower.service
276%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
4bc5704a
JK
277
278%files cpupower-libs
49fba13a
ER
279%defattr(644,root,root,755)
280%attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
281%ghost %{_libdir}/libcpupower.so.0
282
4bc5704a 283%files cpupower-libs-devel
49fba13a
ER
284%defattr(644,root,root,755)
285%{_libdir}/libcpupower.so
286%{_includedir}/cpufreq.h
fea1e605
ER
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 0.230143 seconds and 4 git commands to generate.