Subject: pkg/10552: update for pkgsrc/sysutils/apcupsd (for 3.6.2)
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 07/09/2000 17:02:20
>Number:         10552
>Category:       pkg
>Synopsis:       update for pkgsrc/sysutils/apcupsd (for 3.6.2)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 09 17:03:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        2000/07/09
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:

System: NetBSD

>Description:

	the current version of apcupsd is 3.6.2, but pkgsrc is back at 3.5.8

	note that the enclosed patches have not been submitted to the
	apcupsd maintainers.

>How-To-Repeat:

	by examination

>Fix:

	unshar the following in pkgsrc/apcupsd and tailor to suit:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	files/
#	files/apcupsd
#	files/md5
#	files/patch-sum
#	patches/
#	patches/patch-aa
#	patches/patch-ab
#	patches/patch-ac
#	patches/patch-ae
#	patches/patch-af
#	patches/patch-ag
#	patches/patch-ah
#	patches/patch-ai
#	patches/patch-aj
#	pkg/
#	pkg/COMMENT
#	pkg/DESCR
#	pkg/MESSAGE
#	pkg/PLIST
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
X# $NetBSD: Makefile,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
X#
X
XDISTNAME=	apcupsd-3.6.2
XPKGNAME=	apcupsd-3.6.2
XCATEGORIES=	sysutils
XMASTER_SITES=	http://www.brisse.dk/dlarea/
X
XMAINTAINER=	bouyer@netbsd.org
XHOMEPAGE=	http://www.brisse.dk/site/apcupsd/
X
X.include "../../mk/bsd.prefs.mk"
X
XUSE_GMAKE=	yes
X
XBUILD_DEPENDS+=	autoconf:../../devel/autoconf
XGNU_CONFIGURE=	YES
X
XCONFIGURE_ARGS+=	--enable-http           # include http support
XCONFIGURE_ARGS+=	--with-catgets          # use catgets functions if available
X
X# this seems to require -lintl and <libintl.h>
X#CONFIGURE_ARGS+=	--enable-nls            # enable Native Language Support
X
X# you need thread support to compile powerflute!
X#CONFIGURE_ARGS+=	--enable-threads        # compile threading code
X#DEPENDS+=	ncurses-*:../../devel/ncurses
X#CONFIGURE_ARGS+=	--enable-powerflute     # compile powerflute program (curses interface)
X# must be appended for libncurses
X#LDFLAGS=	-L${LOCALBASE}/lib
X
X# this would be done only in apcupsd-x11?
X#CONFIGURE_ARGS+=	--with-x                # use the X Window System
X
X#  --enable-threads        compile threading code
X#  --enable-http           include http support
X#  --enable-nls            enable Native Language Support
X#  --with-included-gettext use the GNU gettext library included here
X#  --with-catgets          use catgets functions if available
X
X# We have patched configure.in -- re-autoconf it...
Xpre-configure:
X	(cd ${WRKSRC}; autoreconf --force)
X
X# we should probably allow the tty to be set in /etc/mk.conf too
X#
Xpost-build:
X	${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${WRKSRC}/examples/apcupsd.conf > \
X		${WRKDIR}/apcupsd.conf.sample
X	${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${FILESDIR}/apcupsd > \
X		${WRKDIR}/apcupsd
X	${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${WRKSRC}/doc/apcupsd.man > \
X		${WRKSRC}/doc/apcupsd.8
X
XDOCS=	README.BackUPS-Pro	\
X	README.NEW		\
X	README.NewerBackUPS-Pro	\
X	README.Share-UPS	\
X	README.SmartUPS-VS	\
X	README.apcaccess	\
X	README.autoconfig	\
X	README.cable		\
X	README.developers	\
X	Statement.APCC 		\
X	minicom.apcupsd		\
X	port.gif
X
Xpost-install:
X	${INSTALL_DATA} ${WRKDIR}/apcupsd.conf.sample ${PREFIX}/etc/
X	${INSTALL_SCRIPT} ${WRKDIR}/apcupsd ${PREFIX}/etc/rc.d/
X	@${MKDIR} ${PREFIX}/share/doc/apcupsd
X.for file in ${DOCS}
X	${INSTALL_DATA} ${WRKSRC}/doc/${file} ${PREFIX}/share/doc/apcupsd/
X.endfor
X
X.include "../../mk/bsd.pkg.mk"
END-of-Makefile
echo c - files/
mkdir -p files/ > /dev/null 2>&1
echo x - files/apcupsd
sed 's/^X//' >files/apcupsd << 'END-of-files/apcupsd'
X#! /bin/sh
X#
X
X# PROVIDE: apcupsd
X# REQUIRE: DAEMON
X
XPREFIX=@@PREFIX@@
X
X. /etc/rc.subr
X. /etc/rc.conf
X
Xname="apcupsd"
X
Xcommand="${PREFIX}/sbin/${name}"
X
Xstart_cmd="${PREFIX}/sbin/powersc INIT"
Xstop_cmd="${PREFIX}/sbin/powersc STOP"
Xrestart_cmd="${PREFIX}/sbin/powersc RESTARTME"
X
Xpidfile="/var/run/${name}.pid"
X
Xrun_rc_command "$1"
END-of-files/apcupsd
echo x - files/md5
sed 's/^X//' >files/md5 << 'END-of-files/md5'
X$NetBSD$
X
XMD5 (apcupsd-3.6.2.tar.gz) = 2512748a0cd7937b99adb7d92d917d4f
END-of-files/md5
echo x - files/patch-sum
sed 's/^X//' >files/patch-sum << 'END-of-files/patch-sum'
X$NetBSD: patch-sum,v 1.1 2000/01/21 19:17:03 bouyer Exp $
X
XMD5 (patch-aa) = e598e45236b82252ae45ced7f48e667c
XMD5 (patch-ab) = 686f4194d1fdd860310749273641a97b
XMD5 (patch-ac) = cf0538899b14d3fbab4c54688b846b32
XMD5 (patch-ae) = 94cfc21a6857ca0c5b1a97e9631fa3d3
XMD5 (patch-af) = 483c8ab40f4ff507f5527418ef8db08f
XMD5 (patch-ag) = 4925009b65a37eb2a2e98f82b07c89dc
XMD5 (patch-ah) = 113278c927dc87661ea6c067a9386e3e
XMD5 (patch-ai) = 505b81196303d166a6e33292e13ec283
XMD5 (patch-aj) = 8eae4c6d36e5a8f5a26791a594a5651b
END-of-files/patch-sum
echo c - patches/
mkdir -p patches/ > /dev/null 2>&1
echo x - patches/patch-aa
sed 's/^X//' >patches/patch-aa << 'END-of-patches/patch-aa'
X+++ configure.in	Sun Jul  9 19:51:25 2000
X@@ -17,23 +17,28 @@
X dnl Check for local host architecture.
X dnl
X AC_CANONICAL_HOST		dnl Check for host type.
X-dnl
X+
X+
X+AC_PROG_CC			dnl Determine a C compiler to use.
X+AC_LANG_C
X+
X+dnl Try to get a POSIX.1 environment
X+AC_AIX
X+AC_MINIX
X+AC_ISC_POSIX
X+
X dnl
X dnl	Check for programs.
X dnl
X-AC_PROG_CC			dnl Determine a C compiler to use.
X AC_PROG_CPP			dnl Determine a C pre-processor to use.
X AC_PROG_CC_C_O			dnl Determine if C compiler support -c -o.
X AC_PROG_GCC_TRADITIONAL		dnl Determine if ioctl() need -traditional.
X AC_PROG_INSTALL			dnl Determine a BSD install program.
X 
X dnl Now check for programs
X-AC_PATH_PROGS(SHUTDOWN, shutdown shutdown.bsd,
X-AC_PATH_PROGS(RANLIB, ranlib true,
X-AC_PATH_PROGS(WALL, wall,
X+AC_PATH_PROGS(SHUTDOWN, shutdown shutdown.bsd, shutdown, $PATH:/sbin:/usr/sbin)
X+AC_PATH_PROGS(RANLIB, ranlib, true)
X+AC_PATH_PROGS(WALL, wall, cat)
X 
X dnl	Check for libraries.
X dnl
X@@ -112,6 +117,7 @@
X              
X AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPTLONG),
X     [EXTRASRC="$EXTRASRC \$(srcdir)/lib/getopt.c \$(srcdir)/lib/getopt1.c"
X+     CPPFLAGS="-Ilib"
X      EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
X 
X dnl
X@@ -172,11 +178,6 @@
X AC_SYS_LONG_FILE_NAMES		dnl Check for long file names.
X AC_SYS_RESTARTABLE_SYSCALLS	dnl Check interrupted syscalls will restart.
X dnl
X-dnl
X-dnl UNIX variants
X-AC_AIX				dnl Check for aix.
X-AC_ISC_POSIX			dnl Check for isc.
X-AC_MINIX			dnl Check for minix.
X dnl
X dnl
X dnl	Check for enable particular features.
END-of-patches/patch-aa
echo x - patches/patch-ab
sed 's/^X//' >patches/patch-ab << 'END-of-patches/patch-ab'
X+++ Makefile.in	Sun Jul  9 18:47:31 2000
X@@ -134,7 +134,7 @@
X dummy:
X 
X .c.o:
X-	$(CC) $(defines) -c $(CPFLAGS) -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/lib @INTLINCLUDE@ $(CEFLAGS) $(CFLAGS) $<
X+	$(CC) $(defines) -c $(CPFLAGS) -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/lib @INTLINCLUDE@ $(CEFLAGS) $(CFLAGS) -o $@ $<
X 
X # For some losing Unix makes.
X SHELL = /bin/sh
X@@ -167,7 +167,7 @@
X 	@echo "Installing powersc script..."
X 	$(INSTALL_PROGRAM) installs/powersc $(sbindir)/powersc
X 	@echo "Installing manual page..."
X-	$(INSTALL_DATA) $(srcdir)/doc/apcupsd.man $(mandir)/apcupsd.$(manext)
X+	$(INSTALL_DATA) $(srcdir)/doc/apcupsd.$(manext) $(mandir)/apcupsd.$(manext)
X 	@echo "Installing language catalogs..."
X 	@POMAKE@ install
X 
END-of-patches/patch-ab
echo x - patches/patch-ac
sed 's/^X//' >patches/patch-ac << 'END-of-patches/patch-ac'
X$NetBSD: patch-ac,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
X
X+++ apchttp.c	Sun Jul 18 19:50:58 1999
X@@ -70,7 +70,6 @@
X 
X #include <ctype.h>
X #include <errno.h>
X-#include <netinet/in.h>
X #include <signal.h>
X #include <stdio.h>
X #include <stdlib.h>
X@@ -80,6 +79,7 @@
X #include <sys/types.h>
X #include <time.h>
X #include <unistd.h>
X+#include <netinet/in.h>
X 
X /* apc includes */
X #include <apc_version.h>
END-of-patches/patch-ac
echo x - patches/patch-ae
sed 's/^X//' >patches/patch-ae << 'END-of-patches/patch-ae'
X+++ apcserial.c	Sun Jul  9 17:39:35 2000
X@@ -134,10 +134,10 @@
X 	newtio.c_oflag = 0;                  /* Raw output */
X 	newtio.c_lflag = 0;                  /* No local echo */
X 
X-#ifdef __freebsd__
X+#if defined(__freebsd__) || defined (__NetBSD__)
X 	newtio.c_ispeed = DEFAULT_SPEED;     /* Set input speed */
X 	newtio.c_ospeed = DEFAULT_SPEED;     /* Set output speed */
X-#endif /* __freebsd__ */
X+#endif /* __freebsd__  || __NetBSD__ */
X 
X 	/* w.p. This makes a non.blocking read() with 5 sec. timeout */
X 	newtio.c_cc[VMIN] = 0;
X@@ -206,7 +206,6 @@
X {
X 	char response[32];                                         /* w.p. */
X 	char a;
X-	FILE *pwdf;
X 	int errflag = 0;
X 	response[0] = '\0';
X 
X@@ -242,19 +241,6 @@
X 				}
X 			}
X 		}
X-		if ((((pwdf = fopen(PWRFAIL, "r" )) == NULL) &&
X-		    (ups->mode.type != BK)) ||
X-		    (((pwdf = fopen(PWRFAIL, "r" )) == NULL) &&
X-		    (ups->LineUp != 0) && (ups->mode.type == BK))) {
X-			fprintf(stderr,
X-			        ups->argvalue, ups->argvalue,
X-			        ups->argvalue, ups->argvalue);
X-			terminate(0);
X-		} else {
X 			errflag=0;                             /* w.p. */
X 			if ((ups->class.type == SHAREMASTER) ||
X 			    (ups->class.type == SHARENETMASTER)) {
X@@ -271,7 +257,6 @@
X 					ups->argvalue);
X 				sleep(15);
X 			}
X-			fclose(pwdf);
X 
X 			fprintf(stderr,
X 				"%s: Attempting to kill the power!\n",
X@@ -420,9 +405,7 @@
X 				}
X 			}
X 			/* w.p. */
X-			sleep(10);
X 			terminate(0);
X-		}
X 	} else {
X 		if (ups->mode.type <= SHAREBASIC) {
X 			switch(ups->cable.type) {
END-of-patches/patch-ae
echo x - patches/patch-af
sed 's/^X//' >patches/patch-af << 'END-of-patches/patch-af'
X+++ apcupsd.c	Sun Jul  9 17:39:48 2000
X@@ -292,13 +292,6 @@
X  * it should close them.
X  *********************************************************************/
X void terminate (int sig) {
X-	/*
X-	 * XXX - Is someone able to explain me why here we find a sleep for 10
X-	 * seconds ?
X-	 *
X-	 * -RF
X-	 */
X-	sleep(10);
X #ifdef NEW_THREADS
X 	restore_signals();
X #endif /* NEW_THREADS */
END-of-patches/patch-af
echo x - patches/patch-ag
sed 's/^X//' >patches/patch-ag << 'END-of-patches/patch-ag'
X+++ include/apc_defines.h	Sun Jul  9 19:10:44 2000
X@@ -68,6 +68,12 @@
X #define PWRFAIL			"/var/run/powerfail"
X #endif /* __freebsd__ */
X 
X+#ifdef __NetBSD__
X+# define APCCONF		"/etc/apcupsd.conf"
X+# define UPS_STAT		"/var/run/apcupsd.status"
X+# define PWRFAIL		"/var/run/powerfail"
X+#endif /* __NetBSD__ */
X+
X #ifndef APCCONF
X #define APCCONF			"/etc/apcupsd.conf"
X #endif
X@@ -82,7 +88,7 @@
X 
X #define NOLOGIN			"/etc/nologin"
X #define APCPID			"/var/run/apcupsd.pid"
X-#define LOG_FILE		"/var/log/apcupsd.log"
X+#define LOG_FILE		"/var/log/apcupsd"
X 
X #if USE_TMP_DIRECTORY
X #define APC_RE_NET		"/tmp/apcupsd.re-net"
X@@ -91,7 +97,7 @@
X #endif /* USE_TMP_DIRECTORY */
X 
X #define APC_LOCK_PREFIX		"/LCK.."
X-#define LOCK_DEFAULT		"/var/lock"
X+#define LOCK_DEFAULT		"/var/spool/lock"
X 
X #define APC_MAGIC		"apcupsd-linux-4.0"
X 
END-of-patches/patch-ag
echo x - patches/patch-ah
sed 's/^X//' >patches/patch-ah << 'END-of-patches/patch-ah'
X+++ doc/apcupsd.man	Sun Jul  9 19:25:06 2000
X@@ -8,13 +8,13 @@
X .SH NAME
X apcupsd \- daemon for Most APCC's UPS support under Linux
X .SH SYNOPSIS
X-.B /sbin/apcupsd 
X+.B @@PREFIX@@/sbin/apcupsd 
X .br
X-.B /sbin/powersc
X+.B @@PREFIX@@/sbin/powersc
X .br
X .B /etc/apcupsd.conf
X .br
X-.B /sbin/apcaccess
X+.B @@PREFIX@@/bin/apcaccess
X .SH DESCRIPTION
X .LP
X This daemon can be used for controlling the APC SmartUPS. During a power
X@@ -23,7 +23,7 @@
X about this fact. If power is not restored, a system shutdown will follow
X when the battery is exausted, a timeout (seconds) expires, or runtime
X minutes based on internal values based on power consumption rates. The
X-whole shutdown is now made by script calls to the "/sbin/powersc"
X+whole shutdown is now made by script calls to the "@@PREFIX@@/sbin/powersc"
X file called by "apcupsd", so no changes in the inittab are necessary.
X There is now no communication between "apcupsd" and init(1) process.
X .LP
X@@ -46,7 +46,7 @@
X .SH CONFIGURATION
X It is necessary to write configuration info to the file "/etc/apcupsd.conf".  
X This file is a plain ASCII file and you can use your favorite editor for
X-configuration. For simple configuration, see enclosed sample file.
X+configuration. For simple configuration, see sample file in @@PREFIX@@/etc
X .LP 
X Configuration commands in 
X .B /etc/apcupsd.conf
X@@ -54,7 +54,7 @@
X .LP
X .B  CONTROL
X -- <path|filename>
X-.B /sbin/powersc
X+.B @@PREFIX@@/sbin/powersc
X .br
X Name of control script called by "apcupsd".
X .LP
X@@ -121,7 +121,7 @@
X -- <name of serial port>
X .br
X Please specify which device is used for UPS communication.
X-The default is /dev/ttyS[0|1|2|3].
X+The default is /dev/tty0[0|1|2|3].
X .LP
X .B  LOCKFILE
X -- <path to lockfile>
X@@ -163,7 +163,7 @@
X -- <time in seconds>
X .br
X Please specify time in seconds for "apcupsd" to update the psuedo
X-proc fs file "/etc/apcupsd.status". This rate is reset if there is
X+proc fs file "/var/run/apcupsd.status". This rate is reset if there is
X a power state change.
X .LP
X This will be replaced with "apcaccess 'status'" calls. This will prevent
X@@ -173,7 +173,7 @@
X -- <time in seconds>
X .br
X Please specify time in seconds for "apcupsd" to update the log file
X-"/var/log/apcupsd.log". This rate is reset if there is a power state change.
X+"/var/log/apcupsd". This rate is reset if there is a power state change.
X .br
X Future additions will allow one to select the location of the logfile.
X .LP
X@@ -487,14 +487,14 @@
X .B /etc/apcupsd.conf
X - configuration file.
X .br
X-.B /etc/apcupsd.status
X+.B /var/run/apcupsd.status
X - psuedo procfs-type file.
X .br
X-.B /var/log/apcupsd.log
X+.B /var/log/apcupsd
X - the UPS status is logged.
X .SH FILE FORMAT
X .br
X-Both "apcupsd.log" and "apcupsd.status" are simple ascii files with
X+Both "apcupsd" and "apcupsd.status" are simple ascii files with
X several floating point numbers on one line. The format varies based
X on the type of UPS that you are using.
X .LP
X@@ -570,7 +570,7 @@
X .br
X BATTSTAT : BatteryStatus
X .LP
X-.B /var/log/apcupsd.log
X+.B /var/log/apcupsd
X .br
X .B SmartUPS and MatrixUPS Smart Signals
X .br
END-of-patches/patch-ah
echo x - patches/patch-ai
sed 's/^X//' >patches/patch-ai << 'END-of-patches/patch-ai'
X+++ installs/powersc.in	Sun Jul  9 18:10:23 2000
X@@ -26,66 +26,68 @@
X case "$1" in
X 	POWEROUT)
X 		printf "Warning!  There are power problems." | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Warning there are Power problems."
X 		;;
X 	ONBATTERY)
X 		printf "Power Failure! Running on UPS." | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Power Failure! Running on UPS."
X 		;;
X 	FAILING)
X-		printf "Battery Power Failed -- Normal Shutdown.\n" | $WALL
X+		printf "Battery power failed -- Normal shutdown.\n" | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Battery power failed -- Normal shutdown."
X 		;;
X 	TIMEOUT)
X 		printf "On-line battery timeout -- Normal Shutdown.\n" | $WALL
X+		/usr/bin/logger -p user.info -t powersc "On-line battery timeout -- Normal Shutdown."
X 		;;
X 	LOADLIMIT)
X 		printf "Battery load limits reached -- Normal Shutdown.\n" | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Battery load limits reached -- Normal Shutdown."
X 		;;
X 	RUNLIMIT)
X 		printf "Battery run time limits reached -- Normal Shutdown.\n" | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Battery run time limits reached -- Normal Shutdown."
X 		;;
X 	DOSHUTDOWN)
X-		printf "Beginning Shutdown Sequence!" | $WALL
X-		ps x | gawk '{ if (($5 == "init") && ($1 == "1")) print $6 }' \
X-			| cut -f2 -d[ | cut -f1 -d] \
X-			> /tmp/run.level.power
X 		if [ -f $POWERPID ]
X 		then
X 			exit 0
X 		else
X 			echo $$ > $POWERPID
X-			$SHUTDOWN -h now
X+			$SHUTDOWN -h now "$0: beginning normal UPS initiated shutdown..."
X 		fi
X 		;;
X 	MAINSBACK | WAITASEC)
X 		printf "Power has returned." | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Power has returned."
X 		if [ -f $POWERPID ]; then
X 			printf "Attempting to cancel shutdown." | $WALL
X+			/usr/bin/logger -p user.info -t powersc "Attempting to cancel shutdown."
X 			kill $(cat $POWERPID)
X 			rm -f $POWERPID
X-			init $(cat /tmp/run.level.power)
X 		fi
X 		;;
X 	ANNOYME)
X-		printf "Power Problems!  Please Log Off Now!" | $WALL
X+		printf "Power Problems!  Please logout now!" | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Power Problems!  Please logout now!"
X 		;;
X 	EMERGENCY)
X-		printf "Possible battery failure -- Emergency Shutdown!" | $WALL
X-		$SHUTDOWN -h now
X+		$SHUTDOWN -h now "$0: Emergency shutdown, UPS Batteries have failed"
X 		;;
X 	CHANGEME)
X-		printf "Emergency -- Batteries Have Failed!\nChange Them NOW!" | $WALL
X+		printf "Emergency -- Batteries have failed!\nChange them as soon as possible!" | $WALL
X+		/usr/bin/logger -p user.info -t powersc "Emergency -- Batteries have failed!  Change them as soon as possible!"
X 		;;
X 	REMOTE)
X-		printf "Remote Calls -- Normal Shutdown.\nBeginning Shutdown Sequence!" | $WALL
X-		$SHUTDOWN -h now
X+		$SHUTDOWN -h now "Remote UPS calls -- Normal shutdown.  Beginning shutdown sequence!"
X 		;;
X 	KILL)	sleep 1
X 		$APCUPSD killpower
X 		sleep 10
X 		;;
X 	INIT)	rm -f $POWERPID
X-		rm -f /etc/powerfail
X-		rm -f /etc/powerstatus
X-		rm -f /etc/nologin
X+		rm -f /var/run/powerfail
X+		rm -f /var/run/apcupsd.status
X                 [ "$2" = "" ] && echo -n "Starting APCUPSD Power Management: "
X 		$APCUPSD
X 		[ "$2" = "" ] && echo "apcupsd"
X@@ -103,9 +105,8 @@
X 		kill $(cat $APCPID)
X 		rm -f $APCPID
X 		rm -f $POWERPID
X-		rm -f /etc/powerfail
X-		rm -f /etc/powerstatus
X-		rm -f /etc/nologin
X+		rm -f /var/run/powerfail
X+		rm -f /var/run/apcupsd.status
X 		sleep 10
X 		$APCUPSD
X 		[ "$2" = "" ] && echo "apcupsd"
END-of-patches/patch-ai
echo x - patches/patch-aj
sed 's/^X//' >patches/patch-aj << 'END-of-patches/patch-aj'
X+++ examples/apcupsd.conf	Sun Jul  9 18:52:10 2000
X@@ -3,7 +3,7 @@
X # "apcupsd" POSIX config file
X #
X # CONTROL <string>
X-CONTROL /sbin/powersc
X+CONTROL @@PREFIX@@/sbin/powersc
X #
X # UPSCABLE [ simple | smart |
X #            940-00(20B,23A,24B,24C,24G,95A,95C) |
X@@ -26,10 +26,10 @@
X UPSMODE disable
X #
X #DEVICE <string> /dev/<serial port>
X-DEVICE /dev/ttyS0
X+DEVICE /dev/tty01
X #
X #LOCKFILE <path to lockfile>
X-LOCKFILE /var/lock
X+LOCKFILE /var/spool/lock
X #
X #ACCESS <string> [ true | false ] Enable Access Support
X ACCESS true
X@@ -44,10 +44,10 @@
X NOLOGON timeout
X #
X # PROCFS <int> <120> <0> disables <update rate procfs-type of current status>
X-PROCFS 0
X+PROCFS 60
X #
X # LOGGING <int> <500> <0> disables <rate update log file of current status>
X-LOGGING 0
X+LOGGING 60
X #
X # TIMEOUT <time is seconds to run on UPS, powerfails>
X TIMEOUT 900
END-of-patches/patch-aj
echo c - pkg/
mkdir -p pkg/ > /dev/null 2>&1
echo x - pkg/COMMENT
sed 's/^X//' >pkg/COMMENT << 'END-of-pkg/COMMENT'
XUPS power management for APCC Products
END-of-pkg/COMMENT
echo x - pkg/DESCR
sed 's/^X//' >pkg/DESCR << 'END-of-pkg/DESCR'
XIt allows your computer/server to run during power problems
Xfor a specified length of time or the life of the batteries
Xin your BackUPS, BackUPS Pro, SmartUPS v/s, or SmartUPS, and
Xthen properly executes a controlled shutdown during an
Xextended power failure.
END-of-pkg/DESCR
echo x - pkg/MESSAGE
sed 's/^X//' >pkg/MESSAGE << 'END-of-pkg/MESSAGE'
XNOTE:  With most APC cables you must put a "local" flag in /etc/ttys for
Xthe port you connect your UPS to (and run "ttyflags -a" to turn it on
Xthe first time).
END-of-pkg/MESSAGE
echo x - pkg/PLIST
sed 's/^X//' >pkg/PLIST << 'END-of-pkg/PLIST'
X@comment $NetBSD: PLIST,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
X
X@unexec %D/etc/rc.d/apcupsd stop ; echo "apcupsd stopped."
Xsbin/apcaccess
Xsbin/apcupsd
Xsbin/powersc
Xetc/apcupsd.conf.sample
Xetc/rc.d/apcupsd
Xman/man8/apcupsd.8
Xshare/doc/apcupsd/README.BackUPS-Pro
Xshare/doc/apcupsd/README.NEW
Xshare/doc/apcupsd/README.NewerBackUPS-Pro
Xshare/doc/apcupsd/README.Share-UPS
Xshare/doc/apcupsd/README.SmartUPS-VS
Xshare/doc/apcupsd/README.apcaccess
Xshare/doc/apcupsd/README.autoconfig
Xshare/doc/apcupsd/README.cable
Xshare/doc/apcupsd/README.developers
Xshare/doc/apcupsd/Statement.APCC
Xshare/doc/apcupsd/minicom.apcupsd
X@dirrm share/doc/apcupsd
END-of-pkg/PLIST
exit


>Release-Note:
>Audit-Trail:
>Unformatted: