diff options
author | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2013-06-26 19:31:49 +0000 |
---|---|---|
committer | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2013-06-26 19:31:49 +0000 |
commit | 18ca2e1e2592391c922a365888901b8224c8f2fa (patch) | |
tree | b38b4a354387750a28c77373cd6c6d0744ef3034 /eclass | |
parent | create texmf-var/web2c before trying to build the formats if it does not exis... (diff) | |
download | historical-18ca2e1e2592391c922a365888901b8224c8f2fa.tar.gz historical-18ca2e1e2592391c922a365888901b8224c8f2fa.tar.bz2 historical-18ca2e1e2592391c922a365888901b8224c8f2fa.zip |
[eclass] Copy mysql eclasses from the mysql overlay.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/mysql-autotools.eclass | 60 | ||||
-rw-r--r-- | eclass/mysql-cmake.eclass | 55 | ||||
-rw-r--r-- | eclass/mysql-v2.eclass | 193 |
3 files changed, 161 insertions, 147 deletions
diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclass index e00906be8eda..644c1e7489d2 100644 --- a/eclass/mysql-autotools.eclass +++ b/eclass/mysql-autotools.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.17 2013/03/16 19:20:34 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.18 2013/06/26 19:31:49 jmbsvicetto Exp $ # @ECLASS: mysql-autotools.eclass # @MAINTAINER: @@ -51,14 +51,14 @@ mysql-autotools_disable_test() { # ${S}/mysql-tests/suite/ndb_team/t/disabled.def # ${S}/mysql-tests/suite/binlog/t/disabled.def # ${S}/mysql-tests/suite/innodb/t/disabled.def - if [ -n "${testsuite}" ]; then + if [[ -n ${testsuite} ]]; then for mysql_disable_file in \ ${S}/mysql-test/suite/${testsuite}/disabled.def \ ${S}/mysql-test/suite/${testsuite}/t/disabled.def \ FAILED ; do - [ -f "${mysql_disable_file}" ] && break + [[ -f ${mysql_disable_file} ]] && break done - if [ "${mysql_disabled_file}" != "FAILED" ]; then + if [[ ${mysql_disabled_file} != "FAILED" ]]; then echo "${testname} : ${reason}" >> "${mysql_disable_file}" else ewarn "Could not find testsuite disabled.def location for ${rawtestname}" @@ -99,7 +99,7 @@ mysql-autotools_configure_minimal() { # MariaDB requires this flag in order to link to GPLv3 readline v6 or greater # A note is added to the configure output - if [[ "${PN}" == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then + if [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then myconf="${myconf} --disable-distribution" fi } @@ -134,7 +134,7 @@ mysql-autotools_configure_common() { fi fi - if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then + if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." ewarn "You MUST file bugs without these variables set." @@ -220,7 +220,7 @@ mysql-autotools_configure_51() { # Not supporting as examples: example,daemon_example,ftexample plugins_sta="${plugins_sta} partition" - if [[ "${PN}" != "mariadb" ]] ; then + if [[ ${PN} != "mariadb" ]] ; then elog "Before using the Federated storage engine, please be sure to read" elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" plugins_dyn="${plugins_dyn} federated" @@ -237,10 +237,10 @@ mysql-autotools_configure_51() { # - innobase, innodb_plugin # Build falcon if available for 6.x series. for i in innobase falcon ; do - [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}" + [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}" done for i in innodb_plugin ; do - [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}" + [[ -e ${S}/storage/${i} ]] && plugins_dyn="${plugins_dyn} ${i}" done # like configuration=max-no-ndb @@ -252,12 +252,12 @@ mysql-autotools_configure_51() { plugins_dis="${plugins_dis} ndbcluster" fi - if [[ "${PN}" == "mariadb" ]] ; then + if [[ ${PN} == "mariadb" ]] ; then # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not # caught above. # This is not optional, without it several upstream testcases fail. # Also strongly recommended by upstream. - if [[ "${PV}" < "5.2.0" ]] ; then + if [[ ${PV} < "5.2.0" ]] ; then myconf="${myconf} --with-maria-tmp-tables" plugins_sta="${plugins_sta} maria" else @@ -265,11 +265,11 @@ mysql-autotools_configure_51() { plugins_sta="${plugins_sta} aria" fi - [ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] || + [[ ( -e ${S}/storage/innobase ) || ( -e ${S}/storage/xtradb ) ]] || die "The ${P} package doesn't provide innobase nor xtradb" for i in innobase xtradb ; do - [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}" + [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}" done myconf="${myconf} $(use_with libevent)" @@ -300,7 +300,7 @@ mysql-autotools_configure_51() { fi fi - if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then + if pbxt_available && [[ ${PBXT_NEWSTYLE} == "1" ]]; then use pbxt \ && plugins_sta="${plugins_sta} pbxt" \ || plugins_dis="${plugins_dis} pbxt" @@ -311,7 +311,7 @@ mysql-autotools_configure_51() { plugins_dyn="" # Google MySQL, bundle what upstream supports - if [[ "${PN}" == "google-mysql" ]]; then + if [[ ${PN} == "google-mysql" ]]; then for x in innobase innodb_plugin innodb ; do plugins_sta="${plugins_sta//$x}" plugins_dyn="${plugins_dyn//$x}" @@ -389,7 +389,7 @@ mysql-autotools_src_prepare() { # 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}" + [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" # Additional checks, remove bundled zlib rm -f "${S}/zlib/"*.[ch] @@ -417,21 +417,21 @@ mysql-autotools_src_prepare() { i="innobase" o="${WORKDIR}/storage-${i}.mysql-upstream" # Have we been here already? - [ -d "${o}" ] && rm -f "${i}" + [[ -d ${o} ]] && rm -f "${i}" # Or maybe we haven't - [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" + [[ ( -d ${i} ) && ! ( -d ${o} ) ]] && mv "${i}" "${o}" cp -ral "${WORKDIR}/${XTRADB_P}" "${i}" popd >/dev/null fi - if pbxt_patch_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then + if pbxt_patch_available && [[ ${PBXT_NEWSTYLE} == "1" ]] && use pbxt ; then einfo "Adding storage engine: PBXT" pushd "${S}"/storage >/dev/null i='pbxt' - [ -d "${i}" ] && rm -rf "${i}" + [[ -d ${i} ]] && rm -rf "${i}" cp -ral "${WORKDIR}/${PBXT_P}" "${i}" f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch" - [[ -f $f ]] && epatch "$f" + [[ -f $f ]] && epatch "$f" popd >/dev/null fi @@ -490,7 +490,7 @@ mysql-autotools_src_configure() { # implicitly. Upstream might be interested in this, exclude # -fno-implicit-templates for google-mysql for now. mysql_version_is_at_least "5.0" \ - && [[ "${PN}" != "google-mysql" ]] \ + && [[ ${PN} != "google-mysql" ]] \ && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" export CXXFLAGS @@ -526,7 +526,7 @@ mysql-autotools_src_configure() { | xargs -0 -n100 sed -i \ -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|' - if [[ $EAPI == 2 ]] && [[ "${PBXT_NEWSTYLE}" != "1" ]]; then + if [[ $EAPI == 2 ]] && [[ ${PBXT_NEWSTYLE} != "1" ]]; then pbxt_patch_available && use pbxt && pbxt_src_configure fi } @@ -538,7 +538,7 @@ mysql-autotools_src_compile() { emake || die "emake failed" - if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then + if [[ ${PBXT_NEWSTYLE} != "1" ]]; then pbxt_patch_available && use pbxt && pbxt_src_compile fi } @@ -557,7 +557,7 @@ mysql-autotools_src_install() { testroot="${MY_SHAREDSTATEDIR}" \ || die "emake install failed" - if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then + if [[ ${PBXT_NEWSTYLE} != "1" ]]; then pbxt_patch_available && use pbxt && pbxt_src_install fi @@ -620,7 +620,7 @@ mysql-autotools_src_install() { # Empty directories ... diropts "-m0750" keepdir "${MY_DATADIR#${EPREFIX}}" - if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then + if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then chown -R mysql:mysql "${D}/${MY_DATADIR}" fi @@ -635,7 +635,7 @@ mysql-autotools_src_install() { # Docs einfo "Installing docs" for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do - [[ -f "$i" ]] && dodoc "$i" + [[ -f $i ]] && dodoc "$i" done doinfo "${S}"/Docs/mysql.info @@ -648,12 +648,12 @@ mysql-autotools_src_install() { "${S}"/support-files/magic \ "${S}"/support-files/ndb-config-2-node.ini do - [[ -f "$script" ]] && dodoc "${script}" + [[ -f $script ]] && dodoc "${script}" done docinto "scripts" for script in "${S}"/scripts/mysql* ; do - [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" + [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}" done fi @@ -661,7 +661,7 @@ mysql-autotools_src_install() { mysql_lib_symlinks "${ED}" #Remove mytop if perl is not selected - [[ "${PN}" == "mariadb" ]] && ! use perl \ + [[ ${PN} == "mariadb" ]] && ! use perl \ && mysql_version_is_at_least "5.3" \ && rm -f "${ED}/usr/bin/mytop" diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass index f47e5fd619ae..41cf20a5feea 100644 --- a/eclass/mysql-cmake.eclass +++ b/eclass/mysql-cmake.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.15 2013/03/04 19:10:31 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.16 2013/06/26 19:31:49 jmbsvicetto Exp $ # @ECLASS: mysql-cmake.eclass # @MAINTAINER: @@ -36,29 +36,29 @@ mysql-cmake_disable_test() { for mysql_disabled_file in \ ${S}/mysql-test/disabled.def \ ${S}/mysql-test/t/disabled.def ; do - [ -f "${mysql_disabled_file}" ] && break + [[ -f ${mysql_disabled_file} ]] && break done #mysql_disabled_file="${S}/mysql-test/t/disabled.def" #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" echo ${testname} : ${reason} >> "${mysql_disabled_file}" - if [ -n "${testsuite}" ] && [ "${testsuite}" != "main" ]; then + 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 \ FAILED ; do - [ -f "${mysql_disabled_file}" ] && break + [[ -f ${mysql_disabled_file} ]] && break done - if [ "${mysql_disabled_file}" != "FAILED" ]; then + if [[ ${mysql_disabled_file} != "FAILED" ]]; then echo "${testname} : ${reason}" >> "${mysql_disabled_file}" else for mysql_disabled_dir in \ ${S}/mysql-test/suite/${testsuite} \ ${S}/mysql-test/suite/${testsuite}/t \ FAILED ; do - [ -d "${mysql_disabled_dir}" ] && break + [[ -d ${mysql_disabled_dir} ]] && break done - if [ "${mysql_disabled_dir}" != "FAILED" ]; then + if [[ ${mysql_disabled_dir} != "FAILED" ]]; then echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def" else ewarn "Could not find testsuite disabled.def location for ${rawtestname}" @@ -72,7 +72,7 @@ mysql-cmake_disable_test() { # Helper function to configure locale cmake options configure_cmake_locale() { - if ! use minimal && [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then + if ! use minimal && [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." ewarn "You MUST file bugs without these variables set." @@ -151,7 +151,7 @@ configure_cmake_standard() { if use ssl; then mycmakeargs+=( -DWITH_SSL=system ) else - mycmakeargs+=( -DWITH_SSL=0 ) + mycmakeargs+=( -DWITH_SSL=bundled ) fi if mysql_version_is_at_least "5.5" && use jemalloc; then @@ -179,7 +179,7 @@ configure_cmake_standard() { mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) ) fi - if [ "${PN}" == "mariadb" ]; then + if [[ ${PN} == "mariadb" ]]; then mycmakeargs+=( $(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE) $(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE) @@ -189,7 +189,12 @@ configure_cmake_standard() { if ! use pam ; then mycmakeargs+=( -DAUTH_PAM_DISABLED=1 ) fi - + fi + + if [[ ${PN} == "percona-server" ]]; then + mycmakeargs+=( + $(cmake-utils_use_with pam) + ) fi } @@ -218,7 +223,7 @@ mysql-cmake_src_prepare() { # 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}" + [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" rm -f "scripts/mysqlbug" epatch_user @@ -253,13 +258,13 @@ mysql-cmake_src_configure() { -DINSTALL_SQLBENCHDIR=share/mysql -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql -DWITH_COMMENT="Gentoo Linux ${PF}" - -DWITHOUT_UNIT_TESTS=1 + $(cmake-utils_use_with test UNIT_TESTS) ) # 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" ]] ; then mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 ) fi @@ -274,12 +279,16 @@ mysql-cmake_src_configure() { # Bug #114895, bug #110149 filter-flags "-O" "-O[01]" - CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" + CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" # 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! + if ! mysql_version_is_at_least "5.7" ; then + CXXFLAGS="${CXXFLAGS} -fno-exceptions" + fi export CXXFLAGS # bug #283926, with GCC4.4, this is required to get correct behavior. @@ -316,6 +325,9 @@ mysql-cmake_src_install() { dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" + # Create a mariadb_config symlink + [[ ${PN} == "mariadb" ]] && 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" @@ -341,7 +353,7 @@ mysql-cmake_src_install() { # Configuration stuff case ${MYSQL_PV_MAJOR} in 5.[1-4]*) mysql_mycnf_version="5.1" ;; - 5.[5-9]|6*|7*) mysql_mycnf_version="5.5" ;; + 5.[5-9]|6*|7*|8*|9*|10*) mysql_mycnf_version="5.5" ;; esac einfo "Building default my.cnf (${mysql_mycnf_version})" insinto "${MY_SYSCONFDIR#${EPREFIX}}" @@ -363,7 +375,7 @@ mysql-cmake_src_install() { einfo "Creating initial directories" # Empty directories ... diropts "-m0750" - if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then + if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then dodir "${MY_DATADIR#${EPREFIX}}" keepdir "${MY_DATADIR#${EPREFIX}}" chown -R mysql:mysql "${D}/${MY_DATADIR}" @@ -386,19 +398,16 @@ mysql-cmake_src_install() { "${S}"/support-files/magic \ "${S}"/support-files/ndb-config-2-node.ini.sh do - [[ -f "$script" ]] && dodoc "${script}" + [[ -f $script ]] && dodoc "${script}" done docinto "scripts" for script in "${S}"/scripts/mysql* ; do - [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" + [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}" done - fi - mysql_lib_symlinks "${ED}" - #Remove mytop if perl is not selected - [[ "${PN}" == "mariadb" ]] && ! use perl \ + [[ ${PN} == "mariadb" ]] && ! use perl \ && rm -f "${ED}/usr/bin/mytop" } diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass index b13d22667f88..76dae6d5ce66 100644 --- a/eclass/mysql-v2.eclass +++ b/eclass/mysql-v2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.24 2013/02/13 00:40:57 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.25 2013/06/26 19:31:49 jmbsvicetto Exp $ # @ECLASS: mysql-v2.eclass # @MAINTAINER: @@ -11,7 +11,7 @@ # @BLURB: This eclass provides most of the functions for mysql ebuilds # @DESCRIPTION: # The mysql-v2.eclass is the base eclass to build the mysql and -# alternative projects (mariadb) ebuilds. +# alternative projects (mariadb and percona) ebuilds. # This eclass uses the mysql-autotools and mysql-cmake eclasses for the # specific bits related to the build system. # It provides the src_unpack, src_prepare, src_configure, src_compile, @@ -44,7 +44,7 @@ MYSQL_EXTRAS="" # @DESCRIPTION: # The version of the MYSQL_EXTRAS repo to use to build mysql # Use "none" to disable it's use -[[ "${MY_EXTRAS_VER}" == "live" ]] && MYSQL_EXTRAS="git-2" +[[ ${MY_EXTRAS_VER} == "live" ]] && MYSQL_EXTRAS="git-2" inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx versionator toolchain-funcs @@ -53,7 +53,7 @@ inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx # case "${EAPI:-0}" in - 3|4|5) ;; + 4|5) ;; *) die "Unsupported EAPI: ${EAPI}" ;; esac @@ -67,8 +67,8 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_ # and we will run a mysql server during test phase S="${WORKDIR}/mysql" -[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z" -if [[ "${MY_EXTRAS_VER}" == "live" ]]; then +[[ ${MY_EXTRAS_VER} == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z" +if [[ ${MY_EXTRAS_VER} == "live" ]]; then EGIT_PROJECT=mysql-extras EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git" fi @@ -113,10 +113,10 @@ mysql_version_is_at_least "5.1.50" || die "This eclass should only be used with # Designation by PERCONA for a MySQL version to apply an XTRADB release # Work out the default SERVER_URI correctly -if [ -z "${SERVER_URI}" ]; then - [ -z "${MY_PV}" ] && MY_PV="${PV//_/-}" - if [ "${PN}" == "mariadb" ]; then - MARIA_FULL_PV="$(replace_version_separator 3 '-' ${MY_PV})" +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}) 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 @@ -126,6 +126,16 @@ if [ -z "${SERVER_URI}" ]; then 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 " + if [[ ${PN} == "mariadb-galera" ]]; then + MY_SOURCEDIR="${PN%%-galera}-${MARIA_FULL_PV}" + fi + elif [[ ${PN} == "percona-server" ]]; then + 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 else URI_DIR="MySQL" URI_FILE="mysql" @@ -141,19 +151,28 @@ fi SRC_URI="${SERVER_URI}" # Gentoo patches to MySQL -[[ ${MY_EXTRAS_VER} != live ]] && [[ ${MY_EXTRAS_VER} != none ]] \ -&& SRC_URI="${SRC_URI} +if [[ ${MY_EXTRAS_VER} != "live" && ${MY_EXTRAS_VER} != "none" ]]; then + SRC_URI="${SRC_URI} mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 http://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 http://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" +fi DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." HOMEPAGE="http://www.mysql.com/" -if [[ "${PN}" == "mariadb" ]]; then +if [[ ${PN} == "mariadb" ]]; then HOMEPAGE="http://mariadb.org/" DESCRIPTION="An enhanced, drop-in replacement for MySQL" fi +if [[ ${PN} == "mariadb-galera" ]]; then + HOMEPAGE="http://mariadb.org/" + DESCRIPTION="An enhanced, drop-in replacement for MySQL with Galera Replication" +fi +if [[ ${PN} == "percona-server" ]]; then + HOMEPAGE="http://www.percona.com/software/percona-server" + DESCRIPTION="An enhanced, drop-in replacement fro MySQL from the Percona team" +fi LICENSE="GPL-2" SLOT="0" @@ -172,34 +191,29 @@ IUSE="${IUSE} extraengine" IUSE="${IUSE} cluster" IUSE="${IUSE} max-idx-128" -IUSE="${IUSE} berkdb" IUSE="${IUSE} +community profiling" -[[ ${PN} == "mariadb" ]] \ -&& mysql_check_version_range "5.1.38 to 5.3.99" \ -&& IUSE="${IUSE} libevent" - -[[ ${PN} == "mariadb" ]] \ -&& mysql_version_is_at_least "5.2" \ -&& IUSE="${IUSE} oqgraph" - -[[ ${PN} == "mariadb" ]] \ -&& mysql_version_is_at_least "5.2.5" \ -&& IUSE="${IUSE} sphinx" - -[[ ${PN} == "mariadb" ]] \ -&& mysql_version_is_at_least "5.2.10" \ -&& IUSE="${IUSE} pam" +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.10" && IUSE="${IUSE} pam" +fi if mysql_version_is_at_least "5.5"; then REQUIRED_USE="tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc )" IUSE="${IUSE} jemalloc tcmalloc" fi -REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )" +if mysql_version_is_at_least "5.5.7"; then + IUSE="${IUSE} systemtap" +fi -mysql_version_is_at_least "5.5.7" \ -&& IUSE="${IUSE} systemtap" +if [[ ${PN} == "percona-server" ]]; then + mysql_version_is_at_least "5.5.10" && IUSE="${IUSE} pam" +fi + +REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )" # # DEPENDENCIES: @@ -216,42 +230,30 @@ DEPEND=" >=sys-libs/zlib-1.2.3 " -[[ ${PN} == mariadb ]] \ -&& mysql_check_version_range "5.1.38 to 5.3.99" \ -&& DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )" +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 )" + mysql_version_is_at_least "5.2" && DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )" + mysql_version_is_at_least "5.2.5" && DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )" + 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 )" +fi # Having different flavours at the same time is not a good idea -for i in "mysql" "mariadb" ; do +for i in "mysql" "mariadb" "mariadb-galera" "percona-server"; do [[ ${i} == ${PN} ]] || DEPEND="${DEPEND} !dev-db/${i}" done -[[ "${PN}" == "mariadb" ]] \ -&& mysql_version_is_at_least "5.2" \ -&& DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )" - -[[ "${PN}" == "mariadb" ]] \ -&& mysql_version_is_at_least "5.2.5" \ -&& DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )" - -[[ "${PN}" == "mariadb" ]] \ -&& mysql_version_is_at_least "5.2.10" \ -&& DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )" - -# Bug 441700 MariaDB >=5.3 include custom mytop -[[ "${PN}" == "mariadb" ]] \ -&& mysql_version_is_at_least "5.3" \ -&& DEPEND="${DEPEND} perl? ( !dev-db/mytop )" - -mysql_version_is_at_least "5.5.7" \ -&& DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" \ -&& DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )" - -mysql_version_is_at_least "5.5" \ -&& DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )" +if mysql_version_is_at_least "5.5" ; then + DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )" + DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )" +fi -mysql_version_is_at_least "5.5" \ -&& DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )" +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 )" +fi # prefix: first need to implement something for #196294 RDEPEND="${DEPEND} @@ -259,14 +261,16 @@ RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql ) " -# Bug 455016 Add dependancies of mytop -[[ "${PN}" == "mariadb" ]] \ -&& mysql_version_is_at_least "5.3" \ -&& RDEPEND="${RDEPEND} perl? ( - virtual/perl-Getopt-Long - dev-perl/TermReadKey - virtual/perl-Term-ANSIColor - virtual/perl-Time-HiRes ) " +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 ) " + fi +fi DEPEND="${DEPEND} virtual/yacc @@ -278,8 +282,9 @@ DEPEND="${DEPEND} static? ( sys-libs/ncurses[static-libs] )" DEPEND="${DEPEND} >=dev-util/cmake-2.4.3" # compile-time-only -mysql_version_is_at_least "5.5.8" \ -&& DEPEND="${DEPEND} >=dev-util/cmake-2.6.3" +if mysql_version_is_at_least "5.5.8" ; then + DEPEND="${DEPEND} >=dev-util/cmake-2.6.3" +fi # dev-perl/DBD-mysql is needed by some scripts installed by MySQL PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" @@ -295,13 +300,12 @@ PDEPEND="${PDEPEND} =virtual/mysql-${MYSQL_PV_MAJOR}" # PBXT_VERSION means that we have a PBXT patch for this PV # PBXT was only introduced after 5.1.12 pbxt_patch_available() { - [[ ${PN} != "mariadb" ]] \ - && [[ -n "${PBXT_VERSION}" ]] + [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" && ( -n "${PBXT_VERSION}" ) ]] return $? } pbxt_available() { - pbxt_patch_available || [[ ${PN} == "mariadb" ]] + pbxt_patch_available || [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] return $? } @@ -310,18 +314,16 @@ pbxt_available() { # XTRADB_VERS means that we have a XTRADB patch for this PV # XTRADB was only introduced after 5.1.26 xtradb_patch_available() { - [[ ${PN} != "mariadb" ]] \ - && [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] + [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" + && ( -n "${XTRADB_VER}" ) && ( -n "${PERCONA_VER}" ) ]] return $? } - if pbxt_patch_available; then PBXT_P="pbxt-${PBXT_VERSION}" PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )" - fi # PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins @@ -393,8 +395,7 @@ mysql-v2_pkg_setup() { fi # Check for USE flag problems in pkg_setup - if ! mysql_version_is_at_least "5.2" \ - && use debug ; then + if ! mysql_version_is_at_least "5.2" && use debug ; then # Also in package.use.mask die "Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51" fi @@ -496,13 +497,13 @@ mysql-v2_pkg_postinst() { docinto "scripts" for script in scripts/mysql* ; do - [[ -f "${script}" ]] \ - && [[ "${script%.sh}" == "${script}" ]] \ - && dodoc "${script}" + if [[ -f "${script}" && "${script%.sh}" == "${script}" ]]; then + dodoc "${script}" + fi done - if [ ${PN} == "mariadb" ] \ - && mysql_version_is_at_least "5.2.10" && use pam ; then + 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:" @@ -536,10 +537,6 @@ mysql-v2_pkg_postinst() { elog " PRIMARY KEY (name)" elog " ) CHARACTER SET utf8 COLLATE utf8_bin;" fi - - mysql_check_version_range "4.0 to 5.0.99.99" \ - && use berkdb \ - && elog "Berkeley DB support is deprecated and will be removed in future versions!" } # @FUNCTION: mysql-v2_getopt @@ -587,7 +584,7 @@ mysql-v2_pkg_config() { local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" - if [[ -d "${old_MY_DATADIR_s}" ]] && [[ "${old_MY_DATADIR_s}" != / ]]; then + if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then if [[ -d "${MY_DATADIR_s}" ]]; then ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" @@ -670,11 +667,11 @@ mysql-v2_pkg_config() { && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ || touch "${TMPDIR}/fill_help_tables.sql" help_tables="${TMPDIR}/fill_help_tables.sql" - + # Figure out which options we need to disable to do the setup helpfile="${TMPDIR}/mysqld-help" ${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null - for opt in grant-tables host-cache name-resolve networking slave-start bdb \ + for opt in grant-tables host-cache name-resolve networking slave-start \ federated innodb ssl log-bin relay-log slow-query-log external-locking \ ndbcluster log-slave-updates \ ; do @@ -690,7 +687,7 @@ mysql-v2_pkg_config() { 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 - [ -f ${cmd} ] || cmd=${EROOT}usr/bin/mysql_install_db + [[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options}" einfo "Command: $cmd" eval $cmd \ @@ -716,6 +713,14 @@ mysql-v2_pkg_config() { einfo "Creating the mysql database and setting proper" einfo "permissions on it ..." + # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it + PID_DIR="${EROOT}/var/run/mysqld" + if [[ ! -d "${PID_DIR}" ]]; then + mkdir "${PID_DIR}" + chown mysql:mysql "${PID_DIR}" + chmod 755 "${PID_DIR}" + fi + local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" local mysqld="${EROOT}/usr/sbin/mysqld \ @@ -763,7 +768,7 @@ mysql-v2_pkg_config() { mysql < "${sqltmp}" rc=$? eend $? - [ $rc -ne 0 ] && ewarn "Failed to load zoneinfo!" + [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" # Stop the server and cleanup einfo "Stopping the server ..." |