Bumped required EAPI to 3 due to the prefix support.
Fix -userpriv detection - fixes bug 312809.
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.72 2012/01/05 23:20:02 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.73 2012/01/06 21:32:48 jmbsvicetto Exp $
+
+ 06 Jan 2012; Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
+ mysql.eclass, mysql-autotools.eclass, mysql-cmake.eclass, mysql-v2.eclass,
+ mysql_fx.eclass:
+ [mysql eclasses] Added prefix support for eclasses - fixes bug 348788 and bug
+ 388125.
+ Bumped required EAPI to 3 due to the prefix support.
+ Fix -userpriv detection - fixes bug 312809.
05 Jan 2012; Michał Górny <mgorny@gentoo.org> systemd.eclass:
Fix use of dosym with directory destination.
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.2 2011/08/22 04:46:32 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.3 2012/01/06 21:32:48 jmbsvicetto Exp $
# @ECLASS: mysql-autotools.eclass
# @MAINTAINER:
myconf="${myconf} --with-extra-charsets=all"
myconf="${myconf} --with-mysqld-user=mysql"
myconf="${myconf} --with-server"
- myconf="${myconf} --with-unix-socket-path=/var/run/mysqld/mysqld.sock"
+ myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
myconf="${myconf} --without-libwrap"
if use static ; then
# TODO: !!!! readd --without-readline
# the failure depend upon config/ac-macros/readline.m4 checking into
# readline.h instead of history.h
- myconf="${myconf} $(use_with ssl ssl /usr)"
+ myconf="${myconf} $(use_with ssl ssl "${EPREFIX}"/usr)"
myconf="${myconf} --enable-assembler"
myconf="${myconf} --with-geometry"
myconf="${myconf} --with-readline"
- myconf="${myconf} --with-zlib-dir=/usr/"
+ myconf="${myconf} --with-zlib-dir=${EPREFIX}/usr/"
myconf="${myconf} --without-pstack"
- myconf="${myconf} --with-plugindir=/usr/$(get_libdir)/mysql/plugin"
+ myconf="${myconf} --with-plugindir=${EPREFIX}/usr/$(get_libdir)/mysql/plugin"
# This is an explict die here, because if we just forcibly disable it, then the
# user's data is not accessible.
eautoreconf
local myconf=""
- myconf="${myconf} --with-mysql=${S} --libdir=/usr/$(get_libdir)"
+ myconf="${myconf} --with-mysql=${S} --libdir=${EPREFIX}/usr/$(get_libdir)"
use debug && myconf="${myconf} --with-debug=full"
econf ${myconf} || die "Problem configuring PBXT storage engine"
}
filter-flags -fomit-frame-pointer
econf \
- --libexecdir="/usr/sbin" \
+ --libexecdir="${EPREFIX}/usr/sbin" \
--sysconfdir="${MY_SYSCONFDIR}" \
--localstatedir="${MY_LOCALSTATEDIR}" \
--sharedstatedir="${MY_SHAREDSTATEDIR}" \
# Various junk (my-*.cnf moved elsewhere)
einfo "Removing duplicate /usr/share/mysql files"
- rm -Rf "${D}/usr/share/info"
+ rm -Rf "${ED}/usr/share/info"
for removeme in "mysql-log-rotate" mysql.server* \
binary-configure* my-*.cnf mi_test_all*
do
if use minimal ; then
einfo "Remove all extra content for minimal build"
rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
- rm -f "${D}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
- rm -f "${D}/usr/sbin/mysqld"
+ rm -f "${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
+ rm -f "${ED}/usr/sbin/mysqld"
rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
fi
5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;;
esac
einfo "Building default my.cnf (${mysql_mycnf_version})"
- insinto "${MY_SYSCONFDIR}"
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}"
doins scripts/mysqlaccess.conf
mycnf_src="my.cnf-${mysql_mycnf_version}"
sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+ -e "s!/tmp!${EPREFIX}/tmp!" \
+ -e "s!/usr!${EPREFIX}/usr!" \
+ -e "s!= /var!= ${EPREFIX}/var!" \
"${FILESDIR}/${mycnf_src}" \
> "${TMPDIR}/my.cnf.ok"
if use latin1 ; then
# Empty directories ...
diropts "-m0750"
if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
- dodir "${MY_DATADIR}"
- keepdir "${MY_DATADIR}"
+ dodir "${MY_DATADIR#${EPREFIX}}"
+ keepdir "${MY_DATADIR#${EPREFIX}}"
chown -R mysql:mysql "${D}/${MY_DATADIR}"
fi
diropts "-m0755"
- for folder in "${MY_LOGDIR}" "/var/run/mysqld" ; do
+ for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
dodir "${folder}"
keepdir "${folder}"
- chown -R mysql:mysql "${D}/${folder}"
+ chown -R mysql:mysql "${ED}/${folder}"
done
fi
fi
- mysql_lib_symlinks "${D}"
+ mysql_lib_symlinks "${ED}"
}
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.4 2011/12/27 07:37:20 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.5 2012/01/06 21:32:48 jmbsvicetto Exp $
# @ECLASS: mysql-cmake.eclass
# @MAINTAINER:
-DENABLED_LOCAL_INFILE=1
-DEXTRA_CHARSETS=all
-DMYSQL_USER=mysql
- -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock
+ -DMYSQL_UNIX_ADDR=${EPREFIX}/var/run/mysqld/mysqld.sock
-DWITHOUT_READLINE=1
-DWITH_ZLIB=system
-DWITHOUT_LIBWRAP=1
CMAKE_BUILD_TYPE="RelWithDebInfo"
mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX=/usr
- -DMYSQL_DATADIR=/var/lib/mysql
- -DSYSCONFDIR=/etc/mysql
+ -DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr
+ -DMYSQL_DATADIR=${EPREFIX}/var/lib/mysql
+ -DSYSCONFDIR=${EPREFIX}/etc/mysql
-DINSTALL_BINDIR=bin
-DINSTALL_DOCDIR=share/doc/${P}
-DINSTALL_DOCREADMEDIR=share/doc/${P}
-DINSTALL_INFODIR=share/info
-DINSTALL_LIBDIR=$(get_libdir)/mysql
-DINSTALL_MANDIR=share/man
- -DINSTALL_MYSQLDATADIR=/var/lib/mysql
+ -DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql
-DINSTALL_MYSQLSHAREDIR=share/mysql
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test
-DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
-DINSTALL_SBINDIR=sbin
-DINSTALL_SCRIPTDIR=share/mysql/scripts
-DINSTALL_SQLBENCHDIR=share/mysql
- -DINSTALL_SUPPORTFILESDIR=/usr/share/mysql
+ -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql
-DWITH_COMMENT="Gentoo Linux ${PF}"
-DWITHOUT_UNIT_TESTS=1
)
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
# INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
- rm -Rf "${D}/usr/data"
+ rm -Rf "${ED}/usr/data"
# Various junk (my-*.cnf moved elsewhere)
einfo "Removing duplicate /usr/share/mysql files"
# if use minimal ; then
# einfo "Remove all extra content for minimal build"
# rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
-# rm -f "${D}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
-# rm -f "${D}/usr/sbin/mysqld"
+# rm -f "${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
+# rm -f "${ED}/usr/sbin/mysqld"
# rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
# fi
# Empty directories ...
diropts "-m0750"
if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
- dodir "${MY_DATADIR}"
- keepdir "${MY_DATADIR}"
+ dodir "${MY_DATADIR#${EPREFIX}}"
+ keepdir "${MY_DATADIR#${EPREFIX}}"
chown -R mysql:mysql "${D}/${MY_DATADIR}"
fi
diropts "-m0755"
- for folder in "${MY_LOGDIR}" "/var/run/mysqld" ; do
+ for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
dodir "${folder}"
keepdir "${folder}"
- chown -R mysql:mysql "${D}/${folder}"
+ chown -R mysql:mysql "${ED}/${folder}"
done
fi
fi
- mysql_lib_symlinks "${D}"
+ mysql_lib_symlinks "${ED}"
}
-# Copyright 1999-2011 Gentoo Foundation
+# 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.11 2011/12/27 07:37:20 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.12 2012/01/06 21:32:48 jmbsvicetto Exp $
# @ECLASS: mysql-v2.eclass
# @MAINTAINER:
#
case "${EAPI:-0}" in
- 2|3|4) ;;
+ 3|4) ;;
*) die "Unsupported EAPI: ${EAPI}" ;;
esac
mysql_version_is_at_least "5.5.7" \
&& IUSE="${IUSE} systemtap"
-
#
# DEPENDENCIES:
#
if has test ${FEATURES} ; then
if ! use minimal ; then
- if [[ $UID -eq 0 ]]; then
+ if ! has userpriv ${FEATURES} ; then
eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
fi
fi
mysql_init_vars
# Check FEATURES="collision-protect" before removing this
- [[ -d "${ROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
# Secure the logfiles
touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
local pwd2="b"
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")"
+ if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${EROOT}/root/.my.cnf" ]; then
+ MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${EROOT}/root/.my.cnf")"
fi
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
help_tables="${TMPDIR}/fill_help_tables.sql"
pushd "${TMPDIR}" &>/dev/null
- "${ROOT}/usr/bin/mysql_install_db" --basedir=/usr >"${TMPDIR}"/mysql_install_db.log 2>&1
+ "${EROOT}/usr/bin/mysql_install_db" "--basedir=${EPREFIX}/usr" >"${TMPDIR}"/mysql_install_db.log 2>&1
if [ $? -ne 0 ]; then
grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
- die "Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
+ die "Failed to run mysql_install_db. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
fi
popd &>/dev/null
[[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
# Figure out which options we need to disable to do the setup
helpfile="${TMPDIR}/mysqld-help"
- ${ROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
+ ${EROOT}/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 \
ndbcluster \
# Filling timezones, see
# 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
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
if [[ -r "${help_tables}" ]] ; then
cat "${help_tables}" >> "${sqltmp}"
einfo "Creating the mysql database and setting proper"
einfo "permissions on it ..."
- local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
- local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
- local mysqld="${ROOT}/usr/sbin/mysqld \
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
+ local mysqld="${EROOT}/usr/sbin/mysqld \
${options} \
--user=mysql \
- --basedir=${ROOT}/usr \
+ --basedir=${EROOT}/usr \
--datadir=${ROOT}/${MY_DATADIR} \
--max_allowed_packet=8M \
--net_buffer_length=16K \
ebegin "Setting root password"
# Do this from memory, as we don't want clear text passwords in temp files
local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'"
- "${ROOT}/usr/bin/mysql" \
+ "${EROOT}/usr/bin/mysql" \
--socket=${socket} \
-hlocalhost \
-e "${sql}"
eend $?
ebegin "Loading \"zoneinfo\", this step may require a few seconds ..."
- "${ROOT}/usr/bin/mysql" \
+ "${EROOT}/usr/bin/mysql" \
--socket=${socket} \
-hlocalhost \
-uroot \
# Remove mysql symlinks.
mysql-v2_pkg_postrm() {
- : # mysql_lib_symlinks "${D}"
+ : # mysql_lib_symlinks "${ED}"
}
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.166 2011/09/25 12:43:28 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.167 2012/01/06 21:32:48 jmbsvicetto Exp $
# @ECLASS: mysql.eclass
# @MAINTAINER:
# Be warned, *DEPEND are version-dependant
# These are used for both runtime and compiletime
DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
- userland_GNU? ( sys-process/procps )
+ kernel_linux? ( sys-process/procps )
>=sys-apps/sed-4
>=sys-apps/texinfo-4.7-r1
>=sys-libs/readline-4.1
# Initialize global variables
# 2005-11-19 <vivo@gentoo.org>
mysql_init_vars() {
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="/usr/share/mysql"}
- MY_SYSCONFDIR=${MY_SYSCONFDIR="/etc/mysql"}
- MY_LIBDIR=${MY_LIBDIR="/usr/$(get_libdir)/mysql"}
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="/var/lib/mysql"}
- MY_LOGDIR=${MY_LOGDIR="/var/log/mysql"}
- MY_INCLUDEDIR=${MY_INCLUDEDIR="/usr/include/mysql"}
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"}
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+ MY_LIBDIR=${MY_LIBDIR="${EPREFIX}/usr/$(get_libdir)/mysql"}
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+ MY_INCLUDEDIR=${MY_INCLUDEDIR="${EPREFIX}/usr/include/mysql"}
if [[ -z "${MY_DATADIR}" ]] ; then
MY_DATADIR=""
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
+ if [[ -f ${MY_SYSCONFDIR}/my.cnf ]] ; then
MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
| sed -ne '/datadir/s|^--datadir=||p' \
| tail -n1`
if [[ -z "${MY_DATADIR}" ]] ; then
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
+ MY_DATADIR=`grep ^datadir ${MY_SYSCONFDIR}/my.cnf \
| sed -e 's/.*=\s*//' \
| tail -n1`
fi
myconf="${myconf} --with-extra-charsets=all"
myconf="${myconf} --with-mysqld-user=mysql"
myconf="${myconf} --with-server"
- myconf="${myconf} --with-unix-socket-path=/var/run/mysqld/mysqld.sock"
+ myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
myconf="${myconf} --without-libwrap"
if use static ; then
}
configure_40_41_50() {
+ myconf="${myconf} --with-zlib-dir=${EPREFIX}/usr"
myconf="${myconf} $(use_with perl bench)"
myconf="${myconf} --enable-assembler"
myconf="${myconf} --with-extra-tools"
myconf="${myconf} --with-innodb"
myconf="${myconf} --without-readline"
- myconf="${myconf} $(use_with ssl openssl)"
+ myconf="${myconf} $(use_with ssl openssl "${EPREFIX}/usr")"
mysql_version_is_at_least "5.0" || myconf="${myconf} $(use_with raid)"
# --with-vio is not needed anymore, it's on by default and
# TODO: !!!! readd --without-readline
# the failure depend upon config/ac-macros/readline.m4 checking into
# readline.h instead of history.h
- myconf="${myconf} $(use_with ssl ssl /usr)"
+ myconf="${myconf} $(use_with ssl ssl "${EPREFIX}"/usr)"
myconf="${myconf} --enable-assembler"
myconf="${myconf} --with-geometry"
myconf="${myconf} --with-readline"
- myconf="${myconf} --with-zlib-dir=/usr/"
+ myconf="${myconf} --with-zlib-dir=${EPREFIX}/usr/"
myconf="${myconf} --without-pstack"
- myconf="${myconf} --with-plugindir=/usr/$(get_libdir)/mysql/plugin"
+ myconf="${myconf} --with-plugindir=${EPREFIX}/usr/$(get_libdir)/mysql/plugin"
# This is an explict die here, because if we just forcibly disable it, then the
# user's data is not accessible.
eautoreconf
local myconf=""
- myconf="${myconf} --with-mysql=${S} --libdir=/usr/$(get_libdir)"
+ myconf="${myconf} --with-mysql=${S} --libdir=${EPREFIX}/usr/$(get_libdir)"
use debug && myconf="${myconf} --with-debug=full"
econf ${myconf} || die "Problem configuring PBXT storage engine"
}
# 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)
- case ${GCC_VER} in
- 2*|3*|4.0|4.1|4.2)
+ case ${CHOST}:${GCC_VER} in
+ *-darwin*:4.*) : ;; # bug #310615
+ *: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."
&& use berkdb ; then
einfo "Fixing up berkdb buildsystem"
[[ -w "bdb/dist/ltmain.sh" ]] && cp -f "ltmain.sh" "bdb/dist/ltmain.sh"
- cp -f "/usr/share/aclocal/libtool.m4" "bdb/dist/aclocal/libtool.ac" \
+ cp -f "${EPREFIX}/usr/share/aclocal/libtool.m4" "bdb/dist/aclocal/libtool.ac" \
|| die "Could not copy libtool.m4 to bdb/dist/"
#These files exist only with libtool-2*, and need to be included.
- if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then
- cat "/usr/share/aclocal/ltsugar.m4" >> "bdb/dist/aclocal/libtool.ac"
- cat "/usr/share/aclocal/ltversion.m4" >> "bdb/dist/aclocal/libtool.ac"
- cat "/usr/share/aclocal/lt~obsolete.m4" >> "bdb/dist/aclocal/libtool.ac"
- cat "/usr/share/aclocal/ltoptions.m4" >> "bdb/dist/aclocal/libtool.ac"
+ if [ -f ${EPREFIX}'/usr/share/aclocal/ltsugar.m4' ]; then
+ cat "${EPREFIX}/usr/share/aclocal/ltsugar.m4" >> "bdb/dist/aclocal/libtool.ac"
+ cat "${EPREFIX}/usr/share/aclocal/ltversion.m4" >> "bdb/dist/aclocal/libtool.ac"
+ cat "${EPREFIX}/usr/share/aclocal/lt~obsolete.m4" >> "bdb/dist/aclocal/libtool.ac"
+ cat "${EPREFIX}/usr/share/aclocal/ltoptions.m4" >> "bdb/dist/aclocal/libtool.ac"
fi
pushd "bdb/dist" &>/dev/null
sh s_all \
filter-flags -fomit-frame-pointer
econf \
- --libexecdir="/usr/sbin" \
- --sysconfdir="${MY_SYSCONFDIR}" \
- --localstatedir="${MY_LOCALSTATEDIR}" \
- --sharedstatedir="${MY_SHAREDSTATEDIR}" \
- --libdir="${MY_LIBDIR}" \
- --includedir="${MY_INCLUDEDIR}" \
+ --libexecdir="${EPREFIX}"/usr/sbin \
+ --sysconfdir=${MY_SYSCONFDIR} \
+ --localstatedir=${MY_LOCALSTATEDIR} \
+ --sharedstatedir=${MY_SHAREDSTATEDIR} \
+ --libdir=${MY_LIBDIR} \
+ --includedir=${MY_INCLUDEDIR} \
--with-low-memory \
--with-client-ldflags=-lstdc++ \
--enable-thread-safe-client \
emake install \
DESTDIR="${D}" \
- benchdir_root="${MY_SHAREDSTATEDIR}" \
+ benchdir_root=${MY_SHAREDSTATEDIR} \
testroot="${MY_SHAREDSTATEDIR}" \
|| die "emake install failed"
# Various junk (my-*.cnf moved elsewhere)
einfo "Removing duplicate /usr/share/mysql files"
- rm -Rf "${D}/usr/share/info"
+ rm -Rf "${ED}/usr/share/info"
for removeme in "mysql-log-rotate" mysql.server* \
binary-configure* my-*.cnf mi_test_all*
do
if use minimal ; then
einfo "Remove all extra content for minimal build"
rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
- rm -f "${D}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
- rm -f "${D}/usr/sbin/mysqld"
+ rm -f "${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
+ rm -f "${ED}/usr/sbin/mysqld"
rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
fi
5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;;
esac
einfo "Building default my.cnf (${mysql_mycnf_version})"
- insinto "${MY_SYSCONFDIR}"
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}"
doins scripts/mysqlaccess.conf
mycnf_src="my.cnf-${mysql_mycnf_version}"
sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+ -e "s!/tmp!${EPREFIX}/tmp!" \
+ -e "s!/usr!${EPREFIX}/usr!" \
+ -e "s!= /var!= ${EPREFIX}/var!" \
"${FILESDIR}/${mycnf_src}" \
> "${TMPDIR}/my.cnf.ok"
+ use prefix && sed -i -e '/^user[ ]*= mysql$/d' "${TMPDIR}/my.cnf.ok"
if use latin1 ; then
sed -i \
-e "/character-set/s|utf8|latin1|g" \
# Empty directories ...
diropts "-m0750"
if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
- dodir "${MY_DATADIR}"
- keepdir "${MY_DATADIR}"
+ dodir "${MY_DATADIR#${EPREFIX}}"
+ keepdir "${MY_DATADIR#${EPREFIX}}"
chown -R mysql:mysql "${D}/${MY_DATADIR}"
fi
diropts "-m0755"
- for folder in "${MY_LOGDIR}" "/var/run/mysqld" ; do
+ for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
dodir "${folder}"
keepdir "${folder}"
- chown -R mysql:mysql "${D}/${folder}"
+ chown -R mysql:mysql "${ED}/${folder}"
done
fi
fi
- mysql_lib_symlinks "${D}"
+ mysql_lib_symlinks "${ED}"
}
# @FUNCTION: mysql_pkg_preinst
mysql_init_vars
# Check FEATURES="collision-protect" before removing this
- [[ -d "${ROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
+ [[ -d "${EROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
# Secure the logfiles
touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
local pwd2="b"
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")"
+ if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${EROOT}/root/.my.cnf" ]; then
+ MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${EROOT}/root/.my.cnf")"
fi
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
help_tables="${TMPDIR}/fill_help_tables.sql"
pushd "${TMPDIR}" &>/dev/null
- "${ROOT}/usr/bin/mysql_install_db" >"${TMPDIR}"/mysql_install_db.log 2>&1
+ "${EROOT}/usr/bin/mysql_install_db" >"${TMPDIR}"/mysql_install_db.log 2>&1
if [ $? -ne 0 ]; then
grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
die "Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
# Figure out which options we need to disable to do the setup
helpfile="${TMPDIR}/mysqld-help"
- ${ROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
+ ${EROOT}/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 \
ndbcluster \
if mysql_version_is_at_least "4.1.3" ; then
# Filling timezones, see
# 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
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
if [[ -r "${help_tables}" ]] ; then
cat "${help_tables}" >> "${sqltmp}"
einfo "Creating the mysql database and setting proper"
einfo "permissions on it ..."
- local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
- local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
- local mysqld="${ROOT}/usr/sbin/mysqld \
+ use prefix || options="${options} --user=mysql"
+
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
+ local mysqld="${EROOT}/usr/sbin/mysqld \
${options} \
--user=mysql \
- --basedir=${ROOT}/usr \
+ --basedir=${EROOT}/usr \
--datadir=${ROOT}/${MY_DATADIR} \
--max_allowed_packet=8M \
--net_buffer_length=16K \
ebegin "Setting root password"
# Do this from memory, as we don't want clear text passwords in temp files
local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'"
- "${ROOT}/usr/bin/mysql" \
+ "${EROOT}/usr/bin/mysql" \
--socket=${socket} \
-hlocalhost \
-e "${sql}"
eend $?
ebegin "Loading \"zoneinfo\", this step may require a few seconds ..."
- "${ROOT}/usr/bin/mysql" \
+ "${EROOT}/usr/bin/mysql" \
--socket=${socket} \
-hlocalhost \
-uroot \
# @DESCRIPTION:
# Remove mysql symlinks.
mysql_pkg_postrm() {
- : # mysql_lib_symlinks "${D}"
+ : # mysql_lib_symlinks "${ED}"
}
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.27 2011/12/27 17:55:12 fauli Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.28 2012/01/06 21:32:48 jmbsvicetto Exp $
# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
# Maintainer:
libnameln=${libname##*/}
# loop in version of the library to link it, similar to how
# libtool works
- while [[ ${libnameln:0-3} != '${libsuffix}' ]] && [[ ${maxdots} -lt 6 ]] ; do
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # macho: libname.x.y.z.dylib
+ local libbasename=${libnameln%%.*} # libname
+ local libver=${libnameln#${libbasename}} # .x.y.z.dylib
+ libver=${libver%${libsuffix}} # .x.y.z
+ while [[ -n ${libver} ]] && [[ ${maxdots} -lt 6 ]] ; do
+ libnameln="${libbasename}${libver}${libsuffix}"
+ rm -f "${libnameln}"
+ ln -s "${libname}" "${libnameln}"
+ (( ++maxdots ))
+ libver=${libver%.*}
+ done
+ libnameln="${libbasename}${libsuffix}"
rm -f "${libnameln}"
ln -s "${libname}" "${libnameln}"
- (( ++maxdots ))
- libnameln="${libnameln%.*}"
- done
- rm -f "${libnameln}"
- ln -s "${libname}" "${libnameln}"
+ else
+ # elf: libname.so.x.y.z
+ while [[ ${libnameln:0-3} != '${libsuffix}' ]] && [[ ${maxdots} -lt 6 ]] ; do
+ rm -f "${libnameln}"
+ ln -s "${libname}" "${libnameln}"
+ (( ++maxdots ))
+ libnameln="${libnameln%.*}"
+ done
+ rm -f "${libnameln}"
+ ln -s "${libname}" "${libnameln}"
+ fi
done
done
# Initialize global variables
# 2005-11-19 <vivo@gentoo.org>
mysql_init_vars() {
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="/usr/share/mysql"}
- MY_SYSCONFDIR=${MY_SYSCONFDIR="/etc/mysql"}
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="/var/lib/mysql"}
- MY_LOGDIR=${MY_LOGDIR="/var/log/mysql"}
- MY_INCLUDEDIR=${MY_INCLUDEDIR="/usr/include/mysql"}
- MY_LIBDIR=${MY_LIBDIR="/usr/$(get_libdir)/mysql"}
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"}
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+ MY_INCLUDEDIR=${MY_INCLUDEDIR="${EPREFIX}/usr/include/mysql"}
+ MY_LIBDIR=${MY_LIBDIR="${EPREFIX}/usr/$(get_libdir)/mysql"}
if [[ -z "${MY_DATADIR}" ]] ; then
MY_DATADIR=""
ewarn "MySQL MY_DATADIR has changed"
ewarn "from ${MY_DATADIR}"
ewarn "to ${new_MY_DATADIR}"
- MY_DATADIR="${new_MY_DATADIR}"
fi
fi
fi