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

Diff of /eclass/mysql.eclass

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

Revision 1.21 Revision 1.25
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.21 2006/03/03 01:33:07 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.25 2006/03/16 20:39:00 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
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-${MY_EXTRAS_VER}.tar.bz2" 21 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
22LICENSE="GPL-2" 22LICENSE="GPL-2"
23IUSE="big-tables berkdb debug embedded minimal perl selinux srvdir ssl static" 23IUSE="big-tables berkdb debug embedded minimal perl selinux srvdir ssl static"
24RESTRICT="primaryuri confcache" 24RESTRICT="primaryuri confcache"
25DEPEND="app-admin/eselect-mysql"
26 25
27mysql_version_is_at_least "4.01.03.00" \ 26mysql_version_is_at_least "4.01.03.00" \
28&& IUSE="${IUSE} cluster extraengine" 27&& IUSE="${IUSE} cluster extraengine"
29 28
30mysql_version_is_at_least "5.00.00.00" \ 29mysql_version_is_at_least "5.00.00.00" \
337 336
338 if mysql_version_is_at_least "5.01.05.00" ; then 337 if mysql_version_is_at_least "5.01.05.00" ; then
339 myconf="${myconf} --with-row-based-replication" 338 myconf="${myconf} --with-row-based-replication"
340 fi 339 fi
341 340
341 #TODO rechek again later, had problem with assembler enabled
342 # and some combination of use-flags with 5.1
343 if mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then
344 myconf="${myconf} --disable-assembler"
345 else
346 myconf="${myconf} --enable-assembler"
347 fi
348
342 #Bug #114895,Bug #110149 349 #Bug #114895,Bug #110149
343 filter-flags "-O" "-O[01]" 350 filter-flags "-O" "-O[01]"
344 #glibc-2.3.2_pre fix; bug #16496 351 #glibc-2.3.2_pre fix; bug #16496
345 append-flags "-DHAVE_ERRNO_AS_DEFINE=1" 352 append-flags "-DHAVE_ERRNO_AS_DEFINE=1"
346 353
357 --localstatedir="${MY_LOCALSTATEDIR}" \ 364 --localstatedir="${MY_LOCALSTATEDIR}" \
358 --sharedstatedir="${MY_SHAREDSTATEDIR}" \ 365 --sharedstatedir="${MY_SHAREDSTATEDIR}" \
359 --libdir="${MY_LIBDIR}" \ 366 --libdir="${MY_LIBDIR}" \
360 --includedir="${MY_INCLUDEDIR}" \ 367 --includedir="${MY_INCLUDEDIR}" \
361 --with-low-memory \ 368 --with-low-memory \
362 --enable-assembler \
363 --enable-local-infile \ 369 --enable-local-infile \
364 --with-mysqld-user=mysql \ 370 --with-mysqld-user=mysql \
365 --with-client-ldflags=-lstdc++ \ 371 --with-client-ldflags=-lstdc++ \
366 --enable-thread-safe-client \ 372 --enable-thread-safe-client \
367 --with-comment="Gentoo Linux ${PF}" \ 373 --with-comment="Gentoo Linux ${PF}" \
434 "${FILESDIR}/my.cnf-4.1-r1" \ 440 "${FILESDIR}/my.cnf-4.1-r1" \
435 > "${TMPDIR}/my.cnf.ok" 441 > "${TMPDIR}/my.cnf.ok"
436 newins "${TMPDIR}/my.cnf.ok" my.cnf 442 newins "${TMPDIR}/my.cnf.ok" my.cnf
437 443
438 insinto "/etc/conf.d" 444 insinto "/etc/conf.d"
439 newins "${FILESDIR}/mysql-slot.conf.d-r1" "mysql" 445 newins "${FILESDIR}/mysql.conf.d-r1" "mysql"
440 mysql_version_is_at_least "5.00.11.00" \ 446 mysql_version_is_at_least "5.00.11.00" \
441 && newins "${FILESDIR}/mysqlmanager-slot.conf.d" "mysqlmanager" 447 && newins "${FILESDIR}/mysqlmanager.conf.d" "mysqlmanager"
442 448
443 # minimal builds don't have the server 449 # minimal builds don't have the server
444 if ! useq minimal; then 450 if ! useq minimal; then
445 exeinto /etc/init.d 451 exeinto /etc/init.d
446 newexe "${FILESDIR}/mysql-slot.rc6-r3" "mysql" 452 newexe "${FILESDIR}/mysql.rc6-r3" "mysql"
447 453
448 mysql_version_is_at_least "5.00.11.00" \ 454 mysql_version_is_at_least "5.00.11.00" \
449 && newexe "${FILESDIR}/mysqlmanager-slot.rc6" "mysqlmanager" 455 && newexe "${FILESDIR}/mysqlmanager.rc6" "mysqlmanager"
450 insinto /etc/logrotate.d 456 insinto /etc/logrotate.d
451 sed -e "s!___MY_SUFFIX___!${MY_SUFFIX}!g" \ 457 sed -e "s!___MY_SUFFIX___!${MY_SUFFIX}!g" \
452 "${FILESDIR}/logrotate-slot.mysql" \ 458 "${FILESDIR}/logrotate-slot.mysql" \
453 > "${TMPDIR}/logrotate.mysql" 459 > "${TMPDIR}/logrotate.mysql"
454 newins "${TMPDIR}/logrotate.mysql" "mysql${MY_SUFFIX}" 460 newins "${TMPDIR}/logrotate.mysql" "mysql${MY_SUFFIX}"
512 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}" 518 echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}"
513 echo "${MY_LIBDIR#"/"}" >> "${filelist}" 519 echo "${MY_LIBDIR#"/"}" >> "${filelist}"
514 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}" 520 echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}"
515 popd &>/dev/null 521 popd &>/dev/null
516 fi 522 fi
523
524 # It's safer portage wis doing this in instal, but we can't
525 # if it's a slotted install
526 [[ ${SLOT} -eq 0 ]] && ROOT="${D}" mysql_lib_symlinks
517} 527}
518 528
519mysql_pkg_preinst() { 529mysql_pkg_preinst() {
520 530
521 enewgroup mysql 60 || die "problem adding group mysql" 531 enewgroup mysql 60 || die "problem adding group mysql"
524} 534}
525 535
526mysql_pkg_postinst() { 536mysql_pkg_postinst() {
527 537
528 mysql_init_vars 538 mysql_init_vars
529 mysql_lib_symlinks 539 # slotted, manage lib symlinks on the real file-system
540 # to cope with other version installed
541 [[ ${SLOT} -ne 0 ]] && mysql_lib_symlinks
530 542
531 # mind at FEATURES=collision-protect before to remove this 543 # mind at FEATURES=collision-protect before to remove this
532 [ -d "${ROOT}/var/log/mysql" ] \ 544 [ -d "${ROOT}/var/log/mysql" ] \
533 || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" 545 || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
534 546

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.20