1 |
commit: 721beb40041eb9330261aa77dbace57fd598b81d |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 1 14:45:20 2018 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 1 14:45:20 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=721beb40 |
7 |
|
8 |
dev-db/mariadb: Add refactored ebuilds for testing |
9 |
|
10 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
11 |
Manifest-Sign-Key: D1F781EFF9F4A3B6 |
12 |
|
13 |
dev-db/mariadb/Manifest | 34 +- |
14 |
dev-db/mariadb/mariadb-10.0.35-r1.ebuild | 844 ++++++++++++++++++++++++++++ |
15 |
dev-db/mariadb/mariadb-10.1.33-r1.ebuild | 879 +++++++++++++++++++++++++++++ |
16 |
dev-db/mariadb/mariadb-10.2.15-r1.ebuild | 919 +++++++++++++++++++++++++++++++ |
17 |
dev-db/mariadb/mariadb-10.2.6.ebuild | 398 ------------- |
18 |
dev-db/mariadb/mariadb-10.2.7.ebuild | 401 -------------- |
19 |
dev-db/mariadb/metadata.xml | 3 + |
20 |
7 files changed, 2662 insertions(+), 816 deletions(-) |
21 |
|
22 |
diff --git a/dev-db/mariadb/Manifest b/dev-db/mariadb/Manifest |
23 |
index b1fc702..57c7343 100644 |
24 |
--- a/dev-db/mariadb/Manifest |
25 |
+++ b/dev-db/mariadb/Manifest |
26 |
@@ -1,32 +1,32 @@ |
27 |
-----BEGIN PGP SIGNED MESSAGE----- |
28 |
Hash: SHA256 |
29 |
|
30 |
-DIST mariadb-10.2.6.tar.gz 67599197 SHA256 c385c76e40d6e5f0577eba021805da5f494a30c9ef51884baefe206d5658a2e5 SHA512 142628085f42ef15ceef6aca5e47ba56cc38cbfc0ac4f35f6b37512c14a60430ef4805e54fd51c47e101b7692781e174426bdb49cae6807c4c18cc3d876f8732 WHIRLPOOL e5920a6f0833fa39b706b067037fb6e432e77ba4e7beee51300e408c92cf5962db91013b1958e649947006f0ac2775c70996d9c7f0dcd98d3b40e87ae5abc049 |
31 |
-DIST mariadb-10.2.7.tar.gz 67669554 SHA256 225ba1bbc48325ad38a9f433ff99da4641028f42404a29591cc370e4a676c0bc SHA512 fa595acc0f5c9c62077db000f1721af79628994c08e82b2eb95d265e3c556e80942c487fc1b91299c382becd71f21a0a117ca93d7428752f436ed83683a4f4cd WHIRLPOOL d76d584924dac41fd787c1a02f79de90ae5334b217b66deb59756490a8c42b801fddac425542e371d68b04fa462a3f438626896749a1c12be70e9d22d857771e |
32 |
+DIST mariadb-10.0.35.tar.gz 66551252 SHA256 1b8368e9653570ccb555a07db3de3a8b7277e7587a916d176d2ec70d3c05c00e SHA512 01fc8d48be3f3847bb222835436ab938c6c5b5ac8ba6cc87b3b6d2a2201b7ab4b152dc1f7d9749c89de90097d50052714ac08aafbbb117fffac32bfb47e74779 WHIRLPOOL 2b70e7d79196c3ce2df503a0a7d1d8eea075b98c9ab09e5ee72b3af567cccaa9d5e00d1dfb0320d36e6d6fc2217fe8ceb0321f93f24377060a0ba8df88feabc7 |
33 |
+DIST mariadb-10.1.33.tar.gz 65292094 SHA256 94312c519f2c0c25e1964c64e22aff0036fb22dfb2685638f43a6b2211395d2d SHA512 1d30e06d0c19e338bfbbe6815cf5eee8e1b839b525950f7f54c7cf8f89034658a284df4756f54719ab0f55875546d4713b03bab7dd094ec13291732b069f737e WHIRLPOOL 95cd15f8eb63db01af4d2164c51e4026e31ddbc44a657eac0643a9b43279679d287d6a4424a38d1e957580d3f851efebf9ec530fdd6aa1fb7acf4ff1e0a1a0f8 |
34 |
+DIST mariadb-10.2.15.tar.gz 73329750 SHA256 33de205158fc22fd8eb4e5770cc5ffa1cb4029f9c398dfd8c554ccb3e636ba11 SHA512 7702af8787973b15784dc8a89f9d56765725a420e2e68f1924b67c88c134c7d83d3249dddd16707fa9e5f05ed747f813f16feefbb477e999a6698b1dcfb5a88f WHIRLPOOL 9155656363232c2fd0a5f90d6883320fc41618a73a58c8b54512d3f7a81ef56b9ee2566bf0f4c19094cd25dd9fa9cf7f0623f90a4345e2192e87dc5f98014cdb |
35 |
DIST mariadb-5.1.67.tar.gz 25022999 SHA256 33471e9275c9b03919cabc38eb39f807d645adabf6a1a18f2e41ed73f47677c8 SHA512 de4a531027860c4226ec5e023b6f8573c2eb723bacaeb14279b9609ed033dcb58fc090aef3d9babcd4a4d0817ddf6ef75589c78f63075072d31ad0b7f7c17d7d WHIRLPOOL 22696d27c3a510396c4b86db5f5a4b39bbcde89285a8460b175ef7c40b3b7541fc8f205c0b96da7f94504a7fd14bfe02efb45204efda524a2426cd25e08162ff |
36 |
DIST mariadb-5.2.14.tar.gz 25469828 SHA256 8ab3db0535ce8728b03a34799da2334c18cff467e01d122293f23aad20613fe5 SHA512 b0aded450355861bf01604ac5bd0012d0d06a699bc83017cdb6b8749ed161aca9fedb733301aab991c521b21f3c8b2fea4867a2fd038379475e720782c02e869 WHIRLPOOL 8c2dd7ee0c1df5696d6b9f5c4387b7f755258a710ac088559f0f9779b27d18e30f32de0d4212015a15b6a83de2abbdd5c4ec811fa87fe2aec547809dc0970607 |
37 |
DIST mariadb-5.3.12.tar.gz 26880808 SHA256 83a4598117cadde2bd7eac4c1398edbc86cc3aa8d3824bbee864d4b568a3a30c SHA512 d53ea48745dad5693fd6a1fd5cf502852f12f8236b8a1fb7f81ad647301d2fd08d4f2944c74de580d0a4136d6c8b49f257124fa1b234ba8f2338f2047435ef94 WHIRLPOOL b9caf1b241262b3b25728769116a94b480ae404ed3d49c8afd6eb4ad6071552e436e4b9483e7f5d0113bc3127eaf04ceaa80d455486e7a92d00820b6b298c460 |
38 |
DIST mariadb-5.5.49.tar.gz 45738390 SHA256 2c82f2af71b88a7940d5ff647498ed78922c92e88004942caa213131e20f4706 SHA512 4eceb8ab4e1fb7144374f100440b83a8b3294fa9da61027086c27b02b8ff899e3f9d4511adbb02fb50ddab92a48bf6a39ad71ab9e00bc8be00022a4ea4e6fc2f WHIRLPOOL e757ff389b184fa235e39bebbfd4bd53e29a20da640a90a6a2454537a238edfff07f9a76da32e65a7756aa25421174d57f6f28d94924bb3ee0aa7ac6474d03c3 |
39 |
DIST mysql-extras-20121101-2319Z.tar.bz2 1898358 SHA256 ea5da082d3384bde67e005ebc39b78e7caadea80745333fb5a9cf47a4c4e4c5d SHA512 6a49abb1beee012d87ab63071a568ee6d9d8e4ff7a76401b91f5bdc127860d1c504a3877cbadb81536b07afe5ff419c77c793b0fc14ba484f56765d1ca526614 WHIRLPOOL 4bda75a0a9063830b3140bbc3cb12b60fa21289eee2fa476fb286da6318fdf0445a9c6193bd2063aefcd3f4ecc1f8045b30635f0e32014098d0f3dbee86e01fc |
40 |
DIST mysql-extras-20150509-1847Z.tar.bz2 1494301 SHA256 de9c9fbb67998604cb3c0409842e4601646c8ad17f2aa301f55ffd4aed7a483d SHA512 f87d96ab8c35236d4453182c49f87f6e703af9dc217916546e4dd7368caa18a2340c9063decd96c22251d1097d7e2cac58bef30e6ff75c23aedf8926dbc3d3b4 WHIRLPOOL f60297c8ee1dfd9867ed6b29a8b04a002f23bc36b1e8d9b5db30e1e454a49fe06ffc37b10d934b11235364eecdc62beb50ce24690ab3d07a50056357906fa0fa |
41 |
-DIST mysql-extras-20170719-0024Z.tar.bz2 310450 SHA256 220d4a62c737164a22554bc34c4a1b557441dda12f85ab94936158d540bf2f45 SHA512 658f70b617129b80c69e897e60b4aacc414ce4fc31b3814be6ef7b0002a8f81d6a41af2a88a0a4cd82b7665b1d6682ef6140bebd3c41d08b8ad6b4e083669139 WHIRLPOOL 2463673e700cf3eacc1d02e973f486afdc6120b4cdd194751644770145d5fd018d9a1674d119749224cefca6dd6fc13037c490aec0c34a02c01975141b5e38f1 |
42 |
-DIST mysql-extras-20170719-0113Z.tar.bz2 311116 SHA256 30b7e5f981a110ec8e1582939c59ea037559fa1519771d487d591f022b6a148d SHA512 5e470562e629bd1d104cd1d85e2b57f82b56c8f1f8236d666aca564ed577be50a5818312d8cb2a6a5f18a9c6c6792932fb15f56fd0baac6fadee4411b278f3ce WHIRLPOOL a5764ea0b9ba33d4a4982b24eeefddbaea4367d9e58b866fa9145e65d53369820762a27d36271c522ea3ad214637d28c3d0db3477d47e68647afada7a3dbbd75 |
43 |
+DIST mysql-extras-20180515-1334Z.tar.bz2 321462 SHA256 1a2c4116017ec56ec77375fa7fc85c7f0375d342505a45de16c4fd0dacd4bddf SHA512 de3000f0c65eed9595b52d53205cdcac60cb4a06a5aca27057c8beca6a7890f453aeeda0bb8487b8de75cfb4caa48682b7706273574876c5cefd0d03988c4f7e WHIRLPOOL b3a5fa87ea88cd823d2c7e5449fa50789cc13d487df800836644ba568ba3f8cab34bc26f57e41901e842ef73f7665636b843b8815c996d315589fb1a34ca39a6 |
44 |
-----BEGIN PGP SIGNATURE----- |
45 |
Version: GnuPG v2 |
46 |
|
47 |
-iQKTBAEBCAB9FiEEZsLkTtkOMnWOfVXA0feB7/n0o7YFAllutcFfFIAAAAAALgAo |
48 |
+iQKTBAEBCAB9FiEEZsLkTtkOMnWOfVXA0feB7/n0o7YFAlsRW/lfFIAAAAAALgAo |
49 |
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDY2 |
50 |
QzJFNDRFRDkwRTMyNzU4RTdENTVDMEQxRjc4MUVGRjlGNEEzQjYACgkQ0feB7/n0 |
51 |
-o7YxxA/+JY9n8PNTpQD71BqeOy7gyeCVZrjFXfzULDId3gC7NUry1bmt7lb3/SLc |
52 |
-BPxYsQrZcWlxKvFXJYpfcTWa2+aMFgG1YiouuLqCsbsQPbaK5J+eD3lc0rixLufi |
53 |
-QEmBjN58sIGWFw0Ft6HFuVsUle7JRZmi7TwqXxR8G4Qwk56I1H9lR0vcJCbMrvQf |
54 |
-/eom0Ceq6S6efBD/WdUoB5EPXSMrdETn8P3p5aW012bXKy0FHWnj+10CHA3EHKmk |
55 |
-fKeuTPER9qqusd2tE9sBOQuMUuKOqrK7z9jme37U+H/1/1V61eZugmLFp0/aSK6h |
56 |
-1vUrwt5a6KGCY9ksVFoRbfvk4LECXzE1t7oYy+k/SOcS0FV+45gjhCnknQbE/CME |
57 |
-oR05Dnd8f+5FJ7C9JMVeyJF0IRayNi18I0Kg/8Z0fU7SzvxJWuFLC5V92ZxTUvil |
58 |
-s2t8LH0m7UMskm9bgbScpM7DcvrJ0BRhKfOEjGUzWZ2s6exHL9uKkhoZegkcsQDX |
59 |
-FAaCc9WnkYEso8iUCgbR+Z7/QgdU2kbMEXTT9/cidUAjmQthsJTUAF0uqJy0xQ7n |
60 |
-gfjYcyPTwW+PK02VTQ7h2EQq4Ac4wn6nzwX//kNWVZoFYhc1fMHMb/Wr7YOMorbI |
61 |
-WFMYVKdxF4i/4FBEtQlt/oS7GTdejpYdAYNiHHyMKcsKRSvEW6I= |
62 |
-=NBDb |
63 |
+o7ZkfBAAzMk+AZbWMUIrocloAEfIjT4GymS81B//185CiJmC0ZO6kD2AM4NmYsJo |
64 |
+gIv7rwPuEpPoQG0IObGWwc5Ne7tOtn+XPmwdRocbgIh+Hj2M3610st1secuJWw+v |
65 |
+QCq/A3ml2eRPuHssgNuHgCMZ87ssdkWtPJhomjTLRFSonhs275MQpt+quc9UGA8D |
66 |
+YF20zH6uD1QfnEbcF87K2c8rN08i5p5XWwrfGun4Wsv1curBCcsqd2UWMoHlxIoy |
67 |
+9X0FE+xrnGOFUZ1xOtpuW3t6++Xhsx7Alukx7RqbCdKCgRbvk+1DsgV5nEUKP9dx |
68 |
+p1dtLz82T2IcWoALsDpReRrhiHQzCb3Ptj7XlKainAtexeAUH6XU3yyV9JTKarWE |
69 |
+9FBlnisC+mb5JZ4GkqINNOP8VMKUgGt19rpm1YpWHVLdAwYuA487Qgz/yR6sXoFW |
70 |
+MR+YLF7diJltOj471PoA6jkg66/U/CdJg2v2596+W0+HJvo2LgILHAHSxFOCIZnt |
71 |
+on+hmT7TzrIGsifxlIykZ8LzPrzRyoF/C2krOq1PNSy5HFIVt7JQ3aXqKPXUP0d1 |
72 |
+za1lCI+lG3ciOuspPBqY3MiYLPnCUP0TrcV0UEBD6aqXMpnmNqa65D4BWK9DyeOX |
73 |
+CLAz4eOHGL9Q7Doq35jh9vtGtRrRzR6F8ygzgMcnZeGeN5UOUZ4= |
74 |
+=JLgg |
75 |
-----END PGP SIGNATURE----- |
76 |
|
77 |
diff --git a/dev-db/mariadb/mariadb-10.0.35-r1.ebuild b/dev-db/mariadb/mariadb-10.0.35-r1.ebuild |
78 |
new file mode 100644 |
79 |
index 0000000..a524cb6 |
80 |
--- /dev/null |
81 |
+++ b/dev-db/mariadb/mariadb-10.0.35-r1.ebuild |
82 |
@@ -0,0 +1,844 @@ |
83 |
+# Copyright 1999-2018 Gentoo Foundation |
84 |
+# Distributed under the terms of the GNU General Public License v2 |
85 |
+ |
86 |
+EAPI="6" |
87 |
+MY_EXTRAS_VER="20180515-1334Z" |
88 |
+SUBSLOT="18" |
89 |
+ |
90 |
+JAVA_PKG_OPT_USE="jdbc" |
91 |
+ |
92 |
+# Keeping eutils in EAPI=6 for emktemp in pkg_config |
93 |
+ |
94 |
+inherit eutils flag-o-matic prefix toolchain-funcs java-pkg-opt-2 user cmake-utils multilib-build |
95 |
+ |
96 |
+SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
97 |
+ |
98 |
+# Gentoo patches to MySQL |
99 |
+if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
100 |
+ SRC_URI="${SRC_URI} |
101 |
+ mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
102 |
+ https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
103 |
+ https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
104 |
+ https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
105 |
+ https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
106 |
+fi |
107 |
+ |
108 |
+HOMEPAGE="http://mariadb.org/" |
109 |
+DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
110 |
+LICENSE="GPL-2" |
111 |
+SLOT="0/${SUBSLOT:-0}" |
112 |
+IUSE="bindist client-libs debug extraengine jdbc jemalloc latin1 libressl |
113 |
+ numa odbc oqgraph pam +perl profiling selinux +server sphinx |
114 |
+ static static-libs systemtap tcmalloc |
115 |
+ test tokudb xml yassl" |
116 |
+ |
117 |
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
118 |
+RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
119 |
+ |
120 |
+REQUIRED_USE="jdbc? ( extraengine server !static ) |
121 |
+ server? ( tokudb? ( jemalloc !tcmalloc ) ) |
122 |
+ ?? ( tcmalloc jemalloc ) |
123 |
+ static? ( yassl !pam )" |
124 |
+ |
125 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
126 |
+ |
127 |
+# Shorten the path because the socket path length must be shorter than 107 chars |
128 |
+# and we will run a mysql server during test phase |
129 |
+S="${WORKDIR}/mysql" |
130 |
+ |
131 |
+if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
132 |
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
133 |
+ inherit git-r3 |
134 |
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git" |
135 |
+ EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
136 |
+ EGIT_CLONE_TYPE=shallow |
137 |
+else |
138 |
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
139 |
+fi |
140 |
+ |
141 |
+PATCHES=( |
142 |
+ "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch" |
143 |
+ "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-10.0.33.patch" |
144 |
+ "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch" |
145 |
+ "${MY_PATCH_DIR}/20018_all_mariadb-10.0.20-without-clientlibs-tools.patch" |
146 |
+) |
147 |
+ |
148 |
+# Be warned, *DEPEND are version-dependant |
149 |
+# These are used for both runtime and compiletime |
150 |
+COMMON_DEPEND=" |
151 |
+ kernel_linux? ( |
152 |
+ sys-process/procps:0= |
153 |
+ dev-libs/libaio:0= |
154 |
+ ) |
155 |
+ >=sys-apps/sed-4 |
156 |
+ >=sys-apps/texinfo-4.7-r1 |
157 |
+ jemalloc? ( dev-libs/jemalloc:0= ) |
158 |
+ tcmalloc? ( dev-util/google-perftools:0= ) |
159 |
+ systemtap? ( >=dev-util/systemtap-1.3:0= ) |
160 |
+ !yassl? ( |
161 |
+ !libressl? ( dev-libs/openssl:0= !>=dev-libs/openssl-1.1 ) |
162 |
+ libressl? ( dev-libs/libressl:0= ) |
163 |
+ ) |
164 |
+ >=sys-libs/zlib-1.2.3:0= |
165 |
+ sys-libs/ncurses:0= |
166 |
+ !bindist? ( |
167 |
+ >=sys-libs/readline-4.1:0= |
168 |
+ ) |
169 |
+ server? ( |
170 |
+ extraengine? ( |
171 |
+ odbc? ( dev-db/unixODBC:0= ) |
172 |
+ xml? ( dev-libs/libxml2:2= ) |
173 |
+ ) |
174 |
+ numa? ( sys-process/numactl ) |
175 |
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
176 |
+ pam? ( virtual/pam:0= ) |
177 |
+ tokudb? ( app-arch/snappy ) |
178 |
+ ) |
179 |
+ >=dev-libs/libpcre-8.41-r1:3= |
180 |
+" |
181 |
+DEPEND="virtual/yacc |
182 |
+ static? ( sys-libs/ncurses[static-libs] ) |
183 |
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
184 |
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
185 |
+ ${COMMON_DEPEND}" |
186 |
+RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
187 |
+ client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) |
188 |
+ !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
189 |
+ server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
190 |
+ ${COMMON_DEPEND} |
191 |
+ perl? ( !dev-db/mytop |
192 |
+ virtual/perl-Getopt-Long |
193 |
+ dev-perl/TermReadKey |
194 |
+ virtual/perl-Term-ANSIColor |
195 |
+ virtual/perl-Time-HiRes ) |
196 |
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
197 |
+" |
198 |
+# For other stuff to bring us in |
199 |
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
200 |
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
201 |
+ !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] )" |
202 |
+ |
203 |
+pkg_setup() { |
204 |
+ if [[ ${MERGE_TYPE} != binary ]] ; then |
205 |
+ local GCC_MAJOR_SET=$(gcc-major-version) |
206 |
+ local GCC_MINOR_SET=$(gcc-minor-version) |
207 |
+ if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
208 |
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
209 |
+ eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
210 |
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
211 |
+ die |
212 |
+ fi |
213 |
+ # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
214 |
+ # non x86{,_64} arches |
215 |
+ if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
216 |
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
217 |
+ eerror "${PN} needs to be built with gcc-4.7 or later." |
218 |
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
219 |
+ die |
220 |
+ fi |
221 |
+ fi |
222 |
+ java-pkg-opt-2_pkg_setup |
223 |
+ if has test ${FEATURES} && \ |
224 |
+ use server && ! has userpriv ${FEATURES} ; then |
225 |
+ eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
226 |
+ fi |
227 |
+ |
228 |
+ # This should come after all of the die statements |
229 |
+ enewgroup mysql 60 || die "problem adding 'mysql' group" |
230 |
+ enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
231 |
+} |
232 |
+ |
233 |
+pkg_preinst() { |
234 |
+ java-pkg-opt-2_pkg_preinst |
235 |
+} |
236 |
+ |
237 |
+pkg_postinst() { |
238 |
+ # Make sure the vars are correctly initialized |
239 |
+ mysql_init_vars |
240 |
+ |
241 |
+ # Create log directory securely if it does not exist |
242 |
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
243 |
+ |
244 |
+ if use server ; then |
245 |
+ if use pam; then |
246 |
+ einfo |
247 |
+ elog "This install includes the PAM authentication plugin." |
248 |
+ elog "To activate and configure the PAM plugin, please read:" |
249 |
+ elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
250 |
+ einfo |
251 |
+ fi |
252 |
+ |
253 |
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
254 |
+ einfo |
255 |
+ elog "You might want to run:" |
256 |
+ elog "\"emerge --config =${CATEGORY}/${PF}\"" |
257 |
+ elog "if this is a new install." |
258 |
+ elog |
259 |
+ elog "If you are switching server implentations, you should run the" |
260 |
+ elog "mysql_upgrade tool." |
261 |
+ einfo |
262 |
+ else |
263 |
+ einfo |
264 |
+ elog "If you are upgrading major versions, you should run the" |
265 |
+ elog "mysql_upgrade tool." |
266 |
+ einfo |
267 |
+ fi |
268 |
+ |
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 |
+} |
278 |
+ |
279 |
+src_unpack() { |
280 |
+ unpack ${A} |
281 |
+ # Grab the patches |
282 |
+ [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack |
283 |
+ |
284 |
+ mv -f "${WORKDIR%/}/${P}" "${S}" || die |
285 |
+} |
286 |
+ |
287 |
+src_prepare() { |
288 |
+ _disable_engine() { |
289 |
+ echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
290 |
+ } |
291 |
+ |
292 |
+ _disable_plugin() { |
293 |
+ echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
294 |
+ } |
295 |
+ |
296 |
+ java-pkg-opt-2_src_prepare |
297 |
+ if use tcmalloc; then |
298 |
+ echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die |
299 |
+ fi |
300 |
+ |
301 |
+ # Don't build bundled xz-utils for tokudb |
302 |
+ echo > "${S%/}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
303 |
+ sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S%/}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
304 |
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S%/}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
305 |
+ |
306 |
+ local plugin |
307 |
+ local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
308 |
+ locale_info qc_info server_audit semisync sql_errlog ) |
309 |
+ local test_plugins=( audit_null auth_examples daemon_example fulltext ) |
310 |
+ if ! use server; then # These plugins are for the server |
311 |
+ for plugin in "${server_plugins[@]}" ; do |
312 |
+ _disable_plugin "${plugin}" |
313 |
+ done |
314 |
+ fi |
315 |
+ |
316 |
+ if ! use test; then # These plugins are only used during testing |
317 |
+ for plugin in "${test_plugins[@]}" ; do |
318 |
+ _disable_plugin "${plugin}" |
319 |
+ done |
320 |
+ fi |
321 |
+ |
322 |
+ # Collides with mariadb-connector-c bug 655980 |
323 |
+ _disable_plugin auth_dialog |
324 |
+ |
325 |
+ # Don't build Mroonga or example |
326 |
+ _disable_engine mroonga |
327 |
+ _disable_engine example |
328 |
+ |
329 |
+ if ! use oqgraph ; then # avoids extra library checks |
330 |
+ _disable_engine oqgraph |
331 |
+ fi |
332 |
+ |
333 |
+ cmake-utils_src_prepare |
334 |
+} |
335 |
+ |
336 |
+src_configure(){ |
337 |
+ # bug 508724 mariadb cannot use ld.gold |
338 |
+ tc-ld-disable-gold |
339 |
+ # Bug #114895, bug #110149 |
340 |
+ filter-flags "-O" "-O[01]" |
341 |
+ |
342 |
+ append-cxxflags -felide-constructors |
343 |
+ |
344 |
+ # bug #283926, with GCC4.4, this is required to get correct behavior. |
345 |
+ append-flags -fno-strict-aliasing |
346 |
+ |
347 |
+ CMAKE_BUILD_TYPE="RelWithDebInfo" |
348 |
+ |
349 |
+ # debug hack wrt #497532 |
350 |
+ mycmakeargs=( |
351 |
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
352 |
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
353 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr" |
354 |
+ -DINSTALL_SYSCONFDIR="${EPREFIX%/}/etc/mysql" |
355 |
+ -DINSTALL_BINDIR=bin |
356 |
+ -DINSTALL_DOCDIR=share/doc/${PF} |
357 |
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
358 |
+ -DINSTALL_INCLUDEDIR=include/mysql |
359 |
+ -DINSTALL_INFODIR=share/info |
360 |
+ -DINSTALL_LIBDIR=$(get_libdir) |
361 |
+ -DINSTALL_MANDIR=share/man |
362 |
+ -DINSTALL_MYSQLSHAREDIR=share/mariadb |
363 |
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
364 |
+ -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
365 |
+ -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql" |
366 |
+ -DINSTALL_SBINDIR=sbin |
367 |
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mariadb" |
368 |
+ -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" |
369 |
+ -DWITH_UNIT_TESTS=$(usex test ON OFF) |
370 |
+ -DWITH_ZLIB=system |
371 |
+ -DENABLED_LOCAL_INFILE=1 |
372 |
+ -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
373 |
+ -DINSTALL_UNIX_ADDRDIR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
374 |
+ # The build forces this to be defined when cross-compiling. We pass it |
375 |
+ # all the time for simplicity and to make sure it is actually correct. |
376 |
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
377 |
+ -DWITHOUT_CLIENTLIBS=YES |
378 |
+ -DWITH_READLINE=$(usex bindist 1 0) |
379 |
+ -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
380 |
+ -DENABLE_DTRACE=$(usex systemtap) |
381 |
+ ) |
382 |
+ if use test ; then |
383 |
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
384 |
+ else |
385 |
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
386 |
+ fi |
387 |
+ |
388 |
+ if ! use yassl ; then |
389 |
+ mycmakeargs+=( -DWITH_SSL=system ) |
390 |
+ else |
391 |
+ mycmakeargs+=( -DWITH_SSL=bundled ) |
392 |
+ fi |
393 |
+ |
394 |
+ if use server ; then |
395 |
+ |
396 |
+ # Federated{,X} must be treated special otherwise they will not be built as plugins |
397 |
+ if ! use extraengine ; then |
398 |
+ mycmakeargs+=( |
399 |
+ -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 |
400 |
+ -DWITHOUT_FEDERATEDX_STORAGE_ENGINE=1 ) |
401 |
+ fi |
402 |
+ |
403 |
+ mycmakeargs+=( |
404 |
+ -DWITH_JEMALLOC=$(usex jemalloc system) |
405 |
+ -DWITH_PCRE=system |
406 |
+ -D$(usex sphinx WITH WITHOUT)_SPHINX_STORAGE_ENGINE=1 |
407 |
+ -D$(usex tokudb WITH WITHOUT)_TOKUDB_STORAGE_ENGINE=1 |
408 |
+ -D$(usex oqgraph WITH WITHOUT)_AUTH_PAM=1 |
409 |
+ -D$(usex extraengine WITH WITHOUT)_SEQUENCE_STORAGE_ENGINE=1 |
410 |
+ -D$(usex extraengine WITH WITHOUT)_SPIDER_STORAGE_ENGINE=1 |
411 |
+ -D$(usex extraengine WITH WITHOUT)_CONNECT_STORAGE_ENGINE=1 |
412 |
+ -DCONNECT_WITH_LIBXML2=$(usex xml) |
413 |
+ -DCONNECT_WITH_ODBC=$(usex odbc) |
414 |
+ -DCONNECT_WITH_JDBC=$(usex jdbc) |
415 |
+ # Build failure and autodep wrt bug 639144 |
416 |
+ -DCONNECT_WITH_MONGO=OFF |
417 |
+ -DINSTALL_SQLBENCHDIR=share/mariadb |
418 |
+ ) |
419 |
+ |
420 |
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
421 |
+ ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
422 |
+ ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
423 |
+ ewarn "You MUST file bugs without these variables set." |
424 |
+ |
425 |
+ mycmakeargs+=( |
426 |
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
427 |
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
428 |
+ ) |
429 |
+ |
430 |
+ elif ! use latin1 ; then |
431 |
+ mycmakeargs+=( |
432 |
+ -DDEFAULT_CHARSET=utf8 |
433 |
+ -DDEFAULT_COLLATION=utf8_general_ci |
434 |
+ ) |
435 |
+ else |
436 |
+ mycmakeargs+=( |
437 |
+ -DDEFAULT_CHARSET=latin1 |
438 |
+ -DDEFAULT_COLLATION=latin1_swedish_ci |
439 |
+ ) |
440 |
+ fi |
441 |
+ mycmakeargs+=( |
442 |
+ -DEXTRA_CHARSETS=all |
443 |
+ -DDISABLE_SHARED=$(usex static YES NO) |
444 |
+ -DWITH_EMBEDDED_SERVER=OFF |
445 |
+ -DENABLED_PROFILING=$(usex profiling) |
446 |
+ ) |
447 |
+ |
448 |
+ if use static; then |
449 |
+ mycmakeargs+=( -DWITH_PIC=1 ) |
450 |
+ fi |
451 |
+ |
452 |
+ if use jemalloc || use tcmalloc ; then |
453 |
+ mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
454 |
+ fi |
455 |
+ |
456 |
+ # Storage engines |
457 |
+ mycmakeargs+=( |
458 |
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
459 |
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
460 |
+ -DWITH_CSV_STORAGE_ENGINE=1 |
461 |
+ -DWITH_HEAP_STORAGE_ENGINE=1 |
462 |
+ -DWITH_INNOBASE_STORAGE_ENGINE=1 |
463 |
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
464 |
+ -DWITH_MYISAM_STORAGE_ENGINE=1 |
465 |
+ -DWITH_PARTITION_STORAGE_ENGINE=1 |
466 |
+ ) |
467 |
+ |
468 |
+ else |
469 |
+ mycmakeargs+=( |
470 |
+ -DWITHOUT_SERVER=1 |
471 |
+ -DEXTRA_CHARSETS=none |
472 |
+ -DINSTALL_SQLBENCHDIR= |
473 |
+ ) |
474 |
+ fi |
475 |
+ |
476 |
+ cmake-utils_src_configure |
477 |
+} |
478 |
+ |
479 |
+src_compile() { |
480 |
+ cmake-utils_src_compile |
481 |
+} |
482 |
+ |
483 |
+src_install() { |
484 |
+ cmake-utils_src_install |
485 |
+ |
486 |
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
487 |
+ if [[ -f "${ED%/}/usr/include/mysql/server/private/config.h" ]] ; then |
488 |
+ rm "${ED%/}/usr/include/mysql/server/private/config.h" || die |
489 |
+ fi |
490 |
+ |
491 |
+ # Make sure the vars are correctly initialized |
492 |
+ mysql_init_vars |
493 |
+ |
494 |
+ # Convenience links |
495 |
+ einfo "Making Convenience links for mysqlcheck multi-call binary" |
496 |
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
497 |
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
498 |
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
499 |
+ |
500 |
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
501 |
+ if [[ -d "${ED%/}/usr/data" ]] ; then |
502 |
+ rm -Rf "${ED%/}/usr/data" || die |
503 |
+ fi |
504 |
+ |
505 |
+ # Unless they explicitly specific USE=test, then do not install the |
506 |
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a |
507 |
+ # validation of your database configuration after tuning it. |
508 |
+ if ! use test ; then |
509 |
+ rm -rf "${D%/}/${MY_SHAREDSTATEDIR}/mysql-test" |
510 |
+ fi |
511 |
+ |
512 |
+ # Configuration stuff |
513 |
+ einfo "Building default configuration ..." |
514 |
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
515 |
+ [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf |
516 |
+ local mycnf_src="my.cnf-5.6" |
517 |
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
518 |
+ "${FILESDIR%/}/${mycnf_src}" \ |
519 |
+ > "${TMPDIR%/}/my.cnf.ok" || die |
520 |
+ use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok" |
521 |
+ if use latin1 ; then |
522 |
+ sed -i \ |
523 |
+ -e "/character-set/s|utf8|latin1|g" \ |
524 |
+ "${TMPDIR%/}/my.cnf.ok" || die |
525 |
+ fi |
526 |
+ eprefixify "${TMPDIR%/}/my.cnf.ok" |
527 |
+ newins "${TMPDIR}/my.cnf.ok" my.cnf |
528 |
+ |
529 |
+ if use server ; then |
530 |
+ einfo "Including support files and sample configurations" |
531 |
+ docinto "support-files" |
532 |
+ local script |
533 |
+ for script in \ |
534 |
+ "${S%/}"/support-files/magic |
535 |
+ do |
536 |
+ [[ -f "$script" ]] && dodoc "${script}" |
537 |
+ done |
538 |
+ |
539 |
+ docinto "scripts" |
540 |
+ for script in "${S%/}"/scripts/mysql* ; do |
541 |
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
542 |
+ done |
543 |
+ fi |
544 |
+ |
545 |
+ #Remove mytop if perl is not selected |
546 |
+ [[ -e "${ED%/}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED%/}/usr/bin/mytop" |
547 |
+} |
548 |
+ |
549 |
+# Official test instructions: |
550 |
+# USE='extraengine perl server' \ |
551 |
+# FEATURES='test userpriv -usersandbox' \ |
552 |
+# ebuild mariadb-X.X.XX.ebuild \ |
553 |
+# digest clean package |
554 |
+src_test() { |
555 |
+ |
556 |
+ _disable_test() { |
557 |
+ local rawtestname reason |
558 |
+ rawtestname="${1}" ; shift |
559 |
+ reason="${@}" |
560 |
+ ewarn "test '${rawtestname}' disabled: '${reason}'" |
561 |
+ echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
562 |
+ } |
563 |
+ |
564 |
+ local TESTDIR="${BUILD_DIR}/mysql-test" |
565 |
+ local retstatus_unit |
566 |
+ local retstatus_tests |
567 |
+ |
568 |
+ if ! use server ; then |
569 |
+ einfo "Skipping server tests due to minimal build." |
570 |
+ return 0 |
571 |
+ fi |
572 |
+ |
573 |
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named |
574 |
+ # localhost. Also causes weird failures. |
575 |
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
576 |
+ |
577 |
+ if [[ $UID -eq 0 ]]; then |
578 |
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
579 |
+ fi |
580 |
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
581 |
+ |
582 |
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
583 |
+ |
584 |
+ # Run CTest (test-units) |
585 |
+ cmake-utils_src_test |
586 |
+ retstatus_unit=$? |
587 |
+ |
588 |
+ # Ensure that parallel runs don't die |
589 |
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
590 |
+ # Enable parallel testing, auto will try to detect number of cores |
591 |
+ # You may set this by hand. |
592 |
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
593 |
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
594 |
+ |
595 |
+ # create directories because mysqladmin might run out of order |
596 |
+ mkdir -p "${T}"/var-tests{,/log} || die |
597 |
+ |
598 |
+ # Run mysql tests |
599 |
+ pushd "${TESTDIR}" > /dev/null || die |
600 |
+ |
601 |
+ touch "${T}/disabled.def" |
602 |
+ # These are failing in MariaDB 10.0 for now and are believed to be |
603 |
+ # false positives: |
604 |
+ # |
605 |
+ # main.mysql_client_test, main.mysql_client_test_nonblock |
606 |
+ # main.mysql_client_test_comp: |
607 |
+ # segfaults at random under Portage only, suspect resource limits. |
608 |
+ |
609 |
+ local t |
610 |
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
611 |
+ main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam \ |
612 |
+ rpl.rpl_semi_sync_uninstall_plugin ; do |
613 |
+ _disable_test "$t" "False positives in Gentoo" |
614 |
+ done |
615 |
+ |
616 |
+ if ! use client-libs ; then |
617 |
+ _disable_test main.plugin_auth "Needs client libraries built" |
618 |
+ fi |
619 |
+ |
620 |
+ # run mysql-test tests |
621 |
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
622 |
+ retstatus_tests=$? |
623 |
+ |
624 |
+ popd > /dev/null || die |
625 |
+ |
626 |
+ # Cleanup is important for these testcases. |
627 |
+ pkill -9 -f "${S}/ndb" 2>/dev/null |
628 |
+ pkill -9 -f "${S}/sql" 2>/dev/null |
629 |
+ |
630 |
+ local failures="" |
631 |
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
632 |
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
633 |
+ |
634 |
+ [[ -z "$failures" ]] || die "Test failures: $failures" |
635 |
+ einfo "Tests successfully completed" |
636 |
+} |
637 |
+ |
638 |
+mysql_init_vars() { |
639 |
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
640 |
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
641 |
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
642 |
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
643 |
+ |
644 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
645 |
+ MY_DATADIR="" |
646 |
+ if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
647 |
+ MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
648 |
+ | sed -ne '/datadir/s|^--datadir=||p' \ |
649 |
+ | tail -n1` |
650 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
651 |
+ MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
652 |
+ | sed -e 's/.*=\s*//' \ |
653 |
+ | tail -n1` |
654 |
+ fi |
655 |
+ fi |
656 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
657 |
+ MY_DATADIR="${MY_LOCALSTATEDIR}" |
658 |
+ einfo "Using default MY_DATADIR" |
659 |
+ fi |
660 |
+ elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
661 |
+ |
662 |
+ if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
663 |
+ if [[ -e "${MY_DATADIR}" ]] ; then |
664 |
+ # If you get this and you're wondering about it, see bug #207636 |
665 |
+ elog "MySQL datadir found in ${MY_DATADIR}" |
666 |
+ elog "A new one will not be created." |
667 |
+ PREVIOUS_DATADIR="yes" |
668 |
+ else |
669 |
+ PREVIOUS_DATADIR="no" |
670 |
+ fi |
671 |
+ export PREVIOUS_DATADIR |
672 |
+ fi |
673 |
+ else |
674 |
+ if [[ ${EBUILD_PHASE} == "config" ]]; then |
675 |
+ local new_MY_DATADIR |
676 |
+ new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
677 |
+ | sed -ne '/datadir/s|^--datadir=||p' \ |
678 |
+ | tail -n1` |
679 |
+ |
680 |
+ if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
681 |
+ ewarn "MySQL MY_DATADIR has changed" |
682 |
+ ewarn "from ${MY_DATADIR}" |
683 |
+ ewarn "to ${new_MY_DATADIR}" |
684 |
+ MY_DATADIR="${new_MY_DATADIR}" |
685 |
+ fi |
686 |
+ fi |
687 |
+ fi |
688 |
+ |
689 |
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
690 |
+ export MY_LOCALSTATEDIR MY_LOGDIR |
691 |
+ export MY_DATADIR |
692 |
+} |
693 |
+ |
694 |
+pkg_config() { |
695 |
+ _getoptval() { |
696 |
+ local mypd="${EROOT}"/usr/bin/my_print_defaults |
697 |
+ local section="$1" |
698 |
+ local flag="--${2}=" |
699 |
+ local extra_options="${3}" |
700 |
+ "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
701 |
+ } |
702 |
+ local old_MY_DATADIR="${MY_DATADIR}" |
703 |
+ local old_HOME="${HOME}" |
704 |
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf |
705 |
+ export HOME=${EPREFIX}/root |
706 |
+ |
707 |
+ # Make sure the vars are correctly initialized |
708 |
+ mysql_init_vars |
709 |
+ |
710 |
+ [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
711 |
+ if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
712 |
+ die "Minimal builds do NOT include the MySQL server" |
713 |
+ fi |
714 |
+ |
715 |
+ if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
716 |
+ local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
717 |
+ MY_DATADIR_s="${MY_DATADIR_s%%/}" |
718 |
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
719 |
+ old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
720 |
+ |
721 |
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
722 |
+ if [[ -d "${MY_DATADIR_s}" ]]; then |
723 |
+ ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
724 |
+ ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
725 |
+ else |
726 |
+ elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
727 |
+ mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
728 |
+ || die "Moving MY_DATADIR failed" |
729 |
+ fi |
730 |
+ else |
731 |
+ ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
732 |
+ if [[ -d "${MY_DATADIR_s}" ]]; then |
733 |
+ ewarn "Attempting to use ${MY_DATADIR_s}" |
734 |
+ else |
735 |
+ eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
736 |
+ die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
737 |
+ fi |
738 |
+ fi |
739 |
+ fi |
740 |
+ |
741 |
+ local pwd1="a" |
742 |
+ local pwd2="b" |
743 |
+ local maxtry=15 |
744 |
+ |
745 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
746 |
+ local tmp_mysqld_password_source= |
747 |
+ |
748 |
+ for tmp_mysqld_password_source in mysql client; do |
749 |
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
750 |
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
751 |
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
752 |
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
753 |
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
754 |
+ MYSQL_ROOT_PASSWORD= |
755 |
+ continue |
756 |
+ fi |
757 |
+ |
758 |
+ einfo "Found password in '${tmp_mysqld_password_source}' section!" |
759 |
+ break |
760 |
+ fi |
761 |
+ done |
762 |
+ |
763 |
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
764 |
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
765 |
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
766 |
+ fi |
767 |
+ |
768 |
+ unset tmp_mysqld_password_source |
769 |
+ fi |
770 |
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)" |
771 |
+ # These are dir+prefix |
772 |
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" |
773 |
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
774 |
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" |
775 |
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
776 |
+ |
777 |
+ if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
778 |
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
779 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
780 |
+ fi |
781 |
+ if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
782 |
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
783 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
784 |
+ fi |
785 |
+ if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
786 |
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
787 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
788 |
+ fi |
789 |
+ |
790 |
+ if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
791 |
+ ewarn "You have already a MySQL database in place." |
792 |
+ ewarn "(${ROOT}/${MY_DATADIR}/*)" |
793 |
+ ewarn "Please rename or delete it if you wish to replace it." |
794 |
+ die "MySQL database already exists!" |
795 |
+ fi |
796 |
+ |
797 |
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named |
798 |
+ # localhost. Also causes weird failures. |
799 |
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
800 |
+ |
801 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
802 |
+ |
803 |
+ einfo "Please provide a password for the mysql 'root' user now" |
804 |
+ einfo "or through the ${HOME}/.my.cnf file." |
805 |
+ ewarn "Avoid [\"'\\_%] characters in the password" |
806 |
+ read -rsp " >" pwd1 ; echo |
807 |
+ |
808 |
+ einfo "Retype the password" |
809 |
+ read -rsp " >" pwd2 ; echo |
810 |
+ |
811 |
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then |
812 |
+ die "Passwords are not the same" |
813 |
+ fi |
814 |
+ MYSQL_ROOT_PASSWORD="${pwd1}" |
815 |
+ unset pwd1 pwd2 |
816 |
+ fi |
817 |
+ |
818 |
+ local options |
819 |
+ local sqltmp="$(emktemp)" |
820 |
+ |
821 |
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
822 |
+ # see http://bugs.mysql.com/bug.php?id=31312 |
823 |
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
824 |
+ |
825 |
+ # Figure out which options we need to disable to do the setup |
826 |
+ local helpfile="${TMPDIR}/mysqld-help" |
827 |
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
828 |
+ for opt in grant-tables host-cache name-resolve networking slave-start \ |
829 |
+ federated ssl log-bin relay-log slow-query-log external-locking \ |
830 |
+ log-slave-updates \ |
831 |
+ ; do |
832 |
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
833 |
+ egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
834 |
+ done |
835 |
+ |
836 |
+ einfo "Creating the mysql database and setting proper permissions on it ..." |
837 |
+ |
838 |
+ # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
839 |
+ PID_DIR="${EROOT}/var/run/mysqld" |
840 |
+ if [[ ! -d "${PID_DIR}" ]]; then |
841 |
+ install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
842 |
+ fi |
843 |
+ |
844 |
+ if [[ ! -d "${MY_DATADIR}" ]]; then |
845 |
+ install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
846 |
+ fi |
847 |
+ |
848 |
+ pushd "${TMPDIR}" &>/dev/null || die |
849 |
+ |
850 |
+ # Filling timezones, see |
851 |
+ # http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
852 |
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
853 |
+ |
854 |
+ local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
855 |
+ [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
856 |
+ cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
857 |
+ einfo "Command: ${cmd[*]}" |
858 |
+ su -s /bin/sh -c "${cmd[*]}" mysql \ |
859 |
+ >"${TMPDIR}"/mysql_install_db.log 2>&1 |
860 |
+ if [ $? -ne 0 ]; then |
861 |
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
862 |
+ die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
863 |
+ fi |
864 |
+ popd &>/dev/null || die |
865 |
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
866 |
+ || die "MySQL databases not installed" |
867 |
+ |
868 |
+ use prefix || options="${options} --user=mysql" |
869 |
+ |
870 |
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
871 |
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
872 |
+ local mysqld="${EROOT}/usr/sbin/mysqld \ |
873 |
+ ${options} \ |
874 |
+ --log-warnings=0 \ |
875 |
+ --basedir=${EROOT}/usr \ |
876 |
+ --datadir=${ROOT}/${MY_DATADIR} \ |
877 |
+ --max_allowed_packet=8M \ |
878 |
+ --net_buffer_length=16K \ |
879 |
+ --socket=${socket} \ |
880 |
+ --pid-file=${pidfile} |
881 |
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
882 |
+ #einfo "About to start mysqld: ${mysqld}" |
883 |
+ ebegin "Starting mysqld" |
884 |
+ einfo "Command ${mysqld}" |
885 |
+ ${mysqld} & |
886 |
+ rc=$? |
887 |
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
888 |
+ maxtry=$((${maxtry}-1)) |
889 |
+ echo -n "." |
890 |
+ sleep 1 |
891 |
+ done |
892 |
+ eend $rc |
893 |
+ |
894 |
+ if ! [[ -S "${socket}" ]]; then |
895 |
+ die "Completely failed to start up mysqld with: ${mysqld}" |
896 |
+ fi |
897 |
+ |
898 |
+ ebegin "Setting root password" |
899 |
+ # Do this from memory, as we don't want clear text passwords in temp files |
900 |
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
901 |
+ "${EROOT}/usr/bin/mysql" \ |
902 |
+ "--socket=${socket}" \ |
903 |
+ -hlocalhost \ |
904 |
+ -e "${sql}" |
905 |
+ eend $? |
906 |
+ |
907 |
+ if [[ -n "${sqltmp}" ]] ; then |
908 |
+ ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
909 |
+ "${EROOT}/usr/bin/mysql" \ |
910 |
+ "--socket=${socket}" \ |
911 |
+ -hlocalhost \ |
912 |
+ -uroot \ |
913 |
+ --password="${MYSQL_ROOT_PASSWORD}" \ |
914 |
+ mysql < "${sqltmp}" |
915 |
+ rc=$? |
916 |
+ eend $? |
917 |
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
918 |
+ fi |
919 |
+ |
920 |
+ # Stop the server and cleanup |
921 |
+ einfo "Stopping the server ..." |
922 |
+ kill $(< "${pidfile}" ) |
923 |
+ rm -f "${sqltmp}" |
924 |
+ wait %1 |
925 |
+ einfo "Done" |
926 |
+} |
927 |
|
928 |
diff --git a/dev-db/mariadb/mariadb-10.1.33-r1.ebuild b/dev-db/mariadb/mariadb-10.1.33-r1.ebuild |
929 |
new file mode 100644 |
930 |
index 0000000..73f3563 |
931 |
--- /dev/null |
932 |
+++ b/dev-db/mariadb/mariadb-10.1.33-r1.ebuild |
933 |
@@ -0,0 +1,879 @@ |
934 |
+# Copyright 1999-2018 Gentoo Foundation |
935 |
+# Distributed under the terms of the GNU General Public License v2 |
936 |
+ |
937 |
+EAPI="6" |
938 |
+MY_EXTRAS_VER="20180515-1334Z" |
939 |
+SUBSLOT="18" |
940 |
+ |
941 |
+JAVA_PKG_OPT_USE="jdbc" |
942 |
+ |
943 |
+# Keeping eutils in EAPI=6 for emktemp in pkg_config |
944 |
+ |
945 |
+inherit eutils flag-o-matic prefix toolchain-funcs java-pkg-opt-2 user cmake-utils multilib-build |
946 |
+ |
947 |
+SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
948 |
+ |
949 |
+# Gentoo patches to MySQL |
950 |
+if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
951 |
+ SRC_URI="${SRC_URI} |
952 |
+ mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
953 |
+ https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
954 |
+ https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
955 |
+ https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
956 |
+ https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
957 |
+fi |
958 |
+ |
959 |
+HOMEPAGE="http://mariadb.org/" |
960 |
+DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
961 |
+LICENSE="GPL-2" |
962 |
+SLOT="0/${SUBSLOT:-0}" |
963 |
+IUSE="+backup bindist client-libs cracklib debug extraengine galera jdbc jemalloc kerberos |
964 |
+ innodb-lz4 innodb-lzo innodb-snappy latin1 libressl mroonga numa odbc oqgraph pam |
965 |
+ +perl profiling selinux +server sphinx sst-rsync sst-mariabackup sst-xtrabackup |
966 |
+ systemd systemtap static static-libs tcmalloc test tokudb xml yassl" |
967 |
+ |
968 |
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
969 |
+RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
970 |
+ |
971 |
+REQUIRED_USE="jdbc? ( extraengine server !static ) |
972 |
+ server? ( tokudb? ( jemalloc !tcmalloc ) ) |
973 |
+ ?? ( tcmalloc jemalloc ) |
974 |
+ static? ( yassl !pam )" |
975 |
+ |
976 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
977 |
+ |
978 |
+# Shorten the path because the socket path length must be shorter than 107 chars |
979 |
+# and we will run a mysql server during test phase |
980 |
+S="${WORKDIR}/mysql" |
981 |
+ |
982 |
+if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
983 |
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
984 |
+ inherit git-r3 |
985 |
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git" |
986 |
+ EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
987 |
+ EGIT_CLONE_TYPE=shallow |
988 |
+else |
989 |
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
990 |
+fi |
991 |
+ |
992 |
+PATCHES=( |
993 |
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mariadb-10.1.27.patch |
994 |
+ "${MY_PATCH_DIR}"/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch |
995 |
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
996 |
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.1.16-without-clientlibs-tools.patch |
997 |
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch |
998 |
+ "${MY_PATCH_DIR}"/20029_all_mariadb-10.1.31-enable-numa.patch |
999 |
+ "${MY_PATCH_DIR}"/20035_all_mariadb-10.1-atomic-detection.patch |
1000 |
+) |
1001 |
+ |
1002 |
+# Be warned, *DEPEND are version-dependant |
1003 |
+# These are used for both runtime and compiletime |
1004 |
+COMMON_DEPEND=" |
1005 |
+ kernel_linux? ( |
1006 |
+ sys-process/procps:0= |
1007 |
+ dev-libs/libaio:0= |
1008 |
+ ) |
1009 |
+ >=sys-apps/sed-4 |
1010 |
+ >=sys-apps/texinfo-4.7-r1 |
1011 |
+ jemalloc? ( dev-libs/jemalloc:0= ) |
1012 |
+ tcmalloc? ( dev-util/google-perftools:0= ) |
1013 |
+ systemtap? ( >=dev-util/systemtap-1.3:0= ) |
1014 |
+ !yassl? ( |
1015 |
+ !libressl? ( dev-libs/openssl:0= !>=dev-libs/openssl-1.1 ) |
1016 |
+ libressl? ( dev-libs/libressl:0= ) |
1017 |
+ ) |
1018 |
+ >=sys-libs/zlib-1.2.3:0= |
1019 |
+ sys-libs/ncurses:0= |
1020 |
+ !bindist? ( |
1021 |
+ sys-libs/binutils-libs:0= |
1022 |
+ >=sys-libs/readline-4.1:0= |
1023 |
+ ) |
1024 |
+ server? ( |
1025 |
+ backup? ( app-arch/libarchive:0= ) |
1026 |
+ cracklib? ( sys-libs/cracklib:0= ) |
1027 |
+ extraengine? ( |
1028 |
+ odbc? ( dev-db/unixODBC:0= ) |
1029 |
+ xml? ( dev-libs/libxml2:2= ) |
1030 |
+ sys-libs/zlib[minizip] |
1031 |
+ ) |
1032 |
+ innodb-lz4? ( app-arch/lz4 ) |
1033 |
+ innodb-lzo? ( dev-libs/lzo ) |
1034 |
+ innodb-snappy? ( app-arch/snappy ) |
1035 |
+ kerberos? ( virtual/krb5 ) |
1036 |
+ mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
1037 |
+ numa? ( sys-process/numactl ) |
1038 |
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
1039 |
+ pam? ( virtual/pam:0= ) |
1040 |
+ systemd? ( sys-apps/systemd:= ) |
1041 |
+ tokudb? ( app-arch/snappy ) |
1042 |
+ ) |
1043 |
+ !yassl? ( !libressl? ( !>=dev-libs/openssl-1.1.0 ) ) |
1044 |
+ >=dev-libs/libpcre-8.41-r1:3= |
1045 |
+" |
1046 |
+DEPEND="virtual/yacc |
1047 |
+ static? ( sys-libs/ncurses[static-libs] ) |
1048 |
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
1049 |
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
1050 |
+ ${COMMON_DEPEND}" |
1051 |
+RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
1052 |
+ client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) |
1053 |
+ !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
1054 |
+ server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
1055 |
+ ${COMMON_DEPEND} |
1056 |
+ server? ( galera? ( |
1057 |
+ sys-apps/iproute2 |
1058 |
+ =sys-cluster/galera-25* |
1059 |
+ sst-rsync? ( sys-process/lsof ) |
1060 |
+ sst-mariabackup? ( net-misc/socat[ssl] ) |
1061 |
+ sst-xtrabackup? ( net-misc/socat[ssl] ) |
1062 |
+ ) ) |
1063 |
+ perl? ( !dev-db/mytop |
1064 |
+ virtual/perl-Getopt-Long |
1065 |
+ dev-perl/TermReadKey |
1066 |
+ virtual/perl-Term-ANSIColor |
1067 |
+ virtual/perl-Time-HiRes ) |
1068 |
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
1069 |
+" |
1070 |
+# For other stuff to bring us in |
1071 |
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
1072 |
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
1073 |
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
1074 |
+ !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) |
1075 |
+ server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
1076 |
+ |
1077 |
+pkg_setup() { |
1078 |
+ if [[ ${MERGE_TYPE} != binary ]] ; then |
1079 |
+ local GCC_MAJOR_SET=$(gcc-major-version) |
1080 |
+ local GCC_MINOR_SET=$(gcc-minor-version) |
1081 |
+ if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1082 |
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1083 |
+ eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
1084 |
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1085 |
+ die |
1086 |
+ fi |
1087 |
+ # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
1088 |
+ # non x86{,_64} arches |
1089 |
+ if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1090 |
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1091 |
+ eerror "${PN} needs to be built with gcc-4.7 or later." |
1092 |
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1093 |
+ die |
1094 |
+ fi |
1095 |
+ fi |
1096 |
+ java-pkg-opt-2_pkg_setup |
1097 |
+ if has test ${FEATURES} && \ |
1098 |
+ use server && ! has userpriv ${FEATURES} ; then |
1099 |
+ eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
1100 |
+ fi |
1101 |
+ |
1102 |
+ # This should come after all of the die statements |
1103 |
+ enewgroup mysql 60 || die "problem adding 'mysql' group" |
1104 |
+ enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
1105 |
+} |
1106 |
+ |
1107 |
+pkg_preinst() { |
1108 |
+ java-pkg-opt-2_pkg_preinst |
1109 |
+} |
1110 |
+ |
1111 |
+pkg_postinst() { |
1112 |
+ # Make sure the vars are correctly initialized |
1113 |
+ mysql_init_vars |
1114 |
+ |
1115 |
+ # Create log directory securely if it does not exist |
1116 |
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
1117 |
+ |
1118 |
+ if use server ; then |
1119 |
+ if use pam; then |
1120 |
+ einfo |
1121 |
+ elog "This install includes the PAM authentication plugin." |
1122 |
+ elog "To activate and configure the PAM plugin, please read:" |
1123 |
+ elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
1124 |
+ einfo |
1125 |
+ fi |
1126 |
+ |
1127 |
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
1128 |
+ einfo |
1129 |
+ elog "You might want to run:" |
1130 |
+ elog "\"emerge --config =${CATEGORY}/${PF}\"" |
1131 |
+ elog "if this is a new install." |
1132 |
+ elog |
1133 |
+ elog "If you are switching server implentations, you should run the" |
1134 |
+ elog "mysql_upgrade tool." |
1135 |
+ einfo |
1136 |
+ else |
1137 |
+ einfo |
1138 |
+ elog "If you are upgrading major versions, you should run the" |
1139 |
+ elog "mysql_upgrade tool." |
1140 |
+ einfo |
1141 |
+ fi |
1142 |
+ |
1143 |
+ einfo |
1144 |
+ elog "Be sure to edit the my.cnf file to activate your cluster settings." |
1145 |
+ elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
1146 |
+ elog "The first time the cluster is activated, you should add" |
1147 |
+ elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
1148 |
+ elog "This option should then be removed for subsequent starts." |
1149 |
+ einfo |
1150 |
+ fi |
1151 |
+} |
1152 |
+ |
1153 |
+src_unpack() { |
1154 |
+ unpack ${A} |
1155 |
+ # Grab the patches |
1156 |
+ [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack |
1157 |
+ |
1158 |
+ mv -f "${WORKDIR%/}/${PN%%-galera}-${PV}" "${S}" || die |
1159 |
+} |
1160 |
+ |
1161 |
+src_prepare() { |
1162 |
+ _disable_engine() { |
1163 |
+ echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
1164 |
+ } |
1165 |
+ |
1166 |
+ _disable_plugin() { |
1167 |
+ echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
1168 |
+ } |
1169 |
+ |
1170 |
+ java-pkg-opt-2_src_prepare |
1171 |
+ if use tcmalloc; then |
1172 |
+ echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die |
1173 |
+ fi |
1174 |
+ |
1175 |
+ # Don't build bundled xz-utils for tokudb |
1176 |
+ echo > "${S%/}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
1177 |
+ sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S%/}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
1178 |
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S%/}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
1179 |
+ |
1180 |
+ local plugin |
1181 |
+ local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
1182 |
+ locale_info qc_info server_audit semisync sql_errlog ) |
1183 |
+ local test_plugins=( audit_null auth_examples daemon_example fulltext ) |
1184 |
+ if ! use server; then # These plugins are for the server |
1185 |
+ for plugin in "${server_plugins[@]}" ; do |
1186 |
+ _disable_plugin "${plugin}" |
1187 |
+ done |
1188 |
+ fi |
1189 |
+ |
1190 |
+ if ! use test; then # These plugins are only used during testing |
1191 |
+ for plugin in "${test_plugins[@]}" ; do |
1192 |
+ _disable_plugin "${plugin}" |
1193 |
+ done |
1194 |
+ fi |
1195 |
+ |
1196 |
+ # Collides with mariadb-connector-c bug 655980 |
1197 |
+ _disable_plugin auth_dialog |
1198 |
+ |
1199 |
+ # Avoid useless library checks |
1200 |
+ use mroonga || _disable_engine mroonga |
1201 |
+ use oqgraph || _disable_engine oqgraph |
1202 |
+ _disable_engine example |
1203 |
+ |
1204 |
+ cmake-utils_src_prepare |
1205 |
+} |
1206 |
+ |
1207 |
+src_configure(){ |
1208 |
+ # bug 508724 mariadb cannot use ld.gold |
1209 |
+ tc-ld-disable-gold |
1210 |
+ # Bug #114895, bug #110149 |
1211 |
+ filter-flags "-O" "-O[01]" |
1212 |
+ |
1213 |
+ append-cxxflags -felide-constructors |
1214 |
+ |
1215 |
+ # bug #283926, with GCC4.4, this is required to get correct behavior. |
1216 |
+ append-flags -fno-strict-aliasing |
1217 |
+ |
1218 |
+ CMAKE_BUILD_TYPE="RelWithDebInfo" |
1219 |
+ |
1220 |
+ # debug hack wrt #497532 |
1221 |
+ mycmakeargs=( |
1222 |
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
1223 |
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
1224 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr" |
1225 |
+ -DINSTALL_SYSCONFDIR="${EPREFIX%/}/etc/mysql" |
1226 |
+ -DINSTALL_BINDIR=bin |
1227 |
+ -DINSTALL_DOCDIR=share/doc/${PF} |
1228 |
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
1229 |
+ -DINSTALL_INCLUDEDIR=include/mysql |
1230 |
+ -DINSTALL_INFODIR=share/info |
1231 |
+ -DINSTALL_LIBDIR=$(get_libdir) |
1232 |
+ -DINSTALL_MANDIR=share/man |
1233 |
+ -DINSTALL_MYSQLSHAREDIR=share/mariadb |
1234 |
+ -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mariadb/mysql-test' '') |
1235 |
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
1236 |
+ -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
1237 |
+ -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql" |
1238 |
+ -DINSTALL_SBINDIR=sbin |
1239 |
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mariadb" |
1240 |
+ -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" |
1241 |
+ -DWITH_UNIT_TESTS=$(usex test ON OFF) |
1242 |
+ -DWITH_ZLIB=system |
1243 |
+ -DENABLED_LOCAL_INFILE=1 |
1244 |
+ -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
1245 |
+ -DINSTALL_UNIX_ADDRDIR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
1246 |
+ -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
1247 |
+ -DWITH_DEFAULT_FEATURE_SET=0 |
1248 |
+ -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
1249 |
+ # The build forces this to be defined when cross-compiling. We pass it |
1250 |
+ # all the time for simplicity and to make sure it is actually correct. |
1251 |
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
1252 |
+ -DWITHOUT_CLIENTLIBS=YES |
1253 |
+ -DWITH_READLINE=$(usex bindist 1 0) |
1254 |
+ -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
1255 |
+ -DENABLE_DTRACE=$(usex systemtap) |
1256 |
+ -DWITH_SSL=$(usex yassl bundled system) |
1257 |
+ ) |
1258 |
+ |
1259 |
+ if use server ; then |
1260 |
+ |
1261 |
+ # Federated{,X} must be treated special otherwise they will not be built as plugins |
1262 |
+ if ! use extraengine ; then |
1263 |
+ mycmakeargs+=( |
1264 |
+ -DPLUGIN_FEDERATED=NO |
1265 |
+ -DPLUGIN_FEDERATEDX=NO ) |
1266 |
+ fi |
1267 |
+ |
1268 |
+ mycmakeargs+=( |
1269 |
+ -DWITH_JEMALLOC=$(usex jemalloc system) |
1270 |
+ -DWITH_PCRE=system |
1271 |
+ -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
1272 |
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
1273 |
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
1274 |
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
1275 |
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
1276 |
+ -DPLUGIN_CASSANDRA=NO |
1277 |
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
1278 |
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
1279 |
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
1280 |
+ -DCONNECT_WITH_MYSQL=1 |
1281 |
+ -DCONNECT_WITH_LIBXML2=$(usex xml) |
1282 |
+ -DCONNECT_WITH_ODBC=$(usex odbc) |
1283 |
+ -DCONNECT_WITH_JDBC=$(usex jdbc) |
1284 |
+ # Build failure and autodep wrt bug 639144 |
1285 |
+ -DCONNECT_WITH_MONGO=OFF |
1286 |
+ -DWITH_WSREP=$(usex galera) |
1287 |
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
1288 |
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
1289 |
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
1290 |
+ -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
1291 |
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
1292 |
+ -DWITH_MARIABACKUP=$(usex backup ON OFF) |
1293 |
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
1294 |
+ -DWITH_SYSTEMD=$(usex systemd YES NO) |
1295 |
+ -DWITH_NUMA=$(usex numa ON OFF) |
1296 |
+ -DINSTALL_SQLBENCHDIR='' |
1297 |
+ ) |
1298 |
+ |
1299 |
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
1300 |
+ ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
1301 |
+ ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
1302 |
+ ewarn "You MUST file bugs without these variables set." |
1303 |
+ |
1304 |
+ mycmakeargs+=( |
1305 |
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
1306 |
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
1307 |
+ ) |
1308 |
+ |
1309 |
+ elif ! use latin1 ; then |
1310 |
+ mycmakeargs+=( |
1311 |
+ -DDEFAULT_CHARSET=utf8 |
1312 |
+ -DDEFAULT_COLLATION=utf8_general_ci |
1313 |
+ ) |
1314 |
+ else |
1315 |
+ mycmakeargs+=( |
1316 |
+ -DDEFAULT_CHARSET=latin1 |
1317 |
+ -DDEFAULT_COLLATION=latin1_swedish_ci |
1318 |
+ ) |
1319 |
+ fi |
1320 |
+ mycmakeargs+=( |
1321 |
+ -DEXTRA_CHARSETS=all |
1322 |
+ -DMYSQL_USER=mysql |
1323 |
+ -DDISABLE_SHARED=$(usex static YES NO) |
1324 |
+ -DWITH_DEBUG=$(usex debug) |
1325 |
+ -DWITH_EMBEDDED_SERVER=OFF |
1326 |
+ -DENABLED_PROFILING=$(usex profiling) |
1327 |
+ ) |
1328 |
+ |
1329 |
+ if use static; then |
1330 |
+ mycmakeargs+=( -DWITH_PIC=1 ) |
1331 |
+ fi |
1332 |
+ |
1333 |
+ if use jemalloc || use tcmalloc ; then |
1334 |
+ mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
1335 |
+ fi |
1336 |
+ |
1337 |
+ # Storage engines |
1338 |
+ mycmakeargs+=( |
1339 |
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
1340 |
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
1341 |
+ -DWITH_CSV_STORAGE_ENGINE=1 |
1342 |
+ -DWITH_HEAP_STORAGE_ENGINE=1 |
1343 |
+ -DWITH_INNOBASE_STORAGE_ENGINE=1 |
1344 |
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
1345 |
+ -DWITH_MYISAM_STORAGE_ENGINE=1 |
1346 |
+ -DWITH_PARTITION_STORAGE_ENGINE=1 |
1347 |
+ ) |
1348 |
+ |
1349 |
+ else |
1350 |
+ mycmakeargs+=( |
1351 |
+ -DWITHOUT_SERVER=1 |
1352 |
+ -DWITH_EMBEDDED_SERVER=OFF |
1353 |
+ -DEXTRA_CHARSETS=none |
1354 |
+ -DINSTALL_SQLBENCHDIR= |
1355 |
+ -DWITH_SYSTEMD=NO |
1356 |
+ ) |
1357 |
+ fi |
1358 |
+ |
1359 |
+ cmake-utils_src_configure |
1360 |
+} |
1361 |
+ |
1362 |
+src_compile() { |
1363 |
+ cmake-utils_src_compile |
1364 |
+} |
1365 |
+ |
1366 |
+src_install() { |
1367 |
+ cmake-utils_src_install |
1368 |
+ |
1369 |
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
1370 |
+ if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
1371 |
+ rm "${ED}/usr/include/mysql/server/private/config.h" || die |
1372 |
+ fi |
1373 |
+ |
1374 |
+ # Make sure the vars are correctly initialized |
1375 |
+ mysql_init_vars |
1376 |
+ |
1377 |
+ # Convenience links |
1378 |
+ einfo "Making Convenience links for mysqlcheck multi-call binary" |
1379 |
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
1380 |
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
1381 |
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
1382 |
+ |
1383 |
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
1384 |
+ if [[ -d "${ED}/usr/data" ]] ; then |
1385 |
+ rm -Rf "${ED}/usr/data" || die |
1386 |
+ fi |
1387 |
+ |
1388 |
+ # Unless they explicitly specific USE=test, then do not install the |
1389 |
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a |
1390 |
+ # validation of your database configuration after tuning it. |
1391 |
+ if ! use test ; then |
1392 |
+ rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
1393 |
+ fi |
1394 |
+ |
1395 |
+ # Configuration stuff |
1396 |
+ einfo "Building default configuration ..." |
1397 |
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
1398 |
+ [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
1399 |
+ local mycnf_src="my.cnf-5.6" |
1400 |
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
1401 |
+ "${FILESDIR}/${mycnf_src}" \ |
1402 |
+ > "${TMPDIR}/my.cnf.ok" || die |
1403 |
+ use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok" |
1404 |
+ if use latin1 ; then |
1405 |
+ sed -i \ |
1406 |
+ -e "/character-set/s|utf8|latin1|g" \ |
1407 |
+ "${TMPDIR}/my.cnf.ok" || die |
1408 |
+ fi |
1409 |
+ eprefixify "${TMPDIR}/my.cnf.ok" |
1410 |
+ newins "${TMPDIR}/my.cnf.ok" my.cnf |
1411 |
+ |
1412 |
+ if use server ; then |
1413 |
+ einfo "Including support files and sample configurations" |
1414 |
+ docinto "support-files" |
1415 |
+ local script |
1416 |
+ for script in \ |
1417 |
+ "${S}"/support-files/magic |
1418 |
+ do |
1419 |
+ [[ -f "$script" ]] && dodoc "${script}" |
1420 |
+ done |
1421 |
+ |
1422 |
+ docinto "scripts" |
1423 |
+ for script in "${S}"/scripts/mysql* ; do |
1424 |
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
1425 |
+ done |
1426 |
+ fi |
1427 |
+ |
1428 |
+ #Remove mytop if perl is not selected |
1429 |
+ [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
1430 |
+} |
1431 |
+ |
1432 |
+# Official test instructions: |
1433 |
+# USE='extraengine perl server static-libs' \ |
1434 |
+# FEATURES='test userpriv -usersandbox' \ |
1435 |
+# ebuild mariadb-X.X.XX.ebuild \ |
1436 |
+# digest clean package |
1437 |
+src_test() { |
1438 |
+ |
1439 |
+ _disable_test() { |
1440 |
+ local rawtestname reason |
1441 |
+ rawtestname="${1}" ; shift |
1442 |
+ reason="${@}" |
1443 |
+ ewarn "test '${rawtestname}' disabled: '${reason}'" |
1444 |
+ echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
1445 |
+ } |
1446 |
+ |
1447 |
+ local TESTDIR="${BUILD_DIR}/mysql-test" |
1448 |
+ local retstatus_unit |
1449 |
+ local retstatus_tests |
1450 |
+ |
1451 |
+ if ! use server ; then |
1452 |
+ einfo "Skipping server tests due to minimal build." |
1453 |
+ return 0 |
1454 |
+ fi |
1455 |
+ |
1456 |
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named |
1457 |
+ # localhost. Also causes weird failures. |
1458 |
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
1459 |
+ |
1460 |
+ if [[ $UID -eq 0 ]]; then |
1461 |
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
1462 |
+ fi |
1463 |
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
1464 |
+ |
1465 |
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1466 |
+ |
1467 |
+ # Run CTest (test-units) |
1468 |
+ cmake-utils_src_test |
1469 |
+ retstatus_unit=$? |
1470 |
+ |
1471 |
+ # Ensure that parallel runs don't die |
1472 |
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
1473 |
+ # Enable parallel testing, auto will try to detect number of cores |
1474 |
+ # You may set this by hand. |
1475 |
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
1476 |
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
1477 |
+ |
1478 |
+ # create directories because mysqladmin might run out of order |
1479 |
+ mkdir -p "${T}"/var-tests{,/log} || die |
1480 |
+ |
1481 |
+ # Run mysql tests |
1482 |
+ pushd "${TESTDIR}" > /dev/null || die |
1483 |
+ |
1484 |
+ touch "${T}/disabled.def" |
1485 |
+ # These are failing in MariaDB 10.0 for now and are believed to be |
1486 |
+ # false positives: |
1487 |
+ # |
1488 |
+ # main.mysql_client_test, main.mysql_client_test_nonblock |
1489 |
+ # main.mysql_client_test_comp: |
1490 |
+ # segfaults at random under Portage only, suspect resource limits. |
1491 |
+ |
1492 |
+ local t |
1493 |
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
1494 |
+ _disable_test "$t" "False positive due to varying policies" |
1495 |
+ done |
1496 |
+ |
1497 |
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
1498 |
+ main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
1499 |
+ _disable_test "$t" "False positives in Gentoo" |
1500 |
+ done |
1501 |
+ |
1502 |
+ if ! use client-libs ; then |
1503 |
+ _disable_test main.plugin_auth "Needs client libraries built" |
1504 |
+ fi |
1505 |
+ |
1506 |
+ # run mysql-test tests |
1507 |
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
1508 |
+ retstatus_tests=$? |
1509 |
+ |
1510 |
+ popd > /dev/null || die |
1511 |
+ |
1512 |
+ # Cleanup is important for these testcases. |
1513 |
+ pkill -9 -f "${S}/ndb" 2>/dev/null |
1514 |
+ pkill -9 -f "${S}/sql" 2>/dev/null |
1515 |
+ |
1516 |
+ local failures="" |
1517 |
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
1518 |
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
1519 |
+ |
1520 |
+ [[ -z "$failures" ]] || die "Test failures: $failures" |
1521 |
+ einfo "Tests successfully completed" |
1522 |
+} |
1523 |
+ |
1524 |
+mysql_init_vars() { |
1525 |
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
1526 |
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
1527 |
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
1528 |
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
1529 |
+ |
1530 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
1531 |
+ MY_DATADIR="" |
1532 |
+ if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
1533 |
+ MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
1534 |
+ | sed -ne '/datadir/s|^--datadir=||p' \ |
1535 |
+ | tail -n1` |
1536 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
1537 |
+ MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
1538 |
+ | sed -e 's/.*=\s*//' \ |
1539 |
+ | tail -n1` |
1540 |
+ fi |
1541 |
+ fi |
1542 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
1543 |
+ MY_DATADIR="${MY_LOCALSTATEDIR}" |
1544 |
+ einfo "Using default MY_DATADIR" |
1545 |
+ fi |
1546 |
+ elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
1547 |
+ |
1548 |
+ if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
1549 |
+ if [[ -e "${MY_DATADIR}" ]] ; then |
1550 |
+ # If you get this and you're wondering about it, see bug #207636 |
1551 |
+ elog "MySQL datadir found in ${MY_DATADIR}" |
1552 |
+ elog "A new one will not be created." |
1553 |
+ PREVIOUS_DATADIR="yes" |
1554 |
+ else |
1555 |
+ PREVIOUS_DATADIR="no" |
1556 |
+ fi |
1557 |
+ export PREVIOUS_DATADIR |
1558 |
+ fi |
1559 |
+ else |
1560 |
+ if [[ ${EBUILD_PHASE} == "config" ]]; then |
1561 |
+ local new_MY_DATADIR |
1562 |
+ new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
1563 |
+ | sed -ne '/datadir/s|^--datadir=||p' \ |
1564 |
+ | tail -n1` |
1565 |
+ |
1566 |
+ if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
1567 |
+ ewarn "MySQL MY_DATADIR has changed" |
1568 |
+ ewarn "from ${MY_DATADIR}" |
1569 |
+ ewarn "to ${new_MY_DATADIR}" |
1570 |
+ MY_DATADIR="${new_MY_DATADIR}" |
1571 |
+ fi |
1572 |
+ fi |
1573 |
+ fi |
1574 |
+ |
1575 |
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
1576 |
+ export MY_LOCALSTATEDIR MY_LOGDIR |
1577 |
+ export MY_DATADIR |
1578 |
+} |
1579 |
+ |
1580 |
+pkg_config() { |
1581 |
+ _getoptval() { |
1582 |
+ local mypd="${EROOT}"/usr/bin/my_print_defaults |
1583 |
+ local section="$1" |
1584 |
+ local flag="--${2}=" |
1585 |
+ local extra_options="${3}" |
1586 |
+ "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
1587 |
+ } |
1588 |
+ local old_MY_DATADIR="${MY_DATADIR}" |
1589 |
+ local old_HOME="${HOME}" |
1590 |
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf |
1591 |
+ export HOME=${EPREFIX}/root |
1592 |
+ |
1593 |
+ # Make sure the vars are correctly initialized |
1594 |
+ mysql_init_vars |
1595 |
+ |
1596 |
+ [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
1597 |
+ if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
1598 |
+ die "Minimal builds do NOT include the MySQL server" |
1599 |
+ fi |
1600 |
+ |
1601 |
+ if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
1602 |
+ local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
1603 |
+ MY_DATADIR_s="${MY_DATADIR_s%%/}" |
1604 |
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
1605 |
+ old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
1606 |
+ |
1607 |
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
1608 |
+ if [[ -d "${MY_DATADIR_s}" ]]; then |
1609 |
+ ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
1610 |
+ ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
1611 |
+ else |
1612 |
+ elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
1613 |
+ mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
1614 |
+ || die "Moving MY_DATADIR failed" |
1615 |
+ fi |
1616 |
+ else |
1617 |
+ ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
1618 |
+ if [[ -d "${MY_DATADIR_s}" ]]; then |
1619 |
+ ewarn "Attempting to use ${MY_DATADIR_s}" |
1620 |
+ else |
1621 |
+ eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
1622 |
+ die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
1623 |
+ fi |
1624 |
+ fi |
1625 |
+ fi |
1626 |
+ |
1627 |
+ local pwd1="a" |
1628 |
+ local pwd2="b" |
1629 |
+ local maxtry=15 |
1630 |
+ |
1631 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
1632 |
+ local tmp_mysqld_password_source= |
1633 |
+ |
1634 |
+ for tmp_mysqld_password_source in mysql client; do |
1635 |
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
1636 |
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
1637 |
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
1638 |
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
1639 |
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
1640 |
+ MYSQL_ROOT_PASSWORD= |
1641 |
+ continue |
1642 |
+ fi |
1643 |
+ |
1644 |
+ einfo "Found password in '${tmp_mysqld_password_source}' section!" |
1645 |
+ break |
1646 |
+ fi |
1647 |
+ done |
1648 |
+ |
1649 |
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
1650 |
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
1651 |
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
1652 |
+ fi |
1653 |
+ |
1654 |
+ unset tmp_mysqld_password_source |
1655 |
+ fi |
1656 |
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)" |
1657 |
+ # These are dir+prefix |
1658 |
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" |
1659 |
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
1660 |
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" |
1661 |
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
1662 |
+ |
1663 |
+ if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
1664 |
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
1665 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
1666 |
+ fi |
1667 |
+ if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
1668 |
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
1669 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
1670 |
+ fi |
1671 |
+ if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
1672 |
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
1673 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
1674 |
+ fi |
1675 |
+ |
1676 |
+ if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
1677 |
+ ewarn "You have already a MySQL database in place." |
1678 |
+ ewarn "(${ROOT}/${MY_DATADIR}/*)" |
1679 |
+ ewarn "Please rename or delete it if you wish to replace it." |
1680 |
+ die "MySQL database already exists!" |
1681 |
+ fi |
1682 |
+ |
1683 |
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named |
1684 |
+ # localhost. Also causes weird failures. |
1685 |
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
1686 |
+ |
1687 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
1688 |
+ |
1689 |
+ einfo "Please provide a password for the mysql 'root' user now" |
1690 |
+ einfo "or through the ${HOME}/.my.cnf file." |
1691 |
+ ewarn "Avoid [\"'\\_%] characters in the password" |
1692 |
+ read -rsp " >" pwd1 ; echo |
1693 |
+ |
1694 |
+ einfo "Retype the password" |
1695 |
+ read -rsp " >" pwd2 ; echo |
1696 |
+ |
1697 |
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then |
1698 |
+ die "Passwords are not the same" |
1699 |
+ fi |
1700 |
+ MYSQL_ROOT_PASSWORD="${pwd1}" |
1701 |
+ unset pwd1 pwd2 |
1702 |
+ fi |
1703 |
+ |
1704 |
+ local options |
1705 |
+ local sqltmp="$(emktemp)" |
1706 |
+ |
1707 |
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
1708 |
+ # see http://bugs.mysql.com/bug.php?id=31312 |
1709 |
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
1710 |
+ |
1711 |
+ # Figure out which options we need to disable to do the setup |
1712 |
+ local helpfile="${TMPDIR}/mysqld-help" |
1713 |
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
1714 |
+ for opt in grant-tables host-cache name-resolve networking slave-start \ |
1715 |
+ federated ssl log-bin relay-log slow-query-log external-locking \ |
1716 |
+ log-slave-updates \ |
1717 |
+ ; do |
1718 |
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
1719 |
+ egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
1720 |
+ done |
1721 |
+ |
1722 |
+ einfo "Creating the mysql database and setting proper permissions on it ..." |
1723 |
+ |
1724 |
+ # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
1725 |
+ PID_DIR="${EROOT}/var/run/mysqld" |
1726 |
+ if [[ ! -d "${PID_DIR}" ]]; then |
1727 |
+ install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
1728 |
+ fi |
1729 |
+ |
1730 |
+ if [[ ! -d "${MY_DATADIR}" ]]; then |
1731 |
+ install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
1732 |
+ fi |
1733 |
+ |
1734 |
+ pushd "${TMPDIR}" &>/dev/null || die |
1735 |
+ |
1736 |
+ # Filling timezones, see |
1737 |
+ # http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
1738 |
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
1739 |
+ |
1740 |
+ local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
1741 |
+ [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
1742 |
+ cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
1743 |
+ einfo "Command: ${cmd[*]}" |
1744 |
+ su -s /bin/sh -c "${cmd[*]}" mysql \ |
1745 |
+ >"${TMPDIR}"/mysql_install_db.log 2>&1 |
1746 |
+ if [ $? -ne 0 ]; then |
1747 |
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
1748 |
+ die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
1749 |
+ fi |
1750 |
+ popd &>/dev/null || die |
1751 |
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
1752 |
+ || die "MySQL databases not installed" |
1753 |
+ |
1754 |
+ use prefix || options="${options} --user=mysql" |
1755 |
+ |
1756 |
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
1757 |
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
1758 |
+ local mysqld="${EROOT}/usr/sbin/mysqld \ |
1759 |
+ ${options} \ |
1760 |
+ --log-warnings=0 \ |
1761 |
+ --basedir=${EROOT}/usr \ |
1762 |
+ --datadir=${ROOT}/${MY_DATADIR} \ |
1763 |
+ --max_allowed_packet=8M \ |
1764 |
+ --net_buffer_length=16K \ |
1765 |
+ --socket=${socket} \ |
1766 |
+ --pid-file=${pidfile} |
1767 |
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
1768 |
+ #einfo "About to start mysqld: ${mysqld}" |
1769 |
+ ebegin "Starting mysqld" |
1770 |
+ einfo "Command ${mysqld}" |
1771 |
+ ${mysqld} & |
1772 |
+ rc=$? |
1773 |
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
1774 |
+ maxtry=$((${maxtry}-1)) |
1775 |
+ echo -n "." |
1776 |
+ sleep 1 |
1777 |
+ done |
1778 |
+ eend $rc |
1779 |
+ |
1780 |
+ if ! [[ -S "${socket}" ]]; then |
1781 |
+ die "Completely failed to start up mysqld with: ${mysqld}" |
1782 |
+ fi |
1783 |
+ |
1784 |
+ ebegin "Setting root password" |
1785 |
+ # Do this from memory, as we don't want clear text passwords in temp files |
1786 |
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
1787 |
+ "${EROOT}/usr/bin/mysql" \ |
1788 |
+ "--socket=${socket}" \ |
1789 |
+ -hlocalhost \ |
1790 |
+ -e "${sql}" |
1791 |
+ eend $? |
1792 |
+ |
1793 |
+ if [[ -n "${sqltmp}" ]] ; then |
1794 |
+ ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
1795 |
+ "${EROOT}/usr/bin/mysql" \ |
1796 |
+ "--socket=${socket}" \ |
1797 |
+ -hlocalhost \ |
1798 |
+ -uroot \ |
1799 |
+ --password="${MYSQL_ROOT_PASSWORD}" \ |
1800 |
+ mysql < "${sqltmp}" |
1801 |
+ rc=$? |
1802 |
+ eend $? |
1803 |
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
1804 |
+ fi |
1805 |
+ |
1806 |
+ # Stop the server and cleanup |
1807 |
+ einfo "Stopping the server ..." |
1808 |
+ kill $(< "${pidfile}" ) |
1809 |
+ rm -f "${sqltmp}" |
1810 |
+ wait %1 |
1811 |
+ einfo "Done" |
1812 |
+} |
1813 |
|
1814 |
diff --git a/dev-db/mariadb/mariadb-10.2.15-r1.ebuild b/dev-db/mariadb/mariadb-10.2.15-r1.ebuild |
1815 |
new file mode 100644 |
1816 |
index 0000000..57c64fa |
1817 |
--- /dev/null |
1818 |
+++ b/dev-db/mariadb/mariadb-10.2.15-r1.ebuild |
1819 |
@@ -0,0 +1,919 @@ |
1820 |
+# Copyright 1999-2018 Gentoo Foundation |
1821 |
+# Distributed under the terms of the GNU General Public License v2 |
1822 |
+ |
1823 |
+EAPI="6" |
1824 |
+MY_EXTRAS_VER="20180515-1334Z" |
1825 |
+SUBSLOT="18" |
1826 |
+ |
1827 |
+JAVA_PKG_OPT_USE="jdbc" |
1828 |
+ |
1829 |
+# Keeping eutils in EAPI=6 for emktemp in pkg_config |
1830 |
+ |
1831 |
+inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
1832 |
+ java-pkg-opt-2 user cmake-utils multilib-build |
1833 |
+ |
1834 |
+SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
1835 |
+ |
1836 |
+# Gentoo patches to MySQL |
1837 |
+if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
1838 |
+ SRC_URI="${SRC_URI} |
1839 |
+ mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1840 |
+ https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1841 |
+ https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1842 |
+ https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1843 |
+ https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
1844 |
+fi |
1845 |
+ |
1846 |
+HOMEPAGE="http://mariadb.org/" |
1847 |
+DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
1848 |
+LICENSE="GPL-2 LGPL-2.1+" |
1849 |
+SLOT="0/${SUBSLOT:-0}" |
1850 |
+IUSE="+backup bindist client-libs cracklib debug extraengine galera innodb-lz4 |
1851 |
+ innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
1852 |
+ numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
1853 |
+ sst-rsync sst-mariabackup sst-xtrabackup static static-libs systemd systemtap tcmalloc |
1854 |
+ test tokudb xml yassl" |
1855 |
+ |
1856 |
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
1857 |
+RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
1858 |
+ |
1859 |
+REQUIRED_USE="jdbc? ( extraengine server !static ) |
1860 |
+ server? ( tokudb? ( jemalloc !tcmalloc ) ) |
1861 |
+ !server? ( !extraengine ) |
1862 |
+ ?? ( tcmalloc jemalloc ) |
1863 |
+ static? ( yassl !pam )" |
1864 |
+ |
1865 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
1866 |
+ |
1867 |
+# Shorten the path because the socket path length must be shorter than 107 chars |
1868 |
+# and we will run a mysql server during test phase |
1869 |
+S="${WORKDIR}/mysql" |
1870 |
+ |
1871 |
+if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
1872 |
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
1873 |
+ inherit git-r3 |
1874 |
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git" |
1875 |
+ EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
1876 |
+ EGIT_CLONE_TYPE=shallow |
1877 |
+else |
1878 |
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
1879 |
+fi |
1880 |
+ |
1881 |
+PATCHES=( |
1882 |
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
1883 |
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.9-without-clientlibs-tools.patch |
1884 |
+ "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
1885 |
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
1886 |
+ "${MY_PATCH_DIR}"/20035_all_mariadb-10.2-atomic-detection.patch |
1887 |
+) |
1888 |
+ |
1889 |
+# Be warned, *DEPEND are version-dependant |
1890 |
+# These are used for both runtime and compiletime |
1891 |
+# MULTILIB_USEDEP only set for libraries used by the client library |
1892 |
+COMMON_DEPEND=" |
1893 |
+ kernel_linux? ( |
1894 |
+ sys-process/procps:0= |
1895 |
+ dev-libs/libaio:0= |
1896 |
+ ) |
1897 |
+ >=sys-apps/sed-4 |
1898 |
+ >=sys-apps/texinfo-4.7-r1 |
1899 |
+ jemalloc? ( dev-libs/jemalloc:0= ) |
1900 |
+ tcmalloc? ( dev-util/google-perftools:0= ) |
1901 |
+ systemtap? ( >=dev-util/systemtap-1.3:0= ) |
1902 |
+ >=sys-libs/zlib-1.2.3:0= |
1903 |
+ kerberos? ( virtual/krb5 ) |
1904 |
+ yassl? ( net-libs/gnutls:0= ) |
1905 |
+ !yassl? ( |
1906 |
+ !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
1907 |
+ libressl? ( dev-libs/libressl:0= ) |
1908 |
+ ) |
1909 |
+ sys-libs/ncurses:0= |
1910 |
+ !bindist? ( |
1911 |
+ sys-libs/binutils-libs:0= |
1912 |
+ >=sys-libs/readline-4.1:0= |
1913 |
+ ) |
1914 |
+ server? ( |
1915 |
+ backup? ( app-arch/libarchive:0= ) |
1916 |
+ cracklib? ( sys-libs/cracklib:0= ) |
1917 |
+ extraengine? ( |
1918 |
+ odbc? ( dev-db/unixODBC:0= ) |
1919 |
+ xml? ( dev-libs/libxml2:2= ) |
1920 |
+ ) |
1921 |
+ innodb-lz4? ( app-arch/lz4 ) |
1922 |
+ innodb-lzo? ( dev-libs/lzo ) |
1923 |
+ innodb-snappy? ( app-arch/snappy ) |
1924 |
+ mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
1925 |
+ numa? ( sys-process/numactl ) |
1926 |
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
1927 |
+ pam? ( virtual/pam:0= ) |
1928 |
+ systemd? ( sys-apps/systemd:= ) |
1929 |
+ tokudb? ( app-arch/snappy ) |
1930 |
+ ) |
1931 |
+ >=dev-libs/libpcre-8.41-r1:3= |
1932 |
+" |
1933 |
+DEPEND="virtual/yacc |
1934 |
+ static? ( sys-libs/ncurses[static-libs] ) |
1935 |
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
1936 |
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
1937 |
+ ${COMMON_DEPEND}" |
1938 |
+RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
1939 |
+ !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
1940 |
+ server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
1941 |
+ ${COMMON_DEPEND} |
1942 |
+ server? ( galera? ( |
1943 |
+ sys-apps/iproute2 |
1944 |
+ =sys-cluster/galera-25* |
1945 |
+ sst-rsync? ( sys-process/lsof ) |
1946 |
+ sst-mariabackup? ( net-misc/socat[ssl] ) |
1947 |
+ sst-xtrabackup? ( net-misc/socat[ssl] ) |
1948 |
+ ) ) |
1949 |
+ perl? ( !dev-db/mytop |
1950 |
+ virtual/perl-Getopt-Long |
1951 |
+ dev-perl/TermReadKey |
1952 |
+ virtual/perl-Term-ANSIColor |
1953 |
+ virtual/perl-Time-HiRes ) |
1954 |
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
1955 |
+" |
1956 |
+# For other stuff to bring us in |
1957 |
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
1958 |
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
1959 |
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
1960 |
+ dev-db/mariadb-connector-c[${MULTILIB_USEDEP},static-libs] dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs] |
1961 |
+ server? ( ~virtual/mysql-5.6[static=] |
1962 |
+ galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
1963 |
+ |
1964 |
+pkg_setup() { |
1965 |
+ if [[ ${MERGE_TYPE} != binary ]] ; then |
1966 |
+ local GCC_MAJOR_SET=$(gcc-major-version) |
1967 |
+ local GCC_MINOR_SET=$(gcc-minor-version) |
1968 |
+ if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1969 |
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1970 |
+ eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
1971 |
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1972 |
+ die |
1973 |
+ fi |
1974 |
+ # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
1975 |
+ # non x86{,_64} arches |
1976 |
+ if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1977 |
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1978 |
+ eerror "${PN} needs to be built with gcc-4.7 or later." |
1979 |
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1980 |
+ die |
1981 |
+ fi |
1982 |
+ fi |
1983 |
+ java-pkg-opt-2_pkg_setup |
1984 |
+ if has test ${FEATURES} && \ |
1985 |
+ use server && ! has userpriv ${FEATURES} ; then |
1986 |
+ eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
1987 |
+ fi |
1988 |
+ |
1989 |
+ # This should come after all of the die statements |
1990 |
+ enewgroup mysql 60 || die "problem adding 'mysql' group" |
1991 |
+ enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
1992 |
+} |
1993 |
+ |
1994 |
+pkg_preinst() { |
1995 |
+ java-pkg-opt-2_pkg_preinst |
1996 |
+} |
1997 |
+ |
1998 |
+pkg_postinst() { |
1999 |
+ # Make sure the vars are correctly initialized |
2000 |
+ mysql_init_vars |
2001 |
+ |
2002 |
+ # Create log directory securely if it does not exist |
2003 |
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
2004 |
+ |
2005 |
+ if use server ; then |
2006 |
+ if use pam; then |
2007 |
+ einfo |
2008 |
+ elog "This install includes the PAM authentication plugin." |
2009 |
+ elog "To activate and configure the PAM plugin, please read:" |
2010 |
+ elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
2011 |
+ einfo |
2012 |
+ fi |
2013 |
+ |
2014 |
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
2015 |
+ einfo |
2016 |
+ elog "You might want to run:" |
2017 |
+ elog "\"emerge --config =${CATEGORY}/${PF}\"" |
2018 |
+ elog "if this is a new install." |
2019 |
+ elog |
2020 |
+ elog "If you are switching server implentations, you should run the" |
2021 |
+ elog "mysql_upgrade tool." |
2022 |
+ einfo |
2023 |
+ else |
2024 |
+ einfo |
2025 |
+ elog "If you are upgrading major versions, you should run the" |
2026 |
+ elog "mysql_upgrade tool." |
2027 |
+ einfo |
2028 |
+ fi |
2029 |
+ |
2030 |
+ if use galera ; then |
2031 |
+ einfo |
2032 |
+ elog "Be sure to edit the my.cnf file to activate your cluster settings." |
2033 |
+ elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
2034 |
+ elog "The first time the cluster is activated, you should add" |
2035 |
+ elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
2036 |
+ elog "This option should then be removed for subsequent starts." |
2037 |
+ einfo |
2038 |
+ fi |
2039 |
+ fi |
2040 |
+ |
2041 |
+ # Note about configuration change |
2042 |
+ einfo |
2043 |
+ elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
2044 |
+ elog "to several files in /etc/mysql/${PN}.d." |
2045 |
+ elog "Please backup any changes you made to /etc/mysql/my.cnf" |
2046 |
+ elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
2047 |
+ elog "You may have as many files as needed and they are read alphabetically." |
2048 |
+ elog "Be sure the options have the appropitate section headers, i.e. [mysqld]." |
2049 |
+ einfo |
2050 |
+} |
2051 |
+ |
2052 |
+src_unpack() { |
2053 |
+ unpack ${A} |
2054 |
+ # Grab the patches |
2055 |
+ [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack |
2056 |
+ |
2057 |
+ mv -f "${WORKDIR%/}/${P}" "${S}" || die |
2058 |
+} |
2059 |
+ |
2060 |
+src_prepare() { |
2061 |
+ _disable_engine() { |
2062 |
+ echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
2063 |
+ } |
2064 |
+ |
2065 |
+ _disable_plugin() { |
2066 |
+ echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
2067 |
+ } |
2068 |
+ java-pkg-opt-2_src_prepare |
2069 |
+ if use tcmalloc; then |
2070 |
+ echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
2071 |
+ fi |
2072 |
+ |
2073 |
+ # Don't build bundled xz-utils for tokudb |
2074 |
+ echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
2075 |
+ sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
2076 |
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
2077 |
+ |
2078 |
+ # Remove the bundled groonga |
2079 |
+ # There is no CMake flag, it simply checks for existance |
2080 |
+ rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
2081 |
+ |
2082 |
+ local plugin |
2083 |
+ local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
2084 |
+ locale_info qc_info server_audit sql_errlog ) |
2085 |
+ local test_plugins=( audit_null auth_examples daemon_example fulltext ) |
2086 |
+ if ! use server; then # These plugins are for the server |
2087 |
+ for plugin in "${server_plugins[@]}" ; do |
2088 |
+ _disable_plugin "${plugin}" |
2089 |
+ done |
2090 |
+ fi |
2091 |
+ |
2092 |
+ if ! use test; then # These plugins are only used during testing |
2093 |
+ for plugin in "${test_plugins[@]}" ; do |
2094 |
+ _disable_plugin "${plugin}" |
2095 |
+ done |
2096 |
+ fi |
2097 |
+ |
2098 |
+ # Collides with mariadb-connector-c bug 655980 |
2099 |
+ _disable_plugin auth_dialog |
2100 |
+ |
2101 |
+ # Avoid useless library checks |
2102 |
+ use mroonga || _disable_engine mroonga |
2103 |
+ use oqgraph || _disable_engine oqgraph |
2104 |
+ _disable_engine example |
2105 |
+ |
2106 |
+ cmake-utils_src_prepare |
2107 |
+} |
2108 |
+ |
2109 |
+src_configure(){ |
2110 |
+ # bug 508724 mariadb cannot use ld.gold |
2111 |
+ tc-ld-disable-gold |
2112 |
+ # Bug #114895, bug #110149 |
2113 |
+ filter-flags "-O" "-O[01]" |
2114 |
+ |
2115 |
+ append-cxxflags -felide-constructors |
2116 |
+ |
2117 |
+ # bug #283926, with GCC4.4, this is required to get correct behavior. |
2118 |
+ append-flags -fno-strict-aliasing |
2119 |
+ |
2120 |
+ CMAKE_BUILD_TYPE="RelWithDebInfo" |
2121 |
+ |
2122 |
+ # debug hack wrt #497532 |
2123 |
+ mycmakeargs=( |
2124 |
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
2125 |
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
2126 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
2127 |
+ -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
2128 |
+ -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
2129 |
+ -DINSTALL_BINDIR=bin |
2130 |
+ -DINSTALL_DOCDIR=share/doc/${PF} |
2131 |
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
2132 |
+ -DINSTALL_INCLUDEDIR=include/mysql |
2133 |
+ -DINSTALL_INFODIR=share/info |
2134 |
+ -DINSTALL_LIBDIR=$(get_libdir) |
2135 |
+ -DINSTALL_MANDIR=share/man |
2136 |
+ -DINSTALL_MYSQLSHAREDIR=share/mariadb |
2137 |
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
2138 |
+ -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
2139 |
+ -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
2140 |
+ -DINSTALL_SBINDIR=sbin |
2141 |
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
2142 |
+ -DWITH_COMMENT="Gentoo Linux ${PF}" |
2143 |
+ -DWITH_UNIT_TESTS=$(usex test ON OFF) |
2144 |
+ -DWITH_LIBEDIT=0 |
2145 |
+ -DWITH_ZLIB=system |
2146 |
+ -DWITHOUT_LIBWRAP=1 |
2147 |
+ -DENABLED_LOCAL_INFILE=1 |
2148 |
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
2149 |
+ -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
2150 |
+ -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
2151 |
+ -DWITH_DEFAULT_FEATURE_SET=0 |
2152 |
+ -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
2153 |
+ -DENABLE_STATIC_LIBS=$(usex static-libs ON OFF) |
2154 |
+ # The build forces this to be defined when cross-compiling. We pass it |
2155 |
+ # all the time for simplicity and to make sure it is actually correct. |
2156 |
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
2157 |
+ -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
2158 |
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
2159 |
+ -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
2160 |
+ -DCONC_WITH_EXTERNAL_ZLIB=YES |
2161 |
+ -DWITH_EXTERNAL_ZLIB=YES |
2162 |
+ -DSUFFIX_INSTALL_DIR="" |
2163 |
+ -DWITH_UNITTEST=OFF |
2164 |
+ -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mariadb/mysql-test' '') |
2165 |
+ -DWITH_SSL=$(usex yassl bundled system) |
2166 |
+ -DWITHOUT_CLIENTLIBS=YES |
2167 |
+ # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
2168 |
+ -DWITH_READLINE=$(usex bindist 1 0) |
2169 |
+ -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
2170 |
+ -DENABLE_DTRACE=$(usex systemtap) |
2171 |
+ ) |
2172 |
+ |
2173 |
+ if use server ; then |
2174 |
+ |
2175 |
+ # Federated{,X} must be treated special otherwise they will not be built as plugins |
2176 |
+ if ! use extraengine ; then |
2177 |
+ mycmakeargs+=( |
2178 |
+ -DPLUGIN_FEDERATED=NO |
2179 |
+ -DPLUGIN_FEDERATEDX=NO ) |
2180 |
+ fi |
2181 |
+ |
2182 |
+ mycmakeargs+=( |
2183 |
+ -DWITH_JEMALLOC=$(usex jemalloc system) |
2184 |
+ -DWITH_PCRE=system |
2185 |
+ -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
2186 |
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
2187 |
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
2188 |
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
2189 |
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
2190 |
+ -DPLUGIN_CASSANDRA=NO |
2191 |
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
2192 |
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
2193 |
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
2194 |
+ -DCONNECT_WITH_MYSQL=1 |
2195 |
+ -DCONNECT_WITH_LIBXML2=$(usex xml) |
2196 |
+ -DCONNECT_WITH_ODBC=$(usex odbc) |
2197 |
+ -DCONNECT_WITH_JDBC=$(usex jdbc) |
2198 |
+ # Build failure and autodep wrt bug 639144 |
2199 |
+ -DCONNECT_WITH_MONGO=OFF |
2200 |
+ -DWITH_WSREP=$(usex galera) |
2201 |
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
2202 |
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
2203 |
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
2204 |
+ -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
2205 |
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
2206 |
+ -DWITH_MARIABACKUP=$(usex backup ON OFF) |
2207 |
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
2208 |
+ -DINSTALL_SQLBENCHDIR='' |
2209 |
+ -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
2210 |
+ # systemd is only linked to for server notification |
2211 |
+ -DWITH_SYSTEMD=$(usex systemd yes no) |
2212 |
+ -DWITH_NUMA=$(usex numa ON OFF) |
2213 |
+ ) |
2214 |
+ |
2215 |
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
2216 |
+ ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
2217 |
+ ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
2218 |
+ ewarn "You MUST file bugs without these variables set." |
2219 |
+ |
2220 |
+ mycmakeargs+=( |
2221 |
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
2222 |
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
2223 |
+ ) |
2224 |
+ |
2225 |
+ elif ! use latin1 ; then |
2226 |
+ mycmakeargs+=( |
2227 |
+ -DDEFAULT_CHARSET=utf8 |
2228 |
+ -DDEFAULT_COLLATION=utf8_general_ci |
2229 |
+ ) |
2230 |
+ else |
2231 |
+ mycmakeargs+=( |
2232 |
+ -DDEFAULT_CHARSET=latin1 |
2233 |
+ -DDEFAULT_COLLATION=latin1_swedish_ci |
2234 |
+ ) |
2235 |
+ fi |
2236 |
+ mycmakeargs+=( |
2237 |
+ -DEXTRA_CHARSETS=all |
2238 |
+ -DMYSQL_USER=mysql |
2239 |
+ -DDISABLE_SHARED=$(usex static YES NO) |
2240 |
+ -DWITH_DEBUG=$(usex debug) |
2241 |
+ -DWITH_EMBEDDED_SERVER=OFF |
2242 |
+ -DWITH_PROFILING=$(usex profiling) |
2243 |
+ ) |
2244 |
+ |
2245 |
+ if use static; then |
2246 |
+ mycmakeargs+=( -DWITH_PIC=1 ) |
2247 |
+ fi |
2248 |
+ |
2249 |
+ if use jemalloc || use tcmalloc ; then |
2250 |
+ mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
2251 |
+ fi |
2252 |
+ |
2253 |
+ # Storage engines |
2254 |
+ mycmakeargs+=( |
2255 |
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
2256 |
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
2257 |
+ -DWITH_CSV_STORAGE_ENGINE=1 |
2258 |
+ -DWITH_HEAP_STORAGE_ENGINE=1 |
2259 |
+ -DWITH_INNOBASE_STORAGE_ENGINE=1 |
2260 |
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
2261 |
+ -DWITH_MYISAM_STORAGE_ENGINE=1 |
2262 |
+ -DWITH_PARTITION_STORAGE_ENGINE=1 |
2263 |
+ ) |
2264 |
+ |
2265 |
+ else |
2266 |
+ mycmakeargs+=( |
2267 |
+ -DWITHOUT_SERVER=1 |
2268 |
+ -DEXTRA_CHARSETS=none |
2269 |
+ -DINSTALL_SQLBENCHDIR= |
2270 |
+ -DWITH_SYSTEMD=no |
2271 |
+ ) |
2272 |
+ fi |
2273 |
+ |
2274 |
+ cmake-utils_src_configure |
2275 |
+} |
2276 |
+ |
2277 |
+src_compile() { |
2278 |
+ cmake-utils_src_compile |
2279 |
+} |
2280 |
+ |
2281 |
+src_install() { |
2282 |
+ cmake-utils_src_install |
2283 |
+ |
2284 |
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
2285 |
+ if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
2286 |
+ rm "${ED}/usr/include/mysql/server/private/config.h" || die |
2287 |
+ fi |
2288 |
+ |
2289 |
+ # Make sure the vars are correctly initialized |
2290 |
+ mysql_init_vars |
2291 |
+ |
2292 |
+ # Convenience links |
2293 |
+ einfo "Making Convenience links for mysqlcheck multi-call binary" |
2294 |
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
2295 |
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
2296 |
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
2297 |
+ |
2298 |
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
2299 |
+ if [[ -d "${ED}/usr/data" ]] ; then |
2300 |
+ rm -Rf "${ED}/usr/data" || die |
2301 |
+ fi |
2302 |
+ |
2303 |
+ # Unless they explicitly specific USE=test, then do not install the |
2304 |
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a |
2305 |
+ # validation of your database configuration after tuning it. |
2306 |
+ if ! use test ; then |
2307 |
+ rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
2308 |
+ fi |
2309 |
+ |
2310 |
+ # Configuration stuff |
2311 |
+ einfo "Building default configuration ..." |
2312 |
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
2313 |
+ [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
2314 |
+ cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
2315 |
+ eprefixify "${TMPDIR}/my.cnf" |
2316 |
+ doins "${TMPDIR}/my.cnf" |
2317 |
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
2318 |
+ cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
2319 |
+ eprefixify "${TMPDIR}/50-distro-client.cnf" |
2320 |
+ doins "${TMPDIR}/50-distro-client.cnf" |
2321 |
+ |
2322 |
+ if use server ; then |
2323 |
+ mycnf_src="my.cnf.distro-server" |
2324 |
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
2325 |
+ "${FILESDIR}/${mycnf_src}" \ |
2326 |
+ > "${TMPDIR}/my.cnf.ok" || die |
2327 |
+ if use prefix ; then |
2328 |
+ sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
2329 |
+ "${TMPDIR}/my.cnf.ok" || die |
2330 |
+ fi |
2331 |
+ if use latin1 ; then |
2332 |
+ sed -i \ |
2333 |
+ -e "/character-set/s|utf8|latin1|g" \ |
2334 |
+ "${TMPDIR}/my.cnf.ok" || die |
2335 |
+ fi |
2336 |
+ eprefixify "${TMPDIR}/my.cnf.ok" |
2337 |
+ newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
2338 |
+ |
2339 |
+ einfo "Including support files and sample configurations" |
2340 |
+ docinto "support-files" |
2341 |
+ local script |
2342 |
+ for script in \ |
2343 |
+ "${S}"/support-files/magic |
2344 |
+ do |
2345 |
+ [[ -f "$script" ]] && dodoc "${script}" |
2346 |
+ done |
2347 |
+ |
2348 |
+ docinto "scripts" |
2349 |
+ for script in "${S}"/scripts/mysql* ; do |
2350 |
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
2351 |
+ done |
2352 |
+ fi |
2353 |
+ |
2354 |
+ #Remove mytop if perl is not selected |
2355 |
+ [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
2356 |
+} |
2357 |
+ |
2358 |
+# Official test instructions: |
2359 |
+# USE='extraengine perl server static-libs' \ |
2360 |
+# FEATURES='test userpriv -usersandbox' \ |
2361 |
+# ebuild mariadb-X.X.XX.ebuild \ |
2362 |
+# digest clean package |
2363 |
+src_test() { |
2364 |
+ |
2365 |
+ _disable_test() { |
2366 |
+ local rawtestname reason |
2367 |
+ rawtestname="${1}" ; shift |
2368 |
+ reason="${@}" |
2369 |
+ ewarn "test '${rawtestname}' disabled: '${reason}'" |
2370 |
+ echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
2371 |
+ } |
2372 |
+ |
2373 |
+ local TESTDIR="${BUILD_DIR}/mysql-test" |
2374 |
+ local retstatus_unit |
2375 |
+ local retstatus_tests |
2376 |
+ |
2377 |
+ if ! use server ; then |
2378 |
+ einfo "Skipping server tests due to minimal build." |
2379 |
+ return 0 |
2380 |
+ fi |
2381 |
+ |
2382 |
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named |
2383 |
+ # localhost. Also causes weird failures. |
2384 |
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
2385 |
+ |
2386 |
+ if [[ $UID -eq 0 ]]; then |
2387 |
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
2388 |
+ fi |
2389 |
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
2390 |
+ |
2391 |
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
2392 |
+ |
2393 |
+ # Run CTest (test-units) |
2394 |
+ cmake-utils_src_test |
2395 |
+ retstatus_unit=$? |
2396 |
+ |
2397 |
+ # Ensure that parallel runs don't die |
2398 |
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
2399 |
+ # Enable parallel testing, auto will try to detect number of cores |
2400 |
+ # You may set this by hand. |
2401 |
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
2402 |
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
2403 |
+ |
2404 |
+ # create directories because mysqladmin might run out of order |
2405 |
+ mkdir -p "${T}"/var-tests{,/log} || die |
2406 |
+ |
2407 |
+ # Run mysql tests |
2408 |
+ pushd "${TESTDIR}" > /dev/null || die |
2409 |
+ |
2410 |
+ touch "${T}/disabled.def" |
2411 |
+ # These are failing in MariaDB 10.0 for now and are believed to be |
2412 |
+ # false positives: |
2413 |
+ # |
2414 |
+ # main.mysql_client_test, main.mysql_client_test_nonblock |
2415 |
+ # main.mysql_client_test_comp: |
2416 |
+ # segfaults at random under Portage only, suspect resource limits. |
2417 |
+ |
2418 |
+ local t |
2419 |
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
2420 |
+ _disable_test "$t" "False positive due to varying policies" |
2421 |
+ done |
2422 |
+ |
2423 |
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
2424 |
+ main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
2425 |
+ _disable_test "$t" "False positives in Gentoo" |
2426 |
+ done |
2427 |
+ |
2428 |
+ if ! use client-libs ; then |
2429 |
+ _disable_test main.plugin_auth "Needs client libraries built" |
2430 |
+ fi |
2431 |
+ |
2432 |
+ # run mysql-test tests |
2433 |
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
2434 |
+ retstatus_tests=$? |
2435 |
+ |
2436 |
+ popd > /dev/null || die |
2437 |
+ |
2438 |
+ # Cleanup is important for these testcases. |
2439 |
+ pkill -9 -f "${S}/ndb" 2>/dev/null |
2440 |
+ pkill -9 -f "${S}/sql" 2>/dev/null |
2441 |
+ |
2442 |
+ local failures="" |
2443 |
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
2444 |
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
2445 |
+ |
2446 |
+ [[ -z "$failures" ]] || die "Test failures: $failures" |
2447 |
+ einfo "Tests successfully completed" |
2448 |
+} |
2449 |
+ |
2450 |
+mysql_init_vars() { |
2451 |
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
2452 |
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
2453 |
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
2454 |
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
2455 |
+ |
2456 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
2457 |
+ MY_DATADIR="" |
2458 |
+ if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
2459 |
+ MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
2460 |
+ | sed -ne '/datadir/s|^--datadir=||p' \ |
2461 |
+ | tail -n1` |
2462 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
2463 |
+ MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
2464 |
+ | sed -e 's/.*=\s*//' \ |
2465 |
+ | tail -n1` |
2466 |
+ fi |
2467 |
+ fi |
2468 |
+ if [[ -z "${MY_DATADIR}" ]] ; then |
2469 |
+ MY_DATADIR="${MY_LOCALSTATEDIR}" |
2470 |
+ einfo "Using default MY_DATADIR" |
2471 |
+ fi |
2472 |
+ elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
2473 |
+ |
2474 |
+ if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
2475 |
+ if [[ -e "${MY_DATADIR}" ]] ; then |
2476 |
+ # If you get this and you're wondering about it, see bug #207636 |
2477 |
+ elog "MySQL datadir found in ${MY_DATADIR}" |
2478 |
+ elog "A new one will not be created." |
2479 |
+ PREVIOUS_DATADIR="yes" |
2480 |
+ else |
2481 |
+ PREVIOUS_DATADIR="no" |
2482 |
+ fi |
2483 |
+ export PREVIOUS_DATADIR |
2484 |
+ fi |
2485 |
+ else |
2486 |
+ if [[ ${EBUILD_PHASE} == "config" ]]; then |
2487 |
+ local new_MY_DATADIR |
2488 |
+ new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
2489 |
+ | sed -ne '/datadir/s|^--datadir=||p' \ |
2490 |
+ | tail -n1` |
2491 |
+ |
2492 |
+ if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
2493 |
+ ewarn "MySQL MY_DATADIR has changed" |
2494 |
+ ewarn "from ${MY_DATADIR}" |
2495 |
+ ewarn "to ${new_MY_DATADIR}" |
2496 |
+ MY_DATADIR="${new_MY_DATADIR}" |
2497 |
+ fi |
2498 |
+ fi |
2499 |
+ fi |
2500 |
+ |
2501 |
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
2502 |
+ export MY_LOCALSTATEDIR MY_LOGDIR |
2503 |
+ export MY_DATADIR |
2504 |
+} |
2505 |
+ |
2506 |
+pkg_config() { |
2507 |
+ _getoptval() { |
2508 |
+ local mypd="${EROOT}"/usr/bin/my_print_defaults |
2509 |
+ local section="$1" |
2510 |
+ local flag="--${2}=" |
2511 |
+ local extra_options="${3}" |
2512 |
+ "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
2513 |
+ } |
2514 |
+ local old_MY_DATADIR="${MY_DATADIR}" |
2515 |
+ local old_HOME="${HOME}" |
2516 |
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf |
2517 |
+ export HOME=${EPREFIX}/root |
2518 |
+ |
2519 |
+ # Make sure the vars are correctly initialized |
2520 |
+ mysql_init_vars |
2521 |
+ |
2522 |
+ [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
2523 |
+ if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
2524 |
+ die "Minimal builds do NOT include the MySQL server" |
2525 |
+ fi |
2526 |
+ |
2527 |
+ if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
2528 |
+ local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
2529 |
+ MY_DATADIR_s="${MY_DATADIR_s%%/}" |
2530 |
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
2531 |
+ old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
2532 |
+ |
2533 |
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
2534 |
+ if [[ -d "${MY_DATADIR_s}" ]]; then |
2535 |
+ ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
2536 |
+ ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
2537 |
+ else |
2538 |
+ elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
2539 |
+ mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
2540 |
+ || die "Moving MY_DATADIR failed" |
2541 |
+ fi |
2542 |
+ else |
2543 |
+ ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
2544 |
+ if [[ -d "${MY_DATADIR_s}" ]]; then |
2545 |
+ ewarn "Attempting to use ${MY_DATADIR_s}" |
2546 |
+ else |
2547 |
+ eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
2548 |
+ die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
2549 |
+ fi |
2550 |
+ fi |
2551 |
+ fi |
2552 |
+ |
2553 |
+ local pwd1="a" |
2554 |
+ local pwd2="b" |
2555 |
+ local maxtry=15 |
2556 |
+ |
2557 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
2558 |
+ local tmp_mysqld_password_source= |
2559 |
+ |
2560 |
+ for tmp_mysqld_password_source in mysql client; do |
2561 |
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
2562 |
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
2563 |
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
2564 |
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
2565 |
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
2566 |
+ MYSQL_ROOT_PASSWORD= |
2567 |
+ continue |
2568 |
+ fi |
2569 |
+ |
2570 |
+ einfo "Found password in '${tmp_mysqld_password_source}' section!" |
2571 |
+ break |
2572 |
+ fi |
2573 |
+ done |
2574 |
+ |
2575 |
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
2576 |
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
2577 |
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
2578 |
+ fi |
2579 |
+ |
2580 |
+ unset tmp_mysqld_password_source |
2581 |
+ fi |
2582 |
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)" |
2583 |
+ # These are dir+prefix |
2584 |
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" |
2585 |
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
2586 |
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" |
2587 |
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
2588 |
+ |
2589 |
+ if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
2590 |
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
2591 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
2592 |
+ fi |
2593 |
+ if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
2594 |
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
2595 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
2596 |
+ fi |
2597 |
+ if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
2598 |
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
2599 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
2600 |
+ fi |
2601 |
+ |
2602 |
+ if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
2603 |
+ ewarn "You have already a MySQL database in place." |
2604 |
+ ewarn "(${ROOT}/${MY_DATADIR}/*)" |
2605 |
+ ewarn "Please rename or delete it if you wish to replace it." |
2606 |
+ die "MySQL database already exists!" |
2607 |
+ fi |
2608 |
+ |
2609 |
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named |
2610 |
+ # localhost. Also causes weird failures. |
2611 |
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
2612 |
+ |
2613 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
2614 |
+ |
2615 |
+ einfo "Please provide a password for the mysql 'root' user now" |
2616 |
+ einfo "or through the ${HOME}/.my.cnf file." |
2617 |
+ ewarn "Avoid [\"'\\_%] characters in the password" |
2618 |
+ read -rsp " >" pwd1 ; echo |
2619 |
+ |
2620 |
+ einfo "Retype the password" |
2621 |
+ read -rsp " >" pwd2 ; echo |
2622 |
+ |
2623 |
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then |
2624 |
+ die "Passwords are not the same" |
2625 |
+ fi |
2626 |
+ MYSQL_ROOT_PASSWORD="${pwd1}" |
2627 |
+ unset pwd1 pwd2 |
2628 |
+ fi |
2629 |
+ |
2630 |
+ local options |
2631 |
+ local sqltmp="$(emktemp)" |
2632 |
+ |
2633 |
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
2634 |
+ # see http://bugs.mysql.com/bug.php?id=31312 |
2635 |
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
2636 |
+ |
2637 |
+ # Figure out which options we need to disable to do the setup |
2638 |
+ local helpfile="${TMPDIR}/mysqld-help" |
2639 |
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
2640 |
+ for opt in grant-tables host-cache name-resolve networking slave-start \ |
2641 |
+ federated ssl log-bin relay-log slow-query-log external-locking \ |
2642 |
+ log-slave-updates \ |
2643 |
+ ; do |
2644 |
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
2645 |
+ egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
2646 |
+ done |
2647 |
+ |
2648 |
+ einfo "Creating the mysql database and setting proper permissions on it ..." |
2649 |
+ |
2650 |
+ # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
2651 |
+ PID_DIR="${EROOT}/var/run/mysqld" |
2652 |
+ if [[ ! -d "${PID_DIR}" ]]; then |
2653 |
+ install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
2654 |
+ fi |
2655 |
+ |
2656 |
+ if [[ ! -d "${MY_DATADIR}" ]]; then |
2657 |
+ install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
2658 |
+ fi |
2659 |
+ |
2660 |
+ pushd "${TMPDIR}" &>/dev/null || die |
2661 |
+ |
2662 |
+ # Filling timezones, see |
2663 |
+ # http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
2664 |
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
2665 |
+ |
2666 |
+ local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
2667 |
+ [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
2668 |
+ cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
2669 |
+ einfo "Command: ${cmd[*]}" |
2670 |
+ su -s /bin/sh -c "${cmd[*]}" mysql \ |
2671 |
+ >"${TMPDIR}"/mysql_install_db.log 2>&1 |
2672 |
+ if [ $? -ne 0 ]; then |
2673 |
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
2674 |
+ die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
2675 |
+ fi |
2676 |
+ popd &>/dev/null || die |
2677 |
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
2678 |
+ || die "MySQL databases not installed" |
2679 |
+ |
2680 |
+ use prefix || options="${options} --user=mysql" |
2681 |
+ |
2682 |
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
2683 |
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
2684 |
+ local mysqld="${EROOT}/usr/sbin/mysqld \ |
2685 |
+ ${options} \ |
2686 |
+ --log-warnings=0 \ |
2687 |
+ --basedir=${EROOT}/usr \ |
2688 |
+ --datadir=${ROOT}/${MY_DATADIR} \ |
2689 |
+ --max_allowed_packet=8M \ |
2690 |
+ --net_buffer_length=16K \ |
2691 |
+ --socket=${socket} \ |
2692 |
+ --pid-file=${pidfile} |
2693 |
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
2694 |
+ #einfo "About to start mysqld: ${mysqld}" |
2695 |
+ ebegin "Starting mysqld" |
2696 |
+ einfo "Command ${mysqld}" |
2697 |
+ ${mysqld} & |
2698 |
+ rc=$? |
2699 |
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
2700 |
+ maxtry=$((${maxtry}-1)) |
2701 |
+ echo -n "." |
2702 |
+ sleep 1 |
2703 |
+ done |
2704 |
+ eend $rc |
2705 |
+ |
2706 |
+ if ! [[ -S "${socket}" ]]; then |
2707 |
+ die "Completely failed to start up mysqld with: ${mysqld}" |
2708 |
+ fi |
2709 |
+ |
2710 |
+ ebegin "Setting root password" |
2711 |
+ # Do this from memory, as we don't want clear text passwords in temp files |
2712 |
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
2713 |
+ "${EROOT}/usr/bin/mysql" \ |
2714 |
+ "--socket=${socket}" \ |
2715 |
+ -hlocalhost \ |
2716 |
+ -e "${sql}" |
2717 |
+ eend $? |
2718 |
+ |
2719 |
+ if [[ -n "${sqltmp}" ]] ; then |
2720 |
+ ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
2721 |
+ "${EROOT}/usr/bin/mysql" \ |
2722 |
+ "--socket=${socket}" \ |
2723 |
+ -hlocalhost \ |
2724 |
+ -uroot \ |
2725 |
+ --password="${MYSQL_ROOT_PASSWORD}" \ |
2726 |
+ mysql < "${sqltmp}" |
2727 |
+ rc=$? |
2728 |
+ eend $? |
2729 |
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
2730 |
+ fi |
2731 |
+ |
2732 |
+ # Stop the server and cleanup |
2733 |
+ einfo "Stopping the server ..." |
2734 |
+ kill $(< "${pidfile}" ) |
2735 |
+ rm -f "${sqltmp}" |
2736 |
+ wait %1 |
2737 |
+ einfo "Done" |
2738 |
+} |
2739 |
|
2740 |
diff --git a/dev-db/mariadb/mariadb-10.2.6.ebuild b/dev-db/mariadb/mariadb-10.2.6.ebuild |
2741 |
deleted file mode 100644 |
2742 |
index bcb6b90..0000000 |
2743 |
--- a/dev-db/mariadb/mariadb-10.2.6.ebuild |
2744 |
+++ /dev/null |
2745 |
@@ -1,398 +0,0 @@ |
2746 |
-# Copyright 1999-2018 Gentoo Foundation |
2747 |
-# Distributed under the terms of the GNU General Public License v2 |
2748 |
- |
2749 |
-EAPI="6" |
2750 |
-MY_EXTRAS_VER="20170719-0024Z" |
2751 |
-# The wsrep API version must match between upstream WSREP and sys-cluster/galera major number |
2752 |
-WSREP_REVISION="25" |
2753 |
-SUBSLOT="18" |
2754 |
-MYSQL_PV_MAJOR="5.6" |
2755 |
- |
2756 |
-JAVA_PKG_OPT_USE="jdbc" |
2757 |
- |
2758 |
-inherit toolchain-funcs java-pkg-opt-2 prefix toolchain-funcs \ |
2759 |
- multilib-minimal mysql-multilib-r1 |
2760 |
- |
2761 |
-HOMEPAGE="http://mariadb.org/" |
2762 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
2763 |
-LICENSE="GPL-2 LGPL-2.1+" |
2764 |
- |
2765 |
-IUSE="+backup bindist cracklib galera kerberos innodb-lz4 innodb-lzo innodb-snappy jdbc mroonga odbc oqgraph pam rocksdb sphinx sst-rsync sst-xtrabackup tokudb systemd xml" |
2766 |
-RESTRICT="!bindist? ( bindist )" |
2767 |
- |
2768 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )" |
2769 |
- |
2770 |
-# REMEMBER: also update eclass/mysql*.eclass before committing! |
2771 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
2772 |
- |
2773 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
2774 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras" |
2775 |
-else |
2776 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" |
2777 |
-fi |
2778 |
- |
2779 |
-PATCHES=( |
2780 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
2781 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.6-without-clientlibs-tools.patch |
2782 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
2783 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
2784 |
-) |
2785 |
- |
2786 |
-COMMON_DEPEND=" |
2787 |
- mroonga? ( app-text/groonga-normalizer-mysql ) |
2788 |
- kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] ) |
2789 |
- !bindist? ( |
2790 |
- sys-libs/binutils-libs:0= |
2791 |
- >=sys-libs/readline-4.1:0= |
2792 |
- ) |
2793 |
- server? ( |
2794 |
- backup? ( app-arch/libarchive:0= ) |
2795 |
- cracklib? ( sys-libs/cracklib:0= ) |
2796 |
- extraengine? ( |
2797 |
- odbc? ( dev-db/unixODBC:0= ) |
2798 |
- xml? ( dev-libs/libxml2:2= ) |
2799 |
- ) |
2800 |
- innodb-lz4? ( app-arch/lz4 ) |
2801 |
- innodb-lzo? ( dev-libs/lzo ) |
2802 |
- innodb-snappy? ( app-arch/snappy ) |
2803 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
2804 |
- pam? ( virtual/pam:0= ) |
2805 |
- systemd? ( sys-apps/systemd:= ) |
2806 |
- tokudb? ( app-arch/snappy ) |
2807 |
- ) |
2808 |
- >=dev-libs/libpcre-8.35:3= |
2809 |
- sys-libs/zlib[${MULTILIB_USEDEP}] |
2810 |
-" |
2811 |
-DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
2812 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
2813 |
- ${COMMON_DEPEND}" |
2814 |
-RDEPEND="${RDEPEND} ${COMMON_DEPEND} |
2815 |
- server? ( galera? ( |
2816 |
- sys-apps/iproute2 |
2817 |
- =sys-cluster/galera-${WSREP_REVISION}* |
2818 |
- sst-rsync? ( sys-process/lsof ) |
2819 |
- sst-xtrabackup? ( net-misc/socat[ssl] ) |
2820 |
- ) ) |
2821 |
- perl? ( !dev-db/mytop |
2822 |
- virtual/perl-Getopt-Long |
2823 |
- dev-perl/TermReadKey |
2824 |
- virtual/perl-Term-ANSIColor |
2825 |
- virtual/perl-Time-HiRes ) |
2826 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
2827 |
-" |
2828 |
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
2829 |
-PDEPEND="server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
2830 |
- |
2831 |
-MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h |
2832 |
- /usr/include/mariadb/mariadb_version.h |
2833 |
- /usr/include/mysql/private/probes_mysql_nodtrace.h |
2834 |
- /usr/include/mysql/private/probes_mysql_dtrace.h ) |
2835 |
- |
2836 |
-pkg_setup() { |
2837 |
- java-pkg-opt-2_pkg_setup |
2838 |
- mysql-multilib-r1_pkg_setup |
2839 |
-} |
2840 |
- |
2841 |
-pkg_preinst() { |
2842 |
- java-pkg-opt-2_pkg_preinst |
2843 |
- |
2844 |
- # Here we need to see if the implementation switched client libraries |
2845 |
- # We check if this is a new instance of the package and a client library already exists |
2846 |
- local SHOW_ABI_MESSAGE libpath |
2847 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
2848 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
2849 |
- elog "Due to ABI changes when switching between different client libraries," |
2850 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
2851 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
2852 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
2853 |
- fi |
2854 |
-} |
2855 |
- |
2856 |
-src_prepare() { |
2857 |
- java-pkg-opt-2_src_prepare |
2858 |
- if use tcmalloc; then |
2859 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
2860 |
- fi |
2861 |
- |
2862 |
- # Don't build bundled xz-utils for tokudb |
2863 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
2864 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
2865 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
2866 |
- |
2867 |
- # Remove the bundled groonga |
2868 |
- # There is no CMake flag, it simply checks for existance |
2869 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
2870 |
- |
2871 |
- eapply "${PATCHES[@]}" |
2872 |
- eapply_user |
2873 |
-} |
2874 |
- |
2875 |
-src_configure(){ |
2876 |
- # bug 508724 mariadb cannot use ld.gold |
2877 |
- tc-ld-disable-gold |
2878 |
- |
2879 |
- local MYSQL_CMAKE_NATIVE_DEFINES=( |
2880 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
2881 |
- -DWITH_PCRE=system |
2882 |
- ) |
2883 |
- local MYSQL_CMAKE_EXTRA_DEFINES=( |
2884 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
2885 |
- -DAUTH_GSSAPI_PLUGIN_TYPE="$(usex kerberos DYNAMIC OFF)" |
2886 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
2887 |
- -DWITH_EXTERNAL_ZLIB=YES |
2888 |
- -DSUFFIX_INSTALL_DIR="" |
2889 |
- -DINSTALL_INCLUDEDIR=include/mysql |
2890 |
- -DINSTALL_INFODIR=share/info |
2891 |
- -DINSTALL_LIBDIR=$(get_libdir) |
2892 |
- -DINSTALL_ELIBDIR=$(get_libdir)/mariadb |
2893 |
- -DINSTALL_MANDIR=share/man |
2894 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
2895 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
2896 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
2897 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
2898 |
- -DWITH_UNITTEST=OFF |
2899 |
- ) |
2900 |
- |
2901 |
- if use test ; then |
2902 |
- MYSQL_CMAKE_EXTRA_DEFINES+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
2903 |
- fi |
2904 |
- |
2905 |
- if use server ; then |
2906 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
2907 |
- if ! use extraengine ; then |
2908 |
- MYSQL_CMAKE_NATIVE_DEFINES+=( |
2909 |
- -DPLUGIN_FEDERATED=NO |
2910 |
- -DPLUGIN_FEDERATEDX=NO ) |
2911 |
- fi |
2912 |
- |
2913 |
- MYSQL_CMAKE_NATIVE_DEFINES+=( |
2914 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
2915 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
2916 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
2917 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
2918 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
2919 |
- -DPLUGIN_CASSANDRA=NO |
2920 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
2921 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
2922 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
2923 |
- -DCONNECT_WITH_MYSQL=1 |
2924 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
2925 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
2926 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
2927 |
- -DWITH_WSREP=$(usex galera) |
2928 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
2929 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
2930 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
2931 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
2932 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
2933 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
2934 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
2935 |
- -DINSTALL_SQLBENCHDIR=share/mariadb |
2936 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
2937 |
- ) |
2938 |
- if use test ; then |
2939 |
- # This is needed for the new client lib which tests a real, open server |
2940 |
- MYSQL_CMAKE_NATIVE_DEFINES+=( -DSKIP_TESTS=ON ) |
2941 |
- fi |
2942 |
- fi |
2943 |
- mysql-multilib-r1_src_configure |
2944 |
-} |
2945 |
- |
2946 |
-src_install() { |
2947 |
- # wrap the config scripts |
2948 |
- local MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config /usr/bin/mysql_config ) |
2949 |
- multilib-minimal_src_install |
2950 |
-} |
2951 |
- |
2952 |
-# Intentionally override eclass function |
2953 |
-multilib_src_install() { |
2954 |
- cmake-utils_src_install |
2955 |
- |
2956 |
- # Make sure the vars are correctly initialized |
2957 |
- mysql_init_vars |
2958 |
- |
2959 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
2960 |
- if [[ -f "${D}${MY_INCLUDEDIR}/private/config.h" ]] ; then |
2961 |
- rm "${D}${MY_INCLUDEDIR}/private/config.h" || die |
2962 |
- fi |
2963 |
- |
2964 |
- if ! multilib_is_native_abi && use server ; then |
2965 |
- insinto /usr/include/mysql/private |
2966 |
- doins "${S}"/sql/*.h |
2967 |
- fi |
2968 |
-} |
2969 |
- |
2970 |
-multilib_src_install_all() { |
2971 |
- # Make sure the vars are correctly initialized |
2972 |
- mysql_init_vars |
2973 |
- |
2974 |
- # Convenience links |
2975 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
2976 |
- dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze" |
2977 |
- dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" |
2978 |
- dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" |
2979 |
- |
2980 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
2981 |
- if [[ -d "${ED}/usr/data" ]] ; then |
2982 |
- rm -Rf "${ED}/usr/data" || die |
2983 |
- fi |
2984 |
- |
2985 |
- # Unless they explicitly specific USE=test, then do not install the |
2986 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
2987 |
- # validation of your database configuration after tuning it. |
2988 |
- if ! use test ; then |
2989 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
2990 |
- fi |
2991 |
- |
2992 |
- # Configuration stuff |
2993 |
- einfo "Building default configuration ..." |
2994 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
2995 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
2996 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
2997 |
- eprefixify "${TMPDIR}/my.cnf" |
2998 |
- doins "${TMPDIR}/my.cnf" |
2999 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
3000 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
3001 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
3002 |
- doins "${TMPDIR}/50-distro-client.cnf" |
3003 |
- |
3004 |
- if use server ; then |
3005 |
- mycnf_src="my.cnf.distro-server" |
3006 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
3007 |
- "${FILESDIR}/${mycnf_src}" \ |
3008 |
- > "${TMPDIR}/my.cnf.ok" || die |
3009 |
- if use prefix ; then |
3010 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
3011 |
- "${TMPDIR}/my.cnf.ok" || die |
3012 |
- fi |
3013 |
- if use latin1 ; then |
3014 |
- sed -i \ |
3015 |
- -e "/character-set/s|utf8|latin1|g" \ |
3016 |
- "${TMPDIR}/my.cnf.ok" || die |
3017 |
- fi |
3018 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
3019 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
3020 |
- einfo "Creating initial directories" |
3021 |
- # Empty directories ... |
3022 |
- diropts "-m0750" |
3023 |
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then |
3024 |
- dodir "${MY_DATADIR#${EPREFIX}}" |
3025 |
- keepdir "${MY_DATADIR#${EPREFIX}}" |
3026 |
- chown -R mysql:mysql "${D}/${MY_DATADIR}" |
3027 |
- fi |
3028 |
- |
3029 |
- diropts "-m0755" |
3030 |
- local folder |
3031 |
- for folder in "${MY_LOGDIR#${EPREFIX}}" ; do |
3032 |
- dodir "${folder}" |
3033 |
- keepdir "${folder}" |
3034 |
- chown -R mysql:mysql "${ED}/${folder}" |
3035 |
- done |
3036 |
- |
3037 |
- einfo "Including support files and sample configurations" |
3038 |
- docinto "support-files" |
3039 |
- local script |
3040 |
- for script in \ |
3041 |
- "${S}"/support-files/magic |
3042 |
- do |
3043 |
- [[ -f "$script" ]] && dodoc "${script}" |
3044 |
- done |
3045 |
- |
3046 |
- docinto "scripts" |
3047 |
- for script in "${S}"/scripts/mysql* ; do |
3048 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
3049 |
- done |
3050 |
- fi |
3051 |
- |
3052 |
- #Remove mytop if perl is not selected |
3053 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
3054 |
- |
3055 |
- # Install compatible symlinks to libmysqlclient |
3056 |
- use static-libs && dosym libmariadbclient.a "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.a" |
3057 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so" |
3058 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so.${SUBSLOT}" |
3059 |
-} |
3060 |
- |
3061 |
-# Official test instructions: |
3062 |
-# USE='embedded extraengine perl server openssl static-libs' \ |
3063 |
-# FEATURES='test userpriv -usersandbox' \ |
3064 |
-# ebuild mariadb-X.X.XX.ebuild \ |
3065 |
-# digest clean package |
3066 |
-multilib_src_test() { |
3067 |
- |
3068 |
- if ! multilib_is_native_abi ; then |
3069 |
- einfo "Server tests not available on non-native abi". |
3070 |
- return 0; |
3071 |
- fi |
3072 |
- |
3073 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
3074 |
- local retstatus_unit |
3075 |
- local retstatus_tests |
3076 |
- |
3077 |
- if use server ; then |
3078 |
- einfo "Skipping server tests due to minimal build." |
3079 |
- return 0 |
3080 |
- fi |
3081 |
- |
3082 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
3083 |
- # localhost. Also causes weird failures. |
3084 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
3085 |
- |
3086 |
- if [[ $UID -eq 0 ]]; then |
3087 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
3088 |
- fi |
3089 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
3090 |
- |
3091 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
3092 |
- |
3093 |
- # Run CTest (test-units) |
3094 |
- cmake-utils_src_test |
3095 |
- retstatus_unit=$? |
3096 |
- |
3097 |
- # Ensure that parallel runs don't die |
3098 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
3099 |
- # Enable parallel testing, auto will try to detect number of cores |
3100 |
- # You may set this by hand. |
3101 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
3102 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
3103 |
- |
3104 |
- # create directories because mysqladmin might run out of order |
3105 |
- mkdir -p "${T}"/var-tests{,/log} |
3106 |
- |
3107 |
- # Run mysql tests |
3108 |
- pushd "${TESTDIR}" || die |
3109 |
- |
3110 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
3111 |
- # false positives: |
3112 |
- # |
3113 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
3114 |
- # main.mysql_client_test_comp: |
3115 |
- # segfaults at random under Portage only, suspect resource limits. |
3116 |
- |
3117 |
- local t |
3118 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
3119 |
- mysql-multilib-r1_disable_test "$t" "False positive due to varying policies" |
3120 |
- done |
3121 |
- |
3122 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
3123 |
- main.mysql_client_test_comp ; do |
3124 |
- mysql-multilib-r1_disable_test "$t" "False positives in Gentoo" |
3125 |
- done |
3126 |
- |
3127 |
- # run mysql-test tests |
3128 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder |
3129 |
- retstatus_tests=$? |
3130 |
- |
3131 |
- popd || die |
3132 |
- |
3133 |
- # Cleanup is important for these testcases. |
3134 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
3135 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
3136 |
- |
3137 |
- local failures="" |
3138 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
3139 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
3140 |
- |
3141 |
- [[ -z "$failures" ]] || eerror "Test failures: $failures" |
3142 |
- einfo "Tests successfully completed" |
3143 |
-} |
3144 |
|
3145 |
diff --git a/dev-db/mariadb/mariadb-10.2.7.ebuild b/dev-db/mariadb/mariadb-10.2.7.ebuild |
3146 |
deleted file mode 100644 |
3147 |
index 6886518..0000000 |
3148 |
--- a/dev-db/mariadb/mariadb-10.2.7.ebuild |
3149 |
+++ /dev/null |
3150 |
@@ -1,401 +0,0 @@ |
3151 |
-# Copyright 1999-2018 Gentoo Foundation |
3152 |
-# Distributed under the terms of the GNU General Public License v2 |
3153 |
- |
3154 |
-EAPI="6" |
3155 |
-MY_EXTRAS_VER="20170719-0113Z" |
3156 |
-# The wsrep API version must match between upstream WSREP and sys-cluster/galera major number |
3157 |
-WSREP_REVISION="25" |
3158 |
-SUBSLOT="18" |
3159 |
-MYSQL_PV_MAJOR="5.6" |
3160 |
- |
3161 |
-JAVA_PKG_OPT_USE="jdbc" |
3162 |
- |
3163 |
-inherit toolchain-funcs java-pkg-opt-2 prefix toolchain-funcs \ |
3164 |
- multilib-minimal mysql-multilib-r1 |
3165 |
- |
3166 |
-HOMEPAGE="http://mariadb.org/" |
3167 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
3168 |
-LICENSE="GPL-2 LGPL-2.1+" |
3169 |
- |
3170 |
-IUSE="+backup bindist cracklib galera kerberos innodb-lz4 innodb-lzo innodb-snappy jdbc mroonga odbc oqgraph pam rocksdb sphinx sst-rsync sst-xtrabackup tokudb systemd xml" |
3171 |
-RESTRICT="!bindist? ( bindist )" |
3172 |
- |
3173 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )" |
3174 |
- |
3175 |
-# REMEMBER: also update eclass/mysql*.eclass before committing! |
3176 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
3177 |
- |
3178 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
3179 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras" |
3180 |
-else |
3181 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" |
3182 |
-fi |
3183 |
- |
3184 |
-PATCHES=( |
3185 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
3186 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.7-without-clientlibs-tools.patch |
3187 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
3188 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
3189 |
-) |
3190 |
- |
3191 |
-COMMON_DEPEND=" |
3192 |
- mroonga? ( app-text/groonga-normalizer-mysql ) |
3193 |
- kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] ) |
3194 |
- !bindist? ( |
3195 |
- sys-libs/binutils-libs:0= |
3196 |
- >=sys-libs/readline-4.1:0= |
3197 |
- ) |
3198 |
- server? ( |
3199 |
- backup? ( app-arch/libarchive:0= ) |
3200 |
- cracklib? ( sys-libs/cracklib:0= ) |
3201 |
- extraengine? ( |
3202 |
- odbc? ( dev-db/unixODBC:0= ) |
3203 |
- xml? ( dev-libs/libxml2:2= ) |
3204 |
- ) |
3205 |
- innodb-lz4? ( app-arch/lz4 ) |
3206 |
- innodb-lzo? ( dev-libs/lzo ) |
3207 |
- innodb-snappy? ( app-arch/snappy ) |
3208 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
3209 |
- pam? ( virtual/pam:0= ) |
3210 |
- systemd? ( sys-apps/systemd:= ) |
3211 |
- tokudb? ( app-arch/snappy ) |
3212 |
- ) |
3213 |
- >=dev-libs/libpcre-8.35:3= |
3214 |
- sys-libs/zlib[${MULTILIB_USEDEP}] |
3215 |
-" |
3216 |
-DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
3217 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
3218 |
- ${COMMON_DEPEND}" |
3219 |
-RDEPEND="${RDEPEND} ${COMMON_DEPEND} |
3220 |
- server? ( galera? ( |
3221 |
- sys-apps/iproute2 |
3222 |
- =sys-cluster/galera-${WSREP_REVISION}* |
3223 |
- sst-rsync? ( sys-process/lsof ) |
3224 |
- sst-xtrabackup? ( net-misc/socat[ssl] ) |
3225 |
- ) ) |
3226 |
- perl? ( !dev-db/mytop |
3227 |
- virtual/perl-Getopt-Long |
3228 |
- dev-perl/TermReadKey |
3229 |
- virtual/perl-Term-ANSIColor |
3230 |
- virtual/perl-Time-HiRes ) |
3231 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
3232 |
-" |
3233 |
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
3234 |
-PDEPEND="server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
3235 |
- |
3236 |
-MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h |
3237 |
- /usr/include/mariadb/mariadb_version.h |
3238 |
- /usr/include/mysql/private/probes_mysql_nodtrace.h |
3239 |
- /usr/include/mysql/private/probes_mysql_dtrace.h ) |
3240 |
- |
3241 |
-pkg_setup() { |
3242 |
- java-pkg-opt-2_pkg_setup |
3243 |
- mysql-multilib-r1_pkg_setup |
3244 |
-} |
3245 |
- |
3246 |
-pkg_preinst() { |
3247 |
- java-pkg-opt-2_pkg_preinst |
3248 |
- |
3249 |
- # Here we need to see if the implementation switched client libraries |
3250 |
- # We check if this is a new instance of the package and a client library already exists |
3251 |
- local SHOW_ABI_MESSAGE libpath |
3252 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
3253 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
3254 |
- elog "Due to ABI changes when switching between different client libraries," |
3255 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
3256 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
3257 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
3258 |
- fi |
3259 |
-} |
3260 |
- |
3261 |
-src_prepare() { |
3262 |
- java-pkg-opt-2_src_prepare |
3263 |
- if use tcmalloc; then |
3264 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
3265 |
- fi |
3266 |
- |
3267 |
- # Don't build bundled xz-utils for tokudb |
3268 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
3269 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
3270 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
3271 |
- |
3272 |
- # Remove the bundled groonga |
3273 |
- # There is no CMake flag, it simply checks for existance |
3274 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
3275 |
- |
3276 |
- eapply "${PATCHES[@]}" |
3277 |
- eapply_user |
3278 |
-} |
3279 |
- |
3280 |
-src_configure(){ |
3281 |
- # bug 508724 mariadb cannot use ld.gold |
3282 |
- tc-ld-disable-gold |
3283 |
- |
3284 |
- local MYSQL_CMAKE_NATIVE_DEFINES=( |
3285 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
3286 |
- -DWITH_PCRE=system |
3287 |
- ) |
3288 |
- local MYSQL_CMAKE_EXTRA_DEFINES=( |
3289 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
3290 |
- -DAUTH_GSSAPI_PLUGIN_TYPE="$(usex kerberos DYNAMIC OFF)" |
3291 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
3292 |
- -DWITH_EXTERNAL_ZLIB=YES |
3293 |
- -DSUFFIX_INSTALL_DIR="" |
3294 |
- -DINSTALL_INCLUDEDIR=include/mysql |
3295 |
- -DINSTALL_INFODIR=share/info |
3296 |
- -DINSTALL_LIBDIR=$(get_libdir) |
3297 |
- -DINSTALL_ELIBDIR=$(get_libdir)/mariadb |
3298 |
- -DINSTALL_MANDIR=share/man |
3299 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
3300 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
3301 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
3302 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
3303 |
- -DWITH_UNITTEST=OFF |
3304 |
- ) |
3305 |
- |
3306 |
- if use test ; then |
3307 |
- MYSQL_CMAKE_EXTRA_DEFINES+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
3308 |
- fi |
3309 |
- |
3310 |
- if use server ; then |
3311 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
3312 |
- if ! use extraengine ; then |
3313 |
- MYSQL_CMAKE_NATIVE_DEFINES+=( |
3314 |
- -DPLUGIN_FEDERATED=NO |
3315 |
- -DPLUGIN_FEDERATEDX=NO ) |
3316 |
- fi |
3317 |
- |
3318 |
- MYSQL_CMAKE_NATIVE_DEFINES+=( |
3319 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
3320 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
3321 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
3322 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
3323 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
3324 |
- -DPLUGIN_CASSANDRA=NO |
3325 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
3326 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
3327 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
3328 |
- -DCONNECT_WITH_MYSQL=1 |
3329 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
3330 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
3331 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
3332 |
- -DWITH_WSREP=$(usex galera) |
3333 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
3334 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
3335 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
3336 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
3337 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
3338 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
3339 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
3340 |
- -DINSTALL_SQLBENCHDIR=share/mariadb |
3341 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
3342 |
- ) |
3343 |
- if use test ; then |
3344 |
- # This is needed for the new client lib which tests a real, open server |
3345 |
- MYSQL_CMAKE_NATIVE_DEFINES+=( -DSKIP_TESTS=ON ) |
3346 |
- fi |
3347 |
- fi |
3348 |
- mysql-multilib-r1_src_configure |
3349 |
-} |
3350 |
- |
3351 |
-src_install() { |
3352 |
- # wrap the config scripts |
3353 |
- local MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config /usr/bin/mysql_config ) |
3354 |
- multilib-minimal_src_install |
3355 |
-} |
3356 |
- |
3357 |
-# Intentionally override eclass function |
3358 |
-multilib_src_install() { |
3359 |
- cmake-utils_src_install |
3360 |
- |
3361 |
- # Make sure the vars are correctly initialized |
3362 |
- mysql_init_vars |
3363 |
- |
3364 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
3365 |
- if [[ -f "${D}${MY_INCLUDEDIR}/private/config.h" ]] ; then |
3366 |
- rm "${D}${MY_INCLUDEDIR}/private/config.h" || die |
3367 |
- fi |
3368 |
- |
3369 |
- if ! multilib_is_native_abi && use server ; then |
3370 |
- insinto /usr/include/mysql/private |
3371 |
- doins "${S}"/sql/*.h |
3372 |
- fi |
3373 |
- |
3374 |
- # Install compatible symlinks to libmysqlclient |
3375 |
- use static-libs && dosym libmariadbclient.a "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.a" |
3376 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so" |
3377 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so.${SUBSLOT}" |
3378 |
- |
3379 |
- # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. |
3380 |
- find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die |
3381 |
-} |
3382 |
- |
3383 |
-multilib_src_install_all() { |
3384 |
- # Make sure the vars are correctly initialized |
3385 |
- mysql_init_vars |
3386 |
- |
3387 |
- # Convenience links |
3388 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
3389 |
- dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze" |
3390 |
- dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" |
3391 |
- dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" |
3392 |
- |
3393 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
3394 |
- if [[ -d "${ED}/usr/data" ]] ; then |
3395 |
- rm -Rf "${ED}/usr/data" || die |
3396 |
- fi |
3397 |
- |
3398 |
- # Unless they explicitly specific USE=test, then do not install the |
3399 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
3400 |
- # validation of your database configuration after tuning it. |
3401 |
- if ! use test ; then |
3402 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
3403 |
- fi |
3404 |
- |
3405 |
- # Configuration stuff |
3406 |
- einfo "Building default configuration ..." |
3407 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
3408 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
3409 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
3410 |
- eprefixify "${TMPDIR}/my.cnf" |
3411 |
- doins "${TMPDIR}/my.cnf" |
3412 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
3413 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
3414 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
3415 |
- doins "${TMPDIR}/50-distro-client.cnf" |
3416 |
- |
3417 |
- if use server ; then |
3418 |
- mycnf_src="my.cnf.distro-server" |
3419 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
3420 |
- "${FILESDIR}/${mycnf_src}" \ |
3421 |
- > "${TMPDIR}/my.cnf.ok" || die |
3422 |
- if use prefix ; then |
3423 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
3424 |
- "${TMPDIR}/my.cnf.ok" || die |
3425 |
- fi |
3426 |
- if use latin1 ; then |
3427 |
- sed -i \ |
3428 |
- -e "/character-set/s|utf8|latin1|g" \ |
3429 |
- "${TMPDIR}/my.cnf.ok" || die |
3430 |
- fi |
3431 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
3432 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
3433 |
- einfo "Creating initial directories" |
3434 |
- # Empty directories ... |
3435 |
- diropts "-m0750" |
3436 |
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then |
3437 |
- dodir "${MY_DATADIR#${EPREFIX}}" |
3438 |
- keepdir "${MY_DATADIR#${EPREFIX}}" |
3439 |
- chown -R mysql:mysql "${D}/${MY_DATADIR}" |
3440 |
- fi |
3441 |
- |
3442 |
- diropts "-m0755" |
3443 |
- local folder |
3444 |
- for folder in "${MY_LOGDIR#${EPREFIX}}" ; do |
3445 |
- dodir "${folder}" |
3446 |
- keepdir "${folder}" |
3447 |
- chown -R mysql:mysql "${ED}/${folder}" |
3448 |
- done |
3449 |
- |
3450 |
- einfo "Including support files and sample configurations" |
3451 |
- docinto "support-files" |
3452 |
- local script |
3453 |
- for script in \ |
3454 |
- "${S}"/support-files/magic |
3455 |
- do |
3456 |
- [[ -f "$script" ]] && dodoc "${script}" |
3457 |
- done |
3458 |
- |
3459 |
- docinto "scripts" |
3460 |
- for script in "${S}"/scripts/mysql* ; do |
3461 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
3462 |
- done |
3463 |
- fi |
3464 |
- |
3465 |
- #Remove mytop if perl is not selected |
3466 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
3467 |
-} |
3468 |
- |
3469 |
-# Official test instructions: |
3470 |
-# USE='embedded extraengine perl server openssl static-libs' \ |
3471 |
-# FEATURES='test userpriv -usersandbox' \ |
3472 |
-# ebuild mariadb-X.X.XX.ebuild \ |
3473 |
-# digest clean package |
3474 |
-multilib_src_test() { |
3475 |
- |
3476 |
- if ! multilib_is_native_abi ; then |
3477 |
- einfo "Server tests not available on non-native abi". |
3478 |
- return 0; |
3479 |
- fi |
3480 |
- |
3481 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
3482 |
- local retstatus_unit |
3483 |
- local retstatus_tests |
3484 |
- |
3485 |
- if use server ; then |
3486 |
- einfo "Skipping server tests due to minimal build." |
3487 |
- return 0 |
3488 |
- fi |
3489 |
- |
3490 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
3491 |
- # localhost. Also causes weird failures. |
3492 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
3493 |
- |
3494 |
- if [[ $UID -eq 0 ]]; then |
3495 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
3496 |
- fi |
3497 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
3498 |
- |
3499 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
3500 |
- |
3501 |
- # Run CTest (test-units) |
3502 |
- cmake-utils_src_test |
3503 |
- retstatus_unit=$? |
3504 |
- |
3505 |
- # Ensure that parallel runs don't die |
3506 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
3507 |
- # Enable parallel testing, auto will try to detect number of cores |
3508 |
- # You may set this by hand. |
3509 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
3510 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
3511 |
- |
3512 |
- # create directories because mysqladmin might run out of order |
3513 |
- mkdir -p "${T}"/var-tests{,/log} |
3514 |
- |
3515 |
- # Run mysql tests |
3516 |
- pushd "${TESTDIR}" || die |
3517 |
- |
3518 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
3519 |
- # false positives: |
3520 |
- # |
3521 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
3522 |
- # main.mysql_client_test_comp: |
3523 |
- # segfaults at random under Portage only, suspect resource limits. |
3524 |
- |
3525 |
- local t |
3526 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
3527 |
- mysql-multilib-r1_disable_test "$t" "False positive due to varying policies" |
3528 |
- done |
3529 |
- |
3530 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
3531 |
- main.mysql_client_test_comp ; do |
3532 |
- mysql-multilib-r1_disable_test "$t" "False positives in Gentoo" |
3533 |
- done |
3534 |
- |
3535 |
- # run mysql-test tests |
3536 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder |
3537 |
- retstatus_tests=$? |
3538 |
- |
3539 |
- popd || die |
3540 |
- |
3541 |
- # Cleanup is important for these testcases. |
3542 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
3543 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
3544 |
- |
3545 |
- local failures="" |
3546 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
3547 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
3548 |
- |
3549 |
- [[ -z "$failures" ]] || eerror "Test failures: $failures" |
3550 |
- einfo "Tests successfully completed" |
3551 |
-} |
3552 |
|
3553 |
diff --git a/dev-db/mariadb/metadata.xml b/dev-db/mariadb/metadata.xml |
3554 |
index 69cc5da..d9c8a04 100644 |
3555 |
--- a/dev-db/mariadb/metadata.xml |
3556 |
+++ b/dev-db/mariadb/metadata.xml |
3557 |
@@ -12,6 +12,7 @@ |
3558 |
<use> |
3559 |
<flag name="backup">Build mariadb-backup which supports SST and hot backup of InnoDB, Aria and MyISAM including compression and encryption</flag> |
3560 |
<flag name="big-tables">Make tables contain up to 1.844E+19 rows</flag> |
3561 |
+ <flag name="client-libs">Build the client libraries from the server package instead of the C Connector packages</flag> |
3562 |
<flag name="cluster">Add support for NDB clustering (deprecated)</flag> |
3563 |
<flag name="community">Enables the community features from upstream.</flag> |
3564 |
<flag name="embedded">Build embedded server (libmysqld)</flag> |
3565 |
@@ -28,6 +29,7 @@ |
3566 |
<flag name="max-idx-128">Raise the max index per table limit from 64 to 128</flag> |
3567 |
<flag name="minimal">Install client programs only, no server</flag> |
3568 |
<flag name="mroonga">Add support for the Mroonga engine for interfacing with the Groonga text search</flag> |
3569 |
+ <flag name="numa">Enable NUMA support using sys-process/numactl (NUMA kernel support is also required)</flag> |
3570 |
<flag name="openssl">Enable SSL connections and crypto functions using <pkg>dev-libs/openssl</pkg></flag> |
3571 |
<flag name="oqgraph">Add support for the Open Query GRAPH engine</flag> |
3572 |
<flag name="pam">Enable the optional PAM authentication plugin for the server</flag> |
3573 |
@@ -37,6 +39,7 @@ |
3574 |
<flag name="server">Build the server program</flag> |
3575 |
<flag name="sphinx">Add suport for the sphinx full-text search engine</flag> |
3576 |
<flag name="sst-rsync">Add tools needed to support the rsync SST method</flag> |
3577 |
+ <flag name="sst-mariabackup">Add tools needed to support the mariabackup SST method</flag> |
3578 |
<flag name="sst-xtrabackup">Add tools needed to support the xtrabackup and xtrabackup-v2 SST methods</flag> |
3579 |
<flag name="systemtap">Build support for profiling and tracing using <pkg>dev-util/systemtap</pkg></flag> |
3580 |
<flag name="test">Install upstream testsuites for end use.</flag> |