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

Diff of /eclass/mysql.eclass

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

Revision 1.6 Revision 1.22
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.6 2006/01/14 19:00:32 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.22 2006/03/03 09:28:58 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 autotools mysql_fx
9 9
10#major, minor only in the slot 10#major, minor only in the slot
11SLOT=$(( ${MYSQL_VERSION_ID} / 10000 )) 11SLOT=$(( ${MYSQL_VERSION_ID} / 10000 ))
12 12
13# shorten the path because the socket path length must be shorter than 107 chars 13# shorten the path because the socket path length must be shorter than 107 chars
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-20060114.tar.bz2" 21 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
22LICENSE="GPL-2" 22LICENSE="GPL-2"
23IUSE="big-tables berkdb debug minimal perl selinux ssl static" 23IUSE="big-tables berkdb debug embedded minimal perl selinux srvdir ssl static"
24RESTRICT="primaryuri" 24RESTRICT="primaryuri confcache"
25DEPEND="app-admin/eselect-mysql" 25DEPEND="app-admin/eselect-mysql"
26 26
27mysql_version_is_at_least "4.01.03.00" \ 27mysql_version_is_at_least "4.01.03.00" \
28&& IUSE="${IUSE} cluster utf8 extraengine" 28&& IUSE="${IUSE} cluster extraengine"
29
30mysql_version_is_at_least "5.00.00.00" \
31|| IUSE="${IUSE} raid"
29 32
30mysql_version_is_at_least "5.00.18.00" \ 33mysql_version_is_at_least "5.00.18.00" \
31&& IUSE="${IUSE} max-idx-128" 34&& IUSE="${IUSE} max-idx-128"
32 35
33mysql_version_is_at_least "5.01.00.00" \ 36mysql_version_is_at_least "5.01.00.00" \
34&& IUSE="${IUSE} innodb" 37&& IUSE="${IUSE} innodb"
35 38
36EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_config pkg_postrm 39EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_config pkg_prerm pkg_postrm
40
41# void mysql_init_vars()
42#
43# initialize global variables
44# 2005-11-19 <vivo at gentoo.org>
45mysql_init_vars() {
46
47 if [[ ${SLOT} -eq 0 ]] ; then
48 MY_SUFFIX=""
49 else
50 MY_SUFFIX=${MY_SUFFIX:-"-${SLOT}"}
51 fi
52 MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR:-"/usr/share/mysql${MY_SUFFIX}"}
53 MY_SYSCONFDIR=${MY_SYSCONFDIR="/etc/mysql${MY_SUFFIX}"}
54 MY_LIBDIR=${MY_LIBDIR="/usr/$(get_libdir)/mysql${MY_SUFFIX}"}
55 MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="/var/lib/mysql${MY_SUFFIX}"}
56 MY_LOGDIR=${MY_LOGDIR="/var/log/mysql${MY_SUFFIX}"}
57 MY_INCLUDEDIR=${MY_INCLUDEDIR="/usr/include/mysql${MY_SUFFIX}"}
58
59 if [ -z "${DATADIR}" ]; then
60 DATADIR=""
61 if [ -f "${MY_SYSCONFDIR}/my.cnf" ] ; then
62 DATADIR=`"my_print_defaults${MY_SUFFIX}" mysqld 2>/dev/null | sed -ne '/datadir/s|^--datadir=||p' | tail -n1`
63 if [ -z "${DATADIR}" ]; then
64 if useq "srvdir" ; then
65 DATADIR="${ROOT}/srv/localhost/mysql${MY_SUFFIX}/datadir"
66 else
67 DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" | sed -e 's/.*=\s*//'`
68 fi
69 fi
70 fi
71 if [ -z "${DATADIR}" ]; then
72 if useq "srvdir" ; then
73 DATADIR="${ROOT}/srv/localhost/mysql${MY_SUFFIX}/datadir"
74 else
75 DATADIR="${MY_LOCALSTATEDIR}"
76 fi
77 einfo "Using default DATADIR"
78 fi
79 einfo "MySQL DATADIR is ${DATADIR}"
80
81 if [ -z "${PREVIOUS_DATADIR}" ] ; then
82 if [ -a "${DATADIR}" ] ; then
83 ewarn "Previous datadir found, it's YOUR job to change"
84 ewarn "ownership and have care of it"
85 PREVIOUS_DATADIR="yes"
86 export PREVIOUS_DATADIR
87 else
88 PREVIOUS_DATADIR="no"
89 export PREVIOUS_DATADIR
90 fi
91 fi
92 fi
93
94 export MY_SUFFIX MY_SHAREDSTATEDIR MY_SYSCONFDIR
95 export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR
96 export MY_INCLUDEDIR
97 export DATADIR
98}
37 99
38mysql_pkg_setup() { 100mysql_pkg_setup() {
39 101
40 enewgroup mysql 60 || die "problem adding group mysql" 102 enewgroup mysql 60 || die "problem adding group mysql"
41 enewuser mysql 60 -1 /dev/null mysql \ 103 enewuser mysql 60 -1 /dev/null mysql \
71 133
72 # additional check, remove bundled zlib 134 # additional check, remove bundled zlib
73 rm -f "${S}/zlib/"*.[ch] 135 rm -f "${S}/zlib/"*.[ch]
74 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" 136 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
75 rm -f scripts/mysqlbug 137 rm -f scripts/mysqlbug
76
77 # Multilib issue with zlib detection
78 mysql_version_is_at_least "5.00.15.00" \
79 && sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \
80 "${S}/config/ac-macros/zlib.m4"
81 138
82 # Make charsets install in the right place 139 # Make charsets install in the right place
83 find . -name 'Makefile.am' \ 140 find . -name 'Makefile.am' \
84 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; 141 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
85 142
104 fi 161 fi
105 162
106 for d in ${rebuilddirlist}; do 163 for d in ${rebuilddirlist}; do
107 einfo "reconfiguring dir \"${d}\"" 164 einfo "reconfiguring dir \"${d}\""
108 pushd "${d}" &>/dev/null 165 pushd "${d}" &>/dev/null
109 for buildstep in \ 166 AT_GNUCONF_UPDATE="yes" eautoreconf
110 'libtoolize --copy --force' \
111 'aclocal --force' \
112 'autoheader --force -Wnone' \
113 'autoconf --force -Wnone' \
114 'automake --force --force-missing -Wnone' \
115 'gnuconfig_update'
116 do
117 einfo "performing ${buildstep}"
118 ${buildstep} || die "failed ${buildstep/ */} dir \"${d}\""
119 done
120 popd &>/dev/null 167 popd &>/dev/null
121 done 168 done
122 169
170 #TODO berkdb in 5.1 need to be worked on
123 if ! useq bdbdir && ! mysql_check_version_range "5.01.00.00 to 5.01.06.99" 171 if useq berkdb && ! mysql_check_version_range "5.01.00.00 to 5.01.08.99"
124 then 172 then
125 [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f ltmain.sh "${bdbdir}/ltmain.sh" 173 [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f ltmain.sh "${bdbdir}/ltmain.sh"
126 pushd "${bdbdir}" && sh s_all || die "failed bdb reconfigure" &>/dev/null 174 pushd "${bdbdir}" && sh s_all || die "failed bdb reconfigure" &>/dev/null
127 popd &>/dev/null 175 popd &>/dev/null
128 fi 176 fi
186 234
187 if useq static ; then 235 if useq static ; then
188 myconf="${myconf} --without-raid" 236 myconf="${myconf} --without-raid"
189 ewarn "disabling raid support, has problem with static" 237 ewarn "disabling raid support, has problem with static"
190 else 238 else
239 if mysql_version_is_at_least "5.00.00.00" ; then
191 myconf="${myconf} --with-raid" 240 myconf="${myconf} --without-raid"
241 else
242 myconf="${myconf} `use_with raid`"
243 fi
192 fi 244 fi
193 245
194 if ! mysql_version_is_at_least "5.00.00.00" ; then 246 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 247 if mysql_version_is_at_least "4.01.00.00" ; then
196 myconf="${myconf} --with-charset=utf8" 248 myconf="${myconf} --with-charset=utf8"
197 myconf="${myconf} --with-collation=utf8_general_ci" 249 myconf="${myconf} --with-collation=utf8_general_ci"
198 else 250 else
199 myconf="${myconf} --with-charset=latin1" 251 myconf="${myconf} --with-charset=latin1"
200 myconf="${myconf} --with-collation=latin1_swedish_ci" 252 myconf="${myconf} --with-collation=latin1_swedish_ci"
218 || mysql_check_version_range "5.01.00.00 to 5.01.06.99" 270 || mysql_check_version_range "5.01.00.00 to 5.01.06.99"
219 then 271 then
220 ewarn "bdb berkeley-db disabled due to arch or version" 272 ewarn "bdb berkeley-db disabled due to arch or version"
221 myconf="${myconf} --without-berkeley-db" 273 myconf="${myconf} --without-berkeley-db"
222 else 274 else
275 #TODO berkdb in 5.1 need to be worked on
223 useq berkdb \ 276 useq berkdb && \
277 ! mysql_check_version_range "5.01.00.00 to 5.01.08.99" \
224 && myconf="${myconf} --with-berkeley-db=./bdb" \ 278 && myconf="${myconf} --with-berkeley-db=./bdb" \
225 || myconf="${myconf} --without-berkeley-db" 279 || myconf="${myconf} --without-berkeley-db"
226 fi 280 fi
227 281
228 if mysql_version_is_at_least "4.01.03.00" ; then 282 if mysql_version_is_at_least "4.01.03.00" ; then
230 myconf="${myconf} --with-geometry" 284 myconf="${myconf} --with-geometry"
231 myconf="${myconf} $(use_with cluster ndbcluster)" 285 myconf="${myconf} $(use_with cluster ndbcluster)"
232 fi 286 fi
233 287
234 mysql_version_is_at_least "4.01.11.00" && myconf="${myconf} `use_with big-tables`" 288 mysql_version_is_at_least "4.01.11.00" && myconf="${myconf} `use_with big-tables`"
289
290 mysql_version_is_at_least "5.01.06.00" && myconf="${myconf} --with-ndb-binlog"
291
292 if useq embedded ; then
293 #REMIND, need the privilege control enabled ?
294 myconf="${myconf} --without-embedded-privilege-control"
295 myconf="${myconf} --with-embedded-server"
296 else
297 myconf="${myconf} --without-embedded-privilege-control"
298 myconf="${myconf} --without-embedded-server"
299 fi
235 else 300 else
236 for i in ${minimal_exclude_list}; do 301 for i in ${minimal_exclude_list}; do
237 myconf="${myconf} --without-${i}" 302 myconf="${myconf} --without-${i}"
238 done 303 done
239 myconf="${myconf} --without-berkeley-db" 304 myconf="${myconf} --without-berkeley-db"
262 if mysql_version_is_at_least "5.01.00.00" ; then 327 if mysql_version_is_at_least "5.01.00.00" ; then
263 myconf="${myconf} --with-partition" 328 myconf="${myconf} --with-partition"
264 fi 329 fi
265 fi 330 fi
266 331
332 fi
333
267 mysql_version_is_at_least "5.00.18.00" \ 334 mysql_version_is_at_least "5.00.18.00" \
268 && useq "max-idx-128" \ 335 && useq "max-idx-128" \
269 && myconf="${myconf} --with-max-indexes=128" 336 && myconf="${myconf} --with-max-indexes=128"
337
338 if mysql_version_is_at_least "5.01.05.00" ; then
339 myconf="${myconf} --with-row-based-replication"
270 fi 340 fi
271 341
272 #Bug #114895,Bug #110149 342 #Bug #114895,Bug #110149
273 filter-flags "-O" "-O[01]" 343 filter-flags "-O" "-O[01]"
274 #glibc-2.3.2_pre fix; bug #16496 344 #glibc-2.3.2_pre fix; bug #16496
293 --enable-local-infile \ 363 --enable-local-infile \
294 --with-mysqld-user=mysql \ 364 --with-mysqld-user=mysql \
295 --with-client-ldflags=-lstdc++ \ 365 --with-client-ldflags=-lstdc++ \
296 --enable-thread-safe-client \ 366 --enable-thread-safe-client \
297 --with-comment="Gentoo Linux ${PF}" \ 367 --with-comment="Gentoo Linux ${PF}" \
298 --with-unix-socket-path="/var/run/mysqld/mysqld${MY_SUFFIX}.sock" \ 368 --with-unix-socket-path="/var/run/mysqld/mysqld.sock" \
299 --with-zlib-dir=/usr \
300 --with-lib-ccflags="-fPIC" \ 369 --with-lib-ccflags="-fPIC" \
301 --without-readline \ 370 --without-readline \
302 --without-docs \ 371 --without-docs \
303 ${myconf} || die "bad ./configure" 372 ${myconf} || die "bad ./configure"
304 373
305 # TODO Move this before autoreconf !!! 374 # TODO Move this before autoreconf !!!
306 find . -name 'Makefile' \ 375 find . -type f -name Makefile -print0 \
307 -exec sed --in-place \ 376 | xargs -0 -n100 sed -i \
308 -e 's|^pkglibdir\s*=\s*$(libdir)/mysql|pkglibdir = $(libdir)|' \ 377 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
309 -e 's|^pkgincludedir\s*=\s*$(includedir)/mysql|pkgincludedir = $(includedir)|' \
310 {} \;
311 378
312 emake || die "compile problem" 379 emake || die "compile problem"
313} 380}
314 381
315mysql_src_install() { 382mysql_src_install() {
360 fi 427 fi
361 428
362 # config stuff 429 # config stuff
363 insinto "${MY_SYSCONFDIR}" 430 insinto "${MY_SYSCONFDIR}"
364 doins scripts/mysqlaccess.conf 431 doins scripts/mysqlaccess.conf
432 sed -e "s!@MY_SUFFIX@!${MY_SUFFIX}!g" \
433 -e "s!@DATADIR@!${DATADIR}!g" \
434 "${FILESDIR}/my.cnf-4.1-r1" \
435 > "${TMPDIR}/my.cnf.ok"
365 newins "${FILESDIR}/my.cnf-4.1" my.cnf 436 newins "${TMPDIR}/my.cnf.ok" my.cnf
437
366 insinto "/etc/conf.d" 438 insinto "/etc/conf.d"
367 newins "${FILESDIR}/mysql-slot.conf.d-r2" "mysql" 439 newins "${FILESDIR}/mysql-slot.conf.d-r1" "mysql"
368 mysql_version_is_at_least "5.00.11.00" \ 440 mysql_version_is_at_least "5.00.11.00" \
369 && newins "${FILESDIR}/mysqlmanager-slot.conf.d" "mysqlmanager" 441 && newins "${FILESDIR}/mysqlmanager-slot.conf.d" "mysqlmanager"
370
371 local charset='utf8'
372 ! useq utf8 && local charset='latin1'
373 sed --in-place \
374 -e "s/@MY_SUFFIX@/${MY_SUFFIX}/" \
375 -e "s/@CHARSET@/${charset}/" \
376 "${D}/etc/mysql${MY_SUFFIX}/my.cnf"
377 442
378 # minimal builds don't have the server 443 # minimal builds don't have the server
379 if ! useq minimal; then 444 if ! useq minimal; then
380 exeinto /etc/init.d 445 exeinto /etc/init.d
381 newexe "${FILESDIR}/mysql-slot.rc6-r2" "mysql" 446 newexe "${FILESDIR}/mysql-slot.rc6-r3" "mysql"
382 [[ ${SLOT} -gt 0 ]] && dosym "/etc/init.d/mysql" "/etc/init.d/mysql${MY_SUFFIX}"
383 447
384 mysql_version_is_at_least "5.00.11.00" \ 448 mysql_version_is_at_least "5.00.11.00" \
385 && newexe "${FILESDIR}/mysqlmanager-slot.rc6" "mysqlmanager" 449 && newexe "${FILESDIR}/mysqlmanager-slot.rc6" "mysqlmanager"
386 insinto /etc/logrotate.d 450 insinto /etc/logrotate.d
387 # TODO 451 sed -e "s!___MY_SUFFIX___!${MY_SUFFIX}!g" \
452 "${FILESDIR}/logrotate-slot.mysql" \
453 > "${TMPDIR}/logrotate.mysql"
388 newins "${FILESDIR}/logrotate.mysql" "mysql${MY_SUFFIX}" 454 newins "${TMPDIR}/logrotate.mysql" "mysql${MY_SUFFIX}"
389 455
390 #empty dirs... 456 #empty dirs...
391 diropts "-m0750" 457 diropts "-m0750"
392 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 458 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
393 dodir "${DATADIR}" 459 dodir "${DATADIR}"
425 # oops, temporary fix 491 # oops, temporary fix
426 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \ 492 mysql_check_version_range "5.00.16.00 to 5.00.18.99" \
427 && cp -f \ 493 && cp -f \
428 "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0" \ 494 "${WORKDIR}/mysql-extras/fill_help_tables.sql-5.0" \
429 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql" 495 "${D}/usr/share/mysql${MY_SUFFIX}/fill_help_tables.sql"
496
497 if [[ ${SLOT} -gt 0 ]] ; then
498 # MOVED HERE DUE TO BUG #121445
499 # create a list of files, to be used
500 # by external utilities
501 mkdir -p "${D}/var/lib/eselect/mysql/"
502 local filelist="${D}/var/lib/eselect/mysql/mysql${MY_SUFFIX}.filelist"
503 pushd "${D}/" &>/dev/null
504 find usr/bin/ usr/sbin/ \
505 -type f -name "*${MY_SUFFIX}*" \
506 -and -not -name "mysql_config${MY_SUFFIX}" \
507 > "${filelist}"
508 find usr/share/man \
509 -type f -name "*${MY_SUFFIX}*" \
510 | sed -e 's/$/.gz/' \
511 >> "${filelist}"
512 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
513 echo "${MY_LIBDIR#"/"}" >> "${filelist}"
514 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
515 popd &>/dev/null
516 fi
430} 517}
431 518
432mysql_pkg_preinst() { 519mysql_pkg_preinst() {
433 520
434 enewgroup mysql 60 || die "problem adding group mysql" 521 enewgroup mysql 60 || die "problem adding group mysql"
448 #secure the logfiles... does this bother anybody? 535 #secure the logfiles... does this bother anybody?
449 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} 536 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
450 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* 537 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
451 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* 538 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
452 539
453 # create a list of files, to be used
454 # by external utilities
455 # uncompressed because of the small size
456 local filelist="${ROOT}/var/lib/eselect/mysql/mysql${MY_SUFFIX}"
457 pushd "${D}/" &>/dev/null
458 mkdir -p "${ROOT}/var/lib/eselect/mysql/"
459 env -i find usr/bin/ usr/sbin/ usr/share/man \
460 -type f -name "*${MY_SUFFIX}*" \
461 -and -not -name "mysql_config${MY_SUFFIX}" \
462 > "${filelist}.filelist"
463 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}.filelist"
464 echo "${MY_LIBDIR#"/"}" >> "${filelist}.filelist"
465 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}.filelist"
466 popd &>/dev/null
467
468 if ! useq minimal; then 540 if ! useq minimal; then
469 if [[ ${SLOT} -gt 0 ]] ; then 541 if [[ ${SLOT} -gt 0 ]] ; then
470 if [[ -f "${ROOT}/usr/sbin/mysqld" ]] ; then 542 einfo "you may want to read:"
471 einfo "you may want to run unmerge any unslotted MySQL versions with " 543 einfo "http://www.gentoo.org/doc/en/mysql-upgrade-slotted.xml"
472 einfo "emerge -C --pretend dev-db/mysql"
473 einfo "emerge -C =dev-db/mysql-X.Y.Z"
474 einfo "After the unmerge run \"eselect myqsl list\" followed by a " 544 einfo "you may want to run \"eselect mysql list\" followed by a "
475 einfo "\"eselect myqsl set 1\" to chose the default mysql server" 545 einfo "\"eselect mysql set 1\" to choose the default mysql server"
476 else
477 local tmpres="$( eselect mysql show )"
478 # "like grep -q unset"
479 if [[ "{$tmpres}" == "{$tmpres/unset/}" ]] ; then
480 eselect mysql set 1
481 else
482 einfo "The version of mysql emerged now stils is _NOT_ the default"
483 einfo "you may want to run \"eselect myqsl list\" followed by a "
484 einfo "\"eselect myqsl set 1\" to chose the default mysql server"
485 fi
486 fi
487 fi 546 fi
488 547
489 # your friendly public service announcement... 548 # your friendly public service announcement...
490 einfo 549 einfo
491 einfo "You might want to run:" 550 einfo "You might want to run:"
492 einfo "\"emerge --config =${CATEGORY}/${PF}\"" 551 einfo "\"emerge --config =${CATEGORY}/${PF}\""
493 einfo "if this is a new install." 552 einfo "if this is a new install."
494 einfo 553 einfo
554 mysql_version_is_at_least "5.01.00.00" \
495 einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream." 555 || einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream."
496 fi 556 fi
497} 557}
498 558
499mysql_pkg_config() { 559mysql_pkg_config() {
500 mysql_init_vars 560 mysql_init_vars
530 fi 590 fi
531 591
532 local options="" 592 local options=""
533 local sqltmp="$(emktemp)" 593 local sqltmp="$(emktemp)"
534 594
535 local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" 595 local help_tables="${MY_SHAREDSTATEDIR}/fill_help_tables.sql"
536 [[ -r "${help_tables}" ]] \ 596 [[ -r "${help_tables}" ]] \
537 && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ 597 && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \
538 || touch "${TMPDIR}/fill_help_tables.sql" 598 || touch "${TMPDIR}/fill_help_tables.sql"
539 help_tables="${TMPDIR}/fill_help_tables.sql" 599 help_tables="${TMPDIR}/fill_help_tables.sql"
540 600
541 pushd "${TMPDIR}" &>/dev/null 601 pushd "${TMPDIR}" &>/dev/null
542 ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR" 602 ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR"
556 if [[ -r "${help_tables}" ]] ; then 616 if [[ -r "${help_tables}" ]] ; then
557 cat "${help_tables}" >> "${sqltmp}" 617 cat "${help_tables}" >> "${sqltmp}"
558 fi 618 fi
559 fi 619 fi
560 620
561 local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock 621 local socket=${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock
562 local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock 622 local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.pid
563 local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ 623 local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \
564 ${options} \ 624 ${options} \
565 --user=mysql \ 625 --user=mysql \
566 --skip-grant-tables \ 626 --skip-grant-tables \
567 --basedir=${ROOT}/usr \ 627 --basedir=${ROOT}/usr \
602 einfo "stopping the server," 662 einfo "stopping the server,"
603 wait %1 663 wait %1
604 einfo "done" 664 einfo "done"
605} 665}
606 666
667mysql_pkg_prerm() {
668 if [[ ${SLOT} -gt 0 ]] ; then
669 # external program
670 eselect mysql slot_remove "${SLOT}"
671 fi
672}
673
607mysql_pkg_postrm() { 674mysql_pkg_postrm() {
608 mysql_lib_symlinks 675 mysql_lib_symlinks
609 if [[ ${SLOT} -gt 0 ]] ; then 676 if [[ ${SLOT} -gt 0 ]] ; then
610 einfo "you may want to run \"eselect myqsl list\" followed by a " 677 einfo "you may want to run \"eselect mysql list\" followed by a "
611 einfo "\"eselect myqsl list\" to chose the default mysql server" 678 einfo "\"eselect mysql list\" to choose the default mysql server"
612 fi 679 fi
613} 680}

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20