ports/92466: Port sysutils/apcupsd - upgrade and many fixes
Ion-Mihai Tetcu
itetcu at people.tecnik93.com
Tue Mar 28 12:40:31 UTC 2006
The following reply was made to PR ports/92466; it has been noted by GNATS.
From: Ion-Mihai Tetcu <itetcu at people.tecnik93.com>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit at FreeBSD.org>
Cc: "Alex Samorukov" <samm at os2.kiev.ua>, Marcus Alves Grando
<mnag at FreeBSD.org>, Eugene Grosbein <eugen at grosbein.pp.ru>, Robert Huff
<roberthuff at rcn.com>, Nosov Artem <chip at planetatelecom.ru>, "L V"
<pleader at hotmail.com>
Subject: Re: ports/92466: Port sysutils/apcupsd - upgrade and many fixes
Date: Tue, 28 Mar 2006 15:39:41 +0300
--MP_viS.RK_GXxF/=qZsjpWbORC
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
[ some interested parties cc'ed, feedback welcomed ]
Attached patch updates the port and it's OK, according to my amd64
tinderbox and local tests.
Log:
- Update to 3.12.2
- Replace files/apcupsd.sh.sample with files/apcupsd.in and use RC_SUBR
with it
- Fix man path (--manndir)
- add -lmenu -lcurses to LIBS (something it's broken here because we're
linking all binaries with this libs but the upstream documented way
doesn't work; I'll investigate this further as time permits).
- since distributed documentation doesn't build add manual.pdf to the
DISTFILES and install it as the the only PORTDOCS. I'll probably let it
be this way (else the port will have to depend on *tex, etc. which I'd
like to avoid) - patches for making this optional are welcomed.
Still to do:
- import some USB patches from upstream CVS.
Apologies for being late with this update, I hope it will not happen in
the future.
PR: ports/92466 by "Alex Samorukov" <samm at os2.kiev.ua> (based on)
--
IOnut - Unregistered ;) FreeBSD "user"
"Intellectual Property" is nowhere near as valuable as "Intellect"
Ferengi Rule of Acquisition #10:
Greed is eternal.
-- ST:DS9, Prophet Motive
--MP_viS.RK_GXxF/=qZsjpWbORC
Content-Type: text/x-patch; name=apcupsd.diff
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=apcupsd.diff
? apcupsd.diff
Index: Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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=F6ller <Lars.Koeller at 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 kur=
iyama Exp $
#
-# $Tecnik: ports/sysutils/apcupsd/Makefile,v 1.2 2006/01/26 00:35:21 itetc=
u Exp $
+# $Tecnik: ports/sysutils/apcupsd/Makefile,v 1.4 2006/03/28 11:47:37 itetc=
u Exp $
=20
PORTNAME=3D apcupsd
-PORTVERSION=3D 3.10.18
-PORTREVISION=3D 1
+PORTVERSION=3D 3.12.2
CATEGORIES=3D sysutils
-MASTER_SITES=3D ${MASTER_SITE_SOURCEFORGE}
-MASTER_SITE_SUBDIR=3D ${PORTNAME}
+MASTER_SITES=3D ${MASTER_SITE_SOURCEFORGE}:src \
+ http://apcupsd.sourceforge.net/manual/:doc
+MASTER_SITE_SUBDIR=3D ${PORTNAME}:src \
+# /manual/:doc
+DISTFILES=3D ${DISTNAME}${EXTRACT_SUFX}:src \
+ ${PORTNAME}.pdf:doc
+EXTRACT_ONLY=3D ${DISTNAME}${EXTRACT_SUFX}
=20
MAINTAINER=3D itetcu at people.tecnik93.com
COMMENT=3D A daemon for controlling APC UPS
=20
USE_GETTEXT=3D yes
-
-STARTUP_SCRIPT=3D apcupsd.sh.sample
-PLIST_SUB=3D STARTUP_SCRIPT=3D${STARTUP_SCRIPT}
+USE_RC_SUBR=3D apcupsd
=20
HAS_CONFIGURE=3D yes
CONFIGURE_ARGS=3D --prefix=3D${PREFIX} --sbindir=3D${PREFIX}/sbin \
+ --mandir=3D${MANPREFIX}/man \
--with-nologin=3D/var/run \
--disable-install-distdir \
--sysconfdir=3D${PREFIX}/etc/apcupsd \
@@ -30,9 +33,11 @@
=20
OPTIONS=3D CLIENT_ONLY "Build apcupsd client only (no network server)" off
OPTIONS+=3D CGI "Compile with CGI programms to show status" off
-OPTIONS+=3D USB "Compile with USB Support (READ MANUAL!!!)" off
-OPTIONS+=3D SNMP "Compile with SNMP Support (READ MANUAL!!!)" off
-OPTIONS+=3D NOPTHREADS "Compile without pthreads support (READ MANUAL!!!)"=
off
+OPTIONS+=3D USB "Compile with USB Support (READ MANUAL!)" off
+OPTIONS+=3D SNMP "Compile with SNMP Support (READ MANUAL!)" off
+OPTIONS+=3D NOPTHREADS "Compile without pthreads support (READ MANUAL!)" o=
ff
+
+PORTDOCS=3D ${PORTNAME}.pdf
=20
.include <bsd.port.pre.mk>
=20
@@ -69,7 +74,9 @@
=20
# Cause FreeBSD 3.X misses libmenu, libforms and libpanel (curses)
.if ${OSVERSION} > 400000
-CONFIGURE_ARGS+=3D--enable-powerflute --with-libwrap=3Dyes
+CONFIGURE_ARGS+=3D --enable-powerflute --with-libwrap=3Dyes
+#CONFIGURE_ENV+=3D POWERLIBS=3D"-lcurses -lmenu"
+CONFIGURE_ENV+=3D LIBS=3D"-lcurses -lmenu"
PLIST_SUB+=3D POWERFL=3D""
.else
PLIST_SUB+=3D POWERFL=3D"@comment "
@@ -77,8 +84,6 @@
=20
MAN8=3D "apcupsd.8"
=20
-PORTDOCS=3D 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/${STAR=
TUP_SCRIPT}
${INSTALL_DATA} ${FILESDIR}/apcupsd.conf.net-master.sample ${PREFIX}/etc/=
apcupsd/
${INSTALL_DATA} ${FILESDIR}/apcupsd.conf.net-slave.sample ${PREFIX}/etc/a=
pcupsd/
# If there is already a config file it is installed as ...new
@@ -128,9 +132,10 @@
=20
.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
=20
.include <bsd.port.post.mk>
Index: distinfo
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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) =3D 64104a1fface0253e77318ca84948bac
-SHA256 (apcupsd-3.10.18.tar.gz) =3D ae42d64e5cb29c8ce291f634139b5c81e888c9=
5686f5c70ac9c250a1d8c02a38
-SIZE (apcupsd-3.10.18.tar.gz) =3D 5698299
+MD5 (apcupsd-3.12.2.tar.gz) =3D f771fafbc06551e7820bd3d277b5cce3
+SHA256 (apcupsd-3.12.2.tar.gz) =3D 755cd2bffc4090c58979a87ed3f9135afd18461=
53feb8a39fad95f745adbd347
+SIZE (apcupsd-3.12.2.tar.gz) =3D 4219660
+MD5 (apcupsd.pdf) =3D 6cc2c59e54abc35854758e43f8fd13a4
+SHA256 (apcupsd.pdf) =3D 7d5664233350757709adfbf09cfd4f2434028c8af14c8f48c=
4255d41adfda0ca
+SIZE (apcupsd.pdf) =3D 1095048
Index: pkg-message
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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
=20
${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:
=20
- For serial cable: DEVICE /dev/ups (or /dev/cuaaX)
+ For serial cable: DEVICE /dev/cuaadX (or /dev/cuaaX for [45.]x)=20
For USB cable: DEVICE (yes, leave it blank after DEVICE)
=20
NOTE that for USB cable you must comment out the line
@@ -29,5 +21,12 @@
Your keyboard and mouse will still work.
=20
WARNING USB support on FreeBSD is still considered BETA!
+
+Add apcupsd_enable=3DYES 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)
=20
**********************************************************************
Index: pkg-plist
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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/ho=
st.conf; then rm -f %D/etc/apcupsd/host.conf; fi
+%%CGI%%@unexec if cmp -s %D/etc/apcupsd/hosts.conf.sample %D/etc/apcupsd/h=
osts.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/apcups=
d/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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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=3D"apcupsd"
+rcvar=3D`set_rcvar`
+
+load_rc_config $name
+
+: ${apcupsd_enable=3D"NO"}
+#: ${apcupsd_args=3D""}
+
+pidfile=3D"/var/run/apcupsd.pid"
+command=3D"%%PREFIX%%/sbin/apcupsd"
+#command_args=3D"${apcupsd_args}"
+
+required_files=3D"%%PREFIX%%/etc/${name}/apcupsd.conf"
+#required_dirs
+apcupsd_flags=3D${apcupsd_flags:-"--kill-on-powerfail"}
+apcupsd_pidfile=3D${apcupsd_pidfile:-/var/run/apcupsd.pid}
+apcupsd_lockfile=3D${apcupsd_lockfile:-/var/spool/lock/apcupsd.lock}
+
+
+run_rc_command "$1"
Index: files/apcupsd.sh.sample
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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/2=
7 14:24:29 vd Exp $
-# startup scripts for APCUPSD.
-
-if ! PREFIX=3D$(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=3D${apcupsd_enable:-YES}
-apcupsd_program=3D${apcupsd_program:-${PREFIX}/sbin/apcupsd}
-apcupsd_flags=3D${apcupsd_flags:-"--kill-on-powerfail"}
-apcupsd_pidfile=3D${apcupsd_pidfile:-/var/run/apcupsd.pid}
-apcupsd_lockfile=3D${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=3D" Failed."
- touch ${apcupsd_lockfile}
- fi
- ;;
- esac
- ;;
-
- stop)
- if [ -f ${apcupsd_pidfile} ]; then
- PID=3D`cat ${apcupsd_pidfile}`
- kill -KILL $PID || return=3D" Failed."
- rm -f ${apcupsd_pidfile}
- # some slaves won't die
- killall apcupsd > /dev/null 2>&1
- echo " apcupsd killed"
- else
- return=3D" Failed."
- fi
- ;;
-
- restart)
- $0 stop
- $0 start;
- ;;
-
- status)
- ${PREFIX}/sbin/apcaccess status
- ;;
-
- *)
- echo "usage: $0 {start|stop|restart|status}" 1>&2
- ;;
-esac
-
-exit 0;
--MP_viS.RK_GXxF/=qZsjpWbORC--
More information about the freebsd-ports-bugs
mailing list