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 cd16748194e2 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
d95f49cb3b54.

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:	cd16748194e2
Differential Revision: https://reviews.freebsd.org/D44662
2024-04-07 11:36:13 +02:00

55 lines
1.5 KiB
Makefile

PORTNAME= mysql-snmp
DISTVERSIONPREFIX= v
DISTVERSION= 1.2-17
DISTVERSIONSUFFIX= -g1d0b409
PORTREVISION= 2
CATEGORIES= net-mgmt perl5
MAINTAINER= 0mp@FreeBSD.org
COMMENT= Net-SNMP Perl agent for monitoring MySQL servers
WWW= https://github.com/masterzen/mysql-snmp
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
RUN_DEPENDS= net-snmp>=0:net-mgmt/net-snmp \
${DBD_MYSQL} \
p5-DBI>=0:databases/p5-DBI \
p5-Math-BigInt-GMP>=0:math/p5-Math-BigInt-GMP \
p5-Net-SNMP>=5.4.3:net-mgmt/p5-Net-SNMP \
p5-Unix-Syslog>=0:sysutils/p5-Unix-Syslog
USES= mysql perl5 shebangfix
USE_GITHUB= yes
GH_ACCOUNT= masterzen
USE_PERL5= run test
USE_RC_SUBR= mysql-snmp
SHEBANG_FILES= mysql-snmp opennms/* tests/test.pl
NO_ARCH= yes
NO_BUILD= yes
SUB_LIST= PERL=${PERL}
OPTIONS_DEFINE= DOCS
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/mysql-snmp ${STAGEDIR}${PREFIX}/sbin
@${MKDIR} ${STAGEDIR}${PREFIX}/share/snmp/mibs
${INSTALL_DATA} ${WRKSRC}/MYSQL-SERVER-MIB.txt \
${STAGEDIR}${PREFIX}/share/snmp/mibs
${INSTALL_MAN} ${WRKSRC}/mysql-snmp.1 ${STAGEDIR}${PREFIX}/share/man/man1
@${MKDIR} ${STAGEDIR}${DATADIR}
(cd ${WRKSRC} && ${COPYTREE_SHARE} opennms ${STAGEDIR}/${DATADIR})
@${MKDIR} ${STAGEDIR}${ETCDIR}
${INSTALL_DATA} ${WRKSRC}/my.cnf ${STAGEDIR}${ETCDIR}/my.cnf.sample
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
do-test:
@(cd ${WRKSRC} && \
${SETENV} ${TEST_ENV} ${PERL5} -I ${STAGEDIR}${PREFIX}/sbin ./tests/test.pl)
.include <bsd.port.mk>