Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
It allows your computer/server to run during power problems
for a specified length of time or the life of the batteries
in your BackUPS, BackUPS Pro, SmartUPS v/s, or SmartUPS, and
then properly executes a controlled shutdown during an
extended power failure.
+20
View File
@@ -0,0 +1,20 @@
===========================================================================
$NetBSD: MESSAGE,v 1.4 2012/01/22 09:07:50 shattered Exp $
NOTE: You may use the (undocumented) NISIP configuration file option to
determine what interfaces the NIS server will listen on; use
"NISIP 127.0.0.1" for better security.
NOTE: With NetBSD 4.0 and higher, you can leave USB HID devices enabled,
but force a single port to attach ugen instead (for the UPS) with
a kernel configuration line along the lines of:
ugen* at uhub0 port 1 flags 1
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.
For complete documentation, see the HTML docs in
file://${PREFIX}/share/doc/html/apcupsd/index.html
===========================================================================
+119
View File
@@ -0,0 +1,119 @@
# $NetBSD: Makefile,v 1.74 2013/06/04 22:17:03 tron Exp $
DISTNAME= apcupsd-3.14.9
PKGREVISION= 8
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=apcupsd/}
MAINTAINER= bouyer@NetBSD.org
HOMEPAGE= http://www.apcupsd.org/
COMMENT= UPS power management for APCC Products
USE_TOOLS+= gmake msgfmt sh makedepend
USE_LANGUAGES= c c++
GNU_CONFIGURE= yes
PKG_SYSCONFSUBDIR= apcupsd
.include "options.mk"
# Thread support is needed to compile powerflute, which has a curses
# interface (apparently needing ncurses), but pthreads isn't very
# efficient and is less preferred.
#
#.include "../../devel/ncurses/buildlink3.mk"
#CONFIGURE_ARGS+= --enable-threads # compile threading code
#CONFIGURE_ARGS+= --enable-powerflute # compile powerflute program
#CONFIGURE_ARGS+= --with-net-port=${APCUPSD_NET_PORT} # un-registered port is 7000
#CONFIGURE_ARGS+= --with-nis-port=${APCUPSD_NIS_PORT} # registered port is 3551
#CONFIGURE_ARGS+= --with-upscable=${APCUPSD_UPS_CABLE}
#CONFIGURE_ARGS+= --with-upscable=${APCUPSD_UPS_TYPE}
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
# NOTE: You want the /dev/ttyXX for smart cables such as 940-0024C,
# but probably the /dev/dtyXX for a basic smart-custom cable
CONFIGURE_ARGS+= --with-serial-dev=/dev/tty01
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
# configure sets sbindir to '${prefix}/sbin' without expanding $prefix
# this breaks .in files that uses @sbindir@
CONFIGURE_ARGS+= --sbindir=${PREFIX}/sbin
CONFIGURE_ENV+= SCRIPTSHELL=${TOOLS_SH:Q}
CONFIGURE_ENV+= ac_cv_path_MAKE=${MAKE:Q} LD=${CXX}
EGDIR= ${PREFIX}/share/examples/apcupsd
CONF_FILES_PERMS+= ${EGDIR}/apcupsd.conf ${PKG_SYSCONFDIR}/apcupsd.conf ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 644
CONF_FILES_PERMS+= ${EGDIR}/apcupsd.css ${PKG_SYSCONFDIR}/apcupsd.css ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 644
CONF_FILES_PERMS+= ${EGDIR}/changeme ${PKG_SYSCONFDIR}/changeme ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/commfailure ${PKG_SYSCONFDIR}/commfailure ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/commok ${PKG_SYSCONFDIR}/commok ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/multimon.conf ${PKG_SYSCONFDIR}/multimon.conf ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/hosts.conf ${PKG_SYSCONFDIR}/hosts.conf ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/offbattery ${PKG_SYSCONFDIR}/offbattery ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/onbattery ${PKG_SYSCONFDIR}/onbattery ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/apccontrol ${PKG_SYSCONFDIR}/apccontrol ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
RCD_SCRIPTS= apcupsd
PLATFORM_SUBDIR=${OPSYS:tl}
.if ${OPSYS} == "DragonFly"
PLATFORM_SUBDIR=netbsd
.endif
.if ${OPSYS} == "SunOS"
PLATFORM_SUBDIR=sun
.endif
RCD_SCRIPT_SRC.apcupsd= ${WRKSRC}/platforms/${PLATFORM_SUBDIR}/apcupsd
EGFILES= ${PLATFORM_SUBDIR}/apccontrol etc/changeme etc/commfailure etc/commok \
etc/offbattery etc/onbattery etc/multimon.conf etc/hosts.conf
INSTALLATION_DIRS= share/examples/apcupsd share/examples/rc.d \
share/doc/html/apcupsd share/doc/html/apcupsd/manual
SUBST_CLASSES+= strip
SUBST_STAGE.strip= pre-configure
SUBST_FILES.strip= autoconf/install-sh autoconf/targets.mak
SUBST_FILES.strip+= src/gapcmon/Makefile.in src/cgi/Makefile.in
SUBST_FILES.strip+= src/Makefile.in
SUBST_SED.strip= -e "s|STRIP|STRIPFLAG|g"
SUBST_MESSAGE.strip= Fixing conflicting STRIP variable name
# XXX we should probably allow the tty to be set in /etc/mk.conf too
#
HTMLDOCS= apcupsd.gif bclogo.gif bugs.html index.html license.html \
lists.html mail16d.png support.html systems.html
HTMLMANUALS= manual.html apcupsd.png charging.png commlost.png \
main_configs.png multimon.png onbatt.png online.png status.png \
thanks.png wininstall6.png
post-install:
${INSTALL_DATA} ${WRKSRC}/platforms/etc/apcupsd.conf \
${DESTDIR}${PREFIX}/share/examples/apcupsd
${INSTALL_DATA} ${WRKSRC}/src/cgi/apcupsd.css \
${DESTDIR}${PREFIX}/share/examples/apcupsd
.for file in ${EGFILES}
${INSTALL_SCRIPT} ${WRKSRC}/platforms/${file} \
${DESTDIR}${PREFIX}/share/examples/apcupsd
.endfor
.for file in ${HTMLDOCS}
${INSTALL_DATA} ${WRKSRC}/doc/home-page/${file} \
${DESTDIR}${PREFIX}/share/doc/html/apcupsd
.endfor
.for file in ${HTMLMANUALS}
${INSTALL_DATA} ${WRKSRC}/doc/manual/${file} \
${DESTDIR}${PREFIX}/share/doc/html/apcupsd/manual
.endfor
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
+44
View File
@@ -0,0 +1,44 @@
@comment $NetBSD: PLIST,v 1.15 2012/01/22 09:07:50 shattered Exp $
${PLIST.cgi}libexec/cgi-bin/upsstats.cgi
${PLIST.cgi}libexec/cgi-bin/upsfstats.cgi
${PLIST.cgi}libexec/cgi-bin/apcupsimage.cgi
${PLIST.cgi}libexec/cgi-bin/multimon.cgi
man/man5/apcupsd.conf.5
man/man8/apcaccess.8
man/man8/apccontrol.8
man/man8/apctest.8
man/man8/apcupsd.8
sbin/apcaccess
sbin/apctest
sbin/apcupsd
share/doc/html/apcupsd/apcupsd.gif
share/doc/html/apcupsd/bclogo.gif
share/doc/html/apcupsd/bugs.html
share/doc/html/apcupsd/index.html
share/doc/html/apcupsd/license.html
share/doc/html/apcupsd/lists.html
share/doc/html/apcupsd/mail16d.png
share/doc/html/apcupsd/manual/apcupsd.png
share/doc/html/apcupsd/manual/charging.png
share/doc/html/apcupsd/manual/commlost.png
share/doc/html/apcupsd/manual/main_configs.png
share/doc/html/apcupsd/manual/manual.html
share/doc/html/apcupsd/manual/multimon.png
share/doc/html/apcupsd/manual/onbatt.png
share/doc/html/apcupsd/manual/online.png
share/doc/html/apcupsd/manual/status.png
share/doc/html/apcupsd/manual/thanks.png
share/doc/html/apcupsd/manual/wininstall6.png
share/doc/html/apcupsd/support.html
share/doc/html/apcupsd/systems.html
share/examples/apcupsd/apccontrol
share/examples/apcupsd/apcupsd.conf
share/examples/apcupsd/apcupsd.css
share/examples/apcupsd/changeme
share/examples/apcupsd/commfailure
share/examples/apcupsd/commok
share/examples/apcupsd/hosts.conf
share/examples/apcupsd/multimon.conf
share/examples/apcupsd/offbattery
share/examples/apcupsd/onbattery
share/examples/rc.d/apcupsd
+19
View File
@@ -0,0 +1,19 @@
$NetBSD: distinfo,v 1.19 2012/05/07 12:55:23 shattered Exp $
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) = 2877fd13513c96f4489953b539012b03c16b0223
SHA1 (patch-ae) = 9deb5f88617ea4fa81308567f4e65851c05e3f86
SHA1 (patch-af) = 0e230b543aa72c6d5799b2223e52f2d932255e4f
SHA1 (patch-ag) = c160cf80182edd0e42323dd24eddff7ae91c0e13
SHA1 (patch-ah) = 738b93b481310aa92ee16d0fbf91b5723b8cabb8
SHA1 (patch-ai) = 0295d1bd90b5bb7890e93ef04f12c76cfdc6c94a
SHA1 (patch-aj) = d6e3b244c184b090e3b3f56ab6780283e85b2593
SHA1 (patch-al) = bf84f2db316e944a7231ff4c75a5c903f61121dc
SHA1 (patch-am) = a2c060519748cf95f0f9aaa284f783f086c1d7d4
SHA1 (patch-an) = 4464effaf8c67e202bb6c71bad1e6c3fb87c5444
SHA1 (patch-ao) = 1f755c11e30759f023c3a1a6f23949300d1ff7f7
SHA1 (patch-ap) = 32cf69dcc70ade970532e4e738fe8927ec1ec304
+15
View File
@@ -0,0 +1,15 @@
# $NetBSD: options.mk,v 1.3 2011/08/01 14:54:51 bouyer Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.apcupsd
PKG_SUPPORTED_OPTIONS= cgi
PKG_SUGGESTED_OPTIONS= cgi
.include "../../mk/bsd.options.mk"
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
.endif
+31
View File
@@ -0,0 +1,31 @@
$NetBSD: patch-ab,v 1.6 2007/06/15 21:15:39 bouyer Exp $
--- 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.
@@ -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 @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
# 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
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-ac,v 1.4 2006/11/15 21:46:25 bouyer Exp $
--- include/defines.h.orig 2006-11-15 17:33:07.000000000 +0100
+++ include/defines.h 2006-11-15 17:33:22.000000000 +0100
@@ -52,7 +52,7 @@
* sure: is better have /blah//LCK.. than /blahLCK..
*/
#define APC_LOCK_PREFIX "/LCK.."
-#define LOCK_DEFAULT "/var/lock"
+#define LOCK_DEFAULT "/var/spool/lock"
/*
* This string should be the first line of the configuration file.
+152
View File
@@ -0,0 +1,152 @@
$NetBSD: patch-ad,v 1.5 2012/05/07 12:55:23 shattered Exp $
--- platforms/netbsd/apccontrol.in.orig 2012-04-21 20:53:17.000000000 +0000
+++ platforms/netbsd/apccontrol.in
@@ -0,0 +1,147 @@
+#!@SCRIPTSHELL@
+#
+# Copyright (C) 1999-2002 Riccardo Facchetti <riccardo@master.oasi.gpa.it>
+#
+# for apcupsd release @VERSION@ (@DATE@) - @DISTNAME@
+#
+# @configure_input@
+#
+
+#
+# These variables are needed for set up the autoconf other variables.
+#
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+
+APCPID=@PIDDIR@/apcupsd.pid
+APCUPSD=@sbindir@/apcupsd
+SHUTDOWN=@SHUTDOWN@
+SCRIPTSHELL=@SCRIPTSHELL@
+SCRIPTDIR=@sysconfdir@
+
+#
+# This piece is to substitute the default behaviour with your own script,
+# perl, or C program.
+# You can customize every single command creating an executable file (may be a
+# script or a compiled program) and calling it the same as the $1 parameter
+# passed by apcupsd to this script.
+#
+# After executing your script, apccontrol continues with the default action.
+# If you do not want apccontrol to continue, exit your script with exit
+# code 99. E.g. "exit 99".
+#
+# WARNING: the apccontrol file will be overwritten every time you update your
+# apcupsd, doing `make install'. Your own customized scripts will _not_ be
+# overwritten. If you wish to make changes to this file (discouraged), you
+# should change apccontrol.sh.in and then rerun the configure process.
+#
+if [ -f ${SCRIPTDIR}/${1} -a -x ${SCRIPTDIR}/${1} ]
+then
+ ${SCRIPTDIR}/${1} ${2} ${3} ${4}
+ # exit code 99 means he does not want us to do default action
+ if [ $? = 99 ] ; then
+ exit 0
+ fi
+fi
+
+case "$1" in
+ killpower)
+ printf "UPS now committed to shut down" | wall
+# echo "Apccontrol doing: ${APCUPSD} --killpower"
+# sleep 10
+# ${APCUPSD} --killpower
+ ;;
+ commfailure)
+ printf "Communications with UPS lost." | wall
+ /usr/bin/logger -p user.info -t apccontrol "Warning, serial port communications with UPS lost."
+ ;;
+ commok)
+ printf "Communications with UPS restored." | wall
+ /usr/bin/logger -p user.info -t apccontrol "Communications with UPS restored."
+ ;;
+ powerout)
+ printf "Warning power loss detected." | wall
+ /usr/bin/logger -p user.info -t apccontrol "Warning, power loss detected."
+ ;;
+ onbattery)
+ printf "Power failure. Running on UPS batteries." | wall
+ /usr/bin/logger -p user.info -t apccontrol "Power failure. Running on UPS batteries."
+ ;;
+ offbattery)
+ ;;
+ mainsback)
+ printf "Power has returned..." | wall
+ /usr/bin/logger -p user.info -t apccontrol "Power has returned..."
+ if [ -f @PWRFAILDIR@/powerfail ] ; then
+ printf "Continuing with shutdown." | wall
+ /usr/bin/logger -p user.info -t apccontrol "Continuing with shutdown."
+ fi
+ ;;
+ failing)
+ printf "UPS battery power exhaused. Doing shutdown.\n" | wall
+ /usr/bin/logger -p user.info -t apccontrol "UPS battery power exhaused. Doing shutdown."
+ ;;
+ timeout)
+ printf "UPS battery runtime limit exceeded. Doing shutdown.\n" | wall
+ /usr/bin/logger -p user.info -t apccontrol "UPS battery runtime limit exceeded. Doing shutdown."
+ ;;
+ loadlimit)
+ printf "UPS battery discharge limit reached. Doing shutdown.\n" | wall
+ /usr/bin/logger -p user.info -t apccontrol "UPS battery discharge limit reached. Doing shutdown."
+ ;;
+ runlimit)
+ printf "UPS battery runtime percent reached. Doing shutdown.\n" \
+ | wall
+ /usr/bin/logger -p user.info -t apccontrol "UPS battery runtime percent reached. Doing shutdown."
+ ;;
+ doreboot)
+ printf "Beginning Reboot Sequence" | wall
+ ${SHUTDOWN} -r now "apcupsd initiated reboot"
+ ;;
+ doshutdown)
+ printf "Beginning Shutdown Sequence" | wall
+ ${SHUTDOWN} -h now "apcupsd initiated shutdown"
+ ;;
+ annoyme)
+ printf "Power problems, please logoff." | wall
+ ;;
+ emergency)
+ printf "Emergency Shutdown. Possible UPS battery failure." \
+ | wall
+ /usr/bin/logger -p user.crit -t apccontrol "Emergency Shutdown. Possible UPS battery failure."
+ ${SHUTDOWN} -h now "apcupsd emergency shutdown"
+ ;;
+ changeme)
+ printf "Emergency! UPS batteries have failed\nChange them NOW" \
+ | wall
+ /usr/bin/logger -p user.info -t apccontrol "Emergency! UPS batteries have failed. Change them NOW."
+ ;;
+ remotedown)
+ printf "Remote Shutdown.\nBeginning Shutdown Sequence." | wall
+ ${SHUTDOWN} -h now "apcupsd remote shutdown"
+ ;;
+ restartme)
+ echo -n "Restarting APCUPSD Power Management: "
+ THEPID=`cat ${APCPID}`
+ kill ${THEPID}
+ rm -f ${APCPID}
+ rm -f @PWRFAILDIR@/powerfail
+ rm -f @nologdir@/nologin
+ sleep 5
+ `${APCUPSD} --kill-on-powerfail`
+ echo "apcupsd"
+ ;;
+ startselftest)
+ ;;
+ endselftest)
+ ;;
+ battdetach)
+ ;;
+ battattach)
+ ;;
+ *) echo "Usage: ${0##*/} command"
+ echo " warning: this script is intended to be launched by"
+ echo " apcupsd and should never be launched by users."
+ exit 1
+ ;;
+esac
+54
View File
@@ -0,0 +1,54 @@
$NetBSD: patch-ae,v 1.7 2011/08/01 14:54:51 bouyer Exp $
--- 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
-dnl
-dnl If the user has not set -sbindir, we set our default as /sbin
-dnl
- if test x$sbindir = x'${exec_prefix}/sbin' ; then
- sbindir='/sbin'
- fi
fi
dnl
@@ -146,7 +140,7 @@
AC_SUBST(PTHREAD_LFLAGS)
APCACCESS=apcaccess
-SMTP=smtp
+SMTP=
APCTEST=apctest
AC_SUBST(APCACCESS)
AC_SUBST(SMTP)
@@ -989,7 +983,7 @@
elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
then
DISTNAME=freebsd
-elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
+elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD || test $HAVE_UNAME=yes -a x`uname -s` = xDragonFly
then
DISTNAME=netbsd
elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
@@ -1130,7 +1124,7 @@
platforms/debian/apcupsd \
platforms/debian/ups-monitor"
;;
-freebsd)
+freebsd|dragonfly)
DISTVER=`uname -a |awk '{print $3}'`
SERIALDEV=/dev/cuaa0
nologdir=/var/run
@@ -1164,7 +1158,8 @@
PTHREAD_LFLAGS=""
LDFLAGS="$LDFLAGS -pthread"
DFILES="\
- platforms/netbsd/apcupsd"
+ platforms/netbsd/apcupsd \
+ platforms/netbsd/apccontrol"
;;
openbsd)
DISTVER=`uname -a |awk '{print $3}'`
+21
View File
@@ -0,0 +1,21 @@
$NetBSD: patch-af,v 1.7 2011/08/01 14:54:51 bouyer Exp $
--- 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)
+18
View File
@@ -0,0 +1,18 @@
$NetBSD: patch-ag,v 1.5 2011/08/01 14:54:51 bouyer Exp $
--- 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:
+14
View File
@@ -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@"
+63
View File
@@ -0,0 +1,63 @@
$NetBSD: patch-ai,v 1.5 2011/08/01 14:54:51 bouyer Exp $
--- 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 [ $$? -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 " 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"; \
- ) >> $(DESTDIR)/etc/rc.shutdown; \
- fi; \
- grep -q /etc/rc.apcupsd /etc/rc.local; \
- 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"; \
- ) >> $(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 "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-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
+60
View File
@@ -0,0 +1,60 @@
$NetBSD: patch-aj,v 1.8 2011/08/01 14:54:51 bouyer Exp $
--- 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
- if test x$sbindir = x'${exec_prefix}/sbin' ; then
- sbindir='/sbin'
- fi
fi
# Make sure we can run config.sub.
@@ -3416,7 +3413,7 @@
APCACCESS=apcaccess
-SMTP=smtp
+SMTP=
APCTEST=apctest
@@ -10575,7 +10572,7 @@
echo "$as_me:$LINENO: result: Using Linux USB driver." >&5
echo "${ECHO_T}Using Linux USB driver." >&6
;;
- *-*-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
-elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
+elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD || test $HAVE_UNAME=yes -a x`uname -s` = xDragonFly
then
DISTNAME=netbsd
elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
@@ -12331,7 +12328,7 @@
platforms/debian/apcupsd \
platforms/debian/ups-monitor"
;;
-freebsd)
+freebsd|dragonfly)
DISTVER=`uname -a |awk '{print $3}'`
SERIALDEV=/dev/cuaa0
nologdir=/var/run
@@ -12365,7 +12362,8 @@
PTHREAD_LFLAGS=""
LDFLAGS="$LDFLAGS -pthread"
DFILES="\
- platforms/netbsd/apcupsd"
+ platforms/netbsd/apcupsd \
+ platforms/netbsd/apccontrol"
;;
openbsd)
DISTVER=`uname -a |awk '{print $3}'`
+18
View File
@@ -0,0 +1,18 @@
$NetBSD: patch-al,v 1.5 2011/08/01 14:54:51 bouyer Exp $
--- 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"
#include "../usb_common.h"
+#ifdef __DragonFly__
+#include <bus/usb/usb.h>
+#include <bus/usb/usbhid.h>
+#else
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
+#endif
/* Compatibility cruft for FreeBSD <= 4.7 */
#ifndef USB_MAX_DEVNAMES
+18
View File
@@ -0,0 +1,18 @@
$NetBSD: patch-am,v 1.3 2007/03/07 20:48:04 joerg Exp $
--- src/drivers/usb/bsd/hidutils.c.orig 2007-03-07 19:31:41.000000000 +0000
+++ src/drivers/usb/bsd/hidutils.c
@@ -26,8 +26,13 @@
#include "apc.h"
#include "hidutils.h"
+#ifdef __DragonFly__
+#include <bus/usb/usb.h>
+#include <bus/usb/usbhid.h>
+#else
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
+#endif
#define MAX_SANE_DESCRIPTOR_LEN 4096
+48
View File
@@ -0,0 +1,48 @@
$NetBSD: patch-an,v 1.7 2011/08/14 21:42:14 shattered Exp $
--- src/cgi/Makefile.orig 2009-09-20 19:41:26.000000000 +0000
+++ src/cgi/Makefile
@@ -16,7 +16,7 @@ upsimage_obj := $(call SRC2OBJ,$(upsim
SRCS = $(common_srcs) $(multimon_srcs) $(upsstats_srcs) \
$(upsfstats_srcs) $(upsimage_srcs)
-all-targets: multimon.cgi upsstats.cgi upsfstats.cgi upsimage.cgi
+all-targets: multimon.cgi upsstats.cgi upsfstats.cgi apcupsimage.cgi
multimon.cgi: $(common_obj) $(multimon_obj) $(APCLIBS)
$(LINK)
@@ -27,7 +27,7 @@ upsstats.cgi: $(common_obj) $(upsstats_o
upsfstats.cgi: $(common_obj) $(upsfstats_obj) $(APCLIBS)
$(LINK)
-upsimage.cgi: $(common_obj) $(upsimage_obj) $(APCLIBS)
+apcupsimage.cgi: $(common_obj) $(upsimage_obj) $(APCLIBS)
$(LINK) $(X_LIBS) $(LIBGD)
all-install: install-cgi
@@ -38,23 +38,13 @@ install-cgi:
$(call INSTPROG,755,multimon.cgi,$(cgibin))
$(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))
+ $(call INSTPROG,755,apcupsimage.cgi,$(cgibin))
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)
+ $(call UNINST,$(cgibin)/apcupsimage.cgi)
# Include dependencies
-include $(DEPS)
+19
View File
@@ -0,0 +1,19 @@
$NetBSD: patch-ao,v 1.7 2011/08/01 14:54:51 bouyer Exp $
--- 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-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))
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-ap,v 1.4 2012/02/19 18:21:58 bouyer Exp $
--- platforms/sun/Makefile.orig 2008-06-01 23:57:56.000000000 +0200
+++ platforms/sun/Makefile 2012-02-19 19:20:10.000000000 +0100
@@ -12,7 +12,7 @@
$(call MKDIR,/etc/rc1.d)
$(call MKDIR,/etc/rc2.d)
$(call MKDIR,/etc/init.d)
- $(call INSTPROG,744,apcupsd,/etc/init.d/apcupsd)
+ $(call INSTSCRIPT,744,apcupsd,/etc/init.d/apcupsd)
$(call SYMLINK,../init.d/apcupsd,/etc/rc0.d/K21apcupsd)
$(call SYMLINK,../init.d/apcupsd,/etc/rc1.d/S89apcupsd)
$(call SYMLINK,../init.d/apcupsd,/etc/rc2.d/S89apcupsd)