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

Diff of /eclass/mysql.eclass

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

Revision 1.2 Revision 1.19
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/Attic/mysql.eclass,v 1.2 2006/01/04 20:25:14 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql.eclass,v 1.19 2006/02/18 10:54:23 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
14# and we will run a mysql server during test phase 14# and we will run a mysql server during test phase
15S="${WORKDIR}/${PN}" 15S="${WORKDIR}/${PN}"
16 16
17DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" 17DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
18HOMEPAGE="http://www.mysql.com/" 18HOMEPAGE="http://www.mysql.com/"
19NEWP="${PN}-${PV/_/-}" 19NEWP="${P/_/-}"
20SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${NEWP}.tar.gz 20SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${NEWP}.tar.gz
21 mirror://gentoo/mysql-extras-20051220.tar.bz2" 21 mirror://gentoo/mysql-extras-20060115.tar.bz2"
22
23LICENSE="GPL-2" 22LICENSE="GPL-2"
24KEYWORDS="-*"
25IUSE="big-tables berkdb debug minimal perl selinux ssl static" 23IUSE="big-tables berkdb debug minimal perl selinux srvdir ssl static"
26RESTRICT="primaryuri" 24RESTRICT="primaryuri confcache"
25DEPEND="app-admin/eselect-mysql"
27 26
28mysql_version_is_at_least "4.01.03.00" \ 27mysql_version_is_at_least "4.01.03.00" \
29&& IUSE="${IUSE} cluster utf8 extraengine" 28&& IUSE="${IUSE} cluster extraengine"
30 29
31mysql_version_is_at_least "5.00.18.00" \ 30mysql_version_is_at_least "5.00.18.00" \
32&& IUSE="${IUSE} max-idx-128" 31&& IUSE="${IUSE} max-idx-128"
33 32
34mysql_version_is_at_least "5.01.00.00" \ 33mysql_version_is_at_least "5.01.00.00" \
35&& IUSE="${IUSE} innodb" 34&& IUSE="${IUSE} innodb"
36 35
37EXPORT_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
38# void mysql_init_vars()
39#
40# initialize global variables
41# 2005-11-19 <vivo at gentoo.org>
42mysql_init_vars() {
43
44 if [[ ${SLOT} -eq 0 ]] ; then
45 MY_SUFFIX=""
46 else
47 MY_SUFFIX=${MY_SUFFIX:-"-${SLOT}"}
48 fi
49 MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR:-"/usr/share/mysql${MY_SUFFIX}"}
50 MY_SYSCONFDIR=${MY_SYSCONFDIR="/etc/mysql${MY_SUFFIX}"}
51 MY_LIBDIR=${MY_LIBDIR="/usr/$(get_libdir)/mysql${MY_SUFFIX}"}
52 MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="/var/lib/mysql${MY_SUFFIX}"}
53 MY_LOGDIR=${MY_LOGDIR="/var/log/mysql${MY_SUFFIX}"}
54 MY_INCLUDEDIR=${MY_INCLUDEDIR="/usr/include/mysql${MY_SUFFIX}"}
55
56 if [ -z "${DATADIR}" ]; then
57 DATADIR=""
58 if [ -f "${MY_SYSCONFDIR}/my.cnf" ] ; then
59 DATADIR=`"my_print_defaults${MY_SUFFIX}" mysqld 2>/dev/null | sed -ne '/datadir/s|^--datadir=||p' | tail -n1`
60 if [ -z "${DATADIR}" ]; then
61 if useq "srvdir" ; then
62 DATADIR="${ROOT}/srv/localhost/mysql${MY_SUFFIX}/datadir"
63 else
64 DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" | sed -e 's/.*=\s*//'`
65 fi
66 fi
67 fi
68 if [ -z "${DATADIR}" ]; then
69 if useq "srvdir" ; then
70 DATADIR="${ROOT}/srv/localhost/mysql${MY_SUFFIX}/datadir"
71 else
72 DATADIR="${MY_LOCALSTATEDIR}"
73 fi
74 einfo "Using default DATADIR"
75 fi
76 einfo "MySQL DATADIR is ${DATADIR}"
77
78 if [ -z "${PREVIOUS_DATADIR}" ] ; then
79 if [ -a "${DATADIR}" ] ; then
80 ewarn "Previous datadir found, it's YOUR job to change"
81 ewarn "ownership and have care of it"
82 PREVIOUS_DATADIR="yes"
83 export PREVIOUS_DATADIR
84 else
85 PREVIOUS_DATADIR="no"
86 export PREVIOUS_DATADIR
87 fi
88 fi
89 fi
90
91 export MY_SUFFIX MY_SHAREDSTATEDIR MY_SYSCONFDIR
92 export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR
93 export MY_INCLUDEDIR
94 export DATADIR
95}
38 96
39mysql_pkg_setup() { 97mysql_pkg_setup() {
40 98
41 enewgroup mysql 60 || die "problem adding group mysql" 99 enewgroup mysql 60 || die "problem adding group mysql"
42 enewuser mysql 60 -1 /dev/null mysql \ 100 enewuser mysql 60 -1 /dev/null mysql \
60 die "USEs cluster, extraengine conflicts with \"minimal\"" 118 die "USEs cluster, extraengine conflicts with \"minimal\""
61 fi 119 fi
62 120
63 unpack ${A} || die 121 unpack ${A} || die
64 122
65 mv "${WORKDIR}/${NEWP}" "${S}" 123 mv -f "${WORKDIR}/${NEWP}" "${S}"
66 cd "${S}" 124 cd "${S}"
67 125
68 EPATCH_SUFFIX="patch" 126 EPATCH_SUFFIX="patch"
69 mkdir -p "${EPATCH_SOURCE}" || die "unable to create epatch directory" 127 mkdir -p "${EPATCH_SOURCE}" || die "unable to create epatch directory"
70 mysql_mv_patches 128 mysql_mv_patches
104 bdbdir='bdb/dist' 162 bdbdir='bdb/dist'
105 fi 163 fi
106 164
107 for d in ${rebuilddirlist}; do 165 for d in ${rebuilddirlist}; do
108 einfo "reconfiguring dir \"${d}\"" 166 einfo "reconfiguring dir \"${d}\""
109 pushd "${d}" 167 pushd "${d}" &>/dev/null
110 for buildstep in \ 168 for buildstep in \
111 'libtoolize --copy --force' \ 169 'libtoolize --copy --force' \
112 'aclocal --force' \ 170 'aclocal --force' \
113 'autoheader --force -Wnone' \ 171 'autoheader --force -Wnone' \
114 'autoconf --force -Wnone' \ 172 'autoconf --force -Wnone' \
116 'gnuconfig_update' 174 'gnuconfig_update'
117 do 175 do
118 einfo "performing ${buildstep}" 176 einfo "performing ${buildstep}"
119 ${buildstep} || die "failed ${buildstep/ */} dir \"${d}\"" 177 ${buildstep} || die "failed ${buildstep/ */} dir \"${d}\""
120 done 178 done
121 popd 179 popd &>/dev/null
122 done 180 done
123 181
124 if ! mysql_check_version_range "5.01.00.00 to 5.01.06.99" ; then 182 if useq berkdb && ! mysql_check_version_range "5.01.00.00 to 5.01.06.99"
183 then
125 [[ -w "${bdbdir}/ltmain.sh" ]] && cp ltmain.sh "${bdbdir}/ltmain.sh" 184 [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f ltmain.sh "${bdbdir}/ltmain.sh"
126 pushd "${bdbdir}" && sh s_all || die "failed bdb reconfigure" 185 pushd "${bdbdir}" && sh s_all || die "failed bdb reconfigure" &>/dev/null
127 popd 186 popd &>/dev/null
128 fi 187 fi
129 188
130} 189}
131 190
132src_compile() { 191mysql_src_compile() {
133 192
134 mysql_init_vars 193 mysql_init_vars
135 local myconf 194 local myconf
136 195
137 if useq static ; then 196 if useq static ; then
190 else 249 else
191 myconf="${myconf} --with-raid" 250 myconf="${myconf} --with-raid"
192 fi 251 fi
193 252
194 if ! mysql_version_is_at_least "5.00.00.00" ; then 253 if ! mysql_version_is_at_least "5.00.00.00" ; then
195 if mysql_version_is_at_least "4.01.00.00" && useq utf8; then 254 if mysql_version_is_at_least "4.01.00.00" ; then
196 myconf="${myconf} --with-charset=utf8" 255 myconf="${myconf} --with-charset=utf8"
197 myconf="${myconf} --with-collation=utf8_general_ci" 256 myconf="${myconf} --with-collation=utf8_general_ci"
198 else 257 else
199 myconf="${myconf} --with-charset=latin1" 258 myconf="${myconf} --with-charset=latin1"
200 myconf="${myconf} --with-collation=latin1_swedish_ci" 259 myconf="${myconf} --with-collation=latin1_swedish_ci"
230 myconf="${myconf} --with-geometry" 289 myconf="${myconf} --with-geometry"
231 myconf="${myconf} $(use_with cluster ndbcluster)" 290 myconf="${myconf} $(use_with cluster ndbcluster)"
232 fi 291 fi
233 292
234 mysql_version_is_at_least "4.01.11.00" && myconf="${myconf} `use_with big-tables`" 293 mysql_version_is_at_least "4.01.11.00" && myconf="${myconf} `use_with big-tables`"
294
295 mysql_version_is_at_least "5.01.06.00" && myconf="${myconf} --with-ndb-binlog"
235 else 296 else
236 for i in ${minimal_exclude_list}; do 297 for i in ${minimal_exclude_list}; do
237 myconf="${myconf} --without-${i}" 298 myconf="${myconf} --without-${i}"
238 done 299 done
239 myconf="${myconf} --without-berkeley-db" 300 myconf="${myconf} --without-berkeley-db"
262 if mysql_version_is_at_least "5.01.00.00" ; then 323 if mysql_version_is_at_least "5.01.00.00" ; then
263 myconf="${myconf} --with-partition" 324 myconf="${myconf} --with-partition"
264 fi 325 fi
265 fi 326 fi
266 327
328 fi
329
267 mysql_version_is_at_least "5.00.18.00" \ 330 mysql_version_is_at_least "5.00.18.00" \
268 && useq "max-idx-128" \ 331 && useq "max-idx-128" \
269 && myconf="${myconf} --with-max-indexes=128" 332 && myconf="${myconf} --with-max-indexes=128"
333
334 if mysql_version_is_at_least "5.01.05.00" ; then
335 myconf="${myconf} --with-row-based-replication"
270 fi 336 fi
271 337
272 #Bug #114895,Bug #110149 338 #Bug #114895,Bug #110149
273 filter-flags "-O" "-O[01]" 339 filter-flags "-O" "-O[01]"
274 #glibc-2.3.2_pre fix; bug #16496 340 #glibc-2.3.2_pre fix; bug #16496
293 --enable-local-infile \ 359 --enable-local-infile \
294 --with-mysqld-user=mysql \ 360 --with-mysqld-user=mysql \
295 --with-client-ldflags=-lstdc++ \ 361 --with-client-ldflags=-lstdc++ \
296 --enable-thread-safe-client \ 362 --enable-thread-safe-client \
297 --with-comment="Gentoo Linux ${PF}" \ 363 --with-comment="Gentoo Linux ${PF}" \
298 --with-unix-socket-path="/var/run/mysqld/mysqld${MY_SUFFIX}.sock" \ 364 --with-unix-socket-path="/var/run/mysqld/mysqld.sock" \
299 --with-zlib-dir=/usr \ 365 --with-zlib-dir=/usr \
300 --with-lib-ccflags="-fPIC" \ 366 --with-lib-ccflags="-fPIC" \
301 --without-readline \ 367 --without-readline \
302 --without-docs \ 368 --without-docs \
303 ${myconf} || die "bad ./configure" 369 ${myconf} || die "bad ./configure"
331 binary-configure* my-*.cnf mi_test_all* 397 binary-configure* my-*.cnf mi_test_all*
332 do 398 do
333 rm -f ${D}/usr/share/mysql/${removeme} 399 rm -f ${D}/usr/share/mysql/${removeme}
334 done 400 done
335 401
336 # oops
337 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \
338 && cp "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0.15" "${D}/usr/share/mysql${MY_SUFFIX}/"
339
340 # TODO change at Makefile-am level 402 # TODO change at Makefile-am level
341 for moveme in "mysql_fix_privilege_tables.sql" \ 403 for moveme in "mysql_fix_privilege_tables.sql" \
342 "fill_help_tables.sql" "ndb-config-2-node.ini" 404 "fill_help_tables.sql" "ndb-config-2-node.ini"
343 do 405 do
344 mv "${D}/usr/share/mysql/${moveme}" "${D}/usr/share/mysql${MY_SUFFIX}/" 2>/dev/null 406 mv -f "${D}/usr/share/mysql/${moveme}" "${D}/usr/share/mysql${MY_SUFFIX}/" 2>/dev/null
345 done 407 done
346 408
347 if [[ -n "${MY_SUFFIX}" ]] ; then 409 if [[ -n "${MY_SUFFIX}" ]] ; then
348 local notcatched=$(ls "${D}/usr/share/mysql"/*) 410 local notcatched=$(ls "${D}/usr/share/mysql"/*)
349 if [[ -n "${notcatched}" ]] ; then 411 if [[ -n "${notcatched}" ]] ; then
364 fi 426 fi
365 427
366 # config stuff 428 # config stuff
367 insinto "${MY_SYSCONFDIR}" 429 insinto "${MY_SYSCONFDIR}"
368 doins scripts/mysqlaccess.conf 430 doins scripts/mysqlaccess.conf
431 sed -e "s!@MY_SUFFIX@!${MY_SUFFIX}!g" \
432 -e "s!@DATADIR@!${DATADIR}!g" \
433 "${FILESDIR}/my.cnf-4.1-r1" \
434 > "${TMPDIR}/my.cnf.ok"
369 newins "${FILESDIR}/my.cnf-4.1" my.cnf 435 newins "${TMPDIR}/my.cnf.ok" my.cnf
436
370 insinto "/etc/conf.d" 437 insinto "/etc/conf.d"
371 newins "${FILESDIR}/mysql-slot.conf.d-r1" "mysql" 438 newins "${FILESDIR}/mysql-slot.conf.d-r1" "mysql"
372 mysql_version_is_at_least "5.00.11.00" \ 439 mysql_version_is_at_least "5.00.11.00" \
373 && newins "${FILESDIR}/mysqlmanager-slot.conf.d" "mysqlmanager" 440 && newins "${FILESDIR}/mysqlmanager-slot.conf.d" "mysqlmanager"
374 441
375 local charset='utf8'
376 ! useq utf8 && local charset='latin1'
377 sed --in-place \
378 -e "s/@MY_SUFFIX@/${MY_SUFFIX}/" \
379 -e "s/@CHARSET@/${charset}/" \
380 "${D}/etc/mysql${MY_SUFFIX}/my.cnf"
381
382 # minimal builds don't have the server 442 # minimal builds don't have the server
383 if ! useq minimal; then 443 if ! useq minimal; then
384 exeinto /etc/init.d 444 exeinto /etc/init.d
385 newexe "${FILESDIR}/mysql-slot.rc6-r1" "mysql" 445 newexe "${FILESDIR}/mysql-slot.rc6-r3" "mysql"
446
386 mysql_version_is_at_least "5.00.11.00" \ 447 mysql_version_is_at_least "5.00.11.00" \
387 && newexe "${FILESDIR}/mysqlmanager-slot.rc6" "mysqlmanager" 448 && newexe "${FILESDIR}/mysqlmanager-slot.rc6" "mysqlmanager"
388 insinto /etc/logrotate.d 449 insinto /etc/logrotate.d
389 # TODO 450 sed -e "s!___MY_SUFFIX___!${MY_SUFFIX}!g" \
451 "${FILESDIR}/logrotate-slot.mysql" \
452 > "${TMPDIR}/logrotate.mysql"
390 newins "${FILESDIR}/logrotate.mysql" "mysql${MY_SUFFIX}" 453 newins "${TMPDIR}/logrotate.mysql" "mysql${MY_SUFFIX}"
391 454
392 #empty dirs... 455 #empty dirs...
393 diropts "-m0750" 456 diropts "-m0750"
394 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 457 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
395 dodir "${DATADIR}" 458 dodir "${DATADIR}"
417 do 480 do
418 dodoc "${script}" 481 dodoc "${script}"
419 done 482 done
420 483
421 docinto "scripts" 484 docinto "scripts"
422 for script in \ 485 for script in scripts/mysql* ; do
423 $(ls scripts/mysql* | grep -v '.sh$') 486 [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
424 do
425 dodoc "${script}"
426 done 487 done
427 fi 488 fi
489
490 # oops, temporary fix
491 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \
492 && cp -f \
493 "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0" \
494 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql"
495
496 # MOVED HERE DUE TO BUG #121445
497 # create a list of files, to be used
498 # by external utilities
499 mkdir -p "${D}/var/lib/eselect/mysql/"
500 local filelist="${D}/var/lib/eselect/mysql/mysql${MY_SUFFIX}.filelist"
501 pushd "${D}/" &>/dev/null
502 env -i find usr/bin/ usr/sbin/ usr/share/man \
503 -type f -name "*${MY_SUFFIX}*" \
504 -and -not -name "mysql_config${MY_SUFFIX}" \
505 > "${filelist}"
506 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
507 echo "${MY_LIBDIR#"/"}" >> "${filelist}"
508 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
509 popd &>/dev/null
510
428} 511}
429 512
430mysql_pkg_preinst() { 513mysql_pkg_preinst() {
514
515 ## create a list of files, to be used
516 ## by external utilities
517 ## will be used in pkg_postinst
518 #local filelist="${TMPDIR}/FILELIST"
519 #pushd "${D}/" &>/dev/null
520 # mkdir -p "${ROOT}/var/lib/eselect/mysql/"
521 # env -i find usr/bin/ usr/sbin/ usr/share/man \
522 # -type f -name "*${MY_SUFFIX}*" \
523 # -and -not -name "mysql_config${MY_SUFFIX}" \
524 # > "${filelist}"
525 # echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
526 # echo "${MY_LIBDIR#"/"}" >> "${filelist}"
527 # echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
528 #popd &>/dev/null
431 529
432 enewgroup mysql 60 || die "problem adding group mysql" 530 enewgroup mysql 60 || die "problem adding group mysql"
433 enewuser mysql 60 -1 /dev/null mysql \ 531 enewuser mysql 60 -1 /dev/null mysql \
434 || die "problem adding user mysql" 532 || die "problem adding user mysql"
435} 533}
446 #secure the logfiles... does this bother anybody? 544 #secure the logfiles... does this bother anybody?
447 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} 545 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
448 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* 546 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
449 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* 547 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
450 548
549 ## list of files, to be used
550 ## by external utilities
551 #mkdir -p "${ROOT}/var/lib/eselect/mysql/"
552 #cp "${TMPDIR}/FILELIST" "${ROOT}/var/lib/eselect/mysql/mysql${MY_SUFFIX}.filelist"
553
451 if ! useq minimal; then 554 if ! useq minimal; then
555 if [[ ${SLOT} -gt 0 ]] ; then
556 #if [[ -f "${ROOT}/usr/sbin/mysqld" ]] ; then
557 einfo "you may want to read:"
558 einfo "http://www.gentoo.org/doc/en/mysql-upgrade-slotted.xml"
559 #else
560 # local tmpres="$( eselect mysql show )"
561 # # "like grep -q unset"
562 # if [[ "{$tmpres}" == "{$tmpres/unset/}" ]] ; then
563 # eselect mysql set 1
564 # else
565 # einfo "The version of mysql emerged now stils is _NOT_ the default"
566 einfo "you may want to run \"eselect mysql list\" followed by a "
567 einfo "\"eselect mysql set 1\" to choose the default mysql server"
568 # fi
569 #fi
570 fi
571
452 # your friendly public service announcement... 572 # your friendly public service announcement...
453 einfo 573 einfo
454 einfo "You might want to run:" 574 einfo "You might want to run:"
455 einfo "\"emerge --config =${CATEGORY}/${PF}\"" 575 einfo "\"emerge --config =${CATEGORY}/${PF}\""
456 einfo "if this is a new install." 576 einfo "if this is a new install."
457 einfo 577 einfo
458 fi
459
460 einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream." 578 einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream."
579 fi
461} 580}
462 581
463mysql_pkg_config() { 582mysql_pkg_config() {
464 mysql_init_vars 583 mysql_init_vars
465 [[ -z "${DATADIR}" ]] && die "sorry, unable to find DATADIR" 584 [[ -z "${DATADIR}" ]] && die "sorry, unable to find DATADIR"
494 fi 613 fi
495 614
496 local options="" 615 local options=""
497 local sqltmp="$(emktemp)" 616 local sqltmp="$(emktemp)"
498 617
499 local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" 618 local help_tables="${MY_SHAREDSTATEDIR}/fill_help_tables.sql"
500 [[ -r "${help_tables}" ]] \ 619 [[ -r "${help_tables}" ]] \
501 && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ 620 && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \
502 || touch "${TMPDIR}/fill_help_tables.sql" 621 || touch "${TMPDIR}/fill_help_tables.sql"
503 help_tables="${TMPDIR}/fill_help_tables.sql" 622 help_tables="${TMPDIR}/fill_help_tables.sql"
504 623
505 pushd "${TMPDIR}" 624 pushd "${TMPDIR}" &>/dev/null
506 ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR" 625 ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR"
507 popd 626 popd &>/dev/null
508 [[ -f ${ROOT}/${DATADIR}/mysql/user.frm ]] || die "MySQL databases not installed" 627 [[ -f ${ROOT}/${DATADIR}/mysql/user.frm ]] || die "MySQL databases not installed"
509 chown -R mysql:mysql ${ROOT}/${DATADIR} 2> /dev/null 628 chown -R mysql:mysql ${ROOT}/${DATADIR} 2> /dev/null
510 chmod 0750 ${ROOT}/${DATADIR} 2> /dev/null 629 chmod 0750 ${ROOT}/${DATADIR} 2> /dev/null
511 630
512 if mysql_version_is_at_least "4.01.03.00" ; then 631 if mysql_version_is_at_least "4.01.03.00" ; then
520 if [[ -r "${help_tables}" ]] ; then 639 if [[ -r "${help_tables}" ]] ; then
521 cat "${help_tables}" >> "${sqltmp}" 640 cat "${help_tables}" >> "${sqltmp}"
522 fi 641 fi
523 fi 642 fi
524 643
525 local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock 644 local socket=${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock
526 local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock 645 local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.pid
527 local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ 646 local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \
528 ${options} \ 647 ${options} \
529 --user=mysql \ 648 --user=mysql \
530 --skip-grant-tables \ 649 --skip-grant-tables \
531 --basedir=${ROOT}/usr \ 650 --basedir=${ROOT}/usr \
566 einfo "stopping the server," 685 einfo "stopping the server,"
567 wait %1 686 wait %1
568 einfo "done" 687 einfo "done"
569} 688}
570 689
690mysql_pkg_prerm() {
691 # external program
692 eselect mysql slot_remove "${SLOT}"
693}
694
571mysql_pkg_postrm() { 695mysql_pkg_postrm() {
572 mysql_lib_symlinks 696 mysql_lib_symlinks
697 if [[ ${SLOT} -gt 0 ]] ; then
698 einfo "you may want to run \"eselect mysql list\" followed by a "
699 einfo "\"eselect mysql list\" to choose the default mysql server"
700 fi
573} 701}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20