ports/mail/sqlgrey/Makefile
Florian Smeets 92a030dffd databases/p5-DBD-mysql: Fix for MariaDB users
Add a new variable DBD_MYSQL, use that in *_DEPENDS and add mysql to USES
where required. DBD_MYSQL will automatically set the correct DBD dependency.

In cd16748194 databases/p5-DBD-mysql was updated to 5.x, in 5.x the
support for MariaDB was removed and only MySQL >= 8.0 is supported.

In the 4.x releases MariaDB is still supported, according to upstream 4.x
will still be supported for a while [1], so use that for now when we detect
that MYSQL_FLAVOUR is set to mariadb. databases/p5-DBD-mysql4 was added in
d95f49cb3b.

DBD:MariaDB would be another alternative, but migrating to it might need
more analysis than just staying with the 4.x releases of p5-DBD-mysql. This
thread on the amavis-users mailing list has a very good summary [2] from
the author of DBD:MariaDB.

This includes ideas and suggestions from vvd and mat. Thanks!

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277889#c17
[2] https://lists.amavis.org/pipermail/amavis-users/2024-March/006823.html

PR:		275100, 277889
Reviewed by:	vvd, mat
Fixes:	cd16748194
Differential Revision: https://reviews.freebsd.org/D44662
2024-04-07 11:36:13 +02:00

63 lines
2 KiB
Makefile

PORTNAME= sqlgrey
PORTVERSION= 1.8.0
PORTREVISION= 6
CATEGORIES= mail
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-1.8%20%28stable%29
MAINTAINER= ports@FreeBSD.org
COMMENT= Greylisting policy server for Postfix using an SQL backend
WWW= https://sqlgrey.sourceforge.net/
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
RUN_DEPENDS= p5-Net-Server>=0:net/p5-Net-Server \
p5-IO-Multiplex>=0:devel/p5-IO-Multiplex \
p5-Pod-Parser>=0:textproc/p5-Pod-Parser \
${LOCALBASE}/bin/bash:shells/bash \
${LOCALBASE}/bin/gmd5sum:sysutils/coreutils
USES= perl5 shebangfix
SHEBANG_FILES= ${WRKSRC}/sqlgrey-logstats.pl ${WRKSRC}/update_sqlgrey_config ${WRKSRC}/sqlgrey
USE_PERL5= run
USE_RC_SUBR= sqlgrey
NO_BUILD= yes
NO_ARCH= yes
ETCFILES= clients_fqdn_whitelist clients_ip_whitelist dyn_fqdn.regexp smtp_server.regexp sqlgrey.conf
USERS= sqlgrey
GROUPS= ${USERS}
SUB_LIST= PERL=${PERL} USERS=${USERS} GROUPS=${GROUPS}
PLIST_SUB= TOUCH=${TOUCH}
PORTDOCS= Changelog FAQ HOWTO README TODO
OPTIONS_DEFINE= PGSQL MYSQL SQLITE STATS DOCS
OPTIONS_DEFAULT=PGSQL
STATS_DESC= Depend on Date::Calc for logstats.pl script
PGSQL_RUN_DEPENDS= p5-DBD-Pg>=0:databases/p5-DBD-Pg
MYSQL_RUN_DEPENDS= ${DBD_MYSQL}
MYSQL_USES= mysql
SQLITE_RUN_DEPENDS= p5-DBD-SQLite>=0:databases/p5-DBD-SQLite
STATS_RUN_DEPENDS= p5-Date-Calc>=0:devel/p5-Date-Calc
post-patch:
@${REINPLACE_CMD} -e 's!/etc/sqlgrey!${ETCDIR}!g' ${WRKSRC}/sqlgrey
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/sqlgrey-logstats.pl ${STAGEDIR}${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/sqlgrey ${STAGEDIR}${PREFIX}/sbin
${INSTALL_SCRIPT} ${WRKSRC}/update_sqlgrey_config ${STAGEDIR}${PREFIX}/sbin
cd ${WRKSRC} && perldoc -u sqlgrey | pod2man sqlgrey > ${STAGEDIR}${PREFIX}/share/man/man1/sqlgrey.1
@${MKDIR} ${STAGEDIR}${ETCDIR}
.for i in ${ETCFILES}
${INSTALL_DATA} ${WRKSRC}/etc/${i} ${STAGEDIR}${ETCDIR}/${i}.sample
.endfor
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>