Index: Mk/Uses/mysql.mk =================================================================== --- Mk/Uses/mysql.mk +++ Mk/Uses/mysql.mk @@ -74,66 +74,63 @@ _PERCONA!= ${LOCALBASE}/bin/mysql --version | ${GREP} Percona | wc -l _MARIADB!= ${LOCALBASE}/bin/mysql --version | ${GREP} MariaDB | wc -l -.if ${_PERCONA} == 1 -_MYSQL_VER= ${_MYSQL}p -.elif ${_MARIADB} == 1 +.if ${_MARIADB} == 1 _MYSQL_VER= ${_MYSQL}m +.elif ${_PERCONA} == 1 +_MYSQL_VER= ${_MYSQL}p .else _MYSQL_VER= ${_MYSQL} .endif .endif .if defined(_WANT_MYSQL_VER) -.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 +. if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} != ${_WANT_MYSQL_VER} +IGNORE= cannot install: the port wants\ + ${_WANT_MYSQL_VER:C/.*m$/mariadb/:C/.*p$/percona/:C/.*[0-9]$/mysql/}${_WANT_MYSQL_VER:C/[mp]//}-client\ + and you try to install\ + ${WITH_MYSQL_VER:C/.*m$/mariadb/:C/.*p$/percona/:C/.*[0-9]$/mysql/}${WITH_MYSQL_VER:C/[mp]//}-client +. endif MYSQL_VER= ${_WANT_MYSQL_VER} .elif defined(WITH_MYSQL_VER) MYSQL_VER= ${WITH_MYSQL_VER} .else -.if defined(_MYSQL_VER) +. if defined(_MYSQL_VER) MYSQL_VER= ${_MYSQL_VER} -.else +. else MYSQL_VER= ${DEFAULT_MYSQL_VER} -.endif +. endif .endif # _WANT_MYSQL_VER -.if defined(_MYSQL_VER) -.if ${_MYSQL_VER} != ${MYSQL_VER} -IGNORE= cannot install: MySQL versions mismatch: mysql${_MYSQL_VER}-client is installed and wanted version is mysql${MYSQL_VER}-client -.endif -.endif - -.if (${MYSQL_VER:C/[0-9]*//} == "m") -_MYSQL_FLAVOUR= mariadb -.elif (${MYSQL_VER:C/[0-9]*//} == "p") -_MYSQL_FLAVOUR= percona -.else -_MYSQL_FLAVOUR= mysql +.if defined(_MYSQL_VER) && ${_MYSQL_VER} != ${MYSQL_VER} +IGNORE= cannot install: MySQL versions mismatch:\ + ${_MYSQL_VER:C/.*$/mariadb/:C/.*p$/percona/:C/.*[0-9]$/mysql/}${_MYSQL_VER:C/[mp]//}-client\ + is installed and wanted version is\ + ${MYSQL_VER:C/.*m$/mariadb/:C/.*p$/percona/:C/.*[0-9]$/mysql/}${MYSQL_VER:C/[mp]//}-client .endif +_MYSQL_FLAVOUR= ${MYSQL_VER:C/.*$/mariadb/:C/.*p$/percona/:C/.*[0-9]$/mysql/}${_MYSQL_VER:C/[mp]//} _MYSQL_CLIENT= databases/${_MYSQL_FLAVOUR}${MYSQL_VER:C/[mp]//}-client _MYSQL_SERVER= databases/${_MYSQL_FLAVOUR}${MYSQL_VER:C/[mp]//}-server # And now we are checking if we can use it .if defined(MYSQL${MYSQL_VER}_LIBVER) -.if defined(IGNORE_WITH_MYSQL) -. for VER in ${IGNORE_WITH_MYSQL} -. if (${MYSQL_VER} == "${VER}") -IGNORE= cannot install: does not work with MySQL version ${MYSQL_VER} (MySQL ${IGNORE_WITH_MYSQL} not supported) -. endif -. endfor -.endif # IGNORE_WITH_MYSQL -.if defined(_WANT_MYSQL_SERVER) || defined(_WANT_MYSQL_EMBEDDED) +. if defined(IGNORE_WITH_MYSQL) +. for VER in ${IGNORE_WITH_MYSQL} +. if (${MYSQL_VER} == "${VER}") +IGNORE= cannot install: does not work with MySQL version ${MYSQL_VER} (MySQL ${IGNORE_WITH_MYSQL} not supported) +. endif +. endfor +. endif # IGNORE_WITH_MYSQL +. if defined(_WANT_MYSQL_SERVER) || defined(_WANT_MYSQL_EMBEDDED) RUN_DEPENDS+= ${LOCALBASE}/libexec/mysqld:${_MYSQL_SERVER} -.if defined(_WANT_MYSQL_EMBEDDED) +. if defined(_WANT_MYSQL_EMBEDDED) BUILD_DEPENDS+= ${LOCALBASE}/lib/mysql/libmysqld.a:${_MYSQL_SERVER} -.endif -.endif -.if defined(_WANT_MYSQL_CLIENT) || \ +. endif +. endif +. if defined(_WANT_MYSQL_CLIENT) || \ !(defined(_WANT_MYSQL_SERVER) || defined(_WANT_MYSQL_EMBEDDED)) LIB_DEPENDS+= libmysqlclient.so.${MYSQL${MYSQL_VER}_LIBVER}:${_MYSQL_CLIENT} -.endif +. endif .else IGNORE= cannot install: unknown MySQL version: ${MYSQL_VER} .endif # Check for correct libs