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

Diff of /eclass/mysql.eclass

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

Revision 1.4 Revision 1.5
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.4 2006/01/07 16:43:39 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.5 2006/01/08 23:29:20 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
361 # config stuff 361 # config stuff
362 insinto "${MY_SYSCONFDIR}" 362 insinto "${MY_SYSCONFDIR}"
363 doins scripts/mysqlaccess.conf 363 doins scripts/mysqlaccess.conf
364 newins "${FILESDIR}/my.cnf-4.1" my.cnf 364 newins "${FILESDIR}/my.cnf-4.1" my.cnf
365 insinto "/etc/conf.d" 365 insinto "/etc/conf.d"
366 newins "${FILESDIR}/mysql-slot.conf.d-r1" "mysql" 366 newins "${FILESDIR}/mysql-slot.conf.d-r2" "mysql"
367 mysql_version_is_at_least "5.00.11.00" \ 367 mysql_version_is_at_least "5.00.11.00" \
368 && newins "${FILESDIR}/mysqlmanager-slot.conf.d" "mysqlmanager" 368 && newins "${FILESDIR}/mysqlmanager-slot.conf.d" "mysqlmanager"
369 369
370 local charset='utf8' 370 local charset='utf8'
371 ! useq utf8 && local charset='latin1' 371 ! useq utf8 && local charset='latin1'
375 "${D}/etc/mysql${MY_SUFFIX}/my.cnf" 375 "${D}/etc/mysql${MY_SUFFIX}/my.cnf"
376 376
377 # minimal builds don't have the server 377 # minimal builds don't have the server
378 if ! useq minimal; then 378 if ! useq minimal; then
379 exeinto /etc/init.d 379 exeinto /etc/init.d
380 newexe "${FILESDIR}/mysql-slot.rc6-r1" "mysql" 380 newexe "${FILESDIR}/mysql-slot.rc6-r2" "mysql"
381 [[ ${SLOT} -gt 0 ]] && dosym "/etc/init.d/mysql" "/etc/init.d/mysql${MY_SUFFIX}"
382
381 mysql_version_is_at_least "5.00.11.00" \ 383 mysql_version_is_at_least "5.00.11.00" \
382 && newexe "${FILESDIR}/mysqlmanager-slot.rc6" "mysqlmanager" 384 && newexe "${FILESDIR}/mysqlmanager-slot.rc6" "mysqlmanager"
383 insinto /etc/logrotate.d 385 insinto /etc/logrotate.d
384 # TODO 386 # TODO
385 newins "${FILESDIR}/logrotate.mysql" "mysql${MY_SUFFIX}" 387 newins "${FILESDIR}/logrotate.mysql" "mysql${MY_SUFFIX}"
422 # oops, temporary fix 424 # oops, temporary fix
423 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \ 425 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \
424 && cp -f \ 426 && cp -f \
425 "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0.15" \ 427 "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0.15" \
426 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql" 428 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql"
427
428 # create a list of executable files, to be used
429 # by external utilities
430 # uncompressed because of the small size
431 local exelist="usr/share/mysql${MY_SUFFIX}/.exe-list"
432 pushd "${D}/" &>/dev/null
433 env -i find usr/bin/ usr/sbin/ usr/share/man \
434 -type f -name "*${MY_SUFFIX}*" \
435 > "${exelist}"
436 echo "${MY_SYSCONFDIR##"/"}" >> "${exelist}"
437 echo "${MY_INCLUDEDIR##"/"}" >> "${exelist}"
438 echo "${MY_LIBDIR##"/"}" >> "${exelist}"
439 echo "${MY_SHAREDSTATEDIR##"/"}" >> "${exelist}"
440 popd &>/dev/null
441} 429}
442 430
443mysql_pkg_preinst() { 431mysql_pkg_preinst() {
444 432
445 enewgroup mysql 60 || die "problem adding group mysql" 433 enewgroup mysql 60 || die "problem adding group mysql"
459 #secure the logfiles... does this bother anybody? 447 #secure the logfiles... does this bother anybody?
460 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} 448 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
461 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* 449 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
462 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* 450 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
463 451
452 # create a list of files, to be used
453 # by external utilities
454 # uncompressed because of the small size
455 local filelist="${ROOT}/var/lib/eselect/mysql/mysql${MY_SUFFIX}"
456 pushd "${D}/" &>/dev/null
457 mkdir -p "${ROOT}/var/lib/eselect/mysql/"
458 env -i find usr/bin/ usr/sbin/ usr/share/man \
459 -type f -name "*${MY_SUFFIX}*" \
460 > "${filelist}.filelist"
461 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}.filelist"
462 echo "${MY_INCLUDEDIR#"/"}" >> "${filelist}.filelist"
463 echo "${MY_LIBDIR#"/"}" >> "${filelist}.filelist"
464 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}.filelist"
465 popd &>/dev/null
466
464 if ! useq minimal; then 467 if ! useq minimal; then
468 if [[ ${SLOT} -gt 0 ]] ; then
469 if [[ -f "${ROOT}/usr/sbin/mysqld" ]] ; then
470 einfo "you may want to run unmerge any unslotted MySQL versions with "
471 einfo "emerge -C --pretend dev-db/mysql"
472 einfo "emerge -C =dev-db/mysql-X.Y.Z"
473 einfo "After the unmerge run \"eselect myqsl list\" followed by a "
474 einfo "\"eselect myqsl set 1\" to chose the default mysql server"
475 else
476 local tmpres="$( eselect mysql show )"
477 # "like grep -q unset"
478 if [[ "{$tmpres}" == "{$tmpres/unset/}" ]] ; then
479 eselect mysql set 1
480 else
481 einfo "The version of mysql emerged now stils is _NOT_ the default"
482 einfo "you may want to run \"eselect myqsl list\" followed by a "
483 einfo "\"eselect myqsl set 1\" to chose the default mysql server"
484 fi
485 fi
486 fi
487
465 # your friendly public service announcement... 488 # your friendly public service announcement...
466 einfo 489 einfo
467 einfo "You might want to run:" 490 einfo "You might want to run:"
468 einfo "\"emerge --config =${CATEGORY}/${PF}\"" 491 einfo "\"emerge --config =${CATEGORY}/${PF}\""
469 einfo "if this is a new install." 492 einfo "if this is a new install."
470 einfo 493 einfo
471 fi
472
473 einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream." 494 einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream."
474 if [[ ${SLOT} -gt 0 ]] ; then
475 einfo "you may want to run \"eselect myqsl list\" followed by a "
476 einfo "\"eselect myqsl list\" to chose the default mysql server"
477 einfo "Prior to do this unmerge any unslotted MySQL versions with "
478 einfo "emerge -C -p dev-db/mysql <<< NOTICE the \"-p\""
479 einfo "emerge -C =dev-db/mysql-X.Y.Z"
480 fi 495 fi
481} 496}
482 497
483mysql_pkg_config() { 498mysql_pkg_config() {
484 mysql_init_vars 499 mysql_init_vars

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20