]> git.pld-linux.org Git - packages/lm_sensors.git/blob - lm_sensors.spec
- use functions
[packages/lm_sensors.git] / lm_sensors.spec
1 # TODO
2 # - unpackaged:
3 #   /usr/sbin/fancontrol.pl (isn't that the same as sh fancontrol script?)
4 # - a big trigger warning how to use fancontrol and to init it first
5 #
6 %define         cmodule         %{_sysconfdir}/sysconfig/sensors_modules
7 %define         cdaemon         %{_sysconfdir}/sysconfig/sensors
8 %define         smodule         %{_sysconfdir}/rc.d/init.d/sensors_modules
9 %define         sdaemon         %{_sysconfdir}/rc.d/init.d/sensors
10
11 %include        /usr/lib/rpm/macros.perl
12 Summary:        Hardware health monitoring
13 Summary(pl):    Monitor stanu sprzêtu
14 Summary(pt_BR): Ferramentas para monitoração do hardware
15 Summary(ru):    õÔÉÌÉÔÙ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ ÁÐÐÁÒÁÔÕÒÙ
16 Summary(uk):    õÔÉ̦ÔÉ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ ÁÐÁÒÁÔÕÒÉ
17 Name:           lm_sensors
18 Version:        2.10.1
19 Release:        2
20 License:        GPL
21 Group:          Applications/System
22 Source0:        http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.gz
23 # Source0-md5:  cdc857b78e813b88cbf8be92441aa299
24 Source1:        sensors.init
25 Source2:        sensors.sysconfig
26 Source3:        fancontrol.init
27 Source4:        fancontrol.sysconfig
28 Source5:        sensors.sh
29 Source6:        sensors_modules.init
30 Source7:        sensors_modules.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 URL:            http://www.lm-sensors.nu/
36 BuildRequires:  bison
37 BuildRequires:  flex >= 2.5.1
38 BuildRequires:  perl-modules >= 5.6
39 BuildRequires:  rpm-perlprov >= 3.0.3-16
40 BuildRequires:  rpmbuild(macros) >= 1.268
41 BuildRequires:  rrdtool-devel >= 1.2.10
42 BuildRequires:  sysfsutils-devel
43 Requires:       %{name}-libs = %{version}-%{release}
44 Requires:       dev >= 2.9.0-13
45 Requires:       dmidecode
46 Requires:       %{name}-config
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
50 Tools for monitoring the hardware health of Linux systems containing
51 hardware health monitoring hardware such as the LM78 and LM75.
52
53 %description -l pl
54 Narzêdzie do monitorowania sprzêtu w systemach linuksowych
55 wyposa¿onych w sprzêt monitoruj±cy, taki jak LM78 lub LM75.
56
57 %description -l pt_BR
58 Ferramentas para monitoração do hardware. Contém uma coleção de
59 módulos para acesso genérico ao barramento SMBus e monitoração de
60 hardware.
61
62 %description -l ru
63 ðÁËÅÔ lm_sensors ÓÏÄÅÒÖÉÔ ÎÁÂÏÒ ÍÏÄÕÌÅÊ ÄÌÑ ÓÔÁÎÄÁÒÔÎÏÇÏ ÄÏÓÔÕÐÁ Ë
64 SMBus É ÍÏÎÉÔÏÒÉÎÇÁ. ÷îéíáîéå: ÄÌÑ ÜÔÏÇÏ ÎÅÏÂÈÏÄÉÍÁ ÓÐÅÃÉÁÌØÎÁÑ
65 ÐÏÄÄÅÒÖËÁ, ÏÔÓÕÔÓÔ×ÕÀÝÁÑ × ÓÔÁÎÄÁÒÔÎÙÈ ÓÔÁÒÙÈ ÑÄÒÁÈ 2.2.XX!
66
67 %description -l uk
68 ðÁËÅÔ lm_sensors Í¦ÓÔÉÔØ ÎÁ¦ҠÍÏÄÕ̦נÄÌÑ ÓÔÁÎÄÁÒÔÎÏÇÏ ÄÏÓÔÕÐÕ ÄÏ
69 SMBus ÔÁ ÍÏΦÔÏÒÉÎÇÕ. õ÷áçá: ÄÌÑ ÃØÏÇÏ ÐÏÔÒ¦ÂÎÁ ÓÐÅæÁÌØÎÁ Ð¦ÄÔÒÉÍËÁ,
70 ÑËÁ ×¦ÄÓÕÔÎÑ Õ ÓÔÁÎÄÁÒÔÎÉÈ ÓÔÁÒÉÈ ÑÄÒÁÈ 2.2.XX!
71
72 %package libs
73 Summary:        lm_sensors library
74 Summary(pl):    Biblioteka lm_sensors
75 Group:          Libraries
76 Obsoletes:      liblm_sensors1
77 Conflicts:      lm_sensors <= 2.9.2-2
78
79 %description libs
80 lm_sensors library.
81
82 %description libs -l pl
83 Biblioteka lm_sensors.
84
85 %package devel
86 Summary:        Header files for lm_sensors
87 Summary(pl):    Pliki nag³ówkowe dla lm_sensors
88 Summary(pt_BR): Arquivos necessários ao desenvolvimento de programas que usem o lm_sensors
89 Summary(ru):    æÁÊÌÙ ÒÁÚÒÁÂÏÔÞÉËÁ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ lm_sensors
90 Summary(uk):    æÁÊÌÉ ÐÒÏÇÒÁͦÓÔÁ ÄÌÑ ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ lm_sensors
91 Group:          Development/Libraries
92 Requires:       %{name}-libs = %{version}-%{release}
93 Obsoletes:      liblm_sensors1-devel
94
95 %description devel
96 Header files for lm_sensors.
97
98 %description devel -l pl
99 Pliki nag³ówkowe dla lm_sensors.
100
101 %description devel -l pt_BR
102 Arquivos necessários ao desenvolvimento de programas que usem o
103 lm_sensors.
104
105 %description devel -l ru
106 ðÁËÅÔ lm_sensors-devel ×ËÌÀÞÁÅÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
107 ÐÏÓÔÒÏÅÎÉÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ ÄÁÎÎÙÅ ÓÅÎÓÏÒÏ×.
108
109 %description devel -l uk
110 ðÁËÅÔ lm_sensors-devel Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ, ÎÅÏÂȦÄΦ ÄÌÑ
111 ÐÏÂÕÄÏ×É ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ ÄÁΦ ÓÅÎÓÏÒ¦×.
112
113 %package static
114 Summary:        Static libraries for lm_sensors
115 Summary(pl):    Biblioteki statyczne dla lm_sensors
116 Summary(pt_BR): Bibliotecas estáticas para desenvolvimento com lm_sensors
117 Summary(ru):    óÔÁÔÉÞÅÓËÁÑ ÂÉÂÌÉÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ lm_sensors
118 Summary(uk):    óÔÁÔÉÞÎÁ Â¦Â̦ÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ lm_sensors
119 Group:          Development/Libraries
120 Requires:       %{name}-devel = %{version}-%{release}
121
122 %description static
123 Static libraries for lm_sensors.
124
125 %description static -l pl
126 Biblioteki statyczne dla lm_sensors.
127
128 %description static -l pt_BR
129 Bibliotecas estáticas para desenvolvimento com lm_sensors
130
131 %description static -l ru
132 ðÁËÅÔ lm_sensors-static ×ËÌÀÞÁÅÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ, ÎÅÏÂÈÏÄÉÍÙÅ
133 ÄÌÑ ÐÏÓÔÒÏÅÎÉÑ ÐÒÏÇÒÁÍÍ, ÉÓÐÏÌØÚÕÀÝÉÈ ÄÁÎÎÙÅ ÓÅÎÓÏÒÏ×.
134
135 %description static -l uk
136 ðÁËÅÔ lm_sensors-static Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ, ÎÅÏÂȦÄΦ ÄÌÑ
137 ÐÏÂÕÄÏ×É ÐÒÏÇÒÁÍ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ ÄÁΦ ÓÅÎÓÏÒ¦×.
138
139 %package config-default
140 Summary:        Sensors configuration files
141 Summary(pl):    Pliki konfiguracyjne lm_sensors
142 Group:          Applications/System
143 Requires:       %{name} = %{version}-%{release}
144 Provides:       %{name}-config
145
146 %description config-default
147 Default configuration files for lm_sensors.
148
149 %package sensord
150 Summary:        Sensord daemon
151 Summary(pl):    Demon sensord
152 Group:          Daemons
153 Requires(post,preun):   /sbin/chkconfig
154 Requires:       %{name} = %{version}-%{release}
155 Requires:       %{name}-config
156 Requires:       rc-scripts
157
158 %description sensord
159 Sensord daemon.
160
161 %description sensord -l pl
162 Demon sensord.
163
164 %package fancontrol
165 Summary:        Fancontrol daemon
166 Summary(pl):    Demon sterowania wiatraczkami
167 Group:          Daemons
168 Requires(post,preun):   /sbin/chkconfig
169 Requires:       %{name} = %{version}-%{release}
170 Requires:       %{name}-sensord = %{version}-%{release}
171 Requires:       rc-scripts
172
173 %description fancontrol
174 Fancontrol daemon monitors current temperature of the computer and
175 adjusts fans speed acordingly.
176
177 It is crucial to correctly configure this daemon (via running service
178 fancontrol init) and ensuring, that the temperature levels are set not
179 to burn the insides of the computer!
180
181 %description fancontrol -l pl
182 Demon fancontrol monitoruje obecn± temperaturê komputera i ustawia
183 odpowiednio prêdko¶æ wiatraków.
184
185 Kluczowym jest, aby poprawnie skonfigurowaæ tego demona (poprzez
186 uruchomienie service fancontrol init) oraz upewniæ siê, ¿e progi
187 temperatury s± ustawione poprawnie, by nie spaliæ wnêtrza komputera!
188
189 %prep
190 %setup -q
191 %patch0 -p1
192 %patch1 -p1
193 %patch2 -p1
194 %patch3 -p1
195
196 %build
197 %{__make} user \
198         CC="%{__cc}" \
199         OPTS="%{rpmcflags}" \
200         LIBDIR=%{_libdir} \
201         LINUX=/dev/null \
202         LINUX_HEADERS=%{_kernelsrcdir}/include \
203         I2C_HEADERS=/usr/include \
204         PROG_EXTRA:="sensord" \
205         SYSFS_SUPPORT:=1
206
207 %{__make} -C prog/eepromer \
208         CC="%{__cc}" \
209         CFLAGS="%{rpmcflags} -I../../kernel/include"
210
211 %install
212 rm -rf $RPM_BUILD_ROOT
213
214 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} \
215         $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig}
216
217 %{__make} user_install \
218         DESTDIR=$RPM_BUILD_ROOT \
219         PREFIX=%{_prefix} \
220         ETCDIR=%{_sysconfdir} \
221         LIBDIR=%{_libdir} \
222         MANDIR=%{_mandir} \
223         PROG_EXTRA:="sensord" \
224         LINUX=/dev/null \
225         LINUX_HEADERS=%{_kernelsrcdir}/include \
226         I2C_HEADERS=/usr/include
227
228 install prog/eepromer/{eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
229
230 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/sensors
231 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/sensors
232 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/fancontrol
233 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/fancontrol
234 install %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}
235 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/sensors_modules
236 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/sensors_modules
237
238 # i2c API for userspace - included in glibc-kernel-headers
239 rm -f $RPM_BUILD_ROOT%{_includedir}/linux/i2c-dev.h
240
241 %clean
242 rm -rf $RPM_BUILD_ROOT
243
244 %post   libs -p /sbin/ldconfig
245 %postun libs -p /sbin/ldconfig
246
247 %post
248 if [ -f "%{cmodule}" ]; then
249         /sbin/chkconfig --add sensors_modules
250         %service sensors_modules restart "sensors modules"
251         if [ -f "%{sdaemon}" ]; then
252                 /sbin/chkconfig --add sensors
253                 %service sensors restart "sensors deamon"
254         fi
255 fi
256
257 %preun
258 if [ "$1" = "0" ]; then
259         if [ -f "%{sdaemon}" ]; then
260                 %service sensors stop
261                 /sbin/chkconfig --del sensors
262         fi
263         %service sensors_modules stop
264         /sbin/chkconfig --del sensors_modules
265 fi
266
267 %post config-default
268 if [ "$1" = 1 ]; then
269 cat << EOF
270  *********************************************************************
271  *                                                                   *
272  *  NOTE:                                                            *
273  *  You have to configure sensors to match your motherboard sensors  *
274  *  in  /etc/sensors.conf  and  /etc/sysconfig/sensors_modules. Use  *
275  *  sensors-detect script which  can  help you find proper modules.  *
276  *                                                                   *
277  *********************************************************************
278 EOF
279 fi
280 if [ -f "%{smodule}" ]; then
281         /sbin/chkconfig --add sensors_modules
282         %service sensors_modules restart "sensors modules"
283 fi
284 if [ -f "%{sdaemon}" ]; then
285         /sbin/chkconfig --add sensors
286         %service sensors restart "sensors daemon"
287 fi
288
289 %preun config-default
290 if [ "$1" = "0" ]; then
291         if [ -f "%{sdaemon}" ]; then
292                 %service sensors stop
293                 /sbin/chkconfig --del sensors
294         fi
295         if [ -f "%{smodule}" ]; then
296                 %service sensors_modules stop
297                 /sbin/chkconfig --del sensors_modules
298         fi
299 fi
300
301 %post sensord
302 if [ -f "%{cmodule}" ]; then
303         /sbin/chkconfig --add sensors
304         %service sensors restart "sensors daemon"
305 fi
306
307 %preun sensord
308 if [ "$1" = "0" ]; then
309         %service sensors stop
310         /sbin/chkconfig --del sensors
311 fi
312
313 %post fancontrol
314 if [ "$1" = 1 ]; then
315         echo "You have to configure fancontrol by running service fancontrol init first."
316 fi
317 /sbin/chkconfig --add fancontrol
318 %service fancontrol restart "fancontrol daemon"
319
320 %preun fancontrol
321 if [ "$1" = "0" ]; then
322         %service fancontrol stop
323         /sbin/chkconfig --del fancontrol
324 fi
325
326 %files
327 %defattr(644,root,root,755)
328 %doc BACKGROUND BUGS CHANGES README README.thinkpad TODO doc/{busses,chips}
329 %doc doc/{FAQ,donations,fan-divisors,progs,temperature-sensors,*html,vid}
330 %doc prog/{config,daemon,eepromer/README*,matorb,maxilife}
331 %attr(755,root,root) %{_bindir}/ddcmon
332 %attr(755,root,root) %{_bindir}/decode-*.pl
333 %attr(755,root,root) %{_bindir}/sensors
334 %attr(755,root,root) %{_bindir}/sensors.sh
335 %attr(755,root,root) %{_sbindir}/eeprom*
336 %attr(755,root,root) %{_sbindir}/i2c*
337 %attr(755,root,root) %{_sbindir}/sensors-detect
338 %ifarch %{ix86} %{x8664}
339 %attr(755,root,root) %{_sbindir}/isadump
340 %attr(755,root,root) %{_sbindir}/isaset
341 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/sensors_modules
342 %{_mandir}/man8/isadump.8*
343 %{_mandir}/man8/isaset.8*
344 %endif
345 %{_mandir}/man1/sensors.1*
346 %{_mandir}/man5/sensors.conf.5*
347 %{_mandir}/man8/i2c*.8*
348
349 %files config-default
350 %defattr(644,root,root,755)
351 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sensors.conf
352 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sysconfig/sensors_modules
353
354 %files libs
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_libdir}/lib*.so.*.*
357
358 %files devel
359 %defattr(644,root,root,755)
360 %doc doc/{developers,kernel}
361 %attr(755,root,root) %{_libdir}/lib*.so
362 %{_includedir}/sensors
363 %{_includedir}/linux/sensors.h
364 %{_mandir}/man3/*
365
366 %files static
367 %defattr(644,root,root,755)
368 %{_libdir}/libsensors.a
369
370 %files sensord
371 %defattr(644,root,root,755)
372 %attr(754,root,root) %{_sbindir}/sensord
373 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/sensors
374 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sysconfig/sensors
375 %{_mandir}/man8/sensors-detect.8*
376 %{_mandir}/man8/sensord.8*
377
378 %files fancontrol
379 %defattr(644,root,root,755)
380 %attr(755,root,root) %{_sbindir}/fancontrol
381 %attr(755,root,root) %{_sbindir}/pwmconfig
382 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/fancontrol
383 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sysconfig/fancontrol
384 %{_mandir}/man8/fancontrol.8*
385 %{_mandir}/man8/pwmconfig.8*
This page took 0.133899 seconds and 3 git commands to generate.