public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mysql/
Date: Thu, 30 Apr 2020 21:43:20 +0000 (UTC)	[thread overview]
Message-ID: <1588282936.1d17c28118c0eb467d78c2d7a7432e675cadcbd4.whissi@gentoo> (raw)

commit:     1d17c28118c0eb467d78c2d7a7432e675cadcbd4
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 21:25:21 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 21:42:16 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d17c281

dev-db/mysql: bump to v5.7.30

Bug: https://bugs.gentoo.org/717628
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 dev-db/mysql/Manifest            |   2 +
 dev-db/mysql/mysql-5.7.30.ebuild | 975 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 977 insertions(+)

diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
index 6f0e03d7d84..9cf53ff8307 100644
--- a/dev-db/mysql/Manifest
+++ b/dev-db/mysql/Manifest
@@ -1,9 +1,11 @@
 DIST mysql-5.6.44.tar.gz 32531507 BLAKE2B 28fbf49f699eb9f43223ffa186671b119d16016274cc7192db232b85c58123a61154e37193b9b7145c6a650b80b5f6cf838529bc2bc5ea9c78c0dbc39de834d3 SHA512 65ace1c803773ca6c8759d171c09bc93c7d61b8e3208ac9905f82e99087622c9dcca602d2da217741dc62fc6eabe9108ebc7f31facd26705072eae65fcc37077
 DIST mysql-5.6.45.tar.gz 32525559 BLAKE2B 3c629aed1de808acdea6654c7413e6851507c9c5be939ca4b4f5e2796da317e9b518a749bfc03d2b0ef05bd604b39f72e24b751076b9f206b462d21fa5db4f50 SHA512 f9d8bb72e96cc83f1064fe7df2e5fe8317ca9d44c4e776cf7827a61292fbcfccec716806c80d565958383d78fef93a19d61c726687b57680d5f93299291ff168
+DIST mysql-5.7.30-patches-01.tar.xz 6684 BLAKE2B 9350280094619fda0d91eacae573396198954fceb5dc039669d236b1dad98eef306702550b517ef30ee3d0e6721667b6f5549df91e3c15cef68888079c00d9ba SHA512 74e8e8794fe54b73776b38296aa42c65547311b80bfe65c88b2f961bd44083e9628eb47da4ebcf4c20e2d7c694f514223bcbf29cce27853cca500710ae97778d
 DIST mysql-8.0.20-patches-01.tar.xz 7176 BLAKE2B 2fc51986c0a4da60521d0e64b9f8705caf8ec3869af930c9729359c3710059fc78aae176523fdf17d10173b404431f31f9bb23ee5c82fba7cbbb4cb39881c005 SHA512 bf8211cf3873f8672b9d3d1dc42b68a1c635690ffdc2d3393eafa83f060ada9f2eaa63f859bf8eecc24976a733d8c7c3b9632ac70f28b5facf48eae921c7ceeb
 DIST mysql-boost-5.7.26.tar.gz 51098338 BLAKE2B 1263cd75814a7293b26b0f44fd2b7d20d983f3c6a62725df9515ecac2ef252f6644810cb4bf0d6f36b98e55317f1c67ea7541228cb38d896dfedc476a5755f26 SHA512 a5f9871dc5a8e5fffc1467c3dd542533a63fe553c029120475f8fd5530d884c76ab0c33ad260daf317faf318ccef01464f6ac2dc3468efceb6bf2b6c06c54cfd
 DIST mysql-boost-5.7.27.tar.gz 51436383 BLAKE2B 6db64ab5fa659aae9baa3725a0de9465e48c37618ffd69f34809880c06a00ce55dce77f507810c6fa52d86901facfa42d3d1bd8db1914a779fbc88a69be82497 SHA512 573f4555f3d62bcd3dc2228bcfba023518d462bb6689114a3505ccf7c7c3061d2775a8e7a37ec3c8b9dea6e8fbc56ba599610f237abc38cedff58e75799bdc52
 DIST mysql-boost-5.7.29.tar.gz 51417554 BLAKE2B 652ce9f99419387e9bcc37afeb1b46438784752e963c3aa1877f17650c31d8b058b4052da97c3a7e9454e758c259d6c311e0518f9a75909fce9741150b82164c SHA512 38acf7c2a10b20c59230ad05cd2cd6996c4c582233c1be573ead08e5c6684275790da07a036570363f89b4d61547b306589b0b98ed5fca70723a3f2cbc21fe11
+DIST mysql-boost-5.7.30.tar.gz 51363998 BLAKE2B 7897ad74b685c3b30e7ecdf132fdfa72f3416c05e8d0086cb8f7674b6c4f377fff9abc51ed258cc4dfeab50a2cb393af9076d9c1f9a83a26521facbaf223afa1 SHA512 b75d41d0c72d16c6f8d5393dab6e476b7993d296eb5683c12417ce2da3db2052fdab2a152f6e7c545315d21bfa35f26a247cb6cdab83d3418b5d34ed7f5f9560
 DIST mysql-boost-8.0.19.tar.gz 264147972 BLAKE2B 61a5ccbef1a7a675c85e4e6bda8e5285bdb931e6ee14d4710bf13dfd9157d1095200db2886dc93ea7251d3d59245f35c0bef5ba88ba6aac209b1e080f3b07dc4 SHA512 5ffc03f005ab2585694902e926b6cb2b10059b2b030549eccd3949f9c3b2f02626d02529f940dec003f2d69683856fd1c720ff12f89dfbdc48befaf24a9c4d01
 DIST mysql-boost-8.0.20.tar.gz 266282970 BLAKE2B 2aeb9d6c575ed9dc2d00d3e51e6391c59ffa39156491d9ed2c07e19bb2efb88a14d5a9d4b537c137d71854e39fa3a7fc2b93618118d4fd062e92ba2d83783c6f SHA512 7a962e9ddec7069008c5ab6ac2801515e2661ca2875afc6141541c03e2f941f4255b3c0d806a4df2fd2f2f1d12323aeb1e456c1d364777a18ccebefad7b22a99
 DIST mysql-extras-20190817-0024Z.tar.bz2 337793 BLAKE2B dfd51a708654aff5bdbbaf2acad7ef966869a8e3adcba544ee15f217d2ba942827445841e73981bccc6c1f145b6225bfa7245114219f0cf52f0dfb85494a6830 SHA512 c2ff81be1c55636f0a2700033af030149f312f0383217054a4b8c65aef174626299fcb4539eaae967ea7d096a5bb09f5b5122dce344b44b0a135d886ba0fdf28

diff --git a/dev-db/mysql/mysql-5.7.30.ebuild b/dev-db/mysql/mysql-5.7.30.ebuild
new file mode 100644
index 00000000000..ddb4b28d3e1
--- /dev/null
+++ b/dev-db/mysql/mysql-5.7.30.ebuild
@@ -0,0 +1,975 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+CMAKE_MAKEFILE_GENERATOR=emake
+
+# Keeping eutils in EAPI=6 for emktemp in pkg_config
+
+inherit cmake-utils eutils flag-o-matic linux-info \
+	prefix toolchain-funcs multilib-minimal
+
+# Patch version
+PATCH_SET="https://dev.gentoo.org/~whissi/dist/mysql/${PN}-5.7.30-patches-01.tar.xz"
+
+SRC_URI="https://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz
+	https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-${PV}.tar.gz
+	http://downloads.mysql.com/archives/MySQL-5.7/${PN}-boost-${PV}.tar.gz
+	${PATCH_SET}"
+
+HOMEPAGE="https://www.mysql.com/"
+DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
+LICENSE="GPL-2"
+SLOT="0/18"
+IUSE="cjk client-libs cracklib debug experimental jemalloc latin1 libressl numa +perl profiling
+	selinux +server static static-libs systemtap tcmalloc test yassl"
+
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
+RESTRICT="!test? ( test ) libressl? ( test )"
+
+REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )"
+
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+# Shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/mysql"
+
+# Be warned, *DEPEND are version-dependant
+# These are used for both runtime and compiletime
+# MULTILIB_USEDEP only set for libraries used by the client library
+COMMON_DEPEND="net-misc/curl:=
+	>=sys-apps/sed-4
+	>=sys-apps/texinfo-4.7-r1
+	sys-libs/ncurses:0=
+	client-libs? ( >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?] )
+	!client-libs? (
+		dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?]
+		>=sys-libs/zlib-1.2.3:0=
+	)
+	jemalloc? ( dev-libs/jemalloc:0= )
+	kernel_linux? (
+		dev-libs/libaio:0=
+		sys-process/procps:0=
+	)
+	server? (
+		>=app-arch/lz4-0_p131:=
+		cjk? ( app-text/mecab:= )
+		experimental? (
+			dev-libs/libevent:=
+			dev-libs/protobuf:=
+			net-libs/libtirpc:=
+		)
+		numa? ( sys-process/numactl )
+	)
+	systemtap? ( >=dev-util/systemtap-1.3:0= )
+	tcmalloc? ( dev-util/google-perftools:0= )
+	!yassl? (
+		client-libs? (
+			!libressl? ( >=dev-libs/openssl-1.0.0:0=[${MULTILIB_USEDEP},static-libs?] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP},static-libs?] )
+		)
+		!client-libs? (
+			!libressl? ( >=dev-libs/openssl-1.0.0:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+	dev-libs/protobuf
+	virtual/yacc
+	server? (
+		dev-libs/libevent
+		experimental? ( net-libs/rpcsvc-proto )
+	)
+	static? ( sys-libs/ncurses[static-libs] )
+	test? (
+		acct-group/mysql acct-user/mysql
+		dev-perl/JSON
+	)
+"
+RDEPEND="${COMMON_DEPEND}
+	!dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
+	client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c dev-libs/protobuf:= )
+	selinux? ( sec-policy/selinux-mysql )
+	server? (
+		!prefix? (
+			acct-group/mysql acct-user/mysql
+			dev-db/mysql-init-scripts
+		)
+	)
+"
+# For other stuff to bring us in
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
+
+mysql_init_vars() {
+	MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"}
+	MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+	MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+	MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+
+	if [[ -z "${MY_DATADIR}" ]] ; then
+		MY_DATADIR=""
+		if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
+			MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+				| sed -ne '/datadir/s|^--datadir=||p' \
+				| tail -n1`
+			if [[ -z "${MY_DATADIR}" ]] ; then
+				MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
+				| sed -e 's/.*=\s*//' \
+				| tail -n1`
+			fi
+		fi
+		if [[ -z "${MY_DATADIR}" ]] ; then
+			MY_DATADIR="${MY_LOCALSTATEDIR}"
+			einfo "Using default MY_DATADIR"
+		fi
+		elog "MySQL MY_DATADIR is ${MY_DATADIR}"
+
+		if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
+			if [[ -e "${MY_DATADIR}" ]] ; then
+				# If you get this and you're wondering about it, see bug #207636
+				elog "MySQL datadir found in ${MY_DATADIR}"
+				elog "A new one will not be created."
+				PREVIOUS_DATADIR="yes"
+			else
+				PREVIOUS_DATADIR="no"
+			fi
+			export PREVIOUS_DATADIR
+		fi
+	else
+		if [[ ${EBUILD_PHASE} == "config" ]] ; then
+			local new_MY_DATADIR
+			new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+				| sed -ne '/datadir/s|^--datadir=||p' \
+				| tail -n1`
+
+			if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]] ; then
+				ewarn "MySQL MY_DATADIR has changed"
+				ewarn "from ${MY_DATADIR}"
+				ewarn "to ${new_MY_DATADIR}"
+				MY_DATADIR="${new_MY_DATADIR}"
+			fi
+		fi
+	fi
+
+	export MY_SHAREDSTATEDIR MY_SYSCONFDIR
+	export MY_LOCALSTATEDIR MY_LOGDIR
+	export MY_DATADIR
+}
+
+pkg_pretend() {
+	if use numa ; then
+		local CONFIG_CHECK="~NUMA"
+
+		local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;"
+		WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support"
+
+		check_extra_config
+	fi
+}
+
+pkg_setup() {
+	if [[ ${MERGE_TYPE} != binary ]] ; then
+		local GCC_MAJOR_SET=$(gcc-major-version)
+		local GCC_MINOR_SET=$(gcc-minor-version)
+		# Bug 565584: InnoDB now requires atomic functions introduced with gcc-4.7 on
+		# non x86{,_64} arches
+		if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
+			${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+			eerror "${PN} needs to be built with gcc-4.7 or later."
+			eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+			die
+		fi
+	fi
+
+	if has test ${FEATURES} && \
+		use server && ! has userpriv ${FEATURES} ; then
+			eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+	fi
+}
+
+pkg_preinst() {
+	# Here we need to see if the implementation switched client libraries
+	# We check if this is a new instance of the package and a client library already exists
+	local SHOW_ABI_MESSAGE libpath
+	if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+		libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so")
+		elog "Due to ABI changes when switching between different client libraries,"
+		elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+		elog "Please run: revdep-rebuild --library ${libpath}"
+		ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+	fi
+}
+
+pkg_postinst() {
+	# Make sure the vars are correctly initialized
+	mysql_init_vars
+
+	# Create log directory securely if it does not exist
+	[[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
+
+	if use server ; then
+		if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+			einfo
+			elog "You might want to run:"
+			elog "\"emerge --config =${CATEGORY}/${PF}\""
+			elog "if this is a new install."
+			elog
+			elog "If you are switching server implentations, you should run the"
+			elog "mysql_upgrade tool."
+			einfo
+		else
+			einfo
+			elog "If you are upgrading major versions, you should run the"
+			elog "mysql_upgrade tool."
+			einfo
+		fi
+	fi
+
+	# Note about configuration change
+	einfo
+	elog "This version of ${PN} reorganizes the configuration from a single my.cnf"
+	elog "to several files in /etc/mysql/mysql.d."
+	elog "Please backup any changes you made to /etc/mysql/my.cnf"
+	elog "and add them as a new file under /etc/mysql/mysql.d with a .cnf extension."
+	elog "You may have as many files as needed and they are read alphabetically."
+	elog "Be sure the options have the appropriate section headers, i.e. [mysqld]."
+	einfo
+}
+
+src_unpack() {
+	unpack ${A}
+
+	mv -f "${WORKDIR}/${P}" "${S}" || die
+}
+
+src_prepare() {
+	eapply "${WORKDIR}"/mysql-patches
+
+	cmake-utils_src_prepare
+
+	if use jemalloc ; then
+		echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die
+	fi
+
+	if use tcmalloc ; then
+		echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die
+	fi
+
+	# Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
+	if [[ -d "${S}/support-files/SELinux" ]] ; then
+		echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
+	fi
+
+	# Remove bundled libs so we cannot accidentally use them
+	# We keep extra/lz4 directory because we use extra/lz4/xxhash.c via sql/CMakeLists.txt:394
+	rm -rv \
+		"${S}"/extra/protobuf \
+		"${S}"/extra/libevent \
+		"${S}"/zlib \
+		|| die
+
+	# Don't clash with dev-db/mysql-connector-c
+	rm \
+		man/my_print_defaults.1 \
+		man/perror.1 \
+		man/zlib_decompress.1 \
+		|| die
+
+	if use libressl ; then
+		sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
+			"${S}/cmake/ssl.cmake" || die
+	fi
+
+	sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die
+}
+
+src_configure() {
+	# Bug #114895, bug #110149
+	filter-flags "-O" "-O[01]"
+
+	append-cxxflags -felide-constructors
+
+	# bug #283926, with GCC4.4, this is required to get correct behavior.
+	append-flags -fno-strict-aliasing
+
+	if use client-libs ; then
+		multilib-minimal_src_configure
+	else
+		multilib_src_configure
+	fi
+}
+
+multilib_src_configure() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	if ! multilib_is_native_abi && ! use client-libs ; then
+		return
+	fi
+
+	CMAKE_BUILD_TYPE="RelWithDebInfo"
+
+	# debug hack wrt #497532
+	mycmakeargs=(
+		-DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+		-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+		-DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql"
+		-DSYSCONFDIR="${EPREFIX}/etc/mysql"
+		-DINSTALL_BINDIR=bin
+		-DINSTALL_DOCDIR=share/doc/${PF}
+		-DINSTALL_DOCREADMEDIR=share/doc/${PF}
+		-DINSTALL_INCLUDEDIR=include/mysql
+		-DINSTALL_INFODIR=share/info
+		-DINSTALL_LIBDIR=$(get_libdir)
+		-DINSTALL_MANDIR=share/man
+		-DINSTALL_MYSQLSHAREDIR=share/mysql
+		-DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
+		-DINSTALL_SCRIPTDIR=share/mysql/scripts
+		-DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql"
+		-DINSTALL_SBINDIR=sbin
+		-DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql"
+		-DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
+		-DWITH_UNIT_TESTS=$(usex test ON OFF)
+		### TODO: make this system but issues with UTF-8 prevent it
+		-DWITH_EDITLINE=bundled
+		-DWITH_ZLIB=system
+		-DWITH_LIBWRAP=0
+		-DENABLED_LOCAL_INFILE=1
+		-DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+		-DWITH_DEFAULT_COMPILER_OPTIONS=0
+		-DWITH_DEFAULT_FEATURE_SET=0
+		# The build forces this to be defined when cross-compiling. We pass it
+		# all the time for simplicity and to make sure it is actually correct.
+		-DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
+		-DWITH_CURL=system
+		-DWITH_BOOST="${S}/boost"
+	)
+	if use test ; then
+		mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test )
+	else
+		mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
+	fi
+
+	if ! use yassl ; then
+		mycmakeargs+=( -DWITH_SSL=system )
+	else
+		mycmakeargs+=( -DWITH_SSL=bundled )
+	fi
+
+	if ! use client-libs ; then
+		mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES )
+	fi
+
+	# bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION
+	# systemtap only works on native ABI, bug 530132
+	if multilib_is_native_abi ; then
+		mycmakeargs+=(
+			-DENABLE_DTRACE=$(usex systemtap)
+		)
+	else
+		mycmakeargs+=(
+			-DWITHOUT_TOOLS=1
+			-DWITH_READLINE=1
+			-DENABLE_DTRACE=0
+		)
+	fi
+
+	if multilib_is_native_abi && use server ; then
+		mycmakeargs+=(
+			-DWITH_LIBEVENT=system
+			-DWITH_LZ4=system
+			-DWITH_PROTOBUF=system
+			-DWITH_MECAB=$(usex cjk system OFF)
+			-DWITH_NUMA=$(usex numa ON OFF)
+			-DWITH_RAPID=$(usex experimental ON OFF)
+		)
+
+		if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]] ; then
+			ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
+			ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
+			ewarn "You MUST file bugs without these variables set."
+
+			mycmakeargs+=(
+				-DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
+				-DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
+			)
+		elif ! use latin1 ; then
+			mycmakeargs+=(
+				-DDEFAULT_CHARSET=utf8
+				-DDEFAULT_COLLATION=utf8_general_ci
+			)
+		else
+			mycmakeargs+=(
+				-DDEFAULT_CHARSET=latin1
+				-DDEFAULT_COLLATION=latin1_swedish_ci
+			)
+		fi
+
+		mycmakeargs+=(
+			-DEXTRA_CHARSETS=all
+			-DDISABLE_SHARED=$(usex static YES NO)
+			-DWITH_DEBUG=$(usex debug)
+			-DWITH_EMBEDDED_SERVER=OFF
+		)
+
+		if use profiling ; then
+			# Setting to OFF doesn't work: Once set, profiling options will be added
+			# to `mysqld --help` output via sql/sys_vars.cc causing
+			# "main.mysqld--help-notwin" test to fail
+			mycmakeargs+=( -DENABLED_PROFILING=ON )
+		fi
+
+		if use static ; then
+			mycmakeargs+=( -DWITH_PIC=1 )
+		fi
+
+		# Storage engines
+		mycmakeargs+=(
+			-DWITH_EXAMPLE_STORAGE_ENGINE=0
+			-DWITH_ARCHIVE_STORAGE_ENGINE=1
+			-DWITH_BLACKHOLE_STORAGE_ENGINE=1
+			-DWITH_CSV_STORAGE_ENGINE=1
+			-DWITH_FEDERATED_STORAGE_ENGINE=1
+			-DWITH_HEAP_STORAGE_ENGINE=1
+			-DWITH_INNOBASE_STORAGE_ENGINE=1
+			-DWITH_INNODB_MEMCACHED=0
+			-DWITH_MYISAMMRG_STORAGE_ENGINE=1
+			-DWITH_MYISAM_STORAGE_ENGINE=1
+			-DWITH_PARTITION_STORAGE_ENGINE=1
+		)
+
+	else
+		mycmakeargs+=(
+			-DWITHOUT_SERVER=1
+			-DWITH_EMBEDDED_SERVER=OFF
+			-DEXTRA_CHARSETS=none
+		)
+	fi
+
+	cmake-utils_src_configure
+}
+
+src_compile() {
+	if use client-libs ; then
+		multilib-minimal_src_compile
+	else
+		multilib_src_compile
+	fi
+}
+
+multilib_src_compile() {
+	cmake-utils_src_compile
+}
+
+# Official test instructions:
+# ulimit -n 16500 && \
+# USE='latin1 perl server' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mysql-X.X.XX.ebuild \
+# digest clean package
+src_test() {
+	_disable_test() {
+		local rawtestname reason
+		rawtestname="${1}" ; shift
+		reason="${@}"
+		ewarn "test '${rawtestname}' disabled: '${reason}'"
+		echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
+	}
+
+	local TESTDIR="${BUILD_DIR}/mysql-test"
+	local retstatus_unit
+	local retstatus_tests
+
+	if ! use server ; then
+		einfo "Skipping server tests due to minimal build."
+		return 0
+	fi
+
+	# Bug #213475 - MySQL _will_ object strenously if your machine is named
+	# localhost. Also causes weird failures.
+	[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+	if [[ $UID -eq 0 ]] ; then
+		die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+	fi
+	has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+	einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+	# Run CTest (test-units)
+	cmake-utils_src_test
+	retstatus_unit=$?
+
+	# Ensure that parallel runs don't die
+	export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+	# Enable parallel testing, auto will try to detect number of cores
+	# You may set this by hand.
+	# The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+	export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+	# create directories because mysqladmin might run out of order
+	mkdir -p "${T}"/var-tests{,/log} || die
+
+	# Run mysql tests
+	pushd "${TESTDIR}" &>/dev/null || die
+
+	touch "${T}/disabled.def"
+	# These are failing in MySQL 5.7 for now and are believed to be
+	# false positives:
+	#
+	local t
+
+	for t in auth_sec.keyring_udf ; do
+			_disable_test "$t" "False positives in Gentoo"
+	done
+
+	# Unstable tests
+	# - main.xa_prepared_binlog_off: https://bugs.mysql.com/bug.php?id=83340
+	# - rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch: https://bugs.mysql.com/bug.php?id=89223
+	# - rpl.rpl_non_direct_stm_mixing_engines: MDEV-14489
+	for t in \
+		main.xa_prepared_binlog_off \
+		rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch \
+		rpl.rpl_non_direct_stm_mixing_engines \
+	; do
+		_disable_test "$t" "Unstable test"
+	done
+
+	for t in \
+		gis.geometry_class_attri_prop \
+		gis.geometry_property_function_issimple \
+		gis.gis_bugs_crashes \
+		gis.spatial_op_testingfunc_mix \
+		gis.spatial_analysis_functions_buffer \
+		gis.spatial_analysis_functions_distance \
+		gis.spatial_utility_function_distance_sphere \
+		gis.spatial_utility_function_simplify \
+		gis.spatial_analysis_functions_centroid \
+	; do
+		_disable_test "$t" "Known rounding error with latest AMD processors"
+	done
+
+	if use numa && use kernel_linux ; then
+		# bug 584880
+		if ! linux_config_exists || ! linux_chkconfig_present NUMA ; then
+			for t in sys_vars.innodb_numa_interleave_basic ; do
+				_disable_test "$t" "Test $t requires system with NUMA support"
+			done
+		fi
+	fi
+
+	if ! use latin1 ; then
+		# The following tests will fail if DEFAULT_CHARSET
+		# isn't set to latin1:
+		for t in \
+			binlog.binlog_mysqlbinlog_filter \
+			binlog.binlog_xa_prepared_disconnect \
+			funcs_1.is_columns_mysql \
+			funcs_1.is_tables_mysql \
+			funcs_1.is_triggers \
+			innodb.innodb_pagesize_max_recordsize \
+			innodb.innodb-system-table-view \
+			innodb.mysqldump_max_recordsize \
+			main.mysql_client_test \
+			main.mysqld--help-notwin \
+			main.type_string \
+			main.information_schema \
+			perfschema.binlog_edge_mix \
+			perfschema.binlog_edge_stmt \
+			rpl.rpl_xa_survive_disconnect \
+			rpl.rpl_xa_survive_disconnect_lsu_off \
+			rpl.rpl_xa_survive_disconnect_table \
+		; do
+			_disable_test "$t" "Requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set"
+		done
+	fi
+
+	if has_version '>=dev-libs/openssl-1.1.1' ; then
+		# Tests are expecting <openssl-1.1.1 default cipher
+		for t in \
+			auth_sec.cert_verify \
+			auth_sec.mysql_ssl_connection \
+			auth_sec.openssl_cert_generation \
+			auth_sec.ssl_auto_detect \
+			auth_sec.ssl_mode \
+			auth_sec.tls \
+			binlog.binlog_grant_alter_user \
+			encryption.innodb_onlinealter_encryption \
+			main.grant_alter_user_qa \
+			main.grant_user_lock_qa \
+			main.mysql_ssl_default \
+			main.openssl_1 \
+			main.plugin_auth_sha256_tls \
+			main.ssl \
+			main.ssl_8k_key \
+			main.ssl_bug75311 \
+			main.ssl_ca \
+			main.ssl_cipher \
+			main.ssl_compress \
+			main.ssl_crl \
+			main.ssl_ecdh \
+			main.ssl_verify_identity \
+			x.connection_tls_version \
+			x.connection_openssl \
+		; do
+			_disable_test  "$t" "Requires <dev-libs/openssl-1.1.1"
+		done
+	fi
+
+	# Try to increase file limits to increase test coverage
+	if ! ulimit -n 16500 1>/dev/null 2>&1 ; then
+		# Upper limit comes from parts.partition_* tests
+		ewarn "For maximum test coverage please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager."
+
+		if ! ulimit -n 4162 1>/dev/null 2>&1 ; then
+			# Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)'
+			ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager."
+
+			if ! ulimit -n 3000 1>/dev/null 2>&1 ; then
+				ewarn "For minimum test coverage please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager."
+			else
+				einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)."
+			fi
+		else
+			einfo "Will run test suite with open file limit set to 4162 (medium test coverage)."
+		fi
+	else
+		einfo "Will run test suite with open file limit set to 16500 (best test coverage)."
+	fi
+
+	# run mysql-test tests
+	perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
+	retstatus_tests=$?
+
+	popd &>/dev/null || die
+
+	# Cleanup is important for these testcases.
+	pkill -9 -f "${S}/ndb" 2>/dev/null
+	pkill -9 -f "${S}/sql" 2>/dev/null
+
+	local failures=""
+	[[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+	[[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+	[[ -z "$failures" ]] || die "Test failures: $failures"
+	einfo "Tests successfully completed"
+}
+
+src_install() {
+	local MULTILIB_WRAPPED_HEADERS
+	local MULTILIB_CHOST_TOOLS
+	if use client-libs ; then
+		# headers with ABI specific data
+		MULTILIB_WRAPPED_HEADERS=(
+			/usr/include/mysql/server/my_config.h
+			/usr/include/mysql/server/mysql_version.h )
+
+		# wrap the config scripts
+		MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+		multilib-minimal_src_install
+	else
+		multilib_src_install
+		multilib_src_install_all
+	fi
+}
+
+# Intentionally override eclass function
+multilib_src_install() {
+
+	cmake-utils_src_install
+
+	# Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them.
+	find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die
+}
+
+multilib_src_install_all() {
+	# Make sure the vars are correctly initialized
+	mysql_init_vars
+
+	# Convenience links
+	einfo "Making Convenience links for mysqlcheck multi-call binary"
+	dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
+	dosym "mysqlcheck" "/usr/bin/mysqlrepair"
+	dosym "mysqlcheck" "/usr/bin/mysqloptimize"
+
+	# INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
+	if [[ -d "${ED}/usr/data" ]] ; then
+		rm -Rf "${ED}/usr/data" || die
+	fi
+
+	# Unless they explicitly specific USE=test, then do not install the
+	# testsuite. It DOES have a use to be installed, esp. when you want to do a
+	# validation of your database configuration after tuning it.
+	if ! use test ; then
+		rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test"
+	fi
+
+	# Configuration stuff
+	einfo "Building default configuration ..."
+	insinto "${MY_SYSCONFDIR#${EPREFIX}}"
+	[[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
+	cp "${FILESDIR}/my.cnf-5.7" "${TMPDIR}/my.cnf" || die
+	eprefixify "${TMPDIR}/my.cnf"
+	doins "${TMPDIR}/my.cnf"
+	insinto "${MY_SYSCONFDIR#${EPREFIX}}/mysql.d"
+	cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die
+	eprefixify "${TMPDIR}/50-distro-client.cnf"
+	doins "${TMPDIR}/50-distro-client.cnf"
+
+	if use server ; then
+		mycnf_src="my.cnf.distro-server"
+		sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+			"${FILESDIR}/${mycnf_src}" \
+			> "${TMPDIR}/my.cnf.ok" || die
+
+		if use prefix ; then
+			sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \
+				"${TMPDIR}/my.cnf.ok" || die
+		fi
+
+		if use latin1 ; then
+			sed -i \
+				-e "/character-set/s|utf8|latin1|g" \
+				"${TMPDIR}/my.cnf.ok" || die
+		fi
+
+		eprefixify "${TMPDIR}/my.cnf.ok"
+
+		newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
+	fi
+
+	#Remove mytop if perl is not selected
+	[[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop"
+}
+
+pkg_config() {
+	_getoptval() {
+		local mypd="${EROOT%/}"/usr/bin/my_print_defaults
+		local section="$1"
+		local flag="--${2}="
+		local extra_options="${3}"
+		"${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
+	}
+	local old_MY_DATADIR="${MY_DATADIR}"
+	local old_HOME="${HOME}"
+	# my_print_defaults needs to read stuff in $HOME/.my.cnf
+	export HOME=${EPREFIX}/root
+
+	# Make sure the vars are correctly initialized
+	mysql_init_vars
+
+	[[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
+	if [[ ! -x "${EROOT%/}/usr/sbin/mysqld" ]] ; then
+		die "Minimal builds do NOT include the MySQL server"
+	fi
+
+	if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]] ; then
+		local MY_DATADIR_s="${ROOT%/}/${MY_DATADIR}"
+		MY_DATADIR_s="${MY_DATADIR_s%%/}"
+		local old_MY_DATADIR_s="${ROOT%/}/${old_MY_DATADIR}"
+		old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
+
+		if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]] ; then
+			if [[ -d "${MY_DATADIR_s}" ]] ; then
+				ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
+				ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
+			else
+				elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
+				mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
+				|| die "Moving MY_DATADIR failed"
+			fi
+		else
+			ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
+			if [[ -d "${MY_DATADIR_s}" ]] ; then
+				ewarn "Attempting to use ${MY_DATADIR_s}"
+			else
+				eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
+				die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
+			fi
+		fi
+	fi
+
+	local pwd1="a"
+	local pwd2="b"
+	local maxtry=15
+
+	if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then
+		local tmp_mysqld_password_source=
+
+		for tmp_mysqld_password_source in mysql client ; do
+			einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
+			MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
+			if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then
+				if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]] ; then
+					ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
+					MYSQL_ROOT_PASSWORD=
+					continue
+				fi
+
+				einfo "Found password in '${tmp_mysqld_password_source}' section!"
+				break
+			fi
+		done
+
+		# Sometimes --show is required to display passwords in some implementations of my_print_defaults
+		if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]] ; then
+			MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
+		fi
+
+		unset tmp_mysqld_password_source
+	fi
+	MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)"
+	# These are dir+prefix
+	MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)"
+	MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
+	MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)"
+	MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
+
+	if [[ ! -d "${EROOT%/}/$MYSQL_TMPDIR" ]] ; then
+		einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
+		install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR"
+	fi
+
+	if [[ ! -d "${EROOT%/}/$MYSQL_LOG_BIN" ]] ; then
+		einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
+		install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_LOG_BIN"
+	fi
+
+	if [[ ! -d "${EROOT%/}/$MYSQL_RELAY_LOG" ]] ; then
+		einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
+		install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_RELAY_LOG"
+	fi
+
+	if [[ -d "${ROOT%/}/${MY_DATADIR}/mysql" ]] ; then
+		ewarn "You have already a MySQL database in place."
+		ewarn "(${ROOT%/}/${MY_DATADIR}/*)"
+		ewarn "Please rename or delete it if you wish to replace it."
+		die "MySQL database already exists!"
+	fi
+
+	# Bug #213475 - MySQL _will_ object strenously if your machine is named
+	# localhost. Also causes weird failures.
+	[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+	if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then
+
+		einfo "Please provide a password for the mysql 'root' user now"
+		einfo "or through the ${HOME}/.my.cnf file."
+		ewarn "Avoid [\"'\\_%] characters in the password"
+		read -rsp "    >" pwd1 ; echo
+
+		einfo "Retype the password"
+		read -rsp "    >" pwd2 ; echo
+
+		if [[ "x$pwd1" != "x$pwd2" ]] ; then
+			die "Passwords are not the same"
+		fi
+		MYSQL_ROOT_PASSWORD="${pwd1}"
+		unset pwd1 pwd2
+	fi
+
+	local options
+	local sqltmp="$(emktemp)"
+
+	# Fix bug 446200. Don't reference host my.cnf, needs to come first,
+	# see http://bugs.mysql.com/bug.php?id=31312
+	use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
+
+	# Figure out which options we need to disable to do the setup
+	local helpfile="${TMPDIR%/}/mysqld-help"
+	"${EROOT%/}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
+	for opt in host-cache name-resolve networking slave-start \
+		federated ssl log-bin relay-log slow-query-log external-locking \
+		log-slave-updates \
+		; do
+		optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
+		egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
+	done
+
+	einfo "Creating the mysql database and setting proper permissions on it ..."
+
+	# Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
+	PID_DIR="${EROOT%/}/var/run/mysqld"
+	if [[ ! -d "${PID_DIR}" ]] ; then
+		install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
+	fi
+
+	if [[ ! -d "${MY_DATADIR}" ]] ; then
+		install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
+	fi
+
+	pushd "${TMPDIR}" &>/dev/null || die
+
+	# Filling timezones, see
+	# http://dev.mysql.com/doc/mysql/en/time-zone-support.html
+	echo "USE mysql;" >"${sqltmp}"
+	"${EROOT%/}/usr/bin/mysql_tzinfo_to_sql" "${EROOT%/}/usr/share/zoneinfo" >> "${sqltmp}" 2>/dev/null
+	chown mysql "${sqltmp}" || die
+
+	# --initialize-insecure will not set root password
+	# --initialize would set a random one in the log which we don't need as we set it ourselves
+	local cmd=( "${EROOT%/}/usr/sbin/mysqld" "--initialize-insecure" "--init-file='${sqltmp}'" )
+	cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT%/}${MY_DATADIR}" "--tmpdir=${ROOT%/}${MYSQL_TMPDIR}" )
+	einfo "Command: ${cmd[*]}"
+	su -s /bin/sh -c "${cmd[*]}" mysql \
+		>"${TMPDIR%/}"/mysql_install_db.log 2>&1
+	if [[ $? -ne 0 ]] ; then
+		grep -B5 -A999 -i "ERROR" "${TMPDIR%/}"/mysql_install_db.log 1>&2
+		die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR%/}/mysql_install_db.log"
+	fi
+	popd &>/dev/null || die
+	[[ -f "${ROOT%/}/${MY_DATADIR}/mysql/user.frm" ]] \
+	|| die "MySQL databases not installed"
+
+	use prefix || options="${options} --user=mysql"
+
+	local socket="${EROOT%/}/var/run/mysqld/mysqld${RANDOM}.sock"
+	local pidfile="${EROOT%/}/var/run/mysqld/mysqld${RANDOM}.pid"
+	local mysqld="${EROOT%/}/usr/sbin/mysqld \
+		${options} \
+		$(use prefix || echo --user=mysql) \
+		--log-warnings=0 \
+		--basedir=${EROOT%/}/usr \
+		--datadir=${ROOT%/}/${MY_DATADIR} \
+		--max_allowed_packet=8M \
+		--net_buffer_length=16K \
+		--socket=${socket} \
+		--pid-file=${pidfile} \
+		--tmpdir=${ROOT}/${MYSQL_TMPDIR}"
+	#einfo "About to start mysqld: ${mysqld}"
+	ebegin "Starting mysqld"
+	einfo "Command ${mysqld}"
+	${mysqld} &
+	rc=$?
+	while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
+		maxtry=$((${maxtry}-1))
+		echo -n "."
+		sleep 1
+	done
+	eend $rc
+
+	if ! [[ -S "${socket}" ]] ; then
+		die "Completely failed to start up mysqld with: ${mysqld}"
+	fi
+
+	ebegin "Setting root password"
+	# Do this from memory, as we don't want clear text passwords in temp files
+	local sql="ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${MYSQL_ROOT_PASSWORD}'"
+	"${EROOT%/}/usr/bin/mysql" \
+		--no-defaults \
+		"--socket=${socket}" \
+		-hlocalhost \
+		-e "${sql}"
+	eend $?
+
+	# Stop the server and cleanup
+	einfo "Stopping the server ..."
+	kill $(< "${pidfile}" )
+	rm -f "${sqltmp}"
+	wait %1
+	einfo "Done"
+}


             reply	other threads:[~2020-04-30 21:43 UTC|newest]

Thread overview: 401+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 21:43 Thomas Deutschmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-01-10  4:37 [gentoo-commits] repo/gentoo:master commit in: dev-db/mysql/ Sam James
2025-01-10  4:37 Sam James
2025-01-10  4:37 Sam James
2025-01-09  2:30 Sam James
2025-01-09  2:30 Sam James
2025-01-09  2:30 Sam James
2025-01-09  2:30 Sam James
2025-01-09  2:30 Sam James
2024-07-04  0:29 Sam James
2024-07-01 18:55 Mike Gilbert
2024-06-14  8:16 Sam James
2024-03-04  4:57 Sam James
2024-01-24  6:55 Sam James
2023-12-17 12:39 Sam James
2023-11-27 15:43 Andreas Sturmlechner
2023-10-14  8:34 Sam James
2023-10-14  8:34 Sam James
2023-08-06 11:49 Sam James
2023-08-02 16:41 Sam James
2023-07-15 11:45 Arthur Zamarin
2023-07-15 11:45 Arthur Zamarin
2023-07-15 11:45 Arthur Zamarin
2023-07-15 11:45 Arthur Zamarin
2023-07-15 10:11 Arthur Zamarin
2023-05-06 14:01 Arthur Zamarin
2023-05-06 14:01 Arthur Zamarin
2023-05-06 14:01 Arthur Zamarin
2023-04-02 19:30 Arthur Zamarin
2023-04-02 19:30 Arthur Zamarin
2023-02-14  0:29 Mike Gilbert
2023-02-14  0:29 Mike Gilbert
2023-02-01  9:11 Arthur Zamarin
2023-01-18 22:44 Sam James
2023-01-13 15:02 Arthur Zamarin
2023-01-13 15:02 Arthur Zamarin
2023-01-13 15:02 Arthur Zamarin
2023-01-03  6:23 Sam James
2022-12-02 20:25 Arthur Zamarin
2022-12-02  8:02 Arthur Zamarin
2022-10-31 15:49 Sam James
2022-10-31 15:45 Sam James
2022-10-31 15:45 Sam James
2022-07-29  2:47 Sam James
2022-06-13 12:18 Jakov Smolić
2022-06-13 12:16 Jakov Smolić
2022-05-15  1:00 Sam James
2022-03-09 15:55 David Seifert
2022-03-03 21:22 David Seifert
2022-02-27 22:25 Sam James
2022-02-27 22:25 Sam James
2022-02-27 16:24 Sam James
2022-01-13  4:18 Sam James
2022-01-13  4:18 Sam James
2022-01-13  4:18 Sam James
2022-01-13  4:18 Sam James
2022-01-12  4:09 Sam James
2022-01-12  4:09 Sam James
2022-01-11 21:40 Sam James
2022-01-11 21:40 Sam James
2021-11-18 15:35 Thomas Deutschmann
2021-11-17  1:05 Thomas Deutschmann
2021-11-14 16:06 Thomas Deutschmann
2021-11-14  3:49 Thomas Deutschmann
2021-11-14  3:49 Thomas Deutschmann
2021-10-16  3:42 Sam James
2021-10-16  2:45 Sam James
2021-10-16  2:45 Sam James
2021-10-16  2:45 Sam James
2021-10-14  9:44 Sam James
2021-10-14  9:44 Sam James
2021-10-12  0:10 Sam James
2021-10-12  0:10 Sam James
2021-09-22 12:16 Thomas Deutschmann
2021-08-13 14:16 Marek Szuba
2021-08-04 20:31 Thomas Deutschmann
2021-08-04 19:13 Thomas Deutschmann
2021-08-04 19:13 Thomas Deutschmann
2021-07-06 18:02 Sam James
2021-07-06 18:02 Sam James
2021-06-22 23:49 Thomas Deutschmann
2021-05-24  1:19 Thomas Deutschmann
2021-05-21  2:12 Thomas Deutschmann
2021-05-12 15:38 Thomas Deutschmann
2021-05-03  8:04 Mikle Kolyada
2021-05-01 18:24 Sam James
2021-04-28 13:20 Thomas Deutschmann
2021-04-26  1:03 Thomas Deutschmann
2021-04-26  1:03 Thomas Deutschmann
2021-02-26  8:49 Mikle Kolyada
2021-02-26  8:49 Mikle Kolyada
2021-02-03 23:55 Thomas Deutschmann
2021-01-21 22:32 Thomas Deutschmann
2021-01-21 22:32 Thomas Deutschmann
2021-01-06 18:43 Fabian Groffen
2020-12-25 23:46 Sam James
2020-12-25 23:46 Sam James
2020-12-25 23:41 Sam James
2020-12-25 23:41 Sam James
2020-12-25 23:41 Sam James
2020-12-25 23:41 Sam James
2020-12-25  2:14 Sam James
2020-12-25  2:14 Sam James
2020-12-24 14:11 Sam James
2020-12-24 14:11 Sam James
2020-12-20 21:01 Thomas Deutschmann
2020-11-30  1:18 Thomas Deutschmann
2020-11-25 16:34 Thomas Deutschmann
2020-11-25 16:34 Thomas Deutschmann
2020-11-13 19:46 Sam James
2020-11-13 17:54 Sam James
2020-10-20 18:56 Thomas Deutschmann
2020-10-20 18:56 Thomas Deutschmann
2020-10-20 18:56 Thomas Deutschmann
2020-09-19 20:09 Mikle Kolyada
2020-09-19 20:09 Mikle Kolyada
2020-08-29 17:57 Thomas Deutschmann
2020-08-22 20:24 Thomas Deutschmann
2020-08-07 12:10 Sam James
2020-08-07 12:10 Sam James
2020-08-07  4:26 Sam James
2020-08-07  4:26 Sam James
2020-08-05 19:22 Thomas Deutschmann
2020-07-26 13:28 Thomas Deutschmann
2020-07-26 13:28 Thomas Deutschmann
2020-07-26 13:21 Thomas Deutschmann
2020-07-26  1:46 Thomas Deutschmann
2020-07-26  1:46 Thomas Deutschmann
2020-07-26  0:11 Thomas Deutschmann
2020-06-01 23:16 Thomas Deutschmann
2020-05-24 20:25 Thomas Deutschmann
2020-05-14 21:29 Thomas Deutschmann
2020-05-10 10:11 Mikle Kolyada
2020-05-10 10:11 Mikle Kolyada
2020-05-04 19:57 Mart Raudsepp
2020-05-04 16:01 Thomas Deutschmann
2020-05-03 15:21 Thomas Deutschmann
2020-04-30 23:06 Thomas Deutschmann
2020-04-30 21:43 Thomas Deutschmann
2020-04-30 20:45 Thomas Deutschmann
2020-04-21  0:14 Thomas Deutschmann
2020-03-19  3:47 Matt Turner
2020-03-17  1:07 Thomas Deutschmann
2020-03-05 11:08 Agostino Sarubbo
2020-02-17 15:23 Agostino Sarubbo
2020-02-16 21:14 Thomas Deutschmann
2020-02-15 12:13 Mikle Kolyada
2020-02-12  9:35 Agostino Sarubbo
2020-02-12  9:34 Agostino Sarubbo
2020-02-08 17:06 David Seifert
2020-01-25 19:53 Thomas Deutschmann
2020-01-25 19:53 Thomas Deutschmann
2020-01-22 20:26 Thomas Deutschmann
2020-01-20 19:26 Thomas Deutschmann
2020-01-20 19:26 Thomas Deutschmann
2019-12-31  3:30 Thomas Deutschmann
2019-12-31  3:30 Thomas Deutschmann
2019-12-09 18:27 Sergei Trofimovich
2019-12-09 18:27 Sergei Trofimovich
2019-10-31  1:41 Thomas Deutschmann
2019-10-16 17:33 Brian Evans
2019-09-15  9:44 Mikle Kolyada
2019-09-13 18:31 Mikle Kolyada
2019-09-13  2:19 Aaron Bauman
2019-09-08 20:00 Thomas Deutschmann
2019-08-22 20:02 Thomas Deutschmann
2019-08-22 20:02 Thomas Deutschmann
2019-08-22 20:02 Thomas Deutschmann
2019-08-22 20:02 Thomas Deutschmann
2019-08-19 18:34 Thomas Deutschmann
2019-08-18 12:34 Thomas Deutschmann
2019-08-17 20:13 Thomas Deutschmann
2019-08-17 18:42 Thomas Deutschmann
2019-08-17 18:42 Thomas Deutschmann
2019-08-17 13:48 Thomas Deutschmann
2019-08-17 13:48 Thomas Deutschmann
2019-08-17  0:50 Thomas Deutschmann
2019-08-17  0:50 Thomas Deutschmann
2019-08-17  0:50 Thomas Deutschmann
2019-08-17  0:50 Thomas Deutschmann
2019-08-14 22:57 Thomas Deutschmann
2019-08-08 19:42 Thomas Deutschmann
2019-08-02 21:58 Thomas Deutschmann
2019-08-02 16:56 Thomas Deutschmann
2019-08-02 16:56 Thomas Deutschmann
2019-08-02 11:23 Mikle Kolyada
2019-08-02 11:23 Mikle Kolyada
2019-08-02 11:23 Mikle Kolyada
2019-08-02 11:23 Mikle Kolyada
2019-08-02 11:23 Mikle Kolyada
2019-08-01 21:11 Aaron Bauman
2019-07-31 14:40 Thomas Deutschmann
2019-07-31 14:40 Thomas Deutschmann
2019-07-02  8:19 Sergei Trofimovich
2019-07-02  8:19 Sergei Trofimovich
2019-06-04 11:36 Thomas Deutschmann
2019-05-24 14:30 Thomas Deutschmann
2019-05-24 10:52 Thomas Deutschmann
2019-05-14  0:41 Thomas Deutschmann
2019-04-25  3:52 Aaron Bauman
2019-04-02 12:18 Mikle Kolyada
2019-03-10 14:37 Mikle Kolyada
2019-03-05 18:46 Thomas Deutschmann
2019-03-05 18:16 Mikle Kolyada
2019-03-03 19:04 Thomas Deutschmann
2019-03-03 18:57 Thomas Deutschmann
2019-01-31  3:12 Brian Evans
2019-01-26 19:23 Thomas Deutschmann
2018-12-18 19:36 Mikle Kolyada
2018-11-30 11:13 Tobias Klausmann
2018-11-29 17:44 Tobias Klausmann
2018-11-28 23:11 Sergei Trofimovich
2018-11-28 23:11 Sergei Trofimovich
2018-11-26 14:49 Mikle Kolyada
2018-11-20 18:07 Mikle Kolyada
2018-11-20  1:42 Thomas Deutschmann
2018-11-19 18:28 Thomas Deutschmann
2018-11-19 16:24 Thomas Deutschmann
2018-11-19 14:10 Thomas Deutschmann
2018-11-14 16:59 Thomas Deutschmann
2018-11-14 16:59 Thomas Deutschmann
2018-11-13 18:26 Brian Evans
2018-11-11 23:19 Thomas Deutschmann
2018-10-30 14:42 Mikle Kolyada
2018-10-27 19:14 Mikle Kolyada
2018-10-27 18:43 Sergei Trofimovich
2018-10-26 21:10 Thomas Deutschmann
2018-10-26 19:24 Thomas Deutschmann
2018-10-23  0:33 Brian Evans
2018-10-19 20:26 Mikle Kolyada
2018-10-18 12:31 Thomas Deutschmann
2018-10-18 11:45 Tobias Klausmann
2018-10-17 22:21 Thomas Deutschmann
2018-10-17  0:46 Thomas Deutschmann
2018-10-16 16:23 Thomas Deutschmann
2018-10-15  1:29 Thomas Deutschmann
2018-10-14  1:21 Thomas Deutschmann
2018-09-24 20:38 Brian Evans
2018-09-24 17:18 Brian Evans
2018-09-17 20:38 Brian Evans
2018-09-17 18:03 Matt Turner
2018-09-17 18:03 Matt Turner
2018-09-15 10:28 Michał Górny
2018-09-14 23:16 Brian Evans
2018-09-14 23:16 Brian Evans
2018-09-14 23:16 Brian Evans
2018-09-01 23:18 Sergei Trofimovich
2018-08-05  1:15 Brian Evans
2018-08-05  1:15 Brian Evans
2018-08-05  1:15 Brian Evans
2018-08-05  1:15 Brian Evans
2018-07-23 21:52 Mikle Kolyada
2018-07-23 13:10 Tobias Klausmann
2018-07-21  0:09 Brian Evans
2018-07-20 22:40 Thomas Deutschmann
2018-07-19 14:10 Mikle Kolyada
2018-06-25  2:03 Brian Evans
2018-06-24  1:11 Brian Evans
2018-05-19  2:35 Brian Evans
2018-05-15 17:41 Brian Evans
2018-05-13 18:42 Brian Evans
2018-04-24 23:52 Brian Evans
2018-04-22  1:10 Brian Evans
2018-04-22  1:10 Brian Evans
2018-03-30 12:03 Sergei Trofimovich
2018-03-04 16:23 Tobias Klausmann
2018-02-14 12:59 Thomas Deutschmann
2018-02-14  0:46 Thomas Deutschmann
2018-02-14  0:46 Thomas Deutschmann
2018-02-14  0:46 Thomas Deutschmann
2018-02-05 21:27 Markus Meier
2018-02-04 20:42 Sergei Trofimovich
2018-01-27 21:24 Mikle Kolyada
2018-01-19  2:33 Brian Evans
2018-01-19  2:33 Brian Evans
2018-01-17 16:53 Thomas Deutschmann
2018-01-17  8:24 Thomas Deutschmann
2017-11-21 15:27 Brian Evans
2017-11-19 15:14 Markus Meier
2017-11-06 14:18 Tobias Klausmann
2017-11-03 12:54 Brian Evans
2017-10-28 23:31 Sergei Trofimovich
2017-10-28 21:42 Sergei Trofimovich
2017-10-28 18:11 Thomas Deutschmann
2017-10-28 18:11 Thomas Deutschmann
2017-10-27 13:49 Thomas Deutschmann
2017-10-25  7:06 Sergei Trofimovich
2017-10-24  7:03 Agostino Sarubbo
2017-10-18 19:53 Brian Evans
2017-10-18 16:27 Brian Evans
2017-10-18 13:36 Brian Evans
2017-10-18 13:36 Brian Evans
2017-09-30  8:40 Sergei Trofimovich
2017-09-30  2:58 Sergei Trofimovich
2017-08-25 21:51 Mikle Kolyada
2017-08-23  4:59 Markus Meier
2017-08-18 20:25 Thomas Deutschmann
2017-08-17 20:18 Sergei Trofimovich
2017-07-22  0:53 Brian Evans
2017-07-19 18:04 Brian Evans
2017-07-19 18:04 Brian Evans
2017-07-19 16:17 Brian Evans
2017-07-16  9:40 Tobias Klausmann
2017-06-25  8:44 Sergei Trofimovich
2017-05-22 17:32 Tobias Klausmann
2017-05-15 11:24 Michael Weber
2017-05-13  6:25 Markus Meier
2017-05-10 10:53 Jeroen Roovers
2017-05-07 23:44 Brian Evans
2017-05-07 23:44 Brian Evans
2017-04-10 18:42 Brian Evans
2017-04-10 16:21 Brian Evans
2017-03-02 14:48 Brian Evans
2017-03-01 20:59 Thomas Deutschmann
2017-03-01 20:59 Thomas Deutschmann
2017-02-06 14:02 Brian Evans
2017-02-05 17:02 Markus Meier
2017-01-25  6:39 Jeroen Roovers
2017-01-21 11:37 Tobias Klausmann
2017-01-19 11:34 Agostino Sarubbo
2017-01-19 11:25 Agostino Sarubbo
2016-12-20 14:02 Brian Evans
2016-12-14 17:14 Brian Evans
2016-10-31  7:42 Jeroen Roovers
2016-10-26 16:38 Markus Meier
2016-10-23  7:44 Jeroen Roovers
2016-10-22 11:33 Agostino Sarubbo
2016-10-22 11:33 Agostino Sarubbo
2016-10-21 15:17 Tobias Klausmann
2016-10-19 20:34 Brian Evans
2016-10-19 20:34 Brian Evans
2016-10-19 16:47 Brian Evans
2016-10-11 14:16 Brian Evans
2016-09-29 13:35 Agostino Sarubbo
2016-09-29 13:35 Agostino Sarubbo
2016-09-29 13:08 Agostino Sarubbo
2016-09-29 13:08 Agostino Sarubbo
2016-09-29  9:48 Agostino Sarubbo
2016-09-29  9:22 Agostino Sarubbo
2016-09-24 19:29 Markus Meier
2016-09-24  7:06 Jeroen Roovers
2016-09-17  9:52 Tobias Klausmann
2016-09-14  7:28 Agostino Sarubbo
2016-09-12 20:00 Brian Evans
2016-09-12 20:00 Brian Evans
2016-09-12 18:56 Brian Evans
2016-08-17 20:11 Brian Evans
2016-08-17 18:11 Brian Evans
2016-07-28 14:08 Agostino Sarubbo
2016-07-28  8:43 Agostino Sarubbo
2016-07-27 20:30 Markus Meier
2016-07-26 12:31 Tobias Klausmann
2016-07-24 16:03 Jeroen Roovers
2016-07-24  8:33 Jeroen Roovers
2016-07-20 17:58 Brian Evans
2016-07-20 17:58 Brian Evans
2016-07-20 16:05 Brian Evans
2016-07-11  3:49 Brian Evans
2016-07-08 13:28 Agostino Sarubbo
2016-07-08  8:42 Agostino Sarubbo
2016-07-08  8:17 Agostino Sarubbo
2016-05-21 12:04 Tobias Klausmann
2016-05-19 18:28 Markus Meier
2016-05-19 14:39 Jeroen Roovers
2016-05-19  7:42 Agostino Sarubbo
2016-05-19  7:40 Agostino Sarubbo
2016-04-18 18:31 Brian Evans
2016-04-18  8:13 Patrice Clement
2016-04-12 18:26 Brian Evans
2016-03-21  2:16 Brian Evans
2016-03-20 12:24 Agostino Sarubbo
2016-03-19 12:28 Agostino Sarubbo
2016-02-12  3:46 Brian Evans
2016-02-12  3:46 Brian Evans
2016-02-03 20:46 Markus Meier
2016-01-31 13:39 Tobias Klausmann
2016-01-31 11:11 Agostino Sarubbo
2016-01-31 11:09 Agostino Sarubbo
2016-01-31  9:23 Jeroen Roovers
2016-01-26  5:11 Brian Evans
2016-01-10 14:29 Brian Evans
2016-01-10 11:22 Agostino Sarubbo
2016-01-09  7:10 Agostino Sarubbo
2015-12-15 17:42 Brian Evans
2015-12-14 14:36 Brian Evans
2015-12-13 22:15 Brian Evans
2015-12-13 22:07 Brian Evans
2015-11-18  9:56 Agostino Sarubbo
2015-11-14 16:49 Markus Meier
2015-11-09  8:53 Agostino Sarubbo
2015-11-08  6:09 Jeroen Roovers
2015-11-06 11:28 Agostino Sarubbo
2015-11-06 11:27 Agostino Sarubbo
2015-11-05 23:13 Brian Evans
2015-10-26 13:24 Brian Evans
2015-10-20 14:52 Brian Evans
2015-10-12 19:39 Brian Evans
2015-10-01 16:01 Brian Evans
2015-09-15 17:22 Brian Evans
2015-09-06  8:32 Agostino Sarubbo
2015-08-26  7:28 Agostino Sarubbo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1588282936.1d17c28118c0eb467d78c2d7a7432e675cadcbd4.whissi@gentoo \
    --to=whissi@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox