ports/155375: New Port: /sysutils/nut
John Bayly
freebsd.ports at tipstrade.net
Tue Mar 8 13:50:11 UTC 2011
>Number: 155375
>Category: ports
>Synopsis: New Port: /sysutils/nut
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Mar 08 13:50:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: John Bayly
>Release: 7.3-RELEASE-p2
>Organization:
TipsTrade Ltd.
>Environment:
FreeBSD rack 7.3-RELEASE-p2 FreeBSD 7.3-RELEASE-p2 #7: Fri Feb 4 15:47:31 GMT 2011 baylyj at rack:/usr/obj/usr/src/sys/S5500BC amd64
>Description:
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 provided
to monitor UPS status via a WEB browser.
WWW: http://www.networkupstools.org/
Version 2.2 (sysutils/nut22) & 2.4 (sysutils/nut) already exist in the ports tree, but the current release is 2.6.0
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# ./nut
# ./nut/files
# ./nut/files/nut.sh.in
# ./nut/files/nut_upslog.sh.in
# ./nut/files/nut_upsmon.sh.in
# ./nut/Makefile
# ./nut/pkg-descr
# ./nut/pkg-plist
# ./nut/distinfo
#
echo c - ./nut
mkdir -p ./nut > /dev/null 2>&1
echo c - ./nut/files
mkdir -p ./nut/files > /dev/null 2>&1
echo x - ./nut/files/nut.sh.in
sed 's/^X//' >./nut/files/nut.sh.in << 'c7ce638f0c332d19691ae0c735b673fe'
X#!/bin/sh
X#
X# $FreeBSD: ports/sysutils/nut/files/nut.sh.in,v 1.2 2010/03/27 00:14:59 dougb Exp $
X#
X
X# PROVIDE: nut
X# REQUIRE: NETWORKING
X# BEFORE: LOGIN
X# KEYWORD: shutdown
X
X# Define these nut_* variables in one of these files:
X# /etc/rc.conf
X# /etc/rc.conf.local
X# /etc/rc.conf.d/nut
X#
X# DO NOT CHANGE THESE DEFAULT VALUES HERE
X#
Xnut_enable=${nut_enable-"NO"}
Xnut_prefix=${nut_prefix-"%%PREFIX%%"}
X
X. /etc/rc.subr
X
Xname="nut"
Xrcvar=`set_rcvar`
X
Xload_rc_config $name
X
Xrequired_dirs="%%STATEDIR%%"
Xrequired_files="${nut_prefix}/etc/nut/ups.conf ${nut_prefix}/etc/nut/upsd.conf ${nut_prefix}/etc/nut/upsd.users"
Xcommand="${nut_prefix}/sbin/upsd"
Xpidfile="%%STATEDIR%%/upsd.pid"
X
Xstart_precmd="nut_prestart"
Xstop_postcmd="nut_poststop"
X
Xnut_prestart() {
X ${nut_prefix}/libexec/nut/upsdrvctl start
X}
X
Xnut_poststop() {
X ${nut_prefix}/libexec/nut/upsdrvctl stop
X}
X
Xrun_rc_command "$1"
c7ce638f0c332d19691ae0c735b673fe
echo x - ./nut/files/nut_upslog.sh.in
sed 's/^X//' >./nut/files/nut_upslog.sh.in << '830f3291cb8368e3b429a014ceca756f'
X#!/bin/sh
X#
X# $FreeBSD: ports/sysutils/nut/files/nut_upslog.sh.in,v 1.2 2010/03/27 00:15:00 dougb Exp $
X#
X
X# PROVIDE: nut_upslog
X# REQUIRE: NETWORKING nut
X# BEFORE: LOGIN
X# KEYWORD: shutdown
X
X# Define these nut_upslog* variables in one of these files:
X# /etc/rc.conf
X# /etc/rc.conf.local
X# /etc/rc.conf.d/nut_upslog
X#
X# DO NOT CHANGE THESE DEFAULT VALUES HERE
X#
Xnut_upslog_enable=${nut_upslog_enable-"NO"}
Xnut_upslog_prefix=${nut_upslog_prefix-"%%PREFIX%%"}
Xnut_upslog_logfile=${nut_upslog_logfile-"/var/log/ups.log"}
Xnut_upslog_interval=${nut_upslog_interval-"300"}
Xnut_upslog_ups=${nut_upslog_ups-"myups at localhost"}
X
X. /etc/rc.subr
X
Xname="nut_upslog"
Xrcvar=`set_rcvar`
X
Xload_rc_config $name
X
Xrequired_dirs="%%STATEDIR%%"
Xcommand="${nut_upslog_prefix}/bin/upslog"
Xpidfile="%%STATEDIR%%/upslog.pid"
Xnut_upslog_flags=${nut_upslog_flags-"-s ${nut_upslog_ups} -l ${nut_upslog_logfile} -i ${nut_upslog_interval}"}
X
Xrun_rc_command "$1"
830f3291cb8368e3b429a014ceca756f
echo x - ./nut/files/nut_upsmon.sh.in
sed 's/^X//' >./nut/files/nut_upsmon.sh.in << '4f106c81f19244acf267d98ed7b39d2b'
X#!/bin/sh
X#
X# $FreeBSD: ports/sysutils/nut/files/nut_upsmon.sh.in,v 1.2 2010/03/27 00:15:00 dougb Exp $
X#
X
X# PROVIDE: nut_upsmon
X# REQUIRE: NETWORKING nut
X# BEFORE: LOGIN
X# KEYWORD: shutdown
X
X# Define these nut_upsmon* variables in one of these files:
X# /etc/rc.conf
X# /etc/rc.conf.local
X# /etc/rc.conf.d/nut_upsmon
X#
X# DO NOT CHANGE THESE DEFAULT VALUES HERE
X#
Xnut_upsmon_enable=${nut_upsmon_enable-"NO"}
Xnut_upsmon_prefix=${nut_upsmon_prefix-"%%PREFIX%%"}
X
X. /etc/rc.subr
X
Xname="nut_upsmon"
Xrcvar=`set_rcvar`
X
Xload_rc_config $name
X
Xrequired_dirs="%%STATEDIR%%"
Xrequired_files="${nut_upsmon_prefix}/etc/nut/upsmon.conf"
Xcommand="${nut_upsmon_prefix}/sbin/upsmon"
Xpidfile="%%STATEDIR%%/upsmon.pid"
Xnut_upsmon_flags=${nut_upsmon_flags-"localhost"}
X
Xrun_rc_command "$1"
4f106c81f19244acf267d98ed7b39d2b
echo x - ./nut/Makefile
sed 's/^X//' >./nut/Makefile << 'df45a3b74ee0173ca013110ce45e00d6'
X# New ports collection makefile for: nut
X# Date created: 08 Jan 2000
X# Whom: Boris Popov <bp at freebsd.org>
X# Date modified: 06 Dec 2010
X# Whom: John Bayly <freebsd.ports at tipstrade.net>
X#
X# $FreeBSD: ports/sysutils/nut/Makefile,v 1.58 2010/09/16 15:00:00 itetcu Exp $
X#
X
XPORTNAME= nut
XPORTVERSION= 2.6.0
XPORTREVISION= 0
XCATEGORIES= sysutils
XMASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/
XDISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${DISTNAME}${EXTRACT_SUFX}.sig
XEXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
X
XMAINTAINER= freebsd.ports at tipstrade.net
XCOMMENT= Network UPS Tools
X
XUSE_AUTOTOOLS= autoconf
XGNU_CONFIGURE= yes
XUSE_GMAKE= yes
XUSE_LDCONFIG= yes
XUSE_GNOME= pkgconfig
X
XNUT_USER?= uucp
XNUT_GROUP?= uucp
XSTATEDIR?= /var/db/nut
X
XOPTIONS= SERIAL "SERIAL support" on \
X USB "USB support" on \
X SNMP "SNMP support" on \
X NEON "NEON XML/HTTP support" on \
X PDU "Powerman PDU support" off \
X HAL "HAL support" off \
X CGI "Web CGI interface" off \
X BASH "Bash Completion support" off
X
XUSE_RC_SUBR= nut.sh nut_upsmon.sh nut_upslog.sh
XSUB_LIST+= STATEDIR=${STATEDIR}
XPLIST_SUB+= STATEDIR=${STATEDIR}
X
XMAN3= upscli_connect.3 upscli_disconnect.3 upscli_fd.3 \
X upscli_get.3 upscli_list_next.3 upscli_list_start.3 \
X upscli_readline.3 upscli_sendline.3 upscli_splitaddr.3 \
X upscli_splitname.3 upscli_ssl.3 upscli_strerror.3 \
X upscli_upserror.3 upsclient.3
X
XMAN5= nut.conf.5 ups.conf.5 upsd.conf.5 upsd.users.5 \
X upsmon.conf.5 upssched.conf.5
X
XMAN8= nutupsdrv.8 upsc.8 upscmd.8 upsd.8 upsdrvctl.8 \
X upslog.8 upsmon.8 upsrw.8 upssched.8
X
XPORTDOCS= *
X
X.include <bsd.port.pre.mk>
X
XCONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/nut \
X --program-transform-name="" \
X --localstatedir=${STATEDIR} \
X --datadir=${PREFIX}/etc/nut \
X --with-drvpath=${PREFIX}/libexec/nut \
X --with-statepath=${STATEDIR} \
X --with-altpidpath=${STATEDIR} \
X --with-pidpath=${STATEDIR} \
X --with-pkgconfig-dir=${PREFIX}/libdata/pkgconfig \
X --with-user=${NUT_USER} \
X --with-group=${NUT_GROUP} \
X --with-dev
X
X.if defined(WITH_CGI)
XLIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd
XMAN5+= hosts.conf.5 upsset.conf.5 upsstats.html.5
XMAN8+= upsset.cgi.8 upsstats.cgi.8 upsimage.cgi.8
XCGIDIR?= ${PREFIX}/www/cgi-bin/${PORTNAME}
XCGIDIR_REL?= ${CGIDIR:S,^${PREFIX}/,,}
XCONFIGURE_ARGS+= --with-cgi --with-cgipath=${CGIDIR} \
X --with-htmlpath=${WWWDIR} \
X --with-gd-includes=-I${PREFIX}/include \
X --with-gd-libs="-L${PREFIX}/lib -lgd"
XPLIST_SUB+= NUT_CGI=""
XPLIST_SUB+= CGIDIR="${CGIDIR_REL}"
XPLIST_SUB+= CGIETCDIR="etc/nut/"
X.else
XCONFIGURE_ARGS+= --without-cgi
XPLIST_SUB+= NUT_CGI="@comment "
X.endif
X
X.if !defined(WITHOUT_SERIAL)
XCONFIGURE_ARGS+= --with-serial
XMAN8+= apcsmart.8 bcmxcp.8 belkin.8 belkinunv.8 bestfortress.8 \
X bestuferrups.8 bestups.8 bestfcom.8 blazer.8 clone.8 \
X dummy-ups.8 etapro.8 everups.8 gamatronic.8 genericups.8 \
X isbmex.8 ivtscd.8 liebert.8 liebert-esp2.8 masterguard.8 \
X metasys.8 mge-shut.8 mge-utalk.8 microdowell.8 \
X oneac.8 optiups.8 powercom.8 powerpanel.8 rhino.8 safenet.8 \
X solis.8 tripplite.8 tripplitesu.8 upscode2.8 victronups.8
XPLIST_SUB+= NUT_SERIAL=""
X.else
XCONFIGURE_ARGS+= --without-serial
XPLIST_SUB+= NUT_SERIAL="@comment "
X.endif
X
X.if !defined(WITHOUT_USB)
X. if ${OSVERSION} < 800069
XLIB_DEPENDS+= usb-0.1.8:${PORTSDIR}/devel/libusb
X. else
XEXTRA_PATCHES= ${FILESDIR}/extra-patch-m4_nut_check_libusb.m4
X. endif
XCONFIGURE_ARGS+= --with-usb=auto
XMAN8+= bcmxcp_usb.8 richcomm_usb.8 tripplite_usb.8 \
X usbhid-ups.8
XPLIST_SUB+= NUT_USB=""
X.else
XCONFIGURE_ARGS+= --without-usb
XPLIST_SUB+= NUT_USB="@comment "
X.endif
X
X.if !defined(WITHOUT_SNMP)
XLIB_DEPENDS+= netsnmp.20:${PORTSDIR}/net-mgmt/net-snmp
XCONFIGURE_ARGS+= --with-snmp
XMAN8+= snmp-ups.8
XPLIST_SUB+= NUT_SNMP=""
X.else
XCONFIGURE_ARGS+= --without-snmp
XPLIST_SUB+= NUT_SNMP="@comment "
X.endif
X
X.if !defined(WITHOUT_NEON)
XLIB_DEPENDS+= neon.27:${PORTSDIR}/www/neon29
XCONFIGURE_ARGS+= --with-neon
XMAN8+= netxml-ups.8
XPLIST_SUB+= NUT_NEON=""
X.else
XCONFIGURE_ARGS+= --without-neon
XPLIST_SUB+= NUT_NEON="@comment "
X.endif
X
X.if defined(WITH_PDU)
XLIB_DEPENDS+= powerman.0:${PORTSDIR}/sysutils/powerman
XCONFIGURE_ARGS+= --with-powerman
XMAN8+= powerman-pdu.8
XPLIST_SUB+= NUT_PDU=""
X.else
XCONFIGURE_ARGS+= --without-powerman
XPLIST_SUB+= NUT_PDU="@comment "
X.endif
X
X.if defined(WITH_HAL)
X. if defined(WITHOUT_USB)
XBROKEN= HAL is only usable with USB support enabled. Run 'make config' again!
X. endif
XLIB_DEPENDS+= hal.1:${PORTSDIR}/sysutils/hal
XCONFIGURE_ARGS+= --with-hal
X#MAN8+=
XPLIST_SUB+= NUT_HAL=""
X.else
XCONFIGURE_ARGS+= --without-hal
XPLIST_SUB+= NUT_HAL="@comment "
X.endif
X
X.if defined(WITH_BASH)
XRUN_DEPENDS+= ${LOCALBASE}/bin/bash_completion.sh:${PORTSDIR}/shells/bash-completion
XPLIST_SUB+= BASH=""
X.else
XPLIST_SUB+= BASH="@comment "
X.endif
X
Xpre-install:
X @${MKDIR} ${PREFIX}/libexec/nut
X @${MKDIR} ${STATEDIR}
X @${CHOWN} ${NUT_USER}:${NUT_GROUP} ${STATEDIR}
X @${CHMOD} 0750 ${STATEDIR}
X
Xpost-install:
X.if defined(WITH_BASH)
X ${INSTALL_DATA} ${WRKSRC}/scripts/misc/nut.bash_completion ${PREFIX}/etc/bash_completion.d/
X.endif
X.if !defined(NOPORTDOCS)
X @${MKDIR} ${DOCSDIR}/cables
X ${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${DOCSDIR}/cables
X ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${DOCSDIR}
X.for file in AUTHORS COPYING ChangeLog INSTALL MAINTAINERS NEWS README UPGRADING
X ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
X.endfor
X.endif
X
X.include <bsd.port.post.mk>
df45a3b74ee0173ca013110ce45e00d6
echo x - ./nut/pkg-descr
sed 's/^X//' >./nut/pkg-descr << '1d1613336a1cd898fdbf55bb7130c479'
XThis is a developing project to monitor a large assortment of UPS hardware.
XNetwork communications are used so that multiple systems can monitor a
Xsingle physical UPS and shut down together if necessary without any
Xspecial "sharing hardware" on the UPS itself. CGI scripts are provided
Xto monitor UPS status via a WEB browser.
X
XWWW: http://www.networkupstools.org/
1d1613336a1cd898fdbf55bb7130c479
echo x - ./nut/pkg-plist
sed 's/^X//' >./nut/pkg-plist << '89a1f66f8e58ff228ec772fe5c8392dd'
X at stopdaemon nut_upsmon
X at stopdaemon nut_upslog
X at stopdaemon nut
Xbin/upsc
Xbin/upscmd
Xbin/upslog
Xbin/upsrw
Xbin/upssched-cmd
X%%BASH%%etc/bash_completion.d/nut.bash_completion
Xetc/nut/cmdvartab
Xetc/nut/driver.list
Xetc/nut/nut.conf.sample
Xetc/nut/ups.conf.sample
Xetc/nut/upsd.conf.sample
Xetc/nut/upsd.users.sample
Xetc/nut/upsmon.conf.sample
Xetc/nut/upssched.conf.sample
Xinclude/parseconf.h
Xinclude/upsclient.h
X%%NUT_HAL%%lib/hal/hald-addon-bcmxcp_usb
X%%NUT_HAL%%lib/hal/hald-addon-tripplite_usb
X%%NUT_HAL%%lib/hal/hald-addon-usbhid-ups
Xlib/libupsclient.la
Xlib/libupsclient.so
Xlib/libupsclient.so.1
Xlibdata/pkgconfig/libupsclient.pc
X%%NUT_SERIAL%%libexec/nut/apcsmart
X%%NUT_SERIAL%%libexec/nut/bcmxcp
X%%NUT_USB%%libexec/nut/bcmxcp_usb
X%%NUT_SERIAL%%libexec/nut/belkin
X%%NUT_SERIAL%%libexec/nut/belkinunv
X%%NUT_SERIAL%%libexec/nut/bestfcom
X%%NUT_SERIAL%%libexec/nut/bestfortress
X%%NUT_SERIAL%%libexec/nut/bestuferrups
X%%NUT_SERIAL%%libexec/nut/bestups
X%%NUT_SERIAL%%libexec/nut/blazer_ser
X%%NUT_USB%%libexec/nut/blazer_usb
X%%NUT_SERIAL%%libexec/nut/clone
X%%NUT_SERIAL%%libexec/nut/clone-outlet
X%%NUT_SERIAL%%libexec/nut/dummy-ups
X%%NUT_SERIAL%%libexec/nut/etapro
X%%NUT_SERIAL%%libexec/nut/everups
X%%NUT_SERIAL%%libexec/nut/gamatronic
X%%NUT_SERIAL%%libexec/nut/genericups
X%%NUT_SERIAL%%libexec/nut/isbmex
X%%NUT_SERIAL%%libexec/nut/ivtscd
X%%NUT_SERIAL%%libexec/nut/liebert
X%%NUT_SERIAL%%libexec/nut/liebert-esp2
X%%NUT_SERIAL%%libexec/nut/masterguard
X%%NUT_SERIAL%%libexec/nut/metasys
X%%NUT_SERIAL%%libexec/nut/mge-shut
X%%NUT_SERIAL%%libexec/nut/mge-utalk
X%%NUT_SERIAL%%libexec/nut/microdowell
X%%NUT_NEON%%libexec/nut/netxml-ups
X%%NUT_SERIAL%%libexec/nut/newmge-shut
X%%NUT_SERIAL%%libexec/nut/oneac
X%%NUT_SERIAL%%libexec/nut/optiups
X%%NUT_SERIAL%%libexec/nut/powercom
X%%NUT_PDU%%libexec/nut/powerman-pdu
X%%NUT_SERIAL%%libexec/nut/powerpanel
X%%NUT_SERIAL%%libexec/nut/rhino
X%%NUT_USB%%libexec/nut/richcomm_usb
X%%NUT_SERIAL%%libexec/nut/safenet
X%%NUT_SERIAL%%libexec/nut/skel
X%%NUT_SNMP%%libexec/nut/snmp-ups
X%%NUT_SERIAL%%libexec/nut/solis
X%%NUT_SERIAL%%libexec/nut/tripplite
X%%NUT_USB%%libexec/nut/tripplite_usb
X%%NUT_SERIAL%%libexec/nut/tripplitesu
X%%NUT_SERIAL%%libexec/nut/upscode2
Xlibexec/nut/upsdrvctl
X%%NUT_USB%%libexec/nut/usbhid-ups
X%%NUT_SERIAL%%libexec/nut/victronups
Xsbin/upsd
Xsbin/upsmon
Xsbin/upssched
X%%NUT_HAL%%share/hal/fdi/information/20thirdparty/20-ups-nut-device.fdi
X%%NUT_CGI%%%%CGIDIR%%/upsimage.cgi
X%%NUT_CGI%%%%CGIDIR%%/upsset.cgi
X%%NUT_CGI%%%%CGIDIR%%/upsstats.cgi
X%%NUT_CGI%%%%CGIETCDIR%%/hosts.conf.sample
X%%NUT_CGI%%%%CGIETCDIR%%/upsset.conf.sample
X%%NUT_CGI%%%%CGIETCDIR%%/upsstats-single.html.sample
X%%NUT_CGI%%%%CGIETCDIR%%/upsstats.html.sample
X%%NUT_CGI%%%%WWWDIR%%/bottom.html
X%%NUT_CGI%%%%WWWDIR%%/header.html
X%%NUT_CGI%%%%WWWDIR%%/index.html
X%%NUT_CGI%%%%WWWDIR%%/nut-banner.png
X at dirrmtry etc/nut
X at dirrmtry libdata/pkgconfig
X at dirrmtry libexec/nut
X at dirrmtry %%STATEDIR%%
X%%NUT_CGI%%@dirrm %%CGIDIR%%
X%%NUT_CGI%%@dirrmtry www/cgi-bin
X%%NUT_CGI%%@dirrm %%WWWDIR%%
89a1f66f8e58ff228ec772fe5c8392dd
echo x - ./nut/distinfo
sed 's/^X//' >./nut/distinfo << 'c77e2c5167860c8c437f20b97d5db568'
XSHA256 (nut-2.6.0.tar.gz) = febaa230b6b5f0ad27d780851047527d36c8c7a34e557b3832d6d55174d7a0d5
XSIZE (nut-2.6.0.tar.gz) = 1703273
XSHA256 (nut-2.6.0.tar.gz.sig) = 67e80f9724e3084ac0ed1357e934412bd68cd4e95784da1bee5db2f09326e77c
XSIZE (nut-2.6.0.tar.gz.sig) = 72
c77e2c5167860c8c437f20b97d5db568
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list