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

Diff of /eclass/mysql.eclass

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

Revision 1.148 Revision 1.149
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.148 2010/08/09 19:29:49 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.149 2010/08/20 23:52:51 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>
59# Upstream MySQL considers the first two parts of the version number to be the 59# Upstream MySQL considers the first two parts of the version number to be the
60# major version. Upgrades that change major version should always run 60# major version. Upgrades that change major version should always run
61# mysql_upgrade. 61# mysql_upgrade.
62MYSQL_PV_MAJOR="$(get_version_component_range 1-2 ${PV})" 62MYSQL_PV_MAJOR="$(get_version_component_range 1-2 ${PV})"
63 63
64# Cluster is a special case...
65if [[ "${PN}" == "mysql-cluster" ]]; then
66 case $PV in
67 6.1*|7.0*|7.1*) MYSQL_PV_MAJOR=5.1 ;;
68 esac
69fi
70
71
64# @ECLASS-VARIABLE: MYSQL_VERSION_ID 72# @ECLASS-VARIABLE: MYSQL_VERSION_ID
65# @DESCRIPTION: 73# @DESCRIPTION:
66# MYSQL_VERSION_ID will be: 74# MYSQL_VERSION_ID will be:
67# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99] 75# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
68# This is an important part, because many of the choices the MySQL ebuild will do 76# This is an important part, because many of the choices the MySQL ebuild will do
95 MYSQL_COMMUNITY_FEATURES=1 103 MYSQL_COMMUNITY_FEATURES=1
96elif [ "${PV#5.4}" != "${PV}" ] ; then 104elif [ "${PV#5.4}" != "${PV}" ] ; then
97 MYSQL_COMMUNITY_FEATURES=1 105 MYSQL_COMMUNITY_FEATURES=1
98elif [ "${PV#5.5}" != "${PV}" ] ; then 106elif [ "${PV#5.5}" != "${PV}" ] ; then
99 MYSQL_COMMUNITY_FEATURES=1 107 MYSQL_COMMUNITY_FEATURES=1
100elif [ "${PV#6.0}" != "${PV}" ] ; then 108elif [ "${PV#6}" != "${PV}" ] ; then
109 MYSQL_COMMUNITY_FEATURES=1
110elif [ "${PV#7}" != "${PV}" ] ; then
101 MYSQL_COMMUNITY_FEATURES=1 111 MYSQL_COMMUNITY_FEATURES=1
102else 112else
103 MYSQL_COMMUNITY_FEATURES=0 113 MYSQL_COMMUNITY_FEATURES=0
104fi 114fi
105 115
124 134
125[[ "${PN}" == "mariadb" ]] \ 135[[ "${PN}" == "mariadb" ]] \
126&& DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )" 136&& DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )"
127 137
128# Having different flavours at the same time is not a good idea 138# Having different flavours at the same time is not a good idea
129for i in "mysql" "mysql-community" "mariadb" ; do 139for i in "mysql" "mysql-community" "mysql-cluster" "mariadb" ; do
130 [[ "${i}" == ${PN} ]] || 140 [[ "${i}" == ${PN} ]] ||
131 DEPEND="${DEPEND} !dev-db/${i}" 141 DEPEND="${DEPEND} !dev-db/${i}"
132done 142done
133 143
134RDEPEND="${DEPEND} 144RDEPEND="${DEPEND}
158 SERVER_URI=" 168 SERVER_URI="
159 http://ftp.rediris.es/mirror/MariaDB/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz 169 http://ftp.rediris.es/mirror/MariaDB/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
160 http://maria.llarian.net/download/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz 170 http://maria.llarian.net/download/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
161 http://launchpad.net/maria/${MYSQL_PV_MAJOR}/ongoing/+download/${MARIA_FULL_P}.tar.gz 171 http://launchpad.net/maria/${MYSQL_PV_MAJOR}/ongoing/+download/${MARIA_FULL_P}.tar.gz
162 " 172 "
163 # The community build is on the mirrors 173 # The community and cluster builds are on the mirrors
164 elif [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then 174 elif [[ "${MYSQL_COMMUNITY_FEATURES}" == "1" || ${PN} == "mysql-cluster" ]] ; then
165 if [[ "${PN}" == "mysql-cluster" ]] ; then 175 if [[ "${PN}" == "mysql-cluster" ]] ; then
166 URI_DIR="MySQL-Cluster" 176 URI_DIR="MySQL-Cluster"
167 URI_FILE="mysql-cluster-gpl" 177 URI_FILE="mysql-cluster-gpl"
168 else 178 else
169 URI_DIR="MySQL" 179 URI_DIR="MySQL"
204IUSE="big-tables debug embedded minimal ${IUSE_DEFAULT_ON}perl selinux ssl static test" 214IUSE="big-tables debug embedded minimal ${IUSE_DEFAULT_ON}perl selinux ssl static test"
205 215
206mysql_version_is_at_least "4.1" \ 216mysql_version_is_at_least "4.1" \
207&& IUSE="${IUSE} latin1" 217&& IUSE="${IUSE} latin1"
208 218
209mysql_version_is_at_least "4.1.3" \ 219if mysql_version_is_at_least "4.1.3" ; then
210&& IUSE="${IUSE} cluster extraengine" 220 IUSE="${IUSE} extraengine"
221 if [[ "${PN}" != "mysql-cluster" ]] ; then
222 IUSE="${IUSE} cluster"
223 fi
224fi
211 225
212mysql_version_is_at_least "5.0" \ 226mysql_version_is_at_least "5.0" \
213|| IUSE="${IUSE} raid" 227|| IUSE="${IUSE} raid"
214 228
215mysql_version_is_at_least "5.0.18" \ 229mysql_version_is_at_least "5.0.18" \
436 if use debug ; then 450 if use debug ; then
437 myconf="${myconf} --with-debug=full" 451 myconf="${myconf} --with-debug=full"
438 else 452 else
439 myconf="${myconf} --without-debug" 453 myconf="${myconf} --without-debug"
440 mysql_version_is_at_least "4.1.3" \ 454 mysql_version_is_at_least "4.1.3" \
441 && use cluster \ 455 && ( use cluster || [[ "${PN}" == "mysql-cluster" ]] ) \
442 && myconf="${myconf} --without-ndb-debug" 456 && myconf="${myconf} --without-ndb-debug"
443 fi 457 fi
444 458
445 if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then 459 if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then
446 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" 460 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
503 myconf="${myconf} --without-berkeley-db" 517 myconf="${myconf} --without-berkeley-db"
504 fi 518 fi
505 519
506 if mysql_version_is_at_least "4.1.3" ; then 520 if mysql_version_is_at_least "4.1.3" ; then
507 myconf="${myconf} --with-geometry" 521 myconf="${myconf} --with-geometry"
522 if [[ "${PN}" != "mysql-cluster" ]] ; then
508 myconf="${myconf} $(use_with cluster ndbcluster)" 523 myconf="${myconf} $(use_with cluster ndbcluster)"
524 fi
509 fi 525 fi
510 526
511 if mysql_version_is_at_least "4.1.3" && use extraengine ; then 527 if mysql_version_is_at_least "4.1.3" && use extraengine ; then
512 # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html 528 # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html
513 myconf="${myconf} --with-archive-storage-engine" 529 myconf="${myconf} --with-archive-storage-engine"
624 for i in innodb_plugin ; do 640 for i in innodb_plugin ; do
625 [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}" 641 [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}"
626 done 642 done
627 643
628 # like configuration=max-no-ndb 644 # like configuration=max-no-ndb
629 if use cluster ; then 645 if ( use cluster || [[ "${PN}" == "mysql-cluster" ]] ) ; then
630 plugins_sta="${plugins_sta} ndbcluster partition" 646 plugins_sta="${plugins_sta} ndbcluster partition"
631 plugins_dis="${plugins_dis//partition}" 647 plugins_dis="${plugins_dis//partition}"
632 myconf="${myconf} --with-ndb-binlog" 648 myconf="${myconf} --with-ndb-binlog"
633 else 649 else
634 plugins_dis="${plugins_dis} ndbcluster" 650 plugins_dis="${plugins_dis} ndbcluster"
822 838
823 # last -fPIC fixup, per bug #305873 839 # last -fPIC fixup, per bug #305873
824 i="${S}"/storage/innodb_plugin/plug.in 840 i="${S}"/storage/innodb_plugin/plug.in
825 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" 841 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
826 842
827 # Additional checks, remove bundled zlib 843 # Additional checks, remove bundled zlib (Cluster needs this, for static
844 # memory management in zlib, leave available for Cluster)
845 if [[ "${PN}" != "mysql-cluster" ]] ; then
828 rm -f "${S}/zlib/"*.[ch] 846 rm -f "${S}/zlib/"*.[ch]
829 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" 847 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
848 fi
830 rm -f "scripts/mysqlbug" 849 rm -f "scripts/mysqlbug"
831 850
832 # Make charsets install in the right place 851 # Make charsets install in the right place
833 find . -name 'Makefile.am' \ 852 find . -name 'Makefile.am' \
834 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; 853 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
1280 # Figure out which options we need to disable to do the setup 1299 # Figure out which options we need to disable to do the setup
1281 helpfile="${TMPDIR}/mysqld-help" 1300 helpfile="${TMPDIR}/mysqld-help"
1282 ${ROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null 1301 ${ROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
1283 for opt in grant-tables host-cache name-resolve networking slave-start bdb \ 1302 for opt in grant-tables host-cache name-resolve networking slave-start bdb \
1284 federated innodb ssl log-bin relay-log slow-query-log external-locking \ 1303 federated innodb ssl log-bin relay-log slow-query-log external-locking \
1304 ndbcluster \
1285 ; do 1305 ; do
1286 optexp="--(skip-)?${opt}" optfull="--skip-${opt}" 1306 optexp="--(skip-)?${opt}" optfull="--skip-${opt}"
1287 egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" 1307 egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
1288 done 1308 done
1289 # But some options changed names 1309 # But some options changed names

Legend:
Removed from v.1.148  
changed lines
  Added in v.1.149

  ViewVC Help
Powered by ViewVC 1.1.20