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

Diff of /eclass/mysql_fx.eclass

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

Revision 1.27 Revision 1.28
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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_fx.eclass,v 1.27 2011/12/27 17:55:12 fauli Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.28 2012/01/06 21:32:48 jmbsvicetto Exp $
4 4
5# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 5# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
6# Maintainer: 6# Maintainer:
7# - MySQL Team <mysql-bugs@gentoo.org> 7# - MySQL Team <mysql-bugs@gentoo.org>
8# - Luca Longinotti <chtekk@gentoo.org> 8# - Luca Longinotti <chtekk@gentoo.org>
203 # maxdot is a limit versus infinite loop 203 # maxdot is a limit versus infinite loop
204 maxdots=0 204 maxdots=0
205 libnameln=${libname##*/} 205 libnameln=${libname##*/}
206 # loop in version of the library to link it, similar to how 206 # loop in version of the library to link it, similar to how
207 # libtool works 207 # libtool works
208 if [[ ${CHOST} == *-darwin* ]] ; then
209 # macho: libname.x.y.z.dylib
210 local libbasename=${libnameln%%.*} # libname
211 local libver=${libnameln#${libbasename}} # .x.y.z.dylib
212 libver=${libver%${libsuffix}} # .x.y.z
208 while [[ ${libnameln:0-3} != '${libsuffix}' ]] && [[ ${maxdots} -lt 6 ]] ; do 213 while [[ -n ${libver} ]] && [[ ${maxdots} -lt 6 ]] ; do
214 libnameln="${libbasename}${libver}${libsuffix}"
215 rm -f "${libnameln}"
216 ln -s "${libname}" "${libnameln}"
217 (( ++maxdots ))
218 libver=${libver%.*}
219 done
220 libnameln="${libbasename}${libsuffix}"
209 rm -f "${libnameln}" 221 rm -f "${libnameln}"
210 ln -s "${libname}" "${libnameln}" 222 ln -s "${libname}" "${libnameln}"
223 else
224 # elf: libname.so.x.y.z
225 while [[ ${libnameln:0-3} != '${libsuffix}' ]] && [[ ${maxdots} -lt 6 ]] ; do
226 rm -f "${libnameln}"
227 ln -s "${libname}" "${libnameln}"
211 (( ++maxdots )) 228 (( ++maxdots ))
212 libnameln="${libnameln%.*}" 229 libnameln="${libnameln%.*}"
213 done 230 done
214 rm -f "${libnameln}" 231 rm -f "${libnameln}"
215 ln -s "${libname}" "${libnameln}" 232 ln -s "${libname}" "${libnameln}"
233 fi
216 done 234 done
217 done 235 done
218 236
219 popd &> /dev/null 237 popd &> /dev/null
220} 238}
223# @DESCRIPTION: 241# @DESCRIPTION:
224# void mysql_init_vars() 242# void mysql_init_vars()
225# Initialize global variables 243# Initialize global variables
226# 2005-11-19 <vivo@gentoo.org> 244# 2005-11-19 <vivo@gentoo.org>
227mysql_init_vars() { 245mysql_init_vars() {
228 MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="/usr/share/mysql"} 246 MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"}
229 MY_SYSCONFDIR=${MY_SYSCONFDIR="/etc/mysql"} 247 MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
230 MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="/var/lib/mysql"} 248 MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
231 MY_LOGDIR=${MY_LOGDIR="/var/log/mysql"} 249 MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
232 MY_INCLUDEDIR=${MY_INCLUDEDIR="/usr/include/mysql"} 250 MY_INCLUDEDIR=${MY_INCLUDEDIR="${EPREFIX}/usr/include/mysql"}
233 MY_LIBDIR=${MY_LIBDIR="/usr/$(get_libdir)/mysql"} 251 MY_LIBDIR=${MY_LIBDIR="${EPREFIX}/usr/$(get_libdir)/mysql"}
234 252
235 if [[ -z "${MY_DATADIR}" ]] ; then 253 if [[ -z "${MY_DATADIR}" ]] ; then
236 MY_DATADIR="" 254 MY_DATADIR=""
237 if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then 255 if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
238 MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ 256 MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
270 288
271 if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then 289 if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
272 ewarn "MySQL MY_DATADIR has changed" 290 ewarn "MySQL MY_DATADIR has changed"
273 ewarn "from ${MY_DATADIR}" 291 ewarn "from ${MY_DATADIR}"
274 ewarn "to ${new_MY_DATADIR}" 292 ewarn "to ${new_MY_DATADIR}"
275 MY_DATADIR="${new_MY_DATADIR}"
276 fi 293 fi
277 fi 294 fi
278 fi 295 fi
279 296
280 if [ "${MY_SOURCEDIR:-unset}" == "unset" ]; then 297 if [ "${MY_SOURCEDIR:-unset}" == "unset" ]; then

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20