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

Diff of /eclass/mysql.eclass

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

Revision 1.58 Revision 1.68
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.58 2007/01/04 20:38:16 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.68 2007/01/12 17:00:39 chtekk 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>
10 10
11# Note that MYSQL_VERSION_ID must be empty !!! 11# Note that MYSQL_VERSION_ID must be empty !!!
12 12
13ECLASS="mysql" 13ECLASS="mysql"
14INHERITED="$INHERITED $ECLASS" 14INHERITED="$INHERITED $ECLASS"
15WANT_AUTOCONF="latest"
16WANT_AUTOMAKE="latest"
15inherit eutils flag-o-matic gnuconfig autotools mysql_fx 17inherit eutils flag-o-matic gnuconfig autotools mysql_fx
16 18
17# avoid running userspace code 8 times per ebuild :( 19# Shorten the path because the socket path length must be shorter than 107 chars
18if [[ "${_MYPVR}" != "${PVR}" ]] && [[ -n "${PVR}" ]] 20# and we will run a mysql server during test phase
19then 21S="${WORKDIR}/mysql"
20 _MYPVR=${PVR}
21 22
22 [[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070104" 23[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070108"
23 24
24 if [[ ${PR#r} -lt 60 ]] ; then 25if [[ ${PR#r} -lt 60 ]] ; then
25 IS_BITKEEPER=0 26 IS_BITKEEPER=0
26 elif [[ ${PR#r} -lt 90 ]] ; then 27elif [[ ${PR#r} -lt 90 ]] ; then
27 IS_BITKEEPER=60 28 IS_BITKEEPER=60
28 else 29else
29 IS_BITKEEPER=90 30 IS_BITKEEPER=90
30 fi 31fi
31 32
32 # MYSQL_VERSION_ID will be: 33# MYSQL_VERSION_ID will be:
33 # major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99] 34# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
34 # This is an important part, because many of the choices the MySQL ebuild will do 35# This is an important part, because many of the choices the MySQL ebuild will do
35 # depend on this variable. 36# depend on this variable.
36 # In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803" 37# In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803"
37 MYSQL_VERSION_ID="" 38MYSQL_VERSION_ID=""
38 tpv=( ${PV//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" 39tpv=( ${PV//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}"
39 for vatom in 0 1 2 3 ; do 40for vatom in 0 1 2 3 ; do
40 # pad to length 2 41 # pad to length 2
41 tpv[${vatom}]="00${tpv[${vatom}]}" 42 tpv[${vatom}]="00${tpv[${vatom}]}"
42 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" 43 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}"
44done
45# strip leading "0" (otherwise it's considered an octal number by BASH)
46MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
47
48# Be warned, *DEPEND are version-dependant
49DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
50 userland_GNU? ( sys-process/procps )
51 >=sys-apps/sed-4
52 >=sys-apps/texinfo-4.7-r1
53 >=sys-libs/readline-4.1
54 >=sys-libs/zlib-1.2.3
55 "
56
57# having different flavours at the same time is not a good idea
58for i in "" "-community" "-slotted" ; do
59 [[ "${i}" == ${PN#mysql} ]] ||
60 DEPEND="${DEPEND} !dev-db/mysql${i}"
61done
62
63mysql_version_is_at_least "5.1" \
64|| DEPEND="${DEPEND} berkdb? ( sys-apps/ed )"
65
66# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
67PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
68
69if mysql_version_is_at_least "5.1.12" ; then
70 DEPEND="${DEPEND} innodb? ( >=dev-util/cmake-2.4.3 )"
71fi
72
73# BitKeeper dependency, compile-time only
74[[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client"
75
76if [[ ${PN} == "mysql-slotted" ]] ; then
77 DEPEND="${DEPEND} app-admin/eselect-mysql"
78fi
79
80if [[ ${PN} == "mysql-slotted" ]] ; then
81 SLOT=""
82 tpv=( ${PV//[-._]/ } )
83 for vatom in 0 1 2 ; do
84 SLOT="${SLOT}${tpv[${vatom}]}_"
43 done 85 done
44 # strip leading "0" (otherwise it's considered an octal number by BASH)
45 MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
46
47 # Be warned, *DEPEND are version-dependant
48 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
49 userland_GNU? ( sys-process/procps )
50 >=sys-apps/sed-4
51 >=sys-apps/texinfo-4.7-r1
52 >=sys-libs/readline-4.1
53 >=sys-libs/zlib-1.2.3
54 "
55
56 # having different flavours at the same time is not a good idea
57 for i in "" "-community" "-slotted" ; do
58 [[ "${i}" == ${PN#mysql} ]] ||
59 DEPEND="${DEPEND} !dev-db/mysql${i}"
60 done
61
62 mysql_version_is_at_least "5.1" \
63 || DEPEND="${DEPEND} berkdb? ( sys-apps/ed )"
64
65 # dev-perl/DBD-mysql is needed by some scripts installed by MySQL
66 PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
67
68 if mysql_version_is_at_least "5.1.12" ; then
69 DEPEND="${DEPEND} innodb? ( >=dev-util/cmake-2.4.3 )"
70 fi
71
72 # Shorten the path because the socket path length must be shorter than 107 chars
73 # and we will run a mysql server during test phase
74 S="${WORKDIR}/mysql"
75
76 # BitKeeper dependency, compile-time only
77 [[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client"
78
79 if [[ ${PN} == "mysql-slotted" ]] ; then
80 DEPEND="${DEPEND} app-admin/eselect-mysql"
81 fi
82
83 if [[ ${PN} == "mysql-slotted" ]] ; then
84 SLOT=""
85 tpv=( ${PV//[-._]/ } )
86 for vatom in 0 1 2 ; do
87 SLOT="${SLOT}${tpv[${vatom}]}_"
88 done
89 #finally SLOT=5_0_24 86 #finally SLOT=5_0_24
90 SLOT=${SLOT:0:${#SLOT}-1} 87 SLOT=${SLOT:0:${#SLOT}-1}
91 else 88else
92 SLOT="0" 89 SLOT="0"
93 fi 90fi
94 91
95 # Define correct SRC_URIs 92# Define correct SRC_URIs
96 SRC_URI=" 93SRC_URI="
97 ${SERVER_URI} 94${SERVER_URI}
98 http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 95http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
99 " 96"
100 mysql_version_is_at_least "5.1.12" \ 97mysql_version_is_at_least "5.1.12" \
101 && [[ -n "${PBXT_VERSION}" ]] \ 98&& [[ -n "${PBXT_VERSION}" ]] \
102 && SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )" 99&& SRC_URI="${SRC_URI} pbxt? ( mirror://sourceforge/pbxt/pbxt-${PBXT_VERSION}.tar.gz )"
103 100
104 DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 101DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
105 HOMEPAGE="http://www.mysql.com/" 102HOMEPAGE="http://www.mysql.com/"
106 LICENSE="GPL-2" 103LICENSE="GPL-2"
107 IUSE="big-tables debug embedded minimal perl selinux ssl static" 104IUSE="big-tables debug embedded minimal perl selinux ssl static"
108 RESTRICT="confcache" 105RESTRICT="confcache"
109 106
110 mysql_version_is_at_least "4.1" \ 107mysql_version_is_at_least "4.1" \
111 && IUSE="${IUSE} latin1" 108&& IUSE="${IUSE} latin1"
112 109
113 mysql_version_is_at_least "4.1.3" \ 110mysql_version_is_at_least "4.1.3" \
114 && IUSE="${IUSE} cluster extraengine" 111&& IUSE="${IUSE} cluster extraengine"
115 112
116 mysql_version_is_at_least "5.0" \ 113mysql_version_is_at_least "5.0" \
117 || IUSE="${IUSE} raid" 114|| IUSE="${IUSE} raid"
118 115
119 mysql_version_is_at_least "5.0.18" \ 116mysql_version_is_at_least "5.0.18" \
120 && IUSE="${IUSE} max-idx-128" 117&& IUSE="${IUSE} max-idx-128"
121 118
122 mysql_version_is_at_least "5.1" \ 119mysql_version_is_at_least "5.1" \
123 && IUSE="${IUSE} innodb" 120&& IUSE="${IUSE} innodb"
124 121
125 mysql_version_is_at_least "5.1" \ 122mysql_version_is_at_least "5.1" \
126 || IUSE="${IUSE} berkdb" 123|| IUSE="${IUSE} berkdb"
127 124
128 mysql_version_is_at_least "5.1.12" \ 125mysql_version_is_at_least "5.1.12" \
129 && IUSE="${IUSE} pbxt" 126&& IUSE="${IUSE} pbxt"
130 127
131 RDEPEND="${DEPEND} 128RDEPEND="${DEPEND}
132 sys-apps/mysql 129 !minimal? ( dev-db/mysql-init-scripts )
133 selinux? ( sec-policy/selinux-mysql ) 130 selinux? ( sec-policy/selinux-mysql )"
134 "
135
136fi # if [[ "${_MYPVR}" != "${PVR}" ]]
137 131
138EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ 132EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \
139 pkg_postinst pkg_config pkg_postrm 133 pkg_postinst pkg_config pkg_postrm
140 134
141# 135#
177 171
178 if [[ ! -d "${wc_path}" ]]; then 172 if [[ ! -d "${wc_path}" ]]; then
179 local options="-r+" 173 local options="-r+"
180 # first check out 174 # first check out
181 einfo "bitkeeper check out start -->" 175 einfo "bitkeeper check out start -->"
182 einfo " repository: ${repo_uri}" 176 elog " repository: ${repo_uri}"
183 ${ebk_fetch_cmd} ${options} "${repo_uri}" ${wc_path} \ 177 ${ebk_fetch_cmd} ${options} "${repo_uri}" ${wc_path} \
184 || die "${EBK}: can't fetch from ${repo_uri}." 178 || die "${EBK}: can't fetch from ${repo_uri}."
185 else 179 else
186 if [[ ! -d "${wc_path}/BK" ]]; then 180 if [[ ! -d "${wc_path}/BK" ]]; then
187 popd 181 popd
188 die "Look like ${wc_path} is not a bitkeeper path." 182 die "Look like ${wc_path} is not a bitkeeper path."
189 fi 183 fi
190 184
191 # update working copy 185 # update working copy
192 einfo "bitkeeper update start -->" 186 einfo "bitkeeper update start -->"
193 einfo " repository: ${repo_uri}" 187 elog " repository: ${repo_uri}"
194 188
195 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \ 189 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \
196 || die "BK: can't update from ${repo_uri} to ${wc_path}." 190 || die "BK: can't update from ${repo_uri} to ${wc_path}."
197 fi 191 fi
198 192
278 myconf="${myconf} --without-${i}" 272 myconf="${myconf} --without-${i}"
279 done 273 done
280 myconf="${myconf} --with-extra-charsets=none" 274 myconf="${myconf} --with-extra-charsets=none"
281 myconf="${myconf} --enable-local-infile" 275 myconf="${myconf} --enable-local-infile"
282 276
283 if useq "static" ; then 277 if use static ; then
284 myconf="${myconf} --with-client-ldflags=-all-static" 278 myconf="${myconf} --with-client-ldflags=-all-static"
285 myconf="${myconf} --disable-shared" 279 myconf="${myconf} --disable-shared"
286 else 280 else
287 myconf="${myconf} --enable-shared --enable-static" 281 myconf="${myconf} --enable-shared --enable-static"
288 fi 282 fi
289 283
290 if mysql_version_is_at_least "4.01.00.00" && ! useq "latin1" ; then 284 if mysql_version_is_at_least "4.01.00.00" && ! use latin1 ; then
291 myconf="${myconf} --with-charset=utf8" 285 myconf="${myconf} --with-charset=utf8"
292 myconf="${myconf} --with-collation=utf8_general_ci" 286 myconf="${myconf} --with-collation=utf8_general_ci"
293 else 287 else
294 myconf="${myconf} --with-charset=latin1" 288 myconf="${myconf} --with-charset=latin1"
295 myconf="${myconf} --with-collation=latin1_swedish_ci" 289 myconf="${myconf} --with-collation=latin1_swedish_ci"
303 myconf="${myconf} --with-mysqld-user=mysql" 297 myconf="${myconf} --with-mysqld-user=mysql"
304 myconf="${myconf} --with-server" 298 myconf="${myconf} --with-server"
305 myconf="${myconf} --with-unix-socket-path=/var/run/mysqld/mysqld.sock" 299 myconf="${myconf} --with-unix-socket-path=/var/run/mysqld/mysqld.sock"
306 myconf="${myconf} --without-libwrap" 300 myconf="${myconf} --without-libwrap"
307 301
308 if useq "static" ; then 302 if use static ; then
309 myconf="${myconf} --with-mysqld-ldflags=-all-static" 303 myconf="${myconf} --with-mysqld-ldflags=-all-static"
310 myconf="${myconf} --with-client-ldflags=-all-static" 304 myconf="${myconf} --with-client-ldflags=-all-static"
311 myconf="${myconf} --disable-shared" 305 myconf="${myconf} --disable-shared"
312 else 306 else
313 myconf="${myconf} --enable-shared --enable-static" 307 myconf="${myconf} --enable-shared --enable-static"
314 fi 308 fi
315 309
316 if useq "debug" ; then 310 if use debug ; then
317 myconf="${myconf} --with-debug=full" 311 myconf="${myconf} --with-debug=full"
318 else 312 else
319 myconf="${myconf} --without-debug" 313 myconf="${myconf} --without-debug"
320 mysql_version_is_at_least "4.1.3" \ 314 mysql_version_is_at_least "4.1.3" \
321 && useq "cluster" \ 315 && use cluster \
322 && myconf="${myconf} --without-ndb-debug" 316 && myconf="${myconf} --without-ndb-debug"
323 fi 317 fi
324 318
325 if mysql_version_is_at_least "4.1" && ! useq "latin1" ; then 319 if mysql_version_is_at_least "4.1" && ! use latin1 ; then
326 myconf="${myconf} --with-charset=utf8" 320 myconf="${myconf} --with-charset=utf8"
327 myconf="${myconf} --with-collation=utf8_general_ci" 321 myconf="${myconf} --with-collation=utf8_general_ci"
328 else 322 else
329 myconf="${myconf} --with-charset=latin1" 323 myconf="${myconf} --with-charset=latin1"
330 myconf="${myconf} --with-collation=latin1_swedish_ci" 324 myconf="${myconf} --with-collation=latin1_swedish_ci"
331 fi 325 fi
332 326
333 if useq "embedded" ; then 327 if use embedded ; then
334 myconf="${myconf} --with-embedded-privilege-control" 328 myconf="${myconf} --with-embedded-privilege-control"
335 myconf="${myconf} --with-embedded-server" 329 myconf="${myconf} --with-embedded-server"
336 else 330 else
337 myconf="${myconf} --without-embedded-privilege-control" 331 myconf="${myconf} --without-embedded-privilege-control"
338 myconf="${myconf} --without-embedded-server" 332 myconf="${myconf} --without-embedded-server"
346 myconf="${myconf} --with-extra-tools" 340 myconf="${myconf} --with-extra-tools"
347 myconf="${myconf} --with-innodb" 341 myconf="${myconf} --with-innodb"
348 myconf="${myconf} --without-readline" 342 myconf="${myconf} --without-readline"
349 mysql_version_is_at_least "5.0" || myconf="${myconf} $(use_with raid)" 343 mysql_version_is_at_least "5.0" || myconf="${myconf} $(use_with raid)"
350 344
351 if useq "ssl" ; then 345 if use ssl ; then
352 # --with-vio is not needed anymore, it's on by default and 346 # --with-vio is not needed anymore, it's on by default and
353 # has been removed from configure 347 # has been removed from configure
354 mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio" 348 mysql_version_is_at_least "5.0.4" || myconf="${myconf} --with-vio"
349 fi
350
355 if mysql_version_is_at_least "5.0.6" ; then 351 if mysql_version_is_at_least "5.1.11" ; then
356 # myconf="${myconf} --with-yassl"
357 myconf="${myconf} --with-ssl" 352 myconf="${myconf} $(use_with ssl)"
358 else 353 else
359 myconf="${myconf} --with-openssl" 354 myconf="${myconf} $(use_with ssl openssl)"
360 fi
361 else
362 myconf="${myconf} --without-openssl"
363 fi 355 fi
364 356
365 # The following fix is due to a bug with bdb on SPARC's. See: 357 # The following fix is due to a bug with bdb on SPARC's. See:
366 # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8 358 # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8
367 # It comes down to non-64-bit safety problems. 359 # It comes down to non-64-bit safety problems.
368 if useq "sparc" || useq "alpha" || useq "hppa" || useq "mips" || useq "amd64" ; then 360 if use sparc || use alpha || use hppa || use mips || use amd64 ; then
369 elog "Berkeley DB support was disabled due to incompatible arch" 361 elog "Berkeley DB support was disabled due to incompatible arch"
370 myconf="${myconf} --without-berkeley-db" 362 myconf="${myconf} --without-berkeley-db"
371 else 363 else
372 if useq "berkdb" ; then 364 if use berkdb ; then
373 myconf="${myconf} --with-berkeley-db=./bdb" 365 myconf="${myconf} --with-berkeley-db=./bdb"
374 else 366 else
375 myconf="${myconf} --without-berkeley-db" 367 myconf="${myconf} --without-berkeley-db"
376 fi 368 fi
377 fi 369 fi
379 if mysql_version_is_at_least "4.1.3" ; then 371 if mysql_version_is_at_least "4.1.3" ; then
380 myconf="${myconf} --with-geometry" 372 myconf="${myconf} --with-geometry"
381 myconf="${myconf} $(use_with cluster ndbcluster)" 373 myconf="${myconf} $(use_with cluster ndbcluster)"
382 fi 374 fi
383 375
384 if mysql_version_is_at_least "4.1.3" && useq "extraengine" ; then 376 if mysql_version_is_at_least "4.1.3" && use extraengine ; then
385 # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html 377 # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html
386 myconf="${myconf} --with-archive-storage-engine" 378 myconf="${myconf} --with-archive-storage-engine"
387 379
388 # http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html 380 # http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html
389 myconf="${myconf} --with-csv-storage-engine" 381 myconf="${myconf} --with-csv-storage-engine"
400 myconf="${myconf} --with-federated-storage-engine" 392 myconf="${myconf} --with-federated-storage-engine"
401 fi 393 fi
402 fi 394 fi
403 395
404 mysql_version_is_at_least "5.0.18" \ 396 mysql_version_is_at_least "5.0.18" \
405 && useq "max-idx-128" \ 397 && use max-idx-128 \
406 && myconf="${myconf} --with-max-indexes=128" 398 && myconf="${myconf} --with-max-indexes=128"
407} 399}
408 400
409configure_51() { 401configure_51() {
410 # TODO: !!!! readd --without-readline 402 # TODO: !!!! readd --without-readline
415 myconf="${myconf} --with-geometry" 407 myconf="${myconf} --with-geometry"
416 myconf="${myconf} --with-readline" 408 myconf="${myconf} --with-readline"
417 myconf="${myconf} --with-row-based-replication" 409 myconf="${myconf} --with-row-based-replication"
418 myconf="${myconf} --with-zlib=/usr/$(get_libdir)" 410 myconf="${myconf} --with-zlib=/usr/$(get_libdir)"
419 myconf="${myconf} --without-pstack" 411 myconf="${myconf} --without-pstack"
420 useq "max-idx-128" && myconf="${myconf} --with-max-indexes=128" 412 use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
421 413
422 # 5.1 introduces a new way to manage storage engines (plugins) 414 # 5.1 introduces a new way to manage storage engines (plugins)
423 # like configuration=none 415 # like configuration=none
424 local plugins="csv,myisam,myisammrg,heap" 416 local plugins="csv,myisam,myisammrg,heap"
425 if useq "extraengine" ; then 417 if use extraengine ; then
426 # like configuration=max-no-ndb, archive and example removed in 5.1.11 418 # like configuration=max-no-ndb, archive and example removed in 5.1.11
427 plugins="${plugins},archive,blackhole,example,federated,partition" 419 plugins="${plugins},archive,blackhole,example,federated,partition"
428 420
429 elog "Before using the Federated storage engine, please be sure to read" 421 elog "Before using the Federated storage engine, please be sure to read"
430 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" 422 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
431 fi 423 fi
432 424
433 if useq "innodb" ; then 425 if use innodb ; then
434 plugins="${plugins},innobase" 426 plugins="${plugins},innobase"
435 fi 427 fi
436 428
437 # like configuration=max-no-ndb 429 # like configuration=max-no-ndb
438 if useq "cluster" ; then 430 if use cluster ; then
439 plugins="${plugins},ndbcluster" 431 plugins="${plugins},ndbcluster"
440 myconf="${myconf} --with-ndb-binlog" 432 myconf="${myconf} --with-ndb-binlog"
441 fi 433 fi
442 434
443 if mysql_version_is_at_least "5.2" ; then 435 if mysql_version_is_at_least "5.2" ; then
457 449
458 local myconf 450 local myconf
459 myconf="${myconf} --with-mysql=${S}" 451 myconf="${myconf} --with-mysql=${S}"
460 mkdir -p ${T}/lib 452 mkdir -p ${T}/lib
461 myconf="${myconf} --libdir=${D}/${MY_LIBDIR}" 453 myconf="${myconf} --libdir=${D}/${MY_LIBDIR}"
462 useq "debug" && myconf="${myconf} --with-debug=full" 454 use debug && myconf="${myconf} --with-debug=full"
463 # TODO is safe/needed to use econf here ? 455 # TODO is safe/needed to use econf here ?
464 ./configure ${myconf} || die "problem configuring pbxt storage engine" 456 ./configure ${myconf} || die "problem configuring pbxt storage engine"
465 # TODO is safe/needed to use emake here ? 457 # TODO is safe/needed to use emake here ?
466 make || die "problem making pbxt storage engine (${myconf})" 458 make || die "problem making pbxt storage engine (${myconf})"
467 459
482mysql_pkg_setup() { 474mysql_pkg_setup() {
483 enewgroup mysql 60 || die "problem adding 'mysql' group" 475 enewgroup mysql 60 || die "problem adding 'mysql' group"
484 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 476 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
485 477
486 # Check for USE flag problems in pkg_setup 478 # Check for USE flag problems in pkg_setup
487 if useq "static" && useq "ssl" ; then 479 if use static && use ssl ; then
488 eerror "MySQL does not support being built statically with SSL support enabled!" 480 eerror "MySQL does not support being built statically with SSL support enabled!"
489 die "MySQL does not support being built statically with SSL support enabled!" 481 die "MySQL does not support being built statically with SSL support enabled!"
490 fi 482 fi
491 483
492 if ! mysql_version_is_at_least "5.0" \ 484 if ! mysql_version_is_at_least "5.0" \
493 && useq "raid" \ 485 && use raid \
494 && useq "static" ; then 486 && use static ; then
495 eerror "USE flags 'raid' and 'static' conflict, you cannot build MySQL statically" 487 eerror "USE flags 'raid' and 'static' conflict, you cannot build MySQL statically"
496 eerror "with RAID support enabled." 488 eerror "with RAID support enabled."
497 die "USE flags 'raid' and 'static' conflict!" 489 die "USE flags 'raid' and 'static' conflict!"
498 fi 490 fi
499 491
500 if mysql_version_is_at_least "4.1.3" \ 492 if mysql_version_is_at_least "4.1.3" \
501 && ( useq "cluster" || useq "extraengine" ) \ 493 && ( use cluster || use extraengine ) \
502 && useq "minimal" ; then 494 && use minimal ; then
503 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 495 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
504 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 496 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
505 fi 497 fi
506 498
507 mysql_check_version_range "4.0 to 5.0.99.99" \ 499 mysql_check_version_range "4.0 to 5.0.99.99" \
508 && useq "berkdb" \ 500 && use berkdb \
509 && elog "Berkeley DB support is deprecated and will be removed in future versions!" 501 && elog "Berkeley DB support is deprecated and will be removed in future versions!"
510} 502}
511 503
512mysql_src_unpack() { 504mysql_src_unpack() {
513 # Initialize the proper variables first 505 # Initialize the proper variables first
558 local rebuilddirlist d 550 local rebuilddirlist d
559 551
560 if mysql_version_is_at_least "5.1.12" ; then 552 if mysql_version_is_at_least "5.1.12" ; then
561 rebuilddirlist="." 553 rebuilddirlist="."
562 # TODO IMPO! Check this with a cmake expert 554 # TODO IMPO! Check this with a cmake expert
563 useq "innodb" \ 555 use innodb \
564 && cmake \ 556 && cmake \
565 -DCMAKE_C_COMPILER=$(which $(tc-getCC)) \ 557 -DCMAKE_C_COMPILER=$(which $(tc-getCC)) \
566 -DCMAKE_CXX_COMPILER=$(which $(tc-getCC)) \ 558 -DCMAKE_CXX_COMPILER=$(which $(tc-getCC)) \
567 "storage/innobase" 559 "storage/innobase"
568 else 560 else
575 AT_GNUCONF_UPDATE="yes" eautoreconf 567 AT_GNUCONF_UPDATE="yes" eautoreconf
576 popd &>/dev/null 568 popd &>/dev/null
577 done 569 done
578 570
579 if mysql_check_version_range "4.1 to 5.0.99.99" \ 571 if mysql_check_version_range "4.1 to 5.0.99.99" \
580 && useq "berkdb" ; then 572 && use berkdb ; then
581 [[ -w "bdb/dist/ltmain.sh" ]] && cp -f "ltmain.sh" "bdb/dist/ltmain.sh" 573 [[ -w "bdb/dist/ltmain.sh" ]] && cp -f "ltmain.sh" "bdb/dist/ltmain.sh"
582 pushd "bdb/dist" \ 574 pushd "bdb/dist" \
583 && sh s_all \ 575 && sh s_all \
584 || die "Failed bdb reconfigure" \ 576 || die "Failed bdb reconfigure" \
585 &>/dev/null 577 &>/dev/null
592 mysql_init_vars 584 mysql_init_vars
593 585
594 # $myconf is modified by the configure_* functions 586 # $myconf is modified by the configure_* functions
595 local myconf="" 587 local myconf=""
596 588
597 if useq "minimal" ; then 589 if use minimal ; then
598 configure_minimal 590 configure_minimal
599 else 591 else
600 configure_common 592 configure_common
601 if mysql_version_is_at_least "5.1.10" ; then 593 if mysql_version_is_at_least "5.1.10" ; then
602 configure_51 594 configure_51
637 | xargs -0 -n100 sed -i \ 629 | xargs -0 -n100 sed -i \
638 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|' 630 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
639 631
640 emake || die "emake failed" 632 emake || die "emake failed"
641 633
642 mysql_version_is_at_least "5.1.1" && useq "pbxt" && pbxt_src_compile 634 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_compile
643} 635}
644 636
645mysql_src_install() { 637mysql_src_install() {
646 # Make sure the vars are correctly initialized 638 # Make sure the vars are correctly initialized
647 mysql_init_vars 639 mysql_init_vars
648 640
649 emake install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die 641 emake install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die
650 642
651 mysql_version_is_at_least "5.1.12" && useq "pbxt" && pbxt_src_install 643 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_install
652 644
653 insinto "${MY_INCLUDEDIR}" 645 insinto "${MY_INCLUDEDIR}"
654 doins "${MY_INCLUDEDIR}"/my_{config,dir}.h 646 doins "${MY_INCLUDEDIR}"/my_{config,dir}.h
655 647
656 # Convenience links 648 # Convenience links
674 mv -f "${D}/usr/share/mysql/${moveme}" "${D}/usr/share/mysql${MY_SUFFIX}/" 2>/dev/null 666 mv -f "${D}/usr/share/mysql/${moveme}" "${D}/usr/share/mysql${MY_SUFFIX}/" 2>/dev/null
675 done 667 done
676 fi 668 fi
677 669
678 # clean up stuff for a minimal build 670 # clean up stuff for a minimal build
679 if useq "minimal" ; then 671 if use minimal ; then
680 rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench} 672 rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
681 rm -f "${D}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam} 673 rm -f "${D}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
682 rm -f "${D}/usr/sbin/mysqld" 674 rm -f "${D}/usr/sbin/mysqld"
683 rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a 675 rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
684 fi 676 fi
703 doins scripts/mysqlaccess.conf 695 doins scripts/mysqlaccess.conf
704 sed -e "s!@MY_SUFFIX@!${MY_SUFFIX}!g" \ 696 sed -e "s!@MY_SUFFIX@!${MY_SUFFIX}!g" \
705 -e "s!@DATADIR@!${DATADIR}!g" \ 697 -e "s!@DATADIR@!${DATADIR}!g" \
706 "${FILESDIR}/my.cnf-${mysql_mycnf_version}" \ 698 "${FILESDIR}/my.cnf-${mysql_mycnf_version}" \
707 > "${TMPDIR}/my.cnf.ok" 699 > "${TMPDIR}/my.cnf.ok"
708 if mysql_version_is_at_least "4.1" && useq "latin1" ; then 700 if mysql_version_is_at_least "4.1" && use latin1 ; then
709 sed -e "s|utf8|latin1|g" -i "${TMPDIR}/my.cnf.ok" 701 sed -e "s|utf8|latin1|g" -i "${TMPDIR}/my.cnf.ok"
710 fi 702 fi
711 newins "${TMPDIR}/my.cnf.ok" my.cnf 703 newins "${TMPDIR}/my.cnf.ok" my.cnf
712 704
713 # Minimal builds don't have the MySQL server 705 # Minimal builds don't have the MySQL server
714 if ! useq "minimal" ; then 706 if ! use minimal ; then
715 # Empty directories ... 707 # Empty directories ...
716 diropts "-m0750" 708 diropts "-m0750"
717 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 709 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
718 dodir "${DATADIR}" 710 dodir "${DATADIR}"
719 keepdir "${DATADIR}" 711 keepdir "${DATADIR}"
730 722
731 # Docs 723 # Docs
732 dodoc README COPYING ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE 724 dodoc README COPYING ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE
733 725
734 # Minimal builds don't have the MySQL server 726 # Minimal builds don't have the MySQL server
735 if ! useq "minimal" ; then 727 if ! use minimal ; then
736 docinto "support-files" 728 docinto "support-files"
737 for script in \ 729 for script in \
738 support-files/my-*.cnf \ 730 support-files/my-*.cnf \
739 support-files/magic \ 731 support-files/magic \
740 support-files/ndb-config-2-node.ini 732 support-files/ndb-config-2-node.ini
789 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} 781 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
790 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* 782 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
791 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* 783 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
792 784
793 # Minimal builds don't have the MySQL server 785 # Minimal builds don't have the MySQL server
794 if ! useq "minimal" ; then 786 if ! use minimal ; then
795 docinto "support-files" 787 docinto "support-files"
796 for script in \ 788 for script in \
797 support-files/my-*.cnf \ 789 support-files/my-*.cnf \
798 support-files/magic \ 790 support-files/magic \
799 support-files/ndb-config-2-node.ini 791 support-files/ndb-config-2-node.ini
805 for script in scripts/mysql* ; do 797 for script in scripts/mysql* ; do
806 [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" 798 [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
807 done 799 done
808 fi 800 fi
809 801
810 einfo "you may want to read slotting upgrade documents in the overlay" 802 #einfo "you may want to read slotting upgrade documents in the overlay"
811 if useq "pbxt" && mysql_version_is_at_least "5.1" ; then 803 if mysql_version_is_at_least "5.1.12" && use pbxt ; then
812 # TODO tell it better ;-) 804 # TODO tell it better ;-)
813 einfo "mysql> INSTALL PLUGIN pbxt SONAME 'libpbxt.so';" 805 elog "mysql> INSTALL PLUGIN pbxt SONAME 'libpbxt.so';"
814 einfo "CREATE TABLE t1 (c1 int, c2 text) ENGINE=pbxt;" 806 elog "CREATE TABLE t1 (c1 int, c2 text) ENGINE=pbxt;"
815 einfo "if, after that you cannot start the mysql server" 807 elog "if, after that you cannot start the mysql server"
816 einfo "remove the ${MY_DATADIR}/mysql/plugin.* files, then" 808 elog "remove the ${MY_DATADIR}/mysql/plugin.* files, then"
817 einfo "use the mysql upgrade script to restore the table" 809 elog "use the mysql upgrade script to restore the table"
818 einfo " or " 810 elog " or "
819 einfo "CREATE TABLE IF NOT EXISTS plugin (" 811 elog "CREATE TABLE IF NOT EXISTS plugin ("
820 einfo " name char(64) binary DEFAULT '' NOT NULL," 812 elog " name char(64) binary DEFAULT '' NOT NULL,"
821 einfo " dl char(128) DEFAULT '' NOT NULL," 813 elog " dl char(128) DEFAULT '' NOT NULL,"
822 einfo " PRIMARY KEY (name)" 814 elog " PRIMARY KEY (name)"
823 einfo ") CHARACTER SET utf8 COLLATE utf8_bin;" 815 elog ") CHARACTER SET utf8 COLLATE utf8_bin;"
824 fi 816 fi
825 mysql_check_version_range "4.0 to 5.0.99.99" \ 817 mysql_check_version_range "4.0 to 5.0.99.99" \
826 && useq "berkdb" \ 818 && use berkdb \
827 && elog "Berkeley DB support is deprecated and will be removed in future versions!" 819 && elog "Berkeley DB support is deprecated and will be removed in future versions!"
828} 820}
829 821
830mysql_pkg_config() { 822mysql_pkg_config() {
831 # Make sure the vars are correctly initialized 823 # Make sure the vars are correctly initialized

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.68

  ViewVC Help
Powered by ViewVC 1.1.20