| 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.133 2010/02/21 00:18:16 robbat2 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.135 2010/03/03 23:57:13 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> |
| … | |
… | |
| 186 | |
186 | |
| 187 | # PBXT engine |
187 | # PBXT engine |
| 188 | mysql_version_is_at_least "5.1.12" \ |
188 | mysql_version_is_at_least "5.1.12" \ |
| 189 | && [[ -n "${PBXT_VERSION}" ]] \ |
189 | && [[ -n "${PBXT_VERSION}" ]] \ |
| 190 | && PBXT_P="pbxt-${PBXT_VERSION}" \ |
190 | && PBXT_P="pbxt-${PBXT_VERSION}" \ |
| 191 | && PBXT_SRC_URI="mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" \ |
191 | && PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" \ |
| 192 | && SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )" \ |
192 | && SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )" \ |
| 193 | && IUSE="${IUSE} pbxt" |
193 | && IUSE="${IUSE} pbxt" |
| 194 | |
194 | |
| 195 | # Get the percona tarball if XTRADB_VER and PERCONA_VER are both set |
195 | # Get the percona tarball if XTRADB_VER and PERCONA_VER are both set |
| 196 | mysql_version_is_at_least "5.1.26" \ |
196 | mysql_version_is_at_least "5.1.26" \ |
| 197 | && [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] \ |
197 | && [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] \ |
| 198 | && XTRADB_P="percona-xtradb-${XTRADB_VER}" \ |
198 | && XTRADB_P="percona-xtradb-${XTRADB_VER}" \ |
|
|
199 | && XTRADB_SRC_URI_COMMON="${PERCONA_VER}/source/${XTRADB_P}.tar.gz" \ |
|
|
200 | && XTRADB_SRC_URI1="http://www.percona.com/percona-builds/xtradb/${XTRADB_SRC_URI_COMMON}" \ |
| 199 | && XTRADB_SRC_URI="http://www.percona.com/${PN}/xtradb/${PERCONA_VER}/source/${XTRADB_P}.tar.gz" \ |
201 | && XTRADB_SRC_URI2="http://www.percona.com/${PN}/xtradb/${XTRADB_SRC_URI_COMMON}" \ |
| 200 | && SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI} )" \ |
202 | && SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI1} ${XTRADB_SRC_URI2} )" \ |
| 201 | && IUSE="${IUSE} xtradb" |
203 | && IUSE="${IUSE} xtradb" |
| 202 | |
204 | |
| 203 | # |
205 | # |
| 204 | # HELPER FUNCTIONS: |
206 | # HELPER FUNCTIONS: |
| 205 | # |
207 | # |
| … | |
… | |
| 403 | if use ssl ; then |
405 | if use ssl ; then |
| 404 | mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio" |
406 | mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio" |
| 405 | fi |
407 | fi |
| 406 | |
408 | |
| 407 | if mysql_version_is_at_least "5.1.11" ; then |
409 | if mysql_version_is_at_least "5.1.11" ; then |
| 408 | myconf="${myconf} $(use_with ssl)" |
410 | myconf="${myconf} $(use_with ssl /usr)" |
| 409 | else |
411 | else |
| 410 | myconf="${myconf} $(use_with ssl openssl)" |
412 | myconf="${myconf} $(use_with ssl openssl)" |
| 411 | fi |
413 | fi |
| 412 | |
414 | |
| 413 | if mysql_version_is_at_least "5.0.60" ; then |
415 | if mysql_version_is_at_least "5.0.60" ; then |
| … | |
… | |
| 532 | |
534 | |
| 533 | einfo "Reconfiguring dir '${PWD}'" |
535 | einfo "Reconfiguring dir '${PWD}'" |
| 534 | AT_GNUCONF_UPDATE="yes" eautoreconf |
536 | AT_GNUCONF_UPDATE="yes" eautoreconf |
| 535 | |
537 | |
| 536 | local myconf="" |
538 | local myconf="" |
| 537 | myconf="${myconf} --with-mysql=${S} --libdir=${D}/${MY_LIBDIR}" |
539 | myconf="${myconf} --with-mysql=${S} --libdir=${MY_LIBDIR}" |
| 538 | use debug && myconf="${myconf} --with-debug=full" |
540 | use debug && myconf="${myconf} --with-debug=full" |
| 539 | # TODO: is it safe/needed to use econf here ? |
541 | # TODO: is it safe/needed to use econf here ? |
| 540 | ./configure ${myconf} || die "Problem configuring PBXT storage engine" |
542 | ./configure ${myconf} || die "Problem configuring PBXT storage engine" |
| 541 | } |
543 | } |
| 542 | |
544 | |
| … | |
… | |
| 552 | # TODO: modify test suite for PBXT |
554 | # TODO: modify test suite for PBXT |
| 553 | } |
555 | } |
| 554 | |
556 | |
| 555 | pbxt_src_install() { |
557 | pbxt_src_install() { |
| 556 | pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null |
558 | pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null |
| 557 | make install || die "Failed to install PBXT" |
559 | emake install DESTDIR="${D}" || die "Failed to install PBXT" |
| 558 | popd |
560 | popd |
| 559 | } |
561 | } |
| 560 | |
562 | |
| 561 | # |
563 | # |
| 562 | # EBUILD FUNCTIONS |
564 | # EBUILD FUNCTIONS |
| … | |
… | |
| 691 | einfo "Replacing InnoDB with Percona XtraDB" |
693 | einfo "Replacing InnoDB with Percona XtraDB" |
| 692 | pushd "${S}"/storage |
694 | pushd "${S}"/storage |
| 693 | i="innobase" |
695 | i="innobase" |
| 694 | o="${WORKDIR}/storage-${i}.mysql-upstream" |
696 | o="${WORKDIR}/storage-${i}.mysql-upstream" |
| 695 | # Have we been here already? |
697 | # Have we been here already? |
| 696 | [ -h "${i}" ] && rm -f "${i}" |
698 | [ -d "${o}" ] && rm -f "${i}" |
| 697 | # Or maybe we haven't |
699 | # Or maybe we haven't |
| 698 | [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" |
700 | [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" |
| 699 | ln -s "${WORKDIR}/${XTRADB_P}" "${i}" |
701 | cp -ra "${WORKDIR}/${XTRADB_P}" "${i}" |
| 700 | popd |
702 | popd |
| 701 | fi |
703 | fi |
| 702 | |
704 | |
| 703 | if mysql_version_is_at_least "5.1.12" ; then |
705 | if mysql_version_is_at_least "5.1.12" ; then |
| 704 | einfo "Updating innobase cmake" |
|
|
| 705 | rebuilddirlist="." |
706 | rebuilddirlist="." |
|
|
707 | # This does not seem to be needed presently. robbat2 2010/02/23 |
|
|
708 | #einfo "Updating innobase cmake" |
| 706 | # TODO: check this with a cmake expert |
709 | ## TODO: check this with a cmake expert |
| 707 | cmake \ |
710 | #cmake \ |
| 708 | -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ |
711 | # -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ |
| 709 | -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \ |
712 | # -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \ |
| 710 | "storage/innobase" |
713 | # "storage/innobase" |
| 711 | else |
714 | else |
| 712 | rebuilddirlist=". innobase" |
715 | rebuilddirlist=". innobase" |
| 713 | fi |
716 | fi |
| 714 | |
717 | |
| 715 | for d in ${rebuilddirlist} ; do |
718 | for d in ${rebuilddirlist} ; do |
| … | |
… | |
| 914 | for script in \ |
917 | for script in \ |
| 915 | "${S}"/support-files/my-*.cnf \ |
918 | "${S}"/support-files/my-*.cnf \ |
| 916 | "${S}"/support-files/magic \ |
919 | "${S}"/support-files/magic \ |
| 917 | "${S}"/support-files/ndb-config-2-node.ini |
920 | "${S}"/support-files/ndb-config-2-node.ini |
| 918 | do |
921 | do |
| 919 | dodoc "${script}" |
922 | [[ -f "$script" ]] && dodoc "${script}" |
| 920 | done |
923 | done |
| 921 | |
924 | |
| 922 | docinto "scripts" |
925 | docinto "scripts" |
| 923 | for script in "${S}"/scripts/mysql* ; do |
926 | for script in "${S}"/scripts/mysql* ; do |
| 924 | [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" |
927 | [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" |
| 925 | done |
928 | done |
| 926 | |
929 | |
| 927 | fi |
930 | fi |
| 928 | |
931 | |
| 929 | mysql_lib_symlinks "${D}" |
932 | mysql_lib_symlinks "${D}" |