View | Details | Raw Unified | Return to bug 220002
Collapse All | Expand All

(-)./Makefile (-9 / +14 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	apcupsd
4
PORTNAME=	apcupsd
5
PORTVERSION=	3.14.14
5
PORTVERSION=	3.14.14
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}%20-%20Stable/${PORTVERSION}
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}%20-%20Stable/${PORTVERSION}
9
9
Lines 11-16 MAINTAINER= ports@FreeBSD.org Link Here
11
COMMENT=	Set of programs for controlling APC UPS
11
COMMENT=	Set of programs for controlling APC UPS
12
12
13
LICENSE=	GPLv2
13
LICENSE=	GPLv2
14
LICENSE_FILE=	${WRKSRC}/COPYING
14
15
15
USES=		gmake
16
USES=		gmake
16
GNU_CONFIGURE=	yes
17
GNU_CONFIGURE=	yes
Lines 28-36 SUB_FILES= pkg-message Link Here
28
29
29
OPTIONS_DEFINE=	APCSMART_DRV APCDUMB_DRV CLIENT_ONLY CGI PCNET_DRV USB_DRV \
30
OPTIONS_DEFINE=	APCSMART_DRV APCDUMB_DRV CLIENT_ONLY CGI PCNET_DRV USB_DRV \
30
		SNMP_DRV SNMP_DRV_OLD TCP_WRAPPERS TEST_DRV GAPCMON \
31
		SNMP_DRV SNMP_DRV_OLD TCP_WRAPPERS TEST_DRV GAPCMON \
31
		DOCS MODBUS
32
		DOCS MODBUS MODBUS_USB
32
OPTIONS_DEFAULT=	APCSMART_DRV APCDUMB_DRV PCNET_DRV SNMP_DRV USB_DRV \
33
OPTIONS_DEFAULT=	APCSMART_DRV APCDUMB_DRV PCNET_DRV SNMP_DRV USB_DRV \
33
		TCP_WRAPPERS MODBUS
34
		TCP_WRAPPERS MODBUS MODBUS_USB
34
OPTIONS_SUB=	yes
35
OPTIONS_SUB=	yes
35
36
36
APCSMART_DRV_DESC=	APC SmartUPS serial driver support
37
APCSMART_DRV_DESC=	APC SmartUPS serial driver support
Lines 45-52 TCP_WRAPPERS_DESC= ${LIBWRAP_DESC} Link Here
45
TEST_DRV_DESC=		Test driver support
46
TEST_DRV_DESC=		Test driver support
46
GAPCMON_DESC=		Build GTK GUI front-end
47
GAPCMON_DESC=		Build GTK GUI front-end
47
MODBUS_DESC=		MODBUS driver support
48
MODBUS_DESC=		MODBUS driver support
48
49
MODBUS_USB_DESC=	MODBUS USB driver support
49
#PORTDOCS=	${PORTNAME}.pdf
50
50
51
APCSMART_DRV_CONFIGURE_ENABLE=	apcsmart
51
APCSMART_DRV_CONFIGURE_ENABLE=	apcsmart
52
APCDUMB_DRV_CONFIGURE_ENABLE=	dumb
52
APCDUMB_DRV_CONFIGURE_ENABLE=	dumb
Lines 64-78 PCNET_DRV_CONFIGURE_ENABLE= pcnet Link Here
64
USB_DRV_CONFIGURE_ENABLE=	usb
64
USB_DRV_CONFIGURE_ENABLE=	usb
65
SNMP_DRV_CONFIGURE_ENABLE=	snmp
65
SNMP_DRV_CONFIGURE_ENABLE=	snmp
66
MODBUS_CONFIGURE_ENABLE=	modbus
66
MODBUS_CONFIGURE_ENABLE=	modbus
67
MODBUS_USB_CONFIGURE_ENABLE=	modbus-usb
67
SNMP_DRV_OLD_CONFIGURE_ENABLE=	net-snmp
68
SNMP_DRV_OLD_CONFIGURE_ENABLE=	net-snmp
68
SNMP_DRV_OLD_LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
69
SNMP_DRV_OLD_LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
69
TCP_WRAPPERS_CONFIGURE_WITH=	libwrap=yes
70
TCP_WRAPPERS_CONFIGURE_WITH=	libwrap=yes
70
TEST_DRV_CONFIGURE_ENABLE=	test
71
TEST_DRV_CONFIGURE_ENABLE=	test
71
72
72
#CONFIGURE_ARGS+=	--with-libwrap=yes
73
#CONFIGURE_ENV+=		LIBS="-lcurses -lmenu"
74
#PLIST_SUB+=		POWERFL=""
75
76
.include <bsd.port.options.mk>
73
.include <bsd.port.options.mk>
77
74
78
pre-configure:
75
pre-configure:
Lines 86-89 pre-configure: Link Here
86
	@${FALSE}
83
	@${FALSE}
87
.endif
84
.endif
88
85
86
pre-install:
87
	${MKDIR} ${STAGEDIR}/${ETCDIR}
88
	${CP} ${WRKSRC}/platforms/freebsd/apccontrol\
89
		${STAGEDIR}${ETCDIR}/apccontrol.sample
90
.for a in changeme commfailure commok offbattery onbattery
91
	${CP} ${WRKSRC}/platforms/etc/${a} ${STAGEDIR}${ETCDIR}/${a}.sample
92
.endfor
93
89
.include <bsd.port.mk>
94
.include <bsd.port.mk>
(-)./files/apcupsd.in (-9 / +58 lines)
Lines 11-34 Link Here
11
#
11
#
12
# apcupsd_enable (bool):	Set to "NO" by default.
12
# apcupsd_enable (bool):	Set to "NO" by default.
13
#				Set it to "YES" to enable apcupsd.
13
#				Set it to "YES" to enable apcupsd.
14
# apcupsd_args (str):		Custom additional arguments to be passed
14
# apcupsd_flags (str):		Custom additional arguments to be passed
15
#				to apcupsd (default empty).
15
#				to apcupsd (default --kill-on-powerfail).
16
# apcupsd_configs (str):	A list of configs to run multiple instances.
16
#
17
#
17
18
18
. /etc/rc.subr
19
. /etc/rc.subr
19
20
20
name="apcupsd"
21
name=apcupsd
21
rcvar=apcupsd_enable
22
rcvar=apcupsd_enable
22
23
23
load_rc_config $name
24
load_rc_config $name
24
25
25
: ${apcupsd_enable="NO"}
26
: ${apcupsd_enable="NO"}
26
: ${apcupsd_flags="--kill-on-powerfail"}
27
: ${apcupsd_flags="--kill-on-powerfail"}
27
: ${apcupsd_pidfile="/var/run/apcupsd.pid"}
28
: ${apcupsd_lockfile="/var/spool/lock/apcupsd.lock"}
29
28
30
pidfile="/var/run/apcupsd.pid"
29
pidfile=/var/run/${name}.pid
31
required_files="%%ETCDIR%%/apcupsd.conf"
30
required_files="${apcupsd_configs:-%%ETCDIR%%/apcupsd.conf}"
32
command="%%PREFIX%%/sbin/apcupsd"
31
command=%%PREFIX%%/sbin/${name}
32
restart_cmd=${name}_restart_cmd
33
33
34
run_rc_command "$1"
34
apcupsd_precmd()
35
{
36
	config=$1
37
38
	dn="`/usr/bin/dirname ${pidfile}`"
39
	if [ -n "${config}" ]; then
40
		# Specific config
41
		base="`/usr/bin/basename ${config} .conf`"
42
		pidfile="${dn}/${base}.pid"
43
		command_args="-f ${config} -P ${pidfile}"
44
	else
45
		# Default config
46
		command_args=""
47
	fi
48
}
49
50
apcupsd_restart_cmd()
51
{
52
	if [ -n "${apcupsd_configs}" ]; then
53
		# One or more named configs
54
		for config in ${apcupsd_configs}; do
55
			apcupsd_precmd ${config}
56
			run_rc_command stop
57
		done
58
		for config in ${apcupsd_configs}; do
59
			apcupsd_precmd ${config}
60
			run_rc_command start
61
		done
62
	else
63
		# Default config
64
		apcupsd_precmd
65
		run_rc_command stop
66
		run_rc_command start
67
	fi
68
}
69
70
if [ "$1" = restart ]; then
71
	apcupsd_precmd
72
	run_rc_command $1
73
elif [ -n "${apcupsd_configs}" ]; then
74
	# One or more named configs
75
	for config in ${apcupsd_configs}; do
76
		apcupsd_precmd ${config}
77
		run_rc_command $1
78
	done
79
else
80
	# Default config
81
	apcupsd_precmd
82
	run_rc_command $1
83
fi
(-)./files/pkg-message.in (-1 / +3 lines)
Lines 1-7 Link Here
1
**********************************************************************
1
**********************************************************************
2
Read the manual
2
Read the manual
3
3
4
  %%DOCSDIR%%/apcupsd.pdf
4
http://apcupsd.com/manual/
5
or
6
http://apcupsd.com/manual/apcupsd.pdf
5
7
6
to do site specific configuration assigenments! Especially have a
8
to do site specific configuration assigenments! Especially have a
7
detailed look into the chapter describing the shutdown procedure.
9
detailed look into the chapter describing the shutdown procedure.
(-)./pkg-descr (-1 / +1 lines)
Lines 4-7 It can monitor and log the current power Link Here
4
automatic shutdown, and can run in network mode in order to power down
4
automatic shutdown, and can run in network mode in order to power down
5
other hosts on a LAN
5
other hosts on a LAN
6
6
7
WWW: http://www.apcupsd.com
7
WWW: http://apcupsd.com
(-)./pkg-plist (-6 / +6 lines)
Lines 3-14 sbin/apcaccess Link Here
3
sbin/apctest
3
sbin/apctest
4
sbin/smtp
4
sbin/smtp
5
@sample %%ETCDIR%%/apcupsd.conf.sample
5
@sample %%ETCDIR%%/apcupsd.conf.sample
6
%%ETCDIR%%/apccontrol
6
@sample %%ETCDIR%%/apccontrol.sample
7
%%ETCDIR%%/changeme
7
@sample %%ETCDIR%%/changeme.sample
8
%%ETCDIR%%/commfailure
8
@sample %%ETCDIR%%/commfailure.sample
9
%%ETCDIR%%/commok
9
@sample %%ETCDIR%%/commok.sample
10
%%ETCDIR%%/onbattery
10
@sample %%ETCDIR%%/onbattery.sample
11
%%ETCDIR%%/offbattery
11
@sample %%ETCDIR%%/offbattery.sample
12
%%CGI%%@sample %%ETCDIR%%/apcupsd.css.sample
12
%%CGI%%@sample %%ETCDIR%%/apcupsd.css.sample
13
%%CGI%%@sample %%ETCDIR%%/hosts.conf.sample
13
%%CGI%%@sample %%ETCDIR%%/hosts.conf.sample
14
%%CGI%%@sample %%ETCDIR%%/multimon.conf.sample
14
%%CGI%%@sample %%ETCDIR%%/multimon.conf.sample

Return to bug 220002