diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index 8bef55ae040a..835699598ccf 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,170 +1,171 @@ PORTNAME= nut PORTVERSION= 2.8.5 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ MAINTAINER= cy@FreeBSD.org COMMENT= Network UPS Tools WWW= https://www.networkupstools.org/ LICENSE= GPLv2+ GPLv3+ ART10 GPLv1+ LICENSE_COMB= multi LICENSE_FILE= ${WRKSRC}/COPYING CONFLICTS= nut-devel-* GNU_CONFIGURE= yes USES= autoreconf:build compiler:c11 gmake libtool pkgconfig python:build USE_LDCONFIG= yes NUT_USER?= nut NUT_GROUP?= nut USERS= ${NUT_USER} GROUPS= ${NUT_GROUP} dialer STATEDIR?= /var/db/nut PLIST_SUB+= NUT_USER=${NUT_USER} PLIST_SUB+= NUT_GROUP=${NUT_GROUP} CGIDIR?= ${PREFIX}/www/cgi-bin/${PORTNAME} CGIDIR_REL?= ${CGIDIR:S,^${PREFIX}/,,} PLIST_SUB+= CGIDIR="${CGIDIR_REL}" PLIST_SUB+= CGIETCDIR="etc/nut/" OPTIONS_DEFAULT=SERIAL USB SNMP NEON PDU MODBUS CGI BASH AVAHI DOCS MANPAGES OPENSSL OPTIONS_DEFAULT_amd64= FREEIPMI OPTIONS_DEFAULT_i386= FREEIPMI OPTIONS_DEFAULT_powerpc= FREEIPMI OPTIONS_DEFAULT_powerpc64= FREEIPMI OPTIONS_DEFAULT_powerpc64le= FREEIPMI OPTIONS_DEFAULT_riscv64= FREEIPMI OPTIONS_DEFAULT_riscv64sf= FREEIPMI OPTIONS_DEFINE= SERIAL USB SNMP NEON PDU MODBUS CGI BASH AVAHI IPMIPSU FREEIPMI DOCS MANPAGES DEV OPTIONS_SINGLE= IPMI SSL OPTIONS_SINGLE_SSL= SSL_OFF OPENSSL NSS OPTIONS_SUB= yes SERIAL_DESC= SERIAL support USB_DESC= USB support NEON_DESC= NEON XML/HTTP support PDU_DESC= Powerman PDU support MODBUS_DESC= Modbus support CGI_DESC= Web CGI interface FREEIPMI_DESC= freeipmi support IPMIPSU_DESC= Use nut-ipmipsu support (experimental) SSL_OFF_DESC= No SSL support DEV_DESC= Install developer tools USE_RC_SUBR= nut nut_upsmon nut_upslog SUB_LIST+= STATEDIR=${STATEDIR} NUT_USER=${NUT_USER} NUT_GROUP=${NUT_GROUP} PLIST_SUB+= STATEDIR=${STATEDIR} PORTDOCS= * TMPDIR?= /tmp INSTALL_TARGET= install-strip CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/nut \ --program-transform-name="" \ --localstatedir=${STATEDIR} \ --datadir=${PREFIX}/etc/nut \ --mandir=${PREFIX}/share/man/nut \ --with-devd-dir=${PREFIX}/etc/devd \ --with-drvpath=${PREFIX}/libexec/nut \ --with-statepath=${STATEDIR} \ --with-altpidpath=${STATEDIR} \ --with-pidpath=${STATEDIR} \ --with-pkgconfig-dir=${PREFIX}/libdata/pkgconfig \ --with-user=${NUT_USER} \ --with-group=${NUT_GROUP} \ --with-python=${PYTHON_CMD} \ --without-python2 \ --with-python3=${PYTHON_CMD} \ --without-nut_monitor \ --with-ltdl --with-nut-scanner \ --without-augeas-lenses-dir \ --enable-extapi-enphase=no GNU_CONFIGURE_MANPREFIX=${PREFIX}/share CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib -pthread LIB_DEPENDS+= libltdl.so:devel/libltdl MANPAGES_CONFIGURE_ON= --with-doc=man=auto MANPAGES_CONFIGURE_OFF= --with-doc=no CGI_LIB_DEPENDS= libgd.so:graphics/gd CGI_CONFIGURE_WITH= cgi CGI_CONFIGURE_ON= --with-cgipath=${CGIDIR} \ --with-htmlpath=${WWWDIR} \ --with-gd-includes=-I${LOCALBASE}/include \ --with-gd-libs="-L${LOCALBASE}/lib -lgd" SERIAL_CONFIGURE_WITH= serial USB_CONFIGURE_WITH= usb=auto USB_LIB_DEPENDS= libgio-2.0.so:devel/glib20 SNMP_LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp SNMP_CONFIGURE_WITH= snmp NEON_LIB_DEPENDS= libneon.so:www/neon NEON_CONFIGURE_WITH= neon PDU_LIB_DEPENDS= libpowerman.so:sysutils/powerman PDU_CONFIGURE_WITH= powerman MODBUS_LIB_DEPENDS= libmodbus.so:comms/libmodbus MODBUS_CONFIGURE_WITH= modbus AVAHI_BUILD_DEPENDS= ${LOCALBASE}/include/avahi-ui/avahi-ui.h:net/avahi-header AVAHI_BUILD_DEPENDS= avahi-daemon:net/avahi-app AVAHI_RUN_DEPENDS= avahi-daemon:net/avahi-app AVAHI_CONFIGURE_WITH= avahi FREEIPMI_LIB_DEPENDS= libfreeipmi.so:sysutils/freeipmi FREEIPMI_CONFIGURE_WITH=freeipmi IPMIPSU_LIB_DEPENDS= libfreeipmi.so:sysutils/freeipmi IPMIPSU_CONFIGURE_WITH= ipmi OPENSSL_USES= ssl OPENSSL_CONFIGURE_WITH= openssl NSS_LIB_DEPENDS= libnss3.so:security/nss NSS_CONFIGURE_WITH= nss DEV_CONFIGURE_WITH= dev .include post-patch: @${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -i '' -e 's|/usr/bin/env python|${PYTHON_CMD}|' @${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -i '' -e 's|/usr/local/ups|${PREFIX}|' pre-install: @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nut .if ${PORT_OPTIONS:MUSB} @${REINPLACE_CMD} -e 's/device-name\*/cdev/g' ${WRKSRC}/scripts/devd/nut-usb.conf .endif post-install: @${MKDIR} ${STAGEDIR}${STATEDIR} @${MKDIR} ${STAGEDIR}${PREFIX}/etc/syslog.d .if ${PORT_OPTIONS:MBASH} @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d/ ${INSTALL_DATA} ${WRKSRC}/scripts/misc/nut.bash_completion ${STAGEDIR}${PREFIX}/etc/bash_completion.d/ .endif .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR}/cables ${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${STAGEDIR}${DOCSDIR}/cables ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/docs/FAQ.txt ${STAGEDIR}${DOCSDIR} .for file in AUTHORS COPYING INSTALL MAINTAINERS NEWS README ${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR} .endfor .endif @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${PATCHDIR}/nut.syslog ${STAGEDIR}${EXAMPLESDIR}/syslog.sample ${INSTALL_DATA} ${PATCHDIR}/nut.newsyslog ${STAGEDIR}${EXAMPLESDIR}/newsyslog.sample ${INSTALL_DATA} ${PATCHDIR}/nut_upslog.sample ${STAGEDIR}${EXAMPLESDIR}/nut_upslog.sample ${MKDIR} ${STAGEDIR}/var/log/nut .include diff --git a/sysutils/nut/files/patch-configure b/sysutils/nut/files/patch-configure new file mode 100644 index 000000000000..8d490e0823f5 --- /dev/null +++ b/sysutils/nut/files/patch-configure @@ -0,0 +1,41 @@ +--- configure.orig 2026-04-09 09:46:14.395464000 -0700 ++++ configure 2026-04-09 10:04:59.108399000 -0700 +@@ -9339,20 +9339,8 @@ + if test -n "`${PROBE_OS_GROUP} nogroup`" && test -z "`${PROBE_OS_GROUP} \"${RUN_AS_GROUP}\"`" + then : + RUN_AS_GROUP="nogroup" +- +-fi + +-for TOKEN in upsmon nutmon ups nut; do +- if test -n "`${PROBE_OS_USER} ${TOKEN}`" +-then : +- RUN_AS_USER="${TOKEN}" +-fi +- if test -n "`${PROBE_OS_GROUP} ${TOKEN}`" +-then : +- RUN_AS_GROUP="${TOKEN}" + fi +-done +-unset TOKEN + + case ${target_os} in #( + *mingw*) : +@@ -41472,7 +41460,7 @@ + then : + withval=$with_nut_monitor; nut_with_nut_monitor="${withval}" + else $as_nop +- nut_with_nut_monitor="auto" ++ nut_with_nut_monitor="no" + + fi + +@@ -47583,7 +47571,7 @@ + fi + if test -n "${nut_with_nut_monitor_py2gtk2}${nut_with_nut_monitor_py3qt5}${nut_with_nut_monitor_py3qt6}" ; then + case "${nut_with_nut_monitor}" in +- "auto") nut_with_nut_monitor="yes" ;; ++ "auto") nut_with_nut_monitor="no" ;; + esac + else + case "${nut_with_nut_monitor}" in diff --git a/sysutils/nut/files/patch-configure.ac b/sysutils/nut/files/patch-configure.ac deleted file mode 100644 index f4ba07af7082..000000000000 --- a/sysutils/nut/files/patch-configure.ac +++ /dev/null @@ -1,34 +0,0 @@ ---- configure.ac.orig 2025-11-17 08:11:32.054205000 -0800 -+++ configure.ac 2025-11-17 08:19:12.634169000 -0800 -@@ -509,13 +509,6 @@ - [RUN_AS_GROUP="nogroup"] - ) - --dnl Last hit wins, user and groups accounts separately --for TOKEN in upsmon nutmon ups nut; do -- AS_IF([test -n "`${PROBE_OS_USER} ${TOKEN}`"], [RUN_AS_USER="${TOKEN}"]) -- AS_IF([test -n "`${PROBE_OS_GROUP} ${TOKEN}`"], [RUN_AS_GROUP="${TOKEN}"]) --done --unset TOKEN -- - dnl NOTE: NUT legacy default, keep as is for least surprise - dnl Distributions are however welcome to specify the option to use tmpfs - AS_CASE([${target_os}], -@@ -2844,7 +2837,7 @@ - - dnl A Python GUI client application for the sysadmin desktop - dnl (not necessarily on the NUT server itself): --NUT_ARG_WITH([nut_monitor], [install the NUT-Monitor GUI files], [auto]) -+NUT_ARG_WITH([nut_monitor], [install the NUT-Monitor GUI files], [no]) - NUT_ARG_WITH([pynut], [install the PyNUT module files (yes, no, app, auto)], [auto]) - dnl Note: we did NUT_CHECK_PYTHON2 NUT_CHECK_PYTHON3 etc above, - dnl and if at all possible, we generate the files from .in templates -@@ -3534,7 +3527,7 @@ - dnl Can we satisfy any NUT-Monitor installation request? - if test -n "${nut_with_nut_monitor_py2gtk2}${nut_with_nut_monitor_py3qt5}${nut_with_nut_monitor_py3qt6}" ; then - case "${nut_with_nut_monitor}" in -- "auto") nut_with_nut_monitor="yes" ;; -+ "auto") nut_with_nut_monitor="no" ;; - esac - else - case "${nut_with_nut_monitor}" in