aboutsummaryrefslogtreecommitdiffstats
path: root/databases/mysql57-client
diff options
context:
space:
mode:
authormmokhi <mmokhi@FreeBSD.org>2017-07-24 00:45:07 +0800
committermmokhi <mmokhi@FreeBSD.org>2017-07-24 00:45:07 +0800
commit6d2a8f929c013175a1700d0492be3f00d75dcad4 (patch)
tree0f2b175c4a61415ef11c102066c5cf1683e11516 /databases/mysql57-client
parent486e85b35b554cec48c6fb532a5390d31ab0c5d7 (diff)
downloadfreebsd-ports-gnome-6d2a8f929c013175a1700d0492be3f00d75dcad4.tar.gz
freebsd-ports-gnome-6d2a8f929c013175a1700d0492be3f00d75dcad4.tar.zst
freebsd-ports-gnome-6d2a8f929c013175a1700d0492be3f00d75dcad4.zip
databases/mysql57-{server client}: Fix broken SASL/LDAP integration on newest 5.7.19 upgrade
-Add a SASL/LDAP option for mysql57-client -Fix plugin.cmake for "FreeBSD != Linux" case For new plugin, MySQL build assumes everything is MacOS or Windows or Linux. This breaks upgrades when you have SASL/LDAP client-library installed. Because it "Decides" that you "Want" SASL/LDAP support and tries to build it. PR: 220865 Submitted by: mmokhi Reported by: Vladimir Omelchuk <admin@vladiom.com.ua> Reviewed by: mat, feld (mentors) Approved by: feld (mentor) MFH: 2017Q3 Differential Revision: https://reviews.freebsd.org/D11667
Diffstat (limited to 'databases/mysql57-client')
-rw-r--r--databases/mysql57-client/Makefile10
-rw-r--r--databases/mysql57-client/files/patch-cmake_plugin.cmake43
-rw-r--r--databases/mysql57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt18
-rw-r--r--databases/mysql57-client/pkg-plist1
4 files changed, 72 insertions, 0 deletions
diff --git a/databases/mysql57-client/Makefile b/databases/mysql57-client/Makefile
index 64447a722880..75a0e5c3557e 100644
--- a/databases/mysql57-client/Makefile
+++ b/databases/mysql57-client/Makefile
@@ -2,6 +2,7 @@
# $FreeBSD$
PORTNAME= mysql
+PORTREVISION= 1
PKGNAMESUFFIX= 57-client
COMMENT= Multithreaded SQL database (client)
@@ -33,6 +34,15 @@ MMAN1= comp_err.1 msql2mysql.1 mysql.1 mysql_config.1 mysql_config_editor.1 mys
CLIENT_ONLY= yes
+OPTIONS_GROUP+= PLUGINS
+PLUGINS_DESC= Default Client Plugins
+OPTIONS_GROUP_PLUGINS= SASLCLIENT
+SASLCLIENT_DESC= SASL client plugin module
+SASLCLIENT_CMAKE_BOOL= WITH_AUTHENTICATION_LDAP
+SASLCLIENT_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2
+SASLCLIENT_BUILD_DEPENDS= ${LOCALBASE}/include/sasl/sasl.h:net/openldap24-sasl-client
+OPTIONS_DEFAULT+= SASLCLIENT
+
# issue 166367: adding symlinks for back-compatibility with ${lib}_r
post-install:
@${LN} -s libmysqlclient.a ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.a
diff --git a/databases/mysql57-client/files/patch-cmake_plugin.cmake b/databases/mysql57-client/files/patch-cmake_plugin.cmake
new file mode 100644
index 000000000000..8716c1b962b4
--- /dev/null
+++ b/databases/mysql57-client/files/patch-cmake_plugin.cmake
@@ -0,0 +1,43 @@
+--- cmake/plugin.cmake.orig 2017-06-22 14:13:19 UTC
++++ cmake/plugin.cmake
+@@ -219,9 +219,16 @@ MACRO(MYSQL_ADD_PLUGIN)
+ # Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
+ # an additional dependency.
+ # Use MYSQL_PLUGIN_IMPORT for static data symbols to be exported.
+- IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
++ #
++ # P.S. "FreeBSD" is obviously not "Linux" but it behaves near similar in this case.
++ IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+ TARGET_LINK_LIBRARIES (${target} mysqld ${ARG_LINK_LIBRARIES})
+ ENDIF()
++ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
++ SET_TARGET_PROPERTIES(${target} PROPERTIES
++ LINK_FLAGS "-L%%FREEBSD_LOCAL_LIB%% ${LINK_FLAGS} "
++ )
++ ENDIF()
+ ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
+
+ IF(NOT ARG_MODULE_ONLY)
+@@ -239,13 +246,17 @@ MACRO(MYSQL_ADD_PLUGIN)
+ MYSQL_INSTALL_TARGETS(${target}
+ DESTINATION ${INSTALL_PLUGINDIR}
+ COMPONENT ${INSTALL_COMPONENT})
+- INSTALL_DEBUG_TARGET(${target}
+- DESTINATION ${INSTALL_PLUGINDIR}/debug
+- COMPONENT ${INSTALL_COMPONENT})
++ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
++ INSTALL_DEBUG_TARGET(${target}
++ DESTINATION ${INSTALL_PLUGINDIR}/debug
++ COMPONENT ${INSTALL_COMPONENT})
++ # Add installed files to list for RPMs
++ FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
++ "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/debug/${ARG_MODULE_OUTPUT_NAME}.so\n")
++ ENDIF()
+ # Add installed files to list for RPMs
+ FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
+- "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n"
+- "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/debug/${ARG_MODULE_OUTPUT_NAME}.so\n")
++ "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n")
+ # For internal testing in PB2, append collections files
+ IF(DEFINED ENV{PB2WORKDIR})
+ PLUGIN_APPEND_COLLECTIONS(${plugin})
diff --git a/databases/mysql57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt b/databases/mysql57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt
new file mode 100644
index 000000000000..05783d914af4
--- /dev/null
+++ b/databases/mysql57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt
@@ -0,0 +1,18 @@
+--- libmysql/authentication_ldap/CMakeLists.txt.orig 2017-07-20 22:54:16 UTC
++++ libmysql/authentication_ldap/CMakeLists.txt
+@@ -52,8 +52,10 @@ ELSE ()
+ SET(SASL_LIBRARY "sasl2")
+ ENDIF ()
+
+-MYSQL_ADD_PLUGIN(authentication_ldap_sasl_client
+- auth_ldap_sasl_client.cc log_client.cc
+- LINK_LIBRARIES ${SASL_LIBRARY}
+- MODULE_ONLY
+- MODULE_OUTPUT_NAME "authentication_ldap_sasl_client")
++IF (WITH_AUTHENTICATION_LDAP)
++ MYSQL_ADD_PLUGIN(authentication_ldap_sasl_client
++ auth_ldap_sasl_client.cc log_client.cc
++ LINK_LIBRARIES ${SASL_LIBRARY}
++ MODULE_ONLY
++ MODULE_OUTPUT_NAME "authentication_ldap_sasl_client")
++ENDIF()
diff --git a/databases/mysql57-client/pkg-plist b/databases/mysql57-client/pkg-plist
index 299830f01287..735135d59823 100644
--- a/databases/mysql57-client/pkg-plist
+++ b/databases/mysql57-client/pkg-plist
@@ -125,6 +125,7 @@ lib/mysql/libmysqlservices.a
lib/mysql/libmysqlclient_r.a
lib/mysql/libmysqlclient_r.so
lib/mysql/libmysqlclient_r.so.20
+%%SASLCLIENT%%lib/mysql/plugin/authentication_ldap_sasl_client.so
libdata/pkgconfig/mysqlclient.pc
man/man1/comp_err.1.gz
man/man1/mysql.1.gz