]> git.pld-linux.org Git - packages/lm_sensors.git/blob - lm_sensors.spec
e84046ba5abf2a4c6b5d14d7b5f405561246a113
[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 Summary(pl):    Biblioteka lm_sensors
83 Group:          Libraries
84
85 %description libs
86 lm_sensors library.
87
88 %description libs -l pl
89 Biblioteka lm_sensors.
90
91 %package devel
92 Summary:        Header files for lm_sensors
93 Summary(pl):    Pliki nag³ówkowe dla lm_sensors
94 Summary(pt_BR): Arquivos necessários ao desenvolvimento de programas que usem o lm_sensors
95 Summary(ru):    æÁÊÌÙ ÒÁÚÒÁÂÏÔÞÉËÁ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ lm_sensors
96 Summary(uk):    æÁÊÌÉ ÐÒÏÇÒÁͦÓÔÁ ÄÌÑ ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ lm_sensors
97 Group:          Development/Libraries
98 Requires:       %{name}-libs = %{version}-%{release}
99 Obsoletes:      liblm_sensors1-devel
100
101 %description devel
102 Header files for lm_sensors.
103
104 %description devel -l pl
105 Pliki nag³ówkowe dla lm_sensors.
106
107 %description devel -l pt_BR
108 Arquivos necessários ao desenvolvimento de programas que usem o
109 lm_sensors.
110
111 %description devel -l ru
112 ðÁËÅÔ lm_sensors-devel ×ËÌÀÞÁÅÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
113 ÐÏÓÔÒÏÅÎÉÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ ÄÁÎÎÙÅ ÓÅÎÓÏÒÏ×.
114
115 %description devel -l uk
116 ðÁËÅÔ lm_sensors-devel Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ, ÎÅÏÂȦÄΦ ÄÌÑ
117 ÐÏÂÕÄÏ×É ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ ÄÁΦ ÓÅÎÓÏÒ¦×.
118
119 %package static
120 Summary:        Static libraries for lm_sensors
121 Summary(pl):    Biblioteki statyczne dla lm_sensors
122 Summary(pt_BR): Bibliotecas estáticas para desenvolvimento com lm_sensors
123 Summary(ru):    óÔÁÔÉÞÅÓËÁÑ ÂÉÂÌÉÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ lm_sensors
124 Summary(uk):    óÔÁÔÉÞÎÁ Â¦Â̦ÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ lm_sensors
125 Group:          Development/Libraries
126 Requires:       %{name}-devel = %{version}-%{release}
127
128 %description static
129 Static libraries for lm_sensors.
130
131 %description static -l pl
132 Biblioteki statyczne dla lm_sensors.
133
134 %description static -l pt_BR
135 Bibliotecas estáticas para desenvolvimento com lm_sensors
136
137 %description static -l ru
138 ðÁËÅÔ lm_sensors-static ×ËÌÀÞÁÅÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ, ÎÅÏÂÈÏÄÉÍÙÅ
139 ÄÌÑ ÐÏÓÔÒÏÅÎÉÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ ÄÁÎÎÙÅ ÓÅÎÓÏÒÏ×.
140
141 %description static -l uk
142 ðÁËÅÔ lm_sensors-static Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ, ÎÅÏÂȦÄΦ ÄÌÑ
143 ÐÏÂÕÄÏ×É ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ ÄÁΦ ÓÅÎÓÏÒ¦×.
144
145 %package sensord
146 Summary:        Sensord daemon
147 Summary(pl):    Demon sensord
148 Group:          Daemons
149 PreReq:         rc-scripts
150 Requires(post,preun):   /sbin/chkconfig
151 Requires:       %{name} = %{version}-%{release}
152
153 %description sensord
154 Sensord daemon.
155
156 %description sensord -l pl
157 Demon sensord.
158
159 %package -n kernel24-i2c-%{name}
160 Summary:        Kernel modules for various buses and monitor chips
161 Summary(pl):    Modu³y j±dra dla ró¿nego rodzaju sensorów
162 Group:          Applications/System
163 Release:        %{_rel}@%{_kernel_ver_str}
164 Requires(post,postun):  /sbin/depmod
165 %{?with_dist_kernel:%requires_releq_kernel_up}
166 %{?with_dist_kernel:Requires:   i2c >= 2.9.0}
167 Provides:       %{name}-modules = %{version}-%{release}
168 Obsoletes:      kernel-misc-lm_sensors
169
170 %description -n kernel24-i2c-%{name}
171 Kernel modules for various buses and monitor chips.
172
173 %description -n kernel24-i2c-%{name} -l pl
174 Modu³y j±dra dla ró¿nego rodzaju sensorów monitoruj±cych.
175
176 %package -n kernel24-smp-i2c-%{name}
177 Summary:        Kernel modules for various buses and monitor chips
178 Summary(pl):    Modu³y j±dra dla ró¿nego rodzaju sensorów
179 Group:          Applications/System
180 Release:        %{_rel}@%{_kernel_ver_str}
181 Requires(post,postun):  /sbin/depmod
182 %{?with_dist_kernel:%requires_releq_kernel_smp}
183 %{?with_dist_kernel:Requires:   i2c >= 2.9.0}
184 Provides:       %{name}-modules = %{version}-%{release}
185 Obsoletes:      kernel-smp-misc-lm_sensors
186
187 %description -n kernel24-smp-i2c-%{name}
188 Kernel SMP modules for various buses and monitor chips.
189
190 %description -n kernel24-smp-i2c-%{name} -l pl
191 Modu³y j±dra SMP dla ró¿nego rodzaju sensorów monitoruj±cych.
192
193 %prep
194 %setup -q
195 %patch0 -p1
196 %patch1 -p1
197 %patch2 -p1
198 %patch3 -p1
199 %patch4 -p1
200
201 %build
202 %if %{with kernel}
203 # workaround to avoid unresolved dmi* symbols in i2c-piix4.o
204 install -d fakelinux
205 :> fakelinux/.config
206 %ifarch %{ix86}
207 echo 'CONFIG_X86=y' >> fakelinux/.config
208 %endif
209 %ifarch %{ix86} %{x8664} alpha ppc
210 echo 'CONFIG_IPMI_HANDLER=m' >> fakelinux/.config
211 %endif
212
213 %if %{with smp}
214 # SMP
215 %{__make} all-kernel-busses all-kernel-chips \
216         CC="%{kgcc}" \
217         OPTS="%{rpmcflags} -D__KERNEL_SMP=1" \
218         LINUX=`pwd`/fakelinux \
219         LINUX_HEADERS=%{_kernelsrcdir}/include \
220         I2C_HEADERS=%{_kernelsrcdir}/include \
221         SMP=1
222
223 %{__make} install-kernel-busses install-kernel-chips \
224         MODPREF=kernel-smp-modules \
225         LINUX=`pwd`/fakelinux \
226         LINUX_HEADERS=%{_kernelsrcdir}/include \
227         I2C_HEADERS=%{_kernelsrcdir}/include \
228         SMP=1
229
230 %{__make} clean
231 %endif
232
233 # UP
234 %{__make} all-kernel-busses all-kernel-chips \
235         CC="%{kgcc}" \
236         OPTS="%{rpmcflags}" \
237         LINUX=`pwd`/fakelinux \
238         LINUX_HEADERS=%{_kernelsrcdir}/include \
239         I2C_HEADERS=%{_kernelsrcdir}/include \
240         SMP=0
241 %endif
242
243 %if %{with userspace}
244 %{__make} user \
245         CC="%{__cc}" \
246         OPTS="%{rpmcflags}" \
247         LIBDIR=%{_libdir} \
248         LINUX=/dev/null \
249         LINUX_HEADERS=%{_kernelsrcdir}/include \
250         I2C_HEADERS=/usr/include \
251         PROG_EXTRA:="sensord"
252
253 %{__make} -C prog/eepromer \
254         CC="%{__cc}" \
255         CFLAGS="%{rpmcflags} -I../../kernel/include"
256 %endif
257
258 %install
259 rm -rf $RPM_BUILD_ROOT
260
261 %if %{with kernel}
262 %{__make} install-kernel-busses install-kernel-chips \
263         DESTDIR=$RPM_BUILD_ROOT \
264         MODPREF=/lib/modules/%{_kernel_ver} \
265         LINUX=`pwd`/fakelinux \
266         LINUX_HEADERS=%{_kernelsrcdir}/include \
267         I2C_HEADERS=%{_kernelsrcdir}/include \
268         SMP=0
269 %endif
270
271 %if %{with userspace}
272 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} \
273         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
274
275 %{__make} user_install \
276         DESTDIR=$RPM_BUILD_ROOT \
277         PREFIX=%{_prefix} \
278         ETCDIR=%{_sysconfdir} \
279         LIBDIR=%{_libdir} \
280         MANDIR=%{_mandir} \
281         PROG_EXTRA:="sensord" \
282         LINUX=/dev/null \
283         LINUX_HEADERS=%{_kernelsrcdir}/include \
284         I2C_HEADERS=/usr/include
285
286 install prog/eepromer/{eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
287
288 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors
289 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensors
290
291 # i2c API for userspace - included in glibc-kernel-headers
292 rm -f $RPM_BUILD_ROOT%{_includedir}/linux/i2c-dev.h
293 %endif
294
295 %if %{with kernel} && %{with smp}
296 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/{busses,chips}
297 install kernel-smp-modules/kernel/drivers/i2c/busses/*.o \
298         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/busses
299 install kernel-smp-modules/kernel/drivers/i2c/chips/*.o \
300         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/chips
301 %endif
302
303 %clean
304 rm -rf $RPM_BUILD_ROOT
305
306 %post   libs -p /sbin/ldconfig
307 %postun libs -p /sbin/ldconfig
308
309 %post sensord
310 /sbin/chkconfig --add sensors
311 if [ -f /var/lock/subsys/sensors ]; then
312         /etc/rc.d/init.d/sensors restart >&2
313 else
314         echo "You have to configure sensors modules in /etc/sysconfig/sensors"
315         echo
316         echo "Run \"/etc/rc.d/init.d/sensors start\" to start sensors daemon." >&2
317 fi
318
319 %preun sensord
320 if [ "$1" = "0" ]; then
321         if [ -f /var/lock/subsys/sensors ]; then
322                 /etc/rc.d/init.d/sensors stop >&2
323         fi
324         /sbin/chkconfig --del sensors
325 fi
326
327 %post   -n kernel24-i2c-%{name}
328 %depmod %{_kernel_ver}
329
330 %postun -n kernel24-i2c-%{name}
331 %depmod %{_kernel_ver}
332
333 %post   -n kernel24-smp-i2c-%{name}
334 %depmod %{_kernel_ver}smp
335
336 %postun -n kernel24-smp-i2c-%{name}
337 %depmod %{_kernel_ver}smp
338
339 %if %{with userspace}
340 %files
341 %defattr(644,root,root,755)
342 %doc BACKGROUND BUGS CHANGES README README.thinkpad TODO doc/{busses,chips}
343 %doc doc/{FAQ,donations,fan-divisors,progs,temperature-sensors,*html,vid}
344 %doc prog/{config,daemon,eepromer/README*,matorb,maxilife}
345 %attr(755,root,root) %{_bindir}/ddcmon
346 %attr(755,root,root) %{_bindir}/decode-*.pl
347 %attr(755,root,root) %{_bindir}/sensors
348 %attr(755,root,root) %{_sbindir}/sensors-detect
349 %attr(755,root,root) %{_sbindir}/eeprom*
350 %attr(755,root,root) %{_sbindir}/fancontrol
351 %attr(755,root,root) %{_sbindir}/i2c*
352 %ifarch %{ix86} %{x8664}
353 %attr(755,root,root) %{_sbindir}/isadump
354 %attr(755,root,root) %{_sbindir}/isaset
355 %{_mandir}/man8/isadump.8*
356 %{_mandir}/man8/isaset.8*
357 %endif
358 %attr(755,root,root) %{_sbindir}/pwmconfig
359 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sensors.conf
360 %{_mandir}/man1/sensors.1*
361 %{_mandir}/man5/sensors.conf.5*
362 %{_mandir}/man8/fancontrol.8*
363 %{_mandir}/man8/i2c*.8*
364 %{_mandir}/man8/pwmconfig.8*
365 %{_mandir}/man8/sensors-detect.8*
366
367 %files libs
368 %defattr(644,root,root,755)
369 %attr(755,root,root) %{_libdir}/lib*.so.*.*
370
371 %files devel
372 %defattr(644,root,root,755)
373 %doc doc/{developers,kernel}
374 %attr(755,root,root) %{_libdir}/lib*.so
375 %{_includedir}/sensors
376 %{_includedir}/linux/sensors.h
377 %{_mandir}/man3/*
378
379 %files static
380 %defattr(644,root,root,755)
381 %{_libdir}/libsensors.a
382
383 %files sensord
384 %defattr(644,root,root,755)
385 %attr(754,root,root) %{_sbindir}/sensord
386 %attr(754,root,root) /etc/rc.d/init.d/sensors
387 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sensors
388 %{_mandir}/man8/sensord.8*
389 %endif
390
391 %if %{with kernel}
392 %files -n kernel24-i2c-%{name}
393 %defattr(644,root,root,755)
394 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/busses
395 /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/busses/*.o*
396 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/chips
397 /lib/modules/%{_kernel_ver}/kernel/drivers/i2c/chips/*.o*
398
399 %if %{with smp}
400 %files -n kernel24-smp-i2c-%{name}
401 %defattr(644,root,root,755)
402 %dir /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/busses
403 /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/busses/*.o*
404 %dir /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/chips
405 /lib/modules/%{_kernel_ver}smp/kernel/drivers/i2c/chips/*.o*
406 %endif
407 %endif
This page took 0.06536 seconds and 3 git commands to generate.