diff options
author | Ion-Mihai Tetcu <itetcu@FreeBSD.org> | 2008-03-31 17:21:57 +0000 |
---|---|---|
committer | Ion-Mihai Tetcu <itetcu@FreeBSD.org> | 2008-03-31 17:21:57 +0000 |
commit | c5e2e02c6709004be5a06b8302bde15c331a3212 (patch) | |
tree | e196e7970861a9c3f798980b74a4f83ba511cce2 /sysutils/apcupsd | |
parent | 1e63d1609be3715e24c5b81226b580aeec83ed36 (diff) | |
download | ports-c5e2e02c6709004be5a06b8302bde15c331a3212.tar.gz ports-c5e2e02c6709004be5a06b8302bde15c331a3212.zip |
Notes
Diffstat (limited to 'sysutils/apcupsd')
-rw-r--r-- | sysutils/apcupsd/Makefile | 102 | ||||
-rw-r--r-- | sysutils/apcupsd/distinfo | 11 | ||||
-rw-r--r-- | sysutils/apcupsd/files/patch-src__apcaccess.c | 51 | ||||
-rw-r--r-- | sysutils/apcupsd/files/patch-src__drivers__usb__bsd__bsd-usb.c | 32 |
4 files changed, 174 insertions, 22 deletions
diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile index 5d7a5ea75e0c..11e47c066fc6 100644 --- a/sysutils/apcupsd/Makefile +++ b/sysutils/apcupsd/Makefile @@ -6,21 +6,20 @@ # PORTNAME= apcupsd -PORTVERSION= 3.14.2 -PORTREVISION= 1 +PORTVERSION= 3.14.3 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S/$/:src_sf/g} \ - http://sce-tindy.tecnik93.com/FreeBSD/ports/${PORTNAME}/sources/:src_bk \ + http://T32.TecNik93.com/FreeBSD/ports/${PORTNAME}/sources/:src_bk \ http://apcupsd.sourceforge.net/manual/:doc_sf \ - http://sce-tindy.tecnik93.com/FreeBSD/ports/${PORTNAME}/sources/:doc_bk + http://T32.TecNik93.com/FreeBSD/ports/${PORTNAME}/sources/:doc_bk 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} -IGNOREFILES= ${PORTNAME}.pdf +#IGNOREFILES= ${PORTNAME}.pdf MAINTAINER= itetcu@FreeBSD.org -COMMENT= A daemon for controlling APC UPS +COMMENT= Set of programs for controlling APC UPS BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend @@ -40,20 +39,42 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -L${LOCALBASE}/lib" \ MAN8= apcupsd.8 -OPTIONS= CLIENT_ONLY "Build NIS client only (no network server)" off \ +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 \ CGI "Compile with CGI programms to show status" off \ - USB "Compile with USB Support (READ MANUAL!)" on \ - SNMP "Compile with SNMP Support (READ MANUAL!)" on + NLS "Enable Native Language Support" off \ + PCNET_DRV "Compile PowerChute Network Shutdown driver" on \ + POWERFLUTE "Compile powerflute program" 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 \ +# GAPCMON "Build GTK GUI front-end" off PORTDOCS= ${PORTNAME}.pdf .include <bsd.port.pre.mk> -.if defined(WITH_CLIENT_ONLY) -CONFIGURE_ARGS+= --enable-net +.ifdef(WITH_APCSMART_DRV) +CONFIGURE_ARGS+= --enable-apcsmart +.else +CONFIGURE_ARGS+= --disable-apcsmart +.endif + +.ifdef(WITH_APCDUMB_DRV) +CONFIGURE_ARGS+= --enable-dumb +.else +CONFIGURE_ARGS+= --disable-dumb +.endif + +.ifdef(WITH_CLIENT_ONLY) +CONFIGURE_ARGS+= --enable-net \ + --disable-apcsmart --disable-dumb --disable-usb \ + --disable-snmp --disable-test --disable-pcnet .endif -.if defined(WITH_CGI) +.ifdef(WITH_CGI) CONFIGURE_ARGS+= --enable-cgi --with-cgi-bin=${ETCDIR}/cgi LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd PLIST_SUB+= CGI="" @@ -61,18 +82,65 @@ PLIST_SUB+= CGI="" PLIST_SUB+= CGI="@comment " .endif -.if !defined(WITHOUT_USB) +#.ifdef(WITH_GAPCMON) +#CONFIGURE_ARGS+= --enable-gapcmon +#.endif + +.ifndef(WITHOUT_NLS) +USE_GETTEXT= yes +CONFIGURE_ARGS+= --enable-nls +PLIST_SUB+= NLS="" +.else +PLIST_SUB+= NLS="@comment " +.endif + +.ifdef(WITH_PCNET_DRV) +CONFIGURE_ARGS+= --enable-pcnet +.else +CONFIGURE_ARGS+= --disable-pcnet +.endif + +.ifdef(WITH_POWERFLUTE) +CONFIGURE_ARGS+= --enable-powerflute +CONFIGURE_ENV+= LIBS+="-lcurses -lmenu" +PLIST_SUB+= POWERFL="" +.else +PLIST_SUB+= POWERFL="@comment " +.endif + +.ifdef(WITH_USB) CONFIGURE_ARGS+= --enable-usb .endif -.if !defined(WITHOUT_SNMP) +.ifdef(WITH_SNMP_DRV) LIB_DEPENDS+= netsnmp.16:${PORTSDIR}/net-mgmt/net-snmp CONFIGURE_ARGS+= --enable-snmp +.else +CONFIGURE_ARGS+= --disable-snmp .endif -CONFIGURE_ARGS+= --enable-powerflute --with-libwrap=yes -CONFIGURE_ENV+= LIBS="-lcurses -lmenu" -PLIST_SUB+= POWERFL="" +.ifdef(WITH_TCP_WRAPPERS) +CONFIGURE_ARGS+= --with-libwrap=yes +.endif + +.ifdef(WITH_TEST_DRV) +CONFIGURE_ARGS+= --enable-test +.endif + +#CONFIGURE_ARGS+= --with-libwrap=yes +#CONFIGURE_ENV+= LIBS="-lcurses -lmenu" +#PLIST_SUB+= POWERFL="" + +pre-configure: +.if defined(WITH_CLIENT_ONLY) && ( defined(WITH_APCSMART_DRV) || \ + 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} +.endif post-configure: @${REINPLACE_CMD} -e "s|%PREFIX%|${PREFIX}|g" ${WRKSRC}/doc/apcupsd.man diff --git a/sysutils/apcupsd/distinfo b/sysutils/apcupsd/distinfo index 374e637e5dbf..affe792a6dff 100644 --- a/sysutils/apcupsd/distinfo +++ b/sysutils/apcupsd/distinfo @@ -1,5 +1,6 @@ -MD5 (apcupsd-3.14.2.tar.gz) = fd8785e7607d20cefa68dc20e44eebc4 -SHA256 (apcupsd-3.14.2.tar.gz) = 72605e54356ffe32dc24159b4094a5b7e5e978d2440edded8b01496af9caca50 -SIZE (apcupsd-3.14.2.tar.gz) = 4345034 -MD5 (apcupsd.pdf) = IGNORE -SHA256 (apcupsd.pdf) = IGNORE +MD5 (apcupsd-3.14.3.tar.gz) = a212351d21828e9344264614c7ad8ba1 +SHA256 (apcupsd-3.14.3.tar.gz) = 01b8f4219ff91044600afd78842ac93cb40f034cf00cd25144fe918db80eed88 +SIZE (apcupsd-3.14.3.tar.gz) = 4350109 +MD5 (apcupsd.pdf) = d81946b0b2c2e8cc651fb217e521f4bf +SHA256 (apcupsd.pdf) = 3fde7947a45bf65572c1c84dfd6df6ca9f9ce24e559c50cf3e5e53172ab17c97 +SIZE (apcupsd.pdf) = 1074251 diff --git a/sysutils/apcupsd/files/patch-src__apcaccess.c b/sysutils/apcupsd/files/patch-src__apcaccess.c new file mode 100644 index 000000000000..8e32e08c9f48 --- /dev/null +++ b/sysutils/apcupsd/files/patch-src__apcaccess.c @@ -0,0 +1,51 @@ +--- src/apcaccess.c.orig 2007-08-03 18:17:38.000000000 +0300 ++++ src/apcaccess.c 2008-02-27 09:30:39.352400647 +0200 +@@ -62,11 +62,19 @@ + int main(int argc, char **argv) + { + int mode = 0; ++ UPSINFO *ups = NULL; ++ ++ char *cfgfile = APCCONF; ++ struct stat cfgstat; + + #ifdef HAVE_MINGW + WSA_Init(); /* init MS networking */ + #endif + ++ ups = attach_ups(ups); ++ if (!ups) ++ Error_abort0(_("Cannot attach SYSV IPC.\n")); ++ + if (argc < 2) { + /* Assume user wants "status" */ + mode = 2; +@@ -87,6 +95,20 @@ + *p++ = 0; + port = atoi(p); + } ++ } else { ++ /* check configuration so local NISIP and NISPORT variables can be used as ++ defaults */ ++ if (!stat(cfgfile, &cfgstat)) { ++ check_for_config(ups, cfgfile); ++ ++ if (ups) { ++ if (ups->nisip && ups->nisip[0]) ++ host = ups->nisip; ++ ++ if (ups->statusport) ++ port = ups->statusport; ++ } ++ } + } + + if (!*host || strcmp(host, "0.0.0.0") == 0) +@@ -101,5 +123,7 @@ + Error_abort0(_("Strange mode\n")); + } + ++ detach_ups(ups); ++ + return 0; + } diff --git a/sysutils/apcupsd/files/patch-src__drivers__usb__bsd__bsd-usb.c b/sysutils/apcupsd/files/patch-src__drivers__usb__bsd__bsd-usb.c new file mode 100644 index 000000000000..eb2109c0fda6 --- /dev/null +++ b/sysutils/apcupsd/files/patch-src__drivers__usb__bsd__bsd-usb.c @@ -0,0 +1,32 @@ +--- ./src/drivers/usb/bsd/bsd-usb.c.orig 2007-10-27 20:15:14.000000000 +0300 ++++ ./src/drivers/usb/bsd/bsd-usb.c 2008-03-29 20:21:50.000000000 +0200 +@@ -351,9 +351,9 @@ + + int pusb_ups_get_capabilities(UPSINFO *ups, const struct s_known_info *known_info) + { +- int i, rc, ci, phys; ++ int i, ci, phys, input, feature; + USB_DATA *my_data = (USB_DATA *)ups->driver_internal_data; +- hid_item_t item; ++ hid_item_t item, witem; + USB_INFO *info; + + write_lock(ups); +@@ -506,7 +506,7 @@ + + // Store a (possibly truncated) copy of the floating point value in the + // integer field as well. +- val.iValue = val.dValue; ++ val.iValue = (int) val.dValue; + + Dmsg4(200, "Def val=%d exp=%d dVal=%f ci=%d\n", info->value, + exponent, val.dValue, info->ci); +@@ -775,7 +775,7 @@ + return true; + } + +-int pusb_write_int_to_ups(UPSINFO *ups, int ci, int value, char *name) ++int pusb_write_int_to_ups(UPSINFO *ups, int ci, int value, const char *name) + { + USB_DATA *my_data = (USB_DATA *)ups->driver_internal_data; + USB_INFO *info; |