1 |
commit: 40984ffe654ae90069740e76c6406ec5f8d3ed9f |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 29 02:07:00 2017 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 29 02:30:49 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40984ffe |
7 |
|
8 |
dev-db/mariadb: Drop old 10.2 versions |
9 |
|
10 |
Package-Manager: Portage-2.3.10, Repoman-2.3.3 |
11 |
|
12 |
dev-db/mariadb/Manifest | 4 - |
13 |
dev-db/mariadb/mariadb-10.2.7-r2.ebuild | 1030 ------------------------------- |
14 |
dev-db/mariadb/mariadb-10.2.8.ebuild | 1028 ------------------------------ |
15 |
3 files changed, 2062 deletions(-) |
16 |
|
17 |
diff --git a/dev-db/mariadb/Manifest b/dev-db/mariadb/Manifest |
18 |
index 2d8c8bf6399..22339c286a1 100644 |
19 |
--- a/dev-db/mariadb/Manifest |
20 |
+++ b/dev-db/mariadb/Manifest |
21 |
@@ -3,15 +3,11 @@ DIST mariadb-10.0.30.tar.gz 63433598 SHA256 9a2cb7f06ecce1bb64dddc70c484e36507b5 |
22 |
DIST mariadb-10.0.32.tar.gz 63567828 SHA256 f7a8d9ba88b01d426f5d69e5044e505e444a5ce73e22c9c50913dade43725936 SHA512 e1ecfc2b819b5ffa72fc0d4131fc9d7b6811919e10f15608830611028746580731c653a6b3eb43c92640cd29716b6278f48d27af5322dd2084f2d5f356e6f628 WHIRLPOOL e39e115d1382dbce432c2e27f85b03c8079dec03fd84fc3a0e1f906cb8ef2f82e2eab719fe2544de2ba8a83c66858d276ca2224e66317ecd7ade2d7a78d00368 |
23 |
DIST mariadb-10.1.24.tar.gz 61780687 SHA256 b3df99ae5b1ec8cf6cede4cbc4ae3f54ce66464549cba6d56d9ff4d24e4d551e SHA512 0b8d81b53f6866a81f33559ce57ebf956fec3ba25da0bd58c8bee3b2ecc00a6c370340000209d18463f84501d3ba35994b51ef99224616c37cd38d2fc87b73e9 WHIRLPOOL 91261a05e3d8b0cad925c382e0cf9a40fcfd3d35ae320c4a9860db110cb5655d1e1f992f9dea8987e50a07dd4a66aa42c9a3470a7acb3d0d706bcef7bc890122 |
24 |
DIST mariadb-10.1.26.tar.gz 61887132 SHA256 ba88b1cb9967dea2909938a34ba89373b162b0d83e5c98a0f1c94540156bf73d SHA512 a7505c579728b58eb6a92bdee1f5dfea5c10c8389cb7a31eb99fe2c6bc416593925cf9708d3dec91ede12eb4e232098a0833af2185bdd60bc593c89d255f3c0b WHIRLPOOL 8fe0c23f70b441a1f8d32d1fedcd033443641288ef1a20c49fbedfe6f5da95cb82125faa68f676fd68c441d4bf096101f364e1b3976f54229f5d9d0d10edbe21 |
25 |
-DIST mariadb-10.2.7.tar.gz 67669554 SHA256 225ba1bbc48325ad38a9f433ff99da4641028f42404a29591cc370e4a676c0bc SHA512 fa595acc0f5c9c62077db000f1721af79628994c08e82b2eb95d265e3c556e80942c487fc1b91299c382becd71f21a0a117ca93d7428752f436ed83683a4f4cd WHIRLPOOL d76d584924dac41fd787c1a02f79de90ae5334b217b66deb59756490a8c42b801fddac425542e371d68b04fa462a3f438626896749a1c12be70e9d22d857771e |
26 |
-DIST mariadb-10.2.8.tar.gz 73488662 SHA256 8dd250fe79f085e26f52ac448fbdb7af2a161f735fae3aed210680b9f2492393 SHA512 c0527481a99249caef829a3ad2f610f6ebb30ed9af49c56b783695ce4fe83db93021ef0f60efad92750038c8894b957cbb1f2c4ee56fe8d5c15c878c83ba46d1 WHIRLPOOL 6b3b2ffe69cffbe88ad41f133618e0277745e99b927deda2853dc031941353540486a49fcd1c01f5f75f2ab466c3cf5ec07c0a040af8cef3619813eed272b287 |
27 |
DIST mariadb-10.2.9.tar.gz 70858881 SHA256 12e0a01c52591ee77cf0f940fe65df024457fa16c70f08c6116048d576096124 SHA512 11ba0913144d7298ffa4c0a0128a3d1525a39b8205ffc580311751cf25a4e86159e46a32d3c8330c4ea028cdd50643eb5381651df654751ca3e4fb3d4698a373 WHIRLPOOL dba0a8dfd5079b314ffc399e116abf8582bdaf51657dfe6e72247ab92da874aca97af4ca27dbcfdca5634c926598a853b7a8ecd8a61fee453c2764085a05b949 |
28 |
DIST mariadb-5.5.57.tar.gz 45783940 SHA256 5dbde98d7e4a5a1721b6cbed7898b2549a88866247951cf586057975c6cea641 SHA512 5d6350abd6f0ba98326633a36bb7ec67525e34e08cbe43f79c9b30bf0b872b0a8f9f0bfd5f3a4c2800a52d25b9c6f3a3a4a62e0f41574153bbf4b881f5347c71 WHIRLPOOL c2af12fb71b3fcc9989cd2208a44dc81401fe1387ae2d03981fd5d00277d480a35f23bdb8f1564f91b4c345bdb18a610b46ee91f47772ba5de1baf8f808eaec3 |
29 |
DIST mysql-extras-20160629-1442Z.tar.bz2 299152 SHA256 c90979db927772468f8b398c640469ff4740f950068e740c04ff60500e714766 SHA512 1de46daf6b4534dadf9d3eff8d5d557778e63b5e04aedb57fe56d3016ba93a9d55d80faee38f77852d23da5169879e4f25b3386abe44ee8d961db7ffc4145715 WHIRLPOOL d8c94e4e43e772307d8d137a28e18991fa24a27b1587ec19ae5bd12c733cc0931e459092de2c43216776e3284c7c416d52030fe20c98a6439388507c5fe5111f |
30 |
DIST mysql-extras-20160721-1526Z.tar.bz2 301788 SHA256 45198f8adb4a61fdd89a5d3c7966ce2fe9241381510e1f7b93e793502a32dfcb SHA512 c7450039780e4e2684c932ba7c291c1de25dd1a64e4c6e88aa13b790768b4100955f36ae4a3bf983569ea23b43be02da6dad3d5985c1163ec9e8aa91f0efd85d WHIRLPOOL becdf0d4d7b8b5a269246d2fcf1bc09c4313046468b264f07394ae9f1de2f736ad3fff8cad35e544df7a3623688050e6fb9635dfea3876ea082d19cf9fe88927 |
31 |
DIST mysql-extras-20170310-1426Z.tar.bz2 307052 SHA256 23f5becec389fc49e7cf0d52c6c914cbc8d7e3fc5851ee38881ee6884ffc5732 SHA512 2dbb3e46f14fbd0be9ee0e3a8ff2e4d5325f9a9be332014ea556283c0bc5f53349952d267d6713fac5b54e3167a66ddd36f18b18b79ca6b68ede399399488157 WHIRLPOOL 9f459d9e58938597e7919b29fc819d87920a51461d274bf87520fe322a67ad8638ef19212855ba8e37507d3b160d29ecad0099f4632f078cc503e1be0f809fb4 |
32 |
DIST mysql-extras-20170316-1355Z.tar.bz2 308933 SHA256 ebcb4f03413ccf42877558ad365db01bbb5ef2e12620a9be479ffc2514d9830e SHA512 5bf7938bfa5989da85216fbca4575397fc05c83e1afac76bd6c0b338a876caf37194f53a2a933d6f69eb31727ca005be617e53a8fdd0a95d8f1f68684c4ba68c WHIRLPOOL 701871ff554970adef8e5eb1e2e966a09c4b59ac7931df125f78a4fcfa415e87767184a9d3418013d27410ad0482673942f1df48d5e5de68917f49e1efa96689 |
33 |
-DIST mysql-extras-20170803-1814Z.tar.bz2 311860 SHA256 6d07ac00913e8a5911bc041b1da36b6792ab7ce24a8723acd37d145871ca6a82 SHA512 1a96ad61ebdeacadbc43a26e0ffbac4968272e115c5ad0f618aa7404d9904ebff1497023898de4b6820705ec0c08490e6bece89bc9d8bed7e32b78e1acd2d4a8 WHIRLPOOL d240ceba8d35af5ece80747ba6d3d32e12b982f7dddd5f0a5db17f0b4b93090fa38b944145f3d6c18e93e3d9eca222a75d164cb876b03f153016d754067fc7e3 |
34 |
-DIST mysql-extras-20170820-2245Z.tar.bz2 312101 SHA256 619afb88752e461434709ed91e91c2104845a9a9ee67ac944212833f4a715ed8 SHA512 34868c8ba3509ed5e3625c973e16f5015390ca9fc656cbcdbe8f5568bc7cab3708bb7c88b1af324ebb66f86433dfee71b90adf6451556fcfc12ad4e7d32256dd WHIRLPOOL f8e08f47bb0789c25dc096c76340b1ca9db8a264d89aca816e3b45e4dd984dc9dea90554c6c114179dc972026c703404aa8521b3c93fb882d7eadd1295635fb9 |
35 |
DIST mysql-extras-20170830-1210Z.tar.bz2 312079 SHA256 eda0090fb448e22a004e334956278a887843a3b2bf3ed523b80dd4691d4729d4 SHA512 55553de3bb93b09c29ff411c135ff2762edad3498d9e8fb844df349ce8ab864969668f2bbc3ba99e2217cc20f1c9155443794c301ca064d09a1b45ddead567c8 WHIRLPOOL 961073913064ad3f4decf4221bd9f87fd8bd6349c3e13c1c799e5622b9f2353a2981d2577c5a00c026ac006c03a1c609f4527c2d9027610214d2e79bc5be0669 |
36 |
DIST mysql-extras-20170926-1321Z.tar.bz2 312466 SHA256 e2ecfa43d70d9796cfd60dc2448b8e76e4e35ccbbe12b6a4becc8f854e172c12 SHA512 556e782ccc40d8cffb2fde8c46038c90023440c07785ec667f898afdb8c802faeb4dbfe8b3918a1e563b46d1dc8c0de1172f7843ce08ee1ded435b344f8f0cf5 WHIRLPOOL cae69f01090231bd25a48002e8682b70894d0b4e3ae43083fb062db159a44d4b085edb46f92ed0452d98fccbec7fc0fd1f97eff9fd16b810fc22e845e8923b50 |
37 |
|
38 |
diff --git a/dev-db/mariadb/mariadb-10.2.7-r2.ebuild b/dev-db/mariadb/mariadb-10.2.7-r2.ebuild |
39 |
deleted file mode 100644 |
40 |
index e4dd19a02eb..00000000000 |
41 |
--- a/dev-db/mariadb/mariadb-10.2.7-r2.ebuild |
42 |
+++ /dev/null |
43 |
@@ -1,1030 +0,0 @@ |
44 |
-# Copyright 1999-2017 Gentoo Foundation |
45 |
-# Distributed under the terms of the GNU General Public License v2 |
46 |
- |
47 |
-EAPI="6" |
48 |
-MY_EXTRAS_VER="20170803-1814Z" |
49 |
-SUBSLOT="18" |
50 |
- |
51 |
-JAVA_PKG_OPT_USE="jdbc" |
52 |
- |
53 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
54 |
- |
55 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
56 |
- java-pkg-opt-2 user cmake-utils multilib-minimal |
57 |
- |
58 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
59 |
- |
60 |
-# Gentoo patches to MySQL |
61 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
62 |
- SRC_URI="${SRC_URI} |
63 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
64 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
65 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
66 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
67 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
68 |
-fi |
69 |
- |
70 |
-HOMEPAGE="http://mariadb.org/" |
71 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
72 |
-LICENSE="GPL-2 LGPL-2.1+" |
73 |
-SLOT="0/${SUBSLOT:-0}" |
74 |
-IUSE="+backup bindist cracklib debug embedded extraengine galera innodb-lz4 |
75 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
76 |
- odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
77 |
- sst-rsync sst-xtrabackup static static-libs systemd systemtap tcmalloc |
78 |
- test tokudb xml yassl" |
79 |
- |
80 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
81 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
82 |
- |
83 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
84 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
85 |
- !server? ( !extraengine !embedded ) |
86 |
- ?? ( tcmalloc jemalloc ) |
87 |
- static? ( yassl !pam )" |
88 |
- |
89 |
-# REMEMBER: also update eclass/mysql*.eclass before committing! |
90 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
91 |
- |
92 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
93 |
-# and we will run a mysql server during test phase |
94 |
-S="${WORKDIR}/mysql" |
95 |
- |
96 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
97 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras" |
98 |
-else |
99 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" |
100 |
-fi |
101 |
- |
102 |
-PATCHES=( |
103 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
104 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.7-without-clientlibs-tools.patch |
105 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
106 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
107 |
- "${MY_PATCH_DIR}"/20026_all_mariadb-add-pkgdatadir.patch |
108 |
-) |
109 |
- |
110 |
-# Be warned, *DEPEND are version-dependant |
111 |
-# These are used for both runtime and compiletime |
112 |
-# MULTILIB_USEDEP only set for libraries used by the client library |
113 |
-COMMON_DEPEND=" |
114 |
- kernel_linux? ( |
115 |
- sys-process/procps:0= |
116 |
- dev-libs/libaio:0= |
117 |
- ) |
118 |
- >=sys-apps/sed-4 |
119 |
- >=sys-apps/texinfo-4.7-r1 |
120 |
- !dev-db/mariadb-connector-c[mysqlcompat] |
121 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
122 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
123 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
124 |
- !yassl? ( |
125 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0=[${MULTILIB_USEDEP},static-libs?] ) |
126 |
- libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP},static-libs?] ) |
127 |
- ) |
128 |
- >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?] |
129 |
- sys-libs/ncurses:0= |
130 |
- mroonga? ( app-text/groonga-normalizer-mysql ) |
131 |
- kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] ) |
132 |
- !bindist? ( |
133 |
- sys-libs/binutils-libs:0= |
134 |
- >=sys-libs/readline-4.1:0= |
135 |
- ) |
136 |
- server? ( |
137 |
- backup? ( app-arch/libarchive:0= ) |
138 |
- cracklib? ( sys-libs/cracklib:0= ) |
139 |
- extraengine? ( |
140 |
- odbc? ( dev-db/unixODBC:0= ) |
141 |
- xml? ( dev-libs/libxml2:2= ) |
142 |
- ) |
143 |
- innodb-lz4? ( app-arch/lz4 ) |
144 |
- innodb-lzo? ( dev-libs/lzo ) |
145 |
- innodb-snappy? ( app-arch/snappy ) |
146 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
147 |
- pam? ( virtual/pam:0= ) |
148 |
- systemd? ( sys-apps/systemd:= ) |
149 |
- tokudb? ( app-arch/snappy ) |
150 |
- ) |
151 |
- >=dev-libs/libpcre-8.35:3= |
152 |
-" |
153 |
-DEPEND="virtual/yacc |
154 |
- static? ( sys-libs/ncurses[static-libs] ) |
155 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
156 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
157 |
- ${COMMON_DEPEND}" |
158 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
159 |
- abi_x86_32? ( !app-emulation/emul-linux-x86-db[-abi_x86_32(-)] ) |
160 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
161 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
162 |
- !<virtual/mysql-5.6-r9 |
163 |
- ${COMMON_DEPEND} |
164 |
- server? ( galera? ( |
165 |
- sys-apps/iproute2 |
166 |
- =sys-cluster/galera-25* |
167 |
- sst-rsync? ( sys-process/lsof ) |
168 |
- sst-xtrabackup? ( net-misc/socat[ssl] ) |
169 |
- ) ) |
170 |
- perl? ( !dev-db/mytop |
171 |
- virtual/perl-Getopt-Long |
172 |
- dev-perl/TermReadKey |
173 |
- virtual/perl-Term-ANSIColor |
174 |
- virtual/perl-Time-HiRes ) |
175 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
176 |
-" |
177 |
-# For other stuff to bring us in |
178 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
179 |
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
180 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
181 |
- server? ( ~virtual/mysql-5.6[embedded=,static=] ) |
182 |
- virtual/libmysqlclient:${SLOT}[${MULTILIB_USEDEP},static-libs=] |
183 |
- server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
184 |
- |
185 |
-pkg_setup() { |
186 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
187 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
188 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
189 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
190 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
191 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
192 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
193 |
- die |
194 |
- fi |
195 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
196 |
- # non x86{,_64} arches |
197 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
198 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
199 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
200 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
201 |
- die |
202 |
- fi |
203 |
- fi |
204 |
- java-pkg-opt-2_pkg_setup |
205 |
- if has test ${FEATURES} && \ |
206 |
- use server && ! has userpriv ${FEATURES} ; then |
207 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
208 |
- fi |
209 |
- |
210 |
- # This should come after all of the die statements |
211 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
212 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
213 |
-} |
214 |
- |
215 |
-pkg_preinst() { |
216 |
- java-pkg-opt-2_pkg_preinst |
217 |
- |
218 |
- # Here we need to see if the implementation switched client libraries |
219 |
- # We check if this is a new instance of the package and a client library already exists |
220 |
- local SHOW_ABI_MESSAGE libpath |
221 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
222 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
223 |
- elog "Due to ABI changes when switching between different client libraries," |
224 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
225 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
226 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
227 |
- fi |
228 |
-} |
229 |
- |
230 |
-pkg_postinst() { |
231 |
- # Make sure the vars are correctly initialized |
232 |
- mysql_init_vars |
233 |
- |
234 |
- # Check FEATURES="collision-protect" before removing this |
235 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
236 |
- |
237 |
- # Secure the logfiles |
238 |
- touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} |
239 |
- chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* |
240 |
- chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* |
241 |
- |
242 |
- # Minimal builds don't have the MySQL server |
243 |
- if use server ; then |
244 |
- if use pam; then |
245 |
- einfo |
246 |
- elog "This install includes the PAM authentication plugin." |
247 |
- elog "To activate and configure the PAM plugin, please read:" |
248 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
249 |
- einfo |
250 |
- fi |
251 |
- |
252 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
253 |
- einfo |
254 |
- elog "You might want to run:" |
255 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
256 |
- elog "if this is a new install." |
257 |
- elog |
258 |
- elog "If you are switching server implentations, you should run the" |
259 |
- elog "mysql_upgrade tool." |
260 |
- einfo |
261 |
- else |
262 |
- einfo |
263 |
- elog "If you are upgrading major versions, you should run the" |
264 |
- elog "mysql_upgrade tool." |
265 |
- einfo |
266 |
- fi |
267 |
- |
268 |
- if use galera ; then |
269 |
- einfo |
270 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
271 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
272 |
- elog "The first time the cluster is activated, you should add" |
273 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
274 |
- elog "This option should then be removed for subsequent starts." |
275 |
- einfo |
276 |
- fi |
277 |
- fi |
278 |
- |
279 |
- # Note about configuration change |
280 |
- einfo |
281 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
282 |
- elog "to several files in /etc/mysql/${PN}.d." |
283 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
284 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
285 |
- elog "You may have as many files as needed and they are read alphabetically." |
286 |
- elog "Be sure the options have the appropitate section headers, i.e. [mysqld]." |
287 |
- einfo |
288 |
-} |
289 |
- |
290 |
-src_unpack() { |
291 |
- |
292 |
- # Initialize the proper variables first |
293 |
- mysql_init_vars |
294 |
- |
295 |
- unpack ${A} |
296 |
- # Grab the patches |
297 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack |
298 |
- |
299 |
- mv -f "${WORKDIR}/${P}" "${S}" || die |
300 |
-} |
301 |
- |
302 |
-src_prepare() { |
303 |
- java-pkg-opt-2_src_prepare |
304 |
- if use tcmalloc; then |
305 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
306 |
- fi |
307 |
- |
308 |
- # Don't build bundled xz-utils for tokudb |
309 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
310 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
311 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
312 |
- |
313 |
- # Remove the bundled groonga |
314 |
- # There is no CMake flag, it simply checks for existance |
315 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
316 |
- |
317 |
- eapply "${PATCHES[@]}" |
318 |
- eapply_user |
319 |
-} |
320 |
- |
321 |
-src_configure(){ |
322 |
- # bug 508724 mariadb cannot use ld.gold |
323 |
- tc-ld-disable-gold |
324 |
- # Bug #114895, bug #110149 |
325 |
- filter-flags "-O" "-O[01]" |
326 |
- |
327 |
- append-cxxflags -felide-constructors |
328 |
- |
329 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
330 |
- append-flags -fno-strict-aliasing |
331 |
- |
332 |
- multilib-minimal_src_configure |
333 |
-} |
334 |
- |
335 |
-multilib_src_configure() { |
336 |
- debug-print-function ${FUNCNAME} "$@" |
337 |
- |
338 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
339 |
- |
340 |
- # debug hack wrt #497532 |
341 |
- mycmakeargs=( |
342 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
343 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
344 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
345 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
346 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
347 |
- -DINSTALL_BINDIR=bin |
348 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
349 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
350 |
- -DINSTALL_INCLUDEDIR=include/mysql |
351 |
- -DINSTALL_INFODIR=share/info |
352 |
- -DINSTALL_LIBDIR=$(get_libdir) |
353 |
- -DINSTALL_MANDIR=share/man |
354 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
355 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
356 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
357 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
358 |
- -DINSTALL_SBINDIR=sbin |
359 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
360 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
361 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
362 |
- -DWITH_LIBEDIT=0 |
363 |
- -DWITH_ZLIB=system |
364 |
- -DWITHOUT_LIBWRAP=1 |
365 |
- -DENABLED_LOCAL_INFILE=1 |
366 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
367 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
368 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
369 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
370 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
371 |
- -DENABLE_STATIC_LIBS=$(usex static-libs ON OFF) |
372 |
- # The build forces this to be defined when cross-compiling. We pass it |
373 |
- # all the time for simplicity and to make sure it is actually correct. |
374 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
375 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
376 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
377 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
378 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
379 |
- -DWITH_EXTERNAL_ZLIB=YES |
380 |
- -DSUFFIX_INSTALL_DIR="" |
381 |
- -DWITH_UNITTEST=OFF |
382 |
- ) |
383 |
- if use test ; then |
384 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
385 |
- else |
386 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
387 |
- fi |
388 |
- |
389 |
- if ! use yassl ; then |
390 |
- mycmakeargs+=( -DWITH_SSL=system ) |
391 |
- else |
392 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
393 |
- fi |
394 |
- |
395 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
396 |
- if multilib_is_native_abi; then |
397 |
- mycmakeargs+=( |
398 |
- -DWITH_READLINE=$(usex bindist 1 0) |
399 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
400 |
- ) |
401 |
- else |
402 |
- mycmakeargs+=( |
403 |
- -DWITHOUT_TOOLS=1 |
404 |
- -DWITH_READLINE=1 |
405 |
- -DNOT_FOR_DISTRIBUTION=0 |
406 |
- ) |
407 |
- fi |
408 |
- |
409 |
- if multilib_is_native_abi && use server ; then |
410 |
- |
411 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
412 |
- if ! use extraengine ; then |
413 |
- mycmakeargs+=( |
414 |
- -DPLUGIN_FEDERATED=NO |
415 |
- -DPLUGIN_FEDERATEDX=NO ) |
416 |
- fi |
417 |
- |
418 |
- mycmakeargs+=( |
419 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
420 |
- -DWITH_PCRE=system |
421 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
422 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
423 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
424 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
425 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
426 |
- -DPLUGIN_CASSANDRA=NO |
427 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
428 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
429 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
430 |
- -DCONNECT_WITH_MYSQL=1 |
431 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
432 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
433 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
434 |
- -DWITH_WSREP=$(usex galera) |
435 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
436 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
437 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
438 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
439 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
440 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
441 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
442 |
- -DINSTALL_SQLBENCHDIR=share/mariadb |
443 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
444 |
- # systemd is only linked to for server notification |
445 |
- -DWITH_SYSTEMD=$(usex systemd) |
446 |
- ) |
447 |
- if use test ; then |
448 |
- # This is needed for the new client lib which tests a real, open server |
449 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
450 |
- fi |
451 |
- |
452 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
453 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
454 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
455 |
- ewarn "You MUST file bugs without these variables set." |
456 |
- |
457 |
- mycmakeargs+=( |
458 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
459 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
460 |
- ) |
461 |
- |
462 |
- elif ! use latin1 ; then |
463 |
- mycmakeargs+=( |
464 |
- -DDEFAULT_CHARSET=utf8 |
465 |
- -DDEFAULT_COLLATION=utf8_general_ci |
466 |
- ) |
467 |
- else |
468 |
- mycmakeargs+=( |
469 |
- -DDEFAULT_CHARSET=latin1 |
470 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
471 |
- ) |
472 |
- fi |
473 |
- mycmakeargs+=( |
474 |
- -DEXTRA_CHARSETS=all |
475 |
- -DMYSQL_USER=mysql |
476 |
- -DDISABLE_SHARED=$(usex static YES NO) |
477 |
- -DWITH_DEBUG=$(usex debug) |
478 |
- -DWITH_EMBEDDED_SERVER=$(usex embedded) |
479 |
- -DWITH_PROFILING=$(usex profiling) |
480 |
- ) |
481 |
- |
482 |
- if use static; then |
483 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
484 |
- fi |
485 |
- |
486 |
- if use jemalloc || use tcmalloc ; then |
487 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
488 |
- fi |
489 |
- |
490 |
- # Storage engines |
491 |
- mycmakeargs+=( |
492 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
493 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
494 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
495 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
496 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
497 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
498 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
499 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
500 |
- ) |
501 |
- |
502 |
- else |
503 |
- mycmakeargs+=( |
504 |
- -DWITHOUT_SERVER=1 |
505 |
- -DWITHOUT_EMBEDDED_SERVER=1 |
506 |
- -DEXTRA_CHARSETS=none |
507 |
- -DINSTALL_SQLBENCHDIR= |
508 |
- -DWITH_SYSTEMD=NO |
509 |
- ) |
510 |
- fi |
511 |
- |
512 |
- # systemtap only works on native ABI bug 530132 |
513 |
- if multilib_is_native_abi; then |
514 |
- mycmakeargs+=( -DENABLE_DTRACE=$(usex systemtap) ) |
515 |
- else |
516 |
- mycmakeargs+=( -DENABLE_DTRACE=0 ) |
517 |
- fi |
518 |
- |
519 |
- cmake-utils_src_configure |
520 |
-} |
521 |
- |
522 |
-src_compile() { |
523 |
- multilib-minimal_src_compile |
524 |
-} |
525 |
- |
526 |
-multilib_src_compile() { |
527 |
- cmake-utils_src_compile |
528 |
-} |
529 |
- |
530 |
-src_install() { |
531 |
- # headers with ABI specific data |
532 |
- local MULTILIB_WRAPPED_HEADERS=( |
533 |
- /usr/include/mysql/my_config.h |
534 |
- /usr/include/mysql/private/embedded_priv.h |
535 |
- /usr/include/mysql/mysql_version.h |
536 |
- /usr/include/mariadb/mariadb_version.h |
537 |
- /usr/include/mysql/mariadb_version.h |
538 |
- /usr/include/mysql/private/probes_mysql_nodtrace.h |
539 |
- /usr/include/mysql/private/probes_mysql_dtrace.h ) |
540 |
- |
541 |
- # wrap the config scripts |
542 |
- local MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config /usr/bin/mysql_config ) |
543 |
- multilib-minimal_src_install |
544 |
-} |
545 |
- |
546 |
-# Intentionally override eclass function |
547 |
-multilib_src_install() { |
548 |
- cmake-utils_src_install |
549 |
- |
550 |
- # Make sure the vars are correctly initialized |
551 |
- mysql_init_vars |
552 |
- |
553 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
554 |
- if [[ -f "${D}/usr/include/mysql/private/config.h" ]] ; then |
555 |
- rm "${D}/usr/include/mysql/private/config.h" || die |
556 |
- fi |
557 |
- |
558 |
- if ! multilib_is_native_abi && use server ; then |
559 |
- insinto /usr/include/mysql/private |
560 |
- doins "${S}"/sql/*.h |
561 |
- fi |
562 |
- |
563 |
- # Install compatible symlinks to libmysqlclient |
564 |
-# use static-libs && dosym libmariadbclient.a "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.a" |
565 |
-# dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so" |
566 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so.${SUBSLOT}" |
567 |
- |
568 |
- # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. |
569 |
- find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die |
570 |
-} |
571 |
- |
572 |
-multilib_src_install_all() { |
573 |
- # Make sure the vars are correctly initialized |
574 |
- mysql_init_vars |
575 |
- |
576 |
- # Convenience links |
577 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
578 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
579 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
580 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
581 |
- |
582 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
583 |
- if [[ -d "${ED}/usr/data" ]] ; then |
584 |
- rm -Rf "${ED}/usr/data" || die |
585 |
- fi |
586 |
- |
587 |
- # Unless they explicitly specific USE=test, then do not install the |
588 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
589 |
- # validation of your database configuration after tuning it. |
590 |
- if ! use test ; then |
591 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
592 |
- fi |
593 |
- |
594 |
- # Configuration stuff |
595 |
- einfo "Building default configuration ..." |
596 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
597 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
598 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
599 |
- eprefixify "${TMPDIR}/my.cnf" |
600 |
- doins "${TMPDIR}/my.cnf" |
601 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
602 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
603 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
604 |
- doins "${TMPDIR}/50-distro-client.cnf" |
605 |
- |
606 |
- if use server ; then |
607 |
- mycnf_src="my.cnf.distro-server" |
608 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
609 |
- "${FILESDIR}/${mycnf_src}" \ |
610 |
- > "${TMPDIR}/my.cnf.ok" || die |
611 |
- if use prefix ; then |
612 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
613 |
- "${TMPDIR}/my.cnf.ok" || die |
614 |
- fi |
615 |
- if use latin1 ; then |
616 |
- sed -i \ |
617 |
- -e "/character-set/s|utf8|latin1|g" \ |
618 |
- "${TMPDIR}/my.cnf.ok" || die |
619 |
- fi |
620 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
621 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
622 |
- einfo "Creating initial directories" |
623 |
- # Empty directories ... |
624 |
- diropts "-m0750" |
625 |
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then |
626 |
- dodir "${MY_DATADIR#${EPREFIX}}" |
627 |
- keepdir "${MY_DATADIR#${EPREFIX}}" |
628 |
- chown -R mysql:mysql "${D}/${MY_DATADIR}" |
629 |
- fi |
630 |
- |
631 |
- diropts "-m0755" |
632 |
- local folder |
633 |
- for folder in "${MY_LOGDIR#${EPREFIX}}" ; do |
634 |
- dodir "${folder}" |
635 |
- keepdir "${folder}" |
636 |
- chown -R mysql:mysql "${ED}/${folder}" |
637 |
- done |
638 |
- |
639 |
- einfo "Including support files and sample configurations" |
640 |
- docinto "support-files" |
641 |
- local script |
642 |
- for script in \ |
643 |
- "${S}"/support-files/magic |
644 |
- do |
645 |
- [[ -f "$script" ]] && dodoc "${script}" |
646 |
- done |
647 |
- |
648 |
- docinto "scripts" |
649 |
- for script in "${S}"/scripts/mysql* ; do |
650 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
651 |
- done |
652 |
- fi |
653 |
- |
654 |
- #Remove mytop if perl is not selected |
655 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
656 |
-} |
657 |
- |
658 |
-# Official test instructions: |
659 |
-# USE='embedded extraengine perl server static-libs' \ |
660 |
-# FEATURES='test userpriv -usersandbox' \ |
661 |
-# ebuild mariadb-X.X.XX.ebuild \ |
662 |
-# digest clean package |
663 |
-multilib_src_test() { |
664 |
- |
665 |
- if ! multilib_is_native_abi ; then |
666 |
- einfo "Server tests not available on non-native abi". |
667 |
- return 0; |
668 |
- fi |
669 |
- |
670 |
- _disable_test() { |
671 |
- |
672 |
- local rawtestname testname testsuite reason mysql_disabled_file mysql_disabled_dir |
673 |
- rawtestname="${1}" ; shift |
674 |
- reason="${@}" |
675 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
676 |
- |
677 |
- testsuite="${rawtestname/.*}" |
678 |
- testname="${rawtestname/*.}" |
679 |
- for mysql_disabled_file in \ |
680 |
- "${S}/mysql-test/disabled.def" \ |
681 |
- "${S}/mysql-test/t/disabled.def" ; do |
682 |
- [[ -f ${mysql_disabled_file} ]] && break |
683 |
- done |
684 |
- #mysql_disabled_file="${S}/mysql-test/t/disabled.def" |
685 |
- #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" |
686 |
- echo ${testname} : ${reason} >> "${mysql_disabled_file}" |
687 |
- |
688 |
- if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then |
689 |
- for mysql_disabled_file in \ |
690 |
- "${S}/mysql-test/suite/${testsuite}/disabled.def" \ |
691 |
- "${S}/mysql-test/suite/${testsuite}/t/disabled.def" \ |
692 |
- FAILED ; do |
693 |
- [[ -f ${mysql_disabled_file} ]] && break |
694 |
- done |
695 |
- if [[ ${mysql_disabled_file} != "FAILED" ]]; then |
696 |
- echo "${testname} : ${reason}" >> "${mysql_disabled_file}" |
697 |
- else |
698 |
- for mysql_disabled_dir in \ |
699 |
- "${S}/mysql-test/suite/${testsuite}" \ |
700 |
- "${S}/mysql-test/suite/${testsuite}/t" \ |
701 |
- FAILED ; do |
702 |
- [[ -d ${mysql_disabled_dir} ]] && break |
703 |
- done |
704 |
- if [[ ${mysql_disabled_dir} != "FAILED" ]]; then |
705 |
- echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def" |
706 |
- else |
707 |
- ewarn "Could not find testsuite disabled.def location for ${rawtestname}" |
708 |
- fi |
709 |
- fi |
710 |
- fi |
711 |
- } |
712 |
- |
713 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
714 |
- local retstatus_unit |
715 |
- local retstatus_tests |
716 |
- |
717 |
- if ! use server ; then |
718 |
- einfo "Skipping server tests due to minimal build." |
719 |
- return 0 |
720 |
- fi |
721 |
- |
722 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
723 |
- # localhost. Also causes weird failures. |
724 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
725 |
- |
726 |
- if [[ $UID -eq 0 ]]; then |
727 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
728 |
- fi |
729 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
730 |
- |
731 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
732 |
- |
733 |
- # Run CTest (test-units) |
734 |
- cmake-utils_src_test |
735 |
- retstatus_unit=$? |
736 |
- |
737 |
- # Ensure that parallel runs don't die |
738 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
739 |
- # Enable parallel testing, auto will try to detect number of cores |
740 |
- # You may set this by hand. |
741 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
742 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
743 |
- |
744 |
- # create directories because mysqladmin might run out of order |
745 |
- mkdir -p "${T}"/var-tests{,/log} || die |
746 |
- |
747 |
- # Run mysql tests |
748 |
- pushd "${TESTDIR}" > /dev/null || die |
749 |
- |
750 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
751 |
- # false positives: |
752 |
- # |
753 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
754 |
- # main.mysql_client_test_comp: |
755 |
- # segfaults at random under Portage only, suspect resource limits. |
756 |
- |
757 |
- local t |
758 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
759 |
- _disable_test "$t" "False positive due to varying policies" |
760 |
- done |
761 |
- |
762 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
763 |
- main.mysql_client_test_comp ; do |
764 |
- _disable_test "$t" "False positives in Gentoo" |
765 |
- done |
766 |
- |
767 |
- # run mysql-test tests |
768 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder |
769 |
- retstatus_tests=$? |
770 |
- |
771 |
- popd > /dev/null || die |
772 |
- |
773 |
- # Cleanup is important for these testcases. |
774 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
775 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
776 |
- |
777 |
- local failures="" |
778 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
779 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
780 |
- |
781 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
782 |
- einfo "Tests successfully completed" |
783 |
-} |
784 |
- |
785 |
-mysql_init_vars() { |
786 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
787 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
788 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
789 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
790 |
- |
791 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
792 |
- MY_DATADIR="" |
793 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
794 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
795 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
796 |
- | tail -n1` |
797 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
798 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
799 |
- | sed -e 's/.*=\s*//' \ |
800 |
- | tail -n1` |
801 |
- fi |
802 |
- fi |
803 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
804 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
805 |
- einfo "Using default MY_DATADIR" |
806 |
- fi |
807 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
808 |
- |
809 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
810 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
811 |
- # If you get this and you're wondering about it, see bug #207636 |
812 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
813 |
- elog "A new one will not be created." |
814 |
- PREVIOUS_DATADIR="yes" |
815 |
- else |
816 |
- PREVIOUS_DATADIR="no" |
817 |
- fi |
818 |
- export PREVIOUS_DATADIR |
819 |
- fi |
820 |
- else |
821 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
822 |
- local new_MY_DATADIR |
823 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
824 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
825 |
- | tail -n1` |
826 |
- |
827 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
828 |
- ewarn "MySQL MY_DATADIR has changed" |
829 |
- ewarn "from ${MY_DATADIR}" |
830 |
- ewarn "to ${new_MY_DATADIR}" |
831 |
- MY_DATADIR="${new_MY_DATADIR}" |
832 |
- fi |
833 |
- fi |
834 |
- fi |
835 |
- |
836 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
837 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
838 |
- export MY_DATADIR |
839 |
-} |
840 |
- |
841 |
-pkg_config() { |
842 |
- _getoptval() { |
843 |
- local mypd="${EROOT}"/usr/bin/my_print_defaults |
844 |
- local section="$1" |
845 |
- local flag="--${2}=" |
846 |
- local extra_options="${3}" |
847 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
848 |
- } |
849 |
- local old_MY_DATADIR="${MY_DATADIR}" |
850 |
- local old_HOME="${HOME}" |
851 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
852 |
- export HOME=${EPREFIX}/root |
853 |
- |
854 |
- # Make sure the vars are correctly initialized |
855 |
- mysql_init_vars |
856 |
- |
857 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
858 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
859 |
- die "Minimal builds do NOT include the MySQL server" |
860 |
- fi |
861 |
- |
862 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
863 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
864 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
865 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
866 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
867 |
- |
868 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
869 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
870 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
871 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
872 |
- else |
873 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
874 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
875 |
- || die "Moving MY_DATADIR failed" |
876 |
- fi |
877 |
- else |
878 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
879 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
880 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
881 |
- else |
882 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
883 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
884 |
- fi |
885 |
- fi |
886 |
- fi |
887 |
- |
888 |
- local pwd1="a" |
889 |
- local pwd2="b" |
890 |
- local maxtry=15 |
891 |
- |
892 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
893 |
- local tmp_mysqld_password_source= |
894 |
- |
895 |
- for tmp_mysqld_password_source in mysql client; do |
896 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
897 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
898 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
899 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
900 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
901 |
- MYSQL_ROOT_PASSWORD= |
902 |
- continue |
903 |
- fi |
904 |
- |
905 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
906 |
- break |
907 |
- fi |
908 |
- done |
909 |
- |
910 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
911 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
912 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
913 |
- fi |
914 |
- |
915 |
- unset tmp_mysqld_password_source |
916 |
- fi |
917 |
- MYSQL_TMPDIR="$(_getoptval '--mysqld' tmpdir)" |
918 |
- # These are dir+prefix |
919 |
- MYSQL_RELAY_LOG="$(_getoptval '--mysqld' relay-log)" |
920 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
921 |
- MYSQL_LOG_BIN="$(_getoptval '--mysqld' log-bin)" |
922 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
923 |
- |
924 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
925 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
926 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
927 |
- fi |
928 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
929 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
930 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
931 |
- fi |
932 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
933 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
934 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
935 |
- fi |
936 |
- |
937 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
938 |
- ewarn "You have already a MySQL database in place." |
939 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
940 |
- ewarn "Please rename or delete it if you wish to replace it." |
941 |
- die "MySQL database already exists!" |
942 |
- fi |
943 |
- |
944 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
945 |
- # localhost. Also causes weird failures. |
946 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
947 |
- |
948 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
949 |
- |
950 |
- einfo "Please provide a password for the mysql 'root' user now" |
951 |
- einfo "or through the ${HOME}/.my.cnf file." |
952 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
953 |
- read -rsp " >" pwd1 ; echo |
954 |
- |
955 |
- einfo "Retype the password" |
956 |
- read -rsp " >" pwd2 ; echo |
957 |
- |
958 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
959 |
- die "Passwords are not the same" |
960 |
- fi |
961 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
962 |
- unset pwd1 pwd2 |
963 |
- fi |
964 |
- |
965 |
- local options |
966 |
- local sqltmp="$(emktemp)" |
967 |
- |
968 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
969 |
- # see http://bugs.mysql.com/bug.php?id=31312 |
970 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
971 |
- |
972 |
- # Figure out which options we need to disable to do the setup |
973 |
- local helpfile="${TMPDIR}/mysqld-help" |
974 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
975 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
976 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
977 |
- log-slave-updates \ |
978 |
- ; do |
979 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
980 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
981 |
- done |
982 |
- |
983 |
- use prefix || options="${options} --user=mysql" |
984 |
- |
985 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
986 |
- |
987 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
988 |
- PID_DIR="${EROOT}/var/run/mysqld" |
989 |
- if [[ ! -d "${PID_DIR}" ]]; then |
990 |
- mkdir -p "${PID_DIR}" || die "Could not create pid directory" |
991 |
- chown mysql:mysql "${PID_DIR}" || die "Could not set ownership on pid directory" |
992 |
- chmod 755 "${PID_DIR}" || die "Could not set permissions on pid directory" |
993 |
- fi |
994 |
- |
995 |
- pushd "${TMPDIR}" &>/dev/null |
996 |
- |
997 |
- # Filling timezones, see |
998 |
- # http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
999 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
1000 |
- |
1001 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
1002 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
1003 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
1004 |
- einfo "Command: ${cmd[*]}" |
1005 |
- "${cmd[@]}" \ |
1006 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
1007 |
- if [ $? -ne 0 ]; then |
1008 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
1009 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
1010 |
- fi |
1011 |
- popd &>/dev/null |
1012 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
1013 |
- || die "MySQL databases not installed" |
1014 |
- chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null |
1015 |
- chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null |
1016 |
- |
1017 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
1018 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
1019 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
1020 |
- ${options} \ |
1021 |
- --log-warnings=0 \ |
1022 |
- --basedir=${EROOT}/usr \ |
1023 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
1024 |
- --max_allowed_packet=8M \ |
1025 |
- --net_buffer_length=16K \ |
1026 |
- --socket=${socket} \ |
1027 |
- --pid-file=${pidfile} |
1028 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
1029 |
- #einfo "About to start mysqld: ${mysqld}" |
1030 |
- ebegin "Starting mysqld" |
1031 |
- einfo "Command ${mysqld}" |
1032 |
- ${mysqld} & |
1033 |
- rc=$? |
1034 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
1035 |
- maxtry=$((${maxtry}-1)) |
1036 |
- echo -n "." |
1037 |
- sleep 1 |
1038 |
- done |
1039 |
- eend $rc |
1040 |
- |
1041 |
- if ! [[ -S "${socket}" ]]; then |
1042 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
1043 |
- fi |
1044 |
- |
1045 |
- ebegin "Setting root password" |
1046 |
- # Do this from memory, as we don't want clear text passwords in temp files |
1047 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
1048 |
- "${EROOT}/usr/bin/mysql" \ |
1049 |
- "--socket=${socket}" \ |
1050 |
- -hlocalhost \ |
1051 |
- -e "${sql}" |
1052 |
- eend $? |
1053 |
- |
1054 |
- if [[ -n "${sqltmp}" ]] ; then |
1055 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
1056 |
- "${EROOT}/usr/bin/mysql" \ |
1057 |
- "--socket=${socket}" \ |
1058 |
- -hlocalhost \ |
1059 |
- -uroot \ |
1060 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
1061 |
- mysql < "${sqltmp}" |
1062 |
- rc=$? |
1063 |
- eend $? |
1064 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
1065 |
- fi |
1066 |
- |
1067 |
- # Stop the server and cleanup |
1068 |
- einfo "Stopping the server ..." |
1069 |
- kill $(< "${pidfile}" ) |
1070 |
- rm -f "${sqltmp}" |
1071 |
- wait %1 |
1072 |
- einfo "Done" |
1073 |
-} |
1074 |
|
1075 |
diff --git a/dev-db/mariadb/mariadb-10.2.8.ebuild b/dev-db/mariadb/mariadb-10.2.8.ebuild |
1076 |
deleted file mode 100644 |
1077 |
index 505e94e4664..00000000000 |
1078 |
--- a/dev-db/mariadb/mariadb-10.2.8.ebuild |
1079 |
+++ /dev/null |
1080 |
@@ -1,1028 +0,0 @@ |
1081 |
-# Copyright 1999-2017 Gentoo Foundation |
1082 |
-# Distributed under the terms of the GNU General Public License v2 |
1083 |
- |
1084 |
-EAPI="6" |
1085 |
-MY_EXTRAS_VER="20170820-2245Z" |
1086 |
-SUBSLOT="18" |
1087 |
- |
1088 |
-JAVA_PKG_OPT_USE="jdbc" |
1089 |
- |
1090 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
1091 |
- |
1092 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
1093 |
- java-pkg-opt-2 user cmake-utils multilib-minimal |
1094 |
- |
1095 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
1096 |
- |
1097 |
-# Gentoo patches to MySQL |
1098 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
1099 |
- SRC_URI="${SRC_URI} |
1100 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1101 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1102 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1103 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1104 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
1105 |
-fi |
1106 |
- |
1107 |
-HOMEPAGE="http://mariadb.org/" |
1108 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
1109 |
-LICENSE="GPL-2 LGPL-2.1+" |
1110 |
-SLOT="0/${SUBSLOT:-0}" |
1111 |
-IUSE="+backup bindist cracklib debug embedded extraengine galera innodb-lz4 |
1112 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
1113 |
- numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
1114 |
- sst-rsync sst-xtrabackup static static-libs systemd systemtap tcmalloc |
1115 |
- test tokudb xml yassl" |
1116 |
- |
1117 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
1118 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
1119 |
- |
1120 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
1121 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
1122 |
- !server? ( !extraengine !embedded ) |
1123 |
- ?? ( tcmalloc jemalloc ) |
1124 |
- static? ( yassl !pam )" |
1125 |
- |
1126 |
-# REMEMBER: also update eclass/mysql*.eclass before committing! |
1127 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
1128 |
- |
1129 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
1130 |
-# and we will run a mysql server during test phase |
1131 |
-S="${WORKDIR}/mysql" |
1132 |
- |
1133 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
1134 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras" |
1135 |
-else |
1136 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" |
1137 |
-fi |
1138 |
- |
1139 |
-PATCHES=( |
1140 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
1141 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.8-without-clientlibs-tools.patch |
1142 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
1143 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
1144 |
- "${MY_PATCH_DIR}"/20026_all_mariadb-add-pkgdatadir.patch |
1145 |
-) |
1146 |
- |
1147 |
-# Be warned, *DEPEND are version-dependant |
1148 |
-# These are used for both runtime and compiletime |
1149 |
-# MULTILIB_USEDEP only set for libraries used by the client library |
1150 |
-COMMON_DEPEND=" |
1151 |
- kernel_linux? ( |
1152 |
- sys-process/procps:0= |
1153 |
- dev-libs/libaio:0= |
1154 |
- ) |
1155 |
- >=sys-apps/sed-4 |
1156 |
- >=sys-apps/texinfo-4.7-r1 |
1157 |
- !dev-db/mariadb-connector-c[mysqlcompat] |
1158 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
1159 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
1160 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
1161 |
- !yassl? ( |
1162 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0=[${MULTILIB_USEDEP},static-libs?] ) |
1163 |
- libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP},static-libs?] ) |
1164 |
- ) |
1165 |
- >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?] |
1166 |
- sys-libs/ncurses:0= |
1167 |
- mroonga? ( app-text/groonga-normalizer-mysql ) |
1168 |
- kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] ) |
1169 |
- !bindist? ( |
1170 |
- sys-libs/binutils-libs:0= |
1171 |
- >=sys-libs/readline-4.1:0= |
1172 |
- ) |
1173 |
- server? ( |
1174 |
- backup? ( app-arch/libarchive:0= ) |
1175 |
- cracklib? ( sys-libs/cracklib:0= ) |
1176 |
- extraengine? ( |
1177 |
- odbc? ( dev-db/unixODBC:0= ) |
1178 |
- xml? ( dev-libs/libxml2:2= ) |
1179 |
- ) |
1180 |
- innodb-lz4? ( app-arch/lz4 ) |
1181 |
- innodb-lzo? ( dev-libs/lzo ) |
1182 |
- innodb-snappy? ( app-arch/snappy ) |
1183 |
- numa? ( sys-process/numactl ) |
1184 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
1185 |
- pam? ( virtual/pam:0= ) |
1186 |
- systemd? ( sys-apps/systemd:= ) |
1187 |
- tokudb? ( app-arch/snappy ) |
1188 |
- ) |
1189 |
- >=dev-libs/libpcre-8.35:3= |
1190 |
-" |
1191 |
-DEPEND="virtual/yacc |
1192 |
- static? ( sys-libs/ncurses[static-libs] ) |
1193 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
1194 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
1195 |
- ${COMMON_DEPEND}" |
1196 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
1197 |
- abi_x86_32? ( !app-emulation/emul-linux-x86-db[-abi_x86_32(-)] ) |
1198 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
1199 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
1200 |
- !<virtual/mysql-5.6-r9 |
1201 |
- ${COMMON_DEPEND} |
1202 |
- server? ( galera? ( |
1203 |
- sys-apps/iproute2 |
1204 |
- =sys-cluster/galera-25* |
1205 |
- sst-rsync? ( sys-process/lsof ) |
1206 |
- sst-xtrabackup? ( net-misc/socat[ssl] ) |
1207 |
- ) ) |
1208 |
- perl? ( !dev-db/mytop |
1209 |
- virtual/perl-Getopt-Long |
1210 |
- dev-perl/TermReadKey |
1211 |
- virtual/perl-Term-ANSIColor |
1212 |
- virtual/perl-Time-HiRes ) |
1213 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
1214 |
-" |
1215 |
-# For other stuff to bring us in |
1216 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
1217 |
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
1218 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
1219 |
- server? ( ~virtual/mysql-5.6[embedded=,static=] ) |
1220 |
- virtual/libmysqlclient:${SLOT}[${MULTILIB_USEDEP},static-libs=] |
1221 |
- server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
1222 |
- |
1223 |
-pkg_setup() { |
1224 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
1225 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
1226 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
1227 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1228 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1229 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
1230 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1231 |
- die |
1232 |
- fi |
1233 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
1234 |
- # non x86{,_64} arches |
1235 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1236 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1237 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
1238 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1239 |
- die |
1240 |
- fi |
1241 |
- fi |
1242 |
- java-pkg-opt-2_pkg_setup |
1243 |
- if has test ${FEATURES} && \ |
1244 |
- use server && ! has userpriv ${FEATURES} ; then |
1245 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
1246 |
- fi |
1247 |
- |
1248 |
- # This should come after all of the die statements |
1249 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
1250 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
1251 |
-} |
1252 |
- |
1253 |
-pkg_preinst() { |
1254 |
- java-pkg-opt-2_pkg_preinst |
1255 |
- |
1256 |
- # Here we need to see if the implementation switched client libraries |
1257 |
- # We check if this is a new instance of the package and a client library already exists |
1258 |
- local SHOW_ABI_MESSAGE libpath |
1259 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
1260 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
1261 |
- elog "Due to ABI changes when switching between different client libraries," |
1262 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
1263 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
1264 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
1265 |
- fi |
1266 |
-} |
1267 |
- |
1268 |
-pkg_postinst() { |
1269 |
- # Make sure the vars are correctly initialized |
1270 |
- mysql_init_vars |
1271 |
- |
1272 |
- # Check FEATURES="collision-protect" before removing this |
1273 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
1274 |
- |
1275 |
- # Secure the logfiles |
1276 |
- touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} |
1277 |
- chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* |
1278 |
- chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* |
1279 |
- |
1280 |
- # Minimal builds don't have the MySQL server |
1281 |
- if use server ; then |
1282 |
- if use pam; then |
1283 |
- einfo |
1284 |
- elog "This install includes the PAM authentication plugin." |
1285 |
- elog "To activate and configure the PAM plugin, please read:" |
1286 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
1287 |
- einfo |
1288 |
- fi |
1289 |
- |
1290 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
1291 |
- einfo |
1292 |
- elog "You might want to run:" |
1293 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
1294 |
- elog "if this is a new install." |
1295 |
- elog |
1296 |
- elog "If you are switching server implentations, you should run the" |
1297 |
- elog "mysql_upgrade tool." |
1298 |
- einfo |
1299 |
- else |
1300 |
- einfo |
1301 |
- elog "If you are upgrading major versions, you should run the" |
1302 |
- elog "mysql_upgrade tool." |
1303 |
- einfo |
1304 |
- fi |
1305 |
- |
1306 |
- if use galera ; then |
1307 |
- einfo |
1308 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
1309 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
1310 |
- elog "The first time the cluster is activated, you should add" |
1311 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
1312 |
- elog "This option should then be removed for subsequent starts." |
1313 |
- einfo |
1314 |
- fi |
1315 |
- fi |
1316 |
- |
1317 |
- # Note about configuration change |
1318 |
- einfo |
1319 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
1320 |
- elog "to several files in /etc/mysql/${PN}.d." |
1321 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
1322 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
1323 |
- elog "You may have as many files as needed and they are read alphabetically." |
1324 |
- elog "Be sure the options have the appropitate section headers, i.e. [mysqld]." |
1325 |
- einfo |
1326 |
-} |
1327 |
- |
1328 |
-src_unpack() { |
1329 |
- |
1330 |
- # Initialize the proper variables first |
1331 |
- mysql_init_vars |
1332 |
- |
1333 |
- unpack ${A} |
1334 |
- # Grab the patches |
1335 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack |
1336 |
- |
1337 |
- mv -f "${WORKDIR}/${P}" "${S}" || die |
1338 |
-} |
1339 |
- |
1340 |
-src_prepare() { |
1341 |
- java-pkg-opt-2_src_prepare |
1342 |
- if use tcmalloc; then |
1343 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
1344 |
- fi |
1345 |
- |
1346 |
- # Don't build bundled xz-utils for tokudb |
1347 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
1348 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
1349 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
1350 |
- |
1351 |
- # Remove the bundled groonga |
1352 |
- # There is no CMake flag, it simply checks for existance |
1353 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
1354 |
- |
1355 |
- eapply "${PATCHES[@]}" |
1356 |
- eapply_user |
1357 |
-} |
1358 |
- |
1359 |
-src_configure(){ |
1360 |
- # bug 508724 mariadb cannot use ld.gold |
1361 |
- tc-ld-disable-gold |
1362 |
- # Bug #114895, bug #110149 |
1363 |
- filter-flags "-O" "-O[01]" |
1364 |
- |
1365 |
- append-cxxflags -felide-constructors |
1366 |
- |
1367 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
1368 |
- append-flags -fno-strict-aliasing |
1369 |
- |
1370 |
- multilib-minimal_src_configure |
1371 |
-} |
1372 |
- |
1373 |
-multilib_src_configure() { |
1374 |
- debug-print-function ${FUNCNAME} "$@" |
1375 |
- |
1376 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
1377 |
- |
1378 |
- # debug hack wrt #497532 |
1379 |
- mycmakeargs=( |
1380 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
1381 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
1382 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
1383 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
1384 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
1385 |
- -DINSTALL_BINDIR=bin |
1386 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
1387 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
1388 |
- -DINSTALL_INCLUDEDIR=include/mysql |
1389 |
- -DINSTALL_INFODIR=share/info |
1390 |
- -DINSTALL_LIBDIR=$(get_libdir) |
1391 |
- -DINSTALL_MANDIR=share/man |
1392 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
1393 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
1394 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
1395 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
1396 |
- -DINSTALL_SBINDIR=sbin |
1397 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
1398 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
1399 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
1400 |
- -DWITH_LIBEDIT=0 |
1401 |
- -DWITH_ZLIB=system |
1402 |
- -DWITHOUT_LIBWRAP=1 |
1403 |
- -DENABLED_LOCAL_INFILE=1 |
1404 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1405 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1406 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
1407 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
1408 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
1409 |
- -DENABLE_STATIC_LIBS=$(usex static-libs ON OFF) |
1410 |
- # The build forces this to be defined when cross-compiling. We pass it |
1411 |
- # all the time for simplicity and to make sure it is actually correct. |
1412 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
1413 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
1414 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
1415 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
1416 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
1417 |
- -DWITH_EXTERNAL_ZLIB=YES |
1418 |
- -DSUFFIX_INSTALL_DIR="" |
1419 |
- -DWITH_UNITTEST=OFF |
1420 |
- ) |
1421 |
- if use test ; then |
1422 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
1423 |
- else |
1424 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
1425 |
- fi |
1426 |
- |
1427 |
- if ! use yassl ; then |
1428 |
- mycmakeargs+=( -DWITH_SSL=system ) |
1429 |
- else |
1430 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
1431 |
- fi |
1432 |
- |
1433 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
1434 |
- # systemtap only works on native ABI bug 530132 |
1435 |
- if multilib_is_native_abi; then |
1436 |
- mycmakeargs+=( |
1437 |
- -DWITH_READLINE=$(usex bindist 1 0) |
1438 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
1439 |
- -DENABLE_DTRACE=$(usex systemtap) |
1440 |
- ) |
1441 |
- else |
1442 |
- mycmakeargs+=( |
1443 |
- -DWITHOUT_TOOLS=1 |
1444 |
- -DWITH_READLINE=1 |
1445 |
- -DNOT_FOR_DISTRIBUTION=0 |
1446 |
- -DENABLE_DTRACE=0 |
1447 |
- ) |
1448 |
- fi |
1449 |
- |
1450 |
- if multilib_is_native_abi && use server ; then |
1451 |
- |
1452 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
1453 |
- if ! use extraengine ; then |
1454 |
- mycmakeargs+=( |
1455 |
- -DPLUGIN_FEDERATED=NO |
1456 |
- -DPLUGIN_FEDERATEDX=NO ) |
1457 |
- fi |
1458 |
- |
1459 |
- mycmakeargs+=( |
1460 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
1461 |
- -DWITH_PCRE=system |
1462 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
1463 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
1464 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
1465 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
1466 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
1467 |
- -DPLUGIN_CASSANDRA=NO |
1468 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
1469 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
1470 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
1471 |
- -DCONNECT_WITH_MYSQL=1 |
1472 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
1473 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
1474 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
1475 |
- -DWITH_WSREP=$(usex galera) |
1476 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
1477 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
1478 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
1479 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
1480 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
1481 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
1482 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
1483 |
- -DINSTALL_SQLBENCHDIR=share/mariadb |
1484 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
1485 |
- # systemd is only linked to for server notification |
1486 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
1487 |
- -DWITH_NUMA=$(usex numa ON OFF) |
1488 |
- ) |
1489 |
- if use test ; then |
1490 |
- # This is needed for the new client lib which tests a real, open server |
1491 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
1492 |
- fi |
1493 |
- |
1494 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
1495 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
1496 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
1497 |
- ewarn "You MUST file bugs without these variables set." |
1498 |
- |
1499 |
- mycmakeargs+=( |
1500 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
1501 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
1502 |
- ) |
1503 |
- |
1504 |
- elif ! use latin1 ; then |
1505 |
- mycmakeargs+=( |
1506 |
- -DDEFAULT_CHARSET=utf8 |
1507 |
- -DDEFAULT_COLLATION=utf8_general_ci |
1508 |
- ) |
1509 |
- else |
1510 |
- mycmakeargs+=( |
1511 |
- -DDEFAULT_CHARSET=latin1 |
1512 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
1513 |
- ) |
1514 |
- fi |
1515 |
- mycmakeargs+=( |
1516 |
- -DEXTRA_CHARSETS=all |
1517 |
- -DMYSQL_USER=mysql |
1518 |
- -DDISABLE_SHARED=$(usex static YES NO) |
1519 |
- -DWITH_DEBUG=$(usex debug) |
1520 |
- -DWITH_EMBEDDED_SERVER=$(usex embedded) |
1521 |
- -DWITH_PROFILING=$(usex profiling) |
1522 |
- ) |
1523 |
- |
1524 |
- if use static; then |
1525 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
1526 |
- fi |
1527 |
- |
1528 |
- if use jemalloc || use tcmalloc ; then |
1529 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
1530 |
- fi |
1531 |
- |
1532 |
- # Storage engines |
1533 |
- mycmakeargs+=( |
1534 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
1535 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
1536 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
1537 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
1538 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
1539 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
1540 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
1541 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
1542 |
- ) |
1543 |
- |
1544 |
- else |
1545 |
- mycmakeargs+=( |
1546 |
- -DWITHOUT_SERVER=1 |
1547 |
- -DWITHOUT_EMBEDDED_SERVER=1 |
1548 |
- -DEXTRA_CHARSETS=none |
1549 |
- -DINSTALL_SQLBENCHDIR= |
1550 |
- -DWITH_SYSTEMD=no |
1551 |
- ) |
1552 |
- fi |
1553 |
- |
1554 |
- cmake-utils_src_configure |
1555 |
-} |
1556 |
- |
1557 |
-src_compile() { |
1558 |
- multilib-minimal_src_compile |
1559 |
-} |
1560 |
- |
1561 |
-multilib_src_compile() { |
1562 |
- cmake-utils_src_compile |
1563 |
-} |
1564 |
- |
1565 |
-src_install() { |
1566 |
- # headers with ABI specific data |
1567 |
- local MULTILIB_WRAPPED_HEADERS=( |
1568 |
- /usr/include/mysql/server/my_config.h |
1569 |
- /usr/include/mysql/server/private/embedded_priv.h |
1570 |
- /usr/include/mysql/server/mysql_version.h |
1571 |
- /usr/include/mariadb/mariadb_version.h |
1572 |
- /usr/include/mysql/mariadb_version.h |
1573 |
- /usr/include/mysql/server/private/probes_mysql_nodtrace.h |
1574 |
- /usr/include/mysql/server/private/probes_mysql_dtrace.h ) |
1575 |
- |
1576 |
- # wrap the config scripts |
1577 |
- local MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config /usr/bin/mysql_config ) |
1578 |
- multilib-minimal_src_install |
1579 |
-} |
1580 |
- |
1581 |
-# Intentionally override eclass function |
1582 |
-multilib_src_install() { |
1583 |
- cmake-utils_src_install |
1584 |
- |
1585 |
- # Make sure the vars are correctly initialized |
1586 |
- mysql_init_vars |
1587 |
- |
1588 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
1589 |
- if [[ -f "${D}/usr/include/mysql/server/private/config.h" ]] ; then |
1590 |
- rm "${D}/usr/include/mysql/server/private/config.h" || die |
1591 |
- fi |
1592 |
- |
1593 |
- if ! multilib_is_native_abi && use server ; then |
1594 |
- insinto /usr/include/mysql/server/private |
1595 |
- doins "${S}"/sql/*.h |
1596 |
- fi |
1597 |
- |
1598 |
- # Install compatible symlinks to libmysqlclient |
1599 |
-# use static-libs && dosym libmariadbclient.a "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.a" |
1600 |
-# dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so" |
1601 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so.${SUBSLOT}" |
1602 |
- |
1603 |
- # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. |
1604 |
- find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die |
1605 |
-} |
1606 |
- |
1607 |
-multilib_src_install_all() { |
1608 |
- # Make sure the vars are correctly initialized |
1609 |
- mysql_init_vars |
1610 |
- |
1611 |
- # Convenience links |
1612 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
1613 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
1614 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
1615 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
1616 |
- |
1617 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
1618 |
- if [[ -d "${ED}/usr/data" ]] ; then |
1619 |
- rm -Rf "${ED}/usr/data" || die |
1620 |
- fi |
1621 |
- |
1622 |
- # Unless they explicitly specific USE=test, then do not install the |
1623 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
1624 |
- # validation of your database configuration after tuning it. |
1625 |
- if ! use test ; then |
1626 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
1627 |
- fi |
1628 |
- |
1629 |
- # Configuration stuff |
1630 |
- einfo "Building default configuration ..." |
1631 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
1632 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
1633 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
1634 |
- eprefixify "${TMPDIR}/my.cnf" |
1635 |
- doins "${TMPDIR}/my.cnf" |
1636 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
1637 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
1638 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
1639 |
- doins "${TMPDIR}/50-distro-client.cnf" |
1640 |
- |
1641 |
- if use server ; then |
1642 |
- mycnf_src="my.cnf.distro-server" |
1643 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
1644 |
- "${FILESDIR}/${mycnf_src}" \ |
1645 |
- > "${TMPDIR}/my.cnf.ok" || die |
1646 |
- if use prefix ; then |
1647 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
1648 |
- "${TMPDIR}/my.cnf.ok" || die |
1649 |
- fi |
1650 |
- if use latin1 ; then |
1651 |
- sed -i \ |
1652 |
- -e "/character-set/s|utf8|latin1|g" \ |
1653 |
- "${TMPDIR}/my.cnf.ok" || die |
1654 |
- fi |
1655 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
1656 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
1657 |
- einfo "Creating initial directories" |
1658 |
- # Empty directories ... |
1659 |
- diropts "-m0750" |
1660 |
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then |
1661 |
- dodir "${MY_DATADIR#${EPREFIX}}" |
1662 |
- keepdir "${MY_DATADIR#${EPREFIX}}" |
1663 |
- chown -R mysql:mysql "${D}/${MY_DATADIR}" |
1664 |
- fi |
1665 |
- |
1666 |
- diropts "-m0755" |
1667 |
- local folder |
1668 |
- for folder in "${MY_LOGDIR#${EPREFIX}}" ; do |
1669 |
- dodir "${folder}" |
1670 |
- keepdir "${folder}" |
1671 |
- chown -R mysql:mysql "${ED}/${folder}" |
1672 |
- done |
1673 |
- |
1674 |
- einfo "Including support files and sample configurations" |
1675 |
- docinto "support-files" |
1676 |
- local script |
1677 |
- for script in \ |
1678 |
- "${S}"/support-files/magic |
1679 |
- do |
1680 |
- [[ -f "$script" ]] && dodoc "${script}" |
1681 |
- done |
1682 |
- |
1683 |
- docinto "scripts" |
1684 |
- for script in "${S}"/scripts/mysql* ; do |
1685 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
1686 |
- done |
1687 |
- fi |
1688 |
- |
1689 |
- #Remove mytop if perl is not selected |
1690 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
1691 |
-} |
1692 |
- |
1693 |
-# Official test instructions: |
1694 |
-# USE='extraengine perl server static-libs' \ |
1695 |
-# FEATURES='test userpriv -usersandbox' \ |
1696 |
-# ebuild mariadb-X.X.XX.ebuild \ |
1697 |
-# digest clean package |
1698 |
-multilib_src_test() { |
1699 |
- |
1700 |
- if ! multilib_is_native_abi ; then |
1701 |
- einfo "Server tests not available on non-native abi". |
1702 |
- return 0; |
1703 |
- fi |
1704 |
- |
1705 |
- _disable_test() { |
1706 |
- |
1707 |
- local rawtestname testname testsuite reason mysql_disabled_file mysql_disabled_dir |
1708 |
- rawtestname="${1}" ; shift |
1709 |
- reason="${@}" |
1710 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
1711 |
- |
1712 |
- testsuite="${rawtestname/.*}" |
1713 |
- testname="${rawtestname/*.}" |
1714 |
- for mysql_disabled_file in \ |
1715 |
- "${S}/mysql-test/disabled.def" \ |
1716 |
- "${S}/mysql-test/t/disabled.def" ; do |
1717 |
- [[ -f ${mysql_disabled_file} ]] && break |
1718 |
- done |
1719 |
- #mysql_disabled_file="${S}/mysql-test/t/disabled.def" |
1720 |
- #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" |
1721 |
- echo ${testname} : ${reason} >> "${mysql_disabled_file}" |
1722 |
- |
1723 |
- if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then |
1724 |
- for mysql_disabled_file in \ |
1725 |
- "${S}/mysql-test/suite/${testsuite}/disabled.def" \ |
1726 |
- "${S}/mysql-test/suite/${testsuite}/t/disabled.def" \ |
1727 |
- FAILED ; do |
1728 |
- [[ -f ${mysql_disabled_file} ]] && break |
1729 |
- done |
1730 |
- if [[ ${mysql_disabled_file} != "FAILED" ]]; then |
1731 |
- echo "${testname} : ${reason}" >> "${mysql_disabled_file}" |
1732 |
- else |
1733 |
- for mysql_disabled_dir in \ |
1734 |
- "${S}/mysql-test/suite/${testsuite}" \ |
1735 |
- "${S}/mysql-test/suite/${testsuite}/t" \ |
1736 |
- FAILED ; do |
1737 |
- [[ -d ${mysql_disabled_dir} ]] && break |
1738 |
- done |
1739 |
- if [[ ${mysql_disabled_dir} != "FAILED" ]]; then |
1740 |
- echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def" |
1741 |
- else |
1742 |
- ewarn "Could not find testsuite disabled.def location for ${rawtestname}" |
1743 |
- fi |
1744 |
- fi |
1745 |
- fi |
1746 |
- } |
1747 |
- |
1748 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
1749 |
- local retstatus_unit |
1750 |
- local retstatus_tests |
1751 |
- |
1752 |
- if ! use server ; then |
1753 |
- einfo "Skipping server tests due to minimal build." |
1754 |
- return 0 |
1755 |
- fi |
1756 |
- |
1757 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
1758 |
- # localhost. Also causes weird failures. |
1759 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
1760 |
- |
1761 |
- if [[ $UID -eq 0 ]]; then |
1762 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
1763 |
- fi |
1764 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
1765 |
- |
1766 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1767 |
- |
1768 |
- # Run CTest (test-units) |
1769 |
- cmake-utils_src_test |
1770 |
- retstatus_unit=$? |
1771 |
- |
1772 |
- # Ensure that parallel runs don't die |
1773 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
1774 |
- # Enable parallel testing, auto will try to detect number of cores |
1775 |
- # You may set this by hand. |
1776 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
1777 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
1778 |
- |
1779 |
- # create directories because mysqladmin might run out of order |
1780 |
- mkdir -p "${T}"/var-tests{,/log} || die |
1781 |
- |
1782 |
- # Run mysql tests |
1783 |
- pushd "${TESTDIR}" > /dev/null || die |
1784 |
- |
1785 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
1786 |
- # false positives: |
1787 |
- # |
1788 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
1789 |
- # main.mysql_client_test_comp: |
1790 |
- # segfaults at random under Portage only, suspect resource limits. |
1791 |
- |
1792 |
- local t |
1793 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
1794 |
- _disable_test "$t" "False positive due to varying policies" |
1795 |
- done |
1796 |
- |
1797 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
1798 |
- main.mysql_client_test_comp ; do |
1799 |
- _disable_test "$t" "False positives in Gentoo" |
1800 |
- done |
1801 |
- |
1802 |
- # run mysql-test tests |
1803 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder |
1804 |
- retstatus_tests=$? |
1805 |
- |
1806 |
- popd > /dev/null || die |
1807 |
- |
1808 |
- # Cleanup is important for these testcases. |
1809 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
1810 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
1811 |
- |
1812 |
- local failures="" |
1813 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
1814 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
1815 |
- |
1816 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
1817 |
- einfo "Tests successfully completed" |
1818 |
-} |
1819 |
- |
1820 |
-mysql_init_vars() { |
1821 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
1822 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
1823 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
1824 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
1825 |
- |
1826 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
1827 |
- MY_DATADIR="" |
1828 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
1829 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
1830 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
1831 |
- | tail -n1` |
1832 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
1833 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
1834 |
- | sed -e 's/.*=\s*//' \ |
1835 |
- | tail -n1` |
1836 |
- fi |
1837 |
- fi |
1838 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
1839 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
1840 |
- einfo "Using default MY_DATADIR" |
1841 |
- fi |
1842 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
1843 |
- |
1844 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
1845 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
1846 |
- # If you get this and you're wondering about it, see bug #207636 |
1847 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
1848 |
- elog "A new one will not be created." |
1849 |
- PREVIOUS_DATADIR="yes" |
1850 |
- else |
1851 |
- PREVIOUS_DATADIR="no" |
1852 |
- fi |
1853 |
- export PREVIOUS_DATADIR |
1854 |
- fi |
1855 |
- else |
1856 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
1857 |
- local new_MY_DATADIR |
1858 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
1859 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
1860 |
- | tail -n1` |
1861 |
- |
1862 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
1863 |
- ewarn "MySQL MY_DATADIR has changed" |
1864 |
- ewarn "from ${MY_DATADIR}" |
1865 |
- ewarn "to ${new_MY_DATADIR}" |
1866 |
- MY_DATADIR="${new_MY_DATADIR}" |
1867 |
- fi |
1868 |
- fi |
1869 |
- fi |
1870 |
- |
1871 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
1872 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
1873 |
- export MY_DATADIR |
1874 |
-} |
1875 |
- |
1876 |
-pkg_config() { |
1877 |
- _getoptval() { |
1878 |
- local mypd="${EROOT}"/usr/bin/my_print_defaults |
1879 |
- local section="$1" |
1880 |
- local flag="--${2}=" |
1881 |
- local extra_options="${3}" |
1882 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
1883 |
- } |
1884 |
- local old_MY_DATADIR="${MY_DATADIR}" |
1885 |
- local old_HOME="${HOME}" |
1886 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
1887 |
- export HOME=${EPREFIX}/root |
1888 |
- |
1889 |
- # Make sure the vars are correctly initialized |
1890 |
- mysql_init_vars |
1891 |
- |
1892 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
1893 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
1894 |
- die "Minimal builds do NOT include the MySQL server" |
1895 |
- fi |
1896 |
- |
1897 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
1898 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
1899 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
1900 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
1901 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
1902 |
- |
1903 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
1904 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
1905 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
1906 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
1907 |
- else |
1908 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
1909 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
1910 |
- || die "Moving MY_DATADIR failed" |
1911 |
- fi |
1912 |
- else |
1913 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
1914 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
1915 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
1916 |
- else |
1917 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
1918 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
1919 |
- fi |
1920 |
- fi |
1921 |
- fi |
1922 |
- |
1923 |
- local pwd1="a" |
1924 |
- local pwd2="b" |
1925 |
- local maxtry=15 |
1926 |
- |
1927 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
1928 |
- local tmp_mysqld_password_source= |
1929 |
- |
1930 |
- for tmp_mysqld_password_source in mysql client; do |
1931 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
1932 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
1933 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
1934 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
1935 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
1936 |
- MYSQL_ROOT_PASSWORD= |
1937 |
- continue |
1938 |
- fi |
1939 |
- |
1940 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
1941 |
- break |
1942 |
- fi |
1943 |
- done |
1944 |
- |
1945 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
1946 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
1947 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
1948 |
- fi |
1949 |
- |
1950 |
- unset tmp_mysqld_password_source |
1951 |
- fi |
1952 |
- MYSQL_TMPDIR="$(_getoptval '--mysqld' tmpdir)" |
1953 |
- # These are dir+prefix |
1954 |
- MYSQL_RELAY_LOG="$(_getoptval '--mysqld' relay-log)" |
1955 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
1956 |
- MYSQL_LOG_BIN="$(_getoptval '--mysqld' log-bin)" |
1957 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
1958 |
- |
1959 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
1960 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
1961 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
1962 |
- fi |
1963 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
1964 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
1965 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
1966 |
- fi |
1967 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
1968 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
1969 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
1970 |
- fi |
1971 |
- |
1972 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
1973 |
- ewarn "You have already a MySQL database in place." |
1974 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
1975 |
- ewarn "Please rename or delete it if you wish to replace it." |
1976 |
- die "MySQL database already exists!" |
1977 |
- fi |
1978 |
- |
1979 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
1980 |
- # localhost. Also causes weird failures. |
1981 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
1982 |
- |
1983 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
1984 |
- |
1985 |
- einfo "Please provide a password for the mysql 'root' user now" |
1986 |
- einfo "or through the ${HOME}/.my.cnf file." |
1987 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
1988 |
- read -rsp " >" pwd1 ; echo |
1989 |
- |
1990 |
- einfo "Retype the password" |
1991 |
- read -rsp " >" pwd2 ; echo |
1992 |
- |
1993 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
1994 |
- die "Passwords are not the same" |
1995 |
- fi |
1996 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
1997 |
- unset pwd1 pwd2 |
1998 |
- fi |
1999 |
- |
2000 |
- local options |
2001 |
- local sqltmp="$(emktemp)" |
2002 |
- |
2003 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
2004 |
- # see http://bugs.mysql.com/bug.php?id=31312 |
2005 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
2006 |
- |
2007 |
- # Figure out which options we need to disable to do the setup |
2008 |
- local helpfile="${TMPDIR}/mysqld-help" |
2009 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
2010 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
2011 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
2012 |
- log-slave-updates \ |
2013 |
- ; do |
2014 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
2015 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
2016 |
- done |
2017 |
- |
2018 |
- use prefix || options="${options} --user=mysql" |
2019 |
- |
2020 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
2021 |
- |
2022 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
2023 |
- PID_DIR="${EROOT}/var/run/mysqld" |
2024 |
- if [[ ! -d "${PID_DIR}" ]]; then |
2025 |
- mkdir -p "${PID_DIR}" || die "Could not create pid directory" |
2026 |
- chown mysql:mysql "${PID_DIR}" || die "Could not set ownership on pid directory" |
2027 |
- chmod 755 "${PID_DIR}" || die "Could not set permissions on pid directory" |
2028 |
- fi |
2029 |
- |
2030 |
- pushd "${TMPDIR}" &>/dev/null |
2031 |
- |
2032 |
- # Filling timezones, see |
2033 |
- # http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
2034 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
2035 |
- |
2036 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
2037 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
2038 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
2039 |
- einfo "Command: ${cmd[*]}" |
2040 |
- "${cmd[@]}" \ |
2041 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
2042 |
- if [ $? -ne 0 ]; then |
2043 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
2044 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
2045 |
- fi |
2046 |
- popd &>/dev/null |
2047 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
2048 |
- || die "MySQL databases not installed" |
2049 |
- chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null |
2050 |
- chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null |
2051 |
- |
2052 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
2053 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
2054 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
2055 |
- ${options} \ |
2056 |
- --log-warnings=0 \ |
2057 |
- --basedir=${EROOT}/usr \ |
2058 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
2059 |
- --max_allowed_packet=8M \ |
2060 |
- --net_buffer_length=16K \ |
2061 |
- --socket=${socket} \ |
2062 |
- --pid-file=${pidfile} |
2063 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
2064 |
- #einfo "About to start mysqld: ${mysqld}" |
2065 |
- ebegin "Starting mysqld" |
2066 |
- einfo "Command ${mysqld}" |
2067 |
- ${mysqld} & |
2068 |
- rc=$? |
2069 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
2070 |
- maxtry=$((${maxtry}-1)) |
2071 |
- echo -n "." |
2072 |
- sleep 1 |
2073 |
- done |
2074 |
- eend $rc |
2075 |
- |
2076 |
- if ! [[ -S "${socket}" ]]; then |
2077 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
2078 |
- fi |
2079 |
- |
2080 |
- ebegin "Setting root password" |
2081 |
- # Do this from memory, as we don't want clear text passwords in temp files |
2082 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
2083 |
- "${EROOT}/usr/bin/mysql" \ |
2084 |
- "--socket=${socket}" \ |
2085 |
- -hlocalhost \ |
2086 |
- -e "${sql}" |
2087 |
- eend $? |
2088 |
- |
2089 |
- if [[ -n "${sqltmp}" ]] ; then |
2090 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
2091 |
- "${EROOT}/usr/bin/mysql" \ |
2092 |
- "--socket=${socket}" \ |
2093 |
- -hlocalhost \ |
2094 |
- -uroot \ |
2095 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
2096 |
- mysql < "${sqltmp}" |
2097 |
- rc=$? |
2098 |
- eend $? |
2099 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
2100 |
- fi |
2101 |
- |
2102 |
- # Stop the server and cleanup |
2103 |
- einfo "Stopping the server ..." |
2104 |
- kill $(< "${pidfile}" ) |
2105 |
- rm -f "${sqltmp}" |
2106 |
- wait %1 |
2107 |
- einfo "Done" |
2108 |
-} |