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

Diff of /eclass/mysql.eclass

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

Revision 1.51 Revision 1.54
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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.51 2006/12/29 20:34:02 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.54 2007/01/03 13:42:05 vivo Exp $
4# kate: encoding utf-8; eol unix;
5# kate: indent-width 4; mixedindent off; remove-trailing-space on; space-indent off;
6# kate: word-wrap-column 80; word-wrap off;
4 7
5# Author: Francesco Riosa <vivo@gentoo.org> 8# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
6# Maintainer: Luca Longinotti <chtekk@gentoo.org> 9# Maintainer: Luca Longinotti <chtekk@gentoo.org>
7 10
8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too
9# Note that MYSQL_VERSION_ID must be empty !!! 11# Note that MYSQL_VERSION_ID must be empty !!!
10 12
13ECLASS="mysql"
14INHERITED="$INHERITED $ECLASS"
15
16# avoid running userspace code 8 times per ebuild :(
17if [[ "${_MYPVR}" != "${PVR}" ]] || [[ -z "${MYSQL_VERSION_ID}" ]]
18then
19 _MYPVR=${PVR}
20
11# MYSQL_VERSION_ID will be: 21 # MYSQL_VERSION_ID will be:
12# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99] 22 # major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
13# This is an important part, because many of the choices the MySQL ebuild will do 23 # This is an important part, because many of the choices the MySQL ebuild will do
14# depend on this variable. 24 # depend on this variable.
15# In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803" 25 # In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803"
16
17if [[ -z "${MYSQL_VERSION_ID}" ]] ; then 26 if [[ -z "${MYSQL_VERSION_ID}" ]] ; then
18 tpv=( ${PV//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" 27 tpv=( ${PV//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}"
19 for vatom in 0 1 2 3 ; do 28 for vatom in 0 1 2 3 ; do
20 # pad to length 2 29 # pad to length 2
21 tpv[${vatom}]="00${tpv[${vatom}]}" 30 tpv[${vatom}]="00${tpv[${vatom}]}"
22 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" 31 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}"
23 done 32 done
24 # strip leading "0" (otherwise it's considered an octal number by BASH) 33 # strip leading "0" (otherwise it's considered an octal number by BASH)
25 MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} 34 MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
26fi 35 fi
27 36
28inherit eutils flag-o-matic gnuconfig autotools mysql_fx 37 inherit eutils flag-o-matic gnuconfig autotools mysql_fx
29 38
30# Be warned, *DEPEND are version-dependant 39 # Be warned, *DEPEND are version-dependant
31DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) 40 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
32 userland_GNU? ( sys-process/procps ) 41 userland_GNU? ( sys-process/procps )
33 >=sys-apps/sed-4 42 >=sys-apps/sed-4
34 >=sys-apps/texinfo-4.7-r1 43 >=sys-apps/texinfo-4.7-r1
35 >=sys-libs/readline-4.1 44 >=sys-libs/readline-4.1
36 >=sys-libs/zlib-1.2.3" 45 >=sys-libs/zlib-1.2.3"
37 46
38# LEAVE THE SURROUNDING SPACES THERE 47 # LEAVE THE SURROUNDING SPACES THERE
39MYSQL_MUTUALLY_EXCLUSIVE=" !dev-db/mysql !dev-db/mysql-community " 48 MYSQL_MUTUALLY_EXCLUSIVE=" !dev-db/mysql !dev-db/mysql-community "
40DEPEND="${DEPEND} ${MYSQL_MUTUALLY_EXCLUSIVE/ !${CATEGORY}\/${PN} /}" 49 DEPEND="${DEPEND} ${MYSQL_MUTUALLY_EXCLUSIVE/ !${CATEGORY}\/${PN} /}"
41 50
42mysql_version_is_at_least "5.01.00.00" \ 51 mysql_version_is_at_least "5.01.00.00" \
43|| DEPEND="${DEPEND} berkdb? ( sys-apps/ed )" 52 || DEPEND="${DEPEND} berkdb? ( sys-apps/ed )"
44 53
45RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql )" 54 RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql )"
46 55
47# dev-perl/DBD-mysql is needed by some scripts installed by MySQL 56 # dev-perl/DBD-mysql is needed by some scripts installed by MySQL
48PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" 57 PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
49 58
50# Shorten the path because the socket path length must be shorter than 107 chars 59 # Shorten the path because the socket path length must be shorter than 107 chars
51# and we will run a mysql server during test phase 60 # and we will run a mysql server during test phase
52S="${WORKDIR}/mysql" # BitKeeper ebuilds 61 S="${WORKDIR}/mysql" # BitKeeper ebuilds
53 62
54# Define $MY_FIXED_PV for MySQL patchsets 63 # Define $MY_FIXED_PV for MySQL patchsets
55MY_FIXED_PV="${PV/_alpha/}" 64 MY_FIXED_PV="${PV/_alpha/}"
56#MY_FIXED_PV="${MY_FIXED_PV/_beta/}" 65 #MY_FIXED_PV="${MY_FIXED_PV/_beta/}"
57#MY_FIXED_PV="${MY_FIXED_PV/_rc/}" 66 #MY_FIXED_PV="${MY_FIXED_PV/_rc/}"
58 67
59MY_P="${P/_/-}" 68 MY_P="${P/_/-}"
60MY_P="${MY_P/-alpha/-bk-}" # BitKeeper ebuilds 69 MY_P="${MY_P/-alpha/-bk-}" # BitKeeper ebuilds
61MY_P="${MY_P/-community/}" 70 MY_P="${MY_P/-community/}"
62 71
63# Define correct SRC_URIs 72 # Define correct SRC_URIs
64SRC_URI="${BASE_URI}/${MY_P}${MYSQL_RERELEASE}.tar.gz" 73 SRC_URI="${BASE_URI}/${MY_P}${MYSQL_RERELEASE}.tar.gz"
65if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then 74 if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then
66 MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" 75 MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2"
67 # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball 76 # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball
68 SRC_URI="${SRC_URI} http://g3nt8.org/patches/${MYSQL_PATCHSET_FILENAME}" 77 SRC_URI="${SRC_URI} http://g3nt8.org/patches/${MYSQL_PATCHSET_FILENAME}"
69fi 78 fi
70 79
71DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 80 DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
72HOMEPAGE="http://www.mysql.com/" 81 HOMEPAGE="http://www.mysql.com/"
73SLOT="0" 82 SLOT="0"
74LICENSE="GPL-2" 83 LICENSE="GPL-2"
75IUSE="big-tables debug embedded minimal perl selinux srvdir ssl static" 84 IUSE="big-tables debug embedded minimal perl selinux srvdir ssl static"
76RESTRICT="confcache" 85 RESTRICT="confcache"
77 86
78mysql_version_is_at_least "4.01.00.00" \ 87 mysql_version_is_at_least "4.01.00.00" \
79&& IUSE="${IUSE} latin1" 88 && IUSE="${IUSE} latin1"
80 89
81mysql_version_is_at_least "4.01.03.00" \ 90 mysql_version_is_at_least "4.01.03.00" \
82&& IUSE="${IUSE} cluster extraengine" 91 && IUSE="${IUSE} cluster extraengine"
83 92
84mysql_version_is_at_least "5.00.00.00" \ 93 mysql_version_is_at_least "5.00.00.00" \
85|| IUSE="${IUSE} raid" 94 || IUSE="${IUSE} raid"
86 95
87mysql_version_is_at_least "5.00.18.00" \ 96 mysql_version_is_at_least "5.00.18.00" \
88&& IUSE="${IUSE} max-idx-128" 97 && IUSE="${IUSE} max-idx-128"
89 98
90mysql_version_is_at_least "5.01.00.00" \ 99 mysql_version_is_at_least "5.01.00.00" \
91&& IUSE="${IUSE} innodb" 100 && IUSE="${IUSE} innodb"
92 101
93mysql_version_is_at_least "5.01.00.00" \ 102 mysql_version_is_at_least "5.01.00.00" \
94|| IUSE="${IUSE} berkdb" 103 || IUSE="${IUSE} berkdb"
104fi # if [[ "${_MYPVR}" != "${PVR}" ]]
95 105
96EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ 106EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \
97 pkg_postinst pkg_config pkg_postrm 107 pkg_postinst pkg_config pkg_postrm
98 108
99# 109#
150 fi 160 fi
151 161
152 einfo " working copy: ${wc_path}" 162 einfo " working copy: ${wc_path}"
153 cd "${wc_path}" 163 cd "${wc_path}"
154 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: can't export to ${S}." 164 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: can't export to ${S}."
155 165
156 echo 166 echo
157 popd 167 popd
158 168
159} 169}
160 170
376 # 5.1 introduces a new way to manage storage engines (plugins) 386 # 5.1 introduces a new way to manage storage engines (plugins)
377 # like configuration=none 387 # like configuration=none
378 local plugins="csv,myisam,myisammrg,heap" 388 local plugins="csv,myisam,myisammrg,heap"
379 if useq "extraengine" ; then 389 if useq "extraengine" ; then
380 # like configuration=max-no-ndb, archive and example removed in 5.1.11 390 # like configuration=max-no-ndb, archive and example removed in 5.1.11
381 plugins="${plugins},archive,blackhole,example,federated,ftexample,partition" 391 plugins="${plugins},archive,blackhole,example,federated,partition"
382 392
383 elog "Before using the Federated storage engine, please be sure to read" 393 elog "Before using the Federated storage engine, please be sure to read"
384 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" 394 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
385 fi 395 fi
386 396
430# 440#
431 441
432mysql_pkg_setup() { 442mysql_pkg_setup() {
433 enewgroup mysql 60 || die "problem adding 'mysql' group" 443 enewgroup mysql 60 || die "problem adding 'mysql' group"
434 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 444 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
435 445
436 # Check for USE flag problems in pkg_setup 446 # Check for USE flag problems in pkg_setup
437 if useq "static" && useq "ssl" ; then 447 if useq "static" && useq "ssl" ; then
438 eerror "MySQL does not support being built statically with SSL support enabled!" 448 eerror "MySQL does not support being built statically with SSL support enabled!"
439 die "MySQL does not support being built statically with SSL support enabled!" 449 die "MySQL does not support being built statically with SSL support enabled!"
440 fi 450 fi
500 510
501 local rebuilddirlist d 511 local rebuilddirlist d
502 512
503 if mysql_version_is_at_least "5.1.12" ; then 513 if mysql_version_is_at_least "5.1.12" ; then
504 rebuilddirlist="." 514 rebuilddirlist="."
505 # TODO IMPO! Check this with a cmake expert 515 # TODO IMPO! Check this with a cmake expert
506 useq "innodb" \ 516 useq "innodb" \
507 && cmake \ 517 && cmake \
508 -DCMAKE_C_COMPILER=$(which $(tc-getCC)) \ 518 -DCMAKE_C_COMPILER=$(which $(tc-getCC)) \
509 -DCMAKE_CXX_COMPILER=$(which $(tc-getCC)) \ 519 -DCMAKE_CXX_COMPILER=$(which $(tc-getCC)) \
510 "storage/innobase" 520 "storage/innobase"

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.54

  ViewVC Help
Powered by ViewVC 1.1.20