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

Diff of /eclass/mysql.eclass

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

Revision 1.119 Revision 1.127
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.119 2009/12/09 18:45:46 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql.eclass,v 1.127 2010/02/01 01:07:08 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
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
94# @ECLASS-VARIABLE: XTRADB_VER
95# @DESCRIPTION:
96# Version of the XTRADB storage engine
97XTRADB_VER="${XTRADB_VER}"
98
99# @ECLASS-VARIABLE: PERCONA_VER
100# @DESCRIPTION:
101# Designation by PERCONA for a MySQL version to apply an XTRADB release
102PERCONA_VER="${PERCONA_VER}"
103
94# Be warned, *DEPEND are version-dependant 104# Be warned, *DEPEND are version-dependant
95# These are used for both runtime and compiletime 105# These are used for both runtime and compiletime
96DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) 106DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
97 userland_GNU? ( sys-process/procps ) 107 userland_GNU? ( sys-process/procps )
98 >=sys-apps/sed-4 108 >=sys-apps/sed-4
136fi 146fi
137 147
138# Define correct SRC_URIs 148# Define correct SRC_URIs
139SRC_URI="${SERVER_URI}" 149SRC_URI="${SERVER_URI}"
140 150
141[[ ${MY_EXTRAS_VER} != live ]] && SRC_URI="${SRC_URI} 151# Gentoo patches to MySQL
152[[ ${MY_EXTRAS_VER} != live ]] \
153&& SRC_URI="${SRC_URI}
142 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 154 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
143 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"
157
158# PBXT engine
144mysql_version_is_at_least "5.1.12" \ 159mysql_version_is_at_least "5.1.12" \
145&& [[ -n "${PBXT_VERSION}" ]] \ 160&& [[ -n "${PBXT_VERSION}" ]] \
146&& SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )" 161&& PBXT_P="pbxt-${PBXT_VERSION}" \
162&& PBXT_SRC_URI="mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" \
163&& SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )"
164
165# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set
166mysql_version_is_at_least "5.1.26" \
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" \
170&& SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI} )"
147 171
148DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 172DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
149HOMEPAGE="http://www.mysql.com/" 173HOMEPAGE="http://www.mysql.com/"
150LICENSE="GPL-2" 174LICENSE="GPL-2"
151SLOT="0" 175SLOT="0"
165 189
166mysql_version_is_at_least "5.1" \ 190mysql_version_is_at_least "5.1" \
167|| IUSE="${IUSE} berkdb" 191|| IUSE="${IUSE} berkdb"
168 192
169mysql_version_is_at_least "5.1.12" \ 193mysql_version_is_at_least "5.1.12" \
194&& [[ -n "${PBXT_VERSION}" ]] \
170&& IUSE="${IUSE} pbxt" 195&& IUSE="${IUSE} pbxt"
196
197mysql_version_is_at_least "5.1.26" \
198&& [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] \
199&& IUSE="${IUSE} xtradb"
171 200
172[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \ 201[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \
173&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling" 202&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling"
174
175 203
176# 204#
177# HELPER FUNCTIONS: 205# HELPER FUNCTIONS:
178# 206#
179 207
180# @FUNCTION: mysql_disable_test 208# @FUNCTION: mysql_disable_test
181# @DESCRIPTION: 209# @DESCRIPTION:
182# Helper function to disable specific tests. 210# Helper function to disable specific tests.
183mysql_disable_test() { 211mysql_disable_test() {
212 local rawtestname testname testsuite reason mysql_disable_file
184 local testname="${1}" ; shift 213 rawtestname="${1}" ; shift
185 local reason="${@}" 214 reason="${@}"
215 ewarn "test '${rawtestname}' disabled: '${reason}'"
216
217 testsuite="${rawtestname/.*}"
218 testname="${rawtestname/*.}"
186 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}"
187 echo ${testname} : ${reason} >> "${mysql_disable_file}" 221 echo ${testname} : ${reason} >> "${mysql_disable_file}"
188 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
189} 248}
190 249
191# @FUNCTION: mysql_init_vars 250# @FUNCTION: mysql_init_vars
192# @DESCRIPTION: 251# @DESCRIPTION:
193# void mysql_init_vars() 252# void mysql_init_vars()
523 && use minimal ; then 582 && use minimal ; then
524 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 583 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
525 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 584 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
526 fi 585 fi
527 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
528 # This should come after all of the die statements 595 # This should come after all of the die statements
529 enewgroup mysql 60 || die "problem adding 'mysql' group" 596 enewgroup mysql 60 || die "problem adding 'mysql' group"
530 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"
531 598
532 mysql_check_version_range "4.0 to 5.0.99.99" \ 599 mysql_check_version_range "4.0 to 5.0.99.99" \
579 find . -name 'Makefile.am' \ 646 find . -name 'Makefile.am' \
580 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; 647 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
581 648
582 if mysql_version_is_at_least "4.1" ; then 649 if mysql_version_is_at_least "4.1" ; then
583 # 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"
584 find . -name Makefile \ 652 find . -name Makefile \
585 -o -name Makefile.in \ 653 -o -name Makefile.in \
586 -o -name configure \ 654 -o -name configure \
587 -exec rm -f {} \; 655 -exec rm -f {} \;
588 rm -f "ltmain.sh" 656 rm -f "ltmain.sh"
589 rm -f "scripts/mysqlbug" 657 rm -f "scripts/mysqlbug"
590 fi 658 fi
591 659
592 local rebuilddirlist d 660 local rebuilddirlist d
593 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
594 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"
595 rebuilddirlist="." 677 rebuilddirlist="."
596 # TODO: check this with a cmake expert 678 # TODO: check this with a cmake expert
597 cmake \ 679 cmake \
598 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ 680 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
599 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \ 681 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
609 popd &>/dev/null 691 popd &>/dev/null
610 done 692 done
611 693
612 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" \
613 && use berkdb ; then 695 && use berkdb ; then
696 einfo "Fixing up berkdb buildsystem"
614 [[ -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"
615 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" \
616 || die "Could not copy libtool.m4 to bdb/dist/" 699 || die "Could not copy libtool.m4 to bdb/dist/"
617 #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.
618 if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then 701 if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.127

  ViewVC Help
Powered by ViewVC 1.1.20