Source0: http://downloads.sourceforge.net/thinkfan/%{name}-%{version}.tar.gz
# Source0-md5: 0e98ec7854edbb8186544f3aec6d95e4
Source1: %{name}.init
-URL: http://thinkfan.sourceforge.net
+URL: http://thinkfan.sourceforge.net/
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-A minimalist fan control program. Supports any hardware through the
-sysfs hwmon interface and most Thinkpads through /proc/acpi/ibm.
+A minimalist fan control program. Supports any kind of system via the
+sysfs hwmon interface (/sys/class/hwmon). It is designed to eat as
+little CPU power as possible. The development was inspired by the
+excellent work people have done on thinkwiki.org.
%prep
%setup -q
CC="%{__cc}" \
CFLAGS="%{rpmcppflags} %{rpmcflags}"
-%{__make}
-
%install
rm -rf $RPM_BUILD_ROOT
-
install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1,/etc/rc.d/init.d}
-install thinkfan $RPM_BUILD_ROOT%{_sbindir}
-install thinkfan.1 $RPM_BUILD_ROOT%{_mandir}/man1
-install thinkfan.conf.thinkpad $RPM_BUILD_ROOT%{_sysconfdir}/thinkfan.conf
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install -p thinkfan $RPM_BUILD_ROOT%{_sbindir}
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -p thinkfan.conf.sysfs $RPM_BUILD_ROOT%{_sysconfdir}/thinkfan.conf
+cp -p thinkfan.1 $RPM_BUILD_ROOT%{_mandir}/man1
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add thinkfan
-%service thinkfan reload "thinkfan daemon"
+%service thinkfan restart
%preun
if [ "$1" = "0" ]; then
- /sbin/chkconfig --del thinkfan
+ /sbin/chkconfig --del thinkfan
+ %service thinkfan stop
fi
%files
%defattr(644,root,root,755)
-%doc NEWS README ChangeLog thinkfan.conf.sysfs
+%doc NEWS README ChangeLog thinkfan.conf.thinkpad
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
%attr(755,root,root) %{_sbindir}/thinkfan
%{_mandir}/man1/thinkfan.1*
-%attr(754,root,root) /etc/rc.d/init.d/%{name}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf