packages: thinkfan/thinkfan.init (NEW), thinkfan/thinkfan.spec (NEW) - initla

arekm arekm at pld-linux.org
Mon Mar 14 10:46:07 CET 2011


Author: arekm                        Date: Mon Mar 14 09:46:07 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- initla

---- Files affected:
packages/thinkfan:
   thinkfan.init (NONE -> 1.1)  (NEW), thinkfan.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/thinkfan/thinkfan.init
diff -u /dev/null packages/thinkfan/thinkfan.init:1.1
--- /dev/null	Mon Mar 14 10:46:07 2011
+++ packages/thinkfan/thinkfan.init	Mon Mar 14 10:46:02 2011
@@ -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

================================================================
Index: packages/thinkfan/thinkfan.spec
diff -u /dev/null packages/thinkfan/thinkfan.spec:1.1
--- /dev/null	Mon Mar 14 10:46:07 2011
+++ packages/thinkfan/thinkfan.spec	Mon Mar 14 10:46:02 2011
@@ -0,0 +1,67 @@
+# $Revision$, $Date$
+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
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2011/03/14 09:46:02  arekm
+- initla
+
================================================================


More information about the pld-cvs-commit mailing list