| 1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 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-v2.eclass,v 1.20 2012/11/01 20:22:57 robbat2 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.21 2012/11/01 23:57:50 robbat2 Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: mysql-v2.eclass |
5 | # @ECLASS: mysql-v2.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Maintainers: |
7 | # Maintainers: |
| 8 | # - MySQL Team <mysql-bugs@gentoo.org> |
8 | # - MySQL Team <mysql-bugs@gentoo.org> |
| … | |
… | |
| 174 | IUSE="${IUSE} max-idx-128" |
174 | IUSE="${IUSE} max-idx-128" |
| 175 | IUSE="${IUSE} berkdb" |
175 | IUSE="${IUSE} berkdb" |
| 176 | IUSE="${IUSE} +community profiling" |
176 | IUSE="${IUSE} +community profiling" |
| 177 | |
177 | |
| 178 | [[ ${PN} == "mariadb" ]] \ |
178 | [[ ${PN} == "mariadb" ]] \ |
|
|
179 | && mysql_check_version_range "5.1.38 to 5.3.99" \ |
| 179 | && IUSE="${IUSE} libevent" |
180 | && IUSE="${IUSE} libevent" |
| 180 | |
181 | |
| 181 | [[ ${PN} == "mariadb" ]] \ |
182 | [[ ${PN} == "mariadb" ]] \ |
| 182 | && mysql_version_is_at_least "5.2" \ |
183 | && mysql_version_is_at_least "5.2" \ |
| 183 | && IUSE="${IUSE} oqgraph" |
184 | && IUSE="${IUSE} oqgraph" |
| 184 | |
185 | |
| 185 | [[ ${PN} == "mariadb" ]] \ |
186 | [[ ${PN} == "mariadb" ]] \ |
| 186 | && mysql_version_is_at_least "5.2.5" \ |
187 | && mysql_version_is_at_least "5.2.5" \ |
| 187 | && IUSE="${IUSE} sphinx" |
188 | && IUSE="${IUSE} sphinx" |
|
|
189 | |
|
|
190 | if mysql_version_is_at_least "5.5"; then |
|
|
191 | REQUIRED_USE="tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc )" |
|
|
192 | IUSE="${IUSE} jemalloc tcmalloc" |
|
|
193 | fi |
| 188 | |
194 | |
| 189 | mysql_version_is_at_least "5.5.7" \ |
195 | mysql_version_is_at_least "5.5.7" \ |
| 190 | && IUSE="${IUSE} systemtap" |
196 | && IUSE="${IUSE} systemtap" |
| 191 | |
197 | |
| 192 | # |
198 | # |
| … | |
… | |
| 203 | >=sys-libs/readline-4.1 |
209 | >=sys-libs/readline-4.1 |
| 204 | >=sys-libs/zlib-1.2.3 |
210 | >=sys-libs/zlib-1.2.3 |
| 205 | " |
211 | " |
| 206 | |
212 | |
| 207 | [[ ${PN} == mariadb ]] \ |
213 | [[ ${PN} == mariadb ]] \ |
|
|
214 | && mysql_check_version_range "5.1.38 to 5.3.99" \ |
| 208 | && DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )" |
215 | && DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )" |
| 209 | |
216 | |
| 210 | # Having different flavours at the same time is not a good idea |
217 | # Having different flavours at the same time is not a good idea |
| 211 | for i in "mysql" "mariadb" ; do |
218 | for i in "mysql" "mariadb" ; do |
| 212 | [[ ${i} == ${PN} ]] || |
219 | [[ ${i} == ${PN} ]] || |
| … | |
… | |
| 239 | [[ "${PN}" == "mariadb" ]] \ |
246 | [[ "${PN}" == "mariadb" ]] \ |
| 240 | && mysql_version_is_at_least "5.2.5" \ |
247 | && mysql_version_is_at_least "5.2.5" \ |
| 241 | && DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )" |
248 | && DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )" |
| 242 | |
249 | |
| 243 | mysql_version_is_at_least "5.5.7" \ |
250 | mysql_version_is_at_least "5.5.7" \ |
| 244 | && DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" |
251 | && DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" \ |
|
|
252 | && DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )" |
|
|
253 | |
|
|
254 | mysql_version_is_at_least "5.5" \ |
|
|
255 | && DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )" |
|
|
256 | |
|
|
257 | mysql_version_is_at_least "5.5" \ |
|
|
258 | && DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )" |
| 245 | |
259 | |
| 246 | # dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
260 | # dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
| 247 | PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" |
261 | PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" |
| 248 | |
262 | |
| 249 | # For other stuff to bring us in |
263 | # For other stuff to bring us in |
| … | |
… | |
| 493 | elog "mysql_upgrade tool." |
507 | elog "mysql_upgrade tool." |
| 494 | einfo |
508 | einfo |
| 495 | fi |
509 | fi |
| 496 | |
510 | |
| 497 | if pbxt_available && use pbxt ; then |
511 | if pbxt_available && use pbxt ; then |
| 498 | # TODO: explain it better |
512 | elog "Note: PBXT is now statically built when enabled." |
| 499 | elog " mysql> INSTALL PLUGIN pbxt SONAME 'libpbxt.so';" |
513 | elog "" |
| 500 | elog " mysql> CREATE TABLE t1 (c1 int, c2 text) ENGINE=pbxt;" |
514 | elog "If, you previously installed as a plugin and " |
| 501 | elog "if, after that, you cannot start the MySQL server," |
515 | elog "you cannot start the MySQL server," |
| 502 | elog "remove the ${MY_DATADIR}/mysql/plugin.* files, then" |
516 | elog "remove the ${MY_DATADIR}/mysql/plugin.* files, then" |
| 503 | elog "use the MySQL upgrade script to restore the table" |
517 | elog "use the MySQL upgrade script to restore the table" |
| 504 | elog "or execute the following SQL command:" |
518 | elog "or execute the following SQL command:" |
| 505 | elog " CREATE TABLE IF NOT EXISTS plugin (" |
519 | elog " CREATE TABLE IF NOT EXISTS plugin (" |
| 506 | elog " name char(64) binary DEFAULT '' NOT NULL," |
520 | elog " name char(64) binary DEFAULT '' NOT NULL," |