freebsd-ports/textproc/write-good/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

76 lines
2.6 KiB
Makefile

PORTNAME= write-good
DISTVERSIONPREFIX= v
DISTVERSION= 1.0.8
CATEGORIES= textproc
MASTER_SITES= LOCAL/0mp/:npm
DISTFILES= ${_NPM_DISTFILES}
MAINTAINER= 0mp@FreeBSD.org
COMMENT= Naive linter for English prose
WWW= https://github.com/btford/write-good
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= npm:www/npm
USES= nodejs:run
USE_GITHUB= yes
GH_ACCOUNT= btford
NO_ARCH= yes
NO_BUILD= yes
OPTIONS_DEFINE= DOCS
PORTDOCS= README.md
.if !defined(MAINTAINER_MODE)
_NPM_DISTFILES= ${_NPM_DISTFILE_cache}:npm \
${_NPM_DISTFILE_modules}:npm
.endif
_NPM_DISTFILE_cache= ${PORTNAME}-${DISTVERSION}.cache${EXTRACT_SUFX}
_NPM_DISTFILE_modules= ${PORTNAME}-${DISTVERSION}.modules${EXTRACT_SUFX}
_UNNECESSARY_FILES= test .dockerignore \
.eslintrc .gitignore .npmignore .pre-commit-hooks.yaml \
.travis.yml Dockerfile LICENSE README.md
_LIBEXEC_REL= libexec/${PORTNAME}
_LIBEXEC= ${STAGEDIR}${PREFIX}/${_LIBEXEC_REL}
do-install:
@${MKDIR} ${_LIBEXEC}
(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${_LIBEXEC})
${RLN} ${_LIBEXEC}/bin/${PORTNAME}.js ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${RLN} ${_LIBEXEC}/bin/${PORTNAME}.js ${STAGEDIR}${PREFIX}/bin/writegood
${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/writegood
(cd ${_LIBEXEC} && ${RM} -r ${_UNNECESSARY_FILES})
post-install:
# Build plist automatically to avoid listing all the node_modules files.
(cd ${STAGEDIR}${PREFIX} && \
${FIND} ${_LIBEXEC_REL}/node_modules -not -type d >> ${TMPPLIST})
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_MAN} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
# - Requires npm (e.g., from www/npm).
# - Remember to set MAINTAINER_MODE,
# e.g., "make -DMAINTAINER_MODE _npm-regenerate".
_npm-regenerate:
${MAKE} clean patch
(cd ${WRKSRC} && ${SETENV} ${_NPM_ENV} npm install --ignore-scripts)
${FIND} ${WRKDIR}/.npm ${WRKSRC}/node_modules -exec ${TOUCH} -h -d 1970-01-01T00:00:00Z {} \;
(cd ${WRKDIR} && \
${FIND} .npm/_cacache -print0 | LC_ALL=C ${SORT} -z | \
${TAR} czf ${WRKDIR}/${_NPM_DISTFILE_cache} --format=bsdtar --uid 0 --gid 0 --options gzip:!timestamp --no-recursion --null -T -)
(cd ${WRKDIR} && \
${FIND} ${WRKSRC:T}/node_modules -print0 | LC_ALL=C ${SORT} -z | \
${TAR} czf ${WRKDIR}/${_NPM_DISTFILE_modules} --format=bsdtar --uid 0 --gid 0 --options gzip:!timestamp --no-recursion --null -T -)
scp ${WRKDIR}/${_NPM_DISTFILE_cache} ${WRKDIR}/${_NPM_DISTFILE_modules} 0mp@freefall.freebsd.org:public_distfiles/
cp ${WRKDIR}/${_NPM_DISTFILE_cache} ${WRKDIR}/${_NPM_DISTFILE_modules} ${DISTDIR}/
.include <bsd.port.mk>