Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mysql:master commit in: dev-db/mysql/
Date: Wed, 31 Jul 2019 13:57:16
Message-Id: 1564581415.41a7f01c3469a9eb7795c06805772a748ee0580f.grknight@gentoo
1 commit: 41a7f01c3469a9eb7795c06805772a748ee0580f
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 31 13:56:55 2019 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 31 13:56:55 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=41a7f01c
7
8 dev-db/mysql: Drop old versions
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Manifest-Sign-Key: D1F781EFF9F4A3B6
12 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
13
14 dev-db/mysql/Manifest | 28 +-
15 dev-db/mysql/metadata.xml | 1 -
16 dev-db/mysql/mysql-5.5.60-r1.ebuild | 791 ------------------------------------
17 dev-db/mysql/mysql-5.6.30.ebuild | 165 --------
18 dev-db/mysql/mysql-5.6.40-r1.ebuild | 768 ----------------------------------
19 dev-db/mysql/mysql-5.7.17.ebuild | 210 ----------
20 6 files changed, 22 insertions(+), 1941 deletions(-)
21
22 diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
23 index d5672e5..4ab2b64 100644
24 --- a/dev-db/mysql/Manifest
25 +++ b/dev-db/mysql/Manifest
26 @@ -1,20 +1,36 @@
27 +-----BEGIN PGP SIGNED MESSAGE-----
28 +Hash: SHA256
29 +
30 DIST mysql-4.0.27.tar.gz 11152643 SHA256 c79f83bed7c1ea98e018b8829375b55c1de838d21a526d7f679becc75de00d0f SHA512 188283133e99e1c0b52ac8650aff325d7c9762fbad526c2c67b26dd614f2a86afb247a3f55ff071be1d44cd13060b9d7cca08ba1d758a04d2369381fa104454e WHIRLPOOL d3964468635eae0caf7fc8fb7b3576da12d49264bd9b797bb2191da8c6b91ca46321fb090e994df2b93b43f50686dcc4f735bdff03b49a3176fa746d5c4a60ab
31 DIST mysql-4.1.22.tar.gz 17761101 SHA256 6bd2436fd0f233bb1518e15975cb4e9fa4434acb53c3c3cd7d4648219abf58e9 SHA512 9de1c2b27cf428a10f67a6217fc2783b638beb6345e2127a4163ceb286073886d223de861c40be0ab36ea78ec5f33ccd5ee457d1e35e67b081d629118b68d390 WHIRLPOOL b40ca2e0d07fc0bd504e57b7eb005d36cf842bb668e93722c723bcc5a797dc9b456ee8971ea99bfc2b9119a2e19ee599f8441eb4601709eb4238196a27319257
32 DIST mysql-5.0.96.tar.gz 22686667 SHA256 43853814775158aa1650f483530a7dde153957579e3349e3ec780b89d741fc84 SHA512 2e3b4ac221c1c1c11618dc79067a7feff680380fcea435813287b02cb0dff45fb5a32a4393c53cf13165f6efc99dbf347a9388ad364cfdf2e392760a310aa5a9 WHIRLPOOL 3e167e4ff4c56095fbdee55b7e619c9b7ad2120eb72c9a58fe77a023ab6e7498c74e2053876e61687d7812f9ff7022303728ddda49732e7569035684263d2517
33 DIST mysql-5.1.73.tar.gz 24023347 SHA256 05ebe21305408b24407d14b77607a3e5ffa3c300e03f1359d3066f301989dcb5 SHA512 2e3651ebc1370dad7e01158cdd99133ed3f90c985114766b6282d58b743ae7bce16db797e82819fa5bbc2fa53d89811fd76b278c7459338288e7957634a8c3ff WHIRLPOOL f47c3fe1cd98b8ca2163646c760bd9763c65eab0591b31fe30a8c55c72c8b10d7b549b394493695cf98f50999364409ef8158661141277e6d99b011835aef942
34 -DIST mysql-5.5.60.tar.gz 21025041 SHA256 a34112e1748823f6dfd0d129fe29a629cf35b8702f9dfaf1f24caf89ab523d1c SHA512 734395f3ce2c12e7703fe48d5bb2ce85ff8d7f04ae51cbe2d04a46b72b9689f804e5b498ae0b4722b0c098e2eed43d4f93b622964059525e6d9d14a47d55f775 WHIRLPOOL cf00fad25570cc991c4f4666667cb35a7fdec3831e233f2647c99761c1bcec665fc9a425608b40111095ffe8fddd37bf2a184880c7e698337999c5022e746abf
35 DIST mysql-5.5.62.tar.gz 21111902 SHA256 b1e7853bc1f04aabf6771e0ad947f35ac8d237f4b35d0706d1095c9526ff99d7 SHA512 1080a3989c20bbbfe98739f99dacd183f2087ceee5147845852144240386808568af4c908ecdbccdcb6114000ab760ed7257492834d50018eff9520260fd91ce WHIRLPOOL f55b30e0839025180945d9d8244613b46f0b635bb75d4a409a82bdda0262374f2df1e9124f3abdad58e0a603fc8c3b2b34e235037f6613923385a903bfb9945b
36 -DIST mysql-5.6.30.tar.gz 32223818 SHA256 48464df00aad9b9dfc26c903529ddad944a7562aa28e66e98e4f3f0c35179deb SHA512 b9f5b22a0557fbdd765fd3c379395584dd35bbec2d7504eb132f734129c0d95d24dc538c9b64524870bbecb92fa2f1e95b49ccfe22531ed17ec1e754f08d491b WHIRLPOOL f56d4e9d2ac801605bb941d1a8ba4b876d838a5e3bdac2e644477e87f2e5d439594c28d0e1c1d0c45ebb38fbf4183c429dc8c53bd7aa76aeea95acd1774ca71e
37 -DIST mysql-5.6.40.tar.gz 32083035 SHA256 1048a7abedba851efa62868e4d28d0be8828162b53903cd68e4f29546418d92d SHA512 c8e458b4cd34cae87f1b088ed2188bd00de8cdc42709d5964e82fa2e4aaecfc12a75ae006c54ffa0d3d286fbdef9704d0cbb83436437d5705fb8921d960e758c WHIRLPOOL a962d9223fbd66f47d7859458b82793c6a74e81c0dce69b222a274b92823245eb121302af10f9a476e88bc88edfdccddaa681efd3357b23f4880da05e3fbfb98
38 -DIST mysql-boost-5.7.17.tar.gz 61480982 SHA256 b75bba87199ef6a6ccc5dfbcaf70949009dc12089eafad8c5254afc9002aa903 SHA512 a1512abeba307fd21687677d2ee4bf20ced373312824de034e9b340d97e67eb4fcc5caa4ad7d9f58d6c0ddf57f6f6c0b0978e7b01c46f397ac661da843e3dfa6 WHIRLPOOL c9c078afdb1f8eb4405593611c179552493265c50b1eb1bac8cecadbac07103a11a05daf8c26d3d751526d5a69f14a8b6fce40b1aaaac7b9b4680679bf61bc4f
39 DIST mysql-boost-5.7.21.tar.gz 48931457 SHA256 ad29ecb6fb3c3571394fe231633a2d1d188d49e9eb749daa4e8799b7630daa09 SHA512 29a1bfa1f5d5e354b66ca8c9fdaf7ee88de3d57bee3c6368861b46ab6d992affb7604577c06f241df542b96ab088c055473fd76584376dd149956ae1dd8726f3 WHIRLPOOL 0a86c9e088c870e5e8bf90b15ba53cd61e126143c5147adcbf5273c5dd8018bfe23fbbfd1b5055b9e9ece0a2b1fab21409eaa9bd939ec248410a92d4fe0052ab
40 DIST mysql-extras-20070105.tar.bz2 50005 SHA256 17697bf70acffd0eeefd976b5ef06dd36080273bf7e805b51a31d72f5f2c5172 SHA512 65e8fd1f9cc71083dbcfaffc331171e0d7deedbd784e416a4b629139f71cc102a84fa62c2d9e48310a18571ef7f06153911ee75c5d7bb6ba88807c287e7cbf34 WHIRLPOOL 3f858fbed6f57ffac863c29bef09a658e3d9f57cf4c6b5c62537973ae44f217344a8592ad311b14b1e7e8d475434b3c69339a8d2873c498ba712ff6f5e128cec
41 DIST mysql-extras-20090228-2228Z.tar.bz2 254048 SHA256 03a986a5c5ae57f1436553565239613e978ae11e12834fcb275ec6457b12b6fb SHA512 b347c0894d45cff2c10e26c12d7586c335811b607cd760b48e51743e74c55ace820d2d50fac2ce72543c14b9b4d15afce336bd956ea8a820df4a651f23e3b79f WHIRLPOOL 4d89a44791ec7e95baa3822bb62a3638c86d24bcfc777b9ff5a8d26020e7401159a3c03ebda9907fcbf02589b80726f2daa5bf2498d8e6e6e33540edf9b1d551
42 DIST mysql-extras-20120401-2131Z.tar.bz2 1835097 SHA256 95e531799ed267c566da8b0759da78d0351d6004c7c8a45018054e287a989495 SHA512 0625e1f06e04c7841256955950dd7766a5f03d4ade2aee3c13335f08acff374933ed1fd7ddea214eaaa3531d7373ef094734f5c00530555347f058f5ec4d9d36 WHIRLPOOL f2c6e9387b38b609d3bfea83c6983c456d30a9dcf95c256a44402d4c63fa22543d55d6afa9b8dbf4238dcadf32fac3daec5031d50c8a4acf7a074d04fbede213
43 DIST mysql-extras-20140514-0124Z.tar.bz2 1493742 SHA256 0cdda9f8587532375274510a8a1f8fe5e80f10cfdf851a01074109803f7ee4cf SHA512 7a798809809b35a515a3475be5f1a96547d495592c83c4cf5c79fb07ceb45a04000da8922d051004c0f2d944f92ca47b75ad08d06a8dccca2ae9f94778d31a7e WHIRLPOOL 371446d80cd9fa22a28eeecde8d18c9c3ca76db9bc57a4ab2073ed0fc1d19a70a06a33cb92257a671849e4bad8bfb9f235272ee1221c7c21ce5f45bc900a59cc
44 -DIST mysql-extras-20160212-0233Z.tar.bz2 297332 SHA256 01a52587ef1335b2795197d2e547c0b3a1e4b705db09f96cdfb45d2152b6536b SHA512 956dbdcb987556c0625944848f97a36d096cd1f1712a2e051dd027f2856d3c6e94a18d23faca71882260c4b12ee329e3a5f569443b877a3c3e5e88146bfac916 WHIRLPOOL e3837d329ddd137be60fe9d0b37f35ed2e0e7fe1383f38ee45617be288ae318a444e6befdfbaf64b07d4a88ec47fec5cd88d733ecd5bb32ce40f3ba8d09573cd
45 DIST mysql-extras-20180312-2011Z.tar.bz2 319047 SHA256 5d83747593b2276ecaf253b193814df2bfe170de57ceb7565e3d9f215df92254 SHA512 b0aa9fc8fbc050451ef147cee99b00cf10d34a71641837821e78655241f7d79a94fe2efb4cef9a23fe9741e08ada2fc0b58ef3b3663752bc567babfbcaa547c8 WHIRLPOOL 29085d38c285e62fa5925e70e01fda98ce5582e660b84fa09992049b5c222d1c14e73b94c63cb754bd94df00ce154b24ea5d4ee472de1766b6941cb05503c493
46 -DIST mysql-extras-20180628-0201Z.tar.bz2 322141 SHA256 8317028fa98cc4abd819d11191fb82026eb9c4d23490b7c1d42590731fbc834d SHA512 71a3800ec091b41e41d25536199149eb714c0bbfc0f6fc478e8e4dcaf4cf87a7e4d49c513da3c9badc0de810d7d78c05ad91dd898e45005b42136346237de42a WHIRLPOOL 71a5d8d09ede40a2d7adad6d57e1b546fabb34610c92ede6e0b472c0d84ad016e39ec7fcb038c708723535542dfd9caace22f2b8dd822951ba8c0ee2778c462b
47 DIST mysql-extras-20180804-2323Z.tar.bz2 322215 SHA256 fa962215d2dba8f781f25351a1f8f70c79d4ab92eef438ec14824aadf12a9b34 SHA512 efd9d416f394cc61b977ab76f05ab3acc5803ff8bdee8e1dbc65cc5b3f07e4f9742140d9586c028908b10fcc44f21c98ebffdebcc5c3578acbe05b07526bcb3d WHIRLPOOL 175407174870609128c502a9843d2c3f3f40acdd24d3263bbe98b30d6b0586821f642ba57c0519ae5e795a883bf7eb736a4da6de5a6590407a3db560105d5140
48 DIST pbxt-1.0.11-6-pre-ga.tar.gz 3156307 SHA256 71ff3d86e9e5691f3efe541bf31f55a7ec2a88af27df6ad853b65902e00e6d12 SHA512 fa238303f06e0a9adfb10bd5a2e1d2e4850d2c17a350af3874cbff099d6e47b7c555d750c584d06a3ca87c1eb1e9301a9619d8d9a4cffb7fd0169b2b3a63c80c WHIRLPOOL 05cdd39f6f5dafff2def0062a00a24eff6cf6d8754f622b133365cef47cd6b828df5500ac407359d0793a75dd239ec1e49a13d2400a01ddf8b4cef7466e86962
49 DIST percona-xtradb-1.0.6-10.tar.gz 1676716 SHA256 e3aa818f13cf669412e59ad194eae8eada7a857bf7a4260e4bb41cab4d7ae39c SHA512 72e4b656b22a0420e6f5935dc28060e5c50fbeb48c6d1ae430579d9ccef8042fdd4dde128cc977b903de6221f7021e8c87ea29fe6a8a8c74edb84bf54ab889f3 WHIRLPOOL a916879be315498da27c60992efa4d19e91305b81242925e161547f3fb97a820256e1d07863e9e007ef843af54cd087ce5ac47d5ed1b70862da6cd5a9d81eccf
50 +-----BEGIN PGP SIGNATURE-----
51 +Version: GnuPG v2
52 +
53 +iQKTBAEBCAB9FiEEZsLkTtkOMnWOfVXA0feB7/n0o7YFAl1BniZfFIAAAAAALgAo
54 +aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDY2
55 +QzJFNDRFRDkwRTMyNzU4RTdENTVDMEQxRjc4MUVGRjlGNEEzQjYACgkQ0feB7/n0
56 +o7ahww//auRw72e8YFZr47EKU5QgBPF09Sno4320t9rtSpRPoAVLdfkhnsmwxiA7
57 +sqV/5hT0NkWtNVee5RsxzVkW4s45I8Q0gGjqD+WGc5qP4iNKYflUgSiXXLlQ1MY8
58 +IsIkofRPit6XmjG1QAdjftwiZREZH8c1hlHPZB0UHwOMoZMH0GWUljhS02kK4gK6
59 +8WK5WUYCN29i8SvTGE7rCQOp3hdIcwRApM4fciERbNK3bqUsmLb8R7qRj1CvqrXL
60 +B971GLypt1PNFuBMQPd/iU/sasrZY2ncU3rO0wOcvAoUSmc3qIx/SjUA/e9CdJNN
61 +uXw4tCXRptC+a8Z0hvTGtlN9SWHr5hxSlv9au3GgfGPSFnVDXiZuKbObRzvkzeLs
62 +YuWhULl6IZMOd5hhhyjI3Ct7M14+yIvxj4DsU+sXni3qrHT82/9hWVZrBydRF0tJ
63 +5wp0B4vaf78cekw+NKmevxa3BXAGAlpRRfRnu4Cx4TDv2O9kLzG7/oPEIWHhStYw
64 +sDyaxH6qM1CTroIcYOT9NQfdtZU4RjdL5Lcf15zB+ZcYHzmupZbd6JIczXqggl4g
65 +MGwr+O8axkwzRoiHr0q2WQNHUIMrtFrbunkxzvhNKkSsBE361SLO6r+9Qp57Sy3w
66 +mb/ulSHGYEGmICbh03Z/oHalpw7BE78xCB/7IhA8s1MR9NR1xcA=
67 +=Jr+Z
68 +-----END PGP SIGNATURE-----
69
70 diff --git a/dev-db/mysql/metadata.xml b/dev-db/mysql/metadata.xml
71 index c89ecc4..59b0429 100644
72 --- a/dev-db/mysql/metadata.xml
73 +++ b/dev-db/mysql/metadata.xml
74 @@ -15,7 +15,6 @@
75 <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
76 <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
77 <flag name="libressl">Enable SSL connections and crypto functions using <pkg>dev-libs/libressl</pkg></flag>
78 - <flag name="openssl">Enable SSL connections and crypto functions using <pkg>dev-libs/openssl</pkg></flag>
79 <flag name="max-idx-128">Raise the max index per table limit from 64 to 128</flag>
80 <flag name="minimal">Install client programs only, no server</flag>
81 <flag name="numa">Enable NUMA support using sys-process/numactl (NUMA kernel support is also required)</flag>
82
83 diff --git a/dev-db/mysql/mysql-5.5.60-r1.ebuild b/dev-db/mysql/mysql-5.5.60-r1.ebuild
84 deleted file mode 100644
85 index 36a1e5f..0000000
86 --- a/dev-db/mysql/mysql-5.5.60-r1.ebuild
87 +++ /dev/null
88 @@ -1,791 +0,0 @@
89 -# Copyright 1999-2018 Gentoo Foundation
90 -# Distributed under the terms of the GNU General Public License v2
91 -
92 -EAPI="6"
93 -MY_EXTRAS_VER="20180628-0201Z"
94 -SUBSLOT="18"
95 -
96 -# Keeping eutils in EAPI=6 for emktemp in pkg_config
97 -
98 -inherit eutils flag-o-matic prefix toolchain-funcs user cmake-utils multilib-build
99 -
100 -SRC_URI="https://cdn.mysql.com/Downloads/MySQL-5.5/${P}.tar.gz
101 - https://downloads.mysql.com/archives/MySQL-5.5/${P}.tar.gz"
102 -# Gentoo patches to MySQL
103 -if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
104 - SRC_URI="${SRC_URI}
105 - mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
106 - https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
107 - https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
108 - https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
109 - https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
110 -fi
111 -
112 -HOMEPAGE="https://mysql.com/"
113 -DESCRIPTION="An enhanced, drop-in replacement for MySQL"
114 -LICENSE="GPL-2"
115 -SLOT="0/${SUBSLOT:-0}"
116 -IUSE="bindist client-libs debug extraengine jemalloc latin1 libressl
117 - +perl profiling selinux +server static static-libs systemtap tcmalloc
118 - test yassl"
119 -
120 -# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
121 -RESTRICT="!bindist? ( bindist ) libressl? ( test )"
122 -
123 -REQUIRED_USE="?? ( tcmalloc jemalloc )
124 - static? ( yassl )"
125 -
126 -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"
127 -
128 -# Shorten the path because the socket path length must be shorter than 107 chars
129 -# and we will run a mysql server during test phase
130 -S="${WORKDIR}/mysql"
131 -
132 -if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then
133 - MY_PATCH_DIR="${WORKDIR%/}/mysql-extras"
134 - inherit git-r3
135 - EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git"
136 - EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras"
137 - EGIT_CLONE_TYPE=shallow
138 -else
139 - MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}"
140 -fi
141 -
142 -PATCHES=(
143 - "${MY_PATCH_DIR}/01050_all_mysql_config_cleanup-5.5.patch"
144 - "${MY_PATCH_DIR}/02040_all_embedded-library-shared-5.5.10.patch"
145 - "${MY_PATCH_DIR}/20001_all_fix-minimal-build-cmake-mysql-5.5.41.patch"
146 - "${MY_PATCH_DIR}/20002_all_mysql-va-list.patch"
147 - "${MY_PATCH_DIR}/20006_all_cmake_elib-mysql-5.5.53.patch"
148 - "${MY_PATCH_DIR}/20007_all_cmake-debug-werror-5.6.22.patch"
149 - "${MY_PATCH_DIR}/20008_all_mysql-tzinfo-symlink-5.6.37.patch"
150 - "${MY_PATCH_DIR}/20009_all_mysql_myodbc_symbol_fix-5.5.38.patch"
151 - "${MY_PATCH_DIR}/20018_all_mysql-5.5.60-without-clientlibs-tools.patch"
152 - "${MY_PATCH_DIR}/20027_all_mysql-5.5-perl5.26-includes.patch"
153 - "${MY_PATCH_DIR}/20030_all_mysql-5.5-fix-client-mysql-type.patch"
154 -)
155 -
156 -# Be warned, *DEPEND are version-dependant
157 -# These are used for both runtime and compiletime
158 -COMMON_DEPEND="
159 - kernel_linux? (
160 - sys-process/procps:0=
161 - dev-libs/libaio:0=
162 - )
163 - >=sys-apps/sed-4
164 - >=sys-apps/texinfo-4.7-r1
165 - jemalloc? ( dev-libs/jemalloc:0= )
166 - tcmalloc? ( dev-util/google-perftools:0= )
167 - systemtap? ( >=dev-util/systemtap-1.3:0= )
168 - !yassl? (
169 - !libressl? ( dev-libs/openssl:0= !>=dev-libs/openssl-1.1 )
170 - libressl? ( dev-libs/libressl:0= )
171 - )
172 - >=sys-libs/zlib-1.2.3:0=
173 - sys-libs/ncurses:0=
174 - !bindist? (
175 - >=sys-libs/readline-4.1:0=
176 - )
177 - !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] )
178 -"
179 -DEPEND="virtual/yacc
180 - static? ( sys-libs/ncurses[static-libs] )
181 - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
182 - ${COMMON_DEPEND}"
183 -RDEPEND="selinux? ( sec-policy/selinux-mysql )
184 - client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c )
185 - !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
186 - server? ( !prefix? ( dev-db/mysql-init-scripts ) )
187 - ${COMMON_DEPEND}
188 - perl? ( !dev-db/mytop
189 - virtual/perl-Getopt-Long
190 - dev-perl/TermReadKey
191 - virtual/perl-Term-ANSIColor
192 - virtual/perl-Time-HiRes )
193 -"
194 -# For other stuff to bring us in
195 -# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
196 -PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
197 -
198 -pkg_setup() {
199 - if [[ ${MERGE_TYPE} != binary ]] ; then
200 - local GCC_MAJOR_SET=$(gcc-major-version)
201 - local GCC_MINOR_SET=$(gcc-minor-version)
202 - # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
203 - # non x86{,_64} arches
204 - if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
205 - ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
206 - eerror "${PN} needs to be built with gcc-4.7 or later."
207 - eerror "Please use gcc-config to switch to gcc-4.7 or later version."
208 - die
209 - fi
210 - fi
211 - if has test ${FEATURES} && \
212 - use server && ! has userpriv ${FEATURES} ; then
213 - eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
214 - fi
215 -
216 - # This should come after all of the die statements
217 - enewgroup mysql 60 || die "problem adding 'mysql' group"
218 - enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
219 -}
220 -
221 -pkg_postinst() {
222 - # Make sure the vars are correctly initialized
223 - mysql_init_vars
224 -
225 - # Create log directory securely if it does not exist
226 - [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
227 -
228 - if use server ; then
229 - if [[ -z "${REPLACING_VERSIONS}" ]] ; then
230 - einfo
231 - elog "You might want to run:"
232 - elog "\"emerge --config =${CATEGORY}/${PF}\""
233 - elog "if this is a new install."
234 - elog
235 - elog "If you are switching server implentations, you should run the"
236 - elog "mysql_upgrade tool."
237 - einfo
238 - else
239 - einfo
240 - elog "If you are upgrading major versions, you should run the"
241 - elog "mysql_upgrade tool."
242 - einfo
243 - fi
244 -
245 - einfo
246 - elog "Be sure to edit the my.cnf file to activate your cluster settings."
247 - elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\""
248 - elog "The first time the cluster is activated, you should add"
249 - elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node."
250 - elog "This option should then be removed for subsequent starts."
251 - einfo
252 - fi
253 -}
254 -
255 -src_unpack() {
256 - unpack ${A}
257 - # Grab the patches
258 - [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack
259 -
260 - mv -f "${WORKDIR%/}/${P}" "${S}" || die
261 -}
262 -
263 -src_prepare() {
264 - _disable_engine() {
265 - echo > "${S%/}/storage/${1}/CMakeLists.txt" || die
266 - }
267 -
268 - _disable_plugin() {
269 - echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die
270 - }
271 -
272 - if use tcmalloc; then
273 - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die
274 - fi
275 -
276 - if use jemalloc; then
277 - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S%/}/sql/CMakeLists.txt" || die
278 - fi
279 -
280 - # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
281 - if [[ -d "${S}/support-files/SELinux" ]] ; then
282 - echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
283 - fi
284 -
285 - if use libressl ; then
286 - sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
287 - "${S}/cmake/ssl.cmake" || die
288 - fi
289 -
290 - local plugin
291 - local server_plugins=( semisync )
292 - local test_plugins=( audit_null daemon_example fulltext )
293 - if ! use server; then # These plugins are for the server
294 - for plugin in "${server_plugins[@]}" ; do
295 - _disable_plugin "${plugin}"
296 - done
297 - fi
298 -
299 - if ! use test; then # These plugins are only used during testing
300 - for plugin in "${test_plugins[@]}" ; do
301 - _disable_plugin "${plugin}"
302 - done
303 - fi
304 -
305 - # Don't build example
306 - _disable_engine example
307 - _disable_engine ndb
308 -
309 - cmake-utils_src_prepare
310 -}
311 -
312 -src_configure(){
313 - # Bug #114895, bug #110149
314 - filter-flags "-O" "-O[01]"
315 -
316 - append-cxxflags -felide-constructors
317 -
318 - # bug #283926, with GCC4.4, this is required to get correct behavior.
319 - append-flags -fno-strict-aliasing
320 -
321 - CMAKE_BUILD_TYPE="RelWithDebInfo"
322 -
323 - # debug hack wrt #497532
324 - mycmakeargs=(
325 - -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
326 - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
327 - -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr"
328 - -DDEFAULT_SYSCONFDIR="${EPREFIX%/}/etc/mysql"
329 - -DINSTALL_BINDIR=bin
330 - -DINSTALL_DOCDIR=share/doc/${PF}
331 - -DINSTALL_DOCREADMEDIR=share/doc/${PF}
332 - -DINSTALL_INCLUDEDIR=include/mysql
333 - -DINSTALL_INFODIR=share/info
334 - -DINSTALL_LIBDIR=$(get_libdir)
335 - -DINSTALL_MANDIR=share/man
336 - -DINSTALL_MYSQLSHAREDIR=share/mysql
337 - -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
338 - -DINSTALL_SCRIPTDIR=share/mysql/scripts
339 - -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql"
340 - -DINSTALL_SBINDIR=sbin
341 - -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mysql"
342 - -DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
343 - -DWITH_UNIT_TESTS=$(usex test ON OFF)
344 - -DWITH_ZLIB=system
345 - -DENABLED_LOCAL_INFILE=1
346 - -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock"
347 - # The build forces this to be defined when cross-compiling. We pass it
348 - # all the time for simplicity and to make sure it is actually correct.
349 - -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
350 - -DWITHOUT_CLIENTLIBS=YES
351 - -DWITH_READLINE=$(usex bindist 1 0)
352 - -DENABLE_DTRACE=$(usex systemtap)
353 - )
354 - if use test ; then
355 - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test )
356 - else
357 - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
358 - fi
359 -
360 - if ! use yassl ; then
361 - mycmakeargs+=( -DWITH_SSL=system )
362 - else
363 - mycmakeargs+=( -DWITH_SSL=bundled )
364 - fi
365 -
366 - if use server ; then
367 -
368 - # Federated{,X} must be treated special otherwise they will not be built as plugins
369 - if ! use extraengine ; then
370 - mycmakeargs+=(
371 - -DWITHOUT_FEDERATED_STORAGE_ENGINE=1
372 - -DWITHOUT_FEDERATEDX_STORAGE_ENGINE=1 )
373 - fi
374 -
375 - if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
376 - ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
377 - ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
378 - ewarn "You MUST file bugs without these variables set."
379 -
380 - mycmakeargs+=(
381 - -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
382 - -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
383 - )
384 -
385 - elif ! use latin1 ; then
386 - mycmakeargs+=(
387 - -DDEFAULT_CHARSET=utf8
388 - -DDEFAULT_COLLATION=utf8_general_ci
389 - )
390 - else
391 - mycmakeargs+=(
392 - -DDEFAULT_CHARSET=latin1
393 - -DDEFAULT_COLLATION=latin1_swedish_ci
394 - )
395 - fi
396 - mycmakeargs+=(
397 - -DINSTALL_SQLBENCHDIR=share/mysql
398 - -DEXTRA_CHARSETS=all
399 - -DDISABLE_SHARED=$(usex static YES NO)
400 - -DWITH_EMBEDDED_SERVER=OFF
401 - -DENABLED_PROFILING=$(usex profiling)
402 - )
403 -
404 - if use static; then
405 - mycmakeargs+=( -DWITH_PIC=1 )
406 - fi
407 -
408 - # Storage engines
409 - mycmakeargs+=(
410 - -DWITH_ARCHIVE_STORAGE_ENGINE=1
411 - -DWITH_BLACKHOLE_STORAGE_ENGINE=1
412 - -DWITH_CSV_STORAGE_ENGINE=1
413 - -DWITH_HEAP_STORAGE_ENGINE=1
414 - -DWITH_INNOBASE_STORAGE_ENGINE=1
415 - -DWITH_MYISAMMRG_STORAGE_ENGINE=1
416 - -DWITH_MYISAM_STORAGE_ENGINE=1
417 - -DWITH_PARTITION_STORAGE_ENGINE=1
418 - )
419 -
420 - else
421 - mycmakeargs+=(
422 - -DWITHOUT_SERVER=1
423 - -DEXTRA_CHARSETS=none
424 - -DINSTALL_SQLBENCHDIR=
425 - )
426 - fi
427 -
428 - cmake-utils_src_configure
429 -}
430 -
431 -src_compile() {
432 - cmake-utils_src_compile
433 -}
434 -
435 -src_install() {
436 - cmake-utils_src_install
437 -
438 - # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
439 - if [[ -f "${ED%/}/usr/include/mysql/server/private/config.h" ]] ; then
440 - rm "${ED%/}/usr/include/mysql/server/private/config.h" || die
441 - fi
442 -
443 - # Make sure the vars are correctly initialized
444 - mysql_init_vars
445 -
446 - # Convenience links
447 - einfo "Making Convenience links for mysqlcheck multi-call binary"
448 - dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
449 - dosym "mysqlcheck" "/usr/bin/mysqlrepair"
450 - dosym "mysqlcheck" "/usr/bin/mysqloptimize"
451 -
452 - # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
453 - if [[ -d "${ED%/}/usr/data" ]] ; then
454 - rm -Rf "${ED%/}/usr/data" || die
455 - fi
456 -
457 - # Unless they explicitly specific USE=test, then do not install the
458 - # testsuite. It DOES have a use to be installed, esp. when you want to do a
459 - # validation of your database configuration after tuning it.
460 - if ! use test ; then
461 - rm -rf "${D%/}/${MY_SHAREDSTATEDIR}/mysql-test"
462 - fi
463 -
464 - # Configuration stuff
465 - einfo "Building default configuration ..."
466 - insinto "${MY_SYSCONFDIR#${EPREFIX}}"
467 - [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf
468 - local mycnf_src="my.cnf-5.5"
469 - sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
470 - "${FILESDIR%/}/${mycnf_src}" \
471 - > "${TMPDIR%/}/my.cnf.ok" || die
472 - use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok"
473 - if use latin1 ; then
474 - sed -i \
475 - -e "/character-set/s|utf8|latin1|g" \
476 - "${TMPDIR%/}/my.cnf.ok" || die
477 - fi
478 - eprefixify "${TMPDIR%/}/my.cnf.ok"
479 - newins "${TMPDIR}/my.cnf.ok" my.cnf
480 -
481 - if use server ; then
482 - einfo "Including support files and sample configurations"
483 - docinto "support-files"
484 - local script
485 - for script in \
486 - "${S%/}"/support-files/magic
487 - do
488 - [[ -f "$script" ]] && dodoc "${script}"
489 - done
490 -
491 - docinto "scripts"
492 - for script in "${S%/}"/scripts/mysql* ; do
493 - [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
494 - done
495 - fi
496 -
497 - #Remove mytop if perl is not selected
498 - [[ -e "${ED%/}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED%/}/usr/bin/mytop"
499 -}
500 -
501 -# Official test instructions:
502 -# USE='extraengine perl server' \
503 -# FEATURES='test userpriv -usersandbox' \
504 -# ebuild mysql-X.X.XX.ebuild \
505 -# digest clean package
506 -src_test() {
507 -
508 - _disable_test() {
509 - local rawtestname reason
510 - rawtestname="${1}" ; shift
511 - reason="${@}"
512 - ewarn "test '${rawtestname}' disabled: '${reason}'"
513 - echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
514 - }
515 -
516 - local TESTDIR="${BUILD_DIR}/mysql-test"
517 - local retstatus_unit
518 - local retstatus_tests
519 -
520 - if ! use server ; then
521 - einfo "Skipping server tests due to minimal build."
522 - return 0
523 - fi
524 -
525 - # Bug #213475 - MySQL _will_ object strenously if your machine is named
526 - # localhost. Also causes weird failures.
527 - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
528 -
529 - if [[ $UID -eq 0 ]]; then
530 - die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
531 - fi
532 - has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
533 -
534 - einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
535 -
536 - # Run CTest (test-units)
537 - cmake-utils_src_test
538 - retstatus_unit=$?
539 -
540 - # Ensure that parallel runs don't die
541 - export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
542 - # Enable parallel testing, auto will try to detect number of cores
543 - # You may set this by hand.
544 - # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
545 - export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
546 -
547 - # create directories because mysqladmin might run out of order
548 - mkdir -p "${T}"/var-tests{,/log} || die
549 -
550 - # Run mysql tests
551 - pushd "${TESTDIR}" > /dev/null || die
552 -
553 - touch "${T}/disabled.def"
554 - # These are failing in MySQL 5.5 for now and are believed to be
555 - # false positives:
556 - #
557 - # main.mysql_client_test, main.mysql_client_test_nonblock
558 - # main.mysql_client_test_comp:
559 - # segfaults at random under Portage only, suspect resource limits.
560 -
561 - local t
562 - for t in main.mysql_client_test main.mysql_client_test_nonblock \
563 - main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam \
564 - main.mysqlhotcopy_archive main.mysqlhotcopy_myisam main.openssl_1 \
565 - rpl.rpl_semi_sync_uninstall_plugin ; do
566 - _disable_test "$t" "False positives in Gentoo"
567 - done
568 -
569 - if ! use client-libs ; then
570 - _disable_test main.plugin_auth "Needs client libraries built"
571 - fi
572 -
573 - # run mysql-test tests
574 - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
575 - retstatus_tests=$?
576 -
577 - popd > /dev/null || die
578 -
579 - # Cleanup is important for these testcases.
580 - pkill -9 -f "${S}/ndb" 2>/dev/null
581 - pkill -9 -f "${S}/sql" 2>/dev/null
582 -
583 - local failures=""
584 - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
585 - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
586 -
587 - [[ -z "$failures" ]] || die "Test failures: $failures"
588 - einfo "Tests successfully completed"
589 -}
590 -
591 -mysql_init_vars() {
592 - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"}
593 - MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
594 - MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
595 - MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
596 -
597 - if [[ -z "${MY_DATADIR}" ]] ; then
598 - MY_DATADIR=""
599 - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
600 - MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
601 - | sed -ne '/datadir/s|^--datadir=||p' \
602 - | tail -n1`
603 - if [[ -z "${MY_DATADIR}" ]] ; then
604 - MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
605 - | sed -e 's/.*=\s*//' \
606 - | tail -n1`
607 - fi
608 - fi
609 - if [[ -z "${MY_DATADIR}" ]] ; then
610 - MY_DATADIR="${MY_LOCALSTATEDIR}"
611 - einfo "Using default MY_DATADIR"
612 - fi
613 - elog "MySQL MY_DATADIR is ${MY_DATADIR}"
614 -
615 - if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
616 - if [[ -e "${MY_DATADIR}" ]] ; then
617 - # If you get this and you're wondering about it, see bug #207636
618 - elog "MySQL datadir found in ${MY_DATADIR}"
619 - elog "A new one will not be created."
620 - PREVIOUS_DATADIR="yes"
621 - else
622 - PREVIOUS_DATADIR="no"
623 - fi
624 - export PREVIOUS_DATADIR
625 - fi
626 - else
627 - if [[ ${EBUILD_PHASE} == "config" ]]; then
628 - local new_MY_DATADIR
629 - new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
630 - | sed -ne '/datadir/s|^--datadir=||p' \
631 - | tail -n1`
632 -
633 - if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
634 - ewarn "MySQL MY_DATADIR has changed"
635 - ewarn "from ${MY_DATADIR}"
636 - ewarn "to ${new_MY_DATADIR}"
637 - MY_DATADIR="${new_MY_DATADIR}"
638 - fi
639 - fi
640 - fi
641 -
642 - export MY_SHAREDSTATEDIR MY_SYSCONFDIR
643 - export MY_LOCALSTATEDIR MY_LOGDIR
644 - export MY_DATADIR
645 -}
646 -
647 -pkg_config() {
648 - _getoptval() {
649 - local mypd="${EROOT}"/usr/bin/my_print_defaults
650 - local section="$1"
651 - local flag="--${2}="
652 - local extra_options="${3}"
653 - "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
654 - }
655 - local old_MY_DATADIR="${MY_DATADIR}"
656 - local old_HOME="${HOME}"
657 - # my_print_defaults needs to read stuff in $HOME/.my.cnf
658 - export HOME=${EPREFIX}/root
659 -
660 - # Make sure the vars are correctly initialized
661 - mysql_init_vars
662 -
663 - [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
664 - if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then
665 - die "Minimal builds do NOT include the MySQL server"
666 - fi
667 -
668 - if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
669 - local MY_DATADIR_s="${ROOT}/${MY_DATADIR}"
670 - MY_DATADIR_s="${MY_DATADIR_s%%/}"
671 - local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}"
672 - old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
673 -
674 - if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
675 - if [[ -d "${MY_DATADIR_s}" ]]; then
676 - ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
677 - ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
678 - else
679 - elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
680 - mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
681 - || die "Moving MY_DATADIR failed"
682 - fi
683 - else
684 - ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
685 - if [[ -d "${MY_DATADIR_s}" ]]; then
686 - ewarn "Attempting to use ${MY_DATADIR_s}"
687 - else
688 - eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
689 - die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
690 - fi
691 - fi
692 - fi
693 -
694 - local pwd1="a"
695 - local pwd2="b"
696 - local maxtry=15
697 -
698 - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
699 - local tmp_mysqld_password_source=
700 -
701 - for tmp_mysqld_password_source in mysql client; do
702 - einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
703 - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
704 - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
705 - if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
706 - ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
707 - MYSQL_ROOT_PASSWORD=
708 - continue
709 - fi
710 -
711 - einfo "Found password in '${tmp_mysqld_password_source}' section!"
712 - break
713 - fi
714 - done
715 -
716 - # Sometimes --show is required to display passwords in some implementations of my_print_defaults
717 - if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
718 - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
719 - fi
720 -
721 - unset tmp_mysqld_password_source
722 - fi
723 - MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)"
724 - # These are dir+prefix
725 - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)"
726 - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
727 - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)"
728 - MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
729 -
730 - if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
731 - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
732 - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR"
733 - fi
734 - if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then
735 - einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
736 - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN"
737 - fi
738 - if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then
739 - einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
740 - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG"
741 - fi
742 -
743 - if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
744 - ewarn "You have already a MySQL database in place."
745 - ewarn "(${ROOT}/${MY_DATADIR}/*)"
746 - ewarn "Please rename or delete it if you wish to replace it."
747 - die "MySQL database already exists!"
748 - fi
749 -
750 - # Bug #213475 - MySQL _will_ object strenously if your machine is named
751 - # localhost. Also causes weird failures.
752 - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
753 -
754 - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
755 -
756 - einfo "Please provide a password for the mysql 'root' user now"
757 - einfo "or through the ${HOME}/.my.cnf file."
758 - ewarn "Avoid [\"'\\_%] characters in the password"
759 - read -rsp " >" pwd1 ; echo
760 -
761 - einfo "Retype the password"
762 - read -rsp " >" pwd2 ; echo
763 -
764 - if [[ "x$pwd1" != "x$pwd2" ]] ; then
765 - die "Passwords are not the same"
766 - fi
767 - MYSQL_ROOT_PASSWORD="${pwd1}"
768 - unset pwd1 pwd2
769 - fi
770 -
771 - local options
772 - local sqltmp="$(emktemp)"
773 -
774 - # Fix bug 446200. Don't reference host my.cnf, needs to come first,
775 - # see http://bugs.mysql.com/bug.php?id=31312
776 - use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
777 -
778 - # Figure out which options we need to disable to do the setup
779 - local helpfile="${TMPDIR}/mysqld-help"
780 - "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
781 - for opt in grant-tables host-cache name-resolve networking slave-start \
782 - federated ssl log-bin relay-log slow-query-log external-locking \
783 - log-slave-updates \
784 - ; do
785 - optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
786 - egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
787 - done
788 -
789 - einfo "Creating the mysql database and setting proper permissions on it ..."
790 -
791 - # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
792 - PID_DIR="${EROOT}/var/run/mysqld"
793 - if [[ ! -d "${PID_DIR}" ]]; then
794 - install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
795 - fi
796 -
797 - if [[ ! -d "${MY_DATADIR}" ]]; then
798 - install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
799 - fi
800 -
801 - pushd "${TMPDIR}" &>/dev/null || die
802 -
803 - # Filling timezones, see
804 - # http://dev.mysql.com/doc/mysql/en/time-zone-support.html
805 - "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
806 -
807 - local cmd=( "${EROOT}usr/share/mysql/scripts/mysql_install_db" )
808 - [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
809 - cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
810 - einfo "Command: ${cmd[*]}"
811 - su -s /bin/sh -c "${cmd[*]}" mysql \
812 - >"${TMPDIR}"/mysql_install_db.log 2>&1
813 - if [ $? -ne 0 ]; then
814 - grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
815 - die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
816 - fi
817 - popd &>/dev/null || die
818 - [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
819 - || die "MySQL databases not installed"
820 -
821 - use prefix || options="${options} --user=mysql"
822 -
823 - local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
824 - local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
825 - local mysqld="${EROOT}/usr/sbin/mysqld \
826 - ${options} \
827 - --log-warnings=0 \
828 - --basedir=${EROOT}/usr \
829 - --datadir=${ROOT}/${MY_DATADIR} \
830 - --max_allowed_packet=8M \
831 - --net_buffer_length=16K \
832 - --socket=${socket} \
833 - --pid-file=${pidfile}
834 - --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
835 - #einfo "About to start mysqld: ${mysqld}"
836 - ebegin "Starting mysqld"
837 - einfo "Command ${mysqld}"
838 - ${mysqld} &
839 - rc=$?
840 - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
841 - maxtry=$((${maxtry}-1))
842 - echo -n "."
843 - sleep 1
844 - done
845 - eend $rc
846 -
847 - if ! [[ -S "${socket}" ]]; then
848 - die "Completely failed to start up mysqld with: ${mysqld}"
849 - fi
850 -
851 - ebegin "Setting root password"
852 - # Do this from memory, as we don't want clear text passwords in temp files
853 - local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES"
854 - "${EROOT}/usr/bin/mysql" \
855 - "--socket=${socket}" \
856 - -hlocalhost \
857 - -e "${sql}"
858 - eend $?
859 -
860 - if [[ -n "${sqltmp}" ]] ; then
861 - ebegin "Loading \"zoneinfo\", this step may require a few seconds"
862 - "${EROOT}/usr/bin/mysql" \
863 - "--socket=${socket}" \
864 - -hlocalhost \
865 - -uroot \
866 - --password="${MYSQL_ROOT_PASSWORD}" \
867 - mysql < "${sqltmp}"
868 - rc=$?
869 - eend $?
870 - [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
871 - fi
872 -
873 - # Stop the server and cleanup
874 - einfo "Stopping the server ..."
875 - kill $(< "${pidfile}" )
876 - rm -f "${sqltmp}"
877 - wait %1
878 - einfo "Done"
879 -}
880
881 diff --git a/dev-db/mysql/mysql-5.6.30.ebuild b/dev-db/mysql/mysql-5.6.30.ebuild
882 deleted file mode 100644
883 index 5979eb8..0000000
884 --- a/dev-db/mysql/mysql-5.6.30.ebuild
885 +++ /dev/null
886 @@ -1,165 +0,0 @@
887 -# Copyright 1999-2018 Gentoo Foundation
888 -# Distributed under the terms of the GNU General Public License v2
889 -
890 -EAPI="5"
891 -
892 -MY_EXTRAS_VER="20160212-0233Z"
893 -MY_PV="${PV//_alpha_pre/-m}"
894 -MY_PV="${MY_PV//_/-}"
895 -HAS_TOOLS_PATCH="1"
896 -SUBSLOT="18"
897 -
898 -inherit mysql-multilib-r1
899 -# only to make repoman happy. it is really set in the eclass
900 -IUSE="$IUSE"
901 -
902 -# REMEMBER: also update eclass/mysql*.eclass before committing!
903 -KEYWORDS="~alpha ~amd64 ~arm ~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"
904 -
905 -# When MY_EXTRAS is bumped, the index should be revised to exclude these.
906 -EPATCH_EXCLUDE=''
907 -
908 -DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
909 -RDEPEND="${RDEPEND}"
910 -
911 -# Please do not add a naive src_unpack to this ebuild
912 -# If you want to add a single patch, copy the ebuild to an overlay
913 -# and create your own mysql-extras tarball, looking at 000_index.txt
914 -
915 -# validate_password plugin uses exceptions when it shouldn't yet (until 5.7)
916 -# disable until we see what happens with it
917 -MYSQL_CMAKE_NATIVE_DEFINES=( -DWITHOUT_VALIDATE_PASSWORD=1 )
918 -
919 -src_prepare() {
920 - mysql-multilib-r1_src_prepare
921 - if use libressl ; then
922 - sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
923 - "${S}/cmake/ssl.cmake" || die
924 - fi
925 -}
926 -
927 -# Official test instructions:
928 -# USE='server embedded extraengine perl openssl static-libs' \
929 -# FEATURES='test userpriv -usersandbox' \
930 -# ebuild mysql-X.X.XX.ebuild \
931 -# digest clean package
932 -multilib_src_test() {
933 -
934 - if ! multilib_is_native_abi ; then
935 - einfo "Server tests not available on non-native abi".
936 - return 0;
937 - fi
938 -
939 - local TESTDIR="${BUILD_DIR}/mysql-test"
940 - local retstatus_unit
941 - local retstatus_tests
942 -
943 - # Bug #213475 - MySQL _will_ object strenously if your machine is named
944 - # localhost. Also causes weird failures.
945 - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
946 -
947 - if use server ; then
948 -
949 - if [[ $UID -eq 0 ]]; then
950 - die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
951 - fi
952 - has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
953 -
954 - einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
955 - addpredict /this-dir-does-not-exist/t9.MYI
956 -
957 - # Run CTest (test-units)
958 - cmake-utils_src_test
959 - retstatus_unit=$?
960 - [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
961 -
962 - # Ensure that parallel runs don't die
963 - export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
964 - # Enable parallel testing, auto will try to detect number of cores
965 - # You may set this by hand.
966 - # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
967 - export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
968 -
969 - # create directories because mysqladmin might right out of order
970 - mkdir -p "${T}"/var-tests{,/log}
971 -
972 - # create symlink for the tests to find mysql_tzinfo_to_sql
973 - ln -s "${BUILD_DIR}/sql/mysql_tzinfo_to_sql" "${S}/sql/"
974 -
975 - # These are failing in MySQL 5.5/5.6 for now and are believed to be
976 - # false positives:
977 - #
978 - # main.information_schema, binlog.binlog_statement_insert_delayed,
979 - # funcs_1.is_triggers funcs_1.is_tables_mysql,
980 - # funcs_1.is_columns_mysql, binlog.binlog_mysqlbinlog_filter,
981 - # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt,
982 - # mysqld--help-notwin, funcs_1.is_triggers, funcs_1.is_tables_mysql, funcs_1.is_columns_mysql
983 - # perfschema.binlog_edge_stmt, perfschema.binlog_edge_mix, binlog.binlog_mysqlbinlog_filter
984 - # fails due to USE=-latin1 / utf8 default
985 - #
986 - # main.mysql_client_test:
987 - # segfaults at random under Portage only, suspect resource limits.
988 - #
989 - # rpl.rpl_plugin_load
990 - # fails due to included file not listed in expected result
991 - # appears to be poor planning
992 - #
993 - # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
994 - # fails due to bad cleanup of previous tests when run in parallel
995 - # The tool is deprecated anyway
996 - # Bug 532288
997 - for t in \
998 - binlog.binlog_mysqlbinlog_filter \
999 - binlog.binlog_statement_insert_delayed \
1000 - funcs_1.is_columns_mysql \
1001 - funcs_1.is_tables_mysql \
1002 - funcs_1.is_triggers \
1003 - main.information_schema \
1004 - main.mysql_client_test \
1005 - main.mysqld--help-notwin \
1006 - perfschema.binlog_edge_mix \
1007 - perfschema.binlog_edge_stmt \
1008 - rpl.rpl_plugin_load \
1009 - main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
1010 - ; do
1011 - mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
1012 - done
1013 -
1014 - if ! use extraengine ; then
1015 - # bug 401673, 530766
1016 - for t in federated.federated_plugin ; do
1017 - mysql-multilib-r1_disable_test "$t" "Test $t requires USE=extraengine (Need federated engine)"
1018 - done
1019 - fi
1020 -
1021 - # Run mysql tests
1022 - pushd "${TESTDIR}"
1023 -
1024 - # Set file limits higher so tests run
1025 - ulimit -n 3000
1026 -
1027 - # run mysql-test tests
1028 - perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
1029 - --suite-timeout=5000 --reorder
1030 - retstatus_tests=$?
1031 - [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
1032 - has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
1033 -
1034 - popd
1035 -
1036 - # Cleanup is important for these testcases.
1037 - pkill -9 -f "${S}/ndb" 2>/dev/null
1038 - pkill -9 -f "${S}/sql" 2>/dev/null
1039 -
1040 - failures=""
1041 - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
1042 - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
1043 - has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
1044 -
1045 - [[ -z "$failures" ]] || die "Test failures: $failures"
1046 - einfo "Tests successfully completed"
1047 -
1048 - else
1049 - einfo "Skipping server tests due to minimal build."
1050 - fi
1051 -}
1052
1053 diff --git a/dev-db/mysql/mysql-5.6.40-r1.ebuild b/dev-db/mysql/mysql-5.6.40-r1.ebuild
1054 deleted file mode 100644
1055 index 3851573..0000000
1056 --- a/dev-db/mysql/mysql-5.6.40-r1.ebuild
1057 +++ /dev/null
1058 @@ -1,768 +0,0 @@
1059 -# Copyright 1999-2018 Gentoo Foundation
1060 -# Distributed under the terms of the GNU General Public License v2
1061 -
1062 -EAPI="6"
1063 -MY_EXTRAS_VER="20180628-0201Z"
1064 -
1065 -CMAKE_MAKEFILE_GENERATOR=emake
1066 -
1067 -# Keeping eutils in EAPI=6 for emktemp in pkg_config
1068 -
1069 -inherit eutils flag-o-matic prefix toolchain-funcs \
1070 - user cmake-utils multilib-build
1071 -
1072 -SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.6/${P}.tar.gz
1073 - https://cdn.mysql.com/archives/mysql-5.6/${P}.tar.gz
1074 - http://downloads.mysql.com/archives/MySQL-5.6/${P}.tar.gz"
1075 -
1076 -# Gentoo patches to MySQL
1077 -if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
1078 - SRC_URI="${SRC_URI}
1079 - mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
1080 - https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
1081 - https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
1082 - https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
1083 - https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
1084 -fi
1085 -
1086 -HOMEPAGE="https://www.mysql.com/"
1087 -DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
1088 -LICENSE="GPL-2"
1089 -SLOT="0/18"
1090 -IUSE="client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux
1091 - +server static static-libs systemtap tcmalloc test yassl"
1092 -
1093 -# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
1094 -RESTRICT="libressl? ( test )"
1095 -
1096 -REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )"
1097 -
1098 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
1099 -
1100 -# Shorten the path because the socket path length must be shorter than 107 chars
1101 -# and we will run a mysql server during test phase
1102 -S="${WORKDIR}/mysql"
1103 -
1104 -if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then
1105 - inherit git-r3
1106 - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git"
1107 - EGIT_CHECKOUT_DIR="${WORKDIR}/mysql-extras"
1108 - EGIT_CLONE_TYPE=shallow
1109 - MY_PATCH_DIR="${WORKDIR}/mysql-extras"
1110 -else
1111 - MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
1112 -fi
1113 -
1114 -PATCHES=(
1115 - "${MY_PATCH_DIR}"/01050_all_mysql_config_cleanup-5.6.patch
1116 - "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch
1117 - "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch
1118 - "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch
1119 - "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch
1120 - "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch
1121 - "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch
1122 - "${MY_PATCH_DIR}"/20027_all_mysql-5.5-perl5.26-includes.patch
1123 - "${MY_PATCH_DIR}"/20028_all_mysql-5.6-gcc7.patch
1124 - "${MY_PATCH_DIR}"/20031_all_mysql-5.6-fix-monitor.test.patch
1125 -)
1126 -
1127 -# Be warned, *DEPEND are version-dependant
1128 -# These are used for both runtime and compiletime
1129 -COMMON_DEPEND="
1130 - kernel_linux? (
1131 - sys-process/procps:0=
1132 - dev-libs/libaio:0=
1133 - )
1134 - net-misc/curl
1135 - >=sys-apps/sed-4
1136 - >=sys-apps/texinfo-4.7-r1
1137 - jemalloc? ( dev-libs/jemalloc:0= )
1138 - tcmalloc? ( dev-util/google-perftools:0= )
1139 - systemtap? ( >=dev-util/systemtap-1.3:0= )
1140 - !yassl? (
1141 - !libressl? ( >=dev-libs/openssl-1.0.0:0= )
1142 - libressl? ( dev-libs/libressl:0= )
1143 - )
1144 - >=sys-libs/zlib-1.2.3:0=
1145 - sys-libs/ncurses:0=
1146 - server? (
1147 - numa? ( sys-process/numactl )
1148 - )
1149 - !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] )
1150 -"
1151 -DEPEND="virtual/yacc
1152 - static? ( sys-libs/ncurses[static-libs] )
1153 - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
1154 - ${COMMON_DEPEND}"
1155 -RDEPEND="selinux? ( sec-policy/selinux-mysql )
1156 - client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c )
1157 - !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
1158 - server? ( !prefix? ( dev-db/mysql-init-scripts ) )
1159 - ${COMMON_DEPEND}
1160 -"
1161 -# For other stuff to bring us in
1162 -# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
1163 -PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
1164 -
1165 -pkg_setup() {
1166 - if [[ ${MERGE_TYPE} != binary ]] ; then
1167 - local GCC_MAJOR_SET=$(gcc-major-version)
1168 - local GCC_MINOR_SET=$(gcc-minor-version)
1169 - # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
1170 - # non x86{,_64} arches
1171 - if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
1172 - ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
1173 - eerror "${PN} needs to be built with gcc-4.7 or later."
1174 - eerror "Please use gcc-config to switch to gcc-4.7 or later version."
1175 - die
1176 - fi
1177 - fi
1178 - if has test ${FEATURES} && \
1179 - use server && ! has userpriv ${FEATURES} ; then
1180 - eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
1181 - fi
1182 -
1183 - # This should come after all of the die statements
1184 - enewgroup mysql 60 || die "problem adding 'mysql' group"
1185 - enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
1186 -}
1187 -
1188 -pkg_preinst() {
1189 - # Here we need to see if the implementation switched client libraries
1190 - # We check if this is a new instance of the package and a client library already exists
1191 - local SHOW_ABI_MESSAGE libpath
1192 - if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
1193 - libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so")
1194 - elog "Due to ABI changes when switching between different client libraries,"
1195 - elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
1196 - elog "Please run: revdep-rebuild --library ${libpath}"
1197 - ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
1198 - fi
1199 -}
1200 -
1201 -pkg_postinst() {
1202 - # Make sure the vars are correctly initialized
1203 - mysql_init_vars
1204 -
1205 - # Create log directory securely if it does not exist
1206 - [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
1207 -
1208 - if use server ; then
1209 - if [[ -z "${REPLACING_VERSIONS}" ]] ; then
1210 - einfo
1211 - elog "You might want to run:"
1212 - elog "\"emerge --config =${CATEGORY}/${PF}\""
1213 - elog "if this is a new install."
1214 - elog
1215 - elog "If you are switching server implentations, you should run the"
1216 - elog "mysql_upgrade tool."
1217 - einfo
1218 - else
1219 - einfo
1220 - elog "If you are upgrading major versions, you should run the"
1221 - elog "mysql_upgrade tool."
1222 - einfo
1223 - fi
1224 - fi
1225 -}
1226 -
1227 -src_unpack() {
1228 - unpack ${A}
1229 - # Grab the patches
1230 - [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack
1231 -
1232 - mv -f "${WORKDIR}/${P}" "${S}" || die
1233 -}
1234 -
1235 -src_prepare() {
1236 - _disable_engine() {
1237 - echo > "${S%/}/storage/${1}/CMakeLists.txt" || die
1238 - }
1239 -
1240 - _disable_plugin() {
1241 - echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die
1242 - }
1243 -
1244 - if use jemalloc ; then
1245 - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die
1246 - fi
1247 - if use tcmalloc; then
1248 - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die
1249 - fi
1250 - # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
1251 - if [[ -d "${S}/support-files/SELinux" ]] ; then
1252 - echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
1253 - fi
1254 -
1255 - if use libressl ; then
1256 - sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
1257 - "${S}/cmake/ssl.cmake" || die
1258 - fi
1259 -
1260 - sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die
1261 -
1262 - local plugin
1263 - local server_plugins=( semisync )
1264 - local test_plugins=( audit_null daemon_example fulltext )
1265 - if ! use server; then # These plugins are for the server
1266 - for plugin in "${server_plugins[@]}" ; do
1267 - _disable_plugin "${plugin}"
1268 - done
1269 - fi
1270 -
1271 - if ! use test; then # These plugins are only used during testing
1272 - for plugin in "${test_plugins[@]}" ; do
1273 - _disable_plugin "${plugin}"
1274 - done
1275 - fi
1276 -
1277 - # Don't build example
1278 - _disable_engine example
1279 - _disable_engine ndb
1280 - _disable_plugin innodb_memcached
1281 -
1282 - cmake-utils_src_prepare
1283 -}
1284 -
1285 -src_configure(){
1286 - # bug 508724 mariadb cannot use ld.gold
1287 - tc-ld-disable-gold
1288 - # Bug #114895, bug #110149
1289 - filter-flags "-O" "-O[01]"
1290 -
1291 - append-cxxflags -felide-constructors
1292 -
1293 - # bug #283926, with GCC4.4, this is required to get correct behavior.
1294 - append-flags -fno-strict-aliasing
1295 -
1296 - CMAKE_BUILD_TYPE="RelWithDebInfo"
1297 -
1298 - # debug hack wrt #497532
1299 - mycmakeargs=(
1300 - -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
1301 - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
1302 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
1303 - -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql"
1304 - -DSYSCONFDIR="${EPREFIX}/etc/mysql"
1305 - -DINSTALL_BINDIR=bin
1306 - -DINSTALL_DOCDIR=share/doc/${PF}
1307 - -DINSTALL_DOCREADMEDIR=share/doc/${PF}
1308 - -DINSTALL_INCLUDEDIR=include/mysql
1309 - -DINSTALL_INFODIR=share/info
1310 - -DINSTALL_LIBDIR=$(get_libdir)
1311 - -DINSTALL_MANDIR=share/man
1312 - -DINSTALL_MYSQLSHAREDIR=share/mysql
1313 - -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
1314 - -DINSTALL_SCRIPTDIR=share/mysql/scripts
1315 - -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql"
1316 - -DINSTALL_SBINDIR=sbin
1317 - -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql"
1318 - -DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
1319 - -DWITH_UNIT_TESTS=$(usex test ON OFF)
1320 - ### TODO: make this system but issues with UTF-8 prevent it
1321 - -DWITH_EDITLINE=bundled
1322 - -DWITH_ZLIB=system
1323 - -DWITH_LIBWRAP=0
1324 - -DENABLED_LOCAL_INFILE=1
1325 - -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
1326 - -DWITH_DEFAULT_COMPILER_OPTIONS=0
1327 - -DWITH_DEFAULT_FEATURE_SET=0
1328 - # The build forces this to be defined when cross-compiling. We pass it
1329 - # all the time for simplicity and to make sure it is actually correct.
1330 - -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
1331 - -DWITH_LIBEVENT=NO
1332 - -DWITHOUT_CLIENTLIBS=YES
1333 - -DENABLE_DTRACE=$(usex systemtap)
1334 - -DWITH_SSL=$(usex yassl bundled system)
1335 - -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mysql/mysql-test' '')
1336 - -DWITHOUT_VALIDATE_PASSWORD=1
1337 - )
1338 -
1339 - if use server ; then
1340 -
1341 - if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
1342 - ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
1343 - ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
1344 - ewarn "You MUST file bugs without these variables set."
1345 -
1346 - mycmakeargs+=(
1347 - -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
1348 - -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
1349 - )
1350 -
1351 - elif ! use latin1 ; then
1352 - mycmakeargs+=(
1353 - -DDEFAULT_CHARSET=utf8
1354 - -DDEFAULT_COLLATION=utf8_general_ci
1355 - )
1356 - else
1357 - mycmakeargs+=(
1358 - -DDEFAULT_CHARSET=latin1
1359 - -DDEFAULT_COLLATION=latin1_swedish_ci
1360 - )
1361 - fi
1362 - mycmakeargs+=(
1363 - -DWITH_NUMA=$(usex numa ON OFF)
1364 - -DEXTRA_CHARSETS=all
1365 - -DDISABLE_SHARED=$(usex static YES NO)
1366 - -DWITH_DEBUG=$(usex debug)
1367 - -DWITH_EMBEDDED_SERVER=OFF
1368 - -DENABLED_PROFILING=$(usex profiling)
1369 - )
1370 -
1371 - if use static; then
1372 - mycmakeargs+=( -DWITH_PIC=1 )
1373 - fi
1374 -
1375 - # Storage engines
1376 - mycmakeargs+=(
1377 - -DWITH_ARCHIVE_STORAGE_ENGINE=1
1378 - -DWITH_BLACKHOLE_STORAGE_ENGINE=1
1379 - -DWITH_CSV_STORAGE_ENGINE=1
1380 - -DWITH_HEAP_STORAGE_ENGINE=1
1381 - -DWITH_INNOBASE_STORAGE_ENGINE=1
1382 - -DWITH_MYISAMMRG_STORAGE_ENGINE=1
1383 - -DWITH_MYISAM_STORAGE_ENGINE=1
1384 - -DWITH_PARTITION_STORAGE_ENGINE=1
1385 - -DWITH_INNODB_MEMCACHED=0
1386 - )
1387 -
1388 - else
1389 - mycmakeargs+=(
1390 - -DWITHOUT_SERVER=1
1391 - -DWITH_EMBEDDED_SERVER=OFF
1392 - -DEXTRA_CHARSETS=none
1393 - )
1394 - fi
1395 -
1396 - cmake-utils_src_configure
1397 -}
1398 -
1399 -src_compile() {
1400 - cmake-utils_src_compile
1401 -}
1402 -
1403 -src_install() {
1404 - cmake-utils_src_install
1405 -
1406 - # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them.
1407 - find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die
1408 - # Make sure the vars are correctly initialized
1409 - mysql_init_vars
1410 -
1411 - # Convenience links
1412 - einfo "Making Convenience links for mysqlcheck multi-call binary"
1413 - dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
1414 - dosym "mysqlcheck" "/usr/bin/mysqlrepair"
1415 - dosym "mysqlcheck" "/usr/bin/mysqloptimize"
1416 -
1417 - # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
1418 - if [[ -d "${ED}/usr/data" ]] ; then
1419 - rm -Rf "${ED}/usr/data" || die
1420 - fi
1421 -
1422 - # Unless they explicitly specific USE=test, then do not install the
1423 - # testsuite. It DOES have a use to be installed, esp. when you want to do a
1424 - # validation of your database configuration after tuning it.
1425 - if ! use test ; then
1426 - rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test"
1427 - fi
1428 -
1429 - # Configuration stuff
1430 - einfo "Building default configuration ..."
1431 - insinto "${MY_SYSCONFDIR#${EPREFIX}}"
1432 - [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf
1433 - local mycnf_src="my.cnf-5.6"
1434 - sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
1435 - "${FILESDIR%/}/${mycnf_src}" \
1436 - > "${TMPDIR%/}/my.cnf.ok" || die
1437 - use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok"
1438 - if use latin1 ; then
1439 - sed -i \
1440 - -e "/character-set/s|utf8|latin1|g" \
1441 - "${TMPDIR%/}/my.cnf.ok" || die
1442 - fi
1443 - eprefixify "${TMPDIR%/}/my.cnf.ok"
1444 - newins "${TMPDIR}/my.cnf.ok" my.cnf
1445 -
1446 - if use server ; then
1447 - einfo "Including support files and sample configurations"
1448 - docinto "support-files"
1449 - local script
1450 - for script in \
1451 - "${S}"/support-files/magic
1452 - do
1453 - [[ -f "$script" ]] && dodoc "${script}"
1454 - done
1455 -
1456 - docinto "scripts"
1457 - for script in "${S}"/scripts/mysql* ; do
1458 - [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
1459 - done
1460 - fi
1461 -
1462 - #Remove mytop if perl is not selected
1463 - [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop"
1464 -}
1465 -
1466 -# Official test instructions:
1467 -# USE='perl server static-libs' \
1468 -# FEATURES='test userpriv -usersandbox' \
1469 -# ebuild mysql-X.X.XX.ebuild \
1470 -# digest clean package
1471 -src_test() {
1472 -
1473 - _disable_test() {
1474 - local rawtestname reason
1475 - rawtestname="${1}" ; shift
1476 - reason="${@}"
1477 - ewarn "test '${rawtestname}' disabled: '${reason}'"
1478 - echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
1479 - }
1480 -
1481 - local TESTDIR="${BUILD_DIR}/mysql-test"
1482 - local retstatus_unit
1483 - local retstatus_tests
1484 -
1485 - if ! use server ; then
1486 - einfo "Skipping server tests due to minimal build."
1487 - return 0
1488 - fi
1489 -
1490 - # Bug #213475 - MySQL _will_ object strenously if your machine is named
1491 - # localhost. Also causes weird failures.
1492 - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
1493 -
1494 - if [[ $UID -eq 0 ]]; then
1495 - die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
1496 - fi
1497 - has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
1498 -
1499 - einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1500 -
1501 - # Run CTest (test-units)
1502 - cmake-utils_src_test
1503 - retstatus_unit=$?
1504 -
1505 - # Ensure that parallel runs don't die
1506 - export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
1507 - # Enable parallel testing, auto will try to detect number of cores
1508 - # You may set this by hand.
1509 - # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
1510 - export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
1511 -
1512 - # create directories because mysqladmin might run out of order
1513 - mkdir -p "${T}"/var-tests{,/log} || die
1514 -
1515 - # Run mysql tests
1516 - pushd "${TESTDIR}" > /dev/null || die
1517 -
1518 - touch "${T}/disabled.def"
1519 - # These are failing in MySQL 5.7 for now and are believed to be
1520 - # false positives:
1521 - #
1522 - local t
1523 -
1524 - for t in auth_sec.keyring_udf federated.federated_plugin ; do
1525 - _disable_test "$t" "False positives in Gentoo"
1526 - done
1527 -
1528 - # run mysql-test tests
1529 - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
1530 - retstatus_tests=$?
1531 -
1532 - popd > /dev/null || die
1533 -
1534 - # Cleanup is important for these testcases.
1535 - pkill -9 -f "${S}/ndb" 2>/dev/null
1536 - pkill -9 -f "${S}/sql" 2>/dev/null
1537 -
1538 - local failures=""
1539 - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
1540 - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
1541 -
1542 - [[ -z "$failures" ]] || die "Test failures: $failures"
1543 - einfo "Tests successfully completed"
1544 -}
1545 -
1546 -mysql_init_vars() {
1547 - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX%/}/usr/share/mysql"}
1548 - MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX%/}/etc/mysql"}
1549 - MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX%/}/var/lib/mysql"}
1550 - MY_LOGDIR=${MY_LOGDIR="${EPREFIX%/}/var/log/mysql"}
1551 -
1552 - if [[ -z "${MY_DATADIR}" ]] ; then
1553 - MY_DATADIR=""
1554 - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
1555 - MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
1556 - | sed -ne '/datadir/s|^--datadir=||p' \
1557 - | tail -n1`
1558 - if [[ -z "${MY_DATADIR}" ]] ; then
1559 - MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
1560 - | sed -e 's/.*=\s*//' \
1561 - | tail -n1`
1562 - fi
1563 - fi
1564 - if [[ -z "${MY_DATADIR}" ]] ; then
1565 - MY_DATADIR="${MY_LOCALSTATEDIR}"
1566 - einfo "Using default MY_DATADIR"
1567 - fi
1568 - elog "MySQL MY_DATADIR is ${MY_DATADIR}"
1569 -
1570 - if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
1571 - if [[ -e "${MY_DATADIR}" ]] ; then
1572 - # If you get this and you're wondering about it, see bug #207636
1573 - elog "MySQL datadir found in ${MY_DATADIR}"
1574 - elog "A new one will not be created."
1575 - PREVIOUS_DATADIR="yes"
1576 - else
1577 - PREVIOUS_DATADIR="no"
1578 - fi
1579 - export PREVIOUS_DATADIR
1580 - fi
1581 - else
1582 - if [[ ${EBUILD_PHASE} == "config" ]]; then
1583 - local new_MY_DATADIR
1584 - new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
1585 - | sed -ne '/datadir/s|^--datadir=||p' \
1586 - | tail -n1`
1587 -
1588 - if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
1589 - ewarn "MySQL MY_DATADIR has changed"
1590 - ewarn "from ${MY_DATADIR}"
1591 - ewarn "to ${new_MY_DATADIR}"
1592 - MY_DATADIR="${new_MY_DATADIR}"
1593 - fi
1594 - fi
1595 - fi
1596 -
1597 - export MY_SHAREDSTATEDIR MY_SYSCONFDIR
1598 - export MY_LOCALSTATEDIR MY_LOGDIR
1599 - export MY_DATADIR
1600 -}
1601 -
1602 -pkg_config() {
1603 - _getoptval() {
1604 - local mypd="${EROOT%/}"/usr/bin/my_print_defaults
1605 - local section="$1"
1606 - local flag="--${2}="
1607 - local extra_options="${3}"
1608 - "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
1609 - }
1610 - local old_MY_DATADIR="${MY_DATADIR}"
1611 - local old_HOME="${HOME}"
1612 - # my_print_defaults needs to read stuff in $HOME/.my.cnf
1613 - export HOME=${EPREFIX%/}/root
1614 -
1615 - # Make sure the vars are correctly initialized
1616 - mysql_init_vars
1617 -
1618 - [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
1619 - if [[ ! -x "${EROOT%/}/usr/sbin/mysqld" ]] ; then
1620 - die "Minimal builds do NOT include the MySQL server"
1621 - fi
1622 -
1623 - if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
1624 - local MY_DATADIR_s="${ROOT%/}/${MY_DATADIR}"
1625 - MY_DATADIR_s="${MY_DATADIR_s%%/}"
1626 - local old_MY_DATADIR_s="${ROOT%/}/${old_MY_DATADIR}"
1627 - old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
1628 -
1629 - if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
1630 - if [[ -d "${MY_DATADIR_s}" ]]; then
1631 - ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
1632 - ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
1633 - else
1634 - elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
1635 - mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
1636 - || die "Moving MY_DATADIR failed"
1637 - fi
1638 - else
1639 - ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
1640 - if [[ -d "${MY_DATADIR_s}" ]]; then
1641 - ewarn "Attempting to use ${MY_DATADIR_s}"
1642 - else
1643 - eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
1644 - die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
1645 - fi
1646 - fi
1647 - fi
1648 -
1649 - local pwd1="a"
1650 - local pwd2="b"
1651 - local maxtry=15
1652 -
1653 - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
1654 - local tmp_mysqld_password_source=
1655 -
1656 - for tmp_mysqld_password_source in mysql client; do
1657 - einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
1658 - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
1659 - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
1660 - if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
1661 - ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
1662 - MYSQL_ROOT_PASSWORD=
1663 - continue
1664 - fi
1665 -
1666 - einfo "Found password in '${tmp_mysqld_password_source}' section!"
1667 - break
1668 - fi
1669 - done
1670 -
1671 - # Sometimes --show is required to display passwords in some implementations of my_print_defaults
1672 - if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
1673 - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
1674 - fi
1675 -
1676 - unset tmp_mysqld_password_source
1677 - fi
1678 - MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)"
1679 - # These are dir+prefix
1680 - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)"
1681 - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
1682 - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)"
1683 - MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
1684 -
1685 - if [[ ! -d "${EROOT%/}/$MYSQL_TMPDIR" ]]; then
1686 - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
1687 - install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR"
1688 - fi
1689 - if [[ ! -d "${EROOT%/}/$MYSQL_LOG_BIN" ]]; then
1690 - einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
1691 - install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_LOG_BIN"
1692 - fi
1693 - if [[ ! -d "${EROOT%/}/$MYSQL_RELAY_LOG" ]]; then
1694 - einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
1695 - install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_RELAY_LOG"
1696 - fi
1697 -
1698 - if [[ -d "${ROOT%/}/${MY_DATADIR}/mysql" ]] ; then
1699 - ewarn "You have already a MySQL database in place."
1700 - ewarn "(${ROOT%/}/${MY_DATADIR}/*)"
1701 - ewarn "Please rename or delete it if you wish to replace it."
1702 - die "MySQL database already exists!"
1703 - fi
1704 -
1705 - # Bug #213475 - MySQL _will_ object strenously if your machine is named
1706 - # localhost. Also causes weird failures.
1707 - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
1708 -
1709 - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
1710 -
1711 - einfo "Please provide a password for the mysql 'root' user now"
1712 - einfo "or through the ${HOME}/.my.cnf file."
1713 - ewarn "Avoid [\"'\\_%] characters in the password"
1714 - read -rsp " >" pwd1 ; echo
1715 -
1716 - einfo "Retype the password"
1717 - read -rsp " >" pwd2 ; echo
1718 -
1719 - if [[ "x$pwd1" != "x$pwd2" ]] ; then
1720 - die "Passwords are not the same"
1721 - fi
1722 - MYSQL_ROOT_PASSWORD="${pwd1}"
1723 - unset pwd1 pwd2
1724 - fi
1725 -
1726 - local options
1727 - local sqltmp="$(emktemp)"
1728 -
1729 - # Fix bug 446200. Don't reference host my.cnf, needs to come first,
1730 - # see http://bugs.mysql.com/bug.php?id=31312
1731 - use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
1732 -
1733 - # Figure out which options we need to disable to do the setup
1734 - local helpfile="${TMPDIR%/}/mysqld-help"
1735 - "${EROOT%/}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
1736 - for opt in host-cache name-resolve networking slave-start \
1737 - federated ssl log-bin relay-log slow-query-log external-locking \
1738 - log-slave-updates \
1739 - ; do
1740 - optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
1741 - egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
1742 - done
1743 -
1744 - einfo "Creating the mysql database and setting proper permissions on it ..."
1745 -
1746 - # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
1747 - PID_DIR="${EROOT%/}/var/run/mysqld"
1748 - if [[ ! -d "${PID_DIR}" ]]; then
1749 - install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
1750 - fi
1751 -
1752 - if [[ ! -d "${MY_DATADIR}" ]]; then
1753 - install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
1754 - fi
1755 -
1756 - pushd "${TMPDIR}" &>/dev/null || die
1757 -
1758 - # Filling timezones, see
1759 - # http://dev.mysql.com/doc/mysql/en/time-zone-support.html
1760 - echo "USE mysql;" >"${sqltmp}"
1761 - "${EROOT%/}/usr/bin/mysql_tzinfo_to_sql" "${EROOT%/}/usr/share/zoneinfo" >> "${sqltmp}" 2>/dev/null
1762 - chown mysql "${sqltmp}" || die
1763 -
1764 - # --initialize-insecure will not set root password
1765 - # --initialize would set a random one in the log which we don't need as we set it ourselves
1766 - local cmd=( "${EROOT%/}/usr/sbin/mysqld" "--initialize-insecure" "--init-file='${sqltmp}'" )
1767 - cmd+=( "--basedir=${EPREFIX%/}/usr" ${options} "--datadir=${ROOT%/}${MY_DATADIR}" "--tmpdir=${ROOT%/}${MYSQL_TMPDIR}" )
1768 - einfo "Command: ${cmd[*]}"
1769 - su -s /bin/sh -c "${cmd[*]}" mysql \
1770 - >"${TMPDIR%/}"/mysql_install_db.log 2>&1
1771 - if [ $? -ne 0 ]; then
1772 - grep -B5 -A999 -i "ERROR" "${TMPDIR%/}"/mysql_install_db.log 1>&2
1773 - die "Failed to initialize mysqld. Please review ${EPREFIX%/}/var/log/mysql/mysqld.err AND ${TMPDIR%/}/mysql_install_db.log"
1774 - fi
1775 - popd &>/dev/null || die
1776 - [[ -f "${ROOT%/}/${MY_DATADIR}/mysql/user.frm" ]] \
1777 - || die "MySQL databases not installed"
1778 -
1779 - use prefix || options="${options} --user=mysql"
1780 -
1781 - local socket="${EROOT%/}/var/run/mysqld/mysqld${RANDOM}.sock"
1782 - local pidfile="${EROOT%/}/var/run/mysqld/mysqld${RANDOM}.pid"
1783 - local mysqld="${EROOT%/}/usr/sbin/mysqld \
1784 - ${options} \
1785 - $(use prefix || echo --user=mysql) \
1786 - --log-warnings=0 \
1787 - --basedir=${EROOT%/}/usr \
1788 - --datadir=${ROOT%/}/${MY_DATADIR} \
1789 - --max_allowed_packet=8M \
1790 - --net_buffer_length=16K \
1791 - --socket=${socket} \
1792 - --pid-file=${pidfile}
1793 - --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
1794 - #einfo "About to start mysqld: ${mysqld}"
1795 - ebegin "Starting mysqld"
1796 - einfo "Command ${mysqld}"
1797 - ${mysqld} &
1798 - rc=$?
1799 - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
1800 - maxtry=$((${maxtry}-1))
1801 - echo -n "."
1802 - sleep 1
1803 - done
1804 - eend $rc
1805 -
1806 - if ! [[ -S "${socket}" ]]; then
1807 - die "Completely failed to start up mysqld with: ${mysqld}"
1808 - fi
1809 -
1810 - ebegin "Setting root password"
1811 - # Do this from memory, as we don't want clear text passwords in temp files
1812 - local sql="ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${MYSQL_ROOT_PASSWORD}'"
1813 - "${EROOT%/}/usr/bin/mysql" \
1814 - --no-defaults \
1815 - "--socket=${socket}" \
1816 - -hlocalhost \
1817 - -e "${sql}"
1818 - eend $?
1819 -
1820 - # Stop the server and cleanup
1821 - einfo "Stopping the server ..."
1822 - kill $(< "${pidfile}" )
1823 - rm -f "${sqltmp}"
1824 - wait %1
1825 - einfo "Done"
1826 -}
1827
1828 diff --git a/dev-db/mysql/mysql-5.7.17.ebuild b/dev-db/mysql/mysql-5.7.17.ebuild
1829 deleted file mode 100644
1830 index ef830b3..0000000
1831 --- a/dev-db/mysql/mysql-5.7.17.ebuild
1832 +++ /dev/null
1833 @@ -1,210 +0,0 @@
1834 -# Copyright 1999-2018 Gentoo Foundation
1835 -# Distributed under the terms of the GNU General Public License v2
1836 -
1837 -EAPI="6"
1838 -
1839 -MY_EXTRAS_VER="live"
1840 -MY_PV="${PV//_alpha_pre/-m}"
1841 -MY_PV="${MY_PV//_/-}"
1842 -SUBSLOT="20"
1843 -SERVER_URI="https://cdn.mysql.com/archives/${PN}-5.7/${PN}-boost-${MY_PV}.tar.gz"
1844 -MY_SOURCEDIR="${PN}-${MY_PV}"
1845 -inherit mysql-multilib-r1
1846 -
1847 -IUSE="cjk"
1848 -
1849 -# REMEMBER: also update eclass/mysql*.eclass before committing!
1850 -KEYWORDS="~alpha ~amd64 ~arm ~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"
1851 -
1852 -# When MY_EXTRAS is bumped, the index should be revised to exclude these.
1853 -EPATCH_EXCLUDE=''
1854 -
1855 -DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
1856 - >=app-arch/lz4-0_p131:=
1857 - >=dev-libs/protobuf-2.5.0:=
1858 - cjk? ( app-text/mecab )"
1859 -RDEPEND="${RDEPEND}"
1860 -
1861 -MY_PATCH_DIR="${WORKDIR}/mysql-extras"
1862 -
1863 -PATCHES=(
1864 - "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch
1865 - "${MY_PATCH_DIR}"/20001_all_fix-minimal-build-cmake-mysql-5.7.patch
1866 - "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.7.patch
1867 - "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.7.patch
1868 - "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.7.6.patch
1869 - "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.7.10.patch
1870 - "${MY_PATCH_DIR}"/20018_all_mysql-5.7-without-clientlibs-tools.patch
1871 -)
1872 -
1873 -# Please do not add a naive src_unpack to this ebuild
1874 -# If you want to add a single patch, copy the ebuild to an overlay
1875 -# and create your own mysql-extras tarball, looking at 000_index.txt
1876 -
1877 -src_prepare() {
1878 - mysql-multilib-r1_src_prepare
1879 - if use libressl ; then
1880 - sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
1881 - "${S}/cmake/ssl.cmake" || die
1882 - fi
1883 - # Remove dozens of test only plugins by deleting them
1884 - if ! use test ; then
1885 - rm -r "${S}"/plugin/{test_service_sql_api,test_services,udf_services} || die
1886 - fi
1887 - # Remove CJK Fulltext plugin
1888 - if ! use cjk ; then
1889 - rm -r "${S}"/plugin/fulltext || die
1890 - fi
1891 -}
1892 -
1893 -src_configure() {
1894 - local MYSQL_CMAKE_NATIVE_DEFINES=(
1895 - -DWITH_LZ4=system
1896 - -DWITH_NUMA=OFF
1897 - -DWITH_BOOST="${S}/boost/boost_1_59_0"
1898 - -DWITH_PROTOBUF=system
1899 - )
1900 - # This is the CJK fulltext plugin, not related to the complete fulltext indexing
1901 - if use cjk ; then
1902 - MYSQL_CMAKE_NATIVE_DEFINES+=( -DWITH_MECAB=system )
1903 - else
1904 - MYSQL_CMAKE_NATIVE_DEFINES+=( -DWITHOUT_FULLTEXT=1 )
1905 - fi
1906 - mysql-multilib-r1_src_configure
1907 -}
1908 -
1909 -# Official test instructions:
1910 -# USE='server embedded extraengine perl openssl static-libs' \
1911 -# FEATURES='test userpriv -usersandbox' \
1912 -# ebuild mysql-X.X.XX.ebuild \
1913 -# digest clean package
1914 -multilib_src_test() {
1915 -
1916 - if ! multilib_is_native_abi ; then
1917 - einfo "Server tests not available on non-native abi".
1918 - return 0;
1919 - fi
1920 -
1921 - local TESTDIR="${BUILD_DIR}/mysql-test"
1922 - local retstatus_unit
1923 - local retstatus_tests
1924 -
1925 - # Bug #213475 - MySQL _will_ object strenously if your machine is named
1926 - # localhost. Also causes weird failures.
1927 - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
1928 -
1929 - if use server ; then
1930 -
1931 - if [[ $UID -eq 0 ]]; then
1932 - die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
1933 - fi
1934 - has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
1935 -
1936 - einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1937 - addpredict /this-dir-does-not-exist/t9.MYI
1938 -
1939 - # Run CTest (test-units)
1940 - cmake-utils_src_test
1941 - retstatus_unit=$?
1942 - [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
1943 -
1944 - # Ensure that parallel runs don't die
1945 - export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
1946 - # Enable parallel testing, auto will try to detect number of cores
1947 - # You may set this by hand.
1948 - # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
1949 - export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
1950 -
1951 - # create directories because mysqladmin might right out of order
1952 - mkdir -p "${T}"/var-tests{,/log}
1953 -
1954 - # create symlink for the tests to find mysql_tzinfo_to_sql
1955 - ln -s "${BUILD_DIR}/sql/mysql_tzinfo_to_sql" "${S}/sql/"
1956 -
1957 - # These are failing in MySQL 5.5/5.6 for now and are believed to be
1958 - # false positives:
1959 - #
1960 - # main.information_schema, binlog.binlog_statement_insert_delayed,
1961 - # funcs_1.is_triggers funcs_1.is_tables_mysql,
1962 - # funcs_1.is_columns_mysql, binlog.binlog_mysqlbinlog_filter,
1963 - # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt,
1964 - # mysqld--help-notwin, funcs_1.is_triggers, funcs_1.is_tables_mysql, funcs_1.is_columns_mysql
1965 - # perfschema.binlog_edge_stmt, perfschema.binlog_edge_mix, binlog.binlog_mysqlbinlog_filter
1966 - # fails due to USE=-latin1 / utf8 default
1967 - #
1968 - # main.mysql_client_test:
1969 - # segfaults at random under Portage only, suspect resource limits.
1970 - #
1971 - # rpl.rpl_plugin_load
1972 - # fails due to included file not listed in expected result
1973 - # appears to be poor planning
1974 - #
1975 - # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
1976 - # fails due to bad cleanup of previous tests when run in parallel
1977 - # The tool is deprecated anyway
1978 - # Bug 532288
1979 - #
1980 - # main.events2
1981 - # Event creation is in the past and automatically dropped
1982 - for t in \
1983 - binlog.binlog_mysqlbinlog_filter \
1984 - binlog.binlog_statement_insert_delayed \
1985 - funcs_1.is_columns_mysql \
1986 - funcs_1.is_tables_mysql \
1987 - funcs_1.is_triggers \
1988 - main.information_schema \
1989 - main.mysql_client_test \
1990 - main.mysqld--help-notwin \
1991 - perfschema.binlog_edge_mix \
1992 - perfschema.binlog_edge_stmt \
1993 - rpl.rpl_plugin_load \
1994 - main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
1995 - main.events_2 \
1996 - ; do
1997 - mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
1998 - done
1999 -
2000 - if ! use extraengine ; then
2001 - # bug 401673, 530766
2002 - for t in federated.federated_plugin ; do
2003 - mysql-multilib-r1_disable_test "$t" "Test $t requires USE=extraengine (Need federated engine)"
2004 - done
2005 - fi
2006 -
2007 - if ! use cjk ; then
2008 - for t in innodb_fts.ngram_2 innodb_fts.ngram_1 innodb_fts.ngram ; do
2009 - mysql-multilib-r1_disable_test "$t" "Test $t requires USE=cjk"
2010 - done
2011 - fi
2012 -
2013 - # Run mysql tests
2014 - pushd "${TESTDIR}"
2015 -
2016 - # Set file limits higher so tests run
2017 -# ulimit -n 3000
2018 -
2019 - # run mysql-test tests
2020 - perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
2021 - --suite-timeout=5000 --reorder
2022 - retstatus_tests=$?
2023 - [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
2024 - has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
2025 -
2026 - popd
2027 -
2028 - # Cleanup is important for these testcases.
2029 - pkill -9 -f "${S}/ndb" 2>/dev/null
2030 - pkill -9 -f "${S}/sql" 2>/dev/null
2031 -
2032 - failures=""
2033 - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
2034 - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
2035 - has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
2036 -
2037 - [[ -z "$failures" ]] || die "Test failures: $failures"
2038 - einfo "Tests successfully completed"
2039 -
2040 - else
2041 - einfo "Skipping server tests due to minimal build."
2042 - fi
2043 -}