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 1RcvI2-0006lf-FJ for garchives@archives.gentoo.org; Tue, 20 Dec 2011 08:43:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2FBF621C09B; Tue, 20 Dec 2011 08:42:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D46D721C09B for ; Tue, 20 Dec 2011 08:42:41 +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 3F07E1B401A for ; Tue, 20 Dec 2011 08:42:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9B18680042 for ; Tue, 20 Dec 2011 08:42:40 +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: 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.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: e421b62e55d37e926aa8f681f6f19b260c9d6cbf Date: Tue, 20 Dec 2011 08:42:40 +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: 0533ec60-a838-40d8-a17c-ad261c67b0ce X-Archives-Hash: 1605ef2f3d3f21ced7d8f7088945a0e5 commit: e421b62e55d37e926aa8f681f6f19b260c9d6cbf Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) ge= ntoo org> AuthorDate: Tue Dec 20 00:18:26 2011 +0000 Commit: Jorge Manuel B. S. Vicetto gentoo org= > CommitDate: Tue Dec 20 00:18:26 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/mysql.git;a=3D= commit;h=3De421b62e Apply prefix patch. --- eclass/mysql-autotools.eclass | 48 +++++++++--------- eclass/mysql-cmake.eclass | 24 +++++----- eclass/mysql-v2.eclass | 32 ++++++------ eclass/mysql.eclass | 110 ++++++++++++++++++++++-------------= ------ eclass/mysql_fx.eclass | 54 ++++++++++++-------- 5 files changed, 143 insertions(+), 125 deletions(-) diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclas= s index bf0b0b5..06f4979 100644 --- a/eclass/mysql-autotools.eclass +++ b/eclass/mysql-autotools.eclass @@ -337,7 +337,7 @@ pbxt_src_compile() { pbxt_src_install() { =20 pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null - emake install DESTDIR=3D"${D}" || die "Failed to install PBXT" + emake install DESTDIR=3D"${ED}" || die "Failed to install PBXT" popd } =20 @@ -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)!'"${EPREFIX}"${MY_SHAREDSTATE= DIR}'!g' {} \; + -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} = \; =20 # Remove what needs to be recreated, so we're sure it's actually done einfo "Cleaning up old buildscript files" @@ -478,11 +478,11 @@ mysql-autotools_src_configure() { =20 econf \ --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}" \ + --sysconfdir=3D"${MY_SYSCONFDIR}" \ + --localstatedir=3D"${MY_LOCALSTATEDIR}" \ + --sharedstatedir=3D"${MY_SHAREDSTATEDIR}" \ + --libdir=3D"${MY_LIBDIR}" \ + --includedir=3D"${MY_INCLUDEDIR}" \ --with-low-memory \ --with-client-ldflags=3D-lstdc++ \ --enable-thread-safe-client \ @@ -522,9 +522,9 @@ mysql-autotools_src_install() { mysql_init_vars =20 emake install \ - DESTDIR=3D"${D}" \ - benchdir_root=3D"${EPREFIX}${MY_SHAREDSTATEDIR}" \ - testroot=3D"${EPREFIX}${MY_SHAREDSTATEDIR}" \ + DESTDIR=3D"${ED}" \ + benchdir_root=3D"${MY_SHAREDSTATEDIR}" \ + testroot=3D"${MY_SHAREDSTATEDIR}" \ || die "emake install failed" =20 if [[ "${PBXT_NEWSTYLE}" !=3D "1" ]]; then @@ -539,27 +539,27 @@ mysql-autotools_src_install() { =20 # 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 - rm -f "${D}"/${MY_SHAREDSTATEDIR}/${removeme} + rm -f "${ED}"/${MY_SHAREDSTATEDIR}/${removeme} done =20 # Clean up stuff for a minimal build 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_extensio= ns,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myi= sam*,isam*,pack_isam} - rm -f "${D}/usr/sbin/mysqld" - rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isam= mrg,isam},vio,dbug}.a + rm -Rf "${ED}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench} + rm -f "${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installation= ,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensi= ons,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},my= isam*,isam*,pack_isam} + rm -f "${ED}/usr/sbin/mysqld" + rm -f "${ED}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isa= mmrg,isam},vio,dbug}.a fi =20 # Unless they explicitly specific USE=3Dtest, 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 + rm -rf "${ED}"/${MY_SHAREDSTATEDIR}/mysql-test fi =20 # Configuration stuff @@ -567,10 +567,10 @@ mysql-autotools_src_install() { 5.[1-9]|6*|7*) mysql_mycnf_version=3D"5.1" ;; esac einfo "Building default my.cnf (${mysql_mycnf_version})" - insinto "${MY_SYSCONFDIR}" + insinto "${MY_SYSCONFDIR#${EPREFIX}}" doins scripts/mysqlaccess.conf mycnf_src=3D"my.cnf-${mysql_mycnf_version}" - sed -e "s!@DATADIR@!${EPREFIX}${MY_DATADIR}!g" \ + sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ -e "s!/tmp!${EPREFIX}/tmp!" \ -e "s!/usr!${EPREFIX}/usr!" \ -e "s!=3D /var!=3D ${EPREFIX}/var!" \ @@ -589,16 +589,16 @@ mysql-autotools_src_install() { # Empty directories ... diropts "-m0750" if [[ "${PREVIOUS_DATADIR}" !=3D "yes" ]] ; then - dodir "${MY_DATADIR}" - keepdir "${MY_DATADIR}" + dodir "${MY_DATADIR#${EPREFIX}}" + keepdir "${MY_DATADIR#${EPREFIX}}" chown -R mysql:mysql "${D}/${MY_DATADIR}" fi =20 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 =20 @@ -628,5 +628,5 @@ mysql-autotools_src_install() { =20 fi =20 - mysql_lib_symlinks "${D}" + mysql_lib_symlinks "${ED}" } diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass index c74f056..d792cf9 100644 --- a/eclass/mysql-cmake.eclass +++ b/eclass/mysql-cmake.eclass @@ -268,7 +268,7 @@ mysql-cmake_src_install() { dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" =20 # INSTALL_LAYOUT=3DSTANDALONE causes cmake to create a /usr/data dir - rm -Rf "${D}/usr/data" + rm -Rf "${ED}/usr/data" =20 # Various junk (my-*.cnf moved elsewhere) einfo "Removing duplicate /usr/share/mysql files" @@ -276,17 +276,17 @@ mysql-cmake_src_install() { # Clean up stuff for a minimal build # 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_extensi= ons,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},my= isam*,isam*,pack_isam} -# rm -f "${D}/usr/sbin/mysqld" -# rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isa= mmrg,isam},vio,dbug}.a +# rm -Rf "${ED}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench} +# rm -f "${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installatio= n,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extens= ions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},m= yisam*,isam*,pack_isam} +# rm -f "${ED}/usr/sbin/mysqld" +# rm -f "${ED}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,is= ammrg,isam},vio,dbug}.a # fi =20 # Unless they explicitly specific USE=3Dtest, 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 + rm -rf "${ED}"/${MY_SHAREDSTATEDIR}/mysql-test fi =20 # Configuration stuff @@ -313,16 +313,16 @@ mysql-cmake_src_install() { # Empty directories ... diropts "-m0750" if [[ "${PREVIOUS_DATADIR}" !=3D "yes" ]] ; then - dodir "${MY_DATADIR}" - keepdir "${MY_DATADIR}" - chown -R mysql:mysql "${D}/${MY_DATADIR}" + dodir "${MY_DATADIR#${EPREFIX}}" + keepdir "${MY_DATADIR#${EPREFIX}}" + chown -R mysql:mysql "${ED}/${MY_DATADIR}" fi =20 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 =20 @@ -345,5 +345,5 @@ mysql-cmake_src_install() { =20 fi =20 - mysql_lib_symlinks "${D}" + mysql_lib_symlinks "${ED}" } diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass index de9a79e..41233e0 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 "${EROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysq= l "${EROOT}${MY_LOGDIR}" + [[ -d "${EROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysq= l "${ROOT}${MY_LOGDIR}" =20 # Secure the logfiles - touch "${EROOT}${MY_LOGDIR}"/mysql.{log,err} - chown mysql:mysql "${EROOT}${MY_LOGDIR}"/mysql* - chmod 0660 "${EROOT}${MY_LOGDIR}"/mysql* + touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} + chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* + chmod 0660 "${ROOT}${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 ${EROOT}/${MY_DATADIR}= )" - local old_MY_DATADIR_s=3D"$(strip_duplicate_slashes ${EROOT}/${old_MY_= DATADIR})" + 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})" =20 if [[ -d "${old_MY_DATADIR_s}" ]]; then if [[ -d "${MY_DATADIR_s}" ]]; then @@ -602,9 +602,9 @@ mysql-v2_pkg_config() { MYSQL_ROOT_PASSWORD=3D"$(sed -n -e '/^password=3D/s,^password=3D,,gp' = "${EROOT}/root/.my.cnf")" fi =20 - if [[ -d "${EROOT}/${MY_DATADIR}/mysql" ]] ; then + if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then ewarn "You have already a MySQL database in place." - ewarn "(${EROOT}/${MY_DATADIR}/*)" + ewarn "(${ROOT}/${MY_DATADIR}/*)" ewarn "Please rename or delete it if you wish to replace it." die "MySQL database already exists!" fi @@ -633,23 +633,23 @@ mysql-v2_pkg_config() { local options=3D"" local sqltmp=3D"$(emktemp)" =20 - local help_tables=3D"${EROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" + local help_tables=3D"${ROOT}${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 - "${EROOT}/usr/bin/mysql_install_db" --basedir=3D/usr >"${TMPDIR}"/mysql= _install_db.log 2>&1 + "${EROOT}/usr/bin/mysql_install_db" "--basedir=3D${EPREFIX}/usr" >"${TM= PDIR}"/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" + 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 "${EROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ + [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ || die "MySQL databases not installed" - chown -R mysql:mysql "${EROOT}/${MY_DATADIR}" 2>/dev/null - chmod 0750 "${EROOT}/${MY_DATADIR}" 2>/dev/null + chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null + chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null =20 # Figure out which options we need to disable to do the setup helpfile=3D"${TMPDIR}/mysqld-help" @@ -682,7 +682,7 @@ mysql-v2_pkg_config() { ${options} \ --user=3Dmysql \ --basedir=3D${EROOT}/usr \ - --datadir=3D${EROOT}/${MY_DATADIR} \ + --datadir=3D${ROOT}/${MY_DATADIR} \ --max_allowed_packet=3D8M \ --net_buffer_length=3D16K \ --default-storage-engine=3DMyISAM \ @@ -736,5 +736,5 @@ mysql-v2_pkg_config() { # Remove mysql symlinks. mysql-v2_pkg_postrm() { =20 - : # mysql_lib_symlinks "${D}" + : # mysql_lib_symlinks "${ED}" } diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass index 78b482b..6b8a2cd 100644 --- a/eclass/mysql.eclass +++ b/eclass/mysql.eclass @@ -127,7 +127,7 @@ PERCONA_VER=3D"${PERCONA_VER}" # Be warned, *DEPEND are version-dependant # These are used for both runtime and compiletime DEPEND=3D"ssl? ( >=3Ddev-libs/openssl-0.9.6d ) - userland_GNU? ( sys-process/procps ) + kernel_linux? ( sys-process/procps ) >=3Dsys-apps/sed-4 >=3Dsys-apps/texinfo-4.7-r1 >=3Dsys-libs/readline-4.1 @@ -364,21 +364,21 @@ mysql_disable_test() { # Initialize global variables # 2005-11-19 mysql_init_vars() { - MY_SHAREDSTATEDIR=3D${MY_SHAREDSTATEDIR=3D"/usr/share/mysql"} - MY_SYSCONFDIR=3D${MY_SYSCONFDIR=3D"/etc/mysql"} - MY_LIBDIR=3D${MY_LIBDIR=3D"/usr/$(get_libdir)/mysql"} - MY_LOCALSTATEDIR=3D${MY_LOCALSTATEDIR=3D"/var/lib/mysql"} - MY_LOGDIR=3D${MY_LOGDIR=3D"/var/log/mysql"} - MY_INCLUDEDIR=3D${MY_INCLUDEDIR=3D"/usr/include/mysql"} + MY_SHAREDSTATEDIR=3D${MY_SHAREDSTATEDIR=3D"${EPREFIX}/usr/share/mysql"} + MY_SYSCONFDIR=3D${MY_SYSCONFDIR=3D"${EPREFIX}/etc/mysql"} + MY_LIBDIR=3D${MY_LIBDIR=3D"${EPREFIX}/usr/$(get_libdir)/mysql"} + MY_LOCALSTATEDIR=3D${MY_LOCALSTATEDIR=3D"${EPREFIX}/var/lib/mysql"} + MY_LOGDIR=3D${MY_LOGDIR=3D"${EPREFIX}/var/log/mysql"} + MY_INCLUDEDIR=3D${MY_INCLUDEDIR=3D"${EPREFIX}/usr/include/mysql"} =20 if [[ -z "${MY_DATADIR}" ]] ; then MY_DATADIR=3D"" - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then + if [[ -f ${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 ${MY_SYSCONFDIR}/my.cnf \ | sed -e 's/.*=3D\s*//' \ | tail -n1` fi @@ -460,7 +460,7 @@ 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 @@ -505,12 +505,13 @@ configure_common() { } =20 configure_40_41_50() { + myconf=3D"${myconf} --with-zlib-dir=3D${EPREFIX}/usr" myconf=3D"${myconf} $(use_with perl bench)" myconf=3D"${myconf} --enable-assembler" myconf=3D"${myconf} --with-extra-tools" myconf=3D"${myconf} --with-innodb" myconf=3D"${myconf} --without-readline" - myconf=3D"${myconf} $(use_with ssl openssl)" + myconf=3D"${myconf} $(use_with ssl openssl "${EPREFIX}/usr")" mysql_version_is_at_least "5.0" || myconf=3D"${myconf} $(use_with raid)= " =20 # --with-vio is not needed anymore, it's on by default and @@ -586,13 +587,13 @@ 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. @@ -743,7 +744,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" } @@ -839,8 +840,9 @@ mysql_pkg_setup() { # 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=3D$(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 >=3D5.0.87, or use a newer GCC." @@ -978,14 +980,14 @@ mysql_src_prepare() { && 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/libt= ool.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.a= c" - cat "/usr/share/aclocal/lt~obsolete.m4" >> "bdb/dist/aclocal/libtool= .ac" - cat "/usr/share/aclocal/ltoptions.m4" >> "bdb/dist/aclocal/libtool.a= c" + if [ -f ${EPREFIX}'/usr/share/aclocal/ltsugar.m4' ]; then + cat "${EPREFIX}/usr/share/aclocal/ltsugar.m4" >> "bdb/dist/aclocal/l= ibtool.ac" + cat "${EPREFIX}/usr/share/aclocal/ltversion.m4" >> "bdb/dist/aclocal= /libtool.ac" + cat "${EPREFIX}/usr/share/aclocal/lt~obsolete.m4" >> "bdb/dist/acloc= al/libtool.ac" + cat "${EPREFIX}/usr/share/aclocal/ltoptions.m4" >> "bdb/dist/aclocal= /libtool.ac" fi pushd "bdb/dist" &>/dev/null sh s_all \ @@ -1046,12 +1048,12 @@ mysql_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${MY_SYSCONFDIR} \ + --localstatedir=3D${MY_LOCALSTATEDIR} \ + --sharedstatedir=3D${MY_SHAREDSTATEDIR} \ + --libdir=3D${MY_LIBDIR} \ + --includedir=3D${MY_INCLUDEDIR} \ --with-low-memory \ --with-client-ldflags=3D-lstdc++ \ --enable-thread-safe-client \ @@ -1096,7 +1098,7 @@ mysql_src_install() { =20 emake install \ DESTDIR=3D"${D}" \ - benchdir_root=3D"${MY_SHAREDSTATEDIR}" \ + benchdir_root=3D${MY_SHAREDSTATEDIR} \ testroot=3D"${MY_SHAREDSTATEDIR}" \ || die "emake install failed" =20 @@ -1112,7 +1114,7 @@ mysql_src_install() { =20 # 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 @@ -1123,8 +1125,8 @@ mysql_src_install() { 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_extensio= ns,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myi= sam*,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_extensi= ons,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},my= isam*,isam*,pack_isam} + rm -f "${ED}/usr/sbin/mysqld" rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isam= mrg,isam},vio,dbug}.a fi =20 @@ -1142,12 +1144,16 @@ mysql_src_install() { 5.[1-9]|6*|7*) mysql_mycnf_version=3D"5.1" ;; esac einfo "Building default my.cnf (${mysql_mycnf_version})" - insinto "${MY_SYSCONFDIR}" + insinto "${MY_SYSCONFDIR#${EPREFIX}}" doins scripts/mysqlaccess.conf mycnf_src=3D"my.cnf-${mysql_mycnf_version}" sed -e "s!@DATADIR@!${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" + use prefix && sed -i -e '/^user[ ]*=3D mysql$/d' "${TMPDIR}/my.cnf.ok" if use latin1 ; then sed -i \ -e "/character-set/s|utf8|latin1|g" \ @@ -1161,16 +1167,16 @@ mysql_src_install() { # Empty directories ... diropts "-m0750" if [[ "${PREVIOUS_DATADIR}" !=3D "yes" ]] ; then - dodir "${MY_DATADIR}" - keepdir "${MY_DATADIR}" + dodir "${MY_DATADIR#${EPREFIX}}" + keepdir "${MY_DATADIR#${EPREFIX}}" chown -R mysql:mysql "${D}/${MY_DATADIR}" fi =20 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 =20 @@ -1200,7 +1206,7 @@ mysql_src_install() { =20 fi =20 - mysql_lib_symlinks "${D}" + mysql_lib_symlinks "${ED}" } =20 # @FUNCTION: mysql_pkg_preinst @@ -1224,7 +1230,7 @@ mysql_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 "${ROOT}${MY_LOGDIR}" =20 # Secure the logfiles touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} @@ -1325,8 +1331,8 @@ mysql_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 @@ -1367,7 +1373,7 @@ mysql_pkg_config() { help_tables=3D"${TMPDIR}/fill_help_tables.sql" =20 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/mysq= ld.err AND ${TMPDIR}/mysql_install_db.log" @@ -1395,7 +1401,7 @@ mysql_pkg_config() { 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 =20 if [[ -r "${help_tables}" ]] ; then cat "${help_tables}" >> "${sqltmp}" @@ -1405,12 +1411,14 @@ mysql_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 \ + use prefix || options=3D"${options} --user=3Dmysql" + + 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 \ + --basedir=3D${EROOT}/usr \ --datadir=3D${ROOT}/${MY_DATADIR} \ --max_allowed_packet=3D8M \ --net_buffer_length=3D16K \ @@ -1435,14 +1443,14 @@ mysql_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 \ @@ -1464,5 +1472,5 @@ mysql_pkg_config() { # @DESCRIPTION: # Remove mysql symlinks. mysql_pkg_postrm() { - : # mysql_lib_symlinks "${D}" + : # mysql_lib_symlinks "${ED}" } diff --git a/eclass/mysql_fx.eclass b/eclass/mysql_fx.eclass index cad3114..c7c624f 100644 --- a/eclass/mysql_fx.eclass +++ b/eclass/mysql_fx.eclass @@ -205,14 +205,29 @@ mysql_lib_symlinks() { libnameln=3D${libname##*/} # loop in version of the library to link it, similar to how # libtool works - while [[ ${libnameln:0-3} !=3D '${libsuffix}' ]] && [[ ${maxdots} -lt= 6 ]] ; do + if [[ ${CHOST} =3D=3D *-darwin* ]] ; then + # macho: libname.x.y.z.dylib + local libbasename=3D${libnameln%%.*} # libname + local libver=3D${libnameln#${libbasename}} # .x.y.z.dylib + libver=3D${libver%${libsuffix}} # .x.y.z + while [[ -n ${libver} ]] && [[ ${maxdots} -lt 6 ]] ; do + libnameln=3D"${libbasename}${libver}${libsuffix}" + rm -f "${libnameln}" + ln -s "${libname}" "${libnameln}" + (( ++maxdots )) + libver=3D${libver%.*} + done + else + # elf: libname.so.x.y.z + while [[ ${libnameln:0-3} !=3D '${libsuffix}' ]] && [[ ${maxdots} -l= t 6 ]] ; do + rm -f "${libnameln}" + ln -s "${libname}" "${libnameln}" + (( ++maxdots )) + libnameln=3D"${libnameln%.*}" + done rm -f "${libnameln}" ln -s "${libname}" "${libnameln}" - (( ++maxdots )) - libnameln=3D"${libnameln%.*}" - done - rm -f "${libnameln}" - ln -s "${libname}" "${libnameln}" + fi done done =20 @@ -225,21 +240,21 @@ mysql_lib_symlinks() { # Initialize global variables # 2005-11-19 mysql_init_vars() { - MY_SHAREDSTATEDIR=3D${MY_SHAREDSTATEDIR=3D"/usr/share/mysql"} - MY_SYSCONFDIR=3D${MY_SYSCONFDIR=3D"/etc/mysql"} - MY_LOCALSTATEDIR=3D${MY_LOCALSTATEDIR=3D"/var/lib/mysql"} - MY_LOGDIR=3D${MY_LOGDIR=3D"/var/log/mysql"} - MY_INCLUDEDIR=3D${MY_INCLUDEDIR=3D"/usr/include/mysql"} - MY_LIBDIR=3D${MY_LIBDIR=3D"/usr/$(get_libdir)/mysql"} + MY_SHAREDSTATEDIR=3D${MY_SHAREDSTATEDIR=3D"${EPREFIX}/usr/share/mysql"} + MY_SYSCONFDIR=3D${MY_SYSCONFDIR=3D"${EPREFIX}/etc/mysql"} + MY_LOCALSTATEDIR=3D${MY_LOCALSTATEDIR=3D"${EPREFIX}/var/lib/mysql"} + MY_LOGDIR=3D${MY_LOGDIR=3D"${EPREFIX}/var/log/mysql"} + MY_INCLUDEDIR=3D${MY_INCLUDEDIR=3D"${EPREFIX}/usr/include/mysql"} + MY_LIBDIR=3D${MY_LIBDIR=3D"${EPREFIX}/usr/$(get_libdir)/mysql"} =20 if [[ -z "${MY_DATADIR}" ]] ; then MY_DATADIR=3D"" - if [[ -f "${EPREFIX}${MY_SYSCONFDIR}/my.cnf" ]] ; then + if [[ -f "${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 "${EPREFIX}${MY_SYSCONFDIR}/my.cnf" \ + MY_DATADIR=3D`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ | sed -e 's/.*=3D\s*//' \ | tail -n1` fi @@ -247,16 +262,13 @@ 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 ${EPREFIX}${MY_DATADIR}" + elog "MySQL MY_DATADIR is ${MY_DATADIR}" =20 if [[ -z "${PREVIOUS_DATADIR}" ]] ; then - if [[ -e "${EPREFIX}${MY_DATADIR}" ]] ; then + if [[ -e "${MY_DATADIR}" ]] ; then # If you get this and you're wondering about it, see bug #207636 - elog "MySQL datadir found in ${EPREFIX}${MY_DATADIR}" + elog "MySQL datadir found in ${MY_DATADIR}" elog "A new one will not be created." PREVIOUS_DATADIR=3D"yes" else @@ -275,8 +287,6 @@ mysql_init_vars() { ewarn "MySQL MY_DATADIR has changed" ewarn "from ${MY_DATADIR}" ewarn "to ${new_MY_DATADIR}" - # strip leading EPREFIX returned by already installed mysql - MY_DATADIR=3D"${new_MY_DATADIR#${EPREFIX}}" fi fi fi