]> git.pld-linux.org Git - packages/lm_sensors.git/blob - lm_sensors.spec
- -libs split
[packages/lm_sensors.git] / lm_sensors.spec
1 # TODO
2 # - unpackaged:
3 #   /usr/sbin/fancontrol.pl
4 #
5 # Conditional build:
6 %bcond_without  dist_kernel     # without kernel for distributions
7 %bcond_without  smp             # don't build SMP modules
8 %bcond_without  kernel          # build kernel 2.4 modules
9 %bcond_without  userspace       # don't build userspace utilities
10
11 %ifarch %{x8664}
12 %undefine with_kernel
13 %endif
14
15 %include        /usr/lib/rpm/macros.perl
16 Summary:        Hardware health monitoring
17 Summary(pl):    Monitor stanu sprzêtu
18 Summary(pt_BR): Ferramentas para monitoração do hardware
19 Summary(ru):    õÔÉÌÉÔÙ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ ÁÐÐÁÒÁÔÕÒÙ
20 Summary(uk):    õÔÉ̦ÔÉ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ ÁÐÁÒÁÔÕÒÉ
21 Name:           lm_sensors
22 Version:        2.9.2
23 %define _rel    2.1
24 Release:        %{_rel}
25 License:        GPL
26 Group:          Applications/System
27 Source0:        http://secure.netroedge.com/~lm78/archive/%{name}-%{version}.tar.gz
28 # Source0-md5:  229f83cfbd081d5e7bd46885efec1c72
29 Source1:        sensors.init
30 Source2:        sensors.sysconfig
31 Patch0:         %{name}-make.patch
32 Patch1:         %{name}-ppc.patch
33 Patch2:         %{name}-iconv-in-libc.patch
34 Patch3:         %{name}-sensors-detect-PATH.patch
35 Patch4:         %{name}-CAN-2005-2672.patch
36 URL:            http://www.lm-sensors.nu/
37 BuildRequires:  rpmbuild(macros) >= 1.213
38 %if %{with userspace}
39 BuildRequires:  bison
40 BuildRequires:  flex >= 2.5.1
41 BuildRequires:  perl-modules >= 5.6
42 BuildRequires:  rpm-perlprov >= 3.0.3-16
43 BuildRequires:  rrdtool-devel >= 1.2.10
44 %endif
45 %if %{with kernel} && %{with dist_kernel}
46 BuildRequires:  kernel24-i2c-devel >= 2.9.0
47 BuildRequires:  kernel24-headers >= 2.4.0
48 BuildRequires:  kernel24-headers < 2.5.0
49 %endif
50 Requires:       dev >= 2.9.0-13
51 Requires:       dmidecode
52 Obsoletes:      liblm_sensors1
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %define         _kernelsrcdir           /usr/src/linux-2.4
56
57 %description
58 Tools for monitoring the hardware health of Linux systems containing
59 hardware health monitoring hardware such as the LM78 and LM75.
60
61 %description -l pl
62 Narzêdzie do monitorowania sprzêtu w systemach linuksowych
63 wyposa¿onych w sprzêt monitoruj±cy, taki jak LM78 lub LM75.
64
65 %description -l pt_BR
66 Ferramentas para monitoração do hardware. Contém uma coleção de
67 módulos para acesso genérico ao barramento SMBus e monitoração de
68 hardware.
69
70 %description -l ru
71 ðÁËÅÔ lm_sensors ÓÏÄÅÒÖÉÔ ÎÁÂÏÒ ÍÏÄÕÌÅÊ ÄÌÑ ÓÔÁÎÄÁÒÔÎÏÇÏ ÄÏÓÔÕÐÁ Ë
72 SMBus É ÍÏÎÉÔÏÒÉÎÇÁ. ÷îéíáîéå: ÄÌÑ ÜÔÏÇÏ ÎÅÏÂÈÏÄÉÍÁ ÓÐÅÃÉÁÌØÎÁÑ
73 ÐÏÄÄÅÒÖËÁ, ÏÔÓÕÔÓÔ×ÕÀÝÁÑ × ÓÔÁÎÄÁÒÔÎÙÈ ÓÔÁÒÙÈ ÑÄÒÁÈ 2.2.XX!
74
75 %description -l uk
76 ðÁËÅÔ lm_sensors Í¦ÓÔÉÔØ ÎÁ¦ҠÍÏÄÕ̦נÄÌÑ ÓÔÁÎÄÁÒÔÎÏÇÏ ÄÏÓÔÕÐÕ ÄÏ
77 SMBus ÔÁ ÍÏΦÔÏÒÉÎÇÕ. õ÷áçá: ÄÌÑ ÃØÏÇÏ ÐÏÔÒ¦ÂÎÁ ÓÐÅæÁÌØÎÁ Ð¦ÄÔÒÉÍËÁ,
78 ÑËÁ ×¦ÄÓÕÔÎÑ Õ ÓÔÁÎÄÁÒÔÎÉÈ ÓÔÁÒÉÈ ÑÄÒÁÈ 2.2.XX!
79
80 %package libs
81 Summary:        lm_sensors library
82 Group:          Libraries
83
84 %description libs
85 lm_sensors library.
86
87 %package sensord
88 Summary:        Sensord daemon
89 Summary(pl):    Demon sensord
90 Group:          Daemons
91 PreReq:         rc-scripts
92 Requires(post,preun):   /sbin/chkconfig
93 Requires:       %{name} = %{version}-%{release}
94
95 %description sensord
96 Sensord daemon.
97
98 %description sensord -l pl
99 Demon sensord.
100
101 %package devel
102 Summary:        Header files for lm_sensors
103 Summary(pl):    Pliki nag³ówkowe dla lm_sensors
104 Summary(pt_BR): Arquivos necessários ao desenvolvimento de programas que usem o lm_sensors
105 Summary(ru):    æÁÊÌÙ ÒÁÚÒÁÂÏÔÞÉËÁ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ lm_sensors
106 Summary(uk):    æÁÊÌÉ ÐÒÏÇÒÁͦÓÔÁ ÄÌÑ ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ lm_sensors
107 Group:          Development/Libraries
108 Requires:       %{name}-libs = %{version}-%{release}
109 Obsoletes:      liblm_sensors1-devel
110
111 %description devel
112 Header files for lm_sensors.
113
114 %description devel -l pl
115 Pliki nag³ówkowe dla lm_sensors.
116
117 %description devel -l pt_BR
118 Arquivos necessários ao desenvolvimento de programas que usem o
119 lm_sensors.
120
121 %description devel -l ru
122 ðÁËÅÔ lm_sensors-devel ×ËÌÀÞÁÅÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
123 ÐÏÓÔÒÏÅÎÉÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ ÄÁÎÎÙÅ ÓÅÎÓÏÒÏ×.
124
125 %description devel -l uk
126 ðÁËÅÔ lm_sensors-devel Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ, ÎÅÏÂȦÄΦ ÄÌÑ
127 ÐÏÂÕÄÏ×É ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ ÄÁΦ ÓÅÎÓÏÒ¦×.
128
129 %package static
130 Summary:        Static libraries for lm_sensors
131 Summary(pl):    Biblioteki statyczne dla lm_sensors
132 Summary(pt_BR): Bibliotecas estáticas para desenvolvimento com lm_sensors
133 Summary(ru):    óÔÁÔÉÞÅÓËÁÑ ÂÉÂÌÉÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ lm_sensors
134 Summary(uk):    óÔÁÔÉÞÎÁ Â¦Â̦ÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ lm_sensors
135 Group:          Development/Libraries
136 Requires:       %{name}-devel = %{version}-%{release}
137
138 %description static
139 Static libraries for lm_sensors.
140
141 %description static -l pl
142 Biblioteki statyczne dla lm_sensors.
143
144 %description static -l pt_BR
145 Bibliotecas estáticas para desenvolvimento com lm_sensors
146
147 %description static -l ru
148 ðÁËÅÔ lm_sensors-static ×ËÌÀÞÁÅÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ, ÎÅÏÂÈÏÄÉÍÙÅ
149 ÄÌÑ ÐÏÓÔÒÏÅÎÉÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ ÄÁÎÎÙÅ ÓÅÎÓÏÒÏ×.
150
151 %description static -l uk
152 ðÁËÅÔ lm_sensors-static Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ, ÎÅÏÂȦÄΦ ÄÌÑ
153 ÐÏÂÕÄÏ×É ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ ÄÁΦ ÓÅÎÓÏÒ¦×.
154
155 %package -n kernel24-i2c-%{name}
156 Summary:        Kernel modules for various buses and monitor chips
157 Summary(pl):    Modu³y j±dra dla ró¿nego rodzaju sensorów
158 Group:          Applications/System
159 Release:        %{_rel}@%{_kernel_ver_str}
160 Requires(post,postun):  /sbin/depmod
161 %{?with_dist_kernel:%requires_releq_kernel_up}
162 %{?with_dist_kernel:Requires:   i2c >= 2.9.0}
163 Provides:       %{name}-modules = %{version}-%{release}
164 Obsoletes:      kernel-misc-lm_sensors
165
166 %description -n kernel24-i2c-%{name}
167 Kernel modules for various buses and monitor chips.
168
169 %description -n kernel24-i2c-%{name} -l pl
170 Modu³y j±dra dla ró¿nego rodzaju sensorów monitoruj±cych.
171
172 %package -n kernel24-smp-i2c-%{name}
173 Summary:        Kernel modules for various buses and monitor chips
174 Summary(pl):    Modu³y j±dra dla ró¿nego rodzaju sensorów
175 Group:          Applications/System
176 Release:        %{_rel}@%{_kernel_ver_str}
177 Requires(post,postun):  /sbin/depmod
178 %{?with_dist_kernel:%requires_releq_kernel_smp}
179 %{?with_dist_kernel:Requires:   i2c >= 2.9.0}
180 Provides:       %{name}-modules = %{version}-%{release}
181 Obsoletes:      kernel-smp-misc-lm_sensors
182
183 %description -n kernel24-smp-i2c-%{name}
184 Kernel SMP modules for various buses and monitor chips.
185
186 %description -n kernel24-smp-i2c-%{name} -l pl
187 Modu³y j±dra SMP dla ró¿nego rodzaju sensorów monitoruj±cych.
188
189 %prep
190 %setup -q
191 %patch0 -p1
192 %patch1 -p1
193 %patch2 -p1
194 %patch3 -p1
195 %patch4 -p1
196
197 %build
198 %if %{with kernel}
199 # workaround to avoid unresolved dmi* symbols in i2c-piix4.o
200 install -d fakelinux
201 :> fakelinux/.config
202 %ifarch %{ix86}
203 echo 'CONFIG_X86=y' >> fakelinux/.config
204 %endif
205 %ifarch %{ix86} %{x8664} alpha ppc
206 echo 'CONFIG_IPMI_HANDLER=m' >> fakelinux/.config
207 %endif
208
209 %if %{with smp}
210 # SMP
211 %{__make} all-kernel-busses all-kernel-chips \
212         CC="%{kgcc}" \
213         OPTS="%{rpmcflags} -D__KERNEL_SMP=1" \
214         LINUX=`pwd`/fakelinux \
215         LINUX_HEADERS=%{_kernelsrcdir}/include \
216         I2C_HEADERS=%{_kernelsrcdir}/include \
217         SMP=1
218
219 %{__make} install-kernel-busses install-kernel-chips \
220         MODPREF=kernel-smp-modules \
221         LINUX=`pwd`/fakelinux \
222         LINUX_HEADERS=%{_kernelsrcdir}/include \
223         I2C_HEADERS=%{_kernelsrcdir}/include \
224         SMP=1
225
226 %{__make} clean
227 %endif
228
229 # UP
230 %{__make} all-kernel-busses all-kernel-chips \
231         CC="%{kgcc}" \
232         OPTS="%{rpmcflags}" \
233         LINUX=`pwd`/fakelinux \
234         LINUX_HEADERS=%{_kernelsrcdir}/include \
235         I2C_HEADERS=%{_kernelsrcdir}/include \
236         SMP=0
237 %endif
238
239 %if %{with userspace}
240 %{__make} user \
241         CC="%{__cc}" \
242         OPTS="%{rpmcflags}" \
243         LIBDIR=%{_libdir} \
244         LINUX=/dev/null \
245         LINUX_HEADERS=%{_kernelsrcdir}/include \
246         I2C_HEADERS=/usr/include \
247         PROG_EXTRA:="sensord"
248
249 %{__make} -C prog/eepromer \
250         CC="%{__cc}" \
251         CFLAGS="%{rpmcflags} -I../../kernel/include"
252 %endif
253
254 %install
255 rm -rf $RPM_BUILD_ROOT
256
257 %if %{with kernel}
258 %{__make} install-kernel-busses install-kernel-chips \
259         DESTDIR=$RPM_BUILD_ROOT \
260         MODPREF=/lib/modules/%{_kernel_ver} \
261         LINUX=`pwd`/fakelinux \
262         LINUX_HEADERS=%{_kernelsrcdir}/include \
263         I2C_HEADERS=%{_kernelsrcdir}/include \
264         SMP=0
265 %endif
266
267 %if %{with userspace}
268 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} \
269         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
270
271 %{__make} user_install \
272         DESTDIR=$RPM_BUILD_ROOT \
273         PREFIX=%{_prefix} \
274         ETCDIR=%{_sysconfdir} \
275         LIBDIR=%{_libdir} \
276         MANDIR=%{_mandir} \
277         PROG_EXTRA:="sensord" \
278         LINUX=/dev/null \
279         LINUX_HEADERS=%{_kernelsrcdir}/include \
280         I2C_HEADERS=/usr/include
281
282 install prog/eepromer/{eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
283
284 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors
285 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensors
286
287 # i2c API for userspace - included in glibc-kernel-headers
288 rm -f $RPM_BUILD_ROOT%{_includedir}/linux/i2c-dev.h
289 %endif
290
291 %if %{with kernel} && %{with smp}
292 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/{busses,chips}
293 install kernel-smp-modules/kernel/drivers/i2c/busses/*.o \
294         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/busses
295 install kernel-smp-modules/kernel/drivers/i2c/chips/*.o \
296         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/chips
297 %endif
298
299 %clean
300 rm -rf $RPM_BUILD_ROOT
301
302 %post   libs -p /sbin/ldconfig
303 %postun libs -p /sbin/ldconfig
304
305 %post sensord
306 /sbin/chkconfig --add sensors
307 if [ -f /var/lock/subsys/sensors ]; then
308         /etc/rc.d/init.d/sensors restart >&2
309 else
310         echo "You have to configure sensors modules in /etc/sysconfig/sensors"
311         echo
312         echo "Run \"/etc/rc.d/init.d/sensors start\" to start sensors daemon." >&2
313 fi
314
315 %preun sensord
316 if [ "$1" = "0" ]; then
317         if [ -f /var/lock/subsys/sensors ]; then
318                 /etc/rc.d/init.d/sensors stop >&2
319         fi
320         /sbin/chkconfig --del sensors
321 fi
322
323 %post   -n kernel24-i2c-%{name}
324 %depmod %{_kernel_ver}
325
326 %postun -n kernel24-i2c-%{name}
327 %depmod %{_kernel_ver}
328
329 %post   -n kernel24-smp-i2c-%{name}
330 %depmod %{_kernel_ver}smp
331
332 %postun -n kernel24-smp-i2c-%{name}
333 %depmod %{_kernel_ver}smp
334
335 %if %{with userspace}
336 %files
337 %defattr(644,root,root,755)
338 %doc BACKGROUND BUGS CHANGES README README.thinkpad TODO doc/{busses,chips}
339 %doc doc/{FAQ,donations,fan-divisors,progs,temperature-sensors,*html,vid}
340 %doc prog/{config,daemon,eepromer/README*,matorb,maxilife}
341 %attr(755,root,root) %{_bindir}/ddcmon
342 %attr(755,root,root) %{_bindir}/decode-*.pl
343 %attr(755,root,root) %{_bindir}/sensors
344 %attr(755,root,root) %{_sbindir}/sensors-detect
345 %attr(755,root,root) %{_sbindir}/eeprom*
346 %attr(755,root,root) %{_sbindir}/fancontrol
347 %attr(755,root,root) %{_sbindir}/i2c*
348 %ifarch %{ix86} %{x8664}
349 %attr(755,root,root) %{_sbindir}/isadump
350 %attr(755,root,root) %{_sbindir}/isaset
351 %{_mandir}/man8/isadump.8*
352 %{_mandir}/man8/isaset.8*
353 %endif
354 %attr(755,root,root) %{_sbindir}/pwmconfig
355 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sensors.conf
356 %{_mandir}/man1/sensors.1*
357 %{_mandir}/man5/sensors.conf.5*
358 %{_mandir}/man8/fancontrol.8*
359 %{_mandir}/man8/i2c*.8*
360 %{_mandir}/man8/pwmconfig.8*
361 %{_mandir}/man8/sensors-detect.8*
362
363 %files libs
364 %defattr(644,root,root,755)
365 %attr(755,root,root) %{_libdir}/lib*.so.*.*
366
367 %files sensord
368 %defattr(644,root,root,755)
369 %attr(754,root,root) %{_sbindir}/sensord
370 %attr(754,root,root) /etc/rc.d/init.d/sensors
371 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sensors
372 %{_mandir}/man8/sensord.8*
373
374 %files devel
375 %defattr(644,root,root,755)
376 %doc doc/{developers,kernel}
377 %attr(755,root,root) %{_libdir}/lib*.so
378 %{_includedir}/sensors
379 %{_includedir}/linux/sensors.h
380 %{_mandir}/man3/*
381
382 %files static
383 %defattr(644,root,root,755)
384 %{_libdir}/libsensors.a
385 %endif
386
387 %if %{with kernel}
388 %files -n kernel24-i2c-%{name}
389 %defattr(644,root,root,755)
390 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/busses
391 /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/busses/*.o*
392 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/chips
393 /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/chips/*.o*
394
395 %if %{with smp}
396 %files -n kernel24-smp-i2c-%{name}
397 %defattr(644,root,root,755)
398 %dir /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/busses
399 /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/busses/*.o*
400 %dir /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/chips
401 /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/chips/*.o*
402 %endif
403 %endif
This page took 0.571684 seconds and 4 git commands to generate.