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

Diff of /eclass/mysql.eclass

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

Revision 1.30 Revision 1.39
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.30 2006/05/05 19:49:43 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.39 2006/10/20 14:44:01 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"
55[[ -n "${MYSQL_PATCHSET_REV}" ]] && SRC_URI="${SRC_URI} http://gentoo.longitekk.com/${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" 57if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then
58 MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2"
59 # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball
60 SRC_URI="${SRC_URI} http://gentoo.longitekk.com/${MYSQL_PATCHSET_FILENAME}"
61fi
56 62
57DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 63DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
58HOMEPAGE="http://www.mysql.com/" 64HOMEPAGE="http://www.mysql.com/"
59SLOT="0" 65SLOT="0"
60LICENSE="GPL-2" 66LICENSE="GPL-2"
61IUSE="big-tables berkdb debug embedded minimal perl selinux srvdir ssl static" 67IUSE="big-tables debug embedded minimal perl selinux srvdir ssl static"
62RESTRICT="primaryuri confcache" 68RESTRICT="confcache"
63 69
64mysql_version_is_at_least "4.01.00.00" \ 70mysql_version_is_at_least "4.01.00.00" \
65&& IUSE="${IUSE} latin1" 71&& IUSE="${IUSE} latin1"
66 72
67mysql_version_is_at_least "4.01.03.00" \ 73mysql_version_is_at_least "4.01.03.00" \
74&& IUSE="${IUSE} max-idx-128" 80&& IUSE="${IUSE} max-idx-128"
75 81
76mysql_version_is_at_least "5.01.00.00" \ 82mysql_version_is_at_least "5.01.00.00" \
77&& IUSE="${IUSE} innodb" 83&& IUSE="${IUSE} innodb"
78 84
85mysql_version_is_at_least "5.01.00.00" \
86|| IUSE="${IUSE} berkdb"
87
79EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ 88EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \
80 pkg_postinst pkg_config pkg_postrm 89 pkg_postinst pkg_config pkg_postrm
90
91#
92# HELPER FUNCTIONS:
93#
81 94
82# void mysql_init_vars() 95# void mysql_init_vars()
83# 96#
84# Initialize global variables 97# Initialize global variables
85# 2005-11-19 <vivo@gentoo.org> 98# 2005-11-19 <vivo@gentoo.org>
113 else 126 else
114 DATADIR="${MY_LOCALSTATEDIR}" 127 DATADIR="${MY_LOCALSTATEDIR}"
115 fi 128 fi
116 einfo "Using default DATADIR" 129 einfo "Using default DATADIR"
117 fi 130 fi
118 einfo "MySQL DATADIR is ${DATADIR}" 131 elog "MySQL DATADIR is ${DATADIR}"
119 132
120 if [[ -z "${PREVIOUS_DATADIR}" ]] ; then 133 if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
121 if [[ -e "${DATADIR}" ]] ; then 134 if [[ -e "${DATADIR}" ]] ; then
122 ewarn "Previous datadir found, it's YOUR job to change" 135 elog "Previous datadir found, it's YOUR job to change"
123 ewarn "ownership and take care of it" 136 elog "ownership and take care of it"
124 PREVIOUS_DATADIR="yes" 137 PREVIOUS_DATADIR="yes"
125 else 138 else
126 PREVIOUS_DATADIR="no" 139 PREVIOUS_DATADIR="no"
127 fi 140 fi
128 export PREVIOUS_DATADIR 141 export PREVIOUS_DATADIR
133 export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR 146 export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR
134 export MY_INCLUDEDIR 147 export MY_INCLUDEDIR
135 export DATADIR 148 export DATADIR
136} 149}
137 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 --withouth-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
138mysql_pkg_setup() { 314mysql_pkg_setup() {
139 enewgroup mysql 60 || die "problem adding 'mysql' group" 315 enewgroup mysql 60 || die "problem adding 'mysql' group"
140 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
141 322
142 # Check for USE flag problems in pkg_setup 323 # Check for USE flag problems in pkg_setup
143 if useq "static" && useq "ssl" ; then 324 if useq "static" && useq "ssl" ; then
144 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!"
145 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!"
157 && ( useq "cluster" || useq "extraengine" ) \ 338 && ( useq "cluster" || useq "extraengine" ) \
158 && useq "minimal" ; then 339 && useq "minimal" ; then
159 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 340 eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
160 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" 341 die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!"
161 fi 342 fi
343
344 useq "berkdb" && elog "Berkeley DB support is deprecated and will be removed in future versions!"
162} 345}
163 346
164mysql_src_unpack() { 347mysql_src_unpack() {
165 # Initialize the proper variables first 348 # Initialize the proper variables first
166 mysql_init_vars 349 mysql_init_vars
167 350
168 unpack ${A} 351 unpack ${A}
169 352
170 mv -f "${WORKDIR}/${P/_/-}" "${S}" 353 mv -f "${WORKDIR}/${MY_P}${MYSQL_RERELEASE}" "${S}"
171 cd "${S}" 354 cd "${S}"
172 355
173 # Apply the patches for this MySQL version 356 # Apply the patches for this MySQL version
174 if [[ -d "${WORKDIR}/${MY_FIXED_PV}" ]] ; then 357 if [[ -d "${WORKDIR}/${MY_FIXED_PV}" ]] ; then
175 EPATCH_SOURCE="${WORKDIR}/${MY_FIXED_PV}" EPATCH_SUFFIX="patch" epatch 358 EPATCH_SOURCE="${WORKDIR}/${MY_FIXED_PV}" EPATCH_SUFFIX="patch" epatch
179 rm -f "${S}/zlib/"*.[ch] 362 rm -f "${S}/zlib/"*.[ch]
180 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"
181 rm -f "scripts/mysqlbug" 364 rm -f "scripts/mysqlbug"
182 365
183 # Make charsets install in the right place 366 # Make charsets install in the right place
367 find . -name 'Makefile.am' \
184 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' {} \;
185 369
186 # Manage mysqlmanager 370 # Manage mysqlmanager
187 mysql_version_is_at_least "5.00.15.00" \ 371 mysql_version_is_at_least "5.00.15.00" \
188 && 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"
189 375
190 if mysql_version_is_at_least "4.01.00.00" ; then 376 if mysql_version_is_at_least "4.01.00.00" ; then
191 # 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
192 find . -name Makefile \ 378 find . -name Makefile \
193 -o -name Makefile.in \ 379 -o -name Makefile.in \
194 -o -name configure \ 380 -o -name configure \
195 -exec rm -f {} \; 381 -exec rm -f {} \;
196 rm -f "ltmain.sh" 382 rm -f "ltmain.sh"
383 rm -f "scripts/mysqlbug"
197 fi 384 fi
198 385
199 local rebuilddirlist bdbdir d 386 local rebuilddirlist bdbdir d
200 387
201 if mysql_version_is_at_least "5.01.00.00" ; then 388 if mysql_version_is_at_least "5.01.00.00" ; then
211 pushd "${d}" &>/dev/null 398 pushd "${d}" &>/dev/null
212 AT_GNUCONF_UPDATE="yes" eautoreconf 399 AT_GNUCONF_UPDATE="yes" eautoreconf
213 popd &>/dev/null 400 popd &>/dev/null
214 done 401 done
215 402
216 # TODO: berkdb in MySQL 5.1 needs to be worked on 403 # Berkeley DB has been removed in MySQL 5.1
217 if useq "berkdb" \ 404 if useq "berkdb" \
218 && ! mysql_check_version_range "4.00.00.00 to 4.00.99.99" \
219 && ! 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
220 [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f "ltmain.sh" "${bdbdir}/ltmain.sh" 406 [[ -w "${bdbdir}/ltmain.sh" ]] && cp -f "ltmain.sh" "${bdbdir}/ltmain.sh"
221 pushd "${bdbdir}" \ 407 pushd "${bdbdir}" \
222 && sh s_all \ 408 && sh s_all \
223 || die "Failed bdb reconfigure" \ 409 || die "Failed bdb reconfigure" \
224 &>/dev/null 410 &>/dev/null
305 491
306 # 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:
307 # 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
308 # It comes down to non-64-bit safety problems. 494 # It comes down to non-64-bit safety problems.
309 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
310 ewarn "bdb berkeley-db disabled due to incompatible arch" 496 elog "Berkeley DB support was disabled due to incompatible arch"
311 myconf="${myconf} --without-berkeley-db" 497 myconf="${myconf} --without-berkeley-db"
312 else 498 else
313 # TODO: berkdb in MySQL 5.1 needs to be worked on 499 # TODO: berkdb in MySQL 5.1 needs to be worked on
314 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
315 myconf="${myconf} --with-berkeley-db=./bdb" 501 myconf="${myconf} --with-berkeley-db=./bdb"
371 557
372 # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html 558 # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html
373 # http://dev.mysql.com/doc/mysql/en/federated-description.html 559 # http://dev.mysql.com/doc/mysql/en/federated-description.html
374 # http://dev.mysql.com/doc/mysql/en/federated-limitations.html 560 # http://dev.mysql.com/doc/mysql/en/federated-limitations.html
375 if mysql_version_is_at_least "5.00.03.00" ; then 561 if mysql_version_is_at_least "5.00.03.00" ; then
376 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"
377 einfo "http://dev.mysql.com/doc/mysql/en/federated-limitations.html" 563 elog "http://dev.mysql.com/doc/mysql/en/federated-limitations.html"
378 myconf="${myconf} --with-federated-storage-engine" 564 myconf="${myconf} --with-federated-storage-engine"
379 fi 565 fi
380 566
381 # 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
382 if mysql_version_is_at_least "5.01.00.00" ; then 568 if mysql_version_is_at_least "5.01.00.00" ; then
403 filter-flags "-O" "-O[01]" 589 filter-flags "-O" "-O[01]"
404 590
405 # glib-2.3.2_pre fix, bug #16496 591 # glib-2.3.2_pre fix, bug #16496
406 append-flags "-DHAVE_ERRNO_AS_DEFINE=1" 592 append-flags "-DHAVE_ERRNO_AS_DEFINE=1"
407 593
408 # The compiler flags are as their "official" spec says ;) 594 append-flags "-fno-exceptions -fno-strict-aliasing"
409 # CFLAGS="${CFLAGS/-O?/} -O3"
410 export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-exceptions -fno-rtti" 595 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
411 mysql_version_is_at_least "5.00.00.00" \ 596 mysql_version_is_at_least "5.00.00.00" \
412 && export CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 597 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
598 export CXXFLAGS
413 599
414 econf \ 600 econf \
415 --libexecdir="/usr/sbin" \ 601 --libexecdir="/usr/sbin" \
416 --sysconfdir="${MY_SYSCONFDIR}" \ 602 --sysconfdir="${MY_SYSCONFDIR}" \
417 --localstatedir="${MY_LOCALSTATEDIR}" \ 603 --localstatedir="${MY_LOCALSTATEDIR}" \
425 --enable-thread-safe-client \ 611 --enable-thread-safe-client \
426 --with-comment="Gentoo Linux ${PF}" \ 612 --with-comment="Gentoo Linux ${PF}" \
427 --with-unix-socket-path="/var/run/mysqld/mysqld.sock" \ 613 --with-unix-socket-path="/var/run/mysqld/mysqld.sock" \
428 --without-readline \ 614 --without-readline \
429 --without-docs \ 615 --without-docs \
430 ${myconf} || die "bad ./configure" 616 ${myconf} || die "econf failed"
431 617
432 # TODO: Move this before autoreconf !!! 618 # TODO: Move this before autoreconf !!!
433 find . -type f -name Makefile -print0 \ 619 find . -type f -name Makefile -print0 \
434 | xargs -0 -n100 sed -i \ 620 | xargs -0 -n100 sed -i \
435 -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)|'
436 622
437 emake || die "compile problem" 623 emake || die "emake failed"
438} 624}
439 625
440mysql_src_install() { 626mysql_src_install() {
441 # Make sure the vars are correctly initialized 627 # Make sure the vars are correctly initialized
442 mysql_init_vars 628 mysql_init_vars
443 629
444 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"
445 631
446 insinto "${MY_INCLUDEDIR}" 632 insinto "${MY_INCLUDEDIR}"
447 doins "${MY_INCLUDEDIR}"/my_{config,dir}.h 633 doins "${MY_INCLUDEDIR}"/my_{config,dir}.h
448 634
449 # Convenience links 635 # Convenience links
451 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" 637 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
452 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" 638 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
453 639
454 # Various junk (my-*.cnf moved elsewhere) 640 # Various junk (my-*.cnf moved elsewhere)
455 rm -Rf "${D}/usr/share/info" 641 rm -Rf "${D}/usr/share/info"
456 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
457 rm -f "${D}"/usr/share/mysql/${removeme} 645 rm -f "${D}"/usr/share/mysql/${removeme}
458 done 646 done
459 647
460 # Clean up stuff for a minimal build 648 # Clean up stuff for a minimal build
461 if useq "minimal" ; then 649 if useq "minimal" ; then
543mysql_pkg_postinst() { 731mysql_pkg_postinst() {
544 # Make sure the vars are correctly initialized 732 # Make sure the vars are correctly initialized
545 mysql_init_vars 733 mysql_init_vars
546 734
547 # Check FEATURES="collision-protect" before removing this 735 # Check FEATURES="collision-protect" before removing this
736 [[ -d "${ROOT}/var/log/mysql" ]] \
548 [[ -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}"
549 738
550 # Secure the logfiles 739 # Secure the logfiles
551 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} 740 touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
552 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* 741 chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
553 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* 742 chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*
554 743
555 if ! useq "minimal" ; then 744 if ! useq "minimal" ; then
556 # Your friendly public service announcement ... 745 # Your friendly public service announcement ...
557 einfo 746 einfo
558 einfo "You might want to run:" 747 elog "You might want to run:"
559 einfo "\"emerge --config =${CATEGORY}/${PF}\"" 748 elog "\"emerge --config =${CATEGORY}/${PF}\""
560 einfo "if this is a new install." 749 elog "if this is a new install."
561 einfo 750 einfo
562 mysql_version_is_at_least "5.01.00.00" \ 751 mysql_version_is_at_least "5.01.00.00" \
563 || 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."
564 fi 753 fi
754 useq "berkdb" && elog "Berkeley DB support is deprecated and will be removed in future versions!"
565} 755}
566 756
567mysql_pkg_config() { 757mysql_pkg_config() {
568 # Make sure the vars are correctly initialized 758 # Make sure the vars are correctly initialized
569 mysql_init_vars 759 mysql_init_vars

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.20