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

Contents of /eclass/mysql-autotools.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Mon Jan 9 10:42:19 2012 UTC (2 years, 8 months ago) by grobian
Branch: MAIN
Changes since 1.4: +1 -1 lines
Restore incorrectly removed eclasses, wrong repo

1 jmbsvicetto 1.3 # Copyright 1999-2012 Gentoo Foundation
2 robbat2 1.1 # Distributed under the terms of the GNU General Public License v2
3 grobian 1.5 # $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql-autotools.eclass,v 1.3 2012/01/06 21:32:48 jmbsvicetto Exp $
4 robbat2 1.1
5     # @ECLASS: mysql-autotools.eclass
6     # @MAINTAINER:
7 vapier 1.2 # MySQL Team <mysql-bugs@gentoo.org>
8     # Robin H. Johnson <robbat2@gentoo.org>
9     # Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
10     # Luca Longinotti <chtekk@gentoo.org>
11     # @AUTHOR:
12     # Francesco Riosa <vivo@gentoo.org> (retired)
13 robbat2 1.1 # @BLURB: This eclass provides support for autotools based mysql releases
14     # @DESCRIPTION:
15     # The mysql-autotools.eclass provides the support to build the mysql
16     # ebuilds using the autotools build system. This eclass provides
17     # the src_unpack, src_prepare, src_configure, src_compile, scr_install,
18     # pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks.
19    
20     inherit autotools
21    
22     #
23     # HELPER FUNCTIONS:
24     #
25    
26     # @FUNCTION: mysql-autotools_disable_test
27     # @DESCRIPTION:
28     # Helper function to disable specific tests.
29     mysql-autotools_disable_test() {
30    
31     local rawtestname testname testsuite reason mysql_disable_file
32     rawtestname="${1}" ; shift
33     reason="${@}"
34     ewarn "test '${rawtestname}' disabled: '${reason}'"
35    
36     testsuite="${rawtestname/.*}"
37     testname="${rawtestname/*.}"
38     mysql_disable_file="${S}/mysql-test/t/disabled.def"
39     #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
40     echo "${testname} : ${reason}" >> "${mysql_disable_file}"
41    
42     # ${S}/mysql-tests/t/disabled.def
43     #
44     # ${S}/mysql-tests/suite/federated/disabled.def
45     #
46     # ${S}/mysql-tests/suite/jp/t/disabled.def
47     # ${S}/mysql-tests/suite/ndb/t/disabled.def
48     # ${S}/mysql-tests/suite/rpl/t/disabled.def
49     # ${S}/mysql-tests/suite/parts/t/disabled.def
50     # ${S}/mysql-tests/suite/rpl_ndb/t/disabled.def
51     # ${S}/mysql-tests/suite/ndb_team/t/disabled.def
52     # ${S}/mysql-tests/suite/binlog/t/disabled.def
53     # ${S}/mysql-tests/suite/innodb/t/disabled.def
54     if [ -n "${testsuite}" ]; then
55     for mysql_disable_file in \
56     ${S}/mysql-test/suite/${testsuite}/disabled.def \
57     ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
58     FAILED ; do
59     [ -f "${mysql_disable_file}" ] && break
60     done
61     if [ "${mysql_disabled_file}" != "FAILED" ]; then
62     echo "${testname} : ${reason}" >> "${mysql_disable_file}"
63     else
64     ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
65     fi
66     fi
67     }
68    
69     # @FUNCTION: mysql-autotools_configure_minimal
70     # @DESCRIPTION:
71     # Helper function to configure a minimal build
72     mysql-autotools_configure_minimal() {
73    
74     # These are things we exclude from a minimal build, please
75     # note that the server actually does get built and installed,
76     # but we then delete it before packaging.
77     local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication readline"
78    
79     for i in ${minimal_exclude_list} ; do
80     myconf="${myconf} --without-${i}"
81     done
82     myconf="${myconf} --with-extra-charsets=none"
83     myconf="${myconf} --enable-local-infile"
84    
85     if use static ; then
86     myconf="${myconf} --with-client-ldflags=-all-static"
87     myconf="${myconf} --disable-shared --with-pic"
88     else
89     myconf="${myconf} --enable-shared --enable-static"
90     fi
91    
92     if ! use latin1 ; then
93     myconf="${myconf} --with-charset=utf8"
94     myconf="${myconf} --with-collation=utf8_general_ci"
95     else
96     myconf="${myconf} --with-charset=latin1"
97     myconf="${myconf} --with-collation=latin1_swedish_ci"
98     fi
99     }
100    
101     # @FUNCTION: mysql-autotools_configure_common
102     # @DESCRIPTION:
103     # Helper function to configure the common builds
104     mysql-autotools_configure_common() {
105    
106     myconf="${myconf} $(use_with big-tables)"
107     myconf="${myconf} --enable-local-infile"
108     myconf="${myconf} --with-extra-charsets=all"
109     myconf="${myconf} --with-mysqld-user=mysql"
110     myconf="${myconf} --with-server"
111 jmbsvicetto 1.3 myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
112 robbat2 1.1 myconf="${myconf} --without-libwrap"
113    
114     if use static ; then
115     myconf="${myconf} --with-mysqld-ldflags=-all-static"
116     myconf="${myconf} --with-client-ldflags=-all-static"
117     myconf="${myconf} --disable-shared --with-pic"
118     else
119     myconf="${myconf} --enable-shared --enable-static"
120     fi
121    
122     if use debug ; then
123     myconf="${myconf} --with-debug=full"
124     else
125     myconf="${myconf} --without-debug"
126     if ( use cluster || [[ "${PN}" == "mysql-cluster" ]] ); then
127     myconf="${myconf} --without-ndb-debug"
128     fi
129     fi
130    
131     if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then
132     ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
133     ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
134     ewarn "You MUST file bugs without these variables set."
135     myconf="${myconf} --with-charset=${MYSQL_DEFAULT_CHARSET}"
136     myconf="${myconf} --with-collation=${MYSQL_DEFAULT_COLLATION}"
137     elif ! use latin1 ; then
138     myconf="${myconf} --with-charset=utf8"
139     myconf="${myconf} --with-collation=utf8_general_ci"
140     else
141     myconf="${myconf} --with-charset=latin1"
142     myconf="${myconf} --with-collation=latin1_swedish_ci"
143     fi
144    
145     if use embedded ; then
146     myconf="${myconf} --with-embedded-privilege-control"
147     myconf="${myconf} --with-embedded-server"
148     else
149     myconf="${myconf} --without-embedded-privilege-control"
150     myconf="${myconf} --without-embedded-server"
151     fi
152    
153     }
154    
155     # @FUNCTION: mysql-autotools_configure_51
156     # @DESCRIPTION:
157     # Helper function to configure 5.1 and later builds
158     mysql-autotools_configure_51() {
159    
160     # TODO: !!!! readd --without-readline
161     # the failure depend upon config/ac-macros/readline.m4 checking into
162     # readline.h instead of history.h
163 jmbsvicetto 1.3 myconf="${myconf} $(use_with ssl ssl "${EPREFIX}"/usr)"
164 robbat2 1.1 myconf="${myconf} --enable-assembler"
165     myconf="${myconf} --with-geometry"
166     myconf="${myconf} --with-readline"
167 jmbsvicetto 1.3 myconf="${myconf} --with-zlib-dir=${EPREFIX}/usr/"
168 robbat2 1.1 myconf="${myconf} --without-pstack"
169 jmbsvicetto 1.3 myconf="${myconf} --with-plugindir=${EPREFIX}/usr/$(get_libdir)/mysql/plugin"
170 robbat2 1.1
171     # This is an explict die here, because if we just forcibly disable it, then the
172     # user's data is not accessible.
173     use max-idx-128 && die "Bug #336027: upstream has a corruption issue with max-idx-128 presently"
174     #use max-idx-128 && myconf="${myconf} --with-max-indexes=128"
175     if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
176     myconf="${myconf} $(use_enable community community-features)"
177     if use community; then
178     myconf="${myconf} $(use_enable profiling)"
179     else
180     myconf="${myconf} --disable-profiling"
181     fi
182     fi
183    
184     # Scan for all available plugins
185     local plugins_avail="$(
186     LANG=C \
187     find "${S}" \
188     \( \
189     -name 'plug.in' \
190     -o -iname 'configure.in' \
191     -o -iname 'configure.ac' \
192     \) \
193     -print0 \
194     | xargs -0 sed -r -n \
195     -e '/^MYSQL_STORAGE_ENGINE/{
196     s~MYSQL_STORAGE_ENGINE\([[:space:]]*\[?([-_a-z0-9]+)\]?.*,~\1 ~g ;
197     s~^([^ ]+).*~\1~gp;
198     }' \
199     | tr -s '\n' ' '
200     )"
201    
202     # 5.1 introduces a new way to manage storage engines (plugins)
203     # like configuration=none
204     # This base set are required, and will always be statically built.
205     local plugins_sta="csv myisam myisammrg heap"
206     local plugins_dyn=""
207     local plugins_dis="example ibmdb2i"
208    
209     # These aren't actually required by the base set, but are really useful:
210     plugins_sta="${plugins_sta} archive blackhole"
211    
212     # Now the extras
213     if use extraengine ; then
214     # like configuration=max-no-ndb, archive and example removed in 5.1.11
215     # not added yet: ibmdb2i
216     # Not supporting as examples: example,daemon_example,ftexample
217     plugins_sta="${plugins_sta} partition"
218    
219     if [[ "${PN}" != "mariadb" ]] ; then
220     elog "Before using the Federated storage engine, please be sure to read"
221     elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
222     plugins_dyn="${plugins_sta} federatedx"
223     else
224     elog "MariaDB includes the FederatedX engine. Be sure to read"
225     elog "http://askmonty.org/wiki/index.php/Manual:FederatedX_storage_engine"
226     plugins_dyn="${plugins_sta} federated"
227     fi
228     else
229     plugins_dis="${plugins_dis} partition federated"
230     fi
231    
232     # Upstream specifically requests that InnoDB always be built:
233     # - innobase, innodb_plugin
234     # Build falcon if available for 6.x series.
235     for i in innobase falcon ; do
236     [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
237     done
238     for i in innodb_plugin ; do
239     [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}"
240     done
241    
242     # like configuration=max-no-ndb
243     if ( use cluster || [[ "${PN}" == "mysql-cluster" ]] ) ; then
244     plugins_sta="${plugins_sta} ndbcluster partition"
245     plugins_dis="${plugins_dis//partition}"
246     myconf="${myconf} --with-ndb-binlog"
247     else
248     plugins_dis="${plugins_dis} ndbcluster"
249     fi
250    
251     if [[ "${PN}" == "mariadb" ]] ; then
252     # In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
253     # caught above.
254     # This is not optional, without it several upstream testcases fail.
255     # Also strongly recommended by upstream.
256     if [[ "${PV}" < "5.2.0" ]] ; then
257     myconf="${myconf} --with-maria-tmp-tables"
258     plugins_sta="${plugins_sta} maria"
259     else
260     myconf="${myconf} --with-aria-tmp-tables"
261     plugins_sta="${plugins_sta} aria"
262     fi
263    
264     [ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] ||
265     die "The ${P} package doesn't provide innobase nor xtradb"
266    
267     for i in innobase xtradb ; do
268     [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
269     done
270    
271     myconf="${myconf} $(use_with libevent)"
272    
273     if mysql_version_is_at_least "5.2" ; then
274     for i in oqgraph ; do
275     use ${i} \
276     && plugins_dyn="${plugins_dyn} ${i}" \
277     || plugins_dis="${plugins_dis} ${i}"
278     done
279     fi
280    
281     if mysql_version_is_at_least "5.2.5" ; then
282     for i in sphinx ; do
283     use ${i} \
284     && plugins_dyn="${plugins_dyn} ${i}" \
285     || plugins_dis="${plugins_dis} ${i}"
286     done
287     fi
288     fi
289    
290     if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
291     use pbxt \
292     && plugins_dyn="${plugins_dyn} pbxt" \
293     || plugins_dis="${plugins_dis} pbxt"
294     fi
295    
296     use static && \
297     plugins_sta="${plugins_sta} ${plugins_dyn}" && \
298     plugins_dyn=""
299    
300     einfo "Available plugins: ${plugins_avail}"
301     einfo "Dynamic plugins: ${plugins_dyn}"
302     einfo "Static plugins: ${plugins_sta}"
303     einfo "Disabled plugins: ${plugins_dis}"
304    
305     # These are the static plugins
306     myconf="${myconf} --with-plugins=${plugins_sta// /,}"
307     # And the disabled ones
308     for i in ${plugins_dis} ; do
309     myconf="${myconf} --without-plugin-${i}"
310     done
311     }
312    
313     pbxt_src_configure() {
314    
315     mysql_init_vars
316    
317     pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null
318    
319     einfo "Reconfiguring dir '${PWD}'"
320     eautoreconf
321    
322     local myconf=""
323 jmbsvicetto 1.3 myconf="${myconf} --with-mysql=${S} --libdir=${EPREFIX}/usr/$(get_libdir)"
324 robbat2 1.1 use debug && myconf="${myconf} --with-debug=full"
325     econf ${myconf} || die "Problem configuring PBXT storage engine"
326     }
327    
328     pbxt_src_compile() {
329    
330     # TODO: is it safe/needed to use emake here ?
331     make || die "Problem making PBXT storage engine (${myconf})"
332    
333     popd
334     # TODO: modify test suite for PBXT
335     }
336    
337     pbxt_src_install() {
338    
339     pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null
340     emake install DESTDIR="${D}" || die "Failed to install PBXT"
341     popd
342     }
343    
344     #
345     # EBUILD FUNCTIONS
346     #
347    
348     # @FUNCTION: mysql-autotools_src_prepare
349     # @DESCRIPTION:
350     # Apply patches to the source code and remove unneeded bundled libs.
351     mysql-autotools_src_prepare() {
352    
353     cd "${S}"
354    
355     # Apply the patches for this MySQL version
356     EPATCH_SUFFIX="patch"
357     mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
358     # Clean out old items
359     rm -f "${EPATCH_SOURCE}"/*
360     # Now link in right patches
361     mysql_mv_patches
362     # And apply
363     epatch
364    
365     # last -fPIC fixup, per bug #305873
366     i="${S}"/storage/innodb_plugin/plug.in
367     [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
368    
369     # Additional checks, remove bundled zlib (Cluster needs this, for static
370     # memory management in zlib, leave available for Cluster)
371     if [[ "${PN}" != "mysql-cluster" ]] ; then
372     rm -f "${S}/zlib/"*.[ch]
373     sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in"
374     fi
375     rm -f "scripts/mysqlbug"
376    
377     # Make charsets install in the right place
378     find . -name 'Makefile.am' \
379     -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \;
380    
381     # Remove what needs to be recreated, so we're sure it's actually done
382     einfo "Cleaning up old buildscript files"
383     find . -name Makefile \
384     -o -name Makefile.in \
385     -o -name configure \
386     -exec rm -f {} \;
387     rm -f "ltmain.sh"
388     rm -f "scripts/mysqlbug"
389    
390     local rebuilddirlist d
391    
392     if xtradb_patch_available && use xtradb ; then
393     einfo "Adding storage engine: Percona XtraDB (replacing InnoDB)"
394     pushd "${S}"/storage >/dev/null
395     i="innobase"
396     o="${WORKDIR}/storage-${i}.mysql-upstream"
397     # Have we been here already?
398     [ -d "${o}" ] && rm -f "${i}"
399     # Or maybe we haven't
400     [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
401     cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
402     popd >/dev/null
403     fi
404    
405     if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
406     einfo "Adding storage engine: PBXT"
407     pushd "${S}"/storage >/dev/null
408     i='pbxt'
409     [ -d "${i}" ] && rm -rf "${i}"
410     cp -ral "${WORKDIR}/${PBXT_P}" "${i}"
411     popd >/dev/null
412     fi
413    
414     rebuilddirlist="."
415     # This does not seem to be needed presently. robbat2 2010/02/23
416     #einfo "Updating innobase cmake"
417     ## TODO: check this with a cmake expert
418     #cmake \
419     # -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
420     # -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
421     # "storage/innobase"
422    
423     for d in ${rebuilddirlist} ; do
424     einfo "Reconfiguring dir '${d}'"
425     pushd "${d}" &>/dev/null
426     eautoreconf
427     popd &>/dev/null
428     done
429     }
430    
431     # @FUNCTION: mysql-autotools_src_configure
432     # @DESCRIPTION:
433     # Configure mysql to build the code for Gentoo respecting the use flags.
434     mysql-autotools_src_configure() {
435    
436     # Make sure the vars are correctly initialized
437     mysql_init_vars
438    
439     # $myconf is modified by the configure_* functions
440     local myconf=""
441    
442     if use minimal ; then
443     mysql-autotools_configure_minimal
444     else
445     mysql-autotools_configure_common
446     mysql-autotools_configure_51
447     fi
448    
449     # Bug #114895, bug #110149
450     filter-flags "-O" "-O[01]"
451    
452     # glib-2.3.2_pre fix, bug #16496
453     append-flags "-DHAVE_ERRNO_AS_DEFINE=1"
454    
455     # As discovered by bug #246652, doing a double-level of SSP causes NDB to
456     # fail badly during cluster startup.
457     if [[ $(gcc-major-version) -lt 4 ]]; then
458     filter-flags "-fstack-protector-all"
459     fi
460    
461     CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing"
462     CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
463     mysql_version_is_at_least "5.0" \
464     && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
465     export CXXFLAGS
466    
467     # bug #283926, with GCC4.4, this is required to get correct behavior.
468     append-flags -fno-strict-aliasing
469    
470     # bug #335185, #335995, with >= GCC4.3.3 on x86 only, omit-frame-pointer
471     # causes a mis-compile.
472     # Upstream bugs:
473     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38562
474     # http://bugs.mysql.com/bug.php?id=45205
475     use x86 && version_is_at_least "4.3.3" "$(gcc-fullversion)" && \
476     append-flags -fno-omit-frame-pointer && \
477     filter-flags -fomit-frame-pointer
478    
479     econf \
480 jmbsvicetto 1.3 --libexecdir="${EPREFIX}/usr/sbin" \
481 robbat2 1.1 --sysconfdir="${MY_SYSCONFDIR}" \
482     --localstatedir="${MY_LOCALSTATEDIR}" \
483     --sharedstatedir="${MY_SHAREDSTATEDIR}" \
484     --libdir="${MY_LIBDIR}" \
485     --includedir="${MY_INCLUDEDIR}" \
486     --with-low-memory \
487     --with-client-ldflags=-lstdc++ \
488     --enable-thread-safe-client \
489     --with-comment="Gentoo Linux ${PF}" \
490     --without-docs \
491     --with-LIBDIR="$(get_libdir)" \
492     ${myconf} || die "econf failed"
493    
494     # TODO: Move this before autoreconf !!!
495     find . -type f -name Makefile -print0 \
496     | xargs -0 -n100 sed -i \
497     -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
498    
499     if [[ $EAPI == 2 ]] && [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
500     pbxt_patch_available && use pbxt && pbxt_src_configure
501     fi
502     }
503    
504     # @FUNCTION: mysql-autotools_src_compile
505     # @DESCRIPTION:
506     # Compile the mysql code.
507     mysql-autotools_src_compile() {
508    
509     emake || die "emake failed"
510    
511     if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
512     pbxt_patch_available && use pbxt && pbxt_src_compile
513     fi
514     }
515    
516     # @FUNCTION: mysql-autotools_src_install
517     # @DESCRIPTION:
518     # Install mysql.
519     mysql-autotools_src_install() {
520    
521     # Make sure the vars are correctly initialized
522     mysql_init_vars
523    
524     emake install \
525     DESTDIR="${D}" \
526     benchdir_root="${MY_SHAREDSTATEDIR}" \
527     testroot="${MY_SHAREDSTATEDIR}" \
528     || die "emake install failed"
529    
530     if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
531     pbxt_patch_available && use pbxt && pbxt_src_install
532     fi
533    
534     # Convenience links
535     einfo "Making Convenience links for mysqlcheck multi-call binary"
536     dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze"
537     dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
538     dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
539    
540     # Various junk (my-*.cnf moved elsewhere)
541     einfo "Removing duplicate /usr/share/mysql files"
542 jmbsvicetto 1.3 rm -Rf "${ED}/usr/share/info"
543 robbat2 1.1 for removeme in "mysql-log-rotate" mysql.server* \
544     binary-configure* my-*.cnf mi_test_all*
545     do
546     rm -f "${D}"/${MY_SHAREDSTATEDIR}/${removeme}
547     done
548    
549     # Clean up stuff for a minimal build
550     if use minimal ; then
551     einfo "Remove all extra content for minimal build"
552     rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
553 jmbsvicetto 1.3 rm -f "${ED}"/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}
554     rm -f "${ED}/usr/sbin/mysqld"
555 robbat2 1.1 rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
556     fi
557    
558     # Unless they explicitly specific USE=test, then do not install the
559     # testsuite. It DOES have a use to be installed, esp. when you want to do a
560     # validation of your database configuration after tuning it.
561     if use !test ; then
562     rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test
563     fi
564    
565     # Configuration stuff
566     case ${MYSQL_PV_MAJOR} in
567     5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;;
568     esac
569     einfo "Building default my.cnf (${mysql_mycnf_version})"
570 jmbsvicetto 1.3 insinto "${MY_SYSCONFDIR#${EPREFIX}}"
571 robbat2 1.1 doins scripts/mysqlaccess.conf
572     mycnf_src="my.cnf-${mysql_mycnf_version}"
573     sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
574 jmbsvicetto 1.3 -e "s!/tmp!${EPREFIX}/tmp!" \
575     -e "s!/usr!${EPREFIX}/usr!" \
576     -e "s!= /var!= ${EPREFIX}/var!" \
577 robbat2 1.1 "${FILESDIR}/${mycnf_src}" \
578     > "${TMPDIR}/my.cnf.ok"
579     if use latin1 ; then
580     sed -i \
581     -e "/character-set/s|utf8|latin1|g" \
582     "${TMPDIR}/my.cnf.ok"
583     fi
584     newins "${TMPDIR}/my.cnf.ok" my.cnf
585    
586     # Minimal builds don't have the MySQL server
587     if ! use minimal ; then
588     einfo "Creating initial directories"
589     # Empty directories ...
590     diropts "-m0750"
591     if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
592 jmbsvicetto 1.3 dodir "${MY_DATADIR#${EPREFIX}}"
593     keepdir "${MY_DATADIR#${EPREFIX}}"
594 robbat2 1.1 chown -R mysql:mysql "${D}/${MY_DATADIR}"
595     fi
596    
597     diropts "-m0755"
598 jmbsvicetto 1.3 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do
599 robbat2 1.1 dodir "${folder}"
600     keepdir "${folder}"
601 jmbsvicetto 1.3 chown -R mysql:mysql "${ED}/${folder}"
602 robbat2 1.1 done
603     fi
604    
605     # Docs
606     einfo "Installing docs"
607     for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do
608     [[ -f "$i" ]] && dodoc "$i"
609     done
610     doinfo "${S}"/Docs/mysql.info
611    
612     # Minimal builds don't have the MySQL server
613     if ! use minimal ; then
614     einfo "Including support files and sample configurations"
615     docinto "support-files"
616     for script in \
617     "${S}"/support-files/my-*.cnf \
618     "${S}"/support-files/magic \
619     "${S}"/support-files/ndb-config-2-node.ini
620     do
621     [[ -f "$script" ]] && dodoc "${script}"
622     done
623    
624     docinto "scripts"
625     for script in "${S}"/scripts/mysql* ; do
626     [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
627     done
628    
629     fi
630    
631 jmbsvicetto 1.3 mysql_lib_symlinks "${ED}"
632 robbat2 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20