From: Elan Ruusamäe Date: Tue, 15 Mar 2011 05:40:26 +0000 (+0000) Subject: - install generic sysfs config by default, update desc X-Git-Tag: auto/th/thinkfan-0_7_2-1~2 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fthinkfan.git;a=commitdiff_plain;h=5f5f68f - install generic sysfs config by default, update desc - restart service on upgrade, stop on uninstall - one time make is enough Changed files: thinkfan.spec -> 1.2 --- diff --git a/thinkfan.spec b/thinkfan.spec index b56ff96..b4c49b1 100644 --- a/thinkfan.spec +++ b/thinkfan.spec @@ -7,12 +7,14 @@ Group: Base 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 @@ -23,34 +25,32 @@ sed -i -e 's#gcc#%{__cc}#g' Makefile 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