| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2011 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.159 2011/04/21 12:15:19 robbat2 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.166 2011/09/25 12:43:28 grobian Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: mysql.eclass |
5 | # @ECLASS: mysql.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Author: Francesco Riosa (Retired) <vivo@gentoo.org> |
|
|
| 8 | # Maintainers: MySQL Team <mysql-bugs@gentoo.org> |
7 | # MySQL Team <mysql-bugs@gentoo.org> |
| 9 | # - Luca Longinotti <chtekk@gentoo.org> |
8 | # Luca Longinotti <chtekk@gentoo.org> |
| 10 | # - Robin H. Johnson <robbat2@gentoo.org> |
9 | # Robin H. Johnson <robbat2@gentoo.org> |
|
|
10 | # @AUTHOR: |
|
|
11 | # Francesco Riosa (Retired) <vivo@gentoo.org> |
| 11 | # @BLURB: This eclass provides most of the functions for mysql ebuilds |
12 | # @BLURB: This eclass provides most of the functions for mysql ebuilds |
| 12 | # @DESCRIPTION: |
13 | # @DESCRIPTION: |
| 13 | # The mysql.eclass provides almost all the code to build the mysql ebuilds |
14 | # The mysql.eclass provides almost all the code to build the mysql ebuilds |
| 14 | # including the src_unpack, src_prepare, src_configure, src_compile, |
15 | # including the src_unpack, src_prepare, src_configure, src_compile, |
| 15 | # scr_install, pkg_preinst, pkg_postinst, pkg_config and pkg_postrm |
16 | # scr_install, pkg_preinst, pkg_postinst, pkg_config and pkg_postrm |
| … | |
… | |
| 139 | for i in "mysql" "mysql-community" "mysql-cluster" "mariadb" ; do |
140 | for i in "mysql" "mysql-community" "mysql-cluster" "mariadb" ; do |
| 140 | [[ "${i}" == ${PN} ]] || |
141 | [[ "${i}" == ${PN} ]] || |
| 141 | DEPEND="${DEPEND} !dev-db/${i}" |
142 | DEPEND="${DEPEND} !dev-db/${i}" |
| 142 | done |
143 | done |
| 143 | |
144 | |
|
|
145 | # prefix: first need to implement something for #196294 |
| 144 | RDEPEND="${DEPEND} |
146 | RDEPEND="${DEPEND} |
| 145 | !minimal? ( dev-db/mysql-init-scripts ) |
147 | !minimal? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
| 146 | selinux? ( sec-policy/selinux-mysql )" |
148 | selinux? ( sec-policy/selinux-mysql )" |
|
|
149 | |
|
|
150 | DEPEND="${DEPEND} |
|
|
151 | virtual/yacc" |
| 147 | |
152 | |
| 148 | if [ "${EAPI:-0}" = "2" ]; then |
153 | if [ "${EAPI:-0}" = "2" ]; then |
| 149 | DEPEND="${DEPEND} static? ( || ( sys-libs/ncurses[static-libs] <=sys-libs/ncurses-5.7-r3 ) )" |
154 | DEPEND="${DEPEND} static? ( || ( sys-libs/ncurses[static-libs] <=sys-libs/ncurses-5.7-r3 ) )" |
| 150 | fi |
155 | fi |
| 151 | |
156 | |
| … | |
… | |
| 613 | \) \ |
618 | \) \ |
| 614 | -print0 \ |
619 | -print0 \ |
| 615 | | xargs -0 sed -r -n \ |
620 | | xargs -0 sed -r -n \ |
| 616 | -e '/^MYSQL_STORAGE_ENGINE/{ |
621 | -e '/^MYSQL_STORAGE_ENGINE/{ |
| 617 | s~MYSQL_STORAGE_ENGINE\([[:space:]]*\[?([-_a-z0-9]+)\]?.*,~\1 ~g ; |
622 | s~MYSQL_STORAGE_ENGINE\([[:space:]]*\[?([-_a-z0-9]+)\]?.*,~\1 ~g ; |
| 618 | s~^([^ ]+).*~\1~gp; |
623 | s~^([^ ]+).*~\1~gp; |
| 619 | }' \ |
624 | }' \ |
| 620 | | tr -s '\n' ' ' |
625 | | tr -s '\n' ' ' |
| 621 | )" |
626 | )" |
| 622 | |
627 | |
| 623 | # 5.1 introduces a new way to manage storage engines (plugins) |
628 | # 5.1 introduces a new way to manage storage engines (plugins) |
| … | |
… | |
| 771 | # die if FEATURES="test", USE="-minimal" and not using FEATURES="userpriv" |
776 | # die if FEATURES="test", USE="-minimal" and not using FEATURES="userpriv" |
| 772 | # check for conflicting use flags |
777 | # check for conflicting use flags |
| 773 | # create new user and group for mysql |
778 | # create new user and group for mysql |
| 774 | # warn about deprecated features |
779 | # warn about deprecated features |
| 775 | mysql_pkg_setup() { |
780 | mysql_pkg_setup() { |
| 776 | if hasq test ${FEATURES} ; then |
781 | if has test ${FEATURES} ; then |
| 777 | if ! use minimal ; then |
782 | if ! use minimal ; then |
| 778 | if [[ $UID -eq 0 ]]; then |
783 | if [[ $UID -eq 0 ]]; then |
| 779 | eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
784 | eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
| 780 | fi |
785 | fi |
| 781 | fi |
786 | fi |
| … | |
… | |
| 1169 | done |
1174 | done |
| 1170 | fi |
1175 | fi |
| 1171 | |
1176 | |
| 1172 | # Docs |
1177 | # Docs |
| 1173 | einfo "Installing docs" |
1178 | einfo "Installing docs" |
| 1174 | dodoc README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE |
1179 | for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do |
|
|
1180 | [[ -f "$i" ]] && dodoc "$i" |
|
|
1181 | done |
| 1175 | doinfo "${S}"/Docs/mysql.info |
1182 | doinfo "${S}"/Docs/mysql.info |
| 1176 | |
1183 | |
| 1177 | # Minimal builds don't have the MySQL server |
1184 | # Minimal builds don't have the MySQL server |
| 1178 | if ! use minimal ; then |
1185 | if ! use minimal ; then |
| 1179 | einfo "Including support files and sample configurations" |
1186 | einfo "Including support files and sample configurations" |