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

Diff of /eclass/mysql.eclass

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

Revision 1.108 Revision 1.109
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.108 2009/02/28 10:50:24 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.109 2009/02/28 10:51:57 robbat2 Exp $
4 4
5# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 5# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
6# Maintainer: MySQL Team <mysql-bugs@gentoo.org> 6# Maintainer: MySQL Team <mysql-bugs@gentoo.org>
7# - Luca Longinotti <chtekk@gentoo.org> 7# - Luca Longinotti <chtekk@gentoo.org>
8# - Robin H. Johnson <robbat2@gentoo.org> 8# - Robin H. Johnson <robbat2@gentoo.org>
19[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z" 19[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
20if [[ "${MY_EXTRAS_VER}" == "live" ]]; then 20if [[ "${MY_EXTRAS_VER}" == "live" ]]; then
21 EGIT_PROJECT=mysql-extras 21 EGIT_PROJECT=mysql-extras
22 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git" 22 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
23 inherit git 23 inherit git
24fi
25
26if [[ ${PR#r} -lt 60 ]] ; then
27 IS_BITKEEPER=0
28elif [[ ${PR#r} -lt 90 ]] ; then
29 IS_BITKEEPER=60
30else
31 IS_BITKEEPER=90
32fi 24fi
33 25
34# MYSQL_VERSION_ID will be: 26# MYSQL_VERSION_ID will be:
35# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99] 27# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
36# This is an important part, because many of the choices the MySQL ebuild will do 28# This is an important part, because many of the choices the MySQL ebuild will do
74 66
75# compile-time-only 67# compile-time-only
76mysql_version_is_at_least "5.1.12" \ 68mysql_version_is_at_least "5.1.12" \
77&& DEPEND="${DEPEND} >=dev-util/cmake-2.4.3" 69&& DEPEND="${DEPEND} >=dev-util/cmake-2.4.3"
78 70
79# BitKeeper dependency, compile-time only
80[[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client"
81
82
83# dev-perl/DBD-mysql is needed by some scripts installed by MySQL 71# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
84PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" 72PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
85 73
86# For other stuff to bring us in 74# For other stuff to bring us in
87PDEPEND="${PDEPEND} =virtual/mysql-$(get_version_component_range 1-2 ${PV})" 75PDEPEND="${PDEPEND} =virtual/mysql-$(get_version_component_range 1-2 ${PV})"
135 pkg_postinst pkg_config pkg_postrm 123 pkg_postinst pkg_config pkg_postrm
136 124
137# 125#
138# HELPER FUNCTIONS: 126# HELPER FUNCTIONS:
139# 127#
140
141bitkeeper_fetch() {
142 local reposuf
143 if [[ -z "${1}" ]] ; then
144 local tpv
145 tpv=( ${PV//[-._]/ } )
146 reposuf="mysql-${tpv[0]}.${tpv[1]}"
147 else
148 reposuf="${1}"
149 fi
150 einfo "Using '${reposuf}' repository."
151 local repo_uri="bk://mysql.bkbits.net/${reposuf}"
152 ## -- ebk_store_dir: bitkeeper sources store directory
153 local ebk_store_dir="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bk-src"
154 ## -- ebk_fetch_cmd: bitkeeper fetch command
155 # always fetch the latest revision, use -r<revision> if a specified revision is wanted
156 # hint: does not work
157 local ebk_fetch_cmd="sfioball"
158 ## -- ebk_update_cmd: bitkeeper update command
159 local ebk_update_cmd="update"
160
161 # addread "/etc/bitkeeper"
162 addwrite "${ebk_store_dir}"
163
164 if [[ ! -d "${ebk_store_dir}" ]] ; then
165 debug-print "${FUNCNAME}: initial checkout, creating bitkeeper directory ..."
166 mkdir -p "${ebk_store_dir}" || die "BK: couldn't mkdir ${ebk_store_dir}"
167 fi
168
169 pushd "${ebk_store_dir}" || die "BK: couldn't chdir to ${ebk_store_dir}"
170
171 local wc_path=${reposuf}
172
173 if [[ ! -d "${wc_path}" ]] ; then
174 local options="-r+"
175
176 # first checkout
177 einfo "bitkeeper checkout start -->"
178 einfo " repository: ${repo_uri}"
179
180 ${ebk_fetch_cmd} ${options} "${repo_uri}" "${wc_path}" \
181 || die "BK: couldn't fetch from ${repo_uri}"
182 else
183 if [[ ! -d "${wc_path}/BK" ]] ; then
184 popd
185 die "Looks like ${wc_path} is not a bitkeeper path"
186 fi
187
188 # update working copy
189 einfo "bitkeeper update start -->"
190 einfo " repository: ${repo_uri}"
191
192 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \
193 || die "BK: couldn't update from ${repo_uri} to ${wc_path}"
194 fi
195
196 einfo " working copy: ${wc_path}"
197 cd "${wc_path}"
198 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: couldn't export to ${S}"
199
200 echo
201 popd
202}
203 128
204mysql_disable_test() { 129mysql_disable_test() {
205 local testname="${1}" ; shift 130 local testname="${1}" ; shift
206 local reason="${@}" 131 local reason="${@}"
207 local mysql_disable_file="${S}/mysql-test/t/disabled.def" 132 local mysql_disable_file="${S}/mysql-test/t/disabled.def"
527 mysql_init_vars 452 mysql_init_vars
528 453
529 unpack ${A} 454 unpack ${A}
530 # Grab the patches 455 # Grab the patches
531 [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack 456 [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack
532 # Bitkeeper checkout support 457
533 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then
534 if mysql_check_version_range "5.1 to 5.1.99" ; then
535 bitkeeper_fetch "mysql-5.1-ndb"
536 elif mysql_check_version_range "5.2 to 5.2.99" ; then
537 bitkeeper_fetch "mysql-5.2-falcon"
538 else
539 bitkeeper_fetch
540 fi
541 cd "${S}"
542 einfo "Running upstream autorun over BK sources ..."
543 BUILD/autorun.sh
544 else
545 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}" 458 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}"
546 cd "${S}" 459 cd "${S}"
547 fi
548 460
549 # Apply the patches for this MySQL version 461 # Apply the patches for this MySQL version
550 EPATCH_SUFFIX="patch" 462 EPATCH_SUFFIX="patch"
551 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory" 463 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
552 # Clean out old items 464 # Clean out old items

Legend:
Removed from v.1.108  
changed lines
  Added in v.1.109

  ViewVC Help
Powered by ViewVC 1.1.20