/[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.128
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.128 2010/02/01 19:16:06 hanno 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>
16# phase hooks. 16# phase hooks.
17 17
18WANT_AUTOCONF="latest" 18WANT_AUTOCONF="latest"
19WANT_AUTOMAKE="latest" 19WANT_AUTOMAKE="latest"
20 20
21inherit eutils flag-o-matic gnuconfig autotools mysql_fx versionator 21inherit eutils flag-o-matic gnuconfig autotools mysql_fx versionator toolchain-funcs
22
23# Shorten the path because the socket path length must be shorter than 107 chars
24# and we will run a mysql server during test phase
25S="${WORKDIR}/mysql"
26
27[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
28if [[ "${MY_EXTRAS_VER}" == "live" ]]; then
29 EGIT_PROJECT=mysql-extras
30 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
31 inherit git
32fi
22 33
23case "${EAPI:-0}" in 34case "${EAPI:-0}" in
24 2) 35 2)
25 EXPORT_FUNCTIONS pkg_setup \ 36 EXPORT_FUNCTIONS pkg_setup \
26 src_unpack src_prepare \ 37 src_unpack src_prepare \
40 ;; 51 ;;
41 *) 52 *)
42 die "Unsupported EAPI: ${EAPI}" ;; 53 die "Unsupported EAPI: ${EAPI}" ;;
43esac 54esac
44 55
45# Shorten the path because the socket path length must be shorter than 107 chars
46# and we will run a mysql server during test phase
47S="${WORKDIR}/mysql"
48
49[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
50if [[ "${MY_EXTRAS_VER}" == "live" ]]; then
51 EGIT_PROJECT=mysql-extras
52 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
53 inherit git
54fi
55
56# @ECLASS-VARIABLE: MYSQL_VERSION_ID 56# @ECLASS-VARIABLE: MYSQL_VERSION_ID
57# @DESCRIPTION: 57# @DESCRIPTION:
58# MYSQL_VERSION_ID will be: 58# MYSQL_VERSION_ID will be:
59# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99] 59# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
60# This is an important part, because many of the choices the MySQL ebuild will do 60# This is an important part, because many of the choices the MySQL ebuild will do
83 MYSQL_COMMUNITY_FEATURES=1 83 MYSQL_COMMUNITY_FEATURES=1
84elif [ "${PV#5.0}" != "${PV}" ] && mysql_version_is_at_least "5.0.82"; then 84elif [ "${PV#5.0}" != "${PV}" ] && mysql_version_is_at_least "5.0.82"; then
85 MYSQL_COMMUNITY_FEATURES=1 85 MYSQL_COMMUNITY_FEATURES=1
86elif [ "${PV#5.1}" != "${PV}" ] && mysql_version_is_at_least "5.1.28"; then 86elif [ "${PV#5.1}" != "${PV}" ] && mysql_version_is_at_least "5.1.28"; then
87 MYSQL_COMMUNITY_FEATURES=1 87 MYSQL_COMMUNITY_FEATURES=1
88elif [ "${PV#5.4}" != "${PV}" ]; then 88elif [ "${PV#5.4}" != "${PV}" ] || [ "${PV#5.4}" != "${PV}" ]; then
89 MYSQL_COMMUNITY_FEATURES=1 89 MYSQL_COMMUNITY_FEATURES=1
90else 90else
91 MYSQL_COMMUNITY_FEATURES=0 91 MYSQL_COMMUNITY_FEATURES=0
92fi 92fi
93 93
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
198 207
199# @FUNCTION: mysql_disable_test 208# @FUNCTION: mysql_disable_test
200# @DESCRIPTION: 209# @DESCRIPTION:
201# Helper function to disable specific tests. 210# Helper function to disable specific tests.
202mysql_disable_test() { 211mysql_disable_test() {
212 local rawtestname testname testsuite reason mysql_disable_file
203 local testname="${1}" ; shift 213 rawtestname="${1}" ; shift
204 local reason="${@}" 214 reason="${@}"
215 ewarn "test '${rawtestname}' disabled: '${reason}'"
216
217 testsuite="${rawtestname/.*}"
218 testname="${rawtestname/*.}"
205 local mysql_disable_file="${S}/mysql-test/t/disabled.def" 219 mysql_disable_file="${S}/mysql-test/t/disabled.def"
220 einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
206 echo ${testname} : ${reason} >> "${mysql_disable_file}" 221 echo ${testname} : ${reason} >> "${mysql_disable_file}"
207 ewarn "test '${testname}' disabled: '${reason}'" 222
223 # ${S}/mysql-tests/t/disabled.def
224 #
225 # ${S}/mysql-tests/suite/federated/disabled.def
226 #
227 # ${S}/mysql-tests/suite/jp/t/disabled.def
228 # ${S}/mysql-tests/suite/ndb/t/disabled.def
229 # ${S}/mysql-tests/suite/rpl/t/disabled.def
230 # ${S}/mysql-tests/suite/parts/t/disabled.def
231 # ${S}/mysql-tests/suite/rpl_ndb/t/disabled.def
232 # ${S}/mysql-tests/suite/ndb_team/t/disabled.def
233 # ${S}/mysql-tests/suite/binlog/t/disabled.def
234 # ${S}/mysql-tests/suite/innodb/t/disabled.def
235 if [ -n "${testsuite}" ]; then
236 for mysql_disable_file in \
237 ${S}/mysql-test/suite/${testsuite}/disabled.def \
238 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
239 FAILED ; do
240 [ -f "${mysql_disable_file}" ] && break
241 done
242 if [ "${mysql_disabled_file}" != "FAILED" ]; then
243 echo "${testname} : ${reason}" >> "${mysql_disable_file}"
244 else
245 ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
246 fi
247 fi
208} 248}
209 249
210# @FUNCTION: mysql_init_vars 250# @FUNCTION: mysql_init_vars
211# @DESCRIPTION: 251# @DESCRIPTION:
212# void mysql_init_vars() 252# void mysql_init_vars()
462 if use cluster ; then 502 if use cluster ; then
463 plugins="${plugins},ndbcluster" 503 plugins="${plugins},ndbcluster"
464 myconf="${myconf} --with-ndb-binlog" 504 myconf="${myconf} --with-ndb-binlog"
465 fi 505 fi
466 506
467 if mysql_version_is_at_least "5.2" ; then 507 if [ -e "${S}/storage/falcon" ] ; then
468 plugins="${plugins},falcon" 508 plugins="${plugins},falcon"
469 fi 509 fi
470 510
471 myconf="${myconf} --with-plugins=${plugins}" 511 myconf="${myconf} --with-plugins=${plugins}"
472} 512}
542 && use minimal ; then 582 && use minimal ; then
543 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 583 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
544 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 584 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
545 fi 585 fi
546 586
587 # Bug #290570 fun. Upstream made us need a fairly new GCC4.
588 if mysql_version_is_at_least "5.0.83" ; then
589 GCC_VER=$(gcc-version)
590 case ${GCC_VER} in
591 2*|3*|4.0|4.1|4.2) die "Active GCC too old! Must have at least GCC4.3" ;;
592 esac
593 fi
594
547 # This should come after all of the die statements 595 # This should come after all of the die statements
548 enewgroup mysql 60 || die "problem adding 'mysql' group" 596 enewgroup mysql 60 || die "problem adding 'mysql' group"
549 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 597 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
550 598
551 mysql_check_version_range "4.0 to 5.0.99.99" \ 599 mysql_check_version_range "4.0 to 5.0.99.99" \
598 find . -name 'Makefile.am' \ 646 find . -name 'Makefile.am' \
599 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; 647 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
600 648
601 if mysql_version_is_at_least "4.1" ; then 649 if mysql_version_is_at_least "4.1" ; then
602 # Remove what needs to be recreated, so we're sure it's actually done 650 # Remove what needs to be recreated, so we're sure it's actually done
651 einfo "Cleaning up old buildscript files"
603 find . -name Makefile \ 652 find . -name Makefile \
604 -o -name Makefile.in \ 653 -o -name Makefile.in \
605 -o -name configure \ 654 -o -name configure \
606 -exec rm -f {} \; 655 -exec rm -f {} \;
607 rm -f "ltmain.sh" 656 rm -f "ltmain.sh"
608 rm -f "scripts/mysqlbug" 657 rm -f "scripts/mysqlbug"
609 fi 658 fi
610 659
611 local rebuilddirlist d 660 local rebuilddirlist d
612 661
662 if mysql_version_is_at_least "5.1.26" && use xtradb ; then
663 einfo "Replacing InnoDB with Percona XtraDB"
664 pushd "${S}"/storage
665 i="innobase"
666 o="${WORKDIR}/storage-${i}.mysql-upstream"
667 # Have we been here already?
668 [ -h "${i}" ] && rm -f "${i}"
669 # Or maybe we haven't
670 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
671 ln -s "${WORKDIR}/${XTRADB_P}" "${i}"
672 popd
673 fi
674
613 if mysql_version_is_at_least "5.1.12" ; then 675 if mysql_version_is_at_least "5.1.12" ; then
676 einfo "Updating innobase cmake"
614 rebuilddirlist="." 677 rebuilddirlist="."
615 # TODO: check this with a cmake expert 678 # TODO: check this with a cmake expert
616 cmake \ 679 cmake \
617 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ 680 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
618 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \ 681 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
628 popd &>/dev/null 691 popd &>/dev/null
629 done 692 done
630 693
631 if mysql_check_version_range "4.1 to 5.0.99.99" \ 694 if mysql_check_version_range "4.1 to 5.0.99.99" \
632 && use berkdb ; then 695 && use berkdb ; then
696 einfo "Fixing up berkdb buildsystem"
633 [[ -w "bdb/dist/ltmain.sh" ]] && cp -f "ltmain.sh" "bdb/dist/ltmain.sh" 697 [[ -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" \ 698 cp -f "/usr/share/aclocal/libtool.m4" "bdb/dist/aclocal/libtool.ac" \
635 || die "Could not copy libtool.m4 to bdb/dist/" 699 || die "Could not copy libtool.m4 to bdb/dist/"
636 #These files exist only with libtool-2*, and need to be included. 700 #These files exist only with libtool-2*, and need to be included.
637 if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then 701 if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then

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

  ViewVC Help
Powered by ViewVC 1.1.20