From b7b97785ebbb2f11d24d14dab8b81ed274f4ce6a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 19 Mar 2019 11:37:34 +0000 Subject: gentoo resync : 19.03.2019 --- dev-db/Manifest.gz | Bin 20169 -> 19318 bytes dev-db/etcd/Manifest | 6 +- dev-db/etcd/etcd-3.3.10.ebuild | 77 -- dev-db/etcd/etcd-3.3.11.ebuild | 77 -- dev-db/etcd/etcd-3.3.12.ebuild | 1 + dev-db/lib_mysqludf_log/Manifest | 4 - .../files/lib_mysqludf_log-warnings.patch | 11 - .../lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild | 56 -- dev-db/lib_mysqludf_log/metadata.xml | 5 - dev-db/lib_mysqludf_stem/Manifest | 4 - .../files/lib_mysqludf_stem-mysql_m4.patch | 71 -- .../lib_mysqludf_stem-0.9.1.ebuild | 68 -- dev-db/lib_mysqludf_stem/metadata.xml | 5 - dev-db/lmdb/Manifest | 2 +- dev-db/lmdb/lmdb-0.9.23.ebuild | 2 +- dev-db/mariadb-connector-c/Manifest | 9 +- ...db-connector-c-3.0.7-fix-pkconfig-file-r1.patch | 32 - .../mariadb-connector-c-3.0.7-r1.ebuild | 102 --- .../mariadb-connector-c-3.0.8.ebuild | 103 --- .../mariadb-connector-c-3.0.9.ebuild | 21 +- .../mariadb-connector-c-9999.ebuild | 17 +- dev-db/mariadb-galera/Manifest | 6 +- .../mariadb-galera-10.0.35-r1.ebuild | 849 ------------------ .../mariadb-galera/mariadb-galera-10.0.38.ebuild | 859 ++++++++++++++++++ dev-db/mariadb/Manifest | 12 +- dev-db/mariadb/files/my.cnf.distro-client | 2 +- dev-db/mariadb/mariadb-10.1.38-r1.ebuild | 887 +++++++++++++++++++ dev-db/mariadb/mariadb-10.1.38.ebuild | 887 ------------------- dev-db/mariadb/mariadb-10.2.22-r1.ebuild | 972 ++++++++++++++++++++ dev-db/mariadb/mariadb-10.2.22.ebuild | 966 -------------------- dev-db/mariadb/mariadb-10.3.12.ebuild | 968 -------------------- dev-db/mariadb/mariadb-10.3.13.ebuild | 973 +++++++++++++++++++++ dev-db/mongodb/Manifest | 9 +- .../mongodb/files/mongodb-3.2.10-boost-1.62.patch | 15 - dev-db/mongodb/metadata.xml | 1 + dev-db/mongodb/mongodb-3.6.10.ebuild | 164 ++++ dev-db/mongodb/mongodb-4.0.5.ebuild | 164 ++++ dev-db/mongodb/mongodb-4.0.6.ebuild | 164 ++++ dev-db/mysql-connector-c++/Manifest | 4 +- .../mysql-connector-c++-1.1.12.ebuild | 5 +- .../mysql-connector-c++-8.0.15.ebuild | 7 +- dev-db/mysql-init-scripts/Manifest | 5 + dev-db/mysql-init-scripts/files/init.d-2.3 | 194 ++++ dev-db/mysql-init-scripts/files/init.d-s6-2.3 | 163 ++++ .../mysql-init-scripts/files/init.d-supervise-2.3 | 180 ++++ .../mysql-init-scripts/files/logrotate.mysql-2.3 | 14 + .../mysql-init-scripts-2.3.ebuild | 67 ++ dev-db/mysql-udf-base64/Manifest | 6 - .../files/mysql-udf-base64-signedness.patch | 29 - dev-db/mysql-udf-base64/files/mysql-udf-base64.sql | 5 - dev-db/mysql-udf-base64/metadata.xml | 5 - .../mysql-udf-base64-20010618.ebuild | 65 -- dev-db/mysql-udf-http/Manifest | 4 - .../files/mysql-udf-http-stdlib.patch | 10 - dev-db/mysql-udf-http/metadata.xml | 8 - dev-db/mysql-udf-http/mysql-udf-http-1.0.ebuild | 59 -- dev-db/mysql-udf-ipv6/Manifest | 4 - .../files/mysql-udf-ipv6-warnings.patch | 28 - dev-db/mysql-udf-ipv6/metadata.xml | 8 - dev-db/mysql-udf-ipv6/mysql-udf-ipv6-0.4.ebuild | 68 -- dev-db/mysql/Manifest | 8 +- dev-db/mysql/files/my.cnf.distro-client | 2 +- dev-db/mysql/mysql-5.6.43.ebuild | 4 +- dev-db/mysql/mysql-5.7.25.ebuild | 6 +- dev-db/percona-server/Manifest | 6 +- dev-db/percona-server/files/my.cnf.distro-client | 2 +- .../percona-server/percona-server-5.7.25.28.ebuild | 4 +- dev-db/pgadmin4/Manifest | 2 + dev-db/pgadmin4/pgadmin4-4.3.ebuild | 124 +++ dev-db/pgpool2/Manifest | 4 + dev-db/pgpool2/pgpool2-3.7.8.ebuild | 104 +++ dev-db/pgpool2/pgpool2-4.0.3.ebuild | 104 +++ dev-db/pgtap/Manifest | 2 - dev-db/pgtap/pgtap-0.98.0.ebuild | 27 - dev-db/postgresql/Manifest | 6 +- dev-db/postgresql/postgresql-10.7.ebuild | 2 +- dev-db/postgresql/postgresql-11.1.ebuild | 2 +- dev-db/postgresql/postgresql-11.2.ebuild | 2 +- dev-db/qt5-sqlcipher/Manifest | 2 + .../qt5-sqlcipher-1.0.1_p20181221.ebuild | 50 ++ dev-db/redis/Manifest | 2 + dev-db/redis/redis-4.0.13.ebuild | 141 +++ dev-db/rqlite/Manifest | 15 +- dev-db/rqlite/rqlite-4.3.0.ebuild | 50 -- dev-db/rqlite/rqlite-4.4.0.ebuild | 1 + 85 files changed, 5399 insertions(+), 4782 deletions(-) delete mode 100644 dev-db/etcd/etcd-3.3.10.ebuild delete mode 100644 dev-db/etcd/etcd-3.3.11.ebuild delete mode 100644 dev-db/lib_mysqludf_log/Manifest delete mode 100644 dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch delete mode 100644 dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild delete mode 100644 dev-db/lib_mysqludf_log/metadata.xml delete mode 100644 dev-db/lib_mysqludf_stem/Manifest delete mode 100644 dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch delete mode 100644 dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild delete mode 100644 dev-db/lib_mysqludf_stem/metadata.xml delete mode 100644 dev-db/mariadb-connector-c/files/mariadb-connector-c-3.0.7-fix-pkconfig-file-r1.patch delete mode 100644 dev-db/mariadb-connector-c/mariadb-connector-c-3.0.7-r1.ebuild delete mode 100644 dev-db/mariadb-connector-c/mariadb-connector-c-3.0.8.ebuild delete mode 100644 dev-db/mariadb-galera/mariadb-galera-10.0.35-r1.ebuild create mode 100644 dev-db/mariadb-galera/mariadb-galera-10.0.38.ebuild create mode 100644 dev-db/mariadb/mariadb-10.1.38-r1.ebuild delete mode 100644 dev-db/mariadb/mariadb-10.1.38.ebuild create mode 100644 dev-db/mariadb/mariadb-10.2.22-r1.ebuild delete mode 100644 dev-db/mariadb/mariadb-10.2.22.ebuild delete mode 100644 dev-db/mariadb/mariadb-10.3.12.ebuild create mode 100644 dev-db/mariadb/mariadb-10.3.13.ebuild delete mode 100644 dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch create mode 100644 dev-db/mongodb/mongodb-3.6.10.ebuild create mode 100644 dev-db/mongodb/mongodb-4.0.5.ebuild create mode 100644 dev-db/mongodb/mongodb-4.0.6.ebuild create mode 100644 dev-db/mysql-init-scripts/files/init.d-2.3 create mode 100644 dev-db/mysql-init-scripts/files/init.d-s6-2.3 create mode 100644 dev-db/mysql-init-scripts/files/init.d-supervise-2.3 create mode 100644 dev-db/mysql-init-scripts/files/logrotate.mysql-2.3 create mode 100644 dev-db/mysql-init-scripts/mysql-init-scripts-2.3.ebuild delete mode 100644 dev-db/mysql-udf-base64/Manifest delete mode 100644 dev-db/mysql-udf-base64/files/mysql-udf-base64-signedness.patch delete mode 100644 dev-db/mysql-udf-base64/files/mysql-udf-base64.sql delete mode 100644 dev-db/mysql-udf-base64/metadata.xml delete mode 100644 dev-db/mysql-udf-base64/mysql-udf-base64-20010618.ebuild delete mode 100644 dev-db/mysql-udf-http/Manifest delete mode 100644 dev-db/mysql-udf-http/files/mysql-udf-http-stdlib.patch delete mode 100644 dev-db/mysql-udf-http/metadata.xml delete mode 100644 dev-db/mysql-udf-http/mysql-udf-http-1.0.ebuild delete mode 100644 dev-db/mysql-udf-ipv6/Manifest delete mode 100644 dev-db/mysql-udf-ipv6/files/mysql-udf-ipv6-warnings.patch delete mode 100644 dev-db/mysql-udf-ipv6/metadata.xml delete mode 100644 dev-db/mysql-udf-ipv6/mysql-udf-ipv6-0.4.ebuild create mode 100644 dev-db/pgadmin4/pgadmin4-4.3.ebuild create mode 100644 dev-db/pgpool2/pgpool2-3.7.8.ebuild create mode 100644 dev-db/pgpool2/pgpool2-4.0.3.ebuild delete mode 100644 dev-db/pgtap/pgtap-0.98.0.ebuild create mode 100644 dev-db/qt5-sqlcipher/qt5-sqlcipher-1.0.1_p20181221.ebuild create mode 100644 dev-db/redis/redis-4.0.13.ebuild delete mode 100644 dev-db/rqlite/rqlite-4.3.0.ebuild (limited to 'dev-db') diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz index cc16c48ec2bb..e7b55f81f932 100644 Binary files a/dev-db/Manifest.gz and b/dev-db/Manifest.gz differ diff --git a/dev-db/etcd/Manifest b/dev-db/etcd/Manifest index bf4c0cc4bb6d..4136d5c87ee5 100644 --- a/dev-db/etcd/Manifest +++ b/dev-db/etcd/Manifest @@ -4,10 +4,6 @@ AUX etcd.initd 821 BLAKE2B 5eba7f0e8d134ff45caba8c1eb3aaf6afb412082b9a5df95925f3 AUX etcd.logrotated 104 BLAKE2B 3126c99db171af177d6d6368e7e53f3e5e07b9ae2926ff12cb0ff7fb877527df33a91dedcaa4bbbffa190b4f9c2f53868aeca093b93e9cad50718a23eb5fdd46 SHA512 64d3181a936f8bab635a17f90679041c2d70a712307928feae03a517ad02252fc37e25738979bc1ccd0657ef70439e65cb0306759bec3939e940ec382a02d94f AUX etcd.service 304 BLAKE2B ecffe9889f9530bf7172638a0273736abba2b3ea5c5540b5452d26fbaec17ab9c138db86b543c3c88fd3d16ce79487eb2c31ad7bbfb0c5b9cd11eede9b99bd2d SHA512 0074f77a17afe2bb4145f12a6eb312caa3e08cfe8bf35856b79d091ad8786c4223bd91c0a865e789ee9ba180f2672b31721742bb32efd0cd383bc747eb926961 AUX etcd.tmpfiles.d.conf 76 BLAKE2B e5aa0ca42dd579e9c2ac8c6bdfce83f87ec79ce64d10e20b61ab3df45918747f588b9246085fec925bb39b772e061628aadd030a23a59b65a2fc2243eca1a7f9 SHA512 7324b74dcfe050dd7fbc318ca3ce9b5d58bce8fa2ce2d2d771664ef981c834375f7cbfebcb630cd61dab2a3f6bf6c3733ad04f752beadf7bb6fedcc80ff682ce -DIST etcd-3.3.10.tar.gz 3526904 BLAKE2B 8266212707f8fb280d55deba8dffb44e4d48b906c56034b174848fe6f237d5efba8c15ebea076d799db7f3ec560e2d188fdcc8fe26334ae1cbef0384fe8cf847 SHA512 848e241e816312307f74520b99aeabf7def6862093897035ace16cb230817d8e2681d7d2f1c1ac220d7c2b4c7c0a1262bbe3e4db927524f785de888566d2097c -DIST etcd-3.3.11.tar.gz 3526863 BLAKE2B 5daf511e0d1d064a141a29de456aca0a837567052e3c742afc535405e04c90c70dd347b90960df2decadc53a38ceaf7acfad9346677cb17f892ece437cdf10e8 SHA512 4274c4988b6e7fe61dbcc88c88ed6647debd7a67c448b9101c77bebeef6400e65b9e2cc930f635c3f59105554411e1ac606c6a146ad6927a01d2e921b1a92949 DIST etcd-3.3.12.tar.gz 3527586 BLAKE2B fdc4e3e9522c032d951045d4eda7f36743d4fbbb4ea8673bbe00bb38931cd7442910b0b54eeb6df0957439332df498389f3568ba7e8bdecfbd873fecfb3df86f SHA512 63ba6130bd93471260b8d90760455bccef2755e672a9df39224491188c69e4e3e8c1157cfb639c4002fb8a6d16950f7ff448a83e0acbc389162b742f3df6234f -EBUILD etcd-3.3.10.ebuild 1945 BLAKE2B 784b63fd47b27837f2d8c344ca6318c8f54e47e24a034c068d24935c96f9867df36be67fbe406259524e989a8d17a0c1aa5210938e16363e34300afaed5e70b1 SHA512 a0f1d2555d205e46b82e8db5ebcaae808bf788c0c256f4355bd3792f8666f06bae7a6a9d6f3b24bfc6c88145a097ac1de2759a63f9e6a52c330aa4ebceb5269d -EBUILD etcd-3.3.11.ebuild 1949 BLAKE2B 57a02f2ded70079e6da6520853058dfc5b069b3a6f965e6768bca48414cff077694b92ac2725f4fa0c6cde9bfe9938a16056a3cf73c7ae366863943a27a5115c SHA512 4370e03e5831a23aaa7826e8bd4ef73b384784ba79d4f904a73f4002e6bfcfa9d3164b20e451a59d6db49928e8fd1f59d1d501f1aa3b7110261def861e317aa3 -EBUILD etcd-3.3.12.ebuild 1949 BLAKE2B 6f0ad2fcb58afba2af80f01dc23c13af419d190e614d3027450195fbeb3e5c17d452c14c0e714c9774b0f4b0140d0f1992a554484a76be3e69fa3063147ba7ff SHA512 2861f5dcb65b7d13c4858751efbc8e9b51804fea1d87b8eea1170f90da58ebdde7839fe4d14c0e4aa5fc4824b0a5d584cbf773910ecbc9901a57fcc588988086 +EBUILD etcd-3.3.12.ebuild 1991 BLAKE2B 856a1e4bde495fcb961a7acb5a985a12b5bfeda9c962d88a42c538d1465368c697348588a641cb673a527f26dde96965ba614209e196d4596fc58041619bbb34 SHA512 17ed0233df8464b24f304dbe1727300c1eaf9ad79382a3aebb7a1dad8e281c6965a67406e064181f8f0beb90c502d05e126962563e83b620abe6675f93513ca2 MISC metadata.xml 679 BLAKE2B 7374379a18107011df792be631428834334ad8e6da5cfe404f18555e8c168d3fc716a1c8d6cb5cf1d9ccd173737aecf93a165f846865dbb6ba4a76bd4669b446 SHA512 8070d8b51dd3319e8b159072db237dcc5299361c2f74fa086fc4cbc174cc6a5c8f7659310332b54b2275e2bc3d028323c4dfa5775e21693a339f54312582d2f0 diff --git a/dev-db/etcd/etcd-3.3.10.ebuild b/dev-db/etcd/etcd-3.3.10.ebuild deleted file mode 100644 index b1e380183334..000000000000 --- a/dev-db/etcd/etcd-3.3.10.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit user systemd golang-vcs-snapshot - -KEYWORDS="amd64" -EGO_PN="github.com/coreos/etcd" -GIT_COMMIT="27fc7e2" -MY_PV="${PV/_rc/-rc.}" -DESCRIPTION="Highly-available key value store for shared configuration and service discovery" -HOMEPAGE="https://github.com/coreos/etcd" -SRC_URI="https://${EGO_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" -LICENSE="Apache-2.0" -SLOT="0" -IUSE="doc +server" -DEPEND=">=dev-lang/go-1.9:=" -RDEPEND="!dev-db/etcdctl" - -src_prepare() { - default - sed -e "s|GIT_SHA=.*|GIT_SHA=${GIT_COMMIT}|"\ - -i "${S}"/src/${EGO_PN}/build || die - sed -e 's:\(for p in \)shellcheck :\1 :' \ - -e 's:^ gofmt \\$:\\:' \ - -e 's:^ govet \\$:\\:' \ - -i "${S}"/src/${EGO_PN}/test || die - # missing ... in args forwarded to print-like function - sed -e 's:l\.Logger\.Panic(v):l.Logger.Panic(v...):' \ - -i "${S}"/src/${EGO_PN}/raft/logger.go || die -} - -pkg_setup() { - if use server; then - enewgroup ${PN} - enewuser ${PN} -1 -1 /var/lib/${PN} ${PN} - fi -} - -src_compile() { - export GOPATH=${S} - pushd src/${EGO_PN} || die - GO_BUILD_FLAGS=-v ./build || die - popd || die -} - -src_install() { - pushd src/${EGO_PN} || die - dobin bin/etcdctl - use doc && dodoc -r Documentation - if use server; then - insinto /etc/${PN} - doins "${FILESDIR}/${PN}.conf" - dobin bin/etcd - dodoc README.md - systemd_dounit "${FILESDIR}/${PN}.service" - systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d.conf" ${PN}.conf - newinitd "${FILESDIR}"/${PN}.initd ${PN} - newconfd "${FILESDIR}"/${PN}.confd ${PN} - insinto /etc/logrotate.d - newins "${FILESDIR}/${PN}.logrotated" "${PN}" - keepdir /var/lib/${PN} - fowners ${PN}:${PN} /var/lib/${PN} - fperms 0700 /var/lib/${PN} - keepdir /var/log/${PN} - fowners ${PN}:${PN} /var/log/${PN} - fperms 755 /var/log/${PN} - fi - popd || die -} - -src_test() { - pushd src/${EGO_PN} || die - ./test || die - popd || die -} diff --git a/dev-db/etcd/etcd-3.3.11.ebuild b/dev-db/etcd/etcd-3.3.11.ebuild deleted file mode 100644 index 40c9067fb1d4..000000000000 --- a/dev-db/etcd/etcd-3.3.11.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit user systemd golang-vcs-snapshot - -KEYWORDS="~amd64" -EGO_PN="github.com/etcd-io/etcd" -GIT_COMMIT="2cf9e51" -MY_PV="${PV/_rc/-rc.}" -DESCRIPTION="Highly-available key value store for shared configuration and service discovery" -HOMEPAGE="https://github.com/etcd-io/etcd" -SRC_URI="https://${EGO_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" -LICENSE="Apache-2.0" -SLOT="0" -IUSE="doc +server" -DEPEND=">=dev-lang/go-1.10:=" -RDEPEND="!dev-db/etcdctl" - -src_prepare() { - default - sed -e "s|GIT_SHA=.*|GIT_SHA=${GIT_COMMIT}|"\ - -i "${S}"/src/${EGO_PN}/build || die - sed -e 's:\(for p in \)shellcheck :\1 :' \ - -e 's:^ gofmt \\$:\\:' \ - -e 's:^ govet \\$:\\:' \ - -i "${S}"/src/${EGO_PN}/test || die - # missing ... in args forwarded to print-like function - sed -e 's:l\.Logger\.Panic(v):l.Logger.Panic(v...):' \ - -i "${S}"/src/${EGO_PN}/raft/logger.go || die -} - -pkg_setup() { - if use server; then - enewgroup ${PN} - enewuser ${PN} -1 -1 /var/lib/${PN} ${PN} - fi -} - -src_compile() { - export GOPATH=${S} - pushd src/${EGO_PN} || die - GO_BUILD_FLAGS=-v ./build || die - popd || die -} - -src_install() { - pushd src/${EGO_PN} || die - dobin bin/etcdctl - use doc && dodoc -r Documentation - if use server; then - insinto /etc/${PN} - doins "${FILESDIR}/${PN}.conf" - dobin bin/etcd - dodoc README.md - systemd_dounit "${FILESDIR}/${PN}.service" - systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d.conf" ${PN}.conf - newinitd "${FILESDIR}"/${PN}.initd ${PN} - newconfd "${FILESDIR}"/${PN}.confd ${PN} - insinto /etc/logrotate.d - newins "${FILESDIR}/${PN}.logrotated" "${PN}" - keepdir /var/lib/${PN} - fowners ${PN}:${PN} /var/lib/${PN} - fperms 0700 /var/lib/${PN} - keepdir /var/log/${PN} - fowners ${PN}:${PN} /var/log/${PN} - fperms 755 /var/log/${PN} - fi - popd || die -} - -src_test() { - pushd src/${EGO_PN} || die - ./test || die - popd || die -} diff --git a/dev-db/etcd/etcd-3.3.12.ebuild b/dev-db/etcd/etcd-3.3.12.ebuild index 00de853590ff..de901b0d963b 100644 --- a/dev-db/etcd/etcd-3.3.12.ebuild +++ b/dev-db/etcd/etcd-3.3.12.ebuild @@ -39,6 +39,7 @@ pkg_setup() { } src_compile() { + export -n GOCACHE XDG_CACHE_HOME #651934 export GOPATH=${S} pushd src/${EGO_PN} || die GO_BUILD_FLAGS=-v ./build || die diff --git a/dev-db/lib_mysqludf_log/Manifest b/dev-db/lib_mysqludf_log/Manifest deleted file mode 100644 index fdd3e65ea338..000000000000 --- a/dev-db/lib_mysqludf_log/Manifest +++ /dev/null @@ -1,4 +0,0 @@ -AUX lib_mysqludf_log-warnings.patch 479 BLAKE2B ffaec94795811f77b6b8a0fe1c56547933add3583fcc45696bf5a8993926484088dda62f214faf85e7278340f2074e7c4356a19f70b48cdb0067487b19f03a61 SHA512 b3de4eebb97ba168574a0c06096484f62e4cf50c794d0755ea9b0872d2731f308763733ea3ec567e76f0801fc3159130da47bdf8c0d6ce06f0812a12345e959a -DIST lib_mysqludf_log_0.0.2.tar.gz 1892 BLAKE2B 24f4197c2781e0bfd156b73adbea76f7a7580fcc85b55b566357d24896e5485ea7e93523286234ec3f1e39b386f54a63fe6f259053d7589622403655479d47d7 SHA512 674395c145260122bd14055a838b82d69217841364a496a518eb08860ba0beabe35627fe42108663caaf4a8c461d27551de43942ffd4c724d5ab912a2e74474d -EBUILD lib_mysqludf_log-0.0.2.ebuild 1105 BLAKE2B 7d3313e6fb72ec9f6eba93c54947c917696065a30fda789f5cd1ae9f76fa3f649bba17064d022f51f771fe4e01cf65ebf14240361120092e24958fc42e186e8f SHA512 33b332b75c79b4120c9a48a94d1e6fc2f21a4a10201a866cd90d6134f2b5531654577b4d3ae0f62574a63bffde84d815980ed7535f5735ca7a5a66cb984e7a94 -MISC metadata.xml 166 BLAKE2B c254f1fb642881aba57637be14fb0a89b10384f91a128feaec3a8c870d76efc2cbacb92caccc0dee2dd19a5ac5eaf8643080dafa05c4e2ac96a68568927e5afd SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 diff --git a/dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch b/dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch deleted file mode 100644 index 64b59639a328..000000000000 --- a/dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- lib_mysqludf_log.c.orig 2008-07-07 01:17:06.000000000 +0200 -+++ lib_mysqludf_log.c 2011-10-18 12:50:52.000000000 +0200 -@@ -159,7 +159,7 @@ - } else { - fmt = (char *)initid->ptr; - memcpy(fmt, "%0.", 3); -- sprintf(fmt+3, "%d", args->lengths[0]<=9999? args->lengths[0]: 9999); -+ sprintf(fmt+3, "%d", (int)(args->lengths[0]<=9999? args->lengths[0]: 9999)); - numDigits = strlen(fmt + 4); - memcpy(fmt + 4 + numDigits, "s\n\0", 3); - fprintf(stderr, fmt, args->args[0]); diff --git a/dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild b/dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild deleted file mode 100644 index 639f48e5e596..000000000000 --- a/dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=4 - -inherit eutils toolchain-funcs - -DESCRIPTION="MySQL UDF to write to log files" -HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_log/" -SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz" - -LICENSE="LGPL-2.1" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -DEPEND=">=virtual/mysql-5.1" -RDEPEND="${DEPEND}" - -S="${WORKDIR}" - -# compile helper -_compile() { - local CC="$(tc-getCC)" - echo "${CC} ${@}" && "${CC}" "${@}" -} - -pkg_setup() { - MYSQL_PLUGINDIR="$(mysql_config --plugindir)" - MYSQL_INCLUDE="$(mysql_config --include)" -} - -src_prepare() { - epatch "${FILESDIR}/${PN}-warnings.patch" -} - -src_compile() { - _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \ - -shared ${LDFLAGS} -o ${PN}.so ${PN}.c -} - -src_install() { - exeinto "${MYSQL_PLUGINDIR}" - doexe ${PN}.so - dodoc ${PN}.sql -} - -pkg_postinst() { - elog - elog "Please have a look at the documentation, how to" - elog "enable/disable the UDF functions of ${PN}." - elog - elog "The documentation is located here:" - elog "/usr/share/doc/${PF}" - elog -} diff --git a/dev-db/lib_mysqludf_log/metadata.xml b/dev-db/lib_mysqludf_log/metadata.xml deleted file mode 100644 index 6f49eba8f496..000000000000 --- a/dev-db/lib_mysqludf_log/metadata.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/dev-db/lib_mysqludf_stem/Manifest b/dev-db/lib_mysqludf_stem/Manifest deleted file mode 100644 index aa8baa543c73..000000000000 --- a/dev-db/lib_mysqludf_stem/Manifest +++ /dev/null @@ -1,4 +0,0 @@ -AUX lib_mysqludf_stem-mysql_m4.patch 2494 BLAKE2B ffa4e2b6b46e402b968c357a14cee41890c87d444238d6aca1a1268a37eb4515c248e93a4957d0dc3fa3aedbef5c79c114675b62311280415053f1646c875ba1 SHA512 11c057d563f430fa3fedfb8e1b9d830f2b593004dfca98d4ddf61b8ad4a6f77e67725862469dfc01c2dcabce2e65e64ca735e506344e044feeb51ff82e265c4e -DIST lib_mysqludf_stem-0.9.1.tar.gz 953171 BLAKE2B 6cd6aeb2a5e856acffafa883f203bc74e11b2929bf760c9de2d7956816372afd961307642369c9653ce75c71044455b88972442318ea22b85dcde7b7bdc705d0 SHA512 d15736da91dc5a6f2b0289694efeb531337ff6a001d39aafca02c9f165ba5901163855b8f03d13a50c2ab9bee58e7fc03d19e893d086ec0022de9dd6921f93b7 -EBUILD lib_mysqludf_stem-0.9.1.ebuild 1641 BLAKE2B 219827447413f02bed15c83243e851860e5843e486752d47d3b61e0651761518a0b0b9224c4fd6e15864e536ee1b6ddc32c743985f0b30dfc7d4eecc67a25a56 SHA512 d2b001d5d05e1ed34ce1453b4519c07478312d41924afdc9f427c43135a49e9ef3d5bbe546c8f8206040f496c205cd6e749b5939ee4b7ca77ac9118e4f633483 -MISC metadata.xml 166 BLAKE2B c254f1fb642881aba57637be14fb0a89b10384f91a128feaec3a8c870d76efc2cbacb92caccc0dee2dd19a5ac5eaf8643080dafa05c4e2ac96a68568927e5afd SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 diff --git a/dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch b/dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch deleted file mode 100644 index c12d1f7d39a9..000000000000 --- a/dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- config/ax_lib_mysql.m4.orig 2008-05-28 17:31:47.000000000 +0200 -+++ config/ax_lib_mysql.m4 2008-11-26 22:43:48.000000000 +0100 -@@ -87,10 +87,9 @@ - MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`" - - MYSQL_VERSION=`$MYSQL_CONFIG --version` -- -- if test `$MYSQL_CONFIG | /usr/bin/awk '{if ($1 == "--plugindir") print 1}'` == "1"; then -- MYSQL_PLUGINDIR=`$MYSQL_CONFIG --plugindir` -- fi -+ if $MYSQL_CONFIG --plugindir > /dev/null; then -+ MYSQL_PLUGINDIR=`$MYSQL_CONFIG --plugindir` -+ fi - - AC_DEFINE([HAVE_MYSQL], [1], - [Define to 1 if MySQL libraries are available]) ---- config/ax_mysql_bin.m4.orig 2007-08-15 02:22:37.000000000 +0200 -+++ config/ax_mysql_bin.m4 2008-11-26 22:55:40.000000000 +0100 -@@ -43,35 +43,36 @@ - fi - - if test -z "$withmysqlbin" -o "$withmysqlbin" = "yes"; then -- for i in /usr/bin /usr/local/bin ; do -- if test -f "$i/mysql" ; then -- MYSQL="$i/mysql $MYSQL_ARGS" -- fi -- done -+ MYSQL=`which mysql`; -+ if test -n "$MYSQL"; then MYSQL="$MYSQL $MYSQL_ARGS"; fi - elif test "$withmysqlbin" != "no"; then - MYSQL="$withmysqlbin" - fi - - if test -n "$MYSQL" ; then -- MYSQLBIN_PATH = `dirname "$MYSQL"` -+ MYSQLBIN_PATH=`dirname "$MYSQL"` - fi - - if test -z "$withmysqladmin" -o "$withmysqladmin" = "yes"; then -- for i in "$MYSQLBIN_PATH" /usr/bin /usr/local/bin ; do -- if test -n "$i" -a -f "$i/mysqladmin" ; then -- MYSQLADMIN="$i/mysqladmin $MYSQL_ARGS" -- fi -- done -+ if test -n "$MYSQLBIN_PATH" -a -f "$MYSQLBIN_PATH/mysqladmin"; then -+ MYSQLADMIN="$MYSQLBIN_PATH/mysqladmin"; -+ else -+ MYSQLADMIN=`which mysqladmin`; -+ fi -+ -+ if test -n "$MYSQLADMIN"; then MYSQLADMIN="$MYSQLADMIN $MYSQL_ARGS"; fi - elif test "$withmysqladmin" != "no"; then - MYSQLADMIN="$withmysqladmin" - fi - - if test -z "$withmysqltest" -o "$withmysqltest" = "yes"; then -- for i in "$MYSQLBIN_PATH" /usr/bin /usr/local/bin ; do -- if test -n "$i" -a -f "$i/mysqltest" ; then -- MYSQLTEST="$i/mysqltest $MYSQL_ARGS" -- fi -- done -+ if test -n "$MYSQLBIN_PATH" -a -f "$MYSQLBIN_PATH/mysqltest"; then -+ MYSQLTEST="$MYSQLBIN_PATH/mysqltest"; -+ else -+ MYSQLTEST=`which mysqltest`; -+ fi -+ -+ if test -n "$MYSQLTEST"; then MYSQLTEST="$MYSQLTEST $MYSQL_ARGS"; fi - elif test "$withmysqltest" != "no"; then - MYSQLTEST="$withmysqltest" - fi diff --git a/dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild b/dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild deleted file mode 100644 index fdfa360a4beb..000000000000 --- a/dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=4 - -inherit eutils toolchain-funcs autotools - -DESCRIPTION="MySQL UDFs which provides stemming capability for a variety of languages" -HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_stem/" -SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz" - -LICENSE="LGPL-2.1" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -DEPEND=">=virtual/mysql-5.1" -RDEPEND="${DEPEND}" - -RESTRICT="test" - -pkg_setup() { - MYSQL_PLUGINDIR="$(mysql_config --plugindir)" - MYSQL_INCLUDE="$(mysql_config --include)" -} - -src_prepare() { - # add AC_PROG_CXX to configure.ac - sed -i -e 's|\(AC_PROG_CC\)|\1\nAC_PROG_CXX|g' configure.ac - - # fix ax_lib_mysql.m4 + ax_mysql_bin.m4 - epatch "${FILESDIR}/${PN}-mysql_m4.patch" - - # fix and clean libstemmer_c - sed -i -e 's|^\(CFLAGS\)=|\1+=-fPIC |g' libstemmer_c/Makefile - rm -f -- libstemmer_c/stemwords libstemmer_c/*.{o,a} libstemmer_c/*/*.o - - edos2unix installdb.sql - eautoreconf -} - -src_configure() { - econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}" -} - -src_install() { - local X - emake DESTDIR="${D}" install - dodoc libstemmer_c/libstemmer/*.txt - [ -f ${PN}.html ] && dohtml ${PN}.html - [ -d doc/html ] && dohtml -r doc/html/. - for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do - [ -s "${X}" ] && dodoc "${X}" - done - - # remove obsolete *.la file - rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la -} - -pkg_postinst() { - elog - elog "Please have a look at the documentation, how to" - elog "enable/disable the UDF functions of ${PN}." - elog - elog "The documentation is located here:" - elog "/usr/share/doc/${PF}" - elog -} diff --git a/dev-db/lib_mysqludf_stem/metadata.xml b/dev-db/lib_mysqludf_stem/metadata.xml deleted file mode 100644 index 6f49eba8f496..000000000000 --- a/dev-db/lib_mysqludf_stem/metadata.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/dev-db/lmdb/Manifest b/dev-db/lmdb/Manifest index 8cc212d89df2..d52e7501d9e6 100644 --- a/dev-db/lmdb/Manifest +++ b/dev-db/lmdb/Manifest @@ -8,5 +8,5 @@ EBUILD lmdb-0.9.18.ebuild 1239 BLAKE2B cf75faf2a5fe6fd306eb7a28c2372a3bcb3a4395f EBUILD lmdb-0.9.19.ebuild 1849 BLAKE2B d9e235c2aa7ff06d2b6cdf6b6e29544a02d1aaa7ae7248afdf661c3ba4ea0ddbb0e7ed9ec7796e73b1865a430a2a8380236a3206e54a8eca054ba95ff9e1d820 SHA512 791cca180d0d429d64f197a627dd8d94c48e8502d38011be358fc901e521cdb3996653b2cc0c519b9e1e5a58815134e99e64f09d50bcc72444eb2990ac2879ad EBUILD lmdb-0.9.21-r1.ebuild 1960 BLAKE2B b2686f3859333a1f60b4e1053e40e7214ed3196e35b88956ada044f6655c7ae3a472e999db56d08bfeeb3d6520853b1091dc6d8a321827e67903c87e8aebbe15 SHA512 288aec449c08655fe4572451f2960cd6c489158198fc787cb5ec3bd489578995f651bd5d13c36924ef35c2497dd157ae46a78dc9b5e18b31f913753a2a8157bf EBUILD lmdb-0.9.22.ebuild 2322 BLAKE2B 119d9c927f512ecb24aaeaba41641e3fa7bcfe99a9a2c31f27a6152d6a7d1976ec139677ea90a26e3e76f1aa011e16a554d7ca10391ca4d919de56649916f4a8 SHA512 c7f3540619dc06ef582539730f5060c1a2e784c410b91c7fc977749c3e78829e59cf424b6c9c15700168a22f48b22ae554700961374f42f339cd352c50d8c6d9 -EBUILD lmdb-0.9.23.ebuild 2284 BLAKE2B 04a9d94b39c25ab9360c0141339329898bbcc4839a0fa13240461e2b67a9b352b08ee1c546c828be3d03668bbcf3d18fc5dd69b1e81bf2b1f2dde5e051a866f9 SHA512 37f81b1ee1edcebf9b7bb4a87c7c79a42839470bc8c8d4fc6e3ea9e771a95546eca32f60d33a12167efcee420adb46c0c783a8300a0a2f574781e78aa6097245 +EBUILD lmdb-0.9.23.ebuild 2281 BLAKE2B 653bd0c789e63df48dec191cfc80565f8755248ee9c131cfc82448b80fb952c794ba9b365f57c05992dfe45aafa4d205e8379c0f791e8dbe91384893228efe8e SHA512 b1c1cbe8a055f6c480347889bb1fe28e37b98229191c29890f68f873628be3e22be71207477d7bec5323fd60e7931e9b3255bde55a763557b0191e62b3cb2354 MISC metadata.xml 540 BLAKE2B b064697aa562165a627cb1be8cce847c8046d10cf184a4563a632c43ebd1916ad866e843efd49ae5659e379f3695514005b9d601117719c9f48652dab48dcea8 SHA512 7ff1fddaca73c5d7b4a6a9ada9a7aad60e16c8c7063ad5cd9cf57301f504f6e0fe53bf568dec83abf522c2c099d2b3b2463619df17077ebaa3b39bd67bd738c4 diff --git a/dev-db/lmdb/lmdb-0.9.23.ebuild b/dev-db/lmdb/lmdb-0.9.23.ebuild index 65a2931f0dd3..676ccb0568de 100644 --- a/dev-db/lmdb/lmdb-0.9.23.ebuild +++ b/dev-db/lmdb/lmdb-0.9.23.ebuild @@ -11,7 +11,7 @@ SRC_URI="https://github.com/LMDB/lmdb/archive/LMDB_${PV}.tar.gz" LICENSE="OPENLDAP" SLOT="0/${PV}" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" +KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" IUSE="static-libs" DEPEND="" diff --git a/dev-db/mariadb-connector-c/Manifest b/dev-db/mariadb-connector-c/Manifest index 2498d73ec5c5..78a6c144edc4 100644 --- a/dev-db/mariadb-connector-c/Manifest +++ b/dev-db/mariadb-connector-c/Manifest @@ -1,14 +1,9 @@ AUX gentoo-layout-3.0.patch 311 BLAKE2B 4c2f0ae8aa53d605bcaf134274d3b549ec970b43cc68eed1ac71cf089c9fa32a1343d7ebfdf428e7f25032f5782aecfb86fb8f78528ffc708ab15dc7285a24e7 SHA512 4d5a48b4dd66aab04ba597b30e96b4601c6745acca21be1daf051ba6ce1e8fef1a0efa46d8e81da1ecdc893a8ee471bd8c7ed0c5436ee33b8b4f7cd18fdca1a5 AUX mariadb-connector-c-3.0.6-provide-pkconfig-file.patch 1838 BLAKE2B 454433d5815e818bb3cb08241b1629e7cb2e8c6b33d09e241db11cc7f18e73a8cbf40567fe47a613c420581f8487c39478bcbef22da4ba21b77a10f71e4b11ef SHA512 a3ec1a1702d2d5ae5ea6ef93e9bc7f01df548c65574b177a20e8b29694b078ebd67a409ed253467d1db38895e66285eaf73e604a507bfb09384bc3d15325cb60 -AUX mariadb-connector-c-3.0.7-fix-pkconfig-file-r1.patch 998 BLAKE2B 7c07b70ec752832d62757ee08a6f56b59d47e11c68d5333308878ef6b030a3b959bf2d6ba6ec37f0960f1e5f0be702c974f53c81886cc7a8348d4eeca4eaaa03 SHA512 06fdd1bdcbe9550257e4947bae25870525f59a729c7b78eee703990b17b9ada152d32f80f1bb57f67455bc143725a7f166cf34f9de1edcd40c49e49a2d2a6826 AUX mariadb-connector-c-3.0.8-fix-pkconfig-file.patch 630 BLAKE2B 4d087835c14334ebfdbfcf69df16e948dfd0c46c194d56ba44516bfb647ff518d766170d95c3c86f39211555f25993d95b57c516a357bb3db52b8428273aad48 SHA512 9949b6e6ea2fe325279a6459ce6119524444dbec65cd509549bdc89d5a4c9afb6c39abe2d4e1ab64f6c7e917279f83a323f93d3fe7bd79a8d519976f8c786028 DIST mariadb-connector-c-3.0.6-src.tar.gz 666819 BLAKE2B 7245c0e13e569454d1cc70e3579afcbd53c64a0a7e828012b38d73f7d737a81b4fdf0363bd1b156dae783806a51773dbceb2ea06621bd4a73773edb78a70249a SHA512 6a41efacff1840eb8ddd8b34d8894b51f260444c76a1344f9ac9b675fd8492d44716338e4c11594d80118b12d90f75430304282650bce0d5f64179df6cc14d8e -DIST mariadb-connector-c-3.0.7-src.tar.gz 667274 BLAKE2B 75d2d548d51889aecc8af56cbeb61f5eaf21e60924b70dd0559214de464eae209743febdb5d443797f853bc902352f7333aefe84cb367f61f7bf2c341a4a8ac2 SHA512 70facae6234f180d94c0526845a3bf7723d6de3b6871544cb8cea35311fec0537c6342fbf4f024d0dca58ee618642c38748ae73628fcba334064a3c15d307219 -DIST mariadb-connector-c-3.0.8-src.tar.gz 674455 BLAKE2B eca5972f8443c78cdc9f450e7e88ee1c69e2a004664916a0f7dfd9a1ab8242c9e11d3cafcd95323262223fba5d68c5d489d4f61fdddb8369cf603cdd563cfe51 SHA512 d9f970c7ac164ef7d8dd748bf2f749cc1f877a9c8f68a1d57e9ff62d95046bb9505619feca1f1d0d1cdefc1ac49489742aadf4ad9e47c8e6a9b8b40c56eed788 DIST mariadb-connector-c-3.0.9-src.tar.gz 668142 BLAKE2B f61f855c334268b1cb079abc566a600093d7e0bdd164c22045000e337f43d2b57d14988cba1b3fd2f6316f6e0d949be7e67ac73410ddb1abc66e0faa16422946 SHA512 6f45bcd4bee07f6d72d1c4fee0bdb903ef4fa879eb7508156bc885a5657caf69b145d95647c4bc663eb2a2b03569b41ef9d87ca532b77901c2f67fd608048a1a EBUILD mariadb-connector-c-3.0.6-r1.ebuild 2816 BLAKE2B 38450ea224a5f0e960abc65ebce37121ed02d1ec0d5bfc7c2d7a124c9ffd77f10090247493eb0c758b991e40cb8a845fe13355ba8e32b64bb2ca90fa957aca76 SHA512 f5670d8174889c3ccc8b7693cdd97d39c1c0d597d5980c6a5d15317662bffebea1e3b6573c438b076362c8c46649dedf8f285d90ac4f5ffb4eed4d4db82b0378 -EBUILD mariadb-connector-c-3.0.7-r1.ebuild 2828 BLAKE2B 3c7d2eefda6d8ee874c7570827ab015223f9bab0d7c649184d02492cdd319e2a7c281818cf633736e68f000203f23093ad40fdab31e185b4d5d1e1da7488992f SHA512 f45c2e1980bb4be51137b2658213a689acdc13f449704c2406f089179fb8ec897119b3c04fda353ffaad86c7f8bc33e2c2b25b6b56ec1be1eed8be68274970a6 -EBUILD mariadb-connector-c-3.0.8.ebuild 2869 BLAKE2B 39729738d90fbaba3033d87eefd808e5c14d04f746fa2b58f656822943ddb74b350c4c7c90eedf18657e2b793916dd1fd508439cd3bec1e70fb5a2d5e6200aab SHA512 0e55ef203af16d3cb6e000802a1d878d316806ab15f3945e12e1c61a9c14c5aef382a7776065d44376c496ed2558bbfd6bfcc86e7868355ee1f9a356460e17bd -EBUILD mariadb-connector-c-3.0.9.ebuild 2869 BLAKE2B 39729738d90fbaba3033d87eefd808e5c14d04f746fa2b58f656822943ddb74b350c4c7c90eedf18657e2b793916dd1fd508439cd3bec1e70fb5a2d5e6200aab SHA512 0e55ef203af16d3cb6e000802a1d878d316806ab15f3945e12e1c61a9c14c5aef382a7776065d44376c496ed2558bbfd6bfcc86e7868355ee1f9a356460e17bd -EBUILD mariadb-connector-c-9999.ebuild 2869 BLAKE2B 39729738d90fbaba3033d87eefd808e5c14d04f746fa2b58f656822943ddb74b350c4c7c90eedf18657e2b793916dd1fd508439cd3bec1e70fb5a2d5e6200aab SHA512 0e55ef203af16d3cb6e000802a1d878d316806ab15f3945e12e1c61a9c14c5aef382a7776065d44376c496ed2558bbfd6bfcc86e7868355ee1f9a356460e17bd +EBUILD mariadb-connector-c-3.0.9.ebuild 2318 BLAKE2B 3bfe94b1f26a60a13f8a9a9d83bdd387e9c2257a0f0502e1013c4dc4c7c06dae5c31af9efe1ac5b4ff543d9a1a2a6335b8b5b8465ac75bdf3170015696caf3cf SHA512 114a5963a7e1364f0f94063042bb98bc8d45664e6ef54b1cabfd39154b2b6815c41bd597e83ab376dc0d22d10b30e9be154ddc7908560089e4fba84c7271e18b +EBUILD mariadb-connector-c-9999.ebuild 2362 BLAKE2B 6a73cddd218a6b850a906afe3e1e1273bf73d0639d1e32a0af156294b1525dd554b321bf51d9b426c609e00541637c3e7607c7cd6b065e1cc71e845d52055ecb SHA512 cf2b2b46343b5f03eb7bc4e8b001afc712cc1dd1a667eaca7cd9b5696d153647c982cd2ec37cca5a2c2cefc1998bbd3c629957254cec9f76df109d8b2c68e413 MISC metadata.xml 324 BLAKE2B fab5394015cd337683f65a257556ed0f15e35826bb0a6ce75a7033cd5931455ff2bed527064d698e9b3165f2cfcaff8a4bdfcad0b830482ae2e4389a79d529fb SHA512 1fe9e5d5d9f8e817ce49117fbcc6a6d706a090752606647496f2b7a25de51bfb641a408ff0cdaf626d83eb5c314d2e28c3f29532307d942cb41498edf4b44aa6 diff --git a/dev-db/mariadb-connector-c/files/mariadb-connector-c-3.0.7-fix-pkconfig-file-r1.patch b/dev-db/mariadb-connector-c/files/mariadb-connector-c-3.0.7-fix-pkconfig-file-r1.patch deleted file mode 100644 index 1fe06e2c8e5e..000000000000 --- a/dev-db/mariadb-connector-c/files/mariadb-connector-c-3.0.7-fix-pkconfig-file-r1.patch +++ /dev/null @@ -1,32 +0,0 @@ -https://bugs.gentoo.org/673218 - ---- a/mariadb_config/CMakeLists.txt -+++ b/mariadb_config/CMakeLists.txt -@@ -59,5 +59,5 @@ INSTALL(TARGETS mariadb_config - COMPONENT Development) - - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmariadb.pc -- DESTINATION "lib/pkgconfig" -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig - COMPONENT Development) ---- a/mariadb_config/libmariadb.pc.in -+++ b/mariadb_config/libmariadb.pc.in -@@ -7,13 +7,12 @@ - # - - prefix=@CMAKE_INSTALL_PREFIX@ --includedir=${prefix}/@INSTALL_INCLUDEDIR@/@SUFFIX_INSTALL_DIR@ --libdir=${prefix}/@INSTALL_LIBDIR@/@SUFFIX_INSTALL_DIR@ -+includedir=${prefix}/include -+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ - - Name: libmariadb - Version: @CPACK_PACKAGE_VERSION@ -+URL: https://mariadb.com/kb/en/library/mariadb-connector-c/ - Description: MariaDB Connector/C dynamic library --Cflags: -I${includedir} --Libs: -L${libdir} -lmariadb @extra_dynamic_LDFLAGS@ -- -- -+Cflags: -I${includedir}/mariadb -+Libs: -L${libdir} -lmariadb diff --git a/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.7-r1.ebuild b/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.7-r1.ebuild deleted file mode 100644 index 2cd32bf0db31..000000000000 --- a/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.7-r1.ebuild +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 1999-2018 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -VCS_INHERIT="" -if [[ "${PV}" == 9999 ]] ; then - VCS_INHERIT="git-r3" - EGIT_REPO_URI="https://github.com/MariaDB/mariadb-connector-c.git" -else - MY_PN=${PN#mariadb-} - MY_PV=${PV/_b/-b} - SRC_URI="https://downloads.mariadb.org/f/${MY_PN}-${PV%_beta}/${PN}-${MY_PV}-src.tar.gz?serve -> ${P}-src.tar.gz" - S="${WORKDIR%/}/${PN}-${MY_PV}-src" - KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86" -fi - -inherit cmake-utils multilib-minimal toolchain-funcs ${VCS_INHERIT} - -MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config ) - -MULTILIB_WRAPPED_HEADERS+=( - /usr/include/mariadb/mariadb_version.h -) - -DESCRIPTION="C client library for MariaDB/MySQL" -HOMEPAGE="https://mariadb.org/" -LICENSE="LGPL-2.1" - -SLOT="0/3" -IUSE="+curl gnutls kerberos libressl mysqlcompat +ssl static-libs test" - -DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] - virtual/libiconv:=[${MULTILIB_USEDEP}] - curl? ( net-misc/curl:0=[${MULTILIB_USEDEP}] ) - kerberos? ( || ( app-crypt/mit-krb5[${MULTILIB_USEDEP}] - app-crypt/heimdal[${MULTILIB_USEDEP}] ) ) - ssl? ( - gnutls? ( >=net-libs/gnutls-3.3.24:0=[${MULTILIB_USEDEP}] ) - !gnutls? ( - libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) - !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) - ) - ) - " -RDEPEND="${DEPEND} - mysqlcompat? ( - !dev-db/mysql[client-libs(+)] - !dev-db/mysql-cluster[client-libs(+)] - !dev-db/mariadb[client-libs(+)] - !dev-db/mariadb-galera[client-libs(+)] - !dev-db/percona-server[client-libs(+)] - !dev-db/mysql-connector-c ) - !>=dev-db/mariadb-10.2.0[client-libs(+)] - " -PATCHES=( - "${FILESDIR}"/gentoo-layout-3.0.patch - "${FILESDIR}"/${PN}-3.0.7-fix-pkconfig-file-r1.patch -) - -src_configure() { - # bug 508724 mariadb cannot use ld.gold - tc-ld-disable-gold - multilib-minimal_src_configure -} - -multilib_src_configure() { - local mycmakeargs=( - -DWITH_EXTERNAL_ZLIB=ON - -DWITH_SSL:STRING=$(usex ssl $(usex gnutls GNUTLS OPENSSL) OFF) - -DWITH_CURL=$(usex curl ON OFF) - -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT:STRING=$(usex kerberos DYNAMIC OFF) - -DMARIADB_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" - -DINSTALL_LIBDIR="$(get_libdir)" - -DINSTALL_PLUGINDIR="$(get_libdir)/mariadb/plugin" - -DINSTALL_BINDIR=bin - -DWITH_UNIT_TESTS=$(usex test ON OFF) - ) - cmake-utils_src_configure -} - -multilib_src_compile() { - cmake-utils_src_compile -} - -multilib_src_install() { - cmake-utils_src_install - if use mysqlcompat ; then - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so.19 - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so - fi -} - -multilib_src_install_all() { - if ! use static-libs ; then - find "${D}" -name "*.a" -delete || die - fi - if use mysqlcompat ; then - dosym mariadb_config /usr/bin/mysql_config - dosym mariadb /usr/include/mysql - fi -} diff --git a/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.8.ebuild b/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.8.ebuild deleted file mode 100644 index c957edaec2de..000000000000 --- a/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.8.ebuild +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -VCS_INHERIT="" -if [[ "${PV}" == 9999 ]] ; then - VCS_INHERIT="git-r3" - EGIT_REPO_URI="https://github.com/MariaDB/mariadb-connector-c.git" -else - MY_PN=${PN#mariadb-} - MY_PV=${PV/_b/-b} - SRC_URI="https://downloads.mariadb.org/f/${MY_PN}-${PV%_beta}/${PN}-${MY_PV}-src.tar.gz?serve -> ${P}-src.tar.gz" - S="${WORKDIR%/}/${PN}-${MY_PV}-src" - KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86" -fi - -inherit cmake-utils multilib-minimal toolchain-funcs ${VCS_INHERIT} - -MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config ) - -MULTILIB_WRAPPED_HEADERS+=( - /usr/include/mariadb/mariadb_version.h -) - -DESCRIPTION="C client library for MariaDB/MySQL" -HOMEPAGE="https://mariadb.org/" -LICENSE="LGPL-2.1" - -SLOT="0/3" -IUSE="+curl gnutls kerberos libressl mysqlcompat +ssl static-libs test" - -DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] - virtual/libiconv:=[${MULTILIB_USEDEP}] - curl? ( net-misc/curl:0=[${MULTILIB_USEDEP}] ) - kerberos? ( || ( app-crypt/mit-krb5[${MULTILIB_USEDEP}] - app-crypt/heimdal[${MULTILIB_USEDEP}] ) ) - ssl? ( - gnutls? ( >=net-libs/gnutls-3.3.24:0=[${MULTILIB_USEDEP}] ) - !gnutls? ( - libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) - !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) - ) - ) - " -RDEPEND="${DEPEND} - mysqlcompat? ( - !dev-db/mysql[client-libs(+)] - !dev-db/mysql-cluster[client-libs(+)] - !dev-db/mariadb[client-libs(+)] - !dev-db/mariadb-galera[client-libs(+)] - !dev-db/percona-server[client-libs(+)] - !dev-db/mysql-connector-c ) - !>=dev-db/mariadb-10.2.0[client-libs(+)] - " -PATCHES=( - "${FILESDIR}"/gentoo-layout-3.0.patch - "${FILESDIR}"/${PN}-3.0.8-fix-pkconfig-file.patch -) - -src_configure() { - # bug 508724 mariadb cannot use ld.gold - tc-ld-disable-gold - multilib-minimal_src_configure -} - -multilib_src_configure() { - local mycmakeargs=( - -DWITH_EXTERNAL_ZLIB=ON - -DWITH_SSL:STRING=$(usex ssl $(usex gnutls GNUTLS OPENSSL) OFF) - -DWITH_CURL=$(usex curl ON OFF) - -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT:STRING=$(usex kerberos DYNAMIC OFF) - -DMARIADB_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" - -DINSTALL_LIBDIR="$(get_libdir)" - -DINSTALL_PCDIR="$(get_libdir)/pkgconfig" - -DINSTALL_PLUGINDIR="$(get_libdir)/mariadb/plugin" - -DINSTALL_BINDIR=bin - -DWITH_UNIT_TESTS=$(usex test ON OFF) - ) - cmake-utils_src_configure -} - -multilib_src_compile() { - cmake-utils_src_compile -} - -multilib_src_install() { - cmake-utils_src_install - if use mysqlcompat ; then - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so.19 - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so - fi -} - -multilib_src_install_all() { - if ! use static-libs ; then - find "${D}" -name "*.a" -delete || die - fi - if use mysqlcompat ; then - dosym mariadb_config /usr/bin/mysql_config - dosym mariadb /usr/include/mysql - fi -} diff --git a/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.9.ebuild b/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.9.ebuild index c957edaec2de..854813a44d91 100644 --- a/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.9.ebuild +++ b/dev-db/mariadb-connector-c/mariadb-connector-c-3.0.9.ebuild @@ -28,7 +28,7 @@ HOMEPAGE="https://mariadb.org/" LICENSE="LGPL-2.1" SLOT="0/3" -IUSE="+curl gnutls kerberos libressl mysqlcompat +ssl static-libs test" +IUSE="+curl gnutls kerberos libressl +ssl static-libs test" DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] virtual/libiconv:=[${MULTILIB_USEDEP}] @@ -43,16 +43,7 @@ DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] ) ) " -RDEPEND="${DEPEND} - mysqlcompat? ( - !dev-db/mysql[client-libs(+)] - !dev-db/mysql-cluster[client-libs(+)] - !dev-db/mariadb[client-libs(+)] - !dev-db/mariadb-galera[client-libs(+)] - !dev-db/percona-server[client-libs(+)] - !dev-db/mysql-connector-c ) - !>=dev-db/mariadb-10.2.0[client-libs(+)] - " +RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/gentoo-layout-3.0.patch "${FILESDIR}"/${PN}-3.0.8-fix-pkconfig-file.patch @@ -86,18 +77,10 @@ multilib_src_compile() { multilib_src_install() { cmake-utils_src_install - if use mysqlcompat ; then - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so.19 - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so - fi } multilib_src_install_all() { if ! use static-libs ; then find "${D}" -name "*.a" -delete || die fi - if use mysqlcompat ; then - dosym mariadb_config /usr/bin/mysql_config - dosym mariadb /usr/include/mysql - fi } diff --git a/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild b/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild index c957edaec2de..e6c4b2e68967 100644 --- a/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild +++ b/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild @@ -28,7 +28,7 @@ HOMEPAGE="https://mariadb.org/" LICENSE="LGPL-2.1" SLOT="0/3" -IUSE="+curl gnutls kerberos libressl mysqlcompat +ssl static-libs test" +IUSE="+curl gnutls kerberos libressl +ssl static-libs test" DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] virtual/libiconv:=[${MULTILIB_USEDEP}] @@ -44,13 +44,6 @@ DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] ) " RDEPEND="${DEPEND} - mysqlcompat? ( - !dev-db/mysql[client-libs(+)] - !dev-db/mysql-cluster[client-libs(+)] - !dev-db/mariadb[client-libs(+)] - !dev-db/mariadb-galera[client-libs(+)] - !dev-db/percona-server[client-libs(+)] - !dev-db/mysql-connector-c ) !>=dev-db/mariadb-10.2.0[client-libs(+)] " PATCHES=( @@ -86,18 +79,10 @@ multilib_src_compile() { multilib_src_install() { cmake-utils_src_install - if use mysqlcompat ; then - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so.19 - dosym libmariadb.so.3 /usr/$(get_libdir)/libmysqlclient.so - fi } multilib_src_install_all() { if ! use static-libs ; then find "${D}" -name "*.a" -delete || die fi - if use mysqlcompat ; then - dosym mariadb_config /usr/bin/mysql_config - dosym mariadb /usr/include/mysql - fi } diff --git a/dev-db/mariadb-galera/Manifest b/dev-db/mariadb-galera/Manifest index 09f925f62941..64a8479f7d0d 100644 --- a/dev-db/mariadb-galera/Manifest +++ b/dev-db/mariadb-galera/Manifest @@ -1,5 +1,5 @@ AUX my.cnf-5.6 5144 BLAKE2B 2f977b6a92524cfabbdd19058430c62dd4d03a0587036f49057eff69fda04c148a4dca8e58abe418a2bdc0fe1ef3c780cf53d7214fb51f13d5a4b2a4f7a3b8e9 SHA512 db4bdde6f82d9bd33026477d89d8191ddc4099586273ca4aa3f2dcd09572f887d03f79c2ce00bf74d01c21a18384b05516982bdcf31a6c458631315ea75c4cab -DIST mariadb-galera-10.0.35.tar.gz 66950519 BLAKE2B a0b48de41234d1800c1734782bd604d30512e3d33d1937cd3e79f68ec804089166223ba53450ef630779d2b74bc4ace611dc748b4ceca7ed4e4151f97d693655 SHA512 e0160ef74d45c332edf49f21bb673b926008cba9ba650f97a47d7631260b2517db19e1730b76be77af4ee384aa5cc9b3453a24da57c48ab5f062f937494aee87 -DIST mysql-extras-20180515-1334Z.tar.bz2 321462 BLAKE2B 48fc1e0058fa824e6234b0f3319d261997e99f334c8583c0def4cdac4b59f2380d7153ab0fa2ca9a6ab15e35899c2a7586e3b61f4044c4c949110cc8ab9fb0e6 SHA512 de3000f0c65eed9595b52d53205cdcac60cb4a06a5aca27057c8beca6a7890f453aeeda0bb8487b8de75cfb4caa48682b7706273574876c5cefd0d03988c4f7e -EBUILD mariadb-galera-10.0.35-r1.ebuild 27201 BLAKE2B d9a1443ed469f5ca28e4e25c494064877ae0363a46b6834488a83511da3e4149f4a033ec97da8e80a756e2b106a912748a4b78a46177543b4b1380ec2dab2a51 SHA512 df449a5020ee5d6993ad29026799d5987fb7c0bf3fd1de6fa2d1af521907fe71bb48e08ee6ffdd93722c823cb8719c3122e17aa7dcfba69cb9534d8d77b1fae2 +DIST mariadb-galera-10.0.38.tar.gz 65157071 BLAKE2B c54341395101e27dd25183da3d09e7ddf72a07cf440a8aea5daa998d53012a93e1f04bb5020dba28d1337b5f11448be6ae3d8624c437db0cf090eff2aa10151d SHA512 219c2400ebdbf4c6933af1d2d1f88c7f795a988b408676a3c93dbb8c82bdb782f661e9a60f5e940baf31feda8e584e9764918e59cfbdfa1356af8712dde17425 +DIST mysql-extras-20190310-0358Z.tar.bz2 331100 BLAKE2B 69f2b1ee404247e04b7d368c08c429f783fa45dface295be9fa2d94822d052a08a40e6a57bec3afc38886eb0badfcb52c92974c6df033bb90be66abb3f05249a SHA512 5fd4a320e4c224514b054cffbbdf3697ed7351cf71ee779c311f024388bbf12673821b0e12994acbccd30fe119214ea4b53edf87e2cb37be39d0448e4b2cf70b +EBUILD mariadb-galera-10.0.38.ebuild 27681 BLAKE2B 1387526e164ee261fa21976028ef7bc2e80b273c4e2722d286284b2bf62e66bd50dec2e5b6d977aed1a00a483ac319264434dbfded47661905125336f658d909 SHA512 7d7917cad83f6a5ce0a063635e20e8791ae6855a33a0b33e2db8ee149bb28758621b71b560501f34f4a96a73400bedaf8746c2eb8de668c21db9c618ca1a7ab1 MISC metadata.xml 1731 BLAKE2B 0e8a98423e36b3dd621d42ce512063fa8d703cb5254616fd2549cc6f2b03df3d521502b3def93b93000ea4c8b9c24d0bba01bb1417d88c2b2689dcf31876e996 SHA512 09073b18f31f6684cd0ecde266a1c41e7520baf8aa5ff31f19a815ce3f5fea3b1302e0eb702d377f5eb3535c5a7e2828965446b631bbf91219a8c898d1ee8c9e diff --git a/dev-db/mariadb-galera/mariadb-galera-10.0.35-r1.ebuild b/dev-db/mariadb-galera/mariadb-galera-10.0.35-r1.ebuild deleted file mode 100644 index 90a0f496067d..000000000000 --- a/dev-db/mariadb-galera/mariadb-galera-10.0.35-r1.ebuild +++ /dev/null @@ -1,849 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20180515-1334Z" -SUBSLOT="18" - -JAVA_PKG_OPT_USE="jdbc" - -# Keeping eutils in EAPI=6 for emktemp in pkg_config - -inherit eutils 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="bindist client-libs debug extraengine jdbc jemalloc latin1 libressl - numa odbc oqgraph pam +perl profiling selinux +server sphinx - sst-rsync sst-xtrabackup static static-libs 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 ) ) - !server? ( !extraengine ) - ?? ( tcmalloc jemalloc ) - static? ( yassl !pam )" - -KEYWORDS="~amd64 ~x86" - -# 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}/20006_all_cmake_elib-mariadb-10.0.33.patch" - "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch" - "${MY_PATCH_DIR}/20018_all_mariadb-galera-10.0.20-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: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/readline-4.1:0= - ) - server? ( - extraengine? ( - odbc? ( dev-db/unixODBC:0= ) - xml? ( dev-libs/libxml2:2= ) - ) - numa? ( sys-process/numactl ) - oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) - pam? ( virtual/pam:0= ) - tokudb? ( app-arch/snappy ) - ) - >=dev-libs/libpcre-8.41-r1:3= - !client-libs? ( dev-db/mysql-connector-c[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 !dev-db/percona-server !dev-db/mysql-cluster - server? ( !prefix? ( dev-db/mysql-init-scripts ) ) - ${COMMON_DEPEND} - server? ( - sys-apps/iproute2 - =sys-cluster/galera-25* - sst-rsync? ( sys-process/lsof ) - 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? ( 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 - 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 -} - -disable_engine() { - echo > "${S%/}/storage/${1}/CMakeLists.txt" || die -} - -disable_plugin() { - echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die -} - -src_prepare() { - java-pkg-opt-2_src_prepare - 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 - - # Don't build Mroonga or example - disable_engine mroonga - 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" - -DINSTALL_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) - -DWITH_PCRE=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 - -D$(usex extraengine WITH WITHOUT)_SEQUENCE_STORAGE_ENGINE=1 - -D$(usex extraengine WITH WITHOUT)_SPIDER_STORAGE_ENGINE=1 - -D$(usex extraengine WITH WITHOUT)_CONNECT_STORAGE_ENGINE=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=ON - -DINSTALL_SQLBENCHDIR=share/mariadb - ) - - # Workaround for MDEV-14524 - use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) - - 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 - -DWITH_EMBEDDED_SERVER=OFF - -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.6" - 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 - 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 static-libs' \ -# 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 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 - - 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/bin/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)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" - 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-galera/mariadb-galera-10.0.38.ebuild b/dev-db/mariadb-galera/mariadb-galera-10.0.38.ebuild new file mode 100644 index 000000000000..b4d1da15624a --- /dev/null +++ b/dev-db/mariadb-galera/mariadb-galera-10.0.38.ebuild @@ -0,0 +1,859 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +MY_EXTRAS_VER="20190310-0358Z" +SUBSLOT="18" + +JAVA_PKG_OPT_USE="jdbc" + +# Keeping eutils in EAPI=6 for emktemp in pkg_config + +inherit eutils 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="bindist client-libs debug extraengine jdbc jemalloc latin1 libressl + numa odbc oqgraph pam +perl profiling selinux +server sphinx + sst-rsync sst-xtrabackup static 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 ) ) + !server? ( !extraengine ) + ?? ( tcmalloc jemalloc ) + static? ( yassl !pam )" + +KEYWORDS="~amd64 ~x86" + +# 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}/20006_all_cmake_elib-mariadb-10.0.33.patch" + "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch" + "${MY_PATCH_DIR}/20018_all_mariadb-galera-10.0.20-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? ( =sys-libs/zlib-1.2.3:0= + sys-libs/ncurses:0= + !bindist? ( + >=sys-libs/readline-4.1:0= + ) + server? ( + extraengine? ( + odbc? ( dev-db/unixODBC:0= ) + xml? ( dev-libs/libxml2:2= ) + ) + numa? ( sys-process/numactl ) + oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= ) + pam? ( virtual/pam:0= ) + 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 ) + client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) + !dev-db/mysql !dev-db/mariadb !dev-db/percona-server !dev-db/mysql-cluster + server? ( !prefix? ( dev-db/mysql-init-scripts ) ) + ${COMMON_DEPEND} + server? ( + sys-apps/iproute2 + =sys-cluster/galera-25* + sst-rsync? ( sys-process/lsof ) + 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? ( 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 + + # Don't build Mroonga or example + _disable_engine mroonga + _disable_engine example + + if ! use oqgraph ; then # avoids extra library checks + _disable_engine oqgraph + 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" + -DINSTALL_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) + -DWITH_PCRE=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 + -D$(usex extraengine WITH WITHOUT)_SEQUENCE_STORAGE_ENGINE=1 + -D$(usex extraengine WITH WITHOUT)_SPIDER_STORAGE_ENGINE=1 + -D$(usex extraengine WITH WITHOUT)_CONNECT_STORAGE_ENGINE=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=ON + -DINSTALL_SQLBENCHDIR=share/mariadb + ) + + # Workaround for MDEV-14524 + use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 ) + + 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 + -DWITH_EMBEDDED_SERVER=OFF + -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.6" + 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 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 + + 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/bin/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)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" + 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}" + 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/Manifest b/dev-db/mariadb/Manifest index 69c713574cfe..b5b66dc433df 100644 --- a/dev-db/mariadb/Manifest +++ b/dev-db/mariadb/Manifest @@ -1,7 +1,7 @@ AUX my.cnf-10.2 140 BLAKE2B 3a56b7e38c3dc00215cae4bdc3270e30e85299d3290c0c995a611e4b8b15e66f40d6ac40ab18369e7863742ab6eda94259be5a7f363a26020c6fce28a7582e94 SHA512 85c650670e364f5f71842d9ab07b59c5de6e26e774e7192102562e56f94ed5f8fbc487cef31c134209c22b72fde38f7f53b7279cead97a8af608436d1ecc8857 AUX my.cnf-5.5 4805 BLAKE2B 39ffb485329b246867db03977661441ebfa71c8ac6275d5263ddfdaf189bad54b27884b98f6f901d9850514011c31b08f5ed7ef3e330a6a2cc7a91229fa524a8 SHA512 2826b9c5d751150e57bf11665d05257fae6e20fb97fae72fdcb460b653bd96198b5cbc94db6bf81c17e36e5554fbcec8dfd717f554b55a5d5d090e17ad49c819 AUX my.cnf-5.6-r1 4597 BLAKE2B ae7eb874421819b8ce8e3c21e00f21bba1fb508a8d0ea4825f110b42521deca01726d3a8154c1c541119592b809ef6263d13e7701eba7dc8af201b3777c6d226 SHA512 5670fc67032656c5079fe5190ffef5443d5646ffae00d42e231c584e7688578a7df33dbe473749ea160e978152f5d94325eb023c748826aee89866694bc050f8 -AUX my.cnf.distro-client 637 BLAKE2B b9b6b01195a4e2523a0a1cb7efdf5c35579d394b12b7426cc7f2e65485d8c5bd54622b096be12fb9c1b252fc7311278d79ff922ba9332074e4f06419c5dba68e SHA512 85c0b0eb4281b398ca7c010042d69b4306ccebae9838bf7a1ee53c0d6bb12b20f95bcbd3bb359b107b018d456d7bcae8d168757ff34028ce69357ce3f3fbd54e +AUX my.cnf.distro-client 643 BLAKE2B 5ffd286907ee28c92c85bbcc9a6266555733f1115f2d6b8009183dba6939b978ae8d1b8e0a53e672b8e1a1f621650399231723603fc5f96ef7218db84236e176 SHA512 801f6ab8be3110bb4dc38eaa4367715b8d342b69cadfe13dff987ef6c3aedb67d19449f8f2483e63df5d8b444ca30701b0d96f85e211de6b1e3db923b029acbc AUX my.cnf.distro-server 998 BLAKE2B a7f2977a96d394cb7e24d72d82a1c21095c4b55607e5ca4a2c10619278796c328931a5ec076c15b60afef370c2e5da02ca0c628f330e876b4d2c984eeb54df5f SHA512 d9ab6f7fdfe08e6c242f84410ec680ef6aa6778c4bd55fee67c644e1a7d997446d8ef2129be6fc9833d16fe40cf17e09cdf0cf015f06bb145bbf9cfecb51e882 DIST mariadb-10.0.35.tar.gz 66551252 BLAKE2B 69cc9c78f7c47a4b1760940cb0f395b4053fcc47c1087a0c2af873d4a998ee60915e1f4e64f7fe6474c7c1fa3dabe48a3b6621c67893b20526f01e56b0542e7a SHA512 01fc8d48be3f3847bb222835436ab938c6c5b5ac8ba6cc87b3b6d2a2201b7ab4b152dc1f7d9749c89de90097d50052714ac08aafbbb117fffac32bfb47e74779 DIST mariadb-10.0.37.tar.gz 64728382 BLAKE2B 3d794633cc400013be05c326681f11f8b27c7d6758b43f357ca93976a75ff931f6f6d205510b5df305c6f487485864d346e4fa14383be32dafcf2b8756eb045a SHA512 c3ba749f519cce3bb63fec6ee6819ad931f72d54258d4b7700c515cfeb137453271a408a9a353bf78715fe66a0c06539bdbf15f1c556a7b89a5c01af84f7fd49 @@ -10,18 +10,18 @@ DIST mariadb-10.1.34.tar.gz 65298561 BLAKE2B 3f3af7b8bad68a08f69befd3f3e7bd88b8c 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.2.22.tar.gz 71907765 BLAKE2B e7781a9e1bb0becca543ebb0b9e03912fbafa9de45bbd5c7232f92d29b934148dd124ad462bf8aa5aec2e4ee0bf75a03fae5e5fe97a77e1d93095052a577c14b SHA512 cd61d0c2d528b23b975e6ea142560d9b9ebff7ecda6fa9b3659b25b3406e8cc925918f4c3bb0e200ddb8d0520bcaa4d4f70d245b4731896f9ba2f1bdf0a817b2 -DIST mariadb-10.3.12.tar.gz 70666408 BLAKE2B 90e734a5617e44e2c273a1cd22ed2f81493e9458249dc0eb478c3b2b106dd7a0f81d130841be7632272bf6dc01e64350057c2d3e8162e8e8cef1f5a4ac2fb18c SHA512 9dd2939684c4591db306be6afb34663626dfaae133f88dd31125c759dce16b9e9d767a9254e30d9ee5fa2ea027e223dd4799effba8a8b0e4638d5de9e2512003 +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 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-20181211-1735Z.tar.bz2 330779 BLAKE2B 4a41b9067a8b8bc5b595ff8dfeaa20d6577083ad1f6a0d1b56d29663cd436abc611a2ff394fafb8d466771c8676e2019a415554b830f20828ace31eb5b7e082a SHA512 03db4b1b483395eeba57d049c10a07ef50b26ba97f3fad74aa6a19f8835aea60106bbc86dea2a168ec613d9b2caa016240d8d888e42823d383fa3466f8b262d4 +DIST mysql-extras-20190305-2052Z.tar.bz2 331304 BLAKE2B 1d2c35a961159fa5ce9ee6699fce943f5a5b5cf60b11c9bb4bcccee4943f4508a9eb6d01050c642353ac592ce1a6b421abf2a1bebc706c44c4c8a36aa698ec43 SHA512 ae63403320e010acbb92f8aec6da8ed4f267cef0bad37147d594076fd94571de7f98bfc2afbe94af5d716f58d57696fd958b1e13e20e87052f252ed4a188cd3c EBUILD mariadb-10.0.35-r2.ebuild 27520 BLAKE2B 09bb435fc35e43e9d5a9f0bb234d7583d8ceb55f19e46176def7d1d4370fe99aedb89e28860cc49134f693bf0f49ff4333916441742da72cf65ad7ef6353c72a SHA512 159b2c09d0da83841f77822b4501cc4302758711c9db9447e6c34ebe6185801cbacb4774060d238f7c5aee4595ccc4e0e05f062300f38e27ff86a54a2dce4a95 EBUILD mariadb-10.0.37.ebuild 27521 BLAKE2B 2dee454767b07e9ef957a3d44d3abebb3bace6a7119b81c7662051a3db9315382d3ea1f73dd03380da695ba16d724560d2b03eea3dd09eb206abcaee1358de7a SHA512 d90e140866541db92272855beb315aea7f037304e018efa6ac090b9d838864de0b7efe24d63ffdc2bc605ce659e0a8b722e2c7650ba21d740ab7d337ddd2c9d2 EBUILD mariadb-10.0.38.ebuild 27526 BLAKE2B a54b23cb96de54e5cde1f901d1d818245c1c1e5db84f819306a5a38240e8c5f5635bd2c81081213a20a14bf6f4175a1e24acaac4a6e1ec3613804b019e3a5d46 SHA512 0e97dc59e03cef47825e2829166064ecff46f410314e0ddacbe6552a3504318fa6ef01008ab13d437cd384418baaf5ad58b96290093f55c14319305fa5967a06 EBUILD mariadb-10.1.34.ebuild 29472 BLAKE2B 859741b70abf8c2347395b26b7543f36be94165141227bb7dc75f054768490bf891eea5bd2f171aa0c0f8caed7603abf1347a0087caa10e55ce920aaa9c6677b SHA512 ff30a1fcdcc72b8324dec1be29db63a1792ca58474744f0c02014b1fba28d856ac0f154235b0889aedcc95cf24c4b58fcfd681458be726609861ba6f4220ad8f EBUILD mariadb-10.1.37.ebuild 29474 BLAKE2B dba8dc78e78319041edbf8583ed9584f74964ee114a55a2e77702b086e878905d098dacbf01a8fa802f69c8252cfc0a763fbce7412fc69ccdb8dc78b20bd1a56 SHA512 0cc0d703727393dd5c601027c156b194ff6957e46935077fda1312da37ae6b0aa4282b51666b849ac7414ed3d4ead2640b530ffc8e6cd04bc5c9df2d3502848a -EBUILD mariadb-10.1.38.ebuild 29468 BLAKE2B 508bc25ea3b8a0f9275d82bb591ccf48aed66f63290f910570ab8019a7f9b7e9ecb1863bb8d71ff2fcb2318c91e1387b5bd9e679314c682531662f9a59da9cec SHA512 880d95e14d4034b8f2a5d13fd39cffdd33b37bc3f40901c4477aafc4656beadba14fab7585bceb809c61c2ab228451835c4b75e8774aa572411a91a14b0cd7f7 -EBUILD mariadb-10.2.22.ebuild 32138 BLAKE2B 66e09920cd144d53ef3e8f34c24395348cb13b1751c796d83cab4fe7f9da63a85380c7249d4f31e40c08d63c1d2213fa7a84da155ed9386392de483e5e4b5ec7 SHA512 6f95abb7c46b434516aa82815be7bc43ca5c744952addfcc2ef20ddece0a1654a4ea15c4c2c677e3b5161cd64bcf7dbdd8b8d209846239f1878e5e38e0de2993 -EBUILD mariadb-10.3.12.ebuild 32159 BLAKE2B e88a0109fec3ed85753d5e7bb907a1f675fb323340d0e8ba6cb8ae2cee01646f8a94bf894dfaafaa69b7928e391a2a4638de4ac3fc714ef4d3eca16e611e7371 SHA512 c0bb9f9634cf7c6a961310648d871f7df95a82c39f38856df9692835b07a1b90f533cbea6b8e164e62be7a1e395efdffbb8bdd0b6c4d92877ca6ab942840a4ed +EBUILD mariadb-10.1.38-r1.ebuild 29468 BLAKE2B 732ff5a8100367d21f32cdec167f2a144663936a06492d24219cdc1edb980990f9d66ba25af4e72f019ec9d5ec7a790903c717cce3ff9e18d3cd4447ef2102f2 SHA512 cc0026d43b7d4786d1be045c53e68bf06586134bd1d1471dc9e929799eea437a582b34716baf9e192d4b7469712c7cd720500c5727d7a12a8c3b2cc0432d6b90 +EBUILD mariadb-10.2.22-r1.ebuild 32486 BLAKE2B 0899519ad4bc284c94b9159f8d3c31a55bf4843c389ba065dc09bc5e11165f63b13d3e069603f1eb2680924d36ece47a44aa6892de6dac25eb3bf091269330f1 SHA512 8aab092eb3fc54bbe975e7971758082b01aa52c691deb572dded92ea27045e2ba7a28314df55978fd0c446d12baef27d74d9d64428ffb6cc1ff222d10ff0754c +EBUILD mariadb-10.3.13.ebuild 32156 BLAKE2B 614cef34e9b4c1048144d5ab6d550d076c008892537c73aff3554b35d86963b6f1cfbaee7a3b4f5abbda0ccff1edbac63dd2a4bd80de167080478b9d328bb47a SHA512 8a7eaf5e95e33fa6f25f95abd6664e0556a7b22affa285d48ea9b97a5bd3affbcaa39dd762e4298d117ed437fffbe311cbd54e5d6e139593fceab75627221dc9 EBUILD mariadb-5.5.63.ebuild 27054 BLAKE2B fb6b085846137c6607ccb1b58fdaac6abe8999ad67102b3993b52340dd4c7805640379b79c0a0fe300b237438f836a8b62794c423ebc47707b414f7712214919 SHA512 d9356369a5e93dc1dd1a6c6c332ceac7306cc14b33068739d5fef621ea6f14bf2a36e0b8a9f39500ccb8fb7cf35dae013c9303ade0002459971f48d28097d3de MISC metadata.xml 2611 BLAKE2B d1b6b11359e92a3d9cb2c58ed35a15e3cf42ab616ed907fa36a5f777168a805ffd03d01bd13fcd30352ef6c5e8b1d80f4e882ffaf8f6445ed3fce2bcc2a92923 SHA512 80395b35839acebbb18ac8d01e8c806bd89f18d32f85fcba41f41ecfc4f1f869dc8c51c90bb21ebd3c9ac30d51d47869a4dcf3b8ce73967e337e6e396b267c97 diff --git a/dev-db/mariadb/files/my.cnf.distro-client b/dev-db/mariadb/files/my.cnf.distro-client index 4bbe0f976c63..1b9cdabdb2f3 100644 --- a/dev-db/mariadb/files/my.cnf.distro-client +++ b/dev-db/mariadb/files/my.cnf.distro-client @@ -4,7 +4,7 @@ [client] socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock character-sets-dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb/charsets -default-character-set=utf8 +loose-default-character-set=utf8 [mysql] # uncomment the next directive if you are not familiar with SQL diff --git a/dev-db/mariadb/mariadb-10.1.38-r1.ebuild b/dev-db/mariadb/mariadb-10.1.38-r1.ebuild new file mode 100644 index 000000000000..3ad1109b657a --- /dev/null +++ b/dev-db/mariadb/mariadb-10.1.38-r1.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/bin/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)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" + 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.1.38.ebuild b/dev-db/mariadb/mariadb-10.1.38.ebuild deleted file mode 100644 index 4f84cf1ee6fc..000000000000 --- a/dev-db/mariadb/mariadb-10.1.38.ebuild +++ /dev/null @@ -1,887 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20181104-2252Z" -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/bin/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)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" - 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 new file mode 100644 index 000000000000..1c7bc36bc7dd --- /dev/null +++ b/dev-db/mariadb/mariadb-10.2.22-r1.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/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/bin/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)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" + 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.ebuild b/dev-db/mariadb/mariadb-10.2.22.ebuild deleted file mode 100644 index 1097aad248b3..000000000000 --- a/dev-db/mariadb/mariadb-10.2.22.ebuild +++ /dev/null @@ -1,966 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20181211-1735Z" -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/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 - 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/bin/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)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" - 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.12.ebuild b/dev-db/mariadb/mariadb-10.3.12.ebuild deleted file mode 100644 index 3876e70c8cf5..000000000000 --- a/dev-db/mariadb/mariadb-10.3.12.ebuild +++ /dev/null @@ -1,968 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20181211-1735Z" -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.3-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/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 - 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/_rc/}" "${S}" || die -} - -src_prepare() { - _disable_plugin() { - echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die - } - _disable_engine() { - echo > "${S%/}/storage/${1}/CMakeLists.txt" || die - } - - if use jemalloc; then - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" - elif use tcmalloc; then - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" - 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 sql_errlog ) - local test_plugins=( audit_null auth_examples daemon_example fulltext - debug_key_management example_key_management versioning ) - 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_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="" - -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 - if [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl ; then - rm -f "${ED}/usr/bin/mytop" || die - fi - - # Fix a dangling symlink when galera is not built - if [[ -L "${ED}/usr/bin/wsrep_sst_rsync_wan" ]] && ! use galera ; then - rm "${ED}/usr/bin/wsrep_sst_rsync_wan" || die - fi -} - -# 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.func_time "Dependent on time test was written" - - # 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)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" - 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 new file mode 100644 index 000000000000..8d049d3508ee --- /dev/null +++ b/dev-db/mariadb/mariadb-10.3.13.ebuild @@ -0,0 +1,973 @@ +# 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 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.3.12-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.3-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/jre-1.6 ) ) ) +" +# 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 ) + server? ( ~virtual/mysql-5.6[static=] )" + +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 + 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/_rc/}" "${S}" || die +} + +src_prepare() { + _disable_plugin() { + echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die + } + _disable_engine() { + echo > "${S%/}/storage/${1}/CMakeLists.txt" || die + } + + if use jemalloc; then + echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" + elif use tcmalloc; then + echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" + 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 sql_errlog ) + local test_plugins=( audit_null auth_examples daemon_example fulltext + debug_key_management example_key_management versioning ) + 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_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="" + -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 + if [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl ; then + rm -f "${ED}/usr/bin/mytop" || die + fi + + # Fix a dangling symlink when galera is not built + if [[ -L "${ED}/usr/bin/wsrep_sst_rsync_wan" ]] && ! use galera ; then + rm "${ED}/usr/bin/wsrep_sst_rsync_wan" || die + fi + + # Remove broken SST scripts that are incompatible + local scriptremove + for scriptremove in wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2 ; do + if [[ -e "${ED}/usr/bin/${scriptremove}" ]] ; then + rm "${ED}/usr/bin/${scriptremove}" || die + fi + done +} + +# 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.func_time "Dependent on time test was written" + + # 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)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" + 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/mongodb/Manifest b/dev-db/mongodb/Manifest index e9c71dfbf2e5..c4d600c83238 100644 --- a/dev-db/mongodb/Manifest +++ b/dev-db/mongodb/Manifest @@ -1,4 +1,3 @@ -AUX mongodb-3.2.10-boost-1.62.patch 702 BLAKE2B fb3822a1a212aae30f6fbb33a4a87f5f7d0992dfc94b95247e8a0253ed453035aa8f1ba3b9912d3cd1245561d4e529b4e29ab1cf109430c4d2fef51ca33c1bd8 SHA512 79edfd1a6eaba597b31a82e54722dccab288d8b8840a53f79140b5fca221b5acd9fbc770d99e46ea9fa0da502cdf18dd35d982c95a4aa341806c3d8b61fc732f AUX mongodb-3.4.0-fix-scons.patch 1411 BLAKE2B 6e5975b70ec7f281ea2cd101b16ee2849762fa1dd8427522eb3b01cd1738e60ece013bf23d07c180c58af024aebd141ca7fdf80bc240701f48556da46d3787ab SHA512 2e29c91a22663259d2f5413fbb2652702bceb122899e50a8969fb82d74a64a78649e79b005e20e6640740c089b1cee19080890eb8d9344c2ce355a977146b770 AUX mongodb-3.4.6-sysmacros-include.patch 1419 BLAKE2B f07ab093f13ea2b9675538dc99e2e58f85019edffad05bbbf3032f85f8ef881020cc9bf25bc62ca13344e7b8b7dd3b04954c76974c512a41ea5a7a2045de2b34 SHA512 ab269ec003b74848f981021f5eb09e38216d75dd9d1b8a155068b2a335d9ec9d1f5f575028ae9b4b0d8745d15e464cb05b70aabc6c28c984115574c6747afc05 AUX mongodb-3.4.7-no-boost-check.patch 641 BLAKE2B 0dc3a426b28cd80d7b3361ff9c6747aff64dd27c1bc01a9717c2dd1c160b66f53feb72fd2ead385c220ebe92a8c7b8fa6b04fb3fa8437dba17d5f8346665f6b8 SHA512 812eaaadb6f265cfc904e8f3a7ae8276e42e3968529914179efab5e44f1951ab46ac3bbcfb259f924b20a8ca61d2ebcf72b7103ea9d5f25594ff8e9e3e85836b @@ -14,13 +13,19 @@ AUX mongos.conf-r2 648 BLAKE2B 420bebfafc1ef4af4b90580077a803fe30f37d63eca6509e7 AUX mongos.confd-r3 470 BLAKE2B 9cf6f201d337430901d957a5a0811ff11ac2e81814aac2120c5018e6ec4c38b5ca22d19caea593834416c63609c69a8294227fb6b30200b41dfb29799cc5c1b4 SHA512 952fb9cf5d3eeea2006b101e23142e408c98d66d1f4f868f6ea5a4df6a6331ddcbcbdfb24f4b031c1a8c42652141a3684073b96dfc0b3fbd21dc6b5bcf0e36cb AUX mongos.initd-r3 422 BLAKE2B 90872d0d8cdc5e33e3eebee848f58a2db0511d48b496ba9318117b74ad9265ead53a21b7d1790729a62d61839099bee315ace8ff3646c01e096a943c2251bf88 SHA512 bf5897614d59c6b4e72529b126408a62ea37d9e9368e5ff69c8fcf2bad3ec09065cff09467f82117a892c51090018706d2f38c03cb9a974a61a49bd9efa0f144 DIST mongodb-src-r3.4.16.tar.gz 40093657 BLAKE2B 7123444dbdd0b2ad3adfb3391e0177d33c1b6c6a4ea83027821c564faad047a736e52926bc15c58bef59c18282436e913fd3bc9963705e030da01356f83ea367 SHA512 e22eb1fe2a832fed8305200614988c5ecfd619cee44fe2263bffa151732c0e26584084e64065dbc65152be6e5c1767a538193770359bea92f3703c72239075db +DIST mongodb-src-r3.6.10.tar.gz 40562421 BLAKE2B c4fbb9e9586350503df84b344e5c0e05176e681f50a0e96551f157c81c85b71e45c235f0788c1886aa5b6b79fa452afa1a6e8de4acfbfe4c4a0ae62379599f86 SHA512 e0833885a2b1fc14d99749304bd83931a9016039fa32826f9961653601975474f37003eb40fbe8cc5b09644ea447cdc59ccf63110b527d51d4c772cfff88804f DIST mongodb-src-r3.6.8.tar.gz 40428295 BLAKE2B cc02f73cfb49fb38ccabaad5a02610ce73fc41895ce944e48669e254bcbc70c8872a1bd7f8e04371fae4fcd9af2466fd8550367dd1d1da5cee50b86fc5023bf2 SHA512 c981f3269be3bafb59aa89d36c39a801fd7007b60db6c09b4616a559aaf8e50b34cabbdac2b59f23552c0a5112913fba468f7e2ed9a5f4daa3702dcffdf34999 DIST mongodb-src-r3.6.9.tar.gz 40515460 BLAKE2B 5637e7b5cc4b3c7874fedacbe0b05dac1b3dde3ae1c58ecbfc8caf9526c0a8696bdfa1b9b40ffd1adfc81ef90fcb7a41de2c53ccce09da8b7879b9ab2f238eb7 SHA512 00202820570ba5cdc16951b1cb0e9b52bcb8362cee252c857b84d9107761f4061496fc3379ceae6e052f14477d702714384ad1b24eca2c4173af2506a8d1f39f DIST mongodb-src-r4.0.3.tar.gz 49435646 BLAKE2B 1663823d48ec6d93b30b4d68a09bab164291530fd4966fcdd07ffbaceaf25d9fc5c7480d0d794fdd374fa3a2d11f19d87556cf0c47198a13f9d8fb5ccf7f0343 SHA512 c77a01d8d16322514f42030c46a0aa9cedb90f186375222eeb31648060265006b5e929bdde6ca8e7ecd71018f7c19f5bade463d98db0f053d586ffc8adc99550 DIST mongodb-src-r4.0.4.tar.gz 49462543 BLAKE2B a1193ebc6ed818d4e5f27bff1792b6c6c193ff063cae36f2f7adcf63a3b780658d221691c58f42e494ec514d78c81d093067ea7dce8c7158a28846434f493821 SHA512 7e434c8ac715793d7b0015116af72cde766bae953cdc38653a2746ef4a76898dec58f8ee607d9357b87fa11e5a1f0248ae739473ded2d3dcca2b2801434b07e2 +DIST mongodb-src-r4.0.5.tar.gz 49507822 BLAKE2B ca5853c632631a06300247d4d3bfee153ffdde2fcbd313ab95472e6721d92a67f464af32c745a297401132287f66b1b78e0eebe583008689d1580b99422d7e68 SHA512 4a544ad40d75583b38a6a97a0a6e4fae7d0d7a740aa1f993adac6855c5f7fae43b4cf6966e58d16ec716e8b93c770a3dc3997c2785597b5e37dfc7aafa516976 +DIST mongodb-src-r4.0.6.tar.gz 49511958 BLAKE2B c372bb858528cb825db4edf11db636ad71c63148b84838f64cefe886b37631482c1e22eb99dfc557c3f51706d1d2f61b893bfd301cdeb8772a2d85ad75f8f48c SHA512 72e04154cf221833522bb0c2cc99acc2a86d20e2dcbf1f8c6ff0a870edf7b2529a55b6821c664805c00c12a311ae374a276ef1e3ccea1ed84fb125bb8726906a EBUILD mongodb-3.4.16.ebuild 4086 BLAKE2B 09d968fc68f4a3c717ce1e4b2f714464c04251fa8c241c9492a26f3777fcc458d7d27810530129753756012341924773c46bea0474900dd7289edb7778283187 SHA512 6f29c0d7dcb54403fe689f168652586bc4fae81de2b0d28f284046ab33c1e3ad94fbed3815ba2fd2164eacd12e9f43bdd1943179778175d6fe3097165a2410e0 +EBUILD mongodb-3.6.10.ebuild 4230 BLAKE2B 7dcdae9c745188715aab750f024ec651f9c7af64f00d78d5dd293afca61fd1a8e0cc07bf15ae08bb6b6de8a77c19a81cb3fa1dccbe71b022b237d20462038bc7 SHA512 cb123077b262bc4b17ea31a741cf77c48dca7b24d090d0b7428487daba6112a0f21f1397d6e9e03837edf92ed591ed8c2565a2b29463cb1d4a54b3ab5aca91d5 EBUILD mongodb-3.6.8.ebuild 4196 BLAKE2B 5c5a72caa94102818cc03de85afc8d4c2818775814a9dd04555db4c1676dda953c8e64e3d222e35e96dfa90a26a18d9825c910f48102c6d574e8de816749523e SHA512 f6f83c1dd60eb8887457135b82194dd16c874678369a3b3a29907406b921502100e6d52d08b4dca6d9777d6d6c6453e6f134b08550304b0321138fb296e259dd EBUILD mongodb-3.6.9.ebuild 4187 BLAKE2B c491023d742537e146667c049040132f58811e0fa1c051d1cfd13ace7b45330f8ed03f431a18c6e79ad4c9fb4f0b909752332d70d0329275848e2ce06a83eff0 SHA512 44f1661569143ddb3138b0ba04001ae6de049f3269b2fbb3bea0f0a55cdb4ffc616042009c3887945d065f6951b1ff0274607e5cf7a2fc509ce78717bcf0bf74 EBUILD mongodb-4.0.3.ebuild 4198 BLAKE2B 8ecf5ad9712f6c5f3257df6dbd7dba686206c5498287cd39082920a9bbdaaf75585bb205cf09c515d27331a404f2b493d222bcf22d15c6904933bf753db04d01 SHA512 1f0932d7f192b2526d48389375aacc1f73e4b388f6ad46014d47eb18583940c13c9356288db29270d199f5e8930882842128df42c98171a7abf1cc582ffcb210 EBUILD mongodb-4.0.4.ebuild 4198 BLAKE2B b7582d2142231b062780de2503eb1f849ecfc1f033680d8a657c1b6e8f6d3c08a7c2d0855e35cf066f2600193e56c8b2b3dd327e7d3268eadd1a91765f992c6f SHA512 8fe7eeba925e8f91fceb6ec5e7147be6b808dd6df0202ec08eb2e2d416151194537a6a719d75efcee0faa23a03ac9a40e6bd472ce8509173d16d9f42c192e31b -MISC metadata.xml 835 BLAKE2B 6aaa10090846882c813db2fcbec27e9bb8d8ab5b34bbb0f5ac7b0de922606a6382be60f30a19502694022a38dc7c67f03b986d5cd1473e530ab4d05f5ee233a0 SHA512 8d190ebb08b6951c9c9ce39872c0c76b6236a0687980577eae7b2181c0bccacc60ccc67cccc4edc05aa21f4d9d65621eb57f803aab91c7ace6ab794559c9d08a +EBUILD mongodb-4.0.5.ebuild 4231 BLAKE2B cbcc36b52afa5d2ff4e6482c801297d88902b9a09576d1ac355d922e4c66333ebf62e2cfdeab51145bc0c1717587eceae4c817e5ce25ba22620fd85b9d14c60b SHA512 98180763eb93b00c464e3930eb6f4aca8b71a85299f3990a1e21be5f882a0eefc94c297919e072504c18c59b661aca851c347c8b06c3b96364abdff17266aab4 +EBUILD mongodb-4.0.6.ebuild 4231 BLAKE2B cbcc36b52afa5d2ff4e6482c801297d88902b9a09576d1ac355d922e4c66333ebf62e2cfdeab51145bc0c1717587eceae4c817e5ce25ba22620fd85b9d14c60b SHA512 98180763eb93b00c464e3930eb6f4aca8b71a85299f3990a1e21be5f882a0eefc94c297919e072504c18c59b661aca851c347c8b06c3b96364abdff17266aab4 +MISC metadata.xml 901 BLAKE2B f7fde58679ba05518634b82bf5fcc371897165364fe5b023a2ec161790c869de82b4a3dd769d5e1bb450f99679869b60bb1e35beb8d41c54d3448dfca580a7ae SHA512 48f133d396aa31b992bac5f947e5a262b2d07a1016c6d49fa3c86dabb85981edfa332abb867413826762d88051ff3981cc77c2ec92e992d7a231c3b542336e36 diff --git a/dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch b/dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch deleted file mode 100644 index 30a3bdff45f8..000000000000 --- a/dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch +++ /dev/null @@ -1,15 +0,0 @@ -Derived from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/mongodb/patches/patch-src_mongo_db_fts_unicode_string.cpp v1.1 - -* Fix build with boost 1.62.0 - ---- a/src/mongo/db/fts/unicode/string.cpp 2016-09-26 12:10:04.000000000 +0000 -+++ b/src/mongo/db/fts/unicode/string.cpp -@@ -274,7 +274,7 @@ bool String::substrMatch(const std::stri - - // Case sensitive and diacritic sensitive. - return boost::algorithm::boyer_moore_search( -- haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end(); -+ haystack.begin(), haystack.end(), needle.begin(), needle.end()) != std::make_pair(haystack.end(), haystack.end()); - } - - } // namespace unicode diff --git a/dev-db/mongodb/metadata.xml b/dev-db/mongodb/metadata.xml index 32785d23917f..5379d9760d42 100644 --- a/dev-db/mongodb/metadata.xml +++ b/dev-db/mongodb/metadata.xml @@ -14,6 +14,7 @@ and powerful queries). + Adds support for link time optimization Install the MongoDB Monitoring Service agent Install the MongoDB tools (mongoimport, mongodump...) from app-admin/mongo-tools diff --git a/dev-db/mongodb/mongodb-3.6.10.ebuild b/dev-db/mongodb/mongodb-3.6.10.ebuild new file mode 100644 index 000000000000..5806eaa2e2e1 --- /dev/null +++ b/dev-db/mongodb/mongodb-3.6.10.ebuild @@ -0,0 +1,164 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) + +SCONS_MIN_VERSION="2.5.0" +CHECKREQS_DISK_BUILD="2400M" +CHECKREQS_DISK_USR="512M" +CHECKREQS_MEMORY="1024M" + +inherit check-reqs flag-o-matic multiprocessing pax-utils python-single-r1 scons-utils systemd toolchain-funcs user + +MY_P=${PN}-src-r${PV/_rc/-rc} + +DESCRIPTION="A high-performance, open source, schema-free document-oriented database" +HOMEPAGE="https://www.mongodb.com" +SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz" + +LICENSE="Apache-2.0 SSPL-1" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug kerberos libressl lto mms-agent ssl test +tools" + +RDEPEND=">=app-arch/snappy-1.1.3 + >=dev-cpp/yaml-cpp-0.5.3:= + >=dev-libs/boost-1.60:=[threads(+)] + >=dev-libs/libpcre-8.41[cxx] + dev-libs/snowball-stemmer + net-libs/libpcap + >=sys-libs/zlib-1.2.8:= + kerberos? ( dev-libs/cyrus-sasl[kerberos] ) + mms-agent? ( app-admin/mms-agent ) + ssl? ( + !libressl? ( >=dev-libs/openssl-1.0.1g:0= ) + libressl? ( dev-libs/libressl:0= ) + )" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + dev-python/cheetah[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + virtual/python-typing[${PYTHON_USEDEP}] + sys-libs/ncurses:0= + sys-libs/readline:0= + debug? ( dev-util/valgrind ) + test? ( + dev-python/pymongo[${PYTHON_USEDEP}] + )" +PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )" + +PATCHES=( + "${FILESDIR}/${PN}-3.4.7-no-boost-check.patch" + "${FILESDIR}/${PN}-3.6.1-fix-scons.patch" + "${FILESDIR}/${PN}-3.6.1-no-compass.patch" +) + +S="${WORKDIR}/${MY_P}" + +pkg_pretend() { + if [[ -n ${REPLACING_VERSIONS} ]]; then + if ver_test "$REPLACING_VERSIONS" -lt 3.4; then + ewarn "To upgrade from a version earlier than the 3.4-series, you must" + ewarn "successively upgrade major releases until you have upgraded" + ewarn "to 3.4-series. Then upgrade to 3.6 series." + else + ewarn "Be sure to set featureCompatibilityVersion to 3.4 before upgrading." + fi + fi +} + +pkg_setup() { + enewgroup mongodb + enewuser mongodb -1 -1 /var/lib/${PN} mongodb + + python-single-r1_pkg_setup +} + +src_prepare() { + default + + # remove bundled libs + rm -r src/third_party/{boost-*,pcre-*,scons-*,snappy-*,yaml-cpp-*,zlib-*} || die + + # remove compass + rm -r src/mongo/installer/compass || die +} + +src_configure() { + # https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source + # --use-system-icu fails tests + # --use-system-tcmalloc is strongly NOT recommended: + scons_opts=( + CC="$(tc-getCC)" + CXX="$(tc-getCXX)" + + --disable-warnings-as-errors + --use-system-boost + --use-system-pcre + --use-system-snappy + --use-system-stemmer + --use-system-yaml + --use-system-zlib + ) + + use debug && scons_opts+=( --dbg=on ) + use kerberos && scons_opts+=( --use-sasl-client ) + use lto && scons_opts+=( --lto=on ) + use ssl && scons_opts+=( --ssl ) + + # respect mongoDB upstream's basic recommendations + # see bug #536688 and #526114 + if ! use debug; then + filter-flags '-m*' + filter-flags '-O?' + fi + + default +} + +src_compile() { + escons "${scons_opts[@]}" core tools +} + +# FEATURES="test -usersandbox" emerge dev-db/mongodb +src_test() { + "${EPYTHON}" ./buildscripts/resmoke.py --dbpathPrefix=test --suites core --jobs=$(makeopts_jobs) || die "Tests failed" +} + +src_install() { + escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr + + doman debian/mongo*.1 + dodoc README docs/building.md + + newinitd "${FILESDIR}/${PN}.initd-r3" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r3" ${PN} + newinitd "${FILESDIR}/mongos.initd-r3" mongos + newconfd "${FILESDIR}/mongos.confd-r3" mongos + + insinto /etc + newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf + newins "${FILESDIR}/mongos.conf-r2" mongos.conf + + systemd_dounit "${FILESDIR}/${PN}.service" + + insinto /etc/logrotate.d/ + newins "${FILESDIR}/${PN}.logrotate" ${PN} + + # see bug #526114 + pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos} + + local x + for x in /var/{lib,log}/${PN}; do + diropts -m0750 -o mongodb -g mongodb + keepdir "${x}" + done +} + +pkg_postinst() { + ewarn "Make sure to read the release notes and follow the upgrade process:" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/#upgrade-procedures" +} diff --git a/dev-db/mongodb/mongodb-4.0.5.ebuild b/dev-db/mongodb/mongodb-4.0.5.ebuild new file mode 100644 index 000000000000..bb2a9fb04dc3 --- /dev/null +++ b/dev-db/mongodb/mongodb-4.0.5.ebuild @@ -0,0 +1,164 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) + +SCONS_MIN_VERSION="2.5.0" +CHECKREQS_DISK_BUILD="2400M" +CHECKREQS_DISK_USR="512M" +CHECKREQS_MEMORY="1024M" + +inherit check-reqs flag-o-matic multiprocessing pax-utils python-single-r1 scons-utils systemd toolchain-funcs user + +MY_P=${PN}-src-r${PV/_rc/-rc} + +DESCRIPTION="A high-performance, open source, schema-free document-oriented database" +HOMEPAGE="https://www.mongodb.com" +SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz" + +LICENSE="Apache-2.0 SSPL-1" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug kerberos libressl lto mms-agent ssl test +tools" + +RDEPEND=">=app-arch/snappy-1.1.3 + >=dev-cpp/yaml-cpp-0.5.3:= + >=dev-libs/boost-1.60:=[threads(+)] + >=dev-libs/libpcre-8.41[cxx] + dev-libs/snowball-stemmer + net-libs/libpcap + >=sys-libs/zlib-1.2.11:= + kerberos? ( dev-libs/cyrus-sasl[kerberos] ) + mms-agent? ( app-admin/mms-agent ) + ssl? ( + !libressl? ( >=dev-libs/openssl-1.0.1g:0= ) + libressl? ( dev-libs/libressl:0= ) + )" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + dev-python/cheetah[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + virtual/python-typing[${PYTHON_USEDEP}] + sys-libs/ncurses:0= + sys-libs/readline:0= + debug? ( dev-util/valgrind ) + test? ( + dev-python/pymongo[${PYTHON_USEDEP}] + )" +PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )" + +PATCHES=( + "${FILESDIR}/${PN}-3.4.7-no-boost-check.patch" + "${FILESDIR}/${PN}-3.6.1-fix-scons.patch" + "${FILESDIR}/${PN}-4.0.0-no-compass.patch" +) + +S="${WORKDIR}/${MY_P}" + +pkg_pretend() { + if [[ -n ${REPLACING_VERSIONS} ]]; then + if ver_test "$REPLACING_VERSIONS" -lt 3.6; then + ewarn "To upgrade from a version earlier than the 3.6-series, you must" + ewarn "successively upgrade major releases until you have upgraded" + ewarn "to 3.6-series. Then upgrade to 4.0 series." + else + ewarn "Be sure to set featureCompatibilityVersion to 3.6 before upgrading." + fi + fi +} + +pkg_setup() { + enewgroup mongodb + enewuser mongodb -1 -1 /var/lib/${PN} mongodb + + python-single-r1_pkg_setup +} + +src_prepare() { + default + + # remove bundled libs + rm -r src/third_party/{boost-*,pcre-*,scons-*,snappy-*,yaml-cpp-*,zlib-*} || die + + # remove compass + rm -r src/mongo/installer/compass || die +} + +src_configure() { + # https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source + # --use-system-icu fails tests + # --use-system-tcmalloc is strongly NOT recommended: + scons_opts=( + CC="$(tc-getCC)" + CXX="$(tc-getCXX)" + + --disable-warnings-as-errors + --use-system-boost + --use-system-pcre + --use-system-snappy + --use-system-stemmer + --use-system-yaml + --use-system-zlib + ) + + use debug && scons_opts+=( --dbg=on ) + use kerberos && scons_opts+=( --use-sasl-client ) + use lto && scons_opts+=( --lto=on ) + use ssl && scons_opts+=( --ssl ) + + # respect mongoDB upstream's basic recommendations + # see bug #536688 and #526114 + if ! use debug; then + filter-flags '-m*' + filter-flags '-O?' + fi + + default +} + +src_compile() { + escons "${scons_opts[@]}" core tools +} + +# FEATURES="test -usersandbox" emerge dev-db/mongodb +src_test() { + "${EPYTHON}" ./buildscripts/resmoke.py --dbpathPrefix=test --suites core --jobs=$(makeopts_jobs) || die "Tests failed" +} + +src_install() { + escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr + + doman debian/mongo*.1 + dodoc README docs/building.md + + newinitd "${FILESDIR}/${PN}.initd-r3" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r3" ${PN} + newinitd "${FILESDIR}/mongos.initd-r3" mongos + newconfd "${FILESDIR}/mongos.confd-r3" mongos + + insinto /etc + newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf + newins "${FILESDIR}/mongos.conf-r2" mongos.conf + + systemd_dounit "${FILESDIR}/${PN}.service" + + insinto /etc/logrotate.d/ + newins "${FILESDIR}/${PN}.logrotate" ${PN} + + # see bug #526114 + pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos} + + local x + for x in /var/{lib,log}/${PN}; do + diropts -m0750 -o mongodb -g mongodb + keepdir "${x}" + done +} + +pkg_postinst() { + ewarn "Make sure to read the release notes and follow the upgrade process:" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/#upgrade-procedures" +} diff --git a/dev-db/mongodb/mongodb-4.0.6.ebuild b/dev-db/mongodb/mongodb-4.0.6.ebuild new file mode 100644 index 000000000000..bb2a9fb04dc3 --- /dev/null +++ b/dev-db/mongodb/mongodb-4.0.6.ebuild @@ -0,0 +1,164 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) + +SCONS_MIN_VERSION="2.5.0" +CHECKREQS_DISK_BUILD="2400M" +CHECKREQS_DISK_USR="512M" +CHECKREQS_MEMORY="1024M" + +inherit check-reqs flag-o-matic multiprocessing pax-utils python-single-r1 scons-utils systemd toolchain-funcs user + +MY_P=${PN}-src-r${PV/_rc/-rc} + +DESCRIPTION="A high-performance, open source, schema-free document-oriented database" +HOMEPAGE="https://www.mongodb.com" +SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz" + +LICENSE="Apache-2.0 SSPL-1" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug kerberos libressl lto mms-agent ssl test +tools" + +RDEPEND=">=app-arch/snappy-1.1.3 + >=dev-cpp/yaml-cpp-0.5.3:= + >=dev-libs/boost-1.60:=[threads(+)] + >=dev-libs/libpcre-8.41[cxx] + dev-libs/snowball-stemmer + net-libs/libpcap + >=sys-libs/zlib-1.2.11:= + kerberos? ( dev-libs/cyrus-sasl[kerberos] ) + mms-agent? ( app-admin/mms-agent ) + ssl? ( + !libressl? ( >=dev-libs/openssl-1.0.1g:0= ) + libressl? ( dev-libs/libressl:0= ) + )" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + dev-python/cheetah[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + virtual/python-typing[${PYTHON_USEDEP}] + sys-libs/ncurses:0= + sys-libs/readline:0= + debug? ( dev-util/valgrind ) + test? ( + dev-python/pymongo[${PYTHON_USEDEP}] + )" +PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )" + +PATCHES=( + "${FILESDIR}/${PN}-3.4.7-no-boost-check.patch" + "${FILESDIR}/${PN}-3.6.1-fix-scons.patch" + "${FILESDIR}/${PN}-4.0.0-no-compass.patch" +) + +S="${WORKDIR}/${MY_P}" + +pkg_pretend() { + if [[ -n ${REPLACING_VERSIONS} ]]; then + if ver_test "$REPLACING_VERSIONS" -lt 3.6; then + ewarn "To upgrade from a version earlier than the 3.6-series, you must" + ewarn "successively upgrade major releases until you have upgraded" + ewarn "to 3.6-series. Then upgrade to 4.0 series." + else + ewarn "Be sure to set featureCompatibilityVersion to 3.6 before upgrading." + fi + fi +} + +pkg_setup() { + enewgroup mongodb + enewuser mongodb -1 -1 /var/lib/${PN} mongodb + + python-single-r1_pkg_setup +} + +src_prepare() { + default + + # remove bundled libs + rm -r src/third_party/{boost-*,pcre-*,scons-*,snappy-*,yaml-cpp-*,zlib-*} || die + + # remove compass + rm -r src/mongo/installer/compass || die +} + +src_configure() { + # https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source + # --use-system-icu fails tests + # --use-system-tcmalloc is strongly NOT recommended: + scons_opts=( + CC="$(tc-getCC)" + CXX="$(tc-getCXX)" + + --disable-warnings-as-errors + --use-system-boost + --use-system-pcre + --use-system-snappy + --use-system-stemmer + --use-system-yaml + --use-system-zlib + ) + + use debug && scons_opts+=( --dbg=on ) + use kerberos && scons_opts+=( --use-sasl-client ) + use lto && scons_opts+=( --lto=on ) + use ssl && scons_opts+=( --ssl ) + + # respect mongoDB upstream's basic recommendations + # see bug #536688 and #526114 + if ! use debug; then + filter-flags '-m*' + filter-flags '-O?' + fi + + default +} + +src_compile() { + escons "${scons_opts[@]}" core tools +} + +# FEATURES="test -usersandbox" emerge dev-db/mongodb +src_test() { + "${EPYTHON}" ./buildscripts/resmoke.py --dbpathPrefix=test --suites core --jobs=$(makeopts_jobs) || die "Tests failed" +} + +src_install() { + escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr + + doman debian/mongo*.1 + dodoc README docs/building.md + + newinitd "${FILESDIR}/${PN}.initd-r3" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r3" ${PN} + newinitd "${FILESDIR}/mongos.initd-r3" mongos + newconfd "${FILESDIR}/mongos.confd-r3" mongos + + insinto /etc + newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf + newins "${FILESDIR}/mongos.conf-r2" mongos.conf + + systemd_dounit "${FILESDIR}/${PN}.service" + + insinto /etc/logrotate.d/ + newins "${FILESDIR}/${PN}.logrotate" ${PN} + + # see bug #526114 + pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos} + + local x + for x in /var/{lib,log}/${PN}; do + diropts -m0750 -o mongodb -g mongodb + keepdir "${x}" + done +} + +pkg_postinst() { + ewarn "Make sure to read the release notes and follow the upgrade process:" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/#upgrade-procedures" +} diff --git a/dev-db/mysql-connector-c++/Manifest b/dev-db/mysql-connector-c++/Manifest index f063f300733d..bd0f17535fa3 100644 --- a/dev-db/mysql-connector-c++/Manifest +++ b/dev-db/mysql-connector-c++/Manifest @@ -12,9 +12,9 @@ DIST mysql-connector-c++-8.0.11-src.tar.gz 2322951 BLAKE2B a1ea47c0440beae189214 DIST mysql-connector-c++-8.0.13-src.tar.gz 2174609 BLAKE2B 5293ccfb7ad3bd6d50e0518db402d93f707535498ff1f608acc5c642cdc2c671601cbb7c14c7e6ec66fea8bdcb22effbb90e0ee2c207e8e82be7a2b446512f24 SHA512 0c260eff0002f5abc177049b9d050daf3b7860634355c10c02cb0ece18a3d1505454d67d8742d7e879c0cc6b44f8045f75e64d79bdd0bbfc211de9903abec902 DIST mysql-connector-c++-8.0.15-src.tar.gz 2210243 BLAKE2B 45e0ffa2134c9df5a7e311963c7f2c58b5d7cfc0eefd80a5dc323bbe34ba60d40c79154f932e19c5f8e18ae45d0b61d304b7b7daba4955f92f830cf20c718931 SHA512 9a217b8f61babe5dac405be19b12d34b22673e779433d880a3aa31ea2e128f93434599a3fe0c1150b3f7b8c4d03f595d545d8cc33342a60561a2f60bff71ef14 EBUILD mysql-connector-c++-1.1.11.ebuild 1619 BLAKE2B deca616c2dfe247328a82ed6dcee22ac8318979b78ef2d26264cc8c29d26aade47d00f2fa9367dddf21cd0a8703216d6370da1dcc96153054704541e39c31129 SHA512 8af584556114a0b5266af95b82e00d94c16dbd5c6b49c6cf25ad855f8fb4fb65ad9a2d752ce7ae4efaf4df7f2bdaa775cb712a89b0a8c4283e3e7d4fc0f29e9e -EBUILD mysql-connector-c++-1.1.12.ebuild 1586 BLAKE2B db9fd1e93aa373e3631ce3980f385d98918983b7cf7e350bc9723e1fcb6a87dcfda80d872de798ec8c28ed9a09cbf618e6835ff55397086edad08cc3a22fcd94 SHA512 08986b4273f8766442b10ee1433d4bb0cdbc692bb4d23b4589c86f7629027b3d8a1b0456bd79afbe4d0ab94e0da530266885f370012779e618ec64283d9fcf91 +EBUILD mysql-connector-c++-1.1.12.ebuild 1646 BLAKE2B 66e94a142efcb3a7b3111d930519d9fd53be1a500f7ee1cfdcec93ae4d5cf05f6241638c8a5b6305c29054e35dda43907a0ff2a47132eb79a8215e5ec65634c1 SHA512 907fbbab27519498402b914c8f1188d60814ae0e7ebbcc72d8dfa53620f2b52db686ab880cef61f4b37e210177e75fc3d114a5ccfaa1bbcde6df76a1b4070077 EBUILD mysql-connector-c++-1.1.9.ebuild 1568 BLAKE2B 767d7a824046b4b1b18967abc04ae51b0610b15af54d8f1491b7d0731a2a25add4ff0bf2dd0445c793737eaf897205216e554e4405f2ab3d3eec30ef0662edc4 SHA512 55070fa6863b2e3cffc3e7f71bd2b652b198ae824e256b6f72d9c525602582c05a57262ba7f33bf01802551617d4963f30b3bbf15818a4fd1a406ac6286aa65e EBUILD mysql-connector-c++-8.0.11.ebuild 831 BLAKE2B cd00b3ef8d70e64c8fa7d4852a45d58f060fa443dfb90ebffdb3fa11310d4afabf0396eb05ec4af04b2d3fb3115f38b10eb76a1a302d9d7a1cbb5b4f7e61fda0 SHA512 8de6feaa69664b8faea224769777b7050470fd0b60c0d317e00049bc0e29471bac94274ae0da4239ff211651bf3775df0526d29a02d39d88b1d107bddbb44ee0 EBUILD mysql-connector-c++-8.0.13.ebuild 840 BLAKE2B ad79745000c37f90f50ffb434613bdabcdf7cc8c8fb93e24e2148f08e65414f5bfcbd792a6b942494b776bbcd8b0717760d8576dc77d78607aeba473a2e5878a SHA512 8ed227a9269efc07223a71798225f4e573904aae94126c549e32abcf4e02459269c570a7d8e4e4db3ec7a825636a77feab6b1752ceaf23d4416cc42d4ea94e8b -EBUILD mysql-connector-c++-8.0.15.ebuild 849 BLAKE2B 3b5c46fb10763ce2bfe7b12a4aa1736e78dad49338778d43b3de9f1be5f8d87db701c8629af5471ad36607905da4efab21040da2e2a4de1e29f536a48b3ca09f SHA512 0615c16d84fe686c210f49e366d4bfe1cf056e9f15b36000c405d794ddbdf1ea00ba1cc8977574d22a96bcc19f9997d5194a5fdbcbb4f8288b84d79fafb2282d +EBUILD mysql-connector-c++-8.0.15.ebuild 909 BLAKE2B 3a0fa261424e3ce299cf1d10ff5ace8e8bedc4e91fd0eb098916ca1b2d2353562a21d4aaf3fb73c119a665ad64da113036fba6ad9a02a6199306cece67b1f835 SHA512 32c8692e66ed3805c3e01ad5b4e66b04bc0a750e1fd270fc52f70777242abd21d5f11acdff27210b9194190e2ea1bfb3d203e264986c985f0d13210618e51047 MISC metadata.xml 378 BLAKE2B 43fdbbc8d3b6ef99e51da96ddfefbdeaa70ef5fcb2fc6067305f75f75b7ee2fd21b79ca76704d8752bf59ae057b28efb187b063770964246f93fea629b58b467 SHA512 c6e545fb60d306792421ea26a937aaa6aea53d2a4100c9cafe78cf695c9dd0620cf3e770d43ff42749ae42bbe3a35212407ea84edee9af2dcb0255c2b763ddfc diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.12.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.12.ebuild index 5bb2921319c8..9fe978903a8c 100644 --- a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.12.ebuild +++ b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.12.ebuild @@ -13,11 +13,12 @@ SRC_URI="https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}.tar.gz" LICENSE="Artistic GPL-2" SLOT="0/7" KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86" -IUSE="debug examples gcov static-libs" +IUSE="debug examples gcov libressl static-libs" DEPEND="virtual/libmysqlclient:= dev-libs/boost:= - dev-libs/openssl:0= + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) !