]> git.pld-linux.org Git - packages/lm_sensors.git/commitdiff
- added sensord initscript, and sysconfig files
authorfilon <filon@sokrates.mimuw.edu.pl>
Sun, 20 Jan 2002 20:56:49 +0000 (20:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- prereq: /sbin/chkconfig, proper post, preun sections
- added man for sensord
- release 2

Changed files:
    lm_sensors.spec -> 1.32

lm_sensors.spec

index 9f4d324712acf2f8234b02906e170627b7dc52f0..fb822565269e79411fae624eb3252bcf52d1f289 100644 (file)
@@ -2,8 +2,6 @@
 # conditional build
 # _without_dist_kernel         without kernel for distributions
 
-# TODO: init script for loading sensors modules and sensord
-
 %define                _kernel_ver     %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
 %define                _kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
 %define                smpstr          %{?_with_smp:-smp}
@@ -13,17 +11,20 @@ Summary:    Hardware health monitoring
 Summary(pl):   Monitor stanu sprzĂȘtu
 Name:          lm_sensors
 Version:       2.6.2
-Release:       1
+Release:       2
 License:       GPL
 Group:         Applications/System
 Group(de):     Applikationen/System
 Group(pl):     Aplikacje/System
 Source0:       http://www.netroedge.com/~lm78/archive/%{name}-%{version}.tar.gz
+Source1:       sensors.init
+Source2:       sensors.sysconfig
 Patch0:                %{name}-make.patch
 URL:           http://www.netroedge.com/~lm78/
 BuildRequires: flex >= 2.5.1
 BuildRequires: bison
 BuildRequires: i2c-devel >= 2.6.0
+PreReq:                /sbin/chkconfig
 Requires:      %{name}-modules = %{version}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -123,14 +124,38 @@ install -d $RPM_BUILD_ROOT%{_mandir}/man8
 install prog/sensord/sensord $RPM_BUILD_ROOT%{_sbindir}
 install prog/sensord/sensord.8 $RPM_BUILD_ROOT%{_mandir}/man8
 
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensors
+
 gzip -9nf BACKGROUND BUGS CHANGES README README.thinkpad TODO
 find doc -type f ! -name \*.\* -a ! -name \*ticket | xargs gzip -9nf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post   -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+/sbin/chkconfig --add sensors
+if [ -f /var/lock/subsys/sensors ]; then
+       /etc/rc.d/init.d/sensors restart >&2
+else
+       echo "You have to configure sensors modules."
+       echo "Please edit /etc/sysconfig/sensors file according to your hardware."
+       echo
+       echo "Run \"/etc/rc.d/init.d/sensors start\" to start sensors daemon." >&2
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/sensors ]; then
+               /etc/rc.d/init.d/sensors stop >&2
+       fi
+       /sbin/chkconfig --del sensors
+fi
+
+%postun
+/sbin/ldconfig
 
 %post -n kernel%{smpstr}-misc-lm_sensors
 /sbin/depmod -a
@@ -144,16 +169,18 @@ rm -rf $RPM_BUILD_ROOT
 %doc doc/*.gz doc/*.html doc/busses doc/chips
 %attr(755,root,root) %{_bindir}/sensors
 %attr(755,root,root) %{_sbindir}/sensors-detect
-%attr(755,root,root) %{_sbindir}/sensord
+%attr(754,root,root) %{_sbindir}/sensord
+%attr(754,root,root) /etc/rc.d/init.d/sensors
 %attr(755,root,root) %{_libdir}/lib*.so.*.*
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sensors.conf
+%config(noreplace) %verify(not size mtime md5) /etc/sysconfig/sensors
 %{_mandir}/man1/*
 %{_mandir}/man5/*
+%{_mandir}/man8/*
 
 %files devel
 %defattr(644,root,root,755)
 %doc doc/developers doc/kernel
-%defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/lib*.so
 %{_includedir}/sensors
 %{_includedir}/linux/*
This page took 0.107776 seconds and 4 git commands to generate.