1 |
commit: 731537b966b6677ed4a86b9202b98358c024b4aa |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jul 18 20:22:18 2017 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 18 20:22:18 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=731537b9 |
7 |
|
8 |
dev-db/mariadb: Override several pieces of the eclass |
9 |
|
10 |
Simplify many checks and allow for a new config system to be used |
11 |
This now has a single includedir in my.cnf and many files in /etc/mysql/mariadb.d |
12 |
|
13 |
Package-Manager: Portage-2.3.6, Repoman-2.3.2 |
14 |
Manifest-Sign-Key: D1F781EFF9F4A3B6 |
15 |
|
16 |
dev-db/mariadb/files/my.cnf-10.2 | 3 + |
17 |
dev-db/mariadb/files/my.cnf.distro-client | 21 ++++ |
18 |
dev-db/mariadb/files/my.cnf.distro-server | 28 ++++++ |
19 |
dev-db/mariadb/mariadb-10.2.6.ebuild | 158 +++++++++++++++++++++++++++--- |
20 |
dev-db/mariadb/metadata.xml | 1 + |
21 |
5 files changed, 197 insertions(+), 14 deletions(-) |
22 |
|
23 |
diff --git a/dev-db/mariadb/files/my.cnf-10.2 b/dev-db/mariadb/files/my.cnf-10.2 |
24 |
new file mode 100644 |
25 |
index 0000000..80b4771 |
26 |
--- /dev/null |
27 |
+++ b/dev-db/mariadb/files/my.cnf-10.2 |
28 |
@@ -0,0 +1,3 @@ |
29 |
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file. |
30 |
+ |
31 |
+!includedir @GENTOO_PORTAGE_EPREFIX@/etc/mysql/mariadb.d |
32 |
|
33 |
diff --git a/dev-db/mariadb/files/my.cnf.distro-client b/dev-db/mariadb/files/my.cnf.distro-client |
34 |
new file mode 100644 |
35 |
index 0000000..4bbe0f9 |
36 |
--- /dev/null |
37 |
+++ b/dev-db/mariadb/files/my.cnf.distro-client |
38 |
@@ -0,0 +1,21 @@ |
39 |
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/50-distro-client.cnf: The global mysql configuration file. |
40 |
+ |
41 |
+# The following options will be passed to all MySQL clients |
42 |
+[client] |
43 |
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock |
44 |
+character-sets-dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb/charsets |
45 |
+default-character-set=utf8 |
46 |
+ |
47 |
+[mysql] |
48 |
+# uncomment the next directive if you are not familiar with SQL |
49 |
+#safe-updates |
50 |
+ |
51 |
+[mysqldump] |
52 |
+quick |
53 |
+max_allowed_packet = 16M |
54 |
+ |
55 |
+[myisamchk] |
56 |
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb/charsets |
57 |
+ |
58 |
+[myisampack] |
59 |
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb/charsets |
60 |
|
61 |
diff --git a/dev-db/mariadb/files/my.cnf.distro-server b/dev-db/mariadb/files/my.cnf.distro-server |
62 |
new file mode 100644 |
63 |
index 0000000..eaf80be |
64 |
--- /dev/null |
65 |
+++ b/dev-db/mariadb/files/my.cnf.distro-server |
66 |
@@ -0,0 +1,28 @@ |
67 |
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/50-distro-server.cnf: The global mysql configuration file. |
68 |
+ |
69 |
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations |
70 |
+[mysqld] |
71 |
+character-set-server = utf8 |
72 |
+user = mysql |
73 |
+port = 3306 |
74 |
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock |
75 |
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mariadb.pid |
76 |
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err |
77 |
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr |
78 |
+datadir = @DATADIR@ |
79 |
+skip-external-locking |
80 |
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb |
81 |
+#Set this to your desired error message language |
82 |
+lc_messages = en_US |
83 |
+ |
84 |
+# security: |
85 |
+# using "localhost" in connects uses sockets by default |
86 |
+# skip-networking |
87 |
+bind-address = 127.0.0.1 |
88 |
+ |
89 |
+log-bin |
90 |
+server-id = 1 |
91 |
+ |
92 |
+# point the following paths to different dedicated disks |
93 |
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/ |
94 |
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname |
95 |
|
96 |
diff --git a/dev-db/mariadb/mariadb-10.2.6.ebuild b/dev-db/mariadb/mariadb-10.2.6.ebuild |
97 |
index 300717f..323622c 100644 |
98 |
--- a/dev-db/mariadb/mariadb-10.2.6.ebuild |
99 |
+++ b/dev-db/mariadb/mariadb-10.2.6.ebuild |
100 |
@@ -10,13 +10,14 @@ MYSQL_PV_MAJOR="5.6" |
101 |
|
102 |
JAVA_PKG_OPT_USE="jdbc" |
103 |
|
104 |
-inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1 |
105 |
+inherit toolchain-funcs java-pkg-opt-2 prefix toolchain-funcs \ |
106 |
+ multilib-minimal mysql-multilib-r1 |
107 |
|
108 |
HOMEPAGE="http://mariadb.org/" |
109 |
DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
110 |
LICENSE="GPL-2 LGPL-2.1+" |
111 |
|
112 |
-IUSE="+backup bindist cracklib galera kerberos innodb-lz4 innodb-lzo innodb-snappy jdbc mroonga odbc oqgraph pam sphinx sst-rsync sst-xtrabackup tokudb systemd xml" |
113 |
+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" |
114 |
RESTRICT="!bindist? ( bindist )" |
115 |
|
116 |
REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )" |
117 |
@@ -88,7 +89,6 @@ MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h |
118 |
/usr/include/mariadb/mariadb_version.h |
119 |
/usr/include/mysql/private/probes_mysql_nodtrace.h |
120 |
/usr/include/mysql/private/probes_mysql_dtrace.h ) |
121 |
-MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config /usr/bin/mysql_config ) |
122 |
|
123 |
pkg_setup() { |
124 |
java-pkg-opt-2_pkg_setup |
125 |
@@ -97,12 +97,36 @@ pkg_setup() { |
126 |
|
127 |
pkg_preinst() { |
128 |
java-pkg-opt-2_pkg_preinst |
129 |
- mysql-multilib-r1_pkg_preinst |
130 |
+ |
131 |
+ # Here we need to see if the implementation switched client libraries |
132 |
+ # We check if this is a new instance of the package and a client library already exists |
133 |
+ local SHOW_ABI_MESSAGE libpath |
134 |
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
135 |
+ libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
136 |
+ elog "Due to ABI changes when switching between different client libraries," |
137 |
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
138 |
+ elog "Please run: revdep-rebuild --library ${libpath}" |
139 |
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
140 |
+ fi |
141 |
} |
142 |
|
143 |
src_prepare() { |
144 |
java-pkg-opt-2_src_prepare |
145 |
- mysql-multilib-r1_src_prepare |
146 |
+ if use tcmalloc; then |
147 |
+ echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
148 |
+ fi |
149 |
+ |
150 |
+ # Don't build bundled xz-utils for tokudb |
151 |
+ echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
152 |
+ sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
153 |
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
154 |
+ |
155 |
+ # Remove the bundled groonga |
156 |
+ # There is no CMake flag, it simply checks for existance |
157 |
+ rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
158 |
+ |
159 |
+ eapply "${PATCHES[@]}" |
160 |
+ eapply_user |
161 |
} |
162 |
|
163 |
src_configure(){ |
164 |
@@ -144,7 +168,7 @@ src_configure(){ |
165 |
fi |
166 |
|
167 |
MYSQL_CMAKE_NATIVE_DEFINES+=( |
168 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph YES NO) |
169 |
+ -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
170 |
-DPLUGIN_SPHINX=$(usex sphinx YES NO) |
171 |
-DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
172 |
-DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
173 |
@@ -161,11 +185,12 @@ src_configure(){ |
174 |
-DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
175 |
-DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
176 |
-DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
177 |
- -DPLUGIN_MROONGA=$(usex mroonga YES NO) |
178 |
+ -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
179 |
-DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
180 |
-DWITH_MARIABACKUP=$(usex backup ON OFF) |
181 |
-DWITH_LIBARCHIVE=$(usex backup ON OFF) |
182 |
-DINSTALL_SQLBENCHDIR=share/mariadb |
183 |
+ -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
184 |
) |
185 |
if use test ; then |
186 |
# This is needed for the new client lib which tests a real, open server |
187 |
@@ -176,13 +201,118 @@ src_configure(){ |
188 |
} |
189 |
|
190 |
src_install() { |
191 |
- mysql-multilib-r1_src_install |
192 |
- install_compat_symlink() { |
193 |
- use static-libs && dosym libmariadbclient.a "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.a" |
194 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so" |
195 |
- dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so.${SUBSLOT}" |
196 |
- } |
197 |
- multilib_foreach_abi install_compat_symlink |
198 |
+ # wrap the config scripts |
199 |
+ local MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config /usr/bin/mysql_config ) |
200 |
+ multilib-minimal_src_install |
201 |
+} |
202 |
+ |
203 |
+# Intentionally override eclass function |
204 |
+multilib_src_install() { |
205 |
+ cmake-utils_src_install |
206 |
+ |
207 |
+ # Make sure the vars are correctly initialized |
208 |
+ mysql_init_vars |
209 |
+ |
210 |
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
211 |
+ if [[ -f "${D}${MY_INCLUDEDIR}/private/config.h" ]] ; then |
212 |
+ rm "${D}${MY_INCLUDEDIR}/private/config.h" || die |
213 |
+ fi |
214 |
+ |
215 |
+ if ! multilib_is_native_abi && use server ; then |
216 |
+ insinto /usr/include/mysql/private |
217 |
+ doins "${S}"/sql/*.h |
218 |
+ fi |
219 |
+} |
220 |
+ |
221 |
+multilib_src_install_all() { |
222 |
+ # Make sure the vars are correctly initialized |
223 |
+ mysql_init_vars |
224 |
+ |
225 |
+ # Convenience links |
226 |
+ einfo "Making Convenience links for mysqlcheck multi-call binary" |
227 |
+ dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze" |
228 |
+ dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" |
229 |
+ dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" |
230 |
+ |
231 |
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
232 |
+ if [[ -d "${ED}/usr/data" ]] ; then |
233 |
+ rm -Rf "${ED}/usr/data" || die |
234 |
+ fi |
235 |
+ |
236 |
+ # Unless they explicitly specific USE=test, then do not install the |
237 |
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a |
238 |
+ # validation of your database configuration after tuning it. |
239 |
+ if ! use test ; then |
240 |
+ rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
241 |
+ fi |
242 |
+ |
243 |
+ # Configuration stuff |
244 |
+ einfo "Building default configuration ..." |
245 |
+ [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
246 |
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
247 |
+ cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
248 |
+ eprefixify "${TMPDIR}/my.cnf" |
249 |
+ doins "${TMPDIR}/my.cnf" |
250 |
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
251 |
+ cp "${FILESDIR}/my.cnf-distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
252 |
+ eprefixify "${TMPDIR}/50-distro-client.cnf" |
253 |
+ newins "${TMPDIR}/50-distro-client.cnf" |
254 |
+ |
255 |
+ if use server ; then |
256 |
+ mycnf_src="my.cnf.distro-server" |
257 |
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
258 |
+ "${FILESDIR}/${mycnf_src}" \ |
259 |
+ > "${TMPDIR}/my.cnf.ok" || die |
260 |
+ if use prefix ; then |
261 |
+ sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
262 |
+ "${TMPDIR}/my.cnf.ok" || die |
263 |
+ fi |
264 |
+ if use latin1 ; then |
265 |
+ sed -i \ |
266 |
+ -e "/character-set/s|utf8|latin1|g" \ |
267 |
+ "${TMPDIR}/my.cnf.ok" || die |
268 |
+ fi |
269 |
+ eprefixify "${TMPDIR}/my.cnf.ok" |
270 |
+ newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
271 |
+ einfo "Creating initial directories" |
272 |
+ # Empty directories ... |
273 |
+ diropts "-m0750" |
274 |
+ if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then |
275 |
+ dodir "${MY_DATADIR#${EPREFIX}}" |
276 |
+ keepdir "${MY_DATADIR#${EPREFIX}}" |
277 |
+ chown -R mysql:mysql "${D}/${MY_DATADIR}" |
278 |
+ fi |
279 |
+ |
280 |
+ diropts "-m0755" |
281 |
+ local folder |
282 |
+ for folder in "${MY_LOGDIR#${EPREFIX}}" ; do |
283 |
+ dodir "${folder}" |
284 |
+ keepdir "${folder}" |
285 |
+ chown -R mysql:mysql "${ED}/${folder}" |
286 |
+ done |
287 |
+ |
288 |
+ einfo "Including support files and sample configurations" |
289 |
+ docinto "support-files" |
290 |
+ local script |
291 |
+ for script in \ |
292 |
+ "${S}"/support-files/magic |
293 |
+ do |
294 |
+ [[ -f "$script" ]] && dodoc "${script}" |
295 |
+ done |
296 |
+ |
297 |
+ docinto "scripts" |
298 |
+ for script in "${S}"/scripts/mysql* ; do |
299 |
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
300 |
+ done |
301 |
+ fi |
302 |
+ |
303 |
+ #Remove mytop if perl is not selected |
304 |
+ [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
305 |
+ |
306 |
+ # Install compatible symlinks to libmysqlclient |
307 |
+ use static-libs && dosym libmariadbclient.a "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.a" |
308 |
+ dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so" |
309 |
+ dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so.${SUBSLOT}" |
310 |
} |
311 |
|
312 |
# Official test instructions: |
313 |
|
314 |
diff --git a/dev-db/mariadb/metadata.xml b/dev-db/mariadb/metadata.xml |
315 |
index b4e973b..69cc5da 100644 |
316 |
--- a/dev-db/mariadb/metadata.xml |
317 |
+++ b/dev-db/mariadb/metadata.xml |
318 |
@@ -33,6 +33,7 @@ |
319 |
<flag name="pam">Enable the optional PAM authentication plugin for the server</flag> |
320 |
<flag name="pbxt">Add experimental support for PBXT storage engine</flag> |
321 |
<flag name="profiling">Add support for statement profiling (requires USE=community).</flag> |
322 |
+ <flag name="rocksdb">Add support for RocksDB; a key/value, LSM database optimized for flash storage</flag> |
323 |
<flag name="server">Build the server program</flag> |
324 |
<flag name="sphinx">Add suport for the sphinx full-text search engine</flag> |
325 |
<flag name="sst-rsync">Add tools needed to support the rsync SST method</flag> |