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

Diff of /eclass/mysql-autotools.eclass

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

Revision 1.1 Revision 1.3
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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-autotools.eclass,v 1.1 2011/07/13 07:07:15 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.3 2012/01/06 21:32:48 jmbsvicetto Exp $
4 4
5# @ECLASS: mysql-autotools.eclass 5# @ECLASS: mysql-autotools.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
8# Maintainers:
9# - MySQL Team <mysql-bugs@gentoo.org> 7# MySQL Team <mysql-bugs@gentoo.org>
10# - Robin H. Johnson <robbat2@gentoo.org> 8# Robin H. Johnson <robbat2@gentoo.org>
11# - Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> 9# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
12# - Luca Longinotti <chtekk@gentoo.org> 10# Luca Longinotti <chtekk@gentoo.org>
11# @AUTHOR:
12# Francesco Riosa <vivo@gentoo.org> (retired)
13# @BLURB: This eclass provides support for autotools based mysql releases 13# @BLURB: This eclass provides support for autotools based mysql releases
14# @DESCRIPTION: 14# @DESCRIPTION:
15# The mysql-autotools.eclass provides the support to build the mysql 15# The mysql-autotools.eclass provides the support to build the mysql
16# ebuilds using the autotools build system. This eclass provides 16# ebuilds using the autotools build system. This eclass provides
17# the src_unpack, src_prepare, src_configure, src_compile, scr_install, 17# the src_unpack, src_prepare, src_configure, src_compile, scr_install,
106 myconf="${myconf} $(use_with big-tables)" 106 myconf="${myconf} $(use_with big-tables)"
107 myconf="${myconf} --enable-local-infile" 107 myconf="${myconf} --enable-local-infile"
108 myconf="${myconf} --with-extra-charsets=all" 108 myconf="${myconf} --with-extra-charsets=all"
109 myconf="${myconf} --with-mysqld-user=mysql" 109 myconf="${myconf} --with-mysqld-user=mysql"
110 myconf="${myconf} --with-server" 110 myconf="${myconf} --with-server"
111 myconf="${myconf} --with-unix-socket-path=/var/run/mysqld/mysqld.sock" 111 myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
112 myconf="${myconf} --without-libwrap" 112 myconf="${myconf} --without-libwrap"
113 113
114 if use static ; then 114 if use static ; then
115 myconf="${myconf} --with-mysqld-ldflags=-all-static" 115 myconf="${myconf} --with-mysqld-ldflags=-all-static"
116 myconf="${myconf} --with-client-ldflags=-all-static" 116 myconf="${myconf} --with-client-ldflags=-all-static"
158mysql-autotools_configure_51() { 158mysql-autotools_configure_51() {
159 159
160 # TODO: !!!! readd --without-readline 160 # TODO: !!!! readd --without-readline
161 # the failure depend upon config/ac-macros/readline.m4 checking into 161 # the failure depend upon config/ac-macros/readline.m4 checking into
162 # readline.h instead of history.h 162 # readline.h instead of history.h
163 myconf="${myconf} $(use_with ssl ssl /usr)" 163 myconf="${myconf} $(use_with ssl ssl "${EPREFIX}"/usr)"
164 myconf="${myconf} --enable-assembler" 164 myconf="${myconf} --enable-assembler"
165 myconf="${myconf} --with-geometry" 165 myconf="${myconf} --with-geometry"
166 myconf="${myconf} --with-readline" 166 myconf="${myconf} --with-readline"
167 myconf="${myconf} --with-zlib-dir=/usr/" 167 myconf="${myconf} --with-zlib-dir=${EPREFIX}/usr/"
168 myconf="${myconf} --without-pstack" 168 myconf="${myconf} --without-pstack"
169 myconf="${myconf} --with-plugindir=/usr/$(get_libdir)/mysql/plugin" 169 myconf="${myconf} --with-plugindir=${EPREFIX}/usr/$(get_libdir)/mysql/plugin"
170 170
171 # This is an explict die here, because if we just forcibly disable it, then the 171 # This is an explict die here, because if we just forcibly disable it, then the
172 # user's data is not accessible. 172 # user's data is not accessible.
173 use max-idx-128 && die "Bug #336027: upstream has a corruption issue with max-idx-128 presently" 173 use max-idx-128 && die "Bug #336027: upstream has a corruption issue with max-idx-128 presently"
174 #use max-idx-128 && myconf="${myconf} --with-max-indexes=128" 174 #use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
318 318
319 einfo "Reconfiguring dir '${PWD}'" 319 einfo "Reconfiguring dir '${PWD}'"
320 eautoreconf 320 eautoreconf
321 321
322 local myconf="" 322 local myconf=""
323 myconf="${myconf} --with-mysql=${S} --libdir=/usr/$(get_libdir)" 323 myconf="${myconf} --with-mysql=${S} --libdir=${EPREFIX}/usr/$(get_libdir)"
324 use debug && myconf="${myconf} --with-debug=full" 324 use debug && myconf="${myconf} --with-debug=full"
325 econf ${myconf} || die "Problem configuring PBXT storage engine" 325 econf ${myconf} || die "Problem configuring PBXT storage engine"
326} 326}
327 327
328pbxt_src_compile() { 328pbxt_src_compile() {
475 use x86 && version_is_at_least "4.3.3" "$(gcc-fullversion)" && \ 475 use x86 && version_is_at_least "4.3.3" "$(gcc-fullversion)" && \
476 append-flags -fno-omit-frame-pointer && \ 476 append-flags -fno-omit-frame-pointer && \
477 filter-flags -fomit-frame-pointer 477 filter-flags -fomit-frame-pointer
478 478
479 econf \ 479 econf \
480 --libexecdir="/usr/sbin" \ 480 --libexecdir="${EPREFIX}/usr/sbin" \
481 --sysconfdir="${MY_SYSCONFDIR}" \ 481 --sysconfdir="${MY_SYSCONFDIR}" \
482 --localstatedir="${MY_LOCALSTATEDIR}" \ 482 --localstatedir="${MY_LOCALSTATEDIR}" \
483 --sharedstatedir="${MY_SHAREDSTATEDIR}" \ 483 --sharedstatedir="${MY_SHAREDSTATEDIR}" \
484 --libdir="${MY_LIBDIR}" \ 484 --libdir="${MY_LIBDIR}" \
485 --includedir="${MY_INCLUDEDIR}" \ 485 --includedir="${MY_INCLUDEDIR}" \
537 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" 537 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
538 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" 538 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
539 539
540 # Various junk (my-*.cnf moved elsewhere) 540 # Various junk (my-*.cnf moved elsewhere)
541 einfo "Removing duplicate /usr/share/mysql files" 541 einfo "Removing duplicate /usr/share/mysql files"
542 rm -Rf "${D}/usr/share/info" 542 rm -Rf "${ED}/usr/share/info"
543 for removeme in "mysql-log-rotate" mysql.server* \ 543 for removeme in "mysql-log-rotate" mysql.server* \
544 binary-configure* my-*.cnf mi_test_all* 544 binary-configure* my-*.cnf mi_test_all*
545 do 545 do
546 rm -f "${D}"/${MY_SHAREDSTATEDIR}/${removeme} 546 rm -f "${D}"/${MY_SHAREDSTATEDIR}/${removeme}
547 done 547 done
548 548
549 # Clean up stuff for a minimal build 549 # Clean up stuff for a minimal build
550 if use minimal ; then 550 if use minimal ; then
551 einfo "Remove all extra content for minimal build" 551 einfo "Remove all extra content for minimal build"
552 rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench} 552 rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
553 rm -f "${D}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam} 553 rm -f "${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
554 rm -f "${D}/usr/sbin/mysqld" 554 rm -f "${ED}/usr/sbin/mysqld"
555 rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a 555 rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
556 fi 556 fi
557 557
558 # Unless they explicitly specific USE=test, then do not install the 558 # Unless they explicitly specific USE=test, then do not install the
559 # testsuite. It DOES have a use to be installed, esp. when you want to do a 559 # testsuite. It DOES have a use to be installed, esp. when you want to do a
565 # Configuration stuff 565 # Configuration stuff
566 case ${MYSQL_PV_MAJOR} in 566 case ${MYSQL_PV_MAJOR} in
567 5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;; 567 5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;;
568 esac 568 esac
569 einfo "Building default my.cnf (${mysql_mycnf_version})" 569 einfo "Building default my.cnf (${mysql_mycnf_version})"
570 insinto "${MY_SYSCONFDIR}" 570 insinto "${MY_SYSCONFDIR#${EPREFIX}}"
571 doins scripts/mysqlaccess.conf 571 doins scripts/mysqlaccess.conf
572 mycnf_src="my.cnf-${mysql_mycnf_version}" 572 mycnf_src="my.cnf-${mysql_mycnf_version}"
573 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ 573 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
574 -e "s!/tmp!${EPREFIX}/tmp!" \
575 -e "s!/usr!${EPREFIX}/usr!" \
576 -e "s!= /var!= ${EPREFIX}/var!" \
574 "${FILESDIR}/${mycnf_src}" \ 577 "${FILESDIR}/${mycnf_src}" \
575 > "${TMPDIR}/my.cnf.ok" 578 > "${TMPDIR}/my.cnf.ok"
576 if use latin1 ; then 579 if use latin1 ; then
577 sed -i \ 580 sed -i \
578 -e "/character-set/s|utf8|latin1|g" \ 581 -e "/character-set/s|utf8|latin1|g" \
584 if ! use minimal ; then 587 if ! use minimal ; then
585 einfo "Creating initial directories" 588 einfo "Creating initial directories"
586 # Empty directories ... 589 # Empty directories ...
587 diropts "-m0750" 590 diropts "-m0750"
588 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 591 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
589 dodir "${MY_DATADIR}" 592 dodir "${MY_DATADIR#${EPREFIX}}"
590 keepdir "${MY_DATADIR}" 593 keepdir "${MY_DATADIR#${EPREFIX}}"
591 chown -R mysql:mysql "${D}/${MY_DATADIR}" 594 chown -R mysql:mysql "${D}/${MY_DATADIR}"
592 fi 595 fi
593 596
594 diropts "-m0755" 597 diropts "-m0755"
595 for folder in "${MY_LOGDIR}" "/var/run/mysqld" ; do 598 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
596 dodir "${folder}" 599 dodir "${folder}"
597 keepdir "${folder}" 600 keepdir "${folder}"
598 chown -R mysql:mysql "${D}/${folder}" 601 chown -R mysql:mysql "${ED}/${folder}"
599 done 602 done
600 fi 603 fi
601 604
602 # Docs 605 # Docs
603 einfo "Installing docs" 606 einfo "Installing docs"
623 [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" 626 [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
624 done 627 done
625 628
626 fi 629 fi
627 630
628 mysql_lib_symlinks "${D}" 631 mysql_lib_symlinks "${ED}"
629} 632}

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20