From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RJ9Qi-0005vy-NJ for garchives@archives.gentoo.org; Wed, 26 Oct 2011 19:46:29 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5316D21C21E; Wed, 26 Oct 2011 19:46:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0144B21C21E for ; Wed, 26 Oct 2011 19:45:59 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6055B1B401C for ; Wed, 26 Oct 2011 19:45:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 855B280042 for ; Wed, 26 Oct 2011 19:45:58 +0000 (UTC) From: "Jorge Manuel B. S. Vicetto" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jorge Manuel B. S. Vicetto" Message-ID: <4f7e634dfd1adf02f80dd19e386cc4e5db462927.jmbsvicetto@gentoo> Subject: [gentoo-commits] proj/mysql:master commit in: eclass/ X-VCS-Repository: proj/mysql X-VCS-Files: eclass/mysql-autotools.eclass eclass/mysql-cmake.eclass eclass/mysql-v2.eclass eclass/mysql_fx.eclass X-VCS-Directories: eclass/ X-VCS-Committer: jmbsvicetto X-VCS-Committer-Name: Jorge Manuel B. S. Vicetto X-VCS-Revision: 4f7e634dfd1adf02f80dd19e386cc4e5db462927 Date: Wed, 26 Oct 2011 19:45:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 95837569d6bb395085d42b2f018e3115 commit: 4f7e634dfd1adf02f80dd19e386cc4e5db462927 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) ge= ntoo org> AuthorDate: Tue Oct 25 00:30:47 2011 +0000 Commit: Jorge Manuel B. S. Vicetto gentoo org= > CommitDate: Tue Oct 25 00:30:47 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/mysql.git;a=3D= commit;h=3D4f7e634d Update mysql-v2 and related eclasses to support Prefix installs - bug 388= 125. --- eclass/mysql-autotools.eclass | 33 +++++++++++++++------------ eclass/mysql-cmake.eclass | 12 +++++----- eclass/mysql-v2.eclass | 48 ++++++++++++++++++++---------------= ----- eclass/mysql_fx.eclass | 16 ++++++++----- 4 files changed, 58 insertions(+), 51 deletions(-) diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclas= s index cf710f9..bf0b0b5 100644 --- a/eclass/mysql-autotools.eclass +++ b/eclass/mysql-autotools.eclass @@ -108,7 +108,7 @@ mysql-autotools_configure_common() { myconf=3D"${myconf} --with-extra-charsets=3Dall" myconf=3D"${myconf} --with-mysqld-user=3Dmysql" myconf=3D"${myconf} --with-server" - myconf=3D"${myconf} --with-unix-socket-path=3D/var/run/mysqld/mysqld.so= ck" + myconf=3D"${myconf} --with-unix-socket-path=3D${EPREFIX}/var/run/mysqld= /mysqld.sock" myconf=3D"${myconf} --without-libwrap" =20 if use static ; then @@ -160,13 +160,13 @@ mysql-autotools_configure_51() { # TODO: !!!! readd --without-readline # the failure depend upon config/ac-macros/readline.m4 checking into # readline.h instead of history.h - myconf=3D"${myconf} $(use_with ssl ssl /usr)" + myconf=3D"${myconf} $(use_with ssl ssl "${EPREFIX}"/usr)" myconf=3D"${myconf} --enable-assembler" myconf=3D"${myconf} --with-geometry" myconf=3D"${myconf} --with-readline" - myconf=3D"${myconf} --with-zlib-dir=3D/usr/" + myconf=3D"${myconf} --with-zlib-dir=3D${EPREFIX}/usr/" myconf=3D"${myconf} --without-pstack" - myconf=3D"${myconf} --with-plugindir=3D/usr/$(get_libdir)/mysql/plugin" + myconf=3D"${myconf} --with-plugindir=3D${EPREFIX}/usr/$(get_libdir)/mys= ql/plugin" =20 # This is an explict die here, because if we just forcibly disable it, = then the # user's data is not accessible. @@ -320,7 +320,7 @@ pbxt_src_configure() { eautoreconf =20 local myconf=3D"" - myconf=3D"${myconf} --with-mysql=3D${S} --libdir=3D/usr/$(get_libdir)" + myconf=3D"${myconf} --with-mysql=3D${S} --libdir=3D${EPREFIX}/usr/$(get= _libdir)" use debug && myconf=3D"${myconf} --with-debug=3Dfull" econf ${myconf} || die "Problem configuring PBXT storage engine" } @@ -376,7 +376,7 @@ mysql-autotools_src_prepare() { =20 # Make charsets install in the right place find . -name 'Makefile.am' \ - -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} = \; + -exec sed --in-place -e 's!$(pkgdatadir)!'"${EPREFIX}"${MY_SHAREDSTATE= DIR}'!g' {} \; =20 # Remove what needs to be recreated, so we're sure it's actually done einfo "Cleaning up old buildscript files" @@ -477,12 +477,12 @@ mysql-autotools_src_configure() { filter-flags -fomit-frame-pointer =20 econf \ - --libexecdir=3D"/usr/sbin" \ - --sysconfdir=3D"${MY_SYSCONFDIR}" \ - --localstatedir=3D"${MY_LOCALSTATEDIR}" \ - --sharedstatedir=3D"${MY_SHAREDSTATEDIR}" \ - --libdir=3D"${MY_LIBDIR}" \ - --includedir=3D"${MY_INCLUDEDIR}" \ + --libexecdir=3D"${EPREFIX}/usr/sbin" \ + --sysconfdir=3D"${EPREFIX}${MY_SYSCONFDIR}" \ + --localstatedir=3D"${EPREFIX}${MY_LOCALSTATEDIR}" \ + --sharedstatedir=3D"${EPREFIX}${MY_SHAREDSTATEDIR}" \ + --libdir=3D"${EPREFIX}${MY_LIBDIR}" \ + --includedir=3D"${EPREFIX}${MY_INCLUDEDIR}" \ --with-low-memory \ --with-client-ldflags=3D-lstdc++ \ --enable-thread-safe-client \ @@ -523,8 +523,8 @@ mysql-autotools_src_install() { =20 emake install \ DESTDIR=3D"${D}" \ - benchdir_root=3D"${MY_SHAREDSTATEDIR}" \ - testroot=3D"${MY_SHAREDSTATEDIR}" \ + benchdir_root=3D"${EPREFIX}${MY_SHAREDSTATEDIR}" \ + testroot=3D"${EPREFIX}${MY_SHAREDSTATEDIR}" \ || die "emake install failed" =20 if [[ "${PBXT_NEWSTYLE}" !=3D "1" ]]; then @@ -570,7 +570,10 @@ mysql-autotools_src_install() { insinto "${MY_SYSCONFDIR}" doins scripts/mysqlaccess.conf mycnf_src=3D"my.cnf-${mysql_mycnf_version}" - sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ + sed -e "s!@DATADIR@!${EPREFIX}${MY_DATADIR}!g" \ + -e "s!/tmp!${EPREFIX}/tmp!" \ + -e "s!/usr!${EPREFIX}/usr!" \ + -e "s!=3D /var!=3D ${EPREFIX}/var!" \ "${FILESDIR}/${mycnf_src}" \ > "${TMPDIR}/my.cnf.ok" if use latin1 ; then diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass index 331d93d..c74f056 100644 --- a/eclass/mysql-cmake.eclass +++ b/eclass/mysql-cmake.eclass @@ -117,7 +117,7 @@ configure_cmake_standard() { -DENABLED_LOCAL_INFILE=3D1 -DEXTRA_CHARSETS=3Dall -DMYSQL_USER=3Dmysql - -DMYSQL_UNIX_ADDR=3D/var/run/mysqld/mysqld.sock + -DMYSQL_UNIX_ADDR=3D${EPREFIX}/var/run/mysqld/mysqld.sock -DWITHOUT_READLINE=3D1 -DWITH_ZLIB=3Dsystem -DWITHOUT_LIBWRAP=3D1 @@ -195,9 +195,9 @@ mysql-cmake_src_configure() { CMAKE_BUILD_TYPE=3D"RelWithDebInfo" =20 mycmakeargs=3D( - -DCMAKE_INSTALL_PREFIX=3D/usr - -DMYSQL_DATADIR=3D/var/lib/mysql - -DSYSCONFDIR=3D/etc/mysql + -DCMAKE_INSTALL_PREFIX=3D${EPREFIX}/usr + -DMYSQL_DATADIR=3D${EPREFIX}/var/lib/mysql + -DSYSCONFDIR=3D${EPREFIX}/etc/mysql -DINSTALL_BINDIR=3Dbin -DINSTALL_DOCDIR=3Dshare/doc/${P} -DINSTALL_DOCREADMEDIR=3Dshare/doc/${P} @@ -205,14 +205,14 @@ mysql-cmake_src_configure() { -DINSTALL_INFODIR=3Dshare/info -DINSTALL_LIBDIR=3D$(get_libdir)/mysql -DINSTALL_MANDIR=3Dshare/man - -DINSTALL_MYSQLDATADIR=3D/var/lib/mysql + -DINSTALL_MYSQLDATADIR=3D${EPREFIX}/var/lib/mysql -DINSTALL_MYSQLSHAREDIR=3Dshare/mysql -DINSTALL_MYSQLTESTDIR=3Dshare/mysql/mysql-test -DINSTALL_PLUGINDIR=3D$(get_libdir)/mysql/plugin -DINSTALL_SBINDIR=3Dsbin -DINSTALL_SCRIPTDIR=3Dshare/mysql/scripts -DINSTALL_SQLBENCHDIR=3Dshare/mysql - -DINSTALL_SUPPORTFILESDIR=3D/usr/share/mysql + -DINSTALL_SUPPORTFILESDIR=3D${EPREFIX}/usr/share/mysql -DWITH_COMMENT=3D"Gentoo Linux ${PF}" -DWITHOUT_UNIT_TESTS=3D1 ) diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass index 5b41d12..d556230 100644 --- a/eclass/mysql-v2.eclass +++ b/eclass/mysql-v2.eclass @@ -496,12 +496,12 @@ mysql-v2_pkg_postinst() { mysql_init_vars =20 # Check FEATURES=3D"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 mysq= l "${EROOT}${MY_LOGDIR}" =20 # Secure the logfiles - touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} - chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* - chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* + touch "${EROOT}${MY_LOGDIR}"/mysql.{log,err} + chown mysql:mysql "${EROOT}${MY_LOGDIR}"/mysql* + chmod 0660 "${EROOT}${MY_LOGDIR}"/mysql* =20 # Minimal builds don't have the MySQL server if ! use minimal ; then @@ -571,8 +571,8 @@ mysql-v2_pkg_config() { fi =20 if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" !=3D "${old_MY_DATADI= R}" ) ]]; then - local MY_DATADIR_s=3D"$(strip_duplicate_slashes ${ROOT}/${MY_DATADIR})= " - local old_MY_DATADIR_s=3D"$(strip_duplicate_slashes ${ROOT}/${old_MY_D= ATADIR})" + local MY_DATADIR_s=3D"$(strip_duplicate_slashes ${EROOT}/${MY_DATADIR}= )" + local old_MY_DATADIR_s=3D"$(strip_duplicate_slashes ${EROOT}/${old_MY_= DATADIR})" =20 if [[ -d "${old_MY_DATADIR_s}" ]]; then if [[ -d "${MY_DATADIR_s}" ]]; then @@ -598,13 +598,13 @@ mysql-v2_pkg_config() { local pwd2=3D"b" local maxtry=3D15 =20 - if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${ROOT}/root/.my.cnf" ]; then - MYSQL_ROOT_PASSWORD=3D"$(sed -n -e '/^password=3D/s,^password=3D,,gp' = "${ROOT}/root/.my.cnf")" + if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${EROOT}/root/.my.cnf" ]; then + MYSQL_ROOT_PASSWORD=3D"$(sed -n -e '/^password=3D/s,^password=3D,,gp' = "${EROOT}/root/.my.cnf")" fi =20 - if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then + if [[ -d "${EROOT}/${MY_DATADIR}/mysql" ]] ; then ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${MY_DATADIR}/*)" + ewarn "(${EROOT}/${MY_DATADIR}/*)" ewarn "Please rename or delete it if you wish to replace it." die "MySQL database already exists!" fi @@ -633,27 +633,27 @@ mysql-v2_pkg_config() { local options=3D"" local sqltmp=3D"$(emktemp)" =20 - local help_tables=3D"${ROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" + local help_tables=3D"${EROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" [[ -r "${help_tables}" ]] \ && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ || touch "${TMPDIR}/fill_help_tables.sql" help_tables=3D"${TMPDIR}/fill_help_tables.sql" =20 pushd "${TMPDIR}" &>/dev/null - "${ROOT}/usr/bin/mysql_install_db --basedir=3D/usr" >"${TMPDIR}"/mysql_= install_db.log 2>&1 + "${EROOT}/usr/bin/mysql_install_db --basedir=3D/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/mysq= ld.err AND ${TMPDIR}/mysql_install_db.log" fi popd &>/dev/null - [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ + [[ -f "${EROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ || die "MySQL databases not installed" - chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null - chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null + chown -R mysql:mysql "${EROOT}/${MY_DATADIR}" 2>/dev/null + chmod 0750 "${EROOT}/${MY_DATADIR}" 2>/dev/null =20 # Figure out which options we need to disable to do the setup helpfile=3D"${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 \ @@ -667,7 +667,7 @@ mysql-v2_pkg_config() { =20 # 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 =20 if [[ -r "${help_tables}" ]] ; then cat "${help_tables}" >> "${sqltmp}" @@ -676,13 +676,13 @@ mysql-v2_pkg_config() { einfo "Creating the mysql database and setting proper" einfo "permissions on it ..." =20 - local socket=3D"${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock" - local pidfile=3D"${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid" - local mysqld=3D"${ROOT}/usr/sbin/mysqld \ + local socket=3D"${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" + local pidfile=3D"${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" + local mysqld=3D"${EROOT}/usr/sbin/mysqld \ ${options} \ --user=3Dmysql \ - --basedir=3D${ROOT}/usr \ - --datadir=3D${ROOT}/${MY_DATADIR} \ + --basedir=3D${EROOT}/usr \ + --datadir=3D${EROOT}/${MY_DATADIR} \ --max_allowed_packet=3D8M \ --net_buffer_length=3D16K \ --default-storage-engine=3DMyISAM \ @@ -706,14 +706,14 @@ mysql-v2_pkg_config() { ebegin "Setting root password" # Do this from memory, as we don't want clear text passwords in temp fi= les local sql=3D"UPDATE mysql.user SET Password =3D PASSWORD('${MYSQL_ROOT_= PASSWORD}') WHERE USER=3D'root'" - "${ROOT}/usr/bin/mysql" \ + "${EROOT}/usr/bin/mysql" \ --socket=3D${socket} \ -hlocalhost \ -e "${sql}" eend $? =20 ebegin "Loading \"zoneinfo\", this step may require a few seconds ..." - "${ROOT}/usr/bin/mysql" \ + "${EROOT}/usr/bin/mysql" \ --socket=3D${socket} \ -hlocalhost \ -uroot \ diff --git a/eclass/mysql_fx.eclass b/eclass/mysql_fx.eclass index afadab1..cad3114 100644 --- a/eclass/mysql_fx.eclass +++ b/eclass/mysql_fx.eclass @@ -234,12 +234,12 @@ mysql_init_vars() { =20 if [[ -z "${MY_DATADIR}" ]] ; then MY_DATADIR=3D"" - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then + if [[ -f "${EPREFIX}${MY_SYSCONFDIR}/my.cnf" ]] ; then MY_DATADIR=3D`"my_print_defaults" mysqld 2>/dev/null \ | sed -ne '/datadir/s|^--datadir=3D||p' \ | tail -n1` if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR=3D`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ + MY_DATADIR=3D`grep ^datadir "${EPREFIX}${MY_SYSCONFDIR}/my.cnf" \ | sed -e 's/.*=3D\s*//' \ | tail -n1` fi @@ -247,13 +247,16 @@ mysql_init_vars() { if [[ -z "${MY_DATADIR}" ]] ; then MY_DATADIR=3D"${MY_LOCALSTATEDIR}" einfo "Using default MY_DATADIR" + else + # strip leading EPREFIX returned by already installed mysql + MY_DATADIR=3D"${MY_DATADIR#${EPREFIX}}" fi - elog "MySQL MY_DATADIR is ${MY_DATADIR}" + elog "MySQL MY_DATADIR is ${EPREFIX}${MY_DATADIR}" =20 if [[ -z "${PREVIOUS_DATADIR}" ]] ; then - if [[ -e "${MY_DATADIR}" ]] ; then + if [[ -e "${EPREFIX}${MY_DATADIR}" ]] ; then # If you get this and you're wondering about it, see bug #207636 - elog "MySQL datadir found in ${MY_DATADIR}" + elog "MySQL datadir found in ${EPREFIX}${MY_DATADIR}" elog "A new one will not be created." PREVIOUS_DATADIR=3D"yes" else @@ -272,7 +275,8 @@ mysql_init_vars() { ewarn "MySQL MY_DATADIR has changed" ewarn "from ${MY_DATADIR}" ewarn "to ${new_MY_DATADIR}" - MY_DATADIR=3D"${new_MY_DATADIR}" + # strip leading EPREFIX returned by already installed mysql + MY_DATADIR=3D"${new_MY_DATADIR#${EPREFIX}}" fi fi fi