freebsd-ports/chinese/phpbb-tw/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

96 lines
3.0 KiB
Makefile

PORTNAME= phpbb
PORTVERSION= 2.0.23
CATEGORIES= chinese www
MASTER_SITES= LOCAL/chinsan/php/ \
http://freebsd.ee.ccu.edu.tw/
PKGNAMESUFFIX= -tw
DISTNAME= phpBB-tw-${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= The Traditional Chinese version of phpBB
WWW= https://www.phpbb.com/
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/docs/COPYING
RUN_DEPENDS= ${LOCALBASE}/share/pear/System.php:devel/pear@${PHP_FLAVOR}
CONFLICTS_INSTALL= phpbb phpbb3 zh-phpbb3-tw # share/doc/phpbb/AUTHORS share/doc/phpbb/CHANGELOG.html
USES= dos2unix php
IGNORE_WITH_PHP= 82
# Get HOSTNAME
.if exists(/sbin/sysctl)
HOSTNAME!= /sbin/sysctl -n kern.hostname
.else
HOSTNAME!= /usr/sbin/sysctl -n kern.hostname
.endif
# The phpBB2 port supports a number of variables that may be tweaked at build
# time. Perform a "make options" to see more information on these variables.
#
WWWDOCROOT?= www
PHPBB_URL?= phpBB2
#
# End of user-configurable variables.
# Set/override/append to variables from bsd.port.mk:
#
WRKSRC= ${WRKDIR}/phpBB2
NO_BUILD= yes
NO_ARCH= yes
SUB_FILES= pkg-message
SUB_LIST= PHPBB_URL="${PHPBB_URL}" \
PHPBBDIR="${PHPBBDIR}" \
HOSTNAME="${HOSTNAME}" \
DELETEFILES="${EXCEPTFILES}"
PHPBB_VER= ${PORTVERSION:S/.//g:S/.//g}
PLIST_SUB+= PHPBBDIR=${PHPBBDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
PLIST_SUB+= PHPBB_VER=${PHPBB_VER}
# Set custom variables:
#
PHPBBDIR= ${WWWDOCROOT}/${PHPBB_URL}
PKGOPTS= ${FILESDIR}/pkg-opts
EXCEPTFILES= ${STAGEDIR}${PREFIX}/${PHPBBDIR}/install/install.php \
${STAGEDIR}${PREFIX}/${PHPBBDIR}/install/upgrade.php \
${STAGEDIR}${PREFIX}/${PHPBBDIR}/install/update_to_latest.php
OPTIONS_DEFINE= DOCS
options:
@ ${ECHO_MSG} "===> Build options for ${PKGNAME}:"
@ ${CAT} ${PKGOPTS}
pre-everything::
.if !defined(BATCH)
@ ${TEST} -r ${PKGOPTS} && \
(${ECHO_MSG} '-------------------------------------------------------------------------'; \
${ECHO_MSG} 'Perform a "make options" to see a list of available installation options.'; \
${ECHO_MSG} '-------------------------------------------------------------------------')
.endif
post-patch:
@ ${REINPLACE_CMD} -e "s#\.\./templates#/${PHPBB_URL}/templates#" \
${WRKSRC}/docs/*.html
@${RM} `${FIND} ${WRKSRC} -name '*.orig'`
do-install:
@ ${MKDIR} -m 0775 ${STAGEDIR}${PREFIX}/${PHPBBDIR}
@ cd ${WRKSRC} && ${FIND} * \( -name config.php \
${EXCEPTFILES:S/^/-o -name /} \
-o -name docs -a -prune -o -name contrib -a -prune \) -o -print \
| ${TAR} cTf - - | ${TAR} xUCf ${STAGEDIR}${PREFIX}/${PHPBBDIR} -
@ ${TOUCH} ${STAGEDIR}${PREFIX}/${PHPBBDIR}/config.php
@ ${MKDIR} ${STAGEDIR}${DATADIR}/contrib
@ cd ${WRKSRC} && ${INSTALL_DATA} ${EXCEPTFILES} ${STAGEDIR}${DATADIR}
@ cd ${WRKSRC}/contrib && ${INSTALL_DATA} * ${STAGEDIR}${DATADIR}/contrib
# @ cd ${DATADIR} && ${INSTALL} -c -o ${WWWOWN} -g ${WWWGRP} \
# ${EXCEPTFILES} ${PREFIX}/${PHPBBDIR}
@ ${MKDIR} ${STAGEDIR}${DOCSDIR}
@ cd ${WRKSRC}/docs && ${FIND} * -type f -maxdepth 0 \! -name \*.bak \
\! -name COPYING -exec ${INSTALL_DATA} {} ${STAGEDIR}${DOCSDIR} \;
.include <bsd.port.mk>