freebsd-ports/sysutils/nut/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.

Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.

There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.

This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.

There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.

The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.

Approved by:		portmgr (tcberner)
2022-09-07 23:10:59 +02:00

151 lines
4.7 KiB
Makefile

PORTNAME= nut
PORTVERSION= 2.8.0
PORTREVISION= 11
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?= uucp
NUT_GROUP?= uucp
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 FREEIPMI DOCS MANPAGES OPENSSL
OPTIONS_DEFINE= SERIAL USB SNMP NEON PDU MODBUS CGI BASH AVAHI IPMIPSU FREEIPMI DOCS MANPAGES
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
USE_RC_SUBR= nut nut_upsmon nut_upslog
SUB_LIST+= STATEDIR=${STATEDIR}
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 \
--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-dev
CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib
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
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
BASH_BUILD_DEPENDS= ${LOCALBASE}/share/bash-completion/bash_completion.sh:shells/bash-completion
BASH_RUN_DEPENDS= ${LOCALBASE}/share/bash-completion/bash_completion.sh:shells/bash-completion
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
.include <bsd.port.pre.mk>
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
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 ChangeLog INSTALL MAINTAINERS NEWS README UPGRADING
${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
@${RM} ${STAGEDIR}${PREFIX}/etc/nut/solaris-init/nut
@${RMDIR} ${STAGEDIR}${PREFIX}/etc/nut/solaris-init
.include <bsd.port.post.mk>