1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00
freebsd-ports/textproc/libtre/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

94 lines
2.8 KiB
Makefile

PORTNAME= libtre
PORTVERSION= 0.8.0
PORTREVISION= 3
CATEGORIES= textproc
MASTER_SITES= http://laurikari.net/tre/ \
LOCAL/bf
DISTNAME= tre-${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= Lightweight fully POSIX compliant regexp matching library
WWW= https://laurikari.net/tre/
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= libtool localbase:ldflags pathfix pkgconfig tar:bzip2
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-static
USE_LDCONFIG= yes
TEST_TARGET= check
OPTIONS_DEFINE= NLS OPTIMIZED_CFLAGS PGO DOCS
OPTIONS_SUB= yes
NLS_USES= gettext
NLS_CONFIGURE_ENABLE= nls
OPTIMIZED_CFLAGS_CFLAGS= \
-Wuninitialized -ffast-math -finline-functions \
-fomit-frame-pointer -fexpensive-optimizations -O3
PGO_CFLAGS= -fprofile-generate
PGO_LDFLAGS= -fprofile-generate
.include <bsd.port.options.mk>
post-patch: .SILENT
${MV} ${WRKSRC}/doc/agrep.1.in ${WRKSRC}/doc/tre_agrep.1.in
${REINPLACE_CMD} -e 's;agrep\.1;tre_agrep\.1;g' ${WRKSRC}/configure \
${WRKSRC}/tre.spec.in ${WRKSRC}/doc/Makefile.in
${REINPLACE_CMD} -e 's;agrep;tre_agrep;g' ${WRKSRC}/tests/agrep/*.ok
.if ${PORT_OPTIONS:MPGO}
pre-build: pgo
.endif
post-install:
${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in tre-api.html tre-syntax.html
${INSTALL_DATA} ${WRKSRC}/doc/${i} ${STAGEDIR}${DOCSDIR}
.endfor
.if ${PORT_OPTIONS:MPGO}
pgo: pgo-pre-build pgo-build pgo-run pgo-post-run pgo-clean
pgo-pre-build:
@${FIND} ${BUILD_WRKSRC} -type f -name Makefile -exec \
${REINPLACE_CMD} -E \
-e 's,^((C|LD)FLAGS[[:space:]]*=.*)-fprofile-generate,\1,' \
-e 's,^(CFLAGS[[:space:]]*=.*)-fprofile-use,\1,' \
-e 's,^((C|LD)FLAGS[[:space:]]*=.*)$$,\1 -fprofile-generate,' \
{} \;
pgo-build:
@(cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET})
pgo-run:
# Check everything to generate profiling information.
@-(cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} check)
pgo-post-run:
@${FIND} ${BUILD_WRKSRC} -type f -name Makefile -exec \
${REINPLACE_CMD} -E \
-e 's,^((C|LD)FLAGS[[:space:]]*=.*)-fprofile-generate,\1,' \
-e 's,^(CFLAGS[[:space:]]*=.*)-fprofile-use,\1,' \
-e 's,^(CFLAGS[[:space:]]*=.*)$$,\1 -fprofile-use,' \
{} \;
@${REINPLACE_CMD} -E \
-e 's,-fprofile-generate,-fprofile-use,g' \
${CONFIGURE_WRKSRC}/config.status \
${CONFIGURE_WRKSRC}/libtool
@${REINPLACE_CMD} -E \
-e 's,-fprofile-generate,,g' \
${BUILD_WRKSRC}/tre.pc
pgo-clean:
# Selectively clean some directories.
. for dir in src tests
@(cd ${BUILD_WRKSRC}/${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} clean)
. endfor
# Only remove some files from lib to preserve profiling information.
@${FIND} -E ${BUILD_WRKSRC}/lib -iregex ".*\.(a|la|lai|lo|o|so|so\..*)$$" \
-exec ${RM} {} \;
.endif # if ${PORT_OPTIONS:MPGO}
.include <bsd.port.mk>