/[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.10 Revision 1.16
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2013 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-autotools.eclass,v 1.10 2012/11/01 23:57:50 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql-autotools.eclass,v 1.16 2013/03/09 21:36:07 robbat2 Exp $
4 4
5# @ECLASS: mysql-autotools.eclass 5# @ECLASS: mysql-autotools.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# MySQL Team <mysql-bugs@gentoo.org> 7# MySQL Team <mysql-bugs@gentoo.org>
8# Robin H. Johnson <robbat2@gentoo.org> 8# Robin H. Johnson <robbat2@gentoo.org>
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,
18# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks. 18# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks.
19 19
20inherit autotools flag-o-matic multilib 20inherit autotools flag-o-matic multilib prefix
21 21
22# 22#
23# HELPER FUNCTIONS: 23# HELPER FUNCTIONS:
24# 24#
25 25
287 use ${i} \ 287 use ${i} \
288 && plugins_dyn="${plugins_dyn} ${i}" \ 288 && plugins_dyn="${plugins_dyn} ${i}" \
289 || plugins_dis="${plugins_dis} ${i}" 289 || plugins_dis="${plugins_dis} ${i}"
290 done 290 done
291 fi 291 fi
292
293 #Authentication plugins
294 if mysql_version_is_at_least "5.2.11" ; then
295 for i in pam ; do
296 use ${i} \
297 && plugins_dyn="${plugins_dyn} auth_${i}" \
298 || plugins_dis="${plugins_dis} auth_${i}"
299 done
300 fi
292 fi 301 fi
293 302
294 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then 303 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
295 use pbxt \ 304 use pbxt \
296 && plugins_sta="${plugins_sta} pbxt" \ 305 && plugins_sta="${plugins_sta} pbxt" \
298 fi 307 fi
299 308
300 use static && \ 309 use static && \
301 plugins_sta="${plugins_sta} ${plugins_dyn}" && \ 310 plugins_sta="${plugins_sta} ${plugins_dyn}" && \
302 plugins_dyn="" 311 plugins_dyn=""
312
313 # Google MySQL, bundle what upstream supports
314 if [[ "${PN}" == "google-mysql" ]]; then
315 for x in innobase innodb_plugin innodb ; do
316 plugins_sta="${plugins_sta//$x}"
317 plugins_dyn="${plugins_dyn//$x}"
318 done
319 plugins_sta="${plugins_sta} innodb_plugin googlestats"
320 myconf="${myconf} --with-perftools-dir=/usr --enable-perftools-tcmalloc"
321 # use system lzo for google-mysql
322 myconf="${myconf} --with-lzo2-dir=/usr"
323 fi
303 324
304 einfo "Available plugins: ${plugins_avail}" 325 einfo "Available plugins: ${plugins_avail}"
305 einfo "Dynamic plugins: ${plugins_dyn}" 326 einfo "Dynamic plugins: ${plugins_dyn}"
306 einfo "Static plugins: ${plugins_sta}" 327 einfo "Static plugins: ${plugins_sta}"
307 einfo "Disabled plugins: ${plugins_dis}" 328 einfo "Disabled plugins: ${plugins_dis}"
407 einfo "Adding storage engine: PBXT" 428 einfo "Adding storage engine: PBXT"
408 pushd "${S}"/storage >/dev/null 429 pushd "${S}"/storage >/dev/null
409 i='pbxt' 430 i='pbxt'
410 [ -d "${i}" ] && rm -rf "${i}" 431 [ -d "${i}" ] && rm -rf "${i}"
411 cp -ral "${WORKDIR}/${PBXT_P}" "${i}" 432 cp -ral "${WORKDIR}/${PBXT_P}" "${i}"
433 f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch"
434 [[ -f $f ]] && epatch "$f"
412 popd >/dev/null 435 popd >/dev/null
413 fi 436 fi
414 437
415 rebuilddirlist="." 438 rebuilddirlist="."
416 # This does not seem to be needed presently. robbat2 2010/02/23 439 # This does not seem to be needed presently. robbat2 2010/02/23
431 454
432# @FUNCTION: mysql-autotools_src_configure 455# @FUNCTION: mysql-autotools_src_configure
433# @DESCRIPTION: 456# @DESCRIPTION:
434# Configure mysql to build the code for Gentoo respecting the use flags. 457# Configure mysql to build the code for Gentoo respecting the use flags.
435mysql-autotools_src_configure() { 458mysql-autotools_src_configure() {
459 # bug 401733
460 export QA_CONFIGURE_OPTIONS=".*"
436 461
437 # Make sure the vars are correctly initialized 462 # Make sure the vars are correctly initialized
438 mysql_init_vars 463 mysql_init_vars
439 464
440 # $myconf is modified by the configure_* functions 465 # $myconf is modified by the configure_* functions
459 filter-flags "-fstack-protector-all" 484 filter-flags "-fstack-protector-all"
460 fi 485 fi
461 486
462 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" 487 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing"
463 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" 488 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
489 # storage/googlestats, sql/ in google-mysql are using C++ templates
490 # implicitly. Upstream might be interested in this, exclude
491 # -fno-implicit-templates for google-mysql for now.
464 mysql_version_is_at_least "5.0" \ 492 mysql_version_is_at_least "5.0" \
493 && [[ "${PN}" != "google-mysql" ]] \
465 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 494 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
466 export CXXFLAGS 495 export CXXFLAGS
467 496
468 # bug #283926, with GCC4.4, this is required to get correct behavior. 497 # bug #283926, with GCC4.4, this is required to get correct behavior.
469 append-flags -fno-strict-aliasing 498 append-flags -fno-strict-aliasing
580 if use latin1 ; then 609 if use latin1 ; then
581 sed -i \ 610 sed -i \
582 -e "/character-set/s|utf8|latin1|g" \ 611 -e "/character-set/s|utf8|latin1|g" \
583 "${TMPDIR}/my.cnf.ok" 612 "${TMPDIR}/my.cnf.ok"
584 fi 613 fi
614 eprefixify "${TMPDIR}/my.cnf.ok"
585 newins "${TMPDIR}/my.cnf.ok" my.cnf 615 newins "${TMPDIR}/my.cnf.ok" my.cnf
586 616
587 # Minimal builds don't have the MySQL server 617 # Minimal builds don't have the MySQL server
588 if ! use minimal ; then 618 if ! use minimal ; then
589 einfo "Creating initial directories" 619 einfo "Creating initial directories"
590 # Empty directories ... 620 # Empty directories ...
591 diropts "-m0750" 621 diropts "-m0750"
622 keepdir "${MY_DATADIR#${EPREFIX}}"
592 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 623 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
593 dodir "${MY_DATADIR#${EPREFIX}}"
594 keepdir "${MY_DATADIR#${EPREFIX}}"
595 chown -R mysql:mysql "${D}/${MY_DATADIR}" 624 chown -R mysql:mysql "${D}/${MY_DATADIR}"
596 fi 625 fi
597 626
598 diropts "-m0755" 627 diropts "-m0755"
599 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do 628 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
628 done 657 done
629 658
630 fi 659 fi
631 660
632 mysql_lib_symlinks "${ED}" 661 mysql_lib_symlinks "${ED}"
662
663 #Remove mytop if perl is not selected
664 [[ "${PN}" == "mariadb" ]] && ! use perl \
665 && mysql_version_is_at_least "5.3" \
666 && rm -f "${ED}/usr/bin/mytop"
667
668 #Bug 455462 remove unnecessary libtool files
669 prune_libtool_files --modules
633} 670}

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20