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

Diff of /eclass/mysql.eclass

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

Revision 1.55 Revision 1.58
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.55 2007/01/03 15:27:13 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.58 2007/01/04 20:38:16 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>
13ECLASS="mysql" 13ECLASS="mysql"
14INHERITED="$INHERITED $ECLASS" 14INHERITED="$INHERITED $ECLASS"
15inherit eutils flag-o-matic gnuconfig autotools mysql_fx 15inherit eutils flag-o-matic gnuconfig autotools mysql_fx
16 16
17# avoid running userspace code 8 times per ebuild :( 17# avoid running userspace code 8 times per ebuild :(
18if [[ "${_MYPVR}" != "${PVR}" ]] || [[ -z "${MYSQL_VERSION_ID}" ]] 18if [[ "${_MYPVR}" != "${PVR}" ]] && [[ -n "${PVR}" ]]
19then 19then
20 _MYPVR=${PVR} 20 _MYPVR=${PVR}
21 21
22 [[ -z ${MY_EXTRAS_VER} ]] && MY_EXTRAS_VER="20070103" 22 [[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070104"
23 23
24 if [[ ${PR#r} -lt 60 ]] ; then 24 if [[ ${PR#r} -lt 60 ]] ; then
25 IS_BITKEEPER=0 25 IS_BITKEEPER=0
26 elif [[ ${PR#r} -lt 90 ]] ; then 26 elif [[ ${PR#r} -lt 90 ]] ; then
27 IS_BITKEEPER=60 27 IS_BITKEEPER=60
48 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) 48 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
49 userland_GNU? ( sys-process/procps ) 49 userland_GNU? ( sys-process/procps )
50 >=sys-apps/sed-4 50 >=sys-apps/sed-4
51 >=sys-apps/texinfo-4.7-r1 51 >=sys-apps/texinfo-4.7-r1
52 >=sys-libs/readline-4.1 52 >=sys-libs/readline-4.1
53 >=sys-libs/zlib-1.2.3" 53 >=sys-libs/zlib-1.2.3
54 "
54 55
55 # having different flavours at the same time is not a good idea 56 # having different flavours at the same time is not a good idea
56 for i in "" "-community" "-slotted" ; do 57 for i in "" "-community" "-slotted" ; do
57 [[ "${i}" == ${PN#mysql} ]] || 58 [[ "${i}" == ${PN#mysql} ]] ||
58 DEPEND="${DEPEND} !dev-db/mysql${i}" 59 DEPEND="${DEPEND} !dev-db/mysql${i}"
125 || IUSE="${IUSE} berkdb" 126 || IUSE="${IUSE} berkdb"
126 127
127 mysql_version_is_at_least "5.1.12" \ 128 mysql_version_is_at_least "5.1.12" \
128 && IUSE="${IUSE} pbxt" 129 && IUSE="${IUSE} pbxt"
129 130
131 RDEPEND="${DEPEND}
132 sys-apps/mysql
130 RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql )" 133 selinux? ( sec-policy/selinux-mysql )
134 "
131 135
132fi # if [[ "${_MYPVR}" != "${PVR}" ]] 136fi # if [[ "${_MYPVR}" != "${PVR}" ]]
133 137
134EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ 138EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \
135 pkg_postinst pkg_config pkg_postrm 139 pkg_postinst pkg_config pkg_postrm
138# HELPER FUNCTIONS: 142# HELPER FUNCTIONS:
139# 143#
140 144
141bitkeeper_fetch() { 145bitkeeper_fetch() {
142 146
147 local reposuf
148 if [[ -z "${1}" ]] ; then
149 local tpv
143 local tpv=( ${PV//[-._]/ } ) 150 tpv=( ${PV//[-._]/ } )
144 local reposuf="${tpv[0]}.${tpv[1]}" 151 reposuf="mysql-${tpv[0]}.${tpv[1]}"
145 useq "cluster" && reposuf="${reposuf}-ndb" 152 else
153 reposuf="${1}"
154 fi
155 einfo "using \"${reposuf}\" repository."
146 local repo_uri="bk://mysql.bkbits.net/mysql-${reposuf}" 156 local repo_uri="bk://mysql.bkbits.net/${reposuf}"
147 ## -- ebk_store_dir: bitkeeper sources store directory 157 ## -- ebk_store_dir: bitkeeper sources store directory
148 local ebk_store_dir="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bk-src" 158 local ebk_store_dir="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bk-src"
149 ## -- ebk_fetch_cmd: bitkeeper fetch command 159 ## -- ebk_fetch_cmd: bitkeeper fetch command
150 # always fetch the latest revision, use -r<revision> if a specified revision is wanted 160 # always fetch the latest revision, use -r<revision> if a specified revision is wanted
151 # hint: does not work 161 # hint: does not work
161 mkdir -p "${ebk_store_dir}" || die "${EBK}: can't mkdir ${ebk_store_dir}." 171 mkdir -p "${ebk_store_dir}" || die "${EBK}: can't mkdir ${ebk_store_dir}."
162 fi 172 fi
163 173
164 pushd "${ebk_store_dir}" || die "${EBK}: can't chdir to ${ebk_store_dir}" 174 pushd "${ebk_store_dir}" || die "${EBK}: can't chdir to ${ebk_store_dir}"
165 175
166 local wc_path=mysql-${reposuf} 176 local wc_path=${reposuf}
167 177
168 if [[ ! -d "${wc_path}" ]]; then 178 if [[ ! -d "${wc_path}" ]]; then
169 local options="-r+" 179 local options="-r+"
170 # first check out 180 # first check out
171 einfo "bitkeeper check out start -->" 181 einfo "bitkeeper check out start -->"
182 einfo "bitkeeper update start -->" 192 einfo "bitkeeper update start -->"
183 einfo " repository: ${repo_uri}" 193 einfo " repository: ${repo_uri}"
184 194
185 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \ 195 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \
186 || die "BK: can't update from ${repo_uri} to ${wc_path}." 196 || die "BK: can't update from ${repo_uri} to ${wc_path}."
187
188 fi 197 fi
189 198
190 einfo " working copy: ${wc_path}" 199 einfo " working copy: ${wc_path}"
191 cd "${wc_path}" 200 cd "${wc_path}"
192 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: can't export to ${S}." 201 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: can't export to ${S}."
343 # --with-vio is not needed anymore, it's on by default and 352 # --with-vio is not needed anymore, it's on by default and
344 # has been removed from configure 353 # has been removed from configure
345 mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio" 354 mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio"
346 if mysql_version_is_at_least "5.0.6" ; then 355 if mysql_version_is_at_least "5.0.6" ; then
347 # myconf="${myconf} --with-yassl" 356 # myconf="${myconf} --with-yassl"
348 myconf="${myconf} --with-openssl" 357 myconf="${myconf} --with-ssl"
349 else 358 else
350 myconf="${myconf} --with-openssl" 359 myconf="${myconf} --with-openssl"
351 fi 360 fi
352 else 361 else
353 myconf="${myconf} --without-openssl" 362 myconf="${myconf} --without-openssl"
429 if useq "cluster" ; then 438 if useq "cluster" ; then
430 plugins="${plugins},ndbcluster" 439 plugins="${plugins},ndbcluster"
431 myconf="${myconf} --with-ndb-binlog" 440 myconf="${myconf} --with-ndb-binlog"
432 fi 441 fi
433 442
443 if mysql_version_is_at_least "5.2" ; then
444 plugins="${plugins},falcon"
445 fi
446
434 myconf="${myconf} --with-plugins=${plugins}" 447 myconf="${myconf} --with-plugins=${plugins}"
435} 448}
436 449
437pbxt_src_compile() { 450pbxt_src_compile() {
438 mysql_init_vars 451 mysql_init_vars
500 # Initialize the proper variables first 513 # Initialize the proper variables first
501 mysql_init_vars 514 mysql_init_vars
502 515
503 unpack ${A} 516 unpack ${A}
504 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then 517 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then
518 if mysql_check_version_range "5.1 to 5.1.99" ; then
519 bitkeeper_fetch "mysql-5.1-ndb"
520 elif mysql_check_version_range "5.2.0 to 5.2.99" ; then
521 bitkeeper_fetch "mysql-5.2-falcon"
522 else
505 bitkeeper_fetch 523 bitkeeper_fetch
524 fi
506 cd "${S}" 525 cd "${S}"
507 einfo "running upstream autorun on bk sources" 526 einfo "running upstream autorun on bk sources"
508 BUILD/autorun.sh 527 BUILD/autorun.sh
509 else 528 else
510 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}" 529 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}"
747 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}" 766 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
748 echo "${MY_LIBDIR#"/"}" >> "${filelist}" 767 echo "${MY_LIBDIR#"/"}" >> "${filelist}"
749 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}" 768 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
750 popd &>/dev/null 769 popd &>/dev/null
751 fi 770 fi
771
772 mysql_lib_symlinks "${D}"
752} 773}
753 774
754mysql_pkg_preinst() { 775mysql_pkg_preinst() {
755 enewgroup mysql 60 || die "problem adding 'mysql' group" 776 enewgroup mysql 60 || die "problem adding 'mysql' group"
756 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 777 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
917} 938}
918 939
919mysql_pkg_postrm() { 940mysql_pkg_postrm() {
920 if [[ ${PN} == "mysql-slotted" ]] ; then 941 if [[ ${PN} == "mysql-slotted" ]] ; then
921 mysql_lib_symlinks 942 mysql_lib_symlinks
943 mysql_clients_link_to_best_version
922 fi 944 fi
923} 945}

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.58

  ViewVC Help
Powered by ViewVC 1.1.20