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

Diff of /eclass/mysql.eclass

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

Revision 1.79 Revision 1.84
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.eclass,v 1.79 2007/07/02 14:24:27 peper Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.84 2008/01/16 04:01:14 robbat2 Exp $
4 4
5# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 5# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
6# Maintainer: Luca Longinotti <chtekk@gentoo.org> 6# Maintainer: Luca Longinotti <chtekk@gentoo.org>
7 7
8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too! 8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too!
66# dev-perl/DBD-mysql is needed by some scripts installed by MySQL 66# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
67PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" 67PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
68 68
69# BitKeeper dependency, compile-time only 69# BitKeeper dependency, compile-time only
70[[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client" 70[[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client"
71
72# Work out the default SERVER_URI correctly
73if [ -z "${SERVER_URI}" ]; then
74 # The community build is on the mirrors
75 if [ "${PN}" == "mysql-community" ]; then
76 SERVER_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/mysql-${PV//_/-}.tar.gz"
77 # The enterprise source is on the primary site only
78 elif [ "${PN}" == "mysql" ]; then
79 SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz"
80 fi
81fi
71 82
72# Define correct SRC_URIs 83# Define correct SRC_URIs
73SRC_URI="${SERVER_URI} 84SRC_URI="${SERVER_URI}
74 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 85 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
75 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" 86 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
238 249
239configure_minimal() { 250configure_minimal() {
240 # These are things we exclude from a minimal build, please 251 # These are things we exclude from a minimal build, please
241 # note that the server actually does get built and installed, 252 # note that the server actually does get built and installed,
242 # but we then delete it before packaging. 253 # but we then delete it before packaging.
243 local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication" 254 local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication readline"
244 255
245 for i in ${minimal_exclude_list} ; do 256 for i in ${minimal_exclude_list} ; do
246 myconf="${myconf} --without-${i}" 257 myconf="${myconf} --without-${i}"
247 done 258 done
248 myconf="${myconf} --with-extra-charsets=none" 259 myconf="${myconf} --with-extra-charsets=none"
249 myconf="${myconf} --enable-local-infile" 260 myconf="${myconf} --enable-local-infile"
250 261
251 if use static ; then 262 if use static ; then
252 myconf="${myconf} --with-client-ldflags=-all-static" 263 myconf="${myconf} --with-client-ldflags=-all-static"
253 myconf="${myconf} --disable-shared" 264 myconf="${myconf} --disable-shared --with-pic"
254 else 265 else
255 myconf="${myconf} --enable-shared --enable-static" 266 myconf="${myconf} --enable-shared --enable-static"
256 fi 267 fi
257 268
258 if mysql_version_is_at_least "4.1" && ! use latin1 ; then 269 if mysql_version_is_at_least "4.1" && ! use latin1 ; then
274 myconf="${myconf} --without-libwrap" 285 myconf="${myconf} --without-libwrap"
275 286
276 if use static ; then 287 if use static ; then
277 myconf="${myconf} --with-mysqld-ldflags=-all-static" 288 myconf="${myconf} --with-mysqld-ldflags=-all-static"
278 myconf="${myconf} --with-client-ldflags=-all-static" 289 myconf="${myconf} --with-client-ldflags=-all-static"
279 myconf="${myconf} --disable-shared" 290 myconf="${myconf} --disable-shared --with-pic"
280 else 291 else
281 myconf="${myconf} --enable-shared --enable-static" 292 myconf="${myconf} --enable-shared --enable-static"
282 fi 293 fi
283 294
284 if use debug ; then 295 if use debug ; then
440} 451}
441 452
442# 453#
443# EBUILD FUNCTIONS 454# EBUILD FUNCTIONS
444# 455#
445
446mysql_pkg_setup() { 456mysql_pkg_setup() {
447 enewgroup mysql 60 || die "problem adding 'mysql' group" 457 if hasq test ${FEATURES} ; then
448 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 458 if ! use minimal ; then
459 if ! hasq userpriv ${FEATURES} ; then
460 die "Testing with FEATURES=-userpriv is no longer supported by upstream"
461 fi
462 fi
463 fi
449 464
450 # Check for USE flag problems in pkg_setup 465 # Check for USE flag problems in pkg_setup
451 if use static && use ssl ; then 466 if use static && use ssl ; then
452 eerror "MySQL does not support being built statically with SSL support enabled!" 467 eerror "MySQL does not support being built statically with SSL support enabled!"
453 die "MySQL does not support being built statically with SSL support enabled!" 468 die "MySQL does not support being built statically with SSL support enabled!"
465 && ( use cluster || use extraengine ) \ 480 && ( use cluster || use extraengine ) \
466 && use minimal ; then 481 && use minimal ; then
467 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 482 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
468 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 483 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
469 fi 484 fi
485
486 # This should come after all of the die statements
487 enewgroup mysql 60 || die "problem adding 'mysql' group"
488 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
470 489
471 mysql_check_version_range "4.0 to 5.0.99.99" \ 490 mysql_check_version_range "4.0 to 5.0.99.99" \
472 && use berkdb \ 491 && use berkdb \
473 && elog "Berkeley DB support is deprecated and will be removed in future versions!" 492 && elog "Berkeley DB support is deprecated and will be removed in future versions!"
474} 493}
525 rebuilddirlist="." 544 rebuilddirlist="."
526 # TODO: check this with a cmake expert 545 # TODO: check this with a cmake expert
527 use innodb \ 546 use innodb \
528 && cmake \ 547 && cmake \
529 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ 548 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
530 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCC)) \ 549 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
531 "storage/innobase" 550 "storage/innobase"
532 else 551 else
533 rebuilddirlist=". innobase" 552 rebuilddirlist=". innobase"
534 fi 553 fi
535 554

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.84

  ViewVC Help
Powered by ViewVC 1.1.20