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
2008-07-10 22:03:47 +02:00
PORTVERSION = 3.14.4
2001-12-02 12:24:53 +01:00
CATEGORIES = sysutils
2006-04-22 15:51:37 +02:00
MASTER_SITES = ${ MASTER_SITE_SOURCEFORGE : S / $/ : src_sf /g } \
2008-03-31 19:21:57 +02:00
http://T32.TecNik93.com/FreeBSD/ports/${ PORTNAME } /sources/:src_bk \
2006-04-22 15:51:37 +02:00
http://apcupsd.sourceforge.net/manual/:doc_sf \
2008-03-31 19:21:57 +02:00
http://T32.TecNik93.com/FreeBSD/ports/${ PORTNAME } /sources/:doc_bk
2006-04-22 15:51:37 +02:00
MASTER_SITE_SUBDIR = ${ PORTNAME } /:src_sf
DISTFILES = ${ DISTNAME } ${ EXTRACT_SUFX } :src_sf,src_bk \
${ PORTNAME } .pdf:doc_sf,doc_bk
EXTRACT_ONLY = ${ DISTNAME } ${ EXTRACT_SUFX }
2008-03-31 19:21:57 +02:00
#IGNOREFILES= ${PORTNAME}.pdf
2001-12-02 12:24:53 +01:00
2006-08-04 16:17:31 +02:00
MAINTAINER = itetcu@FreeBSD.org
2008-03-31 19:21:57 +02:00
COMMENT = Set of programs for controlling APC UPS
2001-12-02 12:24:53 +01:00
2006-04-22 15:51:37 +02:00
USE_RC_SUBR = apcupsd
2007-10-21 12:39:39 +02:00
SUB_FILES = pkg-message
2001-12-02 12:24:53 +01:00
2007-07-23 11:36:51 +02:00
GNU_CONFIGURE = yes
2008-07-10 22:03:47 +02:00
USE_GMAKE = yes
2007-07-23 11:36:51 +02:00
CONFIGURE_ARGS = --sbindir= ${ PREFIX } /sbin \
2004-01-18 17:29:11 +01:00
--with-nologin= /var/run \
2005-04-15 19:24:04 +02:00
--disable-install-distdir \
2007-10-21 12:39:39 +02:00
--sysconfdir= ${ ETCDIR } \
2004-03-09 21:01:43 +01:00
--with-serial-dev= /dev/usv
2004-02-03 21:18:25 +01:00
2006-04-22 15:51:37 +02:00
CONFIGURE_ENV = CPPFLAGS = " -I ${ LOCALBASE } /include -L ${ LOCALBASE } /lib " \
CFLAGS = " -I ${ LOCALBASE } /include -L ${ LOCALBASE } /lib " \
LDFLAGS = " -L ${ LOCALBASE } /lib "
MAN8 = apcupsd.8
2008-03-31 19:21:57 +02:00
OPTIONS = APCSMART_DRV "Compile APC SmartUPS serial driver" on \
APCDUMB_DRV "Compile dumb UPS driver" on \
CLIENT_ONLY "Only NIS client (no network server or drivers)" off \
2006-08-04 16:17:31 +02:00
CGI "Compile with CGI programms to show status" off \
2008-03-31 19:21:57 +02:00
PCNET_DRV "Compile PowerChute Network Shutdown driver" on \
USB "Compile with USB Support driver" on \
SNMP_DRV "Compile with SNMP driver" on \
TCP_WRAPPERS "Compile with TCP_WRAPPERS support" on\
TEST_DRV "Compile TEST driver" off \
2008-07-10 22:03:47 +02:00
GAPCMON "Build GTK GUI front-end" off
# POWERFLUTE "Compile powerflute program" off
2004-02-09 20:23:34 +01:00
2006-04-22 15:51:37 +02:00
PORTDOCS = ${ PORTNAME } .pdf
2004-02-09 20:23:34 +01:00
2008-07-10 22:03:47 +02:00
. i n c l u d e < b s d . p o r t . o p t i o n s . m k >
2005-11-17 21:08:14 +01:00
2008-03-31 19:21:57 +02:00
. i f d e f ( W I T H _ A P C S M A R T _ D R V )
CONFIGURE_ARGS += --enable-apcsmart
. e l s e
CONFIGURE_ARGS += --disable-apcsmart
. e n d i f
. i f d e f ( W I T H _ A P C D U M B _ D R V )
CONFIGURE_ARGS += --enable-dumb
. e l s e
CONFIGURE_ARGS += --disable-dumb
. e n d i f
. i f d e f ( W I T H _ C L I E N T _ O N L Y )
CONFIGURE_ARGS += --enable-net \
--disable-apcsmart --disable-dumb --disable-usb \
--disable-snmp --disable-test --disable-pcnet
2005-04-15 19:24:04 +02:00
. e n d i f
2008-03-31 19:21:57 +02:00
. i f d e f ( W I T H _ C G I )
2007-10-21 12:39:39 +02:00
CONFIGURE_ARGS += --enable-cgi --with-cgi-bin= ${ ETCDIR } /cgi
2006-04-22 15:51:37 +02:00
LIB_DEPENDS += gd.4:${ PORTSDIR } /graphics/gd
PLIST_SUB += CGI = ""
2004-02-03 21:18:25 +01:00
. e l s e
2006-04-22 15:51:37 +02:00
PLIST_SUB += CGI = "@comment "
2004-02-03 21:18:25 +01:00
. e n d i f
2008-07-10 22:03:47 +02:00
. i f d e f ( W I T H _ G A P C M O N )
CONFIGURE_ARGS += --enable-gapcmon
USE_GNOME += gconf2
PLIST_SUB += GAPCMON = ""
2008-03-31 19:21:57 +02:00
. e l s e
2008-07-10 22:03:47 +02:00
PLIST_SUB += GAPCMON = "@comment "
2008-03-31 19:21:57 +02:00
. e n d i f
. i f d e f ( W I T H _ P C N E T _ D R V )
CONFIGURE_ARGS += --enable-pcnet
. e l s e
CONFIGURE_ARGS += --disable-pcnet
. e n d i f
2008-07-10 22:03:47 +02:00
# disabled upstream
2008-03-31 19:21:57 +02:00
. i f d e f ( W I T H _ P O W E R F L U T E )
CONFIGURE_ARGS += --enable-powerflute
CONFIGURE_ENV += LIBS += "-lcurses -lmenu"
PLIST_SUB += POWERFL = ""
. e l s e
PLIST_SUB += POWERFL = "@comment "
. e n d i f
. i f d e f ( W I T H _ U S B )
2006-04-22 15:51:37 +02:00
CONFIGURE_ARGS += --enable-usb
2004-01-04 20:18:20 +01:00
. e n d i f
2008-03-31 19:21:57 +02:00
. i f d e f ( W I T H _ S N M P _ D R V )
2008-03-27 11:58:30 +01:00
LIB_DEPENDS += netsnmp.16:${ PORTSDIR } /net-mgmt/net-snmp
2006-04-22 15:51:37 +02:00
CONFIGURE_ARGS += --enable-snmp
2008-03-31 19:21:57 +02:00
. e l s e
CONFIGURE_ARGS += --disable-snmp
2005-07-03 14:25:23 +02:00
. e n d i f
2008-03-31 19:21:57 +02:00
. i f d e f ( W I T H _ T C P _ W R A P P E R S )
CONFIGURE_ARGS += --with-libwrap= yes
. e n d i f
. i f d e f ( W I T H _ T E S T _ D R V )
CONFIGURE_ARGS += --enable-test
. e n d i f
#CONFIGURE_ARGS+= --with-libwrap=yes
#CONFIGURE_ENV+= LIBS="-lcurses -lmenu"
#PLIST_SUB+= POWERFL=""
2008-07-10 22:03:47 +02:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2008-03-31 19:21:57 +02:00
pre-configure :
. i f d e f i n e d ( W I T H _ C L I E N T _ O N L Y ) & & ( d e f i n e d ( W I T H _ A P C S M A R T _ D R V ) | | \
defined( WITH_APCDUMB_DRV) || defined( WITH_PCNET_DRV) || \
defined( WITH_POWERFLUTE) || defined( WITH_USB) || \
definedWITH_SNMP_DRV) || defined( WITH_TEST_DRV) )
@${ ECHO_CMD } "It doesn't make sense to build drivers if all you want is"
@${ ECHO_CMD } "the client; please do make config and select either"
@${ ECHO_CMD } "CLIENT_ONLY or the *_DRV you need"
@${ FALSE }
. e n d i f
2004-01-04 20:18:20 +01:00
2003-11-18 21:18:17 +01:00
post-configure :
2006-04-22 15:51:37 +02:00
@${ 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 :
2006-04-22 15:51:37 +02: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
2003-11-18 21:18:17 +01:00
for na in apccontrol commfailure mainsback mastertimeout \
changeme commok masterconnect onbattery; do \
2007-10-21 12:39:39 +02:00
if [ -f ${ ETCDIR } /$$ na.orig ] ; then \
if cmp -s ${ ETCDIR } /$$ na ${ ETCDIR } /$$ na.orig; then \
${ ECHO_CMD } " %%ETCDIR%%/ $$ na.orig " >> ${ TMPPLIST } ; \
2003-11-18 21:18:17 +01:00
fi \
fi ; \
done
2007-10-21 12:39:39 +02:00
@${ ECHO_CMD } " @unexec if [ -d %D/ ${ ETCDIR_REL } ]; then ${ ECHO_CMD } \"If you are permanently removing this port, you should do a ``rm -rf ${ ETCDIR } `` to remove config files left.\" | ${ FMT } ; fi " >> ${ TMPPLIST }
2006-04-22 15:51:37 +02:00
# Install sample startup script
# If there is already a 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 \
2007-10-21 12:39:39 +02:00
if [ -f ${ ETCDIR } /$$ na ] ; then \
if [ -f ${ ETCDIR } /$$ na.new ] ; then \
${ MV } ${ ETCDIR } /$$ na.new ${ ETCDIR } /$$ na.sample; \
2004-10-28 21:21:50 +02:00
else \
2007-10-21 12:39:39 +02:00
${ CP } ${ ETCDIR } /$$ na ${ ETCDIR } /$$ na.sample; \
2004-10-28 21:21:50 +02:00
fi ; \
fi ; \
done
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 }
2008-07-10 22:03:47 +02:00
${ INSTALL_DATA } ${ DISTDIR } /${ PORTNAME } .pdf ${ DOCSDIR }
2001-12-02 12:24:53 +01:00
. e n d i f
2007-10-21 12:39:39 +02:00
@${ CAT } ${ PKGMESSAGE }
2001-12-02 12:24:53 +01:00
. i n c l u d e < b s d . p o r t . p o s t . m k >