diff options
author | Francesco Riosa <vivo@gentoo.org> | 2006-01-14 19:00:32 +0000 |
---|---|---|
committer | Francesco Riosa <vivo@gentoo.org> | 2006-01-14 19:00:32 +0000 |
commit | b297175285e94b5d21f107921a6e54d593970e28 (patch) | |
tree | 88ed99bb02c32ce36966b7aa84799db246f8cb5c | |
parent | Fixing up segfaults (diff) | |
download | historical-b297175285e94b5d21f107921a6e54d593970e28.tar.gz historical-b297175285e94b5d21f107921a6e54d593970e28.tar.bz2 historical-b297175285e94b5d21f107921a6e54d593970e28.zip |
upgraded patch tarball, better management for client packages that will need to compile against mysql
-rw-r--r-- | eclass/mysql.eclass | 13 | ||||
-rw-r--r-- | eclass/mysql_fx.eclass | 54 |
2 files changed, 57 insertions, 10 deletions
diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass index fe76c7eefd26..ec77b3d0ed3d 100644 --- a/eclass/mysql.eclass +++ b/eclass/mysql.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.5 2006/01/08 23:29:20 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.6 2006/01/14 19:00:32 vivo Exp $ # Author: Francesco Riosa <vivo at gentoo.org> # Maintainer: Francesco Riosa <vivo at gentoo.org> @@ -18,7 +18,7 @@ DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" HOMEPAGE="http://www.mysql.com/" NEWP="${PN}-${PV/_/-}" SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${NEWP}.tar.gz - mirror://gentoo/mysql-extras-20051220.tar.bz2" + mirror://gentoo/mysql-extras-20060114.tar.bz2" LICENSE="GPL-2" IUSE="big-tables berkdb debug minimal perl selinux ssl static" RESTRICT="primaryuri" @@ -120,7 +120,8 @@ mysql_src_unpack() { popd &>/dev/null done - if ! mysql_check_version_range "5.01.00.00 to 5.01.06.99" ; then + if ! useq bdbdir && ! mysql_check_version_range "5.01.00.00 to 5.01.06.99" + then [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f ltmain.sh "${bdbdir}/ltmain.sh" pushd "${bdbdir}" && sh s_all || die "failed bdb reconfigure" &>/dev/null popd &>/dev/null @@ -128,7 +129,7 @@ mysql_src_unpack() { } -src_compile() { +mysql_src_compile() { mysql_init_vars local myconf @@ -424,7 +425,7 @@ mysql_src_install() { # oops, temporary fix mysql_check_version_range "5.00.16.00 to 5.00.18.99" \ && cp -f \ - "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0.15" \ + "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0" \ "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql" } @@ -457,9 +458,9 @@ mysql_pkg_postinst() { mkdir -p "${ROOT}/var/lib/eselect/mysql/" env -i find usr/bin/ usr/sbin/ usr/share/man \ -type f -name "*${MY_SUFFIX}*" \ + -and -not -name "mysql_config${MY_SUFFIX}" \ > "${filelist}.filelist" echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}.filelist" - echo "${MY_INCLUDEDIR#"/"}" >> "${filelist}.filelist" echo "${MY_LIBDIR#"/"}" >> "${filelist}.filelist" echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}.filelist" popd &>/dev/null diff --git a/eclass/mysql_fx.eclass b/eclass/mysql_fx.eclass index 3d907dbbfa31..9921ffde6701 100644 --- a/eclass/mysql_fx.eclass +++ b/eclass/mysql_fx.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.2 2006/01/04 20:40:26 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.3 2006/01/14 19:00:32 vivo Exp $ # Author: Francesco Riosa <vivo at gentoo.org> # Maintainer: Francesco Riosa <vivo at gentoo.org> @@ -161,16 +161,51 @@ mysql_version_is_at_least() { [[ ${want_s} -le ${have_s} ]] && return 0 || return 1 } +# another one inherited from versionator.eclass (version_sort) +mysql_make_file_list() { + local items= left=0 + items=( ${1}-[[:digit:]][[:digit:]][[:digit:]] ) + [[ "${items}" == "${1}-[[:digit:]][[:digit:]][[:digit:]]" ]] && items=( ) + + while [[ ${left} -lt ${#items[@]} ]] ; do + local lowest_idx=${left} + local idx=$(( ${lowest_idx} + 1 )) + while [[ ${idx} -lt ${#items[@]} ]] ; do + [[ "${items[${lowest_idx}]}" > "${items[${idx}]}" ]] \ + && lowest_idx=${idx} + idx=$(( ${idx} + 1 )) + done + local tmp=${items[${lowest_idx}]} + items[${lowest_idx}]=${items[${left}]} + items[${left}]=${tmp} + left=$(( ${left} + 1 )) + done + echo ${items[@]} +} + +mysql_choose_better_version() { + local items= better="" i + items=${1}-[[:digit:]][[:digit:]][[:digit:]] + [[ "${items}" == "${1}-[[:digit:]][[:digit:]][[:digit:]]" ]] && items="" + for i in ${items} ; do + if [[ "${i}" > "${better}" ]] ; then + better="${i}" + fi + done + echo "${better}" +} + + # void mysql_lib_symlinks() # # To be called on the live filesystem, reassign symlinks to each mysql # library to the best version avaiable # 2005-12-30 <vivo at gentoo.org> mysql_lib_symlinks() { - local d dirlist maxdots soname sonameln + local d dirlist maxdots soname sonameln other better pushd "${ROOT}/usr/$(get_libdir)/" # dirlist must contain the less significative directory left - dirlist="mysql $(ls -d mysql-[[:digit:]][[:digit:]][[:digit:]] | sort)" + dirlist="mysql (mysql_make_file_list mysql)" # waste some time in removing and recreating symlinks for d in $dirlist ; do @@ -180,7 +215,7 @@ mysql_lib_symlinks() { sonameln=${soname##*/} # loop in version of the library to link it, similar to the # libtool work - while [[ ${sonameln:(-3)} != '.so' ]] && [[ ${maxdots} -lt 6 ]] + while [[ ${sonameln:0-3} != '.so' ]] && [[ ${maxdots} -lt 6 ]] do rm -f "${sonameln}" ln -s "${soname}" "${sonameln}" @@ -192,4 +227,15 @@ mysql_lib_symlinks() { done done popd + + # "include"s and "mysql_config", needed to compile other sw + for other in "/usr/include/mysql" "/usr/bin/mysql_config" ; do + pushd "${ROOT}${other%/*}" &> /dev/null + if ! [[ -d "${other##*/}" ]] ; then + better=$( mysql_choose_better_version "${other##*/}" ) + [[ -L "${other##*/}" ]] && rm -f "${other##*/}" + ! [[ -f "${other##*/}" ]] && ln -sf "${better}" "${other##*/}" + fi + popd &> /dev/null + done } |