]> git.pld-linux.org Git - packages/kernel-tools.git/blob - kernel-tools.spec
from kernel 3.5.7
[packages/kernel-tools.git] / kernel-tools.spec
1 #
2 # Conditional build:
3 %bcond_without  verbose         # verbose build (V=1)
4
5 %define         rel             0.1
6 %define         basever 3.5
7 %define         postver .7
8 Summary:        Assortment of tools for the Linux kernel
9 Name:           kernel-tools
10 Version:        %{basever}%{postver}
11 Release:        %{rel}
12 License:        GPL v2
13 Group:          Base
14 Source0:        http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
15 # Source0-md5:  24153eaaa81dedc9481ada8cd9c3b83d
16 %if "%{postver}" != ".0"
17 Patch0:         http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
18 # Patch0-md5:   f908f8c222cf4a1988b8bf180df46bb2
19 %endif
20 BuildRequires:  tar >= 1:1.22
21 BuildRequires:  xz
22 Requires:       %{name}-libs = %{version}-%{release}
23 Provides:       cpufreq-utils = 1:009-0.6.p1
24 Provides:       cpufrequtils = 1:009-0.6.p1
25 Provides:       cpupowerutils = 1:009-0.6.p1
26 Obsoletes:      cpufreq-utils < 1:009-0.6.p1
27 Obsoletes:      cpufrequtils < 1:009-0.6.p1
28 Obsoletes:      cpupowerutils < 1:009-0.6.p1
29 Obsoletes:      cpuspeed < 1:1.5-16
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 This package contains the tools/ directory from the kernel source and
34 the supporting documentation.
35
36 %package libs
37 Summary:        Libraries for the kernels-tools
38 License:        GPL v2
39 Group:          Libraries
40
41 %description libs
42 This package contains the libraries built from the tools/ directory
43 from the kernel source.
44
45 %package libs-devel
46 Summary:        Assortment of tools for the Linux kernel
47 License:        GPL v2
48 Group:          Development/Libraries
49 Requires:       kernel-tools = %{version}-%{release}
50 Requires:       kernel-tools-libs = %{version}-%{release}
51 Provides:       cpupowerutils-devel = 1:009-0.6.p1
52 Provides:       kernel-tools-devel
53 Obsoletes:      cpupowerutils-devel < 1:009-0.6.p1
54
55 %description libs-devel
56 This package contains the development files for the tools/ directory
57 from the kernel source.
58
59 %prep
60 %setup -qc
61 cd linux-%{basever}
62
63 %if "%{postver}" != ".0"
64 %patch0 -p1
65 %endif
66
67 %build
68 cd linux-%{basever}
69
70 # cpupower
71 %{__make} -C tools/power/cpupower \
72         CC="%{__cc}" \
73         %{?with_verbose:V=1} \
74         CPUFREQ_BENCH=false
75
76 %ifarch %{ix86}
77 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
78         CC="%{__cc}" \
79         %{?with_verbose:V=1}
80 %endif
81
82 %ifarch %{x8664}
83 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
84         CC="%{__cc}" \
85         %{?with_verbose:V=1}
86 %endif
87
88 %ifarch %{ix86} %{x8664}
89 %{__make} -C tools/power/x86/x86_energy_perf_policy \
90         CC="%{__cc}" \
91         %{?with_verbose:V=1}
92 %{__make} -C tools/power/x86/turbostat \
93         CC="%{__cc}" \
94         %{?with_verbose:V=1}
95 %endif
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99 cd linux-%{basever}
100
101 %{__make} -C tools/power/cpupower  install \
102         DESTDIR=$RPM_BUILD_ROOT \
103         libdir=%{_libdir} \
104         mandir=%{_mandir} \
105         CPUFREQ_BENCH=false
106
107 %find_lang cpupower
108 mv cpupower.lang ..
109
110 %ifarch %{ix86}
111 cd tools/power/cpupower/debug/i386
112 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
113 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
114 cd -
115 %endif
116 %ifarch %{x8664}
117 cd tools/power/cpupower/debug/x86_64
118 install -p centrino-decode $RPM_BUILD_ROOT%{_bindir}/centrino-decode
119 install -p powernow-k8-decode $RPM_BUILD_ROOT%{_bindir}/powernow-k8-decode
120 cd -
121 %endif
122
123 %ifarch %{ix86} %{x8664}
124 install -d $RPM_BUILD_ROOT%{_mandir}/man8
125 # broken makefile, install manually
126 %if 0
127 %{__make} install \
128         -C tools/power/x86/x86_energy_perf_policy \
129         DESTDIR=$RPM_BUILD_ROOT
130 %else
131 cd tools/power/x86/x86_energy_perf_policy
132 install -p x86_energy_perf_policy $RPM_BUILD_ROOT%{_bindir}
133 install -p x86_energy_perf_policy.8 $RPM_BUILD_ROOT%{_mandir}/man8
134 cd -
135 %endif
136
137 # broken makefile, install manually
138 %if 0
139 %{__make} install \
140         -C tools/power/x86/turbostat \
141         DESTDIR=$RPM_BUILD_ROOT
142 %else
143 cd tools/power/x86/turbostat
144 install -p turbostat $RPM_BUILD_ROOT%{_bindir}/turbostat
145 install -p turbostat.8 $RPM_BUILD_ROOT%{_mandir}/man8
146 %endif
147 %endif
148
149 %clean
150 rm -rf $RPM_BUILD_ROOT
151
152 %post   libs -p /sbin/ldconfig
153 %postun libs -p /sbin/ldconfig
154
155 %files -f cpupower.lang
156 %defattr(644,root,root,755)
157 %attr(755,root,root) %{_bindir}/cpupower
158 %ifarch %{ix86} %{x8664}
159 %attr(755,root,root) %{_bindir}/centrino-decode
160 %attr(755,root,root) %{_bindir}/powernow-k8-decode
161 %endif
162 %{_mandir}/man[1-8]/cpupower*
163 %ifarch %{ix86} %{x8664}
164 %attr(755,root,root) %{_bindir}/turbostat
165 %attr(755,root,root) %{_bindir}/x86_energy_perf_policy
166 %{_mandir}/man8/turbostat*
167 %{_mandir}/man8/x86_energy_perf_policy*
168 %endif
169
170 %files libs
171 %defattr(644,root,root,755)
172 %attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
173 %ghost %{_libdir}/libcpupower.so.0
174
175 %files libs-devel
176 %defattr(644,root,root,755)
177 %{_libdir}/libcpupower.so
178 %{_includedir}/cpufreq.h
This page took 0.037036 seconds and 3 git commands to generate.