Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 17:53:30 +0000 (UTC)
From:      Mark Felder <feld@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r458861 - in head/databases: percona57-client percona57-client/files percona57-pam-for-mysql percona57-server percona57-server/files
Message-ID:  <201801121753.w0CHrUwK059227@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: feld
Date: Fri Jan 12 17:53:30 2018
New Revision: 458861
URL: https://svnweb.freebsd.org/changeset/ports/458861

Log:
  databases/percona57: Fix build with SASL
  
  If SASL is detected at build time it assumes you want SASL and also
  errors due to assuming we're Linux. This was already patched in our tree
  for MySQL.
  
  Also enable SASL support by default for the databases/percona57-client.
  This is expected to be the default by upstream now.
  
  Special thanks to mmokhi for figuring this out for us.
  
  PR:		220865
  MFH:		2018Q1

Added:
  head/databases/percona57-client/files/patch-cmake_plugin.cmake
     - copied unchanged from r458860, head/databases/mysql57-client/files/patch-cmake_plugin.cmake
  head/databases/percona57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt
     - copied unchanged from r458860, head/databases/mysql57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt
  head/databases/percona57-server/files/patch-cmake_plugin.cmake
     - copied unchanged from r458860, head/databases/mysql57-server/files/patch-cmake_plugin.cmake
  head/databases/percona57-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt
     - copied unchanged from r458860, head/databases/mysql57-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt
Modified:
  head/databases/percona57-client/Makefile
  head/databases/percona57-client/pkg-plist
  head/databases/percona57-pam-for-mysql/pkg-plist
  head/databases/percona57-server/Makefile
  head/databases/percona57-server/pkg-plist

Modified: head/databases/percona57-client/Makefile
==============================================================================
--- head/databases/percona57-client/Makefile	Fri Jan 12 17:39:27 2018	(r458860)
+++ head/databases/percona57-client/Makefile	Fri Jan 12 17:53:30 2018	(r458861)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	percona
-PORTREVISION?=	0
+PORTREVISION?=	1
 PKGNAMESUFFIX=	57-client
 
 COMMENT=	Multithreaded SQL database (client)
@@ -30,6 +30,16 @@ MANPAGES=	comp_err.1 mysql.1 mysql_config.1 mysql_conf
 		mysqlcheck.1 mysqldump.1 mysqlimport.1 mysqlshow.1 mysqlslap.1
 
 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
+OPTIONS_SUB=	yes
 
 # Percona renamed the libraries, until we decide how to deal with it create some symlinks
 # to prevent breaking installed ports.

Copied: head/databases/percona57-client/files/patch-cmake_plugin.cmake (from r458860, head/databases/mysql57-client/files/patch-cmake_plugin.cmake)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/percona57-client/files/patch-cmake_plugin.cmake	Fri Jan 12 17:53:30 2018	(r458861, copy of r458860, head/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})

Copied: head/databases/percona57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt (from r458860, head/databases/mysql57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/percona57-client/files/patch-libmysql_authentication__ldap_CMakeLists.txt	Fri Jan 12 17:53:30 2018	(r458861, copy of r458860, head/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()

Modified: head/databases/percona57-client/pkg-plist
==============================================================================
--- head/databases/percona57-client/pkg-plist	Fri Jan 12 17:39:27 2018	(r458860)
+++ head/databases/percona57-client/pkg-plist	Fri Jan 12 17:53:30 2018	(r458861)
@@ -128,6 +128,7 @@ lib/mysql/libmysqlservices.a
 lib/mysql/libperconaserverclient.a
 lib/mysql/libperconaserverclient.so
 lib/mysql/libperconaserverclient.so.20
+%%SASLCLIENT%%lib/mysql/plugin/authentication_ldap_sasl_client.so
 libdata/pkgconfig/perconaserverclient.pc
 man/man1/comp_err.1.gz
 man/man1/mysql.1.gz

Modified: head/databases/percona57-pam-for-mysql/pkg-plist
==============================================================================
--- head/databases/percona57-pam-for-mysql/pkg-plist	Fri Jan 12 17:39:27 2018	(r458860)
+++ head/databases/percona57-pam-for-mysql/pkg-plist	Fri Jan 12 17:53:30 2018	(r458861)
@@ -2,4 +2,3 @@
 lib/mysql/plugin/auth_pam.so
 lib/mysql/plugin/auth_pam_compat.so
 lib/mysql/plugin/dialog.so
-@dir lib/mysql/plugin/debug

Modified: head/databases/percona57-server/Makefile
==============================================================================
--- head/databases/percona57-server/Makefile	Fri Jan 12 17:39:27 2018	(r458860)
+++ head/databases/percona57-server/Makefile	Fri Jan 12 17:53:30 2018	(r458861)
@@ -123,6 +123,9 @@ MANPAGES=	my_print_defaults.1 myisam_ftdump.1 myisamch
 		mysqltest.1 perror.1 replace.1 resolve_stack_dump.1 resolveip.1
 
 CMAKE_ARGS+=	-DWITH_EMBEDDED_SERVER="ON"
+# 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
 
 post-install:
 	${MKDIR} ${STAGEDIR}/var/db/mysql
@@ -133,6 +136,9 @@ post-install:
 
 post-patch:
 	@${REINPLACE_CMD} 's/*.1/${MANPAGES}/' ${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
 
 .include <bsd.port.pre.mk>
 

Copied: head/databases/percona57-server/files/patch-cmake_plugin.cmake (from r458860, head/databases/mysql57-server/files/patch-cmake_plugin.cmake)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/percona57-server/files/patch-cmake_plugin.cmake	Fri Jan 12 17:53:30 2018	(r458861, copy of r458860, head/databases/mysql57-server/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})

Copied: head/databases/percona57-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt (from r458860, head/databases/mysql57-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/percona57-server/files/patch-libmysql_authentication__ldap_CMakeLists.txt	Fri Jan 12 17:53:30 2018	(r458861, copy of r458860, head/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()

Modified: head/databases/percona57-server/pkg-plist
==============================================================================
--- head/databases/percona57-server/pkg-plist	Fri Jan 12 17:39:27 2018	(r458860)
+++ head/databases/percona57-server/pkg-plist	Fri Jan 12 17:53:30 2018	(r458861)
@@ -90,7 +90,6 @@ bin/zlib_decompress
 include/mysql/mysqlx_ername.h
 include/mysql/mysqlx_error.h
 include/mysql/mysqlx_version.h
-@dir lib/mysql/plugin/debug
 @dir(mysql,mysql,) /var/db/mysql
 %%INNODBMEMCACHED%%lib/mysql/plugin/innodb_engine.so
 %%INNODBMEMCACHED%%lib/mysql/plugin/libmemcached.so



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