]> git.pld-linux.org Git - packages/lm_sensors.git/blob - lm_sensors.spec
- use requires_releq_kernel_{up,smp} macros, release 10
[packages/lm_sensors.git] / lm_sensors.spec
1
2 # conditional build
3 # _without_dist_kernel          without kernel for distributions
4
5 %define         _kernel_ver     %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
6 %define         _kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
7 %define         _rel 10
8
9 Summary:        Hardware health monitoring
10 Summary(pl):    Monitor stanu sprzêtu
11 Summary(pt_BR): Ferramentas para monitoração do hardware
12 Name:           lm_sensors
13 Version:        2.6.2
14 Release:        %{_rel}
15 License:        GPL
16 Group:          Applications/System
17 Source0:        http://www.netroedge.com/~lm78/archive/%{name}-%{version}.tar.gz
18 Source1:        sensors.init
19 Source2:        sensors.sysconfig
20 Patch0:         %{name}-make.patch
21 URL:            http://www.netroedge.com/~lm78/
22 BuildRequires:  bison
23 BuildRequires:  flex >= 2.5.1
24 %{!?_without_dist_kernel:BuildRequires: i2c-devel >= 2.6.0}
25 PreReq:         /sbin/chkconfig
26 PreReq:         /sbin/ldconfig
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 Obsoletes:      liblm_sensors1
29
30 %description
31 Tools for monitoring the hardware health of Linux systems containing
32 hardware health monitoring hardware such as the LM78 and LM75.
33
34 %description -l pl
35 Narzêdzie do monitorowania sprzêtu w systemach Linuksowych
36 wyposa¿onych w sprzêt monitoruj±cy, taki jak LM78 lub LM75.
37
38 %description -l pt_BR
39 Ferramentas para monitoração do hardware. Contém uma coleção de
40 módulos para acesso genérico ao barramento SMBus e monitoração de
41 hardware.
42
43 %package devel
44 Summary:        Header files for lm_sensors
45 Summary(pl):    Pliki nag³ówkowe dla lm_sensors
46 Summary(pt_BR): Arquivos necessários ao desenvolvimento de programas que usem o lm_sensors
47 Group:          Development/Libraries
48 Requires:       %{name} = %{version}
49 Obsoletes:      liblm_sensors1-devel
50
51 %description devel
52 Header files for lm_sensors.
53
54 %description devel -l pl
55 Pliki nag³ówkowe dla lm_sensors.
56
57 %description devel -l pt_BR
58 Arquivos necessários ao desenvolvimento de programas que usem o
59 lm_sensors.
60
61 %package static
62 Summary:        Static libraries for lm_sensors
63 Summary(pl):    Biblioteki statyczne dla lm_sensors
64 Summary(pt_BR): Bibliotecas estáticas para desenvolvimento com lm_sensors
65 Group:          Development/Libraries
66 Requires:       %{name}-devel = %{version}
67
68 %description static
69 Static libraries for lm_sensors.
70
71 %description static -l pl
72 Biblioteki statyczne dla lm_sensors.
73
74 %description static -l pt_BR
75 Bibliotecas estáticas para desenvolvimento com lm_sensors
76
77 %package -n kernel-misc-%{name}
78 Summary:        Kernel modules for various buses and monitor chips
79 Summary(pl):    Modu³y j±dra dla ró¿nego rodzaju sensorów
80 Group:          Applications/System
81 Release:        %{_rel}@%{_kernel_ver_str}
82 Prereq:         /sbin/depmod
83 %{!?_without_dist_kernel:%requires_releq_kernel_up}
84 %{!?_without_dist_kernel:Requires:      i2c >= 2.6.0}
85 Provides:       %{name}-modules = %{version}
86 Obsoletes:      %{name}-modules
87
88 %description -n kernel-misc-%{name}
89 Kernel modules for various buses and monitor chips.
90
91 %description -n kernel-misc-%{name} -l pl
92 Modu³y j±dra dla ró¿nego rodzaju sensorów monitoruj±cych.
93
94 %package -n kernel-smp-misc-%{name}
95 Summary:        Kernel modules for various buses and monitor chips
96 Summary(pl):    Modu³y j±dra dla ró¿nego rodzaju sensorów
97 Group:          Applications/System
98 Release:        %{_rel}@%{_kernel_ver_str}
99 Prereq:         /sbin/depmod
100 %{!?_without_dist_kernel:%requires_releq_kernel_smp}
101 %{!?_without_dist_kernel:Requires:      i2c >= 2.6.0}
102 Provides:       %{name}-modules = %{version}
103 Obsoletes:      %{name}-modules
104
105 %description -n kernel-smp-misc-%{name}
106 Kernel SMP modules for various buses and monitor chips.
107
108 %description -n kernel-smp-misc-%{name} -l pl
109 Modu³y j±dra SMP dla ró¿nego rodzaju sensorów monitoruj±cych.
110
111 %prep
112 %setup -q
113 %patch0 -p1
114
115 %build
116 #up
117 %{__make} \
118         OPTS="%{rpmcflags}" \
119         LINUX=/dev/null \
120         LINUX_HEADERS=%{_kernelsrcdir}/include \
121         I2C_HEADERS=%{_kernelsrcdir}/include \
122         SMP=0
123
124 %{__make} install-kernel \
125         MODDIR=kernel-up-modules
126 %{__make} install-kernel-busses \
127         MODDIR=kernel-up-modules
128 %{__make} install-kernel-chips \
129         MODDIR=kernel-up-modules
130
131 %{__make} clean
132
133 #smp
134 %{__make} \
135         OPTS="%{rpmcflags} -D__KERNEL_SMP=1" \
136         LINUX=/dev/null \
137         LINUX_HEADERS=%{_kernelsrcdir}/include \
138         I2C_HEADERS=%{_kernelsrcdir}/include \
139         SMP=1
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} \
144         $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/lib/modules/%{_kernel_ver}/misc}
145
146 %{__make} install \
147         DESTDIR=$RPM_BUILD_ROOT \
148         PREFIX=%{_prefix} \
149         ETCDIR=%{_sysconfdir} \
150         MANDIR=%{_mandir} \
151         MODDIR=/lib/modules/%{_kernel_ver}smp/misc
152
153 install prog/sensord/sensord $RPM_BUILD_ROOT%{_sbindir}
154 install prog/sensord/sensord.8 $RPM_BUILD_ROOT%{_mandir}/man8
155
156 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors
157 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensors
158
159 install kernel-up-modules/* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
160
161 gzip -9nf BACKGROUND BUGS CHANGES README README.thinkpad TODO
162 find doc -type f ! -name \*.\* -a ! -name \*ticket | xargs gzip -9nf
163
164 %clean
165 rm -rf $RPM_BUILD_ROOT
166
167 %post
168 /sbin/ldconfig
169 /sbin/chkconfig --add sensors
170 if [ -f /var/lock/subsys/sensors ]; then
171         /etc/rc.d/init.d/sensors restart >&2
172 else
173         echo "You have to configure sensors modules."
174         echo "Please edit /etc/sysconfig/sensors file according to your hardware."
175         echo
176         echo "Run \"/etc/rc.d/init.d/sensors start\" to start sensors daemon." >&2
177 fi
178
179 %preun
180 if [ "$1" = "0" ]; then
181         if [ -f /var/lock/subsys/sensors ]; then
182                 /etc/rc.d/init.d/sensors stop >&2
183         fi
184         /sbin/chkconfig --del sensors
185 fi
186
187 %postun -p /sbin/ldconfig
188
189 %post -n kernel-misc-%{name}
190 /sbin/depmod -a
191
192 %post -n kernel-smp-misc-%{name}
193 /sbin/depmod -a
194
195 %postun -n kernel-misc-%{name}
196 /sbin/depmod -a
197
198 %postun -n kernel-smp-misc-%{name}
199 /sbin/depmod -a
200
201 %files
202 %defattr(644,root,root,755)
203 %doc *.gz
204 %doc doc/*.gz doc/*.html doc/busses doc/chips
205 %attr(755,root,root) %{_bindir}/sensors
206 %attr(755,root,root) %{_sbindir}/sensors-detect
207 %attr(754,root,root) %{_sbindir}/sensord
208 %attr(754,root,root) /etc/rc.d/init.d/sensors
209 %attr(755,root,root) %{_libdir}/lib*.so.*.*
210 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sensors.conf
211 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/sensors
212 %{_mandir}/man1/*
213 %{_mandir}/man5/*
214 %{_mandir}/man8/*
215
216 %files devel
217 %defattr(644,root,root,755)
218 %doc doc/developers doc/kernel
219 %attr(755,root,root) %{_libdir}/lib*.so
220 %{_includedir}/sensors
221 %{_includedir}/linux/*
222 %{_mandir}/man3/*
223
224 %files static
225 %defattr(644,root,root,755)
226 %{_libdir}/libsensors.a
227
228 %files -n kernel-misc-%{name}
229 %defattr(644,root,root,755)
230 /lib/modules/%{_kernel_ver}/misc/*
231
232 %files -n kernel-smp-misc-%{name}
233 %defattr(644,root,root,755)
234 /lib/modules/%{_kernel_ver}smp/misc/*
This page took 0.056471 seconds and 3 git commands to generate.