2001-12-02 12:24:53 +01:00
# New ports collection makefile for: apcupsd
# Date created: 1.12.2001
# Whom: Lars K<> ller <Lars.Koeller@Uni-Bielefeld.DE>
#
# $FreeBSD$
#
PORTNAME = apcupsd
2004-10-14 21:28:31 +02:00
PORTVERSION = 3.10.15
2004-12-13 21:36:18 +01:00
PORTREVISION = 3
2001-12-02 12:24:53 +01:00
CATEGORIES = sysutils
2003-03-09 16:22:53 +01:00
MASTER_SITES = ${ MASTER_SITE_SOURCEFORGE }
MASTER_SITE_SUBDIR = ${ PORTNAME }
2001-12-02 12:24:53 +01:00
MAINTAINER = Lars.Koeller@Uni-Bielefeld.de
2003-02-21 14:28:59 +01:00
COMMENT = A daemon for controlling APC UPS
2001-12-02 12:24:53 +01:00
2004-02-04 05:36:30 +01:00
USE_GETTEXT = yes
2003-11-18 21:18:17 +01:00
USE_REINPLACE = yes
2001-12-02 12:24:53 +01:00
STARTUP_SCRIPT = apcupsd.sh.sample
PLIST_SUB = STARTUP_SCRIPT = ${ STARTUP_SCRIPT }
HAS_CONFIGURE = yes
CONFIGURE_ARGS = --prefix= ${ PREFIX } --sbindir= ${ PREFIX } /sbin \
2004-01-18 17:29:11 +01:00
--with-nologin= /var/run \
2003-11-18 21:18:17 +01:00
--disable-install-distdir --enable-usb \
2001-12-02 12:24:53 +01:00
--sysconfdir= ${ PREFIX } /etc/apcupsd \
2004-03-09 21:01:43 +01:00
--with-serial-dev= /dev/usv
2004-02-03 21:18:25 +01:00
2004-02-09 20:23:34 +01:00
OPTIONS = CLIENT_ONLY "Build apcupsd client only (no network server)" off
OPTIONS += CGI "Compile with CGI programms to show status" off
. i n c l u d e < b s d . p o r t . p r e . m k >
2004-02-03 21:18:25 +01:00
. i f d e f i n e d ( W I T H _ C G I )
CONFIGURE_ARGS += --enable-cgi --with-cgi-bin= ${ PREFIX } /etc/apcupsd/cgi
LIB_DEPENDS += gd.4:${ PORTSDIR } /graphics/gd
PLIST_SUB += CGI = ""
. e l s e
PLIST_SUB += CGI = "@comment "
. e n d i f
2004-01-04 20:18:20 +01:00
. i f d e f i n e d ( W I T H _ C L I E N T _ O N L Y )
CONFIGURE_ARGS += --enable-net
. e l s e
CONFIGURE_ARGS += --enable-master-slave
. e n d i f
2003-11-18 21:18:17 +01:00
CONFIGURE_ENV = CPPFLAGS = " -I ${ LOCALBASE } /include -L ${ LOCALBASE } /lib " \
CFLAGS = " -I ${ LOCALBASE } /include -L ${ LOCALBASE } /lib " \
LDFLAGS = " -L ${ LOCALBASE } /lib "
2001-12-02 12:24:53 +01:00
# Cause FreeBSD 3.X misses libmenu, libforms and libpanel (curses)
. i f $ { O S V E R S I O N } > 4 0 0 0 0 0
2003-11-18 21:18:17 +01:00
CONFIGURE_ARGS += --enable-powerflute --with-libwrap= yes
2001-12-02 12:24:53 +01:00
PLIST_SUB += POWERFL = ""
. e l s e
PLIST_SUB += POWERFL = "@comment "
. e n d i f
MAN8 = "apcupsd.8"
2004-01-07 01:14:00 +01:00
PORTDOCS = apcupsd.pdf manual.html manual.css \
2003-11-18 21:18:17 +01:00
apcupsd.png back.png charging.png home.png main_configs.png \
multimon.png next.png onbatt.png online.png status.png thanks.png \
wininstall1.png wininstall2.png wininstall3.png wininstall4.png \
wininstall5.png wininstall6.png wininstall7.png
2004-01-04 20:18:20 +01:00
pre-everything ::
@${ ECHO_MSG } ""
@${ ECHO_MSG } "You may use the following build options:"
@${ ECHO_MSG } ""
2004-02-03 21:18:25 +01:00
@${ ECHO_MSG } " WITH_CGI=yes if you want to build CGI support."
@${ ECHO_MSG } " WITH_CLIENT_ONLY=yes if you only want a network client."
2004-01-04 20:18:20 +01:00
@${ ECHO_MSG } ""
2004-02-03 21:18:25 +01:00
. i f d e f i n e d ( W I T H _ C G I )
@${ ECHO_MSG } "===> Building with CGI support."
. e n d i f
. i f d e f i n e d ( W I T H _ C L I E N T _ O N L Y )
2004-01-04 20:18:20 +01:00
@${ ECHO_MSG } "===> Building network client."
. e n d i f
2003-11-18 21:18:17 +01:00
post-configure :
${ REINPLACE_CMD } -e " s|%PREFIX%| ${ PREFIX } |g " ${ WRKSRC } /doc/apcupsd.man
2001-12-03 22:27:29 +01:00
2001-12-02 12:24:53 +01:00
post-install :
2003-11-18 21:18:17 +01:00
# If the files presaved are identical with the new one, include then in
# the package list. So the port could be removed without problems
for na in apccontrol commfailure mainsback mastertimeout \
changeme commok masterconnect onbattery; do \
if [ -f ${ PREFIX } /etc/apcupsd/$$ na.orig ] ; then \
if cmp -s ${ PREFIX } /etc/apcupsd/$$ na ${ PREFIX } /etc/apcupsd/$$ na.orig; then \
${ ECHO_CMD } " etc/apcupsd/ $$ na.orig " >> ${ TMPPLIST } ; \
fi \
fi ; \
done
${ ECHO_CMD } " @unexec if [ -d %D/etc/apcupsd ]; then echo \"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
2004-01-05 09:13:18 +01:00
${ 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/
2004-10-28 21:21:50 +02:00
# If there is already an config file it is installed as ...new
2004-11-02 15:34:21 +01:00
for na in apcupsd.conf apcupsd.css hosts.conf multimon.conf; do \
2004-10-28 21:21:50 +02:00
if [ -f ${ PREFIX } /etc/apcupsd/$$ na ] ; then \
if [ -f ${ PREFIX } /etc/apcupsd/$$ na.new ] ; then \
${ MV } ${ PREFIX } /etc/apcupsd/$$ na.new ${ PREFIX } /etc/apcupsd/$$ na.sample; \
else \
${ CP } ${ PREFIX } /etc/apcupsd/$$ na ${ PREFIX } /etc/apcupsd/$$ na.sample; \
fi ; \
fi ; \
done
2004-01-05 09:13:18 +01:00
2001-12-02 12:24:53 +01:00
. i f ! d e f i n e d ( N O P O R T D O C S )
@${ MKDIR } ${ DOCSDIR }
2003-11-18 21:18:17 +01:00
. f o r f i l e n i n $ { P O R T D O C S }
${ INSTALL_DATA } ${ WRKSRC } /doc/docbook/${ filen } ${ DOCSDIR }
2001-12-02 12:24:53 +01:00
. e n d f o r
. e n d i f
. i n c l u d e < b s d . p o r t . p o s t . m k >