summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/mysql-autotools.eclass7
-rw-r--r--eclass/mysql-cmake.eclass3
-rw-r--r--eclass/mysql-v2.eclass32
-rw-r--r--eclass/mysql.eclass20
5 files changed, 37 insertions, 31 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 51024c6b81c7..ed995eb7a40a 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1322 2014/07/17 13:02:11 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1323 2014/07/19 10:18:41 grobian Exp $
+
+ 19 Jul 2014; Fabian Groffen <grobian@gentoo.org> mysql.eclass,
+ mysql-autotools.eclass, mysql-cmake.eclass, mysql-v2.eclass:
+ Fix misc issues for Prefix allowing install and config of mysql
17 Jul 2014; Michael Palimaka <kensington@gentoo.org> kde4-functions.eclass:
Fix missing handbooks when the default handbook language is en_US instead of
diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclass
index 644c1e7489d2..692790072d16 100644
--- a/eclass/mysql-autotools.eclass
+++ b/eclass/mysql-autotools.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.18 2013/06/26 19:31:49 jmbsvicetto Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.19 2014/07/19 10:18:41 grobian Exp $
# @ECLASS: mysql-autotools.eclass
# @MAINTAINER:
@@ -112,7 +112,7 @@ mysql-autotools_configure_common() {
myconf="${myconf} $(use_with big-tables)"
myconf="${myconf} --enable-local-infile"
myconf="${myconf} --with-extra-charsets=all"
- myconf="${myconf} --with-mysqld-user=mysql"
+ use prefix || myconf="${myconf} --with-mysqld-user=mysql"
myconf="${myconf} --with-server"
myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
myconf="${myconf} --without-libwrap"
@@ -606,6 +606,7 @@ mysql-autotools_src_install() {
-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" \
diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass
index 1f398ea5e3e3..25012d13a1bd 100644
--- a/eclass/mysql-cmake.eclass
+++ b/eclass/mysql-cmake.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.21 2014/06/20 00:03:33 grknight Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.22 2014/07/19 10:18:41 grobian Exp $
# @ECLASS: mysql-cmake.eclass
# @MAINTAINER:
@@ -411,6 +411,7 @@ mysql-cmake_src_install() {
sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
"${FILESDIR}/${mycnf_src}" \
> "${TMPDIR}/my.cnf.ok" || die
+ 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" \
diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass
index d98fb8c3121a..049a03503f45 100644
--- a/eclass/mysql-v2.eclass
+++ b/eclass/mysql-v2.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.31 2014/06/20 00:03:33 grknight Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.32 2014/07/19 10:18:41 grobian Exp $
# @ECLASS: mysql-v2.eclass
# @MAINTAINER:
@@ -669,7 +669,7 @@ mysql-v2_pkg_config() {
local old_MY_DATADIR="${MY_DATADIR}"
local old_HOME="${HOME}"
# my_print_defaults needs to read stuff in $HOME/.my.cnf
- export HOME=/root
+ export HOME=${EPREFIX}/root
# Make sure the vars are correctly initialized
mysql_init_vars
@@ -720,13 +720,13 @@ mysql-v2_pkg_config() {
MYSQL_LOG_BIN="$(mysql-v2_getoptval mysqld log-bin)"
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
- if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then
+ if [[ ! -d "${ROOT}"/$MYSQL_TMPDIR ]]; then
einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_TMPDIR
fi
- if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then
+ if [[ ! -d "${ROOT}"/$MYSQL_LOG_BIN ]]; then
einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_LOG_BIN
fi
if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then
einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
@@ -747,7 +747,7 @@ mysql-v2_pkg_config() {
if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
einfo "Please provide a password for the mysql 'root' user now, in the"
- einfo "MYSQL_ROOT_PASSWORD env var or through the /root/.my.cnf file."
+ einfo "MYSQL_ROOT_PASSWORD env var or through the ${HOME}/.my.cnf file."
ewarn "Avoid [\"'\\_%] characters in the password"
read -rsp " >" pwd1 ; echo
@@ -761,9 +761,13 @@ mysql-v2_pkg_config() {
unset pwd1 pwd2
fi
- local options="--log-warnings=0"
+ local options
local sqltmp="$(emktemp)"
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first,
+ # see http://bugs.mysql.com/bug.php?id=31312
+ use prefix && options="${options} --defaults-file=${MY_SYSCONFDIR}/my.cnf"
+
local help_tables="${ROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql"
[[ -r "${help_tables}" ]] \
&& cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \
@@ -786,10 +790,6 @@ mysql-v2_pkg_config() {
use prefix || options="${options} --user=mysql"
- # Fix bug 446200. Don't reference host my.cnf
- use prefix && [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] \
- && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
-
# MySQL 5.6+ needs InnoDB
if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] ; then
mysql_version_is_at_least "5.6" || options="${options} --loose-skip-innodb"
@@ -810,7 +810,7 @@ mysql-v2_pkg_config() {
#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
- cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${EROOT}/${MY_DATADIR}' '--tmpdir=${EROOT}/${MYSQL_TMPDIR}'"
+ cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${ROOT}/${MY_DATADIR}' '--tmpdir=${ROOT}/${MYSQL_TMPDIR}'"
einfo "Command: $cmd"
eval $cmd \
>"${TMPDIR}"/mysql_install_db.log 2>&1
@@ -836,16 +836,16 @@ mysql-v2_pkg_config() {
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
local mysqld="${EROOT}/usr/sbin/mysqld \
${options} \
- --user=mysql \
+ $(use prefix || echo --user=mysql) \
--log-warnings=0 \
--basedir=${EROOT}/usr \
- --datadir=${EROOT}/${MY_DATADIR} \
+ --datadir=${ROOT}/${MY_DATADIR} \
--max_allowed_packet=8M \
--net_buffer_length=16K \
--default-storage-engine=MyISAM \
--socket=${socket} \
--pid-file=${pidfile}
- --tmpdir=${EROOT}/${MYSQL_TMPDIR}"
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
#einfo "About to start mysqld: ${mysqld}"
ebegin "Starting mysqld"
einfo "Command ${mysqld}"
diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass
index 56468edf375a..6d5cc288335b 100644
--- a/eclass/mysql.eclass
+++ b/eclass/mysql.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.178 2014/01/08 06:20:29 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.179 2014/07/19 10:18:41 grobian Exp $
# @ECLASS: mysql.eclass
# @MAINTAINER:
@@ -458,7 +458,7 @@ configure_common() {
myconf="${myconf} $(use_with big-tables)"
myconf="${myconf} --enable-local-infile"
myconf="${myconf} --with-extra-charsets=all"
- myconf="${myconf} --with-mysqld-user=mysql"
+ use prefix || myconf="${myconf} --with-mysqld-user=mysql"
myconf="${myconf} --with-server"
myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
myconf="${myconf} --without-libwrap"
@@ -1366,17 +1366,17 @@ mysql_pkg_config() {
MYSQL_LOG_BIN="$(mysql_getoptval mysqld log-bin)"
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
- if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then
+ if [[ ! -d "${ROOT}"/$MYSQL_TMPDIR ]]; then
einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_TMPDIR
fi
- if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then
+ if [[ ! -d "${ROOT}"/$MYSQL_LOG_BIN ]]; then
einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_LOG_BIN
fi
- if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then
+ if [[ ! -d "${ROOT}"/$MYSQL_RELAY_LOG ]]; then
einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_RELAY_LOG
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_RELAY_LOG
fi
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
@@ -1467,7 +1467,7 @@ mysql_pkg_config() {
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
local mysqld="${EROOT}/usr/sbin/mysqld \
${options} \
- --user=mysql \
+ $(use prefix || echo --user=mysql) \
--log-warnings=0 \
--basedir=${EROOT}/usr \
--datadir=${ROOT}/${MY_DATADIR} \