1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00
freebsd-ports/net-mgmt/pnp/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

104 lines
3.0 KiB
Makefile

PORTNAME= pnp
PORTVERSION= 0.6.26
PORTREVISION= 2
CATEGORIES= net-mgmt
MASTER_SITES= SF/pnp4nagios/PNP-0.6
DISTNAME= pnp4nagios-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
MAINTAINER?= joneum@FreeBSD.org
COMMENT?= Nagios / Icinga performance data collector and grapher
WWW= https://www.pnp4nagios.org/
LICENSE= GPLv2
BUILD_DEPENDS= ${LOCALBASE}/bin/rrdtool:databases/rrdtool
RUN_DEPENDS?= ${LOCALBASE}/bin/rrdtool:databases/rrdtool \
nagios:net-mgmt/nagios
MAKE_JOBS_UNSAFE= yes
USES= dos2unix perl5 php php:web
OPTIONS_DEFINE= PDF EXAMPLES
OPTIONS_DEFAULT= PDF
PDF_DESC= Use built-in fpdf library to produce PDF views
PDF_EXTRA_PATCHES_OFF= ${FILESDIR}/extra-patch-disable-pdf
.include <bsd.port.options.mk>
USE_PHP= gd iconv json pcre session simplexml sockets xml zlib
USE_RC_SUBR= npcd
DOS2UNIX_REGEX= '.*\.\(php\|js\|txt\)$$'
NAGIOSDIR?= /var/spool/nagios
NAGIOSHTMURL?= /nagios
NAGIOSUSER?= nagios
NAGIOSGROUP?= nagios
PNP_STATE= ${NAGIOSDIR}/pnp
PNP_RRDS= ${PNP_STATE}/rrd
PNP_SPOOL= ${PNP_STATE}/perfspool
PNP_URL?= ${NAGIOSHTMURL}/pnp
FPDF_DIR?= share/fpdf
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= \
--sysconfdir=${ETCDIR} \
--datarootdir=${WWWDIR} \
--datadir=${WWWDIR} \
--localstatedir=/var/log \
--with-rrdtool=${LOCALBASE}/bin/rrdtool \
--with-perfdata-dir=${PNP_RRDS} \
--with-perfdata-spool-dir=${PNP_SPOOL} \
--with-nagios-user=${NAGIOSUSER} \
--with-nagios-group=${NAGIOSGROUP}
# Get rid of INSTALL_OPTS that are set by configure --
# we want the things to be installed with root:wheel and
# NAGIOSUSER:NAGIOSGROUP are going to the configuration files.
MAKE_ARGS= INSTALL_OPTS=
INSTALL_TARGET= install install-config
PLIST_SUB+= NAGIOSDIR=${NAGIOSDIR} \
NAGIOSUSER=${NAGIOSUSER} \
NAGIOSGROUP=${NAGIOSGROUP} \
WWWOWN=${WWWOWN} \
WWWGRP=${WWWGRP}
SUB_FILES= pkg-message
SUB_LIST= PNP_RRDS=${PNP_RRDS} \
PNP_URL=${PNP_URL} \
NAGIOSUSER=${NAGIOSUSER} \
NAGIOSGROUP=${NAGIOSGROUP}
SAMPLE_CONFIGS= lighttpd.pnp4nagios.conf nginx.pnp4nagios.conf httpd.conf
.if ${PORT_OPTIONS:MPDF}
PNP_USE_FPDF= 1
.else
PNP_USE_FPDF= 0
.endif
post-patch:
@${REINPLACE_CMD} \
-e's|^\$$conf\['\''use_fpdf'\''\] = [[:digit:]];|$$conf['\''use_fpdf'\''] = ${PNP_USE_FPDF};|' \
-e's|^\$$conf\['\''nagios_base'\''\] = "/nagios/cgi-bin";|$$conf\['\''nagios_base'\''\] = "${NAGIOSHTMURL}/cgi-bin";|' \
-e's|/usr/local/check_mk/|/usr/local/share/check_mk/|g' \
-e's|/usr/local/nagios/var/rw/live|/${NAGIOSDIR}/rw/live|' \
"${WRKSRC}/sample-config/pnp/config.php.in"
.for f in ${SAMPLE_CONFIGS}
@${REINPLACE_CMD} -e 's|@BASE_URL@|${PNP_URL}|g' -e 's|@datarootdir@|${WWWDIR}|g' \
-e 's|/usr/local/nagios/etc|${PREFIX}/etc/${NAGIOSUSER}|' -e 's|Nagios|${NAGIOSUSER}|' \
"${WRKSRC}/sample-config/${f}.in"
.endfor
@${LN} -fs ../en_US/dwnld.html ${WRKSRC}/share/pnp/documents/de_DE/dwnld.html
post-install:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
.for f in ${SAMPLE_CONFIGS}
${INSTALL_DATA} ${WRKSRC}/sample-config/${f} ${STAGEDIR}${EXAMPLESDIR}
.endfor
${INSTALL_MAN} ${WRKSRC}/man/npcd.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
.include <bsd.port.mk>