/[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.87
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.87 2008/03/09 21:19:14 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_PROJECT=mysql-extras
22 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
23 inherit git
24fi
21 25
22if [[ ${PR#r} -lt 60 ]] ; then 26if [[ ${PR#r} -lt 60 ]] ; then
23 IS_BITKEEPER=0 27 IS_BITKEEPER=0
24elif [[ ${PR#r} -lt 90 ]] ; then 28elif [[ ${PR#r} -lt 90 ]] ; then
25 IS_BITKEEPER=60 29 IS_BITKEEPER=60
79 SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz" 83 SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz"
80 fi 84 fi
81fi 85fi
82 86
83# Define correct SRC_URIs 87# Define correct SRC_URIs
84SRC_URI="${SERVER_URI} 88SRC_URI="${SERVER_URI}"
89
90[[ ${MY_EXTRAS_VER} != live ]] && SRC_URI="${SRC_URI}
85 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 91 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
86 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" 92 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
87mysql_version_is_at_least "5.1.12" \ 93mysql_version_is_at_least "5.1.12" \
88&& [[ -n "${PBXT_VERSION}" ]] \ 94&& [[ -n "${PBXT_VERSION}" ]] \
89&& SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )" 95&& SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )"
495mysql_src_unpack() { 501mysql_src_unpack() {
496 # Initialize the proper variables first 502 # Initialize the proper variables first
497 mysql_init_vars 503 mysql_init_vars
498 504
499 unpack ${A} 505 unpack ${A}
506 # Grab the patches
507 [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack
508 # Bitkeeper checkout support
500 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then 509 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then
501 if mysql_check_version_range "5.1 to 5.1.99" ; then 510 if mysql_check_version_range "5.1 to 5.1.99" ; then
502 bitkeeper_fetch "mysql-5.1-ndb" 511 bitkeeper_fetch "mysql-5.1-ndb"
503 elif mysql_check_version_range "5.2 to 5.2.99" ; then 512 elif mysql_check_version_range "5.2 to 5.2.99" ; then
504 bitkeeper_fetch "mysql-5.2-falcon" 513 bitkeeper_fetch "mysql-5.2-falcon"
514 fi 523 fi
515 524
516 # Apply the patches for this MySQL version 525 # Apply the patches for this MySQL version
517 EPATCH_SUFFIX="patch" 526 EPATCH_SUFFIX="patch"
518 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory" 527 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
528 # Clean out old items
529 rm -f "${EPATCH_SOURCE}"/*
530 # Now link in right patches
519 mysql_mv_patches 531 mysql_mv_patches
532 # And apply
520 epatch 533 epatch
521 534
522 # Additional checks, remove bundled zlib 535 # Additional checks, remove bundled zlib
523 rm -f "${S}/zlib/"*.[ch] 536 rm -f "${S}/zlib/"*.[ch]
524 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" 537 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
819 && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ 832 && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \
820 || touch "${TMPDIR}/fill_help_tables.sql" 833 || touch "${TMPDIR}/fill_help_tables.sql"
821 help_tables="${TMPDIR}/fill_help_tables.sql" 834 help_tables="${TMPDIR}/fill_help_tables.sql"
822 835
823 pushd "${TMPDIR}" &>/dev/null 836 pushd "${TMPDIR}" &>/dev/null
824 "${ROOT}/usr/bin/mysql_install_db" | grep -B5 -A999 -i "ERROR" 837 "${ROOT}/usr/bin/mysql_install_db" >"${TMPDIR}"/mysql_install_db.log 2>&1
838 if [ $? -ne 0 ]; then
839 grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
840 die "Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
841 fi
825 popd &>/dev/null 842 popd &>/dev/null
826 [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ 843 [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
827 || die "MySQL databases not installed" 844 || die "MySQL databases not installed"
828 chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2> /dev/null 845 chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2> /dev/null
829 chmod 0750 "${ROOT}/${MY_DATADIR}" 2> /dev/null 846 chmod 0750 "${ROOT}/${MY_DATADIR}" 2> /dev/null

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

  ViewVC Help
Powered by ViewVC 1.1.20