Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Sep 2012 10:59:10 +0200
From:      geoffroy desvernay <dgeo@centrale-marseille.fr>
To:        ports@FreeBSD.org
Subject:   mysql, mariadb, ... => WANT_MYSQL_PROV ?
Message-ID:  <5045C2DE.8030904@centrale-marseille.fr>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------080308010407000101080602
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Hi all,

To help people that use mariadb *and* permit different mariadb versions
in the ports tree, I propose this patch to bsd.database.mk with
MYSQL_PROV, _MYSQL_PROV, WANT_MYSQL_PROV and DEFAULT_MYSQL_PROV that
defaults to mysql to keep current behaviour.

This way, one can define MYSQL_PROV in make.conf to use mariadb, and we
may rename mariadb-* as mariadb53-*, allowing to create mariadb55-* port
at first.

For the moment, only the 'magic' MYSQL_VER=53 can install mariadb,
because the is no mysql53-*, but this is not the same for 5.5...

Any thoughts ?

-- 
*geoffroy desvernay*
C.R.I - Administration systèmes et réseaux
Ecole Centrale de Marseille

--------------080308010407000101080602
Content-Type: text/plain; charset=UTF-8;
 name="bsd.database.mk.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="bsd.database.mk.diff"

--- bsd.database.mk.orig	2012-06-19 01:23:17.000000000 +0200
+++ bsd.database.mk	2012-09-03 20:02:34.000000000 +0200
@@ -34,6 +34,13 @@
 #				- User defined variable to set MySQL version.
 # MYSQL_VER
 #				- Detected MySQL version.
+# DEFAULT_MYSQL_PROV
+#				- default mysql provider
+#				  If none, use installed one. If none, use mysql port
+# WANT_MYSQL_PROV
+#				- Maintainer may use that to match a specific provider
+# MYSQL_PROV
+#				- Provider for mysql* programs (eg: mariadb)
 ##
 # USE_PGSQL		- Add PostgreSQL client dependency.  Components can be depe=
nded
 #				  on using USE_PGSQL=3D	component[:target].  For the full list
@@ -104,6 +111,7 @@
=20
 .if defined(USE_MYSQL)
 DEFAULT_MYSQL_VER?=3D	55
+DEFAULT_MYSQL_PROV?=3D	mysql
 # MySQL client version currently supported.
 MYSQL41_LIBVER=3D		14
 MYSQL50_LIBVER=3D		15
@@ -114,11 +122,27 @@
 # Setting/finding MySQL version we want.
 .if exists(${LOCALBASE}/bin/mysql)
 _MYSQL_VER!=3D	${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distrib=
 \([0-9]\)\.\([0-9]*\).*/\1\2/'
+_MYSQL_PROV!=3D	${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distri=
b [0-9]\.[0-9]*.*-\([A-Za-z]*\),.*/\1/' | tr A-Z a-z
 .endif
=20
+.if defined(WANT_MYSQL_PROV)
+.if defined(WITH_MYSQL_PROV) && ${WITH_MYSQL_PROV} !=3D ${WANT_MYSQL_PRO=
V}
+IGNORE=3D         cannot install: the port wants mysql${WANT_MYSQL_PROV}=
-client and you try to install mysql${WITH_MYSQL_PROV}-client
+.endif
+MYSQL_PROV=3D      ${WANT_MYSQL_PROV}
+.elif defined(WITH_MYSQL_PROV)
+MYSQL_PROV=3D      ${WITH_MYSQL_PROV}
+.else
+.if defined(_MYSQL_PROV)
+MYSQL_PROV=3D      ${_MYSQL_PROV}
+.else
+MYSQL_PROV=3D      ${DEFAULT_MYSQL_PROV}
+.endif
+.endif # WANT_MYSQL_PROV
+
 .if defined(WANT_MYSQL_VER)
 .if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} !=3D ${WANT_MYSQL_VER}
-IGNORE=3D		cannot install: the port wants mysql${WANT_MYSQL_VER}-client =
and you try to install mysql${WITH_MYSQL_VER}-client
+IGNORE=3D		cannot install: the port wants mysql${WANT_MYSQL_VER}-client =
and you try to install ${MYSQL_PROV}${WITH_MYSQL_VER}-client
 .endif
 MYSQL_VER=3D	${WANT_MYSQL_VER}
 .elif defined(WITH_MYSQL_VER)
@@ -131,13 +155,19 @@
 .endif
 .endif # WANT_MYSQL_VER
=20
+.if defined(_MYSQL_PROV)
+.if ${_MYSQL_PROV} !=3D ${MYSQL_PROV}
+IGNORE=3D		cannot install: MySQL provider mismatch: ${_MYSQL_PROV}${_MYS=
QL_VER}-client is installed and wanted provider is ${MYSQL_PROV}
+.endif
+.endif
+
 .if defined(_MYSQL_VER)
 .if ${_MYSQL_VER} !=3D ${MYSQL_VER}
 IGNORE=3D		cannot install: MySQL versions mismatch: mysql${_MYSQL_VER}-c=
lient is installed and wanted version is mysql${MYSQL_VER}-client
 .endif
 .endif
=20
-.if (${MYSQL_VER} =3D=3D "53")
+.if (${MYSQL_PROV} =3D=3D "mariadb" || ${MYSQL_VER} =3D=3D "53")
 _MYSQL_CLIENT=3D	databases/mariadb-client
 _MYSQL_SERVER=3D	databases/mariadb-server
 .else

--------------080308010407000101080602--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5045C2DE.8030904>