2020-02-03 20:40:37 +00:00
|
|
|
# $OpenBSD: Makefile,v 1.104 2020/02/03 20:40:41 sthen Exp $
|
2001-05-06 03:58:56 +00:00
|
|
|
|
2019-06-03 16:06:50 +00:00
|
|
|
COMMENT-main= UPS monitoring program supporting many brands
|
|
|
|
COMMENT-cgi= CGIs for monitoring Nut-based UPSs
|
|
|
|
COMMENT-snmp= driver for monitoring UPS via SNMP
|
|
|
|
COMMENT-xml= driver for monitoring UPS via XML/HTTP
|
2001-02-06 22:24:03 +00:00
|
|
|
|
2019-06-03 16:06:50 +00:00
|
|
|
DISTNAME= nut-2.7.4
|
2010-10-03 22:21:49 +00:00
|
|
|
|
2019-06-03 16:06:50 +00:00
|
|
|
PKGNAME-main= ${DISTNAME}
|
|
|
|
PKGNAME-cgi= ${DISTNAME:S/-/-cgi-/}
|
|
|
|
PKGNAME-snmp= ${DISTNAME:S/-/-snmp-/}
|
|
|
|
PKGNAME-xml= ${DISTNAME:S/-/-xml-/}
|
2010-10-03 22:21:49 +00:00
|
|
|
|
2020-02-03 20:40:37 +00:00
|
|
|
REVISION-main= 7
|
|
|
|
REVISION-snmp= 3
|
|
|
|
REVISION-xml= 4
|
|
|
|
REVISION-cgi= 4
|
2017-01-17 06:58:10 +00:00
|
|
|
|
2016-03-11 20:07:55 +00:00
|
|
|
SHARED_LIBS += upsclient 4.0 # .4.0
|
2014-01-07 21:55:54 +00:00
|
|
|
SHARED_LIBS += nutclient 0.0 # .0.0
|
2016-03-11 20:07:55 +00:00
|
|
|
SHARED_LIBS += nutscan 2.0 # .1.0
|
2011-09-19 15:59:57 +00:00
|
|
|
|
2019-06-03 16:06:50 +00:00
|
|
|
CATEGORIES= sysutils
|
|
|
|
HOMEPAGE= http://www.networkupstools.org/
|
2007-05-18 12:22:45 +00:00
|
|
|
|
2009-04-03 15:40:12 +00:00
|
|
|
# GPLv2+, some scripts (not packaged) are GPLv3+
|
2019-06-03 16:06:50 +00:00
|
|
|
PERMIT_PACKAGE= Yes
|
2010-03-20 17:11:40 +00:00
|
|
|
|
2019-06-03 16:06:50 +00:00
|
|
|
COMPILER= base-clang ports-gcc base-gcc
|
2018-10-24 14:27:57 +00:00
|
|
|
|
2011-09-19 15:59:57 +00:00
|
|
|
COMMON += c crypto pthread
|
2017-07-16 19:18:47 +00:00
|
|
|
WANTLIB-main += ${COMMON} ltdl m ssl ${COMPILER_LIBCXX} usb usb-1.0
|
2017-11-02 21:51:59 +00:00
|
|
|
WANTLIB-xml += ${COMMON} expat iconv intl neon proxy ssl z
|
|
|
|
WANTLIB-cgi += ${COMMON} X11 expat fontconfig iconv intl
|
2011-09-19 15:59:57 +00:00
|
|
|
WANTLIB-cgi += freetype gd jpeg m png ssl upsclient xcb z
|
|
|
|
WANTLIB-snmp += ${COMMON} m netsnmp
|
2010-10-03 22:21:49 +00:00
|
|
|
|
2014-01-07 21:55:54 +00:00
|
|
|
MASTER_SITES= ${HOMEPAGE}source/2.7/
|
2010-03-20 17:11:40 +00:00
|
|
|
|
2019-06-03 16:06:50 +00:00
|
|
|
MODULES= lang/python
|
|
|
|
MODPY_RUNDEP= No
|
2013-07-18 07:58:12 +00:00
|
|
|
# if avahi is present at build time, avahi support is built in nut-scanner,
|
|
|
|
# but it's dlopen()'d at runtime, so support is optional, so we don't list a
|
|
|
|
# hard run dependency for this (to reduce deps in the common case).
|
2019-06-03 16:06:50 +00:00
|
|
|
BUILD_DEPENDS+= net/avahi
|
|
|
|
BUILD_DEPENDS+= textproc/asciidoc>=8.6.8 \
|
|
|
|
textproc/docbook-xsl
|
|
|
|
|
|
|
|
WEB_ROOT= /var/www
|
|
|
|
SUBST_VARS= BASESYSCONFDIR WEB_ROOT
|
|
|
|
|
|
|
|
CONFIGURE_STYLE= gnu
|
|
|
|
SYSCONFDIR= ${BASESYSCONFDIR}/nut
|
|
|
|
LDFLAGS+= -L${LOCALBASE}/lib -pthread
|
|
|
|
CONFIGURE_ARGS+= --datadir=${PREFIX}/share/nut \
|
|
|
|
--htmldir=${PREFIX}/share/doc/nut \
|
|
|
|
--includedir=${PREFIX}/include/nut \
|
|
|
|
--with-dev \
|
|
|
|
--with-doc=html-single \
|
|
|
|
--with-hal-libs="" \
|
|
|
|
--with-ssl \
|
|
|
|
--with-statepath=/var/db/nut \
|
|
|
|
--with-user=_ups \
|
|
|
|
--with-group=_ups \
|
|
|
|
--without-ipmi \
|
|
|
|
CPPFLAGS="-I${LOCALBASE}/include" \
|
|
|
|
LDFLAGS="${LDFLAGS}"
|
2002-10-14 16:14:33 +00:00
|
|
|
|
2011-03-09 23:32:20 +00:00
|
|
|
PSEUDO_FLAVORS= no_snmp no_xml
|
2002-10-14 16:14:33 +00:00
|
|
|
FLAVOR?=
|
2008-01-30 20:55:59 +00:00
|
|
|
MULTI_PACKAGES= -main -cgi
|
2011-03-09 23:32:20 +00:00
|
|
|
|
2013-02-09 14:49:50 +00:00
|
|
|
.if ${FLAVOR:Mno_snmp}
|
2011-03-09 11:00:55 +00:00
|
|
|
CONFIGURE_ARGS+= --without-snmp
|
|
|
|
.else
|
2004-10-03 03:13:10 +00:00
|
|
|
MULTI_PACKAGES+= -snmp
|
|
|
|
.endif
|
2006-11-25 19:36:43 +00:00
|
|
|
|
2013-02-09 14:49:50 +00:00
|
|
|
.if ${FLAVOR:Mno_xml}
|
2011-03-09 23:32:20 +00:00
|
|
|
CONFIGURE_ARGS+= --without-neon
|
|
|
|
.else
|
|
|
|
MULTI_PACKAGES+= -xml
|
|
|
|
.endif
|
|
|
|
|
2018-11-06 18:26:27 +00:00
|
|
|
LIB_DEPENDS-main= ${LIB_DEPENDS} \
|
|
|
|
devel/libtool,-ltdl \
|
2011-11-14 08:58:07 +00:00
|
|
|
devel/libusb-compat
|
2011-03-09 23:32:20 +00:00
|
|
|
RUN_DEPENDS-main= # empty
|
2008-01-30 20:55:59 +00:00
|
|
|
|
2007-05-18 12:22:45 +00:00
|
|
|
PREFIX-cgi= ${WEB_ROOT}
|
2006-11-25 19:36:43 +00:00
|
|
|
|
2011-03-09 23:32:20 +00:00
|
|
|
LIB_DEPENDS-xml= net/neon
|
|
|
|
RUN_DEPENDS-xml= ${RUN_DEPENDS} \
|
|
|
|
sysutils/nut
|
|
|
|
|
2010-11-20 17:22:40 +00:00
|
|
|
LIB_DEPENDS-snmp= net/net-snmp
|
2011-03-09 23:32:20 +00:00
|
|
|
RUN_DEPENDS-snmp= sysutils/nut
|
2010-03-20 17:11:40 +00:00
|
|
|
|
2019-05-20 22:15:00 +00:00
|
|
|
LIB_DEPENDS-cgi= devel/gettext,-runtime \
|
2010-11-20 17:22:40 +00:00
|
|
|
graphics/jpeg \
|
|
|
|
graphics/gd \
|
2011-03-09 23:32:20 +00:00
|
|
|
sysutils/nut
|
2006-11-25 19:36:43 +00:00
|
|
|
|
|
|
|
.if ${MULTI_PACKAGES:M-cgi}
|
2010-11-20 17:22:40 +00:00
|
|
|
BUILD_DEPENDS+= graphics/gd>=1.8.3
|
2001-02-06 22:24:03 +00:00
|
|
|
|
2007-05-18 12:22:45 +00:00
|
|
|
CONFIGURE_ARGS+= --with-cgi \
|
|
|
|
--with-cgipath="${WEB_ROOT}/cgi-bin/nut" \
|
2011-03-09 23:32:20 +00:00
|
|
|
--with-gd-libs="-L${X11BASE}/lib -L${PREFIX}/lib \
|
2008-01-30 20:55:59 +00:00
|
|
|
-lgd -lpng -lz -ljpeg -lm -lfreetype -lX11" \
|
2007-05-18 12:22:45 +00:00
|
|
|
--with-gd-includes="-I${PREFIX}/include"
|
2001-02-06 22:24:03 +00:00
|
|
|
.endif
|
|
|
|
|
2008-09-27 17:30:08 +00:00
|
|
|
USE_GMAKE= Yes
|
2012-11-09 20:50:17 +00:00
|
|
|
USE_LIBTOOL= gnu# -all-static
|
2011-03-09 11:00:55 +00:00
|
|
|
FAKE_FLAGS= sysconfdir=${PREFIX}/share/examples/nut
|
update to nut-2.2.2, which contains the old agiler driver from 2.2.0
(now called agiler-old)
upses such as the below can now work again:
{0x0665, 0x5161, &agiler_old_subdriver}, /* Belkin F6C1200-UNV */
{0x06da, 0x0003, &agiler_old_subdriver}, /* Mustek Powermust */
{0x0f03, 0x0001, &agiler_old_subdriver}, /* Unitek Alpha 1200Sx *
ok sthen@
2008-09-08 19:38:30 +00:00
|
|
|
|
2013-03-11 11:35:43 +00:00
|
|
|
NO_TEST= Yes
|
2002-10-28 19:53:43 +00:00
|
|
|
|
2010-03-03 20:39:15 +00:00
|
|
|
pre-configure:
|
|
|
|
${SUBST_CMD} ${WRKSRC}/conf/upssched.conf.sample.in
|
2012-01-31 14:20:18 +00:00
|
|
|
-ln -s ${MODPY_BIN} ${WRKDIR}/bin/python
|
2010-03-03 20:39:15 +00:00
|
|
|
|
2001-02-06 22:24:03 +00:00
|
|
|
post-install:
|
2004-09-27 03:10:24 +00:00
|
|
|
${INSTALL_DATA_DIR} ${WRKINST}${WEB_ROOT}/conf/nut/
|
2004-02-09 06:48:48 +00:00
|
|
|
.for file in hosts.conf upsset.conf upsstats.html upsstats-single.html
|
2008-01-30 20:55:59 +00:00
|
|
|
${INSTALL_DATA} ${WRKBUILD}/conf/${file}.sample \
|
2011-03-09 23:32:20 +00:00
|
|
|
${WRKINST}${WEB_ROOT}/conf/nut/
|
|
|
|
.endfor
|
2011-03-09 11:00:55 +00:00
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/nut/
|
|
|
|
cd ${WRKSRC}/docs; cp -R ../[A-LN-Z]* ../MAINTAINERS \
|
|
|
|
*html cables images ${PREFIX}/share/doc/nut/
|
2011-11-14 08:58:07 +00:00
|
|
|
${INSTALL_SCRIPT} ${WRKSRC}/scripts/avahi/nut.service \
|
|
|
|
${PREFIX}/share/examples/nut
|
2001-02-06 22:24:03 +00:00
|
|
|
|
|
|
|
.include <bsd.port.mk>
|