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

Diff of /eclass/mysql.eclass

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

Revision 1.59 Revision 1.60
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/Attic/mysql.eclass,v 1.59 2007/01/05 00:07:23 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql.eclass,v 1.60 2007/01/05 11:09:34 vivo Exp $
4# kate: encoding utf-8; eol unix; 4# kate: encoding utf-8; eol unix;
5# kate: indent-width 4; mixedindent off; remove-trailing-space on; space-indent off; 5# kate: indent-width 4; mixedindent off; remove-trailing-space on; space-indent off;
6# kate: word-wrap-column 80; word-wrap off; 6# kate: word-wrap-column 80; word-wrap off;
7 7
8# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 8# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
18 18
19# Shorten the path because the socket path length must be shorter than 107 chars 19# Shorten the path because the socket path length must be shorter than 107 chars
20# and we will run a mysql server during test phase 20# and we will run a mysql server during test phase
21S="${WORKDIR}/mysql" 21S="${WORKDIR}/mysql"
22 22
23# avoid running userspace code 8 times per ebuild :(
24if [[ "${_MYPVR}" != "${PVR}" ]] && [[ -n "${PVR}" ]]
25then
26 _MYPVR=${PVR}
27
28 [[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070105" 23[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070105"
29 24
30 if [[ ${PR#r} -lt 60 ]] ; then 25if [[ ${PR#r} -lt 60 ]] ; then
31 IS_BITKEEPER=0 26 IS_BITKEEPER=0
32 elif [[ ${PR#r} -lt 90 ]] ; then 27elif [[ ${PR#r} -lt 90 ]] ; then
33 IS_BITKEEPER=60 28 IS_BITKEEPER=60
34 else 29else
35 IS_BITKEEPER=90 30 IS_BITKEEPER=90
36 fi 31fi
37 32
38 # MYSQL_VERSION_ID will be: 33# MYSQL_VERSION_ID will be:
39 # major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99] 34# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
40 # This is an important part, because many of the choices the MySQL ebuild will do 35# This is an important part, because many of the choices the MySQL ebuild will do
41 # depend on this variable. 36# depend on this variable.
42 # In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803" 37# In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803"
43 MYSQL_VERSION_ID="" 38MYSQL_VERSION_ID=""
44 tpv=( ${PV//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" 39tpv=( ${PV//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}"
45 for vatom in 0 1 2 3 ; do 40for vatom in 0 1 2 3 ; do
46 # pad to length 2 41 # pad to length 2
47 tpv[${vatom}]="00${tpv[${vatom}]}" 42 tpv[${vatom}]="00${tpv[${vatom}]}"
48 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" 43 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}"
44done
45# strip leading "0" (otherwise it's considered an octal number by BASH)
46MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
47
48# Be warned, *DEPEND are version-dependant
49DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
50 userland_GNU? ( sys-process/procps )
51 >=sys-apps/sed-4
52 >=sys-apps/texinfo-4.7-r1
53 >=sys-libs/readline-4.1
54 >=sys-libs/zlib-1.2.3
55 "
56
57# having different flavours at the same time is not a good idea
58for i in "" "-community" "-slotted" ; do
59 [[ "${i}" == ${PN#mysql} ]] ||
60 DEPEND="${DEPEND} !dev-db/mysql${i}"
61done
62
63mysql_version_is_at_least "5.1" \
64|| DEPEND="${DEPEND} berkdb? ( sys-apps/ed )"
65
66# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
67PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
68
69if mysql_version_is_at_least "5.1.12" ; then
70 DEPEND="${DEPEND} innodb? ( >=dev-util/cmake-2.4.3 )"
71fi
72
73# BitKeeper dependency, compile-time only
74[[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client"
75
76if [[ ${PN} == "mysql-slotted" ]] ; then
77 DEPEND="${DEPEND} app-admin/eselect-mysql"
78fi
79
80if [[ ${PN} == "mysql-slotted" ]] ; then
81 SLOT=""
82 tpv=( ${PV//[-._]/ } )
83 for vatom in 0 1 2 ; do
84 SLOT="${SLOT}${tpv[${vatom}]}_"
49 done 85 done
50 # strip leading "0" (otherwise it's considered an octal number by BASH)
51 MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
52
53 # Be warned, *DEPEND are version-dependant
54 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
55 userland_GNU? ( sys-process/procps )
56 >=sys-apps/sed-4
57 >=sys-apps/texinfo-4.7-r1
58 >=sys-libs/readline-4.1
59 >=sys-libs/zlib-1.2.3
60 "
61
62 # having different flavours at the same time is not a good idea
63 for i in "" "-community" "-slotted" ; do
64 [[ "${i}" == ${PN#mysql} ]] ||
65 DEPEND="${DEPEND} !dev-db/mysql${i}"
66 done
67
68 mysql_version_is_at_least "5.1" \
69 || DEPEND="${DEPEND} berkdb? ( sys-apps/ed )"
70
71 # dev-perl/DBD-mysql is needed by some scripts installed by MySQL
72 PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
73
74 if mysql_version_is_at_least "5.1.12" ; then
75 DEPEND="${DEPEND} innodb? ( >=dev-util/cmake-2.4.3 )"
76 fi
77
78 # BitKeeper dependency, compile-time only
79 [[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client"
80
81 if [[ ${PN} == "mysql-slotted" ]] ; then
82 DEPEND="${DEPEND} app-admin/eselect-mysql"
83 fi
84
85 if [[ ${PN} == "mysql-slotted" ]] ; then
86 SLOT=""
87 tpv=( ${PV//[-._]/ } )
88 for vatom in 0 1 2 ; do
89 SLOT="${SLOT}${tpv[${vatom}]}_"
90 done
91 #finally SLOT=5_0_24 86 #finally SLOT=5_0_24
92 SLOT=${SLOT:0:${#SLOT}-1} 87 SLOT=${SLOT:0:${#SLOT}-1}
93 else 88else
94 SLOT="0" 89 SLOT="0"
95 fi 90fi
96 91
97 # Define correct SRC_URIs 92# Define correct SRC_URIs
98 SRC_URI=" 93SRC_URI="
99 ${SERVER_URI} 94${SERVER_URI}
100 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 95http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
101 " 96"
102 mysql_version_is_at_least "5.1.12" \ 97mysql_version_is_at_least "5.1.12" \
103 && [[ -n "${PBXT_VERSION}" ]] \ 98&& [[ -n "${PBXT_VERSION}" ]] \
104 && SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )" 99&& SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )"
105 100
106 DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 101DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
107 HOMEPAGE="http://www.mysql.com/" 102HOMEPAGE="http://www.mysql.com/"
108 LICENSE="GPL-2" 103LICENSE="GPL-2"
109 IUSE="big-tables debug embedded minimal perl selinux ssl static" 104IUSE="big-tables debug embedded minimal perl selinux ssl static"
110 RESTRICT="confcache" 105RESTRICT="confcache"
111 106
112 mysql_version_is_at_least "4.1" \ 107mysql_version_is_at_least "4.1" \
113 && IUSE="${IUSE} latin1" 108&& IUSE="${IUSE} latin1"
114 109
115 mysql_version_is_at_least "4.1.3" \ 110mysql_version_is_at_least "4.1.3" \
116 && IUSE="${IUSE} cluster extraengine" 111&& IUSE="${IUSE} cluster extraengine"
117 112
118 mysql_version_is_at_least "5.0" \ 113mysql_version_is_at_least "5.0" \
119 || IUSE="${IUSE} raid" 114|| IUSE="${IUSE} raid"
120 115
121 mysql_version_is_at_least "5.0.18" \ 116mysql_version_is_at_least "5.0.18" \
122 && IUSE="${IUSE} max-idx-128" 117&& IUSE="${IUSE} max-idx-128"
123 118
124 mysql_version_is_at_least "5.1" \ 119mysql_version_is_at_least "5.1" \
125 && IUSE="${IUSE} innodb" 120&& IUSE="${IUSE} innodb"
126 121
127 mysql_version_is_at_least "5.1" \ 122mysql_version_is_at_least "5.1" \
128 || IUSE="${IUSE} berkdb" 123|| IUSE="${IUSE} berkdb"
129 124
130 mysql_version_is_at_least "5.1.12" \ 125mysql_version_is_at_least "5.1.12" \
131 && IUSE="${IUSE} pbxt" 126&& IUSE="${IUSE} pbxt"
132 127
133 RDEPEND="${DEPEND} 128RDEPEND="${DEPEND}
134 sys-apps/mysql 129sys-apps/mysql
135 selinux? ( sec-policy/selinux-mysql ) 130selinux? ( sec-policy/selinux-mysql )
136 " 131"
137
138fi # if [[ "${_MYPVR}" != "${PVR}" ]]
139 132
140EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ 133EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \
141 pkg_postinst pkg_config pkg_postrm 134 pkg_postinst pkg_config pkg_postrm
142 135
143# 136#

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60

  ViewVC Help
Powered by ViewVC 1.1.20