summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/apcupsd/Makefile14
-rw-r--r--sysutils/apcupsd/PLIST7
-rw-r--r--sysutils/apcupsd/distinfo25
-rw-r--r--sysutils/apcupsd/options.mk12
-rw-r--r--sysutils/apcupsd/patches/patch-aa88
-rw-r--r--sysutils/apcupsd/patches/patch-ae37
-rw-r--r--sysutils/apcupsd/patches/patch-af31
-rw-r--r--sysutils/apcupsd/patches/patch-ag28
-rw-r--r--sysutils/apcupsd/patches/patch-ai65
-rw-r--r--sysutils/apcupsd/patches/patch-aj44
-rw-r--r--sysutils/apcupsd/patches/patch-al26
-rw-r--r--sysutils/apcupsd/patches/patch-an69
-rw-r--r--sysutils/apcupsd/patches/patch-ao38
13 files changed, 169 insertions, 315 deletions
diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile
index 49afbcc243c..4d8a45f2912 100644
--- a/sysutils/apcupsd/Makefile
+++ b/sysutils/apcupsd/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.61 2011/04/22 13:44:39 obache Exp $
+# $NetBSD: Makefile,v 1.62 2011/08/01 14:54:51 bouyer Exp $
-DISTNAME= apcupsd-3.14.3
-PKGREVISION= 3
+DISTNAME= apcupsd-3.14.9
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=apcupsd/}
@@ -11,7 +10,7 @@ COMMENT= UPS power management for APCC Products
PKG_DESTDIR_SUPPORT= user-destdir
-USE_TOOLS+= msgfmt sh makedepend
+USE_TOOLS+= gmake msgfmt sh makedepend
USE_LANGUAGES= c c++
GNU_CONFIGURE= yes
@@ -38,6 +37,7 @@ CONFIGURE_ARGS+= --enable-net # enable NIS network driver
CONFIGURE_ARGS+= --enable-usb # enable USB network driver
CONFIGURE_ARGS+= --with-catgets # use catgets functions
CONFIGURE_ARGS+= --enable-nls # i18n support
+CONFIGURE_ARGS+= --enable-snmp # enable SNMP driver
CONFIGURE_ARGS+= --with-lock-dir=${VARBASE}/spool/lock
# XXX is this supposed to be the full filename?
CONFIGURE_ARGS+= --with-log-dir=${VARBASE}/db/apcupsd.events
@@ -84,12 +84,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:
-.for file in ${MANFILES}
- ${SED} -e 's|@@PREFIX@@|${PREFIX}|'\
- -e 's|@@SYSCONFDIR@@|${PKG_SYSCONFDIR}|' \
- ${WRKSRC}/doc/${file}.man > ${WRKSRC}/doc/${file}.8
-.endfor
HTMLDOCS= apcupsd.gif bclogo.gif bugs.html bugs.wml index.html index.wml \
license.html license.wml lists.html lists.wml mail16d.png menu.inc \
diff --git a/sysutils/apcupsd/PLIST b/sysutils/apcupsd/PLIST
index c7968be3253..8766a31b5c6 100644
--- a/sysutils/apcupsd/PLIST
+++ b/sysutils/apcupsd/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.12 2009/06/14 18:16:00 joerg Exp $
+@comment $NetBSD: PLIST,v 1.13 2011/08/01 14:54:51 bouyer Exp $
${PLIST.cgi}libexec/cgi-bin/upsstats.cgi
${PLIST.cgi}libexec/cgi-bin/upsfstats.cgi
${PLIST.cgi}libexec/cgi-bin/upsimage.cgi
@@ -6,8 +6,11 @@ ${PLIST.cgi}libexec/cgi-bin/multimon.cgi
sbin/apcaccess
sbin/apctest
sbin/apcupsd
-man/man8/apcupsd.8
+man/man5/apcupsd.conf.5
+man/man8/apcaccess.8
+man/man8/apccontrol.8
man/man8/apctest.8
+man/man8/apcupsd.8
share/doc/html/apcupsd/apcupsd.gif
share/doc/html/apcupsd/bclogo.gif
share/doc/html/apcupsd/bugs.html
diff --git a/sysutils/apcupsd/distinfo b/sysutils/apcupsd/distinfo
index 788c5d76c33..64cd3cef3c1 100644
--- a/sysutils/apcupsd/distinfo
+++ b/sysutils/apcupsd/distinfo
@@ -1,19 +1,18 @@
-$NetBSD: distinfo,v 1.14 2008/06/20 01:09:35 joerg Exp $
+$NetBSD: distinfo,v 1.15 2011/08/01 14:54:51 bouyer Exp $
-SHA1 (apcupsd-3.14.3.tar.gz) = b9f75732752cdee9792a5be526656c153c2d1274
-RMD160 (apcupsd-3.14.3.tar.gz) = 092726b2076e56368cdb7e3c790ee8d5e2a7d2f9
-Size (apcupsd-3.14.3.tar.gz) = 4350109 bytes
-SHA1 (patch-aa) = 112c8db7a67456821a2e449d6a8ff600a7998dc0
+SHA1 (apcupsd-3.14.9.tar.gz) = 1e9e8a054f17c554c047ec1d7b363d35553058bc
+RMD160 (apcupsd-3.14.9.tar.gz) = be1a33b85c790fc3bc62bab370a62d014dbf0a57
+Size (apcupsd-3.14.9.tar.gz) = 1334762 bytes
SHA1 (patch-ab) = 3db85accf1b05c8723dd7625278dfac02909dc34
SHA1 (patch-ac) = 98e8853dd030e09d5a487e57a277ff1269baa517
SHA1 (patch-ad) = 48818f95966f5c9f742e333614b0ab5387886e62
-SHA1 (patch-ae) = 5e2ded84436b1da8b0eec6577065e0630ce00e78
-SHA1 (patch-af) = 68e1bdc56a435dbd21551a86848e93491034b4f7
-SHA1 (patch-ag) = 2b77e969d6cbe8ed06797cd753eb443bd6a3881b
+SHA1 (patch-ae) = 9deb5f88617ea4fa81308567f4e65851c05e3f86
+SHA1 (patch-af) = 0e230b543aa72c6d5799b2223e52f2d932255e4f
+SHA1 (patch-ag) = c160cf80182edd0e42323dd24eddff7ae91c0e13
SHA1 (patch-ah) = 738b93b481310aa92ee16d0fbf91b5723b8cabb8
-SHA1 (patch-ai) = be802d4ea438ac991f7e0ebd1c086699aade0b2b
-SHA1 (patch-aj) = cce8e25f52cc4eaa38eb31baffceb33fe4a43cee
-SHA1 (patch-al) = 071f01068f80aa4380446690c791dd0b2cd8b8af
+SHA1 (patch-ai) = 0295d1bd90b5bb7890e93ef04f12c76cfdc6c94a
+SHA1 (patch-aj) = d6e3b244c184b090e3b3f56ab6780283e85b2593
+SHA1 (patch-al) = bf84f2db316e944a7231ff4c75a5c903f61121dc
SHA1 (patch-am) = a2c060519748cf95f0f9aaa284f783f086c1d7d4
-SHA1 (patch-an) = 56afb8709129ec3bb42d4c29fa5a24c9032aa8a3
-SHA1 (patch-ao) = 08594041766d7655e60f7179b086498f27cc4ece
+SHA1 (patch-an) = f9c58bff4cc839f11cd3d200c61e02bbb3d40ec3
+SHA1 (patch-ao) = 1f755c11e30759f023c3a1a6f23949300d1ff7f7
diff --git a/sysutils/apcupsd/options.mk b/sysutils/apcupsd/options.mk
index ddf04b5f197..1e732aa3bdc 100644
--- a/sysutils/apcupsd/options.mk
+++ b/sysutils/apcupsd/options.mk
@@ -1,18 +1,14 @@
-# $NetBSD: options.mk,v 1.2 2008/04/12 22:43:12 jlam Exp $
+# $NetBSD: options.mk,v 1.3 2011/08/01 14:54:51 bouyer Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.apcupsd
-PKG_SUPPORTED_OPTIONS= snmp cgi
-PKG_SUGGESTED_OPTIONS= snmp cgi
+PKG_SUPPORTED_OPTIONS= cgi
+PKG_SUGGESTED_OPTIONS= cgi
.include "../../mk/bsd.options.mk"
-.if !empty(PKG_OPTIONS:Msnmp)
-. include "../../net/net-snmp/buildlink3.mk"
-CONFIGURE_ARGS+= --enable-snmp # enable SNMP driver
-.endif
-
PLIST_VARS+= cgi
.if !empty(PKG_OPTIONS:Mcgi)
+. include "../../graphics/gd/buildlink3.mk"
CONFIGURE_ARGS+= --enable-cgi # include CGI support
CONFIGURE_ARGS+= --with-cgi-bin=${PREFIX}/libexec/cgi-bin
PLIST.cgi= yes
diff --git a/sysutils/apcupsd/patches/patch-aa b/sysutils/apcupsd/patches/patch-aa
deleted file mode 100644
index 8dba1ca2ec2..00000000000
--- a/sysutils/apcupsd/patches/patch-aa
+++ /dev/null
@@ -1,88 +0,0 @@
-$NetBSD: patch-aa,v 1.4 2006/11/15 21:46:25 bouyer Exp $
-
---- doc/apcupsd.man.orig 2005-09-13 14:34:36.000000000 +0200
-+++ doc/apcupsd.man 2006-11-15 17:30:21.000000000 +0100
-@@ -8,15 +8,15 @@
- .SH NAME
- apcupsd \- daemon for most APC's UPS for Linux
- .SH SYNOPSIS
--.B /sbin/apcupsd
-+.B @@PREFIX@@/sbin/apcupsd
- .br
--.B /etc/apcupsd/apccontrol
-+.B @@SYSCONFDIR@@/apcupsd/apccontrol
- .br
--.B /etc/apcupsd/apcupsd.conf
-+.B @@SYSCONFDIR@@/apcupsd/apcupsd.conf
- .br
--.B /sbin/apcaccess
-+.B @@PREFIX@@/sbin/apcaccess
- .br
--.B /sbin/apcnetd
-+.B @@PREFIX@@/sbin/apcnetd
- .br
- .SH DESCRIPTION
- .LP
-@@ -38,7 +38,7 @@
- conditions is met, apcupsd will inform users about this fact.
-
- The shutdown is made by script calls to
--"/etc/apcupsd/apccontrol", which is called by "apcupsd".
-+"@@SYSCONFDIR@@/apcupsd/apccontrol", which is called by "apcupsd".
- Consequently, no changes to /etc/inittab are necessary. There is
- no communication between apcupsd and init(1) process. Apcupsd
- modifies the halt script so that at the end of the shutdown
-@@ -75,7 +75,7 @@
- .TP
- .B \-c --configure
- Attempts to configure the UPS EPROM to the values specified in the
--configuration file "/etc/apcupsd/apcupsd.conf".
-+configuration file "@@SYSCONFDIR@@/apcupsd/apcupsd.conf".
- This option is now deprecated (not supported) and should not
- be used. Instead use the apctest program, which has an interactive
- EEPROM configuration.
-@@ -85,7 +85,7 @@
- .TP
- .B \-f --config-file <file>
- Specifies the location of the configuration file. The default
--is: /etc/apcupsd/apcupsd.conf
-+is: @@SYSCONFDIR@@/apcupsd/apcupsd.conf
- .TP
- .B \-k --killpower
- Attempt to turn the UPS off. This option is normally only
-@@ -100,12 +100,12 @@
-
- .SH CONFIGURATION
- It may be necessary to change the configuration information in the file
--"/etc/apcupsd/apcupsd.conf" to meet your needs and to correspond to your
-+"@@SYSCONFDIR@@/apcupsd.conf" to meet your needs and to correspond to your
- configuration. This file is a plain ASCII file and you can use your
- favorite editor to change it.
- .LP
- Configuration commands in
--.B /etc/apcupsd/apcupsd.conf
-+.B @@SYSCONFDIR@@/apcupsd.conf
- are:
-
- .LP
-@@ -399,7 +399,7 @@
- are disabled or set to default values. Currently, there is not a known
- way for early signals to be sent to BASIC Ports. MINUTES are set to 0.
- .SH FILES
--.B /etc/apcupsd/apcupsd.conf
-+.B @@SYSCONFDIR@@/apcupsd/apcupsd.conf
- - configuration file.
- .br
- .B /var/log/apcupsd.status
-@@ -415,9 +415,9 @@
-
- These events are sent to the system log, optionally sent
- to the temporary events file (/var/log/apcupsd.events),
--and they also generate a call to /etc/apcupsd/apccontrol
-+and they also generate a call to @@SYSCONFDIR@@/apcupsd/apccontrol
- which in turn will call any scripts you have placed in the
--/etc/apcupsd directory.
-+@@SYSCONFDIR@@/apcupsd directory.
-
- .SH DATA format
- If the DATATIME configuration command is set nonzero,
diff --git a/sysutils/apcupsd/patches/patch-ae b/sysutils/apcupsd/patches/patch-ae
index 7a9fadcf3a3..97504daa8dd 100644
--- a/sysutils/apcupsd/patches/patch-ae
+++ b/sysutils/apcupsd/patches/patch-ae
@@ -1,8 +1,8 @@
-$NetBSD: patch-ae,v 1.6 2007/06/15 19:05:56 bouyer Exp $
+$NetBSD: patch-ae,v 1.7 2011/08/01 14:54:51 bouyer Exp $
---- autoconf/configure.in.orig 2007-06-15 13:15:54.000000000 +0200
-+++ autoconf/configure.in 2007-06-15 13:34:19.000000000 +0200
-@@ -80,12 +80,6 @@
+--- autoconf/configure.in.orig 2010-09-02 16:23:39.000000000 +0200
++++ autoconf/configure.in 2011-08-01 15:40:05.000000000 +0200
+@@ -89,12 +89,6 @@
sysconfdir='/etc/apcupsd'
fi
@@ -15,7 +15,7 @@ $NetBSD: patch-ae,v 1.6 2007/06/15 19:05:56 bouyer Exp $
fi
dnl
-@@ -154,7 +148,7 @@
+@@ -146,7 +140,7 @@
AC_SUBST(PTHREAD_LFLAGS)
APCACCESS=apcaccess
@@ -24,26 +24,7 @@ $NetBSD: patch-ae,v 1.6 2007/06/15 19:05:56 bouyer Exp $
APCTEST=apctest
AC_SUBST(APCACCESS)
AC_SUBST(SMTP)
-@@ -439,7 +433,7 @@
- AM_CONDITIONAL(HAVE_LINUX_OS, $FALSEPRG)
- fi
-
--if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
-+if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD || test $HAVE_UNAME=yes -a x`uname -s` = xDragonFly
- then
- AM_CONDITIONAL(HAVE_FREEBSD_OS, $TRUEPRG)
- AC_DEFINE(HAVE_FREEBSD_OS)
-@@ -718,7 +712,8 @@
- AC_MSG_RESULT([Using Linux USB driver.])
- elif test $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD -o \
- $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD -o \
-- $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xNetBSD ; then
-+ $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xNetBSD -o \
-+ $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xDragonFly ; then
- LIBUSBHIDINC="-I\$(topdir)/src/libusbhid"
- LIBUSBHID=libusbhid
- LIBUSBHIDOBJS="\$(topdir)/src/libusbhid/*.o"
-@@ -1169,7 +1164,7 @@
+@@ -989,7 +983,7 @@
elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
then
DISTNAME=freebsd
@@ -52,7 +33,7 @@ $NetBSD: patch-ae,v 1.6 2007/06/15 19:05:56 bouyer Exp $
then
DISTNAME=netbsd
elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
-@@ -1297,7 +1292,7 @@
+@@ -1130,7 +1124,7 @@
platforms/debian/apcupsd \
platforms/debian/ups-monitor"
;;
@@ -61,10 +42,10 @@ $NetBSD: patch-ae,v 1.6 2007/06/15 19:05:56 bouyer Exp $
DISTVER=`uname -a |awk '{print $3}'`
SERIALDEV=/dev/cuaa0
nologdir=/var/run
-@@ -1335,7 +1330,8 @@
+@@ -1164,7 +1158,8 @@
+ PTHREAD_LFLAGS=""
LDFLAGS="$LDFLAGS -pthread"
DFILES="\
- platforms/netbsd/Makefile \
- platforms/netbsd/apcupsd"
+ platforms/netbsd/apcupsd \
+ platforms/netbsd/apccontrol"
diff --git a/sysutils/apcupsd/patches/patch-af b/sysutils/apcupsd/patches/patch-af
index 764ec2f0065..da70e7d4729 100644
--- a/sysutils/apcupsd/patches/patch-af
+++ b/sysutils/apcupsd/patches/patch-af
@@ -1,12 +1,21 @@
-$NetBSD: patch-af,v 1.6 2008/06/20 01:09:35 joerg Exp $
+$NetBSD: patch-af,v 1.7 2011/08/01 14:54:51 bouyer Exp $
---- Makefile.in.orig 2004-02-07 11:04:05.000000000 +0100
-+++ Makefile.in 2006-11-15 17:48:50.000000000 +0100
-@@ -26,6 +26,7 @@
- install-directories: install-dir@CGI@
- $(SHELL) $(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
- $(SHELL) $(MKINSTALLDIRS) $(DESTDIR)$(mandir)
-+ $(SHELL) $(MKINSTALLDIRS) ${DESTDIR}$(prefix)/share/examples/apcupsd
- @if [ ! -d $(DESTDIR)$(sysconfdir) ] ; then \
- $(SHELL) $(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir); \
- chmod 755 $(DESTDIR)$(sysconfdir); \
+--- src/Makefile.orig 2009-09-30 01:20:45.000000000 +0200
++++ src/Makefile 2011-08-01 16:07:24.000000000 +0200
+@@ -23,7 +23,7 @@
+ SRCS = $(common_srcs) $(apcupsd_srcs) $(apcaccess_srcs) \
+ $(apctest_srcs) $(smtp_srcs)
+
+-all-targets: apcupsd apcaccess apctest smtp
++all-targets: apcupsd apcaccess apctest
+
+ apcupsd: $(common_obj) $(apcupsd_obj) $(APCDRVLIBS) $(APCLIBS)
+ $(LINK) $(DRVLIBS)
+@@ -45,7 +45,6 @@
+ $(call INSTPROG,700,apcupsd,$(sbindir)/apcupsd)
+ $(call INSTPROG,700,apctest,$(sbindir)/apctest)
+ $(call INSTPROG,755,apcaccess,$(sbindir)/apcaccess)
+- $(call INSTPROG,755,smtp,$(sbindir)/smtp)
+
+ uninstall-base:
+ $(call UNINST,$(sbindir)/apcupsd)
diff --git a/sysutils/apcupsd/patches/patch-ag b/sysutils/apcupsd/patches/patch-ag
index 1fbf9cdd815..7c2b34c8b5d 100644
--- a/sysutils/apcupsd/patches/patch-ag
+++ b/sysutils/apcupsd/patches/patch-ag
@@ -1,14 +1,18 @@
-$NetBSD: patch-ag,v 1.4 2006/11/15 21:46:25 bouyer Exp $
+$NetBSD: patch-ag,v 1.5 2011/08/01 14:54:51 bouyer Exp $
---- doc/Makefile.in.orig 2006-11-15 20:57:26.000000000 +0100
-+++ doc/Makefile.in 2006-11-15 20:57:52.000000000 +0100
-@@ -21,7 +21,8 @@
- install-man: apcupsd.man
- @$(ECHO) "Installing manual pages..."
- @$(SHELL) $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(manext)
-- @$(INSTALL_DATA) apcupsd.man $(DESTDIR)$(mandir)/man$(manext)/apcupsd.$(manext)
-+ @$(INSTALL_DATA) apcupsd.8 $(DESTDIR)$(mandir)/man$(manext)/apcupsd.$(manext)
-+ @$(INSTALL_DATA) apctest.8 $(DESTDIR)$(mandir)/man$(manext)/apctest.$(manext)
+--- platforms/etc/Makefile.orig 2011-08-01 16:13:04.000000000 +0200
++++ platforms/etc/Makefile 2011-08-01 16:13:13.000000000 +0200
+@@ -7,13 +7,6 @@
+ all-uninstall: uninstall-etc
+
+ install-etc:
+- $(call MKDIR,$(sysconfdir))
+- $(call INSTNEW,644,apcupsd.conf,$(sysconfdir))
+- $(call INSTORIG,744,changeme,$(sysconfdir))
+- $(call INSTORIG,744,commfailure,$(sysconfdir))
+- $(call INSTORIG,744,commok,$(sysconfdir))
+- $(call INSTORIG,744,offbattery,$(sysconfdir))
+- $(call INSTORIG,744,onbattery,$(sysconfdir))
+
+ uninstall-etc:
- uninstall:
- @$(ECHO) "Removing manual page ..."
diff --git a/sysutils/apcupsd/patches/patch-ai b/sysutils/apcupsd/patches/patch-ai
index 51748f13678..eec56af6f8e 100644
--- a/sysutils/apcupsd/patches/patch-ai
+++ b/sysutils/apcupsd/patches/patch-ai
@@ -1,23 +1,22 @@
-$NetBSD: patch-ai,v 1.4 2007/06/15 21:15:39 bouyer Exp $
+$NetBSD: patch-ai,v 1.5 2011/08/01 14:54:51 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`"; \
+--- platforms/netbsd/Makefile.orig 2011-08-01 15:45:29.000000000 +0200
++++ platforms/netbsd/Makefile 2011-08-01 15:45:49.000000000 +0200
+@@ -7,58 +7,5 @@
+ all-uninstall: uninstall-netbsd
+
+ install-netbsd:
+- $(call DISTINST,NetBSD)
+- $(call MKDIR,/etc)
+- $(call INSTPROG,744,apcupsd,/etc/rc.apcupsd)
+- $(VV)-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; \
+- if [ $$? -ne 0 ]; then \
+- echo " PATCH $(DESTDIR)/etc/rc.shutdown"; \
+- rm -f $(DESTDIR)/etc/rc.shutdown.$$today; \
+- cp -p /etc/rc.shutdown $(DESTDIR)/etc/rc.shutdown.$$today; \
- ( echo "# Do not remove the 'TAG_APCUPSD' text, below"; \
-- echo "if [ -f @PWRFAILDIR@/powerfail ]; then # TAG_APCUPSD";\
+- 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"; \
@@ -25,28 +24,40 @@ $NetBSD: patch-ai,v 1.4 2007/06/15 21:15:39 bouyer Exp $
- echo " echo 'during the reboot.' # TAG_APCUPSD"; \
- echo " echo '' # TAG_APCUPSD"; \
- echo "fi # TAG_APCUPSD"; \
-- ) >> /etc/rc.shutdown; \
+- ) >> $(DESTDIR)/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; \
+- if [ $$? -ne 0 ]; then \
+- echo " PATCH $(DESTDIR)/etc/rc.local"; \
+- rm -f $(DESTDIR)/etc/rc.local.$$today; \
+- cp -p /etc/rc.local $(DESTDIR)/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; \
+- ) >> $(DESTDIR)/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 "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"
+ uninstall-netbsd:
+- $(call DISTUNINST,NetBSD)
+- -$(call UNINST,/etc/rc.apcupsd)
+- $(VV)-today="`date +%Y%m%d%H%M`"; \
+- for f in $(DESTDIR)/etc/rc.local $(DESTDIR)/etc/rc.shutdown; do \
+- grep -q '# TAG_APCUPSD' $$f; \
+- if [ $$? -eq 0 ]; then \
+- echo " PATCH $$f"; \
+- rm -f $$f.$$today; \
+- cp -p $$f $$f.$$today; \
+- $(SED) -e '/TAG_APCUPSD/d;' \
+- < $$f.$$today > $$f; \
+- chmod 644 $$f; \
+- fi; \
+- done
diff --git a/sysutils/apcupsd/patches/patch-aj b/sysutils/apcupsd/patches/patch-aj
index 39a2f077217..3d0dae9a02b 100644
--- a/sysutils/apcupsd/patches/patch-aj
+++ b/sysutils/apcupsd/patches/patch-aj
@@ -1,8 +1,8 @@
-$NetBSD: patch-aj,v 1.7 2007/06/15 19:05:57 bouyer Exp $
+$NetBSD: patch-aj,v 1.8 2011/08/01 14:54:51 bouyer Exp $
---- configure.orig 2007-06-15 13:48:18.000000000 +0200
-+++ configure 2007-06-15 13:48:42.000000000 +0200
-@@ -1538,9 +1538,6 @@
+--- configure.orig 2010-09-02 16:23:39.000000000 +0200
++++ configure 2011-08-01 15:50:48.000000000 +0200
+@@ -1542,9 +1542,6 @@
sysconfdir='/etc/apcupsd'
fi
@@ -12,7 +12,7 @@ $NetBSD: patch-aj,v 1.7 2007/06/15 19:05:57 bouyer Exp $
fi
# Make sure we can run config.sub.
-@@ -3578,7 +3575,7 @@
+@@ -3416,7 +3413,7 @@
APCACCESS=apcaccess
@@ -21,26 +21,16 @@ $NetBSD: patch-aj,v 1.7 2007/06/15 19:05:57 bouyer Exp $
APCTEST=apctest
-@@ -10687,7 +10684,7 @@
- fi
- fi
-
--if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
-+if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD || test $HAVE_UNAME=yes -a x`uname -s` = xDragonFly
- then
-
-
-@@ -11751,7 +11748,8 @@
+@@ -10575,7 +10572,7 @@
+ echo "$as_me:$LINENO: result: Using Linux USB driver." >&5
echo "${ECHO_T}Using Linux USB driver." >&6
- elif test $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD -o \
- $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD -o \
-- $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xNetBSD ; then
-+ $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xNetBSD -o \
-+ $GENERICUSB = "no" -a $HAVE_UNAME=yes -a x`uname -s` = xDragonFly ; then
- LIBUSBHIDINC="-I\$(topdir)/src/libusbhid"
- LIBUSBHID=libusbhid
- LIBUSBHIDOBJS="\$(topdir)/src/libusbhid/*.o"
-@@ -16723,7 +16721,7 @@
+ ;;
+- *-*-freebsd* | *-*-openbsd* | *-*-netbsd*)
++ *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-dragonfly*)
+ LIBUSBHIDINC="-I\$(topdir)/src/libusbhid"
+ LIBUSBHID=libusbhid
+ APCDRVLIBS="$APCDRVLIBS \$(topdir)/src/libusbhid/libusbhid.a"
+@@ -12200,7 +12197,7 @@
elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
then
DISTNAME=freebsd
@@ -49,7 +39,7 @@ $NetBSD: patch-aj,v 1.7 2007/06/15 19:05:57 bouyer Exp $
then
DISTNAME=netbsd
elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
-@@ -16842,7 +16840,7 @@
+@@ -12331,7 +12328,7 @@
platforms/debian/apcupsd \
platforms/debian/ups-monitor"
;;
@@ -58,10 +48,10 @@ $NetBSD: patch-aj,v 1.7 2007/06/15 19:05:57 bouyer Exp $
DISTVER=`uname -a |awk '{print $3}'`
SERIALDEV=/dev/cuaa0
nologdir=/var/run
-@@ -16880,7 +16878,8 @@
+@@ -12365,7 +12362,8 @@
+ PTHREAD_LFLAGS=""
LDFLAGS="$LDFLAGS -pthread"
DFILES="\
- platforms/netbsd/Makefile \
- platforms/netbsd/apcupsd"
+ platforms/netbsd/apcupsd \
+ platforms/netbsd/apccontrol"
diff --git a/sysutils/apcupsd/patches/patch-al b/sysutils/apcupsd/patches/patch-al
index cdd4d664343..21f229a2dbe 100644
--- a/sysutils/apcupsd/patches/patch-al
+++ b/sysutils/apcupsd/patches/patch-al
@@ -1,7 +1,7 @@
-$NetBSD: patch-al,v 1.4 2008/04/28 08:28:05 sborrill Exp $
+$NetBSD: patch-al,v 1.5 2011/08/01 14:54:51 bouyer Exp $
---- src/drivers/usb/bsd/bsd-usb.c.orig 2007-03-07 19:31:11.000000000 +0000
-+++ src/drivers/usb/bsd/bsd-usb.c
+--- src/drivers/usb/bsd/bsd-usb.c.orig 2010-09-09 15:12:49.000000000 +0200
++++ src/drivers/usb/bsd/bsd-usb.c 2011-08-01 15:35:27.000000000 +0200
@@ -27,8 +27,13 @@
#include "apc.h"
#include "hidutils.h"
@@ -16,23 +16,3 @@ $NetBSD: patch-al,v 1.4 2008/04/28 08:28:05 sborrill Exp $
/* Compatibility cruft for FreeBSD <= 4.7 */
#ifndef USB_MAX_DEVNAMES
-@@ -357,8 +357,9 @@
- int pusb_ups_get_capabilities(UPSINFO *ups, const struct s_known_info *known_info)
- {
- int i, rc, ci, phys;
-+ int input, feature;
- USB_DATA *my_data = (USB_DATA *)ups->driver_internal_data;
-- hid_item_t item;
-+ hid_item_t item, witem;
- USB_INFO *info;
-
- write_lock(ups);
-@@ -780,7 +781,7 @@
- return true;
- }
-
--int pusb_write_int_to_ups(UPSINFO *ups, int ci, int value, char *name)
-+int pusb_write_int_to_ups(UPSINFO *ups, int ci, int value, const char *name)
- {
- USB_DATA *my_data = (USB_DATA *)ups->driver_internal_data;
- USB_INFO *info;
diff --git a/sysutils/apcupsd/patches/patch-an b/sysutils/apcupsd/patches/patch-an
index b0fac537c39..37efa13dc14 100644
--- a/sysutils/apcupsd/patches/patch-an
+++ b/sysutils/apcupsd/patches/patch-an
@@ -1,46 +1,27 @@
-$NetBSD: patch-an,v 1.5 2007/06/19 22:22:55 bouyer Exp $
+$NetBSD: patch-an,v 1.6 2011/08/01 14:54:51 bouyer Exp $
---- src/cgi/Makefile.in.orig 2006-09-21 02:07:36.000000000 +0200
-+++ src/cgi/Makefile.in 2007-06-19 23:59:26.000000000 +0200
-@@ -57,41 +57,6 @@
- echo $(INSTALL_PROGRAM) $(STRIP) $$p $(DESTDIR)$(cgibin); \
- $(INSTALL_PROGRAM) $(STRIP) $$p $(DESTDIR)$(cgibin); \
- done
-- # don't overwrite any existing config file
-- @if test ! -f $(DESTDIR)$(sysconfdir)/apcupsd.css; then \
-- (echo "Installing apcupsd.css..." && \
-- $(INSTALL_DATA) apcupsd.css \
-- $(DESTDIR)$(sysconfdir)/apcupsd.css); \
-- else \
-- (echo "Installing apcupsd.css as $(DESTDIR)$(sysconfdir)/apcupsd.css.new" && \
-- $(INSTALL_DATA) apcupsd.css \
-- $(DESTDIR)$(sysconfdir)/apcupsd.css.new); \
-- fi
--
-- # don't overwrite any existing config file
-- @if test ! -f $(DESTDIR)$(sysconfdir)/hosts.conf; then \
-- (echo "Installing hosts.conf..." && \
-- $(INSTALL_DATA) \
-- $(topdir)/platforms/etc/hosts.conf \
-- $(DESTDIR)$(sysconfdir)/hosts.conf); \
-- else \
-- (echo "Installing hosts.conf as $(DESTDIR)$(sysconfdir)/hosts.conf.new" && \
-- $(INSTALL_DATA) \
-- $(topdir)/platforms/etc/hosts.conf \
-- $(DESTDIR)$(sysconfdir)/hosts.conf.new); \
-- fi
-- # don't overwrite any existing config file
-- @if test ! -f $(DESTDIR)$(sysconfdir)/multimon.conf; then \
-- (echo "Installing multimon.conf..." && \
-- $(INSTALL_DATA) \
-- $(topdir)/platforms/etc/multimon.conf \
-- $(DESTDIR)$(sysconfdir)/multimon.conf ); \
-- else \
-- (echo "Installing multimon.conf as $(DESTDIR)$(sysconfdir)/multimon.conf.new" && \
-- $(INSTALL_DATA) \
-- $(topdir)/platforms/etc/multimon.conf \
-- $(DESTDIR)$(sysconfdir)/multimon.conf.new); \
-- fi
+--- src/cgi/Makefile.orig 2011-08-01 15:54:51.000000000 +0200
++++ src/cgi/Makefile 2011-08-01 15:55:10.000000000 +0200
+@@ -39,22 +39,12 @@
+ $(call INSTPROG,755,upsstats.cgi,$(cgibin))
+ $(call INSTPROG,755,upsfstats.cgi,$(cgibin))
+ $(call INSTPROG,755,upsimage.cgi,$(cgibin))
+- $(call MKDIR,$(sysconfdir))
+- $(call INSTNEW,644,apcupsd.css,$(sysconfdir))
+- $(call INSTNEW,644,$(topdir)/platforms/etc/hosts.conf,$(sysconfdir))
+- $(call INSTNEW,644,$(topdir)/platforms/etc/multimon.conf,$(sysconfdir))
- uninstall:
- @echo "Uninstalling cgi program support..."
+ uninstall-cgi:
+ $(call UNINST,$(cgibin)/multimon.cgi)
+ $(call UNINST,$(cgibin)/upsstats.cgi)
+ $(call UNINST,$(cgibin)/upsfstats.cgi)
+ $(call UNINST,$(cgibin)/upsimage.cgi)
+- $(call UNINST,$(sysconfdir)/apcupsd.css)
+- $(call UNINST,$(sysconfdir)/apcupsd.css.new)
+- $(call UNINST,$(sysconfdir)/hosts.conf)
+- $(call UNINST,$(sysconfdir)/hosts.conf.new)
+- $(call UNINST,$(sysconfdir)/multimon.conf)
+- $(call UNINST,$(sysconfdir)/multimon.conf.new)
+
+ # Include dependencies
+ -include $(DEPS)
diff --git a/sysutils/apcupsd/patches/patch-ao b/sysutils/apcupsd/patches/patch-ao
index 9aed3ccabde..693feee0cc4 100644
--- a/sysutils/apcupsd/patches/patch-ao
+++ b/sysutils/apcupsd/patches/patch-ao
@@ -1,25 +1,19 @@
-$NetBSD: patch-ao,v 1.6 2008/04/28 08:28:05 sborrill Exp $
+$NetBSD: patch-ao,v 1.7 2011/08/01 14:54:51 bouyer Exp $
---- platforms/Makefile.in.orig 2007-11-17 19:09:23.000000000 +0000
-+++ platforms/Makefile.in 2008-04-26 22:24:19.000000000 +0100
-@@ -26,20 +26,6 @@
- DESTDIR=$(DESTDIR) install);
+--- platforms/Makefile.orig 2011-08-01 15:55:53.000000000 +0200
++++ platforms/Makefile 2011-08-01 15:56:26.000000000 +0200
+@@ -9,14 +9,6 @@
+ all-uninstall: uninstall-platform
- install: @INSTALL_DISTDIR@
-- @echo "Installing apccontrol script..."
-- @if test -f $(DESTDIR)$(sysconfdir)/apccontrol; then \
-- mv -f $(DESTDIR)$(sysconfdir)/apccontrol $(DESTDIR)$(sysconfdir)/apccontrol.orig; \
-- echo " Found old apccontrol moving it to $(DESTDIR)$(sysconfdir)/apccontrol.orig"; \
-- fi
-- @if test -f ./$(DISTNAME)/apccontrol; then \
-- $(INSTALL_SCRIPT) -m 744 ./$(DISTNAME)/apccontrol $(DESTDIR)$(sysconfdir)/apccontrol; \
-- else \
-- $(INSTALL_SCRIPT) -m 744 ./apccontrol $(DESTDIR)$(sysconfdir)/apccontrol; \
-- fi
-- (cd etc/; $(MAKE) DESTDIR=$(DESTDIR) install)
-- @if test "x@HALPOLICYDIR@" != "xno" -a "x@HALPOLICYDIR@" != "x" ; then \
-- $(INSTALL_DATA) -m 644 ./80-apcupsd-ups-policy.fdi $(DESTDIR)@HALPOLICYDIR@ ; \
-- fi
+ install-platform:
+- $(call MKDIR,$(sysconfdir))
+- $(if $(wildcard ./$(DISTNAME)/apccontrol), \
+- $(call INSTORIG,744,$(DISTNAME)/apccontrol,$(sysconfdir)), \
+- $(call INSTORIG,744,apccontrol,$(sysconfdir)))
+- $(if $(HALPOLICYDIR),$(call MKDIR,$(HALPOLICYDIR)))
+- $(if $(HALPOLICYDIR),$(call INSTDATA,644,80-apcupsd-ups-policy.fdi,$(HALPOLICYDIR)))
+
+ uninstall-platform:
+- $(call UNINST,$(sysconfdir)/apccontrol)
+- $(if $(HALPOLICYDIR),$(call UNINST,$(HALPOLICYDIR)/80-apcupsd-ups-policy.fdi))
- #
- # uninstall symlinks before removing the boot script etc etc