summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-05-18 00:10:51 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-05-18 00:10:51 +0100
commiteccb70a7f91b2d22582587f26d1a28bb31408b45 (patch)
tree3223e1fd54201bcf4ebecac6fbe87361cbe643e2 /dev-db
parenta2810985afabcc31d3eace5e61d8ea25b852ba17 (diff)
gentoo resync : 18.05.2019
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/Manifest.gzbin19479 -> 19481 bytes
-rw-r--r--dev-db/libzdb/Manifest2
-rw-r--r--dev-db/libzdb/libzdb-3.1-r1.ebuild2
-rw-r--r--dev-db/mariadb/Manifest10
-rw-r--r--dev-db/mariadb/mariadb-10.1.40.ebuild887
-rw-r--r--dev-db/mariadb/mariadb-10.2.22-r1.ebuild6
-rw-r--r--dev-db/mariadb/mariadb-10.2.24.ebuild972
-rw-r--r--dev-db/mariadb/mariadb-10.3.13.ebuild6
-rw-r--r--dev-db/mariadb/mariadb-5.5.64.ebuild831
-rw-r--r--dev-db/mysql/Manifest2
-rw-r--r--dev-db/mysql/mysql-5.7.26.ebuild (renamed from dev-db/percona-server/percona-server-5.7.24.27.ebuild)204
-rw-r--r--dev-db/percona-server/Manifest3
-rw-r--r--dev-db/pgpool2/Manifest8
-rw-r--r--dev-db/pgpool2/pgpool2-3.7.7.ebuild104
-rw-r--r--dev-db/pgpool2/pgpool2-3.7.8.ebuild2
-rw-r--r--dev-db/pgpool2/pgpool2-4.0.2.ebuild104
-rw-r--r--dev-db/pgpool2/pgpool2-4.0.3.ebuild2
-rw-r--r--dev-db/postgresql/Manifest10
-rw-r--r--dev-db/postgresql/postgresql-10.8.ebuild460
-rw-r--r--dev-db/postgresql/postgresql-11.3.ebuild460
-rw-r--r--dev-db/postgresql/postgresql-9.4.22.ebuild475
-rw-r--r--dev-db/postgresql/postgresql-9.5.17.ebuild481
-rw-r--r--dev-db/postgresql/postgresql-9.6.13.ebuild486
-rw-r--r--dev-db/spatialite/Manifest2
-rw-r--r--dev-db/spatialite/spatialite-4.3.0-r1.ebuild4
-rw-r--r--dev-db/sqlite/Manifest2
-rw-r--r--dev-db/sqlite/sqlite-3.28.0.ebuild2
27 files changed, 5133 insertions, 394 deletions
diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz
index d05173524da5..f941373eb991 100644
--- a/dev-db/Manifest.gz
+++ b/dev-db/Manifest.gz
Binary files differ
diff --git a/dev-db/libzdb/Manifest b/dev-db/libzdb/Manifest
index 5f6612f3230f..7324bf3ca0f4 100644
--- a/dev-db/libzdb/Manifest
+++ b/dev-db/libzdb/Manifest
@@ -9,6 +9,6 @@ EBUILD libzdb-2.11.2.ebuild 1951 BLAKE2B 302b935d57edf84f87d99e32f1b44f2f0e4e85a
EBUILD libzdb-2.11.3.ebuild 1951 BLAKE2B 302b935d57edf84f87d99e32f1b44f2f0e4e85a175774bfd90f8528095b885e45917079947c057f6cb6d4ab6da12d6233a047275012a9a0e5f1d4ada5e29218f SHA512 d928c77f97d1f974561ef951fcdb3774af7880e6a06705df21698012a747475fb64b3c44248bbe4086e13e6373b038896d35c5cc877e57f2bbc3693498799a25
EBUILD libzdb-2.12.ebuild 1949 BLAKE2B 69c6a78a97234e1566c9b4caf7390ea4799252d7a1221639548e15f21445d0ba45ef63ed2607ddb220b622ae54cc3ba70df7a3108a769c78dcfc117c6e88b1ee SHA512 e463dc5edeec408ae42d282319b9cd4e49338fb7cf86a7c26de5ca808d9e4159fce8610f14fb881ae999626be373db4918e5f9162387f0663a7fc99cc6372ca3
EBUILD libzdb-3.0.ebuild 1951 BLAKE2B 302b935d57edf84f87d99e32f1b44f2f0e4e85a175774bfd90f8528095b885e45917079947c057f6cb6d4ab6da12d6233a047275012a9a0e5f1d4ada5e29218f SHA512 d928c77f97d1f974561ef951fcdb3774af7880e6a06705df21698012a747475fb64b3c44248bbe4086e13e6373b038896d35c5cc877e57f2bbc3693498799a25
-EBUILD libzdb-3.1-r1.ebuild 2040 BLAKE2B 707a80236d9f9a0cf272f7349f1f3b86e54e688af920aa80f37179ffe887bf52ff3be27eb3e5caa2f8c43d216aa3b139702c8a77d1d603149f1258bd66e6c169 SHA512 fc8f600bdea08cc4120faf949add27cc72d5a5e2166e3ebc90d70b453718c9bda8302ff4e37a736f272d351e4a933d54f91d05e28f07fb51b052c3d95b45909f
+EBUILD libzdb-3.1-r1.ebuild 2039 BLAKE2B bbd98df269ba3458b4c51df13db7e720d1148c88f0ebc061ce9de5181cce422d286ec826ae1f3ee73f093be495fbb6ea6be7e47ddbf17da924432ce8922e51ae SHA512 5037dac11891644b2d4c7d7e5618099ebe9b307f1902ee946f84d85aa0cf237bc46529c6303a89038774f41aecb7b795f0737c20aaa1d9bb2e00c9fc9489023c
EBUILD libzdb-3.1.ebuild 1947 BLAKE2B 38bad6b83db476257e1996b547668fe6270a5bef50bd94f444cc9c79a71a57ef089961c9ab6fee965cf45da18c6adfb280eaeebe1a1d7e666b01b7c4b667f0f6 SHA512 8ce0096085f71c4a96699816cf916fc1916318a5185b48dd0975b4cfbd062d9ccd36250f47f4232c7ef83a9893ba11adc0d006f6ba9f18e9a4c8e2bb33f0011d
MISC metadata.xml 252 BLAKE2B 607ece46067f5be04418014fa63f92ad521ce98dcd952feb4fcd1bcfcb16fd520bddb62e7f6e14486a7f45a2505cc258067adc1017af98ba9e69a78244bc62a5 SHA512 e7da72c861777d74f6459375f6f43e39f9e4dda779352c3e8942fcd658dcce6f995f016e34a74b331533f1815fba3faa9af024956a804f38a411990878e4bad6
diff --git a/dev-db/libzdb/libzdb-3.1-r1.ebuild b/dev-db/libzdb/libzdb-3.1-r1.ebuild
index 838dc0b0f568..8c61012456ec 100644
--- a/dev-db/libzdb/libzdb-3.1-r1.ebuild
+++ b/dev-db/libzdb/libzdb-3.1-r1.ebuild
@@ -11,7 +11,7 @@ SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 x86"
IUSE="debug doc mysql postgres +sqlite ssl static-libs"
REQUIRED_USE=" || ( postgres mysql sqlite )"
diff --git a/dev-db/mariadb/Manifest b/dev-db/mariadb/Manifest
index 222ae5745a48..e14b847f9efe 100644
--- a/dev-db/mariadb/Manifest
+++ b/dev-db/mariadb/Manifest
@@ -9,9 +9,12 @@ DIST mariadb-10.0.38.tar.gz 64755921 BLAKE2B 64ea08a2256063639021204f8c92d8f27b2
DIST mariadb-10.1.34.tar.gz 65298561 BLAKE2B 3f3af7b8bad68a08f69befd3f3e7bd88b8cf058feb20309dc2cdbd16bf5d015c2cb0d1d9d2fdf831f6183c0b9bb25405124c24b2940467489e05d42c57f7b0a6 SHA512 3c18359006b340dcf724d1fce36dcc19916c42492269a7545e0726172b8f7b84860e10725c74e4458dae34572395f1650bf17838e9058544e0a6cfcbffd54f6d
DIST mariadb-10.1.37.tar.gz 63492946 BLAKE2B 0f19b402c597443ef970cbe2a2d85d51743cc2d05ab741897efb150f007d7be8b645706a2d0dc5a9f91c7a380d2313840f77d6e9b15f3335495f275b415e5a33 SHA512 b7c35cd67ad265ce2e3a4db20a2ae2b78745db96dc70a211f027a39b6dbb3dc900991c2ee1021ee6a97d12489c3e2a70252e2adf348a458af38b99c3de5a4f25
DIST mariadb-10.1.38.tar.gz 63535685 BLAKE2B c179ea2f60287c2bc1c0d1c47ae989ac2653a24063e8344cef2f3062fc6798e18b969e8f9aa8287104ce2518e6c644cb8d3a4650b5a0bc5dfde973e76e618955 SHA512 184582f3a902a989ba3d9c4d21288c014c8b469adbbb4cbabc621c5006022cef29baed8c1140ed4476b124da83b76dfa414295ed0c3374be826e75aca953a77b
+DIST mariadb-10.1.40.tar.gz 63573615 BLAKE2B a57f89c3a9cbfdfc7ff85ec6d7f4231f29a8c2b5df8a86e069e9c077aafc16f60655eab2765a622ec2675fbec4739a477613a42c68f897785443d8366fb5d1a3 SHA512 6b946189c69905f1a23a96d34720f1592353e0095455bf452bba31d53c90143d088f0fd997cac3da0a779840bb6ae6cc30b45144cba474463a8e3a6978a8a8f3
DIST mariadb-10.2.22.tar.gz 71907765 BLAKE2B e7781a9e1bb0becca543ebb0b9e03912fbafa9de45bbd5c7232f92d29b934148dd124ad462bf8aa5aec2e4ee0bf75a03fae5e5fe97a77e1d93095052a577c14b SHA512 cd61d0c2d528b23b975e6ea142560d9b9ebff7ecda6fa9b3659b25b3406e8cc925918f4c3bb0e200ddb8d0520bcaa4d4f70d245b4731896f9ba2f1bdf0a817b2
+DIST mariadb-10.2.24.tar.gz 71965656 BLAKE2B 2e78d7fc98fe6221126b7700c821ec4294af9d474f440857530b41d5633821b9995b732bbcdcba14c6a01f5decc56f506c99def4dc1a9a4dd52253d3045a88c6 SHA512 bd0e8c506e94f063b6cfbb1e7e872b4fdbe9ab704e07ff3af1e1efabb89daa39fec3b06ec5294d9a19fdc680da082d095cd3c5f9e4c4ee6f9ee5ae0514d6bb6f
DIST mariadb-10.3.13.tar.gz 70745600 BLAKE2B f62b6de0566910cd0995954e3b84528bca4d8b99dab79ce1e8b5d4076a223890fc0bb7b43ac3d81c81c0b907cabbc3b042eab936b845ef18d259793759b05d51 SHA512 3cbd93291aa43b235e5b81d953ea69fb32df54fb518f922f69b5485952f01fae693c77b0efac37f414ed7ff132d3b58f899812bdb7be8a5b344c3640e2c3a0dd
DIST mariadb-5.5.63.tar.gz 45946425 BLAKE2B bddfd67d8393ec22c4bc8d7dab2838825394636bd690c04574bdc4da84fbf6c779fcae7f6be5d596458baa732cb5278475f308f03df083cdfcecffc486950d81 SHA512 4699d8af2210e12d0eea659a4d3fd4bfa68ce11a38cffaf939a96cb7a1fe64dd0827d39c3a0a36fa7cc1981a804a9af7a6d5cfaf23a8cfc8440e54c0163c2acb
+DIST mariadb-5.5.64.tar.gz 45953561 BLAKE2B d6efe53e520b829ec337a00efadd7d813afd5e3ee6ac5a298773c7cd1b724d01856979317fe2bcf814af3bdabdbd7c6c3d2e27a60b4cdf6032b1dfd64e54d84d SHA512 3e93044eb30d2ce50fefce503f16f4b542fd647ff4367675147ebe1b1f576b4fbad5c0bb25670136d0758d2b8b0c571119244c87d66565bb9b3471811f5dc6b8
DIST mysql-extras-20180809-1700Z.tar.bz2 322999 BLAKE2B 8b5feb32085dc35b2f68dae985b2d266c4eaa0e956b490050a2df04bbff99bf8623b67e75af9326d84e3ad625c4d86b0d21d23c9a96df5a0c9cd5ed730958970 SHA512 fbd7af9284bbf09d55f128361e7cc52d94f24ac491aac800cd6d61f2e444aeca66a4d5e6ae94c2fb4044e00cec9b232bae9a76a229f87f19d90b7aecf70792ec
DIST mysql-extras-20181104-2252Z.tar.bz2 328613 BLAKE2B c869dbdd8eb8ab6706b52815fae88e0789b955b9d3e89eac305e6de6e1bc9e78ea10ac58efeac0d6478c7f83587910834e9b4c44e3621224f006daae44dc2bf3 SHA512 e0dff23aa6420a9cfcf2f60464381d4b08194759dcd96910cdf94075fa71e90b74fa3dae700f279f421fee68315af37e47054c9422adeb6cc757fa968a1b65bf
DIST mysql-extras-20190305-2052Z.tar.bz2 331304 BLAKE2B 1d2c35a961159fa5ce9ee6699fce943f5a5b5cf60b11c9bb4bcccee4943f4508a9eb6d01050c642353ac592ce1a6b421abf2a1bebc706c44c4c8a36aa698ec43 SHA512 ae63403320e010acbb92f8aec6da8ed4f267cef0bad37147d594076fd94571de7f98bfc2afbe94af5d716f58d57696fd958b1e13e20e87052f252ed4a188cd3c
@@ -21,7 +24,10 @@ EBUILD mariadb-10.0.38.ebuild 27522 BLAKE2B 289f91951215684d00bf45cc65492a5d327b
EBUILD mariadb-10.1.34.ebuild 29472 BLAKE2B 859741b70abf8c2347395b26b7543f36be94165141227bb7dc75f054768490bf891eea5bd2f171aa0c0f8caed7603abf1347a0087caa10e55ce920aaa9c6677b SHA512 ff30a1fcdcc72b8324dec1be29db63a1792ca58474744f0c02014b1fba28d856ac0f154235b0889aedcc95cf24c4b58fcfd681458be726609861ba6f4220ad8f
EBUILD mariadb-10.1.37.ebuild 29473 BLAKE2B a8b53e4ac50557de7186338143c2742e25b64f7ebce59fec92c2d8568c6d3909424c44ec6cdef69874d9e4f82ab7d9b0b08275c016eef21e975440696b2e3967 SHA512 8ebeca8f496b4292fa4209678f9eef33a1395e93a739153da5772e6aab133d19056a7814697c90d4dcfb78ad5d260a53239130534bf51f64e66e90c41a1377df
EBUILD mariadb-10.1.38-r1.ebuild 29464 BLAKE2B cdfd6cac112908ed089928a7d5fbe6f604cf5ded99a2f9c9085acf82c37811301400cdadaa87bf6d94b5239439485ac6e6004aaa73c564d2492e1a94b1ce4a8e SHA512 500509b8ff1afce7e32648369632dc524df8778a6b566b83cb52c4d80354a2d00b1dcb8befcce4be1b31d5b629f0914f3599c94d1dd3a202f5b274e14af25ec6
-EBUILD mariadb-10.2.22-r1.ebuild 32482 BLAKE2B db40f4e0f645c0b148073a3c034d5556c92276cdb8d01ea7ca5ee8c261086a3b17fe58d04a90cf0cc347746b30aee9ca76fa6a362c7876946c4a1513e9408ef5 SHA512 1d545c9aeb1002637909ad01ca9e4fdd737a710c644e13b17fc194b1e46ccb4773db10af1657d09780fca08c1b1304486551ddfcc2b67ccc95a8b5d8c8d2aa25
-EBUILD mariadb-10.3.13.ebuild 32156 BLAKE2B 614cef34e9b4c1048144d5ab6d550d076c008892537c73aff3554b35d86963b6f1cfbaee7a3b4f5abbda0ccff1edbac63dd2a4bd80de167080478b9d328bb47a SHA512 8a7eaf5e95e33fa6f25f95abd6664e0556a7b22affa285d48ea9b97a5bd3affbcaa39dd762e4298d117ed437fffbe311cbd54e5d6e139593fceab75627221dc9
+EBUILD mariadb-10.1.40.ebuild 29512 BLAKE2B b87872354f3fad04ea8267fbed91397510e4ddf1acafd71cddb0dac4b087825978ad46b8ed945cd877c777849870187e02669573b9b5cd27a993e0e1b10dd2df SHA512 ff4251b4fb68c4038d55847807a0d3d331707cef2ff29a717c207c026d6554a23885f0b55c6be49bd0c215a678f61e6a241eb22932a1ef2c6c5b2ee1e8682010
+EBUILD mariadb-10.2.22-r1.ebuild 32515 BLAKE2B dcf2376e7f0f3f47ae5d3c997f2feda6441bf340bcdb26c64220932ee3c3971da712b5567df7cc76ca4528136673348c8335208fe72c91926bb3ca025d899d6d SHA512 cfd00d2fe5499e8378d025e886da35e9e5a29edc4fc0104d0daa783a3ac054c56d24a23cba21f82e0640cfe3fe6b64598128e42b131944b7ac14e544bbc2db8d
+EBUILD mariadb-10.2.24.ebuild 32530 BLAKE2B abfdf9b1131eacbf59acbbdd250c58609db09b306cdc7ffbad02aa7b2b5e976f528c988a489e71c108bc9ead860aaddfdc3ab51af5d851b69f11e62056fa84d7 SHA512 d25d74d44ebff3f9857f1600fd974d4190739cf83aff6a897753847ff98d502951bba97798d7f049cf9053ecd5f8d9df992ba0de5d92f769595e624d8fe547be
+EBUILD mariadb-10.3.13.ebuild 32189 BLAKE2B 1a79ec6ce0ce0bc6d9000368712d25a0d9d0e096f244d3422bb56518fd20439b3c701291d9b75a45420ac6fe1e2dc0d81cf8142c80334001a9ac6087a66a8004 SHA512 a474f4856bd10379da5173f843ff476379672839d68793c5436a8b7618ef1637050b61ddee11f1cb423cf33aacd28fb5e03d03e73b0a415c3a9e7ea7ea8f45d1
EBUILD mariadb-5.5.63.ebuild 27054 BLAKE2B fb6b085846137c6607ccb1b58fdaac6abe8999ad67102b3993b52340dd4c7805640379b79c0a0fe300b237438f836a8b62794c423ebc47707b414f7712214919 SHA512 d9356369a5e93dc1dd1a6c6c332ceac7306cc14b33068739d5fef621ea6f14bf2a36e0b8a9f39500ccb8fb7cf35dae013c9303ade0002459971f48d28097d3de
+EBUILD mariadb-5.5.64.ebuild 27101 BLAKE2B 1ac27c83ba4942c415c073e69e27047418237d4b51bdbb2fd471678c27502e67cddb56f794b957e4fed9ab0e4c03bad5d78db0ea9d6c07100bc87a3533d5285e SHA512 602085111323ab3c8049a7c7a40797dde9928c3f70d15d11eae2128773dd5c71c286565f4a4cdec032f6d03327c1e65df88a520874efaf91d0011951cbfab73c
MISC metadata.xml 2611 BLAKE2B d1b6b11359e92a3d9cb2c58ed35a15e3cf42ab616ed907fa36a5f777168a805ffd03d01bd13fcd30352ef6c5e8b1d80f4e882ffaf8f6445ed3fce2bcc2a92923 SHA512 80395b35839acebbb18ac8d01e8c806bd89f18d32f85fcba41f41ecfc4f1f869dc8c51c90bb21ebd3c9ac30d51d47869a4dcf3b8ce73967e337e6e396b267c97
diff --git a/dev-db/mariadb/mariadb-10.1.40.ebuild b/dev-db/mariadb/mariadb-10.1.40.ebuild
new file mode 100644
index 000000000000..324475b3e089
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.1.40.ebuild
@@ -0,0 +1,887 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20190305-2052Z"
+SUBSLOT="18"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+# Keeping eutils in EAPI=6 for emktemp in pkg_config
+
+inherit eutils systemd flag-o-matic prefix toolchain-funcs java-pkg-opt-2 user cmake-utils multilib-build
+
+SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz "
+
+# Gentoo patches to MySQL
+if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
+ SRC_URI="${SRC_URI}
+ mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
+fi
+
+HOMEPAGE="https://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+LICENSE="GPL-2"
+SLOT="0/${SUBSLOT:-0}"
+IUSE="+backup bindist client-libs cracklib debug extraengine galera jdbc jemalloc kerberos
+ innodb-lz4 innodb-lzo innodb-snappy latin1 libressl mroonga numa odbc oqgraph pam
+ +perl profiling selinux +server sphinx sst-rsync sst-mariabackup sst-xtrabackup
+ systemd systemtap static static-libs tcmalloc test tokudb xml yassl"
+
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
+RESTRICT="!bindist? ( bindist ) libressl? ( test )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static )
+ server? ( tokudb? ( jemalloc !tcmalloc ) )
+ ?? ( tcmalloc jemalloc )
+ static? ( yassl !pam )"
+
+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"
+
+# Shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/mysql"
+
+if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras"
+ inherit git-r3
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras"
+ EGIT_CLONE_TYPE=shallow
+else
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}"
+fi
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mariadb-10.1.27.patch
+ "${MY_PATCH_DIR}"/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.1.16-without-clientlibs-tools.patch
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch
+ "${MY_PATCH_DIR}"/20029_all_mariadb-10.1.37-enable-numa.patch
+ "${MY_PATCH_DIR}"/20035_all_mariadb-10.1-atomic-detection.patch
+)
+
+# Be warned, *DEPEND are version-dependant
+# These are used for both runtime and compiletime
+COMMON_DEPEND="
+ kernel_linux? (
+ sys-process/procps:0=
+ dev-libs/libaio:0=
+ )
+ >=sys-apps/sed-4
+ >=sys-apps/texinfo-4.7-r1
+ jemalloc? ( dev-libs/jemalloc:0= )
+ tcmalloc? ( dev-util/google-perftools:0= )
+ systemtap? ( >=dev-util/systemtap-1.3:0= )
+ !yassl? (
+ !libressl? ( dev-libs/openssl:0= !>=dev-libs/openssl-1.1 )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ >=sys-libs/zlib-1.2.3:0=
+ sys-libs/ncurses:0=
+ !bindist? (
+ sys-libs/binutils-libs:0=
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ backup? ( app-arch/libarchive:0= )
+ cracklib? ( sys-libs/cracklib:0= )
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ innodb-lz4? ( app-arch/lz4 )
+ innodb-lzo? ( dev-libs/lzo )
+ innodb-snappy? ( app-arch/snappy )
+ kerberos? ( virtual/krb5 )
+ mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 )
+ numa? ( sys-process/numactl )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ systemd? ( sys-apps/systemd:= )
+ tokudb? ( app-arch/snappy )
+ )
+ !yassl? ( !libressl? ( !>=dev-libs/openssl-1.1.0 ) )
+ >=dev-libs/libpcre-8.41-r1:3=
+ !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] )
+"
+DEPEND="virtual/yacc
+ static? ( sys-libs/ncurses[static-libs] )
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="selinux? ( sec-policy/selinux-mysql )
+ client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c )
+ !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
+ server? ( !prefix? ( dev-db/mysql-init-scripts ) )
+ ${COMMON_DEPEND}
+ server? ( galera? (
+ sys-apps/iproute2
+ =sys-cluster/galera-25*
+ sst-rsync? ( sys-process/lsof )
+ sst-mariabackup? ( net-misc/socat[ssl] )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ ) )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# For other stuff to bring us in
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )
+ server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )"
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]] ; then
+ local GCC_MAJOR_SET=$(gcc-major-version)
+ local GCC_MINOR_SET=$(gcc-minor-version)
+ if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} with tokudb needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
+ # non x86{,_64} arches
+ if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ fi
+ java-pkg-opt-2_pkg_setup
+ if has test ${FEATURES} && \
+ use server && ! has userpriv ${FEATURES} ; then
+ eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+
+ # This should come after all of the die statements
+ enewgroup mysql 60 || die "problem adding 'mysql' group"
+ enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+}
+
+pkg_postinst() {
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Create log directory securely if it does not exist
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
+
+ if use server ; then
+ if use pam; then
+ einfo
+ elog "This install includes the PAM authentication plugin."
+ elog "To activate and configure the PAM plugin, please read:"
+ elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/"
+ einfo
+ fi
+
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ einfo
+ elog "You might want to run:"
+ elog "\"emerge --config =${CATEGORY}/${PF}\""
+ elog "if this is a new install."
+ elog
+ elog "If you are switching server implentations, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ else
+ einfo
+ elog "If you are upgrading major versions, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ fi
+
+ einfo
+ elog "Be sure to edit the my.cnf file to activate your cluster settings."
+ elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\""
+ elog "The first time the cluster is activated, you should add"
+ elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node."
+ elog "This option should then be removed for subsequent starts."
+ einfo
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ # Grab the patches
+ [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack
+
+ mv -f "${WORKDIR%/}/${PN%%-galera}-${PV}" "${S}" || die
+}
+
+src_prepare() {
+ _disable_engine() {
+ echo > "${S%/}/storage/${1}/CMakeLists.txt" || die
+ }
+
+ _disable_plugin() {
+ echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die
+ }
+
+ if use tcmalloc; then
+ echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die
+ fi
+
+ # Don't build bundled xz-utils for tokudb
+ echo > "${S%/}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
+ sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S%/}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S%/}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die
+
+ local plugin
+ local server_plugins=( handler_socket auth_socket feedback metadata_lock_info
+ locale_info qc_info server_audit semisync sql_errlog )
+ local test_plugins=( audit_null auth_examples daemon_example fulltext )
+ if ! use server; then # These plugins are for the server
+ for plugin in "${server_plugins[@]}" ; do
+ _disable_plugin "${plugin}"
+ done
+ fi
+
+ if ! use test; then # These plugins are only used during testing
+ for plugin in "${test_plugins[@]}" ; do
+ _disable_plugin "${plugin}"
+ done
+ fi
+
+ # Collides with mariadb-connector-c bug 655980
+ _disable_plugin auth_dialog
+
+ # Avoid useless library checks
+ use mroonga || _disable_engine mroonga
+ use oqgraph || _disable_engine oqgraph
+ _disable_engine example
+
+ cmake-utils_src_prepare
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ # Bug #114895, bug #110149
+ filter-flags "-O" "-O[01]"
+
+ append-cxxflags -felide-constructors
+
+ # bug #283926, with GCC4.4, this is required to get correct behavior.
+ append-flags -fno-strict-aliasing
+
+ CMAKE_BUILD_TYPE="RelWithDebInfo"
+
+ # debug hack wrt #497532
+ mycmakeargs=(
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr"
+ -DDEFAULT_SYSCONFDIR="${EPREFIX%/}/etc/mysql"
+ -DINSTALL_BINDIR=bin
+ -DINSTALL_DOCDIR=share/doc/${PF}
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF}
+ -DINSTALL_INCLUDEDIR=include/mysql
+ -DINSTALL_INFODIR=share/info
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DINSTALL_MANDIR=share/man
+ -DINSTALL_MYSQLSHAREDIR=share/mariadb
+ -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mariadb/mysql-test' '')
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin
+ -DINSTALL_SCRIPTDIR=share/mariadb/scripts
+ -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql"
+ -DINSTALL_SBINDIR=sbin
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mariadb"
+ -DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
+ -DWITH_UNIT_TESTS=$(usex test ON OFF)
+ -DWITH_ZLIB=system
+ -DENABLED_LOCAL_INFILE=1
+ -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock"
+ -DINSTALL_UNIX_ADDRDIR="${EPREFIX%/}/var/run/mysqld/mysqld.sock"
+ -DWITH_DEFAULT_COMPILER_OPTIONS=0
+ -DWITH_DEFAULT_FEATURE_SET=0
+ -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)"
+ # The build forces this to be defined when cross-compiling. We pass it
+ # all the time for simplicity and to make sure it is actually correct.
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
+ -DWITHOUT_CLIENTLIBS=YES
+ -DWITH_READLINE=$(usex bindist 1 0)
+ -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1)
+ -DENABLE_DTRACE=$(usex systemtap)
+ -DWITH_SSL=$(usex yassl bundled system)
+ )
+
+ if use server ; then
+
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ mycmakeargs+=(
+ -DPLUGIN_FEDERATED=NO
+ -DPLUGIN_FEDERATEDX=NO )
+ fi
+
+ mycmakeargs+=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO)
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO)
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO)
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO)
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
+ -DPLUGIN_CASSANDRA=NO
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO)
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ # Build failure and autodep wrt bug 639144
+ -DCONNECT_WITH_MONGO=OFF
+ -DWITH_WSREP=$(usex galera)
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
+ -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO)
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO)
+ -DPLUGIN_AUTH_GSSAPI_CLIENT=NO
+ -DWITH_MARIABACKUP=$(usex backup ON OFF)
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF)
+ -DWITH_SYSTEMD=$(usex systemd yes no)
+ -DWITH_NUMA=$(usex numa ON OFF)
+ -DINSTALL_SQLBENCHDIR=''
+ )
+
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
+ ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
+ ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
+ ewarn "You MUST file bugs without these variables set."
+
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
+ )
+
+ elif ! use latin1 ; then
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=utf8
+ -DDEFAULT_COLLATION=utf8_general_ci
+ )
+ else
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=latin1
+ -DDEFAULT_COLLATION=latin1_swedish_ci
+ )
+ fi
+ mycmakeargs+=(
+ -DEXTRA_CHARSETS=all
+ -DMYSQL_USER=mysql
+ -DDISABLE_SHARED=$(usex static YES NO)
+ -DWITH_DEBUG=$(usex debug)
+ -DWITH_EMBEDDED_SERVER=OFF
+ -DENABLED_PROFILING=$(usex profiling)
+ )
+
+ if use static; then
+ mycmakeargs+=( -DWITH_PIC=1 )
+ fi
+
+ if use jemalloc || use tcmalloc ; then
+ mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
+ fi
+
+ # Storage engines
+ mycmakeargs+=(
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1
+ -DWITH_CSV_STORAGE_ENGINE=1
+ -DWITH_HEAP_STORAGE_ENGINE=1
+ -DWITH_INNOBASE_STORAGE_ENGINE=1
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1
+ -DWITH_MYISAM_STORAGE_ENGINE=1
+ -DWITH_PARTITION_STORAGE_ENGINE=1
+ )
+
+ else
+ mycmakeargs+=(
+ -DWITHOUT_SERVER=1
+ -DWITH_EMBEDDED_SERVER=OFF
+ -DEXTRA_CHARSETS=none
+ -DINSTALL_SQLBENCHDIR=
+ -DWITH_SYSTEMD=no
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
+ if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then
+ rm "${ED}/usr/include/mysql/server/private/config.h" || die
+ fi
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Convenience links
+ einfo "Making Convenience links for mysqlcheck multi-call binary"
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair"
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize"
+
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
+ if [[ -d "${ED}/usr/data" ]] ; then
+ rm -Rf "${ED}/usr/data" || die
+ fi
+
+ # Unless they explicitly specific USE=test, then do not install the
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a
+ # validation of your database configuration after tuning it.
+ if ! use test ; then
+ rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test"
+ fi
+
+ # Configuration stuff
+ einfo "Building default configuration ..."
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}"
+ [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
+ local mycnf_src="my.cnf-5.6-r1"
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+ "${FILESDIR}/${mycnf_src}" \
+ > "${TMPDIR}/my.cnf.ok" || die
+ use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok"
+ if use latin1 ; then
+ sed -i \
+ -e "/character-set/s|utf8|latin1|g" \
+ "${TMPDIR}/my.cnf.ok" || die
+ fi
+ eprefixify "${TMPDIR}/my.cnf.ok"
+ newins "${TMPDIR}/my.cnf.ok" my.cnf
+
+ if use server ; then
+ einfo "Including support files and sample configurations"
+ docinto "support-files"
+ local script
+ for script in \
+ "${S}"/support-files/magic
+ do
+ [[ -f "$script" ]] && dodoc "${script}"
+ done
+
+ docinto "scripts"
+ for script in "${S}"/scripts/mysql* ; do
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
+ done
+ # Manually install supporting files that conflict with other packages
+ # but are needed for galera and initial installation
+ exeinto /usr/libexec/mariadb
+ doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror"
+ fi
+
+ #Remove mytop if perl is not selected
+ [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop"
+}
+
+# Official test instructions:
+# USE='extraengine perl server' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+src_test() {
+
+ _disable_test() {
+ local rawtestname reason
+ rawtestname="${1}" ; shift
+ reason="${@}"
+ ewarn "test '${rawtestname}' disabled: '${reason}'"
+ echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
+ }
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+# cmake-utils_src_test
+# retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log} || die
+
+ # Run mysql tests
+ pushd "${TESTDIR}" > /dev/null || die
+
+ touch "${T}/disabled.def"
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+
+ local t
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do
+ _disable_test "$t" "False positive due to varying policies"
+ done
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ rpl.rpl_semi_sync_uninstall_plugin \
+ main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do
+ _disable_test "$t" "False positives in Gentoo"
+ done
+
+ if ! use client-libs ; then
+ _disable_test main.plugin_auth "Needs client libraries built"
+ fi
+
+ _disable_test sys_vars.sysvars_server_notembedded "Broken test" # bug #661700 required profiling always on
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
+ retstatus_tests=$?
+
+ popd > /dev/null || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
+
+mysql_init_vars() {
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"}
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=""
+ if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
+ MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
+ | sed -e 's/.*=\s*//' \
+ | tail -n1`
+ fi
+ fi
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR="${MY_LOCALSTATEDIR}"
+ einfo "Using default MY_DATADIR"
+ fi
+ elog "MySQL MY_DATADIR is ${MY_DATADIR}"
+
+ if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
+ if [[ -e "${MY_DATADIR}" ]] ; then
+ # If you get this and you're wondering about it, see bug #207636
+ elog "MySQL datadir found in ${MY_DATADIR}"
+ elog "A new one will not be created."
+ PREVIOUS_DATADIR="yes"
+ else
+ PREVIOUS_DATADIR="no"
+ fi
+ export PREVIOUS_DATADIR
+ fi
+ else
+ if [[ ${EBUILD_PHASE} == "config" ]]; then
+ local new_MY_DATADIR
+ new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+
+ if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
+ ewarn "MySQL MY_DATADIR has changed"
+ ewarn "from ${MY_DATADIR}"
+ ewarn "to ${new_MY_DATADIR}"
+ MY_DATADIR="${new_MY_DATADIR}"
+ fi
+ fi
+ fi
+
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR
+ export MY_LOCALSTATEDIR MY_LOGDIR
+ export MY_DATADIR
+}
+
+pkg_config() {
+ _getoptval() {
+ local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults
+ local section="$1"
+ local flag="--${2}="
+ local extra_options="${3}"
+ "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
+ }
+ local old_MY_DATADIR="${MY_DATADIR}"
+ local old_HOME="${HOME}"
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf
+ export HOME=${EPREFIX}/root
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
+ if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then
+ die "Minimal builds do NOT include the MySQL server"
+ fi
+
+ if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
+ local MY_DATADIR_s="${ROOT}/${MY_DATADIR}"
+ MY_DATADIR_s="${MY_DATADIR_s%%/}"
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}"
+ old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
+
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
+ ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
+ else
+ elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
+ mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
+ || die "Moving MY_DATADIR failed"
+ fi
+ else
+ ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Attempting to use ${MY_DATADIR_s}"
+ else
+ eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
+ die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
+ fi
+ fi
+ fi
+
+ local pwd1="a"
+ local pwd2="b"
+ local maxtry=15
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+ local tmp_mysqld_password_source=
+
+ for tmp_mysqld_password_source in mysql client; do
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
+ MYSQL_ROOT_PASSWORD=
+ continue
+ fi
+
+ einfo "Found password in '${tmp_mysqld_password_source}' section!"
+ break
+ fi
+ done
+
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
+ fi
+
+ unset tmp_mysqld_password_source
+ fi
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)"
+ # These are dir+prefix
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)"
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)"
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
+
+ if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR"
+ fi
+ if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN"
+ fi
+ if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG"
+ fi
+
+ if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
+ ewarn "You have already a MySQL database in place."
+ ewarn "(${ROOT}/${MY_DATADIR}/*)"
+ ewarn "Please rename or delete it if you wish to replace it."
+ die "MySQL database already exists!"
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+
+ einfo "Please provide a password for the mysql 'root' user now"
+ einfo "or through the ${HOME}/.my.cnf file."
+ ewarn "Avoid [\"'\\_%] characters in the password"
+ read -rsp " >" pwd1 ; echo
+
+ einfo "Retype the password"
+ read -rsp " >" pwd2 ; echo
+
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then
+ die "Passwords are not the same"
+ fi
+ MYSQL_ROOT_PASSWORD="${pwd1}"
+ unset pwd1 pwd2
+ fi
+
+ local options
+ local sqltmp="$(emktemp)"
+
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first,
+ # see https://bugs.mysql.com/bug.php?id=31312
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
+
+ # Figure out which options we need to disable to do the setup
+ local helpfile="${TMPDIR}/mysqld-help"
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
+ for opt in grant-tables host-cache name-resolve networking slave-start \
+ federated ssl log-bin relay-log slow-query-log external-locking \
+ log-slave-updates \
+ ; do
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
+ egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
+ done
+
+ einfo "Creating the mysql database and setting proper permissions on it ..."
+
+ # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
+ PID_DIR="${EROOT}/var/run/mysqld"
+ if [[ ! -d "${PID_DIR}" ]]; then
+ install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
+ fi
+
+ if [[ ! -d "${MY_DATADIR}" ]]; then
+ install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
+ fi
+
+ pushd "${TMPDIR}" &>/dev/null || die
+
+ # Filling timezones, see
+ # https://dev.mysql.com/doc/mysql/en/time-zone-support.html
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
+
+ local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" )
+ [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
+ cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
+ einfo "Command: ${cmd[*]}"
+ su -s /bin/sh -c "${cmd[*]}" mysql \
+ >"${TMPDIR}"/mysql_install_db.log 2>&1
+ if [ $? -ne 0 ]; then
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
+ die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
+ fi
+ popd &>/dev/null || die
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
+ || die "MySQL databases not installed"
+
+ use prefix || options="${options} --user=mysql"
+
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
+ local mysqld="${EROOT}/usr/sbin/mysqld \
+ ${options} \
+ --log-warnings=0 \
+ --basedir=${EROOT}/usr \
+ --datadir=${ROOT}/${MY_DATADIR} \
+ --max_allowed_packet=8M \
+ --net_buffer_length=16K \
+ --socket=${socket} \
+ --pid-file=${pidfile} \
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
+ #einfo "About to start mysqld: ${mysqld}"
+ ebegin "Starting mysqld"
+ einfo "Command ${mysqld}"
+ ${mysqld} &
+ rc=$?
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
+ maxtry=$((${maxtry}-1))
+ echo -n "."
+ sleep 1
+ done
+ eend $rc
+
+ if ! [[ -S "${socket}" ]]; then
+ die "Completely failed to start up mysqld with: ${mysqld}"
+ fi
+
+ ebegin "Setting root password"
+ # Do this from memory, as we don't want clear text passwords in temp files
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -e "${sql}"
+ eend $?
+
+ if [[ -n "${sqltmp}" ]] ; then
+ ebegin "Loading \"zoneinfo\", this step may require a few seconds"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -uroot \
+ --password="${MYSQL_ROOT_PASSWORD}" \
+ mysql < "${sqltmp}"
+ rc=$?
+ eend $?
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
+ fi
+
+ # Stop the server and cleanup
+ einfo "Stopping the server ..."
+ kill $(< "${pidfile}" )
+ rm -f "${sqltmp}"
+ wait %1
+ einfo "Done"
+}
diff --git a/dev-db/mariadb/mariadb-10.2.22-r1.ebuild b/dev-db/mariadb/mariadb-10.2.22-r1.ebuild
index 38e851d55654..c9ef480b83b6 100644
--- a/dev-db/mariadb/mariadb-10.2.22-r1.ebuild
+++ b/dev-db/mariadb/mariadb-10.2.22-r1.ebuild
@@ -813,11 +813,11 @@ pkg_config() {
unset tmp_mysqld_password_source
fi
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)"
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)"
# These are dir+prefix
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)"
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)"
MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)"
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)"
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
diff --git a/dev-db/mariadb/mariadb-10.2.24.ebuild b/dev-db/mariadb/mariadb-10.2.24.ebuild
new file mode 100644
index 000000000000..184959a17cc8
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.2.24.ebuild
@@ -0,0 +1,972 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20190305-2052Z"
+SUBSLOT="18"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+# Keeping eutils in EAPI=6 for emktemp in pkg_config
+
+inherit eutils systemd flag-o-matic prefix toolchain-funcs \
+ java-pkg-opt-2 user cmake-utils
+
+SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz "
+
+# Gentoo patches to MySQL
+if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
+ SRC_URI="${SRC_URI}
+ mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
+fi
+
+HOMEPAGE="https://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+LICENSE="GPL-2 LGPL-2.1+"
+SLOT="0/${SUBSLOT:-0}"
+IUSE="+backup bindist client-libs cracklib debug extraengine galera innodb-lz4
+ innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga
+ numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx
+ sst-rsync sst-mariabackup sst-xtrabackup static systemd systemtap tcmalloc
+ test tokudb xml yassl"
+
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
+RESTRICT="!bindist? ( bindist ) libressl? ( test )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static )
+ server? ( tokudb? ( jemalloc !tcmalloc ) )
+ ?? ( tcmalloc jemalloc )
+ static? ( yassl !pam )"
+
+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"
+
+# Shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/mysql"
+
+if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras"
+ EGIT_CLONE_TYPE=shallow
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras"
+else
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}"
+fi
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.16-without-clientlibs-tools.patch
+ "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch
+ "${MY_PATCH_DIR}"/20035_all_mariadb-10.2-atomic-detection.patch
+)
+
+# Be warned, *DEPEND are version-dependant
+# These are used for both runtime and compiletime
+COMMON_DEPEND="
+ kernel_linux? (
+ sys-process/procps:0=
+ dev-libs/libaio:0=
+ )
+ >=sys-apps/sed-4
+ >=sys-apps/texinfo-4.7-r1
+ jemalloc? ( dev-libs/jemalloc:0= )
+ tcmalloc? ( dev-util/google-perftools:0= )
+ systemtap? ( >=dev-util/systemtap-1.3:0= )
+ >=sys-libs/zlib-1.2.3:0=
+ kerberos? ( virtual/krb5 )
+ yassl? ( net-libs/gnutls:0= )
+ !yassl? (
+ !libressl? ( >=dev-libs/openssl-1.0.0:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ sys-libs/ncurses:0=
+ !bindist? (
+ sys-libs/binutils-libs:0=
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ backup? ( app-arch/libarchive:0= )
+ cracklib? ( sys-libs/cracklib:0= )
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ )
+ innodb-lz4? ( app-arch/lz4 )
+ innodb-lzo? ( dev-libs/lzo )
+ innodb-snappy? ( app-arch/snappy )
+ mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 )
+ numa? ( sys-process/numactl )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ systemd? ( sys-apps/systemd:= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.41-r1:3=
+"
+DEPEND="virtual/yacc
+ static? ( sys-libs/ncurses[static-libs] )
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="selinux? ( sec-policy/selinux-mysql )
+ !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
+ server? ( !prefix? ( dev-db/mysql-init-scripts ) )
+ !<virtual/mysql-5.6-r11
+ ${COMMON_DEPEND}
+ server? ( galera? (
+ sys-apps/iproute2
+ =sys-cluster/galera-25*
+ sst-rsync? ( sys-process/lsof )
+ sst-mariabackup? ( net-misc/socat[ssl] )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ ) )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# For other stuff to bring us in
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )
+ server? ( ~virtual/mysql-5.6[static=]
+ galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )"
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]] ; then
+ local GCC_MAJOR_SET=$(gcc-major-version)
+ local GCC_MINOR_SET=$(gcc-minor-version)
+ if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} with tokudb needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
+ # non x86{,_64} arches
+ if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ fi
+ java-pkg-opt-2_pkg_setup
+ if has test ${FEATURES} && \
+ use server && ! has userpriv ${FEATURES} ; then
+ eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+
+ # This should come after all of the die statements
+ enewgroup mysql 60 || die "problem adding 'mysql' group"
+ enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+
+ # Here we need to see if the implementation switched client libraries
+ # We check if this is a new instance of the package and a client library already exists
+ local SHOW_ABI_MESSAGE libpath
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so")
+ elog "Due to ABI changes when switching between different client libraries,"
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+ elog "Please run: revdep-rebuild --library ${libpath}"
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+ fi
+}
+
+pkg_postinst() {
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Create log directory securely if it does not exist
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
+
+ if use server ; then
+ if use pam; then
+ einfo
+ elog "This install includes the PAM authentication plugin."
+ elog "To activate and configure the PAM plugin, please read:"
+ elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/"
+ einfo
+ fi
+
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ einfo
+ elog "You might want to run:"
+ elog "\"emerge --config =${CATEGORY}/${PF}\""
+ elog "if this is a new install."
+ elog
+ elog "If you are switching server implentations, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ else
+ einfo
+ elog "If you are upgrading major versions, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ fi
+
+ if use galera ; then
+ einfo
+ elog "Be sure to edit the my.cnf file to activate your cluster settings."
+ elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\""
+ elog "The first time the cluster is activated, you should add"
+ elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node."
+ elog "This option should then be removed for subsequent starts."
+ einfo
+ if use sst-xtrabackup ; then
+ ewarn "As per https://mariadb.com/kb/en/meta/xtrabackup_warning/, XtraBackup"
+ ewarn "as an SST is broken by default beginning with 10.2.19 with the setting"
+ ewarn "innodb_safe_truncate=ON. Please migrate to sst-mariabackup instead."
+ ewarn "sst-xtrabackup is being removed in 10.3 and higher."
+ fi
+ fi
+ fi
+
+ # Note about configuration change
+ einfo
+ elog "This version of mariadb reorganizes the configuration from a single my.cnf"
+ elog "to several files in /etc/mysql/${PN}.d."
+ elog "Please backup any changes you made to /etc/mysql/my.cnf"
+ elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension."
+ elog "You may have as many files as needed and they are read alphabetically."
+ elog "Be sure the options have the appropriate section headers, i.e. [mysqld]."
+ einfo
+}
+
+src_unpack() {
+ unpack ${A}
+ # Grab the patches
+ [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack
+
+ mv -f "${WORKDIR%/}/${P}" "${S}" || die
+}
+
+src_prepare() {
+ _disable_plugin() {
+ echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die
+ }
+ _disable_engine() {
+ echo > "${S%/}/storage/${1}/CMakeLists.txt" || die
+ }
+
+ local malloc
+ for malloc in jemalloc tcmalloc ; do
+ if use ${malloc}; then
+ echo "TARGET_LINK_LIBRARIES(mysqld ${malloc})" >> "${S}/sql/CMakeLists.txt"
+ fi
+ done
+
+ # Don't build bundled xz-utils for tokudb
+ echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
+ sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die
+
+ local plugin
+ local server_plugins=( handler_socket auth_socket feedback metadata_lock_info
+ locale_info qc_info server_audit sql_errlog )
+ local test_plugins=( audit_null auth_examples daemon_example fulltext
+ debug_key_management example_key_management )
+ if ! use server; then # These plugins are for the server
+ for plugin in "${server_plugins[@]}" ; do
+ _disable_plugin "${plugin}"
+ done
+ fi
+
+ if ! use test; then # These plugins are only used during testing
+ for plugin in "${test_plugins[@]}" ; do
+ _disable_plugin "${plugin}"
+ done
+ _disable_engine test_sql_discovery
+ fi
+
+ _disable_engine example
+
+ if ! use oqgraph ; then # avoids extra library checks
+ _disable_engine oqgraph
+ fi
+
+ if use mroonga ; then
+ # Remove the bundled groonga
+ # There is no CMake flag, it simply checks for existance
+ rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga"
+ else
+ _disable_engine mroonga
+ fi
+
+ cmake-utils_src_prepare
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ # Bug #114895, bug #110149
+ filter-flags "-O" "-O[01]"
+
+ append-cxxflags -felide-constructors
+
+ # bug #283926, with GCC4.4, this is required to get correct behavior.
+ append-flags -fno-strict-aliasing
+
+ CMAKE_BUILD_TYPE="RelWithDebInfo"
+
+ # debug hack wrt #497532
+ mycmakeargs=(
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql"
+ -DSYSCONFDIR="${EPREFIX}/etc/mysql"
+ -DINSTALL_BINDIR=bin
+ -DINSTALL_DOCDIR=share/doc/${PF}
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF}
+ -DINSTALL_INCLUDEDIR=include/mysql
+ -DINSTALL_INFODIR=share/info
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DINSTALL_MANDIR=share/man
+ -DINSTALL_MYSQLSHAREDIR=share/mariadb
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin
+ -DINSTALL_SCRIPTDIR=share/mariadb/scripts
+ -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql"
+ -DINSTALL_SBINDIR=sbin
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb"
+ -DWITH_COMMENT="Gentoo Linux ${PF}"
+ -DWITH_UNIT_TESTS=$(usex test ON OFF)
+ -DWITH_LIBEDIT=0
+ -DWITH_ZLIB=system
+ -DWITHOUT_LIBWRAP=1
+ -DENABLED_LOCAL_INFILE=1
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_DEFAULT_COMPILER_OPTIONS=0
+ -DWITH_DEFAULT_FEATURE_SET=0
+ -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)"
+ # The build forces this to be defined when cross-compiling. We pass it
+ # all the time for simplicity and to make sure it is actually correct.
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
+ -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)"
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO)
+ -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF)
+ -DCONC_WITH_EXTERNAL_ZLIB=YES
+ -DWITH_EXTERNAL_ZLIB=YES
+ -DSUFFIX_INSTALL_DIR=""
+ -DWITH_UNITTEST=OFF
+ -DWITHOUT_CLIENTLIBS=YES
+ -DCLIENT_PLUGIN_DIALOG=OFF
+ -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF
+ -DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC
+ -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF
+ )
+ if use test ; then
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test )
+ else
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
+ fi
+
+ if ! use yassl ; then
+ mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC )
+ else
+ mycmakeargs+=( -DWITH_SSL=bundled )
+ fi
+
+ # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION
+ mycmakeargs+=(
+ -DWITH_READLINE=$(usex bindist 1 0)
+ -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1)
+ -DENABLE_DTRACE=$(usex systemtap)
+ )
+
+ if use server ; then
+
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ mycmakeargs+=(
+ -DPLUGIN_FEDERATED=NO
+ -DPLUGIN_FEDERATEDX=NO )
+ fi
+
+ mycmakeargs+=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO)
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO)
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO)
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO)
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
+ -DPLUGIN_CASSANDRA=NO
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO)
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ # Build failure and autodep wrt bug 639144
+ -DCONNECT_WITH_MONGO=OFF
+ -DWITH_WSREP=$(usex galera)
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
+ -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO)
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO)
+ -DWITH_MARIABACKUP=$(usex backup ON OFF)
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF)
+ -DINSTALL_SQLBENCHDIR=share/mariadb
+ -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO)
+ # systemd is only linked to for server notification
+ -DWITH_SYSTEMD=$(usex systemd yes no)
+ -DWITH_NUMA=$(usex numa ON OFF)
+ )
+
+ # Workaround for MDEV-14524
+ use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 )
+
+ if use test ; then
+ # This is needed for the new client lib which tests a real, open server
+ mycmakeargs+=( -DSKIP_TESTS=ON )
+ fi
+
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
+ ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
+ ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
+ ewarn "You MUST file bugs without these variables set."
+
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
+ )
+
+ elif ! use latin1 ; then
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=utf8
+ -DDEFAULT_COLLATION=utf8_general_ci
+ )
+ else
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=latin1
+ -DDEFAULT_COLLATION=latin1_swedish_ci
+ )
+ fi
+ mycmakeargs+=(
+ -DEXTRA_CHARSETS=all
+ -DMYSQL_USER=mysql
+ -DDISABLE_SHARED=$(usex static YES NO)
+ -DWITH_DEBUG=$(usex debug)
+ -DWITH_EMBEDDED_SERVER=OFF
+ -DWITH_PROFILING=$(usex profiling)
+ )
+
+ if use static; then
+ mycmakeargs+=( -DWITH_PIC=1 )
+ fi
+
+ if use jemalloc || use tcmalloc ; then
+ mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
+ fi
+
+ # Storage engines
+ mycmakeargs+=(
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1
+ -DWITH_CSV_STORAGE_ENGINE=1
+ -DWITH_HEAP_STORAGE_ENGINE=1
+ -DWITH_INNOBASE_STORAGE_ENGINE=1
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1
+ -DWITH_MYISAM_STORAGE_ENGINE=1
+ -DWITH_PARTITION_STORAGE_ENGINE=1
+ )
+
+ else
+ mycmakeargs+=(
+ -DWITHOUT_SERVER=1
+ -DWITH_EMBEDDED_SERVER=OFF
+ -DEXTRA_CHARSETS=none
+ -DINSTALL_SQLBENCHDIR=
+ -DWITH_SYSTEMD=no
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
+ if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then
+ rm "${ED}/usr/include/mysql/server/private/config.h" || die
+ fi
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Convenience links
+ einfo "Making Convenience links for mysqlcheck multi-call binary"
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair"
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize"
+
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
+ if [[ -d "${ED}/usr/data" ]] ; then
+ rm -Rf "${ED}/usr/data" || die
+ fi
+
+ # Unless they explicitly specific USE=test, then do not install the
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a
+ # validation of your database configuration after tuning it.
+ if ! use test ; then
+ rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test"
+ fi
+
+ # Configuration stuff
+ einfo "Building default configuration ..."
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}"
+ [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
+ cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die
+ eprefixify "${TMPDIR}/my.cnf"
+ doins "${TMPDIR}/my.cnf"
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d"
+ cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die
+ eprefixify "${TMPDIR}/50-distro-client.cnf"
+ doins "${TMPDIR}/50-distro-client.cnf"
+
+ if use server ; then
+ mycnf_src="my.cnf.distro-server"
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+ "${FILESDIR}/${mycnf_src}" \
+ > "${TMPDIR}/my.cnf.ok" || die
+ if use prefix ; then
+ sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \
+ "${TMPDIR}/my.cnf.ok" || die
+ fi
+ if use latin1 ; then
+ sed -i \
+ -e "/character-set/s|utf8|latin1|g" \
+ "${TMPDIR}/my.cnf.ok" || die
+ fi
+ eprefixify "${TMPDIR}/my.cnf.ok"
+ newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
+
+ einfo "Including support files and sample configurations"
+ docinto "support-files"
+ local script
+ for script in \
+ "${S}"/support-files/magic
+ do
+ [[ -f "$script" ]] && dodoc "${script}"
+ done
+
+ docinto "scripts"
+ for script in "${S}"/scripts/mysql* ; do
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
+ done
+ # Manually install supporting files that conflict with other packages
+ # but are needed for galera and initial installation
+ exeinto /usr/libexec/mariadb
+ doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror"
+ fi
+
+ #Remove mytop if perl is not selected
+ [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop"
+}
+
+# Official test instructions:
+# USE='extraengine perl server' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+src_test() {
+
+ _disable_test() {
+ local rawtestname reason
+ rawtestname="${1}" ; shift
+ reason="${@}"
+ ewarn "test '${rawtestname}' disabled: '${reason}'"
+ echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
+ }
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log} || die
+
+ # Run mysql tests
+ pushd "${TESTDIR}" > /dev/null || die
+
+ touch "${T}/disabled.def"
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+
+ local t
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do
+ _disable_test "$t" "False positive due to varying policies"
+ done
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do
+ _disable_test "$t" "False positives in Gentoo"
+ done
+
+ _disable_test main.plugin_auth "Needs client libraries built"
+ _disable_test main.mysqldump "Test fails past 2018-12-31 due to event expiration"
+
+ # Likely environment issues as only number of clients connected fails
+ _disable_test rpl.rpl_semi_sync_uninstall_plugin \
+ "Fails intermittently on parallel testing"
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
+ retstatus_tests=$?
+
+ popd > /dev/null || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
+
+mysql_init_vars() {
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"}
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=""
+ if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
+ MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
+ | sed -e 's/.*=\s*//' \
+ | tail -n1`
+ fi
+ fi
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR="${MY_LOCALSTATEDIR}"
+ einfo "Using default MY_DATADIR"
+ fi
+ elog "MySQL MY_DATADIR is ${MY_DATADIR}"
+
+ if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
+ if [[ -e "${MY_DATADIR}" ]] ; then
+ # If you get this and you're wondering about it, see bug #207636
+ elog "MySQL datadir found in ${MY_DATADIR}"
+ elog "A new one will not be created."
+ PREVIOUS_DATADIR="yes"
+ else
+ PREVIOUS_DATADIR="no"
+ fi
+ export PREVIOUS_DATADIR
+ fi
+ else
+ if [[ ${EBUILD_PHASE} == "config" ]]; then
+ local new_MY_DATADIR
+ new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+
+ if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
+ ewarn "MySQL MY_DATADIR has changed"
+ ewarn "from ${MY_DATADIR}"
+ ewarn "to ${new_MY_DATADIR}"
+ MY_DATADIR="${new_MY_DATADIR}"
+ fi
+ fi
+ fi
+
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR
+ export MY_LOCALSTATEDIR MY_LOGDIR
+ export MY_DATADIR
+}
+
+pkg_config() {
+ _getoptval() {
+ local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults
+ local section="$1"
+ local flag="--${2}="
+ local extra_options="${3}"
+ "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
+ }
+ local old_MY_DATADIR="${MY_DATADIR}"
+ local old_HOME="${HOME}"
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf
+ export HOME=${EPREFIX}/root
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
+ if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then
+ die "Minimal builds do NOT include the MySQL server"
+ fi
+
+ if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
+ local MY_DATADIR_s="${ROOT}/${MY_DATADIR}"
+ MY_DATADIR_s="${MY_DATADIR_s%%/}"
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}"
+ old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
+
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
+ ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
+ else
+ elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
+ mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
+ || die "Moving MY_DATADIR failed"
+ fi
+ else
+ ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Attempting to use ${MY_DATADIR_s}"
+ else
+ eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
+ die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
+ fi
+ fi
+ fi
+
+ local pwd1="a"
+ local pwd2="b"
+ local maxtry=15
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+ local tmp_mysqld_password_source=
+
+ for tmp_mysqld_password_source in mysql client; do
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
+ MYSQL_ROOT_PASSWORD=
+ continue
+ fi
+
+ einfo "Found password in '${tmp_mysqld_password_source}' section!"
+ break
+ fi
+ done
+
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
+ fi
+
+ unset tmp_mysqld_password_source
+ fi
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)"
+ # These are dir+prefix
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)"
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)"
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
+
+ if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR"
+ fi
+ if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN"
+ fi
+ if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG"
+ fi
+
+ if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
+ ewarn "You have already a MySQL database in place."
+ ewarn "(${ROOT}/${MY_DATADIR}/*)"
+ ewarn "Please rename or delete it if you wish to replace it."
+ die "MySQL database already exists!"
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+
+ einfo "Please provide a password for the mysql 'root' user now"
+ einfo "or through the ${HOME}/.my.cnf file."
+ ewarn "Avoid [\"'\\_%] characters in the password"
+ read -rsp " >" pwd1 ; echo
+
+ einfo "Retype the password"
+ read -rsp " >" pwd2 ; echo
+
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then
+ die "Passwords are not the same"
+ fi
+ MYSQL_ROOT_PASSWORD="${pwd1}"
+ unset pwd1 pwd2
+ fi
+
+ local options
+ local sqltmp="$(emktemp)"
+
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first,
+ # see https://bugs.mysql.com/bug.php?id=31312
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
+
+ # Figure out which options we need to disable to do the setup
+ local helpfile="${TMPDIR}/mysqld-help"
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
+ for opt in grant-tables host-cache name-resolve networking slave-start \
+ federated ssl log-bin relay-log slow-query-log external-locking \
+ log-slave-updates \
+ ; do
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
+ egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
+ done
+
+ einfo "Creating the mysql database and setting proper permissions on it ..."
+
+ # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
+ PID_DIR="${EROOT}/var/run/mysqld"
+ if [[ ! -d "${PID_DIR}" ]]; then
+ install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
+ fi
+
+ if [[ ! -d "${MY_DATADIR}" ]]; then
+ install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
+ fi
+
+ pushd "${TMPDIR}" &>/dev/null || die
+
+ # Filling timezones, see
+ # https://dev.mysql.com/doc/mysql/en/time-zone-support.html
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
+
+ local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" )
+ [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
+ cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
+ einfo "Command: ${cmd[*]}"
+ su -s /bin/sh -c "${cmd[*]}" mysql \
+ >"${TMPDIR}"/mysql_install_db.log 2>&1
+ if [ $? -ne 0 ]; then
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
+ die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
+ fi
+ popd &>/dev/null || die
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
+ || die "MySQL databases not installed"
+
+ use prefix || options="${options} --user=mysql"
+
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
+ local mysqld="${EROOT}/usr/sbin/mysqld \
+ ${options} \
+ --log-warnings=0 \
+ --basedir=${EROOT}/usr \
+ --datadir=${ROOT}/${MY_DATADIR} \
+ --max_allowed_packet=8M \
+ --net_buffer_length=16K \
+ --socket=${socket} \
+ --pid-file=${pidfile} \
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
+ #einfo "About to start mysqld: ${mysqld}"
+ ebegin "Starting mysqld"
+ einfo "Command ${mysqld}"
+ ${mysqld} &
+ rc=$?
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
+ maxtry=$((${maxtry}-1))
+ echo -n "."
+ sleep 1
+ done
+ eend $rc
+
+ if ! [[ -S "${socket}" ]]; then
+ die "Completely failed to start up mysqld with: ${mysqld}"
+ fi
+
+ ebegin "Setting root password"
+ # Do this from memory, as we don't want clear text passwords in temp files
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -e "${sql}"
+ eend $?
+
+ if [[ -n "${sqltmp}" ]] ; then
+ ebegin "Loading \"zoneinfo\", this step may require a few seconds"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -uroot \
+ --password="${MYSQL_ROOT_PASSWORD}" \
+ mysql < "${sqltmp}"
+ rc=$?
+ eend $?
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
+ fi
+
+ # Stop the server and cleanup
+ einfo "Stopping the server ..."
+ kill $(< "${pidfile}" )
+ rm -f "${sqltmp}"
+ wait %1
+ einfo "Done"
+}
diff --git a/dev-db/mariadb/mariadb-10.3.13.ebuild b/dev-db/mariadb/mariadb-10.3.13.ebuild
index 8d049d3508ee..75082171657c 100644
--- a/dev-db/mariadb/mariadb-10.3.13.ebuild
+++ b/dev-db/mariadb/mariadb-10.3.13.ebuild
@@ -814,11 +814,11 @@ pkg_config() {
unset tmp_mysqld_password_source
fi
- MYSQL_TMPDIR="$(_getoptval mysqld tmpdir)"
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)"
# These are dir+prefix
- MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)"
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)"
MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
- MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)"
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)"
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
diff --git a/dev-db/mariadb/mariadb-5.5.64.ebuild b/dev-db/mariadb/mariadb-5.5.64.ebuild
new file mode 100644
index 000000000000..c09952b96da1
--- /dev/null
+++ b/dev-db/mariadb/mariadb-5.5.64.ebuild
@@ -0,0 +1,831 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20180809-1700Z"
+SUBSLOT="18"
+
+# Keeping eutils in EAPI=6 for emktemp in pkg_config
+
+inherit eutils flag-o-matic prefix toolchain-funcs user cmake-utils multilib-build
+
+SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz "
+
+# Gentoo patches to MySQL
+if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
+ SRC_URI="${SRC_URI}
+ mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
+fi
+
+HOMEPAGE="https://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+LICENSE="GPL-2"
+SLOT="0/${SUBSLOT:-0}"
+IUSE="bindist client-libs debug extraengine jemalloc latin1 libressl
+ oqgraph pam +perl profiling selinux +server sphinx
+ static static-libs systemtap tcmalloc
+ test tokudb yassl"
+
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
+RESTRICT="!bindist? ( bindist ) libressl? ( test )"
+
+REQUIRED_USE="server? ( tokudb? ( jemalloc !tcmalloc ) )
+ ?? ( tcmalloc jemalloc )
+ static? ( yassl !pam )"
+
+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"
+
+# Shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/mysql"
+
+if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras"
+ inherit git-r3
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras"
+ EGIT_CLONE_TYPE=shallow
+else
+ MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}"
+fi
+
+PATCHES=(
+ "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch"
+ "${MY_PATCH_DIR}/20004_all_mariadb-filter-tokudb-flags.patch"
+ "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-5.5.50.patch"
+ "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch"
+ "${MY_PATCH_DIR}/20018_all_mariadb-5.5.60-without-clientlibs-tools.patch"
+)
+
+# Be warned, *DEPEND are version-dependant
+# These are used for both runtime and compiletime
+COMMON_DEPEND="
+ kernel_linux? (
+ sys-process/procps:0=
+ dev-libs/libaio:0=
+ )
+ >=sys-apps/sed-4
+ >=sys-apps/texinfo-4.7-r1
+ jemalloc? ( dev-libs/jemalloc:0= )
+ tcmalloc? ( dev-util/google-perftools:0= )
+ systemtap? ( >=dev-util/systemtap-1.3:0= )
+ !yassl? (
+ !libressl? ( <dev-libs/openssl-1.1.0:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ >=sys-libs/zlib-1.2.3:0=
+ sys-libs/ncurses:0=
+ !bindist? (
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ )
+ !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] )
+"
+DEPEND="virtual/yacc
+ static? ( sys-libs/ncurses[static-libs] )
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ ${COMMON_DEPEND}"
+RDEPEND="selinux? ( sec-policy/selinux-mysql )
+ client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c )
+ !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
+ server? ( !prefix? ( dev-db/mysql-init-scripts ) )
+ ${COMMON_DEPEND}
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+"
+# For other stuff to bring us in
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]] ; then
+ local GCC_MAJOR_SET=$(gcc-major-version)
+ local GCC_MINOR_SET=$(gcc-minor-version)
+ if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} with tokudb needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
+ # non x86{,_64} arches
+ if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ fi
+ if has test ${FEATURES} && \
+ use server && ! has userpriv ${FEATURES} ; then
+ eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+
+ # This should come after all of the die statements
+ enewgroup mysql 60 || die "problem adding 'mysql' group"
+ enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
+}
+
+pkg_postinst() {
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Create log directory securely if it does not exist
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
+
+ if use server ; then
+ if use pam; then
+ einfo
+ elog "This install includes the PAM authentication plugin."
+ elog "To activate and configure the PAM plugin, please read:"
+ elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/"
+ einfo
+ fi
+
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ einfo
+ elog "You might want to run:"
+ elog "\"emerge --config =${CATEGORY}/${PF}\""
+ elog "if this is a new install."
+ elog
+ elog "If you are switching server implentations, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ else
+ einfo
+ elog "If you are upgrading major versions, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ fi
+
+ einfo
+ elog "Be sure to edit the my.cnf file to activate your cluster settings."
+ elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\""
+ elog "The first time the cluster is activated, you should add"
+ elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node."
+ elog "This option should then be removed for subsequent starts."
+ einfo
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ # Grab the patches
+ [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack
+
+ mv -f "${WORKDIR%/}/${P}" "${S}" || die
+}
+
+src_prepare() {
+ _disable_engine() {
+ echo > "${S%/}/storage/${1}/CMakeLists.txt" || die
+ }
+
+ _disable_plugin() {
+ echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die
+ }
+
+ if use tcmalloc; then
+ echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die
+ fi
+
+ # Don't build bundled xz-utils for tokudb
+ echo > "${S%/}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" || die
+ sed -i -e 's/ build_lzma//' "${S%/}/storage/tokudb/ft-index/ft/CMakeLists.txt" || die
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S%/}/storage/tokudb/ft-index/portability/CMakeLists.txt" || die
+
+ local plugin
+ local server_plugins=( handler_socket auth_socket feedback qc_info server_audit semisync sql_errlog )
+ local test_plugins=( audit_null auth_examples daemon_example fulltext )
+ if ! use server; then # These plugins are for the server
+ for plugin in "${server_plugins[@]}" ; do
+ _disable_plugin "${plugin}"
+ done
+ fi
+
+ if ! use test; then # These plugins are only used during testing
+ for plugin in "${test_plugins[@]}" ; do
+ _disable_plugin "${plugin}"
+ done
+ fi
+
+ # Collides with mariadb-connector-c bug 655980
+ _disable_plugin auth_dialog
+
+ # Don't build example
+ _disable_engine example
+
+ if ! use oqgraph ; then # avoids extra library checks
+ _disable_engine oqgraph
+ fi
+
+ cmake-utils_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ # Bug #114895, bug #110149
+ filter-flags "-O" "-O[01]"
+
+ append-cxxflags -felide-constructors
+
+ # bug #283926, with GCC4.4, this is required to get correct behavior.
+ append-flags -fno-strict-aliasing
+
+ CMAKE_BUILD_TYPE="RelWithDebInfo"
+
+ # debug hack wrt #497532
+ mycmakeargs=(
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr"
+ -DDEFAULT_SYSCONFDIR="${EPREFIX%/}/etc/mysql"
+ -DINSTALL_BINDIR=bin
+ -DINSTALL_DOCDIR=share/doc/${PF}
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF}
+ -DINSTALL_INCLUDEDIR=include/mysql
+ -DINSTALL_INFODIR=share/info
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DINSTALL_MANDIR=share/man
+ -DINSTALL_MYSQLSHAREDIR=share/mariadb
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin
+ -DINSTALL_SCRIPTDIR=share/mariadb/scripts
+ -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql"
+ -DINSTALL_SBINDIR=sbin
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mariadb"
+ -DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
+ -DWITH_UNIT_TESTS=$(usex test ON OFF)
+ -DWITH_ZLIB=system
+ -DENABLED_LOCAL_INFILE=1
+ -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock"
+ -DINSTALL_UNIX_ADDRDIR="${EPREFIX%/}/var/run/mysqld/mysqld.sock"
+ # The build forces this to be defined when cross-compiling. We pass it
+ # all the time for simplicity and to make sure it is actually correct.
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
+ -DWITHOUT_CLIENTLIBS=YES
+ -DWITH_READLINE=$(usex bindist 1 0)
+ -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1)
+ -DENABLE_DTRACE=$(usex systemtap)
+ )
+ if use test ; then
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test )
+ else
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
+ fi
+
+ if ! use yassl ; then
+ mycmakeargs+=( -DWITH_SSL=system )
+ else
+ mycmakeargs+=( -DWITH_SSL=bundled )
+ fi
+
+ if use server ; then
+
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ mycmakeargs+=(
+ -DWITHOUT_FEDERATED_STORAGE_ENGINE=1
+ -DWITHOUT_FEDERATEDX_STORAGE_ENGINE=1 )
+ fi
+
+ mycmakeargs+=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -D$(usex sphinx WITH WITHOUT)_SPHINX_STORAGE_ENGINE=1
+ -D$(usex tokudb WITH WITHOUT)_TOKUDB_STORAGE_ENGINE=1
+ -D$(usex oqgraph WITH WITHOUT)_AUTH_PAM=1
+ -DINSTALL_SQLBENCHDIR=share/mariadb
+ )
+
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
+ ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
+ ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
+ ewarn "You MUST file bugs without these variables set."
+
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
+ )
+
+ elif ! use latin1 ; then
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=utf8
+ -DDEFAULT_COLLATION=utf8_general_ci
+ )
+ else
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=latin1
+ -DDEFAULT_COLLATION=latin1_swedish_ci
+ )
+ fi
+ mycmakeargs+=(
+ -DEXTRA_CHARSETS=all
+ -DDISABLE_SHARED=$(usex static YES NO)
+ -DWITH_EMBEDDED_SERVER=OFF
+ -DENABLED_PROFILING=$(usex profiling)
+ )
+
+ if use static; then
+ mycmakeargs+=( -DWITH_PIC=1 )
+ fi
+
+ if use jemalloc || use tcmalloc ; then
+ mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
+ fi
+
+ # Storage engines
+ mycmakeargs+=(
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1
+ -DWITH_CSV_STORAGE_ENGINE=1
+ -DWITH_HEAP_STORAGE_ENGINE=1
+ -DWITH_INNOBASE_STORAGE_ENGINE=1
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1
+ -DWITH_MYISAM_STORAGE_ENGINE=1
+ -DWITH_PARTITION_STORAGE_ENGINE=1
+ )
+
+ else
+ mycmakeargs+=(
+ -DWITHOUT_SERVER=1
+ -DEXTRA_CHARSETS=none
+ -DINSTALL_SQLBENCHDIR=
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
+ if [[ -f "${ED%/}/usr/include/mysql/server/private/config.h" ]] ; then
+ rm "${ED%/}/usr/include/mysql/server/private/config.h" || die
+ fi
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Convenience links
+ einfo "Making Convenience links for mysqlcheck multi-call binary"
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair"
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize"
+
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
+ if [[ -d "${ED%/}/usr/data" ]] ; then
+ rm -Rf "${ED%/}/usr/data" || die
+ fi
+
+ # Unless they explicitly specific USE=test, then do not install the
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a
+ # validation of your database configuration after tuning it.
+ if ! use test ; then
+ rm -rf "${D%/}/${MY_SHAREDSTATEDIR}/mysql-test"
+ fi
+
+ # Configuration stuff
+ einfo "Building default configuration ..."
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}"
+ [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf
+ local mycnf_src="my.cnf-5.5"
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+ "${FILESDIR%/}/${mycnf_src}" \
+ > "${TMPDIR%/}/my.cnf.ok" || die
+ use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok"
+ if use latin1 ; then
+ sed -i \
+ -e "/character-set/s|utf8|latin1|g" \
+ "${TMPDIR%/}/my.cnf.ok" || die
+ fi
+ eprefixify "${TMPDIR%/}/my.cnf.ok"
+ newins "${TMPDIR}/my.cnf.ok" my.cnf
+
+ if use server ; then
+ einfo "Including support files and sample configurations"
+ docinto "support-files"
+ local script
+ for script in \
+ "${S%/}"/support-files/magic
+ do
+ [[ -f "$script" ]] && dodoc "${script}"
+ done
+
+ docinto "scripts"
+ for script in "${S%/}"/scripts/mysql* ; do
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
+ done
+ # Manually install supporting files that conflict with other packages
+ # but are needed for galera and initial installation
+ exeinto /usr/libexec/mariadb
+ doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror"
+ fi
+
+ #Remove mytop if perl is not selected
+ [[ -e "${ED%/}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED%/}/usr/bin/mytop"
+}
+
+# Official test instructions:
+# USE='extraengine perl server' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+src_test() {
+
+ _disable_test() {
+ local rawtestname reason
+ rawtestname="${1}" ; shift
+ reason="${@}"
+ ewarn "test '${rawtestname}' disabled: '${reason}'"
+ echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
+ }
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log} || die
+
+ # Run mysql tests
+ pushd "${TESTDIR}" > /dev/null || die
+
+ touch "${T}/disabled.def"
+ # These are failing in MariaDB 5.5 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help, funcs_1.is_triggers, funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+
+ local t
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ binlog.binlog_statement_insert_delayed main.information_schema \
+ main.mysqld--help \
+ archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+ funcs_1.is_triggers funcs_1.is_tables_mysql funcs_1.is_columns_mysql ; do
+ _disable_test "$t" "False positives in Gentoo"
+ done
+
+ if ! use client-libs ; then
+ _disable_test main.plugin_auth "Needs client libraries built"
+ fi
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
+ retstatus_tests=$?
+
+ popd > /dev/null || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
+
+mysql_init_vars() {
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"}
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=""
+ if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
+ MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
+ | sed -e 's/.*=\s*//' \
+ | tail -n1`
+ fi
+ fi
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR="${MY_LOCALSTATEDIR}"
+ einfo "Using default MY_DATADIR"
+ fi
+ elog "MySQL MY_DATADIR is ${MY_DATADIR}"
+
+ if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
+ if [[ -e "${MY_DATADIR}" ]] ; then
+ # If you get this and you're wondering about it, see bug #207636
+ elog "MySQL datadir found in ${MY_DATADIR}"
+ elog "A new one will not be created."
+ PREVIOUS_DATADIR="yes"
+ else
+ PREVIOUS_DATADIR="no"
+ fi
+ export PREVIOUS_DATADIR
+ fi
+ else
+ if [[ ${EBUILD_PHASE} == "config" ]]; then
+ local new_MY_DATADIR
+ new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+
+ if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
+ ewarn "MySQL MY_DATADIR has changed"
+ ewarn "from ${MY_DATADIR}"
+ ewarn "to ${new_MY_DATADIR}"
+ MY_DATADIR="${new_MY_DATADIR}"
+ fi
+ fi
+ fi
+
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR
+ export MY_LOCALSTATEDIR MY_LOGDIR
+ export MY_DATADIR
+}
+
+pkg_config() {
+ _getoptval() {
+ local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults
+ local section="$1"
+ local flag="--${2}="
+ local extra_options="${3}"
+ "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
+ }
+ local old_MY_DATADIR="${MY_DATADIR}"
+ local old_HOME="${HOME}"
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf
+ export HOME=${EPREFIX}/root
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
+ if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then
+ die "Minimal builds do NOT include the MySQL server"
+ fi
+
+ if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
+ local MY_DATADIR_s="${ROOT}/${MY_DATADIR}"
+ MY_DATADIR_s="${MY_DATADIR_s%%/}"
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}"
+ old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
+
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
+ ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
+ else
+ elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
+ mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
+ || die "Moving MY_DATADIR failed"
+ fi
+ else
+ ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Attempting to use ${MY_DATADIR_s}"
+ else
+ eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
+ die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
+ fi
+ fi
+ fi
+
+ local pwd1="a"
+ local pwd2="b"
+ local maxtry=15
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+ local tmp_mysqld_password_source=
+
+ for tmp_mysqld_password_source in mysql client; do
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
+ MYSQL_ROOT_PASSWORD=
+ continue
+ fi
+
+ einfo "Found password in '${tmp_mysqld_password_source}' section!"
+ break
+ fi
+ done
+
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
+ fi
+
+ unset tmp_mysqld_password_source
+ fi
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n 1)"
+ # These are dir+prefix
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n 1)"
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n 1)"
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
+
+ if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR"
+ fi
+ if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN"
+ fi
+ if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG"
+ fi
+
+ if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
+ ewarn "You have already a MySQL database in place."
+ ewarn "(${ROOT}/${MY_DATADIR}/*)"
+ ewarn "Please rename or delete it if you wish to replace it."
+ die "MySQL database already exists!"
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+
+ einfo "Please provide a password for the mysql 'root' user now"
+ einfo "or through the ${HOME}/.my.cnf file."
+ ewarn "Avoid [\"'\\_%] characters in the password"
+ read -rsp " >" pwd1 ; echo
+
+ einfo "Retype the password"
+ read -rsp " >" pwd2 ; echo
+
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then
+ die "Passwords are not the same"
+ fi
+ MYSQL_ROOT_PASSWORD="${pwd1}"
+ unset pwd1 pwd2
+ fi
+
+ local options
+ local sqltmp="$(emktemp)"
+
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first,
+ # see https://bugs.mysql.com/bug.php?id=31312
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
+
+ # Figure out which options we need to disable to do the setup
+ local helpfile="${TMPDIR}/mysqld-help"
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
+ for opt in grant-tables host-cache name-resolve networking slave-start \
+ federated ssl log-bin relay-log slow-query-log external-locking \
+ log-slave-updates \
+ ; do
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
+ egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
+ done
+
+ einfo "Creating the mysql database and setting proper permissions on it ..."
+
+ # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
+ PID_DIR="${EROOT}/var/run/mysqld"
+ if [[ ! -d "${PID_DIR}" ]]; then
+ install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
+ fi
+
+ if [[ ! -d "${MY_DATADIR}" ]]; then
+ install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
+ fi
+
+ pushd "${TMPDIR}" &>/dev/null || die
+
+ # Filling timezones, see
+ # https://dev.mysql.com/doc/mysql/en/time-zone-support.html
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
+
+ local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" )
+ [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
+ cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
+ einfo "Command: ${cmd[*]}"
+ su -s /bin/sh -c "${cmd[*]}" mysql \
+ >"${TMPDIR}"/mysql_install_db.log 2>&1
+ if [ $? -ne 0 ]; then
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
+ die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
+ fi
+ popd &>/dev/null || die
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
+ || die "MySQL databases not installed"
+
+ use prefix || options="${options} --user=mysql"
+
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
+ local mysqld="${EROOT}/usr/sbin/mysqld \
+ ${options} \
+ --log-warnings=0 \
+ --basedir=${EROOT}/usr \
+ --datadir=${ROOT}/${MY_DATADIR} \
+ --max_allowed_packet=8M \
+ --net_buffer_length=16K \
+ --socket=${socket} \
+ --pid-file=${pidfile} \
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
+ #einfo "About to start mysqld: ${mysqld}"
+ ebegin "Starting mysqld"
+ einfo "Command ${mysqld}"
+ ${mysqld} &
+ rc=$?
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
+ maxtry=$((${maxtry}-1))
+ echo -n "."
+ sleep 1
+ done
+ eend $rc
+
+ if ! [[ -S "${socket}" ]]; then
+ die "Completely failed to start up mysqld with: ${mysqld}"
+ fi
+
+ ebegin "Setting root password"
+ # Do this from memory, as we don't want clear text passwords in temp files
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -e "${sql}"
+ eend $?
+
+ if [[ -n "${sqltmp}" ]] ; then
+ ebegin "Loading \"zoneinfo\", this step may require a few seconds"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -uroot \
+ --password="${MYSQL_ROOT_PASSWORD}" \
+ mysql < "${sqltmp}"
+ rc=$?
+ eend $?
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
+ fi
+
+ # Stop the server and cleanup
+ einfo "Stopping the server ..."
+ kill $(< "${pidfile}" )
+ rm -f "${sqltmp}"
+ wait %1
+ einfo "Done"
+}
diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
index eba781d42a89..45aac169b145 100644
--- a/dev-db/mysql/Manifest
+++ b/dev-db/mysql/Manifest
@@ -11,6 +11,7 @@ DIST mysql-5.6.43.tar.gz 32200219 BLAKE2B 2aa1397ff5f011a169ae47650be8db7a097a62
DIST mysql-boost-5.7.23.tar.gz 49025014 BLAKE2B 669f10779bc2cda866d6bd876b4efe55fb4b0c796f596f66513a3ca85f322e2a03e9879eecd72a69729a0cb71d408c46cdd9086ae456712b4adff6ae7c584c97 SHA512 e4317f89d108a68652cd95e41ffd670c37b6663aabd6af3985d18052fb7e8d8879b5822399caf9091cecc0a949ec588c121c87cfd60d69941f68d0ecbedd0953
DIST mysql-boost-5.7.24.tar.gz 49110448 BLAKE2B 1cf64712d84cbb2dfd31f2a530470b6f7cbf5ae9107106d86705575ea9739fa582e1f079447d9a58c4762fffc636d69e448ebdec9172ee15dc09245bc39c3525 SHA512 bbd411e15cd9e6053a353146808b74881d2d950f09e94794a699e7604dadf767b58b661a8321fbe1424f2c2e6cfc3adaa388242183e759082eae47b64cbfbcde
DIST mysql-boost-5.7.25.tar.gz 49107578 BLAKE2B 8a43479c496ce45e71df905b0cb6da442340b691caa15f9862a8c981e7189c50e73b1701c393fe46ab580c508f785d5f15259c2331c77e0790191f3d41bb385c SHA512 b111c64bfcd49dba584bed71a0c7ce33b2b0654654d8f4eaa1a2b7a5daed9674ebfd4a0dfb93c20ffee028feead4709eaf600bb5469f81c86b743d395dfe27a9
+DIST mysql-boost-5.7.26.tar.gz 51098338 BLAKE2B 1263cd75814a7293b26b0f44fd2b7d20d983f3c6a62725df9515ecac2ef252f6644810cb4bf0d6f36b98e55317f1c67ea7541228cb38d896dfedc476a5755f26 SHA512 a5f9871dc5a8e5fffc1467c3dd542533a63fe553c029120475f8fd5530d884c76ab0c33ad260daf317faf318ccef01464f6ac2dc3468efceb6bf2b6c06c54cfd
DIST mysql-extras-20180804-2323Z.tar.bz2 322215 BLAKE2B cca9e502e375bf43473335868517f6c450fc7bcf03e55de5a294c8bdcfcac2bb783dec09bbb3b6c30a561ba7e3a943543c017e2d42b61d466e699acdef4c0231 SHA512 efd9d416f394cc61b977ab76f05ab3acc5803ff8bdee8e1dbc65cc5b3f07e4f9742140d9586c028908b10fcc44f21c98ebffdebcc5c3578acbe05b07526bcb3d
DIST mysql-extras-20181023-0012Z.tar.bz2 327834 BLAKE2B 91a82cbcecbbbe94933da0d8c26cdfee0171602785b2f717fbfec7da422f0ec36f26e897a3c21695f4748017d36c9956cbef03d0852246468368b812a604df82 SHA512 94996708a9da4d55c3aab74f75b74fa4aa80e3fbbb87d9dfe6c1596a934aceed466b7c853e38d9b63f59660763ccef617defc4e6e8770451c21a252250f4e7fa
DIST mysql-extras-20181111-2314Z.tar.bz2 329013 BLAKE2B fa928b699ef0e6f092e028fc1331cc33953d9855e784998fb2f8c1f1712e9424567b2d2b6b7c5ca375f178309522b3596fcba7babdbed7c85b87ae4b85e5db22 SHA512 5cc4d16c5c6b0491fb9532469ec0b9c65e27e1514d561ea4180845a1578fc8e7ba00fca479b9a784646846f5147e4f676340f639b78c3f5ee140dda26bd5bff2
@@ -23,4 +24,5 @@ EBUILD mysql-5.6.43.ebuild 26058 BLAKE2B 900da4370bcf01f3bb6f3c54220e80beddd4243
EBUILD mysql-5.7.23-r2.ebuild 30078 BLAKE2B 57bf58e862639e651335a10a8c4dfc5f7f0f76bfb0545414d697875906d917131fedd3e9d0e58f57b886d8cae55adbd2a104ee3632d49b4ba0669b93a1a68bff SHA512 dfbb88e79b717ceb615246a806123ee2d30c1632cfb40d0bb9e04a9204565a92afbb2b37245794c15985e99a60d2adc46723b97e455fb85e137079d6192b148c
EBUILD mysql-5.7.24.ebuild 30386 BLAKE2B ecf0c03821af6a21467b53a02e6e0a0ae2f7e5d267ff4669266d34cdb9fddb7defbd8a4013dd3a1f8a103c84da4c6eddafae06fc1ebc4bf94c9769e64dbbfc1b SHA512 f8b372573d82b513ea1d82a1e00d728501c483ef949a2411c05ac93a8d2d90162d6992b58d3a101fefcbac541f9f37dcfa2263ac49231839d338af158557153f
EBUILD mysql-5.7.25.ebuild 30466 BLAKE2B 3622e31330f47924ea99c0b31ede3b755a2bcead553730fc3728f6eb505493e90b0206af7235017f80dcecc297ae6dd3022255ca1884de251db0033140a9b3dc SHA512 85418f95306981b3d3ee0ecd91abf3b2c212c4b7d708ad70834a6df3f5e941c0469f5ba29079adc4e51477e01836ae316c1ad86452ee9d705e1180ac4854fc9d
+EBUILD mysql-5.7.26.ebuild 30477 BLAKE2B 61ae7d6a7de17cea9baafb3bee71c7811b963ad078defb7a725878e2274e959422292c15d69f680e50fa83859e004b7c484ab6b157b3b6c71d2368d18fcc5c58 SHA512 f9e3a2e8deda27ecc3cb27fea0f321c37af94a5afb36bef19928eb2b39f5ebca8edc60afde2354aae7d64d892687c3c63b22343d1a5664ed5a3603a5891e6829
MISC metadata.xml 1539 BLAKE2B 0bc66c5855bd1f4353a7f0b551229d68a940478687b4f38653f973e4a5cfcb946c86bdc2d8318aa96aba43598eb476b995005f26727dfa176ced00fbe2b129a1 SHA512 bc0ce8a3de5e55d954f65eec657930af069d3550f485334f80dfa4c6d17c6298d0609d1ba4fe8b6c988f8ad007858f147c17f1354c207891ac1a062a36af50ad
diff --git a/dev-db/percona-server/percona-server-5.7.24.27.ebuild b/dev-db/mysql/mysql-5.7.26.ebuild
index a980f25cd9d7..99cb2805dc75 100644
--- a/dev-db/percona-server/percona-server-5.7.24.27.ebuild
+++ b/dev-db/mysql/mysql-5.7.26.ebuild
@@ -1,28 +1,19 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
-MY_EXTRAS_VER="20181017-2201Z"
+MY_EXTRAS_VER="20190303-1852Z"
CMAKE_MAKEFILE_GENERATOR=emake
-# Python2 required for innodb_stress.innodb_stress{,_blob,_crash} test
-PYTHON_COMPAT=( python2_7 )
-
# Keeping eutils in EAPI=6 for emktemp in pkg_config
-inherit eapi7-ver cmake-utils eutils flag-o-matic linux-info \
- prefix python-any-r1 toolchain-funcs user multilib-minimal
-
-MY_PV=$(ver_rs 3 '-')
-MY_PN="Percona-Server"
-MY_P="${PN}-${MY_PV}"
-MY_MAJOR_PV=$(ver_cut 1-2)
-MY_RELEASE_NOTES_URI="https://www.percona.com/doc/percona-server/5.7/release-notes/release-notes_index.html"
+inherit cmake-utils eutils flag-o-matic linux-info \
+ prefix toolchain-funcs user multilib-minimal
-SRC_URI="https://www.percona.com/downloads/${MY_PN}-${MY_MAJOR_PV}/${MY_PN}-${MY_PV}/source/tarball/${PN}-${MY_PV}.tar.gz
- mirror://sourceforge/boost/boost_1_59_0.tar.gz
-"
+SRC_URI="https://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz
+ https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-${PV}.tar.gz
+ http://downloads.mysql.com/archives/MySQL-5.7/${PN}-boost-${PV}.tar.gz"
# Gentoo patches to MySQL
if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]] ; then
@@ -31,19 +22,19 @@ if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]] ; then
https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
fi
-HOMEPAGE="https://www.percona.com/software/mysql-database/percona-server"
+HOMEPAGE="https://www.mysql.com/"
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
LICENSE="GPL-2"
SLOT="0/18"
-IUSE="cjk client-libs cracklib debug experimental jemalloc latin1 libressl numa pam +perl profiling rocksdb
- selinux +server static static-libs systemtap tcmalloc test tokudb tokudb-backup-plugin yassl"
+IUSE="cjk client-libs cracklib debug experimental jemalloc latin1 libressl numa +perl profiling
+ selinux +server static static-libs systemtap tcmalloc test yassl"
# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
RESTRICT="libressl? ( test )"
REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
# Shorten the path because the socket path length must be shorter than 107 chars
# and we will run a mysql server during test phase
@@ -60,16 +51,16 @@ else
fi
PATCHES=(
- "${MY_PATCH_DIR}"/20001_all_fix-minimal-build-cmake-mysql-5.7.patch
+ "${MY_PATCH_DIR}"/20001_all_fix-minimal-build-cmake-mysql-5.7.23.patch
"${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.7.patch
"${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.7.10.patch
- "${MY_PATCH_DIR}"/20018_all_percona-server-5.7.23-without-clientlibs-tools.patch
- "${MY_PATCH_DIR}"/20018_all_percona-server-5.7.23-fix-libressl-support.patch
+ "${MY_PATCH_DIR}"/20018_all_mysql-5.7.21-without-clientlibs-tools.patch
+ "${MY_PATCH_DIR}"/20018_all_mysql-5.7.25-fix-libressl-support.patch
"${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-add-missing-gcc-8-fix.patch
"${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-grant_user_lock-a-root.patch
"${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-round-off-test-values-for-same-output-on-all-architectures.patch
"${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-mips-ASM.patch
- "${MY_PATCH_DIR}"/20018_all_percona-server-5.7.23-rocksdb-use-system-libs.patch
+ "${MY_PATCH_DIR}"/20018_all_mysql-5.7.25-fix-build-without-server.patch
)
# Be warned, *DEPEND are version-dependant
@@ -98,16 +89,6 @@ COMMON_DEPEND="net-misc/curl:=
net-libs/libtirpc:=
)
numa? ( sys-process/numactl )
- pam? ( virtual/pam:0= )
- rocksdb? (
- app-arch/zstd:=
- dev-libs/protobuf:=
- )
- tokudb? (
- app-arch/snappy:=
- app-arch/xz-utils:=
- )
- tokudb-backup-plugin? ( dev-util/valgrind )
)
systemtap? ( >=dev-util/systemtap-1.3:0= )
tcmalloc? ( dev-util/google-perftools:0= )
@@ -131,13 +112,10 @@ DEPEND="${COMMON_DEPEND}
experimental? ( net-libs/rpcsvc-proto )
)
static? ( sys-libs/ncurses[static-libs] )
- test? (
- $(python_gen_any_dep 'dev-python/mysql-python[${PYTHON_USEDEP}]')
- dev-perl/JSON
- )
+ test? ( dev-perl/JSON )
"
RDEPEND="${COMMON_DEPEND}
- !dev-db/mariadb !dev-db/mariadb-galera !dev-db/mysql !dev-db/mysql-cluster
+ !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c dev-libs/protobuf:= )
selinux? ( sec-policy/selinux-mysql )
server? ( !prefix? ( dev-db/mysql-init-scripts ) )
@@ -146,10 +124,6 @@ RDEPEND="${COMMON_DEPEND}
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
-python_check_deps() {
- has_version "dev-python/mysql-python[${PYTHON_USEDEP}]"
-}
-
mysql_init_vars() {
MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX%/}/usr/share/mysql"}
MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX%/}/etc/mysql"}
@@ -229,8 +203,6 @@ pkg_setup() {
eerror "Please use gcc-config to switch to gcc-4.7 or later version."
die
fi
-
- use test && python-any-r1_pkg_setup
fi
if has test ${FEATURES} && \
@@ -247,10 +219,10 @@ pkg_preinst() {
# Here we need to see if the implementation switched client libraries
# We check if this is a new instance of the package and a client library already exists
local SHOW_ABI_MESSAGE libpath
- if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT%/}/usr/$(get_libdir)/libperconaserverclient.so" ]] ; then
- libpath=$(readlink "${EROOT%/}/usr/$(get_libdir)/libperconaserverclient.so")
+ if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so")
elog "Due to ABI changes when switching between different client libraries,"
- elog "revdep-rebuild must find and rebuild all packages linking to libperconaserverclient."
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
elog "Please run: revdep-rebuild --library ${libpath}"
ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
fi
@@ -297,7 +269,7 @@ src_unpack() {
# Grab the patches
[[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack
- mv -f "${WORKDIR}/${MY_P}" "${S}" || die
+ mv -f "${WORKDIR}/${P}" "${S}" || die
}
src_prepare() {
@@ -311,35 +283,19 @@ src_prepare() {
echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die
fi
- # Don't build bundled xz-utils
- if [[ -d "${S}/storage/tokudb/ft-index" ]] ; then
- echo > "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" || die
- sed -i 's/ build_lzma//' "${S}/storage/tokudb/ft-index/ft/CMakeLists.txt" || die
- elif [[ -d "${S}/storage/tokudb/PerconaFT" ]] ; then
- echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
- sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die
- sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die
- fi
-
- if [[ -d "${S}/plugin/tokudb-backup-plugin" ]] && ! use tokudb-backup-plugin ; then
- rm -r "${S}/plugin/tokudb-backup-plugin/Percona-TokuBackup" || die
+ # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
+ if [[ -d "${S}/support-files/SELinux" ]] ; then
+ echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
fi
# Remove bundled libs so we cannot accidentally use them
# We keep extra/lz4 directory because we use extra/lz4/xxhash.c via sql/CMakeLists.txt:394
rm -rv \
"${S}"/extra/protobuf \
- "${S}"/libevent \
- "${S}"/storage/rocksdb/third_party \
- "${S}"/storage/tokudb/PerconaFT/third_party \
+ "${S}"/extra/libevent \
"${S}"/zlib \
|| die
- # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
- if [[ -d "${S}/support-files/SELinux" ]] ; then
- echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
- fi
-
if use libressl ; then
sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
"${S}/cmake/ssl.cmake" || die
@@ -357,11 +313,6 @@ src_configure(){
# bug #283926, with GCC4.4, this is required to get correct behavior.
append-flags -fno-strict-aliasing
- if use tokudb ; then
- # https://jira.percona.com/browse/PS-4399
- append-cxxflags -Wno-error=shadow
- fi
-
if use client-libs ; then
multilib-minimal_src_configure
else
@@ -412,10 +363,8 @@ multilib_src_configure() {
# all the time for simplicity and to make sure it is actually correct.
-DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
-DWITH_CURL=system
- -DWITH_BOOST="${WORKDIR}/boost_1_59_0"
- -DWITH_PROTOBUF=system
+ -DWITH_BOOST="${S}/boost"
)
-
if use test ; then
mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test )
else
@@ -450,6 +399,7 @@ multilib_src_configure() {
mycmakeargs+=(
-DWITH_LIBEVENT=system
-DWITH_LZ4=system
+ -DWITH_PROTOBUF=system
-DWITH_MECAB=$(usex cjk system OFF)
-DWITH_NUMA=$(usex numa ON OFF)
-DWITH_RAPID=$(usex experimental ON OFF)
@@ -507,17 +457,8 @@ multilib_src_configure() {
-DWITH_MYISAMMRG_STORAGE_ENGINE=1
-DWITH_MYISAM_STORAGE_ENGINE=1
-DWITH_PARTITION_STORAGE_ENGINE=1
- -DWITH_ROCKSDB=$(usex rocksdb 1 0)
- $(usex tokudb '' -DWITHOUT_TOKUDB=1)
)
- if use tokudb ; then
- # TokuDB Backup plugin requires valgrind unconditionally
- mycmakeargs+=(
- $(usex tokudb-backup-plugin '' -DTOKUDB_BACKUP_DISABLED=1)
- )
- fi
-
else
mycmakeargs+=(
-DWITHOUT_SERVER=1
@@ -545,7 +486,7 @@ multilib_src_compile() {
# ulimit -n 16500 && \
# USE='latin1 perl server' \
# FEATURES='test userpriv -usersandbox' \
-# ebuild percona-server-X.X.XX.ebuild \
+# ebuild mysql-X.X.XX.ebuild \
# digest clean package
src_test() {
_disable_test() {
@@ -594,51 +535,27 @@ src_test() {
pushd "${TESTDIR}" &>/dev/null || die
touch "${T}/disabled.def"
- # These are failing in Percona-Server 5.7 for now and are believed to be
- # false positives or are known to fail:
- #
- # encryption.innodb_encryption_tables: https://jira.percona.com/browse/PS-5036
- # group_replication.gr_communication_configuration: requires a valid local network address
- # which clashes with FEATURES=network-sandbox
- # main.mysqlshow: https://jira.percona.com/browse/PS-5017
- # main.percona_bug1289599: https://jira.percona.com/browse/PS-2072
- # keyring_vault.keyring_vault_timeout: requires network access to vault.public-ci.percona.com
- # which clashes with FEATURES=network-sandbox
- # perfschema.show_sanity: https://jira.percona.com/browse/PS-5018
- # rocksdb.prefix_extractor_override: https://jira.percona.com/browse/PS-5199
- # rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch: https://bugs.mysql.com/bug.php?id=89223
- # rpl.rpl_multi_source_mts_reset_worker_info: https://jira.percona.com/browse/PS-3786
- # x.crud_insert_cast: https://jira.percona.com/browse/PS-5032
- # x.insert_table_bad_column: https://jira.percona.com/browse/PS-5032
- # x.insert_table_bad_numcolumns: https://jira.percona.com/browse/PS-5032
- # x.insert_table_bad_column_type: https://jira.percona.com/browse/PS-5032
- # x.insert_table: https://jira.percona.com/browse/PS-5032
- # x.update_crud_arrayappend_o: https://jira.percona.com/browse/PS-5032
- # x.update_crud_arrayinsert_o: https://jira.percona.com/browse/PS-5032
+ # These are failing in MySQL 5.7 for now and are believed to be
+ # false positives:
#
local t
- for t in \
- encryption.innodb_encryption_tables \
- group_replication.gr_communication_configuration \
- main.mysqlshow \
- main.percona_bug1289599 \
- keyring_vault.keyring_vault_timeout \
- perfschema.show_sanity \
- rocksdb.prefix_extractor_override \
- rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch \
- rpl.rpl_multi_source_mts_reset_worker_info \
- x.crud_insert_cast \
- x.insert_table_bad_column \
- x.insert_table_bad_numcolumns \
- x.insert_table_bad_column_type \
- x.insert_table \
- x.update_crud_arrayappend_o \
- x.update_crud_arrayinsert_o \
- ; do
- _disable_test "$t" "False positives in Gentoo / Known bug"
+ for t in auth_sec.keyring_udf ; do
+ _disable_test "$t" "False positives in Gentoo"
+ done
+
+ # Unstable tests
+ # - main.xa_prepared_binlog_off: https://bugs.mysql.com/bug.php?id=83340
+ # - rpl.rpl_non_direct_stm_mixing_engines: MDEV-14489
+ for t in main.xa_prepared_binlog_off rpl.rpl_non_direct_stm_mixing_engines ; do
+ _disable_test "$t" "Unstable test"
done
+ if ! use amd64 ; then
+ # fixed in >=mysql-8 via commit 0a417e84
+ _disable_test "gis.gis_bugs_crashes" "Unstable results on non-amd64 architectures due to floating-point operation"
+ fi
+
if use numa && use kernel_linux ; then
# bug 584880
if ! linux_config_exists || ! linux_chkconfig_present NUMA ; then
@@ -648,29 +565,6 @@ src_test() {
fi
fi
- if use tokudb ; then
- if [[ -f "/sys/kernel/mm/transparent_hugepage/enabled" ]] ; then
- if grep -q -E "\[always\]" /sys/kernel/mm/transparent_hugepage/enabled &>/dev/null ; then
- # TokuDB refuses to start when transparent hugepages are enabled
- for t in \
- tokudb.rows-32m-rand-insert \
- tokudb.savepoint-2 \
- tokudb.savepoint-3 \
- tokudb.savepoint-4 \
- tokudb.savepoint-1078 \
- tokudb.savepoint-1078-2 \
- tokudb.savepoint-1078-3 \
- tokudb.savepoint-1078-4 \
- ; do
- _disable_test "$t" "TokuDB will not work with transparent hugepages enabled"
- done
- fi
- else
- einfo "Cannot determine transparent hugepage status."
- einfo "Please note that TokuDB refuses to start when transparent hugepages are enabled!"
- fi
- fi
-
if ! use latin1 ; then
# The following tests will fail if DEFAULT_CHARSET
# isn't set to latin1:
@@ -817,16 +711,6 @@ multilib_src_install_all() {
eprefixify "${TMPDIR}/my.cnf.ok"
newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
-
- if use tokudb ; then
- # Remove some unwanted files
- rm -fv \
- "${ED%/}"/usr/COPYING.AGPLv3 \
- "${ED%/}"/usr/COPYING.GPLv2 \
- "${ED%/}"/usr/PATENTS \
- "${ED%/}"/usr/README.md \
- || die
- fi
fi
#Remove mytop if perl is not selected
diff --git a/dev-db/percona-server/Manifest b/dev-db/percona-server/Manifest
index 83a8eb1a197a..2d00861c261a 100644
--- a/dev-db/percona-server/Manifest
+++ b/dev-db/percona-server/Manifest
@@ -2,10 +2,7 @@ AUX my.cnf-5.7 138 BLAKE2B 71862b4b77334ab74002237453d2c7f6b51cd1ae57dba3b00b19e
AUX my.cnf.distro-client 637 BLAKE2B b0812e0e03aa9a3b2e55e08b933a0b41b6afd95ded61f4d9d7c34a2d3810ec38520abd0d89e1c6565f61d4cd8a36d653f9f3199b3dd6a91345cdb5ff962685d8 SHA512 74bd1d9a58075d0a6195be1f94db310bcbe8da532b03844e6fa1ff84676e84843fc9adf9aed06b7e4db53c9aa24ef0885d96de0ccfe4c6ad98afe4c145d43f4f
AUX my.cnf.distro-server 994 BLAKE2B 41dceff58edf748f9f60ac3c0d1682d2fc2f026fc1fd14b4c2dea398814beda3c09aabea04dd3a9e145464524c629e7e69dc257d1245e0a46dd8584b7f685172 SHA512 cf172edc23d3dda49c21af6b8adef8aa13694d8ceecddf1d612d4ae34d00ba53c51ae4ae7ca4d11083eeacb5d862f59a855a9d80e9e448ab8bbf17f42aac2650
DIST boost_1_59_0.tar.gz 83709983 BLAKE2B 8c6676fa05fa401a6ecb3b890d95aceb4421ec48dd0eab38ce8d170c618e177c82dc67a165938f6be1a01daab24ce41888f5442dbc19ad3dd41368a01a6f89e4 SHA512 05fdbe5637543defdbc630b921515425885593d16db14534ed7b9aa60925ade8fb598d50cb894aed6dae688e789047216daa1bf03fa1aeb6b531060d9dae52ae
-DIST mysql-extras-20181017-2201Z.tar.bz2 328311 BLAKE2B f1b179e0f2d63105f03ba238125e6cfa2c0cbf2084251b6c344bd02517899322bd161470eddab28c514349caac6401c35909b2f37264fdaf2dc196a309d3cc27 SHA512 26e26a3ad926bc9267d89f0bc34b030bc6292f21d3007185c4c1155beaa608566b4268f93edb64fd6156dbae80ac4f2817e78c1e92e90985e2675c2b1f97854e
DIST mysql-extras-20190303-1852Z.tar.bz2 331026 BLAKE2B ee033fce8f1b6a58f1f690710fb9709a585cd45564b35e71d4f840a3a7f83a5d80f53c24236c9976319abd89c68c62c74a7111517f1b9721d3cbd0898bf0dd8d SHA512 30361a0b848ed27f9170b1116458a9bc13b1b585c5fa1933c99927541c31e9bda4008b0563f2fc7db286f998089ebebf1fe3f18fce7a45e62acbf769ac62d8c1
-DIST percona-server-5.7.24-27.tar.gz 81757023 BLAKE2B 80c28ca3195874133b127ba7268aa6a6af89f4d1a38ee34f0a761e8c35b8da2c8a94781e7672e241164b9887549846875fc294e36e4229f8e2c4d3f65562350e SHA512 f2a5af3c75577da911bcee5bf962e5b6d723ede1a21f19f9211cda1a7e37a3523d904ea0af6fa9787418959c8824c0cf48726b8b0a426b81df01e5a51214b70d
DIST percona-server-5.7.25-28.tar.gz 82296869 BLAKE2B eb12f185be6885e124f8fe5d434c0bba22a67fc2d82a28a52b6f7852722ce046a9a5c30ee5c55280b8046786c39336b131c94c05601580ab81ccf0113254f609 SHA512 e323e092d2af39969edc36d647400c20b50ec059b379f9ac32e71d88524940130639ebb2591d4126d6796e111c31c3a03ab1d00726471be00e1662417e5e63b3
-EBUILD percona-server-5.7.24.27.ebuild 35329 BLAKE2B c55fdfe8e6a642527223991fba51c1538d0b9bc1dab3aa371f205177f9f89790b96c14a0203269a87f6ee4ee950097bcee770b5f78e9d262025549b7aefe50fc SHA512 7450b66e5db69026a17f5da743948af9c23f5f759a2b5416ab077cc85c6e2141ee5aa312bf2bcbf77f30c0cd4e9f87ccf288469307038516cb8a6d4887f131c6
EBUILD percona-server-5.7.25.28.ebuild 36188 BLAKE2B 1d4b219e49db090b90b1a3986653205d89af2f9848f790d2cba620cfa0bdac197a84a43ede5e2e846162ceb951387fabe676b282b7aed9a07e94099d8459b4eb SHA512 664f2b505fde195cf5ccac21162826b66dfa0c9dc7b2a5e4535e4e0a15400d42331598e846fd97b8b05483512b9c86a7cac232f903781140aed00ad512e80511
MISC metadata.xml 1416 BLAKE2B a479a1bc7b6e5947ccef2fdf097d3dd91af932500483112c05b86c5d60ab6ec1ac4179bee0fa291a746281054baa791152cac7a34c8c79a0ad4fd8f5e3d1bcf9 SHA512 ec92d201154c3af80aa4cdcd1eae207827a1b2711cfe7b1a9b0153268a33e472329011c56ec39a009776c629163fc9d4f9e77ad2b00461f07199f3dd12db0b52
diff --git a/dev-db/pgpool2/Manifest b/dev-db/pgpool2/Manifest
index e5f7a133e70a..9a66a6469bdb 100644
--- a/dev-db/pgpool2/Manifest
+++ b/dev-db/pgpool2/Manifest
@@ -5,13 +5,9 @@ AUX pgpool2.confd 649 BLAKE2B 1c520c4fa954c7411c1b700c03bf4e39196c599eb239cf8641
AUX pgpool2.initd 2162 BLAKE2B b04f6b952507b8e4815c7b27f09b59ffe64f6262719c5490377fdbc5f8490cdead18fdbeb0ce8379d9cbd4bbb1aa21221d61853ff49a456a5ef6a8d78f3f5129 SHA512 05dd358d20bae60cfdefd7116b1111288b5a2be6d68a9dc40eaf6ba641524d422f2faac79bd3c629cee4f8b1ca601a9b6e303d4228e538d742ea407b6190ee53
AUX pgpool_run_paths-3.6.5.patch 11626 BLAKE2B 5d0b7a49b3c8bf2f2d69d369894e9976037025b289b0ec0f2cf11ed9862347dc4cb166af2cbd65637de40fdae09809a9232b0638cf69339901d6f3f67e9ddcd5 SHA512 ea718378d0ea14fa48975a899df26bc8aafa1e61b0d3f264ead81031a21d68284f4af5ce065c5534d113faf36724c880ce280665e148ec623e9fea9c8f91c77c
AUX pgpool_run_paths-9999.patch 11759 BLAKE2B 35df553f704846cc4ff8d67e5e6b54ca8ed0a5817a148c359b47cae7ff388fe2bb57600113d7f8ac9afe760ea75e3ddd410d111c2ef87aea3c3fb38671d59260 SHA512 109be0f3bcda49db14ebb86d6e9347aa0a47d582ac1a1438b07719f9fa503045cc5b65a27964c3c0b1690ef489f752a497e3b050b816569d0ce01193dc007259
-DIST pgpool-II-3.7.7.tar.gz 3325039 BLAKE2B 47f4d48b811af0fb6626a6ea4b46bd81d13997fa8756f533711f733eed7526ea79bbc929cf894911cc5697c37fd5fde0306eaee485f00b6c41c2701bf08c972c SHA512 9766d011f8a93ae292770b24915f6825d037d55ad3f75be131a58a9dcfb4d1a61f572f2c48f69ee0d3c6cbdfe76da15e417c26f102c646c3d9e1a2f71d205374
DIST pgpool-II-3.7.8.tar.gz 3337039 BLAKE2B bce75be04d3c37dffecbc0a1f029d6e97f316cc2497de032ccd4862acc6e7ae64f12ffffdb42a99141e548a2cc616ed02d7eef6ca2f63e222fb400cbad72828c SHA512 0f4e337c2307368cfd38f29c63b9267dd3171dc4b9cd2c59cff564295908e2f561230156a5b690e4d87ce4c8b3174d01b081147e7f5d8ff403d3adc8e7cea7e7
-DIST pgpool-II-4.0.2.tar.gz 3576212 BLAKE2B 4027b8d02f4422900e674ee49a1946521b0737e73c9cd73363cd1ad1328de294bdec219bb8df55db58c6b2da365f8094e6b2228e13f1d24f35f7fb373280bd66 SHA512 9014c34f69cdcb3064a3713ed97fa0847f5572866db709c53f703b2ff996dbb31988d6573fcd85c9bb715bb54b9c215adaf11eb2f90193371be804ec37ac955e
DIST pgpool-II-4.0.3.tar.gz 3715976 BLAKE2B c5ecfebc44ee4d6ab8fda5ae0854bb51423252ba518b356a37d3b125bc8f4fac048f6f944fdf9b1ee785aae5ac3eca4c4196adf218bc071dd90b93da5c6e6c08 SHA512 76ffbc8df120d4ef68b761684a1805c0349665375f549cd3a194f7d09b9bbdf70d0824da0cbe975e6d15f850704c4fc7c1a2218f551f88f2ce56f542bdfee9b8
-EBUILD pgpool2-3.7.7.ebuild 2637 BLAKE2B 11d6f1983309788e808af8e72d27a6b7fcfb18b71135215786046b9766509a7674ad52ef1b861ddc4d1156cba0fce62a768932e6509e8a0868984da4be4cdb85 SHA512 421c34bfc8aa2bdae0e213dfee556328b0b784af973ae8de8c6c84e2f4b433ce0afc34d16342b0d02abeabd52b828da188d53c73143b66e3b9e00d0c123fd675
-EBUILD pgpool2-3.7.8.ebuild 2638 BLAKE2B 509e2b9fbea8842eb43f78e27c758e3300023b984e65190b6e48d67b2bc14d2b73692c6aa67a2b30d9e97e49851add952e2c5051f9a725d424e79afd87504d7b SHA512 fae64460d7c4dec5fbd8a2233688bb397f310ba3dc93657c1abed9ba615bc8ac656ad144fa26650615b31e83c8404510b2ebc614a019629dc18cf0becfa00132
-EBUILD pgpool2-4.0.2.ebuild 2643 BLAKE2B 3a1a873d73bca65bc0aada8ffabd5bf249cb47f0931c40aa48c23718fef7560cda55c005195ca180af9f2fdfbc45f36ddcc3b2e154a9803e3393a4c03f91f6f6 SHA512 62f6f2ec58d9c8b6fe21b0f344a22f4e9b4fe7d0de0d15473ff5c004c83e68bd535c02b0ea3b4412a61e79e4d2694b7a31221208eb7cebdfd23cd8f4acd715f9
-EBUILD pgpool2-4.0.3.ebuild 2644 BLAKE2B c132e6bd7f88f476b56184298044c03eca300752bb64635c197671672a486849d5e7ae0acad369da0a2c8c1eb9e9769fa1bc6400c97149df1838f1d053c6e7ba SHA512 02dc500b469579bd334e55e921cbc95553ca294ea01ef70ca179b4c4ba9e1e50d4cfbed93ba8fcb883a58deb2ab5bbc1b31a85f26aa6abf84109a8f7e0c6d0cf
+EBUILD pgpool2-3.7.8.ebuild 2637 BLAKE2B 11d6f1983309788e808af8e72d27a6b7fcfb18b71135215786046b9766509a7674ad52ef1b861ddc4d1156cba0fce62a768932e6509e8a0868984da4be4cdb85 SHA512 421c34bfc8aa2bdae0e213dfee556328b0b784af973ae8de8c6c84e2f4b433ce0afc34d16342b0d02abeabd52b828da188d53c73143b66e3b9e00d0c123fd675
+EBUILD pgpool2-4.0.3.ebuild 2643 BLAKE2B 3a1a873d73bca65bc0aada8ffabd5bf249cb47f0931c40aa48c23718fef7560cda55c005195ca180af9f2fdfbc45f36ddcc3b2e154a9803e3393a4c03f91f6f6 SHA512 62f6f2ec58d9c8b6fe21b0f344a22f4e9b4fe7d0de0d15473ff5c004c83e68bd535c02b0ea3b4412a61e79e4d2694b7a31221208eb7cebdfd23cd8f4acd715f9
EBUILD pgpool2-9999.ebuild 2720 BLAKE2B a63e0ba961271a6719fd7fab4a57280fd22eb93ada6d7a37a2c8d7bad381f64b4f160461adc4de760e1b1747cf9536ba56027d7a93710cff3d76251b3453a8ca SHA512 8e3c7a0e2c2562d31974dfd9a9503f1d2c20499b34f69fdd0ca26cf08f344fb115a5f65251e854e9fae9bbd6d007f5d1d9243c17b84885e359f42bad0c6ef5b9
MISC metadata.xml 390 BLAKE2B d6a0560051449e95bb43e81589eee966a477a75d7ec8211ae96b15f2d51ce9555181b8640d9d830f2b42f8159989e9126423c6ccbbc2bf2dd8121f4920a87a16 SHA512 ce26ee116c3c7ff77a771294ed07f38d8f940dc380915c339eb4c543d86fa5bde025ba83e70af2b7bf4a1bef1e51957f151131836855e0dae2e1daed73ffae8d
diff --git a/dev-db/pgpool2/pgpool2-3.7.7.ebuild b/dev-db/pgpool2/pgpool2-3.7.7.ebuild
deleted file mode 100644
index f4f989f9a38f..000000000000
--- a/dev-db/pgpool2/pgpool2-3.7.7.ebuild
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-POSTGRES_COMPAT=( 9.{3..6} 10 )
-
-inherit autotools postgres-multi
-
-MY_P="${PN/2/-II}-${PV}"
-
-DESCRIPTION="Connection pool server for PostgreSQL"
-HOMEPAGE="http://www.pgpool.net/"
-SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
-LICENSE="BSD"
-SLOT="0"
-
-KEYWORDS="amd64 x86"
-
-IUSE="doc libressl memcached pam ssl static-libs"
-
-RDEPEND="
- ${POSTGRES_DEP}
- net-libs/libnsl:0=
- memcached? ( dev-libs/libmemcached )
- pam? ( sys-auth/pambase )
- ssl? (
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:= )
- )
-"
-DEPEND="${RDEPEND}
- !!dev-db/pgpool
- sys-devel/bison
- virtual/pkgconfig
-"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
- postgres_new_user pgpool
-
- postgres-multi_pkg_setup
-}
-
-src_prepare() {
- eapply \
- "${FILESDIR}/pgpool-configure-memcached.patch" \
- "${FILESDIR}/pgpool-configure-pam.patch" \
- "${FILESDIR}/pgpool-configure-pthread.patch" \
- "${FILESDIR}/pgpool_run_paths-3.6.5.patch"
-
- eautoreconf
-
- postgres-multi_src_prepare
-}
-
-src_configure() {
- postgres-multi_foreach econf \
- --disable-rpath \
- --sysconfdir="${EROOT%/}/etc/${PN}" \
- --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \
- --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \
- $(use_enable static-libs static) \
- $(use_with memcached) \
- $(use_with pam) \
- $(use_with ssl openssl)
-}
-
-src_compile() {
- # Even though we're only going to do an install for the best slot
- # available, the extension bits in src/sql need some things outside
- # of that directory built, too.
- postgres-multi_foreach emake
- postgres-multi_foreach emake -C src/sql
-}
-
-src_install() {
- # We only need the best stuff installed
- postgres-multi_forbest emake DESTDIR="${D}" install
-
- # Except for the extension and .so files that each PostgreSQL slot needs
- postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
-
- newinitd "${FILESDIR}/${PN}.initd" ${PN}
- newconfd "${FILESDIR}/${PN}.confd" ${PN}
-
- # Documentation!
- dodoc NEWS TODO
- doman doc/src/sgml/man{1,8}/*
- use doc && dodoc -r doc/src/sgml/html
-
- # Examples and extras
- # mv some files that get installed to /usr/share/pgpool-II so that
- # they all wind up in the same place
- mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
- into "/usr/share/${PN}"
- dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start}
- insinto "/usr/share/${PN}"
- doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam}
-
- # One more thing: Evil la files!
- find "${ED}" -name '*.la' -exec rm -f {} +
-}
diff --git a/dev-db/pgpool2/pgpool2-3.7.8.ebuild b/dev-db/pgpool2/pgpool2-3.7.8.ebuild
index 26d743723953..f4f989f9a38f 100644
--- a/dev-db/pgpool2/pgpool2-3.7.8.ebuild
+++ b/dev-db/pgpool2/pgpool2-3.7.8.ebuild
@@ -15,7 +15,7 @@ SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
LICENSE="BSD"
SLOT="0"
-KEYWORDS="amd64 ~x86"
+KEYWORDS="amd64 x86"
IUSE="doc libressl memcached pam ssl static-libs"
diff --git a/dev-db/pgpool2/pgpool2-4.0.2.ebuild b/dev-db/pgpool2/pgpool2-4.0.2.ebuild
deleted file mode 100644
index caa0de63f44b..000000000000
--- a/dev-db/pgpool2/pgpool2-4.0.2.ebuild
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-POSTGRES_COMPAT=( 9.{3..6} {10..11} )
-
-inherit autotools postgres-multi
-
-MY_P="${PN/2/-II}-${PV}"
-
-DESCRIPTION="Connection pool server for PostgreSQL"
-HOMEPAGE="http://www.pgpool.net/"
-SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
-LICENSE="BSD"
-SLOT="0"
-
-KEYWORDS="amd64 x86"
-
-IUSE="doc libressl memcached pam ssl static-libs"
-
-RDEPEND="
- ${POSTGRES_DEP}
- net-libs/libnsl:0=
- memcached? ( dev-libs/libmemcached )
- pam? ( sys-auth/pambase )
- ssl? (
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:= )
- )
-"
-DEPEND="${RDEPEND}
- !!dev-db/pgpool
- sys-devel/bison
- virtual/pkgconfig
-"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
- postgres_new_user pgpool
-
- postgres-multi_pkg_setup
-}
-
-src_prepare() {
- eapply \
- "${FILESDIR}/pgpool-configure-memcached.patch" \
- "${FILESDIR}/pgpool-configure-pam.patch" \
- "${FILESDIR}/pgpool-configure-pthread.patch" \
- "${FILESDIR}/pgpool_run_paths-3.6.5.patch"
-
- eautoreconf
-
- postgres-multi_src_prepare
-}
-
-src_configure() {
- postgres-multi_foreach econf \
- --disable-rpath \
- --sysconfdir="${EROOT%/}/etc/${PN}" \
- --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \
- --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \
- $(use_enable static-libs static) \
- $(use_with memcached) \
- $(use_with pam) \
- $(use_with ssl openssl)
-}
-
-src_compile() {
- # Even though we're only going to do an install for the best slot
- # available, the extension bits in src/sql need some things outside
- # of that directory built, too.
- postgres-multi_foreach emake
- postgres-multi_foreach emake -C src/sql
-}
-
-src_install() {
- # We only need the best stuff installed
- postgres-multi_forbest emake DESTDIR="${D}" install
-
- # Except for the extension and .so files that each PostgreSQL slot needs
- postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
-
- newinitd "${FILESDIR}/${PN}.initd" ${PN}
- newconfd "${FILESDIR}/${PN}.confd" ${PN}
-
- # Documentation!
- dodoc NEWS TODO
- doman doc/src/sgml/man{1,8}/*
- use doc && dodoc -r doc/src/sgml/html
-
- # Examples and extras
- # mv some files that get installed to /usr/share/pgpool-II so that
- # they all wind up in the same place
- mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
- into "/usr/share/${PN}"
- dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start}
- insinto "/usr/share/${PN}"
- doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam}
-
- # One more thing: Evil la files!
- find "${ED}" -name '*.la' -exec rm -f {} +
-}
diff --git a/dev-db/pgpool2/pgpool2-4.0.3.ebuild b/dev-db/pgpool2/pgpool2-4.0.3.ebuild
index cd03db48b4d0..caa0de63f44b 100644
--- a/dev-db/pgpool2/pgpool2-4.0.3.ebuild
+++ b/dev-db/pgpool2/pgpool2-4.0.3.ebuild
@@ -15,7 +15,7 @@ SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
LICENSE="BSD"
SLOT="0"
-KEYWORDS="amd64 ~x86"
+KEYWORDS="amd64 x86"
IUSE="doc libressl memcached pam ssl static-libs"
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
index 079390d1e8be..282672b5ef56 100644
--- a/dev-db/postgresql/Manifest
+++ b/dev-db/postgresql/Manifest
@@ -12,25 +12,35 @@ AUX postgresql.service-9.6-r1 1477 BLAKE2B 2a652d5b2892f3a52f484fcc0b4f4dad09cf4
AUX postgresql.tmpfiles 39 BLAKE2B 25a5725af53c8e4e4009887e998172dd863ce218a5438351194548c4fc8ea15308dfba3602d5a922cf49b46015198268a4a4528119d8a74dcef4cc4c1767c052 SHA512 498060f2a597cf374f4fb31deaa2d6c5b00edef68efc0e71b82bfc20b717ae12518ba18fcb455a0c518ebba1a0868f38321470616151d02fa79b889a66dcb9f8
DIST postgresql-10.6.tar.bz2 20350612 BLAKE2B b751085b8fce73efb2531378a553c8c956f5e05a0002de8fdc58c0f2a6cf2b9dfaff6bd621047a094a51e459bc8fc5b1658d6a754a396fa3b7aedc1024ea3b4c SHA512 5d4d5cee2a19ad1820c3411bc4851904e3059cdcacc837350694d54d7d59260b66c565c72cc14a3a10541a8fc49c5185f08f57b7a8c7e4c64ed2614da6e1201f
DIST postgresql-10.7.tar.bz2 18940030 BLAKE2B ce02d2c4ba97c1845b3708941bb7a9f6ee025fc4a881e35790279aadf5e35464d6716cfdeb4ad145ce4549e639ad01d333cff858f956607c0cd583af65f1cd3e SHA512 2fa8194e9ef540930eecc2a43907a77f7f185590046350d48fd625bdb1ab459095c4e2e0d2faac846935d7231ac672ace760633deeee365572768da619458ba9
+DIST postgresql-10.8.tar.bz2 18958913 BLAKE2B d2e1664a53c5b2f24b412f497769ffd33e2f48977fa0f4503cb588497b61955a97497c87950ae60d498d75c7385fc63dd832b518174614f695d8882628a4ebb8 SHA512 c9cd0298f553e13e32d4315e17e9e61c1fd011391c5203282d9040f26fd08c85f749e6f2cea3bcc42d1ca153a1272bcd773196ef3bf2bdfb74cd12c5f523b7ca
DIST postgresql-11.1.tar.bz2 21263173 BLAKE2B d762b6e8b0e7b08b16ed252687118a0a4516172e38e8940879fd050f72d19ff045af949e72977a62c2ce0a788af7d42c9bde7748347566bec3694e337bba6f73 SHA512 35d00984e9f5f063a5b96e97aa1b40381ab76d07b2336bda5981fd80bef1324f56eefca5069ae78770ecd6ece5df85264e599fdb3478ecb71d4fdd0d7b6becca
DIST postgresql-11.2.tar.bz2 19714229 BLAKE2B 459674c08a0435363da29428bef7ec49a012b534b390ce6addafac000ce58ad0ad7ba4e1522f5279da29535399836971c61536827d481af766322935d7c6d01b SHA512 dae00a543fdeed36bc338abd4ccfd9fe9a8b6b2b7eaa00b1078e4f27802de75a461c27da2800bc9dd64e658681e5787bd03764bde79940656cae1e8c8716f011
+DIST postgresql-11.3.tar.bz2 19718775 BLAKE2B f56686bff4e70c2b6333554a620a5c2d5c226654a1d61de43b4493c44a14e2bcd9c102dba420994878d328af52d933885e4948cd002f14b693aef1416697a0ea SHA512 03269bb88f44f3a81d5e3a8ca2fe59f63f784436840f08870b2e539755629cbde8ac288e0bb4472ee93294a88b37b814ddff48444254c1a3f7a10b4bb64f7133
DIST postgresql-9.3.25.tar.bz2 17067593 BLAKE2B fd9ca5685e5511dcaa72da882b674846dcd5a16227e5b33ae06701fe7881df71847666c37925033c6cb01c916111a8f76df134491645f4d1e1dd48a008bd2831 SHA512 319e12b73853b74f5ef2c520d64795bb586ffd495ceab6518f7844de6e0a054aea821976c470108d346f8090c7d3949920d9c435432e33004b7caa7a77a5cdca
DIST postgresql-9.4.20.tar.bz2 17905682 BLAKE2B cb65228f8e78dc8b6303a06480a68de58ecac1fefa1342e4563f2c4051c9f5506b366b36c2dbd54207d25ae497625f8fc5e3e771174a6b3ec33c3c19d2c9ea08 SHA512 664c6e97979f38d263d1dc75a7db442f193a230435cad43ddfa2afcd42ac0d73b2aef0e846fddcc9008cd6d89cba2d5c0a4db93b111665646d3ff4d8f6fbe1e8
DIST postgresql-9.4.21.tar.bz2 16871522 BLAKE2B e6b8957f52a95d5fa56bc39756f1de83459882e40eee07c3ddf9e33eab39a0d61ee492864a920e7714ca1914a772dcc9048bc34072349197597cfb116aa94422 SHA512 850d1f59369457d9a8a42de8f0e4811f60e9164d2e7d7605fdabc04cc5ba2e3794d51e155d709419d06b8e070f214f7d3ef2328c6d37f125264ea008ca18ff5a
+DIST postgresql-9.4.22.tar.bz2 16848787 BLAKE2B 5c2aaef13ef0cf33c421e6839877a8e4e1fc5dbe41d9cabefddd369925869f92f6c6b8a124b5778f9b25359103f0a7ada1eddcaf4bac498709f563928f25e7e3 SHA512 f11623a89b2320616fd53eda52da544bdfcb63bff08cb78fccde134ef628eee7ee90b3de6952f4e08c10297d356624faabf0e5b181b0105f51797796cd04efef
DIST postgresql-9.5.15.tar.bz2 18707696 BLAKE2B f1be26085953d5a15a6545aed3527b9eec6eb57c72f2e05401e43200e628b3a42ee824dd1cb0138556b97fe4922a991489dffa77329b653475874766c1d5b944 SHA512 2ea241b6751a2812c689da9bde40151ebb7cdabdd14e93d92f8bea1e3fcf5bc0d4854834999f33270329e22a09c5aeaf8d59d36ca6e8860704f81f3adcfb30d5
DIST postgresql-9.5.16.tar.bz2 17506874 BLAKE2B ce5c804315ce5d7ac95af2455322801f581c3aa8e943ffae40b7e14a95a4610b71956568a418f2f22b8a9814ff9fd1f9296efc974716c0096aa22dcdb7609ff7 SHA512 4583c825ed00a5ba915863b41c39cd9580492444ff299e44c3856db55fb4f0607d184534fe8977d915fb0730e6d638d8560be11915ce21b9d1f6971e7a285c7c
+DIST postgresql-9.5.17.tar.bz2 17563469 BLAKE2B d40b7f95d03db594144b4882f36bbe22f348faab0b8d67eda3f946448bb0e09188eccdeb4d1c92742fb29a920b30ede55e536a863b22d2009283eab66679122d SHA512 bb468528b1f18166cda0be136f31a632859ffe6e6800233b1cb0e91ce11d2d00d3dc108a74580b5552a4d30b9f1b6849c91576cd497beac788c429815c66eac5
DIST postgresql-9.6.11.tar.bz2 20009048 BLAKE2B aa3e5b1e63c983226ea71737982e62eaff655af7e0f55f20ec886f5d7406b1e30e2fe5378b0dd1ef59e777f862ccc2386121653853d4c186a1b4853a9bbb1591 SHA512 a4314f92d1a661af4076d8c120533ecae76d91461043b8a6ad22dd6e5b562e0bf019bc7f3157a26d9666ba5866e254613ae5b690310168b029795dc088f8c060
DIST postgresql-9.6.12.tar.bz2 18759442 BLAKE2B 067b307318f65616651ee4502f420a84df26e906350f07ce5ab4a769608075f0d017b6d84b0ce5045662ab379e236b66cf751f7950d026f011d0915efcdfab3e SHA512 3a7a96caf682461f1f9bffdbe2b72b1ce00cc6680145e00c139e4af8b9dc8b8679fda1626de65921d6e187fa9290efc930584b98f1fd2aba1ba3d790a741a415
+DIST postgresql-9.6.13.tar.bz2 18767279 BLAKE2B c1ec780a7f938f878425cbd6556145e60a613135129daaacc52e9a699cc448a22481b01fac20d0c09373ea6a026f39bc58234aae4f1126333b94f621981a8135 SHA512 65cc70410ad4a1a738b92855b92eecdbb9efbbca0eb9a45a138d47b696c8f9c9cd19073fbfdf5c80eea7633d0be29b4ed8acbadd38724acf8f18c90bb30f9b26
EBUILD postgresql-10.6.ebuild 13809 BLAKE2B 8d423f5493ffd745207a96fc9e2c39dfd875c87711b89efc500700986afee687fce8df9612493f3d1c665d5eb819b438e89c225889d354bb3b5b04b57d97320f SHA512 b63ecae0488fc4527c525dd7134af9dea2862128829a9f0670c5924582b8820b9d2f2a9262de56e28f0f996191dcc898ee692f629b40f4988b41982441294dde
EBUILD postgresql-10.7.ebuild 13811 BLAKE2B fe7a6df33550d3212db168c3e194a122e54e2f46c76f2cb77b52cf91865d2bea6631172c5f7579fd700986925ef9bbc31ef65fdb29ff0361b638577c068cadc1 SHA512 bb742bd0323ea763a9b213ea5331882969554949ab386b9cc8c5a70b8a94261d8c792027e779a9d1306c632b240d20261c5c363a66f3fb511b089319145e3736
+EBUILD postgresql-10.8.ebuild 13816 BLAKE2B c4497055e8b67e3416f5a616ee71e6d5c11506408cbfd0241dbdd1a24e2987a4c42f485690d9fba32630ac788ccabb380955d62bd61a3d5142960c107665c9a2 SHA512 154d48fa734a98e4d79f1eb7f71f8feb3a8db5891d597107f40f851c60073b1dac4f2fd6508a9c73342af8ea2ee8928980b9cc77a263767f19a1e4f9ebd77f17
EBUILD postgresql-11.1.ebuild 13830 BLAKE2B eda10e9ae1ce6404cf75b1c1cdff44638fcfd2e73f0584012e7c3b62d467f3149645fd9c561d6b584cbb826f1f982378acb3a1903bec07334d80d291ee91af56 SHA512 703b35c39a4c0421bddd625ab83ee032174b5cc0944dc709fb22a591ccc4d1d8bb8e1acbe6ed288e0f0448c0529201b6f5061fa62d42bf0b25147c901a4029c6
EBUILD postgresql-11.2.ebuild 13831 BLAKE2B e56079a7e2f0492e5c3889a4b7c5f21b70c33f4b20329ecf84bae8e5a7cb2b2d0defb962b2802de881604291da7f7ab0c1517773e64f5c2fc948f1ec23986e8f SHA512 c585f3dbcba20b1fc20cad583e9a763cc6f8170c91825e10eb23ee568a25db62d8c0d20363383c6ff8c21abb8ec95e188daed5907c1d36489d253cb71c863fd5
+EBUILD postgresql-11.3.ebuild 13837 BLAKE2B 808504669e54192614407e64f0e958fad815b43a9d39b3539e34c33092cba00eca80a4f86f941d9a84c2df7fedee38d02ccd1306139756d3d39db491a817e8f1 SHA512 c6011d47f273c6f16d267d75e7002392f0e75a2373fbeb9d163f0112b772cc25a3db0f75572460463b64c1118c3c24b994ba37c0119b972ab3d59bdc750a1d4a
EBUILD postgresql-9.3.25.ebuild 13558 BLAKE2B 336b83681269f6c8254a5cbf9177451ff3681d76316b63a365d91f4f03c37aa9b34f1043161a1ea389c74b745012744d2df16ad5285b501552c896033461dbcc SHA512 9998f7d66b38f3b8e060d089757790cb5bb5f479cf4997238324322c1d23bf48584d2ff4dfff8b3c6c3a709a4c12def05fff3584eadcd028f91eeeb4eed72e91
EBUILD postgresql-9.4.20.ebuild 14368 BLAKE2B 2c6b46d98d0cb9f9b4e2063d86b7b1b353c3edffc5386c3f1225dde7430633e539714d98b8ec179b13a612dbbd2cb8a32b2aa321a4cf60e74e64c6b793a1a711 SHA512 6de69907fce6835510de53a961d54cc2dc7e0464d48115c29195d3384ba7447ba472d6b89946545c02b4f42cc2e778f4dbdee75728d212ffc651f75076f59ceb
EBUILD postgresql-9.4.21.ebuild 14369 BLAKE2B 32c03b7b3e2b71cc4e347a451d2ab814ed01a51ac7d7324b023123b045847e51a54a3190d5d54903b573516e18031ab9ea119979b785269a2ddf8d694ab76433 SHA512 c8fa0a053847fbd78e928be1d8789cf336ca5c2b067bb01d5cb245560ff5dbbf44e01b5dd34e11d878150d64a76bb1d58aae5e99dc5aca1f7c00d7dc87dd5df3
+EBUILD postgresql-9.4.22.ebuild 14374 BLAKE2B 9e2ff05bb43736b786df2224596ff26267b832a46bd368b208092b40a71443d19ae88052415008416af7defc9fcc74c409e8ca1258d608c4c96d30dd6726c1b3 SHA512 8fe6bf985af6f7ecf52fc36330e9bc1e36b6d5c8c3ea5d152e611228ad47b9c39f303051b1be057d4b0ce0dc69b2405601d39f9915aafcf148dd515a7e6c14d5
EBUILD postgresql-9.5.15.ebuild 14596 BLAKE2B f12b4c612d4360b93f363fdd0a7eda9285db0122a7e663bd7bec8222289e2a2da0bfdaaff9ed2398a154976cf1f13cd9e2e717b23accc7e528f76565942a5976 SHA512 9e9a7aa496a65e036d1fd4528cbfb06f5014059dd96b581ebee38f3a3e65faefad222cb5f2e54dc95b640a89f362275ce0f3d942a092ceeef50973f2937686fa
EBUILD postgresql-9.5.16.ebuild 14597 BLAKE2B 6767d2163fa8dc5435c2271e3b8efbea3b57cc1d2d2d3c0884fef6fc3d750758cc045f4f423699de8fa89ea4570e0ca445b3da7285ad3669faea7f799e31a72b SHA512 8ec5f2768290b43119e472fccc5951832772a137eebb056c57bbd9c25565ef004095aa2a0ed9c03df90f3ea1faf9d26a5ec9ffd6d5c82d31826fd1052a90605f
+EBUILD postgresql-9.5.17.ebuild 14602 BLAKE2B 5d2c3ca2d4f40fd4054582f2da5ab243001f315038b12e6922395f0d2f308d70baca334cba5d2a762f665456968a38f48d8c74fa7a379c2d482bab0a6fa04aec SHA512 03c1347d7a2e7b2e0917b07a86da85c538bc3b233d011e05837f45dc196432978c375adaa6b3dd96a0757b80f80a4450ff6ea46b3059161f426208afb70efae4
EBUILD postgresql-9.6.11.ebuild 14829 BLAKE2B fffb2f1e956b93a561d289f657cf678f4e414e21787c73d1ebddf7182aba7b8374307e878841edb25de82feb866f88d79b89ed115bb4d916b8ed929c1a30b5d1 SHA512 c8c70732f1390285906e45cbce8afa3e3435814210c53e092bc0c2fa9f0ebe8d86b3f782e6eaed989a4c2a9a766a158232623e203e2d4917cfa95a05ab88d213
EBUILD postgresql-9.6.12.ebuild 14830 BLAKE2B 700d0b13f1ff5f35185a9413a1a030c6e3b8c8822ab4c465c3d212a6aaef34f0bc9dd62d4bd6d7d63e410a1927c3c5ccd08c39e3e27abf5ecf0b79fe7a9951f4 SHA512 7e2e661e9981443317704f38227476da0860904234104e5cc1f126acb93acd07cac655fce2d9eb2f7756699874e6afe037fce93ba2d57fda0ec2180bc8362d29
+EBUILD postgresql-9.6.13.ebuild 14835 BLAKE2B ba07100b5a54b662544d236774b437ae11c13ebaf9cea244c02e917fe6044c94951a55b48e269639848f85d568d7351b7b55299f67583d67dd40f58676afb98e SHA512 7d5101b026d3426302270cecd7542faca8e688097472de7b83a207030e3647c6a56f720f3643b03cd9db1ac75e21b27f96214b566dd15eba7e7751a2bb79bfdd
EBUILD postgresql-9999.ebuild 14257 BLAKE2B 778b681890ef644afbc1406fec240d9ce61df01e878f50a2b68242e0c3b04104c5bb82967f1f63ca02d30aa7774f252fe7c64362a8184747c4229afc85879bd8 SHA512 67cab8401cbb88b4aeeab0eb03fda9ea3c68c5f3ea567a100a17732757143d2f4e54ab86645fbf2a9786906b138fa8cbe6a3d5957f7f75e218ab6a0a0a99c62c
MISC metadata.xml 715 BLAKE2B 59ad51ae06a697fe649054d9fe13040423f425b95abdcf3797e1d0d5abba8c62d54cc8c1afb0be0d0a29d1a39d379912bd931925b5df480fb0bb9b238c36e598 SHA512 03027757eaf95313a6825710b1054a9671aa8396381789397006dfe2f66cd41e85cde418e792bf7d71d7db2413905816ff39685774219c1ea5e8b8d35c5cffd0
diff --git a/dev-db/postgresql/postgresql-10.8.ebuild b/dev-db/postgresql/postgresql-10.8.ebuild
new file mode 100644
index 000000000000..faf10457bbba
--- /dev/null
+++ b/dev-db/postgresql/postgresql-10.8.ebuild
@@ -0,0 +1,460 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
+
+PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
+ zh_TW"
+
+inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT=$(get_major_version)
+
+MY_PV=${PV/_/}
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="https://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl python +readline
+ selinux +server systemd ssl static-libs tcl threads uuid xml zlib"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+server? ( systemd? ( sys-apps/systemd ) )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !alpha spinlocks) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(usex server "$(use_with systemd)" '--without-systemd') \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ $(use_enable nls nls "'$(l10n_get_locales)'")
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ serverman=(
+ initdb
+ pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
+ pg_{test_{fsync,timing},upgrade,waldump}
+ post{gres,master}
+ )
+ for m in ${serverman[@]} ; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.6-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+
+ if [[ -n ${REPLACING_VERSIONS} ]] ; then
+ ewarn "If your system is using 'pg_stat_statements' and you are running a"
+ ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
+ ewarn "the following command after upgrading:"
+ ewarn
+ ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
+ fi
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ if ! use systemd; then
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ fi
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ elif use systemd; then
+ einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-11.3.ebuild b/dev-db/postgresql/postgresql-11.3.ebuild
new file mode 100644
index 000000000000..d50a48f688cd
--- /dev/null
+++ b/dev-db/postgresql/postgresql-11.3.ebuild
@@ -0,0 +1,460 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
+
+PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
+ zh_TW"
+
+inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+SLOT=$(get_major_version)
+
+MY_PV=${PV/_/}
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="http://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl llvm nls pam perl python +readline
+ selinux +server systemd ssl static-libs tcl threads uuid xml zlib"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+llvm? ( sys-devel/llvm:=
+ sys-devel/clang:= )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+server? ( systemd? ( sys-apps/systemd ) )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
+
+ if use pam ; then
+ sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !alpha spinlocks) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with llvm) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(usex server "$(use_with systemd)" '--without-systemd') \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ $(use_enable nls nls "'$(l10n_get_locales)'")
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ serverman=(
+ initdb
+ pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
+ pg_{test_{fsync,timing},upgrade,waldump}
+ post{gres,master}
+ )
+ for m in ${serverman[@]} ; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.6-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+
+ if [[ -n ${REPLACING_VERSIONS} ]] ; then
+ ewarn "If your system is using 'pg_stat_statements' and you are running a"
+ ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
+ ewarn "the following command after upgrading:"
+ ewarn
+ ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
+ fi
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ if ! use systemd; then
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ fi
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ elif use systemd; then
+ einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-9.4.22.ebuild b/dev-db/postgresql/postgresql-9.4.22.ebuild
new file mode 100644
index 000000000000..380e7c0177ca
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.4.22.ebuild
@@ -0,0 +1,475 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
+
+PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
+ zh_TW"
+
+inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT="$(get_version_component_range 1-2)"
+
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="https://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp
+ python +readline selinux +server systemd ssl static-libs tcl threads uuid
+ xml zlib"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !pg_legacytimestamp integer-datetimes) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ $(use_enable nls nls "'$(l10n_get_locales)'")
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}tmp"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql96). They may have been created by the
+ # postgresql.eselect module, but they're handled within this ebuild
+ # now. It's alright if we momentarily delete /usr/bin/psql as it
+ # will be recreated by the eselect module in pkg_ppostinst(). This
+ # is only necessary for 9.7 and earlier. 10 and later were never
+ # handled in this manner.
+ local canonicalise
+ if type -p realpath > /dev/null; then
+ canonicalise=realpath
+ elif type -p readlink > /dev/null; then
+ canonicalise='readlink -f'
+ else
+ # can't die, subshell
+ die "No readlink nor realpath found, cannot canonicalise"
+ fi
+
+ local l
+ # First remove any symlinks in /usr/bin that may have been created
+ # by the old eselect
+ for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
+ if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
+ rm "${l}" || ewarn "Couldn't remove ${l}"
+ fi
+ done
+
+ # Then move the symlinks created by the ebuild to their proper place.
+ for l in "${ED}"/usr/bin/*tmp ; do
+ mv "${l}" "${l%tmp}" \
+ || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
+ done
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-9.5.17.ebuild b/dev-db/postgresql/postgresql-9.5.17.ebuild
new file mode 100644
index 000000000000..0f7a7eb04808
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.5.17.ebuild
@@ -0,0 +1,481 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
+
+PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
+ zh_TW"
+
+inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT="$(get_version_component_range 1-2)"
+
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="https://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp
+ python +readline selinux +server systemd ssl static-libs tcl threads uuid
+ xml zlib"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !alpha spinlocks) \
+ $(use_enable !pg_legacytimestamp integer-datetimes) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ $(use_enable nls nls "'$(l10n_get_locales)'")
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}tmp"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql96). They may have been created by the
+ # postgresql.eselect module, but they're handled within this ebuild
+ # now. It's alright if we momentarily delete /usr/bin/psql as it
+ # will be recreated by the eselect module in pkg_ppostinst(). This
+ # is only necessary for 9.7 and earlier. 10 and later were never
+ # handled in this manner.
+ local canonicalise
+ if type -p realpath > /dev/null; then
+ canonicalise=realpath
+ elif type -p readlink > /dev/null; then
+ canonicalise='readlink -f'
+ else
+ # can't die, subshell
+ die "No readlink nor realpath found, cannot canonicalise"
+ fi
+
+ local l
+ # First remove any symlinks in /usr/bin that may have been created
+ # by the old eselect
+ for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
+ if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
+ rm "${l}" || ewarn "Couldn't remove ${l}"
+ fi
+ done
+
+ # Then move the symlinks created by the ebuild to their proper place.
+ for l in "${ED}"/usr/bin/*tmp ; do
+ mv "${l}" "${l%tmp}" \
+ || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
+ done
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ if use alpha && use server ; then
+ ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
+ ewarn "As a result, performance will be extremely degraded."
+ fi
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-9.6.13.ebuild b/dev-db/postgresql/postgresql-9.6.13.ebuild
new file mode 100644
index 000000000000..04536d79c4ca
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.6.13.ebuild
@@ -0,0 +1,486 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
+
+PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
+ zh_TW"
+
+inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+SLOT="$(get_version_component_range 1-2)"
+
+MY_PV=${PV/_/}
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="https://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp
+ python +readline selinux +server systemd ssl static-libs tcl threads uuid
+ xml zlib"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+server? ( systemd? ( sys-apps/systemd ) )
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !alpha spinlocks) \
+ $(use_enable !pg_legacytimestamp integer-datetimes) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(usex server "$(use_with systemd)" '--without-systemd') \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ $(use_enable nls nls "'$(l10n_get_locales)'")
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}tmp"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.6-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql96). They may have been created by the
+ # postgresql.eselect module, but they're handled within this ebuild
+ # now. It's alright if we momentarily delete /usr/bin/psql as it
+ # will be recreated by the eselect module in pkg_ppostinst(). This
+ # is only necessary for 9.7 and earlier. 10 and later were never
+ # handled in this manner.
+ local canonicalise
+ if type -p realpath > /dev/null; then
+ canonicalise=realpath
+ elif type -p readlink > /dev/null; then
+ canonicalise='readlink -f'
+ else
+ # can't die, subshell
+ die "No readlink nor realpath found, cannot canonicalise"
+ fi
+
+ local l
+ # First remove any symlinks in /usr/bin that may have been created
+ # by the old eselect
+ for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
+ if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
+ rm "${l}" || ewarn "Couldn't remove ${l}"
+ fi
+ done
+
+ # Then move the symlinks created by the ebuild to their proper place.
+ for l in "${ED}"/usr/bin/*tmp ; do
+ mv "${l}" "${l%tmp}" \
+ || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
+ done
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ if ! use systemd; then
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ fi
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ elif use systemd; then
+ einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/spatialite/Manifest b/dev-db/spatialite/Manifest
index bcbd9f30192d..86453745b1a5 100644
--- a/dev-db/spatialite/Manifest
+++ b/dev-db/spatialite/Manifest
@@ -1,5 +1,5 @@
DIST libspatialite-4.3.0.tar.gz 4439538 BLAKE2B f3bbda3b9d6099197691eb85e20c693d5cbc3a8958c8f23bd1ba57add9d8676895163d845a4aadd690650244ffa7ae2a02ce86e844e032b815fe4c94f30fb4b8 SHA512 b686766ed90711a41efbf219a8942ead8aefda8784a9cabc59233f107e0e10eda949d022152af1064a169975aa6a47515f6064589166418b853427dde5779ecc
DIST libspatialite-4.3.0a.tar.gz 4440660 BLAKE2B 2eb2afb96b096b86be9c30cf71663b7b2839d345b6c418fc8511653ed59d0aeff1756b6b19807140c67128c938e39be66d13088640658d14883c92c438c97251 SHA512 adfd63e8dde0f370b07e4e7bb557647d2bfb5549205b60bdcaaca69ff81298a3d885e7c1ca515ef56dd0aca152ae940df8b5dbcb65bb61ae0a9337499895c3c0
-EBUILD spatialite-4.3.0-r1.ebuild 1057 BLAKE2B 0c6b757b74f0af4aa3e621d8a0e60e9b70d95d6aea4b5bca307d5eb3048ef754c2b0c187d44e591d62f6af47848f36ff29da929f660d07b68b6a850f8a9a1e10 SHA512 6507bf86455097d9eef6a3b4e67066c02a6037ec37b7536b7c712c29e5d48e28e6fbb55600843bae38c5ab079d015784d20ad5a402e9f621a16f57a8d28da30f
+EBUILD spatialite-4.3.0-r1.ebuild 1060 BLAKE2B f01a8c5e0d60da79a3d3a524fdbd51b8afe63285746e1b5458d05742d0eb2b78bc02550dbb326f86691f0559a3d5c2f039007cba60fc3f07d9f49c1ad95b658b SHA512 1acdc18e95954a6bd6c510c80ea85b78f59435efa66f53d1f4029cc536f301243bb030161a2ad4eed596f15d2c4f1ce52b4fd673400decd171da9b11e356d582
EBUILD spatialite-4.3.0a.ebuild 1072 BLAKE2B fca30b1c5e55b319b8b06ad509a2e305e8bad3fd5c208ec17991f0aba11ea8acdf8bd32a976511cb55d979e298c09f8973757ed2c627e4c91b658154d8682ac1 SHA512 1c63596e1101681677dfb36866f1e6135520cc6687243383d3c5b859d85bb899ea6ee0729a98448c7a8d8e882a79739c4b5cf235edead99ddc75d2336d47c90e
MISC metadata.xml 559 BLAKE2B b128c4425723bb652063fd3ebebcd83de75a44c7a01e5a8b6c6596cad0bcd1a5f86977f4e3b49d2f1945ea83f12f9761ba712d5f1d919338996c7ddf18bc4a66 SHA512 a21438d83d828b52e4fc16f91edd29e6ace87ada9b697cf233b847a6d3a9f5196135769993873f23409f98548bf852a4e89645c2b0eaf57bd8427ff6dcc36111
diff --git a/dev-db/spatialite/spatialite-4.3.0-r1.ebuild b/dev-db/spatialite/spatialite-4.3.0-r1.ebuild
index 9adfb477cd11..cc5f1d7760a0 100644
--- a/dev-db/spatialite/spatialite-4.3.0-r1.ebuild
+++ b/dev-db/spatialite/spatialite-4.3.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -12,7 +12,7 @@ SRC_URI="https://www.gaia-gis.it/gaia-sins/${MY_PN}-sources/${MY_P}.tar.gz"
LICENSE="MPL-1.1"
SLOT="0"
-KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86"
+KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 x86"
IUSE="+geos iconv +proj test +xls +xml"
RDEPEND="
diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest
index 6bee3d0432f9..6744a830f39e 100644
--- a/dev-db/sqlite/Manifest
+++ b/dev-db/sqlite/Manifest
@@ -12,5 +12,5 @@ DIST sqlite-doc-3280000.zip 9421770 BLAKE2B 695eab96f718307a7aff8a171d9e416ddb4b
DIST sqlite-src-3270200.zip 12248529 BLAKE2B b3c79b85bbfa376b31ebb4ad33aea3f0b60c1f6d1e6505e02758cffff41e44ea0c5b8c24892f0757502ed6213c0f97f00957632ddf0e5ffe25e9f8b7f62c6e9a SHA512 52f61e2fa54558b953dba62b27961eef8563f40e6b4a62638087cb22c7d1fdf2c915ea1071939e2e98f3ce6041da2c9bfb1bdbc1e8b8b4a049b8148e878a4e5e
DIST sqlite-src-3280000.zip 12477204 BLAKE2B e62e0f36f0bebf89990f8ec91cb1e508a5ebc92bb212eaf9c80eb0febecb5623f5938ecd31c210837314f1f9aab19a18189824f82a106799384d8184ca5f65ab SHA512 49c35c65fa686a2326e13218db583c54fa5fe8f48f0caddd11a942601803b3023f7d32ffbab16641e0d72dc9ed288ad26eaa7226c865ac54e1f181859125651f
EBUILD sqlite-3.27.2.ebuild 9949 BLAKE2B 2f377a97be15eabca01ba031906aea8a05ad8c19c3b88aa00fa18b3fd8ae875478210471e83b8e670d7ff3da0f8cafd5419810f8e178d49fd79d514b9da3af2f SHA512 8b6bf4e9b9120b7bac35382f6bb4058be193e8295a1d21f18c2d1c6ebbdcbc123f02a398cba01e0100091c760ca0a4137110b66a94993cdbad78c555428654be
-EBUILD sqlite-3.28.0.ebuild 10132 BLAKE2B de174b5ae32dcfbd9b9fc69306d7de2734d2eda910ab26c76bffe841ab2101a7742c973662b4d9700625cfd4187b20cce0fdeb99896bed44f55a72786e861304 SHA512 df358941b7bb482066fe6929eec2f7087f51ddeb8a551f1e4366cdbe8726065b95a56482ea6aaa2fa40d5a4cb9c8c91a64cb96d2cddeb3b22d7bdebc78274638
+EBUILD sqlite-3.28.0.ebuild 10128 BLAKE2B 6fada4e519c344c4cbe3eb73398b8b0d07fc1057ff983e8e9fe083c98ec7b903b7da4ff704146a7d75f4ab12a680f1b469a91a44ba6fc3ae3af06013bc202efa SHA512 cc6671b879f1e20cf8ec654c7d7dd6086f28d9c5a68affd4db47d5c51d0bf8803d7af1300aa2c08444d861dc4dee1878081bc20b7e3815a1df5b61ec087a4148
MISC metadata.xml 723 BLAKE2B 8866fbde770e7b8582de27303c72df047db80e0d70b1a1ceca0951a05b51bb704452071ceb6c29ecf3704d523888351615d1798aaab092e6b7505d4c6e3698ad SHA512 40616710b1d4edd3e24b5ac0797c1c9b606aeacac9f9543722bc9529e7c2c704a0c10b0ca68a5ba6e0a0ee8bc605212e8a49a050c8687afbdd7dbf28d6d4506a
diff --git a/dev-db/sqlite/sqlite-3.28.0.ebuild b/dev-db/sqlite/sqlite-3.28.0.ebuild
index 8fa70d0563d4..b58e47665c29 100644
--- a/dev-db/sqlite/sqlite-3.28.0.ebuild
+++ b/dev-db/sqlite/sqlite-3.28.0.ebuild
@@ -19,7 +19,7 @@ SRC_URI="doc? ( https://sqlite.org/2019/${PN}-doc-${DOC_PV}.zip )
LICENSE="public-domain"
SLOT="3"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
RESTRICT="!test? ( test )"