]> git.pld-linux.org Git - packages/lm_sensors.git/blob - lm_sensors.spec
- adapterized.
[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 8
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:      i2c >= 2.6.0}
84 %{!?_without_dist_kernel:Conflicts:     kernel < %{_kernel_ver}, kernel > %{_kernel_ver}}
85 %{!?_without_dist_kernel:Conflicts:     kernel-smp}
86 Obsoletes:      %{name}-modules
87 Provides:       %{name}-modules = %{version}
88
89 %description -n kernel-misc-%{name}
90 Kernel modules for various buses and monitor chips.
91
92 %description -n kernel-misc-%{name} -l pl
93 Modu³y j±dra dla ró¿nego rodzaju sensorów monitoruj±cych.
94
95 %package -n kernel-smp-misc-%{name}
96 Summary:        Kernel modules for various buses and monitor chips
97 Summary(pl):    Modu³y j±dra dla ró¿nego rodzaju sensorów
98 Group:          Applications/System
99 Release:        %{_rel}@%{_kernel_ver_str}
100 Prereq:         /sbin/depmod
101 %{!?_without_dist_kernel:Requires:      i2c >= 2.6.0}
102 %{!?_without_dist_kernel:Conflicts:     kernel < %{_kernel_ver}, kernel > %{_kernel_ver}}
103 %{!?_without_dist_kernel:Conflicts:     kernel-up}
104 Obsoletes:      %{name}-modules
105 Provides:       %{name}-modules = %{version}
106
107 %description -n kernel-smp-misc-%{name}
108 Kernel SMP modules for various buses and monitor chips.
109
110 %description -n kernel-smp-misc-%{name} -l pl
111 Modu³y j±dra SMP dla ró¿nego rodzaju sensorów monitoruj±cych.
112
113 %prep
114 %setup -q
115 %patch0 -p1
116
117 %build
118 #up
119 %{__make} \
120         OPTS="%{rpmcflags}" \
121         LINUX=/dev/null \
122         LINUX_HEADERS=%{_kernelsrcdir}/include \
123         I2C_HEADERS=%{_kernelsrcdir}/include \
124         SMP=0
125
126 %{__make} install-kernel \
127         MODDIR=kernel-up-modules
128 %{__make} install-kernel-busses \
129         MODDIR=kernel-up-modules
130 %{__make} install-kernel-chips \
131         MODDIR=kernel-up-modules
132
133 %{__make} clean
134
135 #smp
136 %{__make} \
137         OPTS="%{rpmcflags} -D__KERNEL_SMP=1" \
138         LINUX=/dev/null \
139         LINUX_HEADERS=%{_kernelsrcdir}/include \
140         I2C_HEADERS=%{_kernelsrcdir}/include \
141         SMP=1
142
143 %install
144 rm -rf $RPM_BUILD_ROOT
145 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} \
146         $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/lib/modules/%{_kernel_ver}/misc}
147
148 %{__make} install \
149         DESTDIR=$RPM_BUILD_ROOT \
150         PREFIX=%{_prefix} \
151         ETCDIR=%{_sysconfdir} \
152         MANDIR=%{_mandir} \
153         MODDIR=/lib/modules/%{_kernel_ver}smp/misc
154
155 install prog/sensord/sensord $RPM_BUILD_ROOT%{_sbindir}
156 install prog/sensord/sensord.8 $RPM_BUILD_ROOT%{_mandir}/man8
157
158 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors
159 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensors
160
161 install kernel-up-modules/* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
162
163 gzip -9nf BACKGROUND BUGS CHANGES README README.thinkpad TODO
164 find doc -type f ! -name \*.\* -a ! -name \*ticket | xargs gzip -9nf
165
166 %clean
167 rm -rf $RPM_BUILD_ROOT
168
169 %post
170 /sbin/ldconfig
171 /sbin/chkconfig --add sensors
172 if [ -f /var/lock/subsys/sensors ]; then
173         /etc/rc.d/init.d/sensors restart >&2
174 else
175         echo "You have to configure sensors modules."
176         echo "Please edit /etc/sysconfig/sensors file according to your hardware."
177         echo
178         echo "Run \"/etc/rc.d/init.d/sensors start\" to start sensors daemon." >&2
179 fi
180
181 %preun
182 if [ "$1" = "0" ]; then
183         if [ -f /var/lock/subsys/sensors ]; then
184                 /etc/rc.d/init.d/sensors stop >&2
185         fi
186         /sbin/chkconfig --del sensors
187 fi
188
189 %postun -p /sbin/ldconfig
190
191 %post -n kernel-misc-%{name}
192 /sbin/depmod -a
193
194 %post -n kernel-smp-misc-%{name}
195 /sbin/depmod -a
196
197 %postun -n kernel-misc-%{name}
198 /sbin/depmod -a
199
200 %postun -n kernel-smp-misc-%{name}
201 /sbin/depmod -a
202
203 %files
204 %defattr(644,root,root,755)
205 %doc *.gz
206 %doc doc/*.gz doc/*.html doc/busses doc/chips
207 %attr(755,root,root) %{_bindir}/sensors
208 %attr(755,root,root) %{_sbindir}/sensors-detect
209 %attr(754,root,root) %{_sbindir}/sensord
210 %attr(754,root,root) /etc/rc.d/init.d/sensors
211 %attr(755,root,root) %{_libdir}/lib*.so.*.*
212 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sensors.conf
213 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/sensors
214 %{_mandir}/man1/*
215 %{_mandir}/man5/*
216 %{_mandir}/man8/*
217
218 %files devel
219 %defattr(644,root,root,755)
220 %doc doc/developers doc/kernel
221 %attr(755,root,root) %{_libdir}/lib*.so
222 %{_includedir}/sensors
223 %{_includedir}/linux/*
224 %{_mandir}/man3/*
225
226 %files static
227 %defattr(644,root,root,755)
228 %{_libdir}/libsensors.a
229
230 %files -n kernel-misc-%{name}
231 %defattr(644,root,root,755)
232 /lib/modules/%{_kernel_ver}/misc/*
233
234 %files -n kernel-smp-misc-%{name}
235 %defattr(644,root,root,755)
236 /lib/modules/%{_kernel_ver}smp/misc/*
This page took 1.118824 seconds and 4 git commands to generate.