freebsd-ports/mail/crm114/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

92 lines
2.9 KiB
Makefile

PORTNAME= crm114
PORTVERSION= 20100106
PORTREVISION= 6
# WARNING change versionname in CRM114RELEASENAME too.
# portlint didn't like this variable at this place.
# So I have to put it down in this file.
CATEGORIES= mail
MASTER_SITES= http://crm114.sourceforge.net/tarballs/
# Oliver Eikemeier recommended the following construction
# to avoid the reduncany of the CRM114RELEASENAME and .src and
# .css extention.
DISTNAME= ${PORTNAME}-${PORTVERSION}-${CRM114RELEASENAME}.src
MAINTAINER= ports@FreeBSD.org
COMMENT= Markov based SpamFilter
WWW= http://crm114.sourceforge.net/
LICENSE= GPLv2
LIB_DEPENDS= libtre.so:textproc/libtre
CRM114RELEASENAME=BlameMichelson
USE_CSTD=gnu89
OPTIONS_DEFINE= NORMALIZEMIME DOCS EXAMPLES
NORMALIZEMIME_DESC= Normalize MIME encoding
MAKE_ARGS= CC="${CC}" prefix="${STAGEDIR}${PREFIX}" \
CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
INSTALL_PROGRAM="${INSTALL_PROGRAM}"
CFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib -Wl,--as-needed
CFLAGS+= -DVERSION='\"${PORTVERSION}-${CRM114RELEASENAME}\"'
CFLAGS+= -DNO_LOGL
CONFLICTS_INSTALL= crmsh # bin/crm
INSTALL_TARGET= install_binary_only
CRM_FILES= mailfilter.crm mailfilter.cf mailreaver.crm mailtrainer.crm \
maillib.crm shuffle.crm rewriteutil.crm rewrites.mfp \
whitelist.mfp blacklist.mfp priolist.mfp priolist.mfp.example \
blacklist.mfp.example whitelist.mfp.example crm114-mode.el \
reto_procmailrc.recipe
.include <bsd.port.options.mk>
post-patch:
@${REINPLACE_CMD} -E \
-e 's,^((LD|C)FLAGS),#\1,;;s,^(prefix=),#\1,;;s,^(.*-install),#\1,' \
-e 's,crmregex_tre.c,crmregex_tre.o,' ${WRKSRC}/Makefile
# Peter Jeremy recommended the use of b64decode and md5 20040302
post-install:
${STRIP_CMD} \
${STAGEDIR}${PREFIX}/bin/crm \
${STAGEDIR}${PREFIX}/bin/cssdiff \
${STAGEDIR}${PREFIX}/bin/cssutil \
${STAGEDIR}${PREFIX}/bin/osbf-util \
${STAGEDIR}${PREFIX}/bin/cssmerge
@${REINPLACE_CMD} -Ee 's|^(.*/openssl base64 -d/)|#\1|' \
-e 's|/mewdecode/|/b64decode -pr/|' ${WRKSRC}/mailfilter.cf
@${REINPLACE_CMD} -e 's|/md5sum/|/md5 -r/|' \
-e 's|#!.*/usr/bin/crm.*|#!${PREFIX}/bin/crm|' \
${WRKSRC}/mailfilter.crm ${WRKSRC}/mailtrainer.crm \
${WRKSRC}/rewriteutil.crm \
${WRKSRC}/mailreaver.crm ${WRKSRC}/shuffle.crm
@for i in priolist.mfp whitelist.mfp; do \
${CP} ${WRKSRC}/$${i}.example ${WRKSRC}/$${i}; \
done
.if ${PORT_OPTIONS:MNORMALIZEMIME}
@${REINPLACE_CMD} -Ee 's|^#(.*/normalizemime/)|\1|' \
${WRKSRC}/mailfilter.cf
.else
@${REINPLACE_CMD} -Ee 's|^#(.*/b64decode -pr/)|\1|' \
${WRKSRC}/mailfilter.cf
.endif
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
for i in ${CRM_FILES}; do \
${INSTALL_DATA} ${WRKSRC}/$${i} ${STAGEDIR}${EXAMPLESDIR}; \
done
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
@for i in ${WRKSRC}/[^G]*.txt ${WRKSRC}/README; do \
${INSTALL_DATA} $${i} ${STAGEDIR}${DOCSDIR}; \
done
.endif
.include <bsd.port.mk>