summaryrefslogtreecommitdiff
path: root/sysutils/apcupsd
diff options
context:
space:
mode:
authorbouyer <bouyer>2007-06-15 21:15:38 +0000
committerbouyer <bouyer>2007-06-15 21:15:38 +0000
commitef4be16f70b61896d2bbadc09d9ade4939e0192e (patch)
treee2d9362373039a539199a6813e86677fed5d5a95 /sysutils/apcupsd
parent8f3f67431c19bda274bc27030de986ce773183c5 (diff)
downloadpkgsrc-ef4be16f70b61896d2bbadc09d9ade4939e0192e.tar.gz
Use a more up-to-date config file as example
Add rc.d keywords to the startup script both suggested by Bernd Ernesti.
Diffstat (limited to 'sysutils/apcupsd')
-rw-r--r--sysutils/apcupsd/Makefile15
-rw-r--r--sysutils/apcupsd/PLIST5
-rw-r--r--sysutils/apcupsd/distinfo7
-rw-r--r--sysutils/apcupsd/patches/patch-ab356
-rw-r--r--sysutils/apcupsd/patches/patch-ah14
-rw-r--r--sysutils/apcupsd/patches/patch-ai52
-rw-r--r--sysutils/apcupsd/patches/patch-ak36
7 files changed, 100 insertions, 385 deletions
diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile
index e51b5f9cd84..d685d8d3f36 100644
--- a/sysutils/apcupsd/Makefile
+++ b/sysutils/apcupsd/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.50 2007/06/15 19:05:56 bouyer Exp $
+# $NetBSD: Makefile,v 1.51 2007/06/15 21:15:38 bouyer Exp $
DISTNAME= apcupsd-3.14.1
+PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=apcupsd/}
@@ -55,7 +56,7 @@ CONFIGURE_ENV+= ac_cv_path_MAKE=${MAKE:Q}
EGDIR= ${PREFIX}/share/examples/apcupsd
-CONF_FILES_PERMS+= ${EGDIR}/apcupsd.master.conf ${PKG_SYSCONFDIR}/apcupsd.conf ${ROOT_USER} ${ROOT_GROUP} 644
+CONF_FILES_PERMS+= ${EGDIR}/apcupsd.conf ${PKG_SYSCONFDIR}/apcupsd.conf ${ROOT_USER} ${ROOT_GROUP} 644
CONF_FILES_PERMS+= ${EGDIR}/changeme ${PKG_SYSCONFDIR}/changeme ${ROOT_USER} ${ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/commfailure ${PKG_SYSCONFDIR}/commfailure ${ROOT_USER} ${ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/commok ${PKG_SYSCONFDIR}/commok ${ROOT_USER} ${ROOT_GROUP} 755
@@ -84,12 +85,6 @@ SUBST_MESSAGE.strip= Fixing conflicting STRIP variable name
# XXX we should probably allow the tty to be set in /etc/mk.conf too
#
post-build:
- ${SED} -e 's|@@PREFIX@@|${PREFIX}|' \
- ${WRKSRC}/examples/apcupsd.master.conf > \
- ${WRKDIR}/apcupsd.master.conf
- ${SED} -e 's|@@PREFIX@@|${PREFIX}|' \
- ${WRKSRC}/examples/apcupsd.slave.conf > \
- ${WRKDIR}/apcupsd.slave.conf
.for file in ${MANFILES}
${SED} -e 's|@@PREFIX@@|${PREFIX}|'\
-e 's|@@SYSCONFDIR@@|${PKG_SYSCONFDIR}|' \
@@ -101,9 +96,7 @@ HTMLDOCS= apcupsd.gif bclogo.gif bugs.html bugs.wml index.html index.wml \
publishsite support.html support.wml systems.html systems.wml template.inc
post-install:
- ${INSTALL_DATA} ${WRKDIR}/apcupsd.master.conf \
- ${PREFIX}/share/examples/apcupsd
- ${INSTALL_DATA} ${WRKDIR}/apcupsd.slave.conf \
+ ${INSTALL_DATA} ${WRKSRC}/platforms/etc/apcupsd.conf \
${PREFIX}/share/examples/apcupsd
.for file in ${EGFILES}
${INSTALL_SCRIPT} ${WRKSRC}/platforms/${file} \
diff --git a/sysutils/apcupsd/PLIST b/sysutils/apcupsd/PLIST
index 5f2cb6382ce..39e724ba1e5 100644
--- a/sysutils/apcupsd/PLIST
+++ b/sysutils/apcupsd/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.7 2007/06/15 19:05:56 bouyer Exp $
+@comment $NetBSD: PLIST,v 1.8 2007/06/15 21:15:39 bouyer Exp $
libexec/cgi-bin/upsstats.cgi
libexec/cgi-bin/upsfstats.cgi
libexec/cgi-bin/upsimage.cgi
@@ -27,8 +27,7 @@ share/doc/html/apcupsd/systems.html
share/doc/html/apcupsd/systems.wml
share/doc/html/apcupsd/template.inc
share/examples/apcupsd/apccontrol
-share/examples/apcupsd/apcupsd.master.conf
-share/examples/apcupsd/apcupsd.slave.conf
+share/examples/apcupsd/apcupsd.conf
share/examples/apcupsd/changeme
share/examples/apcupsd/commfailure
share/examples/apcupsd/commok
diff --git a/sysutils/apcupsd/distinfo b/sysutils/apcupsd/distinfo
index c71305e87b3..da1fce52b9c 100644
--- a/sysutils/apcupsd/distinfo
+++ b/sysutils/apcupsd/distinfo
@@ -1,16 +1,17 @@
-$NetBSD: distinfo,v 1.10 2007/06/15 19:05:56 bouyer Exp $
+$NetBSD: distinfo,v 1.11 2007/06/15 21:15:39 bouyer Exp $
SHA1 (apcupsd-3.14.1.tar.gz) = ee2a9ba074b688aba047d571098f44dc591e985c
RMD160 (apcupsd-3.14.1.tar.gz) = f6655123f7daa91966e9a2a4877e90b70babc670
Size (apcupsd-3.14.1.tar.gz) = 4352400 bytes
SHA1 (patch-aa) = 112c8db7a67456821a2e449d6a8ff600a7998dc0
-SHA1 (patch-ab) = b0976e7b98be56ff4e38b615db693729c834811f
+SHA1 (patch-ab) = 3db85accf1b05c8723dd7625278dfac02909dc34
SHA1 (patch-ac) = 98e8853dd030e09d5a487e57a277ff1269baa517
SHA1 (patch-ad) = 48818f95966f5c9f742e333614b0ab5387886e62
SHA1 (patch-ae) = 5e2ded84436b1da8b0eec6577065e0630ce00e78
SHA1 (patch-af) = c4a52226d83ac50adcd9296afd786b42867a7a6d
SHA1 (patch-ag) = 2b77e969d6cbe8ed06797cd753eb443bd6a3881b
+SHA1 (patch-ah) = 738b93b481310aa92ee16d0fbf91b5723b8cabb8
+SHA1 (patch-ai) = be802d4ea438ac991f7e0ebd1c086699aade0b2b
SHA1 (patch-aj) = cce8e25f52cc4eaa38eb31baffceb33fe4a43cee
-SHA1 (patch-ak) = c3069d2b8d9059b383874989cde2edaecd35d49b
SHA1 (patch-al) = a41cb4ee8d896fc633d8869f24e548fda0761340
SHA1 (patch-am) = a2c060519748cf95f0f9aaa284f783f086c1d7d4
diff --git a/sysutils/apcupsd/patches/patch-ab b/sysutils/apcupsd/patches/patch-ab
index 8ca75a7cbea..8e750d6639f 100644
--- a/sysutils/apcupsd/patches/patch-ab
+++ b/sysutils/apcupsd/patches/patch-ab
@@ -1,339 +1,31 @@
-$NetBSD: patch-ab,v 1.5 2007/06/15 19:05:56 bouyer Exp $
+$NetBSD: patch-ab,v 1.6 2007/06/15 21:15:39 bouyer Exp $
---- examples/apcupsd.master.conf.orig 2002-05-28 15:34:19.000000000 +0200
-+++ examples/apcupsd.master.conf 2007-06-15 17:12:48.000000000 +0200
-@@ -1,78 +1,120 @@
- ## apcupsd.conf v1.1 ##
--#
--# for apcupsd release 3.8.0
--#
--# "apcupsd" POSIX config file
--#
--# If you have used a prior version of apcupsd, the CONTROL script file
--# (/sbin/powersc) has now been replaced by /etc/apcupsd/apccontrol.
--# Consequently, the CONTROL configuration statement is obsolete.
--# The following configuration statements have been replaced by scripts
--# called from /etc/apcupsd/apccontrol, and thus are obsolete:
--# BATTCMD, LIMITCMN, LOADCMD, PWRCMD, REBOOTCMD, REMOTECMD, RETCMD,
--# and TIMECMD.
- #
-+# for apcupsd release 3.10.6 (10 October 2003) - freebsd
- #
-+# "apcupsd" POSIX config file
- #
- # ========= General configuration parameters ============
- #
-+# UPSNAME xxx
-+# Use this to give your UPS a name in log files and such. This
-+# is particulary useful if you have multiple UPSes. This does not
-+# set the EEPROM.
-+#UPSNAME
-+#
- # UPSCABLE [ simple | smart |
--# 940-00(20B,23A,24B,24C,24G,95A,95B,95C) |
-+# 940-00(20B,20C,23A,24B,24C,24G,95A,95B,95C) |
- # 940-15(24C) |
--# ether ]
-+# ether, usb ]
- # defines the type of cable that you have.
- UPSCABLE smart
- #
-+# Old types, still valid, are mapped to the new generic drives
-+# automatically
- # UPSTYPE [ backups | sharebasic | netups |
- # backupspro | smartvsups |
- # newbackupspro | backupspropnp |
- # smartups | matrixups | sharesmart ]
-+#
-+# *** NEW TYPES FOR GENERIC DRIVERS ***
-+# UPSTYPE [ dumb | apcsmart | net | usb | snmp | test]
- # defines the type of UPS you have.
- UPSTYPE smartups
- #
- #
- #DEVICE <string> /dev/<serial port>
--# name of your serial port
--DEVICE /dev/ttyS0
-+# name of your UPS device
-+#
-+# Here a table of the possible devices related with the UPS drivers.
-+#
-+# NOTE!!! for USB devices, please use a form indicated below
-+# including the [0-15] as written!
-+#
-+# Driver Device Description
-+# dumb /dev/tty** Serial character device
-+# apcsmart /dev/tty** Serial character device
-+# usb /dev/usb/hid/hiddev[0-15] If you follow our naming scheme
-+# usb /dev/usb/hiddev[0-15] On some systems
-+# net hostname:port Network link to a master apcupsd
-+# through NIS
-+# snmp hostname:port:vendor:community
-+# SNMP Network link to an SNMP-enabled
-+# UPS device. Vendor is the MIB used by
-+# the UPS device: can be "APC" or "RFC"
-+# where APC is the powernet MIB and RFC
-+# is the IETF's rfc1628 UPS-MIB.
-+# Port is usually 161.
-+DEVICE /dev/tty01
- #
- #LOCKFILE <path to lockfile>
- # path for serial port lock file
--LOCKFILE /var/lock
-+LOCKFILE /var/spool/lock
- #
- #
- #
- # ======== configuration parameters used during power failures ==========
- #
--# BATTERYLEVEL <percent of battery charge for shutdown> 10
-+# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
-+# the first that occurs will cause the initation of a shutdown.
-+#
-+# If during a power failure, the remaining battery percentage
-+# (as reported by the UPS) is below or equal to BATTERYLEVEL,
-+# apcupsd will initiate a system shutdown.
- BATTERYLEVEL 5
- #
--# MINUTES <time in minutes of remaining battery runtime before shutdown> 5
-+#
-+# If during a power failure, the remaining runtime in minutes
-+# (as calculated internally by the UPS) is below or equal to MINUTES,
-+# apcupsd, will initiate a system shutdown.
- MINUTES 3
- #
--# TIMEOUT <time is seconds to run on UPS after a power failure>
-+#
-+# If during a power failure, the UPS has run on batteries for TIMEOUT
-+# many seconds or longer, apcupsd will initiate a system shutdown.
-+# A value of 0 disables this timer.
-+#
- # Note, if you have a Smart UPS, you will most likely want to disable
- # this timer by setting it to zero. That way, you UPS will continue
--# on batteries until either the % charge remaing drops below BATTERYLEVEL,
--# or the remaining battery runtime drops below MINUTES. Of course,
-+# on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
-+# or the remaining battery runtime drops to or below MINUTES. Of course,
- # if you are testing, setting this to 60 causes a quick system shutdown
--# if you pull the power plug.
-+# if you pull the power plug.
- # If you have an older dumb UPS, you will want to set this to less than
- # the time you know you can run on batteries.
- TIMEOUT 0
--
- #
--# ANNOY <int> <30> <0> disables
-+#
- # Time in seconds between annoying users to signoff prior to
--# system shutdown.
-+# system shutdown. 0 disables.
- ANNOY 300
- #
--# ANNOYDELAY <int> <60> <0> disables delay before annoying user
-+# Initial delay after power failure before warning users to get
-+# off the system.
- ANNOYDELAY 60
- #
-+# The condition which determines when users are prevented from
-+# logging in during a power failure.
- # NOLOGON <string> [ disable | timeout | percent | minutes | always ]
- NOLOGON disable
- #
- #
-+# If killdelay is set, apcupsd will continue running after a
-+# shutdown has been requested, and after the specified time in
-+# seconds attempt to kill the power. This is for use on systems
-+# where apcupsd cannot regain control after a shutdown.
-+# KILLDELAY <seconds> 0 disables
-+KILLDELAY 0
-+#
- #
- # ==== Configuration statements the network information server =========
- #
-@@ -80,83 +122,149 @@
- # information server. If netstatus is on, a network information
- # server process will be started for serving the STATUS and
- # EVENT data over the network (used by CGI programs).
--NETSERVER on
-+NETSERVER off
- #
--# SERVERPORT <port> default is 7000
-+# NISIP <dotted notation ip address>
-+# IP address on which NIS server will listen for incoming connections.
-+# Default value is 0.0.0.0 that means any incoming request will be
-+# serviced but if you want it to listen to a single subnet you can
-+# set it up to that subnet address, for example 192.168.10.0
-+# Additionally you can listen for a single IP like 192.168.10.1
-+NISIP 0.0.0.0
-+#
-+# NISPORT <port> default is 3551 as registered with the IANA
+--- platforms/etc/apcupsd.conf.in.orig 2007-06-15 22:21:18.000000000 +0200
++++ platforms/etc/apcupsd.conf.in 2007-06-15 22:28:16.000000000 +0200
+@@ -180,7 +180,7 @@
+ # NIS will listen for connections only on that interface. Use the
+ # loopback address (127.0.0.1) to accept connections only from the
+ # local machine.
+-NISIP @NISIP@
++NISIP 127.0.0.1
+
+ # NISPORT <port> default is 3551 as registered with the IANA
# port to use for sending STATUS and EVENTS data over the network.
- # It is not used unless NETSERVER is on. If you change this port,
- # you will need to change the corresponding value in the cgi directory
- # and rebuild the cgi programs.
--SERVERPORT 7000
-+NISPORT 3551
- #
+@@ -191,7 +191,7 @@
+
# If you want the last few EVENTS to be available over the network
# by the network information server, you must define an EVENTSFILE.
--EVENTSFILE /etc/apcupsd/apcupsd.events
-+EVENTSFILE /var/log/apcupsd.events
- #
-+# EVENTSFILEMAX <kilobytes>
-+# By default, the size of the EVENTSFILE will be not be allowed to exceed
-+# 10 kilobytes. When the file grows beyond this limit, older EVENTS will
-+# be removed from the beginning of the file (first in first out). The
-+# parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
-+# to zero to allow the EVENTSFILE to grow without limit.
-+EVENTSFILEMAX 10
- #
-+# ========== Configuration statements used if sharing =============
-+# a UPS and controlling it via the network
- #
-+# The configuration statements below are used if you
-+# want to share one UPS to power multiple machines and have them
-+# communicate by the network. Obviously, the master is connected
-+# to the UPS via the serial cable, and it communicates to the
-+# "slaves" via the network -- i.e. the slaves get their info
-+# concerning the UPS via the ethernet.
-+#
-+# UPSCLASS [ standalone | shareslave | sharemaster | netslave | netmaster ]
-+# normally standalone unless you share a UPS with multiple machines.
-+UPSCLASS standalone
-+#
-+# Unless you want to share the UPS (power multiple machines).
-+# this should be disable
-+# UPSMODE [ disable | share | net | sharenet ]
-+UPSMODE disable
- #
- # ===== Configuration statements to control apcupsd system logging ========
- #
--# STATTIME <int> <120> <0> disables <update rate in seconds for status file >
-+# Time interval in seconds between writing the STATUS file; 0 disables
+-EVENTSFILE @LOGDIR@/apcupsd.events
++EVENTSFILE /var/db/apcupsd.events
+
+ # EVENTSFILEMAX <kilobytes>
+ # By default, the size of the EVENTSFILE will be not be allowed to exceed
+@@ -231,7 +231,7 @@
STATTIME 0
- #
--# STATFILE
--STATFILE /etc/apcupsd/apcupsd.status
-+# Location of STATUS file (written to only if STATTIME is non-zero)
+
+ # Location of STATUS file (written to only if STATTIME is non-zero)
+-STATFILE @LOGDIR@/apcupsd.status
+STATFILE /var/run/apcupsd.status
- #
- #
+
# LOGSTATS [ on | off ] on enables, off disables
--# Note! This generates a lot of output, so if
-+# Note! This generates a lot of output, so if
- # you turn this on, be sure that the
- # file defined in syslog.conf for LOG_NOTICE is a named pipe.
-+# You probably do not want this on.
- LOGSTATS off
- #
- #
--# DATATIME <int> <120> <0> disables <update rate in seconds for data logging >
-+# Time interval in seconds between writing the DATA records to
-+# the log file. 0 disables.
- DATATIME 0
- #
--# FACILITY defines the logging facility (class) for logging to syslog.
--# If not specified, it defaults to "daemon". This is useful
-+# FACILITY defines the logging facility (class) for logging to syslog.
-+# If not specified, it defaults to "daemon". This is useful
- # if you want to separate the data logged by apcupsd from other
- # programs.
--#FACILITY local0
-+#FACILITY DAEMON
- #
- #
- #
- #
-+# ========== Configuration statements used in updating the UPS EPROM =========
- #
--# ========== Configuration statements used if sharing =============
--# a UPS and controlling it via the network
-+# UPS name, max 8 characters -- used only during -n or --rename-ups
-+UPSNAME LK-SMART
- #
--# The configuration statements below are used if you
--# want to share one UPS for multiple machines and have them
--# communicate by the network.
-+# Battery date - 8 characters -- used only during -u or --update-battery-date
-+BATTDATE 11/20/01
- #
--# UPSCLASS [ standalone | shareslave | sharemaster | netslave | netmaster ]
--# normally standalone unless you share a UPS with multiple machines.
--UPSCLASS netmaster
-+# The following items are set during -c or --configure
- #
--# Unless you want to share the UPS (power multiple machines).
--# this should be disable
--# UPSMODE [ disable | share | net | sharenet ]
--UPSMODE net
-+# Sensitivity to line voltage quality (H cause faster transfer to batteries)
-+# SENSITIVITY H M L (default = H)
-+#SENSITIVITY H
-+#
-+# UPS delay after power return (seconds)
-+# WAKEUP 000 060 180 300 (default = 0)
-+WAKEUP 60
-+#
-+# UPS Grace period after request to power off (seconds)
-+# SLEEP 020 180 300 600 (default = 20)
-+SLEEP 180
-+#
-+#
-+# Low line voltage causing transfer to batteries
-+# The permitted values depend on your model as defined by last letter
-+# of FIRMWARE or APCMODEL. Some representative values are:
-+# D 106 103 100 097
-+# M 177 172 168 182
-+# A 092 090 088 086
-+# I 208 204 200 196 (default = 0 => not valid)
-+LOTRANSFER 208
-+#
-+# High line voltage causing transfer to batteries
-+# The permitted values depend on your model as defined by last letter
-+# of FIRMWARE or APCMODEL. Some representative values are:
-+# D 127 130 133 136
-+# M 229 234 239 224
-+# A 108 110 112 114
-+# I 253 257 261 265 (default = 0 => not valid)
-+HITRANSFER 253
- #
--#NETACCESS <string> [ true | false ] Enable Network Access Support
--NETACCESS true
-+# Battery change needed to restore power
-+# RETURNCHARGE 00 15 50 90 (default = 15)
-+#RETURNCHARGE 15
- #
--# NETTIME <int>
--NETTIME 10
-+# Alarm delay
-+# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
-+# BEEPSTATE 0 T L N (default = 0)
-+BEEPSTATE 0
- #
--# NETPORT <int>
--NETPORT 6666
-+# Low battery warning delay in minutes
-+# LOWBATT 02 05 07 10 (default = 02)
-+#LOWBATT 2
- #
--# MASTER <string>
--#MASTER
-+# UPS Output voltage when running on batteries
-+# The permitted values depend on your model as defined by last letter
-+# of FIRMWARE or APCMODEL. Some representative values are:
-+# D 115
-+# M 208
-+# A 100
-+# I 230 240 220 225 (default = 0 => not valid)
-+OUTPUTVOLTS 230
- #
--# SLAVE <string>
--SLAVE my.network.slave.com
-+# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
-+# SELFTEST 336 168 ON OFF (default = 336)
-+SELFTEST 168
- #
--# Note, USERMAGIC is only used by a slave, not here
--# USERMAGIC <string>
--#USERMAGIC
- #
+ # Note! This generates a lot of output, so if
diff --git a/sysutils/apcupsd/patches/patch-ah b/sysutils/apcupsd/patches/patch-ah
new file mode 100644
index 00000000000..e505837fce8
--- /dev/null
+++ b/sysutils/apcupsd/patches/patch-ah
@@ -0,0 +1,14 @@
+$NetBSD: patch-ah,v 1.4 2007/06/15 21:15:39 bouyer Exp $
+
+--- platforms/netbsd/apcupsd.in.orig 2002-05-28 15:34:05.000000000 +0200
++++ platforms/netbsd/apcupsd.in 2007-01-05 20:52:42.000000000 +0100
+@@ -6,6 +6,9 @@
+ # chkconfig: 2345 20 99
+ # description: apcupsd monitors power and takes action if necessary
+ #
++# PROVIDE: apcupsd
++# REQUIRE: DAEMON
++#
+ APCPID=@PIDDIR@/apcupsd.pid
+ APCLOCK=@PIDDIR@/apcupsd.lock
+ DISTVER="@DISTVER@"
diff --git a/sysutils/apcupsd/patches/patch-ai b/sysutils/apcupsd/patches/patch-ai
new file mode 100644
index 00000000000..51748f13678
--- /dev/null
+++ b/sysutils/apcupsd/patches/patch-ai
@@ -0,0 +1,52 @@
+$NetBSD: patch-ai,v 1.4 2007/06/15 21:15:39 bouyer Exp $
+
+--- platforms/netbsd/Makefile.in.orig 2007-06-15 22:58:26.000000000 +0200
++++ platforms/netbsd/Makefile.in 2007-06-15 22:59:03.000000000 +0200
+@@ -21,47 +21,6 @@
+ # a previous version already existed.
+ #
+ install:
+- @echo "NetBSD distribution installation"
+- $(INSTALL_PROGRAM) -m 744 apcupsd /etc/rc.apcupsd
+- @-today="`date +%Y%m%d%H%M`"; \
+- grep -q '# TAG_APCUPSD' /etc/rc.shutdown; \
+- if [ $$? -eq 0 ]; then \
+- echo "/etc/rc.shutdown already patched"; \
+- else \
+- echo "patching /etc/rc.shutdown"; \
+- rm -f /etc/rc.shutdown.$$today; \
+- cp -p /etc/rc.shutdown /etc/rc.shutdown.$$today; \
+- ( echo "# Do not remove the 'TAG_APCUPSD' text, below"; \
+- echo "if [ -f @PWRFAILDIR@/powerfail ]; then # TAG_APCUPSD";\
+- echo " powerdown=YES # TAG_APCUPSD"; \
+- echo " echo '' # TAG_APCUPSD"; \
+- echo " echo 'Please ensure that the UPS has powered off before' # TAG_APCUPSD"; \
+- echo " echo 'rebooting. Otherwise, the UPS may cut the power' # TAG_APCUPSD"; \
+- echo " echo 'during the reboot.' # TAG_APCUPSD"; \
+- echo " echo '' # TAG_APCUPSD"; \
+- echo "fi # TAG_APCUPSD"; \
+- ) >> /etc/rc.shutdown; \
+- fi; \
+- grep -q /etc/rc.apcupsd /etc/rc.local; \
+- if [ $$? -eq 0 ]; then \
+- echo "/etc/rc.local already patched"; \
+- else \
+- rm -f /etc/rc.local.$$today; \
+- cp -p /etc/rc.local /etc/rc.local.$$today; \
+- ( echo "# Start the UPS daemon. Do not remove the 'TAG_APCUPSD' text"; \
+- echo "# if [ -x /etc/rc.apcupsd ]; then # TAG_APCUPSD"; \
+- echo "# /etc/rc.apcupsd start # TAG_APCUPSD"; \
+- echo "# fi # TAG_APCUPSD"; \
+- ) >> /etc/rc.local; \
+- echo ""; \
+- ( echo "While /etc/rc.local has been patched to run apcupsd,";\
+- echo "the commands are currently commented out. You should"; \
+- echo "examine the @sysconfdir@/apcupsd.conf file to ensure"; \
+- echo "that it is suitable for your site. Then run"; \
+- echo "/etc/rc.apcupsd manually to ensure sane operation."; \
+- echo "Once you are satisfied, uncomment the appropriate"; \
+- echo "lines in /etc/rc.local" ) | /usr/bin/fmt; \
+- fi
+
+ uninstall:
+ @echo "NetBSD distribution uninstall"
diff --git a/sysutils/apcupsd/patches/patch-ak b/sysutils/apcupsd/patches/patch-ak
deleted file mode 100644
index e23e54f38d9..00000000000
--- a/sysutils/apcupsd/patches/patch-ak
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD: patch-ak,v 1.2 2006/11/15 21:46:25 bouyer Exp $
-
---- examples/apcupsd.slave.conf.orig 2002-05-28 15:34:19.000000000 +0200
-+++ examples/apcupsd.slave.conf 2006-11-15 17:25:58.000000000 +0100
-@@ -33,11 +33,11 @@
- #
- #DEVICE <string> /dev/<serial port>
- # name of your serial port
--DEVICE /dev/ttyS0
-+DEVICE /dev/tty01
- #
- #LOCKFILE <path to lockfile>
- # path for serial port lock file
--LOCKFILE /var/lock
-+LOCKFILE /var/spool/lock
- #
- #
- #
-@@ -91,7 +91,7 @@
- #
- # If you want the last few EVENTS to be available over the network
- # by the network information server, you must define an EVENTSFILE.
--EVENTSFILE /etc/apcupsd/apcupsd.events
-+EVENTSFILE /var/log/apcupsd.events
- #
- #
- #
-@@ -102,7 +102,7 @@
- STATTIME 0
- #
- # STATFILE
--STATFILE /etc/apcupsd/apcupsd.status
-+STATFILE /var/run/apcupsd.status
- #
- #
- # LOGSTATS [ on | off ] on enables, off disables