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

Contents of /eclass/mysql-cmake.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.28 - (hide annotations) (download)
Tue Jul 28 01:58:13 2015 UTC (13 months ago) by grknight
Branch: MAIN
CVS Tags: HEAD
Changes since 1.27: +40 -29 lines
Add support for the split client/server options to the mysql eclasses

1 grknight 1.28 # Copyright 1999-2015 Gentoo Foundation
2 robbat2 1.1 # Distributed under the terms of the GNU General Public License v2
3 grknight 1.28 # $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.27 2015/01/28 13:48:58 grknight Exp $
4 robbat2 1.1
5     # @ECLASS: mysql-cmake.eclass
6     # @MAINTAINER:
7     # Maintainers:
8     # - MySQL Team <mysql-bugs@gentoo.org>
9     # - Robin H. Johnson <robbat2@gentoo.org>
10     # - Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
11 grknight 1.20 # - Brian Evans <grknight@gentoo.org>
12 robbat2 1.1 # @BLURB: This eclass provides the support for cmake based mysql releases
13     # @DESCRIPTION:
14     # The mysql-cmake.eclass provides the support to build the mysql
15     # ebuilds using the cmake build system. This eclass provides
16 jmbsvicetto 1.19 # the src_prepare, src_configure, src_compile, and src_install
17     # phase hooks.
18 robbat2 1.1
19 jmbsvicetto 1.19 inherit cmake-utils flag-o-matic multilib prefix eutils
20 robbat2 1.1
21     #
22     # HELPER FUNCTIONS:
23     #
24    
25     # @FUNCTION: mysql_cmake_disable_test
26     # @DESCRIPTION:
27     # Helper function to disable specific tests.
28     mysql-cmake_disable_test() {
29    
30 robbat2 1.10 local rawtestname testname testsuite reason mysql_disabled_file mysql_disabled_dir
31 robbat2 1.1 rawtestname="${1}" ; shift
32     reason="${@}"
33     ewarn "test '${rawtestname}' disabled: '${reason}'"
34    
35     testsuite="${rawtestname/.*}"
36     testname="${rawtestname/*.}"
37 robbat2 1.10 for mysql_disabled_file in \
38 jmbsvicetto 1.19 ${S}/mysql-test/disabled.def \
39 robbat2 1.10 ${S}/mysql-test/t/disabled.def ; do
40 jmbsvicetto 1.16 [[ -f ${mysql_disabled_file} ]] && break
41 robbat2 1.10 done
42     #mysql_disabled_file="${S}/mysql-test/t/disabled.def"
43 robbat2 1.1 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
44 robbat2 1.10 echo ${testname} : ${reason} >> "${mysql_disabled_file}"
45 robbat2 1.1
46 jmbsvicetto 1.16 if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then
47 robbat2 1.10 for mysql_disabled_file in \
48 jmbsvicetto 1.19 ${S}/mysql-test/suite/${testsuite}/disabled.def \
49     ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
50 robbat2 1.1 FAILED ; do
51 jmbsvicetto 1.16 [[ -f ${mysql_disabled_file} ]] && break
52 robbat2 1.1 done
53 jmbsvicetto 1.16 if [[ ${mysql_disabled_file} != "FAILED" ]]; then
54 robbat2 1.10 echo "${testname} : ${reason}" >> "${mysql_disabled_file}"
55 robbat2 1.1 else
56 robbat2 1.10 for mysql_disabled_dir in \
57     ${S}/mysql-test/suite/${testsuite} \
58 jmbsvicetto 1.19 ${S}/mysql-test/suite/${testsuite}/t \
59 robbat2 1.10 FAILED ; do
60 jmbsvicetto 1.16 [[ -d ${mysql_disabled_dir} ]] && break
61 robbat2 1.10 done
62 jmbsvicetto 1.16 if [[ ${mysql_disabled_dir} != "FAILED" ]]; then
63 robbat2 1.10 echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def"
64     else
65     ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
66     fi
67 robbat2 1.1 fi
68     fi
69     }
70    
71 jmbsvicetto 1.19 # @FUNCTION: mysql-cmake_use_plugin
72     # @DESCRIPTION:
73     # Helper function to enable/disable plugins by use flags
74     # cmake-utils_use_with is not enough as some references check WITH_ (0|1)
75     # and some check WITHOUT_. Also, this can easily extend to non-storage plugins.
76     mysql-cmake_use_plugin() {
77     [[ -z $2 ]] && die "mysql-cmake_use_plugin <USE flag> <flag name>"
78     if use_if_iuse $1 ; then
79 robbat2 1.23 echo "-DWITH_$2=1 -DPLUGIN_$2=YES"
80 jmbsvicetto 1.19 else
81 robbat2 1.23 echo "-DWITHOUT_$2=1 -DWITH_$2=0 -DPLUGIN_$2=NO"
82 jmbsvicetto 1.19 fi
83     }
84    
85 robbat2 1.1 # @FUNCTION: configure_cmake_locale
86     # @DESCRIPTION:
87     # Helper function to configure locale cmake options
88     configure_cmake_locale() {
89    
90 grknight 1.28 if use_if_iuse minimal ; then
91     :
92     elif ! in_iuse server || use_if_iuse server ; then
93     if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
94     ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
95     ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
96     ewarn "You MUST file bugs without these variables set."
97 robbat2 1.1
98 grknight 1.28 mycmakeargs+=(
99     -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
100     -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
101     )
102 robbat2 1.1
103 grknight 1.28 elif ! use latin1 ; then
104     mycmakeargs+=(
105     -DDEFAULT_CHARSET=utf8
106     -DDEFAULT_COLLATION=utf8_general_ci
107     )
108     else
109     mycmakeargs+=(
110     -DDEFAULT_CHARSET=latin1
111     -DDEFAULT_COLLATION=latin1_swedish_ci
112     )
113     fi
114 robbat2 1.1 fi
115     }
116    
117     # @FUNCTION: configure_cmake_minimal
118     # @DESCRIPTION:
119     # Helper function to configure minimal build
120     configure_cmake_minimal() {
121    
122     mycmakeargs+=(
123     -DWITHOUT_SERVER=1
124     -DWITHOUT_EMBEDDED_SERVER=1
125     -DEXTRA_CHARSETS=none
126     -DINSTALL_SQLBENCHDIR=
127     -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1
128     -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1
129     -DWITHOUT_CSV_STORAGE_ENGINE=1
130     -DWITHOUT_FEDERATED_STORAGE_ENGINE=1
131     -DWITHOUT_HEAP_STORAGE_ENGINE=1
132     -DWITHOUT_INNOBASE_STORAGE_ENGINE=1
133     -DWITHOUT_MYISAMMRG_STORAGE_ENGINE=1
134     -DWITHOUT_MYISAM_STORAGE_ENGINE=1
135     -DWITHOUT_PARTITION_STORAGE_ENGINE=1
136 robbat2 1.23 -DPLUGIN_ARCHIVE=NO
137     -DPLUGIN_BLACKHOLE=NO
138     -DPLUGIN_CSV=NO
139     -DPLUGIN_FEDERATED=NO
140     -DPLUGIN_HEAP=NO
141     -DPLUGIN_INNOBASE=NO
142     -DPLUGIN_MYISAMMRG=NO
143     -DPLUGIN_MYISAM=NO
144     -DPLUGIN_PARTITION=NO
145 robbat2 1.1 )
146     }
147    
148     # @FUNCTION: configure_cmake_standard
149     # @DESCRIPTION:
150     # Helper function to configure standard build
151     configure_cmake_standard() {
152    
153     mycmakeargs+=(
154     -DEXTRA_CHARSETS=all
155     -DMYSQL_USER=mysql
156 jmbsvicetto 1.5 -DMYSQL_UNIX_ADDR=${EPREFIX}/var/run/mysqld/mysqld.sock
157 robbat2 1.3 $(cmake-utils_use_disable !static SHARED)
158 robbat2 1.1 $(cmake-utils_use_with debug)
159     $(cmake-utils_use_with embedded EMBEDDED_SERVER)
160     $(cmake-utils_use_with profiling)
161 robbat2 1.4 $(cmake-utils_use_enable systemtap DTRACE)
162 robbat2 1.1 )
163    
164 jmbsvicetto 1.19 if use static; then
165     mycmakeargs+=( -DWITH_PIC=1 )
166 robbat2 1.1 fi
167    
168 jmbsvicetto 1.19 if use jemalloc; then
169     mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
170 robbat2 1.10 fi
171    
172 jmbsvicetto 1.19 if use tcmalloc; then
173     mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
174 robbat2 1.10 fi
175    
176 robbat2 1.1 # Storage engines
177     mycmakeargs+=(
178     -DWITH_ARCHIVE_STORAGE_ENGINE=1
179     -DWITH_BLACKHOLE_STORAGE_ENGINE=1
180     -DWITH_CSV_STORAGE_ENGINE=1
181     -DWITH_HEAP_STORAGE_ENGINE=1
182     -DWITH_INNOBASE_STORAGE_ENGINE=1
183     -DWITH_MYISAMMRG_STORAGE_ENGINE=1
184     -DWITH_MYISAM_STORAGE_ENGINE=1
185     -DWITH_PARTITION_STORAGE_ENGINE=1
186     )
187 robbat2 1.10
188 jmbsvicetto 1.19 if in_iuse pbxt ; then
189 robbat2 1.10 mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) )
190     fi
191    
192 jmbsvicetto 1.19 if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
193 grknight 1.26
194     # Federated{,X} must be treated special otherwise they will not be built as plugins
195     if ! use extraengine ; then
196     mycmakeargs+=(
197     -DWITHOUT_FEDERATED_STORAGE_ENGINE=1
198     -DPLUGIN_FEDERATED=0
199     -DWITHOUT_FEDERATEDX_STORAGE_ENGINE=1
200     -DPLUGIN_FEDERATEDX=0 )
201     fi
202    
203 robbat2 1.10 mycmakeargs+=(
204 jmbsvicetto 1.19 $(mysql-cmake_use_plugin oqgraph OQGRAPH)
205     $(mysql-cmake_use_plugin sphinx SPHINX)
206     $(mysql-cmake_use_plugin tokudb TOKUDB)
207     $(mysql-cmake_use_plugin pam AUTH_PAM)
208 robbat2 1.10 )
209 robbat2 1.14
210 jmbsvicetto 1.19 if mysql_version_is_at_least 10.0.5 ; then
211     # CassandraSE needs Apache Thrift which is not in portage
212     mycmakeargs+=(
213     -DWITHOUT_CASSANDRA=1 -DWITH_CASSANDRA=0
214 robbat2 1.23 -DPLUGIN_CASSANDRA=NO
215 jmbsvicetto 1.19 $(mysql-cmake_use_plugin extraengine SEQUENCE)
216     $(mysql-cmake_use_plugin extraengine SPIDER)
217     $(mysql-cmake_use_plugin extraengine CONNECT)
218     -DCONNECT_WITH_MYSQL=1
219     $(cmake-utils_use xml CONNECT_WITH_LIBXML2)
220     $(cmake-utils_use odbc CONNECT_WITH_ODBC)
221     )
222 robbat2 1.14 fi
223 grknight 1.26
224     if in_iuse mroonga ; then
225     use mroonga || mycmakeargs+=( -DWITHOUT_MROONGA=1 )
226     else
227     mycmakeargs+=( -DWITHOUT_MROONGA=1 )
228     fi
229    
230     if in_iuse galera ; then
231     mycmakeargs+=( $(cmake-utils_use_with galera WSREP) )
232     fi
233    
234     if mysql_version_is_at_least "10.1.1" ; then
235     mycmakeargs+=( $(cmake-utils_use_with innodb-lz4 INNODB_LZ4)
236     $(cmake-utils_use_with innodb-lzo INNODB_LZO) )
237     fi
238 grknight 1.27
239     if mysql_version_is_at_least "10.1.2" ; then
240     mycmakeargs+=( $(mysql-cmake_use_plugin cracklib CRACKLIB_PASSWORD_CHECK ) )
241     fi
242 grknight 1.26 else
243     mycmakeargs+=( $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE) )
244 jmbsvicetto 1.16 fi
245    
246     if [[ ${PN} == "percona-server" ]]; then
247     mycmakeargs+=(
248     $(cmake-utils_use_with pam)
249     )
250 robbat2 1.10 fi
251 jmbsvicetto 1.19
252     if [[ ${PN} == "mysql-cluster" ]]; then
253     # TODO: This really should include the following options,
254     # but the memcached package doesn't install the files it seeks.
255     # -DWITH_BUNDLED_MEMCACHED=OFF
256     # -DMEMCACHED_HOME=${EPREFIX}/usr
257     mycmakeargs+=(
258     -DWITH_BUNDLED_LIBEVENT=OFF
259     $(cmake-utils_use_with java NDB_JAVA)
260     )
261     fi
262 robbat2 1.1 }
263    
264     #
265     # EBUILD FUNCTIONS
266     #
267    
268     # @FUNCTION: mysql-cmake_src_prepare
269     # @DESCRIPTION:
270     # Apply patches to the source code and remove unneeded bundled libs.
271     mysql-cmake_src_prepare() {
272    
273     debug-print-function ${FUNCNAME} "$@"
274    
275     cd "${S}"
276    
277 jmbsvicetto 1.19 if [[ ${MY_EXTRAS_VER} != none ]]; then
278    
279     # Apply the patches for this MySQL version
280     EPATCH_SUFFIX="patch"
281     mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
282     # Clean out old items
283     rm -f "${EPATCH_SOURCE}"/*
284     # Now link in right patches
285     mysql_mv_patches
286     # And apply
287     epatch
288     fi
289 robbat2 1.1
290     # last -fPIC fixup, per bug #305873
291     i="${S}"/storage/innodb_plugin/plug.in
292 jmbsvicetto 1.16 [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
293 robbat2 1.1
294     rm -f "scripts/mysqlbug"
295 jmbsvicetto 1.19 if use jemalloc && ! ( [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.5.33" ); then
296 grknight 1.21 echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die
297 jmbsvicetto 1.19 fi
298    
299     if use tcmalloc; then
300     echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt"
301     fi
302    
303     if in_iuse tokudb ; then
304     # Don't build bundled xz-utils
305     rm -f "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake"
306     touch "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake"
307 grknight 1.25 sed -i 's/ build_lzma//' "${S}/storage/tokudb/ft-index/ft/CMakeLists.txt" || die
308 jmbsvicetto 1.19 fi
309    
310 grknight 1.26 # Remove the bundled groonga if it exists
311     # There is no CMake flag, it simply checks for existance
312     if [[ -d "${S}"/storage/mroonga/vendor/groonga ]] ; then
313     rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga"
314     fi
315    
316 robbat2 1.15 epatch_user
317 robbat2 1.1 }
318    
319     # @FUNCTION: mysql-cmake_src_configure
320     # @DESCRIPTION:
321     # Configure mysql to build the code for Gentoo respecting the use flags.
322     mysql-cmake_src_configure() {
323    
324     debug-print-function ${FUNCNAME} "$@"
325    
326 jmbsvicetto 1.2 CMAKE_BUILD_TYPE="RelWithDebInfo"
327    
328 hasufell 1.18 # debug hack wrt #497532
329 robbat2 1.1 mycmakeargs=(
330 hasufell 1.18 -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug "" "-DNDEBUG")"
331     -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug "" "-DNDEBUG")"
332 jmbsvicetto 1.5 -DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr
333     -DMYSQL_DATADIR=${EPREFIX}/var/lib/mysql
334     -DSYSCONFDIR=${EPREFIX}/etc/mysql
335 robbat2 1.1 -DINSTALL_BINDIR=bin
336     -DINSTALL_DOCDIR=share/doc/${P}
337     -DINSTALL_DOCREADMEDIR=share/doc/${P}
338     -DINSTALL_INCLUDEDIR=include/mysql
339     -DINSTALL_INFODIR=share/info
340 jmbsvicetto 1.19 -DINSTALL_LIBDIR=$(get_libdir)
341     -DINSTALL_ELIBDIR=$(get_libdir)/mysql
342 robbat2 1.1 -DINSTALL_MANDIR=share/man
343 jmbsvicetto 1.5 -DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql
344 robbat2 1.1 -DINSTALL_MYSQLSHAREDIR=share/mysql
345     -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test
346     -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
347     -DINSTALL_SBINDIR=sbin
348     -DINSTALL_SCRIPTDIR=share/mysql/scripts
349     -DINSTALL_SQLBENCHDIR=share/mysql
350 jmbsvicetto 1.5 -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql
351 robbat2 1.1 -DWITH_COMMENT="Gentoo Linux ${PF}"
352 jmbsvicetto 1.16 $(cmake-utils_use_with test UNIT_TESTS)
353 jmbsvicetto 1.19 -DWITH_LIBEDIT=0
354     -DWITH_ZLIB=system
355     -DWITHOUT_LIBWRAP=1
356     -DENABLED_LOCAL_INFILE=1
357 grknight 1.20 $(cmake-utils_use_enable static-libs STATIC_LIBS)
358     -DWITH_SSL=$(usex ssl system bundled)
359 grknight 1.24 -DWITH_DEFAULT_COMPILER_OPTIONS=0
360     -DWITH_DEFAULT_FEATURE_SET=0
361 robbat2 1.1 )
362    
363 robbat2 1.23 if in_iuse bindist ; then
364 grknight 1.21 mycmakeargs+=(
365     -DWITH_READLINE=$(usex bindist 1 0)
366     -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1)
367     $(usex bindist -DHAVE_BFD_H=0 '')
368     )
369 jmbsvicetto 1.19 fi
370    
371 robbat2 1.23 mycmakeargs+=( -DWITH_EDITLINE=system )
372    
373 jmbsvicetto 1.19 if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
374 grknight 1.20 mycmakeargs+=(
375     -DWITH_JEMALLOC=$(usex jemalloc system)
376     )
377 jmbsvicetto 1.19 mysql_version_is_at_least "10.0.9" && mycmakeargs+=( -DWITH_PCRE=system )
378     fi
379    
380 robbat2 1.1 configure_cmake_locale
381    
382 grknight 1.28 if use_if_iuse minimal ; then
383 robbat2 1.1 configure_cmake_minimal
384     else
385     configure_cmake_standard
386     fi
387    
388     # Bug #114895, bug #110149
389     filter-flags "-O" "-O[01]"
390    
391 jmbsvicetto 1.16 CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
392 jmbsvicetto 1.19 CXXFLAGS="${CXXFLAGS} -felide-constructors"
393     # Causes linkage failures. Upstream bug #59607 removes it
394 robbat2 1.15 if ! mysql_version_is_at_least "5.6" ; then
395     CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
396     fi
397 jmbsvicetto 1.19 # As of 5.7, exceptions and rtti are used!
398 jmbsvicetto 1.16 if ! mysql_version_is_at_least "5.7" ; then
399 jmbsvicetto 1.19 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-rtti"
400 jmbsvicetto 1.16 fi
401 robbat2 1.1 export CXXFLAGS
402    
403     # bug #283926, with GCC4.4, this is required to get correct behavior.
404     append-flags -fno-strict-aliasing
405    
406     cmake-utils_src_configure
407     }
408    
409     # @FUNCTION: mysql-cmake_src_compile
410     # @DESCRIPTION:
411     # Compile the mysql code.
412     mysql-cmake_src_compile() {
413    
414     debug-print-function ${FUNCNAME} "$@"
415    
416     cmake-utils_src_compile
417     }
418    
419     # @FUNCTION: mysql-cmake_src_install
420     # @DESCRIPTION:
421     # Install mysql.
422     mysql-cmake_src_install() {
423    
424     debug-print-function ${FUNCNAME} "$@"
425    
426     # Make sure the vars are correctly initialized
427     mysql_init_vars
428    
429     cmake-utils_src_install
430    
431 grknight 1.28 if ! in_iuse tools || use_if_iuse tools ; then
432     # Convenience links
433     einfo "Making Convenience links for mysqlcheck multi-call binary"
434     dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze"
435     dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
436     dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
437     fi
438 robbat2 1.1
439 jmbsvicetto 1.16 # Create a mariadb_config symlink
440 jmbsvicetto 1.19 [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config"
441 jmbsvicetto 1.16
442 robbat2 1.1 # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
443 jmbsvicetto 1.5 rm -Rf "${ED}/usr/data"
444 robbat2 1.1
445     # Various junk (my-*.cnf moved elsewhere)
446     einfo "Removing duplicate /usr/share/mysql files"
447    
448     # Unless they explicitly specific USE=test, then do not install the
449     # testsuite. It DOES have a use to be installed, esp. when you want to do a
450     # validation of your database configuration after tuning it.
451     if ! use test ; then
452     rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test
453     fi
454    
455     # Configuration stuff
456     case ${MYSQL_PV_MAJOR} in
457 robbat2 1.11 5.[1-4]*) mysql_mycnf_version="5.1" ;;
458 grknight 1.25 5.5) mysql_mycnf_version="5.5" ;;
459     5.[6-9]|6*|7*|8*|9*|10*) mysql_mycnf_version="5.6" ;;
460 robbat2 1.1 esac
461     einfo "Building default my.cnf (${mysql_mycnf_version})"
462 robbat2 1.12 insinto "${MY_SYSCONFDIR#${EPREFIX}}"
463 grknight 1.25 [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
464 robbat2 1.1 mycnf_src="my.cnf-${mysql_mycnf_version}"
465     sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
466     "${FILESDIR}/${mycnf_src}" \
467 grknight 1.21 > "${TMPDIR}/my.cnf.ok" || die
468 robbat2 1.23 use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok"
469 robbat2 1.1 if use latin1 ; then
470     sed -i \
471     -e "/character-set/s|utf8|latin1|g" \
472 grknight 1.21 "${TMPDIR}/my.cnf.ok" || die
473 robbat2 1.1 fi
474 robbat2 1.13 eprefixify "${TMPDIR}/my.cnf.ok"
475 robbat2 1.1 newins "${TMPDIR}/my.cnf.ok" my.cnf
476    
477     # Minimal builds don't have the MySQL server
478 grknight 1.28 if use_if_iuse minimal ; then
479     :
480     elif ! in_iuse server || use_if_iuse server ; then
481 robbat2 1.1 einfo "Creating initial directories"
482     # Empty directories ...
483     diropts "-m0750"
484 jmbsvicetto 1.16 if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
485 jmbsvicetto 1.5 dodir "${MY_DATADIR#${EPREFIX}}"
486     keepdir "${MY_DATADIR#${EPREFIX}}"
487 robbat2 1.1 chown -R mysql:mysql "${D}/${MY_DATADIR}"
488     fi
489    
490     diropts "-m0755"
491 jmbsvicetto 1.19 for folder in "${MY_LOGDIR#${EPREFIX}}" ; do
492 robbat2 1.1 dodir "${folder}"
493     keepdir "${folder}"
494 jmbsvicetto 1.5 chown -R mysql:mysql "${ED}/${folder}"
495 robbat2 1.1 done
496     fi
497    
498     # Minimal builds don't have the MySQL server
499 grknight 1.28 if use_if_iuse minimal ; then
500     :
501     elif ! in_iuse server || use_if_iuse server; then
502 robbat2 1.1 einfo "Including support files and sample configurations"
503     docinto "support-files"
504     for script in \
505     "${S}"/support-files/my-*.cnf.sh \
506     "${S}"/support-files/magic \
507     "${S}"/support-files/ndb-config-2-node.ini.sh
508     do
509 jmbsvicetto 1.16 [[ -f $script ]] && dodoc "${script}"
510 robbat2 1.1 done
511    
512     docinto "scripts"
513     for script in "${S}"/scripts/mysql* ; do
514 jmbsvicetto 1.16 [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
515 robbat2 1.1 done
516     fi
517    
518 robbat2 1.14 #Remove mytop if perl is not selected
519 jmbsvicetto 1.19 [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && ! use perl \
520 robbat2 1.14 && rm -f "${ED}/usr/bin/mytop"
521 grknight 1.21
522 grknight 1.28 in_iuse client-libs && ! use client-libs && return
523    
524 grknight 1.21 # Percona has decided to rename libmysqlclient to libperconaserverclient
525     # Use a symlink to preserve linkages for those who don't use mysql_config
526     if [[ ${PN} == "percona-server" ]] && mysql_version_is_at_least "5.5.36" ; then
527     dosym libperconaserverclient.so /usr/$(get_libdir)/libmysqlclient.so
528     dosym libperconaserverclient.so /usr/$(get_libdir)/libmysqlclient_r.so
529     if use static-libs ; then
530     dosym libperconaserverclient.a /usr/$(get_libdir)/libmysqlclient.a
531     dosym libperconaserverclient.a /usr/$(get_libdir)/libmysqlclient_r.a
532     fi
533     fi
534 robbat2 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20