? apcupsd.diff
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/apcupsd/Makefile,v
retrieving revision 1.43
diff -u -r1.43 Makefile
--- Makefile	28 Jan 2006 15:54:02 -0000	1.43
+++ Makefile	28 Mar 2006 12:32:08 -0000
@@ -2,27 +2,30 @@
 # Date created:		1.12.2001
 # Whom:			Lars Köller <Lars.Koeller@Uni-Bielefeld.DE>
 #
-# $FreeBSD: ports/sysutils/apcupsd/Makefile,v 1.43 2006/01/28 15:54:02 pav Exp $
+# $FreeBSD: ports/sysutils/apcupsd/Makefile,v 1.42 2005/11/30 05:23:09 kuriyama Exp $
 #
-# $Tecnik: ports/sysutils/apcupsd/Makefile,v 1.2 2006/01/26 00:35:21 itetcu Exp $
+# $Tecnik: ports/sysutils/apcupsd/Makefile,v 1.4 2006/03/28 11:47:37 itetcu Exp $
 
 PORTNAME=	apcupsd
-PORTVERSION=	3.10.18
-PORTREVISION=	1
+PORTVERSION=	3.12.2
 CATEGORIES=	sysutils
-MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
-MASTER_SITE_SUBDIR=	${PORTNAME}
+MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}:src \
+		http://apcupsd.sourceforge.net/manual/:doc
+MASTER_SITE_SUBDIR=	${PORTNAME}:src \
+#		/manual/:doc
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:src \
+		${PORTNAME}.pdf:doc
+EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
 
 MAINTAINER=	itetcu@people.tecnik93.com
 COMMENT=	A daemon for controlling APC UPS
 
 USE_GETTEXT=	yes
-
-STARTUP_SCRIPT=	apcupsd.sh.sample
-PLIST_SUB=	STARTUP_SCRIPT=${STARTUP_SCRIPT}
+USE_RC_SUBR=	apcupsd
 
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	--prefix=${PREFIX} --sbindir=${PREFIX}/sbin \
+		--mandir=${MANPREFIX}/man \
 		--with-nologin=/var/run \
 		--disable-install-distdir \
 		--sysconfdir=${PREFIX}/etc/apcupsd \
@@ -30,9 +33,11 @@
 
 OPTIONS=	CLIENT_ONLY "Build apcupsd client only (no network server)" off
 OPTIONS+=	CGI "Compile with CGI programms to show status" off
-OPTIONS+=	USB "Compile with USB Support (READ MANUAL!!!)" off
-OPTIONS+=	SNMP "Compile with SNMP Support (READ MANUAL!!!)" off
-OPTIONS+=	NOPTHREADS "Compile without pthreads support (READ MANUAL!!!)" off
+OPTIONS+=	USB "Compile with USB Support (READ MANUAL!)" off
+OPTIONS+=	SNMP "Compile with SNMP Support (READ MANUAL!)" off
+OPTIONS+=	NOPTHREADS "Compile without pthreads support (READ MANUAL!)" off
+
+PORTDOCS=	${PORTNAME}.pdf
 
 .include <bsd.port.pre.mk>
 
@@ -69,7 +74,9 @@
 
 # Cause FreeBSD 3.X misses libmenu, libforms and libpanel (curses)
 .if ${OSVERSION} > 400000
-CONFIGURE_ARGS+=--enable-powerflute --with-libwrap=yes
+CONFIGURE_ARGS+=	--enable-powerflute --with-libwrap=yes
+#CONFIGURE_ENV+=	POWERLIBS="-lcurses -lmenu"
+CONFIGURE_ENV+=		LIBS="-lcurses -lmenu"
 PLIST_SUB+=	POWERFL=""
 .else
 PLIST_SUB+=	POWERFL="@comment "
@@ -77,8 +84,6 @@
 
 MAN8=		"apcupsd.8"
 
-PORTDOCS=	manual.pdf
-
 pre-everything::
 	@${ECHO_MSG} ""
 	@${ECHO_MSG} "You may use the following build options:"
@@ -112,7 +117,6 @@
 	done
 	${ECHO_CMD} "@unexec if [ -d %D/etc/apcupsd ]; then ${ECHO_CMD} \"If you are permanently removing this port, you should do a ``rm -rf ${PREFIX}/etc/apcupsd`` to remove config files left.\" | ${FMT} ; fi" >> ${TMPPLIST}
 # 	Install sample startup script
-	${INSTALL_SCRIPT} ${FILESDIR}/${STARTUP_SCRIPT} ${PREFIX}/etc/rc.d/${STARTUP_SCRIPT}
 	${INSTALL_DATA} ${FILESDIR}/apcupsd.conf.net-master.sample ${PREFIX}/etc/apcupsd/
 	${INSTALL_DATA} ${FILESDIR}/apcupsd.conf.net-slave.sample ${PREFIX}/etc/apcupsd/
 # 	If there is already a config file it is installed as ...new
@@ -128,9 +132,10 @@
 
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
-.for filen in ${PORTDOCS}
-	${INSTALL_DATA} ${WRKSRC}/doc/texi/${filen} ${DOCSDIR}
-.endfor
+	cd ${DISTDIR} && ${INSTALL_DATA} ${PORTNAME}.pdf ${DOCSDIR}
+#.for filen in ${PORTDOCS}
+#	${INSTALL_DATA} ${WRKSRC}/doc/texi/${filen} ${DOCSDIR}
+#.endfor
 .endif
 
 .include <bsd.port.post.mk>
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/sysutils/apcupsd/distinfo,v
retrieving revision 1.14
diff -u -r1.14 distinfo
--- distinfo	25 Nov 2005 18:14:34 -0000	1.14
+++ distinfo	28 Mar 2006 12:32:08 -0000
@@ -1,3 +1,6 @@
-MD5 (apcupsd-3.10.18.tar.gz) = 64104a1fface0253e77318ca84948bac
-SHA256 (apcupsd-3.10.18.tar.gz) = ae42d64e5cb29c8ce291f634139b5c81e888c95686f5c70ac9c250a1d8c02a38
-SIZE (apcupsd-3.10.18.tar.gz) = 5698299
+MD5 (apcupsd-3.12.2.tar.gz) = f771fafbc06551e7820bd3d277b5cce3
+SHA256 (apcupsd-3.12.2.tar.gz) = 755cd2bffc4090c58979a87ed3f9135afd1846153feb8a39fad95f745adbd347
+SIZE (apcupsd-3.12.2.tar.gz) = 4219660
+MD5 (apcupsd.pdf) = 6cc2c59e54abc35854758e43f8fd13a4
+SHA256 (apcupsd.pdf) = 7d5664233350757709adfbf09cfd4f2434028c8af14c8f48c4255d41adfda0ca
+SIZE (apcupsd.pdf) = 1095048
Index: pkg-message
===================================================================
RCS file: /home/ncvs/ports/sysutils/apcupsd/pkg-message,v
retrieving revision 1.5
diff -u -r1.5 pkg-message
--- pkg-message	15 Apr 2005 17:24:04 -0000	1.5
+++ pkg-message	28 Mar 2006 12:32:08 -0000
@@ -1,12 +1,4 @@
 **********************************************************************
-NOTE IF you install a apcupsd server:
-
-Change to /dev and create a softlink to e.g. ups from the serial line
-the USV is connected to, e.g.
-
-  cd /dev
-  ln -s cuaa1 ups
-
 Read the manual
 
   ${PREFIX}/share/doc/apcupsd/manual.pdf
@@ -18,7 +10,7 @@
 must be copied and/or configured for a proper working apcupsd.
 You need to modify ${PREFIX}/etc/apcupsd/apcupsd.conf as follows:
 
-  For serial cable: DEVICE /dev/ups (or /dev/cuaaX)
+  For serial cable: DEVICE /dev/cuaadX (or /dev/cuaaX for [45.]x) 
   For USB cable: DEVICE (yes, leave it blank after DEVICE)
 
 NOTE that for USB cable you must comment out the line
@@ -29,5 +21,12 @@
 Your keyboard and mouse will still work.
 
 WARNING USB support on FreeBSD is still considered BETA!
+
+Add apcupsd_enable=YES to your /etc/rc.conf[.local] to have apcupsd
+starting up at boot time.
+
+Please check to see you don't have stale files in your etc/rc.d/
+you should have only the 'apcupsd' installed by this port version
+(or apcupsd.sh on 4.x and 5.x)
 
 **********************************************************************
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/sysutils/apcupsd/pkg-plist,v
retrieving revision 1.17
diff -u -r1.17 pkg-plist
--- pkg-plist	22 Jan 2006 06:28:50 -0000	1.17
+++ pkg-plist	28 Mar 2006 12:32:08 -0000
@@ -1,6 +1,5 @@
 sbin/apcupsd
 sbin/apcaccess
-sbin/apcnisd
 sbin/apctest
 sbin/smtp
 %%POWERFL%%sbin/powerflute
@@ -12,13 +11,13 @@
 etc/apcupsd/changeme
 etc/apcupsd/commfailure
 etc/apcupsd/commok
-etc/apcupsd/mainsback
 etc/apcupsd/masterconnect
 etc/apcupsd/mastertimeout
 etc/apcupsd/onbattery
+etc/apcupsd/offbattery
 %%CGI%%@unexec if cmp -s %D/etc/apcupsd/apcupsd.css.sample %D/etc/apcupsd/apcupsd.css; then rm -f %D/etc/apcupsd/apcupsd.css; fi
 %%CGI%%etc/apcupsd/apcupsd.css.sample
-%%CGI%%@unexec if cmp -s %D/etc/apcupsd/host.conf.sample %D/etc/apcupsd/host.conf; then rm -f %D/etc/apcupsd/host.conf; fi
+%%CGI%%@unexec if cmp -s %D/etc/apcupsd/hosts.conf.sample %D/etc/apcupsd/hosts.conf; then rm -f %D/etc/apcupsd/hosts.conf; fi
 %%CGI%%etc/apcupsd/hosts.conf.sample
 %%CGI%%@unexec if cmp -s %D/etc/apcupsd/multimon.conf.sample %D/etc/apcupsd/multimon.conf; then rm -f %D/etc/apcupsd/multimon.conf; fi
 %%CGI%%etc/apcupsd/multimon.conf.sample
@@ -26,6 +25,6 @@
 %%CGI%%etc/apcupsd/cgi/upsfstats.cgi
 %%CGI%%etc/apcupsd/cgi/upsimage.cgi
 %%CGI%%etc/apcupsd/cgi/upsstats.cgi
-etc/rc.d/%%STARTUP_SCRIPT%%
 %%CGI%%@dirrm etc/apcupsd/cgi
 @dirrmtry etc/apcupsd
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
Index: files/apcupsd.in
===================================================================
RCS file: files/apcupsd.in
diff -N files/apcupsd.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/apcupsd.in	28 Mar 2006 12:32:08 -0000
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+
+# Start or stop apcupsd
+
+# PROVIDE: apcupsd
+# REQUIRE: SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf[.local] to enable apcupsd
+# apcupsd_enable (bool):Set to "NO" by default.
+#			Set it to "YES" to enable apcupsd.
+# apcupsd_args (str):	Custom additional arguments to be passed
+#			to apcupsd (default empty).
+#
+
+. %%RC_SUBR%%
+
+name="apcupsd"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${apcupsd_enable="NO"}
+#: ${apcupsd_args=""}
+
+pidfile="/var/run/apcupsd.pid"
+command="%%PREFIX%%/sbin/apcupsd"
+#command_args="${apcupsd_args}"
+
+required_files="%%PREFIX%%/etc/${name}/apcupsd.conf"
+#required_dirs
+apcupsd_flags=${apcupsd_flags:-"--kill-on-powerfail"}
+apcupsd_pidfile=${apcupsd_pidfile:-/var/run/apcupsd.pid}
+apcupsd_lockfile=${apcupsd_lockfile:-/var/spool/lock/apcupsd.lock}
+
+
+run_rc_command "$1"
Index: files/apcupsd.sh.sample
===================================================================
RCS file: files/apcupsd.sh.sample
diff -N files/apcupsd.sh.sample
--- files/apcupsd.sh.sample	27 Feb 2006 14:24:29 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,66 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/sysutils/apcupsd/files/apcupsd.sh.sample,v 1.4 2006/02/27 14:24:29 vd Exp $
-# startup scripts for APCUPSD.
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
-	echo "$0: Cannot determine the PREFIX" >&2
-	exit 1
-fi
-
-# If there is a global system configuration file, suck it in.
-if [ -r /etc/defaults/rc.conf ]; then
-	. /etc/defaults/rc.conf
-	source_rc_confs
-elif [ -r /etc/rc.conf ]; then
-	. /etc/rc.conf
-fi
-
-apcupsd_enable=${apcupsd_enable:-YES}
-apcupsd_program=${apcupsd_program:-${PREFIX}/sbin/apcupsd}
-apcupsd_flags=${apcupsd_flags:-"--kill-on-powerfail"}
-apcupsd_pidfile=${apcupsd_pidfile:-/var/run/apcupsd.pid}
-apcupsd_lockfile=${apcupsd_lockfile:-/var/spool/lock/apcupsd.lock}
-
-case $1 in
-    start)
-	case "${apcupsd_enable}" in
-	    [Yy][Ee][Ss])
-		rm -f /var/run/powerfail
-		rm -f /var/run/nologin
-		if [ -f ${apcupsd_program} ]; then
-		    echo -n " apcupsd"
-		    ${apcupsd_program} ${apcupsd_flags} || return="  Failed."
-		    touch ${apcupsd_lockfile}
-		fi
-		;;
-	esac
-	;;
-
-    stop)
-	if [ -f ${apcupsd_pidfile} ]; then
-	    PID=`cat ${apcupsd_pidfile}`
-	    kill -KILL $PID || return="  Failed."
-	    rm -f ${apcupsd_pidfile}
-	    # some slaves won't die
-	    killall apcupsd > /dev/null 2>&1
-	    echo " apcupsd killed"
-	else
-	    return="  Failed."
-	fi
-	;;
-
-    restart)
-	$0 stop
-	$0 start;
-	;;
-
-    status)
-	${PREFIX}/sbin/apcaccess status
-	;;
-
-    *)
-	echo "usage: $0 {start|stop|restart|status}" 1>&2
-	;;
-esac
-
-exit 0;