summaryrefslogtreecommitdiff
path: root/sysutils/apcupsd
diff options
context:
space:
mode:
authorjlam <jlam>2000-08-05 07:31:15 +0000
committerjlam <jlam>2000-08-05 07:31:15 +0000
commit598cd1ada90b17fcd80489c6887d2db236481712 (patch)
tree8b2436b65057b81666254c8df7e4991ac669ae66 /sysutils/apcupsd
parente5a9923a76ff3691da62fcc8ac366dd80331ed6e (diff)
downloadpkgsrc-598cd1ada90b17fcd80489c6887d2db236481712.tar.gz
Update apcupsd to 3.6.2. Package provided by Greg Woods <woods@weird.com>
in pkg/10552. Changes from version 3.5.8: Network is fully functional under non-threaded compile. Possible fix for "pipe_master_status" calls on slaves. Added 940-1524C smart signal cable support. Added internationalization support. There is _only_ the support but no current code is written for the intl package. It can be compiled in, but intl strings have still to be translated (to be done in the future). Added new configuration options to reduce init time of daemon. powersc CONFIG powersc NAME powersc BATTERY Fixes a FIFO error
Diffstat (limited to 'sysutils/apcupsd')
-rw-r--r--sysutils/apcupsd/Makefile89
-rw-r--r--sysutils/apcupsd/files/apcupsd43
-rw-r--r--sysutils/apcupsd/files/md54
-rw-r--r--sysutils/apcupsd/files/patch-sum21
-rw-r--r--sysutils/apcupsd/patches/patch-aa152
-rw-r--r--sysutils/apcupsd/patches/patch-ab51
-rw-r--r--sysutils/apcupsd/patches/patch-ac49
-rw-r--r--sysutils/apcupsd/patches/patch-ad113
-rw-r--r--sysutils/apcupsd/patches/patch-ae126
-rw-r--r--sysutils/apcupsd/patches/patch-af80
-rw-r--r--sysutils/apcupsd/patches/patch-ag76
-rw-r--r--sysutils/apcupsd/patches/patch-ah91
-rw-r--r--sysutils/apcupsd/patches/patch-ai126
-rw-r--r--sysutils/apcupsd/patches/patch-aj26
-rw-r--r--sysutils/apcupsd/pkg/MESSAGE7
-rw-r--r--sysutils/apcupsd/pkg/PLIST12
16 files changed, 609 insertions, 457 deletions
diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile
index 674273254a0..c378cce7860 100644
--- a/sysutils/apcupsd/Makefile
+++ b/sysutils/apcupsd/Makefile
@@ -1,29 +1,66 @@
-# $NetBSD: Makefile,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+# $NetBSD: Makefile,v 1.2 2000/08/05 07:31:15 jlam Exp $
#
-DISTNAME= apcupsd-3.5.8.src
-PKGNAME= apcupsd-3.5.8
-CATEGORIES= sysutils
-MASTER_SITES= ftp://sunsite.unc.edu/pub/linux/system/ups/
-
-MAINTAINER= bouyer@netbsd.org
-HOMEPAGE= http://www.brisse.dk/site/apcupsd/
-
-USE_GMAKE= yes
-
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/apcupsd-netbsd ${PREFIX}/sbin/apcupsd
- ${INSTALL_PROGRAM} ${WRKSRC}/apcaccess-netbsd ${PREFIX}/bin/apcaccess
- ${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${WRKSRC}/installs/powersc > \
- ${WRKDIR}/powersc
- ${INSTALL_SCRIPT} ${WRKDIR}/powersc ${PREFIX}/sbin/
- ${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${WRKSRC}/installs/apcupsd.conf > \
- ${WRKDIR}/apcupsd.conf.sample
- ${INSTALL_DATA} ${WRKDIR}/apcupsd.conf.sample ${PREFIX}/etc/
- @${MKDIR} ${PREFIX}/share/doc/apcupsd
- ${INSTALL_DATA} ${WRKSRC}/readmes/README* \
- ${WRKSRC}/readmes/minicom.apcupsd ${PREFIX}/share/doc/apcupsd/
- ${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${WRKSRC}/docs/apcupsd.man8 > \
- ${WRKDIR}/apcupsd.8
- ${INSTALL_MAN} ${WRKDIR}/apcupsd.8 ${PREFIX}/man/man8/
+DISTNAME= apcupsd-3.6.2
+CATEGORIES= sysutils
+MASTER_SITES= http://www.brisse.dk/dlarea/
+
+MAINTAINER= bouyer@netbsd.org
+HOMEPAGE= http://www.brisse.dk/site/apcupsd/
+
+BUILD_DEPENDS+= autoreconf:../../devel/autoconf
+DEPENDS+= gettext>=0.10.35nb1:../../devel/gettext
+
+USE_GMAKE= # defined
+
+GNU_CONFIGURE= # defined
+CONFIGURE_ARGS+= --enable-http # include http support
+
+# Thread support is needed to compile powerflute, which has a curses interface
+#
+#DEPENDS+= ncurses-*:../../devel/ncurses
+#CONFIGURE_ARGS+= --enable-threads # compile threading code
+#CONFIGURE_ARGS+= --enable-powerflute # compile powerflute program
+
+CONFIGURE_ARGS+= --with-catgets # use catgets functions
+CONFIGURE_ARGS+= --enable-nls # i18n support
+CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS+= -I${LOCALBASE}/include # libintl.h
+CFLAGS+= -I${LOCALBASE}/include # libintl.h
+
+pre-configure:
+ cd ${WRKSRC} && autoreconf --force
+
+# we should probably allow the tty to be set in /etc/mk.conf too
+#
+post-build:
+ ${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${WRKSRC}/examples/apcupsd.conf > \
+ ${WRKDIR}/apcupsd.conf
+ ${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${FILESDIR}/apcupsd > \
+ ${WRKDIR}/apcupsd
+ ${SED} -e 's|@@PREFIX@@|${PREFIX}|' ${WRKSRC}/doc/apcupsd.man > \
+ ${WRKSRC}/doc/apcupsd.8
+
+DOCS= README.BackUPS-Pro \
+ README.NEW \
+ README.NewerBackUPS-Pro \
+ README.Share-UPS \
+ README.SmartUPS-VS \
+ README.apcaccess \
+ README.autoconfig \
+ README.cable \
+ README.developers \
+ Statement.APCC \
+ minicom.apcupsd \
+ port.gif
+
+post-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples
+ ${INSTALL_DATA} ${WRKDIR}/apcupsd.conf ${PREFIX}/share/examples
+ ${INSTALL_SCRIPT} ${WRKDIR}/apcupsd ${PREFIX}/etc/rc.d
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/apcupsd
+.for file in ${DOCS}
+ ${INSTALL_DATA} ${WRKSRC}/doc/${file} ${PREFIX}/share/doc/apcupsd
+.endfor
+
.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/apcupsd/files/apcupsd b/sysutils/apcupsd/files/apcupsd
new file mode 100644
index 00000000000..f8f9c75ea40
--- /dev/null
+++ b/sysutils/apcupsd/files/apcupsd
@@ -0,0 +1,43 @@
+#! /bin/sh
+#
+# $NetBSD: apcupsd,v 1.1 2000/08/05 07:31:16 jlam Exp $
+#
+# PROVIDE: apcupsd
+# REQUIRE: DAEMON
+
+name="apcupsd"
+command="@@PREFIX@@/sbin/powersc"
+pidfile="/var/run/${name}.pid"
+
+cmd=${1:-start}
+
+case ${cmd} in
+start)
+ if [ -x ${command} ]; then
+ echo "Starting ${name}."
+ ${command} INIT
+ fi
+ ;;
+stop)
+ if [ -f ${pidfile} ]; then
+ pid=`head 1 ${pidfile}`
+ echo "Stopping ${name}."
+ ${command} STOP
+ fi
+ ;;
+restart)
+ if [ -x ${command} ]; then
+ echo "Restarting ${name}."
+ ${command} RESTARTME
+ fi
+ ;;
+status)
+ if [ -f ${pidfile} ]; then
+ pid=`head -1 ${pidfile}`
+ echo "${name} is running as pid ${pid}."
+ else
+ echo "${name} is not running."
+ fi
+ ;;
+esac)
+exit 0
diff --git a/sysutils/apcupsd/files/md5 b/sysutils/apcupsd/files/md5
index 7d5c385ebb7..5813086f66b 100644
--- a/sysutils/apcupsd/files/md5
+++ b/sysutils/apcupsd/files/md5
@@ -1,3 +1,3 @@
-$NetBSD: md5,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+$NetBSD: md5,v 1.2 2000/08/05 07:31:16 jlam Exp $
-MD5 (apcupsd-3.5.8.src.tar.gz) = ced9e22844bd9b490bb5ec7dbed8b014
+MD5 (apcupsd-3.6.2.tar.gz) = 2512748a0cd7937b99adb7d92d917d4f
diff --git a/sysutils/apcupsd/files/patch-sum b/sysutils/apcupsd/files/patch-sum
index db99e9d6869..04684845d64 100644
--- a/sysutils/apcupsd/files/patch-sum
+++ b/sysutils/apcupsd/files/patch-sum
@@ -1,12 +1,11 @@
-$NetBSD: patch-sum,v 1.1 2000/01/21 19:17:03 bouyer Exp $
+$NetBSD: patch-sum,v 1.2 2000/08/05 07:31:17 jlam Exp $
-MD5 (patch-aa) = c12def25bc90455d711b3d416c08542e
-MD5 (patch-ab) = 76d6f1c96bb2d9b841e75696c8142ad2
-MD5 (patch-ac) = cf0538899b14d3fbab4c54688b846b32
-MD5 (patch-ad) = 8f949994fa6d5220f0c79d18f7d0bf12
-MD5 (patch-ae) = 98cd671114488be7145cb31f1074e199
-MD5 (patch-af) = b646705b36b051c235c7ff324539e0ea
-MD5 (patch-ag) = 96c819068224c6ac1fa843005541a386
-MD5 (patch-ah) = 383d130645c24cd1195a19973a8f529e
-MD5 (patch-ai) = 84c21435bae5e38b6ac0ae15d930dd16
-MD5 (patch-aj) = a52aa37a6352eb75188dd36ef317384e
+MD5 (patch-aa) = af67f75b5487cf80626c2247410eca21
+MD5 (patch-ab) = 568e39b7d4496ade71b2ba670e310567
+MD5 (patch-ac) = 511bfd8694ec429b0abf14406b44f98d
+MD5 (patch-ad) = 0b127ea165d605de88dfbe150e2bab4f
+MD5 (patch-ae) = c05e372a33c9fdb625f97e2b4f595886
+MD5 (patch-af) = dc377b31fd2fdea29cf95e23b6dfa321
+MD5 (patch-ag) = cb4f92d6d04c3a09b37c36326e1ce909
+MD5 (patch-ah) = 367a6b6feb8fbb9d061fb5c6e6c8c7c6
+MD5 (patch-ai) = 4be70365a678a2e7b319eb4283045969
diff --git a/sysutils/apcupsd/patches/patch-aa b/sysutils/apcupsd/patches/patch-aa
index 4a09c56e089..49be3e0d3af 100644
--- a/sysutils/apcupsd/patches/patch-aa
+++ b/sysutils/apcupsd/patches/patch-aa
@@ -1,52 +1,102 @@
-$NetBSD: patch-aa,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+$NetBSD: patch-aa,v 1.2 2000/08/05 07:31:17 jlam Exp $
---- Makefile.orig Wed Apr 7 18:06:41 1999
-+++ Makefile Tue Jul 20 18:36:50 1999
-@@ -85,7 +85,7 @@
-
- SHELL = /bin/sh
- ECHO = echo
--MAKE = make
-+MAKE ?= make
- CHOWN = chown
- CHMOD = chmod
- CP = cp
-@@ -120,6 +120,7 @@
- #* *
- #****************************************************************************
-
-+all: netbsd
- default :
- @$(ECHO)
- @$(ECHO) "Usage: make <system-type>"
-@@ -201,7 +202,7 @@
- @$(ECHO) >> .ver
- @$(ECHO) \#ifndef __$(OS)__ >> .ver
- @$(ECHO) \#define __$(OS)__ >> .ver
-- @$(ECHO) \#endif /*\ __$(OS)__ *\/ >> .ver
-+ @$(ECHO) \#endif /*\ __$(OS)__\ \*\/ >> .ver
- @$(ECHO) >> .ver
- @if [ -d /usr/include/ncurses ]; then \
- if [ -f /usr/include/ncurses/curses.h ]; then \
-@@ -227,7 +228,7 @@
- $(ECHO) \#undef __CURSES__ >> .ver; \
- fi
- @$(ECHO) >> .ver
-- @$(ECHO) \#endif /*\_APC_VERSION_H *\/ >> .ver
-+ @$(ECHO) \#endif /*\_APC_VERSION_H\ \*\/ >> .ver
- @$(MV) -f .ver $@
-
- ifdef MUSIC
-@@ -301,6 +302,12 @@
- @$(MAKE) depend $(APCUPSD) \
- OS="freebsd" \
- CC="cc"
-+
-+netbsd :
-+ @$(MAKE) depend $(APCUPSD) \
-+ OS="netbsd" \
-+ CC="cc"
-+
-
- # Generic: Generic BSD-ish system running gcc
-
+--- doc/apcupsd.man.orig Thu Jul 29 03:46:32 1999
++++ doc/apcupsd.man Sat Aug 5 02:52:40 2000
+@@ -8,13 +8,13 @@
+ .SH NAME
+ apcupsd \- daemon for Most APCC's UPS support under Linux
+ .SH SYNOPSIS
+-.B /sbin/apcupsd
++.B @@PREFIX@@/sbin/apcupsd
+ .br
+-.B /sbin/powersc
++.B @@PREFIX@@/sbin/powersc
+ .br
+ .B /etc/apcupsd.conf
+ .br
+-.B /sbin/apcaccess
++.B @@PREFIX@@/bin/apcaccess
+ .SH DESCRIPTION
+ .LP
+ This daemon can be used for controlling the APC SmartUPS. During a power
+@@ -23,7 +23,7 @@
+ about this fact. If power is not restored, a system shutdown will follow
+ when the battery is exausted, a timeout (seconds) expires, or runtime
+ minutes based on internal values based on power consumption rates. The
+-whole shutdown is now made by script calls to the "/sbin/powersc"
++whole shutdown is now made by script calls to the "@@PREFIX@@/sbin/powersc"
+ file called by "apcupsd", so no changes in the inittab are necessary.
+ There is now no communication between "apcupsd" and init(1) process.
+ .LP
+@@ -46,7 +46,7 @@
+ .SH CONFIGURATION
+ It is necessary to write configuration info to the file "/etc/apcupsd.conf".
+ This file is a plain ASCII file and you can use your favorite editor for
+-configuration. For simple configuration, see enclosed sample file.
++configuration. For simple configuration, see sample file in @@PREFIX@@/etc
+ .LP
+ Configuration commands in
+ .B /etc/apcupsd.conf
+@@ -54,7 +54,7 @@
+ .LP
+ .B CONTROL
+ -- <path|filename>
+-.B /sbin/powersc
++.B @@PREFIX@@/sbin/powersc
+ .br
+ Name of control script called by "apcupsd".
+ .LP
+@@ -121,7 +121,7 @@
+ -- <name of serial port>
+ .br
+ Please specify which device is used for UPS communication.
+-The default is /dev/ttyS[0|1|2|3].
++The default is /dev/tty0[0|1|2|3].
+ .LP
+ .B LOCKFILE
+ -- <path to lockfile>
+@@ -163,7 +163,7 @@
+ -- <time in seconds>
+ .br
+ Please specify time in seconds for "apcupsd" to update the psuedo
+-proc fs file "/etc/apcupsd.status". This rate is reset if there is
++proc fs file "/var/run/apcupsd.status". This rate is reset if there is
+ a power state change.
+ .LP
+ This will be replaced with "apcaccess 'status'" calls. This will prevent
+@@ -173,7 +173,7 @@
+ -- <time in seconds>
+ .br
+ Please specify time in seconds for "apcupsd" to update the log file
+-"/var/log/apcupsd.log". This rate is reset if there is a power state change.
++"/var/log/apcupsd". This rate is reset if there is a power state change.
+ .br
+ Future additions will allow one to select the location of the logfile.
+ .LP
+@@ -487,14 +487,14 @@
+ .B /etc/apcupsd.conf
+ - configuration file.
+ .br
+-.B /etc/apcupsd.status
++.B /var/run/apcupsd.status
+ - psuedo procfs-type file.
+ .br
+-.B /var/log/apcupsd.log
++.B /var/log/apcupsd
+ - the UPS status is logged.
+ .SH FILE FORMAT
+ .br
+-Both "apcupsd.log" and "apcupsd.status" are simple ascii files with
++Both "apcupsd" and "apcupsd.status" are simple ascii files with
+ several floating point numbers on one line. The format varies based
+ on the type of UPS that you are using.
+ .LP
+@@ -570,7 +570,7 @@
+ .br
+ BATTSTAT : BatteryStatus
+ .LP
+-.B /var/log/apcupsd.log
++.B /var/log/apcupsd
+ .br
+ .B SmartUPS and MatrixUPS Smart Signals
+ .br
diff --git a/sysutils/apcupsd/patches/patch-ab b/sysutils/apcupsd/patches/patch-ab
index 915b2e682e2..fe1c5b97853 100644
--- a/sysutils/apcupsd/patches/patch-ab
+++ b/sysutils/apcupsd/patches/patch-ab
@@ -1,14 +1,39 @@
-$NetBSD: patch-ab,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+$NetBSD: patch-ab,v 1.2 2000/08/05 07:31:18 jlam Exp $
---- apcaction.c Wed Apr 7 18:06:41 1999
-+++ apcaction.c Sun Jul 18 19:48:13 1999
-@@ -59,7 +59,9 @@
-
- #include <stdio.h>
- #include <unistd.h>
-+#ifndef __NetBSD__
- #include <getopt.h>
-+#endif /* __NetBSD__ */
- #include <stdlib.h>
- #include <stdarg.h>
- #include <fcntl.h>
+--- examples/apcupsd.conf.orig Wed May 26 12:22:25 1999
++++ examples/apcupsd.conf Sat Aug 5 02:52:40 2000
+@@ -3,7 +3,7 @@
+ # "apcupsd" POSIX config file
+ #
+ # CONTROL <string>
+-CONTROL /sbin/powersc
++CONTROL @@PREFIX@@/sbin/powersc
+ #
+ # UPSCABLE [ simple | smart |
+ # 940-00(20B,23A,24B,24C,24G,95A,95C) |
+@@ -26,10 +26,10 @@
+ UPSMODE disable
+ #
+ #DEVICE <string> /dev/<serial port>
+-DEVICE /dev/ttyS0
++DEVICE /dev/tty01
+ #
+ #LOCKFILE <path to lockfile>
+-LOCKFILE /var/lock
++LOCKFILE /var/spool/lock
+ #
+ #ACCESS <string> [ true | false ] Enable Access Support
+ ACCESS true
+@@ -44,10 +44,10 @@
+ NOLOGON timeout
+ #
+ # PROCFS <int> <120> <0> disables <update rate procfs-type of current status>
+-PROCFS 0
++PROCFS 60
+ #
+ # LOGGING <int> <500> <0> disables <rate update log file of current status>
+-LOGGING 0
++LOGGING 60
+ #
+ # TIMEOUT <time is seconds to run on UPS, powerfails>
+ TIMEOUT 900
diff --git a/sysutils/apcupsd/patches/patch-ac b/sysutils/apcupsd/patches/patch-ac
index 06d2539ee3f..91500504fce 100644
--- a/sysutils/apcupsd/patches/patch-ac
+++ b/sysutils/apcupsd/patches/patch-ac
@@ -1,20 +1,35 @@
-$NetBSD: patch-ac,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+$NetBSD: patch-ac,v 1.2 2000/08/05 07:31:18 jlam Exp $
---- apchttp.c Wed Apr 7 18:06:41 1999
-+++ apchttp.c Sun Jul 18 19:50:58 1999
-@@ -70,7 +70,6 @@
+--- include/apc_defines.h.orig Thu Jul 29 04:47:46 1999
++++ include/apc_defines.h Sat Aug 5 02:52:40 2000
+@@ -68,6 +68,12 @@
+ #define PWRFAIL "/var/run/powerfail"
+ #endif /* __freebsd__ */
- #include <ctype.h>
- #include <errno.h>
--#include <netinet/in.h>
- #include <signal.h>
- #include <stdio.h>
- #include <stdlib.h>
-@@ -80,6 +79,7 @@
- #include <sys/types.h>
- #include <time.h>
- #include <unistd.h>
-+#include <netinet/in.h>
++#ifdef __NetBSD__
++# define APCCONF "/etc/apcupsd.conf"
++# define UPS_STAT "/var/run/apcupsd.status"
++# define PWRFAIL "/var/run/powerfail"
++#endif /* __NetBSD__ */
++
+ #ifndef APCCONF
+ #define APCCONF "/etc/apcupsd.conf"
+ #endif
+@@ -82,7 +88,7 @@
+
+ #define NOLOGIN "/etc/nologin"
+ #define APCPID "/var/run/apcupsd.pid"
+-#define LOG_FILE "/var/log/apcupsd.log"
++#define LOG_FILE "/var/log/apcupsd"
+
+ #if USE_TMP_DIRECTORY
+ #define APC_RE_NET "/tmp/apcupsd.re-net"
+@@ -91,7 +97,7 @@
+ #endif /* USE_TMP_DIRECTORY */
+
+ #define APC_LOCK_PREFIX "/LCK.."
+-#define LOCK_DEFAULT "/var/lock"
++#define LOCK_DEFAULT "/var/spool/lock"
+
+ #define APC_MAGIC "apcupsd-linux-4.0"
- /* apc includes */
- #include <apc_version.h>
diff --git a/sysutils/apcupsd/patches/patch-ad b/sysutils/apcupsd/patches/patch-ad
index 1176564e804..e643bd4b59f 100644
--- a/sysutils/apcupsd/patches/patch-ad
+++ b/sysutils/apcupsd/patches/patch-ad
@@ -1,14 +1,101 @@
-$NetBSD: patch-ad,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+$NetBSD: patch-ad,v 1.2 2000/08/05 07:31:18 jlam Exp $
---- apcreports.c Wed Apr 7 18:06:41 1999
-+++ apcreports.c Sun Jul 18 19:48:17 1999
-@@ -58,7 +58,9 @@
-
- #include <stdio.h>
- #include <unistd.h>
-+#ifndef __NetBSD__
- #include <getopt.h>
-+#endif /* __NetBSD__ */
- #include <stdlib.h>
- #include <stdarg.h>
- #include <fcntl.h>
+--- installs/powersc.in.orig Thu Jul 29 03:46:32 1999
++++ installs/powersc.in Sat Aug 5 02:52:40 2000
+@@ -26,66 +26,68 @@
+ case "$1" in
+ POWEROUT)
+ printf "Warning! There are power problems." | $WALL
++ /usr/bin/logger -p user.info -t powersc "Warning there are Power problems."
+ ;;
+ ONBATTERY)
+ printf "Power Failure! Running on UPS." | $WALL
++ /usr/bin/logger -p user.info -t powersc "Power Failure! Running on UPS."
+ ;;
+ FAILING)
+- printf "Battery Power Failed -- Normal Shutdown.\n" | $WALL
++ printf "Battery power failed -- Normal shutdown.\n" | $WALL
++ /usr/bin/logger -p user.info -t powersc "Battery power failed -- Normal shutdown."
+ ;;
+ TIMEOUT)
+ printf "On-line battery timeout -- Normal Shutdown.\n" | $WALL
++ /usr/bin/logger -p user.info -t powersc "On-line battery timeout -- Normal Shutdown."
+ ;;
+ LOADLIMIT)
+ printf "Battery load limits reached -- Normal Shutdown.\n" | $WALL
++ /usr/bin/logger -p user.info -t powersc "Battery load limits reached -- Normal Shutdown."
+ ;;
+ RUNLIMIT)
+ printf "Battery run time limits reached -- Normal Shutdown.\n" | $WALL
++ /usr/bin/logger -p user.info -t powersc "Battery run time limits reached -- Normal Shutdown."
+ ;;
+ DOSHUTDOWN)
+- printf "Beginning Shutdown Sequence!" | $WALL
+- ps x | gawk '{ if (($5 == "init") && ($1 == "1")) print $6 }' \
+- | cut -f2 -d[ | cut -f1 -d] \
+- > /tmp/run.level.power
+ if [ -f $POWERPID ]
+ then
+ exit 0
+ else
+ echo $$ > $POWERPID
+- $SHUTDOWN -h now
++ $SHUTDOWN -h now "$0: beginning normal UPS initiated shutdown..."
+ fi
+ ;;
+ MAINSBACK | WAITASEC)
+ printf "Power has returned." | $WALL
++ /usr/bin/logger -p user.info -t powersc "Power has returned."
+ if [ -f $POWERPID ]; then
+ printf "Attempting to cancel shutdown." | $WALL
++ /usr/bin/logger -p user.info -t powersc "Attempting to cancel shutdown."
+ kill $(cat $POWERPID)
+ rm -f $POWERPID
+- init $(cat /tmp/run.level.power)
+ fi
+ ;;
+ ANNOYME)
+- printf "Power Problems! Please Log Off Now!" | $WALL
++ printf "Power Problems! Please logout now!" | $WALL
++ /usr/bin/logger -p user.info -t powersc "Power Problems! Please logout now!"
+ ;;
+ EMERGENCY)
+- printf "Possible battery failure -- Emergency Shutdown!" | $WALL
+- $SHUTDOWN -h now
++ $SHUTDOWN -h now "$0: Emergency shutdown, UPS Batteries have failed"
+ ;;
+ CHANGEME)
+- printf "Emergency -- Batteries Have Failed!\nChange Them NOW!" | $WALL
++ printf "Emergency -- Batteries have failed!\nChange them as soon as possible!" | $WALL
++ /usr/bin/logger -p user.info -t powersc "Emergency -- Batteries have failed! Change them as soon as possible!"
+ ;;
+ REMOTE)
+- printf "Remote Calls -- Normal Shutdown.\nBeginning Shutdown Sequence!" | $WALL
+- $SHUTDOWN -h now
++ $SHUTDOWN -h now "Remote UPS calls -- Normal shutdown. Beginning shutdown sequence!"
+ ;;
+ KILL) sleep 1
+ $APCUPSD killpower
+ sleep 10
+ ;;
+ INIT) rm -f $POWERPID
+- rm -f /etc/powerfail
+- rm -f /etc/powerstatus
+- rm -f /etc/nologin
++ rm -f /var/run/powerfail
++ rm -f /var/run/apcupsd.status
+ [ "$2" = "" ] && echo -n "Starting APCUPSD Power Management: "
+ $APCUPSD
+ [ "$2" = "" ] && echo "apcupsd"
+@@ -103,9 +105,8 @@
+ kill $(cat $APCPID)
+ rm -f $APCPID
+ rm -f $POWERPID
+- rm -f /etc/powerfail
+- rm -f /etc/powerstatus
+- rm -f /etc/nologin
++ rm -f /var/run/powerfail
++ rm -f /var/run/apcupsd.status
+ sleep 10
+ $APCUPSD
+ [ "$2" = "" ] && echo "apcupsd"
diff --git a/sysutils/apcupsd/patches/patch-ae b/sysutils/apcupsd/patches/patch-ae
index 0249bb795b5..1fff35506f7 100644
--- a/sysutils/apcupsd/patches/patch-ae
+++ b/sysutils/apcupsd/patches/patch-ae
@@ -1,73 +1,61 @@
-$NetBSD: patch-ae,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+$NetBSD: patch-ae,v 1.2 2000/08/05 07:31:19 jlam Exp $
---- apcserial.c.orig Wed Apr 7 18:06:41 1999
-+++ apcserial.c Fri Jan 7 18:54:39 2000
-@@ -59,7 +59,9 @@
+--- configure.in.orig Thu Jul 29 03:46:32 1999
++++ configure.in Sat Aug 5 02:52:40 2000
+@@ -17,23 +17,28 @@
+ dnl Check for local host architecture.
+ dnl
+ AC_CANONICAL_HOST dnl Check for host type.
+-dnl
++
++
++AC_PROG_CC dnl Determine a C compiler to use.
++AC_LANG_C
++
++dnl Try to get a POSIX.1 environment
++AC_AIX
++AC_MINIX
++AC_ISC_POSIX
++
+ dnl
+ dnl Check for programs.
+ dnl
+-AC_PROG_CC dnl Determine a C compiler to use.
+ AC_PROG_CPP dnl Determine a C pre-processor to use.
+ AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
+ AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
+ AC_PROG_INSTALL dnl Determine a BSD install program.
- #include <stdio.h>
- #include <unistd.h>
-+#ifndef __NetBSD__
- #include <getopt.h>
-+#endif /* __NetBSD__ */
- #include <stdlib.h>
- #include <stdarg.h>
- #include <fcntl.h>
-@@ -135,10 +137,10 @@
- newtio.c_oflag = 0; /* Raw output */
- newtio.c_lflag = 0; /* No local echo */
+ dnl Now check for programs
+-AC_PATH_PROGS(SHUTDOWN, shutdown shutdown.bsd,
+- [echo 'ERROR: shutdown program not found !'])
+-AC_PATH_PROGS(RANLIB, ranlib true,
+- [echo 'ERROR: ranlib program not found !'])
+-AC_PATH_PROGS(WALL, wall,
+- [echo 'ERROR: wall program not found !'])
++AC_PATH_PROGS(SHUTDOWN, shutdown shutdown.bsd, shutdown, $PATH:/sbin:/usr/sbin)
++AC_PATH_PROGS(RANLIB, ranlib, true)
++AC_PATH_PROGS(WALL, wall, cat)
--#ifdef __freebsd__
-+#if defined(__freebsd__) || defined (__NetBSD__)
- newtio.c_ispeed = DEFAULT_SPEED; /* Set input speed */
- newtio.c_ospeed = DEFAULT_SPEED; /* Set output speed */
--#endif /* __freebsd__ */
-+#endif /* __freebsd__ || __NetBSD__ */
+ dnl Check for libraries.
+ dnl
+@@ -112,6 +117,7 @@
+
+ AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPTLONG),
+ [EXTRASRC="$EXTRASRC \$(srcdir)/lib/getopt.c \$(srcdir)/lib/getopt1.c"
++ CPPFLAGS="-Ilib"
+ EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
- /* w.p. This makes a non.blocking read() with 5 sec. timeout */
- newtio.c_cc[VMIN] = 0;
-@@ -195,7 +197,6 @@
- {
- char response[32]; /* w.p. */
- char a;
-- FILE *pwdf;
- int errflag = 0;
- response[0] = '\0';
-
-@@ -230,19 +231,6 @@
- }
- }
- }
-- if ((((pwdf = fopen(PWRFAIL, "r" )) == NULL) &&
-- (ups->mode.type != BK)) ||
-- (((pwdf = fopen(PWRFAIL, "r" )) == NULL) &&
-- (ups->LineUp != 0) && (ups->mode.type == BK))) {
-- fprintf(stderr,
-- "%s: Attempting to kill the power!\n" \
-- "%s: Nice TRY but not TODAY!\n" \
-- "%s: Shutdown not called first.\n" \
-- "%s: Bug found by Tom Kunicki\n",
-- ups->argvalue, ups->argvalue,
-- ups->argvalue, ups->argvalue);
-- terminate(0);
-- } else {
- errflag=0; /* w.p. */
- if ((ups->class.type == SHAREMASTER) ||
- (ups->class.type == SHARENETMASTER)) {
-@@ -259,7 +247,6 @@
- ups->argvalue);
- sleep(15);
- }
-- fclose(pwdf);
-
- fprintf(stderr,
- "%s: Attempting to kill the power!\n",
-@@ -407,9 +394,7 @@
- }
- }
- /* w.p. */
-- sleep(10);
- terminate(0);
-- }
- } else {
- if (ups->mode.type <= SHAREBASIC) {
- switch(ups->cable.type) {
+ dnl
+@@ -172,11 +178,6 @@
+ AC_SYS_LONG_FILE_NAMES dnl Check for long file names.
+ AC_SYS_RESTARTABLE_SYSCALLS dnl Check interrupted syscalls will restart.
+ dnl
+-dnl
+-dnl UNIX variants
+-AC_AIX dnl Check for aix.
+-AC_ISC_POSIX dnl Check for isc.
+-AC_MINIX dnl Check for minix.
+ dnl
+ dnl
+ dnl Check for enable particular features.
diff --git a/sysutils/apcupsd/patches/patch-af b/sysutils/apcupsd/patches/patch-af
index 3705c241ef3..63717d62743 100644
--- a/sysutils/apcupsd/patches/patch-af
+++ b/sysutils/apcupsd/patches/patch-af
@@ -1,28 +1,54 @@
-$NetBSD: patch-af,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
+$NetBSD: patch-af,v 1.2 2000/08/05 07:31:19 jlam Exp $
---- apcupsd.c.orig Wed Apr 7 18:06:41 1999
-+++ apcupsd.c Fri Jan 7 18:55:53 2000
-@@ -100,7 +100,9 @@
-
- #include <stdio.h>
- #include <unistd.h>
-+#ifndef __NetBSD__
- #include <getopt.h>
-+#endif /* __NetBSD__ */
- #include <stdlib.h>
- #include <stdarg.h>
- #include <fcntl.h>
-@@ -290,13 +292,6 @@
- * it should close them.
- *********************************************************************/
- void terminate (int sig) {
-- /*
-- * XXX - Is someone able to explain me why here we find a sleep for 10
-- * seconds ?
-- *
-- * -RF
-- */
-- sleep(10);
- #ifdef NEW_THREADS
- restore_signals();
- #endif /* NEW_THREADS */
+--- Makefile.in.orig Thu Jul 29 03:46:32 1999
++++ Makefile.in Sat Aug 5 02:59:43 2000
+@@ -13,7 +13,7 @@
+
+ # Ultrix 2.2 make doesn't expand the value of VPATH.
+ srcdir = @srcdir@
+-libdir = @libdir@/apcupsd
++#libdir = @libdir@/apcupsd
+ VPATH = @srcdir@
+
+ CC = @CC@
+@@ -67,6 +67,8 @@
+
+ # Program to install `make'.
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
++# Program to install scripts
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ # Program to install the man page.
+ INSTALL_DATA = @INSTALL_DATA@
+ # Generic install program.
+@@ -134,11 +136,10 @@
+ dummy:
+
+ .c.o:
+- $(CC) $(defines) -c $(CPFLAGS) -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/lib @INTLINCLUDE@ $(CEFLAGS) $(CFLAGS) $<
++ $(CC) $(defines) -c $(CPFLAGS) -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/lib @INTLINCLUDE@ $(CEFLAGS) $(CFLAGS) -o $@ $<
+
+ # For some losing Unix makes.
+ SHELL = /bin/sh
+-MAKE = make
+
+ tagsrcs = $(srcs)
+ TAGS: $(tagsrcs)
+@@ -159,15 +160,15 @@
+
+ install-apcupsd:
+ @echo "Creating installation directories..."
+- $(SHELL) ${srcdir}/mkinstalldirs $(sbindir) $(mandir) $(libdir)
++ $(SHELL) ${srcdir}/mkinstalldirs $(sbindir) $(mandir)
+ @echo "Installing apcupsd binary..."
+ $(INSTALL_PROGRAM) ./apcupsd $(sbindir)/apcupsd
+ @echo "Installing apcaccess binary..."
+ $(INSTALL_PROGRAM) ./apcaccess $(sbindir)/apcaccess
+ @echo "Installing powersc script..."
+- $(INSTALL_PROGRAM) installs/powersc $(sbindir)/powersc
++ $(INSTALL_SCRIPT) installs/powersc $(sbindir)/powersc
+ @echo "Installing manual page..."
+- $(INSTALL_DATA) $(srcdir)/doc/apcupsd.man $(mandir)/apcupsd.$(manext)
++ $(INSTALL_DATA) $(srcdir)/doc/apcupsd.$(manext) $(mandir)/apcupsd.$(manext)
+ @echo "Installing language catalogs..."
+ @POMAKE@ install
+
diff --git a/sysutils/apcupsd/patches/patch-ag b/sysutils/apcupsd/patches/patch-ag
index 9f43787d062..864c004db27 100644
--- a/sysutils/apcupsd/patches/patch-ag
+++ b/sysutils/apcupsd/patches/patch-ag
@@ -1,17 +1,63 @@
-$NetBSD: patch-ag,v 1.1.1.1 2000/01/21 19:16:00 bouyer Exp $
+$NetBSD: patch-ag,v 1.2 2000/08/05 07:31:20 jlam Exp $
---- include/apc_defines.h Wed Apr 7 18:06:41 1999
-+++ nclude/apc_defines.h Sun Jul 18 19:45:49 1999
-@@ -66,6 +66,12 @@
- #define PWRFAIL "/var/run/powerfail"
- #endif /* __freebsd__ */
+--- apcserial.c.orig Thu Jul 29 04:47:46 1999
++++ apcserial.c Sat Aug 5 02:52:40 2000
+@@ -134,10 +134,10 @@
+ newtio.c_oflag = 0; /* Raw output */
+ newtio.c_lflag = 0; /* No local echo */
-+#ifdef __NetBSD__
-+#define APCCONF "/etc/apcupsd.conf"
-+#define UPS_STAT "/var/log/apcupsd.status"
-+#define PWRFAIL "/var/run/powerfail"
-+#endif /* __NetBSD__ */
-+
- #ifndef APCCONF
- #define APCCONF "/etc/apcupsd.conf"
- #endif
+-#ifdef __freebsd__
++#if defined(__freebsd__) || defined (__NetBSD__)
+ newtio.c_ispeed = DEFAULT_SPEED; /* Set input speed */
+ newtio.c_ospeed = DEFAULT_SPEED; /* Set output speed */
+-#endif /* __freebsd__ */
++#endif /* __freebsd__ || __NetBSD__ */
+
+ /* w.p. This makes a non.blocking read() with 5 sec. timeout */
+ newtio.c_cc[VMIN] = 0;
+@@ -206,7 +206,6 @@
+ {
+ char response[32]; /* w.p. */
+ char a;
+- FILE *pwdf;
+ int errflag = 0;
+ response[0] = '\0';
+
+@@ -242,19 +241,6 @@
+ }
+ }
+ }
+- if ((((pwdf = fopen(PWRFAIL, "r" )) == NULL) &&
+- (ups->mode.type != BK)) ||
+- (((pwdf = fopen(PWRFAIL, "r" )) == NULL) &&
+- (ups->LineUp != 0) && (ups->mode.type == BK))) {
+- fprintf(stderr,
+- "%s: Attempting to kill the power!\n" \
+- "%s: Nice TRY but not TODAY!\n" \
+- "%s: Shutdown not called first.\n" \
+- "%s: Bug found by Tom Kunicki\n",
+- ups->argvalue, ups->argvalue,
+- ups->argvalue, ups->argvalue);
+- terminate(0);
+- } else {
+ errflag=0; /* w.p. */
+ if ((ups->class.type == SHAREMASTER) ||
+ (ups->class.type == SHARENETMASTER)) {
+@@ -271,7 +257,6 @@
+ ups->argvalue);
+ sleep(15);
+ }
+- fclose(pwdf);
+
+ fprintf(stderr,
+ "%s: Attempting to kill the power!\n",
+@@ -420,9 +405,7 @@
+ }
+ }
+ /* w.p. */
+- sleep(10);
+ terminate(0);
+- }
+ } else {
+ if (ups->mode.type <= SHAREBASIC) {
+ switch(ups->cable.type) {
diff --git a/sysutils/apcupsd/patches/patch-ah b/sysutils/apcupsd/patches/patch-ah
index 3bedac48936..f1f4de16366 100644
--- a/sysutils/apcupsd/patches/patch-ah
+++ b/sysutils/apcupsd/patches/patch-ah
@@ -1,75 +1,18 @@
-$NetBSD: patch-ah,v 1.1.1.1 2000/01/21 19:16:00 bouyer Exp $
+$NetBSD: patch-ah,v 1.2 2000/08/05 07:31:20 jlam Exp $
---- docs/apcupsd.man8.orig Wed Apr 7 18:06:41 1999
-+++ docs/apcupsd.man8 Tue Jul 20 19:27:28 1999
-@@ -8,13 +8,13 @@
- .SH NAME
- apcupsd \- daemon for Most APCC's UPS support under Linux and UNIX
- .SH SYNOPSIS
--.B /sbin/apcupsd
-+.B @@PREFIX@@/sbin/apcupsd
- .br
--.B /sbin/powersc
-+.B @@PREFIX@@/sbin/powersc
- .br
- .B /etc/apcupsd.conf
- .br
--.B /sbin/apcaccess
-+.B @@PREFIX@@/bin/apcaccess
- .SH DESCRIPTION
- .LP
- This daemon can be used for controlling the APC SmartUPS. During a power
-@@ -23,7 +23,7 @@
- about this fact. If power is not restored, a system shutdown will follow
- when the battery is exausted, a timeout (seconds) expires, or runtime
- minutes based on internal values based on power consumption rates. The
--whole shutdown is now made by script calls to the "/sbin/powersc"
-+whole shutdown is now made by script calls to the "@@PREFIX@@/sbin/powersc"
- file called by "apcupsd", so no changes in the inittab are necessary.
- There is now no communication between "apcupsd" and init(1) process.
- .LP
-@@ -46,7 +46,7 @@
- .SH CONFIGURATION
- It is necessary to write configuration info to the file "/etc/apcupsd.conf".
- This file is a plain ASCII file and you can use your favorite editor for
--configuration. For simple configuration, see enclosed sample file.
-+configuration. For simple configuration, see sample file in @@PREFIX@@/etc
- .LP
- Configuration commands in
- .B /etc/apcupsd.conf
-@@ -54,7 +54,7 @@
- .LP
- .B CONTROL
- -- <path|filename>
--.B /sbin/powersc
-+.B @@PREFIX@@/sbin/powersc
- .br
- Name of control script called by "apcupsd".
- .LP
-@@ -123,7 +123,7 @@
- -- <name of serial port>
- .br
- Please specify which device is used for UPS communication.
--The default is /dev/ttyS[0|1|2|3].
-+The default is /dev/tty0[0|1|2|3].
- .LP
- .B LOCKFILE
- -- <path to lockfile>
-@@ -165,7 +165,7 @@
- -- <time in seconds>
- .br
- Please specify time in seconds for "apcupsd" to update the psuedo
--proc fs file "/etc/apcupsd.status". This rate is reset if there is
-+proc fs file "/var/log/apcupsd.status". This rate is reset if there is
- a power state change.
- .LP
- This will be replaced with "apcaccess 'status'" calls. This will prevent
-@@ -478,7 +478,7 @@
- .B /etc/apcupsd.conf
- - configuration file.
- .br
--.B /etc/apcupsd.status
-+.B /var/log/apcupsd.status
- - psuedo procfs-type file.
- .br
- .B /var/log/apcupsd.log
+--- apcupsd.c.orig Thu Jul 29 04:47:46 1999
++++ apcupsd.c Sat Aug 5 02:52:40 2000
+@@ -292,13 +292,6 @@
+ * it should close them.
+ *********************************************************************/
+ void terminate (int sig) {
+- /*
+- * XXX - Is someone able to explain me why here we find a sleep for 10
+- * seconds ?
+- *
+- * -RF
+- */
+- sleep(10);
+ #ifdef NEW_THREADS
+ restore_signals();
+ #endif /* NEW_THREADS */
diff --git a/sysutils/apcupsd/patches/patch-ai b/sysutils/apcupsd/patches/patch-ai
index 30a38aa75c9..3d0412f3bc8 100644
--- a/sysutils/apcupsd/patches/patch-ai
+++ b/sysutils/apcupsd/patches/patch-ai
@@ -1,112 +1,20 @@
-$NetBSD: patch-ai,v 1.1.1.1 2000/01/21 19:16:00 bouyer Exp $
+$NetBSD: patch-ai,v 1.2 2000/08/05 07:31:21 jlam Exp $
---- installs/powersc.orig Tue Jul 20 18:58:51 1999
-+++ installs/powersc Tue Jul 20 19:14:13 1999
-@@ -4,25 +4,9 @@
- POWERPID=/var/run/power.pid
- APCPID=/var/run/apcupsd.pid
+--- apchttp.c.orig Mon Apr 26 14:16:43 1999
++++ apchttp.c Sat Aug 5 02:52:41 2000
+@@ -70,7 +70,6 @@
--if [ -x /sbin/shutdown ]; then
- SHUTDOWN=/sbin/shutdown
--elif [ -x /sbin/shutdown.bsd ]; then
-- SHUTDOWN=/sbin/shutdown.bsd
--else
-- echo Command shutdown or shutdown.bsd not found!
-- exit 1
--fi
+ #include <ctype.h>
+ #include <errno.h>
+-#include <netinet/in.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -80,6 +79,7 @@
+ #include <sys/types.h>
+ #include <time.h>
+ #include <unistd.h>
++#include <netinet/in.h>
--if [ -x /usr/local/sbin/apcupsd ]; then
-- APCUPSD=/usr/local/sbin/apcupsd
--elif [ -x /usr/sbin/apcupsd ]; then
-- APCUPSD=/usr/sbin/apcupsd
--elif [ -x /sbin/apcupsd ]; then
-- APCUPSD=/sbin/apcupsd
--else
-- echo Command apcupsd not found!
-- exit 1
--fi
-+ APCUPSD=@@PREFIX@@/sbin/apcupsd
-
- if test "$(whoami)" != "root"; then
- printf "Sorry, you must be root to run this script." | wall
-@@ -32,42 +16,52 @@
- case "$1" in
- POWEROUT)
- printf "Warning there are Power problems." | wall
-+ /usr/bin/logger -p user.info -t apcupsd \
-+ "Warning there are Power problems."
- ;;
- ONBATTERY)
- printf "Power Failure running on UPS." | wall
-+ /usr/bin/logger -p user.info -t apcupsd \
-+ "Power Failure running on UPS."
- ;;
- FAILING)
- printf "Battery Power Failed, Normal Shutdown.\n" | wall
-+ /usr/bin/logger -p user.emerg -t apcupsd \
-+ "UPS Battery Power Failed, Normal Shutdown."
- ;;
- TIMEOUT)
- printf "Online Battery timeout, Normal Shutdown.\n" | wall
-+ /usr/bin/logger -p user.emerg -t apcupsd \
-+ "UPS Online Battery timeout, Normal Shutdown."
- ;;
- LOADLIMIT)
- printf "Battery Load Limits Reached, Normal Shutdown.\n" | wall
-+ /usr/bin/logger -p user.emerg -t apcupsd \
-+ "UPS Battery Load Limits Reached, Normal Shutdown."
- ;;
- RUNLIMIT)
- printf "Battery RunTime Limits Reached, Normal Shutdown.\n" | wall
-+ /usr/bin/logger -p user.emerg -t apcupsd \
-+ "Battery RunTime Limits Reached, Normal Shutdown."
- ;;
- DOSHUTDOWN)
- printf "Beginning Shutdown Sequence!!!!!" | wall
-- ps x | gawk '{ if (($5 == "init") && ($1 == "1")) print $6 }' \
-- | cut -f2 -d[ | cut -f1 -d] \
-- > /tmp/run.level.power
- if [ -f $POWERPID ]
- then
- exit 0
- else
- echo $$ > $POWERPID
-- $SHUTDOWN -h now
-+ $SHUTDOWN -h now "UPS Powerfail"
- fi
- ;;
- MAINSBACK | WAITASEC)
- printf "Power has returned..." | wall
-+ /usr/bin/logger -p user.info -t apcupsd \
-+ "Power has returned..."
- if [ -f $POWERPID ]; then
- printf "Attempting to cancel shutdown."
- kill $(cat $POWERPID)
- rm -f $POWERPID
-- init $(cat /tmp/run.level.power)
- fi
- ;;
- ANNOYME)
-@@ -75,14 +69,20 @@
- ;;
- EMERGENCY)
- printf "Emergency Shutdown, Possible Battery Failure!!!!" | wall
-- $SHUTDOWN -h now
-+ /usr/bin/logger -p user.emerg -t apcupsd \
-+ "Emergency Shutdown, Possible Battery Failure!!!!"
-+ $SHUTDOWN -h now "Emergency Shutdown"
- ;;
- CHANGEME)
- printf "Emergency, Batteries Have Failed!!!!\nChange Them NOW!!!!" | wall
-+ /usr/bin/logger -p user.emerg -t apcupsd \
-+ "Emergency, Batteries Have Failed!!!! Change Them NOW!!!!"
- ;;
- REMOTE)
- printf "Remote Calls, Normal Shutdown.\nBeginning Shutdown Sequence!!!!!" | wall
-- $SHUTDOWN -h now
-+ /usr/bin/logger -p user.emerg -t apcupsd \
-+ "Remote Calls, Normal Shutdown"
-+ $SHUTDOWN -h now "Remote Calls, Normal Shutdown"
- ;;
- KILL) sleep 1
- $APCUPSD killpower
+ #include <apc_config.h>
+ #include <apc_i18n.h>
diff --git a/sysutils/apcupsd/patches/patch-aj b/sysutils/apcupsd/patches/patch-aj
deleted file mode 100644
index b5fe5ff07fd..00000000000
--- a/sysutils/apcupsd/patches/patch-aj
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-aj,v 1.1.1.1 2000/01/21 19:16:00 bouyer Exp $
-
---- installs/apcupsd.conf.orig Tue Jul 20 19:32:16 1999
-+++ installs/apcupsd.conf Tue Jul 20 19:32:54 1999
-@@ -3,7 +3,7 @@
- # "apcupsd" POSIX config file
- #
- # CONTROL <string>
--CONTROL /sbin/powersc
-+CONTROL @@PREFIX@@/sbin/powersc
- #
- # UPSCABLE [ simple | smart | 940-00(20B,23A,24B,24C,24G,95A,95C) | ether ]
- UPSCABLE 940-0024B
-@@ -22,10 +22,10 @@
- UPSMODE disable
- #
- #DEVICE <string> /dev/<serial port>
--DEVICE /dev/ttyS0
-+DEVICE /dev/tty00
- #
- #LOCKFILE <path to lockfile>
--LOCKFILE /var/lock
-+LOCKFILE /var/run
- #
- #ACCESS <string> [ true | false ] Enable Access Support
- ACCESS true
diff --git a/sysutils/apcupsd/pkg/MESSAGE b/sysutils/apcupsd/pkg/MESSAGE
new file mode 100644
index 00000000000..5f15895a6de
--- /dev/null
+++ b/sysutils/apcupsd/pkg/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2000/08/05 07:31:24 jlam Exp $
+
+NOTE: With most APC cables you must put a "local" flag in /etc/ttys for
+ the port you connect your UPS to, and run "ttyflags -a" to turn it
+ on the first time.
+===========================================================================
diff --git a/sysutils/apcupsd/pkg/PLIST b/sysutils/apcupsd/pkg/PLIST
index 47050158d23..18652e68900 100644
--- a/sysutils/apcupsd/pkg/PLIST
+++ b/sysutils/apcupsd/pkg/PLIST
@@ -1,16 +1,20 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2000/01/21 19:15:59 bouyer Exp $
-
-bin/apcaccess
+@comment $NetBSD: PLIST,v 1.2 2000/08/05 07:31:24 jlam Exp $
+sbin/apcaccess
sbin/apcupsd
sbin/powersc
-etc/apcupsd.conf.sample
+etc/rc.d/apcupsd
man/man8/apcupsd.8
share/doc/apcupsd/README.BackUPS-Pro
+share/doc/apcupsd/README.NEW
share/doc/apcupsd/README.NewerBackUPS-Pro
share/doc/apcupsd/README.Share-UPS
share/doc/apcupsd/README.SmartUPS-VS
share/doc/apcupsd/README.apcaccess
share/doc/apcupsd/README.autoconfig
share/doc/apcupsd/README.cable
+share/doc/apcupsd/README.developers
+share/doc/apcupsd/Statement.APCC
share/doc/apcupsd/minicom.apcupsd
+share/doc/apcupsd/port.gif
+share/examples/apcupsd.conf
@dirrm share/doc/apcupsd