jmbsvicetto    14/04/22 02:00:29

  Modified:             ChangeLog mysql-cmake.eclass mysql-v2.eclass
  Log:
  Sync mysql-v2 and mysql-cmake eclasses from the mysql overlay.

Revision  Changes    Path
1.1221               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1221&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1221&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1220&r2=1.1221

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1220
retrieving revision 1.1221
diff -u -r1.1220 -r1.1221
--- ChangeLog   21 Apr 2014 21:55:31 -0000      1.1220
+++ ChangeLog   22 Apr 2014 02:00:28 -0000      1.1221
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1220 2014/04/21 
21:55:31 ottxor Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1221 2014/04/22 
02:00:28 jmbsvicetto Exp $
+
+  22 Apr 2014; Jorge Manuel B. S. Vicetto <[email protected]>
+  mysql-cmake.eclass, mysql-v2.eclass:
+  Sync mysql-v2 and mysql-cmake eclasses from the mysql overlay.
 
   21 Apr 2014; Christoph Junghans <[email protected]> wxwidgets.eclass:
   added prefix support (bug #401661)



1.19                 eclass/mysql-cmake.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-cmake.eclass?rev=1.19&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-cmake.eclass?rev=1.19&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-cmake.eclass?r1=1.18&r2=1.19

Index: mysql-cmake.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- mysql-cmake.eclass  19 Mar 2014 00:55:48 -0000      1.18
+++ mysql-cmake.eclass  22 Apr 2014 02:00:28 -0000      1.19
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.18 2014/03/19 
00:55:48 hasufell Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.19 2014/04/22 
02:00:28 jmbsvicetto Exp $
 
 # @ECLASS: mysql-cmake.eclass
 # @MAINTAINER:
@@ -12,10 +12,10 @@
 # @DESCRIPTION:
 # The mysql-cmake.eclass provides the support to build the mysql
 # ebuilds using the cmake build system. This eclass provides
-# the src_unpack, src_prepare, src_configure, src_compile, scr_install,
-# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks.
+# the src_prepare, src_configure, src_compile, and src_install
+# phase hooks.
 
-inherit cmake-utils flag-o-matic multilib prefix
+inherit cmake-utils flag-o-matic multilib prefix eutils
 
 #
 # HELPER FUNCTIONS:
@@ -34,7 +34,7 @@
        testsuite="${rawtestname/.*}"
        testname="${rawtestname/*.}"
        for mysql_disabled_file in \
-               ${S}/mysql-test/disabled.def  \
+               ${S}/mysql-test/disabled.def \
                ${S}/mysql-test/t/disabled.def ; do
                [[ -f ${mysql_disabled_file} ]] && break
        done
@@ -44,8 +44,8 @@
 
        if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then
                for mysql_disabled_file in \
-                       ${S}/mysql-test/suite/${testsuite}/disabled.def  \
-                       ${S}/mysql-test/suite/${testsuite}/t/disabled.def  \
+                       ${S}/mysql-test/suite/${testsuite}/disabled.def \
+                       ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
                        FAILED ; do
                        [[ -f ${mysql_disabled_file} ]] && break
                done
@@ -54,7 +54,7 @@
                else
                        for mysql_disabled_dir in \
                                ${S}/mysql-test/suite/${testsuite} \
-                               ${S}/mysql-test/suite/${testsuite}/t  \
+                               ${S}/mysql-test/suite/${testsuite}/t \
                                FAILED ; do
                                [[ -d ${mysql_disabled_dir} ]] && break
                        done
@@ -67,6 +67,20 @@
        fi
 }
 
+# @FUNCTION: mysql-cmake_use_plugin
+# @DESCRIPTION:
+# Helper function to enable/disable plugins by use flags
+# cmake-utils_use_with is not enough as some references check WITH_ (0|1)
+# and some check WITHOUT_. Also, this can easily extend to non-storage plugins.
+mysql-cmake_use_plugin() {
+       [[ -z $2 ]] && die "mysql-cmake_use_plugin <USE flag> <flag name>"
+       if use_if_iuse $1 ; then
+               echo "-DWITH_$2=1"
+       else
+               echo "-DWITHOUT_$2=1 -DWITH_$2=0"
+       fi
+}
+
 # @FUNCTION: configure_cmake_locale
 # @DESCRIPTION:
 # Helper function to configure locale cmake options
@@ -103,14 +117,8 @@
        mycmakeargs+=(
                -DWITHOUT_SERVER=1
                -DWITHOUT_EMBEDDED_SERVER=1
-               -DENABLED_LOCAL_INFILE=1
                -DEXTRA_CHARSETS=none
                -DINSTALL_SQLBENCHDIR=
-               -DWITH_SSL=system
-               -DWITH_ZLIB=system
-               -DWITHOUT_LIBWRAP=1
-               -DWITH_READLINE=0
-               -DWITH_LIBEDIT=0
                -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1
                -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1
                -DWITHOUT_CSV_STORAGE_ENGINE=1
@@ -130,36 +138,27 @@
 configure_cmake_standard() {
 
        mycmakeargs+=(
-               -DENABLED_LOCAL_INFILE=1
                -DEXTRA_CHARSETS=all
                -DMYSQL_USER=mysql
                -DMYSQL_UNIX_ADDR=${EPREFIX}/var/run/mysqld/mysqld.sock
-               -DWITH_READLINE=0
-               -DWITH_LIBEDIT=0
-               -DWITH_ZLIB=system
-               -DWITHOUT_LIBWRAP=1
-       )
-
-       mycmakeargs+=(
                $(cmake-utils_use_disable !static SHARED)
                $(cmake-utils_use_with debug)
                $(cmake-utils_use_with embedded EMBEDDED_SERVER)
                $(cmake-utils_use_with profiling)
                $(cmake-utils_use_enable systemtap DTRACE)
+               $(cmake-utils_use_enable static-libs STATIC_LIBS)
        )
 
-       if use ssl; then
-               mycmakeargs+=( -DWITH_SSL=system )
-       else
-               mycmakeargs+=( -DWITH_SSL=bundled )
+       if use static; then
+               mycmakeargs+=( -DWITH_PIC=1 )
        fi
 
-       if mysql_version_is_at_least "5.5" && use jemalloc; then
-               mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' 
-DWITH_SAFEMALLOC=OFF )
+       if use jemalloc; then
+               mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
        fi
 
-       if mysql_version_is_at_least "5.5" && use tcmalloc; then
-               mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ltcmalloc' 
-DWITH_SAFEMALLOC=OFF )
+       if use tcmalloc; then
+               mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
        fi
 
        # Storage engines
@@ -175,19 +174,31 @@
                $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE)
        )
 
-       if pbxt_available ; then
+       if in_iuse pbxt ; then
                mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) 
)
        fi
 
-       if [[ ${PN} == "mariadb" ]]; then
+       if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
                mycmakeargs+=(
-                       $(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE)
-                       $(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE)
-                       $(cmake-utils_use_with extraengine 
FEDERATEDX_STORAGE_ENGINE)
+                       $(mysql-cmake_use_plugin oqgraph OQGRAPH)
+                       $(mysql-cmake_use_plugin sphinx SPHINX)
+                       $(mysql-cmake_use_plugin extraengine FEDERATEDX)
+                       $(mysql-cmake_use_plugin tokudb TOKUDB)
+                       $(mysql-cmake_use_plugin pam AUTH_PAM)
                )
 
-               if ! use pam ; then
-                       mycmakeargs+=( -DAUTH_PAM_DISABLED=1 )
+               if mysql_version_is_at_least 10.0.5 ; then
+                       # CassandraSE needs Apache Thrift which is not in 
portage
+                       # TODO: Add use and deps for Connect SE external deps
+                       mycmakeargs+=(
+                               -DWITHOUT_CASSANDRA=1 -DWITH_CASSANDRA=0
+                               $(mysql-cmake_use_plugin extraengine SEQUENCE)
+                               $(mysql-cmake_use_plugin extraengine SPIDER)
+                               $(mysql-cmake_use_plugin extraengine CONNECT)
+                               -DCONNECT_WITH_MYSQL=1
+                               $(cmake-utils_use xml CONNECT_WITH_LIBXML2)
+                               $(cmake-utils_use odbc CONNECT_WITH_ODBC)
+                       )
                fi
        fi
 
@@ -196,6 +207,17 @@
                        $(cmake-utils_use_with pam)
                )
        fi
+
+       if [[ ${PN} == "mysql-cluster" ]]; then
+               # TODO: This really should include the following options,
+               # but the memcached package doesn't install the files it seeks.
+               # -DWITH_BUNDLED_MEMCACHED=OFF
+               # -DMEMCACHED_HOME=${EPREFIX}/usr
+               mycmakeargs+=(
+                       -DWITH_BUNDLED_LIBEVENT=OFF
+                       $(cmake-utils_use_with java NDB_JAVA)
+               )
+       fi
 }
 
 #
@@ -211,21 +233,38 @@
 
        cd "${S}"
 
-       # Apply the patches for this MySQL version
-       EPATCH_SUFFIX="patch"
-       mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
-       # Clean out old items
-       rm -f "${EPATCH_SOURCE}"/*
-       # Now link in right patches
-       mysql_mv_patches
-       # And apply
-       epatch
+       if [[ ${MY_EXTRAS_VER} != none ]]; then
+
+               # Apply the patches for this MySQL version
+               EPATCH_SUFFIX="patch"
+               mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch 
directory"
+               # Clean out old items
+               rm -f "${EPATCH_SOURCE}"/*
+               # Now link in right patches
+               mysql_mv_patches
+               # And apply
+               epatch
+       fi
 
        # last -fPIC fixup, per bug #305873
        i="${S}"/storage/innodb_plugin/plug.in
        [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
 
        rm -f "scripts/mysqlbug"
+       if use jemalloc && ! ( [[ ${PN} == "mariadb" ]] && 
mysql_version_is_at_least "5.5.33" ); then
+               echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> 
"${S}/sql/CMakeLists.txt"
+       fi
+
+       if use tcmalloc; then
+               echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> 
"${S}/sql/CMakeLists.txt"
+       fi
+
+       if in_iuse tokudb ; then
+               # Don't build bundled xz-utils
+               rm -f 
"${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake"
+               touch 
"${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake"
+       fi
+
        epatch_user
 }
 
@@ -250,7 +289,8 @@
                -DINSTALL_DOCREADMEDIR=share/doc/${P}
                -DINSTALL_INCLUDEDIR=include/mysql
                -DINSTALL_INFODIR=share/info
-               -DINSTALL_LIBDIR=$(get_libdir)/mysql
+               -DINSTALL_LIBDIR=$(get_libdir)
+               -DINSTALL_ELIBDIR=$(get_libdir)/mysql
                -DINSTALL_MANDIR=share/man
                -DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql
                -DINSTALL_MYSQLSHAREDIR=share/mysql
@@ -262,15 +302,39 @@
                -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql
                -DWITH_COMMENT="Gentoo Linux ${PF}"
                $(cmake-utils_use_with test UNIT_TESTS)
+               -DWITH_READLINE=0
+               -DWITH_LIBEDIT=0
+               -DWITH_ZLIB=system
+               -DWITHOUT_LIBWRAP=1
+               -DENABLED_LOCAL_INFILE=1
        )
 
+       if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && 
mysql_version_is_at_least "5.6.12" ; then
+               mycmakeargs+=( -DWITH_EDITLINE=system )
+       fi
+
+       if use ssl; then
+               mycmakeargs+=( -DWITH_SSL=system )
+       else
+               mycmakeargs+=( -DWITH_SSL=bundled )
+       fi
+
        # Bug 412851
        # MariaDB requires this flag to compile with GPLv3 readline linked
        # Adds a warning about redistribution to configure
-       if [[ ${PN} == "mariadb" ]] ; then
+       if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
                mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 )
        fi
 
+       if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
+               if use jemalloc ; then
+                       mycmakeargs+=( -DWITH_JEMALLOC="system" )
+               else
+                       mycmakeargs+=( -DWITH_JEMALLOC=no )
+               fi
+               mysql_version_is_at_least "10.0.9" && mycmakeargs+=( 
-DWITH_PCRE=system )
+       fi
+
        configure_cmake_locale
 
        if use minimal ; then
@@ -283,14 +347,14 @@
        filter-flags "-O" "-O[01]"
 
        CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
-       CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
-       # Causes linkage failures.  Upstream bug #59607 removes it
+       CXXFLAGS="${CXXFLAGS} -felide-constructors"
+       # Causes linkage failures. Upstream bug #59607 removes it
        if ! mysql_version_is_at_least "5.6" ; then
                CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
        fi
-       # As of 5.7, exceptions are used!
+       # As of 5.7, exceptions and rtti are used!
        if ! mysql_version_is_at_least "5.7" ; then
-               CXXFLAGS="${CXXFLAGS} -fno-exceptions"
+               CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-rtti"
        fi
        export CXXFLAGS
 
@@ -329,7 +393,7 @@
        dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
 
        # Create a mariadb_config symlink
-       [[ ${PN} == "mariadb" ]] && dosym "/usr/bin/mysql_config" 
"/usr/bin/mariadb_config"
+       [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && dosym 
"/usr/bin/mysql_config" "/usr/bin/mariadb_config"
 
        # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
        rm -Rf "${ED}/usr/data"
@@ -337,15 +401,6 @@
        # Various junk (my-*.cnf moved elsewhere)
        einfo "Removing duplicate /usr/share/mysql files"
 
-       # Clean up stuff for a minimal build
-#      if use minimal ; then
-#              einfo "Remove all extra content for minimal build"
-#              rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
-#              rm -f 
"${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
-#              rm -f "${ED}/usr/sbin/mysqld"
-#              rm -f 
"${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
-#      fi
-
        # Unless they explicitly specific USE=test, then do not install the
        # testsuite. It DOES have a use to be installed, esp. when you want to 
do a
        # validation of your database configuration after tuning it.
@@ -385,7 +440,7 @@
                fi
 
                diropts "-m0755"
-               for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
+               for folder in "${MY_LOGDIR#${EPREFIX}}" ; do
                        dodir "${folder}"
                        keepdir "${folder}"
                        chown -R mysql:mysql "${ED}/${folder}"
@@ -410,12 +465,7 @@
                done
        fi
 
-       cat <<-EOF > "${T}"/80mysql-libdir
-       LDPATH="${EPREFIX}/usr/$(get_libdir)/mysql"
-       EOF
-       doenvd "${T}"/80mysql-libdir
-
        #Remove mytop if perl is not selected
-       [[ ${PN} == "mariadb" ]] && ! use perl \
+       [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && ! use perl \
        && rm -f "${ED}/usr/bin/mytop"
 }



1.27                 eclass/mysql-v2.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-v2.eclass?rev=1.27&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-v2.eclass?rev=1.27&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-v2.eclass?r1=1.26&r2=1.27

Index: mysql-v2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- mysql-v2.eclass     8 Jan 2014 06:20:29 -0000       1.26
+++ mysql-v2.eclass     22 Apr 2014 02:00:28 -0000      1.27
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.26 2014/01/08 
06:20:29 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.27 2014/04/22 
02:00:28 jmbsvicetto Exp $
 
 # @ECLASS: mysql-v2.eclass
 # @MAINTAINER:
@@ -71,6 +71,7 @@
 if [[ ${MY_EXTRAS_VER} == "live" ]]; then
        EGIT_PROJECT=mysql-extras
        EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
+       RESTRICT="userpriv"
 fi
 
 # @ECLASS-VARIABLE: MYSQL_PV_MAJOR
@@ -80,6 +81,14 @@
 # mysql_upgrade.
 MYSQL_PV_MAJOR="$(get_version_component_range 1-2 ${PV})"
 
+# Cluster is a special case...
+if [[ "${PN}" == "mysql-cluster" ]]; then
+       case $PV in
+               6.1*|7.0*|7.1*) MYSQL_PV_MAJOR=5.1 ;;
+               7.2*|7.3*) MYSQL_PV_MAJOR=5.5 ;;
+       esac
+fi
+
 # @ECLASS-VARIABLE: MYSQL_VERSION_ID
 # @DESCRIPTION:
 # MYSQL_VERSION_ID will be:
@@ -116,15 +125,17 @@
 if [[ -z ${SERVER_URI} ]]; then
        [[ -z ${MY_PV} ]] && MY_PV="${PV//_/-}"
        if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
-               MARIA_FULL_PV=$(replace_version_separator 3 '-' ${MY_PV})
+               # Beginning with 5.5, MariaDB stopped putting beta, alpha or rc 
on their tarball names
+               mysql_version_is_at_least "5.5" && 
MARIA_FULL_PV=$(get_version_component_range 1-3) || \
+                       MARIA_FULL_PV=$(replace_version_separator 3 '-' 
${MY_PV})
                MARIA_FULL_P="${PN}-${MARIA_FULL_PV}"
                SERVER_URI="
                
http://ftp.osuosl.org/pub/mariadb/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
-               
http://ftp.rediris.es/mirror/MariaDB/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
-               
http://maria.llarian.net/download/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
-               
http://launchpad.net/maria/${MYSQL_PV_MAJOR}/ongoing/+download/${MARIA_FULL_P}.tar.gz
-               
http://mirrors.fe.up.pt/pub/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
-               
http://ftp-stud.hs-esslingen.de/pub/Mirrors/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
+               
http://mirror.jmu.edu/pub/mariadb/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
+               
http://mirrors.coreix.net/mariadb/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
+               
http://mirrors.syringanetworks.net/mariadb/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
+               
http://mirrors.fe.up.pt/pub/mariadb/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
+               
http://mirror2.hs-esslingen.de/mariadb/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
                "
                if [[ ${PN} == "mariadb-galera" ]]; then
                        MY_SOURCEDIR="${PN%%-galera}-${MARIA_FULL_PV}"
@@ -133,12 +144,19 @@
                PERCONA_PN="Percona-Server"
                MIRROR_PV=$(get_version_component_range 1-2 ${PV})
                MY_PV=$(get_version_component_range 1-3 ${PV})
-               MY_PATCH=$(get_version_component_range 4 ${PV})
-               
SERVER_URI="http://www.percona.com/redir/downloads/${PERCONA_PN}-${MIRROR_PV}/LATEST/source/${PERCONA_PN}-${MY_PV}-rel30.${MY_PATCH}.tar.gz";
-#              
http://www.percona.com/redir/downloads/Percona-Server-5.5/LATEST/source/Percona-Server-5.5.30-rel30.2.tar.gz
+               PERCONA_RELEASE=$(get_version_component_range 4-5 ${PV})
+               PERCONA_RC=$(get_version_component_range 6 ${PV})
+               
SERVER_URI="http://www.percona.com/redir/downloads/${PERCONA_PN}-${MIRROR_PV}/${PERCONA_PN}-${MY_PV}-${PERCONA_RC}${PERCONA_RELEASE}/source/tarball/${PN}-${MY_PV}-${PERCONA_RC}${PERCONA_RELEASE}.tar.gz";
+#              
http://www.percona.com/redir/downloads/Percona-Server-5.5/LATEST/source/tarball/Percona-Server-5.5.30-30.2.tar.gz
+#              
http://www.percona.com/redir/downloads/Percona-Server-5.6/Percona-Server-5.6.13-rc60.5/source/tarball/Percona-Server-5.6.13-rc60.5.tar.gz
        else
-               URI_DIR="MySQL"
-               URI_FILE="mysql"
+               if [[ "${PN}" == "mysql-cluster" ]] ; then
+                       URI_DIR="MySQL-Cluster"
+                       URI_FILE="mysql-cluster-gpl"
+               else
+                       URI_DIR="MySQL"
+                       URI_FILE="mysql"
+               fi
                URI_A="${URI_FILE}-${MY_PV}.tar.gz"
                MIRROR_PV=$(get_version_component_range 1-2 ${PV})
                # Recently upstream switched to an archive site, and not on 
mirrors
@@ -181,27 +199,29 @@
                IUSE="big-tables debug embedded minimal +perl selinux ssl 
static test"
                ;;
        "cmake")
-               IUSE="debug embedded minimal +perl selinux ssl static test"
+               IUSE="debug embedded minimal +perl selinux ssl static 
static-libs test"
                ;;
 esac
 
-IUSE="${IUSE} latin1"
-
-IUSE="${IUSE} extraengine"
-IUSE="${IUSE} cluster"
-
-IUSE="${IUSE} max-idx-128"
-IUSE="${IUSE} +community profiling"
+# Common IUSE
+IUSE="${IUSE} latin1 extraengine cluster max-idx-128 +community profiling"
 
 if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
        mysql_check_version_range "5.1.38 to 5.3.99" && IUSE="${IUSE} libevent"
-       mysql_version_is_at_least "5.2" && IUSE="${IUSE} oqgraph"
-       mysql_version_is_at_least "5.2.5" && IUSE="${IUSE} sphinx"
+       mysql_version_is_at_least "5.2" && IUSE="${IUSE} oqgraph" && \
+               REQUIRED_USE="${REQUIRED_USE} minimal? ( !oqgraph )"
+       mysql_version_is_at_least "5.2.5" && IUSE="${IUSE} sphinx" && \
+               REQUIRED_USE="${REQUIRED_USE} minimal? ( !sphinx )"
        mysql_version_is_at_least "5.2.10" && IUSE="${IUSE} pam"
+       # 5.5.33 and 10.0.5 add TokuDB. Authors strongly recommend jemalloc or 
perfomance suffers
+       mysql_version_is_at_least "10.0.5" && IUSE="${IUSE} tokudb odbc xml" && 
\
+               REQUIRED_USE="${REQUIRED_USE} odbc? ( extraengine ) xml? ( 
extraengine ) tokudb? ( jemalloc )"
+       mysql_check_version_range "5.5.33 to 5.5.99" && IUSE="${IUSE} tokudb" 
&& \
+               REQUIRED_USE="${REQUIRED_USE} tokudb? ( jemalloc )"
 fi
 
 if mysql_version_is_at_least "5.5"; then
-       REQUIRED_USE="tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc )"
+       REQUIRED_USE="${REQUIRED_USE} tcmalloc? ( !jemalloc ) jemalloc? ( 
!tcmalloc )"
        IUSE="${IUSE} jemalloc tcmalloc"
 fi
 
@@ -226,9 +246,17 @@
        kernel_linux? ( sys-process/procps )
        >=sys-apps/sed-4
        >=sys-apps/texinfo-4.7-r1
-       >=sys-libs/readline-4.1
        >=sys-libs/zlib-1.2.3
 "
+# TODO: add this as a dep if it is moved from the overlay
+#      !dev-db/mariadb-native-client[mysqlcompat]
+
+# dev-db/mysql-5.6.12+ only works with dev-libs/libedit
+if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && 
mysql_version_is_at_least "5.6.12" ; then
+       DEPEND="${DEPEND} dev-libs/libedit"
+else
+       DEPEND="${DEPEND} >=sys-libs/readline-4.1"
+fi
 
 if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
        mysql_check_version_range "5.1.38 to 5.3.99" && DEPEND="${DEPEND} 
libevent? ( >=dev-libs/libevent-1.4 )"
@@ -237,22 +265,41 @@
        mysql_version_is_at_least "5.2.10" && DEPEND="${DEPEND} !minimal? ( 
pam? ( virtual/pam ) )"
        # Bug 441700 MariaDB >=5.3 include custom mytop
        mysql_version_is_at_least "5.3" && DEPEND="${DEPEND} perl? ( 
!dev-db/mytop )"
+       if mysql_version_is_at_least "10.0.5" ; then
+               DEPEND="${DEPEND}
+                       odbc? ( dev-db/unixODBC )
+                       xml? ( dev-libs/libxml2 )
+                       "
+       fi
+       mysql_version_is_at_least "10.0.7" && DEPEND="${DEPEND} oqgraph? ( 
dev-libs/judy )"
+       if mysql_version_is_at_least "10.0.9" ; then
+               use embedded && DEPEND="${DEPEND} 
>=dev-libs/libpcre-8.35[static-libs]" || \
+                       DEPEND="${DEPEND} >=dev-libs/libpcre-8.35"
+       fi
 fi
 
 # Having different flavours at the same time is not a good idea
-for i in "mysql" "mariadb" "mariadb-galera" "percona-server"; do
+for i in "mysql" "mariadb" "mariadb-galera" "percona-server" "mysql-cluster" ; 
do
        [[ ${i} == ${PN} ]] ||
        DEPEND="${DEPEND} !dev-db/${i}"
 done
 
-if mysql_version_is_at_least "5.5" ; then
-       DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )"
-       DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )"
+if mysql_version_is_at_least "5.5.7" ; then
+       DEPEND="${DEPEND}
+               jemalloc? ( dev-libs/jemalloc[static-libs?] )
+               tcmalloc? ( dev-util/google-perftools )
+               >=sys-libs/zlib-1.2.3[static-libs?]
+               ssl? ( >=dev-libs/openssl-0.9.6d[static-libs?] )
+               systemtap? ( >=dev-util/systemtap-1.3 )
+               kernel_linux? ( dev-libs/libaio )
+       "
 fi
 
-if mysql_version_is_at_least "5.5.7" ; then
-       DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )"
-       DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )"
+if [[ ${PN} == "mysql-cluster" ]] ; then
+       # TODO: This really should include net-misc/memcached
+       # but the package does not install the files it seeks.
+       mysql_version_is_at_least "7.2.3" && \
+               DEPEND="${DEPEND} dev-libs/libevent"
 fi
 
 # prefix: first need to implement something for #196294
@@ -264,14 +311,31 @@
 if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
        # Bug 455016 Add dependencies of mytop
        if mysql_version_is_at_least "5.3" ; then
-               RDEPEND="${RDEPEND} perl? (
-                       virtual/perl-Getopt-Long
-                       dev-perl/TermReadKey
-                       virtual/perl-Term-ANSIColor
-                       virtual/perl-Time-HiRes ) "
+               RDEPEND="${RDEPEND}
+                       perl? (
+                               virtual/perl-Getopt-Long
+                               dev-perl/TermReadKey
+                               virtual/perl-Term-ANSIColor
+                               virtual/perl-Time-HiRes
+                       )
+               "
        fi
 fi
 
+if [[ ${PN} == "mariadb-galera" ]] ; then
+       # The wsrep API version must match between the ebuild and 
sys-cluster/galera.
+       # This will be indicated by WSREP_REVISION in the ebuild and the first 
number
+       # in the version of sys-cluster/galera
+       RDEPEND="${RDEPEND}
+               =sys-cluster/galera-${WSREP_REVISION}*
+       "
+fi
+
+if [[ ${PN} == "mysql-cluster" ]] ; then
+       mysql_version_is_at_least "7.2.9" && RDEPEND="${RDEPEND} java? ( 
>=virtual/jre-1.6 )" && \
+               DEPEND="${DEPEND} java? ( >=virtual/jdk-1.6 )"
+fi
+
 DEPEND="${DEPEND}
        virtual/yacc
 "
@@ -290,13 +354,13 @@
 PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
 
 # For other stuff to bring us in
-PDEPEND="${PDEPEND} =virtual/mysql-${MYSQL_PV_MAJOR}"
+PDEPEND="${PDEPEND} ~virtual/mysql-${MYSQL_PV_MAJOR}"
 
 #
 # External patches
 #
 
-# MariaDB has integrated PBXT
+# MariaDB has integrated PBXT until it was dropped in version 5.5.33
 # PBXT_VERSION means that we have a PBXT patch for this PV
 # PBXT was only introduced after 5.1.12
 pbxt_patch_available() {
@@ -305,7 +369,7 @@
 }
 
 pbxt_available() {
-       pbxt_patch_available || [[ ${PN} == "mariadb" || ${PN} == 
"mariadb-galera" ]]
+       pbxt_patch_available || [[ ${PN} == "mariadb" || ${PN} == 
"mariadb-galera" ]] && mysql_check_version_range "5.1 to 5.5.32"
        return $?
 }
 
@@ -380,10 +444,10 @@
 # @FUNCTION: mysql-v2_pkg_setup
 # @DESCRIPTION:
 # Perform some basic tests and tasks during pkg_setup phase:
-#   die if FEATURES="test", USE="-minimal" and not using FEATURES="userpriv"
-#   check for conflicting use flags
-#   create new user and group for mysql
-#   warn about deprecated features
+#      die if FEATURES="test", USE="-minimal" and not using FEATURES="userpriv"
+#      check for conflicting use flags
+#      create new user and group for mysql
+#      warn about deprecated features
 mysql-v2_pkg_setup() {
 
        if has test ${FEATURES} ; then
@@ -404,11 +468,22 @@
        enewgroup mysql 60 || die "problem adding 'mysql' group"
        enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' 
user"
 
-       if use cluster; then
+       if use cluster && [[ "${PN}" != "mysql-cluster" ]]; then
                ewarn "Upstream has noted that the NDB cluster support in the 
5.0 and"
                ewarn "5.1 series should NOT be put into production. In the 
near"
                ewarn "future, it will be disabled from building."
        fi
+
+       if [[ ${PN} == "mysql-cluster" ]] ; then
+               mysql_version_is_at_least "7.2.9" && java-pkg-opt-2_pkg_setup
+       fi
+
+       if use_if_iuse tokudb && [[ $(gcc-version) < 4.7 ]] ; then
+               eerror "${PN} with tokudb needs to be built with gcc-4.7 or 
later."
+               eerror "Please use gcc-config to switch to gcc-4.7 or later 
version."
+               die
+       fi
+
 }
 
 # @FUNCTION: mysql-v2_src_unpack
@@ -431,6 +506,9 @@
 # Apply patches to the source code and remove unneeded bundled libs.
 mysql-v2_src_prepare() {
        ${BUILD_INHERIT}_src_prepare "$@"
+       if [[ ${PN} == "mysql-cluster" ]] ; then
+               mysql_version_is_at_least "7.2.9" && java-pkg-opt-2_src_prepare
+       fi
 }
 
 # @FUNCTION: mysql-v2_src_configure
@@ -458,6 +536,9 @@
 # @DESCRIPTION:
 # Create the user and groups for mysql - die if that fails.
 mysql-v2_pkg_preinst() {
+       if [[ ${PN} == "mysql-cluster" ]] ; then
+               mysql_version_is_at_least "7.2.9" && java-pkg-opt-2_pkg_preinst
+       fi
        enewgroup mysql 60 || die "problem adding 'mysql' group"
        enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' 
user"
 }
@@ -465,11 +546,11 @@
 # @FUNCTION: mysql-v2_pkg_postinst
 # @DESCRIPTION:
 # Run post-installation tasks:
-#   create the dir for logfiles if non-existant
-#   touch the logfiles and secure them
-#   install scripts
-#   issue required steps for optional features
-#   issue deprecation warnings
+#      create the dir for logfiles if non-existant
+#      touch the logfiles and secure them
+#      install scripts
+#      issue required steps for optional features
+#      issue deprecation warnings
 mysql-v2_pkg_postinst() {
 
        # Make sure the vars are correctly initialized
@@ -502,13 +583,14 @@
                        fi
                done
 
-               if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] \
-                       && mysql_version_is_at_least "5.2.10" && use pam ; then
-                       einfo
-                       elog "This install includes the PAM authentication 
plugin."
-                       elog "To activate and configure the PAM plugin, please 
read:"
-                       elog 
"https://kb.askmonty.org/en/pam-authentication-plugin/";
-                       einfo
+               if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
+                       if use_if_iuse pam ; then
+                               einfo
+                               elog "This install includes the PAM 
authentication plugin."
+                               elog "To activate and configure the PAM plugin, 
please read:"
+                               elog 
"https://kb.askmonty.org/en/pam-authentication-plugin/";
+                               einfo
+                       fi
                fi
 
                einfo
@@ -521,9 +603,19 @@
                elog "If you are upgrading major versions, you should run the"
                elog "mysql_upgrade tool."
                einfo
+
+               if [[ ${PN} == "mariadb-galera" ]] ; then
+                       einfo
+                       elog "Be sure to edit the my.cnf file to activate your 
cluster settings."
+                       elog "This should be done after running \"emerge 
--config =${CATEGORY}/${PF}\""
+                       elog "The first time the cluster is activated, you 
should add"
+                       elog "--wsrep-new-cluster to the options in 
/etc/conf.d/mysql for one node."
+                       elog "This option should then be removed for subsequent 
starts."
+                       einfo
+               fi
        fi
 
-       if pbxt_available && use pbxt ; then
+       if use_if_iuse pbxt ; then
                elog "Note: PBXT is now statically built when enabled."
                elog ""
                elog "If, you previously installed as a plugin and "
@@ -531,11 +623,11 @@
                elog "remove the ${MY_DATADIR}/mysql/plugin.* files, then"
                elog "use the MySQL upgrade script to restore the table"
                elog "or execute the following SQL command:"
-               elog "    CREATE TABLE IF NOT EXISTS plugin ("
-               elog "      name char(64) binary DEFAULT '' NOT NULL,"
-               elog "      dl char(128) DEFAULT '' NOT NULL,"
-               elog "      PRIMARY KEY (name)"
-               elog "    ) CHARACTER SET utf8 COLLATE utf8_bin;"
+               elog "  CREATE TABLE IF NOT EXISTS plugin ("
+               elog "          name char(64) binary DEFAULT '' NOT NULL,"
+               elog "          dl char(128) DEFAULT '' NOT NULL,"
+               elog "          PRIMARY KEY (name)"
+               elog "  ) CHARACTER SET utf8 COLLATE utf8_bin;"
        fi
 }
 
@@ -599,7 +691,7 @@
                                ewarn "Attempting to use ${MY_DATADIR_s}"
                        else
                                eerror "New MY_DATADIR (${MY_DATADIR_s}) does 
not exist"
-                               die "Configuration Failed!  Please reinstall 
${CATEGORY}/${PN}"
+                               die "Configuration Failed! Please reinstall 
${CATEGORY}/${PN}"
                        fi
                fi
        fi
@@ -684,6 +776,10 @@
 
        use prefix || options="${options} --user=mysql"
 
+       # Fix bug 446200. Don't reference host my.cnf
+       use prefix && [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] \
+               && options="${options} 
'--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
+
        pushd "${TMPDIR}" &>/dev/null
        #cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' 
'--basedir=${EPREFIX}/usr' ${options}"
        cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db




Reply via email to