diff options
author | Francesco Riosa <vivo@gentoo.org> | 2006-10-20 12:56:30 +0000 |
---|---|---|
committer | Francesco Riosa <vivo@gentoo.org> | 2006-10-20 12:56:30 +0000 |
commit | a2c0466820103bb6e2bb260d02a799ee9dfb5081 (patch) | |
tree | 7779ebf8541d18a8602358676bace7545cd3a524 /eclass | |
parent | added ~amd64 (diff) | |
download | gentoo-2-a2c0466820103bb6e2bb260d02a799ee9dfb5081.tar.gz gentoo-2-a2c0466820103bb6e2bb260d02a799ee9dfb5081.tar.bz2 gentoo-2-a2c0466820103bb6e2bb260d02a799ee9dfb5081.zip |
Porting changes from overlay step 1 of 2:
- added function that will be called by mysql_src_unpack without actually
call them.
- reformatting some rows to make them shorter than 80 chars
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/mysql.eclass | 194 |
1 files changed, 186 insertions, 8 deletions
diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass index a1ad3b0bb759..6c9ac39be3b0 100644 --- a/eclass/mysql.eclass +++ b/eclass/mysql.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.36 2006/10/14 20:27:21 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.37 2006/10/20 12:56:30 vivo Exp $ # Author: Francesco Riosa <vivo@gentoo.org> # Maintainer: Luca Longinotti <chtekk@gentoo.org> @@ -47,8 +47,8 @@ S="${WORKDIR}/${PN}" # Define $MY_FIXED_PV for MySQL patchsets MY_FIXED_PV="${PV/_alpha/}" -MY_FIXED_PV="${MY_FIXED_PV/_beta/}" -MY_FIXED_PV="${MY_FIXED_PV/_rc/}" +#MY_FIXED_PV="${MY_FIXED_PV/_beta/}" +#MY_FIXED_PV="${MY_FIXED_PV/_rc/}" # Define correct SRC_URIs SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${P/_/-}${MYSQL_RERELEASE}.tar.gz" @@ -83,6 +83,10 @@ mysql_version_is_at_least "5.01.00.00" \ EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ pkg_postinst pkg_config pkg_postrm +# +# HELPER FUNCTIONS: +# + # void mysql_init_vars() # # Initialize global variables @@ -139,9 +143,174 @@ mysql_init_vars() { export DATADIR } +configure_minimal() { + # these are things we exclude from a minimal build + # note that the server actually does get built and installed + # but we then delete it before packaging. + local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication" + + for i in ${minimal_exclude_list}; do + myconf="${myconf} --without-${i}" + done + myconf="${myconf} --with-extra-charsets=none" +} + +configure_common() { + myconf="${myconf} --enable-local-infile" + myconf="${myconf} --with-extra-charsets=all" + myconf="${myconf} --with-mysqld-user=mysql" + myconf="${myconf} --with-unix-socket-path='/var/run/mysqld/mysqld.sock'" + myconf="${myconf} --without-libwrap" + + if useq "static" ; then + myconf="${myconf} --with-mysqld-ldflags=-all-static" + myconf="${myconf} --with-client-ldflags=-all-static" + myconf="${myconf} --disable-shared" + else + myconf="${myconf} --enable-shared --enable-static" + fi + + if useq "debug" ; then + myconf="${myconf} --with-debug=full" + else + myconf="${myconf} --without-debug" + mysql_version_is_at_least "4.01.03.00" \ + && useq "cluster" \ + && myconf="${myconf} --without-ndb-debug" + fi + + if mysql_version_is_at_least "4.01.00.00" && ! useq "latin1" ; then + myconf="${myconf} --with-charset=utf8" + myconf="${myconf} --with-collation=utf8_general_ci" + else + myconf="${myconf} --with-charset=latin1" + myconf="${myconf} --with-collation=latin1_swedish_ci" + fi + + if useq "embedded" ; then + myconf="${myconf} --with-embedded-privilege-control" + myconf="${myconf} --with-embedded-server" + else + myconf="${myconf} --without-embedded-privilege-control" + myconf="${myconf} --without-embedded-server" + fi + +} + +configure_40_41_50() { + myconf="${myconf} $(use_with perl bench)" + myconf="${myconf} --enable-assembler" + myconf="${myconf} --with-extra-tools" + myconf="${myconf} --with-innodb" + myconf="${myconf} --without-readline" + mysql_version_is_at_least "5.00.00.00" && myconf="${myconf} $(use_with raid)" + + if useq "ssl" ; then + # --with-vio is not needed anymore, it's on by default and + # has been removed from configure + mysql_version_is_at_least "5.00.04.00" || myconf="${myconf} --with-vio" + if mysql_version_is_at_least "5.00.06.00" ; then + # myconf="${myconf} --with-yassl" + myconf="${myconf} --with-openssl" + else + myconf="${myconf} --with-openssl" + fi + else + myconf="${myconf} --without-openssl" + fi + + # The following fix is due to a bug with bdb on SPARC's. See: + # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8 + # It comes down to non-64-bit safety problems. + if useq "sparc" || useq "alpha" || useq "hppa" || useq "mips" || useq "amd64" ; then + ewarn "bdb berkeley-db disabled due to incompatible arch" + myconf="${myconf} --without-berkeley-db" + else + useq "berkdb" && myconf="${myconf} --with-berkeley-db=./bdb" + fi + + if mysql_version_is_at_least "4.01.03.00" ; then + myconf="${myconf} --with-geometry" + myconf="${myconf} $(use_with cluster ndbcluster)" + fi + + mysql_version_is_at_least "4.01.11.00" \ + && myconf="${myconf} $(use_with big-tables)" + + if mysql_version_is_at_least "4.01.03.00" && useq "extraengine" ; then + # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html + myconf="${myconf} --with-archive-storage-engine" + + # http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html + myconf="${myconf} --with-csv-storage-engine" + + # http://dev.mysql.com/doc/mysql/en/blackhole-storage-engine.html + myconf="${myconf} --with-blackhole-storage-engine" + + # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html + # http://dev.mysql.com/doc/mysql/en/federated-description.html + # http://dev.mysql.com/doc/mysql/en/federated-limitations.html + if mysql_version_is_at_least "5.00.03.00" ; then + einfo "Before using the Federated storage engine, please be sure to read" + einfo "http://dev.mysql.com/doc/mysql/en/federated-limitations.html" + myconf="${myconf} --with-federated-storage-engine" + fi + fi + + mysql_version_is_at_least "5.00.18.00" \ + && useq "max-idx-128" \ + && myconf="${myconf} --with-max-indexes=128" +} + +configure_51() { + # TODO : !!!!! readd --withouth-readline + # the failure depend upon config/ac-macros/readline.m4 checking into + # readline.h instead of history.h + myconf="${myconf} $(use_with big-tables)" + myconf="${myconf} $(use_with ssl)" + myconf="${myconf} --enable-assembler" + myconf="${myconf} --with-geometry" + myconf="${myconf} --with-readline" + myconf="${myconf} --with-row-based-replication" + myconf="${myconf} --with-zlib=/usr/$(get_libdir)" + myconf="${myconf} --without-pstack" + useq "max-idx-128" && myconf="${myconf} --with-max-indexes=128" + + # 5.1 introduces a new way to manage storage engines (plugins) + # like configuration=none + local plugins="csv,myisam,myisammrg,heap" + if useq "extraengine" ; then + # like configuration=max-no-ndb, archive and example removed in 5.1.11 + plugins="${plugins},blackhole,federated,ftexample,partition" + + einfo "before to use federated engine be sure to read" + einfo "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" + fi + + if useq "innodb" ; then + plugins="${plugins},innobase" + fi + + # like configuration=max-no-ndb + if useq "cluster" ; then + plugins="${plugins},ndbcluster" + myconf="${myconf} --with-ndb-binlog" + fi + + myconf="${myconf} --with-plugins=${plugins}" +} + +# +# EBUILD FUNCTIONS +# + mysql_pkg_setup() { enewgroup mysql 60 || die "problem adding 'mysql' group" enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" + + if mysql_version_is_at_least "5.01.12.00" && useq "innodb" ; then + die "innodb now use cmake to build this is a TODO item" + fi # Check for USE flag problems in pkg_setup if useq "static" && useq "ssl" ; then @@ -163,6 +332,8 @@ mysql_pkg_setup() { eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" fi + + useq "berkdb" && ewarn "Berkley DB support is deprecated and will be removed in future versions" } mysql_src_unpack() { @@ -185,11 +356,14 @@ mysql_src_unpack() { rm -f "scripts/mysqlbug" # Make charsets install in the right place - find . -name 'Makefile.am' -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; + find . -name 'Makefile.am' \ + -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; # Manage mysqlmanager mysql_version_is_at_least "5.00.15.00" \ - && sed -i -e "s!@GENTOO_EXT@!!g" -e "s!@GENTOO_SOCK_PATH@!var/run/mysqld!g" "${S}/server-tools/instance-manager/Makefile.am" + && sed -i -e "s!@GENTOO_EXT@!${MY_SUFFIX}!g" \ + -e "s!@GENTOO_SOCK_PATH@!var/run/mysqld!g" \ + "${S}/server-tools/instance-manager/Makefile.am" if mysql_version_is_at_least "4.01.00.00" ; then # Remove what needs to be recreated, so we're sure it's actually done @@ -198,6 +372,7 @@ mysql_src_unpack() { -o -name configure \ -exec rm -f {} \; rm -f "ltmain.sh" + rm -f "scripts/mysqlbug" fi local rebuilddirlist bdbdir d @@ -409,7 +584,6 @@ mysql_src_compile() { # glib-2.3.2_pre fix, bug #16496 append-flags "-DHAVE_ERRNO_AS_DEFINE=1" - # The compiler flags are as their "official" spec says ;) append-flags "-fno-exceptions -fno-strict-aliasing" CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" mysql_version_is_at_least "5.00.00.00" \ @@ -458,7 +632,9 @@ mysql_src_install() { # Various junk (my-*.cnf moved elsewhere) rm -Rf "${D}/usr/share/info" - for removeme in "mysql-log-rotate" mysql.server* binary-configure* my-*.cnf mi_test_all* ; do + for removeme in "mysql-log-rotate" mysql.server* \ + binary-configure* my-*.cnf mi_test_all* + do rm -f "${D}"/usr/share/mysql/${removeme} done @@ -550,7 +726,8 @@ mysql_pkg_postinst() { mysql_init_vars # Check FEATURES="collision-protect" before removing this - [[ -d "${ROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" + [[ -d "${ROOT}/var/log/mysql" ]] \ + || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" # Secure the logfiles touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} @@ -567,6 +744,7 @@ mysql_pkg_postinst() { mysql_version_is_at_least "5.01.00.00" \ || einfo "InnoDB is *not* optional as of MySQL-4.0.24, at the request of upstream." fi + useq "berkdb" && ewarn "Berkley DB support is deprecated and will be removed in future versions" } mysql_pkg_config() { |