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

Diff of /eclass/mysql.eclass

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

Revision 1.32 Revision 1.40
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.32 2006/05/31 20:45:49 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.40 2006/10/20 15:22:24 chtekk Exp $
4 4
5# Author: Francesco Riosa <vivo@gentoo.org> 5# Author: Francesco Riosa <vivo@gentoo.org>
6# Maintainer: Luca Longinotti <chtekk@gentoo.org> 6# Maintainer: Luca Longinotti <chtekk@gentoo.org>
7 7
8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too 8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too
45# and we will run a mysql server during test phase 45# and we will run a mysql server during test phase
46S="${WORKDIR}/${PN}" 46S="${WORKDIR}/${PN}"
47 47
48# Define $MY_FIXED_PV for MySQL patchsets 48# Define $MY_FIXED_PV for MySQL patchsets
49MY_FIXED_PV="${PV/_alpha/}" 49MY_FIXED_PV="${PV/_alpha/}"
50MY_FIXED_PV="${MY_FIXED_PV/_beta/}" 50#MY_FIXED_PV="${MY_FIXED_PV/_beta/}"
51MY_FIXED_PV="${MY_FIXED_PV/_rc/}" 51#MY_FIXED_PV="${MY_FIXED_PV/_rc/}"
52
53MY_P="${P/_/-}"
52 54
53# Define correct SRC_URIs 55# Define correct SRC_URIs
54SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${P/_/-}.tar.gz" 56SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${MY_P}${MYSQL_RERELEASE}.tar.gz"
55if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then 57if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then
56 MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" 58 MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2"
57 # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball 59 # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball
58 SRC_URI="${SRC_URI} mirror://gentoo/${MYSQL_PATCHSET_FILENAME} http://gentoo.longitekk.com/${MYSQL_PATCHSET_FILENAME}" 60 SRC_URI="${SRC_URI} http://gentoo.longitekk.com/${MYSQL_PATCHSET_FILENAME}"
59fi 61fi
60 62
61DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 63DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
62HOMEPAGE="http://www.mysql.com/" 64HOMEPAGE="http://www.mysql.com/"
63SLOT="0" 65SLOT="0"
64LICENSE="GPL-2" 66LICENSE="GPL-2"
65IUSE="big-tables berkdb debug embedded minimal perl selinux srvdir ssl static" 67IUSE="big-tables debug embedded minimal perl selinux srvdir ssl static"
66RESTRICT="primaryuri confcache" 68RESTRICT="confcache"
67 69
68mysql_version_is_at_least "4.01.00.00" \ 70mysql_version_is_at_least "4.01.00.00" \
69&& IUSE="${IUSE} latin1" 71&& IUSE="${IUSE} latin1"
70 72
71mysql_version_is_at_least "4.01.03.00" \ 73mysql_version_is_at_least "4.01.03.00" \
78&& IUSE="${IUSE} max-idx-128" 80&& IUSE="${IUSE} max-idx-128"
79 81
80mysql_version_is_at_least "5.01.00.00" \ 82mysql_version_is_at_least "5.01.00.00" \
81&& IUSE="${IUSE} innodb" 83&& IUSE="${IUSE} innodb"
82 84
85mysql_version_is_at_least "5.01.00.00" \
86|| IUSE="${IUSE} berkdb"
87
83EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ 88EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \
84 pkg_postinst pkg_config pkg_postrm 89 pkg_postinst pkg_config pkg_postrm
90
91#
92# HELPER FUNCTIONS:
93#
85 94
86# void mysql_init_vars() 95# void mysql_init_vars()
87# 96#
88# Initialize global variables 97# Initialize global variables
89# 2005-11-19 <vivo@gentoo.org> 98# 2005-11-19 <vivo@gentoo.org>
117 else 126 else
118 DATADIR="${MY_LOCALSTATEDIR}" 127 DATADIR="${MY_LOCALSTATEDIR}"
119 fi 128 fi
120 einfo "Using default DATADIR" 129 einfo "Using default DATADIR"
121 fi 130 fi
122 einfo "MySQL DATADIR is ${DATADIR}" 131 elog "MySQL DATADIR is ${DATADIR}"
123 132
124 if [[ -z "${PREVIOUS_DATADIR}" ]] ; then 133 if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
125 if [[ -e "${DATADIR}" ]] ; then 134 if [[ -e "${DATADIR}" ]] ; then
126 ewarn "Previous datadir found, it's YOUR job to change" 135 elog "Previous datadir found, it's YOUR job to change"
127 ewarn "ownership and take care of it" 136 elog "ownership and take care of it"
128 PREVIOUS_DATADIR="yes" 137 PREVIOUS_DATADIR="yes"
129 else 138 else
130 PREVIOUS_DATADIR="no" 139 PREVIOUS_DATADIR="no"
131 fi 140 fi
132 export PREVIOUS_DATADIR 141 export PREVIOUS_DATADIR
137 export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR 146 export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR
138 export MY_INCLUDEDIR 147 export MY_INCLUDEDIR
139 export DATADIR 148 export DATADIR
140} 149}
141 150
151configure_minimal() {
152 # These are things we exclude from a minimal build, please
153 # note that the server actually does get built and installed,
154 # but we then delete it before packaging.
155 local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication"
156
157 for i in ${minimal_exclude_list} ; do
158 myconf="${myconf} --without-${i}"
159 done
160 myconf="${myconf} --with-extra-charsets=none"
161}
162
163configure_common() {
164 myconf="${myconf} $(use_with big-tables)"
165 myconf="${myconf} --enable-local-infile"
166 myconf="${myconf} --with-extra-charsets=all"
167 myconf="${myconf} --with-mysqld-user=mysql"
168 myconf="${myconf} --with-server"
169 myconf="${myconf} --with-unix-socket-path='/var/run/mysqld/mysqld.sock'"
170 myconf="${myconf} --without-libwrap"
171
172 if useq "static" ; then
173 myconf="${myconf} --with-mysqld-ldflags=-all-static"
174 myconf="${myconf} --with-client-ldflags=-all-static"
175 myconf="${myconf} --disable-shared"
176 else
177 myconf="${myconf} --enable-shared --enable-static"
178 fi
179
180 if useq "debug" ; then
181 myconf="${myconf} --with-debug=full"
182 else
183 myconf="${myconf} --without-debug"
184 mysql_version_is_at_least "4.01.03.00" \
185 && useq "cluster" \
186 && myconf="${myconf} --without-ndb-debug"
187 fi
188
189 if mysql_version_is_at_least "4.01.00.00" && ! useq "latin1" ; then
190 myconf="${myconf} --with-charset=utf8"
191 myconf="${myconf} --with-collation=utf8_general_ci"
192 else
193 myconf="${myconf} --with-charset=latin1"
194 myconf="${myconf} --with-collation=latin1_swedish_ci"
195 fi
196
197 if useq "embedded" ; then
198 myconf="${myconf} --with-embedded-privilege-control"
199 myconf="${myconf} --with-embedded-server"
200 else
201 myconf="${myconf} --without-embedded-privilege-control"
202 myconf="${myconf} --without-embedded-server"
203 fi
204
205}
206
207configure_40_41_50() {
208 myconf="${myconf} $(use_with perl bench)"
209 myconf="${myconf} --enable-assembler"
210 myconf="${myconf} --with-extra-tools"
211 myconf="${myconf} --with-innodb"
212 myconf="${myconf} --without-readline"
213 mysql_version_is_at_least "5.00.00.00" || myconf="${myconf} $(use_with raid)"
214
215 if useq "ssl" ; then
216 # --with-vio is not needed anymore, it's on by default and
217 # has been removed from configure
218 mysql_version_is_at_least "5.00.04.00" || myconf="${myconf} --with-vio"
219 if mysql_version_is_at_least "5.00.06.00" ; then
220 # myconf="${myconf} --with-yassl"
221 myconf="${myconf} --with-openssl"
222 else
223 myconf="${myconf} --with-openssl"
224 fi
225 else
226 myconf="${myconf} --without-openssl"
227 fi
228
229 # The following fix is due to a bug with bdb on SPARC's. See:
230 # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8
231 # It comes down to non-64-bit safety problems.
232 if useq "sparc" || useq "alpha" || useq "hppa" || useq "mips" || useq "amd64" ; then
233 elog "Berkeley DB support was disabled due to incompatible arch"
234 myconf="${myconf} --without-berkeley-db"
235 else
236 if useq "berkdb" ; then
237 myconf="${myconf} --with-berkeley-db=./bdb"
238 else
239 myconf="${myconf} --without-berkeley-db"
240 fi
241 fi
242
243 if mysql_version_is_at_least "4.01.03.00" ; then
244 myconf="${myconf} --with-geometry"
245 myconf="${myconf} $(use_with cluster ndbcluster)"
246 fi
247
248 if mysql_version_is_at_least "4.01.03.00" && useq "extraengine" ; then
249 # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html
250 myconf="${myconf} --with-archive-storage-engine"
251
252 # http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html
253 myconf="${myconf} --with-csv-storage-engine"
254
255 # http://dev.mysql.com/doc/mysql/en/blackhole-storage-engine.html
256 myconf="${myconf} --with-blackhole-storage-engine"
257
258 # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html
259 # http://dev.mysql.com/doc/mysql/en/federated-description.html
260 # http://dev.mysql.com/doc/mysql/en/federated-limitations.html
261 if mysql_version_is_at_least "5.00.03.00" ; then
262 elog "Before using the Federated storage engine, please be sure to read"
263 elog "http://dev.mysql.com/doc/mysql/en/federated-limitations.html"
264 myconf="${myconf} --with-federated-storage-engine"
265 fi
266 fi
267
268 mysql_version_is_at_least "5.00.18.00" \
269 && useq "max-idx-128" \
270 && myconf="${myconf} --with-max-indexes=128"
271}
272
273configure_51() {
274 # TODO: !!!! readd --without-readline
275 # the failure depend upon config/ac-macros/readline.m4 checking into
276 # readline.h instead of history.h
277 myconf="${myconf} $(use_with ssl)"
278 myconf="${myconf} --enable-assembler"
279 myconf="${myconf} --with-geometry"
280 myconf="${myconf} --with-readline"
281 myconf="${myconf} --with-row-based-replication"
282 myconf="${myconf} --with-zlib=/usr/$(get_libdir)"
283 myconf="${myconf} --without-pstack"
284 useq "max-idx-128" && myconf="${myconf} --with-max-indexes=128"
285
286 # 5.1 introduces a new way to manage storage engines (plugins)
287 # like configuration=none
288 local plugins="csv,myisam,myisammrg,heap"
289 if useq "extraengine" ; then
290 # like configuration=max-no-ndb, archive and example removed in 5.1.11
291 plugins="${plugins},blackhole,federated,ftexample,partition"
292
293 elog "Before using the Federated storage engine, please be sure to read"
294 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
295 fi
296
297 if useq "innodb" ; then
298 plugins="${plugins},innobase"
299 fi
300
301 # like configuration=max-no-ndb
302 if useq "cluster" ; then
303 plugins="${plugins},ndbcluster"
304 myconf="${myconf} --with-ndb-binlog"
305 fi
306
307 myconf="${myconf} --with-plugins=${plugins}"
308}
309
310#
311# EBUILD FUNCTIONS
312#
313
142mysql_pkg_setup() { 314mysql_pkg_setup() {
143 enewgroup mysql 60 || die "problem adding 'mysql' group" 315 enewgroup mysql 60 || die "problem adding 'mysql' group"
144 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" 316 enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
317
318 if mysql_version_is_at_least "5.01.12.00" && useq "innodb" ; then
319 eerror "InnoDB now uses cmake to build, this is a TODO item, will be fixed shortly!"
320 die "InnoDB now uses cmake to build, this is a TODO item, will be fixed shortly!"
321 fi
145 322
146 # Check for USE flag problems in pkg_setup 323 # Check for USE flag problems in pkg_setup
147 if useq "static" && useq "ssl" ; then 324 if useq "static" && useq "ssl" ; then
148 eerror "MySQL does not support being built statically with SSL support enabled!" 325 eerror "MySQL does not support being built statically with SSL support enabled!"
149 die "MySQL does not support being built statically with SSL support enabled!" 326 die "MySQL does not support being built statically with SSL support enabled!"
161 && ( useq "cluster" || useq "extraengine" ) \ 338 && ( useq "cluster" || useq "extraengine" ) \
162 && useq "minimal" ; then 339 && useq "minimal" ; then
163 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 340 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
164 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 341 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
165 fi 342 fi
343
344 useq "berkdb" && elog "Berkeley DB support is deprecated and will be removed in future versions!"
166} 345}
167 346
168mysql_src_unpack() { 347mysql_src_unpack() {
169 # Initialize the proper variables first 348 # Initialize the proper variables first
170 mysql_init_vars 349 mysql_init_vars
171 350
172 unpack ${A} 351 unpack ${A}
173 352
174 mv -f "${WORKDIR}/${P/_/-}" "${S}" 353 mv -f "${WORKDIR}/${MY_P}${MYSQL_RERELEASE}" "${S}"
175 cd "${S}" 354 cd "${S}"
176 355
177 # Apply the patches for this MySQL version 356 # Apply the patches for this MySQL version
178 if [[ -d "${WORKDIR}/${MY_FIXED_PV}" ]] ; then 357 if [[ -d "${WORKDIR}/${MY_FIXED_PV}" ]] ; then
179 EPATCH_SOURCE="${WORKDIR}/${MY_FIXED_PV}" EPATCH_SUFFIX="patch" epatch 358 EPATCH_SOURCE="${WORKDIR}/${MY_FIXED_PV}" EPATCH_SUFFIX="patch" epatch
183 rm -f "${S}/zlib/"*.[ch] 362 rm -f "${S}/zlib/"*.[ch]
184 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" 363 sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
185 rm -f "scripts/mysqlbug" 364 rm -f "scripts/mysqlbug"
186 365
187 # Make charsets install in the right place 366 # Make charsets install in the right place
367 find . -name 'Makefile.am' \
188 find . -name 'Makefile.am' -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; 368 -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
189 369
190 # Manage mysqlmanager 370 # Manage mysqlmanager
191 mysql_version_is_at_least "5.00.15.00" \ 371 mysql_version_is_at_least "5.00.15.00" \
192 && sed -i -e "s!@GENTOO_EXT@!!g" -e "s!@GENTOO_SOCK_PATH@!var/run/mysqld!g" "${S}/server-tools/instance-manager/Makefile.am" 372 && sed -i -e "s!@GENTOO_EXT@!!g" \
373 -e "s!@GENTOO_SOCK_PATH@!var/run/mysqld!g" \
374 "${S}/server-tools/instance-manager/Makefile.am"
193 375
194 if mysql_version_is_at_least "4.01.00.00" ; then 376 if mysql_version_is_at_least "4.01.00.00" ; then
195 # Remove what needs to be recreated, so we're sure it's actually done 377 # Remove what needs to be recreated, so we're sure it's actually done
196 find . -name Makefile \ 378 find . -name Makefile \
197 -o -name Makefile.in \ 379 -o -name Makefile.in \
198 -o -name configure \ 380 -o -name configure \
199 -exec rm -f {} \; 381 -exec rm -f {} \;
200 rm -f "ltmain.sh" 382 rm -f "ltmain.sh"
383 rm -f "scripts/mysqlbug"
201 fi 384 fi
202 385
203 local rebuilddirlist bdbdir d 386 local rebuilddirlist bdbdir d
204 387
205 if mysql_version_is_at_least "5.01.00.00" ; then 388 if mysql_version_is_at_least "5.01.00.00" ; then
215 pushd "${d}" &>/dev/null 398 pushd "${d}" &>/dev/null
216 AT_GNUCONF_UPDATE="yes" eautoreconf 399 AT_GNUCONF_UPDATE="yes" eautoreconf
217 popd &>/dev/null 400 popd &>/dev/null
218 done 401 done
219 402
220 # TODO: berkdb in MySQL 5.1 needs to be worked on 403 # Berkeley DB has been removed in MySQL 5.1
221 if useq "berkdb" \ 404 if useq "berkdb" \
222 && ! mysql_check_version_range "4.00.00.00 to 4.00.99.99" \
223 && ! mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then 405 && mysql_check_version_range "4.01.00.00 to 5.00.99.99" ; then
224 [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f "ltmain.sh" "${bdbdir}/ltmain.sh" 406 [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f "ltmain.sh" "${bdbdir}/ltmain.sh"
225 pushd "${bdbdir}" \ 407 pushd "${bdbdir}" \
226 && sh s_all \ 408 && sh s_all \
227 || die "Failed bdb reconfigure" \ 409 || die "Failed bdb reconfigure" \
228 &>/dev/null 410 &>/dev/null
309 491
310 # The following fix is due to a bug with bdb on SPARC's. See: 492 # The following fix is due to a bug with bdb on SPARC's. See:
311 # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8 493 # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8
312 # It comes down to non-64-bit safety problems. 494 # It comes down to non-64-bit safety problems.
313 if useq "sparc" || useq "alpha" || useq "hppa" || useq "mips" || useq "amd64" ; then 495 if useq "sparc" || useq "alpha" || useq "hppa" || useq "mips" || useq "amd64" ; then
314 ewarn "bdb berkeley-db disabled due to incompatible arch" 496 elog "Berkeley DB support was disabled due to incompatible arch"
315 myconf="${myconf} --without-berkeley-db" 497 myconf="${myconf} --without-berkeley-db"
316 else 498 else
317 # TODO: berkdb in MySQL 5.1 needs to be worked on 499 # TODO: berkdb in MySQL 5.1 needs to be worked on
318 if useq "berkdb" && ! mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then 500 if useq "berkdb" && ! mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then
319 myconf="${myconf} --with-berkeley-db=./bdb" 501 myconf="${myconf} --with-berkeley-db=./bdb"
375 557
376 # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html 558 # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html
377 # http://dev.mysql.com/doc/mysql/en/federated-description.html 559 # http://dev.mysql.com/doc/mysql/en/federated-description.html
378 # http://dev.mysql.com/doc/mysql/en/federated-limitations.html 560 # http://dev.mysql.com/doc/mysql/en/federated-limitations.html
379 if mysql_version_is_at_least "5.00.03.00" ; then 561 if mysql_version_is_at_least "5.00.03.00" ; then
380 einfo "Before using the Federated storage engine, please be sure to read" 562 elog "Before using the Federated storage engine, please be sure to read"
381 einfo "http://dev.mysql.com/doc/mysql/en/federated-limitations.html" 563 elog "http://dev.mysql.com/doc/mysql/en/federated-limitations.html"
382 myconf="${myconf} --with-federated-storage-engine" 564 myconf="${myconf} --with-federated-storage-engine"
383 fi 565 fi
384 566
385 # http://dev.mysql.com/doc/refman/5.1/en/partitioning-overview.html 567 # http://dev.mysql.com/doc/refman/5.1/en/partitioning-overview.html
386 if mysql_version_is_at_least "5.01.00.00" ; then 568 if mysql_version_is_at_least "5.01.00.00" ; then
393 && myconf="${myconf} --with-max-indexes=128" 575 && myconf="${myconf} --with-max-indexes=128"
394 576
395 mysql_version_is_at_least "5.01.05.00" \ 577 mysql_version_is_at_least "5.01.05.00" \
396 && myconf="${myconf} --with-row-based-replication" 578 && myconf="${myconf} --with-row-based-replication"
397 579
398 # TODO: Rechek again later, there were problems with assembler enabled 580 # TODO: Recheck again later, there were problems with assembler enabled
399 # and some combination of USE flags with MySQL 5.1 581 # and some combinations of USE flags with MySQL 5.1
400 if mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then 582 if mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then
401 myconf="${myconf} --disable-assembler" 583 myconf="${myconf} --disable-assembler"
402 else 584 else
403 myconf="${myconf} --enable-assembler" 585 myconf="${myconf} --enable-assembler"
404 fi 586 fi
407 filter-flags "-O" "-O[01]" 589 filter-flags "-O" "-O[01]"
408 590
409 # glib-2.3.2_pre fix, bug #16496 591 # glib-2.3.2_pre fix, bug #16496
410 append-flags "-DHAVE_ERRNO_AS_DEFINE=1" 592 append-flags "-DHAVE_ERRNO_AS_DEFINE=1"
411 593
412 # The compiler flags are as their "official" spec says ;) 594 append-flags "-fno-exceptions -fno-strict-aliasing"
413 # CFLAGS="${CFLAGS/-O?/} -O3"
414 export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-exceptions -fno-rtti" 595 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
415 mysql_version_is_at_least "5.00.00.00" \ 596 mysql_version_is_at_least "5.00.00.00" \
416 && export CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 597 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
598 export CXXFLAGS
417 599
418 econf \ 600 econf \
419 --libexecdir="/usr/sbin" \ 601 --libexecdir="/usr/sbin" \
420 --sysconfdir="${MY_SYSCONFDIR}" \ 602 --sysconfdir="${MY_SYSCONFDIR}" \
421 --localstatedir="${MY_LOCALSTATEDIR}" \ 603 --localstatedir="${MY_LOCALSTATEDIR}" \
429 --enable-thread-safe-client \ 611 --enable-thread-safe-client \
430 --with-comment="Gentoo Linux ${PF}" \ 612 --with-comment="Gentoo Linux ${PF}" \
431 --with-unix-socket-path="/var/run/mysqld/mysqld.sock" \ 613 --with-unix-socket-path="/var/run/mysqld/mysqld.sock" \
432 --without-readline \ 614 --without-readline \
433 --without-docs \ 615 --without-docs \
434 ${myconf} || die "bad ./configure" 616 ${myconf} || die "econf failed"
435 617
436 # TODO: Move this before autoreconf !!! 618 # TODO: Move this before autoreconf !!!
437 find . -type f -name Makefile -print0 \ 619 find . -type f -name Makefile -print0 \
438 | xargs -0 -n100 sed -i \ 620 | xargs -0 -n100 sed -i \
439 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|' 621 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
440 622
441 emake || die "compile problem" 623 emake || die "emake failed"
442} 624}
443 625
444mysql_src_install() { 626mysql_src_install() {
445 # Make sure the vars are correctly initialized 627 # Make sure the vars are correctly initialized
446 mysql_init_vars 628 mysql_init_vars
447 629
448 make install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die "make install error" 630 emake install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die "emake install failed"
449 631
450 insinto "${MY_INCLUDEDIR}" 632 insinto "${MY_INCLUDEDIR}"
451 doins "${MY_INCLUDEDIR}"/my_{config,dir}.h 633 doins "${MY_INCLUDEDIR}"/my_{config,dir}.h
452 634
453 # Convenience links 635 # Convenience links
455 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" 637 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
456 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" 638 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
457 639
458 # Various junk (my-*.cnf moved elsewhere) 640 # Various junk (my-*.cnf moved elsewhere)
459 rm -Rf "${D}/usr/share/info" 641 rm -Rf "${D}/usr/share/info"
460 for removeme in "mysql-log-rotate" mysql.server* binary-configure* my-*.cnf mi_test_all* ; do 642 for removeme in "mysql-log-rotate" mysql.server* \
643 binary-configure* my-*.cnf mi_test_all*
644 do
461 rm -f "${D}"/usr/share/mysql/${removeme} 645 rm -f "${D}"/usr/share/mysql/${removeme}
462 done 646 done
463 647
464 # Clean up stuff for a minimal build 648 # Clean up stuff for a minimal build
465 if useq "minimal" ; then 649 if useq "minimal" ; then
547mysql_pkg_postinst() { 731mysql_pkg_postinst() {
548 # Make sure the vars are correctly initialized 732 # Make sure the vars are correctly initialized
549 mysql_init_vars 733 mysql_init_vars
550 734
551 # Check FEATURES="collision-protect" before removing this 735 # Check FEATURES="collision-protect" before removing this
736 [[ -d "${ROOT}/var/log/mysql" ]] \
552 [[ -d "${ROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" 737 || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
553 738
554 # Secure the logfiles 739 # Secure the logfiles
555 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} 740 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
556 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* 741 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
557 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* 742 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
558 743
559 if ! useq "minimal" ; then 744 if ! useq "minimal" ; then
560 # Your friendly public service announcement ... 745 # Your friendly public service announcement ...
561 einfo 746 einfo
562 einfo "You might want to run:" 747 elog "You might want to run:"
563 einfo "\"emerge --config =${CATEGORY}/${PF}\"" 748 elog "\"emerge --config =${CATEGORY}/${PF}\""
564 einfo "if this is a new install." 749 elog "if this is a new install."
565 einfo 750 einfo
566 mysql_version_is_at_least "5.01.00.00" \ 751 mysql_version_is_at_least "5.01.00.00" \
567 || einfo "InnoDB is *not* optional as of MySQL-4.0.24, at the request of upstream." 752 || elog "InnoDB is *not* optional as of MySQL-4.0.24, at the request of upstream."
568 fi 753 fi
754 useq "berkdb" && elog "Berkeley DB support is deprecated and will be removed in future versions!"
569} 755}
570 756
571mysql_pkg_config() { 757mysql_pkg_config() {
572 # Make sure the vars are correctly initialized 758 # Make sure the vars are correctly initialized
573 mysql_init_vars 759 mysql_init_vars

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.20