Bump patch to newest incarnation of the eclass
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/mysql@2235 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
parent
925fd4bc5d
commit
81d2395c3e
@ -1,6 +1,6 @@
|
|||||||
# Copyright 1999-2009 Gentoo Foundation
|
# Copyright 1999-2009 Gentoo Foundation
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.126 2010/01/31 05:47:21 robbat2 Exp $
|
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.144 2010/04/01 20:36:39 robbat2 Exp $
|
||||||
|
|
||||||
# @ECLASS: mysql.eclass
|
# @ECLASS: mysql.eclass
|
||||||
# @MAINTAINER:
|
# @MAINTAINER:
|
||||||
@ -40,6 +40,7 @@ case "${EAPI:-0}" in
|
|||||||
pkg_preinst pkg_postinst \
|
pkg_preinst pkg_postinst \
|
||||||
pkg_config pkg_postrm
|
pkg_config pkg_postrm
|
||||||
IUSE_DEFAULT_ON='+'
|
IUSE_DEFAULT_ON='+'
|
||||||
|
IUSE_DEFAULT_OFF='-'
|
||||||
;;
|
;;
|
||||||
0 | 1)
|
0 | 1)
|
||||||
EXPORT_FUNCTIONS pkg_setup \
|
EXPORT_FUNCTIONS pkg_setup \
|
||||||
@ -53,6 +54,14 @@ case "${EAPI:-0}" in
|
|||||||
die "Unsupported EAPI: ${EAPI}" ;;
|
die "Unsupported EAPI: ${EAPI}" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
# @ECLASS-VARIABLE: MYSQL_PV_MAJOR
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Upstream MySQL considers the first two parts of the version number to be the
|
||||||
|
# major version. Upgrades that change major version should always run
|
||||||
|
# mysql_upgrade.
|
||||||
|
MYSQL_PV_MAJOR="$(get_version_component_range 1-2 ${PV})"
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MYSQL_VERSION_ID
|
# @ECLASS-VARIABLE: MYSQL_VERSION_ID
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# MYSQL_VERSION_ID will be:
|
# MYSQL_VERSION_ID will be:
|
||||||
@ -63,7 +72,6 @@ esac
|
|||||||
# We also strip off upstream's trailing letter that they use to respin tarballs
|
# We also strip off upstream's trailing letter that they use to respin tarballs
|
||||||
|
|
||||||
MYSQL_VERSION_ID=""
|
MYSQL_VERSION_ID=""
|
||||||
MY_PV="${PV/pre/m}"
|
|
||||||
tpv="${PV%[a-z]}"
|
tpv="${PV%[a-z]}"
|
||||||
tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}"
|
tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}"
|
||||||
for vatom in 0 1 2 3 ; do
|
for vatom in 0 1 2 3 ; do
|
||||||
@ -80,30 +88,22 @@ MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
|
|||||||
# and 0 (no).
|
# and 0 (no).
|
||||||
# Community features are available in mysql-community
|
# Community features are available in mysql-community
|
||||||
# AND in the re-merged mysql-5.0.82 and newer
|
# AND in the re-merged mysql-5.0.82 and newer
|
||||||
if [ "${PN}" == "mysql-community" ]; then
|
if [ "${PN}" == "mysql-community" -o "${PN}" == "mariadb" ]; then
|
||||||
MYSQL_COMMUNITY_FEATURES=1
|
MYSQL_COMMUNITY_FEATURES=1
|
||||||
elif [ "${PV#5.0}" != "${PV}" ] && mysql_version_is_at_least "5.0.82"; then
|
elif [ "${PV#5.0}" != "${PV}" ] && mysql_version_is_at_least "5.0.82"; then
|
||||||
MYSQL_COMMUNITY_FEATURES=1
|
MYSQL_COMMUNITY_FEATURES=1
|
||||||
elif [ "${PV#5.1}" != "${PV}" ] && mysql_version_is_at_least "5.1.28"; then
|
elif [ "${PV#5.1}" != "${PV}" ] && mysql_version_is_at_least "5.1.28"; then
|
||||||
MYSQL_COMMUNITY_FEATURES=1
|
MYSQL_COMMUNITY_FEATURES=1
|
||||||
elif [ "${PV#5.4}" != "${PV}" ]; then
|
elif [ "${PV#5.4}" != "${PV}" ] ; then
|
||||||
MYSQL_COMMUNITY_FEATURES=1
|
MYSQL_COMMUNITY_FEATURES=1
|
||||||
elif [ "${PV#5.5}" != "${PV}" ]; then
|
elif [ "${PV#5.5}" != "${PV}" ] ; then
|
||||||
|
MYSQL_COMMUNITY_FEATURES=1
|
||||||
|
elif [ "${PV#6.0}" != "${PV}" ] ; then
|
||||||
MYSQL_COMMUNITY_FEATURES=1
|
MYSQL_COMMUNITY_FEATURES=1
|
||||||
else
|
else
|
||||||
MYSQL_COMMUNITY_FEATURES=0
|
MYSQL_COMMUNITY_FEATURES=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XTRADB_VER
|
|
||||||
# @DESCRIPTION:
|
|
||||||
# Version of the XTRADB storage engine
|
|
||||||
XTRADB_VER="${XTRADB_VER}"
|
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: PERCONA_VER
|
|
||||||
# @DESCRIPTION:
|
|
||||||
# Designation by PERCONA for a MySQL version to apply an XTRADB release
|
|
||||||
PERCONA_VER="${PERCONA_VER}"
|
|
||||||
|
|
||||||
# Be warned, *DEPEND are version-dependant
|
# Be warned, *DEPEND are version-dependant
|
||||||
# These are used for both runtime and compiletime
|
# These are used for both runtime and compiletime
|
||||||
DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
|
DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
|
||||||
@ -113,10 +113,13 @@ DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
|
|||||||
>=sys-libs/readline-4.1
|
>=sys-libs/readline-4.1
|
||||||
>=sys-libs/zlib-1.2.3"
|
>=sys-libs/zlib-1.2.3"
|
||||||
|
|
||||||
|
[[ "${PN}" == "mariadb" ]] \
|
||||||
|
&& DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )"
|
||||||
|
|
||||||
# Having different flavours at the same time is not a good idea
|
# Having different flavours at the same time is not a good idea
|
||||||
for i in "" "-community" ; do
|
for i in "mysql" "mysql-community" "mariadb" ; do
|
||||||
[[ "${i}" == ${PN#mysql} ]] ||
|
[[ "${i}" == ${PN} ]] ||
|
||||||
DEPEND="${DEPEND} !dev-db/mysql${i}"
|
DEPEND="${DEPEND} !dev-db/${i}"
|
||||||
done
|
done
|
||||||
|
|
||||||
RDEPEND="${DEPEND}
|
RDEPEND="${DEPEND}
|
||||||
@ -135,21 +138,30 @@ mysql_version_is_at_least "5.1.12" \
|
|||||||
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
|
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
|
||||||
|
|
||||||
# For other stuff to bring us in
|
# For other stuff to bring us in
|
||||||
PDEPEND="${PDEPEND} =virtual/mysql-$(get_version_component_range 1-2 ${PV})"
|
PDEPEND="${PDEPEND} =virtual/mysql-${MYSQL_PV_MAJOR}"
|
||||||
|
|
||||||
# Work out the default SERVER_URI correctly
|
# Work out the default SERVER_URI correctly
|
||||||
if [ -z "${SERVER_URI}" ]; then
|
if [ -z "${SERVER_URI}" ]; then
|
||||||
|
[ -z "${MY_PV}" ] && MY_PV="${PV//_/-}"
|
||||||
|
if [ "${PN}" == "mariadb" ]; then
|
||||||
|
MARIA_FULL_PV="$(replace_version_separator 3 '-' ${PV})"
|
||||||
|
MARIA_FULL_P="${PN}-${MARIA_FULL_PV}"
|
||||||
|
SERVER_URI="
|
||||||
|
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
|
||||||
|
"
|
||||||
# The community build is on the mirrors
|
# The community build is on the mirrors
|
||||||
if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
|
elif [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
|
||||||
SERVER_URI="mirror://mysql/Downloads/MySQL-${MY_PV%.*}/mysql-${MY_PV//_/-}.tar.gz"
|
SERVER_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/mysql-${MY_PV}.tar.gz"
|
||||||
# The (old) enterprise source is on the primary site only
|
# The (old) enterprise source is on the primary site only
|
||||||
elif [ "${PN}" == "mysql" ]; then
|
elif [ "${PN}" == "mysql" ]; then
|
||||||
SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${MY_PV//_/-}.tar.gz"
|
SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${MY_PV}.tar.gz"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define correct SRC_URIs
|
# Define correct SRC_URIs
|
||||||
SRC_URI="${SERVER_URI}"
|
SRC_URI="${SERVER_URI} ${GO_MYSQL_PATCHES}"
|
||||||
|
|
||||||
# Gentoo patches to MySQL
|
# Gentoo patches to MySQL
|
||||||
[[ ${MY_EXTRAS_VER} != live ]] \
|
[[ ${MY_EXTRAS_VER} != live ]] \
|
||||||
@ -160,15 +172,23 @@ SRC_URI="${SERVER_URI}"
|
|||||||
|
|
||||||
for str in ${MYSQL_STORAGE} ; do
|
for str in ${MYSQL_STORAGE} ; do
|
||||||
STORAGE_USE="${str/-*/}"
|
STORAGE_USE="${str/-*/}"
|
||||||
SRC_URI="${SRC_URI} ${STORAGE_USE}? ( http://ftp.disconnected-by-peer.at/mysql/mysql-storage-${str}.tar.gz )"
|
SRC_URI="${SRC_URI} http://ftp.disconnected-by-peer.at/mysql/mysql-storage-${str}.tar.gz"
|
||||||
STORAGE_IUSE="${STORAGE_IUSE} ${STORAGE_USE}"
|
STORAGE_IUSE="${STORAGE_IUSE} ${STORAGE_USE}"
|
||||||
|
# IUSE="{IUSE} ${IUSE_DEFAULT_OFF}${STORAGE_USE}"
|
||||||
done
|
done
|
||||||
|
|
||||||
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
|
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
|
||||||
HOMEPAGE="http://www.mysql.com/"
|
HOMEPAGE="http://www.mysql.com/"
|
||||||
|
if [[ "${PN}" == "mariadb" ]]; then
|
||||||
|
HOMEPAGE="http://askmonty.org/"
|
||||||
|
DESCRIPTION="MariaDB is a MySQL fork with 3rd-party patches and additional storage engines merged."
|
||||||
|
fi
|
||||||
|
if [[ "${PN}" == "mysql-community" ]]; then
|
||||||
|
DESCRIPTION="${DESCRIPTION} (obsolete, move to dev-db/mysql)"
|
||||||
|
fi
|
||||||
LICENSE="GPL-2"
|
LICENSE="GPL-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="big-tables debug embedded minimal ${IUSE_DEFAULT_ON}perl selinux ssl static"
|
IUSE="big-tables debug embedded minimal ${IUSE_DEFAULT_ON}perl selinux ssl static test"
|
||||||
|
|
||||||
mysql_version_is_at_least "4.1" \
|
mysql_version_is_at_least "4.1" \
|
||||||
&& IUSE="${IUSE} latin1"
|
&& IUSE="${IUSE} latin1"
|
||||||
@ -185,12 +205,12 @@ mysql_version_is_at_least "5.0.18" \
|
|||||||
mysql_version_is_at_least "5.1" \
|
mysql_version_is_at_least "5.1" \
|
||||||
|| IUSE="${IUSE} berkdb"
|
|| IUSE="${IUSE} berkdb"
|
||||||
|
|
||||||
mysql_version_is_at_least "5.1.26" \
|
|
||||||
&& IUSE="${IUSE} innodb xtradb dynamicplugins"
|
|
||||||
|
|
||||||
[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \
|
[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \
|
||||||
&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling"
|
&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling"
|
||||||
|
|
||||||
|
[[ "${PN}" == "mariadb" ]] \
|
||||||
|
&& IUSE="${IUSE} libevent pbxt xtradb"
|
||||||
|
|
||||||
IUSE="${IUSE} ${STORAGE_IUSE}"
|
IUSE="${IUSE} ${STORAGE_IUSE}"
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -209,7 +229,7 @@ mysql_disable_test() {
|
|||||||
testsuite="${rawtestname/.*}"
|
testsuite="${rawtestname/.*}"
|
||||||
testname="${rawtestname/*.}"
|
testname="${rawtestname/*.}"
|
||||||
mysql_disable_file="${S}/mysql-test/t/disabled.def"
|
mysql_disable_file="${S}/mysql-test/t/disabled.def"
|
||||||
einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
|
#einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
|
||||||
echo ${testname} : ${reason} >> "${mysql_disable_file}"
|
echo ${testname} : ${reason} >> "${mysql_disable_file}"
|
||||||
|
|
||||||
# ${S}/mysql-tests/t/disabled.def
|
# ${S}/mysql-tests/t/disabled.def
|
||||||
@ -389,20 +409,16 @@ configure_40_41_50() {
|
|||||||
myconf="${myconf} --with-extra-tools"
|
myconf="${myconf} --with-extra-tools"
|
||||||
myconf="${myconf} --with-innodb"
|
myconf="${myconf} --with-innodb"
|
||||||
myconf="${myconf} --without-readline"
|
myconf="${myconf} --without-readline"
|
||||||
|
myconf="${myconf} $(use_with ssl openssl)"
|
||||||
mysql_version_is_at_least "5.0" || myconf="${myconf} $(use_with raid)"
|
mysql_version_is_at_least "5.0" || myconf="${myconf} $(use_with raid)"
|
||||||
|
|
||||||
# --with-vio is not needed anymore, it's on by default and
|
# --with-vio is not needed anymore, it's on by default and
|
||||||
# has been removed from configure
|
# has been removed from configure
|
||||||
|
# Apply to 4.x and 5.0.[0-3]
|
||||||
if use ssl ; then
|
if use ssl ; then
|
||||||
mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio"
|
mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if mysql_version_is_at_least "5.1.11" ; then
|
|
||||||
myconf="${myconf} $(use_with ssl)"
|
|
||||||
else
|
|
||||||
myconf="${myconf} $(use_with ssl openssl)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if mysql_version_is_at_least "5.0.60" ; then
|
if mysql_version_is_at_least "5.0.60" ; then
|
||||||
if use berkdb ; then
|
if use berkdb ; then
|
||||||
elog "Berkeley DB support was disabled due to build failures"
|
elog "Berkeley DB support was disabled due to build failures"
|
||||||
@ -467,57 +483,140 @@ configure_51() {
|
|||||||
# TODO: !!!! readd --without-readline
|
# TODO: !!!! readd --without-readline
|
||||||
# the failure depend upon config/ac-macros/readline.m4 checking into
|
# the failure depend upon config/ac-macros/readline.m4 checking into
|
||||||
# readline.h instead of history.h
|
# readline.h instead of history.h
|
||||||
myconf="${myconf} $(use_with ssl)"
|
myconf="${myconf} $(use_with ssl ssl /usr)"
|
||||||
myconf="${myconf} --enable-assembler"
|
myconf="${myconf} --enable-assembler"
|
||||||
myconf="${myconf} --with-geometry"
|
myconf="${myconf} --with-geometry"
|
||||||
myconf="${myconf} --with-readline"
|
myconf="${myconf} --with-readline"
|
||||||
myconf="${myconf} --with-zlib-dir=/usr"
|
myconf="${myconf} --with-zlib-dir=/usr/"
|
||||||
myconf="${myconf} --without-pstack"
|
myconf="${myconf} --without-pstack"
|
||||||
|
myconf="${myconf} --with-plugindir=/usr/$(get_libdir)/mysql/plugin"
|
||||||
|
|
||||||
use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
|
use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
|
||||||
|
if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
|
||||||
|
myconf="${myconf} $(use_enable community community-features)"
|
||||||
|
if use community; then
|
||||||
|
myconf="${myconf} $(use_enable profiling)"
|
||||||
|
else
|
||||||
|
myconf="${myconf} --disable-profiling"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Scan for all available plugins
|
||||||
|
local plugins_avail="$(
|
||||||
|
LANG=C \
|
||||||
|
find "${S}" \
|
||||||
|
\( \
|
||||||
|
-name 'plug.in' \
|
||||||
|
-o -iname 'configure.in' \
|
||||||
|
-o -iname 'configure.ac' \
|
||||||
|
\) \
|
||||||
|
-print0 \
|
||||||
|
| xargs -0 sed -r -n \
|
||||||
|
-e '/^MYSQL_STORAGE_ENGINE/{
|
||||||
|
s~MYSQL_STORAGE_ENGINE\([[:space:]]*\[?([-_a-z0-9]+)\]?.*,~\1 ~g ;
|
||||||
|
s~^([^ ]+).*~\1~gp;
|
||||||
|
}' \
|
||||||
|
| tr -s '\n' ' '
|
||||||
|
)"
|
||||||
|
|
||||||
# 5.1 introduces a new way to manage storage engines (plugins)
|
# 5.1 introduces a new way to manage storage engines (plugins)
|
||||||
# like configuration=none
|
# like configuration=none
|
||||||
local plugins="csv,myisam,myisammrg,heap"
|
# This base set are required, and will always be statically built.
|
||||||
if use extraengine && ! use dynamicplugins ; then
|
local plugins_sta="csv myisam myisammrg heap"
|
||||||
# like configuration=max-no-ndb, archive and example removed in 5.1.11
|
local plugins_dyn=""
|
||||||
plugins="${plugins},archive,blackhole,example,federated,partition"
|
local plugins_dis="example ibmdb2i"
|
||||||
|
|
||||||
elog "Before using the Federated storage engine, please be sure to read"
|
# These aren't actually required by the base set, but are really useful:
|
||||||
elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
|
plugins_sta="${plugins_sta} archive blackhole"
|
||||||
|
|
||||||
|
# default in 5.5.4
|
||||||
|
if mysql_version_is_at_least "5.5.4" ; then
|
||||||
|
plugins_sta="${plugins_sta} partition"
|
||||||
|
fi
|
||||||
|
# Now the extras
|
||||||
|
if use extraengine ; then
|
||||||
|
# like configuration=max-no-ndb, archive and example removed in 5.1.11
|
||||||
|
# not added yet: ibmdb2i
|
||||||
|
# Not supporting as examples: example,daemon_example,ftexample
|
||||||
|
plugins_sta="${plugins_sta} partition"
|
||||||
|
plugins_dyn="${plugins_dyn} federated"
|
||||||
|
|
||||||
|
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"
|
||||||
|
else
|
||||||
|
elog "MariaDB includes the FederatedX engine. Be sure to read"
|
||||||
|
elog "http://askmonty.org/wiki/index.php/Manual:FederatedX_storage_engine"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
plugins_dis="${plugins_dis} partition federated"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Upstream specifically requests that InnoDB always be built.
|
# Upstream specifically requests that InnoDB always be built:
|
||||||
plugins="${plugins},innobase"
|
# - 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}"
|
||||||
|
done
|
||||||
|
for i in innodb_plugin ; do
|
||||||
|
[ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}"
|
||||||
|
done
|
||||||
|
|
||||||
# like configuration=max-no-ndb
|
# like configuration=max-no-ndb
|
||||||
if use cluster ; then
|
if use cluster ; then
|
||||||
plugins="${plugins},ndbcluster"
|
plugins_sta="${plugins_sta} ndbcluster"
|
||||||
myconf="${myconf} --with-ndb-binlog"
|
myconf="${myconf} --with-ndb-binlog"
|
||||||
|
else
|
||||||
|
plugins_dis="${plugins_dis} ndbcluster"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if mysql_version_is_at_least "6.0" ; then
|
if [[ "${PN}" == "mariadb" ]] ; then
|
||||||
plugins="${plugins},falcon"
|
# In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
|
||||||
|
# caught above.
|
||||||
|
plugins_sta="${plugins_sta} maria innobase"
|
||||||
|
myconf="${myconf} $(use_with libevent)"
|
||||||
|
# This is not optional, without it several upstream testcases fail.
|
||||||
|
# Also strongly recommended by upstream.
|
||||||
|
myconf="${myconf} --with-maria-tmp-tables"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for str in ${STORAGE_IUSE} ; do
|
for str in ${STORAGE_IUSE} ; do
|
||||||
if use ${str} ; then
|
if use ${str} ; then
|
||||||
# don't confuse autoconf by specifying the plugins to or more times
|
# don't confuse autoconf by specifying the plugins two or more times
|
||||||
if ! use dynamicplugins ; then
|
[[ -e "${S}"/storage/${str} ]] && plugins_dyn="${plugins_dyn} ${str}"
|
||||||
[[ -d storage/${str} ]] && plugins="${plugins},${str}"
|
elif ! use ${str} ; then
|
||||||
fi
|
# don't confuse autoconf by specifying the plugins two or more times
|
||||||
# suppress error message
|
[[ -e "${S}"/storage/${str} ]] && plugins_dis="${plugins_dis} ${str}"
|
||||||
[[ ${str} = "innodb" ]] && str="innobase"
|
else
|
||||||
[[ ${str} = "xtradb" ]] && str="innobase"
|
# don't confuse autoconf by specifying the plugins two or more times
|
||||||
[[ ! -d storage/${str} ]] && eerror "use ${str} but no ${str} plugin"
|
[[ -e "${S}"/storage/${str} ]] && plugins_sta="${plugins_sta} ${str}"
|
||||||
if [ -e storage/${str}/setup.sh ]; then
|
fi
|
||||||
pushd storage/${str}
|
# suppress error message
|
||||||
sh setup.sh
|
[[ ${str} = "innodb" ]] && str="innobase"
|
||||||
popd
|
[[ ${str} = "xtradb" ]] && str="innobase"
|
||||||
fi
|
[[ ! -e "${S}"/storage/${str} ]] && eerror "use ${str} but no ${str} plugin"
|
||||||
|
if [ -e "${S}"/storage/${str}/setup.sh ]; then
|
||||||
|
pushd storage/${str}
|
||||||
|
sh setup.sh
|
||||||
|
popd
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
myconf="${myconf} --with-plugins=${plugins}"
|
use static && \
|
||||||
|
plugins_sta="${plugins_sta} ${plugins_dyn}" && \
|
||||||
|
plugins_dyn=""
|
||||||
|
|
||||||
|
einfo "Available plugins: ${plugins_avail}"
|
||||||
|
einfo "Dynamic plugins: ${plugins_dyn}"
|
||||||
|
einfo "Static plugins: ${plugins_sta}"
|
||||||
|
einfo "Disabled plugins: ${plugins_dis}"
|
||||||
|
|
||||||
|
# These are the static plugins
|
||||||
|
myconf="${myconf} --with-plugins=${plugins_sta// /,}"
|
||||||
|
# And the disabled ones
|
||||||
|
for i in ${plugins_dis} ; do
|
||||||
|
myconf="${myconf} --without-plugin-${i}"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -541,8 +640,9 @@ mysql_pkg_setup() {
|
|||||||
|
|
||||||
# Check for USE flag problems in pkg_setup
|
# Check for USE flag problems in pkg_setup
|
||||||
if use static && use ssl ; then
|
if use static && use ssl ; then
|
||||||
eerror "MySQL does not support being built statically with SSL support enabled!"
|
M="MySQL does not support being built statically with SSL support enabled!"
|
||||||
die "MySQL does not support being built statically with SSL support enabled!"
|
eerror "${M}"
|
||||||
|
die "${M}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! mysql_version_is_at_least "5.0" \
|
if ! mysql_version_is_at_least "5.0" \
|
||||||
@ -554,17 +654,24 @@ mysql_pkg_setup() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if mysql_version_is_at_least "4.1.3" \
|
if mysql_version_is_at_least "4.1.3" \
|
||||||
&& ( use cluster || use extraengine ) \
|
&& ( use cluster || use extraengine || use embedded ) \
|
||||||
&& use minimal ; then
|
&& use minimal ; then
|
||||||
eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
|
M="USE flags 'cluster', 'extraengine', 'embedded' conflict with 'minimal' USE flag!"
|
||||||
die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
|
eerror "${M}"
|
||||||
|
die "${M}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Bug #290570 fun. Upstream made us need a fairly new GCC4.
|
# Bug #290570, 284946, 307251
|
||||||
if mysql_version_is_at_least "5.0.83" ; then
|
# Upstream changes made us need a fairly new GCC4.
|
||||||
|
# But only for 5.0.8[3-6]!
|
||||||
|
if mysql_version_is_at_least "5.0.83" && ! mysql_version_is_at_least 5.0.87 ; then
|
||||||
GCC_VER=$(gcc-version)
|
GCC_VER=$(gcc-version)
|
||||||
case ${GCC_VER} in
|
case ${GCC_VER} in
|
||||||
2*|3*|4.0|4.1|4.2) die "Active GCC too old! Must have at least GCC4.3" ;;
|
2*|3*|4.0|4.1|4.2)
|
||||||
|
eerror "Some releases of MySQL required a very new GCC, and then"
|
||||||
|
eerror "later release relaxed that requirement again. Either pick a"
|
||||||
|
eerror "MySQL >=5.0.87, or use a newer GCC."
|
||||||
|
die "Active GCC too old!" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -575,6 +682,16 @@ mysql_pkg_setup() {
|
|||||||
mysql_check_version_range "4.0 to 5.0.99.99" \
|
mysql_check_version_range "4.0 to 5.0.99.99" \
|
||||||
&& use berkdb \
|
&& use berkdb \
|
||||||
&& elog "Berkeley DB support is deprecated and will be removed in future versions!"
|
&& elog "Berkeley DB support is deprecated and will be removed in future versions!"
|
||||||
|
|
||||||
|
if [ "${PN}" != "mysql-cluster" ] && use 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."
|
||||||
|
ewarn ""
|
||||||
|
ewarn "If you need NDB support, you should instead move to the new"
|
||||||
|
ewarn "mysql-cluster package that represents that upstream NDB"
|
||||||
|
ewarn "development."
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# @FUNCTION: mysql_src_unpack
|
# @FUNCTION: mysql_src_unpack
|
||||||
@ -588,17 +705,15 @@ mysql_src_unpack() {
|
|||||||
|
|
||||||
for str in ${MYSQL_STORAGE} ; do
|
for str in ${MYSQL_STORAGE} ; do
|
||||||
storage_name="${str/-*/}"
|
storage_name="${str/-*/}"
|
||||||
if use ${storage_name} ; then
|
einfo "Moving ${str/-/ Storage Engine Version } in place"
|
||||||
einfo "Moving ${str/-/ Storage Engine Version } in place"
|
pushd "${WORKDIR}/${MY_SOURCEDIR}"/storage
|
||||||
pushd "${WORKDIR}/${MY_SOURCEDIR}"/storage
|
i="${WORKDIR}/mysql-storage-${str}"
|
||||||
i="${WORKDIR}/mysql-storage-${str}"
|
o="${storage_name}"
|
||||||
o="${storage_name}"
|
# Have we been here already ? or are we updating the included engine !
|
||||||
# Have we been here already ? or are we updating the included engine !
|
[ -h "${o}" ] && rm -f "${o}"
|
||||||
[ -h "${o}" ] && rm -f "${o}"
|
# Or maybe we haven't
|
||||||
# Or maybe we haven't
|
[ -d "${i}" -a ! -d "${o}" ] && cp -R "${i}"/* "${WORKDIR}/${MY_SOURCEDIR}"
|
||||||
[ -d "${i}" -a ! -d "${o}" ] && cp -R "${i}"/* "${WORKDIR}/${MY_SOURCEDIR}"
|
popd
|
||||||
popd
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Grab the patches
|
# Grab the patches
|
||||||
@ -623,12 +738,16 @@ mysql_src_prepare() {
|
|||||||
EPATCH_SUFFIX="patch"
|
EPATCH_SUFFIX="patch"
|
||||||
mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
|
mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
|
||||||
# Clean out old items
|
# Clean out old items
|
||||||
rm -f "${EPATCH_SOURCE}"/*
|
#rm -f "${EPATCH_SOURCE}"/*
|
||||||
# Now link in right patches
|
# Now link in right patches
|
||||||
mysql_mv_patches
|
mysql_mv_patches
|
||||||
# And apply
|
# And apply
|
||||||
epatch
|
epatch
|
||||||
|
|
||||||
|
# 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}"
|
||||||
|
|
||||||
# Additional checks, remove bundled zlib
|
# Additional checks, remove bundled zlib
|
||||||
rm -f "${S}/zlib/"*.[ch]
|
rm -f "${S}/zlib/"*.[ch]
|
||||||
sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
|
sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
|
||||||
@ -651,8 +770,6 @@ mysql_src_prepare() {
|
|||||||
|
|
||||||
local rebuilddirlist d
|
local rebuilddirlist d
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if mysql_version_is_at_least "5.1.26" && use xtradb && use innodb ; then
|
if mysql_version_is_at_least "5.1.26" && use xtradb && use innodb ; then
|
||||||
eerror "Percona XtraDB and Innobase innoDB can not be insalled at the same time."
|
eerror "Percona XtraDB and Innobase innoDB can not be insalled at the same time."
|
||||||
elif mysql_version_is_at_least "5.1.26" && use xtradb && ! use innodb ; then
|
elif mysql_version_is_at_least "5.1.26" && use xtradb && ! use innodb ; then
|
||||||
@ -673,6 +790,7 @@ mysql_src_prepare() {
|
|||||||
# Or maybe we haven't
|
# Or maybe we haven't
|
||||||
[ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
[ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
||||||
mv -f "xtradb" "${i}"
|
mv -f "xtradb" "${i}"
|
||||||
|
rm -rf "innodb"
|
||||||
popd
|
popd
|
||||||
elif mysql_version_is_at_least "5.1.26" && use innodb && ! use xtradb ; then
|
elif mysql_version_is_at_least "5.1.26" && use innodb && ! use xtradb ; then
|
||||||
einfo "Replacing InnoDB with Innobase innoDB"
|
einfo "Replacing InnoDB with Innobase innoDB"
|
||||||
@ -692,17 +810,19 @@ mysql_src_prepare() {
|
|||||||
# Or maybe we haven't
|
# Or maybe we haven't
|
||||||
[ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
[ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
||||||
mv -f "innodb" "${i}"
|
mv -f "innodb" "${i}"
|
||||||
|
rm -rf "xtradb"
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if mysql_version_is_at_least "5.1.12" ; then
|
if mysql_version_is_at_least "5.1.12" ; then
|
||||||
einfo "Updating innobase cmake"
|
|
||||||
rebuilddirlist="."
|
rebuilddirlist="."
|
||||||
# TODO: check this with a cmake expert
|
# This does not seem to be needed presently. robbat2 2010/02/23
|
||||||
cmake \
|
#einfo "Updating innobase cmake"
|
||||||
-DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
|
## TODO: check this with a cmake expert
|
||||||
-DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
|
#cmake \
|
||||||
"storage/innobase"
|
# -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
|
||||||
|
# -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
|
||||||
|
# "storage/innobase"
|
||||||
else
|
else
|
||||||
rebuilddirlist=". innobase"
|
rebuilddirlist=". innobase"
|
||||||
fi
|
fi
|
||||||
@ -801,10 +921,10 @@ mysql_src_configure() {
|
|||||||
# Compile the mysql code.
|
# Compile the mysql code.
|
||||||
mysql_src_compile() {
|
mysql_src_compile() {
|
||||||
# Be backwards compatible for now
|
# Be backwards compatible for now
|
||||||
case ${EAPI:-0} in
|
case ${EAPI:-0} in
|
||||||
2) : ;;
|
2) : ;;
|
||||||
0 | 1) mysql_src_configure ;;
|
0 | 1) mysql_src_configure ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
emake || die "emake failed"
|
emake || die "emake failed"
|
||||||
}
|
}
|
||||||
@ -816,7 +936,11 @@ mysql_src_install() {
|
|||||||
# Make sure the vars are correctly initialized
|
# Make sure the vars are correctly initialized
|
||||||
mysql_init_vars
|
mysql_init_vars
|
||||||
|
|
||||||
emake install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die "emake install failed"
|
emake install \
|
||||||
|
DESTDIR="${D}" \
|
||||||
|
benchdir_root="${MY_SHAREDSTATEDIR}" \
|
||||||
|
testroot="${MY_SHAREDSTATEDIR}" \
|
||||||
|
|| die "emake install failed"
|
||||||
|
|
||||||
# Convenience links
|
# Convenience links
|
||||||
einfo "Making Convenience links for mysqlcheck multi-call binary"
|
einfo "Making Convenience links for mysqlcheck multi-call binary"
|
||||||
@ -830,7 +954,7 @@ mysql_src_install() {
|
|||||||
for removeme in "mysql-log-rotate" mysql.server* \
|
for removeme in "mysql-log-rotate" mysql.server* \
|
||||||
binary-configure* my-*.cnf mi_test_all*
|
binary-configure* my-*.cnf mi_test_all*
|
||||||
do
|
do
|
||||||
rm -f "${D}"/usr/share/mysql/${removeme}
|
rm -f "${D}"/${MY_SHAREDSTATEDIR}/${removeme}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Clean up stuff for a minimal build
|
# Clean up stuff for a minimal build
|
||||||
@ -842,8 +966,17 @@ mysql_src_install() {
|
|||||||
rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
|
rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
|
||||||
fi
|
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.
|
||||||
|
if use !test ; then
|
||||||
|
rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test
|
||||||
|
fi
|
||||||
|
|
||||||
# Configuration stuff
|
# Configuration stuff
|
||||||
if mysql_version_is_at_least "4.1" ; then
|
if mysql_version_is_at_least "5.1" ; then
|
||||||
|
mysql_mycnf_version="5.1"
|
||||||
|
elif mysql_version_is_at_least "4.1" ; then
|
||||||
mysql_mycnf_version="4.1"
|
mysql_mycnf_version="4.1"
|
||||||
else
|
else
|
||||||
mysql_mycnf_version="4.0"
|
mysql_mycnf_version="4.0"
|
||||||
@ -855,7 +988,9 @@ mysql_src_install() {
|
|||||||
"${FILESDIR}/my.cnf-${mysql_mycnf_version}" \
|
"${FILESDIR}/my.cnf-${mysql_mycnf_version}" \
|
||||||
> "${TMPDIR}/my.cnf.ok"
|
> "${TMPDIR}/my.cnf.ok"
|
||||||
if mysql_version_is_at_least "4.1" && use latin1 ; then
|
if mysql_version_is_at_least "4.1" && use latin1 ; then
|
||||||
sed -e "s|utf8|latin1|g" -i "${TMPDIR}/my.cnf.ok"
|
sed -i \
|
||||||
|
-e "/character-set/s|utf8|latin1|g" \
|
||||||
|
"${TMPDIR}/my.cnf.ok"
|
||||||
fi
|
fi
|
||||||
newins "${TMPDIR}/my.cnf.ok" my.cnf
|
newins "${TMPDIR}/my.cnf.ok" my.cnf
|
||||||
|
|
||||||
@ -880,7 +1015,7 @@ mysql_src_install() {
|
|||||||
|
|
||||||
# Docs
|
# Docs
|
||||||
einfo "Installing docs"
|
einfo "Installing docs"
|
||||||
dodoc README COPYING ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE
|
dodoc README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE
|
||||||
doinfo "${S}"/Docs/mysql.info
|
doinfo "${S}"/Docs/mysql.info
|
||||||
|
|
||||||
# Minimal builds don't have the MySQL server
|
# Minimal builds don't have the MySQL server
|
||||||
@ -892,12 +1027,12 @@ mysql_src_install() {
|
|||||||
"${S}"/support-files/magic \
|
"${S}"/support-files/magic \
|
||||||
"${S}"/support-files/ndb-config-2-node.ini
|
"${S}"/support-files/ndb-config-2-node.ini
|
||||||
do
|
do
|
||||||
dodoc "${script}"
|
[[ -f "$script" ]] && dodoc "${script}"
|
||||||
done
|
done
|
||||||
|
|
||||||
docinto "scripts"
|
docinto "scripts"
|
||||||
for script in "${S}"/scripts/mysql* ; do
|
for script in "${S}"/scripts/mysql* ; do
|
||||||
[[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
|
[[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -941,12 +1076,15 @@ mysql_pkg_postinst() {
|
|||||||
support-files/magic \
|
support-files/magic \
|
||||||
support-files/ndb-config-2-node.ini
|
support-files/ndb-config-2-node.ini
|
||||||
do
|
do
|
||||||
dodoc "${script}"
|
[[ -f "${script}" ]] \
|
||||||
|
&& dodoc "${script}"
|
||||||
done
|
done
|
||||||
|
|
||||||
docinto "scripts"
|
docinto "scripts"
|
||||||
for script in scripts/mysql* ; do
|
for script in scripts/mysql* ; do
|
||||||
[[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
|
[[ -f "${script}" ]] \
|
||||||
|
&& [[ "${script%.sh}" == "${script}" ]] \
|
||||||
|
&& dodoc "${script}"
|
||||||
done
|
done
|
||||||
|
|
||||||
einfo
|
einfo
|
||||||
@ -956,6 +1094,21 @@ mysql_pkg_postinst() {
|
|||||||
einfo
|
einfo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if use pbxt ; then
|
||||||
|
# TODO: explain it better
|
||||||
|
elog " mysql> INSTALL PLUGIN pbxt SONAME 'libpbxt.so';"
|
||||||
|
elog " mysql> CREATE TABLE t1 (c1 int, c2 text) ENGINE=pbxt;"
|
||||||
|
elog "if, after that, you cannot start the MySQL server,"
|
||||||
|
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;"
|
||||||
|
fi
|
||||||
|
|
||||||
mysql_check_version_range "4.0 to 5.0.99.99" \
|
mysql_check_version_range "4.0 to 5.0.99.99" \
|
||||||
&& use berkdb \
|
&& use berkdb \
|
||||||
&& elog "Berkeley DB support is deprecated and will be removed in future versions!"
|
&& elog "Berkeley DB support is deprecated and will be removed in future versions!"
|
||||||
@ -1002,7 +1155,12 @@ mysql_pkg_config() {
|
|||||||
|
|
||||||
local pwd1="a"
|
local pwd1="a"
|
||||||
local pwd2="b"
|
local pwd2="b"
|
||||||
local maxtry=5
|
local MYSQL_ROOT_PASSWORD=''
|
||||||
|
local maxtry=15
|
||||||
|
|
||||||
|
if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${ROOT}/root/.my.cnf" ]; then
|
||||||
|
MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${ROOT}/root/.my.cnf")"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
|
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
|
||||||
ewarn "You have already a MySQL database in place."
|
ewarn "You have already a MySQL database in place."
|
||||||
@ -1015,18 +1173,21 @@ mysql_pkg_config() {
|
|||||||
# localhost. Also causes weird failures.
|
# localhost. Also causes weird failures.
|
||||||
[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
|
[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
|
||||||
|
|
||||||
einfo "Creating the mysql database and setting proper"
|
if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
|
||||||
einfo "permissions on it ..."
|
|
||||||
|
|
||||||
einfo "Insert a password for the mysql 'root' user"
|
einfo "Please provide a password for the mysql 'root' user now,"
|
||||||
ewarn "Avoid [\"'\\_%] characters in the password"
|
einfo "or in the MYSQL_ROOT_PASSWORD env var."
|
||||||
read -rsp " >" pwd1 ; echo
|
ewarn "Avoid [\"'\\_%] characters in the password"
|
||||||
|
read -rsp " >" pwd1 ; echo
|
||||||
|
|
||||||
einfo "Retype the password"
|
einfo "Retype the password"
|
||||||
read -rsp " >" pwd2 ; echo
|
read -rsp " >" pwd2 ; echo
|
||||||
|
|
||||||
if [[ "x$pwd1" != "x$pwd2" ]] ; then
|
if [[ "x$pwd1" != "x$pwd2" ]] ; then
|
||||||
die "Passwords are not the same"
|
die "Passwords are not the same"
|
||||||
|
fi
|
||||||
|
MYSQL_ROOT_PASSWORD="${pwd1}"
|
||||||
|
unset pwd1 pwd2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local options=""
|
local options=""
|
||||||
@ -1050,9 +1211,20 @@ mysql_pkg_config() {
|
|||||||
chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null
|
chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null
|
||||||
chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null
|
chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null
|
||||||
|
|
||||||
if mysql_version_is_at_least "4.1.3" ; then
|
# Figure out which options we need to disable to do the setup
|
||||||
options="--skip-ndbcluster"
|
helpfile="${TMPDIR}/mysqld-help"
|
||||||
|
${ROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
|
||||||
|
for opt in grant-tables host-cache name-resolve networking slave-start bdb \
|
||||||
|
federated innodb ssl log-bin relay-log slow-query-log external-locking \
|
||||||
|
; do
|
||||||
|
optexp="--(skip-)?${opt}" optfull="--skip-${opt}"
|
||||||
|
egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
|
||||||
|
done
|
||||||
|
# But some options changed names
|
||||||
|
egrep -sq external-locking "${helpfile}" && \
|
||||||
|
options="${options/skip-locking/skip-external-locking}"
|
||||||
|
|
||||||
|
if mysql_version_is_at_least "4.1.3" ; then
|
||||||
# Filling timezones, see
|
# Filling timezones, see
|
||||||
# http://dev.mysql.com/doc/mysql/en/time-zone-support.html
|
# http://dev.mysql.com/doc/mysql/en/time-zone-support.html
|
||||||
"${ROOT}/usr/bin/mysql_tzinfo_to_sql" "${ROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
|
"${ROOT}/usr/bin/mysql_tzinfo_to_sql" "${ROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
|
||||||
@ -1061,49 +1233,61 @@ mysql_pkg_config() {
|
|||||||
cat "${help_tables}" >> "${sqltmp}"
|
cat "${help_tables}" >> "${sqltmp}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
einfo "Creating the mysql database and setting proper"
|
||||||
|
einfo "permissions on it ..."
|
||||||
|
|
||||||
local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
|
local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
|
||||||
local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
|
local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
|
||||||
local mysqld="${ROOT}/usr/sbin/mysqld \
|
local mysqld="${ROOT}/usr/sbin/mysqld \
|
||||||
${options} \
|
${options} \
|
||||||
--user=mysql \
|
--user=mysql \
|
||||||
--skip-grant-tables \
|
|
||||||
--basedir=${ROOT}/usr \
|
--basedir=${ROOT}/usr \
|
||||||
--datadir=${ROOT}/${MY_DATADIR} \
|
--datadir=${ROOT}/${MY_DATADIR} \
|
||||||
--skip-innodb \
|
|
||||||
--skip-bdb \
|
|
||||||
--skip-networking \
|
|
||||||
--max_allowed_packet=8M \
|
--max_allowed_packet=8M \
|
||||||
--net_buffer_length=16K \
|
--net_buffer_length=16K \
|
||||||
|
--default-storage-engine=MyISAM \
|
||||||
--socket=${socket} \
|
--socket=${socket} \
|
||||||
--pid-file=${pidfile}"
|
--pid-file=${pidfile}"
|
||||||
|
#einfo "About to start mysqld: ${mysqld}"
|
||||||
|
ebegin "Starting mysqld"
|
||||||
${mysqld} &
|
${mysqld} &
|
||||||
|
rc=$?
|
||||||
while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
|
while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
|
||||||
maxtry=$((${maxtry}-1))
|
maxtry=$((${maxtry}-1))
|
||||||
echo -n "."
|
echo -n "."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
eend $rc
|
||||||
|
|
||||||
|
if ! [[ -S "${socket}" ]]; then
|
||||||
|
die "Completely failed to start up mysqld with: ${mysqld}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ebegin "Setting root password"
|
||||||
# Do this from memory, as we don't want clear text passwords in temp files
|
# Do this from memory, as we don't want clear text passwords in temp files
|
||||||
local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'"
|
local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'"
|
||||||
"${ROOT}/usr/bin/mysql" \
|
"${ROOT}/usr/bin/mysql" \
|
||||||
--socket=${socket} \
|
--socket=${socket} \
|
||||||
-hlocalhost \
|
-hlocalhost \
|
||||||
-e "${sql}"
|
-e "${sql}"
|
||||||
|
eend $?
|
||||||
|
|
||||||
einfo "Loading \"zoneinfo\", this step may require a few seconds ..."
|
ebegin "Loading \"zoneinfo\", this step may require a few seconds ..."
|
||||||
|
|
||||||
"${ROOT}/usr/bin/mysql" \
|
"${ROOT}/usr/bin/mysql" \
|
||||||
--socket=${socket} \
|
--socket=${socket} \
|
||||||
-hlocalhost \
|
-hlocalhost \
|
||||||
-uroot \
|
-uroot \
|
||||||
-p"${pwd1}" \
|
-p"${MYSQL_ROOT_PASSWORD}" \
|
||||||
mysql < "${sqltmp}"
|
mysql < "${sqltmp}"
|
||||||
|
rc=$?
|
||||||
|
eend $?
|
||||||
|
[ $rc -ne 0 ] && ewarn "Failed to load zoneinfo!"
|
||||||
|
|
||||||
# Stop the server and cleanup
|
# Stop the server and cleanup
|
||||||
|
einfo "Stopping the server ..."
|
||||||
kill $(< "${pidfile}" )
|
kill $(< "${pidfile}" )
|
||||||
rm -f "${sqltmp}"
|
rm -f "${sqltmp}"
|
||||||
einfo "Stopping the server ..."
|
|
||||||
wait %1
|
wait %1
|
||||||
einfo "Done"
|
einfo "Done"
|
||||||
}
|
}
|
||||||
|
@ -1,112 +1,167 @@
|
|||||||
--- /usr/portage/eclass/mysql.eclass 2010-02-01 02:08:45.000000000 +0100
|
--- /var/lib/layman/mysql-overlay/eclass/mysql.eclass 2010-04-29 20:11:37.345620519 +0200
|
||||||
+++ mysql.eclass 2010-02-01 07:14:49.174800340 +0100
|
+++ mysql.eclass 2010-05-30 02:06:43.216440310 +0200
|
||||||
@@ -63,6 +63,7 @@
|
@@ -40,6 +40,7 @@
|
||||||
# We also strip off upstream's trailing letter that they use to respin tarballs
|
pkg_preinst pkg_postinst \
|
||||||
|
pkg_config pkg_postrm
|
||||||
MYSQL_VERSION_ID=""
|
IUSE_DEFAULT_ON='+'
|
||||||
+MY_PV="${PV/pre/m}"
|
+ IUSE_DEFAULT_OFF='-'
|
||||||
tpv="${PV%[a-z]}"
|
;;
|
||||||
tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}"
|
0 | 1)
|
||||||
for vatom in 0 1 2 3 ; do
|
EXPORT_FUNCTIONS pkg_setup \
|
||||||
@@ -87,6 +88,8 @@
|
@@ -103,16 +104,6 @@
|
||||||
MYSQL_COMMUNITY_FEATURES=1
|
|
||||||
elif [ "${PV#5.4}" != "${PV}" ]; then
|
|
||||||
MYSQL_COMMUNITY_FEATURES=1
|
|
||||||
+elif [ "${PV#5.5}" != "${PV}" ]; then
|
|
||||||
+ MYSQL_COMMUNITY_FEATURES=1
|
|
||||||
else
|
|
||||||
MYSQL_COMMUNITY_FEATURES=0
|
MYSQL_COMMUNITY_FEATURES=0
|
||||||
fi
|
fi
|
||||||
@@ -138,10 +141,10 @@
|
|
||||||
if [ -z "${SERVER_URI}" ]; then
|
-# @ECLASS-VARIABLE: XTRADB_VER
|
||||||
# The community build is on the mirrors
|
-# @DESCRIPTION:
|
||||||
if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
|
-# Version of the XTRADB storage engine
|
||||||
- SERVER_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/mysql-${PV//_/-}.tar.gz"
|
-XTRADB_VER="${XTRADB_VER}"
|
||||||
+ SERVER_URI="mirror://mysql/Downloads/MySQL-${MY_PV%.*}/mysql-${MY_PV//_/-}.tar.gz"
|
-
|
||||||
# The (old) enterprise source is on the primary site only
|
-# @ECLASS-VARIABLE: PERCONA_VER
|
||||||
elif [ "${PN}" == "mysql" ]; then
|
-# @DESCRIPTION:
|
||||||
- SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz"
|
-# Designation by PERCONA for a MySQL version to apply an XTRADB release
|
||||||
+ SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${MY_PV//_/-}.tar.gz"
|
-PERCONA_VER="${PERCONA_VER}"
|
||||||
fi
|
-
|
||||||
|
# Be warned, *DEPEND are version-dependant
|
||||||
|
# These are used for both runtime and compiletime
|
||||||
|
DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
|
||||||
|
@@ -170,7 +161,7 @@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -155,19 +158,11 @@
|
# Define correct SRC_URIs
|
||||||
|
-SRC_URI="${SERVER_URI}"
|
||||||
|
+SRC_URI="${SERVER_URI} ${GO_MYSQL_PATCHES}"
|
||||||
|
|
||||||
|
# Gentoo patches to MySQL
|
||||||
|
[[ ${MY_EXTRAS_VER} != live ]] \
|
||||||
|
@@ -179,6 +170,13 @@
|
||||||
http://g3nt8.org/patches/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/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
|
||||||
|
|
||||||
-# PBXT engine
|
|
||||||
-mysql_version_is_at_least "5.1.12" \
|
|
||||||
-&& [[ -n "${PBXT_VERSION}" ]] \
|
|
||||||
-&& PBXT_P="pbxt-${PBXT_VERSION}" \
|
|
||||||
-&& PBXT_SRC_URI="mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" \
|
|
||||||
-&& SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )"
|
|
||||||
-
|
|
||||||
-# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set
|
|
||||||
-mysql_version_is_at_least "5.1.26" \
|
|
||||||
-&& [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] \
|
|
||||||
-&& XTRADB_P="percona-xtradb-${XTRADB_VER}" \
|
|
||||||
-&& XTRADB_SRC_URI="http://www.percona.com/${PN}/xtradb/${PERCONA_VER}/source/${XTRADB_P}.tar.gz" \
|
|
||||||
-&& SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI} )"
|
|
||||||
+for str in ${MYSQL_STORAGE} ; do
|
+for str in ${MYSQL_STORAGE} ; do
|
||||||
+ STORAGE_USE="${str/-*/}"
|
+ STORAGE_USE="${str/-*/}"
|
||||||
+ SRC_URI="${SRC_URI} ${STORAGE_USE}? ( http://ftp.disconnected-by-peer.at/mysql/mysql-storage-${str}.tar.gz )"
|
+ SRC_URI="${SRC_URI} http://ftp.disconnected-by-peer.at/mysql/mysql-storage-${str}.tar.gz"
|
||||||
+ STORAGE_IUSE="${STORAGE_IUSE} ${STORAGE_USE}"
|
+ STORAGE_IUSE="${STORAGE_IUSE} ${STORAGE_USE}"
|
||||||
|
+# IUSE="{IUSE} ${IUSE_DEFAULT_OFF}${STORAGE_USE}"
|
||||||
+done
|
+done
|
||||||
|
+
|
||||||
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
|
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
|
||||||
HOMEPAGE="http://www.mysql.com/"
|
HOMEPAGE="http://www.mysql.com/"
|
||||||
@@ -190,17 +185,14 @@
|
if [[ "${PN}" == "mariadb" ]]; then
|
||||||
mysql_version_is_at_least "5.1" \
|
@@ -211,57 +209,9 @@
|
||||||
|| IUSE="${IUSE} berkdb"
|
|
||||||
|
|
||||||
-mysql_version_is_at_least "5.1.12" \
|
|
||||||
-&& [[ -n "${PBXT_VERSION}" ]] \
|
|
||||||
-&& IUSE="${IUSE} pbxt"
|
|
||||||
-
|
|
||||||
mysql_version_is_at_least "5.1.26" \
|
|
||||||
-&& [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] \
|
|
||||||
-&& IUSE="${IUSE} xtradb"
|
|
||||||
+&& IUSE="${IUSE} innodb xtradb dynamicplugins"
|
|
||||||
|
|
||||||
[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \
|
|
||||||
&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling"
|
&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling"
|
||||||
|
|
||||||
+IUSE="${IUSE} ${STORAGE_IUSE}"
|
[[ "${PN}" == "mariadb" ]] \
|
||||||
+
|
-&& IUSE="${IUSE} libevent"
|
||||||
#
|
-
|
||||||
# HELPER FUNCTIONS:
|
-# MariaDB has integrated PBXT
|
||||||
#
|
-# PBXT_VERSION means that we have a PBXT patch for this PV
|
||||||
@@ -479,15 +471,14 @@
|
-# PBXT was only introduced after 5.1.12
|
||||||
myconf="${myconf} --enable-assembler"
|
-pbxt_patch_available() {
|
||||||
myconf="${myconf} --with-geometry"
|
- [[ "${PN}" != "mariadb" ]] \
|
||||||
myconf="${myconf} --with-readline"
|
- && mysql_version_is_at_least "5.1.12" \
|
||||||
- myconf="${myconf} --with-row-based-replication"
|
- && [[ -n "${PBXT_VERSION}" ]]
|
||||||
- myconf="${myconf} --with-zlib=/usr/$(get_libdir)"
|
- return $?
|
||||||
+ myconf="${myconf} --with-zlib-dir=/usr"
|
|
||||||
myconf="${myconf} --without-pstack"
|
|
||||||
use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
|
|
||||||
|
|
||||||
- # 5.1 introduces a new way to manage storage engines (plugins)
|
|
||||||
+ # 5.1 introduces a new way to manage storage engines (plugins)
|
|
||||||
# like configuration=none
|
|
||||||
local plugins="csv,myisam,myisammrg,heap"
|
|
||||||
- if use extraengine ; then
|
|
||||||
+ if use extraengine && ! use dynamicplugins ; then
|
|
||||||
# like configuration=max-no-ndb, archive and example removed in 5.1.11
|
|
||||||
plugins="${plugins},archive,blackhole,example,federated,partition"
|
|
||||||
|
|
||||||
@@ -504,44 +495,29 @@
|
|
||||||
myconf="${myconf} --with-ndb-binlog"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- if mysql_version_is_at_least "5.2" ; then
|
|
||||||
+ if mysql_version_is_at_least "6.0" ; then
|
|
||||||
plugins="${plugins},falcon"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- myconf="${myconf} --with-plugins=${plugins}"
|
|
||||||
-}
|
-}
|
||||||
-
|
-
|
||||||
|
-pbxt_available() {
|
||||||
|
- pbxt_patch_available || [[ "${PN}" == "mariadb" ]]
|
||||||
|
- return $?
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set
|
||||||
|
-# MariaDB has integrated XtraDB
|
||||||
|
-# 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" ]] \
|
||||||
|
- && mysql_version_is_at_least "5.1.26" \
|
||||||
|
- && [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]]
|
||||||
|
- return $?
|
||||||
|
-}
|
||||||
|
+&& IUSE="${IUSE} libevent pbxt xtradb"
|
||||||
|
|
||||||
|
-
|
||||||
|
-pbxt_patch_available \
|
||||||
|
-&& 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} )" \
|
||||||
|
-
|
||||||
|
-# PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins
|
||||||
|
-# vs. built outside the dir
|
||||||
|
-pbxt_available \
|
||||||
|
-&& IUSE="${IUSE} pbxt" \
|
||||||
|
-&& mysql_version_is_at_least "5.1.40" \
|
||||||
|
-&& PBXT_NEWSTYLE=1
|
||||||
|
-
|
||||||
|
-xtradb_patch_available \
|
||||||
|
-&& XTRADB_P="percona-xtradb-${XTRADB_VER}" \
|
||||||
|
-&& XTRADB_SRC_URI_COMMON="${PERCONA_VER}/source/${XTRADB_P}.tar.gz" \
|
||||||
|
-&& XTRADB_SRC_B1="http://www.percona.com/" \
|
||||||
|
-&& XTRADB_SRC_B2="${XTRADB_SRC_B1}/percona-builds/" \
|
||||||
|
-&& XTRADB_SRC_URI1="${XTRADB_SRC_B2}/Percona-Server/Percona-Server-${XTRADB_SRC_URI_COMMON}" \
|
||||||
|
-&& XTRADB_SRC_URI2="${XTRADB_SRC_B2}/xtradb/${XTRADB_SRC_URI_COMMON}" \
|
||||||
|
-&& XTRADB_SRC_URI3="${XTRADB_SRC_B1}/${PN}/xtradb/${XTRADB_SRC_URI_COMMON}" \
|
||||||
|
-&& SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI1} ${XTRADB_SRC_URI2} ${XTRADB_SRC_URI3} )" \
|
||||||
|
-&& IUSE="${IUSE} xtradb"
|
||||||
|
+IUSE="${IUSE} ${STORAGE_IUSE}"
|
||||||
|
|
||||||
|
#
|
||||||
|
# HELPER FUNCTIONS:
|
||||||
|
@@ -589,7 +539,7 @@
|
||||||
|
# not added yet: ibmdb2i
|
||||||
|
# Not supporting as examples: example,daemon_example,ftexample
|
||||||
|
plugins_sta="${plugins_sta} partition"
|
||||||
|
- plugins_dyn="${plugins_sta} federated"
|
||||||
|
+ plugins_dyn="${plugins_dyn} federated"
|
||||||
|
|
||||||
|
if [[ "${PN}" != "mariadb" ]] ; then
|
||||||
|
elog "Before using the Federated storage engine, please be sure to read"
|
||||||
|
@@ -623,18 +573,34 @@
|
||||||
|
if [[ "${PN}" == "mariadb" ]] ; then
|
||||||
|
# In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
|
||||||
|
# caught above.
|
||||||
|
- plugins_sta="${plugins_sta},maria,innobase"
|
||||||
|
+ plugins_sta="${plugins_sta} maria innobase"
|
||||||
|
myconf="${myconf} $(use_with libevent)"
|
||||||
|
# This is not optional, without it several upstream testcases fail.
|
||||||
|
# Also strongly recommended by upstream.
|
||||||
|
myconf="${myconf} --with-maria-tmp-tables"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
|
||||||
|
- use pbxt \
|
||||||
|
- && plugins_dyn="${plugins_dyn} pbxt" \
|
||||||
|
- || plugins_dis="${plugins_dis} pbxt"
|
||||||
|
- fi
|
||||||
|
+ for str in ${STORAGE_IUSE} ; do
|
||||||
|
+ if use ${str} ; then
|
||||||
|
+ # don't confuse autoconf by specifying the plugins two or more times
|
||||||
|
+ [[ -e "${S}"/storage/${str} ]] && plugins_dyn="${plugins_dyn} ${str}"
|
||||||
|
+ elif ! use ${str} ; then
|
||||||
|
+ # don't confuse autoconf by specifying the plugins two or more times
|
||||||
|
+ [[ -e "${S}"/storage/${str} ]] && plugins_dis="${plugins_dis} ${str}"
|
||||||
|
+ else
|
||||||
|
+ # don't confuse autoconf by specifying the plugins two or more times
|
||||||
|
+ [[ -e "${S}"/storage/${str} ]] && plugins_sta="${plugins_sta} ${str}"
|
||||||
|
+ fi
|
||||||
|
+ # suppress error message
|
||||||
|
+ [[ ${str} = "innodb" ]] && str="innobase"
|
||||||
|
+ [[ ${str} = "xtradb" ]] && str="innobase"
|
||||||
|
+ [[ ! -e "${S}"/storage/${str} ]] && eerror "use ${str} but no ${str} plugin"
|
||||||
|
+ if [ -e "${S}"/storage/${str}/setup.sh ]; then
|
||||||
|
+ pushd storage/${str}
|
||||||
|
+ sh setup.sh
|
||||||
|
+ popd
|
||||||
|
+ fi
|
||||||
|
+ done
|
||||||
|
|
||||||
|
use static && \
|
||||||
|
plugins_sta="${plugins_sta} ${plugins_dyn}" && \
|
||||||
|
@@ -653,39 +619,6 @@
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
-pbxt_src_configure() {
|
-pbxt_src_configure() {
|
||||||
- mysql_init_vars
|
- mysql_init_vars
|
||||||
-
|
-
|
||||||
@ -116,13 +171,13 @@
|
|||||||
- AT_GNUCONF_UPDATE="yes" eautoreconf
|
- AT_GNUCONF_UPDATE="yes" eautoreconf
|
||||||
-
|
-
|
||||||
- local myconf=""
|
- local myconf=""
|
||||||
- myconf="${myconf} --with-mysql=${S} --libdir=${D}/${MY_LIBDIR}"
|
- myconf="${myconf} --with-mysql=${S} --libdir=/usr/$(get_libdir)"
|
||||||
- use debug && myconf="${myconf} --with-debug=full"
|
- use debug && myconf="${myconf} --with-debug=full"
|
||||||
- # TODO: is it safe/needed to use econf here ?
|
- econf ${myconf} || die "Problem configuring PBXT storage engine"
|
||||||
- ./configure ${myconf} || die "Problem configuring PBXT storage engine"
|
|
||||||
-}
|
-}
|
||||||
-
|
-
|
||||||
-pbxt_src_compile() {
|
-pbxt_src_compile() {
|
||||||
|
-
|
||||||
- # Be backwards compatible for now
|
- # Be backwards compatible for now
|
||||||
- if [[ $EAPI != 2 ]]; then
|
- if [[ $EAPI != 2 ]]; then
|
||||||
- pbxt_src_configure
|
- pbxt_src_configure
|
||||||
@ -133,66 +188,105 @@
|
|||||||
- popd
|
- popd
|
||||||
- # TODO: modify test suite for PBXT
|
- # TODO: modify test suite for PBXT
|
||||||
-}
|
-}
|
||||||
+ for str in ${STORAGE_IUSE} ; do
|
-
|
||||||
+ if use ${str} ; then
|
|
||||||
+ # don't confuse autoconf by specifying the plugins to or more times
|
|
||||||
+ if ! use dynamicplugins ; then
|
|
||||||
+ [[ -d storage/${str} ]] && plugins="${plugins},${str}"
|
|
||||||
+ fi
|
|
||||||
+ # suppress error message
|
|
||||||
+ [[ ${str} = "innodb" ]] && str="innobase"
|
|
||||||
+ [[ ${str} = "xtradb" ]] && str="innobase"
|
|
||||||
+ [[ ! -d storage/${str} ]] && eerror "use ${str} but no ${str} plugin"
|
|
||||||
+ if [ -e storage/${str}/setup.sh ]; then
|
|
||||||
+ pushd storage/${str}
|
|
||||||
+ sh setup.sh
|
|
||||||
+ popd
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+ done
|
|
||||||
|
|
||||||
-pbxt_src_install() {
|
-pbxt_src_install() {
|
||||||
- pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null
|
- pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null
|
||||||
- make install || die "Failed to install PBXT"
|
- emake install DESTDIR="${D}" || die "Failed to install PBXT"
|
||||||
- popd
|
- popd
|
||||||
+ myconf="${myconf} --with-plugins=${plugins}"
|
-}
|
||||||
}
|
-
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -609,6 +585,22 @@
|
# EBUILD FUNCTIONS
|
||||||
|
#
|
||||||
|
@@ -727,15 +660,6 @@
|
||||||
|
eerror "${M}"
|
||||||
|
die "${M}"
|
||||||
|
fi
|
||||||
|
-
|
||||||
|
- if mysql_version_is_at_least "5.1" \
|
||||||
|
- && xtradb_patch_available \
|
||||||
|
- && use xtradb \
|
||||||
|
- && use embedded ; then
|
||||||
|
- M="USE flags 'xtradb' and 'embedded' conflict and cause build failures"
|
||||||
|
- eerror "${M}"
|
||||||
|
- die "${M}"
|
||||||
|
- fi
|
||||||
|
|
||||||
|
# Bug #290570, 284946, 307251
|
||||||
|
# Upstream changes made us need a fairly new GCC4.
|
||||||
|
@@ -778,6 +702,20 @@
|
||||||
mysql_init_vars
|
mysql_init_vars
|
||||||
|
|
||||||
unpack ${A}
|
unpack ${A}
|
||||||
+
|
+
|
||||||
+ for str in ${MYSQL_STORAGE} ; do
|
+ for str in ${MYSQL_STORAGE} ; do
|
||||||
+ storage_name="${str/-*/}"
|
+ storage_name="${str/-*/}"
|
||||||
+ if use ${storage_name} ; then
|
+ einfo "Moving ${str/-/ Storage Engine Version } in place"
|
||||||
+ einfo "Moving ${str/-/ Storage Engine Version } in place"
|
+ pushd "${WORKDIR}/${MY_SOURCEDIR}"/storage
|
||||||
+ pushd "${WORKDIR}/${MY_SOURCEDIR}"/storage
|
+ i="${WORKDIR}/mysql-storage-${str}"
|
||||||
+ i="${WORKDIR}/mysql-storage-${str}"
|
+ o="${storage_name}"
|
||||||
+ o="${storage_name}"
|
+ # Have we been here already ? or are we updating the included engine !
|
||||||
+ # Have we been here already ? or are we updating the included engine !
|
+ [ -h "${o}" ] && rm -f "${o}"
|
||||||
+ [ -h "${o}" ] && rm -f "${o}"
|
+ # Or maybe we haven't
|
||||||
+ # Or maybe we haven't
|
+ [ -d "${i}" -a ! -d "${o}" ] && cp -R "${i}"/* "${WORKDIR}/${MY_SOURCEDIR}"
|
||||||
+ [ -d "${i}" -a ! -d "${o}" ] && cp -R "${i}"/* "${WORKDIR}/${MY_SOURCEDIR}"
|
+ popd
|
||||||
+ popd
|
|
||||||
+ fi
|
|
||||||
+ done
|
+ done
|
||||||
+
|
+
|
||||||
# Grab the patches
|
# Grab the patches
|
||||||
[[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack
|
[[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack
|
||||||
|
|
||||||
@@ -659,16 +651,47 @@
|
@@ -800,7 +738,7 @@
|
||||||
|
EPATCH_SUFFIX="patch"
|
||||||
|
mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
|
||||||
|
# Clean out old items
|
||||||
|
- rm -f "${EPATCH_SOURCE}"/*
|
||||||
|
+ #rm -f "${EPATCH_SOURCE}"/*
|
||||||
|
# Now link in right patches
|
||||||
|
mysql_mv_patches
|
||||||
|
# And apply
|
||||||
|
@@ -832,26 +770,48 @@
|
||||||
|
|
||||||
local rebuilddirlist d
|
local rebuilddirlist d
|
||||||
|
|
||||||
- if mysql_version_is_at_least "5.1.26" && use xtradb ; then
|
- if xtradb_patch_available && use xtradb ; then
|
||||||
+
|
- einfo "Adding storage engine: Percona XtraDB (replacing InnoDB)"
|
||||||
+
|
- pushd "${S}"/storage >/dev/null
|
||||||
+ if mysql_version_is_at_least "5.1.26" && use xtradb && use innodb ; then
|
+ if mysql_version_is_at_least "5.1.26" && use xtradb && use innodb ; then
|
||||||
+ eerror "Percona XtraDB and Innobase innoDB can not be insalled at the same time."
|
+ eerror "Percona XtraDB and Innobase innoDB can not be insalled at the same time."
|
||||||
+ elif mysql_version_is_at_least "5.1.26" && use xtradb && ! use innodb ; then
|
+ elif mysql_version_is_at_least "5.1.26" && use xtradb && ! use innodb ; then
|
||||||
einfo "Replacing InnoDB with Percona XtraDB"
|
+ einfo "Replacing InnoDB with Percona XtraDB"
|
||||||
|
+ einfo "Removing InnoDB Plugin Storage Engine"
|
||||||
|
+ pushd "${S}"/storage
|
||||||
|
+ # the innodb_plugin is a reason for compile errors if we replace innobase
|
||||||
|
+ i="innodb_plugin"
|
||||||
|
+ o="${WORKDIR}/storage-${i}.mysql-upstream"
|
||||||
|
+ # Have we been here already?
|
||||||
|
+ [ -h "${i}" ] && rm -f "${i}"
|
||||||
|
+ # Or maybe we haven't
|
||||||
|
+ [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
||||||
|
i="innobase"
|
||||||
|
o="${WORKDIR}/storage-${i}.mysql-upstream"
|
||||||
|
# Have we been here already?
|
||||||
|
- [ -d "${o}" ] && rm -f "${i}"
|
||||||
|
+ [ -h "${i}" ] && rm -f "${i}"
|
||||||
|
# Or maybe we haven't
|
||||||
|
[ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
||||||
|
- cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
|
||||||
|
- popd >/dev/null
|
||||||
|
- fi
|
||||||
|
-
|
||||||
|
- if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
|
||||||
|
- einfo "Adding storage engine: PBXT"
|
||||||
|
- pushd "${S}"/storage >/dev/null
|
||||||
|
- i='pbxt'
|
||||||
|
- [ -d "${i}" ] && rm -rf "${i}"
|
||||||
|
- cp -ral "${WORKDIR}/${PBXT_P}" "${i}"
|
||||||
|
- popd >/dev/null
|
||||||
|
+ mv -f "xtradb" "${i}"
|
||||||
|
+ rm -rf "innodb"
|
||||||
|
+ popd
|
||||||
|
+ elif mysql_version_is_at_least "5.1.26" && use innodb && ! use xtradb ; then
|
||||||
|
+ einfo "Replacing InnoDB with Innobase innoDB"
|
||||||
+ einfo "Removing InnoDB Plugin Storage Engine"
|
+ einfo "Removing InnoDB Plugin Storage Engine"
|
||||||
+ pushd "${S}"/storage
|
+ pushd "${S}"/storage
|
||||||
+ # the innodb_plugin is a reason for compile errors if we replace innobase
|
+ # the innodb_plugin is a reason for compile errors if we replace innobase
|
||||||
@ -208,78 +302,51 @@
|
|||||||
+ [ -h "${i}" ] && rm -f "${i}"
|
+ [ -h "${i}" ] && rm -f "${i}"
|
||||||
+ # Or maybe we haven't
|
+ # Or maybe we haven't
|
||||||
+ [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
+ [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
||||||
+ mv -f "xtradb" "${i}"
|
|
||||||
+ popd
|
|
||||||
+ elif mysql_version_is_at_least "5.1.26" && use innodb && ! use xtradb ; then
|
|
||||||
+ einfo "Replacing InnoDB with Innobase innoDB"
|
|
||||||
+ einfo "Removing InnoDB Plugin Storage Engine"
|
|
||||||
pushd "${S}"/storage
|
|
||||||
+ # the innodb_plugin is a reason for compile errors if we replace innobase
|
|
||||||
+ i="innodb_plugin"
|
|
||||||
+ o="${WORKDIR}/storage-${i}.mysql-upstream"
|
|
||||||
+ # Have we been here already?
|
|
||||||
+ [ -h "${i}" ] && rm -f "${i}"
|
|
||||||
+ # Or maybe we haven't
|
|
||||||
+ [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
|
||||||
i="innobase"
|
|
||||||
o="${WORKDIR}/storage-${i}.mysql-upstream"
|
|
||||||
# Have we been here already?
|
|
||||||
[ -h "${i}" ] && rm -f "${i}"
|
|
||||||
# Or maybe we haven't
|
|
||||||
[ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
|
|
||||||
- ln -s "${WORKDIR}/${XTRADB_P}" "${i}"
|
|
||||||
+ mv -f "innodb" "${i}"
|
+ mv -f "innodb" "${i}"
|
||||||
popd
|
+ rm -rf "xtradb"
|
||||||
|
+ popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -771,10 +794,6 @@
|
if mysql_version_is_at_least "5.1.12" ; then
|
||||||
|
@@ -954,10 +914,6 @@
|
||||||
find . -type f -name Makefile -print0 \
|
find . -type f -name Makefile -print0 \
|
||||||
| xargs -0 -n100 sed -i \
|
| xargs -0 -n100 sed -i \
|
||||||
-e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
|
-e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
|
||||||
-
|
-
|
||||||
- if [[ $EAPI == 2 ]]; then
|
- if [[ $EAPI == 2 ]] && [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
|
||||||
- mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_configure
|
- pbxt_patch_available && use pbxt && pbxt_src_configure
|
||||||
- fi
|
- fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# @FUNCTION: mysql_src_compile
|
# @FUNCTION: mysql_src_compile
|
||||||
@@ -788,8 +807,6 @@
|
@@ -971,10 +927,6 @@
|
||||||
esac
|
esac
|
||||||
|
|
||||||
emake || die "emake failed"
|
emake || die "emake failed"
|
||||||
-
|
-
|
||||||
- mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_compile
|
- if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
|
||||||
|
- pbxt_patch_available && use pbxt && pbxt_src_compile
|
||||||
|
- fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# @FUNCTION: mysql_src_install
|
# @FUNCTION: mysql_src_install
|
||||||
@@ -801,8 +818,6 @@
|
@@ -990,10 +942,6 @@
|
||||||
|
testroot="${MY_SHAREDSTATEDIR}" \
|
||||||
|
|| die "emake install failed"
|
||||||
|
|
||||||
emake install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die "emake install failed"
|
- if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
|
||||||
|
- pbxt_patch_available && use pbxt && pbxt_src_install
|
||||||
- mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_install
|
- fi
|
||||||
-
|
-
|
||||||
# Convenience links
|
# Convenience links
|
||||||
einfo "Making Convenience links for mysqlcheck multi-call binary"
|
einfo "Making Convenience links for mysqlcheck multi-call binary"
|
||||||
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze"
|
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze"
|
||||||
@@ -941,21 +956,6 @@
|
@@ -1146,7 +1094,7 @@
|
||||||
einfo
|
einfo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- if mysql_version_is_at_least "5.1.12" && use pbxt ; then
|
- if pbxt_available && use pbxt ; then
|
||||||
- # TODO: explain it better
|
+ if use pbxt ; then
|
||||||
- elog " mysql> INSTALL PLUGIN pbxt SONAME 'libpbxt.so';"
|
# TODO: explain it better
|
||||||
- elog " mysql> CREATE TABLE t1 (c1 int, c2 text) ENGINE=pbxt;"
|
elog " mysql> INSTALL PLUGIN pbxt SONAME 'libpbxt.so';"
|
||||||
- elog "if, after that, you cannot start the MySQL server,"
|
elog " mysql> CREATE TABLE t1 (c1 int, c2 text) ENGINE=pbxt;"
|
||||||
- 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;"
|
|
||||||
- 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!"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user