]> git.pld-linux.org Git - packages/thinkfan.git/commitdiff
- initla
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 14 Mar 2011 09:46:02 +0000 (09:46 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    thinkfan.init -> 1.1
    thinkfan.spec -> 1.1

thinkfan.init [new file with mode: 0644]
thinkfan.spec [new file with mode: 0644]

diff --git a/thinkfan.init b/thinkfan.init
new file mode 100644 (file)
index 0000000..cc03a06
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# thinkfan             Start/Stop thinkfan daemon
+#
+# chkconfig:   2345 40 60
+# description: thinkpad fan control programcron is a standard UNIX program that runs user-specified \
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+start() {
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/thinkfan ]; then
+               msg_already_running "thinkfan"
+               return
+       fi
+
+       msg_starting "thinkfan"
+       daemon /usr/sbin/thinkfan
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/thinkfan
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/thinkfan ]; then
+               msg_not_running "thinkfan"
+               return
+       fi
+
+       msg_stopping "thinkfan"
+       killproc thinkfan
+       rm -f /var/lock/subsys/thinkfan
+}
+
+reload() {
+       if [ ! -f /var/lock/subsys/thinkfan ]; then
+               msg_not_running "thinkfan"
+               RETVAL=7
+               return
+       fi
+
+       msg_reloading "thinkfan"
+       killproc thinkfan -HUP
+       RETVAL=$?
+}
+
+condrestart() {
+       if [ ! -f /var/lock/subsys/thinkfan ]; then
+               msg_not_running "thinkfan"
+               RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  reload|force-reload|flush-logs)
+       reload
+       ;;
+  status)
+       status thinkfan
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
+       exit 3
+esac
+
+exit $RETVAL
diff --git a/thinkfan.spec b/thinkfan.spec
new file mode 100644 (file)
index 0000000..b56ff96
--- /dev/null
@@ -0,0 +1,56 @@
+Summary:       ThinkPad fan control program
+Name:          thinkfan
+Version:       0.7.1
+Release:       1
+License:       GPL
+Group:         Base
+Source0:       http://downloads.sourceforge.net/thinkfan/%{name}-%{version}.tar.gz
+# Source0-md5: 0e98ec7854edbb8186544f3aec6d95e4
+Source1:       %{name}.init
+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.
+
+%prep
+%setup -q
+sed -i -e 's#gcc#%{__cc}#g' Makefile
+
+%build
+%{__make} \
+       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}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add thinkfan
+%service thinkfan reload "thinkfan daemon"
+
+%preun
+if [ "$1" = "0" ]; then
+        /sbin/chkconfig --del thinkfan
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc NEWS README ChangeLog thinkfan.conf.sysfs
+%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
This page took 0.175726 seconds and 4 git commands to generate.