Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2006 01:30:56 +0200 (CEST)
From:      Joerg Pulz <Joerg.Pulz@frm2.tum.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Pav Lucistnik <pav@FreeBSD.org>
Subject:   ports/95015: [maintainer] update sysutils/nut* to v2.0.3
Message-ID:  <200603272330.k2RNUu6G084679@hades.admin.frm2>
Resent-Message-ID: <200603272340.k2RNeGLx024977@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         95015
>Category:       ports
>Synopsis:       [maintainer] update sysutils/nut* to v2.0.3
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 27 23:40:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Joerg Pulz
>Release:        FreeBSD 6.1-PRERELEASE i386
>Organization:
TU-Munich / ZWE FRM-II
>Environment:
System: FreeBSD hades.admin.frm2 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #11: Wed Feb 22 19:01:44 CET 2006 root@hades.admin.frm2:/usr/obj/usr/src/sys/HADES i386


	
>Description:
	Update sysutils/nut* to the latest version 2.0.3
	nut/Makefile:
	  - chase new version
	  - introduce user configurable NUT_USER variable
	    *the default is still uucp as some ups drivers need to access the
	     UPS over a serial line and cuad* devices are owned by uucp*
	  - convert to the new style USE_RC_SUBR and move it into the base
	    SUBSYS
	  - add new manpages
	  - remove some useless post-install stuff
	nut/distinfo:
	  - regen for the new distfile
	nut/pkg-plist:
	  - let USE_RC_SUBR handle the rcNG script removal when deinstalling
	  - add some hackish lines to stop running processes before deinstalling
	    *this could be handled better in bsd.port.mk*
	nut/files/nut.sh.sample:
	  - removed old version
	nut/files/nut.sh.in:
	  - new rcNG script
	    *handles only the UPS driver and the UPS daemon 'upsd'*
	nut/files/nut_upslog.sh.in:
	  - new rcNG script to start 'upslog'
		Variable			Default
		nut_upslog_logfile		/var/log/ups.log
		*can be used to specify an alternative file for log entries*
		nut_upslog_interval		300 (seconds)
		*can be used to change how often log entries are written*
		nut_upslog_ups			myups@localhost
		*is the name of the UPS system to write log entries for*
		- this solves PR/92642
		nut_upslog_flags		**see the file
	nut/files/nut_upsmon.sh.in:
	  - new rcNG script to start 'upsmon'
		Variable			Default
		nut_upsmon_flags		localhost
	  - this, together with the NUT_USER variable, solves PR/89940

	nut-usb/pkg-plist:
	  - add two new UPS drivers for USB connected UPS systems

	UPDATING:
	  - add an entry to inform users about the changed behavior of the nut
	    rcNG script and the two new rcNG scripts for 'upslog' and 'upsmon'
>How-To-Repeat:
	
>Fix:

	

--- sysutils_nut.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/nut/Makefile,v
retrieving revision 1.31
diff -u -r1.31 Makefile
--- Makefile	30 Nov 2005 05:23:10 -0000	1.31
+++ Makefile	27 Mar 2006 22:33:37 -0000
@@ -6,8 +6,8 @@
 #
 
 PORTNAME=	nut
-PORTVERSION=	2.0.2
-PORTREVISION=	1
+PORTVERSION=	2.0.3
+PORTREVISION=	0
 CATEGORIES=	sysutils
 MASTER_SITES=	http://eu1.networkupstools.org/source/${PORTVERSION:R}/ \
 		http://us1.networkupstools.org/source/${PORTVERSION:R}/
@@ -30,23 +30,29 @@
 		--with-statepath=${STATEDIR} \
 		--with-altpidpath=${STATEDIR} \
 		--with-pidpath=${STATEDIR} \
-		--with-linux-hiddev=no
-USE_RC_SUBR=	yes
+		--with-linux-hiddev=no \
+		--with-user=${NUT_USER}
+
+NUT_USER?=	uucp
 STATEDIR=	${DESTDIR}/var/db/nut
 
 .include <bsd.port.pre.mk>
 
 .if ${SUBSYS} == base
+USE_RC_SUBR=	nut.sh nut_upsmon.sh nut_upslog.sh
+SUB_LIST+=	STATEDIR=${STATEDIR}
+PLIST_SUB+=	STATEDIR=${STATEDIR}
+
 MAN5=		ups.conf.5 upsd.conf.5 upsd.users.5 upsmon.conf.5 \
 		upssched.conf.5
 MAN8=		apcsmart.8 bcmxcp.8 belkin.8 belkinunv.8 bestuferrups.8 \
 		bestups.8 bestfcom.8 cpsups.8 cyberpower.8 etapro.8 everups.8 \
-		fentonups.8 genericups.8 ippon.8 isbmex.8 liebert.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 \
-		solis.8 tripplite.8 tripplitesu.8 upsc.8 upscmd.8 upscode2.8 \
-		upsd.8 upsdrvctl.8 upslog.8 upsmon.8 upsrw.8 upssched.8 \
-		victronups.8
+		fentonups.8 gamatronic.8 genericups.8 ippon.8 isbmex.8 \
+		liebert.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 solis.8 tripplite.8 tripplitesu.8 upsc.8 upscmd.8 \
+		upscode2.8 upsd.8 upsdrvctl.8 upslog.8 upsmon.8 upsrw.8 \
+		upssched.8 victronups.8
 
 ALL_TARGET=	all
 INSTALL_TARGET=	install install-conf
@@ -80,7 +86,7 @@
 ALL_TARGET=	usb
 INSTALL_TARGET=	install-usb
 
-MAN8=		newhidups.8
+MAN8=		bcmxcp_usb.8 newhidups.8 tripplite_usb.8
 .endif
 
 .if ${SUBSYS} == snmp
@@ -112,18 +118,12 @@
 .endif
 	@${MKDIR} ${PREFIX}/libexec/nut
 	@${MKDIR} ${STATEDIR}
-	@${CHOWN} uucp:wheel ${STATEDIR}
+	@${CHOWN} ${NUT_USER}:wheel ${STATEDIR}
 	@${CHMOD} 0750 ${STATEDIR}
 
-post-install:
-	@${SED} -e "s#%%PREFIX%%#${PREFIX}#g" \
-		-e "s#%%RC_SUBR%%#${RC_SUBR}#g" \
-		-e "s#%%STATEDIR%%#${STATEDIR}#g" \
-		<${FILESDIR}/nut.sh.sample >${WRKSRC}/nut.sh
-	${INSTALL_SCRIPT} ${WRKSRC}/nut.sh ${PREFIX}/etc/rc.d/nut.sh
 .if !defined(NOPORTDOCS)
+post-install:
 	@${MKDIR} ${DOCSDIR}/cables
-	@${MKDIR} ${DOCSDIR}/drivers
 	${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${DOCSDIR}/cables
 	${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/docs/FAQ ${DOCSDIR}
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/sysutils/nut/distinfo,v
retrieving revision 1.18
diff -u -r1.18 distinfo
--- distinfo	24 Jan 2006 01:06:21 -0000	1.18
+++ distinfo	27 Mar 2006 22:33:37 -0000
@@ -1,6 +1,6 @@
-MD5 (nut-2.0.2.tar.gz) = 6560df8d0a42f0f585d34ed1ae8c6f67
-SHA256 (nut-2.0.2.tar.gz) = 0d79137da31bea3a042c0300ebada73fe46a7f1b4051e75c9b4acc94b2719c51
-SIZE (nut-2.0.2.tar.gz) = 609977
-MD5 (nut-2.0.2.tar.gz.sig) = 65bfaa136df1b0a1b73f983f51d706b3
-SHA256 (nut-2.0.2.tar.gz.sig) = 4fd823488011fc924039ddbbe0112af2a961a4e019b78219d22386e5d217ff29
-SIZE (nut-2.0.2.tar.gz.sig) = 65
+MD5 (nut-2.0.3.tar.gz) = ed2d3104d021a6ddb864f23d8cbd1cf6
+SHA256 (nut-2.0.3.tar.gz) = e4ded1fd1f119a71ee500d043bfa08d912d84793738d81b2bd08871e34ed8f95
+SIZE (nut-2.0.3.tar.gz) = 656376
+MD5 (nut-2.0.3.tar.gz.sig) = fa059f3c1310b80f36ba80f13e417bc2
+SHA256 (nut-2.0.3.tar.gz.sig) = 3677a547953abb04200ddf912bf07e9b06f81135a02edda5d31a5325f7c23a89
+SIZE (nut-2.0.3.tar.gz.sig) = 65
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/sysutils/nut/pkg-plist,v
retrieving revision 1.19
diff -u -r1.19 pkg-plist
--- pkg-plist	22 Jan 2006 02:52:14 -0000	1.19
+++ pkg-plist	27 Mar 2006 22:33:37 -0000
@@ -1,4 +1,9 @@
+@unexec %D/etc/rc.d/nut_upslog.sh forcestop 2>/dev/null || true
+@unexec %D/etc/rc.d/nut_upsmon.sh forcestop 2>/dev/null || true
 @unexec %D/etc/rc.d/nut.sh forcestop 2>/dev/null || true
+@unexec %D/etc/rc.d/nut_upslog forcestop 2>/dev/null || true
+@unexec %D/etc/rc.d/nut_upsmon forcestop 2>/dev/null || true
+@unexec %D/etc/rc.d/nut forcestop 2>/dev/null || true
 bin/upsc
 bin/upscmd
 bin/upslog
@@ -10,8 +15,6 @@
 etc/nut/upsd.users.sample
 etc/nut/upsmon.conf.sample
 etc/nut/upssched.conf.sample
-@dirrmtry etc/nut
-etc/rc.d/nut.sh
 libexec/nut/apcsmart
 libexec/nut/bcmxcp
 libexec/nut/belkin
@@ -26,6 +29,7 @@
 libexec/nut/etapro
 libexec/nut/everups
 libexec/nut/fentonups
+libexec/nut/gamatronic
 libexec/nut/genericups
 libexec/nut/ippon
 libexec/nut/isbmex
@@ -84,6 +88,7 @@
 %%PORTDOCS%%%%DOCSDIR%%/design.txt
 %%PORTDOCS%%%%DOCSDIR%%/developers.txt
 %%PORTDOCS%%%%DOCSDIR%%/ideas.txt
+%%PORTDOCS%%%%DOCSDIR%%/hid-subdrivers.txt
 %%PORTDOCS%%%%DOCSDIR%%/new-drivers.txt
 %%PORTDOCS%%%%DOCSDIR%%/new-names.txt
 %%PORTDOCS%%%%DOCSDIR%%/osd-notify.txt
@@ -96,8 +101,8 @@
 %%PORTDOCS%%%%DOCSDIR%%/ssl.txt
 %%PORTDOCS%%%%DOCSDIR%%/upssched.txt
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/cables
-%%PORTDOCS%%@dirrm %%DOCSDIR%%/drivers
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
+@dirrmtry etc/nut
 @dirrmtry libexec/nut
-@unexec rmdir /var/db/nut 2>/dev/null || true
+@dirrmtry %%STATEDIR%%
 %%CGIDIRRM%%
Index: files/nut.sh.in
===================================================================
RCS file: files/nut.sh.in
diff -N files/nut.sh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/nut.sh.in	27 Mar 2006 22:33:37 -0000
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/sysutils/nut/files/nut.sh.sample,v 1.5 2005/07/14 08:21:12 sem Exp $
+#
+
+# PROVIDE: nut
+# REQUIRE: NETWORKING
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# 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%%"}
+
+. %%RC_SUBR%%
+
+name="nut"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+required_dirs="%%STATEDIR%%"
+required_files="${nut_prefix}/etc/nut/ups.conf ${nut_prefix}/etc/nut/upsd.conf ${nut_prefix}/etc/nut/upsd.users"
+command="${nut_prefix}/sbin/upsd"
+pidfile="%%STATEDIR%%/upsd.pid"
+
+start_precmd="nut_prestart"
+stop_postcmd="nut_poststop"
+
+nut_prestart() {
+	${nut_prefix}/libexec/nut/upsdrvctl start
+}
+
+nut_poststop() {
+	${nut_prefix}/libexec/nut/upsdrvctl stop
+}
+
+run_rc_command "$1"
Index: files/nut.sh.sample
===================================================================
RCS file: files/nut.sh.sample
diff -N files/nut.sh.sample
--- files/nut.sh.sample	14 Jul 2005 08:21:12 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/sysutils/nut/files/nut.sh.sample,v 1.5 2005/07/14 08:21:12 sem Exp $
-#
-
-# PROVIDE: nut
-# REQUIRE: NETWORKING
-# BEFORE: LOGIN
-# KEYWORD: shutdown
-
-# 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-"%%STATEDIR%%/nut.pid"}
-nut_upslog=${nut_upslog-"/var/log/ups.log"}
-nut_upsloginterval=${nut_upsloginterval-"300"}
-nut_upslogmail=${nut_upslogmail-"backups@localhost"}
-
-. %%RC_SUBR%%
-
-name="nut"
-rcvar=`set_rcvar`
-
-required_dirs="%%STATEDIR%%"
-required_files="${nut_prefix}/etc/nut/ups.conf ${nut_prefix}/etc/nut/upsd.conf ${nut_prefix}/etc/nut/upsd.users ${nut_prefix}/etc/nut/upsmon.conf"
-
-start_postcmd="nut_start"
-stop_cmd="nut_stop"
-
-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}
-}
-
-nut_stop() {
-	/usr/bin/killall upslog upsmon upsd
-	${nut_prefix}/libexec/nut/upsdrvctl stop
-}
-
-load_rc_config $name
-run_rc_command "$1"
Index: files/nut_upslog.sh.in
===================================================================
RCS file: files/nut_upslog.sh.in
diff -N files/nut_upslog.sh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/nut_upslog.sh.in	27 Mar 2006 22:33:37 -0000
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: nut_upslog
+# REQUIRE: NETWORKING nut
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Define these nut_upslog* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#       /etc/rc.conf.d/nut_upslog
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+nut_upslog_enable=${nut_upslog_enable-"NO"}
+nut_upslog_prefix=${nut_upslog_prefix-"%%PREFIX%%"}
+nut_upslog_logfile=${nut_upslog_logfile-"/var/log/ups.log"}
+nut_upslog_interval=${nut_upslog_interval-"300"}
+nut_upslog_ups=${nut_upslog_ups-"myups@localhost"}
+
+. %%RC_SUBR%%
+
+name="nut_upslog"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+required_dirs="%%STATEDIR%%"
+command="${nut_upslog_prefix}/bin/upslog"
+pidfile="%%STATEDIR%%/upslog.pid"
+nut_upslog_flags=${nut_upslog_flags-"-s ${nut_upslog_ups} -l ${nut_upslog_logfile} -i ${nut_upslog_interval}"}
+
+run_rc_command "$1"
Index: files/nut_upsmon.sh.in
===================================================================
RCS file: files/nut_upsmon.sh.in
diff -N files/nut_upsmon.sh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/nut_upsmon.sh.in	27 Mar 2006 22:33:37 -0000
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: nut_upsmon
+# REQUIRE: NETWORKING nut
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Define these nut_upsmon* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#       /etc/rc.conf.d/nut_upsmon
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+nut_upsmon_enable=${nut_upsmon_enable-"NO"}
+nut_upsmon_prefix=${nut_upsmon_prefix-"%%PREFIX%%"}
+
+. %%RC_SUBR%%
+
+name="nut_upsmon"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+required_dirs="%%STATEDIR%%"
+required_files="${nut_upsmon_prefix}/etc/nut/upsmon.conf"
+command="${nut_upsmon_prefix}/sbin/upsmon"
+pidfile="%%STATEDIR%%/upsmon.pid"
+nut_upsmon_flags=${nut_upsmon_flags-"localhost"}
+
+run_rc_command "$1"
Index: files/patch-Makefile.in
===================================================================
RCS file: /home/ncvs/ports/sysutils/nut/files/patch-Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 patch-Makefile.in
--- files/patch-Makefile.in	14 Jul 2005 08:21:12 -0000	1.1
+++ files/patch-Makefile.in	27 Mar 2006 22:33:37 -0000
@@ -1,5 +1,5 @@
---- Makefile.in.orig	Thu Jan 27 15:33:15 2005
-+++ Makefile.in	Fri Jul  8 21:45:32 2005
+--- Makefile.in.orig	Mon Oct 10 04:12:51 2005
++++ Makefile.in	Thu Feb 23 19:44:12 2006
 @@ -90,6 +90,12 @@
  install-cgi-conf:
  	@cd conf; $(MAKE) install-cgi-conf; cd ..;
@@ -13,19 +13,15 @@
  install-lib:
  	@cd clients; $(MAKE) install-lib; cd ..;
  	@cd man; $(MAKE) install-lib-man; cd ..;
-@@ -98,9 +104,8 @@
+@@ -98,6 +104,7 @@
  usb: build-usb
  
  build-usb:
--	@cd drivers; $(MAKE) hidups; cd ..;
--	@cd drivers; $(MAKE) newhidups; cd ..;
--	@cd drivers; $(MAKE) energizerups; cd ..;
 +	@cd common ; $(MAKE) || exit 1; cd ..;
-+	@cd drivers; $(MAKE) newhidups || exit 1; cd ..;
+ 	@cd drivers; $(MAKE) build-usb; cd ..;
  
  install-usb:
- 	@cd drivers; $(MAKE) install-usb; cd ..;
-@@ -109,7 +114,8 @@
+@@ -107,7 +114,8 @@
  snmp: build-snmp
  
  build-snmp:
Index: files/patch-drivers_Makefile.in
===================================================================
RCS file: files/patch-drivers_Makefile.in
diff -N files/patch-drivers_Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-drivers_Makefile.in	27 Mar 2006 22:33:37 -0000
@@ -0,0 +1,11 @@
+--- drivers/Makefile.in.orig	Thu Feb 23 19:38:14 2006
++++ drivers/Makefile.in	Thu Feb 23 19:38:43 2006
+@@ -8,7 +8,7 @@
+ 
+ # other definitions
+ CC	= @CC@
+-CFLAGS	= -I../include @CFLAGS@
++CFLAGS	= -I../include @CFLAGS@ @LIBUSB_CFLAGS@
+ PROGS	= bestups fentonups apcsmart everups belkin masterguard powercom \
+ 	  cyberpower tripplite victronups genericups mge-utalk bestuferrups \
+ 	  isbmex etapro liebert sms esupssmart tripplitesu blazer safenet \
--- sysutils_nut.diff ends here ---

--- sysutils_nut-usb.diff begins here ---
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/sysutils/nut-usb/pkg-plist,v
retrieving revision 1.1
diff -u -r1.1 pkg-plist
--- pkg-plist	14 Jul 2005 08:40:25 -0000	1.1
+++ pkg-plist	27 Mar 2006 22:34:24 -0000
@@ -1 +1,3 @@
+libexec/nut/bcmxcp_usb
 libexec/nut/newhidups
+libexec/nut/tripplite_usb
--- sysutils_nut-usb.diff ends here ---

--- UPDATING.diff begins here ---
Index: UPDATING
===================================================================
RCS file: /home/ncvs/ports/UPDATING,v
retrieving revision 1.300
diff -u -r1.300 UPDATING
--- UPDATING	22 Mar 2006 20:32:24 -0000	1.300
+++ UPDATING	27 Mar 2006 22:52:09 -0000
@@ -6,6 +6,19 @@
 time you update your ports collection, before attempting any port
 upgrades.
 
+20060328:
+  AFFECTS: users of sysutils/nut
+  AUTHOR: Joerg.Pulz@frm2.tum.de
+
+  Beginning with nut-2.0.3 the nut rcNG script only starts the ups driver and
+  the ups daemon 'upsd'.
+
+  The ups monitor 'upsmon' and the ups logger 'upslog' are now handled by
+  seperate scripts to get more control over the different services.
+  Please take a look into the nut, nut_upslog and nut_upsmon scripts
+  installed in ${PREFIX}/etc/rc.d/ for possible rc.conf values and their
+  defaults.
+
 20060322:
   AFFECTS: users of security/dazuko
   AUTHOR: ehaupt@FreeBSD.org
--- UPDATING.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603272330.k2RNUu6G084679>