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

Diff of /eclass/mysql.eclass

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

Revision 1.151 Revision 1.152
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.151 2010/09/06 08:02:08 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.152 2010/10/06 00:13:11 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>
164 [ -z "${MY_PV}" ] && MY_PV="${PV//_/-}" 164 [ -z "${MY_PV}" ] && MY_PV="${PV//_/-}"
165 if [ "${PN}" == "mariadb" ]; then 165 if [ "${PN}" == "mariadb" ]; then
166 MARIA_FULL_PV="$(replace_version_separator 3 '-' ${PV})" 166 MARIA_FULL_PV="$(replace_version_separator 3 '-' ${PV})"
167 MARIA_FULL_P="${PN}-${MARIA_FULL_PV}" 167 MARIA_FULL_P="${PN}-${MARIA_FULL_PV}"
168 SERVER_URI=" 168 SERVER_URI="
169 http://ftp.osuosl.org/pub/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 170 http://ftp.rediris.es/mirror/MariaDB/${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 171 http://maria.llarian.net/download/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
171 http://launchpad.net/maria/${MYSQL_PV_MAJOR}/ongoing/+download/${MARIA_FULL_P}.tar.gz 172 http://launchpad.net/maria/${MYSQL_PV_MAJOR}/ongoing/+download/${MARIA_FULL_P}.tar.gz
173 http://mirrors.fe.up.pt/pub/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
174 http://ftp-stud.hs-esslingen.de/pub/Mirrors/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
172 " 175 "
173 # The community and cluster builds are on the mirrors 176 # The community and cluster builds are on the mirrors
174 elif [[ "${MYSQL_COMMUNITY_FEATURES}" == "1" || ${PN} == "mysql-cluster" ]] ; then 177 elif [[ "${MYSQL_COMMUNITY_FEATURES}" == "1" || ${PN} == "mysql-cluster" ]] ; then
175 if [[ "${PN}" == "mysql-cluster" ]] ; then 178 if [[ "${PN}" == "mysql-cluster" ]] ; then
176 URI_DIR="MySQL-Cluster" 179 URI_DIR="MySQL-Cluster"
298mysql_disable_test() { 301mysql_disable_test() {
299 local rawtestname testname testsuite reason mysql_disable_file 302 local rawtestname testname testsuite reason mysql_disable_file
300 rawtestname="${1}" ; shift 303 rawtestname="${1}" ; shift
301 reason="${@}" 304 reason="${@}"
302 ewarn "test '${rawtestname}' disabled: '${reason}'" 305 ewarn "test '${rawtestname}' disabled: '${reason}'"
303 306
304 testsuite="${rawtestname/.*}" 307 testsuite="${rawtestname/.*}"
305 testname="${rawtestname/*.}" 308 testname="${rawtestname/*.}"
306 mysql_disable_file="${S}/mysql-test/t/disabled.def" 309 mysql_disable_file="${S}/mysql-test/t/disabled.def"
307 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" 310 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
308 echo ${testname} : ${reason} >> "${mysql_disable_file}" 311 echo ${testname} : ${reason} >> "${mysql_disable_file}"
651 fi 654 fi
652 655
653 if [[ "${PN}" == "mariadb" ]] ; then 656 if [[ "${PN}" == "mariadb" ]] ; then
654 # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not 657 # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
655 # caught above. 658 # caught above.
656 plugins_sta="${plugins_sta} maria innobase" 659 plugins_sta="${plugins_sta} maria"
660
661 [ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] ||
662 die "The ${P} package doesn't provide innobase nor xtradb"
663
664 for i in innobase xtradb ; do
665 [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
666 done
667
657 myconf="${myconf} $(use_with libevent)" 668 myconf="${myconf} $(use_with libevent)"
658 # This is not optional, without it several upstream testcases fail. 669 # This is not optional, without it several upstream testcases fail.
659 # Also strongly recommended by upstream. 670 # Also strongly recommended by upstream.
660 myconf="${myconf} --with-maria-tmp-tables" 671 myconf="${myconf} --with-maria-tmp-tables"
661 fi 672 fi
662 673
663 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then 674 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
664 use pbxt \ 675 use pbxt \
665 && plugins_dyn="${plugins_dyn} pbxt" \ 676 && plugins_dyn="${plugins_dyn} pbxt" \
666 || plugins_dis="${plugins_dis} pbxt" 677 || plugins_dis="${plugins_dis} pbxt"
667 fi 678 fi
668 679
669 use static && \ 680 use static && \
670 plugins_sta="${plugins_sta} ${plugins_dyn}" && \ 681 plugins_sta="${plugins_sta} ${plugins_dyn}" && \
671 plugins_dyn="" 682 plugins_dyn=""
672 683
673 einfo "Available plugins: ${plugins_avail}" 684 einfo "Available plugins: ${plugins_avail}"
674 einfo "Dynamic plugins: ${plugins_dyn}" 685 einfo "Dynamic plugins: ${plugins_dyn}"
675 einfo "Static plugins: ${plugins_sta}" 686 einfo "Static plugins: ${plugins_sta}"
676 einfo "Disabled plugins: ${plugins_dis}" 687 einfo "Disabled plugins: ${plugins_dis}"
677 688
755 && use minimal ; then 766 && use minimal ; then
756 M="USE flags 'cluster', 'extraengine', 'embedded' conflict with 'minimal' USE flag!" 767 M="USE flags 'cluster', 'extraengine', 'embedded' conflict with 'minimal' USE flag!"
757 eerror "${M}" 768 eerror "${M}"
758 die "${M}" 769 die "${M}"
759 fi 770 fi
760 771
761 if mysql_version_is_at_least "5.1" \ 772 if mysql_version_is_at_least "5.1" \
762 && xtradb_patch_available \ 773 && xtradb_patch_available \
763 && use xtradb \ 774 && use xtradb \
764 && use embedded ; then 775 && use embedded ; then
765 M="USE flags 'xtradb' and 'embedded' conflict and cause build failures" 776 M="USE flags 'xtradb' and 'embedded' conflict and cause build failures"
835 mysql_mv_patches 846 mysql_mv_patches
836 # And apply 847 # And apply
837 epatch 848 epatch
838 849
839 # last -fPIC fixup, per bug #305873 850 # last -fPIC fixup, per bug #305873
840 i="${S}"/storage/innodb_plugin/plug.in 851 i="${S}"/storage/innodb_plugin/plug.in
841 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" 852 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
842 853
843 # Additional checks, remove bundled zlib (Cluster needs this, for static 854 # Additional checks, remove bundled zlib (Cluster needs this, for static
844 # memory management in zlib, leave available for Cluster) 855 # memory management in zlib, leave available for Cluster)
845 if [[ "${PN}" != "mysql-cluster" ]] ; then 856 if [[ "${PN}" != "mysql-cluster" ]] ; then
875 # Or maybe we haven't 886 # Or maybe we haven't
876 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" 887 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
877 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}" 888 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
878 popd >/dev/null 889 popd >/dev/null
879 fi 890 fi
880 891
881 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then 892 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
882 einfo "Adding storage engine: PBXT" 893 einfo "Adding storage engine: PBXT"
883 pushd "${S}"/storage >/dev/null 894 pushd "${S}"/storage >/dev/null
884 i='pbxt' 895 i='pbxt'
885 [ -d "${i}" ] && rm -rf "${i}" 896 [ -d "${i}" ] && rm -rf "${i}"
1057 if use !test ; then 1068 if use !test ; then
1058 rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test 1069 rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test
1059 fi 1070 fi
1060 1071
1061 # Configuration stuff 1072 # Configuration stuff
1062 if mysql_version_is_at_least "5.1" ; then 1073 case ${MYSQL_PV_MAJOR} in
1063 mysql_mycnf_version="5.1"
1064 elif mysql_version_is_at_least "4.1" ; then
1065 mysql_mycnf_version="4.1"
1066 else
1067 mysql_mycnf_version="4.0" 1074 3*|4.0) mysql_mycnf_version="4.0" ;;
1068 fi 1075 4.[1-9]|5.0) mysql_mycnf_version="4.1" ;;
1069 einfo "Building default my.cnf" 1076 5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;;
1077 esac
1078 einfo "Building default my.cnf (${mysql_mycnf_version})"
1070 insinto "${MY_SYSCONFDIR}" 1079 insinto "${MY_SYSCONFDIR}"
1071 doins scripts/mysqlaccess.conf 1080 doins scripts/mysqlaccess.conf
1081 mycnf_src="my.cnf-${mysql_mycnf_version}"
1072 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ 1082 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
1073 "${FILESDIR}/my.cnf-${mysql_mycnf_version}" \ 1083 "${FILESDIR}/${mycnf_src}" \
1074 > "${TMPDIR}/my.cnf.ok" 1084 > "${TMPDIR}/my.cnf.ok"
1075 if mysql_version_is_at_least "4.1" && use latin1 ; then 1085 if use latin1 ; then
1076 sed -i \ 1086 sed -i \
1077 -e "/character-set/s|utf8|latin1|g" \ 1087 -e "/character-set/s|utf8|latin1|g" \
1078 "${TMPDIR}/my.cnf.ok" 1088 "${TMPDIR}/my.cnf.ok"
1079 fi 1089 fi
1080 newins "${TMPDIR}/my.cnf.ok" my.cnf 1090 newins "${TMPDIR}/my.cnf.ok" my.cnf
1322 1332
1323 if [[ -r "${help_tables}" ]] ; then 1333 if [[ -r "${help_tables}" ]] ; then
1324 cat "${help_tables}" >> "${sqltmp}" 1334 cat "${help_tables}" >> "${sqltmp}"
1325 fi 1335 fi
1326 fi 1336 fi
1327 1337
1328 einfo "Creating the mysql database and setting proper" 1338 einfo "Creating the mysql database and setting proper"
1329 einfo "permissions on it ..." 1339 einfo "permissions on it ..."
1330 1340
1331 local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock" 1341 local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
1332 local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid" 1342 local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid"

Legend:
Removed from v.1.151  
changed lines
  Added in v.1.152

  ViewVC Help
Powered by ViewVC 1.1.20