/[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.17 Revision 1.18
1# Copyright 1999-2013 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/mysql-autotools.eclass,v 1.17 2013/03/16 19:20:34 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.18 2013/06/26 19:31:49 jmbsvicetto 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>
49 # ${S}/mysql-tests/suite/parts/t/disabled.def 49 # ${S}/mysql-tests/suite/parts/t/disabled.def
50 # ${S}/mysql-tests/suite/rpl_ndb/t/disabled.def 50 # ${S}/mysql-tests/suite/rpl_ndb/t/disabled.def
51 # ${S}/mysql-tests/suite/ndb_team/t/disabled.def 51 # ${S}/mysql-tests/suite/ndb_team/t/disabled.def
52 # ${S}/mysql-tests/suite/binlog/t/disabled.def 52 # ${S}/mysql-tests/suite/binlog/t/disabled.def
53 # ${S}/mysql-tests/suite/innodb/t/disabled.def 53 # ${S}/mysql-tests/suite/innodb/t/disabled.def
54 if [ -n "${testsuite}" ]; then 54 if [[ -n ${testsuite} ]]; then
55 for mysql_disable_file in \ 55 for mysql_disable_file in \
56 ${S}/mysql-test/suite/${testsuite}/disabled.def \ 56 ${S}/mysql-test/suite/${testsuite}/disabled.def \
57 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \ 57 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
58 FAILED ; do 58 FAILED ; do
59 [ -f "${mysql_disable_file}" ] && break 59 [[ -f ${mysql_disable_file} ]] && break
60 done 60 done
61 if [ "${mysql_disabled_file}" != "FAILED" ]; then 61 if [[ ${mysql_disabled_file} != "FAILED" ]]; then
62 echo "${testname} : ${reason}" >> "${mysql_disable_file}" 62 echo "${testname} : ${reason}" >> "${mysql_disable_file}"
63 else 63 else
64 ewarn "Could not find testsuite disabled.def location for ${rawtestname}" 64 ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
65 fi 65 fi
66 fi 66 fi
97 myconf="${myconf} --with-collation=latin1_swedish_ci" 97 myconf="${myconf} --with-collation=latin1_swedish_ci"
98 fi 98 fi
99 99
100 # MariaDB requires this flag in order to link to GPLv3 readline v6 or greater 100 # MariaDB requires this flag in order to link to GPLv3 readline v6 or greater
101 # A note is added to the configure output 101 # A note is added to the configure output
102 if [[ "${PN}" == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then 102 if [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then
103 myconf="${myconf} --disable-distribution" 103 myconf="${myconf} --disable-distribution"
104 fi 104 fi
105} 105}
106 106
107# @FUNCTION: mysql-autotools_configure_common 107# @FUNCTION: mysql-autotools_configure_common
132 if ( use cluster ); then 132 if ( use cluster ); then
133 myconf="${myconf} --without-ndb-debug" 133 myconf="${myconf} --without-ndb-debug"
134 fi 134 fi
135 fi 135 fi
136 136
137 if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then 137 if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
138 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" 138 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
139 ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." 139 ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
140 ewarn "You MUST file bugs without these variables set." 140 ewarn "You MUST file bugs without these variables set."
141 myconf="${myconf} --with-charset=${MYSQL_DEFAULT_CHARSET}" 141 myconf="${myconf} --with-charset=${MYSQL_DEFAULT_CHARSET}"
142 myconf="${myconf} --with-collation=${MYSQL_DEFAULT_COLLATION}" 142 myconf="${myconf} --with-collation=${MYSQL_DEFAULT_COLLATION}"
218 # like configuration=max-no-ndb, archive and example removed in 5.1.11 218 # like configuration=max-no-ndb, archive and example removed in 5.1.11
219 # not added yet: ibmdb2i 219 # not added yet: ibmdb2i
220 # Not supporting as examples: example,daemon_example,ftexample 220 # Not supporting as examples: example,daemon_example,ftexample
221 plugins_sta="${plugins_sta} partition" 221 plugins_sta="${plugins_sta} partition"
222 222
223 if [[ "${PN}" != "mariadb" ]] ; then 223 if [[ ${PN} != "mariadb" ]] ; then
224 elog "Before using the Federated storage engine, please be sure to read" 224 elog "Before using the Federated storage engine, please be sure to read"
225 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" 225 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
226 plugins_dyn="${plugins_dyn} federated" 226 plugins_dyn="${plugins_dyn} federated"
227 else 227 else
228 elog "MariaDB includes the FederatedX engine. Be sure to read" 228 elog "MariaDB includes the FederatedX engine. Be sure to read"
235 235
236 # Upstream specifically requests that InnoDB always be built: 236 # Upstream specifically requests that InnoDB always be built:
237 # - innobase, innodb_plugin 237 # - innobase, innodb_plugin
238 # Build falcon if available for 6.x series. 238 # Build falcon if available for 6.x series.
239 for i in innobase falcon ; do 239 for i in innobase falcon ; do
240 [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}" 240 [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}"
241 done 241 done
242 for i in innodb_plugin ; do 242 for i in innodb_plugin ; do
243 [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}" 243 [[ -e ${S}/storage/${i} ]] && plugins_dyn="${plugins_dyn} ${i}"
244 done 244 done
245 245
246 # like configuration=max-no-ndb 246 # like configuration=max-no-ndb
247 if ( use cluster ) ; then 247 if ( use cluster ) ; then
248 plugins_sta="${plugins_sta} ndbcluster partition" 248 plugins_sta="${plugins_sta} ndbcluster partition"
250 myconf="${myconf} --with-ndb-binlog" 250 myconf="${myconf} --with-ndb-binlog"
251 else 251 else
252 plugins_dis="${plugins_dis} ndbcluster" 252 plugins_dis="${plugins_dis} ndbcluster"
253 fi 253 fi
254 254
255 if [[ "${PN}" == "mariadb" ]] ; then 255 if [[ ${PN} == "mariadb" ]] ; then
256 # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not 256 # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
257 # caught above. 257 # caught above.
258 # This is not optional, without it several upstream testcases fail. 258 # This is not optional, without it several upstream testcases fail.
259 # Also strongly recommended by upstream. 259 # Also strongly recommended by upstream.
260 if [[ "${PV}" < "5.2.0" ]] ; then 260 if [[ ${PV} < "5.2.0" ]] ; then
261 myconf="${myconf} --with-maria-tmp-tables" 261 myconf="${myconf} --with-maria-tmp-tables"
262 plugins_sta="${plugins_sta} maria" 262 plugins_sta="${plugins_sta} maria"
263 else 263 else
264 myconf="${myconf} --with-aria-tmp-tables" 264 myconf="${myconf} --with-aria-tmp-tables"
265 plugins_sta="${plugins_sta} aria" 265 plugins_sta="${plugins_sta} aria"
266 fi 266 fi
267 267
268 [ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] || 268 [[ ( -e ${S}/storage/innobase ) || ( -e ${S}/storage/xtradb ) ]] ||
269 die "The ${P} package doesn't provide innobase nor xtradb" 269 die "The ${P} package doesn't provide innobase nor xtradb"
270 270
271 for i in innobase xtradb ; do 271 for i in innobase xtradb ; do
272 [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}" 272 [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}"
273 done 273 done
274 274
275 myconf="${myconf} $(use_with libevent)" 275 myconf="${myconf} $(use_with libevent)"
276 276
277 if mysql_version_is_at_least "5.2" ; then 277 if mysql_version_is_at_least "5.2" ; then
298 || plugins_dis="${plugins_dis} auth_${i}" 298 || plugins_dis="${plugins_dis} auth_${i}"
299 done 299 done
300 fi 300 fi
301 fi 301 fi
302 302
303 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then 303 if pbxt_available && [[ ${PBXT_NEWSTYLE} == "1" ]]; then
304 use pbxt \ 304 use pbxt \
305 && plugins_sta="${plugins_sta} pbxt" \ 305 && plugins_sta="${plugins_sta} pbxt" \
306 || plugins_dis="${plugins_dis} pbxt" 306 || plugins_dis="${plugins_dis} pbxt"
307 fi 307 fi
308 308
309 use static && \ 309 use static && \
310 plugins_sta="${plugins_sta} ${plugins_dyn}" && \ 310 plugins_sta="${plugins_sta} ${plugins_dyn}" && \
311 plugins_dyn="" 311 plugins_dyn=""
312 312
313 # Google MySQL, bundle what upstream supports 313 # Google MySQL, bundle what upstream supports
314 if [[ "${PN}" == "google-mysql" ]]; then 314 if [[ ${PN} == "google-mysql" ]]; then
315 for x in innobase innodb_plugin innodb ; do 315 for x in innobase innodb_plugin innodb ; do
316 plugins_sta="${plugins_sta//$x}" 316 plugins_sta="${plugins_sta//$x}"
317 plugins_dyn="${plugins_dyn//$x}" 317 plugins_dyn="${plugins_dyn//$x}"
318 done 318 done
319 plugins_sta="${plugins_sta} innodb_plugin googlestats" 319 plugins_sta="${plugins_sta} innodb_plugin googlestats"
387 # And apply 387 # And apply
388 epatch 388 epatch
389 389
390 # last -fPIC fixup, per bug #305873 390 # last -fPIC fixup, per bug #305873
391 i="${S}"/storage/innodb_plugin/plug.in 391 i="${S}"/storage/innodb_plugin/plug.in
392 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" 392 [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
393 393
394 # Additional checks, remove bundled zlib 394 # Additional checks, remove bundled zlib
395 rm -f "${S}/zlib/"*.[ch] 395 rm -f "${S}/zlib/"*.[ch]
396 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" 396 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
397 rm -f "scripts/mysqlbug" 397 rm -f "scripts/mysqlbug"
415 einfo "Adding storage engine: Percona XtraDB (replacing InnoDB)" 415 einfo "Adding storage engine: Percona XtraDB (replacing InnoDB)"
416 pushd "${S}"/storage >/dev/null 416 pushd "${S}"/storage >/dev/null
417 i="innobase" 417 i="innobase"
418 o="${WORKDIR}/storage-${i}.mysql-upstream" 418 o="${WORKDIR}/storage-${i}.mysql-upstream"
419 # Have we been here already? 419 # Have we been here already?
420 [ -d "${o}" ] && rm -f "${i}" 420 [[ -d ${o} ]] && rm -f "${i}"
421 # Or maybe we haven't 421 # Or maybe we haven't
422 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" 422 [[ ( -d ${i} ) && ! ( -d ${o} ) ]] && mv "${i}" "${o}"
423 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}" 423 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
424 popd >/dev/null 424 popd >/dev/null
425 fi 425 fi
426 426
427 if pbxt_patch_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then 427 if pbxt_patch_available && [[ ${PBXT_NEWSTYLE} == "1" ]] && use pbxt ; then
428 einfo "Adding storage engine: PBXT" 428 einfo "Adding storage engine: PBXT"
429 pushd "${S}"/storage >/dev/null 429 pushd "${S}"/storage >/dev/null
430 i='pbxt' 430 i='pbxt'
431 [ -d "${i}" ] && rm -rf "${i}" 431 [[ -d ${i} ]] && rm -rf "${i}"
432 cp -ral "${WORKDIR}/${PBXT_P}" "${i}" 432 cp -ral "${WORKDIR}/${PBXT_P}" "${i}"
433 f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch" 433 f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch"
434 [[ -f $f ]] && epatch "$f" 434 [[ -f $f ]] && epatch "$f"
435 popd >/dev/null 435 popd >/dev/null
436 fi 436 fi
437 437
438 rebuilddirlist="." 438 rebuilddirlist="."
439 # 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
488 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" 488 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
489 # storage/googlestats, sql/ in google-mysql are using C++ templates 489 # storage/googlestats, sql/ in google-mysql are using C++ templates
490 # implicitly. Upstream might be interested in this, exclude 490 # implicitly. Upstream might be interested in this, exclude
491 # -fno-implicit-templates for google-mysql for now. 491 # -fno-implicit-templates for google-mysql for now.
492 mysql_version_is_at_least "5.0" \ 492 mysql_version_is_at_least "5.0" \
493 && [[ "${PN}" != "google-mysql" ]] \ 493 && [[ ${PN} != "google-mysql" ]] \
494 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 494 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
495 export CXXFLAGS 495 export CXXFLAGS
496 496
497 # 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.
498 append-flags -fno-strict-aliasing 498 append-flags -fno-strict-aliasing
524 # TODO: Move this before autoreconf !!! 524 # TODO: Move this before autoreconf !!!
525 find . -type f -name Makefile -print0 \ 525 find . -type f -name Makefile -print0 \
526 | xargs -0 -n100 sed -i \ 526 | xargs -0 -n100 sed -i \
527 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|' 527 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
528 528
529 if [[ $EAPI == 2 ]] && [[ "${PBXT_NEWSTYLE}" != "1" ]]; then 529 if [[ $EAPI == 2 ]] && [[ ${PBXT_NEWSTYLE} != "1" ]]; then
530 pbxt_patch_available && use pbxt && pbxt_src_configure 530 pbxt_patch_available && use pbxt && pbxt_src_configure
531 fi 531 fi
532} 532}
533 533
534# @FUNCTION: mysql-autotools_src_compile 534# @FUNCTION: mysql-autotools_src_compile
536# Compile the mysql code. 536# Compile the mysql code.
537mysql-autotools_src_compile() { 537mysql-autotools_src_compile() {
538 538
539 emake || die "emake failed" 539 emake || die "emake failed"
540 540
541 if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then 541 if [[ ${PBXT_NEWSTYLE} != "1" ]]; then
542 pbxt_patch_available && use pbxt && pbxt_src_compile 542 pbxt_patch_available && use pbxt && pbxt_src_compile
543 fi 543 fi
544} 544}
545 545
546# @FUNCTION: mysql-autotools_src_install 546# @FUNCTION: mysql-autotools_src_install
555 DESTDIR="${D}" \ 555 DESTDIR="${D}" \
556 benchdir_root="${MY_SHAREDSTATEDIR}" \ 556 benchdir_root="${MY_SHAREDSTATEDIR}" \
557 testroot="${MY_SHAREDSTATEDIR}" \ 557 testroot="${MY_SHAREDSTATEDIR}" \
558 || die "emake install failed" 558 || die "emake install failed"
559 559
560 if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then 560 if [[ ${PBXT_NEWSTYLE} != "1" ]]; then
561 pbxt_patch_available && use pbxt && pbxt_src_install 561 pbxt_patch_available && use pbxt && pbxt_src_install
562 fi 562 fi
563 563
564 # Convenience links 564 # Convenience links
565 einfo "Making Convenience links for mysqlcheck multi-call binary" 565 einfo "Making Convenience links for mysqlcheck multi-call binary"
618 if ! use minimal ; then 618 if ! use minimal ; then
619 einfo "Creating initial directories" 619 einfo "Creating initial directories"
620 # Empty directories ... 620 # Empty directories ...
621 diropts "-m0750" 621 diropts "-m0750"
622 keepdir "${MY_DATADIR#${EPREFIX}}" 622 keepdir "${MY_DATADIR#${EPREFIX}}"
623 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 623 if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
624 chown -R mysql:mysql "${D}/${MY_DATADIR}" 624 chown -R mysql:mysql "${D}/${MY_DATADIR}"
625 fi 625 fi
626 626
627 diropts "-m0755" 627 diropts "-m0755"
628 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do 628 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
633 fi 633 fi
634 634
635 # Docs 635 # Docs
636 einfo "Installing docs" 636 einfo "Installing docs"
637 for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do 637 for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do
638 [[ -f "$i" ]] && dodoc "$i" 638 [[ -f $i ]] && dodoc "$i"
639 done 639 done
640 doinfo "${S}"/Docs/mysql.info 640 doinfo "${S}"/Docs/mysql.info
641 641
642 # Minimal builds don't have the MySQL server 642 # Minimal builds don't have the MySQL server
643 if ! use minimal ; then 643 if ! use minimal ; then
646 for script in \ 646 for script in \
647 "${S}"/support-files/my-*.cnf \ 647 "${S}"/support-files/my-*.cnf \
648 "${S}"/support-files/magic \ 648 "${S}"/support-files/magic \
649 "${S}"/support-files/ndb-config-2-node.ini 649 "${S}"/support-files/ndb-config-2-node.ini
650 do 650 do
651 [[ -f "$script" ]] && dodoc "${script}" 651 [[ -f $script ]] && dodoc "${script}"
652 done 652 done
653 653
654 docinto "scripts" 654 docinto "scripts"
655 for script in "${S}"/scripts/mysql* ; do 655 for script in "${S}"/scripts/mysql* ; do
656 [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" 656 [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
657 done 657 done
658 658
659 fi 659 fi
660 660
661 mysql_lib_symlinks "${ED}" 661 mysql_lib_symlinks "${ED}"
662 662
663 #Remove mytop if perl is not selected 663 #Remove mytop if perl is not selected
664 [[ "${PN}" == "mariadb" ]] && ! use perl \ 664 [[ ${PN} == "mariadb" ]] && ! use perl \
665 && mysql_version_is_at_least "5.3" \ 665 && mysql_version_is_at_least "5.3" \
666 && rm -f "${ED}/usr/bin/mytop" 666 && rm -f "${ED}/usr/bin/mytop"
667 667
668 #Bug 455462 remove unnecessary libtool files 668 #Bug 455462 remove unnecessary libtool files
669 prune_libtool_files --modules 669 prune_libtool_files --modules

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20