View | Details | Raw Unified | Return to bug 92466 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 92466