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

Diff of /eclass/mysql.eclass

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

Revision 1.11 Revision 1.12
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.11 2006/01/31 00:55:36 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.12 2006/01/31 19:47:50 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
488 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql" 488 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql"
489} 489}
490 490
491mysql_pkg_preinst() { 491mysql_pkg_preinst() {
492 492
493 enewgroup mysql 60 || die "problem adding group mysql"
494 enewuser mysql 60 -1 /dev/null mysql \
495 || die "problem adding user mysql"
496}
497
498mysql_pkg_postinst() {
499
500 mysql_init_vars
501 mysql_lib_symlinks
502
503 # mind at FEATURES=collision-protect before to remove this
504 [ -d "${ROOT}/var/log/mysql" ] \
505 || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
506
507 #secure the logfiles... does this bother anybody?
508 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
509 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
510 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
511
512 # create a list of files, to be used 493 # create a list of files, to be used
513 # by external utilities 494 # by external utilities
514 # uncompressed because of the small size 495 # will be used in pkg_postinst
515 local filelist="${ROOT}/var/lib/eselect/mysql/mysql${MY_SUFFIX}" 496 local filelist="${TMPDIR}/FILELIST"
516 pushd "${D}/" &>/dev/null 497 pushd "${D}/" &>/dev/null
517 mkdir -p "${ROOT}/var/lib/eselect/mysql/" 498 mkdir -p "${ROOT}/var/lib/eselect/mysql/"
518 env -i find usr/bin/ usr/sbin/ usr/share/man \ 499 env -i find usr/bin/ usr/sbin/ usr/share/man \
519 -type f -name "*${MY_SUFFIX}*" \ 500 -type f -name "*${MY_SUFFIX}*" \
520 -and -not -name "mysql_config${MY_SUFFIX}" \ 501 -and -not -name "mysql_config${MY_SUFFIX}" \
521 > "${filelist}.filelist" 502 > "${filelist}"
522 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}.filelist" 503 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
523 echo "${MY_LIBDIR#"/"}" >> "${filelist}.filelist" 504 echo "${MY_LIBDIR#"/"}" >> "${filelist}"
524 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}.filelist" 505 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
525 popd &>/dev/null 506 popd &>/dev/null
507
508 enewgroup mysql 60 || die "problem adding group mysql"
509 enewuser mysql 60 -1 /dev/null mysql \
510 || die "problem adding user mysql"
511}
512
513mysql_pkg_postinst() {
514
515 mysql_init_vars
516 mysql_lib_symlinks
517
518 # mind at FEATURES=collision-protect before to remove this
519 [ -d "${ROOT}/var/log/mysql" ] \
520 || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
521
522 #secure the logfiles... does this bother anybody?
523 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
524 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
525 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
526
527 # list of files, to be used
528 # by external utilities
529 mkdir -p "${ROOT}/var/lib/eselect/mysql/"
530 cp "${TMPDIR}/FILELIST" "${ROOT}/var/lib/eselect/mysql/mysql${MY_SUFFIX}"
526 531
527 if ! useq minimal; then 532 if ! useq minimal; then
528 if [[ ${SLOT} -gt 0 ]] ; then 533 if [[ ${SLOT} -gt 0 ]] ; then
529 if [[ -f "${ROOT}/usr/sbin/mysqld" ]] ; then 534 if [[ -f "${ROOT}/usr/sbin/mysqld" ]] ; then
530 einfo "you may want to read:" 535 einfo "you may want to read:"

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20