More PLIST updates... clean up the Makefile a bit and add an optional

-snmp SUBPACKAGE.

Also, remove myself as MAINTAINER.  Not that I won't continue to support
it, just that my shinny new(?) SNMP card for my UPS makes this port
not one I'll use everyday anymore.

See what happens when people give me free stuff :).
This commit is contained in:
marcm 2004-10-03 03:13:10 +00:00
parent 2b51b4f590
commit 8d07855f62
6 changed files with 54 additions and 63 deletions

View File

@ -1,16 +1,16 @@
# $OpenBSD: Makefile,v 1.13 2004/09/27 03:10:24 marcm Exp $
# $OpenBSD: Makefile,v 1.14 2004/10/03 03:13:10 marcm Exp $
COMMENT= "UPS monitoring program supporting many brands"
COMMENT-cgi= "CGIs for monitoring Nut-based UPSs"
COMMENT-snmp= "driver for monitoring UPSs via SNMP"
VERSION= 2.0.0
DISTNAME= nut-${VERSION}
PKGNAME-cgi= nut-cgi-${VERSION}
PKGNAME-snmp= nut-snmp-${VERSION}
CATEGORIES= sysutils
HOMEPAGE= http://www.networkupstools.org/
MAINTAINER= Marc Matteo <marcm@openbsd.org>
MASTER_SITES= http://random.networkupstools.org/source/2.0/
# GPL
@ -22,40 +22,53 @@ PERMIT_DISTFILES_FTP= Yes
WEB_ROOT= /var/www
NUT_USER= _ups
NUT_ID= 529
NUT_STATEDIR= /var/db/nut
CONFDIR= ${SYSCONFDIR}/nut
SUBST_VARS= WEB_ROOT NUT_USER NUT_ID NUT_STATEDIR CONFDIR
SUBST_VARS= WEB_ROOT NUT_USER NUT_ID
CONFIGURE_STYLE= gnu old
CONFIGURE_ARGS+= --sysconfdir=${CONFDIR}
CONFIGURE_ARGS+= --sysconfdir=${SYSCONFDIR}/nut
CONFIGURE_ARGS+= --datadir=${LOCALBASE}/share/ups
CONFIGURE_ARGS+= --with-statepath=${NUT_STATEDIR}
CONFIGURE_ARGS+= --with-statepath=/var/db/nut
CONFIGURE_ARGS+= --with-user=${NUT_USER}
CONFIGURE_ARGS+= --with-ssl
CONFIGURE_ARGS+= --enable-strip
PSEUDO_FLAVORS= no_cgi
ALL_TARGET= all
INSTALL_TARGET= install
PSEUDO_FLAVORS= no_cgi snmp
FLAVOR?=
MULTI_PACKAGES=
.if !${FLAVOR:L:Mno_cgi}
MULTI_PACKAGES+= -cgi
.endif
.if ${FLAVOR:L:Msnmp}
MULTI_PACKAGES+= -snmp
.endif
SUBPACKAGE?=
.if defined(PACKAGING)
. if ${SUBPACKAGE} == "-cgi"
PREFIX= ${WEB_ROOT}
. elif ${SUBPACKAGE} == "-snmp"
LIB_DEPENDS+= netsnmp::net/net-snmp
. endif
.else
. if ${MULTI_PACKAGES:M-cgi}
BUILD_DEPENDS= :gd->=1.8.3:graphics/gd
BUILD_DEPENDS+= :gd->=1.8.3:graphics/gd
CONFIGURE_ARGS+= --with-cgi
CONFIGURE_ARGS+= --with-cgipath="${WEB_ROOT}/cgi-bin/nut"
CONFIGURE_ARGS+= --with-gd-libs="-L${LOCALBASE}/lib -lgd -lpng -lz -ljpeg -lttf -lm"
CONFIGURE_ARGS+= --with-gd-includes="-I${LOCALBASE}/include"
ALL_TARGET= all cgi
INSTALL_TARGET= install install-cgi
ALL_TARGET+= cgi
INSTALL_TARGET+= install-cgi
. endif
. if ${MULTI_PACKAGES:M-snmp}
LIB_DEPENDS+= netsnmp::net/net-snmp
ALL_TARGET+= snmp
INSTALL_TARGET+= install-snmp
. endif
.endif

View File

@ -0,0 +1,12 @@
Experimental driver for monitoring UPSs via SNMP. Supports a wide
range of devices by loading various MIBS, including:
ietf: UPS that is RFC 1628 (UPS MIB) compliant, ie MGE
UPS SYSTEMS, Liebert, perhaps others (default)
mge: MGE UPS SYSTEMS devices with SNMP cards (ref 66062,
66045, 66074 and 66244)
apcc: APC AP9606 APC Web/SNMP management card, perhaps
others

View File

@ -1,45 +0,0 @@
#!/bin/sh
#
# $OpenBSD: INSTALL,v 1.7 2004/09/27 03:10:24 marcm Exp $
set -e
PREFIX=${PKG_PREFIX:-/usr/local}
PATH=/bin:/usr/bin:/sbin:/usr/sbin
do_create_user() {
if id -u ${NUT_USER} >/dev/null 2>/dev/null
then
echo "===> Using existing account '${NUT_USER}'"
else
echo "===> Creating user '${NUT_USER}'"
useradd -g dialer \
-c "UPS User" \
-d /var/empty \
-s /sbin/nologin \
-u ${NUT_ID} ${NUT_USER}
fi
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
do_create_user
;;
POST-INSTALL)
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0

View File

@ -7,7 +7,7 @@
| # Start Nut
| if [ -x ${PREFIX}/bin/upsdrvctl ]; then
| echo -n ' nut'
| ${PREFIX}/bin/upsdrvctl start > /dev/null
| ${PREFIX}/bin/upsdrvctl start > /dev/null 2>&1
| ${PREFIX}/sbin/upsd > /dev/null 2>&1
| ${PREFIX}/sbin/upsmon > /dev/null 2>&1
| fi

View File

@ -1,5 +1,6 @@
@comment $OpenBSD: PLIST,v 1.7 2004/09/27 03:10:24 marcm Exp $
@comment $OpenBSD: PLIST,v 1.8 2004/10/03 03:13:10 marcm Exp $
@conflict upsd-*
@newuser ${NUT_USER}:${NUT_ID}:::UPS User:/var/empty:/sbin/nologin
bin/apcsmart
bin/belkin
bin/belkinunv
@ -61,7 +62,6 @@ bin/victronups
@man man/man8/powercom.8
@man man/man8/safenet.8
@man man/man8/sms.8
@man man/man8/snmp-ups.8
@man man/man8/tripplite.8
@man man/man8/tripplitesu.8
@man man/man8/upsc.8
@ -113,19 +113,27 @@ share/doc/nut/ssl.txt
share/doc/nut/upssched.txt
share/examples/nut/
@sample ${SYSCONFDIR}/nut/
@owner ${NUT_USER}
share/examples/nut/ups.conf
@sample ${SYSCONFDIR}/nut/ups.conf
share/examples/nut/upsd.conf
@mode 600
@sample ${SYSCONFDIR}/nut/upsd.conf
@exec chmod 600 ${SYSCONFDIR}/nut/upsd.conf
@mode
share/examples/nut/upsd.users
@mode 600
@sample ${SYSCONFDIR}/nut/upsd.users
@exec chmod 600 ${SYSCONFDIR}/nut/upsd.users
@mode
share/examples/nut/upsmon.conf
@mode 600
@sample ${SYSCONFDIR}/nut/upsmon.conf
@exec chmod 600 ${SYSCONFDIR}/nut/upsmon.conf
@mode
share/examples/nut/upssched.conf
@sample ${SYSCONFDIR}/nut/upssched.conf
@mode 700
@sample /var/db/nut/
@mode
@owner
share/ups/
share/ups/cmdvartab
share/ups/driver.list

View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST-snmp,v 1.1 2004/10/03 03:13:10 marcm Exp $
bin/snmp-ups
@man man/man8/snmp-ups.8