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

Diff of /eclass/mysql.eclass

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

Revision 1.14 Revision 1.15
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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.14 2006/02/03 08:48:37 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.15 2006/02/08 16:17:52 vivo Exp $
4 4
5# Author: Francesco Riosa <vivo at gentoo.org> 5# Author: Francesco Riosa <vivo at gentoo.org>
6# Maintainer: Francesco Riosa <vivo at gentoo.org> 6# Maintainer: Francesco Riosa <vivo at gentoo.org>
7 7
8inherit eutils flag-o-matic gnuconfig mysql_fx 8inherit eutils flag-o-matic gnuconfig mysql_fx
31&& IUSE="${IUSE} max-idx-128" 31&& IUSE="${IUSE} max-idx-128"
32 32
33mysql_version_is_at_least "5.01.00.00" \ 33mysql_version_is_at_least "5.01.00.00" \
34&& IUSE="${IUSE} innodb" 34&& IUSE="${IUSE} innodb"
35 35
36EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_config pkg_postrm 36EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_config mysql_pkg_prerm pkg_postrm
37 37
38# void mysql_init_vars() 38# void mysql_init_vars()
39# 39#
40# initialize global variables 40# initialize global variables
41# 2005-11-19 <vivo at gentoo.org> 41# 2005-11-19 <vivo at gentoo.org>
484 # oops, temporary fix 484 # oops, temporary fix
485 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \ 485 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \
486 && cp -f \ 486 && cp -f \
487 "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0" \ 487 "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0" \
488 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql" 488 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql"
489}
490 489
491mysql_pkg_preinst() { 490 # MOVED HERE DUE TO BUG #121445
492
493 # create a list of files, to be used 491 # create a list of files, to be used
494 # by external utilities 492 # by external utilities
495 # will be used in pkg_postinst 493 mkdir -p "${D}/var/lib/eselect/mysql/"
496 local filelist="${TMPDIR}/FILELIST" 494 local filelist="${D}/var/lib/eselect/mysql/mysql${MY_SUFFIX}.filelist"
497 pushd "${D}/" &>/dev/null 495 pushd "${D}/" &>/dev/null
498 mkdir -p "${ROOT}/var/lib/eselect/mysql/" 496 mkdir -p "${ROOT}/var/lib/eselect/mysql/"
499 env -i find usr/bin/ usr/sbin/ usr/share/man \ 497 env -i find usr/bin/ usr/sbin/ usr/share/man \
500 -type f -name "*${MY_SUFFIX}*" \ 498 -type f -name "*${MY_SUFFIX}*" \
501 -and -not -name "mysql_config${MY_SUFFIX}" \ 499 -and -not -name "mysql_config${MY_SUFFIX}" \
503 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}" 501 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
504 echo "${MY_LIBDIR#"/"}" >> "${filelist}" 502 echo "${MY_LIBDIR#"/"}" >> "${filelist}"
505 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}" 503 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
506 popd &>/dev/null 504 popd &>/dev/null
507 505
506}
507
508mysql_pkg_preinst() {
509
510 ## create a list of files, to be used
511 ## by external utilities
512 ## will be used in pkg_postinst
513 #local filelist="${TMPDIR}/FILELIST"
514 #pushd "${D}/" &>/dev/null
515 # mkdir -p "${ROOT}/var/lib/eselect/mysql/"
516 # env -i find usr/bin/ usr/sbin/ usr/share/man \
517 # -type f -name "*${MY_SUFFIX}*" \
518 # -and -not -name "mysql_config${MY_SUFFIX}" \
519 # > "${filelist}"
520 # echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
521 # echo "${MY_LIBDIR#"/"}" >> "${filelist}"
522 # echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
523 #popd &>/dev/null
524
508 enewgroup mysql 60 || die "problem adding group mysql" 525 enewgroup mysql 60 || die "problem adding group mysql"
509 enewuser mysql 60 -1 /dev/null mysql \ 526 enewuser mysql 60 -1 /dev/null mysql \
510 || die "problem adding user mysql" 527 || die "problem adding user mysql"
511} 528}
512 529
522 #secure the logfiles... does this bother anybody? 539 #secure the logfiles... does this bother anybody?
523 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} 540 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
524 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* 541 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
525 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* 542 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
526 543
527 # list of files, to be used 544 ## list of files, to be used
528 # by external utilities 545 ## by external utilities
529 mkdir -p "${ROOT}/var/lib/eselect/mysql/" 546 #mkdir -p "${ROOT}/var/lib/eselect/mysql/"
530 cp "${TMPDIR}/FILELIST" "${ROOT}/var/lib/eselect/mysql/mysql${MY_SUFFIX}.filelist" 547 #cp "${TMPDIR}/FILELIST" "${ROOT}/var/lib/eselect/mysql/mysql${MY_SUFFIX}.filelist"
531 548
532 if ! useq minimal; then 549 if ! useq minimal; then
533 if [[ ${SLOT} -gt 0 ]] ; then 550 if [[ ${SLOT} -gt 0 ]] ; then
534 if [[ -f "${ROOT}/usr/sbin/mysqld" ]] ; then 551 #if [[ -f "${ROOT}/usr/sbin/mysqld" ]] ; then
535 einfo "you may want to read:" 552 einfo "you may want to read:"
536 einfo "http://www.gentoo.org/doc/en/mysql-upgrade-slotted.xml" 553 einfo "http://www.gentoo.org/doc/en/mysql-upgrade-slotted.xml"
537 else 554 #else
538 local tmpres="$( eselect mysql show )" 555 # local tmpres="$( eselect mysql show )"
539 # "like grep -q unset" 556 # # "like grep -q unset"
540 if [[ "{$tmpres}" == "{$tmpres/unset/}" ]] ; then 557 # if [[ "{$tmpres}" == "{$tmpres/unset/}" ]] ; then
541 eselect mysql set 1 558 # eselect mysql set 1
542 else 559 # else
543 einfo "The version of mysql emerged now stils is _NOT_ the default" 560 # einfo "The version of mysql emerged now stils is _NOT_ the default"
544 einfo "you may want to run \"eselect myqsl list\" followed by a " 561 einfo "you may want to run \"eselect myqsl list\" followed by a "
545 einfo "\"eselect myqsl set 1\" to chose the default mysql server" 562 einfo "\"eselect myqsl set 1\" to chose the default mysql server"
546 fi 563 # fi
547 fi 564 #fi
548 fi 565 fi
549 566
550 # your friendly public service announcement... 567 # your friendly public service announcement...
551 einfo 568 einfo
552 einfo "You might want to run:" 569 einfo "You might want to run:"
663 einfo "stopping the server," 680 einfo "stopping the server,"
664 wait %1 681 wait %1
665 einfo "done" 682 einfo "done"
666} 683}
667 684
685mysql_pkg_prerm() {
686 # external program
687 eselect mysql slot_remove "${SLOT}"
688}
689
668mysql_pkg_postrm() { 690mysql_pkg_postrm() {
669 mysql_lib_symlinks 691 mysql_lib_symlinks
670 if [[ ${SLOT} -gt 0 ]] ; then 692 if [[ ${SLOT} -gt 0 ]] ; then
671 einfo "you may want to run \"eselect myqsl list\" followed by a " 693 einfo "you may want to run \"eselect myqsl list\" followed by a "
672 einfo "\"eselect myqsl list\" to chose the default mysql server" 694 einfo "\"eselect myqsl list\" to chose the default mysql server"

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20