| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 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.57 2007/01/04 11:17:05 vivo Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.58 2007/01/04 20:38:16 vivo Exp $ |
| 4 | # kate: encoding utf-8; eol unix; |
4 | # kate: encoding utf-8; eol unix; |
| 5 | # kate: indent-width 4; mixedindent off; remove-trailing-space on; space-indent off; |
5 | # kate: indent-width 4; mixedindent off; remove-trailing-space on; space-indent off; |
| 6 | # kate: word-wrap-column 80; word-wrap off; |
6 | # kate: word-wrap-column 80; word-wrap off; |
| 7 | |
7 | |
| 8 | # Author: Francesco Riosa (Retired) <vivo@gentoo.org> |
8 | # Author: Francesco Riosa (Retired) <vivo@gentoo.org> |
| … | |
… | |
| 13 | ECLASS="mysql" |
13 | ECLASS="mysql" |
| 14 | INHERITED="$INHERITED $ECLASS" |
14 | INHERITED="$INHERITED $ECLASS" |
| 15 | inherit eutils flag-o-matic gnuconfig autotools mysql_fx |
15 | inherit eutils flag-o-matic gnuconfig autotools mysql_fx |
| 16 | |
16 | |
| 17 | # avoid running userspace code 8 times per ebuild :( |
17 | # avoid running userspace code 8 times per ebuild :( |
| 18 | if [[ "${_MYPVR}" != "${PVR}" ]] && [[ -z "${MYSQL_VERSION_ID}" ]] |
18 | if [[ "${_MYPVR}" != "${PVR}" ]] && [[ -n "${PVR}" ]] |
| 19 | then |
19 | then |
| 20 | _MYPVR=${PVR} |
20 | _MYPVR=${PVR} |
| 21 | |
21 | |
| 22 | [[ -z ${MY_EXTRAS_VER} ]] && MY_EXTRAS_VER="20070103" |
22 | [[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070104" |
| 23 | |
23 | |
| 24 | if [[ ${PR#r} -lt 60 ]] ; then |
24 | if [[ ${PR#r} -lt 60 ]] ; then |
| 25 | IS_BITKEEPER=0 |
25 | IS_BITKEEPER=0 |
| 26 | elif [[ ${PR#r} -lt 90 ]] ; then |
26 | elif [[ ${PR#r} -lt 90 ]] ; then |
| 27 | IS_BITKEEPER=60 |
27 | IS_BITKEEPER=60 |
| … | |
… | |
| 48 | DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) |
48 | DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) |
| 49 | userland_GNU? ( sys-process/procps ) |
49 | userland_GNU? ( sys-process/procps ) |
| 50 | >=sys-apps/sed-4 |
50 | >=sys-apps/sed-4 |
| 51 | >=sys-apps/texinfo-4.7-r1 |
51 | >=sys-apps/texinfo-4.7-r1 |
| 52 | >=sys-libs/readline-4.1 |
52 | >=sys-libs/readline-4.1 |
| 53 | >=sys-libs/zlib-1.2.3" |
53 | >=sys-libs/zlib-1.2.3 |
|
|
54 | " |
| 54 | |
55 | |
| 55 | # having different flavours at the same time is not a good idea |
56 | # having different flavours at the same time is not a good idea |
| 56 | for i in "" "-community" "-slotted" ; do |
57 | for i in "" "-community" "-slotted" ; do |
| 57 | [[ "${i}" == ${PN#mysql} ]] || |
58 | [[ "${i}" == ${PN#mysql} ]] || |
| 58 | DEPEND="${DEPEND} !dev-db/mysql${i}" |
59 | DEPEND="${DEPEND} !dev-db/mysql${i}" |
| … | |
… | |
| 125 | || IUSE="${IUSE} berkdb" |
126 | || IUSE="${IUSE} berkdb" |
| 126 | |
127 | |
| 127 | mysql_version_is_at_least "5.1.12" \ |
128 | mysql_version_is_at_least "5.1.12" \ |
| 128 | && IUSE="${IUSE} pbxt" |
129 | && IUSE="${IUSE} pbxt" |
| 129 | |
130 | |
|
|
131 | RDEPEND="${DEPEND} |
|
|
132 | sys-apps/mysql |
| 130 | RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql )" |
133 | selinux? ( sec-policy/selinux-mysql ) |
|
|
134 | " |
| 131 | |
135 | |
| 132 | fi # if [[ "${_MYPVR}" != "${PVR}" ]] |
136 | fi # if [[ "${_MYPVR}" != "${PVR}" ]] |
| 133 | |
137 | |
| 134 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ |
138 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ |
| 135 | pkg_postinst pkg_config pkg_postrm |
139 | pkg_postinst pkg_config pkg_postrm |
| … | |
… | |
| 348 | # --with-vio is not needed anymore, it's on by default and |
352 | # --with-vio is not needed anymore, it's on by default and |
| 349 | # has been removed from configure |
353 | # has been removed from configure |
| 350 | mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio" |
354 | mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio" |
| 351 | if mysql_version_is_at_least "5.0.6" ; then |
355 | if mysql_version_is_at_least "5.0.6" ; then |
| 352 | # myconf="${myconf} --with-yassl" |
356 | # myconf="${myconf} --with-yassl" |
| 353 | myconf="${myconf} --with-openssl" |
357 | myconf="${myconf} --with-ssl" |
| 354 | else |
358 | else |
| 355 | myconf="${myconf} --with-openssl" |
359 | myconf="${myconf} --with-openssl" |
| 356 | fi |
360 | fi |
| 357 | else |
361 | else |
| 358 | myconf="${myconf} --without-openssl" |
362 | myconf="${myconf} --without-openssl" |
| … | |
… | |
| 434 | if useq "cluster" ; then |
438 | if useq "cluster" ; then |
| 435 | plugins="${plugins},ndbcluster" |
439 | plugins="${plugins},ndbcluster" |
| 436 | myconf="${myconf} --with-ndb-binlog" |
440 | myconf="${myconf} --with-ndb-binlog" |
| 437 | fi |
441 | fi |
| 438 | |
442 | |
|
|
443 | if mysql_version_is_at_least "5.2" ; then |
|
|
444 | plugins="${plugins},falcon" |
|
|
445 | fi |
|
|
446 | |
| 439 | myconf="${myconf} --with-plugins=${plugins}" |
447 | myconf="${myconf} --with-plugins=${plugins}" |
| 440 | } |
448 | } |
| 441 | |
449 | |
| 442 | pbxt_src_compile() { |
450 | pbxt_src_compile() { |
| 443 | mysql_init_vars |
451 | mysql_init_vars |
| … | |
… | |
| 507 | |
515 | |
| 508 | unpack ${A} |
516 | unpack ${A} |
| 509 | if [[ ${IS_BITKEEPER} -eq 90 ]] ; then |
517 | if [[ ${IS_BITKEEPER} -eq 90 ]] ; then |
| 510 | if mysql_check_version_range "5.1 to 5.1.99" ; then |
518 | if mysql_check_version_range "5.1 to 5.1.99" ; then |
| 511 | bitkeeper_fetch "mysql-5.1-ndb" |
519 | bitkeeper_fetch "mysql-5.1-ndb" |
| 512 | elif mysql_check_version_range "5.2 to 5.2.99" ; then |
520 | elif mysql_check_version_range "5.2.0 to 5.2.99" ; then |
| 513 | bitkeeper_fetch "mysql-5.2-falcon" |
521 | bitkeeper_fetch "mysql-5.2-falcon" |
| 514 | else |
522 | else |
| 515 | bitkeeper_fetch |
523 | bitkeeper_fetch |
| 516 | fi |
524 | fi |
| 517 | cd "${S}" |
525 | cd "${S}" |
| … | |
… | |
| 758 | echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}" |
766 | echo "${MY_SYSCONFDIR#"/"}" >> "${filelist}" |
| 759 | echo "${MY_LIBDIR#"/"}" >> "${filelist}" |
767 | echo "${MY_LIBDIR#"/"}" >> "${filelist}" |
| 760 | echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}" |
768 | echo "${MY_SHAREDSTATEDIR#"/"}" >> "${filelist}" |
| 761 | popd &>/dev/null |
769 | popd &>/dev/null |
| 762 | fi |
770 | fi |
|
|
771 | |
|
|
772 | mysql_lib_symlinks "${D}" |
| 763 | } |
773 | } |
| 764 | |
774 | |
| 765 | mysql_pkg_preinst() { |
775 | mysql_pkg_preinst() { |
| 766 | enewgroup mysql 60 || die "problem adding 'mysql' group" |
776 | enewgroup mysql 60 || die "problem adding 'mysql' group" |
| 767 | enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
777 | enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
| … | |
… | |
| 928 | } |
938 | } |
| 929 | |
939 | |
| 930 | mysql_pkg_postrm() { |
940 | mysql_pkg_postrm() { |
| 931 | if [[ ${PN} == "mysql-slotted" ]] ; then |
941 | if [[ ${PN} == "mysql-slotted" ]] ; then |
| 932 | mysql_lib_symlinks |
942 | mysql_lib_symlinks |
|
|
943 | mysql_clients_link_to_best_version |
| 933 | fi |
944 | fi |
| 934 | } |
945 | } |