1 |
commit: a312e126b57d4fb11d6adb48d412f2c872115bb7 |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 14 21:19:00 2019 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 14 21:21:09 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a312e126 |
7 |
|
8 |
dev-db/mariadb: Drop old |
9 |
|
10 |
Package-Manager: Portage-2.3.79, Repoman-2.3.18 |
11 |
Signed-off-by: Brian Evans <grknight <AT> gentoo.org> |
12 |
|
13 |
dev-db/mariadb/Manifest | 8 - |
14 |
.../files/MDEV-20247-replication-10.2.patch | 108 --- |
15 |
dev-db/mariadb/files/MDEV-20247-replication.patch | 121 --- |
16 |
dev-db/mariadb/mariadb-10.1.41-r1.ebuild | 898 ----------------- |
17 |
dev-db/mariadb/mariadb-10.2.26-r1.ebuild | 981 ------------------- |
18 |
dev-db/mariadb/mariadb-10.2.27.ebuild | 981 ------------------- |
19 |
dev-db/mariadb/mariadb-10.3.17-r1.ebuild | 982 ------------------- |
20 |
dev-db/mariadb/mariadb-10.3.18.ebuild | 981 ------------------- |
21 |
dev-db/mariadb/mariadb-10.4.7-r1.ebuild | 1010 -------------------- |
22 |
dev-db/mariadb/mariadb-10.4.8.ebuild | 1009 ------------------- |
23 |
dev-db/mariadb/mariadb-5.5.65.ebuild | 836 ---------------- |
24 |
11 files changed, 7915 deletions(-) |
25 |
|
26 |
diff --git a/dev-db/mariadb/Manifest b/dev-db/mariadb/Manifest |
27 |
index 2882bc8aa37..5fee34d8ec2 100644 |
28 |
--- a/dev-db/mariadb/Manifest |
29 |
+++ b/dev-db/mariadb/Manifest |
30 |
@@ -1,17 +1,9 @@ |
31 |
DIST mariadb-10.1.38.tar.gz 63535685 BLAKE2B c179ea2f60287c2bc1c0d1c47ae989ac2653a24063e8344cef2f3062fc6798e18b969e8f9aa8287104ce2518e6c644cb8d3a4650b5a0bc5dfde973e76e618955 SHA512 184582f3a902a989ba3d9c4d21288c014c8b469adbbb4cbabc621c5006022cef29baed8c1140ed4476b124da83b76dfa414295ed0c3374be826e75aca953a77b |
32 |
-DIST mariadb-10.1.41.tar.gz 63615288 BLAKE2B 91ebc6d24c80ad9651c42a2f4553ce3ec3b7beb17493f90ebbf02ab23f425b0f729766cf2c81202832dfbca0a5e285f94a4daf794fcf4d445730fbe4fcc88871 SHA512 4a18b06fda49c5c3627b4e7cd32fb460e73762273a0c3d09098e34c71e63caa8fad03cdd92ae4a391cdfdb3719934688f0bdf312fa4af7ac3b9e5f5d90f404be |
33 |
DIST mariadb-10.1.43.tar.gz 63635313 BLAKE2B 60617d3021bb478633a995b93a3659a287ecab49bb1997efc430e2f453a8145307f0db02799b43560a51c92ef528060f93fb82fd0362ea34052f68590144bff0 SHA512 47e9693c6c1d25d2c3541efe001569c17e70721edcbfc3d0ccc96f3638820123436c18d2cbc3c2ad252adf1eda446feff0370eb97f9e57b6711757ac899b47e8 |
34 |
DIST mariadb-10.2.22.tar.gz 71907765 BLAKE2B e7781a9e1bb0becca543ebb0b9e03912fbafa9de45bbd5c7232f92d29b934148dd124ad462bf8aa5aec2e4ee0bf75a03fae5e5fe97a77e1d93095052a577c14b SHA512 cd61d0c2d528b23b975e6ea142560d9b9ebff7ecda6fa9b3659b25b3406e8cc925918f4c3bb0e200ddb8d0520bcaa4d4f70d245b4731896f9ba2f1bdf0a817b2 |
35 |
-DIST mariadb-10.2.26.tar.gz 73037655 BLAKE2B 54fd27959960736bffe0eeacc913b9aed0407d1be7a60d3035a1b84cbe8066aa1551c1c82a1b90b824debf85faaa9d11e3de29634a0108bc04bc17ca5c2a9d7c SHA512 1eaac1c1dda1017b64249d39d872729d3140d81653240c54f688f64440b1775e5f3a7c5a8486075fa1799411dfb0c2c09b7c1dbb46d95675572d90127048c124 |
36 |
-DIST mariadb-10.2.27.tar.gz 73068579 BLAKE2B 7e4ae229040b3136ad107979864bc391556c1ba83847addd89e09f3757cd01203503e07832abe496a7f560048ed704f273607da3a114afa59ceb13cbb3b89c14 SHA512 9ea7ea30f964d022d16c662c18ac40ea50ef5b6592d02ba739ad81f9dfa9e60be90ea6d4706b43b07402c4cbc8c0280633b6e21bda6daf5bbc1d3c540993e4d6 |
37 |
DIST mariadb-10.2.29.tar.gz 73087972 BLAKE2B aa3fe880f00b02846b26f16fcd37d18ebe217a2c9680c8c535042d2759852c929cd649d662c6a2bc603d934a6ba770ef945752c99d150f539e1fdd0d9be0ad51 SHA512 cee4e0d1a2b203cadaaa5678c5ce17302f18ffa55d07c8329392b1ea84740340c006eb9ab5920beef80835c2a399d5fffca409b8288e10ae62d290af62ec4ab8 |
38 |
-DIST mariadb-10.3.17.tar.gz 71894997 BLAKE2B 8e04302f67a99c28751f9970b7e8dfc5ada0583fdabc416e0469e23fa93d22dae8b79e762ef14ca65957e22ec310a290b15d33746f6f2e7287f922803e6a6826 SHA512 6fba995d8c284a12f19ee5635f5d69d8fa89fc314f512cd1764b2c4593933baf71a472ddce630463debd3bfbafa1cf5afee3f40d3c4062242f58cea16259561e |
39 |
-DIST mariadb-10.3.18.tar.gz 71950543 BLAKE2B d157426781713f19470004d80c587019e12c875d0958e5077ca373d856a8f1214be01dbc2a50fd5a754eaa91e727179bea70ee2a3133a219209cb819108c8940 SHA512 817253d18f20c74f9ec8030678fd50a28b1726fd59153023a3a5e9b3f79e1f44d79feb24ae9ed72d8c1c04017110c932aba7be0610fb06245590c7f5610db242 |
40 |
DIST mariadb-10.3.20.tar.gz 71990355 BLAKE2B f950f0eb836751d0eebb9ae561fe3b5aefade04a0d389465918aa2a887e4f717ab4e6bd835dea8f9a88aacfe10c0b091fc2a59882a1781a3f2903ef07a759f5d SHA512 8080cb6db85c587f39f128e98b00c3e6428bf3e828271a227bb2c61c97683c965802baa6e5f825317f7e2963683c0f81699642853deeca6977faa2b6932044a3 |
41 |
DIST mariadb-10.4.10.tar.gz 78352896 BLAKE2B c0e448fba455feb9385b7d57e1a727e84eaf4cfa52ce0dbd6ff062aa0b5abc42005680fb185416d04fbd7bb62d9bbd6c93e4cb77b145418cf6be92747f8b1c2a SHA512 4a9b9a37bc3a273de4bd781dac3636256364dae6efbba45765d6b28995da3d64e180422cd10418d1c7acd7fd8843fe2a2638c07e0f56b0c09170c58812cc6b71 |
42 |
-DIST mariadb-10.4.7.tar.gz 78155161 BLAKE2B b2c92093438b3574e494bda2180f4a2b5cbe10bac1c46acc45b5303fb4c2a1ca54f3ea88d138ab9cbb492460171dde86f3c21e5873d964b15c6c064e2e6eb47f SHA512 cb8b5adaef1970b9c8f04db08c18660f8b3df87f699aa93c1bee9497b887ddf50fcf3a2aebbe21a5fc9dfcbd118d0192d7421512522d98eaf30a014822c2f7ce |
43 |
-DIST mariadb-10.4.8.tar.gz 78262897 BLAKE2B 357dfd8db702d30c30173cb4ee0bbbda8e54a77a8f726cdc529cbaeebd390fe11fd05c108dde54b029b7e311ebbf9a610dc2c6e4015c9a198d816deaaec5831e SHA512 1aa7117734f4ebeb08395289ff1295e1d2ed2f89e8ccf3224cd60afaf2be56f81e8f0448e7619eeb6c858355a2b1e224efe42a0f400941f138342318adb66c42 |
44 |
-DIST mariadb-5.5.65.tar.gz 45957577 BLAKE2B 9ed27349d008d2001ed4059370505064918ef3586f89157f5f28892bceabd3073b7070f4054c0a700f1504dde3a4077e274111d5b8cb3713bc5db0910b752628 SHA512 5dbaa2ba7a829a0d5ae6ab8394c31a58753cd93da2637cd83d1e055e78b0796d63214418ddc91a65cefdd791aad4f01b0743aa8c7c40ecbb404cb81fd0138443 |
45 |
DIST mariadb-5.5.66.tar.gz 45962591 BLAKE2B 41befba24abec2af876168a11fc205d328c137baa49e5e521787898e4b973d1dc548ef459228811caa99fa3c2b7a9fe96f3eb7a04bf62f0bb20966e4ffd2ea9b SHA512 403f3bc67018e01eb2277a88d3a7ac673d50df8f7a67607f9d14e3167d1bdd4ca202983df69c97688ff51edbd6d6b43af3541c75e968d1d01713a7b6495e4c8c |
46 |
DIST mysql-extras-20180809-1700Z.tar.bz2 322999 BLAKE2B 8b5feb32085dc35b2f68dae985b2d266c4eaa0e956b490050a2df04bbff99bf8623b67e75af9326d84e3ad625c4d86b0d21d23c9a96df5a0c9cd5ed730958970 SHA512 fbd7af9284bbf09d55f128361e7cc52d94f24ac491aac800cd6d61f2e444aeca66a4d5e6ae94c2fb4044e00cec9b232bae9a76a229f87f19d90b7aecf70792ec |
47 |
DIST mysql-extras-20190305-2052Z.tar.bz2 331304 BLAKE2B 1d2c35a961159fa5ce9ee6699fce943f5a5b5cf60b11c9bb4bcccee4943f4508a9eb6d01050c642353ac592ce1a6b421abf2a1bebc706c44c4c8a36aa698ec43 SHA512 ae63403320e010acbb92f8aec6da8ed4f267cef0bad37147d594076fd94571de7f98bfc2afbe94af5d716f58d57696fd958b1e13e20e87052f252ed4a188cd3c |
48 |
|
49 |
diff --git a/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch b/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch |
50 |
deleted file mode 100644 |
51 |
index 193f2dd7750..00000000000 |
52 |
--- a/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch |
53 |
+++ /dev/null |
54 |
@@ -1,108 +0,0 @@ |
55 |
-From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001 |
56 |
-From: Thirunarayanan Balathandayuthapani <thiru@×××××××.com> |
57 |
-Date: Wed, 7 Aug 2019 12:35:04 +0530 |
58 |
-Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never |
59 |
- starts |
60 |
- |
61 |
-- The commit ab6dd774082c57f48d998e03655c06b672799b2d wrongly sets the |
62 |
-condition inside innobase_srv_conc_enter_innodb(). Problem is that |
63 |
-InnoDB makes the thread to sleep indefinitely if it is a replication |
64 |
-slave thread. |
65 |
- |
66 |
-Thanks to Sujatha Sivakumar for contributing the replication test case. |
67 |
---- |
68 |
- .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++ |
69 |
- .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++ |
70 |
- storage/innobase/handler/ha_innodb.cc | 6 +-- |
71 |
- 4 files changed, 60 insertions(+), 6 deletions(-) |
72 |
- create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
73 |
- create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
74 |
- |
75 |
-diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
76 |
-new file mode 100644 |
77 |
-index 000000000000..0ed894336a1c |
78 |
---- /dev/null |
79 |
-+++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
80 |
-@@ -0,0 +1,18 @@ |
81 |
-+include/master-slave.inc |
82 |
-+[connection master] |
83 |
-+connection slave; |
84 |
-+SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
85 |
-+SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
86 |
-+SET GLOBAL innodb_thread_concurrency = 100; |
87 |
-+connection master; |
88 |
-+CREATE TABLE t(f INT) ENGINE=INNODB; |
89 |
-+INSERT INTO t VALUES (10); |
90 |
-+connection slave; |
91 |
-+include/diff_tables.inc [master:t, slave:t] |
92 |
-+"===== Clean up=======" |
93 |
-+connection master; |
94 |
-+DROP TABLE t; |
95 |
-+connection slave; |
96 |
-+SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
97 |
-+SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
98 |
-+include/rpl_end.inc |
99 |
-diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
100 |
-new file mode 100644 |
101 |
-index 000000000000..b4c2971d2fbc |
102 |
---- /dev/null |
103 |
-+++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
104 |
-@@ -0,0 +1,41 @@ |
105 |
-+# ==== Purpose ==== |
106 |
-+# |
107 |
-+# Test verifies that replication shouldn't hang when number of active threads |
108 |
-+# on the slave server are less than the allowed innodb_thread_concurrency value. |
109 |
-+# |
110 |
-+# ==== Implementation ==== |
111 |
-+# |
112 |
-+# Steps: |
113 |
-+# 0 - Have master slave replication setup with engine being Innodb. |
114 |
-+# 1 - Configure innodb_thread_concurrency = 100. |
115 |
-+# 2 - Do some DML on master and sync the slave with master. |
116 |
-+# 3 - Ensure replication doesn't hang. |
117 |
-+# |
118 |
-+# ==== References ==== |
119 |
-+# |
120 |
-+# MDEV-20247: Replication hangs with "preparing" and never starts |
121 |
-+# |
122 |
-+ |
123 |
-+--source include/master-slave.inc |
124 |
-+--source include/have_innodb.inc |
125 |
-+ |
126 |
-+--connection slave |
127 |
-+SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
128 |
-+SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
129 |
-+SET GLOBAL innodb_thread_concurrency = 100; |
130 |
-+ |
131 |
-+--connection master |
132 |
-+CREATE TABLE t(f INT) ENGINE=INNODB; |
133 |
-+INSERT INTO t VALUES (10); |
134 |
-+--sync_slave_with_master |
135 |
-+ |
136 |
-+--let $diff_tables=master:t, slave:t |
137 |
-+--source include/diff_tables.inc |
138 |
-+ |
139 |
-+--echo "===== Clean up=======" |
140 |
-+--connection master |
141 |
-+DROP TABLE t; |
142 |
-+--sync_slave_with_master |
143 |
-+SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
144 |
-+SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
145 |
-+--source include/rpl_end.inc |
146 |
-diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc |
147 |
-index 081fcbd9c51e..5dfe240631b8 100644 |
148 |
---- a/storage/innobase/handler/ha_innodb.cc |
149 |
-+++ b/storage/innobase/handler/ha_innodb.cc |
150 |
-@@ -1686,9 +1686,9 @@ innobase_srv_conc_enter_innodb( |
151 |
- && thd_is_replication_slave_thread(trx->mysql_thd)) { |
152 |
- const ulonglong end = my_interval_timer() |
153 |
- + ulonglong(srv_replication_delay) * 1000000; |
154 |
-- while (srv_conc_get_active_threads() |
155 |
-- >= srv_thread_concurrency |
156 |
-- || my_interval_timer() >= end) { |
157 |
-+ while ((srv_conc_get_active_threads() |
158 |
-+ >= srv_thread_concurrency) |
159 |
-+ && my_interval_timer() < end) { |
160 |
- os_thread_sleep(2000 /* 2 ms */); |
161 |
- } |
162 |
- } else { |
163 |
|
164 |
diff --git a/dev-db/mariadb/files/MDEV-20247-replication.patch b/dev-db/mariadb/files/MDEV-20247-replication.patch |
165 |
deleted file mode 100644 |
166 |
index 92f8e0e1a67..00000000000 |
167 |
--- a/dev-db/mariadb/files/MDEV-20247-replication.patch |
168 |
+++ /dev/null |
169 |
@@ -1,121 +0,0 @@ |
170 |
-From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001 |
171 |
-From: Thirunarayanan Balathandayuthapani <thiru@×××××××.com> |
172 |
-Date: Wed, 7 Aug 2019 12:35:04 +0530 |
173 |
-Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never |
174 |
- starts |
175 |
- |
176 |
-- The commit ab6dd774082c57f48d998e03655c06b672799b2d wrongly sets the |
177 |
-condition inside innobase_srv_conc_enter_innodb(). Problem is that |
178 |
-InnoDB makes the thread to sleep indefinitely if it is a replication |
179 |
-slave thread. |
180 |
- |
181 |
-Thanks to Sujatha Sivakumar for contributing the replication test case. |
182 |
---- |
183 |
- .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++ |
184 |
- .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++ |
185 |
- storage/innobase/handler/ha_innodb.cc | 6 +-- |
186 |
- storage/xtradb/handler/ha_innodb.cc | 6 +-- |
187 |
- 4 files changed, 60 insertions(+), 6 deletions(-) |
188 |
- create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
189 |
- create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
190 |
- |
191 |
-diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
192 |
-new file mode 100644 |
193 |
-index 000000000000..0ed894336a1c |
194 |
---- /dev/null |
195 |
-+++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
196 |
-@@ -0,0 +1,13 @@ |
197 |
-+include/master-slave.inc |
198 |
-+[connection master] |
199 |
-+SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
200 |
-+SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
201 |
-+SET GLOBAL innodb_thread_concurrency = 100; |
202 |
-+CREATE TABLE t(f INT) ENGINE=INNODB; |
203 |
-+INSERT INTO t VALUES (10); |
204 |
-+include/diff_tables.inc [master:t, slave:t] |
205 |
-+"===== Clean up=======" |
206 |
-+DROP TABLE t; |
207 |
-+SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
208 |
-+SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
209 |
-+include/rpl_end.inc |
210 |
-diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
211 |
-new file mode 100644 |
212 |
-index 000000000000..b4c2971d2fbc |
213 |
---- /dev/null |
214 |
-+++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
215 |
-@@ -0,0 +1,41 @@ |
216 |
-+# ==== Purpose ==== |
217 |
-+# |
218 |
-+# Test verifies that replication shouldn't hang when number of active threads |
219 |
-+# on the slave server are less than the allowed innodb_thread_concurrency value. |
220 |
-+# |
221 |
-+# ==== Implementation ==== |
222 |
-+# |
223 |
-+# Steps: |
224 |
-+# 0 - Have master slave replication setup with engine being Innodb. |
225 |
-+# 1 - Configure innodb_thread_concurrency = 100. |
226 |
-+# 2 - Do some DML on master and sync the slave with master. |
227 |
-+# 3 - Ensure replication doesn't hang. |
228 |
-+# |
229 |
-+# ==== References ==== |
230 |
-+# |
231 |
-+# MDEV-20247: Replication hangs with "preparing" and never starts |
232 |
-+# |
233 |
-+ |
234 |
-+--source include/master-slave.inc |
235 |
-+--source include/have_innodb.inc |
236 |
-+ |
237 |
-+--connection slave |
238 |
-+SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
239 |
-+SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
240 |
-+SET GLOBAL innodb_thread_concurrency = 100; |
241 |
-+ |
242 |
-+--connection master |
243 |
-+CREATE TABLE t(f INT) ENGINE=INNODB; |
244 |
-+INSERT INTO t VALUES (10); |
245 |
-+--sync_slave_with_master |
246 |
-+ |
247 |
-+--let $diff_tables=master:t, slave:t |
248 |
-+--source include/diff_tables.inc |
249 |
-+ |
250 |
-+--echo "===== Clean up=======" |
251 |
-+--connection master |
252 |
-+DROP TABLE t; |
253 |
-+--sync_slave_with_master |
254 |
-+SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
255 |
-+SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
256 |
-+--source include/rpl_end.inc |
257 |
-diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc |
258 |
-index 081fcbd9c51e..5dfe240631b8 100644 |
259 |
---- a/storage/innobase/handler/ha_innodb.cc |
260 |
-+++ b/storage/innobase/handler/ha_innodb.cc |
261 |
-@@ -1686,9 +1686,9 @@ innobase_srv_conc_enter_innodb( |
262 |
- && thd_is_replication_slave_thread(trx->mysql_thd)) { |
263 |
- const ulonglong end = my_interval_timer() |
264 |
- + ulonglong(srv_replication_delay) * 1000000; |
265 |
-- while (srv_conc_get_active_threads() |
266 |
-- >= srv_thread_concurrency |
267 |
-- || my_interval_timer() >= end) { |
268 |
-+ while ((srv_conc_get_active_threads() |
269 |
-+ >= srv_thread_concurrency) |
270 |
-+ && my_interval_timer() < end) { |
271 |
- os_thread_sleep(2000 /* 2 ms */); |
272 |
- } |
273 |
- } else { |
274 |
-diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc |
275 |
-index 5e7482ff6bfa..b5002187e3b2 100644 |
276 |
---- a/storage/xtradb/handler/ha_innodb.cc |
277 |
-+++ b/storage/xtradb/handler/ha_innodb.cc |
278 |
-@@ -1949,9 +1949,9 @@ innobase_srv_conc_enter_innodb( |
279 |
- && thd_is_replication_slave_thread(trx->mysql_thd)) { |
280 |
- const ulonglong end = my_interval_timer() |
281 |
- + ulonglong(srv_replication_delay) * 1000000; |
282 |
-- while (srv_conc_get_active_threads() |
283 |
-- >= srv_thread_concurrency |
284 |
-- || my_interval_timer() >= end) { |
285 |
-+ while ((srv_conc_get_active_threads() |
286 |
-+ >= srv_thread_concurrency) |
287 |
-+ && my_interval_timer() < end) { |
288 |
- os_thread_sleep(2000 /* 2 ms */); |
289 |
- } |
290 |
- } else { |
291 |
|
292 |
diff --git a/dev-db/mariadb/mariadb-10.1.41-r1.ebuild b/dev-db/mariadb/mariadb-10.1.41-r1.ebuild |
293 |
deleted file mode 100644 |
294 |
index 4c50f26bc55..00000000000 |
295 |
--- a/dev-db/mariadb/mariadb-10.1.41-r1.ebuild |
296 |
+++ /dev/null |
297 |
@@ -1,898 +0,0 @@ |
298 |
-# Copyright 1999-2019 Gentoo Authors |
299 |
-# Distributed under the terms of the GNU General Public License v2 |
300 |
- |
301 |
-EAPI="6" |
302 |
-MY_EXTRAS_VER="20190305-2052Z" |
303 |
-SUBSLOT="18" |
304 |
- |
305 |
-JAVA_PKG_OPT_USE="jdbc" |
306 |
- |
307 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
308 |
- |
309 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs java-pkg-opt-2 user cmake-utils multilib-build |
310 |
- |
311 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
312 |
- |
313 |
-# Gentoo patches to MySQL |
314 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
315 |
- SRC_URI="${SRC_URI} |
316 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
317 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
318 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
319 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
320 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
321 |
-fi |
322 |
- |
323 |
-HOMEPAGE="https://mariadb.org/" |
324 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
325 |
-LICENSE="GPL-2" |
326 |
-SLOT="0/${SUBSLOT:-0}" |
327 |
-IUSE="+backup bindist client-libs cracklib debug extraengine galera jdbc jemalloc kerberos |
328 |
- innodb-lz4 innodb-lzo innodb-snappy latin1 libressl mroonga numa odbc oqgraph pam |
329 |
- +perl profiling selinux +server sphinx sst-rsync sst-mariabackup sst-xtrabackup |
330 |
- systemd systemtap static static-libs tcmalloc test tokudb xml yassl" |
331 |
- |
332 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
333 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
334 |
- |
335 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
336 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
337 |
- ?? ( tcmalloc jemalloc ) |
338 |
- static? ( yassl !pam )" |
339 |
- |
340 |
-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" |
341 |
- |
342 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
343 |
-# and we will run a mysql server during test phase |
344 |
-S="${WORKDIR}/mysql" |
345 |
- |
346 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
347 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
348 |
- inherit git-r3 |
349 |
- EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git" |
350 |
- EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
351 |
- EGIT_CLONE_TYPE=shallow |
352 |
-else |
353 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
354 |
-fi |
355 |
- |
356 |
-PATCHES=( |
357 |
- "${MY_PATCH_DIR}"/20006_all_cmake_elib-mariadb-10.1.27.patch |
358 |
- "${MY_PATCH_DIR}"/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch |
359 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
360 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.1.16-without-clientlibs-tools.patch |
361 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch |
362 |
- "${MY_PATCH_DIR}"/20029_all_mariadb-10.1.37-enable-numa.patch |
363 |
- "${MY_PATCH_DIR}"/20035_all_mariadb-10.1-atomic-detection.patch |
364 |
- "${FILESDIR}/MDEV-20247-replication.patch" |
365 |
-) |
366 |
- |
367 |
-# Be warned, *DEPEND are version-dependant |
368 |
-# These are used for both runtime and compiletime |
369 |
-COMMON_DEPEND=" |
370 |
- kernel_linux? ( |
371 |
- sys-process/procps:0= |
372 |
- dev-libs/libaio:0= |
373 |
- ) |
374 |
- >=sys-apps/sed-4 |
375 |
- >=sys-apps/texinfo-4.7-r1 |
376 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
377 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
378 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
379 |
- !yassl? ( |
380 |
- !libressl? ( dev-libs/openssl:0= !>=dev-libs/openssl-1.1 ) |
381 |
- libressl? ( dev-libs/libressl:0= ) |
382 |
- ) |
383 |
- >=sys-libs/zlib-1.2.3:0= |
384 |
- sys-libs/ncurses:0= |
385 |
- !bindist? ( |
386 |
- sys-libs/binutils-libs:0= |
387 |
- >=sys-libs/readline-4.1:0= |
388 |
- ) |
389 |
- server? ( |
390 |
- backup? ( app-arch/libarchive:0= ) |
391 |
- cracklib? ( sys-libs/cracklib:0= ) |
392 |
- extraengine? ( |
393 |
- odbc? ( dev-db/unixODBC:0= ) |
394 |
- xml? ( dev-libs/libxml2:2= ) |
395 |
- sys-libs/zlib[minizip] |
396 |
- ) |
397 |
- innodb-lz4? ( app-arch/lz4 ) |
398 |
- innodb-lzo? ( dev-libs/lzo ) |
399 |
- innodb-snappy? ( app-arch/snappy ) |
400 |
- kerberos? ( virtual/krb5 ) |
401 |
- mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
402 |
- numa? ( sys-process/numactl ) |
403 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
404 |
- pam? ( sys-libs/pam:0= ) |
405 |
- systemd? ( sys-apps/systemd:= ) |
406 |
- tokudb? ( app-arch/snappy ) |
407 |
- ) |
408 |
- !yassl? ( !libressl? ( !>=dev-libs/openssl-1.1.0 ) ) |
409 |
- >=dev-libs/libpcre-8.41-r1:3= |
410 |
- !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) |
411 |
-" |
412 |
-DEPEND="virtual/yacc |
413 |
- static? ( sys-libs/ncurses[static-libs] ) |
414 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
415 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
416 |
- ${COMMON_DEPEND}" |
417 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
418 |
- client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) |
419 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
420 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
421 |
- ${COMMON_DEPEND} |
422 |
- server? ( galera? ( |
423 |
- sys-apps/iproute2 |
424 |
- =sys-cluster/galera-25* |
425 |
- sst-rsync? ( sys-process/lsof ) |
426 |
- sst-mariabackup? ( net-misc/socat[ssl] ) |
427 |
- sst-xtrabackup? ( net-misc/socat[ssl] ) |
428 |
- ) ) |
429 |
- perl? ( !dev-db/mytop |
430 |
- virtual/perl-Getopt-Long |
431 |
- dev-perl/TermReadKey |
432 |
- virtual/perl-Term-ANSIColor |
433 |
- virtual/perl-Time-HiRes ) |
434 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
435 |
-" |
436 |
-# For other stuff to bring us in |
437 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
438 |
-# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
439 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
440 |
- server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
441 |
- |
442 |
-pkg_setup() { |
443 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
444 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
445 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
446 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
447 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
448 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
449 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
450 |
- die |
451 |
- fi |
452 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
453 |
- # non x86{,_64} arches |
454 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
455 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
456 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
457 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
458 |
- die |
459 |
- fi |
460 |
- fi |
461 |
- java-pkg-opt-2_pkg_setup |
462 |
- if has test ${FEATURES} && \ |
463 |
- use server && ! has userpriv ${FEATURES} ; then |
464 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
465 |
- fi |
466 |
- |
467 |
- # This should come after all of the die statements |
468 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
469 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
470 |
-} |
471 |
- |
472 |
-pkg_preinst() { |
473 |
- java-pkg-opt-2_pkg_preinst |
474 |
-} |
475 |
- |
476 |
-pkg_postinst() { |
477 |
- # Make sure the vars are correctly initialized |
478 |
- mysql_init_vars |
479 |
- |
480 |
- # Create log directory securely if it does not exist |
481 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
482 |
- |
483 |
- if use server ; then |
484 |
- if use pam; then |
485 |
- einfo |
486 |
- elog "This install includes the PAM authentication plugin." |
487 |
- elog "To activate and configure the PAM plugin, please read:" |
488 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
489 |
- einfo |
490 |
- fi |
491 |
- |
492 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
493 |
- einfo |
494 |
- elog "You might want to run:" |
495 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
496 |
- elog "if this is a new install." |
497 |
- elog |
498 |
- elog "If you are switching server implentations, you should run the" |
499 |
- elog "mysql_upgrade tool." |
500 |
- einfo |
501 |
- else |
502 |
- einfo |
503 |
- elog "If you are upgrading major versions, you should run the" |
504 |
- elog "mysql_upgrade tool." |
505 |
- einfo |
506 |
- fi |
507 |
- |
508 |
- einfo |
509 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
510 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
511 |
- elog "The first time the cluster is activated, you should add" |
512 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
513 |
- elog "This option should then be removed for subsequent starts." |
514 |
- einfo |
515 |
- fi |
516 |
-} |
517 |
- |
518 |
-src_unpack() { |
519 |
- unpack ${A} |
520 |
- # Grab the patches |
521 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack |
522 |
- |
523 |
- mv -f "${WORKDIR%/}/${PN%%-galera}-${PV}" "${S}" || die |
524 |
-} |
525 |
- |
526 |
-src_prepare() { |
527 |
- _disable_engine() { |
528 |
- echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
529 |
- } |
530 |
- |
531 |
- _disable_plugin() { |
532 |
- echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
533 |
- } |
534 |
- |
535 |
- if use tcmalloc; then |
536 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die |
537 |
- fi |
538 |
- |
539 |
- # Don't build bundled xz-utils for tokudb |
540 |
- echo > "${S%/}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
541 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S%/}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
542 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S%/}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
543 |
- |
544 |
- local plugin |
545 |
- local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
546 |
- locale_info qc_info server_audit semisync sql_errlog ) |
547 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext ) |
548 |
- if ! use server; then # These plugins are for the server |
549 |
- for plugin in "${server_plugins[@]}" ; do |
550 |
- _disable_plugin "${plugin}" |
551 |
- done |
552 |
- fi |
553 |
- |
554 |
- if ! use test; then # These plugins are only used during testing |
555 |
- for plugin in "${test_plugins[@]}" ; do |
556 |
- _disable_plugin "${plugin}" |
557 |
- done |
558 |
- fi |
559 |
- |
560 |
- # Collides with mariadb-connector-c bug 655980 |
561 |
- _disable_plugin auth_dialog |
562 |
- |
563 |
- # Avoid useless library checks |
564 |
- use mroonga || _disable_engine mroonga |
565 |
- use oqgraph || _disable_engine oqgraph |
566 |
- _disable_engine example |
567 |
- |
568 |
- # Don't clash with dev-db/mysql-connector-c |
569 |
- sed -i -e 's/ my_print_defaults.1//' \ |
570 |
- -e 's/ perror.1//' \ |
571 |
- "${S}"/man/CMakeLists.txt || die |
572 |
- |
573 |
- cmake-utils_src_prepare |
574 |
- java-pkg-opt-2_src_prepare |
575 |
-} |
576 |
- |
577 |
-src_configure(){ |
578 |
- # bug 508724 mariadb cannot use ld.gold |
579 |
- tc-ld-disable-gold |
580 |
- # Bug #114895, bug #110149 |
581 |
- filter-flags "-O" "-O[01]" |
582 |
- |
583 |
- append-cxxflags -felide-constructors |
584 |
- |
585 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
586 |
- append-flags -fno-strict-aliasing |
587 |
- |
588 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
589 |
- |
590 |
- # debug hack wrt #497532 |
591 |
- mycmakeargs=( |
592 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
593 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
594 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr" |
595 |
- -DDEFAULT_SYSCONFDIR="${EPREFIX%/}/etc/mysql" |
596 |
- -DINSTALL_BINDIR=bin |
597 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
598 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
599 |
- -DINSTALL_INCLUDEDIR=include/mysql |
600 |
- -DINSTALL_INFODIR=share/info |
601 |
- -DINSTALL_LIBDIR=$(get_libdir) |
602 |
- -DINSTALL_MANDIR=share/man |
603 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
604 |
- -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mariadb/mysql-test' '') |
605 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
606 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
607 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql" |
608 |
- -DINSTALL_SBINDIR=sbin |
609 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mariadb" |
610 |
- -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" |
611 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
612 |
- -DWITH_ZLIB=system |
613 |
- -DENABLED_LOCAL_INFILE=1 |
614 |
- -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
615 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
616 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
617 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
618 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
619 |
- # The build forces this to be defined when cross-compiling. We pass it |
620 |
- # all the time for simplicity and to make sure it is actually correct. |
621 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
622 |
- -DWITHOUT_CLIENTLIBS=YES |
623 |
- -DWITH_READLINE=$(usex bindist 1 0) |
624 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
625 |
- -DENABLE_DTRACE=$(usex systemtap) |
626 |
- -DWITH_SSL=$(usex yassl bundled system) |
627 |
- -DPLUGIN_CLIENT_ED25519=NO |
628 |
- -DPLUGIN_AUTH_GSSAPI_CLIENT=NO |
629 |
- ) |
630 |
- |
631 |
- if use server ; then |
632 |
- |
633 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
634 |
- if ! use extraengine ; then |
635 |
- mycmakeargs+=( |
636 |
- -DPLUGIN_FEDERATED=NO |
637 |
- -DPLUGIN_FEDERATEDX=NO ) |
638 |
- fi |
639 |
- |
640 |
- mycmakeargs+=( |
641 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
642 |
- -DWITH_PCRE=system |
643 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
644 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
645 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
646 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
647 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
648 |
- -DPLUGIN_CASSANDRA=NO |
649 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
650 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
651 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
652 |
- -DCONNECT_WITH_MYSQL=1 |
653 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
654 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
655 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
656 |
- # Build failure and autodep wrt bug 639144 |
657 |
- -DCONNECT_WITH_MONGO=OFF |
658 |
- -DWITH_WSREP=$(usex galera) |
659 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
660 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
661 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
662 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
663 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
664 |
- -DPLUGIN_AUTH_GSSAPI_CLIENT=NO |
665 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
666 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
667 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
668 |
- -DWITH_NUMA=$(usex numa ON OFF) |
669 |
- -DINSTALL_SQLBENCHDIR='' |
670 |
- ) |
671 |
- |
672 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
673 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
674 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
675 |
- ewarn "You MUST file bugs without these variables set." |
676 |
- |
677 |
- mycmakeargs+=( |
678 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
679 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
680 |
- ) |
681 |
- |
682 |
- elif ! use latin1 ; then |
683 |
- mycmakeargs+=( |
684 |
- -DDEFAULT_CHARSET=utf8 |
685 |
- -DDEFAULT_COLLATION=utf8_general_ci |
686 |
- ) |
687 |
- else |
688 |
- mycmakeargs+=( |
689 |
- -DDEFAULT_CHARSET=latin1 |
690 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
691 |
- ) |
692 |
- fi |
693 |
- mycmakeargs+=( |
694 |
- -DEXTRA_CHARSETS=all |
695 |
- -DMYSQL_USER=mysql |
696 |
- -DDISABLE_SHARED=$(usex static YES NO) |
697 |
- -DWITH_DEBUG=$(usex debug) |
698 |
- -DWITH_EMBEDDED_SERVER=OFF |
699 |
- -DENABLED_PROFILING=$(usex profiling) |
700 |
- ) |
701 |
- |
702 |
- if use static; then |
703 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
704 |
- fi |
705 |
- |
706 |
- if use jemalloc || use tcmalloc ; then |
707 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
708 |
- fi |
709 |
- |
710 |
- # Storage engines |
711 |
- mycmakeargs+=( |
712 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
713 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
714 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
715 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
716 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
717 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
718 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
719 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
720 |
- ) |
721 |
- |
722 |
- else |
723 |
- mycmakeargs+=( |
724 |
- -DWITHOUT_SERVER=1 |
725 |
- -DWITH_EMBEDDED_SERVER=OFF |
726 |
- -DEXTRA_CHARSETS=none |
727 |
- -DINSTALL_SQLBENCHDIR= |
728 |
- -DWITH_SYSTEMD=no |
729 |
- ) |
730 |
- fi |
731 |
- |
732 |
- cmake-utils_src_configure |
733 |
-} |
734 |
- |
735 |
-src_compile() { |
736 |
- cmake-utils_src_compile |
737 |
-} |
738 |
- |
739 |
-src_install() { |
740 |
- cmake-utils_src_install |
741 |
- |
742 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
743 |
- if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
744 |
- rm "${ED}/usr/include/mysql/server/private/config.h" || die |
745 |
- fi |
746 |
- |
747 |
- # Make sure the vars are correctly initialized |
748 |
- mysql_init_vars |
749 |
- |
750 |
- # Convenience links |
751 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
752 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
753 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
754 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
755 |
- |
756 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
757 |
- if [[ -d "${ED}/usr/data" ]] ; then |
758 |
- rm -Rf "${ED}/usr/data" || die |
759 |
- fi |
760 |
- |
761 |
- # Unless they explicitly specific USE=test, then do not install the |
762 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
763 |
- # validation of your database configuration after tuning it. |
764 |
- if ! use test ; then |
765 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
766 |
- fi |
767 |
- |
768 |
- # Configuration stuff |
769 |
- einfo "Building default configuration ..." |
770 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
771 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
772 |
- local mycnf_src="my.cnf-5.6-r1" |
773 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
774 |
- "${FILESDIR}/${mycnf_src}" \ |
775 |
- > "${TMPDIR}/my.cnf.ok" || die |
776 |
- use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok" |
777 |
- if use latin1 ; then |
778 |
- sed -i \ |
779 |
- -e "/character-set/s|utf8|latin1|g" \ |
780 |
- "${TMPDIR}/my.cnf.ok" || die |
781 |
- fi |
782 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
783 |
- newins "${TMPDIR}/my.cnf.ok" my.cnf |
784 |
- |
785 |
- if use server ; then |
786 |
- einfo "Including support files and sample configurations" |
787 |
- docinto "support-files" |
788 |
- local script |
789 |
- for script in \ |
790 |
- "${S}"/support-files/magic |
791 |
- do |
792 |
- [[ -f "$script" ]] && dodoc "${script}" |
793 |
- done |
794 |
- |
795 |
- docinto "scripts" |
796 |
- for script in "${S}"/scripts/mysql* ; do |
797 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
798 |
- done |
799 |
- # Manually install supporting files that conflict with other packages |
800 |
- # but are needed for galera and initial installation |
801 |
- exeinto /usr/libexec/mariadb |
802 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
803 |
- fi |
804 |
- |
805 |
- #Remove mytop if perl is not selected |
806 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
807 |
-} |
808 |
- |
809 |
-# Official test instructions: |
810 |
-# USE='extraengine perl server' \ |
811 |
-# FEATURES='test userpriv -usersandbox' \ |
812 |
-# ebuild mariadb-X.X.XX.ebuild \ |
813 |
-# digest clean package |
814 |
-src_test() { |
815 |
- |
816 |
- _disable_test() { |
817 |
- local rawtestname reason |
818 |
- rawtestname="${1}" ; shift |
819 |
- reason="${@}" |
820 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
821 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
822 |
- } |
823 |
- |
824 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
825 |
- local retstatus_unit |
826 |
- local retstatus_tests |
827 |
- |
828 |
- if ! use server ; then |
829 |
- einfo "Skipping server tests due to minimal build." |
830 |
- return 0 |
831 |
- fi |
832 |
- |
833 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
834 |
- # localhost. Also causes weird failures. |
835 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
836 |
- |
837 |
- if [[ $UID -eq 0 ]]; then |
838 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
839 |
- fi |
840 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
841 |
- |
842 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
843 |
- |
844 |
- # Run CTest (test-units) |
845 |
-# cmake-utils_src_test |
846 |
-# retstatus_unit=$? |
847 |
- |
848 |
- # Ensure that parallel runs don't die |
849 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
850 |
- # Enable parallel testing, auto will try to detect number of cores |
851 |
- # You may set this by hand. |
852 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
853 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
854 |
- |
855 |
- # create directories because mysqladmin might run out of order |
856 |
- mkdir -p "${T}"/var-tests{,/log} || die |
857 |
- |
858 |
- # Run mysql tests |
859 |
- pushd "${TESTDIR}" > /dev/null || die |
860 |
- |
861 |
- touch "${T}/disabled.def" |
862 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
863 |
- # false positives: |
864 |
- # |
865 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
866 |
- # main.mysql_client_test_comp: |
867 |
- # segfaults at random under Portage only, suspect resource limits. |
868 |
- |
869 |
- local t |
870 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
871 |
- _disable_test "$t" "False positive due to varying policies" |
872 |
- done |
873 |
- |
874 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
875 |
- rpl.rpl_semi_sync_uninstall_plugin main.mysql \ |
876 |
- main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
877 |
- _disable_test "$t" "False positives in Gentoo" |
878 |
- done |
879 |
- |
880 |
- if ! use client-libs ; then |
881 |
- _disable_test main.plugin_auth "Needs client libraries built" |
882 |
- _disable_test plugins.auth_ed25519 "Needs client libraries built" |
883 |
- fi |
884 |
- |
885 |
- _disable_test main.gis_notembedded "Fails when latin1 USE is not set" |
886 |
- |
887 |
- _disable_test sys_vars.sysvars_server_notembedded "Broken test" # bug #661700 required profiling always on |
888 |
- |
889 |
- # run mysql-test tests |
890 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
891 |
- retstatus_tests=$? |
892 |
- |
893 |
- popd > /dev/null || die |
894 |
- |
895 |
- # Cleanup is important for these testcases. |
896 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
897 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
898 |
- |
899 |
- local failures="" |
900 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
901 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
902 |
- |
903 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
904 |
- einfo "Tests successfully completed" |
905 |
-} |
906 |
- |
907 |
-mysql_init_vars() { |
908 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
909 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
910 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
911 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
912 |
- |
913 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
914 |
- MY_DATADIR="" |
915 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
916 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
917 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
918 |
- | tail -n1` |
919 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
920 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
921 |
- | sed -e 's/.*=\s*//' \ |
922 |
- | tail -n1` |
923 |
- fi |
924 |
- fi |
925 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
926 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
927 |
- einfo "Using default MY_DATADIR" |
928 |
- fi |
929 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
930 |
- |
931 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
932 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
933 |
- # If you get this and you're wondering about it, see bug #207636 |
934 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
935 |
- elog "A new one will not be created." |
936 |
- PREVIOUS_DATADIR="yes" |
937 |
- else |
938 |
- PREVIOUS_DATADIR="no" |
939 |
- fi |
940 |
- export PREVIOUS_DATADIR |
941 |
- fi |
942 |
- else |
943 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
944 |
- local new_MY_DATADIR |
945 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
946 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
947 |
- | tail -n1` |
948 |
- |
949 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
950 |
- ewarn "MySQL MY_DATADIR has changed" |
951 |
- ewarn "from ${MY_DATADIR}" |
952 |
- ewarn "to ${new_MY_DATADIR}" |
953 |
- MY_DATADIR="${new_MY_DATADIR}" |
954 |
- fi |
955 |
- fi |
956 |
- fi |
957 |
- |
958 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
959 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
960 |
- export MY_DATADIR |
961 |
-} |
962 |
- |
963 |
-pkg_config() { |
964 |
- _getoptval() { |
965 |
- local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults |
966 |
- local section="$1" |
967 |
- local flag="--${2}=" |
968 |
- local extra_options="${3}" |
969 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
970 |
- } |
971 |
- local old_MY_DATADIR="${MY_DATADIR}" |
972 |
- local old_HOME="${HOME}" |
973 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
974 |
- export HOME=${EPREFIX}/root |
975 |
- |
976 |
- # Make sure the vars are correctly initialized |
977 |
- mysql_init_vars |
978 |
- |
979 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
980 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
981 |
- die "Minimal builds do NOT include the MySQL server" |
982 |
- fi |
983 |
- |
984 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
985 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
986 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
987 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
988 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
989 |
- |
990 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
991 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
992 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
993 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
994 |
- else |
995 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
996 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
997 |
- || die "Moving MY_DATADIR failed" |
998 |
- fi |
999 |
- else |
1000 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
1001 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
1002 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
1003 |
- else |
1004 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
1005 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
1006 |
- fi |
1007 |
- fi |
1008 |
- fi |
1009 |
- |
1010 |
- local pwd1="a" |
1011 |
- local pwd2="b" |
1012 |
- local maxtry=15 |
1013 |
- |
1014 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
1015 |
- local tmp_mysqld_password_source= |
1016 |
- |
1017 |
- for tmp_mysqld_password_source in mysql client; do |
1018 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
1019 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
1020 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
1021 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
1022 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
1023 |
- MYSQL_ROOT_PASSWORD= |
1024 |
- continue |
1025 |
- fi |
1026 |
- |
1027 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
1028 |
- break |
1029 |
- fi |
1030 |
- done |
1031 |
- |
1032 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
1033 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
1034 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
1035 |
- fi |
1036 |
- |
1037 |
- unset tmp_mysqld_password_source |
1038 |
- fi |
1039 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" |
1040 |
- # These are dir+prefix |
1041 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" |
1042 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
1043 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" |
1044 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
1045 |
- |
1046 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
1047 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
1048 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
1049 |
- fi |
1050 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
1051 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
1052 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
1053 |
- fi |
1054 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
1055 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
1056 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
1057 |
- fi |
1058 |
- |
1059 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
1060 |
- ewarn "You have already a MySQL database in place." |
1061 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
1062 |
- ewarn "Please rename or delete it if you wish to replace it." |
1063 |
- die "MySQL database already exists!" |
1064 |
- fi |
1065 |
- |
1066 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
1067 |
- # localhost. Also causes weird failures. |
1068 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
1069 |
- |
1070 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
1071 |
- |
1072 |
- einfo "Please provide a password for the mysql 'root' user now" |
1073 |
- einfo "or through the ${HOME}/.my.cnf file." |
1074 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
1075 |
- read -rsp " >" pwd1 ; echo |
1076 |
- |
1077 |
- einfo "Retype the password" |
1078 |
- read -rsp " >" pwd2 ; echo |
1079 |
- |
1080 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
1081 |
- die "Passwords are not the same" |
1082 |
- fi |
1083 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
1084 |
- unset pwd1 pwd2 |
1085 |
- fi |
1086 |
- |
1087 |
- local options |
1088 |
- local sqltmp="$(emktemp)" |
1089 |
- |
1090 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
1091 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
1092 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
1093 |
- |
1094 |
- # Figure out which options we need to disable to do the setup |
1095 |
- local helpfile="${TMPDIR}/mysqld-help" |
1096 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
1097 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
1098 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
1099 |
- log-slave-updates \ |
1100 |
- ; do |
1101 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
1102 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
1103 |
- done |
1104 |
- |
1105 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
1106 |
- |
1107 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
1108 |
- PID_DIR="${EROOT}/var/run/mysqld" |
1109 |
- if [[ ! -d "${PID_DIR}" ]]; then |
1110 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
1111 |
- fi |
1112 |
- |
1113 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
1114 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
1115 |
- fi |
1116 |
- |
1117 |
- pushd "${TMPDIR}" &>/dev/null || die |
1118 |
- |
1119 |
- # Filling timezones, see |
1120 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
1121 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
1122 |
- |
1123 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
1124 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
1125 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
1126 |
- einfo "Command: ${cmd[*]}" |
1127 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
1128 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
1129 |
- if [ $? -ne 0 ]; then |
1130 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
1131 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
1132 |
- fi |
1133 |
- popd &>/dev/null || die |
1134 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
1135 |
- || die "MySQL databases not installed" |
1136 |
- |
1137 |
- use prefix || options="${options} --user=mysql" |
1138 |
- |
1139 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
1140 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
1141 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
1142 |
- ${options} \ |
1143 |
- --log-warnings=0 \ |
1144 |
- --basedir=${EROOT}/usr \ |
1145 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
1146 |
- --max_allowed_packet=8M \ |
1147 |
- --net_buffer_length=16K \ |
1148 |
- --socket=${socket} \ |
1149 |
- --pid-file=${pidfile} \ |
1150 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
1151 |
- #einfo "About to start mysqld: ${mysqld}" |
1152 |
- ebegin "Starting mysqld" |
1153 |
- einfo "Command ${mysqld}" |
1154 |
- ${mysqld} & |
1155 |
- rc=$? |
1156 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
1157 |
- maxtry=$((${maxtry}-1)) |
1158 |
- echo -n "." |
1159 |
- sleep 1 |
1160 |
- done |
1161 |
- eend $rc |
1162 |
- |
1163 |
- if ! [[ -S "${socket}" ]]; then |
1164 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
1165 |
- fi |
1166 |
- |
1167 |
- ebegin "Setting root password" |
1168 |
- # Do this from memory, as we don't want clear text passwords in temp files |
1169 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
1170 |
- "${EROOT}/usr/bin/mysql" \ |
1171 |
- "--socket=${socket}" \ |
1172 |
- -hlocalhost \ |
1173 |
- -e "${sql}" |
1174 |
- eend $? |
1175 |
- |
1176 |
- if [[ -n "${sqltmp}" ]] ; then |
1177 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
1178 |
- "${EROOT}/usr/bin/mysql" \ |
1179 |
- "--socket=${socket}" \ |
1180 |
- -hlocalhost \ |
1181 |
- -uroot \ |
1182 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
1183 |
- mysql < "${sqltmp}" |
1184 |
- rc=$? |
1185 |
- eend $? |
1186 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
1187 |
- fi |
1188 |
- |
1189 |
- # Stop the server and cleanup |
1190 |
- einfo "Stopping the server ..." |
1191 |
- kill $(< "${pidfile}" ) |
1192 |
- rm -f "${sqltmp}" |
1193 |
- wait %1 |
1194 |
- einfo "Done" |
1195 |
-} |
1196 |
|
1197 |
diff --git a/dev-db/mariadb/mariadb-10.2.26-r1.ebuild b/dev-db/mariadb/mariadb-10.2.26-r1.ebuild |
1198 |
deleted file mode 100644 |
1199 |
index 025de8a23a9..00000000000 |
1200 |
--- a/dev-db/mariadb/mariadb-10.2.26-r1.ebuild |
1201 |
+++ /dev/null |
1202 |
@@ -1,981 +0,0 @@ |
1203 |
-# Copyright 1999-2019 Gentoo Authors |
1204 |
-# Distributed under the terms of the GNU General Public License v2 |
1205 |
- |
1206 |
-EAPI="6" |
1207 |
-MY_EXTRAS_VER="20190305-2052Z" |
1208 |
-SUBSLOT="18" |
1209 |
- |
1210 |
-JAVA_PKG_OPT_USE="jdbc" |
1211 |
- |
1212 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
1213 |
- |
1214 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
1215 |
- java-pkg-opt-2 user cmake-utils |
1216 |
- |
1217 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
1218 |
- |
1219 |
-# Gentoo patches to MySQL |
1220 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
1221 |
- SRC_URI="${SRC_URI} |
1222 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1223 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1224 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1225 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
1226 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
1227 |
-fi |
1228 |
- |
1229 |
-HOMEPAGE="https://mariadb.org/" |
1230 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
1231 |
-LICENSE="GPL-2 LGPL-2.1+" |
1232 |
-SLOT="0/${SUBSLOT:-0}" |
1233 |
-IUSE="+backup bindist client-libs cracklib debug extraengine galera innodb-lz4 |
1234 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
1235 |
- numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
1236 |
- sst-rsync sst-mariabackup sst-xtrabackup static systemd systemtap tcmalloc |
1237 |
- test tokudb xml yassl" |
1238 |
- |
1239 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
1240 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
1241 |
- |
1242 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
1243 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
1244 |
- ?? ( tcmalloc jemalloc ) |
1245 |
- static? ( yassl !pam )" |
1246 |
- |
1247 |
-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" |
1248 |
- |
1249 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
1250 |
-# and we will run a mysql server during test phase |
1251 |
-S="${WORKDIR}/mysql" |
1252 |
- |
1253 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
1254 |
- inherit git-r3 |
1255 |
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" |
1256 |
- EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
1257 |
- EGIT_CLONE_TYPE=shallow |
1258 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
1259 |
-else |
1260 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
1261 |
-fi |
1262 |
- |
1263 |
-PATCHES=( |
1264 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
1265 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.16-without-clientlibs-tools.patch |
1266 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
1267 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
1268 |
- "${MY_PATCH_DIR}"/20035_all_mariadb-10.2-atomic-detection.patch |
1269 |
- "${FILESDIR}/MDEV-20247-replication-10.2.patch" |
1270 |
-) |
1271 |
- |
1272 |
-# Be warned, *DEPEND are version-dependant |
1273 |
-# These are used for both runtime and compiletime |
1274 |
-COMMON_DEPEND=" |
1275 |
- kernel_linux? ( |
1276 |
- sys-process/procps:0= |
1277 |
- dev-libs/libaio:0= |
1278 |
- ) |
1279 |
- >=sys-apps/sed-4 |
1280 |
- >=sys-apps/texinfo-4.7-r1 |
1281 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
1282 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
1283 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
1284 |
- >=sys-libs/zlib-1.2.3:0= |
1285 |
- kerberos? ( virtual/krb5 ) |
1286 |
- yassl? ( net-libs/gnutls:0= ) |
1287 |
- !yassl? ( |
1288 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
1289 |
- libressl? ( dev-libs/libressl:0= ) |
1290 |
- ) |
1291 |
- sys-libs/ncurses:0= |
1292 |
- !bindist? ( |
1293 |
- sys-libs/binutils-libs:0= |
1294 |
- >=sys-libs/readline-4.1:0= |
1295 |
- ) |
1296 |
- server? ( |
1297 |
- backup? ( app-arch/libarchive:0= ) |
1298 |
- cracklib? ( sys-libs/cracklib:0= ) |
1299 |
- extraengine? ( |
1300 |
- odbc? ( dev-db/unixODBC:0= ) |
1301 |
- xml? ( dev-libs/libxml2:2= ) |
1302 |
- ) |
1303 |
- innodb-lz4? ( app-arch/lz4 ) |
1304 |
- innodb-lzo? ( dev-libs/lzo ) |
1305 |
- innodb-snappy? ( app-arch/snappy ) |
1306 |
- mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
1307 |
- numa? ( sys-process/numactl ) |
1308 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
1309 |
- pam? ( sys-libs/pam:0= ) |
1310 |
- systemd? ( sys-apps/systemd:= ) |
1311 |
- tokudb? ( app-arch/snappy ) |
1312 |
- ) |
1313 |
- >=dev-libs/libpcre-8.41-r1:3= |
1314 |
-" |
1315 |
-DEPEND="virtual/yacc |
1316 |
- static? ( sys-libs/ncurses[static-libs] ) |
1317 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
1318 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
1319 |
- ${COMMON_DEPEND}" |
1320 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
1321 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
1322 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
1323 |
- !<virtual/mysql-5.6-r11 |
1324 |
- ${COMMON_DEPEND} |
1325 |
- server? ( galera? ( |
1326 |
- sys-apps/iproute2 |
1327 |
- =sys-cluster/galera-25* |
1328 |
- sst-rsync? ( sys-process/lsof ) |
1329 |
- sst-mariabackup? ( net-misc/socat[ssl] ) |
1330 |
- sst-xtrabackup? ( net-misc/socat[ssl] ) |
1331 |
- ) ) |
1332 |
- perl? ( !dev-db/mytop |
1333 |
- virtual/perl-Getopt-Long |
1334 |
- dev-perl/TermReadKey |
1335 |
- virtual/perl-Term-ANSIColor |
1336 |
- virtual/perl-Time-HiRes ) |
1337 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
1338 |
-" |
1339 |
-# For other stuff to bring us in |
1340 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
1341 |
-# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
1342 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
1343 |
- server? ( ~virtual/mysql-5.6[static=] |
1344 |
- galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
1345 |
- |
1346 |
-pkg_setup() { |
1347 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
1348 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
1349 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
1350 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1351 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1352 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
1353 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1354 |
- die |
1355 |
- fi |
1356 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
1357 |
- # non x86{,_64} arches |
1358 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
1359 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
1360 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
1361 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
1362 |
- die |
1363 |
- fi |
1364 |
- fi |
1365 |
- java-pkg-opt-2_pkg_setup |
1366 |
- if has test ${FEATURES} && \ |
1367 |
- use server && ! has userpriv ${FEATURES} ; then |
1368 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
1369 |
- fi |
1370 |
- |
1371 |
- # This should come after all of the die statements |
1372 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
1373 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
1374 |
-} |
1375 |
- |
1376 |
-pkg_preinst() { |
1377 |
- java-pkg-opt-2_pkg_preinst |
1378 |
- |
1379 |
- # Here we need to see if the implementation switched client libraries |
1380 |
- # We check if this is a new instance of the package and a client library already exists |
1381 |
- local SHOW_ABI_MESSAGE libpath |
1382 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
1383 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
1384 |
- elog "Due to ABI changes when switching between different client libraries," |
1385 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
1386 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
1387 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
1388 |
- fi |
1389 |
-} |
1390 |
- |
1391 |
-pkg_postinst() { |
1392 |
- # Make sure the vars are correctly initialized |
1393 |
- mysql_init_vars |
1394 |
- |
1395 |
- # Create log directory securely if it does not exist |
1396 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
1397 |
- |
1398 |
- if use server ; then |
1399 |
- if use pam; then |
1400 |
- einfo |
1401 |
- elog "This install includes the PAM authentication plugin." |
1402 |
- elog "To activate and configure the PAM plugin, please read:" |
1403 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
1404 |
- einfo |
1405 |
- fi |
1406 |
- |
1407 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
1408 |
- einfo |
1409 |
- elog "You might want to run:" |
1410 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
1411 |
- elog "if this is a new install." |
1412 |
- elog |
1413 |
- elog "If you are switching server implentations, you should run the" |
1414 |
- elog "mysql_upgrade tool." |
1415 |
- einfo |
1416 |
- else |
1417 |
- einfo |
1418 |
- elog "If you are upgrading major versions, you should run the" |
1419 |
- elog "mysql_upgrade tool." |
1420 |
- einfo |
1421 |
- fi |
1422 |
- |
1423 |
- if use galera ; then |
1424 |
- einfo |
1425 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
1426 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
1427 |
- elog "The first time the cluster is activated, you should add" |
1428 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
1429 |
- elog "This option should then be removed for subsequent starts." |
1430 |
- einfo |
1431 |
- if use sst-xtrabackup ; then |
1432 |
- ewarn "As per https://mariadb.com/kb/en/meta/xtrabackup_warning/, XtraBackup" |
1433 |
- ewarn "as an SST is broken by default beginning with 10.2.19 with the setting" |
1434 |
- ewarn "innodb_safe_truncate=ON. Please migrate to sst-mariabackup instead." |
1435 |
- ewarn "sst-xtrabackup is being removed in 10.3 and higher." |
1436 |
- fi |
1437 |
- fi |
1438 |
- fi |
1439 |
- |
1440 |
- # Note about configuration change |
1441 |
- einfo |
1442 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
1443 |
- elog "to several files in /etc/mysql/${PN}.d." |
1444 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
1445 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
1446 |
- elog "You may have as many files as needed and they are read alphabetically." |
1447 |
- elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." |
1448 |
- einfo |
1449 |
-} |
1450 |
- |
1451 |
-src_unpack() { |
1452 |
- unpack ${A} |
1453 |
- # Grab the patches |
1454 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack |
1455 |
- |
1456 |
- mv -f "${WORKDIR%/}/${P}" "${S}" || die |
1457 |
-} |
1458 |
- |
1459 |
-src_prepare() { |
1460 |
- _disable_plugin() { |
1461 |
- echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
1462 |
- } |
1463 |
- _disable_engine() { |
1464 |
- echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
1465 |
- } |
1466 |
- |
1467 |
- local malloc |
1468 |
- for malloc in jemalloc tcmalloc ; do |
1469 |
- if use ${malloc}; then |
1470 |
- echo "TARGET_LINK_LIBRARIES(mysqld ${malloc})" >> "${S}/sql/CMakeLists.txt" |
1471 |
- fi |
1472 |
- done |
1473 |
- |
1474 |
- # Don't build bundled xz-utils for tokudb |
1475 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
1476 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
1477 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
1478 |
- |
1479 |
- local plugin |
1480 |
- local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
1481 |
- locale_info qc_info server_audit sql_errlog auth_ed25519 ) |
1482 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext |
1483 |
- debug_key_management example_key_management ) |
1484 |
- if ! use server; then # These plugins are for the server |
1485 |
- for plugin in "${server_plugins[@]}" ; do |
1486 |
- _disable_plugin "${plugin}" |
1487 |
- done |
1488 |
- fi |
1489 |
- |
1490 |
- if ! use test; then # These plugins are only used during testing |
1491 |
- for plugin in "${test_plugins[@]}" ; do |
1492 |
- _disable_plugin "${plugin}" |
1493 |
- done |
1494 |
- _disable_engine test_sql_discovery |
1495 |
- fi |
1496 |
- |
1497 |
- _disable_engine example |
1498 |
- |
1499 |
- if ! use oqgraph ; then # avoids extra library checks |
1500 |
- _disable_engine oqgraph |
1501 |
- fi |
1502 |
- |
1503 |
- if use mroonga ; then |
1504 |
- # Remove the bundled groonga |
1505 |
- # There is no CMake flag, it simply checks for existance |
1506 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
1507 |
- else |
1508 |
- _disable_engine mroonga |
1509 |
- fi |
1510 |
- |
1511 |
- # Don't clash with dev-db/mysql-connector-c |
1512 |
- sed -i -e 's/ my_print_defaults.1//' \ |
1513 |
- -e 's/ perror.1//' \ |
1514 |
- "${S}"/man/CMakeLists.txt || die |
1515 |
- |
1516 |
- cmake-utils_src_prepare |
1517 |
- java-pkg-opt-2_src_prepare |
1518 |
-} |
1519 |
- |
1520 |
-src_configure(){ |
1521 |
- # bug 508724 mariadb cannot use ld.gold |
1522 |
- tc-ld-disable-gold |
1523 |
- # Bug #114895, bug #110149 |
1524 |
- filter-flags "-O" "-O[01]" |
1525 |
- |
1526 |
- append-cxxflags -felide-constructors |
1527 |
- |
1528 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
1529 |
- append-flags -fno-strict-aliasing |
1530 |
- |
1531 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
1532 |
- |
1533 |
- # debug hack wrt #497532 |
1534 |
- mycmakeargs=( |
1535 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
1536 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
1537 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
1538 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
1539 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
1540 |
- -DINSTALL_BINDIR=bin |
1541 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
1542 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
1543 |
- -DINSTALL_INCLUDEDIR=include/mysql |
1544 |
- -DINSTALL_INFODIR=share/info |
1545 |
- -DINSTALL_LIBDIR=$(get_libdir) |
1546 |
- -DINSTALL_MANDIR=share/man |
1547 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
1548 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
1549 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
1550 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
1551 |
- -DINSTALL_SBINDIR=sbin |
1552 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
1553 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
1554 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
1555 |
- -DWITH_LIBEDIT=0 |
1556 |
- -DWITH_ZLIB=system |
1557 |
- -DWITHOUT_LIBWRAP=1 |
1558 |
- -DENABLED_LOCAL_INFILE=1 |
1559 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1560 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1561 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
1562 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
1563 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
1564 |
- # The build forces this to be defined when cross-compiling. We pass it |
1565 |
- # all the time for simplicity and to make sure it is actually correct. |
1566 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
1567 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
1568 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
1569 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
1570 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
1571 |
- -DWITH_EXTERNAL_ZLIB=YES |
1572 |
- -DSUFFIX_INSTALL_DIR="" |
1573 |
- -DWITH_UNITTEST=OFF |
1574 |
- -DWITHOUT_CLIENTLIBS=YES |
1575 |
- -DCLIENT_PLUGIN_DIALOG=OFF |
1576 |
- -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF |
1577 |
- -DCLIENT_PLUGIN_CLIENT_ED25519=OFF |
1578 |
- -DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC |
1579 |
- -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF |
1580 |
- ) |
1581 |
- if use test ; then |
1582 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
1583 |
- else |
1584 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
1585 |
- fi |
1586 |
- |
1587 |
- if ! use yassl ; then |
1588 |
- mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC ) |
1589 |
- else |
1590 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
1591 |
- fi |
1592 |
- |
1593 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
1594 |
- mycmakeargs+=( |
1595 |
- -DWITH_READLINE=$(usex bindist 1 0) |
1596 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
1597 |
- -DENABLE_DTRACE=$(usex systemtap) |
1598 |
- ) |
1599 |
- |
1600 |
- if use server ; then |
1601 |
- |
1602 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
1603 |
- if ! use extraengine ; then |
1604 |
- mycmakeargs+=( |
1605 |
- -DPLUGIN_FEDERATED=NO |
1606 |
- -DPLUGIN_FEDERATEDX=NO ) |
1607 |
- fi |
1608 |
- |
1609 |
- mycmakeargs+=( |
1610 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
1611 |
- -DWITH_PCRE=system |
1612 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
1613 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
1614 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
1615 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
1616 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
1617 |
- -DPLUGIN_CASSANDRA=NO |
1618 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
1619 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
1620 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
1621 |
- -DCONNECT_WITH_MYSQL=1 |
1622 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
1623 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
1624 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
1625 |
- # Build failure and autodep wrt bug 639144 |
1626 |
- -DCONNECT_WITH_MONGO=OFF |
1627 |
- -DWITH_WSREP=$(usex galera) |
1628 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
1629 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
1630 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
1631 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
1632 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
1633 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
1634 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
1635 |
- -DINSTALL_SQLBENCHDIR=share/mariadb |
1636 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
1637 |
- # systemd is only linked to for server notification |
1638 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
1639 |
- -DWITH_NUMA=$(usex numa ON OFF) |
1640 |
- ) |
1641 |
- |
1642 |
- # Workaround for MDEV-14524 |
1643 |
- use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) |
1644 |
- |
1645 |
- if use test ; then |
1646 |
- # This is needed for the new client lib which tests a real, open server |
1647 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
1648 |
- fi |
1649 |
- |
1650 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
1651 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
1652 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
1653 |
- ewarn "You MUST file bugs without these variables set." |
1654 |
- |
1655 |
- mycmakeargs+=( |
1656 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
1657 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
1658 |
- ) |
1659 |
- |
1660 |
- elif ! use latin1 ; then |
1661 |
- mycmakeargs+=( |
1662 |
- -DDEFAULT_CHARSET=utf8 |
1663 |
- -DDEFAULT_COLLATION=utf8_general_ci |
1664 |
- ) |
1665 |
- else |
1666 |
- mycmakeargs+=( |
1667 |
- -DDEFAULT_CHARSET=latin1 |
1668 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
1669 |
- ) |
1670 |
- fi |
1671 |
- mycmakeargs+=( |
1672 |
- -DEXTRA_CHARSETS=all |
1673 |
- -DMYSQL_USER=mysql |
1674 |
- -DDISABLE_SHARED=$(usex static YES NO) |
1675 |
- -DWITH_DEBUG=$(usex debug) |
1676 |
- -DWITH_EMBEDDED_SERVER=OFF |
1677 |
- -DWITH_PROFILING=$(usex profiling) |
1678 |
- ) |
1679 |
- |
1680 |
- if use static; then |
1681 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
1682 |
- fi |
1683 |
- |
1684 |
- if use jemalloc || use tcmalloc ; then |
1685 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
1686 |
- fi |
1687 |
- |
1688 |
- # Storage engines |
1689 |
- mycmakeargs+=( |
1690 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
1691 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
1692 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
1693 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
1694 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
1695 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
1696 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
1697 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
1698 |
- ) |
1699 |
- |
1700 |
- else |
1701 |
- mycmakeargs+=( |
1702 |
- -DWITHOUT_SERVER=1 |
1703 |
- -DWITH_EMBEDDED_SERVER=OFF |
1704 |
- -DEXTRA_CHARSETS=none |
1705 |
- -DINSTALL_SQLBENCHDIR= |
1706 |
- -DWITH_SYSTEMD=no |
1707 |
- ) |
1708 |
- fi |
1709 |
- |
1710 |
- cmake-utils_src_configure |
1711 |
-} |
1712 |
- |
1713 |
-src_compile() { |
1714 |
- cmake-utils_src_compile |
1715 |
-} |
1716 |
- |
1717 |
-src_install() { |
1718 |
- cmake-utils_src_install |
1719 |
- |
1720 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
1721 |
- if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
1722 |
- rm "${ED}/usr/include/mysql/server/private/config.h" || die |
1723 |
- fi |
1724 |
- |
1725 |
- # Make sure the vars are correctly initialized |
1726 |
- mysql_init_vars |
1727 |
- |
1728 |
- # Convenience links |
1729 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
1730 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
1731 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
1732 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
1733 |
- |
1734 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
1735 |
- if [[ -d "${ED}/usr/data" ]] ; then |
1736 |
- rm -Rf "${ED}/usr/data" || die |
1737 |
- fi |
1738 |
- |
1739 |
- # Unless they explicitly specific USE=test, then do not install the |
1740 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
1741 |
- # validation of your database configuration after tuning it. |
1742 |
- if ! use test ; then |
1743 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
1744 |
- fi |
1745 |
- |
1746 |
- # Configuration stuff |
1747 |
- einfo "Building default configuration ..." |
1748 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
1749 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
1750 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
1751 |
- eprefixify "${TMPDIR}/my.cnf" |
1752 |
- doins "${TMPDIR}/my.cnf" |
1753 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
1754 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
1755 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
1756 |
- doins "${TMPDIR}/50-distro-client.cnf" |
1757 |
- |
1758 |
- if use server ; then |
1759 |
- mycnf_src="my.cnf.distro-server" |
1760 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
1761 |
- "${FILESDIR}/${mycnf_src}" \ |
1762 |
- > "${TMPDIR}/my.cnf.ok" || die |
1763 |
- if use prefix ; then |
1764 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
1765 |
- "${TMPDIR}/my.cnf.ok" || die |
1766 |
- fi |
1767 |
- if use latin1 ; then |
1768 |
- sed -i \ |
1769 |
- -e "/character-set/s|utf8|latin1|g" \ |
1770 |
- "${TMPDIR}/my.cnf.ok" || die |
1771 |
- fi |
1772 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
1773 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
1774 |
- |
1775 |
- einfo "Including support files and sample configurations" |
1776 |
- docinto "support-files" |
1777 |
- local script |
1778 |
- for script in \ |
1779 |
- "${S}"/support-files/magic |
1780 |
- do |
1781 |
- [[ -f "$script" ]] && dodoc "${script}" |
1782 |
- done |
1783 |
- |
1784 |
- docinto "scripts" |
1785 |
- for script in "${S}"/scripts/mysql* ; do |
1786 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
1787 |
- done |
1788 |
- # Manually install supporting files that conflict with other packages |
1789 |
- # but are needed for galera and initial installation |
1790 |
- exeinto /usr/libexec/mariadb |
1791 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
1792 |
- fi |
1793 |
- |
1794 |
- #Remove mytop if perl is not selected |
1795 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
1796 |
-} |
1797 |
- |
1798 |
-# Official test instructions: |
1799 |
-# USE='extraengine perl server' \ |
1800 |
-# FEATURES='test userpriv -usersandbox' \ |
1801 |
-# ebuild mariadb-X.X.XX.ebuild \ |
1802 |
-# digest clean package |
1803 |
-src_test() { |
1804 |
- |
1805 |
- _disable_test() { |
1806 |
- local rawtestname reason |
1807 |
- rawtestname="${1}" ; shift |
1808 |
- reason="${@}" |
1809 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
1810 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
1811 |
- } |
1812 |
- |
1813 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
1814 |
- local retstatus_unit |
1815 |
- local retstatus_tests |
1816 |
- |
1817 |
- if ! use server ; then |
1818 |
- einfo "Skipping server tests due to minimal build." |
1819 |
- return 0 |
1820 |
- fi |
1821 |
- |
1822 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
1823 |
- # localhost. Also causes weird failures. |
1824 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
1825 |
- |
1826 |
- if [[ $UID -eq 0 ]]; then |
1827 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
1828 |
- fi |
1829 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
1830 |
- |
1831 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1832 |
- |
1833 |
- # Run CTest (test-units) |
1834 |
- cmake-utils_src_test |
1835 |
- retstatus_unit=$? |
1836 |
- |
1837 |
- # Ensure that parallel runs don't die |
1838 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
1839 |
- # Enable parallel testing, auto will try to detect number of cores |
1840 |
- # You may set this by hand. |
1841 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
1842 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
1843 |
- |
1844 |
- # create directories because mysqladmin might run out of order |
1845 |
- mkdir -p "${T}"/var-tests{,/log} || die |
1846 |
- |
1847 |
- # Run mysql tests |
1848 |
- pushd "${TESTDIR}" > /dev/null || die |
1849 |
- |
1850 |
- touch "${T}/disabled.def" |
1851 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
1852 |
- # false positives: |
1853 |
- # |
1854 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
1855 |
- # main.mysql_client_test_comp: |
1856 |
- # segfaults at random under Portage only, suspect resource limits. |
1857 |
- |
1858 |
- local t |
1859 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
1860 |
- _disable_test "$t" "False positive due to varying policies" |
1861 |
- done |
1862 |
- |
1863 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock main.mysql \ |
1864 |
- main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
1865 |
- _disable_test "$t" "False positives in Gentoo" |
1866 |
- done |
1867 |
- |
1868 |
- _disable_test main.gis_notembedded "Needs latin1 USE set" |
1869 |
- _disable_test main.plugin_auth "Needs client libraries built" |
1870 |
- _disable_test plugins.auth_ed25519 "Needs client libraries built" |
1871 |
- _disable_test main.mysqldump "Test fails past 2018-12-31 due to event expiration" |
1872 |
- |
1873 |
- # Likely environment issues as only number of clients connected fails |
1874 |
- _disable_test rpl.rpl_semi_sync_uninstall_plugin \ |
1875 |
- "Fails intermittently on parallel testing" |
1876 |
- |
1877 |
- # run mysql-test tests |
1878 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
1879 |
- retstatus_tests=$? |
1880 |
- |
1881 |
- popd > /dev/null || die |
1882 |
- |
1883 |
- # Cleanup is important for these testcases. |
1884 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
1885 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
1886 |
- |
1887 |
- local failures="" |
1888 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
1889 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
1890 |
- |
1891 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
1892 |
- einfo "Tests successfully completed" |
1893 |
-} |
1894 |
- |
1895 |
-mysql_init_vars() { |
1896 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
1897 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
1898 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
1899 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
1900 |
- |
1901 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
1902 |
- MY_DATADIR="" |
1903 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
1904 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
1905 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
1906 |
- | tail -n1` |
1907 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
1908 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
1909 |
- | sed -e 's/.*=\s*//' \ |
1910 |
- | tail -n1` |
1911 |
- fi |
1912 |
- fi |
1913 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
1914 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
1915 |
- einfo "Using default MY_DATADIR" |
1916 |
- fi |
1917 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
1918 |
- |
1919 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
1920 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
1921 |
- # If you get this and you're wondering about it, see bug #207636 |
1922 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
1923 |
- elog "A new one will not be created." |
1924 |
- PREVIOUS_DATADIR="yes" |
1925 |
- else |
1926 |
- PREVIOUS_DATADIR="no" |
1927 |
- fi |
1928 |
- export PREVIOUS_DATADIR |
1929 |
- fi |
1930 |
- else |
1931 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
1932 |
- local new_MY_DATADIR |
1933 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
1934 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
1935 |
- | tail -n1` |
1936 |
- |
1937 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
1938 |
- ewarn "MySQL MY_DATADIR has changed" |
1939 |
- ewarn "from ${MY_DATADIR}" |
1940 |
- ewarn "to ${new_MY_DATADIR}" |
1941 |
- MY_DATADIR="${new_MY_DATADIR}" |
1942 |
- fi |
1943 |
- fi |
1944 |
- fi |
1945 |
- |
1946 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
1947 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
1948 |
- export MY_DATADIR |
1949 |
-} |
1950 |
- |
1951 |
-pkg_config() { |
1952 |
- _getoptval() { |
1953 |
- local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults |
1954 |
- local section="$1" |
1955 |
- local flag="--${2}=" |
1956 |
- local extra_options="${3}" |
1957 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
1958 |
- } |
1959 |
- local old_MY_DATADIR="${MY_DATADIR}" |
1960 |
- local old_HOME="${HOME}" |
1961 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
1962 |
- export HOME=${EPREFIX}/root |
1963 |
- |
1964 |
- # Make sure the vars are correctly initialized |
1965 |
- mysql_init_vars |
1966 |
- |
1967 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
1968 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
1969 |
- die "Minimal builds do NOT include the MySQL server" |
1970 |
- fi |
1971 |
- |
1972 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
1973 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
1974 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
1975 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
1976 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
1977 |
- |
1978 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
1979 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
1980 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
1981 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
1982 |
- else |
1983 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
1984 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
1985 |
- || die "Moving MY_DATADIR failed" |
1986 |
- fi |
1987 |
- else |
1988 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
1989 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
1990 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
1991 |
- else |
1992 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
1993 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
1994 |
- fi |
1995 |
- fi |
1996 |
- fi |
1997 |
- |
1998 |
- local pwd1="a" |
1999 |
- local pwd2="b" |
2000 |
- local maxtry=15 |
2001 |
- |
2002 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
2003 |
- local tmp_mysqld_password_source= |
2004 |
- |
2005 |
- for tmp_mysqld_password_source in mysql client; do |
2006 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
2007 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
2008 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
2009 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
2010 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
2011 |
- MYSQL_ROOT_PASSWORD= |
2012 |
- continue |
2013 |
- fi |
2014 |
- |
2015 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
2016 |
- break |
2017 |
- fi |
2018 |
- done |
2019 |
- |
2020 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
2021 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
2022 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
2023 |
- fi |
2024 |
- |
2025 |
- unset tmp_mysqld_password_source |
2026 |
- fi |
2027 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" |
2028 |
- # These are dir+prefix |
2029 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" |
2030 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
2031 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" |
2032 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
2033 |
- |
2034 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
2035 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
2036 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
2037 |
- fi |
2038 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
2039 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
2040 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
2041 |
- fi |
2042 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
2043 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
2044 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
2045 |
- fi |
2046 |
- |
2047 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
2048 |
- ewarn "You have already a MySQL database in place." |
2049 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
2050 |
- ewarn "Please rename or delete it if you wish to replace it." |
2051 |
- die "MySQL database already exists!" |
2052 |
- fi |
2053 |
- |
2054 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
2055 |
- # localhost. Also causes weird failures. |
2056 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
2057 |
- |
2058 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
2059 |
- |
2060 |
- einfo "Please provide a password for the mysql 'root' user now" |
2061 |
- einfo "or through the ${HOME}/.my.cnf file." |
2062 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
2063 |
- read -rsp " >" pwd1 ; echo |
2064 |
- |
2065 |
- einfo "Retype the password" |
2066 |
- read -rsp " >" pwd2 ; echo |
2067 |
- |
2068 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
2069 |
- die "Passwords are not the same" |
2070 |
- fi |
2071 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
2072 |
- unset pwd1 pwd2 |
2073 |
- fi |
2074 |
- |
2075 |
- local options |
2076 |
- local sqltmp="$(emktemp)" |
2077 |
- |
2078 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
2079 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
2080 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
2081 |
- |
2082 |
- # Figure out which options we need to disable to do the setup |
2083 |
- local helpfile="${TMPDIR}/mysqld-help" |
2084 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
2085 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
2086 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
2087 |
- log-slave-updates \ |
2088 |
- ; do |
2089 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
2090 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
2091 |
- done |
2092 |
- |
2093 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
2094 |
- |
2095 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
2096 |
- PID_DIR="${EROOT}/var/run/mysqld" |
2097 |
- if [[ ! -d "${PID_DIR}" ]]; then |
2098 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
2099 |
- fi |
2100 |
- |
2101 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
2102 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
2103 |
- fi |
2104 |
- |
2105 |
- pushd "${TMPDIR}" &>/dev/null || die |
2106 |
- |
2107 |
- # Filling timezones, see |
2108 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
2109 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
2110 |
- |
2111 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
2112 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
2113 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
2114 |
- einfo "Command: ${cmd[*]}" |
2115 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
2116 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
2117 |
- if [ $? -ne 0 ]; then |
2118 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
2119 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
2120 |
- fi |
2121 |
- popd &>/dev/null || die |
2122 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
2123 |
- || die "MySQL databases not installed" |
2124 |
- |
2125 |
- use prefix || options="${options} --user=mysql" |
2126 |
- |
2127 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
2128 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
2129 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
2130 |
- ${options} \ |
2131 |
- --log-warnings=0 \ |
2132 |
- --basedir=${EROOT}/usr \ |
2133 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
2134 |
- --max_allowed_packet=8M \ |
2135 |
- --net_buffer_length=16K \ |
2136 |
- --socket=${socket} \ |
2137 |
- --pid-file=${pidfile} \ |
2138 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
2139 |
- #einfo "About to start mysqld: ${mysqld}" |
2140 |
- ebegin "Starting mysqld" |
2141 |
- einfo "Command ${mysqld}" |
2142 |
- ${mysqld} & |
2143 |
- rc=$? |
2144 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
2145 |
- maxtry=$((${maxtry}-1)) |
2146 |
- echo -n "." |
2147 |
- sleep 1 |
2148 |
- done |
2149 |
- eend $rc |
2150 |
- |
2151 |
- if ! [[ -S "${socket}" ]]; then |
2152 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
2153 |
- fi |
2154 |
- |
2155 |
- ebegin "Setting root password" |
2156 |
- # Do this from memory, as we don't want clear text passwords in temp files |
2157 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
2158 |
- "${EROOT}/usr/bin/mysql" \ |
2159 |
- "--socket=${socket}" \ |
2160 |
- -hlocalhost \ |
2161 |
- -e "${sql}" |
2162 |
- eend $? |
2163 |
- |
2164 |
- if [[ -n "${sqltmp}" ]] ; then |
2165 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
2166 |
- "${EROOT}/usr/bin/mysql" \ |
2167 |
- "--socket=${socket}" \ |
2168 |
- -hlocalhost \ |
2169 |
- -uroot \ |
2170 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
2171 |
- mysql < "${sqltmp}" |
2172 |
- rc=$? |
2173 |
- eend $? |
2174 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
2175 |
- fi |
2176 |
- |
2177 |
- # Stop the server and cleanup |
2178 |
- einfo "Stopping the server ..." |
2179 |
- kill $(< "${pidfile}" ) |
2180 |
- rm -f "${sqltmp}" |
2181 |
- wait %1 |
2182 |
- einfo "Done" |
2183 |
-} |
2184 |
|
2185 |
diff --git a/dev-db/mariadb/mariadb-10.2.27.ebuild b/dev-db/mariadb/mariadb-10.2.27.ebuild |
2186 |
deleted file mode 100644 |
2187 |
index 86a84bcac82..00000000000 |
2188 |
--- a/dev-db/mariadb/mariadb-10.2.27.ebuild |
2189 |
+++ /dev/null |
2190 |
@@ -1,981 +0,0 @@ |
2191 |
-# Copyright 1999-2019 Gentoo Authors |
2192 |
-# Distributed under the terms of the GNU General Public License v2 |
2193 |
- |
2194 |
-EAPI="6" |
2195 |
-MY_EXTRAS_VER="20190305-2052Z" |
2196 |
-SUBSLOT="18" |
2197 |
- |
2198 |
-JAVA_PKG_OPT_USE="jdbc" |
2199 |
- |
2200 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
2201 |
- |
2202 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
2203 |
- java-pkg-opt-2 user cmake-utils |
2204 |
- |
2205 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
2206 |
- |
2207 |
-# Gentoo patches to MySQL |
2208 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
2209 |
- SRC_URI="${SRC_URI} |
2210 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
2211 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
2212 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
2213 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
2214 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
2215 |
-fi |
2216 |
- |
2217 |
-HOMEPAGE="https://mariadb.org/" |
2218 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
2219 |
-LICENSE="GPL-2 LGPL-2.1+" |
2220 |
-SLOT="0/${SUBSLOT:-0}" |
2221 |
-IUSE="+backup bindist client-libs cracklib debug extraengine galera innodb-lz4 |
2222 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
2223 |
- numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
2224 |
- sst-rsync sst-mariabackup sst-xtrabackup static systemd systemtap tcmalloc |
2225 |
- test tokudb xml yassl" |
2226 |
- |
2227 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
2228 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
2229 |
- |
2230 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
2231 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
2232 |
- ?? ( tcmalloc jemalloc ) |
2233 |
- static? ( yassl !pam )" |
2234 |
- |
2235 |
-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" |
2236 |
- |
2237 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
2238 |
-# and we will run a mysql server during test phase |
2239 |
-S="${WORKDIR}/mysql" |
2240 |
- |
2241 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
2242 |
- inherit git-r3 |
2243 |
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" |
2244 |
- EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
2245 |
- EGIT_CLONE_TYPE=shallow |
2246 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
2247 |
-else |
2248 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
2249 |
-fi |
2250 |
- |
2251 |
-PATCHES=( |
2252 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
2253 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.16-without-clientlibs-tools.patch |
2254 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
2255 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
2256 |
- "${MY_PATCH_DIR}"/20035_all_mariadb-10.2-atomic-detection.patch |
2257 |
-) |
2258 |
- |
2259 |
-# Be warned, *DEPEND are version-dependant |
2260 |
-# These are used for both runtime and compiletime |
2261 |
-COMMON_DEPEND=" |
2262 |
- kernel_linux? ( |
2263 |
- sys-process/procps:0= |
2264 |
- dev-libs/libaio:0= |
2265 |
- ) |
2266 |
- >=sys-apps/sed-4 |
2267 |
- >=sys-apps/texinfo-4.7-r1 |
2268 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
2269 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
2270 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
2271 |
- >=sys-libs/zlib-1.2.3:0= |
2272 |
- kerberos? ( virtual/krb5 ) |
2273 |
- yassl? ( net-libs/gnutls:0= ) |
2274 |
- !yassl? ( |
2275 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
2276 |
- libressl? ( dev-libs/libressl:0= ) |
2277 |
- ) |
2278 |
- sys-libs/ncurses:0= |
2279 |
- !bindist? ( |
2280 |
- sys-libs/binutils-libs:0= |
2281 |
- >=sys-libs/readline-4.1:0= |
2282 |
- ) |
2283 |
- server? ( |
2284 |
- backup? ( app-arch/libarchive:0= ) |
2285 |
- cracklib? ( sys-libs/cracklib:0= ) |
2286 |
- extraengine? ( |
2287 |
- odbc? ( dev-db/unixODBC:0= ) |
2288 |
- xml? ( dev-libs/libxml2:2= ) |
2289 |
- ) |
2290 |
- innodb-lz4? ( app-arch/lz4 ) |
2291 |
- innodb-lzo? ( dev-libs/lzo ) |
2292 |
- innodb-snappy? ( app-arch/snappy ) |
2293 |
- mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
2294 |
- numa? ( sys-process/numactl ) |
2295 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
2296 |
- pam? ( sys-libs/pam:0= ) |
2297 |
- systemd? ( sys-apps/systemd:= ) |
2298 |
- tokudb? ( app-arch/snappy ) |
2299 |
- ) |
2300 |
- >=dev-libs/libpcre-8.41-r1:3= |
2301 |
-" |
2302 |
-DEPEND="virtual/yacc |
2303 |
- static? ( sys-libs/ncurses[static-libs] ) |
2304 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
2305 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
2306 |
- ${COMMON_DEPEND}" |
2307 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
2308 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
2309 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
2310 |
- !<virtual/mysql-5.6-r11 |
2311 |
- ${COMMON_DEPEND} |
2312 |
- server? ( galera? ( |
2313 |
- sys-apps/iproute2 |
2314 |
- =sys-cluster/galera-25* |
2315 |
- sst-rsync? ( sys-process/lsof ) |
2316 |
- sst-mariabackup? ( net-misc/socat[ssl] ) |
2317 |
- sst-xtrabackup? ( net-misc/socat[ssl] ) |
2318 |
- ) ) |
2319 |
- perl? ( !dev-db/mytop |
2320 |
- virtual/perl-Getopt-Long |
2321 |
- dev-perl/TermReadKey |
2322 |
- virtual/perl-Term-ANSIColor |
2323 |
- virtual/perl-Time-HiRes ) |
2324 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
2325 |
-" |
2326 |
-# For other stuff to bring us in |
2327 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
2328 |
-# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed |
2329 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
2330 |
- server? ( ~virtual/mysql-5.6[static=] |
2331 |
- galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )" |
2332 |
- |
2333 |
-pkg_setup() { |
2334 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
2335 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
2336 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
2337 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
2338 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
2339 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
2340 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
2341 |
- die |
2342 |
- fi |
2343 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
2344 |
- # non x86{,_64} arches |
2345 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
2346 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
2347 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
2348 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
2349 |
- die |
2350 |
- fi |
2351 |
- fi |
2352 |
- java-pkg-opt-2_pkg_setup |
2353 |
- if has test ${FEATURES} && \ |
2354 |
- use server && ! has userpriv ${FEATURES} ; then |
2355 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
2356 |
- fi |
2357 |
- |
2358 |
- # This should come after all of the die statements |
2359 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
2360 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
2361 |
-} |
2362 |
- |
2363 |
-pkg_preinst() { |
2364 |
- java-pkg-opt-2_pkg_preinst |
2365 |
- |
2366 |
- # Here we need to see if the implementation switched client libraries |
2367 |
- # We check if this is a new instance of the package and a client library already exists |
2368 |
- local SHOW_ABI_MESSAGE libpath |
2369 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
2370 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
2371 |
- elog "Due to ABI changes when switching between different client libraries," |
2372 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
2373 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
2374 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
2375 |
- fi |
2376 |
-} |
2377 |
- |
2378 |
-pkg_postinst() { |
2379 |
- # Make sure the vars are correctly initialized |
2380 |
- mysql_init_vars |
2381 |
- |
2382 |
- # Create log directory securely if it does not exist |
2383 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
2384 |
- |
2385 |
- if use server ; then |
2386 |
- if use pam; then |
2387 |
- einfo |
2388 |
- elog "This install includes the PAM authentication plugin." |
2389 |
- elog "To activate and configure the PAM plugin, please read:" |
2390 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
2391 |
- einfo |
2392 |
- fi |
2393 |
- |
2394 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
2395 |
- einfo |
2396 |
- elog "You might want to run:" |
2397 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
2398 |
- elog "if this is a new install." |
2399 |
- elog |
2400 |
- elog "If you are switching server implentations, you should run the" |
2401 |
- elog "mysql_upgrade tool." |
2402 |
- einfo |
2403 |
- else |
2404 |
- einfo |
2405 |
- elog "If you are upgrading major versions, you should run the" |
2406 |
- elog "mysql_upgrade tool." |
2407 |
- einfo |
2408 |
- fi |
2409 |
- |
2410 |
- if use galera ; then |
2411 |
- einfo |
2412 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
2413 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
2414 |
- elog "The first time the cluster is activated, you should add" |
2415 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
2416 |
- elog "This option should then be removed for subsequent starts." |
2417 |
- einfo |
2418 |
- if use sst-xtrabackup ; then |
2419 |
- ewarn "As per https://mariadb.com/kb/en/meta/xtrabackup_warning/, XtraBackup" |
2420 |
- ewarn "as an SST is broken by default beginning with 10.2.19 with the setting" |
2421 |
- ewarn "innodb_safe_truncate=ON. Please migrate to sst-mariabackup instead." |
2422 |
- ewarn "sst-xtrabackup is being removed in 10.3 and higher." |
2423 |
- fi |
2424 |
- fi |
2425 |
- fi |
2426 |
- |
2427 |
- # Note about configuration change |
2428 |
- einfo |
2429 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
2430 |
- elog "to several files in /etc/mysql/${PN}.d." |
2431 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
2432 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
2433 |
- elog "You may have as many files as needed and they are read alphabetically." |
2434 |
- elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." |
2435 |
- einfo |
2436 |
-} |
2437 |
- |
2438 |
-src_unpack() { |
2439 |
- unpack ${A} |
2440 |
- # Grab the patches |
2441 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack |
2442 |
- |
2443 |
- mv -f "${WORKDIR%/}/${P}" "${S}" || die |
2444 |
-} |
2445 |
- |
2446 |
-src_prepare() { |
2447 |
- _disable_plugin() { |
2448 |
- echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
2449 |
- } |
2450 |
- _disable_engine() { |
2451 |
- echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
2452 |
- } |
2453 |
- |
2454 |
- local malloc |
2455 |
- for malloc in jemalloc tcmalloc ; do |
2456 |
- if use ${malloc}; then |
2457 |
- echo "TARGET_LINK_LIBRARIES(mysqld ${malloc})" >> "${S}/sql/CMakeLists.txt" |
2458 |
- fi |
2459 |
- done |
2460 |
- |
2461 |
- # Don't build bundled xz-utils for tokudb |
2462 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
2463 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
2464 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
2465 |
- |
2466 |
- local plugin |
2467 |
- local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
2468 |
- locale_info qc_info server_audit sql_errlog auth_ed25519 ) |
2469 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext |
2470 |
- debug_key_management example_key_management ) |
2471 |
- if ! use server; then # These plugins are for the server |
2472 |
- for plugin in "${server_plugins[@]}" ; do |
2473 |
- _disable_plugin "${plugin}" |
2474 |
- done |
2475 |
- fi |
2476 |
- |
2477 |
- if ! use test; then # These plugins are only used during testing |
2478 |
- for plugin in "${test_plugins[@]}" ; do |
2479 |
- _disable_plugin "${plugin}" |
2480 |
- done |
2481 |
- _disable_engine test_sql_discovery |
2482 |
- fi |
2483 |
- |
2484 |
- _disable_engine example |
2485 |
- |
2486 |
- if ! use oqgraph ; then # avoids extra library checks |
2487 |
- _disable_engine oqgraph |
2488 |
- fi |
2489 |
- |
2490 |
- if use mroonga ; then |
2491 |
- # Remove the bundled groonga |
2492 |
- # There is no CMake flag, it simply checks for existance |
2493 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
2494 |
- else |
2495 |
- _disable_engine mroonga |
2496 |
- fi |
2497 |
- |
2498 |
- # Don't clash with dev-db/mysql-connector-c |
2499 |
- sed -i -e 's/ my_print_defaults.1//' \ |
2500 |
- -e 's/ perror.1//' \ |
2501 |
- "${S}"/man/CMakeLists.txt || die |
2502 |
- |
2503 |
- cmake-utils_src_prepare |
2504 |
- java-pkg-opt-2_src_prepare |
2505 |
-} |
2506 |
- |
2507 |
-src_configure(){ |
2508 |
- # bug 508724 mariadb cannot use ld.gold |
2509 |
- tc-ld-disable-gold |
2510 |
- # Bug #114895, bug #110149 |
2511 |
- filter-flags "-O" "-O[01]" |
2512 |
- |
2513 |
- append-cxxflags -felide-constructors |
2514 |
- |
2515 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
2516 |
- append-flags -fno-strict-aliasing |
2517 |
- |
2518 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
2519 |
- |
2520 |
- # debug hack wrt #497532 |
2521 |
- mycmakeargs=( |
2522 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
2523 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
2524 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
2525 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
2526 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
2527 |
- -DINSTALL_BINDIR=bin |
2528 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
2529 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
2530 |
- -DINSTALL_INCLUDEDIR=include/mysql |
2531 |
- -DINSTALL_INFODIR=share/info |
2532 |
- -DINSTALL_LIBDIR=$(get_libdir) |
2533 |
- -DINSTALL_MANDIR=share/man |
2534 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
2535 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
2536 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
2537 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
2538 |
- -DINSTALL_SBINDIR=sbin |
2539 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
2540 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
2541 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
2542 |
- -DWITH_LIBEDIT=0 |
2543 |
- -DWITH_ZLIB=system |
2544 |
- -DWITHOUT_LIBWRAP=1 |
2545 |
- -DENABLED_LOCAL_INFILE=1 |
2546 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
2547 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
2548 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
2549 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
2550 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
2551 |
- # The build forces this to be defined when cross-compiling. We pass it |
2552 |
- # all the time for simplicity and to make sure it is actually correct. |
2553 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
2554 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
2555 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
2556 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
2557 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
2558 |
- -DWITH_EXTERNAL_ZLIB=YES |
2559 |
- -DSUFFIX_INSTALL_DIR="" |
2560 |
- -DWITH_UNITTEST=OFF |
2561 |
- -DWITHOUT_CLIENTLIBS=YES |
2562 |
- -DCLIENT_PLUGIN_DIALOG=OFF |
2563 |
- -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF |
2564 |
- -DCLIENT_PLUGIN_CLIENT_ED25519=OFF |
2565 |
- -DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC |
2566 |
- -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF |
2567 |
- ) |
2568 |
- if use test ; then |
2569 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
2570 |
- else |
2571 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
2572 |
- fi |
2573 |
- |
2574 |
- if ! use yassl ; then |
2575 |
- mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC ) |
2576 |
- else |
2577 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
2578 |
- fi |
2579 |
- |
2580 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
2581 |
- mycmakeargs+=( |
2582 |
- -DWITH_READLINE=$(usex bindist 1 0) |
2583 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
2584 |
- -DENABLE_DTRACE=$(usex systemtap) |
2585 |
- ) |
2586 |
- |
2587 |
- if use server ; then |
2588 |
- |
2589 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
2590 |
- if ! use extraengine ; then |
2591 |
- mycmakeargs+=( |
2592 |
- -DPLUGIN_FEDERATED=NO |
2593 |
- -DPLUGIN_FEDERATEDX=NO ) |
2594 |
- fi |
2595 |
- |
2596 |
- mycmakeargs+=( |
2597 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
2598 |
- -DWITH_PCRE=system |
2599 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
2600 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
2601 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
2602 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
2603 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
2604 |
- -DPLUGIN_CASSANDRA=NO |
2605 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
2606 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
2607 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
2608 |
- -DCONNECT_WITH_MYSQL=1 |
2609 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
2610 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
2611 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
2612 |
- # Build failure and autodep wrt bug 639144 |
2613 |
- -DCONNECT_WITH_MONGO=OFF |
2614 |
- -DWITH_WSREP=$(usex galera) |
2615 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
2616 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
2617 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
2618 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
2619 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
2620 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
2621 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
2622 |
- -DINSTALL_SQLBENCHDIR=share/mariadb |
2623 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
2624 |
- # systemd is only linked to for server notification |
2625 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
2626 |
- -DWITH_NUMA=$(usex numa ON OFF) |
2627 |
- ) |
2628 |
- |
2629 |
- # Workaround for MDEV-14524 |
2630 |
- use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) |
2631 |
- |
2632 |
- if use test ; then |
2633 |
- # This is needed for the new client lib which tests a real, open server |
2634 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
2635 |
- fi |
2636 |
- |
2637 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
2638 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
2639 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
2640 |
- ewarn "You MUST file bugs without these variables set." |
2641 |
- |
2642 |
- mycmakeargs+=( |
2643 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
2644 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
2645 |
- ) |
2646 |
- |
2647 |
- elif ! use latin1 ; then |
2648 |
- mycmakeargs+=( |
2649 |
- -DDEFAULT_CHARSET=utf8 |
2650 |
- -DDEFAULT_COLLATION=utf8_general_ci |
2651 |
- ) |
2652 |
- else |
2653 |
- mycmakeargs+=( |
2654 |
- -DDEFAULT_CHARSET=latin1 |
2655 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
2656 |
- ) |
2657 |
- fi |
2658 |
- mycmakeargs+=( |
2659 |
- -DEXTRA_CHARSETS=all |
2660 |
- -DMYSQL_USER=mysql |
2661 |
- -DDISABLE_SHARED=$(usex static YES NO) |
2662 |
- -DWITH_DEBUG=$(usex debug) |
2663 |
- -DWITH_EMBEDDED_SERVER=OFF |
2664 |
- -DWITH_PROFILING=$(usex profiling) |
2665 |
- ) |
2666 |
- |
2667 |
- if use static; then |
2668 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
2669 |
- fi |
2670 |
- |
2671 |
- if use jemalloc || use tcmalloc ; then |
2672 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
2673 |
- fi |
2674 |
- |
2675 |
- # Storage engines |
2676 |
- mycmakeargs+=( |
2677 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
2678 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
2679 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
2680 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
2681 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
2682 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
2683 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
2684 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
2685 |
- ) |
2686 |
- |
2687 |
- else |
2688 |
- mycmakeargs+=( |
2689 |
- -DWITHOUT_SERVER=1 |
2690 |
- -DWITH_EMBEDDED_SERVER=OFF |
2691 |
- -DEXTRA_CHARSETS=none |
2692 |
- -DINSTALL_SQLBENCHDIR= |
2693 |
- -DWITH_SYSTEMD=no |
2694 |
- ) |
2695 |
- fi |
2696 |
- |
2697 |
- cmake-utils_src_configure |
2698 |
-} |
2699 |
- |
2700 |
-src_compile() { |
2701 |
- cmake-utils_src_compile |
2702 |
-} |
2703 |
- |
2704 |
-src_install() { |
2705 |
- cmake-utils_src_install |
2706 |
- |
2707 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
2708 |
- if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
2709 |
- rm "${ED}/usr/include/mysql/server/private/config.h" || die |
2710 |
- fi |
2711 |
- |
2712 |
- # Make sure the vars are correctly initialized |
2713 |
- mysql_init_vars |
2714 |
- |
2715 |
- # Convenience links |
2716 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
2717 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
2718 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
2719 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
2720 |
- |
2721 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
2722 |
- if [[ -d "${ED}/usr/data" ]] ; then |
2723 |
- rm -Rf "${ED}/usr/data" || die |
2724 |
- fi |
2725 |
- |
2726 |
- # Unless they explicitly specific USE=test, then do not install the |
2727 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
2728 |
- # validation of your database configuration after tuning it. |
2729 |
- if ! use test ; then |
2730 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
2731 |
- fi |
2732 |
- |
2733 |
- # Configuration stuff |
2734 |
- einfo "Building default configuration ..." |
2735 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
2736 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
2737 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
2738 |
- eprefixify "${TMPDIR}/my.cnf" |
2739 |
- doins "${TMPDIR}/my.cnf" |
2740 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
2741 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
2742 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
2743 |
- doins "${TMPDIR}/50-distro-client.cnf" |
2744 |
- |
2745 |
- if use server ; then |
2746 |
- mycnf_src="my.cnf.distro-server" |
2747 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
2748 |
- "${FILESDIR}/${mycnf_src}" \ |
2749 |
- > "${TMPDIR}/my.cnf.ok" || die |
2750 |
- if use prefix ; then |
2751 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
2752 |
- "${TMPDIR}/my.cnf.ok" || die |
2753 |
- fi |
2754 |
- if use latin1 ; then |
2755 |
- sed -i \ |
2756 |
- -e "/character-set/s|utf8|latin1|g" \ |
2757 |
- "${TMPDIR}/my.cnf.ok" || die |
2758 |
- fi |
2759 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
2760 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
2761 |
- |
2762 |
- einfo "Including support files and sample configurations" |
2763 |
- docinto "support-files" |
2764 |
- local script |
2765 |
- for script in \ |
2766 |
- "${S}"/support-files/magic |
2767 |
- do |
2768 |
- [[ -f "$script" ]] && dodoc "${script}" |
2769 |
- done |
2770 |
- |
2771 |
- docinto "scripts" |
2772 |
- for script in "${S}"/scripts/mysql* ; do |
2773 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
2774 |
- done |
2775 |
- # Manually install supporting files that conflict with other packages |
2776 |
- # but are needed for galera and initial installation |
2777 |
- exeinto /usr/libexec/mariadb |
2778 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
2779 |
- fi |
2780 |
- |
2781 |
- #Remove mytop if perl is not selected |
2782 |
- [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" |
2783 |
-} |
2784 |
- |
2785 |
-# Official test instructions: |
2786 |
-# USE='extraengine perl server' \ |
2787 |
-# FEATURES='test userpriv -usersandbox' \ |
2788 |
-# ebuild mariadb-X.X.XX.ebuild \ |
2789 |
-# digest clean package |
2790 |
-src_test() { |
2791 |
- |
2792 |
- _disable_test() { |
2793 |
- local rawtestname reason |
2794 |
- rawtestname="${1}" ; shift |
2795 |
- reason="${@}" |
2796 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
2797 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
2798 |
- } |
2799 |
- |
2800 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
2801 |
- local retstatus_unit |
2802 |
- local retstatus_tests |
2803 |
- |
2804 |
- if ! use server ; then |
2805 |
- einfo "Skipping server tests due to minimal build." |
2806 |
- return 0 |
2807 |
- fi |
2808 |
- |
2809 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
2810 |
- # localhost. Also causes weird failures. |
2811 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
2812 |
- |
2813 |
- if [[ $UID -eq 0 ]]; then |
2814 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
2815 |
- fi |
2816 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
2817 |
- |
2818 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
2819 |
- |
2820 |
- # Run CTest (test-units) |
2821 |
- cmake-utils_src_test |
2822 |
- retstatus_unit=$? |
2823 |
- |
2824 |
- # Ensure that parallel runs don't die |
2825 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
2826 |
- # Enable parallel testing, auto will try to detect number of cores |
2827 |
- # You may set this by hand. |
2828 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
2829 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
2830 |
- |
2831 |
- # create directories because mysqladmin might run out of order |
2832 |
- mkdir -p "${T}"/var-tests{,/log} || die |
2833 |
- |
2834 |
- # Run mysql tests |
2835 |
- pushd "${TESTDIR}" > /dev/null || die |
2836 |
- |
2837 |
- touch "${T}/disabled.def" |
2838 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
2839 |
- # false positives: |
2840 |
- # |
2841 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
2842 |
- # main.mysql_client_test_comp: |
2843 |
- # segfaults at random under Portage only, suspect resource limits. |
2844 |
- |
2845 |
- local t |
2846 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
2847 |
- _disable_test "$t" "False positive due to varying policies" |
2848 |
- done |
2849 |
- |
2850 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock main.mysql \ |
2851 |
- main.mysql_upgrade \ |
2852 |
- main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
2853 |
- _disable_test "$t" "False positives in Gentoo" |
2854 |
- done |
2855 |
- |
2856 |
- _disable_test main.gis_notembedded "Needs latin1 USE set" |
2857 |
- _disable_test main.plugin_auth "Needs client libraries built" |
2858 |
- _disable_test plugins.auth_ed25519 "Needs client libraries built" |
2859 |
- _disable_test main.mysqldump "Test fails past 2018-12-31 due to event expiration" |
2860 |
- |
2861 |
- # Likely environment issues as only number of clients connected fails |
2862 |
- _disable_test rpl.rpl_semi_sync_uninstall_plugin \ |
2863 |
- "Fails intermittently on parallel testing" |
2864 |
- |
2865 |
- # run mysql-test tests |
2866 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
2867 |
- retstatus_tests=$? |
2868 |
- |
2869 |
- popd > /dev/null || die |
2870 |
- |
2871 |
- # Cleanup is important for these testcases. |
2872 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
2873 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
2874 |
- |
2875 |
- local failures="" |
2876 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
2877 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
2878 |
- |
2879 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
2880 |
- einfo "Tests successfully completed" |
2881 |
-} |
2882 |
- |
2883 |
-mysql_init_vars() { |
2884 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
2885 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
2886 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
2887 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
2888 |
- |
2889 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
2890 |
- MY_DATADIR="" |
2891 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
2892 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
2893 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
2894 |
- | tail -n1` |
2895 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
2896 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
2897 |
- | sed -e 's/.*=\s*//' \ |
2898 |
- | tail -n1` |
2899 |
- fi |
2900 |
- fi |
2901 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
2902 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
2903 |
- einfo "Using default MY_DATADIR" |
2904 |
- fi |
2905 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
2906 |
- |
2907 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
2908 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
2909 |
- # If you get this and you're wondering about it, see bug #207636 |
2910 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
2911 |
- elog "A new one will not be created." |
2912 |
- PREVIOUS_DATADIR="yes" |
2913 |
- else |
2914 |
- PREVIOUS_DATADIR="no" |
2915 |
- fi |
2916 |
- export PREVIOUS_DATADIR |
2917 |
- fi |
2918 |
- else |
2919 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
2920 |
- local new_MY_DATADIR |
2921 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
2922 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
2923 |
- | tail -n1` |
2924 |
- |
2925 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
2926 |
- ewarn "MySQL MY_DATADIR has changed" |
2927 |
- ewarn "from ${MY_DATADIR}" |
2928 |
- ewarn "to ${new_MY_DATADIR}" |
2929 |
- MY_DATADIR="${new_MY_DATADIR}" |
2930 |
- fi |
2931 |
- fi |
2932 |
- fi |
2933 |
- |
2934 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
2935 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
2936 |
- export MY_DATADIR |
2937 |
-} |
2938 |
- |
2939 |
-pkg_config() { |
2940 |
- _getoptval() { |
2941 |
- local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults |
2942 |
- local section="$1" |
2943 |
- local flag="--${2}=" |
2944 |
- local extra_options="${3}" |
2945 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
2946 |
- } |
2947 |
- local old_MY_DATADIR="${MY_DATADIR}" |
2948 |
- local old_HOME="${HOME}" |
2949 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
2950 |
- export HOME=${EPREFIX}/root |
2951 |
- |
2952 |
- # Make sure the vars are correctly initialized |
2953 |
- mysql_init_vars |
2954 |
- |
2955 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
2956 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
2957 |
- die "Minimal builds do NOT include the MySQL server" |
2958 |
- fi |
2959 |
- |
2960 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
2961 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
2962 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
2963 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
2964 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
2965 |
- |
2966 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
2967 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
2968 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
2969 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
2970 |
- else |
2971 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
2972 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
2973 |
- || die "Moving MY_DATADIR failed" |
2974 |
- fi |
2975 |
- else |
2976 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
2977 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
2978 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
2979 |
- else |
2980 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
2981 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
2982 |
- fi |
2983 |
- fi |
2984 |
- fi |
2985 |
- |
2986 |
- local pwd1="a" |
2987 |
- local pwd2="b" |
2988 |
- local maxtry=15 |
2989 |
- |
2990 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
2991 |
- local tmp_mysqld_password_source= |
2992 |
- |
2993 |
- for tmp_mysqld_password_source in mysql client; do |
2994 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
2995 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
2996 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
2997 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
2998 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
2999 |
- MYSQL_ROOT_PASSWORD= |
3000 |
- continue |
3001 |
- fi |
3002 |
- |
3003 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
3004 |
- break |
3005 |
- fi |
3006 |
- done |
3007 |
- |
3008 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
3009 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
3010 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
3011 |
- fi |
3012 |
- |
3013 |
- unset tmp_mysqld_password_source |
3014 |
- fi |
3015 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" |
3016 |
- # These are dir+prefix |
3017 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" |
3018 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
3019 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" |
3020 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
3021 |
- |
3022 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
3023 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
3024 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
3025 |
- fi |
3026 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
3027 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
3028 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
3029 |
- fi |
3030 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
3031 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
3032 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
3033 |
- fi |
3034 |
- |
3035 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
3036 |
- ewarn "You have already a MySQL database in place." |
3037 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
3038 |
- ewarn "Please rename or delete it if you wish to replace it." |
3039 |
- die "MySQL database already exists!" |
3040 |
- fi |
3041 |
- |
3042 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
3043 |
- # localhost. Also causes weird failures. |
3044 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
3045 |
- |
3046 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
3047 |
- |
3048 |
- einfo "Please provide a password for the mysql 'root' user now" |
3049 |
- einfo "or through the ${HOME}/.my.cnf file." |
3050 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
3051 |
- read -rsp " >" pwd1 ; echo |
3052 |
- |
3053 |
- einfo "Retype the password" |
3054 |
- read -rsp " >" pwd2 ; echo |
3055 |
- |
3056 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
3057 |
- die "Passwords are not the same" |
3058 |
- fi |
3059 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
3060 |
- unset pwd1 pwd2 |
3061 |
- fi |
3062 |
- |
3063 |
- local options |
3064 |
- local sqltmp="$(emktemp)" |
3065 |
- |
3066 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
3067 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
3068 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
3069 |
- |
3070 |
- # Figure out which options we need to disable to do the setup |
3071 |
- local helpfile="${TMPDIR}/mysqld-help" |
3072 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
3073 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
3074 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
3075 |
- log-slave-updates \ |
3076 |
- ; do |
3077 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
3078 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
3079 |
- done |
3080 |
- |
3081 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
3082 |
- |
3083 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
3084 |
- PID_DIR="${EROOT}/var/run/mysqld" |
3085 |
- if [[ ! -d "${PID_DIR}" ]]; then |
3086 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
3087 |
- fi |
3088 |
- |
3089 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
3090 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
3091 |
- fi |
3092 |
- |
3093 |
- pushd "${TMPDIR}" &>/dev/null || die |
3094 |
- |
3095 |
- # Filling timezones, see |
3096 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
3097 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
3098 |
- |
3099 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
3100 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
3101 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
3102 |
- einfo "Command: ${cmd[*]}" |
3103 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
3104 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
3105 |
- if [ $? -ne 0 ]; then |
3106 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
3107 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
3108 |
- fi |
3109 |
- popd &>/dev/null || die |
3110 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
3111 |
- || die "MySQL databases not installed" |
3112 |
- |
3113 |
- use prefix || options="${options} --user=mysql" |
3114 |
- |
3115 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
3116 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
3117 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
3118 |
- ${options} \ |
3119 |
- --log-warnings=0 \ |
3120 |
- --basedir=${EROOT}/usr \ |
3121 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
3122 |
- --max_allowed_packet=8M \ |
3123 |
- --net_buffer_length=16K \ |
3124 |
- --socket=${socket} \ |
3125 |
- --pid-file=${pidfile} \ |
3126 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
3127 |
- #einfo "About to start mysqld: ${mysqld}" |
3128 |
- ebegin "Starting mysqld" |
3129 |
- einfo "Command ${mysqld}" |
3130 |
- ${mysqld} & |
3131 |
- rc=$? |
3132 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
3133 |
- maxtry=$((${maxtry}-1)) |
3134 |
- echo -n "." |
3135 |
- sleep 1 |
3136 |
- done |
3137 |
- eend $rc |
3138 |
- |
3139 |
- if ! [[ -S "${socket}" ]]; then |
3140 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
3141 |
- fi |
3142 |
- |
3143 |
- ebegin "Setting root password" |
3144 |
- # Do this from memory, as we don't want clear text passwords in temp files |
3145 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
3146 |
- "${EROOT}/usr/bin/mysql" \ |
3147 |
- "--socket=${socket}" \ |
3148 |
- -hlocalhost \ |
3149 |
- -e "${sql}" |
3150 |
- eend $? |
3151 |
- |
3152 |
- if [[ -n "${sqltmp}" ]] ; then |
3153 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
3154 |
- "${EROOT}/usr/bin/mysql" \ |
3155 |
- "--socket=${socket}" \ |
3156 |
- -hlocalhost \ |
3157 |
- -uroot \ |
3158 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
3159 |
- mysql < "${sqltmp}" |
3160 |
- rc=$? |
3161 |
- eend $? |
3162 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
3163 |
- fi |
3164 |
- |
3165 |
- # Stop the server and cleanup |
3166 |
- einfo "Stopping the server ..." |
3167 |
- kill $(< "${pidfile}" ) |
3168 |
- rm -f "${sqltmp}" |
3169 |
- wait %1 |
3170 |
- einfo "Done" |
3171 |
-} |
3172 |
|
3173 |
diff --git a/dev-db/mariadb/mariadb-10.3.17-r1.ebuild b/dev-db/mariadb/mariadb-10.3.17-r1.ebuild |
3174 |
deleted file mode 100644 |
3175 |
index 36bcf31f509..00000000000 |
3176 |
--- a/dev-db/mariadb/mariadb-10.3.17-r1.ebuild |
3177 |
+++ /dev/null |
3178 |
@@ -1,982 +0,0 @@ |
3179 |
-# Copyright 1999-2019 Gentoo Authors |
3180 |
-# Distributed under the terms of the GNU General Public License v2 |
3181 |
- |
3182 |
-EAPI="6" |
3183 |
-MY_EXTRAS_VER="20190305-2052Z" |
3184 |
-SUBSLOT="18" |
3185 |
- |
3186 |
-JAVA_PKG_OPT_USE="jdbc" |
3187 |
- |
3188 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
3189 |
- |
3190 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
3191 |
- java-pkg-opt-2 user cmake-utils |
3192 |
- |
3193 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
3194 |
- |
3195 |
-# Gentoo patches to MySQL |
3196 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
3197 |
- SRC_URI="${SRC_URI} |
3198 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
3199 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
3200 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
3201 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
3202 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
3203 |
-fi |
3204 |
- |
3205 |
-HOMEPAGE="https://mariadb.org/" |
3206 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
3207 |
-LICENSE="GPL-2 LGPL-2.1+" |
3208 |
-SLOT="0/${SUBSLOT:-0}" |
3209 |
-IUSE="+backup bindist client-libs cracklib debug extraengine galera innodb-lz4 |
3210 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
3211 |
- numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
3212 |
- sst-rsync sst-mariabackup static systemd systemtap tcmalloc |
3213 |
- test tokudb xml yassl" |
3214 |
- |
3215 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
3216 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
3217 |
- |
3218 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
3219 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
3220 |
- ?? ( tcmalloc jemalloc ) |
3221 |
- static? ( yassl !pam )" |
3222 |
- |
3223 |
-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" |
3224 |
- |
3225 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
3226 |
-# and we will run a mysql server during test phase |
3227 |
-S="${WORKDIR}/mysql" |
3228 |
- |
3229 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
3230 |
- inherit git-r3 |
3231 |
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" |
3232 |
- EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
3233 |
- EGIT_CLONE_TYPE=shallow |
3234 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
3235 |
-else |
3236 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
3237 |
-fi |
3238 |
- |
3239 |
-PATCHES=( |
3240 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
3241 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.3.12-without-clientlibs-tools.patch |
3242 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
3243 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
3244 |
- "${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch |
3245 |
- "${FILESDIR}/MDEV-20247-replication-10.2.patch" |
3246 |
-) |
3247 |
- |
3248 |
-# Be warned, *DEPEND are version-dependant |
3249 |
-# These are used for both runtime and compiletime |
3250 |
-COMMON_DEPEND=" |
3251 |
- kernel_linux? ( |
3252 |
- sys-process/procps:0= |
3253 |
- dev-libs/libaio:0= |
3254 |
- ) |
3255 |
- >=sys-apps/sed-4 |
3256 |
- >=sys-apps/texinfo-4.7-r1 |
3257 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
3258 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
3259 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
3260 |
- >=sys-libs/zlib-1.2.3:0= |
3261 |
- kerberos? ( virtual/krb5 ) |
3262 |
- yassl? ( net-libs/gnutls:0= ) |
3263 |
- !yassl? ( |
3264 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
3265 |
- libressl? ( dev-libs/libressl:0= ) |
3266 |
- ) |
3267 |
- sys-libs/ncurses:0= |
3268 |
- !bindist? ( |
3269 |
- sys-libs/binutils-libs:0= |
3270 |
- >=sys-libs/readline-4.1:0= |
3271 |
- ) |
3272 |
- server? ( |
3273 |
- backup? ( app-arch/libarchive:0= ) |
3274 |
- cracklib? ( sys-libs/cracklib:0= ) |
3275 |
- extraengine? ( |
3276 |
- odbc? ( dev-db/unixODBC:0= ) |
3277 |
- xml? ( dev-libs/libxml2:2= ) |
3278 |
- ) |
3279 |
- innodb-lz4? ( app-arch/lz4 ) |
3280 |
- innodb-lzo? ( dev-libs/lzo ) |
3281 |
- innodb-snappy? ( app-arch/snappy ) |
3282 |
- mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
3283 |
- numa? ( sys-process/numactl ) |
3284 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
3285 |
- pam? ( sys-libs/pam:0= ) |
3286 |
- systemd? ( sys-apps/systemd:= ) |
3287 |
- tokudb? ( app-arch/snappy ) |
3288 |
- ) |
3289 |
- >=dev-libs/libpcre-8.41-r1:3= |
3290 |
-" |
3291 |
-DEPEND="virtual/yacc |
3292 |
- static? ( sys-libs/ncurses[static-libs] ) |
3293 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
3294 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
3295 |
- ${COMMON_DEPEND}" |
3296 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
3297 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
3298 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
3299 |
- !<virtual/mysql-5.6-r11 |
3300 |
- ${COMMON_DEPEND} |
3301 |
- server? ( galera? ( |
3302 |
- sys-apps/iproute2 |
3303 |
- =sys-cluster/galera-25* |
3304 |
- sst-rsync? ( sys-process/lsof ) |
3305 |
- sst-mariabackup? ( net-misc/socat[ssl] ) |
3306 |
- ) ) |
3307 |
- perl? ( !dev-db/mytop |
3308 |
- virtual/perl-Getopt-Long |
3309 |
- dev-perl/TermReadKey |
3310 |
- virtual/perl-Term-ANSIColor |
3311 |
- virtual/perl-Time-HiRes ) |
3312 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
3313 |
-" |
3314 |
-# For other stuff to bring us in |
3315 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
3316 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
3317 |
- server? ( ~virtual/mysql-5.6[static=] )" |
3318 |
- |
3319 |
-pkg_setup() { |
3320 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
3321 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
3322 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
3323 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
3324 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
3325 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
3326 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
3327 |
- die |
3328 |
- fi |
3329 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
3330 |
- # non x86{,_64} arches |
3331 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
3332 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
3333 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
3334 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
3335 |
- die |
3336 |
- fi |
3337 |
- fi |
3338 |
- java-pkg-opt-2_pkg_setup |
3339 |
- if has test ${FEATURES} && \ |
3340 |
- use server && ! has userpriv ${FEATURES} ; then |
3341 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
3342 |
- fi |
3343 |
- |
3344 |
- # This should come after all of the die statements |
3345 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
3346 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
3347 |
-} |
3348 |
- |
3349 |
-pkg_preinst() { |
3350 |
- java-pkg-opt-2_pkg_preinst |
3351 |
- |
3352 |
- # Here we need to see if the implementation switched client libraries |
3353 |
- # We check if this is a new instance of the package and a client library already exists |
3354 |
- local SHOW_ABI_MESSAGE libpath |
3355 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
3356 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
3357 |
- elog "Due to ABI changes when switching between different client libraries," |
3358 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
3359 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
3360 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
3361 |
- fi |
3362 |
-} |
3363 |
- |
3364 |
-pkg_postinst() { |
3365 |
- # Make sure the vars are correctly initialized |
3366 |
- mysql_init_vars |
3367 |
- |
3368 |
- # Create log directory securely if it does not exist |
3369 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
3370 |
- |
3371 |
- if use server ; then |
3372 |
- if use pam; then |
3373 |
- einfo |
3374 |
- elog "This install includes the PAM authentication plugin." |
3375 |
- elog "To activate and configure the PAM plugin, please read:" |
3376 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
3377 |
- einfo |
3378 |
- fi |
3379 |
- |
3380 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
3381 |
- einfo |
3382 |
- elog "You might want to run:" |
3383 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
3384 |
- elog "if this is a new install." |
3385 |
- elog |
3386 |
- elog "If you are switching server implentations, you should run the" |
3387 |
- elog "mysql_upgrade tool." |
3388 |
- einfo |
3389 |
- else |
3390 |
- einfo |
3391 |
- elog "If you are upgrading major versions, you should run the" |
3392 |
- elog "mysql_upgrade tool." |
3393 |
- einfo |
3394 |
- fi |
3395 |
- |
3396 |
- if use galera ; then |
3397 |
- einfo |
3398 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
3399 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
3400 |
- elog "The first time the cluster is activated, you should add" |
3401 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
3402 |
- elog "This option should then be removed for subsequent starts." |
3403 |
- einfo |
3404 |
- fi |
3405 |
- fi |
3406 |
- |
3407 |
- # Note about configuration change |
3408 |
- einfo |
3409 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
3410 |
- elog "to several files in /etc/mysql/${PN}.d." |
3411 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
3412 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
3413 |
- elog "You may have as many files as needed and they are read alphabetically." |
3414 |
- elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." |
3415 |
- einfo |
3416 |
-} |
3417 |
- |
3418 |
-src_unpack() { |
3419 |
- unpack ${A} |
3420 |
- # Grab the patches |
3421 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack |
3422 |
- |
3423 |
- mv -f "${WORKDIR}/${P/_rc/}" "${S}" || die |
3424 |
-} |
3425 |
- |
3426 |
-src_prepare() { |
3427 |
- _disable_plugin() { |
3428 |
- echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
3429 |
- } |
3430 |
- _disable_engine() { |
3431 |
- echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
3432 |
- } |
3433 |
- |
3434 |
- if use jemalloc; then |
3435 |
- echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" |
3436 |
- elif use tcmalloc; then |
3437 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
3438 |
- fi |
3439 |
- |
3440 |
- # Don't build bundled xz-utils for tokudb |
3441 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
3442 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
3443 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
3444 |
- |
3445 |
- local plugin |
3446 |
- local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
3447 |
- locale_info qc_info server_audit sql_errlog auth_ed25519 ) |
3448 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext |
3449 |
- debug_key_management example_key_management versioning ) |
3450 |
- if ! use server; then # These plugins are for the server |
3451 |
- for plugin in "${server_plugins[@]}" ; do |
3452 |
- _disable_plugin "${plugin}" |
3453 |
- done |
3454 |
- fi |
3455 |
- |
3456 |
- if ! use test; then # These plugins are only used during testing |
3457 |
- for plugin in "${test_plugins[@]}" ; do |
3458 |
- _disable_plugin "${plugin}" |
3459 |
- done |
3460 |
- _disable_engine test_sql_discovery |
3461 |
- fi |
3462 |
- |
3463 |
- _disable_engine example |
3464 |
- |
3465 |
- if ! use oqgraph ; then # avoids extra library checks |
3466 |
- _disable_engine oqgraph |
3467 |
- fi |
3468 |
- |
3469 |
- if use mroonga ; then |
3470 |
- # Remove the bundled groonga |
3471 |
- # There is no CMake flag, it simply checks for existance |
3472 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
3473 |
- else |
3474 |
- _disable_engine mroonga |
3475 |
- fi |
3476 |
- |
3477 |
- # Don't clash with dev-db/mysql-connector-c |
3478 |
- sed -i -e 's/ my_print_defaults.1//' \ |
3479 |
- -e 's/ perror.1//' \ |
3480 |
- "${S}"/man/CMakeLists.txt || die |
3481 |
- |
3482 |
- cmake-utils_src_prepare |
3483 |
- java-pkg-opt-2_src_prepare |
3484 |
-} |
3485 |
- |
3486 |
-src_configure(){ |
3487 |
- # bug 508724 mariadb cannot use ld.gold |
3488 |
- tc-ld-disable-gold |
3489 |
- # Bug #114895, bug #110149 |
3490 |
- filter-flags "-O" "-O[01]" |
3491 |
- |
3492 |
- append-cxxflags -felide-constructors |
3493 |
- |
3494 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
3495 |
- append-flags -fno-strict-aliasing |
3496 |
- |
3497 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
3498 |
- |
3499 |
- # debug hack wrt #497532 |
3500 |
- mycmakeargs=( |
3501 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
3502 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
3503 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
3504 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
3505 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
3506 |
- -DINSTALL_BINDIR=bin |
3507 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
3508 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
3509 |
- -DINSTALL_INCLUDEDIR=include/mysql |
3510 |
- -DINSTALL_INFODIR=share/info |
3511 |
- -DINSTALL_LIBDIR=$(get_libdir) |
3512 |
- -DINSTALL_MANDIR=share/man |
3513 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
3514 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
3515 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
3516 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
3517 |
- -DINSTALL_SBINDIR=sbin |
3518 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
3519 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
3520 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
3521 |
- -DWITH_LIBEDIT=0 |
3522 |
- -DWITH_ZLIB=system |
3523 |
- -DWITHOUT_LIBWRAP=1 |
3524 |
- -DENABLED_LOCAL_INFILE=1 |
3525 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
3526 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
3527 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
3528 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
3529 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
3530 |
- # The build forces this to be defined when cross-compiling. We pass it |
3531 |
- # all the time for simplicity and to make sure it is actually correct. |
3532 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
3533 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
3534 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
3535 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
3536 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
3537 |
- -DWITH_EXTERNAL_ZLIB=YES |
3538 |
- -DSUFFIX_INSTALL_DIR="" |
3539 |
- -DWITH_UNITTEST=OFF |
3540 |
- -DWITHOUT_CLIENTLIBS=YES |
3541 |
- -DCLIENT_PLUGIN_DIALOG=OFF |
3542 |
- -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF |
3543 |
- -DCLIENT_PLUGIN_CLIENT_ED25519=OFF |
3544 |
- -DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC |
3545 |
- -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF |
3546 |
- ) |
3547 |
- if use test ; then |
3548 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
3549 |
- else |
3550 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
3551 |
- fi |
3552 |
- |
3553 |
- if ! use yassl ; then |
3554 |
- mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC ) |
3555 |
- else |
3556 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
3557 |
- fi |
3558 |
- |
3559 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
3560 |
- mycmakeargs+=( |
3561 |
- -DWITH_READLINE=$(usex bindist 1 0) |
3562 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
3563 |
- -DENABLE_DTRACE=$(usex systemtap) |
3564 |
- ) |
3565 |
- |
3566 |
- if use server ; then |
3567 |
- |
3568 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
3569 |
- if ! use extraengine ; then |
3570 |
- mycmakeargs+=( |
3571 |
- -DPLUGIN_FEDERATED=NO |
3572 |
- -DPLUGIN_FEDERATEDX=NO ) |
3573 |
- fi |
3574 |
- |
3575 |
- mycmakeargs+=( |
3576 |
- -DWITH_PCRE=system |
3577 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
3578 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
3579 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
3580 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
3581 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
3582 |
- -DPLUGIN_CASSANDRA=NO |
3583 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
3584 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
3585 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
3586 |
- -DCONNECT_WITH_MYSQL=1 |
3587 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
3588 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
3589 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
3590 |
- # Build failure and autodep wrt bug 639144 |
3591 |
- -DCONNECT_WITH_MONGO=OFF |
3592 |
- -DWITH_WSREP=$(usex galera) |
3593 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
3594 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
3595 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
3596 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
3597 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
3598 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
3599 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
3600 |
- -DINSTALL_SQLBENCHDIR="" |
3601 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
3602 |
- # systemd is only linked to for server notification |
3603 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
3604 |
- -DWITH_NUMA=$(usex numa ON OFF) |
3605 |
- ) |
3606 |
- |
3607 |
- # Workaround for MDEV-14524 |
3608 |
- use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) |
3609 |
- |
3610 |
- if use test ; then |
3611 |
- # This is needed for the new client lib which tests a real, open server |
3612 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
3613 |
- fi |
3614 |
- |
3615 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
3616 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
3617 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
3618 |
- ewarn "You MUST file bugs without these variables set." |
3619 |
- |
3620 |
- mycmakeargs+=( |
3621 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
3622 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
3623 |
- ) |
3624 |
- |
3625 |
- elif ! use latin1 ; then |
3626 |
- mycmakeargs+=( |
3627 |
- -DDEFAULT_CHARSET=utf8 |
3628 |
- -DDEFAULT_COLLATION=utf8_general_ci |
3629 |
- ) |
3630 |
- else |
3631 |
- mycmakeargs+=( |
3632 |
- -DDEFAULT_CHARSET=latin1 |
3633 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
3634 |
- ) |
3635 |
- fi |
3636 |
- mycmakeargs+=( |
3637 |
- -DEXTRA_CHARSETS=all |
3638 |
- -DMYSQL_USER=mysql |
3639 |
- -DDISABLE_SHARED=$(usex static YES NO) |
3640 |
- -DWITH_DEBUG=$(usex debug) |
3641 |
- -DWITH_EMBEDDED_SERVER=OFF |
3642 |
- -DWITH_PROFILING=$(usex profiling) |
3643 |
- ) |
3644 |
- |
3645 |
- if use static; then |
3646 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
3647 |
- fi |
3648 |
- |
3649 |
- if use jemalloc || use tcmalloc ; then |
3650 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
3651 |
- fi |
3652 |
- |
3653 |
- # Storage engines |
3654 |
- mycmakeargs+=( |
3655 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
3656 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
3657 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
3658 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
3659 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
3660 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
3661 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
3662 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
3663 |
- ) |
3664 |
- |
3665 |
- else |
3666 |
- mycmakeargs+=( |
3667 |
- -DWITHOUT_SERVER=1 |
3668 |
- -DWITH_EMBEDDED_SERVER=OFF |
3669 |
- -DEXTRA_CHARSETS=none |
3670 |
- -DINSTALL_SQLBENCHDIR= |
3671 |
- -DWITH_SYSTEMD=no |
3672 |
- ) |
3673 |
- fi |
3674 |
- |
3675 |
- cmake-utils_src_configure |
3676 |
-} |
3677 |
- |
3678 |
-src_compile() { |
3679 |
- cmake-utils_src_compile |
3680 |
-} |
3681 |
- |
3682 |
-src_install() { |
3683 |
- cmake-utils_src_install |
3684 |
- |
3685 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
3686 |
- if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
3687 |
- rm "${ED}/usr/include/mysql/server/private/config.h" || die |
3688 |
- fi |
3689 |
- |
3690 |
- # Make sure the vars are correctly initialized |
3691 |
- mysql_init_vars |
3692 |
- |
3693 |
- # Convenience links |
3694 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
3695 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
3696 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
3697 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
3698 |
- |
3699 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
3700 |
- if [[ -d "${ED}/usr/data" ]] ; then |
3701 |
- rm -Rf "${ED}/usr/data" || die |
3702 |
- fi |
3703 |
- |
3704 |
- # Unless they explicitly specific USE=test, then do not install the |
3705 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
3706 |
- # validation of your database configuration after tuning it. |
3707 |
- if ! use test ; then |
3708 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
3709 |
- fi |
3710 |
- |
3711 |
- # Configuration stuff |
3712 |
- einfo "Building default configuration ..." |
3713 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
3714 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
3715 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
3716 |
- eprefixify "${TMPDIR}/my.cnf" |
3717 |
- doins "${TMPDIR}/my.cnf" |
3718 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
3719 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
3720 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
3721 |
- doins "${TMPDIR}/50-distro-client.cnf" |
3722 |
- |
3723 |
- if use server ; then |
3724 |
- mycnf_src="my.cnf.distro-server" |
3725 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
3726 |
- "${FILESDIR}/${mycnf_src}" \ |
3727 |
- > "${TMPDIR}/my.cnf.ok" || die |
3728 |
- if use prefix ; then |
3729 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
3730 |
- "${TMPDIR}/my.cnf.ok" || die |
3731 |
- fi |
3732 |
- if use latin1 ; then |
3733 |
- sed -i \ |
3734 |
- -e "/character-set/s|utf8|latin1|g" \ |
3735 |
- "${TMPDIR}/my.cnf.ok" || die |
3736 |
- fi |
3737 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
3738 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
3739 |
- |
3740 |
- einfo "Including support files and sample configurations" |
3741 |
- docinto "support-files" |
3742 |
- local script |
3743 |
- for script in \ |
3744 |
- "${S}"/support-files/magic |
3745 |
- do |
3746 |
- [[ -f "$script" ]] && dodoc "${script}" |
3747 |
- done |
3748 |
- |
3749 |
- docinto "scripts" |
3750 |
- for script in "${S}"/scripts/mysql* ; do |
3751 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
3752 |
- done |
3753 |
- # Manually install supporting files that conflict with other packages |
3754 |
- # but are needed for galera and initial installation |
3755 |
- exeinto /usr/libexec/mariadb |
3756 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
3757 |
- fi |
3758 |
- |
3759 |
- # Remove mytop if perl is not selected |
3760 |
- if [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl ; then |
3761 |
- rm -f "${ED}/usr/bin/mytop" || die |
3762 |
- fi |
3763 |
- |
3764 |
- # Fix a dangling symlink when galera is not built |
3765 |
- if [[ -L "${ED}/usr/bin/wsrep_sst_rsync_wan" ]] && ! use galera ; then |
3766 |
- rm "${ED}/usr/bin/wsrep_sst_rsync_wan" || die |
3767 |
- fi |
3768 |
- |
3769 |
- # Remove broken SST scripts that are incompatible |
3770 |
- local scriptremove |
3771 |
- for scriptremove in wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2 ; do |
3772 |
- if [[ -e "${ED}/usr/bin/${scriptremove}" ]] ; then |
3773 |
- rm "${ED}/usr/bin/${scriptremove}" || die |
3774 |
- fi |
3775 |
- done |
3776 |
-} |
3777 |
- |
3778 |
-# Official test instructions: |
3779 |
-# USE='extraengine perl server' \ |
3780 |
-# FEATURES='test userpriv -usersandbox' \ |
3781 |
-# ebuild mariadb-X.X.XX.ebuild \ |
3782 |
-# digest clean package |
3783 |
-src_test() { |
3784 |
- |
3785 |
- _disable_test() { |
3786 |
- local rawtestname reason |
3787 |
- rawtestname="${1}" ; shift |
3788 |
- reason="${@}" |
3789 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
3790 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
3791 |
- } |
3792 |
- |
3793 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
3794 |
- local retstatus_unit |
3795 |
- local retstatus_tests |
3796 |
- |
3797 |
- if ! use server ; then |
3798 |
- einfo "Skipping server tests due to minimal build." |
3799 |
- return 0 |
3800 |
- fi |
3801 |
- |
3802 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
3803 |
- # localhost. Also causes weird failures. |
3804 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
3805 |
- |
3806 |
- if [[ $UID -eq 0 ]]; then |
3807 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
3808 |
- fi |
3809 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
3810 |
- |
3811 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
3812 |
- |
3813 |
- # Run CTest (test-units) |
3814 |
- cmake-utils_src_test |
3815 |
- retstatus_unit=$? |
3816 |
- |
3817 |
- # Ensure that parallel runs don't die |
3818 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
3819 |
- # Enable parallel testing, auto will try to detect number of cores |
3820 |
- # You may set this by hand. |
3821 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
3822 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
3823 |
- |
3824 |
- # create directories because mysqladmin might run out of order |
3825 |
- mkdir -p "${T}"/var-tests{,/log} || die |
3826 |
- |
3827 |
- # Run mysql tests |
3828 |
- pushd "${TESTDIR}" > /dev/null || die |
3829 |
- |
3830 |
- touch "${T}/disabled.def" |
3831 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
3832 |
- # false positives: |
3833 |
- # |
3834 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
3835 |
- # main.mysql_client_test_comp: |
3836 |
- # segfaults at random under Portage only, suspect resource limits. |
3837 |
- |
3838 |
- local t |
3839 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
3840 |
- _disable_test "$t" "False positive due to varying policies" |
3841 |
- done |
3842 |
- |
3843 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
3844 |
- main.mysql main.gis_notembedded \ |
3845 |
- main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
3846 |
- _disable_test "$t" "False positives in Gentoo" |
3847 |
- done |
3848 |
- |
3849 |
- _disable_test main.plugin_auth "Needs client libraries built" |
3850 |
- _disable_test plugins.auth_ed25519 "Needs client libraries built" |
3851 |
- |
3852 |
- _disable_test main.func_time "Dependent on time test was written" |
3853 |
- |
3854 |
- # run mysql-test tests |
3855 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
3856 |
- retstatus_tests=$? |
3857 |
- |
3858 |
- popd > /dev/null || die |
3859 |
- |
3860 |
- # Cleanup is important for these testcases. |
3861 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
3862 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
3863 |
- |
3864 |
- local failures="" |
3865 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
3866 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
3867 |
- |
3868 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
3869 |
- einfo "Tests successfully completed" |
3870 |
-} |
3871 |
- |
3872 |
-mysql_init_vars() { |
3873 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
3874 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
3875 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
3876 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
3877 |
- |
3878 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
3879 |
- MY_DATADIR="" |
3880 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
3881 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
3882 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
3883 |
- | tail -n1` |
3884 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
3885 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
3886 |
- | sed -e 's/.*=\s*//' \ |
3887 |
- | tail -n1` |
3888 |
- fi |
3889 |
- fi |
3890 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
3891 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
3892 |
- einfo "Using default MY_DATADIR" |
3893 |
- fi |
3894 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
3895 |
- |
3896 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
3897 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
3898 |
- # If you get this and you're wondering about it, see bug #207636 |
3899 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
3900 |
- elog "A new one will not be created." |
3901 |
- PREVIOUS_DATADIR="yes" |
3902 |
- else |
3903 |
- PREVIOUS_DATADIR="no" |
3904 |
- fi |
3905 |
- export PREVIOUS_DATADIR |
3906 |
- fi |
3907 |
- else |
3908 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
3909 |
- local new_MY_DATADIR |
3910 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
3911 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
3912 |
- | tail -n1` |
3913 |
- |
3914 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
3915 |
- ewarn "MySQL MY_DATADIR has changed" |
3916 |
- ewarn "from ${MY_DATADIR}" |
3917 |
- ewarn "to ${new_MY_DATADIR}" |
3918 |
- MY_DATADIR="${new_MY_DATADIR}" |
3919 |
- fi |
3920 |
- fi |
3921 |
- fi |
3922 |
- |
3923 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
3924 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
3925 |
- export MY_DATADIR |
3926 |
-} |
3927 |
- |
3928 |
-pkg_config() { |
3929 |
- _getoptval() { |
3930 |
- local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults |
3931 |
- local section="$1" |
3932 |
- local flag="--${2}=" |
3933 |
- local extra_options="${3}" |
3934 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
3935 |
- } |
3936 |
- local old_MY_DATADIR="${MY_DATADIR}" |
3937 |
- local old_HOME="${HOME}" |
3938 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
3939 |
- export HOME=${EPREFIX}/root |
3940 |
- |
3941 |
- # Make sure the vars are correctly initialized |
3942 |
- mysql_init_vars |
3943 |
- |
3944 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
3945 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
3946 |
- die "Minimal builds do NOT include the MySQL server" |
3947 |
- fi |
3948 |
- |
3949 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
3950 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
3951 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
3952 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
3953 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
3954 |
- |
3955 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
3956 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
3957 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
3958 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
3959 |
- else |
3960 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
3961 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
3962 |
- || die "Moving MY_DATADIR failed" |
3963 |
- fi |
3964 |
- else |
3965 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
3966 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
3967 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
3968 |
- else |
3969 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
3970 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
3971 |
- fi |
3972 |
- fi |
3973 |
- fi |
3974 |
- |
3975 |
- local pwd1="a" |
3976 |
- local pwd2="b" |
3977 |
- local maxtry=15 |
3978 |
- |
3979 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
3980 |
- local tmp_mysqld_password_source= |
3981 |
- |
3982 |
- for tmp_mysqld_password_source in mysql client; do |
3983 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
3984 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
3985 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
3986 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
3987 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
3988 |
- MYSQL_ROOT_PASSWORD= |
3989 |
- continue |
3990 |
- fi |
3991 |
- |
3992 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
3993 |
- break |
3994 |
- fi |
3995 |
- done |
3996 |
- |
3997 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
3998 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
3999 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
4000 |
- fi |
4001 |
- |
4002 |
- unset tmp_mysqld_password_source |
4003 |
- fi |
4004 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" |
4005 |
- # These are dir+prefix |
4006 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" |
4007 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
4008 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" |
4009 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
4010 |
- |
4011 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
4012 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
4013 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
4014 |
- fi |
4015 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
4016 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
4017 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
4018 |
- fi |
4019 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
4020 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
4021 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
4022 |
- fi |
4023 |
- |
4024 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
4025 |
- ewarn "You have already a MySQL database in place." |
4026 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
4027 |
- ewarn "Please rename or delete it if you wish to replace it." |
4028 |
- die "MySQL database already exists!" |
4029 |
- fi |
4030 |
- |
4031 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
4032 |
- # localhost. Also causes weird failures. |
4033 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
4034 |
- |
4035 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
4036 |
- |
4037 |
- einfo "Please provide a password for the mysql 'root' user now" |
4038 |
- einfo "or through the ${HOME}/.my.cnf file." |
4039 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
4040 |
- read -rsp " >" pwd1 ; echo |
4041 |
- |
4042 |
- einfo "Retype the password" |
4043 |
- read -rsp " >" pwd2 ; echo |
4044 |
- |
4045 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
4046 |
- die "Passwords are not the same" |
4047 |
- fi |
4048 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
4049 |
- unset pwd1 pwd2 |
4050 |
- fi |
4051 |
- |
4052 |
- local options |
4053 |
- local sqltmp="$(emktemp)" |
4054 |
- |
4055 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
4056 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
4057 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
4058 |
- |
4059 |
- # Figure out which options we need to disable to do the setup |
4060 |
- local helpfile="${TMPDIR}/mysqld-help" |
4061 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
4062 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
4063 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
4064 |
- log-slave-updates \ |
4065 |
- ; do |
4066 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
4067 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
4068 |
- done |
4069 |
- |
4070 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
4071 |
- |
4072 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
4073 |
- PID_DIR="${EROOT}/var/run/mysqld" |
4074 |
- if [[ ! -d "${PID_DIR}" ]]; then |
4075 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
4076 |
- fi |
4077 |
- |
4078 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
4079 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
4080 |
- fi |
4081 |
- |
4082 |
- pushd "${TMPDIR}" &>/dev/null || die |
4083 |
- |
4084 |
- # Filling timezones, see |
4085 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
4086 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
4087 |
- |
4088 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
4089 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
4090 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
4091 |
- einfo "Command: ${cmd[*]}" |
4092 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
4093 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
4094 |
- if [ $? -ne 0 ]; then |
4095 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
4096 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
4097 |
- fi |
4098 |
- popd &>/dev/null || die |
4099 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
4100 |
- || die "MySQL databases not installed" |
4101 |
- |
4102 |
- use prefix || options="${options} --user=mysql" |
4103 |
- |
4104 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
4105 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
4106 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
4107 |
- ${options} \ |
4108 |
- --log-warnings=0 \ |
4109 |
- --basedir=${EROOT}/usr \ |
4110 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
4111 |
- --max_allowed_packet=8M \ |
4112 |
- --net_buffer_length=16K \ |
4113 |
- --socket=${socket} \ |
4114 |
- --pid-file=${pidfile} \ |
4115 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
4116 |
- #einfo "About to start mysqld: ${mysqld}" |
4117 |
- ebegin "Starting mysqld" |
4118 |
- einfo "Command ${mysqld}" |
4119 |
- ${mysqld} & |
4120 |
- rc=$? |
4121 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
4122 |
- maxtry=$((${maxtry}-1)) |
4123 |
- echo -n "." |
4124 |
- sleep 1 |
4125 |
- done |
4126 |
- eend $rc |
4127 |
- |
4128 |
- if ! [[ -S "${socket}" ]]; then |
4129 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
4130 |
- fi |
4131 |
- |
4132 |
- ebegin "Setting root password" |
4133 |
- # Do this from memory, as we don't want clear text passwords in temp files |
4134 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
4135 |
- "${EROOT}/usr/bin/mysql" \ |
4136 |
- "--socket=${socket}" \ |
4137 |
- -hlocalhost \ |
4138 |
- -e "${sql}" |
4139 |
- eend $? |
4140 |
- |
4141 |
- if [[ -n "${sqltmp}" ]] ; then |
4142 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
4143 |
- "${EROOT}/usr/bin/mysql" \ |
4144 |
- "--socket=${socket}" \ |
4145 |
- -hlocalhost \ |
4146 |
- -uroot \ |
4147 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
4148 |
- mysql < "${sqltmp}" |
4149 |
- rc=$? |
4150 |
- eend $? |
4151 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
4152 |
- fi |
4153 |
- |
4154 |
- # Stop the server and cleanup |
4155 |
- einfo "Stopping the server ..." |
4156 |
- kill $(< "${pidfile}" ) |
4157 |
- rm -f "${sqltmp}" |
4158 |
- wait %1 |
4159 |
- einfo "Done" |
4160 |
-} |
4161 |
|
4162 |
diff --git a/dev-db/mariadb/mariadb-10.3.18.ebuild b/dev-db/mariadb/mariadb-10.3.18.ebuild |
4163 |
deleted file mode 100644 |
4164 |
index 006bc9c2577..00000000000 |
4165 |
--- a/dev-db/mariadb/mariadb-10.3.18.ebuild |
4166 |
+++ /dev/null |
4167 |
@@ -1,981 +0,0 @@ |
4168 |
-# Copyright 1999-2019 Gentoo Authors |
4169 |
-# Distributed under the terms of the GNU General Public License v2 |
4170 |
- |
4171 |
-EAPI="6" |
4172 |
-MY_EXTRAS_VER="20190305-2052Z" |
4173 |
-SUBSLOT="18" |
4174 |
- |
4175 |
-JAVA_PKG_OPT_USE="jdbc" |
4176 |
- |
4177 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
4178 |
- |
4179 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
4180 |
- java-pkg-opt-2 user cmake-utils |
4181 |
- |
4182 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
4183 |
- |
4184 |
-# Gentoo patches to MySQL |
4185 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
4186 |
- SRC_URI="${SRC_URI} |
4187 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
4188 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
4189 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
4190 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
4191 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
4192 |
-fi |
4193 |
- |
4194 |
-HOMEPAGE="https://mariadb.org/" |
4195 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
4196 |
-LICENSE="GPL-2 LGPL-2.1+" |
4197 |
-SLOT="0/${SUBSLOT:-0}" |
4198 |
-IUSE="+backup bindist client-libs cracklib debug extraengine galera innodb-lz4 |
4199 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
4200 |
- numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
4201 |
- sst-rsync sst-mariabackup static systemd systemtap tcmalloc |
4202 |
- test tokudb xml yassl" |
4203 |
- |
4204 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
4205 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
4206 |
- |
4207 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
4208 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
4209 |
- ?? ( tcmalloc jemalloc ) |
4210 |
- static? ( yassl !pam )" |
4211 |
- |
4212 |
-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" |
4213 |
- |
4214 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
4215 |
-# and we will run a mysql server during test phase |
4216 |
-S="${WORKDIR}/mysql" |
4217 |
- |
4218 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
4219 |
- inherit git-r3 |
4220 |
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" |
4221 |
- EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
4222 |
- EGIT_CLONE_TYPE=shallow |
4223 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
4224 |
-else |
4225 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
4226 |
-fi |
4227 |
- |
4228 |
-PATCHES=( |
4229 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
4230 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.3.12-without-clientlibs-tools.patch |
4231 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
4232 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
4233 |
- "${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch |
4234 |
-) |
4235 |
- |
4236 |
-# Be warned, *DEPEND are version-dependant |
4237 |
-# These are used for both runtime and compiletime |
4238 |
-COMMON_DEPEND=" |
4239 |
- kernel_linux? ( |
4240 |
- sys-process/procps:0= |
4241 |
- dev-libs/libaio:0= |
4242 |
- ) |
4243 |
- >=sys-apps/sed-4 |
4244 |
- >=sys-apps/texinfo-4.7-r1 |
4245 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
4246 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
4247 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
4248 |
- >=sys-libs/zlib-1.2.3:0= |
4249 |
- kerberos? ( virtual/krb5 ) |
4250 |
- yassl? ( net-libs/gnutls:0= ) |
4251 |
- !yassl? ( |
4252 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
4253 |
- libressl? ( dev-libs/libressl:0= ) |
4254 |
- ) |
4255 |
- sys-libs/ncurses:0= |
4256 |
- !bindist? ( |
4257 |
- sys-libs/binutils-libs:0= |
4258 |
- >=sys-libs/readline-4.1:0= |
4259 |
- ) |
4260 |
- server? ( |
4261 |
- backup? ( app-arch/libarchive:0= ) |
4262 |
- cracklib? ( sys-libs/cracklib:0= ) |
4263 |
- extraengine? ( |
4264 |
- odbc? ( dev-db/unixODBC:0= ) |
4265 |
- xml? ( dev-libs/libxml2:2= ) |
4266 |
- ) |
4267 |
- innodb-lz4? ( app-arch/lz4 ) |
4268 |
- innodb-lzo? ( dev-libs/lzo ) |
4269 |
- innodb-snappy? ( app-arch/snappy ) |
4270 |
- mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
4271 |
- numa? ( sys-process/numactl ) |
4272 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
4273 |
- pam? ( sys-libs/pam:0= ) |
4274 |
- systemd? ( sys-apps/systemd:= ) |
4275 |
- tokudb? ( app-arch/snappy ) |
4276 |
- ) |
4277 |
- >=dev-libs/libpcre-8.41-r1:3= |
4278 |
-" |
4279 |
-DEPEND="virtual/yacc |
4280 |
- static? ( sys-libs/ncurses[static-libs] ) |
4281 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
4282 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) ) |
4283 |
- ${COMMON_DEPEND}" |
4284 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
4285 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
4286 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
4287 |
- !<virtual/mysql-5.6-r11 |
4288 |
- ${COMMON_DEPEND} |
4289 |
- server? ( galera? ( |
4290 |
- sys-apps/iproute2 |
4291 |
- =sys-cluster/galera-25* |
4292 |
- sst-rsync? ( sys-process/lsof ) |
4293 |
- sst-mariabackup? ( net-misc/socat[ssl] ) |
4294 |
- ) ) |
4295 |
- perl? ( !dev-db/mytop |
4296 |
- virtual/perl-Getopt-Long |
4297 |
- dev-perl/TermReadKey |
4298 |
- virtual/perl-Term-ANSIColor |
4299 |
- virtual/perl-Time-HiRes ) |
4300 |
- server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) ) |
4301 |
-" |
4302 |
-# For other stuff to bring us in |
4303 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
4304 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
4305 |
- server? ( ~virtual/mysql-5.6[static=] )" |
4306 |
- |
4307 |
-pkg_setup() { |
4308 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
4309 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
4310 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
4311 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
4312 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
4313 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
4314 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
4315 |
- die |
4316 |
- fi |
4317 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
4318 |
- # non x86{,_64} arches |
4319 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
4320 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
4321 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
4322 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
4323 |
- die |
4324 |
- fi |
4325 |
- fi |
4326 |
- java-pkg-opt-2_pkg_setup |
4327 |
- if has test ${FEATURES} && \ |
4328 |
- use server && ! has userpriv ${FEATURES} ; then |
4329 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
4330 |
- fi |
4331 |
- |
4332 |
- # This should come after all of the die statements |
4333 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
4334 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
4335 |
-} |
4336 |
- |
4337 |
-pkg_preinst() { |
4338 |
- java-pkg-opt-2_pkg_preinst |
4339 |
- |
4340 |
- # Here we need to see if the implementation switched client libraries |
4341 |
- # We check if this is a new instance of the package and a client library already exists |
4342 |
- local SHOW_ABI_MESSAGE libpath |
4343 |
- if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then |
4344 |
- libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so") |
4345 |
- elog "Due to ABI changes when switching between different client libraries," |
4346 |
- elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient." |
4347 |
- elog "Please run: revdep-rebuild --library ${libpath}" |
4348 |
- ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries" |
4349 |
- fi |
4350 |
-} |
4351 |
- |
4352 |
-pkg_postinst() { |
4353 |
- # Make sure the vars are correctly initialized |
4354 |
- mysql_init_vars |
4355 |
- |
4356 |
- # Create log directory securely if it does not exist |
4357 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
4358 |
- |
4359 |
- if use server ; then |
4360 |
- if use pam; then |
4361 |
- einfo |
4362 |
- elog "This install includes the PAM authentication plugin." |
4363 |
- elog "To activate and configure the PAM plugin, please read:" |
4364 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
4365 |
- einfo |
4366 |
- fi |
4367 |
- |
4368 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
4369 |
- einfo |
4370 |
- elog "You might want to run:" |
4371 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
4372 |
- elog "if this is a new install." |
4373 |
- elog |
4374 |
- elog "If you are switching server implentations, you should run the" |
4375 |
- elog "mysql_upgrade tool." |
4376 |
- einfo |
4377 |
- else |
4378 |
- einfo |
4379 |
- elog "If you are upgrading major versions, you should run the" |
4380 |
- elog "mysql_upgrade tool." |
4381 |
- einfo |
4382 |
- fi |
4383 |
- |
4384 |
- if use galera ; then |
4385 |
- einfo |
4386 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
4387 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
4388 |
- elog "The first time the cluster is activated, you should add" |
4389 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
4390 |
- elog "This option should then be removed for subsequent starts." |
4391 |
- einfo |
4392 |
- fi |
4393 |
- fi |
4394 |
- |
4395 |
- # Note about configuration change |
4396 |
- einfo |
4397 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
4398 |
- elog "to several files in /etc/mysql/${PN}.d." |
4399 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
4400 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
4401 |
- elog "You may have as many files as needed and they are read alphabetically." |
4402 |
- elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." |
4403 |
- einfo |
4404 |
-} |
4405 |
- |
4406 |
-src_unpack() { |
4407 |
- unpack ${A} |
4408 |
- # Grab the patches |
4409 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack |
4410 |
- |
4411 |
- mv -f "${WORKDIR}/${P/_rc/}" "${S}" || die |
4412 |
-} |
4413 |
- |
4414 |
-src_prepare() { |
4415 |
- _disable_plugin() { |
4416 |
- echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
4417 |
- } |
4418 |
- _disable_engine() { |
4419 |
- echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
4420 |
- } |
4421 |
- |
4422 |
- if use jemalloc; then |
4423 |
- echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" |
4424 |
- elif use tcmalloc; then |
4425 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
4426 |
- fi |
4427 |
- |
4428 |
- # Don't build bundled xz-utils for tokudb |
4429 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
4430 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
4431 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
4432 |
- |
4433 |
- local plugin |
4434 |
- local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
4435 |
- locale_info qc_info server_audit sql_errlog auth_ed25519 ) |
4436 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext |
4437 |
- debug_key_management example_key_management versioning ) |
4438 |
- if ! use server; then # These plugins are for the server |
4439 |
- for plugin in "${server_plugins[@]}" ; do |
4440 |
- _disable_plugin "${plugin}" |
4441 |
- done |
4442 |
- fi |
4443 |
- |
4444 |
- if ! use test; then # These plugins are only used during testing |
4445 |
- for plugin in "${test_plugins[@]}" ; do |
4446 |
- _disable_plugin "${plugin}" |
4447 |
- done |
4448 |
- _disable_engine test_sql_discovery |
4449 |
- fi |
4450 |
- |
4451 |
- _disable_engine example |
4452 |
- |
4453 |
- if ! use oqgraph ; then # avoids extra library checks |
4454 |
- _disable_engine oqgraph |
4455 |
- fi |
4456 |
- |
4457 |
- if use mroonga ; then |
4458 |
- # Remove the bundled groonga |
4459 |
- # There is no CMake flag, it simply checks for existance |
4460 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
4461 |
- else |
4462 |
- _disable_engine mroonga |
4463 |
- fi |
4464 |
- |
4465 |
- # Don't clash with dev-db/mysql-connector-c |
4466 |
- sed -i -e 's/ my_print_defaults.1//' \ |
4467 |
- -e 's/ perror.1//' \ |
4468 |
- "${S}"/man/CMakeLists.txt || die |
4469 |
- |
4470 |
- cmake-utils_src_prepare |
4471 |
- java-pkg-opt-2_src_prepare |
4472 |
-} |
4473 |
- |
4474 |
-src_configure(){ |
4475 |
- # bug 508724 mariadb cannot use ld.gold |
4476 |
- tc-ld-disable-gold |
4477 |
- # Bug #114895, bug #110149 |
4478 |
- filter-flags "-O" "-O[01]" |
4479 |
- |
4480 |
- append-cxxflags -felide-constructors |
4481 |
- |
4482 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
4483 |
- append-flags -fno-strict-aliasing |
4484 |
- |
4485 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
4486 |
- |
4487 |
- # debug hack wrt #497532 |
4488 |
- mycmakeargs=( |
4489 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
4490 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
4491 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
4492 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
4493 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
4494 |
- -DINSTALL_BINDIR=bin |
4495 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
4496 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
4497 |
- -DINSTALL_INCLUDEDIR=include/mysql |
4498 |
- -DINSTALL_INFODIR=share/info |
4499 |
- -DINSTALL_LIBDIR=$(get_libdir) |
4500 |
- -DINSTALL_MANDIR=share/man |
4501 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
4502 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
4503 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
4504 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
4505 |
- -DINSTALL_SBINDIR=sbin |
4506 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
4507 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
4508 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
4509 |
- -DWITH_LIBEDIT=0 |
4510 |
- -DWITH_ZLIB=system |
4511 |
- -DWITHOUT_LIBWRAP=1 |
4512 |
- -DENABLED_LOCAL_INFILE=1 |
4513 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
4514 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
4515 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
4516 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
4517 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
4518 |
- # The build forces this to be defined when cross-compiling. We pass it |
4519 |
- # all the time for simplicity and to make sure it is actually correct. |
4520 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
4521 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
4522 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
4523 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
4524 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
4525 |
- -DWITH_EXTERNAL_ZLIB=YES |
4526 |
- -DSUFFIX_INSTALL_DIR="" |
4527 |
- -DWITH_UNITTEST=OFF |
4528 |
- -DWITHOUT_CLIENTLIBS=YES |
4529 |
- -DCLIENT_PLUGIN_DIALOG=OFF |
4530 |
- -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF |
4531 |
- -DCLIENT_PLUGIN_CLIENT_ED25519=OFF |
4532 |
- -DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC |
4533 |
- -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF |
4534 |
- ) |
4535 |
- if use test ; then |
4536 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
4537 |
- else |
4538 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
4539 |
- fi |
4540 |
- |
4541 |
- if ! use yassl ; then |
4542 |
- mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC ) |
4543 |
- else |
4544 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
4545 |
- fi |
4546 |
- |
4547 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
4548 |
- mycmakeargs+=( |
4549 |
- -DWITH_READLINE=$(usex bindist 1 0) |
4550 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
4551 |
- -DENABLE_DTRACE=$(usex systemtap) |
4552 |
- ) |
4553 |
- |
4554 |
- if use server ; then |
4555 |
- |
4556 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
4557 |
- if ! use extraengine ; then |
4558 |
- mycmakeargs+=( |
4559 |
- -DPLUGIN_FEDERATED=NO |
4560 |
- -DPLUGIN_FEDERATEDX=NO ) |
4561 |
- fi |
4562 |
- |
4563 |
- mycmakeargs+=( |
4564 |
- -DWITH_PCRE=system |
4565 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
4566 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
4567 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
4568 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
4569 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
4570 |
- -DPLUGIN_CASSANDRA=NO |
4571 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
4572 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
4573 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
4574 |
- -DCONNECT_WITH_MYSQL=1 |
4575 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
4576 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
4577 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
4578 |
- # Build failure and autodep wrt bug 639144 |
4579 |
- -DCONNECT_WITH_MONGO=OFF |
4580 |
- -DWITH_WSREP=$(usex galera) |
4581 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
4582 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
4583 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
4584 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
4585 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
4586 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
4587 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
4588 |
- -DINSTALL_SQLBENCHDIR="" |
4589 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
4590 |
- # systemd is only linked to for server notification |
4591 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
4592 |
- -DWITH_NUMA=$(usex numa ON OFF) |
4593 |
- ) |
4594 |
- |
4595 |
- # Workaround for MDEV-14524 |
4596 |
- use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) |
4597 |
- |
4598 |
- if use test ; then |
4599 |
- # This is needed for the new client lib which tests a real, open server |
4600 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
4601 |
- fi |
4602 |
- |
4603 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
4604 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
4605 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
4606 |
- ewarn "You MUST file bugs without these variables set." |
4607 |
- |
4608 |
- mycmakeargs+=( |
4609 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
4610 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
4611 |
- ) |
4612 |
- |
4613 |
- elif ! use latin1 ; then |
4614 |
- mycmakeargs+=( |
4615 |
- -DDEFAULT_CHARSET=utf8 |
4616 |
- -DDEFAULT_COLLATION=utf8_general_ci |
4617 |
- ) |
4618 |
- else |
4619 |
- mycmakeargs+=( |
4620 |
- -DDEFAULT_CHARSET=latin1 |
4621 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
4622 |
- ) |
4623 |
- fi |
4624 |
- mycmakeargs+=( |
4625 |
- -DEXTRA_CHARSETS=all |
4626 |
- -DMYSQL_USER=mysql |
4627 |
- -DDISABLE_SHARED=$(usex static YES NO) |
4628 |
- -DWITH_DEBUG=$(usex debug) |
4629 |
- -DWITH_EMBEDDED_SERVER=OFF |
4630 |
- -DWITH_PROFILING=$(usex profiling) |
4631 |
- ) |
4632 |
- |
4633 |
- if use static; then |
4634 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
4635 |
- fi |
4636 |
- |
4637 |
- if use jemalloc || use tcmalloc ; then |
4638 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
4639 |
- fi |
4640 |
- |
4641 |
- # Storage engines |
4642 |
- mycmakeargs+=( |
4643 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
4644 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
4645 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
4646 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
4647 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
4648 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
4649 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
4650 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
4651 |
- ) |
4652 |
- |
4653 |
- else |
4654 |
- mycmakeargs+=( |
4655 |
- -DWITHOUT_SERVER=1 |
4656 |
- -DWITH_EMBEDDED_SERVER=OFF |
4657 |
- -DEXTRA_CHARSETS=none |
4658 |
- -DINSTALL_SQLBENCHDIR= |
4659 |
- -DWITH_SYSTEMD=no |
4660 |
- ) |
4661 |
- fi |
4662 |
- |
4663 |
- cmake-utils_src_configure |
4664 |
-} |
4665 |
- |
4666 |
-src_compile() { |
4667 |
- cmake-utils_src_compile |
4668 |
-} |
4669 |
- |
4670 |
-src_install() { |
4671 |
- cmake-utils_src_install |
4672 |
- |
4673 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
4674 |
- if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
4675 |
- rm "${ED}/usr/include/mysql/server/private/config.h" || die |
4676 |
- fi |
4677 |
- |
4678 |
- # Make sure the vars are correctly initialized |
4679 |
- mysql_init_vars |
4680 |
- |
4681 |
- # Convenience links |
4682 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
4683 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
4684 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
4685 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
4686 |
- |
4687 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
4688 |
- if [[ -d "${ED}/usr/data" ]] ; then |
4689 |
- rm -Rf "${ED}/usr/data" || die |
4690 |
- fi |
4691 |
- |
4692 |
- # Unless they explicitly specific USE=test, then do not install the |
4693 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
4694 |
- # validation of your database configuration after tuning it. |
4695 |
- if ! use test ; then |
4696 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
4697 |
- fi |
4698 |
- |
4699 |
- # Configuration stuff |
4700 |
- einfo "Building default configuration ..." |
4701 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
4702 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
4703 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
4704 |
- eprefixify "${TMPDIR}/my.cnf" |
4705 |
- doins "${TMPDIR}/my.cnf" |
4706 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
4707 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
4708 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
4709 |
- doins "${TMPDIR}/50-distro-client.cnf" |
4710 |
- |
4711 |
- if use server ; then |
4712 |
- mycnf_src="my.cnf.distro-server" |
4713 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
4714 |
- "${FILESDIR}/${mycnf_src}" \ |
4715 |
- > "${TMPDIR}/my.cnf.ok" || die |
4716 |
- if use prefix ; then |
4717 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
4718 |
- "${TMPDIR}/my.cnf.ok" || die |
4719 |
- fi |
4720 |
- if use latin1 ; then |
4721 |
- sed -i \ |
4722 |
- -e "/character-set/s|utf8|latin1|g" \ |
4723 |
- "${TMPDIR}/my.cnf.ok" || die |
4724 |
- fi |
4725 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
4726 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
4727 |
- |
4728 |
- einfo "Including support files and sample configurations" |
4729 |
- docinto "support-files" |
4730 |
- local script |
4731 |
- for script in \ |
4732 |
- "${S}"/support-files/magic |
4733 |
- do |
4734 |
- [[ -f "$script" ]] && dodoc "${script}" |
4735 |
- done |
4736 |
- |
4737 |
- docinto "scripts" |
4738 |
- for script in "${S}"/scripts/mysql* ; do |
4739 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
4740 |
- done |
4741 |
- # Manually install supporting files that conflict with other packages |
4742 |
- # but are needed for galera and initial installation |
4743 |
- exeinto /usr/libexec/mariadb |
4744 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
4745 |
- fi |
4746 |
- |
4747 |
- # Remove mytop if perl is not selected |
4748 |
- if [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl ; then |
4749 |
- rm -f "${ED}/usr/bin/mytop" || die |
4750 |
- fi |
4751 |
- |
4752 |
- # Fix a dangling symlink when galera is not built |
4753 |
- if [[ -L "${ED}/usr/bin/wsrep_sst_rsync_wan" ]] && ! use galera ; then |
4754 |
- rm "${ED}/usr/bin/wsrep_sst_rsync_wan" || die |
4755 |
- fi |
4756 |
- |
4757 |
- # Remove broken SST scripts that are incompatible |
4758 |
- local scriptremove |
4759 |
- for scriptremove in wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2 ; do |
4760 |
- if [[ -e "${ED}/usr/bin/${scriptremove}" ]] ; then |
4761 |
- rm "${ED}/usr/bin/${scriptremove}" || die |
4762 |
- fi |
4763 |
- done |
4764 |
-} |
4765 |
- |
4766 |
-# Official test instructions: |
4767 |
-# USE='extraengine perl server' \ |
4768 |
-# FEATURES='test userpriv -usersandbox' \ |
4769 |
-# ebuild mariadb-X.X.XX.ebuild \ |
4770 |
-# digest clean package |
4771 |
-src_test() { |
4772 |
- |
4773 |
- _disable_test() { |
4774 |
- local rawtestname reason |
4775 |
- rawtestname="${1}" ; shift |
4776 |
- reason="${@}" |
4777 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
4778 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
4779 |
- } |
4780 |
- |
4781 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
4782 |
- local retstatus_unit |
4783 |
- local retstatus_tests |
4784 |
- |
4785 |
- if ! use server ; then |
4786 |
- einfo "Skipping server tests due to minimal build." |
4787 |
- return 0 |
4788 |
- fi |
4789 |
- |
4790 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
4791 |
- # localhost. Also causes weird failures. |
4792 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
4793 |
- |
4794 |
- if [[ $UID -eq 0 ]]; then |
4795 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
4796 |
- fi |
4797 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
4798 |
- |
4799 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
4800 |
- |
4801 |
- # Run CTest (test-units) |
4802 |
- cmake-utils_src_test |
4803 |
- retstatus_unit=$? |
4804 |
- |
4805 |
- # Ensure that parallel runs don't die |
4806 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
4807 |
- # Enable parallel testing, auto will try to detect number of cores |
4808 |
- # You may set this by hand. |
4809 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
4810 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
4811 |
- |
4812 |
- # create directories because mysqladmin might run out of order |
4813 |
- mkdir -p "${T}"/var-tests{,/log} || die |
4814 |
- |
4815 |
- # Run mysql tests |
4816 |
- pushd "${TESTDIR}" > /dev/null || die |
4817 |
- |
4818 |
- touch "${T}/disabled.def" |
4819 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
4820 |
- # false positives: |
4821 |
- # |
4822 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
4823 |
- # main.mysql_client_test_comp: |
4824 |
- # segfaults at random under Portage only, suspect resource limits. |
4825 |
- |
4826 |
- local t |
4827 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
4828 |
- _disable_test "$t" "False positive due to varying policies" |
4829 |
- done |
4830 |
- |
4831 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
4832 |
- main.mysql main.gis_notembedded \ |
4833 |
- main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
4834 |
- _disable_test "$t" "False positives in Gentoo" |
4835 |
- done |
4836 |
- |
4837 |
- _disable_test main.plugin_auth "Needs client libraries built" |
4838 |
- _disable_test plugins.auth_ed25519 "Needs client libraries built" |
4839 |
- |
4840 |
- _disable_test main.func_time "Dependent on time test was written" |
4841 |
- |
4842 |
- # run mysql-test tests |
4843 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
4844 |
- retstatus_tests=$? |
4845 |
- |
4846 |
- popd > /dev/null || die |
4847 |
- |
4848 |
- # Cleanup is important for these testcases. |
4849 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
4850 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
4851 |
- |
4852 |
- local failures="" |
4853 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
4854 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
4855 |
- |
4856 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
4857 |
- einfo "Tests successfully completed" |
4858 |
-} |
4859 |
- |
4860 |
-mysql_init_vars() { |
4861 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
4862 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
4863 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
4864 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
4865 |
- |
4866 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
4867 |
- MY_DATADIR="" |
4868 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
4869 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
4870 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
4871 |
- | tail -n1` |
4872 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
4873 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
4874 |
- | sed -e 's/.*=\s*//' \ |
4875 |
- | tail -n1` |
4876 |
- fi |
4877 |
- fi |
4878 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
4879 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
4880 |
- einfo "Using default MY_DATADIR" |
4881 |
- fi |
4882 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
4883 |
- |
4884 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
4885 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
4886 |
- # If you get this and you're wondering about it, see bug #207636 |
4887 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
4888 |
- elog "A new one will not be created." |
4889 |
- PREVIOUS_DATADIR="yes" |
4890 |
- else |
4891 |
- PREVIOUS_DATADIR="no" |
4892 |
- fi |
4893 |
- export PREVIOUS_DATADIR |
4894 |
- fi |
4895 |
- else |
4896 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
4897 |
- local new_MY_DATADIR |
4898 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
4899 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
4900 |
- | tail -n1` |
4901 |
- |
4902 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
4903 |
- ewarn "MySQL MY_DATADIR has changed" |
4904 |
- ewarn "from ${MY_DATADIR}" |
4905 |
- ewarn "to ${new_MY_DATADIR}" |
4906 |
- MY_DATADIR="${new_MY_DATADIR}" |
4907 |
- fi |
4908 |
- fi |
4909 |
- fi |
4910 |
- |
4911 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
4912 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
4913 |
- export MY_DATADIR |
4914 |
-} |
4915 |
- |
4916 |
-pkg_config() { |
4917 |
- _getoptval() { |
4918 |
- local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults |
4919 |
- local section="$1" |
4920 |
- local flag="--${2}=" |
4921 |
- local extra_options="${3}" |
4922 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
4923 |
- } |
4924 |
- local old_MY_DATADIR="${MY_DATADIR}" |
4925 |
- local old_HOME="${HOME}" |
4926 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
4927 |
- export HOME=${EPREFIX}/root |
4928 |
- |
4929 |
- # Make sure the vars are correctly initialized |
4930 |
- mysql_init_vars |
4931 |
- |
4932 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
4933 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
4934 |
- die "Minimal builds do NOT include the MySQL server" |
4935 |
- fi |
4936 |
- |
4937 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
4938 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
4939 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
4940 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
4941 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
4942 |
- |
4943 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
4944 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
4945 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
4946 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
4947 |
- else |
4948 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
4949 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
4950 |
- || die "Moving MY_DATADIR failed" |
4951 |
- fi |
4952 |
- else |
4953 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
4954 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
4955 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
4956 |
- else |
4957 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
4958 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
4959 |
- fi |
4960 |
- fi |
4961 |
- fi |
4962 |
- |
4963 |
- local pwd1="a" |
4964 |
- local pwd2="b" |
4965 |
- local maxtry=15 |
4966 |
- |
4967 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
4968 |
- local tmp_mysqld_password_source= |
4969 |
- |
4970 |
- for tmp_mysqld_password_source in mysql client; do |
4971 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
4972 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
4973 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
4974 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
4975 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
4976 |
- MYSQL_ROOT_PASSWORD= |
4977 |
- continue |
4978 |
- fi |
4979 |
- |
4980 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
4981 |
- break |
4982 |
- fi |
4983 |
- done |
4984 |
- |
4985 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
4986 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
4987 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
4988 |
- fi |
4989 |
- |
4990 |
- unset tmp_mysqld_password_source |
4991 |
- fi |
4992 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" |
4993 |
- # These are dir+prefix |
4994 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" |
4995 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
4996 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" |
4997 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
4998 |
- |
4999 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
5000 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
5001 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
5002 |
- fi |
5003 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
5004 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
5005 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
5006 |
- fi |
5007 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
5008 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
5009 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
5010 |
- fi |
5011 |
- |
5012 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
5013 |
- ewarn "You have already a MySQL database in place." |
5014 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
5015 |
- ewarn "Please rename or delete it if you wish to replace it." |
5016 |
- die "MySQL database already exists!" |
5017 |
- fi |
5018 |
- |
5019 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
5020 |
- # localhost. Also causes weird failures. |
5021 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
5022 |
- |
5023 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
5024 |
- |
5025 |
- einfo "Please provide a password for the mysql 'root' user now" |
5026 |
- einfo "or through the ${HOME}/.my.cnf file." |
5027 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
5028 |
- read -rsp " >" pwd1 ; echo |
5029 |
- |
5030 |
- einfo "Retype the password" |
5031 |
- read -rsp " >" pwd2 ; echo |
5032 |
- |
5033 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
5034 |
- die "Passwords are not the same" |
5035 |
- fi |
5036 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
5037 |
- unset pwd1 pwd2 |
5038 |
- fi |
5039 |
- |
5040 |
- local options |
5041 |
- local sqltmp="$(emktemp)" |
5042 |
- |
5043 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
5044 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
5045 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
5046 |
- |
5047 |
- # Figure out which options we need to disable to do the setup |
5048 |
- local helpfile="${TMPDIR}/mysqld-help" |
5049 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
5050 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
5051 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
5052 |
- log-slave-updates \ |
5053 |
- ; do |
5054 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
5055 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
5056 |
- done |
5057 |
- |
5058 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
5059 |
- |
5060 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
5061 |
- PID_DIR="${EROOT}/var/run/mysqld" |
5062 |
- if [[ ! -d "${PID_DIR}" ]]; then |
5063 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
5064 |
- fi |
5065 |
- |
5066 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
5067 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
5068 |
- fi |
5069 |
- |
5070 |
- pushd "${TMPDIR}" &>/dev/null || die |
5071 |
- |
5072 |
- # Filling timezones, see |
5073 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
5074 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
5075 |
- |
5076 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
5077 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
5078 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
5079 |
- einfo "Command: ${cmd[*]}" |
5080 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
5081 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
5082 |
- if [ $? -ne 0 ]; then |
5083 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
5084 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
5085 |
- fi |
5086 |
- popd &>/dev/null || die |
5087 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
5088 |
- || die "MySQL databases not installed" |
5089 |
- |
5090 |
- use prefix || options="${options} --user=mysql" |
5091 |
- |
5092 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
5093 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
5094 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
5095 |
- ${options} \ |
5096 |
- --log-warnings=0 \ |
5097 |
- --basedir=${EROOT}/usr \ |
5098 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
5099 |
- --max_allowed_packet=8M \ |
5100 |
- --net_buffer_length=16K \ |
5101 |
- --socket=${socket} \ |
5102 |
- --pid-file=${pidfile} \ |
5103 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
5104 |
- #einfo "About to start mysqld: ${mysqld}" |
5105 |
- ebegin "Starting mysqld" |
5106 |
- einfo "Command ${mysqld}" |
5107 |
- ${mysqld} & |
5108 |
- rc=$? |
5109 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
5110 |
- maxtry=$((${maxtry}-1)) |
5111 |
- echo -n "." |
5112 |
- sleep 1 |
5113 |
- done |
5114 |
- eend $rc |
5115 |
- |
5116 |
- if ! [[ -S "${socket}" ]]; then |
5117 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
5118 |
- fi |
5119 |
- |
5120 |
- ebegin "Setting root password" |
5121 |
- # Do this from memory, as we don't want clear text passwords in temp files |
5122 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
5123 |
- "${EROOT}/usr/bin/mysql" \ |
5124 |
- "--socket=${socket}" \ |
5125 |
- -hlocalhost \ |
5126 |
- -e "${sql}" |
5127 |
- eend $? |
5128 |
- |
5129 |
- if [[ -n "${sqltmp}" ]] ; then |
5130 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
5131 |
- "${EROOT}/usr/bin/mysql" \ |
5132 |
- "--socket=${socket}" \ |
5133 |
- -hlocalhost \ |
5134 |
- -uroot \ |
5135 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
5136 |
- mysql < "${sqltmp}" |
5137 |
- rc=$? |
5138 |
- eend $? |
5139 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
5140 |
- fi |
5141 |
- |
5142 |
- # Stop the server and cleanup |
5143 |
- einfo "Stopping the server ..." |
5144 |
- kill $(< "${pidfile}" ) |
5145 |
- rm -f "${sqltmp}" |
5146 |
- wait %1 |
5147 |
- einfo "Done" |
5148 |
-} |
5149 |
|
5150 |
diff --git a/dev-db/mariadb/mariadb-10.4.7-r1.ebuild b/dev-db/mariadb/mariadb-10.4.7-r1.ebuild |
5151 |
deleted file mode 100644 |
5152 |
index d714c80f9eb..00000000000 |
5153 |
--- a/dev-db/mariadb/mariadb-10.4.7-r1.ebuild |
5154 |
+++ /dev/null |
5155 |
@@ -1,1010 +0,0 @@ |
5156 |
-# Copyright 1999-2019 Gentoo Authors |
5157 |
-# Distributed under the terms of the GNU General Public License v2 |
5158 |
- |
5159 |
-EAPI="7" |
5160 |
-MY_EXTRAS_VER="20190731-2258Z" |
5161 |
-SUBSLOT="18" |
5162 |
- |
5163 |
-JAVA_PKG_OPT_USE="jdbc" |
5164 |
- |
5165 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
5166 |
- java-pkg-opt-2 cmake-utils |
5167 |
- |
5168 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
5169 |
- |
5170 |
-# Gentoo patches to MySQL |
5171 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
5172 |
- SRC_URI="${SRC_URI} |
5173 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
5174 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
5175 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
5176 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
5177 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
5178 |
-fi |
5179 |
- |
5180 |
-HOMEPAGE="https://mariadb.org/" |
5181 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
5182 |
-LICENSE="GPL-2 LGPL-2.1+" |
5183 |
-SLOT="0/${SUBSLOT:-0}" |
5184 |
-IUSE="+backup bindist cracklib debug extraengine galera innodb-lz4 |
5185 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
5186 |
- numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
5187 |
- sst-rsync sst-mariabackup static systemd systemtap tcmalloc |
5188 |
- test tokudb xml yassl" |
5189 |
- |
5190 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
5191 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
5192 |
- |
5193 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
5194 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
5195 |
- ?? ( tcmalloc jemalloc ) |
5196 |
- static? ( yassl !pam )" |
5197 |
- |
5198 |
-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" |
5199 |
- |
5200 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
5201 |
-# and we will run a mysql server during test phase |
5202 |
-S="${WORKDIR}/mysql" |
5203 |
- |
5204 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
5205 |
- inherit git-r3 |
5206 |
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" |
5207 |
- EGIT_CHECKOUT_DIR="${WORKDIR}/mysql-extras" |
5208 |
- EGIT_CLONE_TYPE=shallow |
5209 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras" |
5210 |
-else |
5211 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" |
5212 |
-fi |
5213 |
- |
5214 |
-PATCHES=( |
5215 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
5216 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.4.5-without-clientlibs-tools.patch |
5217 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
5218 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
5219 |
- "${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch |
5220 |
- "${FILESDIR}/MDEV-20247-replication-10.2.patch" |
5221 |
-) |
5222 |
- |
5223 |
-# Be warned, *DEPEND are version-dependant |
5224 |
-# These are used for both runtime and compiletime |
5225 |
-COMMON_DEPEND=" |
5226 |
- kernel_linux? ( |
5227 |
- sys-process/procps:0= |
5228 |
- dev-libs/libaio:0= |
5229 |
- ) |
5230 |
- >=sys-apps/sed-4 |
5231 |
- >=sys-apps/texinfo-4.7-r1 |
5232 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
5233 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
5234 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
5235 |
- >=sys-libs/zlib-1.2.3:0= |
5236 |
- kerberos? ( virtual/krb5 ) |
5237 |
- yassl? ( net-libs/gnutls:0= ) |
5238 |
- !yassl? ( |
5239 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
5240 |
- libressl? ( dev-libs/libressl:0= ) |
5241 |
- ) |
5242 |
- sys-libs/ncurses:0= |
5243 |
- !bindist? ( |
5244 |
- sys-libs/binutils-libs:0= |
5245 |
- >=sys-libs/readline-4.1:0= |
5246 |
- ) |
5247 |
- server? ( |
5248 |
- backup? ( app-arch/libarchive:0= ) |
5249 |
- cracklib? ( sys-libs/cracklib:0= ) |
5250 |
- extraengine? ( |
5251 |
- odbc? ( dev-db/unixODBC:0= ) |
5252 |
- xml? ( dev-libs/libxml2:2= ) |
5253 |
- ) |
5254 |
- innodb-lz4? ( app-arch/lz4 ) |
5255 |
- innodb-lzo? ( dev-libs/lzo ) |
5256 |
- innodb-snappy? ( app-arch/snappy ) |
5257 |
- mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
5258 |
- numa? ( sys-process/numactl ) |
5259 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
5260 |
- pam? ( sys-libs/pam:0= ) |
5261 |
- systemd? ( sys-apps/systemd:= ) |
5262 |
- tokudb? ( app-arch/snappy ) |
5263 |
- ) |
5264 |
- >=dev-libs/libpcre-8.41-r1:3= |
5265 |
-" |
5266 |
-BDEPEND="virtual/yacc |
5267 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
5268 |
-" |
5269 |
-DEPEND="static? ( sys-libs/ncurses[static-libs] ) |
5270 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) |
5271 |
- test? ( acct-group/mysql acct-user/mysql ) ) |
5272 |
- ${COMMON_DEPEND}" |
5273 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
5274 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
5275 |
- !<virtual/mysql-5.6-r11 |
5276 |
- !<virtual/libmysqlclient-18-r1 |
5277 |
- ${COMMON_DEPEND} |
5278 |
- server? ( |
5279 |
- galera? ( |
5280 |
- sys-apps/iproute2 |
5281 |
- =sys-cluster/galera-26* |
5282 |
- sst-rsync? ( sys-process/lsof ) |
5283 |
- sst-mariabackup? ( net-misc/socat[ssl] ) |
5284 |
- ) |
5285 |
- !prefix? ( dev-db/mysql-init-scripts acct-group/mysql acct-user/mysql ) |
5286 |
- extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) |
5287 |
- ) |
5288 |
- perl? ( !dev-db/mytop |
5289 |
- virtual/perl-Getopt-Long |
5290 |
- dev-perl/TermReadKey |
5291 |
- virtual/perl-Term-ANSIColor |
5292 |
- virtual/perl-Time-HiRes ) |
5293 |
-" |
5294 |
-# For other stuff to bring us in |
5295 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
5296 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
5297 |
- server? ( ~virtual/mysql-5.6[static=] )" |
5298 |
- |
5299 |
-pkg_setup() { |
5300 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
5301 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
5302 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
5303 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
5304 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
5305 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
5306 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
5307 |
- die |
5308 |
- fi |
5309 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
5310 |
- # non x86{,_64} arches |
5311 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
5312 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
5313 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
5314 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
5315 |
- die |
5316 |
- fi |
5317 |
- fi |
5318 |
- java-pkg-opt-2_pkg_setup |
5319 |
- if has test ${FEATURES} && \ |
5320 |
- use server && ! has userpriv ${FEATURES} ; then |
5321 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
5322 |
- fi |
5323 |
- |
5324 |
-} |
5325 |
- |
5326 |
-pkg_preinst() { |
5327 |
- java-pkg-opt-2_pkg_preinst |
5328 |
-} |
5329 |
- |
5330 |
-pkg_postinst() { |
5331 |
- # Make sure the vars are correctly initialized |
5332 |
- mysql_init_vars |
5333 |
- |
5334 |
- # Create log directory securely if it does not exist |
5335 |
- [[ -d "${ROOT}/${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}/${MY_LOGDIR}" |
5336 |
- |
5337 |
- if use server ; then |
5338 |
- if use pam; then |
5339 |
- einfo |
5340 |
- elog "This install includes the PAM authentication plugin." |
5341 |
- elog "To activate and configure the PAM plugin, please read:" |
5342 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
5343 |
- einfo |
5344 |
- chown mysql:mysql "${EROOT}/usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir" || die |
5345 |
- fi |
5346 |
- |
5347 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
5348 |
- einfo |
5349 |
- elog "You might want to run:" |
5350 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
5351 |
- elog "if this is a new install." |
5352 |
- elog |
5353 |
- elog "If you are switching server implentations, you should run the" |
5354 |
- elog "mysql_upgrade tool." |
5355 |
- einfo |
5356 |
- else |
5357 |
- einfo |
5358 |
- elog "If you are upgrading major versions, you should run the" |
5359 |
- elog "mysql_upgrade tool." |
5360 |
- einfo |
5361 |
- fi |
5362 |
- |
5363 |
- if use galera ; then |
5364 |
- einfo |
5365 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
5366 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
5367 |
- elog "The first time the cluster is activated, you should add" |
5368 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
5369 |
- elog "This option should then be removed for subsequent starts." |
5370 |
- einfo |
5371 |
- if [[ -n "${REPLACING_VERSIONS}" ]] ; then |
5372 |
- local rver |
5373 |
- for rver in ${REPLACING_VERSIONS} ; do |
5374 |
- if ver_test "${rver}" -lt "10.4.0" ; then |
5375 |
- ewarn "Upgrading galera from a previous version requires admin restart of the entire cluster." |
5376 |
- ewarn "Please refer to https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-104/#galera-4" |
5377 |
- ewarn "for more information" |
5378 |
- fi |
5379 |
- done |
5380 |
- fi |
5381 |
- fi |
5382 |
- fi |
5383 |
- |
5384 |
- # Note about configuration change |
5385 |
- einfo |
5386 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
5387 |
- elog "to several files in /etc/mysql/${PN}.d." |
5388 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
5389 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
5390 |
- elog "You may have as many files as needed and they are read alphabetically." |
5391 |
- elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." |
5392 |
- einfo |
5393 |
-} |
5394 |
- |
5395 |
-src_unpack() { |
5396 |
- unpack ${A} |
5397 |
- # Grab the patches |
5398 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack |
5399 |
- |
5400 |
- mv -f "${WORKDIR}/${P/_rc/}" "${S}" || die |
5401 |
-} |
5402 |
- |
5403 |
-src_prepare() { |
5404 |
- _disable_plugin() { |
5405 |
- echo > "${S}/plugin/${1}/CMakeLists.txt" || die |
5406 |
- } |
5407 |
- _disable_engine() { |
5408 |
- echo > "${S}/storage/${1}/CMakeLists.txt" || die |
5409 |
- } |
5410 |
- |
5411 |
- if use jemalloc; then |
5412 |
- echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" |
5413 |
- elif use tcmalloc; then |
5414 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
5415 |
- fi |
5416 |
- |
5417 |
- # Don't build bundled xz-utils for tokudb |
5418 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
5419 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
5420 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
5421 |
- |
5422 |
- local plugin |
5423 |
- local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
5424 |
- locale_info qc_info server_audit sql_errlog auth_ed25519 ) |
5425 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext |
5426 |
- debug_key_management example_key_management versioning ) |
5427 |
- if ! use server; then # These plugins are for the server |
5428 |
- for plugin in "${server_plugins[@]}" ; do |
5429 |
- _disable_plugin "${plugin}" |
5430 |
- done |
5431 |
- fi |
5432 |
- |
5433 |
- if ! use test; then # These plugins are only used during testing |
5434 |
- for plugin in "${test_plugins[@]}" ; do |
5435 |
- _disable_plugin "${plugin}" |
5436 |
- done |
5437 |
- _disable_engine test_sql_discovery |
5438 |
- echo > "${S}/plugin/auth_pam/testing/CMakeLists.txt" || die |
5439 |
- fi |
5440 |
- |
5441 |
- _disable_engine example |
5442 |
- |
5443 |
- if ! use oqgraph ; then # avoids extra library checks |
5444 |
- _disable_engine oqgraph |
5445 |
- fi |
5446 |
- |
5447 |
- if use mroonga ; then |
5448 |
- # Remove the bundled groonga |
5449 |
- # There is no CMake flag, it simply checks for existance |
5450 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
5451 |
- else |
5452 |
- _disable_engine mroonga |
5453 |
- fi |
5454 |
- |
5455 |
- # Fix static bindings in galera replication |
5456 |
- sed -i -e 's~add_library(wsrep_api_v26$~add_library(wsrep_api_v26 STATIC~' \ |
5457 |
- "${S}"/wsrep-lib/wsrep-API/CMakeLists.txt || die |
5458 |
- sed -i -e 's~add_library(wsrep-lib$~add_library(wsrep-lib STATIC~' \ |
5459 |
- "${S}"/wsrep-lib/src/CMakeLists.txt || die |
5460 |
- |
5461 |
- # Don't clash with dev-db/mysql-connector-c |
5462 |
- sed -i -e 's/ my_print_defaults.1//' \ |
5463 |
- -e 's/ perror.1//' \ |
5464 |
- "${S}"/man/CMakeLists.txt || die |
5465 |
- |
5466 |
- cmake-utils_src_prepare |
5467 |
- java-pkg-opt-2_src_prepare |
5468 |
-} |
5469 |
- |
5470 |
-src_configure(){ |
5471 |
- # bug 508724 mariadb cannot use ld.gold |
5472 |
- tc-ld-disable-gold |
5473 |
- # Bug #114895, bug #110149 |
5474 |
- filter-flags "-O" "-O[01]" |
5475 |
- |
5476 |
- append-cxxflags -felide-constructors |
5477 |
- |
5478 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
5479 |
- append-flags -fno-strict-aliasing |
5480 |
- |
5481 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
5482 |
- |
5483 |
- # debug hack wrt #497532 |
5484 |
- mycmakeargs=( |
5485 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
5486 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
5487 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
5488 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
5489 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
5490 |
- -DINSTALL_BINDIR=bin |
5491 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
5492 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
5493 |
- -DINSTALL_INCLUDEDIR=include/mysql |
5494 |
- -DINSTALL_INFODIR=share/info |
5495 |
- -DINSTALL_LIBDIR=$(get_libdir) |
5496 |
- -DINSTALL_MANDIR=share/man |
5497 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
5498 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
5499 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
5500 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
5501 |
- -DINSTALL_SBINDIR=sbin |
5502 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
5503 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
5504 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
5505 |
- -DWITH_LIBEDIT=0 |
5506 |
- -DWITH_ZLIB=system |
5507 |
- -DWITHOUT_LIBWRAP=1 |
5508 |
- -DENABLED_LOCAL_INFILE=1 |
5509 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
5510 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
5511 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
5512 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
5513 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
5514 |
- # The build forces this to be defined when cross-compiling. We pass it |
5515 |
- # all the time for simplicity and to make sure it is actually correct. |
5516 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
5517 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
5518 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
5519 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
5520 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
5521 |
- -DWITH_EXTERNAL_ZLIB=YES |
5522 |
- -DSUFFIX_INSTALL_DIR="" |
5523 |
- -DWITH_UNITTEST=OFF |
5524 |
- -DWITHOUT_CLIENTLIBS=YES |
5525 |
- -DCLIENT_PLUGIN_DIALOG=OFF |
5526 |
- -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF |
5527 |
- -DCLIENT_PLUGIN_CLIENT_ED25519=OFF |
5528 |
- -DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC |
5529 |
- -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF |
5530 |
- ) |
5531 |
- if use test ; then |
5532 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
5533 |
- else |
5534 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
5535 |
- fi |
5536 |
- |
5537 |
- if ! use yassl ; then |
5538 |
- mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC ) |
5539 |
- else |
5540 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
5541 |
- fi |
5542 |
- |
5543 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
5544 |
- mycmakeargs+=( |
5545 |
- -DWITH_READLINE=$(usex bindist 1 0) |
5546 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
5547 |
- -DENABLE_DTRACE=$(usex systemtap) |
5548 |
- ) |
5549 |
- |
5550 |
- if use server ; then |
5551 |
- |
5552 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
5553 |
- if ! use extraengine ; then |
5554 |
- mycmakeargs+=( |
5555 |
- -DPLUGIN_FEDERATED=NO |
5556 |
- -DPLUGIN_FEDERATEDX=NO ) |
5557 |
- fi |
5558 |
- |
5559 |
- mycmakeargs+=( |
5560 |
- -DWITH_PCRE=system |
5561 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
5562 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
5563 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
5564 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
5565 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
5566 |
- -DPLUGIN_CASSANDRA=NO |
5567 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
5568 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
5569 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
5570 |
- -DCONNECT_WITH_MYSQL=1 |
5571 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
5572 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
5573 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
5574 |
- # Build failure and autodep wrt bug 639144 |
5575 |
- -DCONNECT_WITH_MONGO=OFF |
5576 |
- -DWITH_WSREP=$(usex galera) |
5577 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
5578 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
5579 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
5580 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
5581 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
5582 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
5583 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
5584 |
- -DINSTALL_SQLBENCHDIR="" |
5585 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
5586 |
- # systemd is only linked to for server notification |
5587 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
5588 |
- -DWITH_NUMA=$(usex numa ON OFF) |
5589 |
- ) |
5590 |
- |
5591 |
- # Workaround for MDEV-14524 |
5592 |
- use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) |
5593 |
- |
5594 |
- if use test ; then |
5595 |
- # This is needed for the new client lib which tests a real, open server |
5596 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
5597 |
- fi |
5598 |
- |
5599 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
5600 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
5601 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
5602 |
- ewarn "You MUST file bugs without these variables set." |
5603 |
- |
5604 |
- mycmakeargs+=( |
5605 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
5606 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
5607 |
- ) |
5608 |
- |
5609 |
- elif ! use latin1 ; then |
5610 |
- mycmakeargs+=( |
5611 |
- -DDEFAULT_CHARSET=utf8 |
5612 |
- -DDEFAULT_COLLATION=utf8_general_ci |
5613 |
- ) |
5614 |
- else |
5615 |
- mycmakeargs+=( |
5616 |
- -DDEFAULT_CHARSET=latin1 |
5617 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
5618 |
- ) |
5619 |
- fi |
5620 |
- mycmakeargs+=( |
5621 |
- -DEXTRA_CHARSETS=all |
5622 |
- -DMYSQL_USER=mysql |
5623 |
- -DDISABLE_SHARED=$(usex static YES NO) |
5624 |
- -DWITH_DEBUG=$(usex debug) |
5625 |
- -DWITH_EMBEDDED_SERVER=OFF |
5626 |
- -DWITH_PROFILING=$(usex profiling) |
5627 |
- ) |
5628 |
- |
5629 |
- if use static; then |
5630 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
5631 |
- fi |
5632 |
- |
5633 |
- if use jemalloc || use tcmalloc ; then |
5634 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
5635 |
- fi |
5636 |
- |
5637 |
- # Storage engines |
5638 |
- mycmakeargs+=( |
5639 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
5640 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
5641 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
5642 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
5643 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
5644 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
5645 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
5646 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
5647 |
- ) |
5648 |
- |
5649 |
- else |
5650 |
- mycmakeargs+=( |
5651 |
- -DWITHOUT_SERVER=1 |
5652 |
- -DWITH_EMBEDDED_SERVER=OFF |
5653 |
- -DEXTRA_CHARSETS=none |
5654 |
- -DINSTALL_SQLBENCHDIR= |
5655 |
- -DWITH_SYSTEMD=no |
5656 |
- ) |
5657 |
- fi |
5658 |
- |
5659 |
- cmake-utils_src_configure |
5660 |
-} |
5661 |
- |
5662 |
-src_compile() { |
5663 |
- cmake-utils_src_compile |
5664 |
-} |
5665 |
- |
5666 |
-src_install() { |
5667 |
- cmake-utils_src_install |
5668 |
- |
5669 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
5670 |
- if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
5671 |
- rm "${ED}/usr/include/mysql/server/private/config.h" || die |
5672 |
- fi |
5673 |
- |
5674 |
- # Make sure the vars are correctly initialized |
5675 |
- mysql_init_vars |
5676 |
- |
5677 |
- # Convenience links |
5678 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
5679 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
5680 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
5681 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
5682 |
- |
5683 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
5684 |
- if [[ -d "${ED}/usr/data" ]] ; then |
5685 |
- rm -Rf "${ED}/usr/data" || die |
5686 |
- fi |
5687 |
- |
5688 |
- # Unless they explicitly specific USE=test, then do not install the |
5689 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
5690 |
- # validation of your database configuration after tuning it. |
5691 |
- if ! use test ; then |
5692 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
5693 |
- fi |
5694 |
- |
5695 |
- # Configuration stuff |
5696 |
- einfo "Building default configuration ..." |
5697 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
5698 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
5699 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
5700 |
- eprefixify "${TMPDIR}/my.cnf" |
5701 |
- doins "${TMPDIR}/my.cnf" |
5702 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
5703 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
5704 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
5705 |
- doins "${TMPDIR}/50-distro-client.cnf" |
5706 |
- |
5707 |
- if use server ; then |
5708 |
- mycnf_src="my.cnf.distro-server" |
5709 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
5710 |
- "${FILESDIR}/${mycnf_src}" \ |
5711 |
- > "${TMPDIR}/my.cnf.ok" || die |
5712 |
- if use prefix ; then |
5713 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
5714 |
- "${TMPDIR}/my.cnf.ok" || die |
5715 |
- fi |
5716 |
- if use latin1 ; then |
5717 |
- sed -i \ |
5718 |
- -e "/character-set/s|utf8|latin1|g" \ |
5719 |
- "${TMPDIR}/my.cnf.ok" || die |
5720 |
- fi |
5721 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
5722 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
5723 |
- |
5724 |
- einfo "Including support files and sample configurations" |
5725 |
- docinto "support-files" |
5726 |
- local script |
5727 |
- for script in \ |
5728 |
- "${S}"/support-files/magic |
5729 |
- do |
5730 |
- [[ -f "$script" ]] && dodoc "${script}" |
5731 |
- done |
5732 |
- |
5733 |
- docinto "scripts" |
5734 |
- for script in "${S}"/scripts/mysql* ; do |
5735 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
5736 |
- done |
5737 |
- # Manually install supporting files that conflict with other packages |
5738 |
- # but are needed for galera and initial installation |
5739 |
- exeinto /usr/libexec/mariadb |
5740 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
5741 |
- |
5742 |
- if use pam ; then |
5743 |
- keepdir /usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir |
5744 |
- fi |
5745 |
- fi |
5746 |
- |
5747 |
- # Remove mytop if perl is not selected |
5748 |
- if [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl ; then |
5749 |
- rm -f "${ED}/usr/bin/mytop" || die |
5750 |
- fi |
5751 |
- |
5752 |
- # Fix a dangling symlink when galera is not built |
5753 |
- if [[ -L "${ED}/usr/bin/wsrep_sst_rsync_wan" ]] && ! use galera ; then |
5754 |
- rm "${ED}/usr/bin/wsrep_sst_rsync_wan" || die |
5755 |
- fi |
5756 |
- |
5757 |
- # Remove broken SST scripts that are incompatible |
5758 |
- local scriptremove |
5759 |
- for scriptremove in wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2 ; do |
5760 |
- if [[ -e "${ED}/usr/bin/${scriptremove}" ]] ; then |
5761 |
- rm "${ED}/usr/bin/${scriptremove}" || die |
5762 |
- fi |
5763 |
- done |
5764 |
-} |
5765 |
- |
5766 |
-# Official test instructions: |
5767 |
-# USE='extraengine perl server' \ |
5768 |
-# FEATURES='test userpriv -usersandbox' \ |
5769 |
-# ebuild mariadb-X.X.XX.ebuild \ |
5770 |
-# digest clean package |
5771 |
-src_test() { |
5772 |
- |
5773 |
- _disable_test() { |
5774 |
- local rawtestname reason |
5775 |
- rawtestname="${1}" ; shift |
5776 |
- reason="${@}" |
5777 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
5778 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
5779 |
- } |
5780 |
- |
5781 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
5782 |
- local retstatus_unit |
5783 |
- local retstatus_tests |
5784 |
- |
5785 |
- if ! use server ; then |
5786 |
- einfo "Skipping server tests due to minimal build." |
5787 |
- return 0 |
5788 |
- fi |
5789 |
- |
5790 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
5791 |
- # localhost. Also causes weird failures. |
5792 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
5793 |
- |
5794 |
- if [[ $UID -eq 0 ]]; then |
5795 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
5796 |
- fi |
5797 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
5798 |
- |
5799 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
5800 |
- |
5801 |
- # Run CTest (test-units) |
5802 |
- cmake-utils_src_test |
5803 |
- retstatus_unit=$? |
5804 |
- |
5805 |
- # Ensure that parallel runs don't die |
5806 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
5807 |
- # Enable parallel testing, auto will try to detect number of cores |
5808 |
- # You may set this by hand. |
5809 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
5810 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
5811 |
- |
5812 |
- # create directories because mysqladmin might run out of order |
5813 |
- mkdir -p "${T}"/var-tests{,/log} || die |
5814 |
- |
5815 |
- # Run mysql tests |
5816 |
- pushd "${TESTDIR}" > /dev/null || die |
5817 |
- |
5818 |
- touch "${T}/disabled.def" |
5819 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
5820 |
- # false positives: |
5821 |
- # |
5822 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
5823 |
- # main.mysql_client_test_comp: |
5824 |
- # segfaults at random under Portage only, suspect resource limits. |
5825 |
- |
5826 |
- local t |
5827 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
5828 |
- _disable_test "$t" "False positive due to varying policies" |
5829 |
- done |
5830 |
- |
5831 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock main.mysql \ |
5832 |
- main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
5833 |
- _disable_test "$t" "False positives in Gentoo" |
5834 |
- done |
5835 |
- |
5836 |
- for t in funcs_1.is_columns_mysql main.gis_notembedded main.information_schema \ |
5837 |
- main.mysql_upgrade main.system_mysql_db ; do |
5838 |
- _disable_test "$t" "Failure for difference between latin1 and utf-8" |
5839 |
- done |
5840 |
- |
5841 |
- _disable_test main.plugin_auth "Needs client libraries built" |
5842 |
- _disable_test plugins.auth_ed25519 "Needs client libraries built" |
5843 |
- |
5844 |
- _disable_test main.func_time "Dependent on time test was written" |
5845 |
- |
5846 |
- _disable_test compat/oracle.plugin "Needs example plugin which Gentoo disables" |
5847 |
- |
5848 |
- # run mysql-test tests |
5849 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
5850 |
- retstatus_tests=$? |
5851 |
- |
5852 |
- popd > /dev/null || die |
5853 |
- |
5854 |
- # Cleanup is important for these testcases. |
5855 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
5856 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
5857 |
- |
5858 |
- local failures="" |
5859 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
5860 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
5861 |
- |
5862 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
5863 |
- einfo "Tests successfully completed" |
5864 |
-} |
5865 |
- |
5866 |
-mysql_init_vars() { |
5867 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
5868 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
5869 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
5870 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
5871 |
- |
5872 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
5873 |
- MY_DATADIR="" |
5874 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
5875 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
5876 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
5877 |
- | tail -n1` |
5878 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
5879 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
5880 |
- | sed -e 's/.*=\s*//' \ |
5881 |
- | tail -n1` |
5882 |
- fi |
5883 |
- fi |
5884 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
5885 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
5886 |
- einfo "Using default MY_DATADIR" |
5887 |
- fi |
5888 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
5889 |
- |
5890 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
5891 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
5892 |
- # If you get this and you're wondering about it, see bug #207636 |
5893 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
5894 |
- elog "A new one will not be created." |
5895 |
- PREVIOUS_DATADIR="yes" |
5896 |
- else |
5897 |
- PREVIOUS_DATADIR="no" |
5898 |
- fi |
5899 |
- export PREVIOUS_DATADIR |
5900 |
- fi |
5901 |
- else |
5902 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
5903 |
- local new_MY_DATADIR |
5904 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
5905 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
5906 |
- | tail -n1` |
5907 |
- |
5908 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
5909 |
- ewarn "MySQL MY_DATADIR has changed" |
5910 |
- ewarn "from ${MY_DATADIR}" |
5911 |
- ewarn "to ${new_MY_DATADIR}" |
5912 |
- MY_DATADIR="${new_MY_DATADIR}" |
5913 |
- fi |
5914 |
- fi |
5915 |
- fi |
5916 |
- |
5917 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
5918 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
5919 |
- export MY_DATADIR |
5920 |
-} |
5921 |
- |
5922 |
-pkg_config() { |
5923 |
- _getoptval() { |
5924 |
- local mypd="${EROOT}"/usr/libexec/mariadb/my_print_defaults |
5925 |
- local section="$1" |
5926 |
- local flag="--${2}=" |
5927 |
- local extra_options="${3}" |
5928 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
5929 |
- } |
5930 |
- local old_MY_DATADIR="${MY_DATADIR}" |
5931 |
- local old_HOME="${HOME}" |
5932 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
5933 |
- export HOME=${EPREFIX}/root |
5934 |
- |
5935 |
- # Make sure the vars are correctly initialized |
5936 |
- mysql_init_vars |
5937 |
- |
5938 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
5939 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
5940 |
- die "Minimal builds do NOT include the MySQL server" |
5941 |
- fi |
5942 |
- |
5943 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
5944 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
5945 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
5946 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
5947 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
5948 |
- |
5949 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
5950 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
5951 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
5952 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
5953 |
- else |
5954 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
5955 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
5956 |
- || die "Moving MY_DATADIR failed" |
5957 |
- fi |
5958 |
- else |
5959 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
5960 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
5961 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
5962 |
- else |
5963 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
5964 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
5965 |
- fi |
5966 |
- fi |
5967 |
- fi |
5968 |
- |
5969 |
- local pwd1="a" |
5970 |
- local pwd2="b" |
5971 |
- local maxtry=15 |
5972 |
- |
5973 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
5974 |
- local tmp_mysqld_password_source= |
5975 |
- |
5976 |
- for tmp_mysqld_password_source in mysql client; do |
5977 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
5978 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
5979 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
5980 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
5981 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
5982 |
- MYSQL_ROOT_PASSWORD= |
5983 |
- continue |
5984 |
- fi |
5985 |
- |
5986 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
5987 |
- break |
5988 |
- fi |
5989 |
- done |
5990 |
- |
5991 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
5992 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
5993 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
5994 |
- fi |
5995 |
- |
5996 |
- unset tmp_mysqld_password_source |
5997 |
- fi |
5998 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" |
5999 |
- # These are dir+prefix |
6000 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" |
6001 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
6002 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" |
6003 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
6004 |
- |
6005 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
6006 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
6007 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
6008 |
- fi |
6009 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
6010 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
6011 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
6012 |
- fi |
6013 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
6014 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
6015 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
6016 |
- fi |
6017 |
- |
6018 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
6019 |
- ewarn "You have already a MySQL database in place." |
6020 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
6021 |
- ewarn "Please rename or delete it if you wish to replace it." |
6022 |
- die "MySQL database already exists!" |
6023 |
- fi |
6024 |
- |
6025 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
6026 |
- # localhost. Also causes weird failures. |
6027 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
6028 |
- |
6029 |
- if [[ -z "${MYSQL_ROOT_PASSWORD}" ]]; then |
6030 |
- |
6031 |
- einfo "Please provide a password for the mysql 'root'@'localhost' user now" |
6032 |
- einfo "or through the ${HOME}/.my.cnf file." |
6033 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
6034 |
- einfo "Not entering a password defaults to UNIX authentication" |
6035 |
- read -rsp " >" pwd1 ; echo |
6036 |
- |
6037 |
- if [[ -n "${pwd1}" ]] ; then |
6038 |
- |
6039 |
- einfo "Retype the password" |
6040 |
- read -rsp " >" pwd2 ; echo |
6041 |
- |
6042 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
6043 |
- die "Passwords are not the same" |
6044 |
- fi |
6045 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
6046 |
- fi |
6047 |
- unset pwd1 pwd2 |
6048 |
- fi |
6049 |
- |
6050 |
- local options |
6051 |
- local sqltmp="$(emktemp)" |
6052 |
- |
6053 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
6054 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
6055 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
6056 |
- |
6057 |
- # Figure out which options we need to disable to do the setup |
6058 |
- local helpfile="${TMPDIR}/mysqld-help" |
6059 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
6060 |
- for opt in host-cache name-resolve networking slave-start \ |
6061 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
6062 |
- log-slave-updates \ |
6063 |
- ; do |
6064 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
6065 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
6066 |
- done |
6067 |
- |
6068 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
6069 |
- |
6070 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
6071 |
- PID_DIR="${EROOT}/var/run/mysqld" |
6072 |
- if [[ ! -d "${PID_DIR}" ]]; then |
6073 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
6074 |
- fi |
6075 |
- |
6076 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
6077 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
6078 |
- fi |
6079 |
- |
6080 |
- pushd "${TMPDIR}" &>/dev/null || die |
6081 |
- |
6082 |
- # Filling timezones, see |
6083 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
6084 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
6085 |
- |
6086 |
- local cmd=( "${EROOT}/usr/share/mariadb/scripts/mysql_install_db" ) |
6087 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}/usr/bin/mysql_install_db" ) |
6088 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
6089 |
- einfo "Command: ${cmd[*]}" |
6090 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
6091 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
6092 |
- if [[ $? -ne 0 ]]; then |
6093 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
6094 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
6095 |
- fi |
6096 |
- popd &>/dev/null || die |
6097 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
6098 |
- || die "MySQL databases not installed" |
6099 |
- |
6100 |
- if [[ -z ${sqltmp} && -z ${MYSQL_ROOT_PASSWORD} ]] ; then |
6101 |
- einfo "Done" |
6102 |
- exit 0 |
6103 |
- fi |
6104 |
- |
6105 |
- use prefix || options="${options} --user=mysql" |
6106 |
- |
6107 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
6108 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
6109 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
6110 |
- ${options} \ |
6111 |
- --log-warnings=0 \ |
6112 |
- --basedir=${EROOT}/usr \ |
6113 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
6114 |
- --max_allowed_packet=8M \ |
6115 |
- --net_buffer_length=16K \ |
6116 |
- --socket=${socket} \ |
6117 |
- --pid-file=${pidfile} \ |
6118 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
6119 |
- #einfo "About to start mysqld: ${mysqld}" |
6120 |
- ebegin "Starting mysqld" |
6121 |
- einfo "Command ${mysqld}" |
6122 |
- ${mysqld} & |
6123 |
- rc=$? |
6124 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
6125 |
- maxtry=$((${maxtry}-1)) |
6126 |
- echo -n "." |
6127 |
- sleep 1 |
6128 |
- done |
6129 |
- eend $rc |
6130 |
- |
6131 |
- [[ -S "${socket}" ]] || |
6132 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
6133 |
- |
6134 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then |
6135 |
- ebegin "Setting root password" |
6136 |
- # Do this from memory, as we don't want clear text passwords in temp files |
6137 |
- local sql="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}')" |
6138 |
- "${EROOT}/usr/bin/mysql" \ |
6139 |
- "--socket=${socket}" \ |
6140 |
- -hlocalhost \ |
6141 |
- -e "${sql}" |
6142 |
- unset sql |
6143 |
- eend $? |
6144 |
- fi |
6145 |
- |
6146 |
- if [[ -n "${sqltmp}" ]] ; then |
6147 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
6148 |
- "${EROOT}/usr/bin/mysql" \ |
6149 |
- "--socket=${socket}" \ |
6150 |
- -hlocalhost \ |
6151 |
- -uroot \ |
6152 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
6153 |
- mysql < "${sqltmp}" |
6154 |
- rc=$? |
6155 |
- eend $? |
6156 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
6157 |
- fi |
6158 |
- |
6159 |
- # Stop the server and cleanup |
6160 |
- einfo "Stopping the server ..." |
6161 |
- kill $(< "${pidfile}" ) |
6162 |
- rm -f "${sqltmp}" |
6163 |
- wait %1 |
6164 |
- einfo "Done" |
6165 |
-} |
6166 |
|
6167 |
diff --git a/dev-db/mariadb/mariadb-10.4.8.ebuild b/dev-db/mariadb/mariadb-10.4.8.ebuild |
6168 |
deleted file mode 100644 |
6169 |
index 34b5cbc63be..00000000000 |
6170 |
--- a/dev-db/mariadb/mariadb-10.4.8.ebuild |
6171 |
+++ /dev/null |
6172 |
@@ -1,1009 +0,0 @@ |
6173 |
-# Copyright 1999-2019 Gentoo Authors |
6174 |
-# Distributed under the terms of the GNU General Public License v2 |
6175 |
- |
6176 |
-EAPI="7" |
6177 |
-MY_EXTRAS_VER="20190731-2258Z" |
6178 |
-SUBSLOT="18" |
6179 |
- |
6180 |
-JAVA_PKG_OPT_USE="jdbc" |
6181 |
- |
6182 |
-inherit eutils systemd flag-o-matic prefix toolchain-funcs \ |
6183 |
- java-pkg-opt-2 cmake-utils |
6184 |
- |
6185 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
6186 |
- |
6187 |
-# Gentoo patches to MySQL |
6188 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
6189 |
- SRC_URI="${SRC_URI} |
6190 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
6191 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
6192 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
6193 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
6194 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
6195 |
-fi |
6196 |
- |
6197 |
-HOMEPAGE="https://mariadb.org/" |
6198 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
6199 |
-LICENSE="GPL-2 LGPL-2.1+" |
6200 |
-SLOT="0/${SUBSLOT:-0}" |
6201 |
-IUSE="+backup bindist cracklib debug extraengine galera innodb-lz4 |
6202 |
- innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga |
6203 |
- numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx |
6204 |
- sst-rsync sst-mariabackup static systemd systemtap tcmalloc |
6205 |
- test tokudb xml yassl" |
6206 |
- |
6207 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
6208 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
6209 |
- |
6210 |
-REQUIRED_USE="jdbc? ( extraengine server !static ) |
6211 |
- server? ( tokudb? ( jemalloc !tcmalloc ) ) |
6212 |
- ?? ( tcmalloc jemalloc ) |
6213 |
- static? ( yassl !pam )" |
6214 |
- |
6215 |
-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" |
6216 |
- |
6217 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
6218 |
-# and we will run a mysql server during test phase |
6219 |
-S="${WORKDIR}/mysql" |
6220 |
- |
6221 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
6222 |
- inherit git-r3 |
6223 |
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" |
6224 |
- EGIT_CHECKOUT_DIR="${WORKDIR}/mysql-extras" |
6225 |
- EGIT_CLONE_TYPE=shallow |
6226 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras" |
6227 |
-else |
6228 |
- MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" |
6229 |
-fi |
6230 |
- |
6231 |
-PATCHES=( |
6232 |
- "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch |
6233 |
- "${MY_PATCH_DIR}"/20018_all_mariadb-10.4.5-without-clientlibs-tools.patch |
6234 |
- "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
6235 |
- "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
6236 |
- "${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch |
6237 |
-) |
6238 |
- |
6239 |
-# Be warned, *DEPEND are version-dependant |
6240 |
-# These are used for both runtime and compiletime |
6241 |
-COMMON_DEPEND=" |
6242 |
- kernel_linux? ( |
6243 |
- sys-process/procps:0= |
6244 |
- dev-libs/libaio:0= |
6245 |
- ) |
6246 |
- >=sys-apps/sed-4 |
6247 |
- >=sys-apps/texinfo-4.7-r1 |
6248 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
6249 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
6250 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
6251 |
- >=sys-libs/zlib-1.2.3:0= |
6252 |
- kerberos? ( virtual/krb5 ) |
6253 |
- yassl? ( net-libs/gnutls:0= ) |
6254 |
- !yassl? ( |
6255 |
- !libressl? ( >=dev-libs/openssl-1.0.0:0= ) |
6256 |
- libressl? ( dev-libs/libressl:0= ) |
6257 |
- ) |
6258 |
- sys-libs/ncurses:0= |
6259 |
- !bindist? ( |
6260 |
- sys-libs/binutils-libs:0= |
6261 |
- >=sys-libs/readline-4.1:0= |
6262 |
- ) |
6263 |
- server? ( |
6264 |
- backup? ( app-arch/libarchive:0= ) |
6265 |
- cracklib? ( sys-libs/cracklib:0= ) |
6266 |
- extraengine? ( |
6267 |
- odbc? ( dev-db/unixODBC:0= ) |
6268 |
- xml? ( dev-libs/libxml2:2= ) |
6269 |
- ) |
6270 |
- innodb-lz4? ( app-arch/lz4 ) |
6271 |
- innodb-lzo? ( dev-libs/lzo ) |
6272 |
- innodb-snappy? ( app-arch/snappy ) |
6273 |
- mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 ) |
6274 |
- numa? ( sys-process/numactl ) |
6275 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
6276 |
- pam? ( sys-libs/pam:0= ) |
6277 |
- systemd? ( sys-apps/systemd:= ) |
6278 |
- tokudb? ( app-arch/snappy ) |
6279 |
- ) |
6280 |
- >=dev-libs/libpcre-8.41-r1:3= |
6281 |
-" |
6282 |
-BDEPEND="virtual/yacc |
6283 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
6284 |
-" |
6285 |
-DEPEND="static? ( sys-libs/ncurses[static-libs] ) |
6286 |
- server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) |
6287 |
- test? ( acct-group/mysql acct-user/mysql ) ) |
6288 |
- ${COMMON_DEPEND}" |
6289 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
6290 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
6291 |
- !<virtual/mysql-5.6-r11 |
6292 |
- !<virtual/libmysqlclient-18-r1 |
6293 |
- ${COMMON_DEPEND} |
6294 |
- server? ( |
6295 |
- galera? ( |
6296 |
- sys-apps/iproute2 |
6297 |
- =sys-cluster/galera-26* |
6298 |
- sst-rsync? ( sys-process/lsof ) |
6299 |
- sst-mariabackup? ( net-misc/socat[ssl] ) |
6300 |
- ) |
6301 |
- !prefix? ( dev-db/mysql-init-scripts acct-group/mysql acct-user/mysql ) |
6302 |
- extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) |
6303 |
- ) |
6304 |
- perl? ( !dev-db/mytop |
6305 |
- virtual/perl-Getopt-Long |
6306 |
- dev-perl/TermReadKey |
6307 |
- virtual/perl-Term-ANSIColor |
6308 |
- virtual/perl-Time-HiRes ) |
6309 |
-" |
6310 |
-# For other stuff to bring us in |
6311 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
6312 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) |
6313 |
- server? ( ~virtual/mysql-5.6[static=] )" |
6314 |
- |
6315 |
-pkg_setup() { |
6316 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
6317 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
6318 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
6319 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
6320 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
6321 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
6322 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
6323 |
- die |
6324 |
- fi |
6325 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
6326 |
- # non x86{,_64} arches |
6327 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
6328 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
6329 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
6330 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
6331 |
- die |
6332 |
- fi |
6333 |
- fi |
6334 |
- java-pkg-opt-2_pkg_setup |
6335 |
- if has test ${FEATURES} && \ |
6336 |
- use server && ! has userpriv ${FEATURES} ; then |
6337 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
6338 |
- fi |
6339 |
- |
6340 |
-} |
6341 |
- |
6342 |
-pkg_preinst() { |
6343 |
- java-pkg-opt-2_pkg_preinst |
6344 |
-} |
6345 |
- |
6346 |
-pkg_postinst() { |
6347 |
- # Make sure the vars are correctly initialized |
6348 |
- mysql_init_vars |
6349 |
- |
6350 |
- # Create log directory securely if it does not exist |
6351 |
- [[ -d "${ROOT}/${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}/${MY_LOGDIR}" |
6352 |
- |
6353 |
- if use server ; then |
6354 |
- if use pam; then |
6355 |
- einfo |
6356 |
- elog "This install includes the PAM authentication plugin." |
6357 |
- elog "To activate and configure the PAM plugin, please read:" |
6358 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
6359 |
- einfo |
6360 |
- chown mysql:mysql "${EROOT}/usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir" || die |
6361 |
- fi |
6362 |
- |
6363 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
6364 |
- einfo |
6365 |
- elog "You might want to run:" |
6366 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
6367 |
- elog "if this is a new install." |
6368 |
- elog |
6369 |
- elog "If you are switching server implentations, you should run the" |
6370 |
- elog "mysql_upgrade tool." |
6371 |
- einfo |
6372 |
- else |
6373 |
- einfo |
6374 |
- elog "If you are upgrading major versions, you should run the" |
6375 |
- elog "mysql_upgrade tool." |
6376 |
- einfo |
6377 |
- fi |
6378 |
- |
6379 |
- if use galera ; then |
6380 |
- einfo |
6381 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
6382 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
6383 |
- elog "The first time the cluster is activated, you should add" |
6384 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
6385 |
- elog "This option should then be removed for subsequent starts." |
6386 |
- einfo |
6387 |
- if [[ -n "${REPLACING_VERSIONS}" ]] ; then |
6388 |
- local rver |
6389 |
- for rver in ${REPLACING_VERSIONS} ; do |
6390 |
- if ver_test "${rver}" -lt "10.4.0" ; then |
6391 |
- ewarn "Upgrading galera from a previous version requires admin restart of the entire cluster." |
6392 |
- ewarn "Please refer to https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-104/#galera-4" |
6393 |
- ewarn "for more information" |
6394 |
- fi |
6395 |
- done |
6396 |
- fi |
6397 |
- fi |
6398 |
- fi |
6399 |
- |
6400 |
- # Note about configuration change |
6401 |
- einfo |
6402 |
- elog "This version of mariadb reorganizes the configuration from a single my.cnf" |
6403 |
- elog "to several files in /etc/mysql/${PN}.d." |
6404 |
- elog "Please backup any changes you made to /etc/mysql/my.cnf" |
6405 |
- elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension." |
6406 |
- elog "You may have as many files as needed and they are read alphabetically." |
6407 |
- elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." |
6408 |
- einfo |
6409 |
-} |
6410 |
- |
6411 |
-src_unpack() { |
6412 |
- unpack ${A} |
6413 |
- # Grab the patches |
6414 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack |
6415 |
- |
6416 |
- mv -f "${WORKDIR}/${P/_rc/}" "${S}" || die |
6417 |
-} |
6418 |
- |
6419 |
-src_prepare() { |
6420 |
- _disable_plugin() { |
6421 |
- echo > "${S}/plugin/${1}/CMakeLists.txt" || die |
6422 |
- } |
6423 |
- _disable_engine() { |
6424 |
- echo > "${S}/storage/${1}/CMakeLists.txt" || die |
6425 |
- } |
6426 |
- |
6427 |
- if use jemalloc; then |
6428 |
- echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" |
6429 |
- elif use tcmalloc; then |
6430 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
6431 |
- fi |
6432 |
- |
6433 |
- # Don't build bundled xz-utils for tokudb |
6434 |
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die |
6435 |
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die |
6436 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die |
6437 |
- |
6438 |
- local plugin |
6439 |
- local server_plugins=( handler_socket auth_socket feedback metadata_lock_info |
6440 |
- locale_info qc_info server_audit sql_errlog auth_ed25519 ) |
6441 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext |
6442 |
- debug_key_management example_key_management versioning ) |
6443 |
- if ! use server; then # These plugins are for the server |
6444 |
- for plugin in "${server_plugins[@]}" ; do |
6445 |
- _disable_plugin "${plugin}" |
6446 |
- done |
6447 |
- fi |
6448 |
- |
6449 |
- if ! use test; then # These plugins are only used during testing |
6450 |
- for plugin in "${test_plugins[@]}" ; do |
6451 |
- _disable_plugin "${plugin}" |
6452 |
- done |
6453 |
- _disable_engine test_sql_discovery |
6454 |
- echo > "${S}/plugin/auth_pam/testing/CMakeLists.txt" || die |
6455 |
- fi |
6456 |
- |
6457 |
- _disable_engine example |
6458 |
- |
6459 |
- if ! use oqgraph ; then # avoids extra library checks |
6460 |
- _disable_engine oqgraph |
6461 |
- fi |
6462 |
- |
6463 |
- if use mroonga ; then |
6464 |
- # Remove the bundled groonga |
6465 |
- # There is no CMake flag, it simply checks for existance |
6466 |
- rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" |
6467 |
- else |
6468 |
- _disable_engine mroonga |
6469 |
- fi |
6470 |
- |
6471 |
- # Fix static bindings in galera replication |
6472 |
- sed -i -e 's~add_library(wsrep_api_v26$~add_library(wsrep_api_v26 STATIC~' \ |
6473 |
- "${S}"/wsrep-lib/wsrep-API/CMakeLists.txt || die |
6474 |
- sed -i -e 's~add_library(wsrep-lib$~add_library(wsrep-lib STATIC~' \ |
6475 |
- "${S}"/wsrep-lib/src/CMakeLists.txt || die |
6476 |
- |
6477 |
- # Don't clash with dev-db/mysql-connector-c |
6478 |
- sed -i -e 's/ my_print_defaults.1//' \ |
6479 |
- -e 's/ perror.1//' \ |
6480 |
- "${S}"/man/CMakeLists.txt || die |
6481 |
- |
6482 |
- cmake-utils_src_prepare |
6483 |
- java-pkg-opt-2_src_prepare |
6484 |
-} |
6485 |
- |
6486 |
-src_configure(){ |
6487 |
- # bug 508724 mariadb cannot use ld.gold |
6488 |
- tc-ld-disable-gold |
6489 |
- # Bug #114895, bug #110149 |
6490 |
- filter-flags "-O" "-O[01]" |
6491 |
- |
6492 |
- append-cxxflags -felide-constructors |
6493 |
- |
6494 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
6495 |
- append-flags -fno-strict-aliasing |
6496 |
- |
6497 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
6498 |
- |
6499 |
- # debug hack wrt #497532 |
6500 |
- mycmakeargs=( |
6501 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
6502 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
6503 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
6504 |
- -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" |
6505 |
- -DSYSCONFDIR="${EPREFIX}/etc/mysql" |
6506 |
- -DINSTALL_BINDIR=bin |
6507 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
6508 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
6509 |
- -DINSTALL_INCLUDEDIR=include/mysql |
6510 |
- -DINSTALL_INFODIR=share/info |
6511 |
- -DINSTALL_LIBDIR=$(get_libdir) |
6512 |
- -DINSTALL_MANDIR=share/man |
6513 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
6514 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
6515 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
6516 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" |
6517 |
- -DINSTALL_SBINDIR=sbin |
6518 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb" |
6519 |
- -DWITH_COMMENT="Gentoo Linux ${PF}" |
6520 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
6521 |
- -DWITH_LIBEDIT=0 |
6522 |
- -DWITH_ZLIB=system |
6523 |
- -DWITHOUT_LIBWRAP=1 |
6524 |
- -DENABLED_LOCAL_INFILE=1 |
6525 |
- -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
6526 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock" |
6527 |
- -DWITH_DEFAULT_COMPILER_OPTIONS=0 |
6528 |
- -DWITH_DEFAULT_FEATURE_SET=0 |
6529 |
- -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" |
6530 |
- # The build forces this to be defined when cross-compiling. We pass it |
6531 |
- # all the time for simplicity and to make sure it is actually correct. |
6532 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
6533 |
- -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)" |
6534 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
6535 |
- -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF) |
6536 |
- -DCONC_WITH_EXTERNAL_ZLIB=YES |
6537 |
- -DWITH_EXTERNAL_ZLIB=YES |
6538 |
- -DSUFFIX_INSTALL_DIR="" |
6539 |
- -DWITH_UNITTEST=OFF |
6540 |
- -DWITHOUT_CLIENTLIBS=YES |
6541 |
- -DCLIENT_PLUGIN_DIALOG=OFF |
6542 |
- -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF |
6543 |
- -DCLIENT_PLUGIN_CLIENT_ED25519=OFF |
6544 |
- -DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC |
6545 |
- -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF |
6546 |
- ) |
6547 |
- if use test ; then |
6548 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
6549 |
- else |
6550 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
6551 |
- fi |
6552 |
- |
6553 |
- if ! use yassl ; then |
6554 |
- mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC ) |
6555 |
- else |
6556 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
6557 |
- fi |
6558 |
- |
6559 |
- # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION |
6560 |
- mycmakeargs+=( |
6561 |
- -DWITH_READLINE=$(usex bindist 1 0) |
6562 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
6563 |
- -DENABLE_DTRACE=$(usex systemtap) |
6564 |
- ) |
6565 |
- |
6566 |
- if use server ; then |
6567 |
- |
6568 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
6569 |
- if ! use extraengine ; then |
6570 |
- mycmakeargs+=( |
6571 |
- -DPLUGIN_FEDERATED=NO |
6572 |
- -DPLUGIN_FEDERATEDX=NO ) |
6573 |
- fi |
6574 |
- |
6575 |
- mycmakeargs+=( |
6576 |
- -DWITH_PCRE=system |
6577 |
- -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO) |
6578 |
- -DPLUGIN_SPHINX=$(usex sphinx YES NO) |
6579 |
- -DPLUGIN_TOKUDB=$(usex tokudb YES NO) |
6580 |
- -DPLUGIN_AUTH_PAM=$(usex pam YES NO) |
6581 |
- -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO) |
6582 |
- -DPLUGIN_CASSANDRA=NO |
6583 |
- -DPLUGIN_SEQUENCE=$(usex extraengine YES NO) |
6584 |
- -DPLUGIN_SPIDER=$(usex extraengine YES NO) |
6585 |
- -DPLUGIN_CONNECT=$(usex extraengine YES NO) |
6586 |
- -DCONNECT_WITH_MYSQL=1 |
6587 |
- -DCONNECT_WITH_LIBXML2=$(usex xml) |
6588 |
- -DCONNECT_WITH_ODBC=$(usex odbc) |
6589 |
- -DCONNECT_WITH_JDBC=$(usex jdbc) |
6590 |
- # Build failure and autodep wrt bug 639144 |
6591 |
- -DCONNECT_WITH_MONGO=OFF |
6592 |
- -DWITH_WSREP=$(usex galera) |
6593 |
- -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF) |
6594 |
- -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF) |
6595 |
- -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF) |
6596 |
- -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO) |
6597 |
- -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO) |
6598 |
- -DWITH_MARIABACKUP=$(usex backup ON OFF) |
6599 |
- -DWITH_LIBARCHIVE=$(usex backup ON OFF) |
6600 |
- -DINSTALL_SQLBENCHDIR="" |
6601 |
- -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO) |
6602 |
- # systemd is only linked to for server notification |
6603 |
- -DWITH_SYSTEMD=$(usex systemd yes no) |
6604 |
- -DWITH_NUMA=$(usex numa ON OFF) |
6605 |
- ) |
6606 |
- |
6607 |
- # Workaround for MDEV-14524 |
6608 |
- use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) |
6609 |
- |
6610 |
- if use test ; then |
6611 |
- # This is needed for the new client lib which tests a real, open server |
6612 |
- mycmakeargs+=( -DSKIP_TESTS=ON ) |
6613 |
- fi |
6614 |
- |
6615 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
6616 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
6617 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
6618 |
- ewarn "You MUST file bugs without these variables set." |
6619 |
- |
6620 |
- mycmakeargs+=( |
6621 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
6622 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
6623 |
- ) |
6624 |
- |
6625 |
- elif ! use latin1 ; then |
6626 |
- mycmakeargs+=( |
6627 |
- -DDEFAULT_CHARSET=utf8 |
6628 |
- -DDEFAULT_COLLATION=utf8_general_ci |
6629 |
- ) |
6630 |
- else |
6631 |
- mycmakeargs+=( |
6632 |
- -DDEFAULT_CHARSET=latin1 |
6633 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
6634 |
- ) |
6635 |
- fi |
6636 |
- mycmakeargs+=( |
6637 |
- -DEXTRA_CHARSETS=all |
6638 |
- -DMYSQL_USER=mysql |
6639 |
- -DDISABLE_SHARED=$(usex static YES NO) |
6640 |
- -DWITH_DEBUG=$(usex debug) |
6641 |
- -DWITH_EMBEDDED_SERVER=OFF |
6642 |
- -DWITH_PROFILING=$(usex profiling) |
6643 |
- ) |
6644 |
- |
6645 |
- if use static; then |
6646 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
6647 |
- fi |
6648 |
- |
6649 |
- if use jemalloc || use tcmalloc ; then |
6650 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
6651 |
- fi |
6652 |
- |
6653 |
- # Storage engines |
6654 |
- mycmakeargs+=( |
6655 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
6656 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
6657 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
6658 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
6659 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
6660 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
6661 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
6662 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
6663 |
- ) |
6664 |
- |
6665 |
- else |
6666 |
- mycmakeargs+=( |
6667 |
- -DWITHOUT_SERVER=1 |
6668 |
- -DWITH_EMBEDDED_SERVER=OFF |
6669 |
- -DEXTRA_CHARSETS=none |
6670 |
- -DINSTALL_SQLBENCHDIR= |
6671 |
- -DWITH_SYSTEMD=no |
6672 |
- ) |
6673 |
- fi |
6674 |
- |
6675 |
- cmake-utils_src_configure |
6676 |
-} |
6677 |
- |
6678 |
-src_compile() { |
6679 |
- cmake-utils_src_compile |
6680 |
-} |
6681 |
- |
6682 |
-src_install() { |
6683 |
- cmake-utils_src_install |
6684 |
- |
6685 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
6686 |
- if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then |
6687 |
- rm "${ED}/usr/include/mysql/server/private/config.h" || die |
6688 |
- fi |
6689 |
- |
6690 |
- # Make sure the vars are correctly initialized |
6691 |
- mysql_init_vars |
6692 |
- |
6693 |
- # Convenience links |
6694 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
6695 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
6696 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
6697 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
6698 |
- |
6699 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
6700 |
- if [[ -d "${ED}/usr/data" ]] ; then |
6701 |
- rm -Rf "${ED}/usr/data" || die |
6702 |
- fi |
6703 |
- |
6704 |
- # Unless they explicitly specific USE=test, then do not install the |
6705 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
6706 |
- # validation of your database configuration after tuning it. |
6707 |
- if ! use test ; then |
6708 |
- rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test" |
6709 |
- fi |
6710 |
- |
6711 |
- # Configuration stuff |
6712 |
- einfo "Building default configuration ..." |
6713 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
6714 |
- [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf |
6715 |
- cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die |
6716 |
- eprefixify "${TMPDIR}/my.cnf" |
6717 |
- doins "${TMPDIR}/my.cnf" |
6718 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d" |
6719 |
- cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die |
6720 |
- eprefixify "${TMPDIR}/50-distro-client.cnf" |
6721 |
- doins "${TMPDIR}/50-distro-client.cnf" |
6722 |
- |
6723 |
- if use server ; then |
6724 |
- mycnf_src="my.cnf.distro-server" |
6725 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
6726 |
- "${FILESDIR}/${mycnf_src}" \ |
6727 |
- > "${TMPDIR}/my.cnf.ok" || die |
6728 |
- if use prefix ; then |
6729 |
- sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ |
6730 |
- "${TMPDIR}/my.cnf.ok" || die |
6731 |
- fi |
6732 |
- if use latin1 ; then |
6733 |
- sed -i \ |
6734 |
- -e "/character-set/s|utf8|latin1|g" \ |
6735 |
- "${TMPDIR}/my.cnf.ok" || die |
6736 |
- fi |
6737 |
- eprefixify "${TMPDIR}/my.cnf.ok" |
6738 |
- newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf |
6739 |
- |
6740 |
- einfo "Including support files and sample configurations" |
6741 |
- docinto "support-files" |
6742 |
- local script |
6743 |
- for script in \ |
6744 |
- "${S}"/support-files/magic |
6745 |
- do |
6746 |
- [[ -f "$script" ]] && dodoc "${script}" |
6747 |
- done |
6748 |
- |
6749 |
- docinto "scripts" |
6750 |
- for script in "${S}"/scripts/mysql* ; do |
6751 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
6752 |
- done |
6753 |
- # Manually install supporting files that conflict with other packages |
6754 |
- # but are needed for galera and initial installation |
6755 |
- exeinto /usr/libexec/mariadb |
6756 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
6757 |
- |
6758 |
- if use pam ; then |
6759 |
- keepdir /usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir |
6760 |
- fi |
6761 |
- fi |
6762 |
- |
6763 |
- # Remove mytop if perl is not selected |
6764 |
- if [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl ; then |
6765 |
- rm -f "${ED}/usr/bin/mytop" || die |
6766 |
- fi |
6767 |
- |
6768 |
- # Fix a dangling symlink when galera is not built |
6769 |
- if [[ -L "${ED}/usr/bin/wsrep_sst_rsync_wan" ]] && ! use galera ; then |
6770 |
- rm "${ED}/usr/bin/wsrep_sst_rsync_wan" || die |
6771 |
- fi |
6772 |
- |
6773 |
- # Remove broken SST scripts that are incompatible |
6774 |
- local scriptremove |
6775 |
- for scriptremove in wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2 ; do |
6776 |
- if [[ -e "${ED}/usr/bin/${scriptremove}" ]] ; then |
6777 |
- rm "${ED}/usr/bin/${scriptremove}" || die |
6778 |
- fi |
6779 |
- done |
6780 |
-} |
6781 |
- |
6782 |
-# Official test instructions: |
6783 |
-# USE='extraengine perl server' \ |
6784 |
-# FEATURES='test userpriv -usersandbox' \ |
6785 |
-# ebuild mariadb-X.X.XX.ebuild \ |
6786 |
-# digest clean package |
6787 |
-src_test() { |
6788 |
- |
6789 |
- _disable_test() { |
6790 |
- local rawtestname reason |
6791 |
- rawtestname="${1}" ; shift |
6792 |
- reason="${@}" |
6793 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
6794 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
6795 |
- } |
6796 |
- |
6797 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
6798 |
- local retstatus_unit |
6799 |
- local retstatus_tests |
6800 |
- |
6801 |
- if ! use server ; then |
6802 |
- einfo "Skipping server tests due to minimal build." |
6803 |
- return 0 |
6804 |
- fi |
6805 |
- |
6806 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
6807 |
- # localhost. Also causes weird failures. |
6808 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
6809 |
- |
6810 |
- if [[ $UID -eq 0 ]]; then |
6811 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
6812 |
- fi |
6813 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
6814 |
- |
6815 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
6816 |
- |
6817 |
- # Run CTest (test-units) |
6818 |
- cmake-utils_src_test |
6819 |
- retstatus_unit=$? |
6820 |
- |
6821 |
- # Ensure that parallel runs don't die |
6822 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
6823 |
- # Enable parallel testing, auto will try to detect number of cores |
6824 |
- # You may set this by hand. |
6825 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
6826 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
6827 |
- |
6828 |
- # create directories because mysqladmin might run out of order |
6829 |
- mkdir -p "${T}"/var-tests{,/log} || die |
6830 |
- |
6831 |
- # Run mysql tests |
6832 |
- pushd "${TESTDIR}" > /dev/null || die |
6833 |
- |
6834 |
- touch "${T}/disabled.def" |
6835 |
- # These are failing in MariaDB 10.0 for now and are believed to be |
6836 |
- # false positives: |
6837 |
- # |
6838 |
- # main.mysql_client_test, main.mysql_client_test_nonblock |
6839 |
- # main.mysql_client_test_comp: |
6840 |
- # segfaults at random under Portage only, suspect resource limits. |
6841 |
- |
6842 |
- local t |
6843 |
- for t in plugins.cracklib_password_check plugins.two_password_validations ; do |
6844 |
- _disable_test "$t" "False positive due to varying policies" |
6845 |
- done |
6846 |
- |
6847 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock main.mysql \ |
6848 |
- main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do |
6849 |
- _disable_test "$t" "False positives in Gentoo" |
6850 |
- done |
6851 |
- |
6852 |
- for t in funcs_1.is_columns_mysql main.gis_notembedded main.information_schema \ |
6853 |
- main.mysql_upgrade main.system_mysql_db ; do |
6854 |
- _disable_test "$t" "Failure for difference between latin1 and utf-8" |
6855 |
- done |
6856 |
- |
6857 |
- _disable_test main.plugin_auth "Needs client libraries built" |
6858 |
- _disable_test plugins.auth_ed25519 "Needs client libraries built" |
6859 |
- |
6860 |
- _disable_test main.func_time "Dependent on time test was written" |
6861 |
- |
6862 |
- _disable_test compat/oracle.plugin "Needs example plugin which Gentoo disables" |
6863 |
- |
6864 |
- # run mysql-test tests |
6865 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
6866 |
- retstatus_tests=$? |
6867 |
- |
6868 |
- popd > /dev/null || die |
6869 |
- |
6870 |
- # Cleanup is important for these testcases. |
6871 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
6872 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
6873 |
- |
6874 |
- local failures="" |
6875 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
6876 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
6877 |
- |
6878 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
6879 |
- einfo "Tests successfully completed" |
6880 |
-} |
6881 |
- |
6882 |
-mysql_init_vars() { |
6883 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
6884 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
6885 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
6886 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
6887 |
- |
6888 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
6889 |
- MY_DATADIR="" |
6890 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
6891 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
6892 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
6893 |
- | tail -n1` |
6894 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
6895 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
6896 |
- | sed -e 's/.*=\s*//' \ |
6897 |
- | tail -n1` |
6898 |
- fi |
6899 |
- fi |
6900 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
6901 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
6902 |
- einfo "Using default MY_DATADIR" |
6903 |
- fi |
6904 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
6905 |
- |
6906 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
6907 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
6908 |
- # If you get this and you're wondering about it, see bug #207636 |
6909 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
6910 |
- elog "A new one will not be created." |
6911 |
- PREVIOUS_DATADIR="yes" |
6912 |
- else |
6913 |
- PREVIOUS_DATADIR="no" |
6914 |
- fi |
6915 |
- export PREVIOUS_DATADIR |
6916 |
- fi |
6917 |
- else |
6918 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
6919 |
- local new_MY_DATADIR |
6920 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
6921 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
6922 |
- | tail -n1` |
6923 |
- |
6924 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
6925 |
- ewarn "MySQL MY_DATADIR has changed" |
6926 |
- ewarn "from ${MY_DATADIR}" |
6927 |
- ewarn "to ${new_MY_DATADIR}" |
6928 |
- MY_DATADIR="${new_MY_DATADIR}" |
6929 |
- fi |
6930 |
- fi |
6931 |
- fi |
6932 |
- |
6933 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
6934 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
6935 |
- export MY_DATADIR |
6936 |
-} |
6937 |
- |
6938 |
-pkg_config() { |
6939 |
- _getoptval() { |
6940 |
- local mypd="${EROOT}"/usr/libexec/mariadb/my_print_defaults |
6941 |
- local section="$1" |
6942 |
- local flag="--${2}=" |
6943 |
- local extra_options="${3}" |
6944 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
6945 |
- } |
6946 |
- local old_MY_DATADIR="${MY_DATADIR}" |
6947 |
- local old_HOME="${HOME}" |
6948 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
6949 |
- export HOME=${EPREFIX}/root |
6950 |
- |
6951 |
- # Make sure the vars are correctly initialized |
6952 |
- mysql_init_vars |
6953 |
- |
6954 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
6955 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
6956 |
- die "Minimal builds do NOT include the MySQL server" |
6957 |
- fi |
6958 |
- |
6959 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
6960 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
6961 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
6962 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
6963 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
6964 |
- |
6965 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
6966 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
6967 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
6968 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
6969 |
- else |
6970 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
6971 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
6972 |
- || die "Moving MY_DATADIR failed" |
6973 |
- fi |
6974 |
- else |
6975 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
6976 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
6977 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
6978 |
- else |
6979 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
6980 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
6981 |
- fi |
6982 |
- fi |
6983 |
- fi |
6984 |
- |
6985 |
- local pwd1="a" |
6986 |
- local pwd2="b" |
6987 |
- local maxtry=15 |
6988 |
- |
6989 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
6990 |
- local tmp_mysqld_password_source= |
6991 |
- |
6992 |
- for tmp_mysqld_password_source in mysql client; do |
6993 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
6994 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
6995 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
6996 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
6997 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
6998 |
- MYSQL_ROOT_PASSWORD= |
6999 |
- continue |
7000 |
- fi |
7001 |
- |
7002 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
7003 |
- break |
7004 |
- fi |
7005 |
- done |
7006 |
- |
7007 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
7008 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
7009 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
7010 |
- fi |
7011 |
- |
7012 |
- unset tmp_mysqld_password_source |
7013 |
- fi |
7014 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" |
7015 |
- # These are dir+prefix |
7016 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" |
7017 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
7018 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" |
7019 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
7020 |
- |
7021 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
7022 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
7023 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
7024 |
- fi |
7025 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
7026 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
7027 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
7028 |
- fi |
7029 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
7030 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
7031 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
7032 |
- fi |
7033 |
- |
7034 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
7035 |
- ewarn "You have already a MySQL database in place." |
7036 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
7037 |
- ewarn "Please rename or delete it if you wish to replace it." |
7038 |
- die "MySQL database already exists!" |
7039 |
- fi |
7040 |
- |
7041 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
7042 |
- # localhost. Also causes weird failures. |
7043 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
7044 |
- |
7045 |
- if [[ -z "${MYSQL_ROOT_PASSWORD}" ]]; then |
7046 |
- |
7047 |
- einfo "Please provide a password for the mysql 'root'@'localhost' user now" |
7048 |
- einfo "or through the ${HOME}/.my.cnf file." |
7049 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
7050 |
- einfo "Not entering a password defaults to UNIX authentication" |
7051 |
- read -rsp " >" pwd1 ; echo |
7052 |
- |
7053 |
- if [[ -n "${pwd1}" ]] ; then |
7054 |
- |
7055 |
- einfo "Retype the password" |
7056 |
- read -rsp " >" pwd2 ; echo |
7057 |
- |
7058 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
7059 |
- die "Passwords are not the same" |
7060 |
- fi |
7061 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
7062 |
- fi |
7063 |
- unset pwd1 pwd2 |
7064 |
- fi |
7065 |
- |
7066 |
- local options |
7067 |
- local sqltmp="$(emktemp)" |
7068 |
- |
7069 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
7070 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
7071 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
7072 |
- |
7073 |
- # Figure out which options we need to disable to do the setup |
7074 |
- local helpfile="${TMPDIR}/mysqld-help" |
7075 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
7076 |
- for opt in host-cache name-resolve networking slave-start \ |
7077 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
7078 |
- log-slave-updates \ |
7079 |
- ; do |
7080 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
7081 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
7082 |
- done |
7083 |
- |
7084 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
7085 |
- |
7086 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
7087 |
- PID_DIR="${EROOT}/var/run/mysqld" |
7088 |
- if [[ ! -d "${PID_DIR}" ]]; then |
7089 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
7090 |
- fi |
7091 |
- |
7092 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
7093 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
7094 |
- fi |
7095 |
- |
7096 |
- pushd "${TMPDIR}" &>/dev/null || die |
7097 |
- |
7098 |
- # Filling timezones, see |
7099 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
7100 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
7101 |
- |
7102 |
- local cmd=( "${EROOT}/usr/share/mariadb/scripts/mysql_install_db" ) |
7103 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}/usr/bin/mysql_install_db" ) |
7104 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
7105 |
- einfo "Command: ${cmd[*]}" |
7106 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
7107 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
7108 |
- if [[ $? -ne 0 ]]; then |
7109 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
7110 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
7111 |
- fi |
7112 |
- popd &>/dev/null || die |
7113 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
7114 |
- || die "MySQL databases not installed" |
7115 |
- |
7116 |
- if [[ -z ${sqltmp} && -z ${MYSQL_ROOT_PASSWORD} ]] ; then |
7117 |
- einfo "Done" |
7118 |
- exit 0 |
7119 |
- fi |
7120 |
- |
7121 |
- use prefix || options="${options} --user=mysql" |
7122 |
- |
7123 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
7124 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
7125 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
7126 |
- ${options} \ |
7127 |
- --log-warnings=0 \ |
7128 |
- --basedir=${EROOT}/usr \ |
7129 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
7130 |
- --max_allowed_packet=8M \ |
7131 |
- --net_buffer_length=16K \ |
7132 |
- --socket=${socket} \ |
7133 |
- --pid-file=${pidfile} \ |
7134 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
7135 |
- #einfo "About to start mysqld: ${mysqld}" |
7136 |
- ebegin "Starting mysqld" |
7137 |
- einfo "Command ${mysqld}" |
7138 |
- ${mysqld} & |
7139 |
- rc=$? |
7140 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
7141 |
- maxtry=$((${maxtry}-1)) |
7142 |
- echo -n "." |
7143 |
- sleep 1 |
7144 |
- done |
7145 |
- eend $rc |
7146 |
- |
7147 |
- [[ -S "${socket}" ]] || |
7148 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
7149 |
- |
7150 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then |
7151 |
- ebegin "Setting root password" |
7152 |
- # Do this from memory, as we don't want clear text passwords in temp files |
7153 |
- local sql="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}')" |
7154 |
- "${EROOT}/usr/bin/mysql" \ |
7155 |
- "--socket=${socket}" \ |
7156 |
- -hlocalhost \ |
7157 |
- -e "${sql}" |
7158 |
- unset sql |
7159 |
- eend $? |
7160 |
- fi |
7161 |
- |
7162 |
- if [[ -n "${sqltmp}" ]] ; then |
7163 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
7164 |
- "${EROOT}/usr/bin/mysql" \ |
7165 |
- "--socket=${socket}" \ |
7166 |
- -hlocalhost \ |
7167 |
- -uroot \ |
7168 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
7169 |
- mysql < "${sqltmp}" |
7170 |
- rc=$? |
7171 |
- eend $? |
7172 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
7173 |
- fi |
7174 |
- |
7175 |
- # Stop the server and cleanup |
7176 |
- einfo "Stopping the server ..." |
7177 |
- kill $(< "${pidfile}" ) |
7178 |
- rm -f "${sqltmp}" |
7179 |
- wait %1 |
7180 |
- einfo "Done" |
7181 |
-} |
7182 |
|
7183 |
diff --git a/dev-db/mariadb/mariadb-5.5.65.ebuild b/dev-db/mariadb/mariadb-5.5.65.ebuild |
7184 |
deleted file mode 100644 |
7185 |
index 95a42210c81..00000000000 |
7186 |
--- a/dev-db/mariadb/mariadb-5.5.65.ebuild |
7187 |
+++ /dev/null |
7188 |
@@ -1,836 +0,0 @@ |
7189 |
-# Copyright 1999-2019 Gentoo Authors |
7190 |
-# Distributed under the terms of the GNU General Public License v2 |
7191 |
- |
7192 |
-EAPI="6" |
7193 |
-MY_EXTRAS_VER="20180809-1700Z" |
7194 |
-SUBSLOT="18" |
7195 |
- |
7196 |
-# Keeping eutils in EAPI=6 for emktemp in pkg_config |
7197 |
- |
7198 |
-inherit eutils flag-o-matic prefix toolchain-funcs user cmake-utils multilib-build |
7199 |
- |
7200 |
-SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz " |
7201 |
- |
7202 |
-# Gentoo patches to MySQL |
7203 |
-if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then |
7204 |
- SRC_URI="${SRC_URI} |
7205 |
- mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
7206 |
- https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
7207 |
- https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
7208 |
- https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
7209 |
- https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
7210 |
-fi |
7211 |
- |
7212 |
-HOMEPAGE="https://mariadb.org/" |
7213 |
-DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
7214 |
-LICENSE="GPL-2" |
7215 |
-SLOT="0/${SUBSLOT:-0}" |
7216 |
-IUSE="bindist client-libs debug extraengine jemalloc latin1 libressl |
7217 |
- oqgraph pam +perl profiling selinux +server sphinx |
7218 |
- static static-libs systemtap tcmalloc |
7219 |
- test tokudb yassl" |
7220 |
- |
7221 |
-# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests |
7222 |
-RESTRICT="!bindist? ( bindist ) libressl? ( test )" |
7223 |
- |
7224 |
-REQUIRED_USE="server? ( tokudb? ( jemalloc !tcmalloc ) ) |
7225 |
- ?? ( tcmalloc jemalloc ) |
7226 |
- static? ( yassl !pam )" |
7227 |
- |
7228 |
-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" |
7229 |
- |
7230 |
-# Shorten the path because the socket path length must be shorter than 107 chars |
7231 |
-# and we will run a mysql server during test phase |
7232 |
-S="${WORKDIR}/mysql" |
7233 |
- |
7234 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then |
7235 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" |
7236 |
- inherit git-r3 |
7237 |
- EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git" |
7238 |
- EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" |
7239 |
- EGIT_CLONE_TYPE=shallow |
7240 |
-else |
7241 |
- MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" |
7242 |
-fi |
7243 |
- |
7244 |
-PATCHES=( |
7245 |
- "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch" |
7246 |
- "${MY_PATCH_DIR}/20004_all_mariadb-filter-tokudb-flags.patch" |
7247 |
- "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-5.5.50.patch" |
7248 |
- "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch" |
7249 |
- "${MY_PATCH_DIR}/20018_all_mariadb-5.5.60-without-clientlibs-tools.patch" |
7250 |
-) |
7251 |
- |
7252 |
-# Be warned, *DEPEND are version-dependant |
7253 |
-# These are used for both runtime and compiletime |
7254 |
-COMMON_DEPEND=" |
7255 |
- kernel_linux? ( |
7256 |
- sys-process/procps:0= |
7257 |
- dev-libs/libaio:0= |
7258 |
- ) |
7259 |
- >=sys-apps/sed-4 |
7260 |
- >=sys-apps/texinfo-4.7-r1 |
7261 |
- jemalloc? ( dev-libs/jemalloc:0= ) |
7262 |
- tcmalloc? ( dev-util/google-perftools:0= ) |
7263 |
- systemtap? ( >=dev-util/systemtap-1.3:0= ) |
7264 |
- !yassl? ( |
7265 |
- !libressl? ( <dev-libs/openssl-1.1.0:0= ) |
7266 |
- libressl? ( dev-libs/libressl:0= ) |
7267 |
- ) |
7268 |
- >=sys-libs/zlib-1.2.3:0= |
7269 |
- sys-libs/ncurses:0= |
7270 |
- !bindist? ( |
7271 |
- >=sys-libs/readline-4.1:0= |
7272 |
- ) |
7273 |
- server? ( |
7274 |
- oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) |
7275 |
- pam? ( sys-libs/pam:0= ) |
7276 |
- ) |
7277 |
- !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) |
7278 |
-" |
7279 |
-DEPEND="virtual/yacc |
7280 |
- static? ( sys-libs/ncurses[static-libs] ) |
7281 |
- || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
7282 |
- ${COMMON_DEPEND}" |
7283 |
-RDEPEND="selinux? ( sec-policy/selinux-mysql ) |
7284 |
- client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) |
7285 |
- !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster |
7286 |
- server? ( !prefix? ( dev-db/mysql-init-scripts ) ) |
7287 |
- ${COMMON_DEPEND} |
7288 |
- perl? ( !dev-db/mytop |
7289 |
- virtual/perl-Getopt-Long |
7290 |
- dev-perl/TermReadKey |
7291 |
- virtual/perl-Term-ANSIColor |
7292 |
- virtual/perl-Time-HiRes ) |
7293 |
-" |
7294 |
-# For other stuff to bring us in |
7295 |
-# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
7296 |
-PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" |
7297 |
- |
7298 |
-pkg_setup() { |
7299 |
- if [[ ${MERGE_TYPE} != binary ]] ; then |
7300 |
- local GCC_MAJOR_SET=$(gcc-major-version) |
7301 |
- local GCC_MINOR_SET=$(gcc-minor-version) |
7302 |
- if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
7303 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
7304 |
- eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." |
7305 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
7306 |
- die |
7307 |
- fi |
7308 |
- # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on |
7309 |
- # non x86{,_64} arches |
7310 |
- if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ |
7311 |
- ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then |
7312 |
- eerror "${PN} needs to be built with gcc-4.7 or later." |
7313 |
- eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
7314 |
- die |
7315 |
- fi |
7316 |
- fi |
7317 |
- if has test ${FEATURES} && \ |
7318 |
- use server && ! has userpriv ${FEATURES} ; then |
7319 |
- eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
7320 |
- fi |
7321 |
- |
7322 |
- # This should come after all of the die statements |
7323 |
- enewgroup mysql 60 || die "problem adding 'mysql' group" |
7324 |
- enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
7325 |
-} |
7326 |
- |
7327 |
-pkg_postinst() { |
7328 |
- # Make sure the vars are correctly initialized |
7329 |
- mysql_init_vars |
7330 |
- |
7331 |
- # Create log directory securely if it does not exist |
7332 |
- [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
7333 |
- |
7334 |
- if use server ; then |
7335 |
- if use pam; then |
7336 |
- einfo |
7337 |
- elog "This install includes the PAM authentication plugin." |
7338 |
- elog "To activate and configure the PAM plugin, please read:" |
7339 |
- elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/" |
7340 |
- einfo |
7341 |
- fi |
7342 |
- |
7343 |
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
7344 |
- einfo |
7345 |
- elog "You might want to run:" |
7346 |
- elog "\"emerge --config =${CATEGORY}/${PF}\"" |
7347 |
- elog "if this is a new install." |
7348 |
- elog |
7349 |
- elog "If you are switching server implentations, you should run the" |
7350 |
- elog "mysql_upgrade tool." |
7351 |
- einfo |
7352 |
- else |
7353 |
- einfo |
7354 |
- elog "If you are upgrading major versions, you should run the" |
7355 |
- elog "mysql_upgrade tool." |
7356 |
- einfo |
7357 |
- fi |
7358 |
- |
7359 |
- einfo |
7360 |
- elog "Be sure to edit the my.cnf file to activate your cluster settings." |
7361 |
- elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" |
7362 |
- elog "The first time the cluster is activated, you should add" |
7363 |
- elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." |
7364 |
- elog "This option should then be removed for subsequent starts." |
7365 |
- einfo |
7366 |
- fi |
7367 |
-} |
7368 |
- |
7369 |
-src_unpack() { |
7370 |
- unpack ${A} |
7371 |
- # Grab the patches |
7372 |
- [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack |
7373 |
- |
7374 |
- mv -f "${WORKDIR%/}/${P}" "${S}" || die |
7375 |
-} |
7376 |
- |
7377 |
-src_prepare() { |
7378 |
- _disable_engine() { |
7379 |
- echo > "${S%/}/storage/${1}/CMakeLists.txt" || die |
7380 |
- } |
7381 |
- |
7382 |
- _disable_plugin() { |
7383 |
- echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die |
7384 |
- } |
7385 |
- |
7386 |
- if use tcmalloc; then |
7387 |
- echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die |
7388 |
- fi |
7389 |
- |
7390 |
- # Don't build bundled xz-utils for tokudb |
7391 |
- echo > "${S%/}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" || die |
7392 |
- sed -i -e 's/ build_lzma//' "${S%/}/storage/tokudb/ft-index/ft/CMakeLists.txt" || die |
7393 |
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S%/}/storage/tokudb/ft-index/portability/CMakeLists.txt" || die |
7394 |
- |
7395 |
- local plugin |
7396 |
- local server_plugins=( handler_socket auth_socket feedback qc_info server_audit semisync sql_errlog ) |
7397 |
- local test_plugins=( audit_null auth_examples daemon_example fulltext ) |
7398 |
- if ! use server; then # These plugins are for the server |
7399 |
- for plugin in "${server_plugins[@]}" ; do |
7400 |
- _disable_plugin "${plugin}" |
7401 |
- done |
7402 |
- fi |
7403 |
- |
7404 |
- if ! use test; then # These plugins are only used during testing |
7405 |
- for plugin in "${test_plugins[@]}" ; do |
7406 |
- _disable_plugin "${plugin}" |
7407 |
- done |
7408 |
- fi |
7409 |
- |
7410 |
- # Collides with mariadb-connector-c bug 655980 |
7411 |
- _disable_plugin auth_dialog |
7412 |
- |
7413 |
- # Don't build example |
7414 |
- _disable_engine example |
7415 |
- |
7416 |
- if ! use oqgraph ; then # avoids extra library checks |
7417 |
- _disable_engine oqgraph |
7418 |
- fi |
7419 |
- |
7420 |
- # Don't clash with dev-db/mysql-connector-c |
7421 |
- sed -i -e 's/ my_print_defaults.1//' \ |
7422 |
- -e 's/ perror.1//' \ |
7423 |
- "${S}"/man/CMakeLists.txt || die |
7424 |
- |
7425 |
- cmake-utils_src_prepare |
7426 |
-} |
7427 |
- |
7428 |
-src_configure(){ |
7429 |
- # bug 508724 mariadb cannot use ld.gold |
7430 |
- tc-ld-disable-gold |
7431 |
- # Bug #114895, bug #110149 |
7432 |
- filter-flags "-O" "-O[01]" |
7433 |
- |
7434 |
- append-cxxflags -felide-constructors |
7435 |
- |
7436 |
- # bug #283926, with GCC4.4, this is required to get correct behavior. |
7437 |
- append-flags -fno-strict-aliasing |
7438 |
- |
7439 |
- CMAKE_BUILD_TYPE="RelWithDebInfo" |
7440 |
- |
7441 |
- # debug hack wrt #497532 |
7442 |
- mycmakeargs=( |
7443 |
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
7444 |
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" |
7445 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr" |
7446 |
- -DDEFAULT_SYSCONFDIR="${EPREFIX%/}/etc/mysql" |
7447 |
- -DINSTALL_BINDIR=bin |
7448 |
- -DINSTALL_DOCDIR=share/doc/${PF} |
7449 |
- -DINSTALL_DOCREADMEDIR=share/doc/${PF} |
7450 |
- -DINSTALL_INCLUDEDIR=include/mysql |
7451 |
- -DINSTALL_INFODIR=share/info |
7452 |
- -DINSTALL_LIBDIR=$(get_libdir) |
7453 |
- -DINSTALL_MANDIR=share/man |
7454 |
- -DINSTALL_MYSQLSHAREDIR=share/mariadb |
7455 |
- -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin |
7456 |
- -DINSTALL_SCRIPTDIR=share/mariadb/scripts |
7457 |
- -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql" |
7458 |
- -DINSTALL_SBINDIR=sbin |
7459 |
- -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mariadb" |
7460 |
- -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" |
7461 |
- -DWITH_UNIT_TESTS=$(usex test ON OFF) |
7462 |
- -DWITH_ZLIB=system |
7463 |
- -DENABLED_LOCAL_INFILE=1 |
7464 |
- -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
7465 |
- -DINSTALL_UNIX_ADDRDIR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" |
7466 |
- # The build forces this to be defined when cross-compiling. We pass it |
7467 |
- # all the time for simplicity and to make sure it is actually correct. |
7468 |
- -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) |
7469 |
- -DWITHOUT_CLIENTLIBS=YES |
7470 |
- -DWITH_READLINE=$(usex bindist 1 0) |
7471 |
- -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1) |
7472 |
- -DENABLE_DTRACE=$(usex systemtap) |
7473 |
- ) |
7474 |
- if use test ; then |
7475 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test ) |
7476 |
- else |
7477 |
- mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) |
7478 |
- fi |
7479 |
- |
7480 |
- if ! use yassl ; then |
7481 |
- mycmakeargs+=( -DWITH_SSL=system ) |
7482 |
- else |
7483 |
- mycmakeargs+=( -DWITH_SSL=bundled ) |
7484 |
- fi |
7485 |
- |
7486 |
- if use server ; then |
7487 |
- |
7488 |
- # Federated{,X} must be treated special otherwise they will not be built as plugins |
7489 |
- if ! use extraengine ; then |
7490 |
- mycmakeargs+=( |
7491 |
- -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 |
7492 |
- -DWITHOUT_FEDERATEDX_STORAGE_ENGINE=1 ) |
7493 |
- fi |
7494 |
- |
7495 |
- mycmakeargs+=( |
7496 |
- -DWITH_JEMALLOC=$(usex jemalloc system) |
7497 |
- -D$(usex sphinx WITH WITHOUT)_SPHINX_STORAGE_ENGINE=1 |
7498 |
- -D$(usex tokudb WITH WITHOUT)_TOKUDB_STORAGE_ENGINE=1 |
7499 |
- -D$(usex oqgraph WITH WITHOUT)_AUTH_PAM=1 |
7500 |
- -DINSTALL_SQLBENCHDIR=share/mariadb |
7501 |
- ) |
7502 |
- |
7503 |
- if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
7504 |
- ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
7505 |
- ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
7506 |
- ewarn "You MUST file bugs without these variables set." |
7507 |
- |
7508 |
- mycmakeargs+=( |
7509 |
- -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} |
7510 |
- -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} |
7511 |
- ) |
7512 |
- |
7513 |
- elif ! use latin1 ; then |
7514 |
- mycmakeargs+=( |
7515 |
- -DDEFAULT_CHARSET=utf8 |
7516 |
- -DDEFAULT_COLLATION=utf8_general_ci |
7517 |
- ) |
7518 |
- else |
7519 |
- mycmakeargs+=( |
7520 |
- -DDEFAULT_CHARSET=latin1 |
7521 |
- -DDEFAULT_COLLATION=latin1_swedish_ci |
7522 |
- ) |
7523 |
- fi |
7524 |
- mycmakeargs+=( |
7525 |
- -DEXTRA_CHARSETS=all |
7526 |
- -DDISABLE_SHARED=$(usex static YES NO) |
7527 |
- -DWITH_EMBEDDED_SERVER=OFF |
7528 |
- -DENABLED_PROFILING=$(usex profiling) |
7529 |
- ) |
7530 |
- |
7531 |
- if use static; then |
7532 |
- mycmakeargs+=( -DWITH_PIC=1 ) |
7533 |
- fi |
7534 |
- |
7535 |
- if use jemalloc || use tcmalloc ; then |
7536 |
- mycmakeargs+=( -DWITH_SAFEMALLOC=OFF ) |
7537 |
- fi |
7538 |
- |
7539 |
- # Storage engines |
7540 |
- mycmakeargs+=( |
7541 |
- -DWITH_ARCHIVE_STORAGE_ENGINE=1 |
7542 |
- -DWITH_BLACKHOLE_STORAGE_ENGINE=1 |
7543 |
- -DWITH_CSV_STORAGE_ENGINE=1 |
7544 |
- -DWITH_HEAP_STORAGE_ENGINE=1 |
7545 |
- -DWITH_INNOBASE_STORAGE_ENGINE=1 |
7546 |
- -DWITH_MYISAMMRG_STORAGE_ENGINE=1 |
7547 |
- -DWITH_MYISAM_STORAGE_ENGINE=1 |
7548 |
- -DWITH_PARTITION_STORAGE_ENGINE=1 |
7549 |
- ) |
7550 |
- |
7551 |
- else |
7552 |
- mycmakeargs+=( |
7553 |
- -DWITHOUT_SERVER=1 |
7554 |
- -DEXTRA_CHARSETS=none |
7555 |
- -DINSTALL_SQLBENCHDIR= |
7556 |
- ) |
7557 |
- fi |
7558 |
- |
7559 |
- cmake-utils_src_configure |
7560 |
-} |
7561 |
- |
7562 |
-src_compile() { |
7563 |
- cmake-utils_src_compile |
7564 |
-} |
7565 |
- |
7566 |
-src_install() { |
7567 |
- cmake-utils_src_install |
7568 |
- |
7569 |
- # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used |
7570 |
- if [[ -f "${ED%/}/usr/include/mysql/server/private/config.h" ]] ; then |
7571 |
- rm "${ED%/}/usr/include/mysql/server/private/config.h" || die |
7572 |
- fi |
7573 |
- |
7574 |
- # Make sure the vars are correctly initialized |
7575 |
- mysql_init_vars |
7576 |
- |
7577 |
- # Convenience links |
7578 |
- einfo "Making Convenience links for mysqlcheck multi-call binary" |
7579 |
- dosym "mysqlcheck" "/usr/bin/mysqlanalyze" |
7580 |
- dosym "mysqlcheck" "/usr/bin/mysqlrepair" |
7581 |
- dosym "mysqlcheck" "/usr/bin/mysqloptimize" |
7582 |
- |
7583 |
- # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
7584 |
- if [[ -d "${ED%/}/usr/data" ]] ; then |
7585 |
- rm -Rf "${ED%/}/usr/data" || die |
7586 |
- fi |
7587 |
- |
7588 |
- # Unless they explicitly specific USE=test, then do not install the |
7589 |
- # testsuite. It DOES have a use to be installed, esp. when you want to do a |
7590 |
- # validation of your database configuration after tuning it. |
7591 |
- if ! use test ; then |
7592 |
- rm -rf "${D%/}/${MY_SHAREDSTATEDIR}/mysql-test" |
7593 |
- fi |
7594 |
- |
7595 |
- # Configuration stuff |
7596 |
- einfo "Building default configuration ..." |
7597 |
- insinto "${MY_SYSCONFDIR#${EPREFIX}}" |
7598 |
- [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf |
7599 |
- local mycnf_src="my.cnf-5.5" |
7600 |
- sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
7601 |
- "${FILESDIR%/}/${mycnf_src}" \ |
7602 |
- > "${TMPDIR%/}/my.cnf.ok" || die |
7603 |
- use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok" |
7604 |
- if use latin1 ; then |
7605 |
- sed -i \ |
7606 |
- -e "/character-set/s|utf8|latin1|g" \ |
7607 |
- "${TMPDIR%/}/my.cnf.ok" || die |
7608 |
- fi |
7609 |
- eprefixify "${TMPDIR%/}/my.cnf.ok" |
7610 |
- newins "${TMPDIR}/my.cnf.ok" my.cnf |
7611 |
- |
7612 |
- if use server ; then |
7613 |
- einfo "Including support files and sample configurations" |
7614 |
- docinto "support-files" |
7615 |
- local script |
7616 |
- for script in \ |
7617 |
- "${S%/}"/support-files/magic |
7618 |
- do |
7619 |
- [[ -f "$script" ]] && dodoc "${script}" |
7620 |
- done |
7621 |
- |
7622 |
- docinto "scripts" |
7623 |
- for script in "${S%/}"/scripts/mysql* ; do |
7624 |
- [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" |
7625 |
- done |
7626 |
- # Manually install supporting files that conflict with other packages |
7627 |
- # but are needed for galera and initial installation |
7628 |
- exeinto /usr/libexec/mariadb |
7629 |
- doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror" |
7630 |
- fi |
7631 |
- |
7632 |
- #Remove mytop if perl is not selected |
7633 |
- [[ -e "${ED%/}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED%/}/usr/bin/mytop" |
7634 |
-} |
7635 |
- |
7636 |
-# Official test instructions: |
7637 |
-# USE='extraengine perl server' \ |
7638 |
-# FEATURES='test userpriv -usersandbox' \ |
7639 |
-# ebuild mariadb-X.X.XX.ebuild \ |
7640 |
-# digest clean package |
7641 |
-src_test() { |
7642 |
- |
7643 |
- _disable_test() { |
7644 |
- local rawtestname reason |
7645 |
- rawtestname="${1}" ; shift |
7646 |
- reason="${@}" |
7647 |
- ewarn "test '${rawtestname}' disabled: '${reason}'" |
7648 |
- echo ${rawtestname} : ${reason} >> "${T}/disabled.def" |
7649 |
- } |
7650 |
- |
7651 |
- local TESTDIR="${BUILD_DIR}/mysql-test" |
7652 |
- local retstatus_unit |
7653 |
- local retstatus_tests |
7654 |
- |
7655 |
- if ! use server ; then |
7656 |
- einfo "Skipping server tests due to minimal build." |
7657 |
- return 0 |
7658 |
- fi |
7659 |
- |
7660 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
7661 |
- # localhost. Also causes weird failures. |
7662 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
7663 |
- |
7664 |
- if [[ $UID -eq 0 ]]; then |
7665 |
- die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
7666 |
- fi |
7667 |
- has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox" |
7668 |
- |
7669 |
- einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
7670 |
- |
7671 |
- # Run CTest (test-units) |
7672 |
- cmake-utils_src_test |
7673 |
- retstatus_unit=$? |
7674 |
- |
7675 |
- # Ensure that parallel runs don't die |
7676 |
- export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
7677 |
- # Enable parallel testing, auto will try to detect number of cores |
7678 |
- # You may set this by hand. |
7679 |
- # The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
7680 |
- export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
7681 |
- |
7682 |
- # create directories because mysqladmin might run out of order |
7683 |
- mkdir -p "${T}"/var-tests{,/log} || die |
7684 |
- |
7685 |
- # Run mysql tests |
7686 |
- pushd "${TESTDIR}" > /dev/null || die |
7687 |
- |
7688 |
- touch "${T}/disabled.def" |
7689 |
- # These are failing in MariaDB 5.5 for now and are believed to be |
7690 |
- # false positives: |
7691 |
- # |
7692 |
- # main.information_schema, binlog.binlog_statement_insert_delayed, |
7693 |
- # main.mysqld--help, funcs_1.is_triggers, funcs_1.is_tables_mysql, |
7694 |
- # funcs_1.is_columns_mysql |
7695 |
- # fails due to USE=-latin1 / utf8 default |
7696 |
- # |
7697 |
- # main.mysql_client_test, main.mysql_client_test_nonblock: |
7698 |
- # segfaults at random under Portage only, suspect resource limits. |
7699 |
- # |
7700 |
- # archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam |
7701 |
- # fails due to bad cleanup of previous tests when run in parallel |
7702 |
- # The tool is deprecated anyway |
7703 |
- # Bug 532288 |
7704 |
- |
7705 |
- local t |
7706 |
- for t in main.mysql_client_test main.mysql_client_test_nonblock \ |
7707 |
- binlog.binlog_statement_insert_delayed main.information_schema \ |
7708 |
- main.mysqld--help \ |
7709 |
- archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam \ |
7710 |
- funcs_1.is_triggers funcs_1.is_tables_mysql funcs_1.is_columns_mysql ; do |
7711 |
- _disable_test "$t" "False positives in Gentoo" |
7712 |
- done |
7713 |
- |
7714 |
- if ! use client-libs ; then |
7715 |
- _disable_test main.plugin_auth "Needs client libraries built" |
7716 |
- fi |
7717 |
- |
7718 |
- # run mysql-test tests |
7719 |
- perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" |
7720 |
- retstatus_tests=$? |
7721 |
- |
7722 |
- popd > /dev/null || die |
7723 |
- |
7724 |
- # Cleanup is important for these testcases. |
7725 |
- pkill -9 -f "${S}/ndb" 2>/dev/null |
7726 |
- pkill -9 -f "${S}/sql" 2>/dev/null |
7727 |
- |
7728 |
- local failures="" |
7729 |
- [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
7730 |
- [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
7731 |
- |
7732 |
- [[ -z "$failures" ]] || die "Test failures: $failures" |
7733 |
- einfo "Tests successfully completed" |
7734 |
-} |
7735 |
- |
7736 |
-mysql_init_vars() { |
7737 |
- MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} |
7738 |
- MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} |
7739 |
- MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} |
7740 |
- MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} |
7741 |
- |
7742 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
7743 |
- MY_DATADIR="" |
7744 |
- if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then |
7745 |
- MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
7746 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
7747 |
- | tail -n1` |
7748 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
7749 |
- MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ |
7750 |
- | sed -e 's/.*=\s*//' \ |
7751 |
- | tail -n1` |
7752 |
- fi |
7753 |
- fi |
7754 |
- if [[ -z "${MY_DATADIR}" ]] ; then |
7755 |
- MY_DATADIR="${MY_LOCALSTATEDIR}" |
7756 |
- einfo "Using default MY_DATADIR" |
7757 |
- fi |
7758 |
- elog "MySQL MY_DATADIR is ${MY_DATADIR}" |
7759 |
- |
7760 |
- if [[ -z "${PREVIOUS_DATADIR}" ]] ; then |
7761 |
- if [[ -e "${MY_DATADIR}" ]] ; then |
7762 |
- # If you get this and you're wondering about it, see bug #207636 |
7763 |
- elog "MySQL datadir found in ${MY_DATADIR}" |
7764 |
- elog "A new one will not be created." |
7765 |
- PREVIOUS_DATADIR="yes" |
7766 |
- else |
7767 |
- PREVIOUS_DATADIR="no" |
7768 |
- fi |
7769 |
- export PREVIOUS_DATADIR |
7770 |
- fi |
7771 |
- else |
7772 |
- if [[ ${EBUILD_PHASE} == "config" ]]; then |
7773 |
- local new_MY_DATADIR |
7774 |
- new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ |
7775 |
- | sed -ne '/datadir/s|^--datadir=||p' \ |
7776 |
- | tail -n1` |
7777 |
- |
7778 |
- if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then |
7779 |
- ewarn "MySQL MY_DATADIR has changed" |
7780 |
- ewarn "from ${MY_DATADIR}" |
7781 |
- ewarn "to ${new_MY_DATADIR}" |
7782 |
- MY_DATADIR="${new_MY_DATADIR}" |
7783 |
- fi |
7784 |
- fi |
7785 |
- fi |
7786 |
- |
7787 |
- export MY_SHAREDSTATEDIR MY_SYSCONFDIR |
7788 |
- export MY_LOCALSTATEDIR MY_LOGDIR |
7789 |
- export MY_DATADIR |
7790 |
-} |
7791 |
- |
7792 |
-pkg_config() { |
7793 |
- _getoptval() { |
7794 |
- local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults |
7795 |
- local section="$1" |
7796 |
- local flag="--${2}=" |
7797 |
- local extra_options="${3}" |
7798 |
- "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" |
7799 |
- } |
7800 |
- local old_MY_DATADIR="${MY_DATADIR}" |
7801 |
- local old_HOME="${HOME}" |
7802 |
- # my_print_defaults needs to read stuff in $HOME/.my.cnf |
7803 |
- export HOME=${EPREFIX}/root |
7804 |
- |
7805 |
- # Make sure the vars are correctly initialized |
7806 |
- mysql_init_vars |
7807 |
- |
7808 |
- [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" |
7809 |
- if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then |
7810 |
- die "Minimal builds do NOT include the MySQL server" |
7811 |
- fi |
7812 |
- |
7813 |
- if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
7814 |
- local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
7815 |
- MY_DATADIR_s="${MY_DATADIR_s%%/}" |
7816 |
- local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
7817 |
- old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
7818 |
- |
7819 |
- if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
7820 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
7821 |
- ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
7822 |
- ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
7823 |
- else |
7824 |
- elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" |
7825 |
- mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
7826 |
- || die "Moving MY_DATADIR failed" |
7827 |
- fi |
7828 |
- else |
7829 |
- ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" |
7830 |
- if [[ -d "${MY_DATADIR_s}" ]]; then |
7831 |
- ewarn "Attempting to use ${MY_DATADIR_s}" |
7832 |
- else |
7833 |
- eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" |
7834 |
- die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" |
7835 |
- fi |
7836 |
- fi |
7837 |
- fi |
7838 |
- |
7839 |
- local pwd1="a" |
7840 |
- local pwd2="b" |
7841 |
- local maxtry=15 |
7842 |
- |
7843 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
7844 |
- local tmp_mysqld_password_source= |
7845 |
- |
7846 |
- for tmp_mysqld_password_source in mysql client; do |
7847 |
- einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." |
7848 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" |
7849 |
- if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then |
7850 |
- if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then |
7851 |
- ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" |
7852 |
- MYSQL_ROOT_PASSWORD= |
7853 |
- continue |
7854 |
- fi |
7855 |
- |
7856 |
- einfo "Found password in '${tmp_mysqld_password_source}' section!" |
7857 |
- break |
7858 |
- fi |
7859 |
- done |
7860 |
- |
7861 |
- # Sometimes --show is required to display passwords in some implementations of my_print_defaults |
7862 |
- if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then |
7863 |
- MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" |
7864 |
- fi |
7865 |
- |
7866 |
- unset tmp_mysqld_password_source |
7867 |
- fi |
7868 |
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n 1)" |
7869 |
- # These are dir+prefix |
7870 |
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n 1)" |
7871 |
- MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
7872 |
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n 1)" |
7873 |
- MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
7874 |
- |
7875 |
- if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then |
7876 |
- einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
7877 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" |
7878 |
- fi |
7879 |
- if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then |
7880 |
- einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
7881 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" |
7882 |
- fi |
7883 |
- if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then |
7884 |
- einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
7885 |
- install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" |
7886 |
- fi |
7887 |
- |
7888 |
- if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
7889 |
- ewarn "You have already a MySQL database in place." |
7890 |
- ewarn "(${ROOT}/${MY_DATADIR}/*)" |
7891 |
- ewarn "Please rename or delete it if you wish to replace it." |
7892 |
- die "MySQL database already exists!" |
7893 |
- fi |
7894 |
- |
7895 |
- # Bug #213475 - MySQL _will_ object strenously if your machine is named |
7896 |
- # localhost. Also causes weird failures. |
7897 |
- [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
7898 |
- |
7899 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
7900 |
- |
7901 |
- einfo "Please provide a password for the mysql 'root' user now" |
7902 |
- einfo "or through the ${HOME}/.my.cnf file." |
7903 |
- ewarn "Avoid [\"'\\_%] characters in the password" |
7904 |
- read -rsp " >" pwd1 ; echo |
7905 |
- |
7906 |
- einfo "Retype the password" |
7907 |
- read -rsp " >" pwd2 ; echo |
7908 |
- |
7909 |
- if [[ "x$pwd1" != "x$pwd2" ]] ; then |
7910 |
- die "Passwords are not the same" |
7911 |
- fi |
7912 |
- MYSQL_ROOT_PASSWORD="${pwd1}" |
7913 |
- unset pwd1 pwd2 |
7914 |
- fi |
7915 |
- |
7916 |
- local options |
7917 |
- local sqltmp="$(emktemp)" |
7918 |
- |
7919 |
- # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
7920 |
- # see https://bugs.mysql.com/bug.php?id=31312 |
7921 |
- use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
7922 |
- |
7923 |
- # Figure out which options we need to disable to do the setup |
7924 |
- local helpfile="${TMPDIR}/mysqld-help" |
7925 |
- "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null |
7926 |
- for opt in grant-tables host-cache name-resolve networking slave-start \ |
7927 |
- federated ssl log-bin relay-log slow-query-log external-locking \ |
7928 |
- log-slave-updates \ |
7929 |
- ; do |
7930 |
- optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
7931 |
- egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
7932 |
- done |
7933 |
- |
7934 |
- einfo "Creating the mysql database and setting proper permissions on it ..." |
7935 |
- |
7936 |
- # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it |
7937 |
- PID_DIR="${EROOT}/var/run/mysqld" |
7938 |
- if [[ ! -d "${PID_DIR}" ]]; then |
7939 |
- install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" |
7940 |
- fi |
7941 |
- |
7942 |
- if [[ ! -d "${MY_DATADIR}" ]]; then |
7943 |
- install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" |
7944 |
- fi |
7945 |
- |
7946 |
- pushd "${TMPDIR}" &>/dev/null || die |
7947 |
- |
7948 |
- # Filling timezones, see |
7949 |
- # https://dev.mysql.com/doc/mysql/en/time-zone-support.html |
7950 |
- "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
7951 |
- |
7952 |
- local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) |
7953 |
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) |
7954 |
- cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) |
7955 |
- einfo "Command: ${cmd[*]}" |
7956 |
- su -s /bin/sh -c "${cmd[*]}" mysql \ |
7957 |
- >"${TMPDIR}"/mysql_install_db.log 2>&1 |
7958 |
- if [ $? -ne 0 ]; then |
7959 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
7960 |
- die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
7961 |
- fi |
7962 |
- popd &>/dev/null || die |
7963 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
7964 |
- || die "MySQL databases not installed" |
7965 |
- |
7966 |
- use prefix || options="${options} --user=mysql" |
7967 |
- |
7968 |
- local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
7969 |
- local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
7970 |
- local mysqld="${EROOT}/usr/sbin/mysqld \ |
7971 |
- ${options} \ |
7972 |
- --log-warnings=0 \ |
7973 |
- --basedir=${EROOT}/usr \ |
7974 |
- --datadir=${ROOT}/${MY_DATADIR} \ |
7975 |
- --max_allowed_packet=8M \ |
7976 |
- --net_buffer_length=16K \ |
7977 |
- --socket=${socket} \ |
7978 |
- --pid-file=${pidfile} \ |
7979 |
- --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
7980 |
- #einfo "About to start mysqld: ${mysqld}" |
7981 |
- ebegin "Starting mysqld" |
7982 |
- einfo "Command ${mysqld}" |
7983 |
- ${mysqld} & |
7984 |
- rc=$? |
7985 |
- while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
7986 |
- maxtry=$((${maxtry}-1)) |
7987 |
- echo -n "." |
7988 |
- sleep 1 |
7989 |
- done |
7990 |
- eend $rc |
7991 |
- |
7992 |
- if ! [[ -S "${socket}" ]]; then |
7993 |
- die "Completely failed to start up mysqld with: ${mysqld}" |
7994 |
- fi |
7995 |
- |
7996 |
- ebegin "Setting root password" |
7997 |
- # Do this from memory, as we don't want clear text passwords in temp files |
7998 |
- local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" |
7999 |
- "${EROOT}/usr/bin/mysql" \ |
8000 |
- "--socket=${socket}" \ |
8001 |
- -hlocalhost \ |
8002 |
- -e "${sql}" |
8003 |
- eend $? |
8004 |
- |
8005 |
- if [[ -n "${sqltmp}" ]] ; then |
8006 |
- ebegin "Loading \"zoneinfo\", this step may require a few seconds" |
8007 |
- "${EROOT}/usr/bin/mysql" \ |
8008 |
- "--socket=${socket}" \ |
8009 |
- -hlocalhost \ |
8010 |
- -uroot \ |
8011 |
- --password="${MYSQL_ROOT_PASSWORD}" \ |
8012 |
- mysql < "${sqltmp}" |
8013 |
- rc=$? |
8014 |
- eend $? |
8015 |
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
8016 |
- fi |
8017 |
- |
8018 |
- # Stop the server and cleanup |
8019 |
- einfo "Stopping the server ..." |
8020 |
- kill $(< "${pidfile}" ) |
8021 |
- rm -f "${sqltmp}" |
8022 |
- wait %1 |
8023 |
- einfo "Done" |
8024 |
-} |