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

Diff of /eclass/mysql.eclass

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

Revision 1.120 Revision 1.125
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.120 2009/12/09 18:46:53 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.125 2010/01/31 05:00:43 robbat2 Exp $
4 4
5# @ECLASS: mysql.eclass 5# @ECLASS: mysql.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 7# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
8# Maintainers: MySQL Team <mysql-bugs@gentoo.org> 8# Maintainers: MySQL Team <mysql-bugs@gentoo.org>
146fi 146fi
147 147
148# Define correct SRC_URIs 148# Define correct SRC_URIs
149SRC_URI="${SERVER_URI}" 149SRC_URI="${SERVER_URI}"
150 150
151[[ ${MY_EXTRAS_VER} != live ]] && SRC_URI="${SRC_URI} 151# Gentoo patches to MySQL
152[[ ${MY_EXTRAS_VER} != live ]] \
153&& SRC_URI="${SRC_URI}
152 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 154 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
153 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" 155 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
154PBXT_SRC_URI="mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz" 156 http://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
157
158# PBXT engine
155mysql_version_is_at_least "5.1.12" \ 159mysql_version_is_at_least "5.1.12" \
156&& [[ -n "${PBXT_VERSION}" ]] \ 160&& [[ -n "${PBXT_VERSION}" ]] \
161&& PBXT_P="pbxt-${PBXT_VERSION}" \
162&& PBXT_SRC_URI="mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" \
157&& SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URIPBXT_SRC_URI} )" 163&& SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )"
158 164
159# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set 165# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set
160XTRADB_SRC_URI="http://www.percona.com/${PN}/xtradb/${PERCONA_VER}/source/percona-xtradb-${XTRADB_VER}.tar.gz"
161mysql_version_is_at_least "5.1.26" \ 166mysql_version_is_at_least "5.1.26" \
162&& [[ -n ${XTRADB_VER} && -n ${PERCONA_VER} ]] \ 167&& [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] \
168&& XTRADB_P="percona-xtradb-${XTRADB_VER}" \
169&& XTRADB_SRC_URI="http://www.percona.com/${PN}/xtradb/${PERCONA_VER}/source/${XTRADB_P}.tar.gz" \
163&& SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI} )" 170&& SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI} )"
164 171
165DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 172DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
166HOMEPAGE="http://www.mysql.com/" 173HOMEPAGE="http://www.mysql.com/"
167LICENSE="GPL-2" 174LICENSE="GPL-2"
182 189
183mysql_version_is_at_least "5.1" \ 190mysql_version_is_at_least "5.1" \
184|| IUSE="${IUSE} berkdb" 191|| IUSE="${IUSE} berkdb"
185 192
186mysql_version_is_at_least "5.1.12" \ 193mysql_version_is_at_least "5.1.12" \
194&& [[ -n "${PBXT_VERSION}" ]] \
187&& IUSE="${IUSE} pbxt" 195&& IUSE="${IUSE} pbxt"
188 196
189mysql_version_is_at_least "5.1.26" \ 197mysql_version_is_at_least "5.1.26" \
198&& [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] \
190&& IUSE="${IUSE} xtradb" 199&& IUSE="${IUSE} xtradb"
191 200
192[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \ 201[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \
193&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling" 202&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling"
194 203
542 && use minimal ; then 551 && use minimal ; then
543 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 552 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
544 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 553 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
545 fi 554 fi
546 555
556 # Bug #290570 fun. Upstream made us need a fairly new GCC4.
557 if mysql_version_is_at_least "5.0.83" ; then
558 GCC_VER=$(gcc_version)
559 case ${GCC_VER} in
560 2*|3*|4.0|4.1|4.2) die "Active GCC too old! Must have at least GCC4.3" ;;
561 esac
562 fi
563
547 # This should come after all of the die statements 564 # This should come after all of the die statements
548 enewgroup mysql 60 || die "problem adding 'mysql' group" 565 enewgroup mysql 60 || die "problem adding 'mysql' group"
549 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 566 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
550 567
551 mysql_check_version_range "4.0 to 5.0.99.99" \ 568 mysql_check_version_range "4.0 to 5.0.99.99" \
598 find . -name 'Makefile.am' \ 615 find . -name 'Makefile.am' \
599 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; 616 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
600 617
601 if mysql_version_is_at_least "4.1" ; then 618 if mysql_version_is_at_least "4.1" ; then
602 # Remove what needs to be recreated, so we're sure it's actually done 619 # Remove what needs to be recreated, so we're sure it's actually done
620 einfo "Cleaning up old buildscript files"
603 find . -name Makefile \ 621 find . -name Makefile \
604 -o -name Makefile.in \ 622 -o -name Makefile.in \
605 -o -name configure \ 623 -o -name configure \
606 -exec rm -f {} \; 624 -exec rm -f {} \;
607 rm -f "ltmain.sh" 625 rm -f "ltmain.sh"
608 rm -f "scripts/mysqlbug" 626 rm -f "scripts/mysqlbug"
609 fi 627 fi
610 628
611 local rebuilddirlist d 629 local rebuilddirlist d
612 630
631 if mysql_version_is_at_least "5.1.26" && use xtradb ; then
632 einfo "Replacing InnoDB with Percona XtraDB"
633 pushd "${S}"/storage
634 i="innobase"
635 o="${WORKDIR}/storage-${i}.mysql-upstream"
636 # Have we been here already?
637 [ -h "${i}" ] && rm -f "${i}"
638 # Or maybe we haven't
639 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
640 ln -s "${WORKDIR}/${XTRADB_P}" "${i}"
641 popd
642 fi
643
613 if mysql_version_is_at_least "5.1.12" ; then 644 if mysql_version_is_at_least "5.1.12" ; then
645 einfo "Updating innobase cmake"
614 rebuilddirlist="." 646 rebuilddirlist="."
615 # TODO: check this with a cmake expert 647 # TODO: check this with a cmake expert
616 cmake \ 648 cmake \
617 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ 649 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
618 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \ 650 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
628 popd &>/dev/null 660 popd &>/dev/null
629 done 661 done
630 662
631 if mysql_check_version_range "4.1 to 5.0.99.99" \ 663 if mysql_check_version_range "4.1 to 5.0.99.99" \
632 && use berkdb ; then 664 && use berkdb ; then
665 einfo "Fixing up berkdb buildsystem"
633 [[ -w "bdb/dist/ltmain.sh" ]] && cp -f "ltmain.sh" "bdb/dist/ltmain.sh" 666 [[ -w "bdb/dist/ltmain.sh" ]] && cp -f "ltmain.sh" "bdb/dist/ltmain.sh"
634 cp -f "/usr/share/aclocal/libtool.m4" "bdb/dist/aclocal/libtool.ac" \ 667 cp -f "/usr/share/aclocal/libtool.m4" "bdb/dist/aclocal/libtool.ac" \
635 || die "Could not copy libtool.m4 to bdb/dist/" 668 || die "Could not copy libtool.m4 to bdb/dist/"
636 #These files exist only with libtool-2*, and need to be included. 669 #These files exist only with libtool-2*, and need to be included.
637 if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then 670 if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.125

  ViewVC Help
Powered by ViewVC 1.1.20