/[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.155
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.151 2010/09/06 08:02:08 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql.eclass,v 1.155 2010/11/02 20:27:41 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}"
568 myconf="${myconf} --with-readline" 571 myconf="${myconf} --with-readline"
569 myconf="${myconf} --with-zlib-dir=/usr/" 572 myconf="${myconf} --with-zlib-dir=/usr/"
570 myconf="${myconf} --without-pstack" 573 myconf="${myconf} --without-pstack"
571 myconf="${myconf} --with-plugindir=/usr/$(get_libdir)/mysql/plugin" 574 myconf="${myconf} --with-plugindir=/usr/$(get_libdir)/mysql/plugin"
572 575
576 # This is an explict die here, because if we just forcibly disable it, then the
577 # user's data is not accessible.
578 use max-idx-128 && die "Bug #336027: upstream has a corruption issue with max-idx-128 presently"
573 use max-idx-128 && myconf="${myconf} --with-max-indexes=128" 579 #use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
574 if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then 580 if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
575 myconf="${myconf} $(use_enable community community-features)" 581 myconf="${myconf} $(use_enable community community-features)"
576 if use community; then 582 if use community; then
577 myconf="${myconf} $(use_enable profiling)" 583 myconf="${myconf} $(use_enable profiling)"
578 else 584 else
651 fi 657 fi
652 658
653 if [[ "${PN}" == "mariadb" ]] ; then 659 if [[ "${PN}" == "mariadb" ]] ; then
654 # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not 660 # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
655 # caught above. 661 # caught above.
656 plugins_sta="${plugins_sta} maria innobase" 662 plugins_sta="${plugins_sta} maria"
663
664 [ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] ||
665 die "The ${P} package doesn't provide innobase nor xtradb"
666
667 for i in innobase xtradb ; do
668 [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
669 done
670
657 myconf="${myconf} $(use_with libevent)" 671 myconf="${myconf} $(use_with libevent)"
658 # This is not optional, without it several upstream testcases fail. 672 # This is not optional, without it several upstream testcases fail.
659 # Also strongly recommended by upstream. 673 # Also strongly recommended by upstream.
660 myconf="${myconf} --with-maria-tmp-tables" 674 myconf="${myconf} --with-maria-tmp-tables"
661 fi 675 fi
662 676
663 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then 677 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
664 use pbxt \ 678 use pbxt \
665 && plugins_dyn="${plugins_dyn} pbxt" \ 679 && plugins_dyn="${plugins_dyn} pbxt" \
666 || plugins_dis="${plugins_dis} pbxt" 680 || plugins_dis="${plugins_dis} pbxt"
667 fi 681 fi
668 682
669 use static && \ 683 use static && \
670 plugins_sta="${plugins_sta} ${plugins_dyn}" && \ 684 plugins_sta="${plugins_sta} ${plugins_dyn}" && \
671 plugins_dyn="" 685 plugins_dyn=""
672 686
673 einfo "Available plugins: ${plugins_avail}" 687 einfo "Available plugins: ${plugins_avail}"
674 einfo "Dynamic plugins: ${plugins_dyn}" 688 einfo "Dynamic plugins: ${plugins_dyn}"
675 einfo "Static plugins: ${plugins_sta}" 689 einfo "Static plugins: ${plugins_sta}"
676 einfo "Disabled plugins: ${plugins_dis}" 690 einfo "Disabled plugins: ${plugins_dis}"
677 691
755 && use minimal ; then 769 && use minimal ; then
756 M="USE flags 'cluster', 'extraengine', 'embedded' conflict with 'minimal' USE flag!" 770 M="USE flags 'cluster', 'extraengine', 'embedded' conflict with 'minimal' USE flag!"
757 eerror "${M}" 771 eerror "${M}"
758 die "${M}" 772 die "${M}"
759 fi 773 fi
760 774
761 if mysql_version_is_at_least "5.1" \ 775 if mysql_version_is_at_least "5.1" \
762 && xtradb_patch_available \ 776 && xtradb_patch_available \
763 && use xtradb \ 777 && use xtradb \
764 && use embedded ; then 778 && use embedded ; then
765 M="USE flags 'xtradb' and 'embedded' conflict and cause build failures" 779 M="USE flags 'xtradb' and 'embedded' conflict and cause build failures"
835 mysql_mv_patches 849 mysql_mv_patches
836 # And apply 850 # And apply
837 epatch 851 epatch
838 852
839 # last -fPIC fixup, per bug #305873 853 # last -fPIC fixup, per bug #305873
840 i="${S}"/storage/innodb_plugin/plug.in 854 i="${S}"/storage/innodb_plugin/plug.in
841 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" 855 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
842 856
843 # Additional checks, remove bundled zlib (Cluster needs this, for static 857 # Additional checks, remove bundled zlib (Cluster needs this, for static
844 # memory management in zlib, leave available for Cluster) 858 # memory management in zlib, leave available for Cluster)
845 if [[ "${PN}" != "mysql-cluster" ]] ; then 859 if [[ "${PN}" != "mysql-cluster" ]] ; then
875 # Or maybe we haven't 889 # Or maybe we haven't
876 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" 890 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
877 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}" 891 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
878 popd >/dev/null 892 popd >/dev/null
879 fi 893 fi
880 894
881 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then 895 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
882 einfo "Adding storage engine: PBXT" 896 einfo "Adding storage engine: PBXT"
883 pushd "${S}"/storage >/dev/null 897 pushd "${S}"/storage >/dev/null
884 i='pbxt' 898 i='pbxt'
885 [ -d "${i}" ] && rm -rf "${i}" 899 [ -d "${i}" ] && rm -rf "${i}"
966 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 980 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
967 export CXXFLAGS 981 export CXXFLAGS
968 982
969 # bug #283926, with GCC4.4, this is required to get correct behavior. 983 # bug #283926, with GCC4.4, this is required to get correct behavior.
970 append-flags -fno-strict-aliasing 984 append-flags -fno-strict-aliasing
985
986 # bug #335185, #335995, with >= GCC4.3.3 on x86 only, omit-frame-pointer
987 # causes a mis-compile.
988 # Upstream bugs:
989 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38562
990 # http://bugs.mysql.com/bug.php?id=45205
991 use x86 && version_is_at_least "4.3.3" "$(gcc-fullversion)" && \
992 append-flags -fno-omit-frame-pointer && \
993 filter-flags -fomit-frame-pointer
971 994
972 econf \ 995 econf \
973 --libexecdir="/usr/sbin" \ 996 --libexecdir="/usr/sbin" \
974 --sysconfdir="${MY_SYSCONFDIR}" \ 997 --sysconfdir="${MY_SYSCONFDIR}" \
975 --localstatedir="${MY_LOCALSTATEDIR}" \ 998 --localstatedir="${MY_LOCALSTATEDIR}" \
1057 if use !test ; then 1080 if use !test ; then
1058 rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test 1081 rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test
1059 fi 1082 fi
1060 1083
1061 # Configuration stuff 1084 # Configuration stuff
1062 if mysql_version_is_at_least "5.1" ; then 1085 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" 1086 3*|4.0) mysql_mycnf_version="4.0" ;;
1068 fi 1087 4.[1-9]|5.0) mysql_mycnf_version="4.1" ;;
1069 einfo "Building default my.cnf" 1088 5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;;
1089 esac
1090 einfo "Building default my.cnf (${mysql_mycnf_version})"
1070 insinto "${MY_SYSCONFDIR}" 1091 insinto "${MY_SYSCONFDIR}"
1071 doins scripts/mysqlaccess.conf 1092 doins scripts/mysqlaccess.conf
1093 mycnf_src="my.cnf-${mysql_mycnf_version}"
1072 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ 1094 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
1073 "${FILESDIR}/my.cnf-${mysql_mycnf_version}" \ 1095 "${FILESDIR}/${mycnf_src}" \
1074 > "${TMPDIR}/my.cnf.ok" 1096 > "${TMPDIR}/my.cnf.ok"
1075 if mysql_version_is_at_least "4.1" && use latin1 ; then 1097 if use latin1 ; then
1076 sed -i \ 1098 sed -i \
1077 -e "/character-set/s|utf8|latin1|g" \ 1099 -e "/character-set/s|utf8|latin1|g" \
1078 "${TMPDIR}/my.cnf.ok" 1100 "${TMPDIR}/my.cnf.ok"
1079 fi 1101 fi
1080 newins "${TMPDIR}/my.cnf.ok" my.cnf 1102 newins "${TMPDIR}/my.cnf.ok" my.cnf
1322 1344
1323 if [[ -r "${help_tables}" ]] ; then 1345 if [[ -r "${help_tables}" ]] ; then
1324 cat "${help_tables}" >> "${sqltmp}" 1346 cat "${help_tables}" >> "${sqltmp}"
1325 fi 1347 fi
1326 fi 1348 fi
1327 1349
1328 einfo "Creating the mysql database and setting proper" 1350 einfo "Creating the mysql database and setting proper"
1329 einfo "permissions on it ..." 1351 einfo "permissions on it ..."
1330 1352
1331 local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock" 1353 local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
1332 local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid" 1354 local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid"

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

  ViewVC Help
Powered by ViewVC 1.1.20