1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00
freebsd-ports/comms/atslog/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

112 lines
3.6 KiB
Makefile

PORTNAME= atslog
PORTVERSION= 2.1.1
PORTREVISION= 10
CATEGORIES= comms
MASTER_SITES= BERLIOS
MAINTAINER= ports@FreeBSD.org
COMMENT= Software for collecting and analyzing calls from different PBX models
WWW= http://www.atslog.com/en/about/
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= perl5 shebangfix
SHEBANG_FILES= data/sql/install-sql.pl \
include/atslogcleardb.pl.in include/atslogdb.pl.in
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --localstatedir=/var
USE_RC_SUBR= ${PORTNAME}d
PLIST_SUB= WWWOWN="${WWWOWN}" WWWGRP="${WWWGRP}"
SUB_FILES= pkg-message
PORTDOCS= CHANGES ChangeLog DEINSTALL INSTALL TODO UPDATING USAGE
OPTIONS_DEFINE= EXAMPLES LIBWRAP WWW WWWGD DOCS
OPTIONS_DEFAULT= LIBWRAP MYSQL WWW WWWGD
OPTIONS_MULTI= DB
OPTIONS_MULTI_DB= PGSQL MYSQL
OPTIONS_SUB= yes
LIBWRAP_DESC= Enable TCP wrapper support
WWW_DESC= Install web interface
WWWGD_DESC= Graphic reports
MYSQL_USES= mysql
MYSQL_BUILD_DEPENDS= ${DBD_MYSQL}
MYSQL_RUN_DEPENDS= ${DBD_MYSQL}
PGSQL_USES= pgsql
PGSQL_BUILD_DEPENDS= p5-DBD-Pg>=0:databases/p5-DBD-Pg
PGSQL_RUN_DEPENDS= p5-DBD-Pg>=0:databases/p5-DBD-Pg
LIBWRAP_CONFIGURE_OFF= --disable-libwrap
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MWWW}
USES+= php:web
.if ${PORT_OPTIONS:MWWWGD}
USE_PHP+= gd
.endif
.if ${PORT_OPTIONS:MMYSQL}
USE_PHP+= mysqli
.endif
.if ${PORT_OPTIONS:MPGSQL}
USE_PHP+= pgsql
.endif
.endif
post-patch:
@${REINPLACE_CMD} -e 's|createsqltables.|${DATADIR}/sql/createsqltables.|g' \
-e 's|data.sql|${DATADIR}/sql/data.sql|' ${WRKSRC}/data/sql/install-sql.pl
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${USE_RC_SUBR}/${USE_RC_SUBR} ${STAGEDIR}${PREFIX}/bin
@${MKDIR} ${STAGEDIR}${PREFIX}/share/man/ru.KOI8-R/man8
.for i in ${USE_RC_SUBR} ${PORTNAME}master
${INSTALL_MAN} ${WRKSRC}/man/en/${i}.8 ${STAGEDIR}${PREFIX}/share/man/man8
${INSTALL_MAN} ${WRKSRC}/man/ru.KOI8-R/${i}.8 ${STAGEDIR}${PREFIX}/share/man/ru.KOI8-R/man8
.endfor
${INSTALL_DATA} ${WRKSRC}/include/${PORTNAME}.conf.default ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
${INSTALL_DATA} ${WRKSRC}/include/${PORTNAME}.conf.default.rus ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.rus.sample
.for i in atslogcleardb.pl atslogdb.pl atslogmaster
${INSTALL_SCRIPT} ${WRKSRC}/include/${i} ${STAGEDIR}${PREFIX}/bin
.endfor
@${MKDIR} ${STAGEDIR}${DATADIR}/lang
(cd ${WRKSRC}/include && \
${FIND} lang -type f ! -iregex ".*Makefile" -exec \
${INSTALL_DATA} {} "${STAGEDIR}${DATADIR}/{}" \;)
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/textlogs
(cd ${WRKSRC}/data && \
${FIND} textlogs -type f -exec \
${INSTALL_DATA} {} "${STAGEDIR}${EXAMPLESDIR}/{}" \;)
@${MKDIR} ${STAGEDIR}${DATADIR}/sql
(cd ${WRKSRC}/data && \
${FIND} sql -type f -iregex ".*\.sql" -exec \
${INSTALL_DATA} {} "${STAGEDIR}${DATADIR}/{}" \;)
${INSTALL_SCRIPT} ${WRKSRC}/data/sql/install-sql.pl ${STAGEDIR}${DATADIR}/sql
@${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}
(cd ${WRKSRC}/libexec && \
${FIND} -E . -type f ! -iregex ".*\.(sh|orig)" -exec \
${INSTALL_DATA} {} "${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/{}" \;)
${INSTALL_SCRIPT} ${WRKSRC}/libexec/genindex.sh ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}
@${MKDIR} ${STAGEDIR}${WWWDIR}
cd ${WRKSRC}/www && \
${FIND} . -type d ! -empty -exec \
${MKDIR} "${STAGEDIR}${WWWDIR}/{}" \; && \
${FIND} -E . -type f ! -iregex "(.*Makefile|.*\.orig)" -exec \
${INSTALL_DATA} {} "${STAGEDIR}${WWWDIR}/{}" \;
${MV} ${STAGEDIR}${WWWDIR}/include/config.inc.php.default ${STAGEDIR}${WWWDIR}/include/config.inc.php.sample
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
.endfor
.include <bsd.port.mk>