diff options
author | martin <martin> | 2000-12-28 16:06:13 +0000 |
---|---|---|
committer | martin <martin> | 2000-12-28 16:06:13 +0000 |
commit | 8b18744ae7a948904b6da0a73d983305305daa40 (patch) | |
tree | 0542a36883ba87bb6118c8552b6647ef0532b249 /sysutils | |
parent | 970640012932e956ede96f46103fd39a6b81219a (diff) | |
download | pkgsrc-8b18744ae7a948904b6da0a73d983305305daa40.tar.gz |
Initial import of ups-nut pkg (network ups tools), a collection of
tools used to monitor various UPSes. Pkg from collver@softhome.net
with minor modifications. Closes PR 11745.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/ups-nut/Makefile | 78 | ||||
-rw-r--r-- | sysutils/ups-nut/files/md5 | 3 | ||||
-rw-r--r-- | sysutils/ups-nut/files/patch-sum | 5 | ||||
-rw-r--r-- | sysutils/ups-nut/patches/patch-aa | 13 | ||||
-rw-r--r-- | sysutils/ups-nut/patches/patch-ab | 24 | ||||
-rw-r--r-- | sysutils/ups-nut/patches/patch-ac | 21 | ||||
-rw-r--r-- | sysutils/ups-nut/pkg/COMMENT | 1 | ||||
-rw-r--r-- | sysutils/ups-nut/pkg/DEINSTALL | 19 | ||||
-rw-r--r-- | sysutils/ups-nut/pkg/DESCR | 5 | ||||
-rw-r--r-- | sysutils/ups-nut/pkg/INSTALL | 44 | ||||
-rw-r--r-- | sysutils/ups-nut/pkg/PLIST | 58 |
11 files changed, 271 insertions, 0 deletions
diff --git a/sysutils/ups-nut/Makefile b/sysutils/ups-nut/Makefile new file mode 100644 index 00000000000..12588ec7467 --- /dev/null +++ b/sysutils/ups-nut/Makefile @@ -0,0 +1,78 @@ +# $NetBSD: Makefile,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ +# + +DISTNAME= nut-0.44.2 +PKGNAME= ups-nut-0.44.2 +CATEGORIES= sysutils +MASTER_SITES= http://www.exploits.org/nut/release/ + +MAINTAINER= collver@softhome.net +HOMEPAGE= http://www.exploits.org/nut/ + +.include "../../mk/bsd.prefs.mk" +.if ${OPSYS} == "NetBSD" +.if exists(/usr/sbin/user) +ADDUSER= /usr/sbin/useradd +ADDGROUP= /usr/sbin/groupadd +USERDEL= /usr/sbin/userdel +GROUPDEL= /usr/sbin/groupdel +.else +DEPENDS+= user>=20000313:../../sysutils/user +ADDUSER= ${LOCALBASE}/sbin/useradd +ADDGROUP= ${LOCALBASE}/sbin/groupadd +USERDEL= ${LOCALBASE}/sbin/userdel +GROUPDEL= ${LOCALBASE}/sbin/groupdel +.endif +.elif ${OPSYS} == "SunOS" +ADDUSER= useradd +ADDGROUP= groupadd +USERDEL= userdel +GROUPDEL= groupdel +.endif +WRKSRC= ${WRKDIR}/nut-0.44.2 +DEINSTALL_FILE= ${WRKDIR}/DEINSTALL +INSTALL_FILE= ${WRKDIR}/INSTALL + +GNU_CONFIGURE= yes +NUT_DOCDIR= ${LOCALBASE}/share/doc/nut +NUT_USER= nut +NUT_GROUP= nut +CONFIGURE_ARGS+= --sysconfdir=${LOCALBASE}/etc/nut \ + --with-user=${NUT_USER} \ + --with-group=${NUT_GROUP} \ + --with-statepath=/var/db/nut + +pre-install: + ${SED} -e 's|@NUT_USER@|${NUT_USER}|g' \ + -e 's|@NUT_GROUP@|${NUT_GROUP}|g' \ + -e 's|@USERDEL@|${USERDEL}|g' \ + -e 's|@GROUPDEL@|${GROUPDEL}|g' \ + < ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} + ${SED} -e 's|@NUT_USER@|${NUT_USER}|g' \ + -e 's|@NUT_GROUP@|${NUT_GROUP}|g' \ + -e 's|@USERDIR@|${USERDIR}|g' \ + -e 's|@ADDUSER@|${ADDUSER}|g' \ + -e 's|@ADDGROUP@|${ADDGROUP}|g' \ + -e 's|@CHGRP@|${CHGRP}|g' \ + -e 's|@GREP@|${GREP}|g' \ + -e 's|@RM@|${RM}|g' \ + -e 's|@TOUCH@|${TOUCH}|g' \ + < ${PKGDIR}/INSTALL > ${INSTALL_FILE} + ${SH} ${INSTALL_FILE} + +post-install: + @${SED} -e "/%%PREFIX%%/s##${LOCALBASE}#g" \ + ${WRKSRC}/scripts/NetBSD/upsd \ + >${LOCALBASE}/etc/rc.d/upsd + @${CHMOD} 0755 ${LOCALBASE}/etc/rc.d/upsd + @${INSTALL} -d -o ${NUT_USER} -g ${NUT_GROUP} -m 0770 /var/db/nut + @if ! [ -d ${NUT_DOCDIR} ]; then ${MKDIR} ${NUT_DOCDIR}; fi + @if ! [ -d ${NUT_DOCDIR}/cables ]; then ${MKDIR} ${NUT_DOCDIR}/cables; fi + ${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${NUT_DOCDIR}/cables + ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${NUT_DOCDIR} + ${INSTALL_DATA} ${WRKSRC}/docs/FAQ ${NUT_DOCDIR} + ${INSTALL_DATA} ${WRKSRC}/docs/Changes.trust ${NUT_DOCDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${NUT_DOCDIR} + ${INSTALL_DATA} ${WRKSRC}/QUICKSTART ${NUT_DOCDIR} + +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/ups-nut/files/md5 b/sysutils/ups-nut/files/md5 new file mode 100644 index 00000000000..7bc131b3bdf --- /dev/null +++ b/sysutils/ups-nut/files/md5 @@ -0,0 +1,3 @@ +$NetBSD: md5,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ + +MD5 (nut-0.44.2.tar.gz) = e426128d0a203b6d3dd5f641c2b17fd0 diff --git a/sysutils/ups-nut/files/patch-sum b/sysutils/ups-nut/files/patch-sum new file mode 100644 index 00000000000..777de4a9839 --- /dev/null +++ b/sysutils/ups-nut/files/patch-sum @@ -0,0 +1,5 @@ +$NetBSD: patch-sum,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ + +MD5 (patch-aa) = 335ec6d3e7292bb55e430cf29851ee70 +MD5 (patch-ab) = 23d71e721078f59fd160f58fa71df2fa +MD5 (patch-ac) = ac889575a472b4284d008637ec746af9 diff --git a/sysutils/ups-nut/patches/patch-aa b/sysutils/ups-nut/patches/patch-aa new file mode 100644 index 00000000000..b589717dd71 --- /dev/null +++ b/sysutils/ups-nut/patches/patch-aa @@ -0,0 +1,13 @@ +$NetBSD: patch-aa,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ + +--- Makefile.in.orig Sat Dec 2 17:18:03 2000 ++++ Makefile.in Thu Dec 14 13:01:11 2000 +@@ -5,7 +5,7 @@ + BASEPATH = $(INSTALLROOT)@prefix@ + CONFPATH = $(INSTALLROOT)@sysconfdir@ + CGIPATH = $(INSTALLROOT)@CGIPATH@ +-INSTALLDIRS = $(CONFPATH) $(CGIPATH) $(MODELPATH) $(BASEPATH)/@bindir@ $(BASEPATH)/@sbindir@ $(BASEPATH)/misc ++INSTALLDIRS = $(CONFPATH) $(MODELPATH) $(BASEPATH)/@bindir@ $(BASEPATH)/@sbindir@ + STATEPATH = $(INSTALLROOT)@STATEPATH@ + + SUBDIRS = common models server clients man diff --git a/sysutils/ups-nut/patches/patch-ab b/sysutils/ups-nut/patches/patch-ab new file mode 100644 index 00000000000..566a22d5d67 --- /dev/null +++ b/sysutils/ups-nut/patches/patch-ab @@ -0,0 +1,24 @@ +$NetBSD: patch-ab,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ + +--- conf/Makefile.in.orig Thu Dec 14 13:04:42 2000 ++++ conf/Makefile.in Thu Dec 14 13:05:27 2000 +@@ -13,17 +13,9 @@ + + install: + @for f in $(SECFILES) ; do \ +- if [ -f $(CONFPATH)/$$f ]; then \ +- echo "Preserving existing config file: $$f"; \ +- else \ +- $(INSTALLCMD) -m 0600 $$f $(CONFPATH); \ +- fi; \ ++ $(INSTALLCMD) -m 0600 $$f $(CONFPATH)/$$f.sample; \ + done + + @for f in $(PUBFILES) ; do \ +- if [ -f $(CONFPATH)/$$f ]; then \ +- echo "Preserving existing config file: $$f"; \ +- else \ +- $(INSTALLCMD) -m 0644 $$f $(CONFPATH); \ +- fi; \ ++ $(INSTALLCMD) -m 0644 $$f $(CONFPATH)/$$f.sample; \ + done diff --git a/sysutils/ups-nut/patches/patch-ac b/sysutils/ups-nut/patches/patch-ac new file mode 100644 index 00000000000..5d0f8f36588 --- /dev/null +++ b/sysutils/ups-nut/patches/patch-ac @@ -0,0 +1,21 @@ +$NetBSD: patch-ac,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ + +diff -Pur scripts-orig/NetBSD/upsd.sh scripts/NetBSD/upsd.sh +--- scripts-orig/NetBSD/upsd Wed Dec 31 16:00:00 1969 ++++ scripts/NetBSD/upsd Thu Dec 14 21:19:34 2000 +@@ -0,0 +1,15 @@ ++#!/bin/sh ++UPS_DRIVER="apcsmart" ++DRIVER_OPTIONS="" ++SPECIAL_FILE="/dev/dty00" ++MONITOR_HOST="localhost" ++ ++if [ -z "$1" -o "x$1" = xstart ] ++then ++ if [ x$MONITOR_HOST = xlocalhost ] ++ then ++ %%PREFIX%%/bin/$UPS_DRIVER $DRIVER_OPTIONS $SPECIAL_FILE ++ %%PREFIX%%/sbin/upsd ++ fi ++ %%PREFIX%%/sbin/upsmon $MONITOR_HOST ++fi diff --git a/sysutils/ups-nut/pkg/COMMENT b/sysutils/ups-nut/pkg/COMMENT new file mode 100644 index 00000000000..83ab91a03e2 --- /dev/null +++ b/sysutils/ups-nut/pkg/COMMENT @@ -0,0 +1 @@ +Network UPS Tools diff --git a/sysutils/ups-nut/pkg/DEINSTALL b/sysutils/ups-nut/pkg/DEINSTALL new file mode 100644 index 00000000000..1d5a3b102f0 --- /dev/null +++ b/sysutils/ups-nut/pkg/DEINSTALL @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $NetBSD: DEINSTALL,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ +# + +USER="@NUT_USER@" +GROUP="@NUT_GROUP@" +USERDEL="@USERDEL@" +GROUPDEL="@GROUPDEL@" + +case "$2" in + DEINSTALL) + echo "Removing user ${USER}" + ${USERDEL} -r ${USER} + echo "Removing group ${GROUP}" + ${GROUPDEL} ${GROUP} + ;; +esac +exit 0 diff --git a/sysutils/ups-nut/pkg/DESCR b/sysutils/ups-nut/pkg/DESCR new file mode 100644 index 00000000000..a83a7e2eaa2 --- /dev/null +++ b/sysutils/ups-nut/pkg/DESCR @@ -0,0 +1,5 @@ +This is a developing project to monitor a large assortment of UPS hardware. +Network communications are used so that multiple systems can monitor a +single physical UPS and shut down together if necessary without any +special "sharing hardware" on the UPS itself. CGI scripts are in the +ups-nut-cgi package. diff --git a/sysutils/ups-nut/pkg/INSTALL b/sysutils/ups-nut/pkg/INSTALL new file mode 100644 index 00000000000..e9079880a8c --- /dev/null +++ b/sysutils/ups-nut/pkg/INSTALL @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $NetBSD: INSTALL,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ + +USER=@NUT_USER@ +GROUP=@NUT_GROUP@ + +ADDUSER="@ADDUSER@" +ADDGROUP="@ADDGROUP@" +CHGRP="@CHGRP@" +GREP="@GREP@" +RM="@RM@" +TOUCH="@TOUCH@" + +# Group... the default's shipped with NetBSD +# We need to check that ${GROUP} exists before adding the user. +# Do it with chgrp to be able to use NIS. +# +${TOUCH} "/tmp/grouptest.$$" +${CHGRP} ${GROUP} "/tmp/grouptest.$$" >/dev/null 2>&1 +if [ $? -eq 0 ] +then + echo "Group '${GROUP}' already exists...proceeding." +else + echo "Creating '${GROUP}' group..." + ${ADDGROUP} ${GROUP} + echo "Done." +fi +${RM} -f "/tmp/grouptest.$$" + +# Use `finger' to be able to use NIS. +# +finger ${USER} 2>&1 | ${GREP} -q "no such user" +if [ $? -eq 0 ] +then + echo "Creating '${USER}' user..." + ${ADDUSER} \ + -c "Network UPS Tools" \ + -g ${GROUP} -s /bin/sh -m ${USER} + echo "Done." +else + echo "User '${USER}' already exists...proceeding." +fi +exit 0 diff --git a/sysutils/ups-nut/pkg/PLIST b/sysutils/ups-nut/pkg/PLIST new file mode 100644 index 00000000000..680bead6943 --- /dev/null +++ b/sysutils/ups-nut/pkg/PLIST @@ -0,0 +1,58 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $ +etc/rc.d/upsd +etc/nut/hosts.conf.sample +etc/nut/multimon.conf.sample +etc/nut/upsd.conf.sample +etc/nut/upsmon.conf.sample +etc/nut/upsset.passwd.sample +bin/ups-trust425+625 +bin/apcsmart +bin/fentonups +bin/genericups +bin/optiups +bin/bestups +bin/victronups +bin/ipt-anzen +bin/bestfort +bin/mustekups +bin/engetron +bin/belkin +bin/powercom +bin/bestuferrups +bin/toshiba1500 +bin/newapc +bin/upsc +bin/upslog +bin/upsct +bin/upsct2 +bin/upscmd +sbin/upsd +sbin/upsmon +sbin/upssched +share/doc/nut/Changes.trust +share/doc/nut/FAQ +share/doc/nut/access.txt +share/doc/nut/belkin.txt +share/doc/nut/big-servers.txt +share/doc/nut/commands.txt +share/doc/nut/configure.txt +share/doc/nut/data-room.txt +share/doc/nut/dummyups.txt +share/doc/nut/generic-ups.txt +share/doc/nut/new-modules.txt +share/doc/nut/pager.txt +share/doc/nut/powercom.txt +share/doc/nut/protocol.txt +share/doc/nut/shutdown.txt +share/doc/nut/tips.txt +share/doc/nut/todo.txt +share/doc/nut/ups-trust425+625.txt +share/doc/nut/model-arguments.txt +share/doc/nut/upssched.txt +share/doc/nut/README +share/doc/nut/QUICKSTART +share/doc/nut/cables/powerware.txt +share/doc/nut/cables/victron.txt +@dirrm share/doc/nut/cables +@dirrm share/doc/nut +@unexec rmdir /var/db/nut |