aboutsummaryrefslogtreecommitdiffstats
path: root/databases
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
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')
-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
-rw-r--r--databases/mysql57-server/Makefile18
-rw-r--r--databases/mysql57-server/files/patch-cmake_plugin.cmake37
-rw-r--r--databases/mysql57-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt18
7 files changed, 138 insertions, 7 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
diff --git a/databases/mysql57-server/Makefile b/databases/mysql57-server/Makefile
index ec02cdeb7f31..5bbf0d196e65 100644
--- a/databases/mysql57-server/Makefile
+++ b/databases/mysql57-server/Makefile
@@ -3,6 +3,7 @@
PORTNAME?= mysql
PORTVERSION= 5.7.19
+PORTREVISION= 1
CATEGORIES= databases ipv6
MASTER_SITES= MYSQL/MySQL-5.7
PKGNAMESUFFIX?= 57-server
@@ -55,7 +56,8 @@ CMAKE_ARGS+= -DINSTALL_LAYOUT=FREEBSD \
-DWITH_LIBEVENT=system \
-DWITH_LZ4=system \
-DWITH_ZLIB=system \
- -DINSTALL_MYSQLTESTDIR=0
+ -DINSTALL_MYSQLTESTDIR=0 \
+ -DWITH_DEBUG=0
SHEBANG_FILES= scripts/*.pl* scripts/*.sh
@@ -71,6 +73,8 @@ PLIST_SUB= MY_DBDIR=${MY_DBDIR} \
MY_SECDIR=${MY_SECDIR} \
MY_TMPDIR=${MY_TMPDIR}
+OPTIONS_SUB= YES
+
# MySQL-Server part
.if !defined(CLIENT_ONLY)
USES+= mysql:57
@@ -98,9 +102,8 @@ MMAN1= my_print_defaults.1 myisam_ftdump.1 myisamchk.1 myisamlog.1 myisampack.1
CMAKE_ARGS+= -DWITH_EMBEDDED_SERVER="ON"
-OPTIONS_GROUP= STORAGE
+OPTIONS_GROUP+= STORAGE
OPTIONS_GROUP_STORAGE= ARCHIVE BLACKHOLE EXAMPLE FEDERATED INNOBASE PARTITION PERFSCHEMA
-OPTIONS_SUB= YES
STORAGE_DESC= Permissible "Storage Engines" (to compile statically into the server)
ARCHIVE_DESC= Compile "Archive Storage" statically in server
BLACKHOLE_DESC= Compile "Blackhole Storage" statically in server
@@ -119,8 +122,8 @@ PARTITION_CMAKE_ON= -DWITH_PARTITION_STORAGE_ENGINE=1
PERFSCHEMA_CMAKE_ON= -DWITH_PERFSCHEMA_STORAGE_ENGINE=1
OPTIONS_GROUP+= FEATURES
-OPTIONS_GROUP_FEATURES= PERFSCHM
FEATURES_DESC= Default features knobs
+OPTIONS_GROUP_FEATURES= PERFSCHM
PERFSCHM_DESC= Enable "Performance Schema" by default (High RAM usage)
OPTIONS_DEFAULT+= PERFSCHM
@@ -128,6 +131,10 @@ PERFSCHM_SUB_LIST+= PERFSCHEMRC=""
PERFSCHM_SUB_LIST_OFF+= PERFSCHEMRC="--skip-performance-schema"
FEDERATED_SUB_LIST+= FEDER="--federated"
FEDERATED_SUB_LIST_OFF+= FEDER=""
+
+# issue 220865: Currently there's no source to be built with server-side support.
+# But this keeps the pkg-plist not overlaping
+CMAKE_ARGS+= -DWITH_AUTHENTICATION_LDAP=0
.endif
.include <bsd.port.pre.mk>
@@ -143,6 +150,9 @@ post-extract:
post-patch:
@${REINPLACE_CMD} 's/*.1/${MMAN1}/' ${WRKSRC}/man/CMakeLists.txt
+ # issue 220865: MySQL developers forgot that FreeBSD != Linux
+ @${REINPLACE_CMD} -e 's|%%FREEBSD_LOCAL_LIB%%|${LOCALBASE}/lib|g' \
+ ${WRKSRC}/cmake/plugin.cmake
.if !defined(CLIENT_ONLY)
post-install:
diff --git a/databases/mysql57-server/files/patch-cmake_plugin.cmake b/databases/mysql57-server/files/patch-cmake_plugin.cmake
index 65d4bc2b4d31..8716c1b962b4 100644
--- a/databases/mysql57-server/files/patch-cmake_plugin.cmake
+++ b/databases/mysql57-server/files/patch-cmake_plugin.cmake
@@ -1,12 +1,43 @@
---- cmake/plugin.cmake.orig 2016-03-28 18:06:12 UTC
+--- cmake/plugin.cmake.orig 2017-06-22 14:13:19 UTC
+++ cmake/plugin.cmake
-@@ -237,9 +237,6 @@ MACRO(MYSQL_ADD_PLUGIN)
+@@ -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}/${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-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt b/databases/mysql57-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt
new file mode 100644
index 000000000000..05783d914af4
--- /dev/null
+++ b/databases/mysql57-server/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()