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

Diff of /eclass/mysql.eclass

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

Revision 1.123 Revision 1.131
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/Attic/mysql.eclass,v 1.123 2009/12/10 01:27:59 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql.eclass,v 1.131 2010/02/02 03:01:31 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>
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
150 150
151# Gentoo patches to MySQL 151# Gentoo patches to MySQL
152[[ ${MY_EXTRAS_VER} != live ]] \ 152[[ ${MY_EXTRAS_VER} != live ]] \
153&& SRC_URI="${SRC_URI} 153&& SRC_URI="${SRC_URI}
154 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 154 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
155 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" 155 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
156 http://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
156 157
157# PBXT engine 158# PBXT engine
158mysql_version_is_at_least "5.1.12" \ 159mysql_version_is_at_least "5.1.12" \
159&& [[ -n "${PBXT_VERSION}" ]] \ 160&& [[ -n "${PBXT_VERSION}" ]] \
160&& PBXT_P="pbxt-${PBXT_VERSION}" \ 161&& PBXT_P="pbxt-${PBXT_VERSION}" \
206 207
207# @FUNCTION: mysql_disable_test 208# @FUNCTION: mysql_disable_test
208# @DESCRIPTION: 209# @DESCRIPTION:
209# Helper function to disable specific tests. 210# Helper function to disable specific tests.
210mysql_disable_test() { 211mysql_disable_test() {
212 local rawtestname testname testsuite reason mysql_disable_file
211 local testname="${1}" ; shift 213 rawtestname="${1}" ; shift
212 local reason="${@}" 214 reason="${@}"
215 ewarn "test '${rawtestname}' disabled: '${reason}'"
216
217 testsuite="${rawtestname/.*}"
218 testname="${rawtestname/*.}"
213 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}"
214 echo ${testname} : ${reason} >> "${mysql_disable_file}" 221 echo ${testname} : ${reason} >> "${mysql_disable_file}"
215 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
216} 248}
217 249
218# @FUNCTION: mysql_init_vars 250# @FUNCTION: mysql_init_vars
219# @DESCRIPTION: 251# @DESCRIPTION:
220# void mysql_init_vars() 252# void mysql_init_vars()
455 # 5.1 introduces a new way to manage storage engines (plugins) 487 # 5.1 introduces a new way to manage storage engines (plugins)
456 # like configuration=none 488 # like configuration=none
457 local plugins="csv,myisam,myisammrg,heap" 489 local plugins="csv,myisam,myisammrg,heap"
458 if use extraengine ; then 490 if use extraengine ; then
459 # like configuration=max-no-ndb, archive and example removed in 5.1.11 491 # like configuration=max-no-ndb, archive and example removed in 5.1.11
492 # not added yet: ibmdb2i
493 # Not supporting as examples: example,daemon_example,ftexample
460 plugins="${plugins},archive,blackhole,example,federated,partition" 494 plugins="${plugins},archive,blackhole,federated,partition"
461 495
462 elog "Before using the Federated storage engine, please be sure to read" 496 elog "Before using the Federated storage engine, please be sure to read"
463 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" 497 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
464 fi 498 fi
465 499
466 # Upstream specifically requests that InnoDB always be built. 500 # Upstream specifically requests that InnoDB always be built:
467 plugins="${plugins},innobase" 501 # - innobase, innodb_plugin
502 # Build falcon if available for 6.x series.
503 for i in innobase innodb_plugin falcon ; do
504 [ -e "${S}"/storage/${i} ] && plugins="${plugins},${i}"
505 done
468 506
469 # like configuration=max-no-ndb 507 # like configuration=max-no-ndb
470 if use cluster ; then 508 if use cluster ; then
471 plugins="${plugins},ndbcluster" 509 plugins="${plugins},ndbcluster"
472 myconf="${myconf} --with-ndb-binlog" 510 myconf="${myconf} --with-ndb-binlog"
473 fi
474
475 if mysql_version_is_at_least "5.2" ; then
476 plugins="${plugins},falcon"
477 fi 511 fi
478 512
479 myconf="${myconf} --with-plugins=${plugins}" 513 myconf="${myconf} --with-plugins=${plugins}"
480} 514}
481 515
548 if mysql_version_is_at_least "4.1.3" \ 582 if mysql_version_is_at_least "4.1.3" \
549 && ( use cluster || use extraengine ) \ 583 && ( use cluster || use extraengine ) \
550 && use minimal ; then 584 && use minimal ; then
551 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 585 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
552 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 586 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
587 fi
588
589 # Bug #290570 fun. Upstream made us need a fairly new GCC4.
590 if mysql_version_is_at_least "5.0.83" ; then
591 GCC_VER=$(gcc-version)
592 case ${GCC_VER} in
593 2*|3*|4.0|4.1|4.2) die "Active GCC too old! Must have at least GCC4.3" ;;
594 esac
553 fi 595 fi
554 596
555 # This should come after all of the die statements 597 # This should come after all of the die statements
556 enewgroup mysql 60 || die "problem adding 'mysql' group" 598 enewgroup mysql 60 || die "problem adding 'mysql' group"
557 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 599 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"

Legend:
Removed from v.1.123  
changed lines
  Added in v.1.131

  ViewVC Help
Powered by ViewVC 1.1.20