/[gentoo-x86]/eclass/mysql.eclass
Gentoo

Diff of /eclass/mysql.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.84 Revision 1.86
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.84 2008/01/16 04:01:14 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.86 2008/03/09 21:13:22 robbat2 Exp $
4 4
5# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 5# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
6# Maintainer: MySQL Team <mysql-bugs@gentoo.org>
6# Maintainer: Luca Longinotti <chtekk@gentoo.org> 7# - Luca Longinotti <chtekk@gentoo.org>
7 8# - Robin H. Johnson <robbat2@gentoo.org>
8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too!
9# Note that MYSQL_VERSION_ID must be empty!
10 9
11WANT_AUTOCONF="latest" 10WANT_AUTOCONF="latest"
12WANT_AUTOMAKE="latest" 11WANT_AUTOMAKE="latest"
13 12
14inherit eutils flag-o-matic gnuconfig autotools mysql_fx 13inherit eutils flag-o-matic gnuconfig autotools mysql_fx
16# Shorten the path because the socket path length must be shorter than 107 chars 15# Shorten the path because the socket path length must be shorter than 107 chars
17# and we will run a mysql server during test phase 16# and we will run a mysql server during test phase
18S="${WORKDIR}/mysql" 17S="${WORKDIR}/mysql"
19 18
20[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070108" 19[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070108"
20if [[ "${MY_EXTRAS_VER}" == "live" ]]; then
21 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
22 inherit git
23fi
21 24
22if [[ ${PR#r} -lt 60 ]] ; then 25if [[ ${PR#r} -lt 60 ]] ; then
23 IS_BITKEEPER=0 26 IS_BITKEEPER=0
24elif [[ ${PR#r} -lt 90 ]] ; then 27elif [[ ${PR#r} -lt 90 ]] ; then
25 IS_BITKEEPER=60 28 IS_BITKEEPER=60
79 SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz" 82 SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz"
80 fi 83 fi
81fi 84fi
82 85
83# Define correct SRC_URIs 86# Define correct SRC_URIs
84SRC_URI="${SERVER_URI} 87SRC_URI="${SERVER_URI}"
88
89[[ ${MY_EXTRAS_VER} != live ]] && SRC_URI="${SRC_URI}
85 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 90 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
86 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" 91 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
87mysql_version_is_at_least "5.1.12" \ 92mysql_version_is_at_least "5.1.12" \
88&& [[ -n "${PBXT_VERSION}" ]] \ 93&& [[ -n "${PBXT_VERSION}" ]] \
89&& SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )" 94&& SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )"
495mysql_src_unpack() { 500mysql_src_unpack() {
496 # Initialize the proper variables first 501 # Initialize the proper variables first
497 mysql_init_vars 502 mysql_init_vars
498 503
499 unpack ${A} 504 unpack ${A}
505 # Grab the patches
506 [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack
507 # Bitkeeper checkout support
500 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then 508 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then
501 if mysql_check_version_range "5.1 to 5.1.99" ; then 509 if mysql_check_version_range "5.1 to 5.1.99" ; then
502 bitkeeper_fetch "mysql-5.1-ndb" 510 bitkeeper_fetch "mysql-5.1-ndb"
503 elif mysql_check_version_range "5.2 to 5.2.99" ; then 511 elif mysql_check_version_range "5.2 to 5.2.99" ; then
504 bitkeeper_fetch "mysql-5.2-falcon" 512 bitkeeper_fetch "mysql-5.2-falcon"
514 fi 522 fi
515 523
516 # Apply the patches for this MySQL version 524 # Apply the patches for this MySQL version
517 EPATCH_SUFFIX="patch" 525 EPATCH_SUFFIX="patch"
518 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory" 526 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
527 # Clean out old items
528 rm -f "${EPATCH_SOURCE}"/*
529 # Now link in right patches
519 mysql_mv_patches 530 mysql_mv_patches
531 # And apply
520 epatch 532 epatch
521 533
522 # Additional checks, remove bundled zlib 534 # Additional checks, remove bundled zlib
523 rm -f "${S}/zlib/"*.[ch] 535 rm -f "${S}/zlib/"*.[ch]
524 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" 536 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
819 && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ 831 && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \
820 || touch "${TMPDIR}/fill_help_tables.sql" 832 || touch "${TMPDIR}/fill_help_tables.sql"
821 help_tables="${TMPDIR}/fill_help_tables.sql" 833 help_tables="${TMPDIR}/fill_help_tables.sql"
822 834
823 pushd "${TMPDIR}" &>/dev/null 835 pushd "${TMPDIR}" &>/dev/null
824 "${ROOT}/usr/bin/mysql_install_db" | grep -B5 -A999 -i "ERROR" 836 "${ROOT}/usr/bin/mysql_install_db" >"${TMPDIR}"/mysql_install_db.log 2>&1
837 if [ $? -ne 0 ]; then
838 grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
839 die "Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
840 fi
825 popd &>/dev/null 841 popd &>/dev/null
826 [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ 842 [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
827 || die "MySQL databases not installed" 843 || die "MySQL databases not installed"
828 chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2> /dev/null 844 chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2> /dev/null
829 chmod 0750 "${ROOT}/${MY_DATADIR}" 2> /dev/null 845 chmod 0750 "${ROOT}/${MY_DATADIR}" 2> /dev/null

Legend:
Removed from v.1.84  
changed lines
  Added in v.1.86

  ViewVC Help
Powered by ViewVC 1.1.20