diff options
author | dougb <dougb@FreeBSD.org> | 2005-06-26 04:28:01 +0800 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2005-06-26 04:28:01 +0800 |
commit | a689b5887ddbb25f43c7f2b7df33ae83d3cc626d (patch) | |
tree | 5bc635e9eae15240847a54614f2c3784a1aac718 /sysutils/nut22 | |
parent | e12133abd977d679939c244fa6da75c70f14e25a (diff) | |
download | freebsd-ports-gnome-a689b5887ddbb25f43c7f2b7df33ae83d3cc626d.tar.gz freebsd-ports-gnome-a689b5887ddbb25f43c7f2b7df33ae83d3cc626d.tar.zst freebsd-ports-gnome-a689b5887ddbb25f43c7f2b7df33ae83d3cc626d.zip |
From the PR, with some small mods from me:
1. Upgrade to the latest version, 2.0.1
2. Convert to rc.d style startup/shutdown script
3. Improve permissions on /var/db/nut
Download pgp signature file for the tarball.
PR: ports/81591
Submitted by: Dmitry A Grigorovich
Diffstat (limited to 'sysutils/nut22')
-rw-r--r-- | sysutils/nut22/Makefile | 24 | ||||
-rw-r--r-- | sysutils/nut22/distinfo | 6 | ||||
-rw-r--r-- | sysutils/nut22/files/nut.sh.sample | 94 | ||||
-rw-r--r-- | sysutils/nut22/pkg-plist | 22 |
4 files changed, 70 insertions, 76 deletions
diff --git a/sysutils/nut22/Makefile b/sysutils/nut22/Makefile index 5a1e4aa44ae8..e63214c7a756 100644 --- a/sysutils/nut22/Makefile +++ b/sysutils/nut22/Makefile @@ -6,10 +6,13 @@ # PORTNAME= nut -PORTVERSION= 2.0.0 +PORTVERSION= 2.0.1 CATEGORIES= sysutils MASTER_SITES= http://us1.networkupstools.org/source/${PORTVERSION:R}/ \ http://eu1.networkupstools.org/source/${PORTVERSION:R}/ +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${DISTNAME}${EXTRACT_SUFX}.sig +EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} + MAINTAINER= DougB@FreeBSD.org COMMENT= Network UPS Tools @@ -22,16 +25,17 @@ CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/nut \ --with-statepath=/var/db/nut \ --with-altpidpath=/var/db/nut \ --with-pidpath=/var/db/nut +USE_RC_SUBR= yes MAN5= ups.conf.5 upsd.conf.5 upsd.users.5 upsmon.conf.5 \ upssched.conf.5 MAN8= apcsmart.8 belkin.8 belkinunv.8 bestuferrups.8 bestups.8 \ - cyberpower.8 cyberpower1100.8 etapro.8 everups.8 \ + bestfcom.8 cpsups.8 cyberpower.8 etapro.8 everups.8 \ fentonups.8 genericups.8 ippon.8 isbmex.8 liebert.8 \ - masterguard.8 mge-shut.8 mge-utalk.8 nutupsdrv.8 oneac.8 \ - powercom.8 sms.8 snmp-ups.8 tripplite.8 tripplitesu.8 \ - upsc.8 upscmd.8 upsd.8 upsdrvctl.8 upslog.8 upsmon.8 \ - upsrw.8 upssched.8 victronups.8 safenet.8 + masterguard.8 metasys.8 mge-shut.8 mge-utalk.8 mustek.8 \ + nutupsdrv.8 oneac.8 powercom.8 powermust.8 safenet.8 sms.8 \ + snmp-ups.8 tripplite.8 tripplitesu.8 upsc.8 upscmd.8 upsd.8 \ + upsdrvctl.8 upslog.8 upsmon.8 upsrw.8 upssched.8 victronups.8 ALL_TARGET= all INSTALL_TARGET= install install-conf @@ -65,12 +69,14 @@ pre-install: .endif @${MKDIR} ${PREFIX}/libexec/nut @${MKDIR} /var/db/nut - @${CHOWN} uucp /var/db/nut + @${CHOWN} uucp:wheel /var/db/nut + @${CHMOD} 0750 /var/db/nut post-install: @${SED} -e "s#%%PREFIX%%#${PREFIX}#g" \ - ${FILESDIR}/nut.sh.sample > ${PREFIX}/etc/rc.d/nut.sh.sample - @${CHMOD} 0755 ${PREFIX}/etc/rc.d/nut.sh.sample + -e "s#%%RC_SUBR%%#${RC_SUBR}#g" \ + <${FILESDIR}/nut.sh.sample >${WRKSRC}/nut.sh + ${INSTALL_SCRIPT} ${WRKSRC}/nut.sh ${PREFIX}/etc/rc.d/nut.sh .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR}/cables @${MKDIR} ${DOCSDIR}/drivers diff --git a/sysutils/nut22/distinfo b/sysutils/nut22/distinfo index c1ef2f64908e..5477a5f59301 100644 --- a/sysutils/nut22/distinfo +++ b/sysutils/nut22/distinfo @@ -1,2 +1,4 @@ -MD5 (nut-2.0.0.tar.gz) = 84649ad95809737b5ffc19efdd9e9952 -SIZE (nut-2.0.0.tar.gz) = 530492 +MD5 (nut-2.0.1.tar.gz) = fe28e182ab31015cfcfad5870a2322a2 +SIZE (nut-2.0.1.tar.gz) = 564545 +MD5 (nut-2.0.1.tar.gz.sig) = 5a44399917dbb14cb939266aeafcaf61 +SIZE (nut-2.0.1.tar.gz.sig) = 65 diff --git a/sysutils/nut22/files/nut.sh.sample b/sysutils/nut22/files/nut.sh.sample index fb2d0cd405b2..24945d485928 100644 --- a/sysutils/nut22/files/nut.sh.sample +++ b/sysutils/nut22/files/nut.sh.sample @@ -1,70 +1,46 @@ #!/bin/sh - -# Please see detailed Copyright (c) below # # $FreeBSD$ # -# This is a sample startup file that works for my BackUPS Pro 650. -# If that's not what you're monitoring, you will probably need to -# edit this file, although the basic concepts are the same. -# - Doug Barton, DougB@FreeBSD.org -# -# Edit PREFIX below if necessary, then copy this file to -# ${PREFIX}/etc/rc.d/nut.sh and make it executable. (E.g., chmod 0700) -# Usually /usr/local -PREFIX=%%PREFIX%% +# PROVIDE: nut +# REQUIRE: NETWORKING +# BEFORE: LOGIN +# KEYWORD: shutdown -BIN=${PREFIX}/bin -SBIN=${PREFIX}/sbin -MODELS=${PREFIX}/libexec/nut +# Define these nut_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/nut +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +nut_enable=${nut_enable-"NO"} +nut_prefix=${nut_prefix-"%%PREFIX%%"} +nut_pidfile=${nut_pidfile-"/var/db/nut/nut.pid"} +nut_upslog=${nut_upslog-"/var/log/ups.log"} +nut_upsloginterval=${nut_upsloginterval-"300"} +nut_upslogmail=${nut_upslogmail-"backups@localhost"} -UPSLOG='/var/log/ups.log' -UPSLOGINTERVAL='300' +. %%RC_SUBR%% -case "${1}" in -start) - ${MODELS}/upsdrvctl start - ${SBIN}/upsd - ${SBIN}/upsmon localhost - ${BIN}/upslog -s backups@localhost -l ${UPSLOG} -i ${UPSLOGINTERVAL} - ;; -stop) - /usr/bin/killall upslog upsmon upsd - ${MODELS}/upsdrvctl stop - ;; -restart) - $0 stop - $0 start - ;; -*) - echo "Usage: $0 {start|stop|restart}" - ;; -esac +name="nut" +rcvar=`set_rcvar` + +start_cmd="nut_start" +stop_cmd="nut_stop" -exit 0 +nut_start() { + ${nut_prefix}/libexec/nut/upsdrvctl start + ${nut_prefix}/sbin/upsd + ${nut_prefix}/sbin/upsmon localhost + ${nut_prefix}/bin/upslog -s ${nut_upslogmail} -l ${nut_upslog} -i ${nut_upsloginterval} +} -# Copyright (c) 2003-2004 The FreeBSD Project -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. +nut_stop() { + /usr/bin/killall upslog upsmon upsd + ${nut_prefix}/libexec/nut/upsdrvctl stop +} +load_rc_config $name +run_rc_command "$1" diff --git a/sysutils/nut22/pkg-plist b/sysutils/nut22/pkg-plist index 6852272d2cd9..e8a2acfb9a78 100644 --- a/sysutils/nut22/pkg-plist +++ b/sysutils/nut22/pkg-plist @@ -9,15 +9,17 @@ etc/nut/upsd.conf.sample etc/nut/upsd.users.sample etc/nut/upsmon.conf.sample etc/nut/upssched.conf.sample -etc/rc.d/nut.sh.sample +@unexec rmdir %D/etc/nut 2>/dev/null || true +etc/rc.d/nut.sh libexec/nut/apcsmart libexec/nut/belkin libexec/nut/belkinunv +libexec/nut/bestfcom libexec/nut/bestuferrups libexec/nut/bestups libexec/nut/blazer +libexec/nut/cpsups libexec/nut/cyberpower -libexec/nut/cyberpower1100 libexec/nut/esupssmart libexec/nut/etapro libexec/nut/everups @@ -27,10 +29,13 @@ libexec/nut/ippon libexec/nut/isbmex libexec/nut/liebert libexec/nut/masterguard +libexec/nut/metasys libexec/nut/mge-shut libexec/nut/mge-utalk +libexec/nut/mustek libexec/nut/oneac libexec/nut/powercom +libexec/nut/powermust libexec/nut/safenet libexec/nut/sms libexec/nut/tripplite @@ -47,6 +52,9 @@ sbin/upssched %%CGIETC%%upsset.conf.sample %%CGIETC%%upsstats.html.sample %%CGIETC%%upsstats-single.html.sample +%%PORTDOCS%%@exec mkdir %D/%%DOCSDIR%% +%%PORTDOCS%%@exec mkdir %D/%%DOCSDIR%%/cables +%%PORTDOCS%%@exec mkdir %D/%%DOCSDIR%%/drivers %%PORTDOCS%%%%DOCSDIR%%/CHANGES %%PORTDOCS%%%%DOCSDIR%%/CREDITS %%PORTDOCS%%%%DOCSDIR%%/FAQ @@ -55,6 +63,7 @@ sbin/upssched %%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%%%DOCSDIR%%/UPGRADING %%PORTDOCS%%%%DOCSDIR%%/big-servers.txt +%%PORTDOCS%%%%DOCSDIR%%/cables/apc-rs500-serial.txt %%PORTDOCS%%%%DOCSDIR%%/cables/apc.txt %%PORTDOCS%%%%DOCSDIR%%/cables/ge-imv-victron.txt %%PORTDOCS%%%%DOCSDIR%%/cables/imv.txt @@ -82,9 +91,10 @@ sbin/upssched %%PORTDOCS%%%%DOCSDIR%%/sock-protocol.txt %%PORTDOCS%%%%DOCSDIR%%/ssl.txt %%PORTDOCS%%%%DOCSDIR%%/upssched.txt -@dirrm %%DOCSDIR%%/cables -@dirrm %%DOCSDIR%%/drivers -@dirrm %%DOCSDIR%% +%%PORTDOCS%%@dirrm %%DOCSDIR%%/cables +%%PORTDOCS%%@dirrm %%DOCSDIR%%/drivers +%%PORTDOCS%%@dirrm %%DOCSDIR%% @dirrm libexec/nut +@exec if [ ! -d /var/db/nut ]; then mkdir /var/db/nut; chown uucp:wheel /var/db/nut; chmod 0755 /var/db/nut; fi +@unexec rmdir /var/db/nut 2>/dev/null || true %%CGIDIRRM%% -@unexec rmdir %D/etc/nut 2>/dev/null || true |