1 |
commit: cc238afd8cca227a5ef5b7bdc6d4629cacf1741f |
2 |
Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 18 19:36:28 2018 +0000 |
4 |
Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 18 19:36:28 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc238afd |
7 |
|
8 |
dev-db/mysql: Drop old |
9 |
|
10 |
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
12 |
|
13 |
dev-db/mysql/Manifest | 1 - |
14 |
dev-db/mysql/mysql-5.6.41.ebuild | 789 --------------------------------------- |
15 |
2 files changed, 790 deletions(-) |
16 |
|
17 |
diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest |
18 |
index 92973c30b6f..4932e7433c2 100644 |
19 |
--- a/dev-db/mysql/Manifest |
20 |
+++ b/dev-db/mysql/Manifest |
21 |
@@ -1,7 +1,6 @@ |
22 |
DIST mysql-5.5.61.tar.gz 21027098 BLAKE2B b7589f632a211349fc34cec94e333b878e07113969bf5cf6f78cd37435d95b15c03eaf188ed09768033b182de125c9f018a5fe902094f17ab891f94cab9de6dd SHA512 978384915c145ec8f0d85deb764154d8d4a9764f2d342928bda6ad43a00bc110aa888895416d2ba5684a4432e433037990dd3fe8c5caf024faa487bc2e153f49 |
23 |
DIST mysql-5.5.62.tar.gz 21111902 BLAKE2B f1cbb1c6b4dfac11c2c517a57a5c6216ce43766cc247b3c9b387326a7f6446cbc21ddb42bd95afa658c3b0ed2568a29563ceea248c6ec63364ce210119d39cc2 SHA512 1080a3989c20bbbfe98739f99dacd183f2087ceee5147845852144240386808568af4c908ecdbccdcb6114000ab760ed7257492834d50018eff9520260fd91ce |
24 |
DIST mysql-5.6.40.tar.gz 32083035 BLAKE2B efcc078341bae239df28ac0504111aa34926885ae47edb5011352b56552a5a3abd1f824f8cbdc23d8d667592b8f5510946ef18c3efa61865dbbc7f4bb8a2d4a0 SHA512 c8e458b4cd34cae87f1b088ed2188bd00de8cdc42709d5964e82fa2e4aaecfc12a75ae006c54ffa0d3d286fbdef9704d0cbb83436437d5705fb8921d960e758c |
25 |
-DIST mysql-5.6.41.tar.gz 32111985 BLAKE2B 5ccad59333525b354db4fa892857e237cddf8fe1a4d289c6e410c31d6142a71d3ce4dab8d954fa9932ec1f83b50e8eccd5845e082deaaa56f1c0c5e21b2ce6c0 SHA512 a62d7a68c6bb49de33f8c9e634bce53cb453a87238e92967115e8e928fa9ed291727b8bd5a5271a0b5b634d957eb310c745edfb14b6be1deb9099bb757aa2cff |
26 |
DIST mysql-5.6.42.tar.gz 32201731 BLAKE2B c573328b37225dac090c32178f90e1419fc1848612e304bddc11eafdd48228981a846857be680978b72ef76edbd5d2422a98b5d20b4d082fabcc2b072e2b8fde SHA512 3104e6a3145a119f2b012de6af2a92fc37134aa402b889a562f5fc2391705d0bc2f718166c5fa8387d973fff5ecd9544c8b389b6d0c81d98bdcaf2acfb9b55e8 |
27 |
DIST mysql-boost-5.7.23.tar.gz 49025014 BLAKE2B 669f10779bc2cda866d6bd876b4efe55fb4b0c796f596f66513a3ca85f322e2a03e9879eecd72a69729a0cb71d408c46cdd9086ae456712b4adff6ae7c584c97 SHA512 e4317f89d108a68652cd95e41ffd670c37b6663aabd6af3985d18052fb7e8d8879b5822399caf9091cecc0a949ec588c121c87cfd60d69941f68d0ecbedd0953 |
28 |
DIST mysql-boost-5.7.24.tar.gz 49110448 BLAKE2B 1cf64712d84cbb2dfd31f2a530470b6f7cbf5ae9107106d86705575ea9739fa582e1f079447d9a58c4762fffc636d69e448ebdec9172ee15dc09245bc39c3525 SHA512 bbd411e15cd9e6053a353146808b74881d2d950f09e94794a699e7604dadf767b58b661a8321fbe1424f2c2e6cfc3adaa388242183e759082eae47b64cbfbcde |
29 |
|
30 |
diff --git a/dev-db/mysql/mysql-5.6.41.ebuild b/dev-db/mysql/mysql-5.6.41.ebuild |
31 |
deleted file mode 100644 |
32 |
index d4052c130f8..00000000000 |
33 |
--- a/dev-db/mysql/mysql-5.6.41.ebuild |
34 |
+++ /dev/null |
35 |
@@ -1,789 +0,0 @@ |
36 |
-# Copyright 1999-2018 Gentoo Authors |
37 |
-# Distributed under the terms of the GNU General Public License v2 |
38 |
- |
39 |
-EAPI="6" |
40 |
-MY_EXTRAS_VER="20181111-2314Z" |
41 |
- |
42 |
-CMAKE_MAKEFILE_GENERATOR=emake |
43 |
- |
44 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
45 |
- |
46 |
-inherit eutils flag-o-matic prefix toolchain-funcs \ |
47 |
- user cmake-utils multilib-build |
48 |
- |
49 |
-SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.6/${P}.tar.gz |
50 |
- https://cdn.mysql.com/archives/mysql-5.6/${P}.tar.gz |
51 |
- http://downloads.mysql.com/archives/MySQL-5.6/${P}.tar.gz" |
52 |
- |
53 |
-# Gentoo patches to MySQL |
54 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
55 |
- SRC_URI="${SRC_URI} |
56 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
57 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
58 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
59 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
60 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
61 |
-fi |
62 |
- |
63 |
-HOMEPAGE="https://www.mysql.com/" |
64 |
-DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" |
65 |
-LICENSE="GPL-2" |
66 |
-SLOT="0/18" |
67 |
-IUSE="client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux |
68 |
- +server static static-libs systemtap tcmalloc test yassl" |
69 |
- |
70 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
71 |
-RESTRICT="libressl? ( test )" |
72 |
- |
73 |
-REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )" |
74 |
- |
75 |
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
76 |
- |
77 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
78 |
-# and we will run a mysql server during test phase |
79 |
-S="${WORKDIR}/mysql" |
80 |
- |
81 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
82 |
- inherit git-r3 |
83 |
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" |
84 |
- EGIT_CHECKOUT_DIR="${WORKDIR}/mysql-extras" |
85 |
- EGIT_CLONE_TYPE=shallow |
86 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras" |
87 |
-else |
88 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" |
89 |
-fi |
90 |
- |
91 |
-PATCHES=( |
92 |
- "${MY_PATCH_DIR}"/01050_all_mysql_config_cleanup-5.6.patch |
93 |
- "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch |
94 |
- "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch |
95 |
- "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch |
96 |
- "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch |
97 |
- "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch |
98 |
- "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch |
99 |
- "${MY_PATCH_DIR}"/20027_all_mysql-5.5-perl5.26-includes.patch |
100 |
- "${MY_PATCH_DIR}"/20028_all_mysql-5.6-gcc7.patch |
101 |
- "${MY_PATCH_DIR}"/20031_all_mysql-5.6-fix-monitor.test.patch |
102 |
- "${MY_PATCH_DIR}"/20036_all_mysql-5.6-fix-rpl_semi_sync_shutdown_hang.test.patch |
103 |
-) |
104 |
- |
105 |
-# Be warned, *DEPEND are version-dependant |
106 |
-# These are used for both runtime and compiletime |
107 |
-COMMON_DEPEND=" |
108 |
- kernel_linux? ( |
109 |
- sys-process/procps:0= |
110 |
- dev-libs/libaio:0= |
111 |
- ) |
112 |
- net-misc/curl |
113 |
- >=sys-apps/sed-4 |
114 |
- >=sys-apps/texinfo-4.7-r1 |
115 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
116 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
117 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
118 |
- !yassl? ( |
119 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
120 |
- libressl? ( dev-libs/libressl:0= ) |
121 |
- ) |
122 |
- >=sys-libs/zlib-1.2.3:0= |
123 |
- sys-libs/ncurses:0= |
124 |
- server? ( |
125 |
- numa? ( sys-process/numactl ) |
126 |
- ) |
127 |
- !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) |
128 |
-" |
129 |
-DEPEND="virtual/yacc |
130 |
- static? ( sys-libs/ncurses[static-libs] ) |
131 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
132 |
- ${COMMON_DEPEND}" |
133 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
134 |
- client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) |
135 |
- !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
136 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
137 |
- ${COMMON_DEPEND} |
138 |
-" |
139 |
-# For other stuff to bring us in |
140 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
141 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" |
142 |
- |
143 |
-pkg_setup() { |
144 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
145 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
146 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
147 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
148 |
- # non x86{,_64} arches |
149 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
150 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
151 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
152 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
153 |
- die |
154 |
- fi |
155 |
- fi |
156 |
- if has test ${FEATURES} && \ |
157 |
- use server && ! has userpriv ${FEATURES} ; then |
158 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
159 |
- fi |
160 |
- |
161 |
- # This should come after all of the die statements |
162 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
163 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
164 |
-} |
165 |
- |
166 |
-pkg_preinst() { |
167 |
- # Here we need to see if the implementation switched client libraries |
168 |
- # We check if this is a new instance of the package and a client library already exists |
169 |
- local SHOW_ABI_MESSAGE libpath |
170 |
- if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT%/}/usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
171 |
- libpath=$(readlink "${EROOT%/}/usr/$(get_libdir)/libmysqlclient.so") |
172 |
- elog "Due to ABI changes when switching between different client libraries," |
173 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
174 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
175 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
176 |
- fi |
177 |
-} |
178 |
- |
179 |
-pkg_postinst() { |
180 |
- # Make sure the vars are correctly initialized |
181 |
- mysql_init_vars |
182 |
- |
183 |
- # Create log directory securely if it does not exist |
184 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
185 |
- |
186 |
- if use server ; then |
187 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
188 |
- einfo |
189 |
- elog "You might want to run:" |
190 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
191 |
- elog "if this is a new install." |
192 |
- elog |
193 |
- elog "If you are switching server implentations, you should run the" |
194 |
- elog "mysql_upgrade tool." |
195 |
- einfo |
196 |
- else |
197 |
- einfo |
198 |
- elog "If you are upgrading major versions, you should run the" |
199 |
- elog "mysql_upgrade tool." |
200 |
- einfo |
201 |
- fi |
202 |
- fi |
203 |
-} |
204 |
- |
205 |
-src_unpack() { |
206 |
- unpack ${A} |
207 |
- # Grab the patches |
208 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack |
209 |
- |
210 |
- mv -f "${WORKDIR}/${P}" "${S}" || die |
211 |
-} |
212 |
- |
213 |
-src_prepare() { |
214 |
- _disable_engine() { |
215 |
- echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
216 |
- } |
217 |
- |
218 |
- _disable_plugin() { |
219 |
- echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
220 |
- } |
221 |
- |
222 |
- if use jemalloc ; then |
223 |
- echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die |
224 |
- fi |
225 |
- if use tcmalloc; then |
226 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die |
227 |
- fi |
228 |
- # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux |
229 |
- if [[ -d "${S}/support-files/SELinux" ]] ; then |
230 |
- echo > "${S}/support-files/SELinux/CMakeLists.txt" || die |
231 |
- fi |
232 |
- |
233 |
- if use libressl ; then |
234 |
- sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \ |
235 |
- "${S}/cmake/ssl.cmake" || die |
236 |
- fi |
237 |
- |
238 |
- sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die |
239 |
- |
240 |
- local plugin |
241 |
- local server_plugins=( semisync ) |
242 |
- local test_plugins=( audit_null daemon_example fulltext ) |
243 |
- if ! use server; then # These plugins are for the server |
244 |
- for plugin in "${server_plugins[@]}" ; do |
245 |
- _disable_plugin "${plugin}" |
246 |
- done |
247 |
- fi |
248 |
- |
249 |
- if ! use test; then # These plugins are only used during testing |
250 |
- for plugin in "${test_plugins[@]}" ; do |
251 |
- _disable_plugin "${plugin}" |
252 |
- done |
253 |
- fi |
254 |
- |
255 |
- # Don't build example |
256 |
- _disable_engine example |
257 |
- _disable_engine ndb |
258 |
- _disable_plugin innodb_memcached |
259 |
- |
260 |
- cmake-utils_src_prepare |
261 |
-} |
262 |
- |
263 |
-src_configure(){ |
264 |
- # bug 508724 mariadb cannot use ld.gold |
265 |
- tc-ld-disable-gold |
266 |
- # Bug #114895, bug #110149 |
267 |
- filter-flags "-O" "-O[01]" |
268 |
- |
269 |
- append-cxxflags -felide-constructors |
270 |
- |
271 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
272 |
- append-flags -fno-strict-aliasing |
273 |
- |
274 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
275 |
- |
276 |
- # debug hack wrt #497532 |
277 |
- mycmakeargs=( |
278 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
279 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
280 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
281 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
282 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
283 |
- -DINSTALL_BINDIR=bin |
284 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
285 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
286 |
- -DINSTALL_INCLUDEDIR=include/mysql |
287 |
- -DINSTALL_INFODIR=share/info |
288 |
- -DINSTALL_LIBDIR=$(get_libdir) |
289 |
- -DINSTALL_MANDIR=share/man |
290 |
- -DINSTALL_MYSQLSHAREDIR=share/mysql |
291 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin |
292 |
- -DINSTALL_SCRIPTDIR=share/mysql/scripts |
293 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
294 |
- -DINSTALL_SBINDIR=sbin |
295 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" |
296 |
- -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" |
297 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
298 |
- ### TODO: make this system but issues with UTF-8 prevent it |
299 |
- -DWITH_EDITLINE=bundled |
300 |
- -DWITH_ZLIB=system |
301 |
- -DWITH_LIBWRAP=0 |
302 |
- -DENABLED_LOCAL_INFILE=1 |
303 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
304 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
305 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
306 |
- # The build forces this to be defined when cross-compiling. We pass it |
307 |
- # all the time for simplicity and to make sure it is actually correct. |
308 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
309 |
- -DWITH_LIBEVENT=NO |
310 |
- -DWITHOUT_CLIENTLIBS=YES |
311 |
- -DENABLE_DTRACE=$(usex systemtap) |
312 |
- -DWITH_SSL=$(usex yassl bundled system) |
313 |
- -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mysql/mysql-test' '') |
314 |
- -DWITHOUT_VALIDATE_PASSWORD=1 |
315 |
- ) |
316 |
- |
317 |
- if use server ; then |
318 |
- |
319 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
320 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
321 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
322 |
- ewarn "You MUST file bugs without these variables set." |
323 |
- |
324 |
- mycmakeargs+=( |
325 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
326 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
327 |
- ) |
328 |
- |
329 |
- elif ! use latin1 ; then |
330 |
- mycmakeargs+=( |
331 |
- -DDEFAULT_CHARSET=utf8 |
332 |
- -DDEFAULT_COLLATION=utf8_general_ci |
333 |
- ) |
334 |
- else |
335 |
- mycmakeargs+=( |
336 |
- -DDEFAULT_CHARSET=latin1 |
337 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
338 |
- ) |
339 |
- fi |
340 |
- mycmakeargs+=( |
341 |
- -DWITH_NUMA=$(usex numa ON OFF) |
342 |
- -DEXTRA_CHARSETS=all |
343 |
- -DDISABLE_SHARED=$(usex static YES NO) |
344 |
- -DWITH_DEBUG=$(usex debug) |
345 |
- -DWITH_EMBEDDED_SERVER=OFF |
346 |
- -DENABLED_PROFILING=$(usex profiling) |
347 |
- ) |
348 |
- |
349 |
- if use static; then |
350 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
351 |
- fi |
352 |
- |
353 |
- # Storage engines |
354 |
- mycmakeargs+=( |
355 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
356 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
357 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
358 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
359 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
360 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
361 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
362 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
363 |
- -DWITH_INNODB_MEMCACHED=0 |
364 |
- ) |
365 |
- |
366 |
- else |
367 |
- mycmakeargs+=( |
368 |
- -DWITHOUT_SERVER=1 |
369 |
- -DWITH_EMBEDDED_SERVER=OFF |
370 |
- -DEXTRA_CHARSETS=none |
371 |
- ) |
372 |
- fi |
373 |
- |
374 |
- cmake-utils_src_configure |
375 |
-} |
376 |
- |
377 |
-src_compile() { |
378 |
- cmake-utils_src_compile |
379 |
-} |
380 |
- |
381 |
-src_install() { |
382 |
- cmake-utils_src_install |
383 |
- |
384 |
- # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. |
385 |
- find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die |
386 |
- # Make sure the vars are correctly initialized |
387 |
- mysql_init_vars |
388 |
- |
389 |
- # Convenience links |
390 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
391 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
392 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
393 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
394 |
- |
395 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
396 |
- if [[ -d "${ED}/usr/data" ]] ; then |
397 |
- rm -Rf "${ED}/usr/data" || die |
398 |
- fi |
399 |
- |
400 |
- # Unless they explicitly specific USE=test, then do not install the |
401 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
402 |
- # validation of your database configuration after tuning it. |
403 |
- if ! use test ; then |
404 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
405 |
- fi |
406 |
- |
407 |
- # Configuration stuff |
408 |
- einfo "Building default configuration ..." |
409 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
410 |
- [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf |
411 |
- local mycnf_src="my.cnf-5.6" |
412 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
413 |
- "${FILESDIR%/}/${mycnf_src}" \ |
414 |
- > "${TMPDIR%/}/my.cnf.ok" || die |
415 |
- use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok" |
416 |
- if use latin1 ; then |
417 |
- sed -i \ |
418 |
- -e "/character-set/s|utf8|latin1|g" \ |
419 |
- "${TMPDIR%/}/my.cnf.ok" || die |
420 |
- fi |
421 |
- eprefixify "${TMPDIR%/}/my.cnf.ok" |
422 |
- newins "${TMPDIR}/my.cnf.ok" my.cnf |
423 |
- |
424 |
- if use server ; then |
425 |
- einfo "Including support files and sample configurations" |
426 |
- docinto "support-files" |
427 |
- local script |
428 |
- for script in \ |
429 |
- "${S}"/support-files/magic |
430 |
- do |
431 |
- [[ -f "$script" ]] && dodoc "${script}" |
432 |
- done |
433 |
- |
434 |
- docinto "scripts" |
435 |
- for script in "${S}"/scripts/mysql* ; do |
436 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
437 |
- done |
438 |
- fi |
439 |
- |
440 |
- #Remove mytop if perl is not selected |
441 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
442 |
-} |
443 |
- |
444 |
-# Official test instructions: |
445 |
-# USE='perl server static-libs' \ |
446 |
-# FEATURES='test userpriv -usersandbox' \ |
447 |
-# ebuild mysql-X.X.XX.ebuild \ |
448 |
-# digest clean package |
449 |
-src_test() { |
450 |
- |
451 |
- _disable_test() { |
452 |
- local rawtestname reason |
453 |
- rawtestname="${1}" ; shift |
454 |
- reason="${@}" |
455 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
456 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
457 |
- } |
458 |
- |
459 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
460 |
- local retstatus_unit |
461 |
- local retstatus_tests |
462 |
- |
463 |
- if ! use server ; then |
464 |
- einfo "Skipping server tests due to minimal build." |
465 |
- return 0 |
466 |
- fi |
467 |
- |
468 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
469 |
- # localhost. Also causes weird failures. |
470 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
471 |
- |
472 |
- if [[ $UID -eq 0 ]]; then |
473 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
474 |
- fi |
475 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
476 |
- |
477 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
478 |
- |
479 |
- # Run CTest (test-units) |
480 |
- cmake-utils_src_test |
481 |
- retstatus_unit=$? |
482 |
- |
483 |
- # Ensure that parallel runs don't die |
484 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
485 |
- # Enable parallel testing, auto will try to detect number of cores |
486 |
- # You may set this by hand. |
487 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
488 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
489 |
- |
490 |
- # create directories because mysqladmin might run out of order |
491 |
- mkdir -p "${T}"/var-tests{,/log} || die |
492 |
- |
493 |
- # Run mysql tests |
494 |
- pushd "${TESTDIR}" > /dev/null || die |
495 |
- |
496 |
- touch "${T}/disabled.def" |
497 |
- # These are failing in MySQL 5.7 for now and are believed to be |
498 |
- # false positives: |
499 |
- # |
500 |
- local t |
501 |
- |
502 |
- for t in auth_sec.keyring_udf federated.federated_plugin ; do |
503 |
- _disable_test "$t" "False positives in Gentoo" |
504 |
- done |
505 |
- |
506 |
- # run mysql-test tests |
507 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
508 |
- retstatus_tests=$? |
509 |
- |
510 |
- popd > /dev/null || die |
511 |
- |
512 |
- # Cleanup is important for these testcases. |
513 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
514 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
515 |
- |
516 |
- local failures="" |
517 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
518 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
519 |
- |
520 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
521 |
- einfo "Tests successfully completed" |
522 |
-} |
523 |
- |
524 |
-mysql_init_vars() { |
525 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX%/}/usr/share/mysql"} |
526 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX%/}/etc/mysql"} |
527 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX%/}/var/lib/mysql"} |
528 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX%/}/var/log/mysql"} |
529 |
- |
530 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
531 |
- MY_DATADIR="" |
532 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
533 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
534 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
535 |
- | tail -n1` |
536 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
537 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
538 |
- | sed -e 's/.*=\s*//' \ |
539 |
- | tail -n1` |
540 |
- fi |
541 |
- fi |
542 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
543 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
544 |
- einfo "Using default MY_DATADIR" |
545 |
- fi |
546 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
547 |
- |
548 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
549 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
550 |
- # If you get this and you're wondering about it, see bug #207636 |
551 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
552 |
- elog "A new one will not be created." |
553 |
- PREVIOUS_DATADIR="yes" |
554 |
- else |
555 |
- PREVIOUS_DATADIR="no" |
556 |
- fi |
557 |
- export PREVIOUS_DATADIR |
558 |
- fi |
559 |
- else |
560 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
561 |
- local new_MY_DATADIR |
562 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
563 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
564 |
- | tail -n1` |
565 |
- |
566 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
567 |
- ewarn "MySQL MY_DATADIR has changed" |
568 |
- ewarn "from ${MY_DATADIR}" |
569 |
- ewarn "to ${new_MY_DATADIR}" |
570 |
- MY_DATADIR="${new_MY_DATADIR}" |
571 |
- fi |
572 |
- fi |
573 |
- fi |
574 |
- |
575 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
576 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
577 |
- export MY_DATADIR |
578 |
-} |
579 |
- |
580 |
-pkg_config() { |
581 |
- _getoptval() { |
582 |
- local mypd="${EROOT%/}"/usr/bin/my_print_defaults |
583 |
- local section="$1" |
584 |
- local flag="--${2}=" |
585 |
- local extra_options="${3}" |
586 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
587 |
- } |
588 |
- local old_MY_DATADIR="${MY_DATADIR}" |
589 |
- local old_HOME="${HOME}" |
590 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
591 |
- export HOME=${EPREFIX%/}/root |
592 |
- |
593 |
- # Make sure the vars are correctly initialized |
594 |
- mysql_init_vars |
595 |
- |
596 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
597 |
- if [[ ! -x "${EROOT%/}/usr/sbin/mysqld" ]] ; then |
598 |
- die "Minimal builds do NOT include the MySQL server" |
599 |
- fi |
600 |
- |
601 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
602 |
- local MY_DATADIR_s="${ROOT%/}/${MY_DATADIR}" |
603 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
604 |
- local old_MY_DATADIR_s="${ROOT%/}/${old_MY_DATADIR}" |
605 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
606 |
- |
607 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
608 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
609 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
610 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
611 |
- else |
612 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
613 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
614 |
- || die "Moving MY_DATADIR failed" |
615 |
- fi |
616 |
- else |
617 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
618 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
619 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
620 |
- else |
621 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
622 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
623 |
- fi |
624 |
- fi |
625 |
- fi |
626 |
- |
627 |
- local pwd1="a" |
628 |
- local pwd2="b" |
629 |
- local maxtry=15 |
630 |
- |
631 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
632 |
- local tmp_mysqld_password_source= |
633 |
- |
634 |
- for tmp_mysqld_password_source in mysql client; do |
635 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
636 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
637 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
638 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
639 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
640 |
- MYSQL_ROOT_PASSWORD= |
641 |
- continue |
642 |
- fi |
643 |
- |
644 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
645 |
- break |
646 |
- fi |
647 |
- done |
648 |
- |
649 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
650 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
651 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
652 |
- fi |
653 |
- |
654 |
- unset tmp_mysqld_password_source |
655 |
- fi |
656 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)" |
657 |
- # These are dir+prefix |
658 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" |
659 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
660 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" |
661 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
662 |
- |
663 |
- if [[ ! -d "${EROOT%/}/$MYSQL_TMPDIR" ]]; then |
664 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
665 |
- install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR" |
666 |
- fi |
667 |
- if [[ ! -d "${EROOT%/}/$MYSQL_LOG_BIN" ]]; then |
668 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
669 |
- install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_LOG_BIN" |
670 |
- fi |
671 |
- if [[ ! -d "${EROOT%/}/$MYSQL_RELAY_LOG" ]]; then |
672 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
673 |
- install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_RELAY_LOG" |
674 |
- fi |
675 |
- |
676 |
- if [[ -d "${ROOT%/}/${MY_DATADIR}/mysql" ]] ; then |
677 |
- ewarn "You have already a MySQL database in place." |
678 |
- ewarn "(${ROOT%/}/${MY_DATADIR}/*)" |
679 |
- ewarn "Please rename or delete it if you wish to replace it." |
680 |
- die "MySQL database already exists!" |
681 |
- fi |
682 |
- |
683 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
684 |
- # localhost. Also causes weird failures. |
685 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
686 |
- |
687 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
688 |
- |
689 |
- einfo "Please provide a password for the mysql 'root' user now" |
690 |
- einfo "or through the ${HOME}/.my.cnf file." |
691 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
692 |
- read -rsp " >" pwd1 ; echo |
693 |
- |
694 |
- einfo "Retype the password" |
695 |
- read -rsp " >" pwd2 ; echo |
696 |
- |
697 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
698 |
- die "Passwords are not the same" |
699 |
- fi |
700 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
701 |
- unset pwd1 pwd2 |
702 |
- fi |
703 |
- |
704 |
- local options |
705 |
- local sqltmp="$(emktemp)" |
706 |
- |
707 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
708 |
- # see http://bugs.mysql.com/bug.php?id=31312 |
709 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
710 |
- |
711 |
- local help_tables="${EROOT%/}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" |
712 |
- [[ -r "${help_tables}" ]] \ |
713 |
- && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ |
714 |
- || touch "${TMPDIR}/fill_help_tables.sql" |
715 |
- help_tables="${TMPDIR}/fill_help_tables.sql" |
716 |
- |
717 |
- # Figure out which options we need to disable to do the setup |
718 |
- local helpfile="${TMPDIR%/}/mysqld-help" |
719 |
- "${EROOT%/}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
720 |
- for opt in host-cache name-resolve networking slave-start \ |
721 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
722 |
- log-slave-updates \ |
723 |
- ; do |
724 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
725 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
726 |
- done |
727 |
- |
728 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
729 |
- |
730 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
731 |
- PID_DIR="${EROOT%/}/var/run/mysqld" |
732 |
- if [[ ! -d "${PID_DIR}" ]]; then |
733 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
734 |
- fi |
735 |
- |
736 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
737 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
738 |
- fi |
739 |
- |
740 |
- pushd "${TMPDIR}" &>/dev/null || die |
741 |
- |
742 |
- # Filling timezones, see |
743 |
- # http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
744 |
- "${EROOT%/}/usr/bin/mysql_tzinfo_to_sql" "${EROOT%/}/usr/share/zoneinfo" >> "${sqltmp}" 2>/dev/null |
745 |
- chown mysql "${sqltmp}" || die |
746 |
- |
747 |
- local cmd=( "${EROOT%/}/usr/share/mysql/scripts/mysql_install_db" ) |
748 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT%/}/usr/bin/mysql_install_db" ) |
749 |
- if [[ -r "${help_tables}" ]] ; then |
750 |
- cat "${help_tables}" >> "${sqltmp}" |
751 |
- fi |
752 |
- cmd+=( "--basedir=${EPREFIX%/}/usr" ${options} "--datadir=${ROOT%/}${MY_DATADIR}" "--tmpdir=${ROOT%/}${MYSQL_TMPDIR}" ) |
753 |
- einfo "Command: ${cmd[*]}" |
754 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
755 |
- >"${TMPDIR%/}"/mysql_install_db.log 2>&1 |
756 |
- if [ $? -ne 0 ]; then |
757 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR%/}"/mysql_install_db.log 1>&2 |
758 |
- die "Failed to initialize mysqld. Please review ${EPREFIX%/}/var/log/mysql/mysqld.err AND ${TMPDIR%/}/mysql_install_db.log" |
759 |
- fi |
760 |
- popd &>/dev/null || die |
761 |
- [[ -f "${ROOT%/}/${MY_DATADIR}/mysql/user.frm" ]] \ |
762 |
- || die "MySQL databases not installed" |
763 |
- |
764 |
- use prefix || options="${options} --user=mysql" |
765 |
- |
766 |
- local socket="${EROOT%/}/var/run/mysqld/mysqld${RANDOM}.sock" |
767 |
- local pidfile="${EROOT%/}/var/run/mysqld/mysqld${RANDOM}.pid" |
768 |
- local mysqld="${EROOT%/}/usr/sbin/mysqld \ |
769 |
- ${options} \ |
770 |
- $(use prefix || echo --user=mysql) \ |
771 |
- --log-warnings=0 \ |
772 |
- --basedir=${EROOT%/}/usr \ |
773 |
- --datadir=${ROOT%/}/${MY_DATADIR} \ |
774 |
- --max_allowed_packet=8M \ |
775 |
- --net_buffer_length=16K \ |
776 |
- --socket=${socket} \ |
777 |
- --pid-file=${pidfile} \ |
778 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
779 |
- #einfo "About to start mysqld: ${mysqld}" |
780 |
- ebegin "Starting mysqld" |
781 |
- einfo "Command ${mysqld}" |
782 |
- ${mysqld} & |
783 |
- rc=$? |
784 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
785 |
- maxtry=$((${maxtry}-1)) |
786 |
- echo -n "." |
787 |
- sleep 1 |
788 |
- done |
789 |
- eend $rc |
790 |
- |
791 |
- if ! [[ -S "${socket}" ]]; then |
792 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
793 |
- fi |
794 |
- |
795 |
- ebegin "Setting root password" |
796 |
- # Do this from memory, as we don't want clear text passwords in temp files |
797 |
- local sql="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}');" |
798 |
- "${EROOT%/}/usr/bin/mysql" \ |
799 |
- --no-defaults \ |
800 |
- "--socket=${socket}" \ |
801 |
- -hlocalhost \ |
802 |
- -e "${sql}" |
803 |
- eend $? |
804 |
- |
805 |
- if [[ -n "${sqltmp}" ]] ; then |
806 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
807 |
- "${EROOT%/}/usr/bin/mysql" \ |
808 |
- --socket="${socket}" \ |
809 |
- -hlocalhost \ |
810 |
- -uroot \ |
811 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
812 |
- mysql < "${sqltmp}" |
813 |
- rc=$? |
814 |
- eend $? |
815 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
816 |
- fi |
817 |
- |
818 |
- # Stop the server and cleanup |
819 |
- einfo "Stopping the server ..." |
820 |
- kill $(< "${pidfile}" ) |
821 |
- rm -f "${sqltmp}" |
822 |
- wait %1 |
823 |
- einfo "Done" |
824 |
-} |