/[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.3 Revision 1.10
1# Copyright 1999-2012 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.3 2012/01/06 21:32:48 jmbsvicetto Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.10 2012/11/01 23:57:50 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 20inherit autotools flag-o-matic multilib
21 21
22# 22#
23# HELPER FUNCTIONS: 23# HELPER FUNCTIONS:
24# 24#
25 25
94 myconf="${myconf} --with-collation=utf8_general_ci" 94 myconf="${myconf} --with-collation=utf8_general_ci"
95 else 95 else
96 myconf="${myconf} --with-charset=latin1" 96 myconf="${myconf} --with-charset=latin1"
97 myconf="${myconf} --with-collation=latin1_swedish_ci" 97 myconf="${myconf} --with-collation=latin1_swedish_ci"
98 fi 98 fi
99
100 # MariaDB requires this flag in order to link to GPLv3 readline v6 or greater
101 # A note is added to the configure output
102 if [[ "${PN}" == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then
103 myconf="${myconf} --disable-distribution"
104 fi
99} 105}
100 106
101# @FUNCTION: mysql-autotools_configure_common 107# @FUNCTION: mysql-autotools_configure_common
102# @DESCRIPTION: 108# @DESCRIPTION:
103# Helper function to configure the common builds 109# Helper function to configure the common builds
121 127
122 if use debug ; then 128 if use debug ; then
123 myconf="${myconf} --with-debug=full" 129 myconf="${myconf} --with-debug=full"
124 else 130 else
125 myconf="${myconf} --without-debug" 131 myconf="${myconf} --without-debug"
126 if ( use cluster || [[ "${PN}" == "mysql-cluster" ]] ); then 132 if ( use cluster ); then
127 myconf="${myconf} --without-ndb-debug" 133 myconf="${myconf} --without-ndb-debug"
128 fi 134 fi
129 fi 135 fi
130 136
131 if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then 137 if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then
170 176
171 # This is an explict die here, because if we just forcibly disable it, then the 177 # This is an explict die here, because if we just forcibly disable it, then the
172 # user's data is not accessible. 178 # user's data is not accessible.
173 use max-idx-128 && die "Bug #336027: upstream has a corruption issue with max-idx-128 presently" 179 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" 180 #use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
175 if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
176 myconf="${myconf} $(use_enable community community-features)" 181 myconf="${myconf} $(use_enable community community-features)"
177 if use community; then 182 if use community; then
178 myconf="${myconf} $(use_enable profiling)" 183 myconf="${myconf} $(use_enable profiling)"
179 else 184 else
180 myconf="${myconf} --disable-profiling" 185 myconf="${myconf} --disable-profiling"
181 fi
182 fi 186 fi
183 187
184 # Scan for all available plugins 188 # Scan for all available plugins
185 local plugins_avail="$( 189 local plugins_avail="$(
186 LANG=C \ 190 LANG=C \
217 plugins_sta="${plugins_sta} partition" 221 plugins_sta="${plugins_sta} partition"
218 222
219 if [[ "${PN}" != "mariadb" ]] ; then 223 if [[ "${PN}" != "mariadb" ]] ; then
220 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"
221 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"
222 plugins_dyn="${plugins_sta} federatedx" 226 plugins_dyn="${plugins_dyn} federated"
223 else 227 else
224 elog "MariaDB includes the FederatedX engine. Be sure to read" 228 elog "MariaDB includes the FederatedX engine. Be sure to read"
225 elog "http://askmonty.org/wiki/index.php/Manual:FederatedX_storage_engine" 229 elog "http://askmonty.org/wiki/index.php/Manual:FederatedX_storage_engine"
226 plugins_dyn="${plugins_sta} federated" 230 plugins_dyn="${plugins_dyn} federatedx"
227 fi 231 fi
228 else 232 else
229 plugins_dis="${plugins_dis} partition federated" 233 plugins_dis="${plugins_dis} partition federated"
230 fi 234 fi
231 235
238 for i in innodb_plugin ; do 242 for i in innodb_plugin ; do
239 [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}" 243 [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}"
240 done 244 done
241 245
242 # like configuration=max-no-ndb 246 # like configuration=max-no-ndb
243 if ( use cluster || [[ "${PN}" == "mysql-cluster" ]] ) ; then 247 if ( use cluster ) ; then
244 plugins_sta="${plugins_sta} ndbcluster partition" 248 plugins_sta="${plugins_sta} ndbcluster partition"
245 plugins_dis="${plugins_dis//partition}" 249 plugins_dis="${plugins_dis//partition}"
246 myconf="${myconf} --with-ndb-binlog" 250 myconf="${myconf} --with-ndb-binlog"
247 else 251 else
248 plugins_dis="${plugins_dis} ndbcluster" 252 plugins_dis="${plugins_dis} ndbcluster"
287 fi 291 fi
288 fi 292 fi
289 293
290 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then 294 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
291 use pbxt \ 295 use pbxt \
292 && plugins_dyn="${plugins_dyn} pbxt" \ 296 && plugins_sta="${plugins_sta} pbxt" \
293 || plugins_dis="${plugins_dis} pbxt" 297 || plugins_dis="${plugins_dis} pbxt"
294 fi 298 fi
295 299
296 use static && \ 300 use static && \
297 plugins_sta="${plugins_sta} ${plugins_dyn}" && \ 301 plugins_sta="${plugins_sta} ${plugins_dyn}" && \
364 368
365 # last -fPIC fixup, per bug #305873 369 # last -fPIC fixup, per bug #305873
366 i="${S}"/storage/innodb_plugin/plug.in 370 i="${S}"/storage/innodb_plugin/plug.in
367 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" 371 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
368 372
369 # Additional checks, remove bundled zlib (Cluster needs this, for static 373 # Additional checks, remove bundled zlib
370 # memory management in zlib, leave available for Cluster)
371 if [[ "${PN}" != "mysql-cluster" ]] ; then
372 rm -f "${S}/zlib/"*.[ch] 374 rm -f "${S}/zlib/"*.[ch]
373 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" 375 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
374 fi
375 rm -f "scripts/mysqlbug" 376 rm -f "scripts/mysqlbug"
376 377
377 # Make charsets install in the right place 378 # Make charsets install in the right place
378 find . -name 'Makefile.am' \ 379 find . -name 'Makefile.am' \
379 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; 380 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
400 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" 401 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
401 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}" 402 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
402 popd >/dev/null 403 popd >/dev/null
403 fi 404 fi
404 405
405 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then 406 if pbxt_patch_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
406 einfo "Adding storage engine: PBXT" 407 einfo "Adding storage engine: PBXT"
407 pushd "${S}"/storage >/dev/null 408 pushd "${S}"/storage >/dev/null
408 i='pbxt' 409 i='pbxt'
409 [ -d "${i}" ] && rm -rf "${i}" 410 [ -d "${i}" ] && rm -rf "${i}"
410 cp -ral "${WORKDIR}/${PBXT_P}" "${i}" 411 cp -ral "${WORKDIR}/${PBXT_P}" "${i}"

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

  ViewVC Help
Powered by ViewVC 1.1.20