[csw-devel] SF.net SVN: gar:[2281] csw/trunk/server

idogan23 at users.sourceforge.net idogan23 at users.sourceforge.net
Wed Nov 12 20:48:02 CET 2008


Revision: 2281
          http://gar.svn.sourceforge.net/gar/?rev=2281&view=rev
Author:   idogan23
Date:     2008-11-12 19:48:01 +0000 (Wed, 12 Nov 2008)

Log Message:
-----------
apcupsd: moved from utils to server, added SMF support through cswclassutils, added custom prototype and depend, added postinstall script, changed install paths

Modified Paths:
--------------
    csw/trunk/server/apcupsd/Makefile
    csw/trunk/server/apcupsd/checksums

Added Paths:
-----------
    csw/trunk/server/apcupsd/
    csw/trunk/server/apcupsd/files/CSWapcupsd.depend
    csw/trunk/server/apcupsd/files/CSWapcupsd.postinstall
    csw/trunk/server/apcupsd/files/CSWapcupsd.prototype
    csw/trunk/server/apcupsd/files/cswapcupsd

Modified: csw/trunk/server/apcupsd/Makefile
===================================================================
--- csw/trunk/utils/apcupsd/Makefile	2008-10-27 10:06:28 UTC (rev 2183)
+++ csw/trunk/server/apcupsd/Makefile	2008-11-12 19:48:01 UTC (rev 2281)
@@ -12,14 +12,32 @@
 
 MASTER_SITES = http://www.apcupsd.org/
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
-DISTFILES += $(call admfiles,CSWapcupsd,)
+DISTFILES += $(call admfiles,CSWapcupsd, depend prototype postinstall)
+DISTFILES += cswapcupsd
 
+SPKG_CLASSES = none cswinitsmf
+
 CONFIGURE_ARGS = $(DIRPATHS)
 CONFIGURE_ARGS += --sysconfdir=/opt/csw/etc/apcupsd
 CONFIGURE_ARGS += --with-nologin=/var/run
+CONFIGURE_ARGS += --with-pwrfail-dir=/opt/csw/etc/apcupsd/powerfail
+CONFIGURE_ARGS += --with-log-dir=/opt/csw/var/apcupsd
+CONFIGURE_ARGS += --with-cgi-bin=/opt/csw/etc/apcupsd/cgi
 
-GARCOMPILER = GCC
+GARCOMPILER = GNU
 
 TEST_SCRIPTS=
 
+# moving configuration file & installing init script
+post-install:
+	(cd $(DESTDIR)$(prefix)/etc/apcupsd; \
+	for i in apcupsd.conf; do \
+		if [ -r "$$i" ]; then \
+			echo "$$i -> $$i.CSW"; \
+			mv "$$i" "$$i.CSW";     \
+		fi \
+	done)
+	ginstall -d $(DESTDIR)/etc/opt/csw/init.d
+	ginstall -m 755 files/cswapcupsd $(DESTDIR)/etc/opt/csw/init.d/cswapcupsd
+
 include ../category.mk

Modified: csw/trunk/server/apcupsd/checksums
===================================================================
--- csw/trunk/utils/apcupsd/checksums	2008-10-27 10:06:28 UTC (rev 2183)
+++ csw/trunk/server/apcupsd/checksums	2008-11-12 19:48:01 UTC (rev 2281)
@@ -1,2 +1,6 @@
 78811129db1a882b9a2b9afd540470b3  download/apcupsd-3.14.4.tar.gz
 8f6ac052c4f049b79553ba43eda38d30  download/CSWapcupsd.gspec
+e5586868ebec465f4b66d0da3c1eedda  download/CSWapcupsd.depend
+9aba501d897f84e4c9973cdb1e9a2a74  download/CSWapcupsd.prototype
+e501dccc827094e6d536fd51752d065b  download/CSWapcupsd.postinstall
+6b63d7b83cb6bc893797d41b751fef70  download/cswapcupsd

Added: csw/trunk/server/apcupsd/files/CSWapcupsd.depend
===================================================================
--- csw/trunk/server/apcupsd/files/CSWapcupsd.depend	                        (rev 0)
+++ csw/trunk/server/apcupsd/files/CSWapcupsd.depend	2008-11-12 19:48:01 UTC (rev 2281)
@@ -0,0 +1,2 @@
+P	CSWcommon
+P	CSWcswclassutils

Added: csw/trunk/server/apcupsd/files/CSWapcupsd.postinstall
===================================================================
--- csw/trunk/server/apcupsd/files/CSWapcupsd.postinstall	                        (rev 0)
+++ csw/trunk/server/apcupsd/files/CSWapcupsd.postinstall	2008-11-12 19:48:01 UTC (rev 2281)
@@ -0,0 +1,3 @@
+if [ ! -f $BASEDIR/opt/csw/etc/apcupsd/apcupsd.conf ] ; then
+        cp $BASEDIR/opt/csw/etc/apcupsd/apcupsd.conf.CSW $BASEDIR/opt/csw/etc/apcupsd/apcupsd.conf
+fi

Added: csw/trunk/server/apcupsd/files/CSWapcupsd.prototype
===================================================================
--- csw/trunk/server/apcupsd/files/CSWapcupsd.prototype	                        (rev 0)
+++ csw/trunk/server/apcupsd/files/CSWapcupsd.prototype	2008-11-12 19:48:01 UTC (rev 2281)
@@ -0,0 +1,19 @@
+d none /opt/csw/etc 0755 root bin
+d none /opt/csw/etc/apcupsd 0755 root bin
+f none /opt/csw/etc/apcupsd/apccontrol 0744 root bin
+f none /opt/csw/etc/apcupsd/apcupsd.conf.CSW 0644 root bin
+f none /opt/csw/etc/apcupsd/changeme 0744 root bin
+f none /opt/csw/etc/apcupsd/commfailure 0744 root bin
+f none /opt/csw/etc/apcupsd/commok 0744 root bin
+f none /opt/csw/etc/apcupsd/offbattery 0744 root bin
+f none /opt/csw/etc/apcupsd/onbattery 0744 root bin
+d none /opt/csw/sbin 0755 root bin
+f none /opt/csw/sbin/apcaccess 0755 root bin
+f none /opt/csw/sbin/apctest 0700 root bin
+f none /opt/csw/sbin/apcupsd 0700 root bin
+f none /opt/csw/sbin/smtp 0755 root bin
+d none /opt/csw/share 0755 root bin
+d none /opt/csw/share/man 0755 root bin
+d none /opt/csw/share/man/man8 0755 root bin
+f none /opt/csw/share/man/man8/apcupsd.8 0644 root bin
+f cswinitsmf /etc/opt/csw/init.d/cswapcupsd 0755 root bin

Added: csw/trunk/server/apcupsd/files/cswapcupsd
===================================================================
--- csw/trunk/server/apcupsd/files/cswapcupsd	                        (rev 0)
+++ csw/trunk/server/apcupsd/files/cswapcupsd	2008-11-12 19:48:01 UTC (rev 2281)
@@ -0,0 +1,52 @@
+#! /bin/sh
+#
+# apcupsd      This shell script takes care of starting and stopping
+#	       the apcupsd UPS monitoring daemon.
+#
+# chkconfig: 2345 20 99
+# description: apcupsd monitors power and takes action if necessary
+#
+#  Update October 7th, 2001 - CPE
+#
+APCPID=/var/run/apcupsd.pid
+DISTVER="Solaris"
+POWERFAILDIR=/opt/csw/etc/apcupsd
+LOCKDIR=/var/spool/locks
+SBINDIR=/opt/csw/sbin
+
+return=" Done."
+
+
+case "$1" in
+    start)
+	rm -f ${POWERFAILDIR}/powerfail
+	echo "Starting apcupsd power management ...\c"
+	${SBINDIR}/apcupsd || return="	Failed."
+	touch ${LOCKDIR}/apcupsd
+	echo "$return"
+    ;;
+    stop)
+	echo "Stopping apcupsd power management ...\c"
+	if [ -f ${APCPID} ]; then
+		THEPID=`cat ${APCPID}`
+		kill ${THEPID} || return=" Failed."
+		rm -f ${APCPID}
+	else
+		return=" Failed."
+	fi
+	rm -f ${LOCKDIR}/apcupsd
+	echo "$return"
+    ;;
+    restart)
+       $0 stop
+       $0 start
+    ;;
+    status)
+       ${SBINDIR}/apcaccess status
+    ;;
+    *)
+    echo "Usage: $0 {start|stop|restart|status}"
+    exit 1
+esac
+
+exit 0


Property changes on: csw/trunk/server/apcupsd/files/cswapcupsd
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list