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