Bug 181798

Summary: Ports specifying WANT_MYSQL_VER failing with MariaDB
Product: Ports & Packages Reporter: Bernard Spil <brnrd>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Bernard Spil freebsd_committer freebsd_triage 2013-09-04 09:10:00 UTC
Ports specifying WANT_MYSQL_VER (e.g. mail/dspam, databases/p5-DBD-mysql55) fail when MariaDB is installed.

I've hacked the mail/dspam Makefile to suffix an m to the version using an extra knob MARIADB but a quick check verifies that other ports specifying WANT_MYSQL_VER fail the same way

[root@build3 p5-DBD-mysql55]# make
===>  p5-DBD-mysql55-4.023 cannot install: MySQL versions mismatch: mysql55m-client is installed and wanted version is mysql55-client.
*** [all] Error code 1

Stop in /usr/ports/databases/p5-DBD-mysql55.

Was trying to patch /usr/ports/Mk/bsd.database.mk but haven't found a proper way of adding the suffix m to the version to make it play nice with MariaDB

Fix: 

suffix an m to the WANT_MYSQL_VER
How-To-Repeat: Install MariaDB
build mail/dspam WITH_MYSQL55
Comment 1 Bernard Spil freebsd_committer freebsd_triage 2013-09-04 14:25:25 UTC
Meanwhile I've created a patch that works for me (tested with
mail/dspam and databases/p5-DBD-mysql)

==== BEGIN PATCH
--- bsd.database.mk.orig        2013-08-05 21:43:39.000000000 +0200
+++ bsd.database.mk     2013-09-04 15:22:30.070278068 +0200
@@ -132,7 +132,13 @@
 .if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} != ${WANT_MYSQL_VER}
 IGNORE=                cannot install: the port wants
mysql${WANT_MYSQL_VER}-client and you try to install
mysql${WITH_MYSQL_VER}-client
 .endif
-MYSQL_VER=     ${WANT_MYSQL_VER}
+.if ${_PERCONA} == 1
+MYSQL_VER=     ${WANT_MYSQL_VER}p
+.elif ${_MARIADB} == 1
+MYSQL_VER=      ${WANT_MYSQL_VER}m
+.else
+MYSQL_VER=      ${WANT_MYSQL_VER}
+.endif
 .elif defined(WITH_MYSQL_VER)
 MYSQL_VER=     ${WITH_MYSQL_VER}
 .else
==== END PATCH
Comment 2 Chris Rees freebsd_committer freebsd_triage 2013-09-08 22:03:57 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Hi Alex-- you can have first go at this, since it's the mysql section. 
If you would prefer, you can reassign this back to me and I'll fix it.