diff options
author | Brian Evans <grknight@gentoo.org> | 2016-02-26 21:56:17 -0500 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2016-02-26 21:56:17 -0500 |
commit | 272d86839db2042ebe26dd2193850e018c737eb4 (patch) | |
tree | 712658de84131fc0618e3cea494e90e8d509a9cf | |
parent | dev-db/mysql-utilities: Version bump with new EAPI (diff) | |
download | mysql-272d86839db2042ebe26dd2193850e018c737eb4.tar.gz mysql-272d86839db2042ebe26dd2193850e018c737eb4.tar.bz2 mysql-272d86839db2042ebe26dd2193850e018c737eb4.zip |
mysql-multilib-r1.eclass: Further refinement for EAPI=6
Use the default functions for patching and deprecate mysql_fx.eclass
PATCHES=() is now set in ebuilds instead of using the move functions
-rw-r--r-- | eclass/mysql-multilib-r1.eclass | 114 |
1 files changed, 92 insertions, 22 deletions
diff --git a/eclass/mysql-multilib-r1.eclass b/eclass/mysql-multilib-r1.eclass index 60340d7..65ebe85 100644 --- a/eclass/mysql-multilib-r1.eclass +++ b/eclass/mysql-multilib-r1.eclass @@ -38,8 +38,14 @@ MYSQL_EXTRAS="" # @DESCRIPTION: # An array of CMake arguments added to native and non-native -inherit eutils systemd flag-o-matic ${MYSQL_EXTRAS} mysql_fx versionator \ - multilib prefix toolchain-funcs user cmake-utils multilib-minimal +# Keeping eutils in EAPI=6 for emktemp in pkg_config + +inherit eutils systemd flag-o-matic ${MYSQL_EXTRAS} versionator \ + prefix toolchain-funcs user cmake-utils multilib-minimal + +if [[ "${EAPI}x" == "5x" ]]; then + inherit multilib mysql_fx +fi # # Supported EAPI versions and export functions @@ -82,19 +88,18 @@ if [[ -z ${MYSQL_PV_MAJOR} ]] ; then MYSQL_PV_MAJOR="$(get_version_component_ran # depend on this variable. # In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803" # We also strip off upstream's trailing letter that they use to respin tarballs -MYSQL_VERSION_ID="" -tpv="${PV%[a-z]}" -tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" -for vatom in 0 1 2 3 ; do - # pad to length 2 - tpv[${vatom}]="00${tpv[${vatom}]}" - MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" -done -# strip leading "0" (otherwise it's considered an octal number by BASH) -MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} - -# This eclass should only be used with at least mysql-5.5.35 -mysql_version_is_at_least "5.5.35" || die "This eclass should only be used with >=mysql-5.5.35" +if [[ "${EAPI}x" == "5x" ]]; then + MYSQL_VERSION_ID="" + tpv="${PV%[a-z]}" + tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" + for vatom in 0 1 2 3 ; do + # pad to length 2 + tpv[${vatom}]="00${tpv[${vatom}]}" + MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" + done + # strip leading "0" (otherwise it's considered an octal number by BASH) + MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} +fi # Work out the default SERVER_URI correctly if [[ -z ${SERVER_URI} ]]; then @@ -294,12 +299,6 @@ mysql-multilib-r1_src_prepare() { mysql_mv_patches # And apply epatch - else - mkdir -p "${WORKDIR}/patch" || die "Unable to create epatch directory" - # Clean out old items - rm -f "${WORKDIR}"/patch/* - EPATCH_SOURCE="${WORKDIR}/patch" mysql_mv_patches - eapply "${WORKDIR}/patch" fi fi @@ -343,7 +342,7 @@ mysql-multilib-r1_src_prepare() { if [[ "${EAPI}x" == "5x" ]] ; then epatch_user else - eapply_user + default fi } @@ -1056,3 +1055,74 @@ mysql-cmake_use_plugin() { echo "-DWITHOUT_$2=1 -DWITH_$2=0 -DPLUGIN_$2=NO" fi } + +# @FUNCTION: mysql_init_vars +# @DESCRIPTION: +# void mysql_init_vars() +# Initialize global variables +# 2005-11-19 <vivo@gentoo.org> +if [[ "${EAPI}x" != "5x" ]]; then + +mysql_init_vars() { + 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="" + 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" \ + | sed -e 's/.*=\s*//' \ + | tail -n1` + fi + fi + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="${MY_LOCALSTATEDIR}" + einfo "Using default MY_DATADIR" + fi + elog "MySQL MY_DATADIR is ${MY_DATADIR}" + + if [[ -z "${PREVIOUS_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 ${MY_DATADIR}" + elog "A new one will not be created." + PREVIOUS_DATADIR="yes" + else + PREVIOUS_DATADIR="no" + fi + export PREVIOUS_DATADIR + fi + else + if [[ ${EBUILD_PHASE} == "config" ]]; then + local new_MY_DATADIR + new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then + ewarn "MySQL MY_DATADIR has changed" + ewarn "from ${MY_DATADIR}" + ewarn "to ${new_MY_DATADIR}" + MY_DATADIR="${new_MY_DATADIR}" + fi + fi + fi + + if [ "${MY_SOURCEDIR:-unset}" == "unset" ]; then + MY_SOURCEDIR=${SERVER_URI##*/} + MY_SOURCEDIR=${MY_SOURCEDIR%.tar*} + fi + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR + export MY_INCLUDEDIR MY_DATADIR MY_SOURCEDIR +} +fi |