From fc637fb28da700da71ec2064d65ca5a7a31b9c6c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 18 Aug 2019 18:16:17 +0100 Subject: gentoo resync : 18.08.2019 --- dev-db/Manifest.gz | Bin 18996 -> 18986 bytes dev-db/clickhouse/Manifest | 5 + dev-db/clickhouse/clickhouse-19.13.1.11-r1.ebuild | 205 ++++ dev-db/clickhouse/clickhouse-19.13.1.11.ebuild | 204 ++++ dev-db/clickhouse/files/clickhouse-server.confd | 4 + dev-db/clickhouse/files/clickhouse-server.initd-r1 | 23 + dev-db/etcd/Manifest | 4 +- dev-db/etcd/etcd-3.3.12.ebuild | 78 -- dev-db/etcd/etcd-3.3.14.ebuild | 78 ++ dev-db/firebird/Manifest | 5 +- .../files/firebird-3.0.2.32703.0-gcc6.patch | 19 - dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild | 235 ----- dev-db/firebird/firebird-3.0.4.33054.0.ebuild | 230 ++++ dev-db/mariadb-connector-c/Manifest | 3 + ...riadb-connector-c-3.1.3-fix-pkconfig-file.patch | 21 + .../mariadb-connector-c-3.1.3.ebuild | 86 ++ dev-db/mariadb/Manifest | 12 +- .../files/MDEV-20247-replication-10.2.patch | 108 ++ dev-db/mariadb/files/MDEV-20247-replication.patch | 121 +++ dev-db/mariadb/mariadb-10.1.41-r1.ebuild | 898 ++++++++++++++++ dev-db/mariadb/mariadb-10.1.41.ebuild | 892 ---------------- dev-db/mariadb/mariadb-10.2.26-r1.ebuild | 981 +++++++++++++++++ dev-db/mariadb/mariadb-10.2.26.ebuild | 975 ----------------- dev-db/mariadb/mariadb-10.3.17-r1.ebuild | 982 +++++++++++++++++ dev-db/mariadb/mariadb-10.3.17.ebuild | 976 ----------------- dev-db/mariadb/mariadb-10.4.7-r1.ebuild | 1010 ++++++++++++++++++ dev-db/mariadb/mariadb-10.4.7.ebuild | 998 ------------------ dev-db/mariadb/mariadb-5.5.65.ebuild | 5 + dev-db/mongodb/Manifest | 18 +- dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch | 35 - .../files/mongodb-3.4.6-sysmacros-include.patch | 38 - dev-db/mongodb/mongodb-3.4.16.ebuild | 160 --- dev-db/mongodb/mongodb-3.6.11.ebuild | 164 --- dev-db/mongodb/mongodb-3.6.12.ebuild | 164 --- dev-db/mongodb/mongodb-3.6.13.ebuild | 2 +- dev-db/mongodb/mongodb-4.0.10.ebuild | 2 +- dev-db/mongodb/mongodb-4.0.12.ebuild | 164 +++ dev-db/mongodb/mongodb-4.0.6.ebuild | 164 --- dev-db/mongodb/mongodb-4.0.9.ebuild | 164 --- dev-db/myodbc/Manifest | 2 + dev-db/myodbc/myodbc-8.0.17.ebuild | 119 +++ dev-db/mysql-cluster/Manifest | 6 +- dev-db/mysql-cluster/mysql-cluster-7.2.34.ebuild | 10 +- dev-db/mysql-cluster/mysql-cluster-7.3.22.ebuild | 14 +- dev-db/mysql-cluster/mysql-cluster-7.4.21.ebuild | 14 +- dev-db/mysql-connector-c/Manifest | 4 +- .../mysql-connector-c-6.1.11-r2.ebuild | 2 +- .../mysql-connector-c-8.0.17-r1.ebuild | 17 +- dev-db/mysql-workbench/Manifest | 4 +- .../mysql-workbench/mysql-workbench-8.0.14.ebuild | 109 -- .../mysql-workbench/mysql-workbench-8.0.17.ebuild | 3 +- dev-db/mysql/Manifest | 16 +- dev-db/mysql/files/my.cnf-8.0.distro-client | 4 +- dev-db/mysql/files/my.cnf-8.0.distro-server | 6 +- dev-db/mysql/mysql-5.6.44-r1.ebuild | 838 +++++++++++++++ dev-db/mysql/mysql-5.6.44.ebuild | 800 -------------- dev-db/mysql/mysql-5.6.45-r1.ebuild | 843 +++++++++++++++ dev-db/mysql/mysql-5.6.45.ebuild | 806 -------------- dev-db/mysql/mysql-5.7.26.ebuild | 60 +- dev-db/mysql/mysql-5.7.27.ebuild | 61 +- dev-db/mysql/mysql-8.0.17.ebuild | 1104 ++++++++++++++++++++ dev-db/mysql/mysql-8.0.17_pre1.ebuild | 815 --------------- dev-db/pgbadger/Manifest | 2 - dev-db/pgbadger/pgbadger-10.0.ebuild | 21 - dev-db/pgpool2/Manifest | 6 - dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch | 268 ----- dev-db/pgpool2/files/pgpool_run_paths-9999.patch | 274 ----- dev-db/pgpool2/pgpool2-3.7.8.ebuild | 104 -- dev-db/pgpool2/pgpool2-4.0.3.ebuild | 104 -- dev-db/pgrouting/Manifest | 1 + dev-db/pgrouting/pgrouting-2.6.2-r1.ebuild | 61 ++ dev-db/postgis/Manifest | 6 + dev-db/postgis/postgis-2.4.8.ebuild | 125 +++ dev-db/postgis/postgis-2.5.3.ebuild | 123 +++ dev-db/postgis/postgis-3.0.0_alpha4.ebuild | 123 +++ dev-db/postgresql/Manifest | 12 + dev-db/postgresql/postgresql-10.10.ebuild | 466 +++++++++ dev-db/postgresql/postgresql-11.5.ebuild | 468 +++++++++ dev-db/postgresql/postgresql-12_beta3.ebuild | 467 +++++++++ dev-db/postgresql/postgresql-9.4.24.ebuild | 480 +++++++++ dev-db/postgresql/postgresql-9.5.19.ebuild | 486 +++++++++ dev-db/postgresql/postgresql-9.6.15.ebuild | 491 +++++++++ dev-db/pspg/Manifest | 4 +- dev-db/pspg/pspg-1.3.0.ebuild | 16 - dev-db/pspg/pspg-1.6.8.ebuild | 15 + dev-db/sqlite/Manifest | 16 +- .../files/sqlite-3.27.0-full_archive-build.patch | 461 -------- .../files/sqlite-3.27.2-full_archive-tests.patch | 36 - .../files/sqlite-3.29.0-full_archive-build.patch | 471 +++++++++ .../files/sqlite-3.29.0-full_archive-tests.patch | 121 +++ dev-db/sqlite/metadata.xml | 4 - dev-db/sqlite/sqlite-3.27.2.ebuild | 328 ------ dev-db/sqlite/sqlite-3.28.0.ebuild | 2 +- dev-db/sqlite/sqlite-3.29.0.ebuild | 395 +++++++ 94 files changed, 12530 insertions(+), 9317 deletions(-) create mode 100644 dev-db/clickhouse/clickhouse-19.13.1.11-r1.ebuild create mode 100644 dev-db/clickhouse/clickhouse-19.13.1.11.ebuild create mode 100644 dev-db/clickhouse/files/clickhouse-server.confd create mode 100644 dev-db/clickhouse/files/clickhouse-server.initd-r1 delete mode 100644 dev-db/etcd/etcd-3.3.12.ebuild create mode 100644 dev-db/etcd/etcd-3.3.14.ebuild delete mode 100644 dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch delete mode 100644 dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild create mode 100644 dev-db/firebird/firebird-3.0.4.33054.0.ebuild create mode 100644 dev-db/mariadb-connector-c/files/mariadb-connector-c-3.1.3-fix-pkconfig-file.patch create mode 100644 dev-db/mariadb-connector-c/mariadb-connector-c-3.1.3.ebuild create mode 100644 dev-db/mariadb/files/MDEV-20247-replication-10.2.patch create mode 100644 dev-db/mariadb/files/MDEV-20247-replication.patch create mode 100644 dev-db/mariadb/mariadb-10.1.41-r1.ebuild delete mode 100644 dev-db/mariadb/mariadb-10.1.41.ebuild create mode 100644 dev-db/mariadb/mariadb-10.2.26-r1.ebuild delete mode 100644 dev-db/mariadb/mariadb-10.2.26.ebuild create mode 100644 dev-db/mariadb/mariadb-10.3.17-r1.ebuild delete mode 100644 dev-db/mariadb/mariadb-10.3.17.ebuild create mode 100644 dev-db/mariadb/mariadb-10.4.7-r1.ebuild delete mode 100644 dev-db/mariadb/mariadb-10.4.7.ebuild delete mode 100644 dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch delete mode 100644 dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch delete mode 100644 dev-db/mongodb/mongodb-3.4.16.ebuild delete mode 100644 dev-db/mongodb/mongodb-3.6.11.ebuild delete mode 100644 dev-db/mongodb/mongodb-3.6.12.ebuild create mode 100644 dev-db/mongodb/mongodb-4.0.12.ebuild delete mode 100644 dev-db/mongodb/mongodb-4.0.6.ebuild delete mode 100644 dev-db/mongodb/mongodb-4.0.9.ebuild create mode 100644 dev-db/myodbc/myodbc-8.0.17.ebuild delete mode 100644 dev-db/mysql-workbench/mysql-workbench-8.0.14.ebuild create mode 100644 dev-db/mysql/mysql-5.6.44-r1.ebuild delete mode 100644 dev-db/mysql/mysql-5.6.44.ebuild create mode 100644 dev-db/mysql/mysql-5.6.45-r1.ebuild delete mode 100644 dev-db/mysql/mysql-5.6.45.ebuild create mode 100644 dev-db/mysql/mysql-8.0.17.ebuild delete mode 100644 dev-db/mysql/mysql-8.0.17_pre1.ebuild delete mode 100644 dev-db/pgbadger/pgbadger-10.0.ebuild delete mode 100644 dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch delete mode 100644 dev-db/pgpool2/files/pgpool_run_paths-9999.patch delete mode 100644 dev-db/pgpool2/pgpool2-3.7.8.ebuild delete mode 100644 dev-db/pgpool2/pgpool2-4.0.3.ebuild create mode 100644 dev-db/pgrouting/pgrouting-2.6.2-r1.ebuild create mode 100644 dev-db/postgis/postgis-2.4.8.ebuild create mode 100644 dev-db/postgis/postgis-2.5.3.ebuild create mode 100644 dev-db/postgis/postgis-3.0.0_alpha4.ebuild create mode 100644 dev-db/postgresql/postgresql-10.10.ebuild create mode 100644 dev-db/postgresql/postgresql-11.5.ebuild create mode 100644 dev-db/postgresql/postgresql-12_beta3.ebuild create mode 100644 dev-db/postgresql/postgresql-9.4.24.ebuild create mode 100644 dev-db/postgresql/postgresql-9.5.19.ebuild create mode 100644 dev-db/postgresql/postgresql-9.6.15.ebuild delete mode 100644 dev-db/pspg/pspg-1.3.0.ebuild create mode 100644 dev-db/pspg/pspg-1.6.8.ebuild delete mode 100644 dev-db/sqlite/files/sqlite-3.27.0-full_archive-build.patch delete mode 100644 dev-db/sqlite/files/sqlite-3.27.2-full_archive-tests.patch create mode 100644 dev-db/sqlite/files/sqlite-3.29.0-full_archive-build.patch create mode 100644 dev-db/sqlite/files/sqlite-3.29.0-full_archive-tests.patch delete mode 100644 dev-db/sqlite/sqlite-3.27.2.ebuild create mode 100644 dev-db/sqlite/sqlite-3.29.0.ebuild (limited to 'dev-db') diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz index e3ca1d685ba9..69313efe7104 100644 Binary files a/dev-db/Manifest.gz and b/dev-db/Manifest.gz differ diff --git a/dev-db/clickhouse/Manifest b/dev-db/clickhouse/Manifest index 065c44bd786f..02eff11f0324 100644 --- a/dev-db/clickhouse/Manifest +++ b/dev-db/clickhouse/Manifest @@ -1,14 +1,19 @@ +AUX clickhouse-server.confd 74 BLAKE2B ccb1d957ce0ec20a65968bb1fe24d756d3f0d73bb0b2bec5b1de7913fdac71fcc04eef0e7d0ca7708b87cccb4ef08b4d5ec2ab514c24c1f39862dc1aced77725 SHA512 3f89e1d592d46c8173df42835c5c9ee541e6fc01eb4448f3351517110650fac3144a6da066f2ebf01bda9a004a972e47dc6c48967f914e541dfe26fb0637cd5c AUX clickhouse-server.initd 445 BLAKE2B 166b867de3ad86f814cfbbdfa86a9328a3a54a88438e628f790cc6be1e0eee272effa06db37bdb0d31a41ac1551321b5a756bbfe3a9a8381e327e12515253da1 SHA512 98d396709899a428012fb8f01fbd861359913e12d765924a6a20e5f5cf0da73a2c8b0561a061d4c581443259605841f55fa33ee881f8eb764d6d2446dd4bf849 +AUX clickhouse-server.initd-r1 552 BLAKE2B 39a75038f2cce6c09623b0c90b87a7536995da05fdedbc261e4a92e4add8bfdfb46c59856f9d0df8b49d115b3ea52e684827037c3da40a8fc02948ff47edcde6 SHA512 40324e870c8d0d2bb62acc78bf2c08be9cc0e64e94d00538d41961fb53d2df45f3d811b75c81a0b3e12ee17d99d2b9c0cbca623f7e1ffe5eadf3674bafb97832 AUX clickhouse-server.service 307 BLAKE2B 1f443f68db97408cb2b0a8e9007195cdc5d6e29f54e55b3bd2b023cfbcb9d3ee4c1083503f83a42cfd18bca3320dfa86571434fe89612fb0a1f5a9e178eb706b SHA512 185db8aed69b178540225fa41f623a78af09e30d2dd1e033baf4d7c80451e702f5d6b9ce5240f7f6fb6d63a4ebed5af4d483515c7e6fe019e7fd44334df4ab37 DIST cctz-4f9776a.tar.gz 290009 BLAKE2B 532eb7d590f9814c05cc7fdd3c75efe0a6b3f81d85201b14163a9600dd858c4fbac592270d0afccd7d5eef0080d7e70e9d716023bdb60d55479585e2cd3d3f59 SHA512 ba0dfc404cc70f03ef2be29fa3b0c70ea881c92a92525ea4ba1b5bcfc9e45df1b62a5eec180f498293e64bdd5cb9b41f97361cbb7e8baf299dcfdcd1557ca205 DIST clickhouse-18.10.3.tar.gz 6136661 BLAKE2B 5564bbe85f4ca43f18df702148af0e4e5b5a8826994d90f29beb3a37cdbeb36f9d3ec77d9c7bc6f843e7586e5441aeb0937548eb5eb61d27cecc5790d8c21a5b SHA512 c78386922388cf910a995b569724eb22fc41ab60e765a4d3644c4a48d8b9a67ef28b7e375186b2eb00c43b4f06e90783084f4ac4d3789f1b6e4251ee30e8833c DIST clickhouse-18.12.17.tar.gz 6495521 BLAKE2B 00dfb823b9e36923beb50a88bee88af3918bedc7b20079785699a42e36e52f32739f786bd78c5b350f58ae59251e3846da6202d04e24e9a750c92e16065cc395 SHA512 876c5fb6011c65b8ec201126678dad6f5de3430b7d320316ced5c6d22e8086ce337d20b73badbd053bf141097b8fe6cd94910ed607b4bbedb681cfa7921d1fb6 DIST clickhouse-18.6.0.tar.gz 5852534 BLAKE2B 5634fd26907b21d4a35cff3ed816696205be4aff1cdd1acfe222e24214b1842eb18a4e499e888b0d92b78f5c3023c2962a385af2c0ea889055e473dfa0198bf5 SHA512 e8ea2d4457122513cad47b1cdb2a58dd2ffaec77a7a08bf82179aca12a369d39970520a995bb5db2e5ea4b0939da827b7d4b1f3929cf71c149c965438ebb3633 +DIST clickhouse-19.13.1.11.zip 11502726 BLAKE2B c2788702a2c27c995abc072a94f3945ed6f9039fe0c7840312a86987faf52d2f7801d531e89a02848fa8ee1319247c41de0f3ad0c0cb51c1df1dbcfca3bd3b0a SHA512 095a0e63eff6989ea1f70fac593069e1cdb6ea207a99d8cfd610c4eb8f3f7411a784d9f100c9fc899898e68dd88dd54bec3c136764793c8cae986d920a651f8c DIST clickhouse-19.5.3.8.zip 11247905 BLAKE2B f72289f55bddf9b3ad2e16a4d1fc6e4f7681477e742eda3694c3c16975820c93affc01c70b194c5992226d79bee714f706c04402c62bd0ed3d1701a16fb22192 SHA512 f578abbd43c3ccf721e079ce2bafac22be0c5d619388be192c59a2053ae1cf1e7f0a025e0323f0f8f004f879990a88c0ca0cd4d135606de51c576619fe0172b8 DIST clickhouse-19.9.5.36.zip 11708002 BLAKE2B 075f9b1556c5ee207a608047fa559cec7a0b1f044236e412189ae6dabe25aa04abf881726e4ffa17d4aad6937250c704f050935e61470994b57eaa1ac9ea07e4 SHA512 b0aa04a1c0f7c15316c83a2711f9b64f8235e664956f933530a9f2dc26fcb8b817adb8ca43c96db1cad498e06f4291ce13c0bb259726039c5caa52ae523fa4ab EBUILD clickhouse-18.10.3.ebuild 4915 BLAKE2B 3f6f0f1cea60a283b325b80100fc56ffcb548e6af01240a12a5f6a6aad521977c63e8918d3742c52c0fef2d5c79144f6a1f9cb95749a6c140cb16548af432f4a SHA512 0ecc73385521a4d916e8834d22e05a8be07fb0b2d6a4bcc3350dfab100717839835e4a47a17d87f50f98acbf420b077dc7f9db800e3456915dc2ed81fc0197ba EBUILD clickhouse-18.12.17.ebuild 4912 BLAKE2B 71e1d446bc95be176c6946d18162b78f0ae0e936be2caedd9ee7b0df958daf8423ffce528c27c90607568f5bf3b391092ef264c7d1439506ab89f6fded52bb6b SHA512 6ac5f2e640ad5e6536a38a9693df2b31706f9d777f53213971ef848160886d16b6cc0a7f900ce587e53b1cdba3edcdd37541b4e639aa65662f9e0a26f9501fc5 EBUILD clickhouse-18.6.0.ebuild 4903 BLAKE2B d363915e46bfe1489e07f9ae9b07a39c146603af9496ab98371b053241566e02c7b85cf64a985ef8958e83a8741ac20583917e8268cec80702e4d37e69d8e110 SHA512 443eb0cd7f343eaff895dfbcb6a98abc4b2734495e2abd9c9f51e613fc2ac8698797bb5f780178c86bc0d8621cfe0b976470c7c4b9ec0bd337fa0599f0d01848 +EBUILD clickhouse-19.13.1.11-r1.ebuild 5144 BLAKE2B 77f5416736145c44a1968ebb74968fe59b807c46dfb4104e73544a554f49a3d4ae34b494290c5beca798c32096014e63fac9940790f9ed3b9c4a4d7b59b09489 SHA512 9aff8448125ad6b1dad555289f1a345b9fbbcb2e7c1594ac680bcfb4274030149c52786cd1b58c620329ec587a683258d9dfd3aca111d1d04c7bdd3a36b309c9 +EBUILD clickhouse-19.13.1.11.ebuild 5054 BLAKE2B 43ae8340ed6038c6ea92c44d4dbd27183feaea2f96ce0c563a2163ce2a3c8e0a851dab3f3a813fa83404fbc008bc84a8c905581756529e4f269b155c6d4d2e76 SHA512 092c727a4dd9a7a9ce0cac0032988e01d29d641674a5f47a0dc77eb4d99090c45925dca4aa304646cc89ceb0017463bbf93d4711683030ced0a18d3e4f04246e EBUILD clickhouse-19.5.3.8.ebuild 5035 BLAKE2B 5af2ff21963b567b2f1f1600a046e90c885a17aeb2b4244a3d60b15b96d25fb268330de602db576ea3809785be984e2f511d63b17776e369f1798549398148ce SHA512 5642771484458e8fc390a259af958598972207706ed3f78247fbd91e242bcf79052be58fc49b50f6d44765fc1932f6731ff45b17244b6919daa69a44ea83023c EBUILD clickhouse-19.9.5.36.ebuild 5035 BLAKE2B 5af2ff21963b567b2f1f1600a046e90c885a17aeb2b4244a3d60b15b96d25fb268330de602db576ea3809785be984e2f511d63b17776e369f1798549398148ce SHA512 5642771484458e8fc390a259af958598972207706ed3f78247fbd91e242bcf79052be58fc49b50f6d44765fc1932f6731ff45b17244b6919daa69a44ea83023c MISC metadata.xml 738 BLAKE2B 861f40f506964d64cf646f043406945dc54950f48e27d4eb28b6fc0f96bf0ceb093520a0b60d813460fbe8b99ba4858f0a49d30abcb25567f44411c78a02f6e7 SHA512 6d87cc967c081b5a5e60136f5928d7b17c65c3a1c26aa1e45a50e74d5383bb665682a8b0cb5cce0496bebcac1f5e27aace8a8373253c031acc3c166c382e0056 diff --git a/dev-db/clickhouse/clickhouse-19.13.1.11-r1.ebuild b/dev-db/clickhouse/clickhouse-19.13.1.11-r1.ebuild new file mode 100644 index 000000000000..a2fbc773fa76 --- /dev/null +++ b/dev-db/clickhouse/clickhouse-19.13.1.11-r1.ebuild @@ -0,0 +1,205 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +CMAKE_MAKEFILE_GENERATOR="ninja" + +inherit cmake-utils systemd toolchain-funcs user + +DESCRIPTION="An OSS column-oriented database management system for real-time data analysis" +HOMEPAGE="https://clickhouse.yandex" +LICENSE="Apache-2.0" + +MY_PN="ClickHouse" +TYPE="stable" + +CCTZ_COMMIT="4f9776a" +SRC_URI="https://github.com/yandex/${MY_PN}/archive/v${PV}-${TYPE}.zip -> ${P}.zip + https://github.com/google/cctz/archive/${CCTZ_COMMIT}.tar.gz -> cctz-${CCTZ_COMMIT}.tar.gz +" + +SLOT="0/${TYPE}" +IUSE="+client cpu_flags_x86_sse4_2 +server debug doc kafka mongodb mysql static test tools" +KEYWORDS="~amd64" + +REQUIRED_USE=" + server? ( cpu_flags_x86_sse4_2 ) + static? ( client server tools ) +" + +RDEPEND=" + dev-libs/re2:0= + !static? ( + >=app-arch/lz4-1.8.0:= + >=app-arch/zstd-1.3.4:= + client? ( + sys-libs/ncurses:0= + sys-libs/readline:0= + ) + + dev-libs/double-conversion + dev-libs/capnproto + dev-libs/libltdl:0 + sys-libs/libunwind:7 + sys-libs/zlib + dev-libs/poco[odbc] + dev-libs/icu:= + dev-libs/glib + >=dev-libs/boost-1.65.0:= + dev-libs/openssl:0= + kafka? ( dev-libs/librdkafka:= ) + mysql? ( virtual/libmysqlclient ) + ) + + >=dev-libs/poco-1.9.0 + dev-libs/libpcre + dev-libs/jemalloc + dev-libs/protobuf +" + +DEPEND="${RDEPEND} + doc? ( >=dev-python/mkdocs-1.0.1 ) + static? ( + >=app-arch/lz4-1.8.0[static-libs] + >=app-arch/zstd-1.3.4[static-libs] + client? ( + sys-libs/ncurses:0=[static-libs] + sys-libs/readline:0=[static-libs] + ) + dev-libs/double-conversion[static-libs] + dev-libs/capnproto[static-libs] + dev-libs/libltdl[static-libs] + sys-libs/libunwind:7[static-libs] + sys-libs/zlib[static-libs] + || ( + dev-db/unixODBC[static-libs] + dev-libs/poco[odbc] + ) + dev-libs/icu[static-libs] + dev-libs/glib[static-libs] + >=dev-libs/boost-1.65.0[static-libs] + dev-libs/openssl[static-libs] + virtual/libmysqlclient[static-libs] + kafka? ( dev-libs/librdkafka[static-libs] ) + ) + =dev-cpp/gtest-1.8* + sys-libs/libtermcap-compat + dev-util/patchelf + >=sys-devel/lld-6.0.0 + >=sys-devel/gcc-7.0 + >=sys-devel/clang-6.0 +" + +S="${WORKDIR}/${MY_PN}-${PV}-${TYPE}" + +_clang_fullversion() { + local ver="$1"; shift + set -- $($(tc-getCPP "$@") -E -P - <<<"__clang_major__ __clang_minor__ __clang_patchlevel__") + eval echo "$ver" +} + +clang-fullversion() { + _clang_fullversion '$1.$2.$3' "$@" +} + +clang-version() { + _clang_fullversion '$1.$2' "$@" +} + +clang-major-version() { + _clang_fullversion '$1' "$@" +} + +clang-minor-version() { + _clang_fullversion '$2' "$@" +} + +clang-micro-version() { + _clang_fullversion '$3' "$@" +} + +pkg_pretend() { + if [[ $(tc-getCC) == clang ]]; then + if [[ $(clang-major-version) -lt 6 ]]; then + eerror "Compilation with clang older than 6.0 is not supported" + die "Too old clang found" + fi + : + elif [[ $(gcc-major-version) -lt 7 ]] && [[$(gcc-minor-version) -lt 2 ]]; then + eerror "Compilation with gcc older than 7.2 is not supported" + die "Too old gcc found" + fi +} + +src_unpack() { + default_src_unpack + [[ ${PV} == 9999 ]] && return 0 + cd "${S}/contrib" || die "failed to cd to contrib" + mkdir -p cctz zstd || die "failed to create directories" + tar --strip-components=1 -C cctz -xf "${DISTDIR}/cctz-${CCTZ_COMMIT}.tar.gz" || die "failed to unpack cctz" +} + +src_prepare() { + eapply_user + cmake-utils_src_prepare +} +src_configure() { + local mycmakeargs=( + -DENABLE_POCO_MONGODB="$(usex mongodb)" + -DENABLE_RDKAFKA="$(usex kafka)" + -DENABLE_TESTS="$(usex test)" + -DUSE_STATIC_LIBRARIES="$(usex static)" + -DMAKE_STATIC_LIBRARIES="$(usex static)" + -DUSE_MYSQL="$(usex mysql)" + -DENABLE_CLICKHOUSE_SERVER="$(usex server)" + -DENABLE_CLICKHOUSE_CLIENT="$(usex client)" + -DENABLE_CLICKHOUSE_LOCAL="$(usex tools)" + -DENABLE_CLICKHOUSE_BENCHMARK="$(usex tools)" + -DENABLE_CLICKHOUSE_PERFORMANCE="$(usex tools)" + -DENABLE_CLICKHOUSE_EXTRACT_FROM_CONFIG="$(usex tools)" + -DENABLE_CLICKHOUSE_COMPRESSOR="$(usex tools)" + -DENABLE_CLICKHOUSE_COPIER="$(usex tools)" + # As of now, clickhouse fails to build if odbc is disabled + -DENABLE_ODBC=True + -DENABLE_CLICKHOUSE_ODBC_BRIDGE=True + -DENABLE_CLICKHOUSE_ALL=OFF + -DUSE_INTERNAL_SSL_LIBRARY=False + -DUSE_INTERNAL_CITYHASH_LIBRARY=ON # Clickhouse explicitly requires bundled patched cityhash + -DUNBUNDLED=ON + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + + if ! use test; then + rm -rf "${D}/usr/share/clickhouse-test" || die "failed to remove tests" + fi + + if use doc; then + pushd "${S}/docs/tools" || die "Failed to enter docs build directory" + ./build.py || die "Failed to build docs" + popd || die "Failed to exit docs build directory" + + dodoc -r "${S}/docs/build" + fi + + if use server; then + newinitd "${FILESDIR}"/clickhouse-server.initd-r1 clickhouse-server + newconfd "${FILESDIR}"/clickhouse-server.confd clickhouse-server + systemd_dounit "${FILESDIR}"/clickhouse-server.service + fi + + keepdir /var/log/clickhouse-server + chown clickhouse:clickhouse "${D}"/var/log/clickhouse-server +} + +pkg_preinst() { + if use server; then + enewgroup clickhouse + enewuser clickhouse -1 -1 /var/lib/clickhouse clickhouse + fi +} diff --git a/dev-db/clickhouse/clickhouse-19.13.1.11.ebuild b/dev-db/clickhouse/clickhouse-19.13.1.11.ebuild new file mode 100644 index 000000000000..bbf65016a543 --- /dev/null +++ b/dev-db/clickhouse/clickhouse-19.13.1.11.ebuild @@ -0,0 +1,204 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +CMAKE_MAKEFILE_GENERATOR="ninja" + +inherit cmake-utils systemd toolchain-funcs user + +DESCRIPTION="An OSS column-oriented database management system for real-time data analysis" +HOMEPAGE="https://clickhouse.yandex" +LICENSE="Apache-2.0" + +MY_PN="ClickHouse" +TYPE="stable" + +CCTZ_COMMIT="4f9776a" +SRC_URI="https://github.com/yandex/${MY_PN}/archive/v${PV}-${TYPE}.zip -> ${P}.zip + https://github.com/google/cctz/archive/${CCTZ_COMMIT}.tar.gz -> cctz-${CCTZ_COMMIT}.tar.gz +" + +SLOT="0/${TYPE}" +IUSE="+client cpu_flags_x86_sse4_2 +server debug doc kafka mongodb mysql static test tools" +KEYWORDS="~amd64" + +REQUIRED_USE=" + server? ( cpu_flags_x86_sse4_2 ) + static? ( client server tools ) +" + +RDEPEND=" + dev-libs/re2:0= + !static? ( + >=app-arch/lz4-1.8.0:= + >=app-arch/zstd-1.3.4:= + client? ( + sys-libs/ncurses:0= + sys-libs/readline:0= + ) + + dev-libs/double-conversion + dev-libs/capnproto + dev-libs/libltdl:0 + sys-libs/libunwind:7 + sys-libs/zlib + dev-libs/poco[odbc] + dev-libs/icu:= + dev-libs/glib + >=dev-libs/boost-1.65.0:= + dev-libs/openssl:0= + kafka? ( dev-libs/librdkafka:= ) + mysql? ( virtual/libmysqlclient ) + ) + + >=dev-libs/poco-1.9.0 + dev-libs/libpcre + dev-libs/jemalloc + dev-libs/protobuf +" + +DEPEND="${RDEPEND} + doc? ( >=dev-python/mkdocs-1.0.1 ) + static? ( + >=app-arch/lz4-1.8.0[static-libs] + >=app-arch/zstd-1.3.4[static-libs] + client? ( + sys-libs/ncurses:0=[static-libs] + sys-libs/readline:0=[static-libs] + ) + dev-libs/double-conversion[static-libs] + dev-libs/capnproto[static-libs] + dev-libs/libltdl[static-libs] + sys-libs/libunwind:7[static-libs] + sys-libs/zlib[static-libs] + || ( + dev-db/unixODBC[static-libs] + dev-libs/poco[odbc] + ) + dev-libs/icu[static-libs] + dev-libs/glib[static-libs] + >=dev-libs/boost-1.65.0[static-libs] + dev-libs/openssl[static-libs] + virtual/libmysqlclient[static-libs] + kafka? ( dev-libs/librdkafka[static-libs] ) + ) + + sys-libs/libtermcap-compat + dev-util/patchelf + >=sys-devel/lld-6.0.0 + >=sys-devel/gcc-7.0 + >=sys-devel/clang-6.0 +" + +S="${WORKDIR}/${MY_PN}-${PV}-${TYPE}" + +_clang_fullversion() { + local ver="$1"; shift + set -- $($(tc-getCPP "$@") -E -P - <<<"__clang_major__ __clang_minor__ __clang_patchlevel__") + eval echo "$ver" +} + +clang-fullversion() { + _clang_fullversion '$1.$2.$3' "$@" +} + +clang-version() { + _clang_fullversion '$1.$2' "$@" +} + +clang-major-version() { + _clang_fullversion '$1' "$@" +} + +clang-minor-version() { + _clang_fullversion '$2' "$@" +} + +clang-micro-version() { + _clang_fullversion '$3' "$@" +} + +pkg_pretend() { + if [[ $(tc-getCC) == clang ]]; then + if [[ $(clang-major-version) -lt 6 ]]; then + eerror "Compilation with clang older than 6.0 is not supported" + die "Too old clang found" + fi + : + elif [[ $(gcc-major-version) -lt 7 ]] && [[$(gcc-minor-version) -lt 2 ]]; then + eerror "Compilation with gcc older than 7.2 is not supported" + die "Too old gcc found" + fi +} + +src_unpack() { + default_src_unpack + [[ ${PV} == 9999 ]] && return 0 + cd "${S}/contrib" || die "failed to cd to contrib" + mkdir -p cctz zstd || die "failed to create directories" + tar --strip-components=1 -C cctz -xf "${DISTDIR}/cctz-${CCTZ_COMMIT}.tar.gz" || die "failed to unpack cctz" +} + +src_prepare() { + eapply_user + cmake-utils_src_prepare +} +src_configure() { + local mycmakeargs=( + -DENABLE_POCO_MONGODB="$(usex mongodb)" + -DENABLE_RDKAFKA="$(usex kafka)" + -DENABLE_TESTS="$(usex test)" + -DUSE_STATIC_LIBRARIES="$(usex static)" + -DMAKE_STATIC_LIBRARIES="$(usex static)" + -DUSE_MYSQL="$(usex mysql)" + -DENABLE_CLICKHOUSE_SERVER="$(usex server)" + -DENABLE_CLICKHOUSE_CLIENT="$(usex client)" + -DENABLE_CLICKHOUSE_LOCAL="$(usex tools)" + -DENABLE_CLICKHOUSE_BENCHMARK="$(usex tools)" + -DENABLE_CLICKHOUSE_PERFORMANCE="$(usex tools)" + -DENABLE_CLICKHOUSE_EXTRACT_FROM_CONFIG="$(usex tools)" + -DENABLE_CLICKHOUSE_COMPRESSOR="$(usex tools)" + -DENABLE_CLICKHOUSE_COPIER="$(usex tools)" + # As of now, clickhouse fails to build if odbc is disabled + -DENABLE_ODBC=True + -DENABLE_CLICKHOUSE_ODBC_BRIDGE=True + -DENABLE_CLICKHOUSE_ALL=OFF + -DUSE_INTERNAL_SSL_LIBRARY=False + -DUSE_INTERNAL_CITYHASH_LIBRARY=ON # Clickhouse explicitly requires bundled patched cityhash + -DUNBUNDLED=ON + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + + if ! use test; then + rm -rf "${D}/usr/share/clickhouse-test" || die "failed to remove tests" + fi + + if use doc; then + pushd "${S}/docs/tools" || die "Failed to enter docs build directory" + ./build.py || die "Failed to build docs" + popd || die "Failed to exit docs build directory" + + dodoc -r "${S}/docs/build" + fi + + if use server; then + newinitd "${FILESDIR}"/clickhouse-server.initd clickhouse-server + systemd_dounit "${FILESDIR}"/clickhouse-server.service + fi + + keepdir /var/log/clickhouse-server + chown clickhouse:clickhouse "${D}"/var/log/clickhouse-server +} + +pkg_preinst() { + if use server; then + enewgroup clickhouse + enewuser clickhouse -1 -1 /var/lib/clickhouse clickhouse + fi +} diff --git a/dev-db/clickhouse/files/clickhouse-server.confd b/dev-db/clickhouse/files/clickhouse-server.confd new file mode 100644 index 000000000000..0e7344672b4b --- /dev/null +++ b/dev-db/clickhouse/files/clickhouse-server.confd @@ -0,0 +1,4 @@ +user="clickhouse" +group="clickhouse" +logdir="/var/log/clickhouse-server" + diff --git a/dev-db/clickhouse/files/clickhouse-server.initd-r1 b/dev-db/clickhouse/files/clickhouse-server.initd-r1 new file mode 100644 index 000000000000..efc11f5e54c0 --- /dev/null +++ b/dev-db/clickhouse/files/clickhouse-server.initd-r1 @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +user="clickhouse" +group="clickhouse" +logdir="/var/log/clickhouse-server" +pidfile="/run/clickhouse-server.pid" +command_background=1 +command="/usr/bin/clickhouse-server" +start_stop_daemon_args="--user ${user} --group ${group} \ + --chdir /etc/clickhouse-server \ + -1 ${logdir}/stdout.log \ + -2 ${logdir}/stderr.log" + +depend() { + need net + after mongodb +} + +start_pre() { + checkpath -m 0755 -o "${user}:${group}" -d "${logdir}" +} diff --git a/dev-db/etcd/Manifest b/dev-db/etcd/Manifest index 937485f6d9a1..eea595fde91e 100644 --- a/dev-db/etcd/Manifest +++ b/dev-db/etcd/Manifest @@ -4,8 +4,8 @@ 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.12.tar.gz 3527586 BLAKE2B fdc4e3e9522c032d951045d4eda7f36743d4fbbb4ea8673bbe00bb38931cd7442910b0b54eeb6df0957439332df498389f3568ba7e8bdecfbd873fecfb3df86f SHA512 63ba6130bd93471260b8d90760455bccef2755e672a9df39224491188c69e4e3e8c1157cfb639c4002fb8a6d16950f7ff448a83e0acbc389162b742f3df6234f DIST etcd-3.3.13.tar.gz 3372732 BLAKE2B 241dee0d9843eefc9aaefb35be8f649d242ab1417456cc3028c8eb2ff2af6a7a1c396f04029d87877d384247b8c7a51ec6ea2e0dd51af07ce48ecc91c613c380 SHA512 5b8cf9d8d8b0afd1551f414480f04837668729c10d5d81c5e9ffba3392bd2567f3798267c5e4dbe60f49dbdd859f668c6fe0d7924e0fd65f918ab3bd01d5751a -EBUILD etcd-3.3.12.ebuild 1990 BLAKE2B 2eb11877c42e9c053df32b573f9abd6f52dd9f2da655c5cc127c7dacd872f832d9a76c3adb717cc6813ae20336c0cf8dd94378f66cf788f4b75cf689bf1cdf07 SHA512 caa9fca22332a54e8027bfdb3d7fa0e1f9f6aaede15833c9487c7c114e9805734209db94148c4cae61968d2987505f9ce8b27bbcc59411727e1a8228be5db2ee +DIST etcd-3.3.14.tar.gz 6342437 BLAKE2B 4bcf27829045e2f2f34c7628d6ed854a7ef5e6db02bd794d1135bb901486d8f3c1bf598c230fe7491e9db7273d3e5aa83bf4c941476ad3093423c14f377513b2 SHA512 76c8147168030310f0e4fa0c22670fd73369795ab6d98c0632c87b5947acf10af4adae58b46f042a482dc7a002044cfbdfbec962517018e2fdf211c381281dae EBUILD etcd-3.3.13.ebuild 1990 BLAKE2B 0dcfa21fd148dd9cfc7899a6432f3df5cfa0c678b39291bd4cc8c371e32932bf9d0f2fe97355572a621280c1200dfa3a9733be3f4fd2cebadf06f9e1fe06e435 SHA512 582ea4605eec3d812df40be5dffabc7c62be3652948f8d3dfae6f0c8553f507ce1ce6e135aa5b1b0c0c5fb52c970140a19c50cfd73bb905773ef17db9143c129 +EBUILD etcd-3.3.14.ebuild 2006 BLAKE2B 7e2c00213dd64e2ab82d7b94e606f7a258fa7d60c8a55b1f7a842f67c902d904e85959e81e457a2b43e06a6beb37ebdc07ca92b978eda8cea844a5555a12dcbb SHA512 58a239758efb92c53d5abd32ea49453e6d4ad4f606e660d3011c5ff7e7f26a42f533b6198360fec980d99bc3199da0febdda9d044dc5d3797be4e680785b5609 MISC metadata.xml 679 BLAKE2B 7374379a18107011df792be631428834334ad8e6da5cfe404f18555e8c168d3fc716a1c8d6cb5cf1d9ccd173737aecf93a165f846865dbb6ba4a76bd4669b446 SHA512 8070d8b51dd3319e8b159072db237dcc5299361c2f74fa086fc4cbc174cc6a5c8f7659310332b54b2275e2bc3d028323c4dfa5775e21693a339f54312582d2f0 diff --git a/dev-db/etcd/etcd-3.3.12.ebuild b/dev-db/etcd/etcd-3.3.12.ebuild deleted file mode 100644 index e72773ec30c6..000000000000 --- a/dev-db/etcd/etcd-3.3.12.ebuild +++ /dev/null @@ -1,78 +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="d57e8b8" -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 -n GOCACHE XDG_CACHE_HOME #651934 - 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.14.ebuild b/dev-db/etcd/etcd-3.3.14.ebuild new file mode 100644 index 000000000000..4124cf6b9401 --- /dev/null +++ b/dev-db/etcd/etcd-3.3.14.ebuild @@ -0,0 +1,78 @@ +# 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="5cf5d88" +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.12:=" +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 -n GOCACHE XDG_CACHE_HOME #651934 + 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 + GO111MODULES=on ./test || die + popd || die +} diff --git a/dev-db/firebird/Manifest b/dev-db/firebird/Manifest index 2e956af20077..0cd3cb456b0b 100644 --- a/dev-db/firebird/Manifest +++ b/dev-db/firebird/Manifest @@ -1,10 +1,9 @@ AUX firebird-3.0.2.32703.0-cloop-compiler.patch 349 BLAKE2B 6906993819f5aa68c39522d82bb7fb57b910f8f311d173a326147a98e983d8cd95ca90dbb538a5caa696ce4337305ece744306bf88f608cc8639bdda198e4576 SHA512 1d57f26ada2023d8bd04d73dd0f55951cef6b373710c8cf73b6bea0b4d54f879d689644d26541b2366bd1071b08eda2e1b531f3779a88b8fb52d3c9312f0c091 -AUX firebird-3.0.2.32703.0-gcc6.patch 806 BLAKE2B 85109e33f130582110e37188ef99cec5e5f0f3f95c481580df3a8c8a97215cd8e070e3febe47e46659e025b8a0c138fd0b271a5fd4b4aa67ca52419cef88db04 SHA512 184f754c4c23b7917acfabf1a5024069b8f35f58e667112a203a02e906560f2f5fea711b12975dafb3adcbe5159999e40fa459898a41d88e6de9b3499d8eaa67 AUX firebird-3.0.2.32703.0-unbundle.patch 1786 BLAKE2B 660af04975ecfdac0ae12a1ee89e0a4d97d321ac7de7e17ba53484a909962584828c18d1f119ecc1af63c1cb2b93f451b847c9363a25831630a807b89ad13bc8 SHA512 bb0f8cb283ee230f9128a9da16da21933a1709615b34bbfac117a0563e2451a07381b52ffc1fed665e74688ff8e2c2548f86c1413427665914cb3df8500543c5 AUX firebird.init.d.3.0 642 BLAKE2B 70f9b07a69c01e391ea8b1f1747a35eb303ff43a4923d65f76064257bfe5178601fa0b06dbf332b6a3529df30ddbe3e3c58e170ca33acfeb06a32474f1806938 SHA512 0805311d7e4ceb9cd5266be88fe61fb7d2d7cf5bf3c9482841c6431767cba9960d4f38418629519b23cdf64893173ebd01641056123ddc7f24c1f1bbf969812b AUX firebird.logrotate 169 BLAKE2B e73e2ff85882cda144f969a9a20426f2e5bfbaf2ce894e4e7adf67a33eb4cb5f1bc2039385437dcc60436145b0d29bd1b9311d8328f68ad7870aea50b8e5402d SHA512 f99edc010272af28f18e2b89e420aabc204feda918a1181e477edb56612b6af97ca6bab2e39989db401eb8296e3233a64853f824af437329e117f09aa9868823 AUX firebird.xinetd.3.0 193 BLAKE2B 34017b978344bc2b05cfe7b92eafd56ba20dd78d1fa21dfb5455d7972325cedae9a6ac25b4fa491899b19cb3bbe2949b8ca78626467100661767f6c944b01c20 SHA512 e02c011b55c1d6823b051d14dbfabef6d034db32ee8046adc796fdf393c837b995c270e0efdcb97950f6fead82cd73773099a247dc29961b0e8f6c4f6c0723ae -DIST Firebird-3.0.2.32703-0.tar.bz2 9536416 BLAKE2B 58afbdb430adb5f9aafe33d5459fb4fe8607e9440b6b114291777e43d447a7a5b5696c9f5903a10b63217a15836ce6386569e636369e37bf83195ec0b96e4fc6 SHA512 5950d1689c77fbcda22f1bd8015321d887dec3c7ef39665428a8bda9122838e767b168442ce7d8fb3b9b80cbd1206725b0f54bd215c5c9eb1d322b546cb042e6 +DIST Firebird-3.0.4.33054-0.tar.bz2 9778106 BLAKE2B 4b9116cbc351e0c2e10d15e6ea8e9754a383da77d8e016337604143eb2677ff2519da34b1a5c2e9b7b071fa9774eddbb535e9f926058ee626573b0411f6c042d SHA512 a346ebd53aeccf0b33eac5d35c3c3356624c1fbd0ad897173b3f68d940143062b28460a2822df807e8e8a1ea8792ebf98ed33e5b3ae273d86e6e36295a7fc8ad DIST ib_b60_doc.zip 10530848 BLAKE2B b4008b3e8b0416014d024cbbc9ac2e648ad671c71b91b7aeb0eedf0f8479aef80e22aff7105c5e7417e88bcf57f2cdacbc2d5f51a2ef7fb870f9d361c5f0ed6d SHA512 59eccf1d6b1f0410eddbc5967fd77a3d00e09749640b3f81e2f8b624f5a45461dffad4af5ec61488e941fb3d3af266fe86c0b56e6b7e023239537cb6557a145a -EBUILD firebird-3.0.2.32703.0-r2.ebuild 6156 BLAKE2B 7894504d0d0b888a7c735538e6e262b3e0bde8c2b5c1b7a7de39dc9374187ebb81781390be9ca8d98c612da32138ffe71714815b1bf0a8793ee19e3c92e98b25 SHA512 b02a546183c0d704c8f40bac27e2185d8b3abdd58ef92f1d3eacf76261490a652540ac2998411a8492960cd2ebdb4b104d0797cfb296e19dea1f81f603955e9f +EBUILD firebird-3.0.4.33054.0.ebuild 6069 BLAKE2B 7d6fe61959eea83b18df7bfcde0d1f11d42cd2b6509b65ef1f88c5695486cbcf2affc5347c17c70c482c339d4945cb9c3ee690773abfc06e66f34d32ca203742 SHA512 232b3e91ca46091c09fc5a96e72108bae203a9c5e484491a3a5548b78c344a83cad17b9476b96f4a65ee8165e60ee268443164b886a9ba22afd2e5b4796eca27 MISC metadata.xml 837 BLAKE2B 91e52f426cd9364da97ed6969369c3fa14a37e195f79192357d245e2e1ff90e20ada790e0a1904b05c4e9e0cdf25dec55aa4dbe14e2db32feb83bd5d465846a0 SHA512 98379c40f675f7b53e90e5327b76e554c17bda1ef7484165785b3d04884dd92fc3034c6b3f0f93667c456e7b23dc83f5143a8ec358759e2a0218c94e96127912 diff --git a/dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch b/dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch deleted file mode 100644 index e1361415c03b..000000000000 --- a/dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 3618aa2171674babf79ef935aa049c40a3db1321 -Author: asfernandes -Date: Sat Mar 5 03:39:36 2016 +0000 - - Make the generated code compatible with gcc 6 in C++-14 mode. - -diff --git a/src/gpre/c_cxx.cpp b/src/gpre/c_cxx.cpp -index 2af96c6..2dcffd6 100644 ---- a/src/gpre/c_cxx.cpp -+++ b/src/gpre/c_cxx.cpp -@@ -2820,7 +2820,7 @@ static void gen_request(const gpre_req* request) - printa(0, "static %sshort\n isc_%dl = %d;", - (request->req_flags & REQ_extend_dpb) ? "" : CONST_STR, - request->req_ident, request->req_length); -- printa(0, "static %schar\n isc_%d [] = {", CONST_STR, request->req_ident); -+ printa(0, "static %sunsigned char\n isc_%d [] = {", CONST_STR, request->req_ident); - - const TEXT* string_type = "blr"; - if (gpreGlob.sw_raw) diff --git a/dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild b/dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild deleted file mode 100644 index 8ab5dd6952cf..000000000000 --- a/dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild +++ /dev/null @@ -1,235 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit autotools flag-o-matic user versionator - -MY_P=${PN/f/F}-$(replace_version_separator 4 -) - -DESCRIPTION="Relational database offering many ANSI SQL:2003 and some SQL:2008 features" -HOMEPAGE="https://www.firebirdsql.org/" -SRC_URI=" - mirror://sourceforge/firebird/${MY_P}.tar.bz2 - doc? ( ftp://ftpc.inprise.com/pub/interbase/techpubs/ib_b60_doc.zip )" - -LICENSE="IDPL Interbase-1.0" -SLOT="0" -KEYWORDS="~amd64 ~x86" - -IUSE="doc examples +server xinetd" - -# FIXME: cloop? -CDEPEND=" - dev-libs/libtommath - dev-libs/icu:= - dev-libs/libedit -" -DEPEND="${CDEPEND} - >=dev-util/btyacc-3.0-r2 - doc? ( app-arch/unzip ) -" -RDEPEND="${CDEPEND} - xinetd? ( virtual/inetd ) - !sys-cluster/ganglia -" - -S="${WORKDIR}/${MY_P}" - -PATCHES=( - "${FILESDIR}/${P}"-unbundle.patch - "${FILESDIR}/${P}"-gcc6.patch - "${FILESDIR}/${P}"-cloop-compiler.patch -) - -pkg_pretend() { - if [[ -e /var/run/${PN}/${PN}.pid ]] ; then - ewarn - ewarn "The presence of server connections may prevent isql or gsec" - ewarn "from establishing an embedded connection. Accordingly," - ewarn "creating employee.fdb or security3.fdb could fail." - ewarn "It is more secure to stop the firebird daemon before running emerge." - ewarn - fi -} - -pkg_setup() { - enewgroup firebird 450 - enewuser firebird 450 /bin/sh /usr/$(get_libdir)/firebird firebird -} - -check_sed() { - MSG="sed of $3, required $2 line(s) modified $1" - einfo "${MSG}" - [[ $1 -ge $2 ]] || die "${MSG}" -} - -src_unpack() { - unpack "${MY_P}.tar.bz2" - if use doc; then - # Unpack docs - mkdir "manuals" || die - cd "manuals" || die - unpack ib_b60_doc.zip - fi -} - -src_prepare() { - default - - # Rename references to isql to fbsql - # sed vs patch for portability and addtional location changes - check_sed "$(sed -i -e 's:"isql :"fbsql :w /dev/stdout' \ - src/isql/isql.epp | wc -l)" "1" "src/isql/isql.epp" # 1 line - check_sed "$(sed -i -e 's:isql :fbsql :w /dev/stdout' \ - src/msgs/history2.sql | wc -l)" "4" "src/msgs/history2.sql" # 4 lines - check_sed "$(sed -i -e 's:--- ISQL:--- FBSQL:w /dev/stdout' \ - -e 's:isql :fbsql :w /dev/stdout' \ - -e 's:ISQL :FBSQL :w /dev/stdout' \ - src/msgs/messages2.sql | wc -l)" "6" "src/msgs/messages2.sql" # 6 lines - - find . -name \*.sh -exec chmod +x {} + || die - rm -r extern/{btyacc,editline,icu} || die - - eautoreconf -} - -src_configure() { - filter-flags -fprefetch-loop-arrays - filter-mfpmath sse - - # otherwise this doesnt build with gcc-6 - # http://tracker.firebirdsql.org/browse/CORE-5099 - append-cflags -fno-sized-deallocation -fno-delete-null-pointer-checks - append-cxxflags -fno-sized-deallocation -fno-delete-null-pointer-checks -std=c++11 - - econf \ - --prefix=/usr/$(get_libdir)/firebird \ - --with-editline \ - --with-system-editline \ - --with-fbbin=/usr/bin \ - --with-fbsbin=/usr/sbin \ - --with-fbconf=/etc/${PN} \ - --with-fblib=/usr/$(get_libdir) \ - --with-fbinclude=/usr/include \ - --with-fbdoc=/usr/share/doc/${PF} \ - --with-fbudf=/usr/$(get_libdir)/${PN}/UDF \ - --with-fbsample=/usr/share/doc/${PF}/examples \ - --with-fbsample-db=/usr/share/doc/${PF}/examples/db \ - --with-fbhelp=/usr/$(get_libdir)/${PN}/help \ - --with-fbintl=/usr/$(get_libdir)/${PN}/intl \ - --with-fbmisc=/usr/share/${PN} \ - --with-fbsecure-db=/etc/${PN} \ - --with-fbmsg=/usr/$(get_libdir)/${PN} \ - --with-fblog=/var/log/${PN}/ \ - --with-fbglock=/var/run/${PN} \ - --with-fbplugins=/usr/$(get_libdir)/${PN}/plugins \ - --with-gnu-ld \ - ${myconf} -} - -# from linux underground, merging into this here -src_install() { - if use doc; then - dodoc -r doc - find "${WORKDIR}"/manuals -type f -iname "*.pdf" -exec dodoc '{}' + || die - fi - - cd "${S}/gen/Release/${PN}" || die - - doheader include/* - dolib.so lib/*.so* - - # links for backwards compatibility - insinto /usr/$(get_libdir) - dosym libfbclient.so /usr/$(get_libdir)/libgds.so - dosym libfbclient.so /usr/$(get_libdir)/libgds.so.0 - dosym libfbclient.so /usr/$(get_libdir)/libfbclient.so.1 - - insinto /usr/share/${PN}/msg - doins *.msg - - use server || return - - einfo "Renaming isql -> fbsql" - mv bin/isql bin/fbsql || die "failed to rename isql -> fbsql" - - dobin bin/{fb_config,fbsql,fbsvcmgr,fbtracemgr,gbak,gfix,gpre,gsec,gsplit,gstat,nbackup,qli} - dosbin bin/{firebird,fbguard,fb_lock_print} - - insinto /usr/share/${PN}/help - # why??? - insopts -m0660 -o firebird -g firebird - doins help/help.fdb - - exeinto /usr/$(get_libdir)/${PN}/intl - doexe intl/libfbintl.so - dosym libfbintl.so /usr/$(get_libdir)/${PN}/intl/fbintl.so - - insinto /usr/$(get_libdir)/${PN}/intl - insopts -m0644 -o root -g root - doins intl/fbintl.conf - - # plugins - exeinto /usr/$(get_libdir)/${PN}/plugins - doexe plugins/*.so - exeinto /usr/$(get_libdir)/${PN}/plugins/udr - doexe plugins/udr/*.so - - exeinto /usr/$(get_libdir)/${PN}/UDF - doexe UDF/*.so - - # logging (do we really need the perms?) - diropts -m 755 -o firebird -g firebird - dodir /var/log/${PN} - keepdir /var/log/${PN} - - # logrotate - insinto /etc/logrotate.d - newins "${FILESDIR}/${PN}.logrotate" ${PN} - - # configuration files - insinto /etc/${PN}/plugins - doins plugins/udr_engine.conf - insinto /etc/${PN} - doins {databases,fbtrace,firebird,plugins}.conf - - # install secutity3.fdb - insopts -m0660 -o firebird -g firebird - doins security3.fdb - - if use xinetd; then - insinto /etc/xinetd.d - newins "${FILESDIR}/${PN}.xinetd.3.0" ${PN} - else - newinitd "${FILESDIR}/${PN}.init.d.3.0" ${PN} - fi - - if use examples; then - cd examples - insinto /usr/share/${PN}/examples - insopts -m0644 -o root -g root - doins -r api - doins -r dbcrypt - doins -r include - doins -r interfaces - doins -r package - doins -r stat - doins -r udf - doins -r udr - doins CMakeLists.txt - doins functions.c - doins README - insinto /usr/share/${PN}/examples/empbuild - insopts -m0660 -o firebird -g firebird - doins empbuild/employee.fdb - fi - - einfo - elog "Starting with version 3, server mode is set in firebird.conf" - elog "The default setting is superserver." - einfo - elog "If you're using UDFs, please remember to move them to /usr/$(get_libdir)/firebird/UDF" - einfo - ewarn "${CATEGORY}/${PF} is still a tad experimental. Please test and file bugs!" -} diff --git a/dev-db/firebird/firebird-3.0.4.33054.0.ebuild b/dev-db/firebird/firebird-3.0.4.33054.0.ebuild new file mode 100644 index 000000000000..899d3889c9e1 --- /dev/null +++ b/dev-db/firebird/firebird-3.0.4.33054.0.ebuild @@ -0,0 +1,230 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MY_P=${PN/f/F}-$(ver_rs 4 '-') +inherit autotools flag-o-matic user + +DESCRIPTION="Relational database offering many ANSI SQL:2003 and some SQL:2008 features" +HOMEPAGE="https://www.firebirdsql.org/" +SRC_URI=" + https://github.com/FirebirdSQL/firebird/releases/download/R$(ver_rs 1-3 '_' $(ver_cut 1-3))/${MY_P}.tar.bz2 + doc? ( ftp://ftpc.inprise.com/pub/interbase/techpubs/ib_b60_doc.zip )" + +LICENSE="IDPL Interbase-1.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc examples +server xinetd" + +BDEPEND=" + >=dev-util/btyacc-3.0-r2 + doc? ( app-arch/unzip ) +" +# FIXME: cloop? +DEPEND=" + dev-libs/icu:= + dev-libs/libedit + dev-libs/libtommath +" +RDEPEND="${DEPEND} + xinetd? ( virtual/inetd ) + !sys-cluster/ganglia +" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}"/${PN}-3.0.2.32703.0-unbundle.patch + "${FILESDIR}"/${PN}-3.0.2.32703.0-cloop-compiler.patch +) + +pkg_pretend() { + if [[ -e /var/run/${PN}/${PN}.pid ]] ; then + ewarn + ewarn "The presence of server connections may prevent isql or gsec" + ewarn "from establishing an embedded connection. Accordingly," + ewarn "creating employee.fdb or security3.fdb could fail." + ewarn "It is more secure to stop the firebird daemon before running emerge." + ewarn + fi +} + +pkg_setup() { + enewgroup firebird 450 + enewuser firebird 450 /bin/sh /usr/$(get_libdir)/firebird firebird +} + +check_sed() { + MSG="sed of $3, required $2 line(s) modified $1" + einfo "${MSG}" + [[ $1 -ge $2 ]] || die "${MSG}" +} + +src_unpack() { + unpack "${MY_P}.tar.bz2" + if use doc; then + # Unpack docs + mkdir "manuals" || die + cd "manuals" || die + unpack ib_b60_doc.zip + fi +} + +src_prepare() { + default + + # Rename references to isql to fbsql + # sed vs patch for portability and addtional location changes + check_sed "$(sed -i -e 's:"isql :"fbsql :w /dev/stdout' \ + src/isql/isql.epp | wc -l)" "1" "src/isql/isql.epp" # 1 line + check_sed "$(sed -i -e 's:isql :fbsql :w /dev/stdout' \ + src/msgs/history2.sql | wc -l)" "4" "src/msgs/history2.sql" # 4 lines + check_sed "$(sed -i -e 's:--- ISQL:--- FBSQL:w /dev/stdout' \ + -e 's:isql :fbsql :w /dev/stdout' \ + -e 's:ISQL :FBSQL :w /dev/stdout' \ + src/msgs/messages2.sql | wc -l)" "6" "src/msgs/messages2.sql" # 6 lines + + find . -name \*.sh -exec chmod +x {} + || die + rm -r extern/{btyacc,editline,icu} || die + + eautoreconf +} + +src_configure() { + filter-flags -fprefetch-loop-arrays + filter-mfpmath sse + + # otherwise this doesnt build with gcc-6 + # http://tracker.firebirdsql.org/browse/CORE-5099 + append-cflags -fno-sized-deallocation -fno-delete-null-pointer-checks + append-cxxflags -fno-sized-deallocation -fno-delete-null-pointer-checks -std=c++11 + + local myeconfargs=( + --prefix=/usr/$(get_libdir)/firebird + --with-editline + --with-system-editline + --with-fbbin=/usr/bin + --with-fbsbin=/usr/sbin + --with-fbconf=/etc/${PN} + --with-fblib=/usr/$(get_libdir) + --with-fbinclude=/usr/include + --with-fbdoc=/usr/share/doc/${PF} + --with-fbudf=/usr/$(get_libdir)/${PN}/UDF + --with-fbsample=/usr/share/doc/${PF}/examples + --with-fbsample-db=/usr/share/doc/${PF}/examples/db + --with-fbhelp=/usr/$(get_libdir)/${PN}/help + --with-fbintl=/usr/$(get_libdir)/${PN}/intl + --with-fbmisc=/usr/share/${PN} + --with-fbsecure-db=/etc/${PN} + --with-fbmsg=/usr/$(get_libdir)/${PN} + --with-fblog=/var/log/${PN}/ + --with-fbglock=/var/run/${PN} + --with-fbplugins=/usr/$(get_libdir)/${PN}/plugins + --with-gnu-ld + ) + econf "${myeconfargs[@]}" +} + +# from linux underground, merging into this here +src_install() { + if use doc; then + dodoc -r doc + find "${WORKDIR}"/manuals -type f -iname "*.pdf" -exec dodoc '{}' + || die + fi + + cd "${S}/gen/Release/${PN}" || die + + doheader include/* + dolib.so lib/*.so* + + # links for backwards compatibility + insinto /usr/$(get_libdir) + dosym libfbclient.so /usr/$(get_libdir)/libgds.so + dosym libfbclient.so /usr/$(get_libdir)/libgds.so.0 + dosym libfbclient.so /usr/$(get_libdir)/libfbclient.so.1 + + insinto /usr/share/${PN}/msg + doins *.msg + + use server || return + + einfo "Renaming isql -> fbsql" + mv bin/isql bin/fbsql || die "failed to rename isql -> fbsql" + + dobin bin/{fb_config,fbsql,fbsvcmgr,fbtracemgr,gbak,gfix,gpre,gsec,gsplit,gstat,nbackup,qli} + dosbin bin/{firebird,fbguard,fb_lock_print} + + insinto /usr/share/${PN}/help + # why??? + insopts -m0660 -o firebird -g firebird + doins help/help.fdb + + exeinto /usr/$(get_libdir)/${PN}/intl + doexe intl/libfbintl.so + dosym libfbintl.so /usr/$(get_libdir)/${PN}/intl/fbintl.so + + insinto /usr/$(get_libdir)/${PN}/intl + insopts -m0644 -o root -g root + doins intl/fbintl.conf + + # plugins + exeinto /usr/$(get_libdir)/${PN}/plugins + doexe plugins/*.so + exeinto /usr/$(get_libdir)/${PN}/plugins/udr + doexe plugins/udr/*.so + + exeinto /usr/$(get_libdir)/${PN}/UDF + doexe UDF/*.so + + # logging (do we really need the perms?) + diropts -m 755 -o firebird -g firebird + dodir /var/log/${PN} + keepdir /var/log/${PN} + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotate" ${PN} + + # configuration files + insinto /etc/${PN}/plugins + doins plugins/udr_engine.conf + insinto /etc/${PN} + doins {databases,fbtrace,firebird,plugins}.conf + + # install secutity3.fdb + insopts -m0660 -o firebird -g firebird + doins security3.fdb + + if use xinetd; then + insinto /etc/xinetd.d + newins "${FILESDIR}/${PN}.xinetd.3.0" ${PN} + else + newinitd "${FILESDIR}/${PN}.init.d.3.0" ${PN} + fi + + if use examples; then + cd examples || die + insinto /usr/share/${PN}/examples + insopts -m0644 -o root -g root + doins -r api + doins -r dbcrypt + doins -r include + doins -r interfaces + doins -r package + doins -r stat + doins -r udf + doins -r udr + doins CMakeLists.txt + doins functions.c + doins README + insinto /usr/share/${PN}/examples/empbuild + insopts -m0660 -o firebird -g firebird + doins empbuild/employee.fdb + fi + + elog "Starting with version 3, server mode is set in firebird.conf" + elog "The default setting is superserver." + elog + elog "If you're using UDFs, please remember to move them to /usr/$(get_libdir)/firebird/UDF" +} diff --git a/dev-db/mariadb-connector-c/Manifest b/dev-db/mariadb-connector-c/Manifest index 3f921cd8e7a2..099a90cdb0db 100644 --- a/dev-db/mariadb-connector-c/Manifest +++ b/dev-db/mariadb-connector-c/Manifest @@ -1,11 +1,14 @@ 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.8-fix-pkconfig-file.patch 630 BLAKE2B 4d087835c14334ebfdbfcf69df16e948dfd0c46c194d56ba44516bfb647ff518d766170d95c3c86f39211555f25993d95b57c516a357bb3db52b8428273aad48 SHA512 9949b6e6ea2fe325279a6459ce6119524444dbec65cd509549bdc89d5a4c9afb6c39abe2d4e1ab64f6c7e917279f83a323f93d3fe7bd79a8d519976f8c786028 +AUX mariadb-connector-c-3.1.3-fix-pkconfig-file.patch 616 BLAKE2B 650c5a794da6d3d0095a823917704d52a5f16c349ce7017b93b1bebfec01287929470a89a2e4aec2f9f7cd5135368e43f2a2e89257c0d7042b878e1806ede8aa SHA512 fe621abedaf81d1fa367c52f69ccce1765757db8d9f412aa40b440d7e51d4de3785a90150e76893f7066b1ba656eb1bad020465e58adae13f08245b839bde4de DIST mariadb-connector-c-3.0.6-src.tar.gz 666819 BLAKE2B 7245c0e13e569454d1cc70e3579afcbd53c64a0a7e828012b38d73f7d737a81b4fdf0363bd1b156dae783806a51773dbceb2ea06621bd4a73773edb78a70249a SHA512 6a41efacff1840eb8ddd8b34d8894b51f260444c76a1344f9ac9b675fd8492d44716338e4c11594d80118b12d90f75430304282650bce0d5f64179df6cc14d8e DIST mariadb-connector-c-3.0.9-src.tar.gz 668142 BLAKE2B f61f855c334268b1cb079abc566a600093d7e0bdd164c22045000e337f43d2b57d14988cba1b3fd2f6316f6e0d949be7e67ac73410ddb1abc66e0faa16422946 SHA512 6f45bcd4bee07f6d72d1c4fee0bdb903ef4fa879eb7508156bc885a5657caf69b145d95647c4bc663eb2a2b03569b41ef9d87ca532b77901c2f67fd608048a1a DIST mariadb-connector-c-3.1.2-src.tar.gz 735530 BLAKE2B c441cb69b0affaaa5ed87a9e81232ef2dfab305bf5d92ad60ad0198508294c1153ad517347d2af1336722149200a1a62ddd4c289913b09de0195c9da79279305 SHA512 8ad0ec5aea07a04e7ac9da6af3d067755dd8f22deed071de2321c581374b5ed1e4d6bab048b231655d3c2a3722b2b99f276d95046c659f867cbd58d772fb17bb +DIST mariadb-connector-c-3.1.3-src.tar.gz 738250 BLAKE2B a3ea70d2dc226b7c8e907dddaa39e280a76fac7b0a8a74971aa9cc6c1fadf3e5cb96fb3f55e29a639a899d5eeb30dd28d4cfaef0256f030af86909d68e9f85dc SHA512 ca3809a5f1a33317962908ee40d5c339ba6b02c5c8818bf12af9b78eb2289efad711ab74ac7706d711951b22957ba897b5e80b60e8df44924ca70569a4e1c5e7 EBUILD mariadb-connector-c-3.0.6-r1.ebuild 2815 BLAKE2B 807069ea31a7c42ae6eba3d8c3d3ccb76f23741d7a4fae97655f76df674cda564487796971d36d12e909243492531f9cacbdff312e61e1bb1522e2221f3f5287 SHA512 40395fbe2f70b2e7e77c339129be309d343368e5b006f4b0fc86c5134e7993c309ef715ef4b7f2e3feae178111954d407e13f6db4070ae0530ec1e6b54e03215 EBUILD mariadb-connector-c-3.0.9.ebuild 2318 BLAKE2B 3bfe94b1f26a60a13f8a9a9d83bdd387e9c2257a0f0502e1013c4dc4c7c06dae5c31af9efe1ac5b4ff543d9a1a2a6335b8b5b8465ac75bdf3170015696caf3cf SHA512 114a5963a7e1364f0f94063042bb98bc8d45664e6ef54b1cabfd39154b2b6815c41bd597e83ab376dc0d22d10b30e9be154ddc7908560089e4fba84c7271e18b EBUILD mariadb-connector-c-3.1.2.ebuild 2316 BLAKE2B 1766c9da2ff67920d51121c910f47955785e028eaf579d9da5a8d420f6f9e025bd20f5e4dc3b4e4e61c28474eee97793a6e5324cc18afaae546fba6ebb41d19f SHA512 6683d0b84194dfdfdefa3f24e3c913e121b48364f6f684517669db4450adb03aaad660f6f6f2162d450f6f89dfa7dfd69d014c9c7a19bedcf89314c9c0b2749f +EBUILD mariadb-connector-c-3.1.3.ebuild 2316 BLAKE2B 479e8d2b73d65e2931113c864b8db112214749bb8fe969e7bc9beba8c07de893e0e21c35957adafe713f042b0390f5bb60de761462296914b1edbd3e214dfa45 SHA512 4387d53d07ac9952154f8366fc81eb520480844e1f3482bf2f442ca9585ee6b3d003ccab119db00632f7abcba93f10c588ca20b872d4a3d14ad25e184af7a270 EBUILD mariadb-connector-c-9999.ebuild 2316 BLAKE2B 1766c9da2ff67920d51121c910f47955785e028eaf579d9da5a8d420f6f9e025bd20f5e4dc3b4e4e61c28474eee97793a6e5324cc18afaae546fba6ebb41d19f SHA512 6683d0b84194dfdfdefa3f24e3c913e121b48364f6f684517669db4450adb03aaad660f6f6f2162d450f6f89dfa7dfd69d014c9c7a19bedcf89314c9c0b2749f MISC metadata.xml 324 BLAKE2B fab5394015cd337683f65a257556ed0f15e35826bb0a6ce75a7033cd5931455ff2bed527064d698e9b3165f2cfcaff8a4bdfcad0b830482ae2e4389a79d529fb SHA512 1fe9e5d5d9f8e817ce49117fbcc6a6d706a090752606647496f2b7a25de51bfb641a408ff0cdaf626d83eb5c314d2e28c3f29532307d942cb41498edf4b44aa6 diff --git a/dev-db/mariadb-connector-c/files/mariadb-connector-c-3.1.3-fix-pkconfig-file.patch b/dev-db/mariadb-connector-c/files/mariadb-connector-c-3.1.3-fix-pkconfig-file.patch new file mode 100644 index 000000000000..ea4798ea9439 --- /dev/null +++ b/dev-db/mariadb-connector-c/files/mariadb-connector-c-3.1.3-fix-pkconfig-file.patch @@ -0,0 +1,21 @@ +--- a/mariadb_config/libmariadb.pc.in ++++ b/mariadb_config/libmariadb.pc.in +@@ -7,14 +7,13 @@ + # + + 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} ++Cflags: -I${includedir}/mariadb + Libs: -L${libdir} -lmariadb + Libs.private: @extra_dynamic_LDFLAGS@ +- +- diff --git a/dev-db/mariadb-connector-c/mariadb-connector-c-3.1.3.ebuild b/dev-db/mariadb-connector-c/mariadb-connector-c-3.1.3.ebuild new file mode 100644 index 000000000000..234dbab69749 --- /dev/null +++ b/dev-db/mariadb-connector-c/mariadb-connector-c-3.1.3.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +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 +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}" +PATCHES=( + "${FILESDIR}"/gentoo-layout-3.0.patch + "${FILESDIR}"/${PN}-3.1.3-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 +} + +multilib_src_install_all() { + if ! use static-libs ; then + find "${D}" -name "*.a" -delete || die + fi +} diff --git a/dev-db/mariadb/Manifest b/dev-db/mariadb/Manifest index a73ed73d84a0..80933283d512 100644 --- a/dev-db/mariadb/Manifest +++ b/dev-db/mariadb/Manifest @@ -1,3 +1,5 @@ +AUX MDEV-20247-replication-10.2.patch 4182 BLAKE2B eb14bc12abda635fc1f4bb0dcb1245efa24e6f604934a8b19b9e65ee34e73872f36e144245c7d6fc19b0b658bacbfae80bf8ebae94da1681da25bb964384b921 SHA512 1c2a5371cf4dbf52c97dee05c65dc49682cdc5ed330265aed6de0c905c43b48879306e7fd8e6d86b2e438b3160c1821aece14b28931a341815bc9a9265579195 +AUX MDEV-20247-replication.patch 4867 BLAKE2B 308ef164760c7a90b0f9383676e6e70dce3163dd60957cef83cfe9ed9d4355c613f54776a018c58fffc07f7c8129e3a95fc4a0f3a162e8ad564a79c10f30aeae SHA512 b0a90a81856dbe70029e16081a987a6fafa3a9e01cfe5e5d9f083f54bfbddd209e212263d55b7b5c0557bacebeec91ce72ee4c92a82b4bf54fe3b8f5e80a4db5 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 @@ -14,10 +16,10 @@ DIST mysql-extras-20180809-1700Z.tar.bz2 322999 BLAKE2B 8b5feb32085dc35b2f68dae9 DIST mysql-extras-20190305-2052Z.tar.bz2 331304 BLAKE2B 1d2c35a961159fa5ce9ee6699fce943f5a5b5cf60b11c9bb4bcccee4943f4508a9eb6d01050c642353ac592ce1a6b421abf2a1bebc706c44c4c8a36aa698ec43 SHA512 ae63403320e010acbb92f8aec6da8ed4f267cef0bad37147d594076fd94571de7f98bfc2afbe94af5d716f58d57696fd958b1e13e20e87052f252ed4a188cd3c DIST mysql-extras-20190731-2258Z.tar.bz2 332111 BLAKE2B cc144c9af852bfdd4149b96bdc22f8afb2d0aa92f95ebd272a244f0fb7743dc03f9244871d5c195260bac5d9ed20583093257ee2c95a5a4d0a4dae488d781adf SHA512 d4428a1128cd5aef62c463b659992b110090b1602cdcb6b8d922d570c6b946fde325bfcf5a9a955a8dcc61f3ccd3d612d8517ebf63e316f98ca9ff2cd8a807aa EBUILD mariadb-10.1.38-r1.ebuild 29461 BLAKE2B 8835eafc8071bc212701f6b3da7a4370ca6cd39ae2930d7ca34f52b35bc052901d970b5a79c4b6a54ae726596ab04ce0fc87c4ecdbd8c5b76a2a9200c34e5136 SHA512 4c3b7e8855dba247daf35857e8deeea15d8a06243bc06c3e8a3966c354f7ef0f3941e8279b4c0657cc1e9b527691b673bf1191dacffeb0fe42da6471f68eaee3 -EBUILD mariadb-10.1.41.ebuild 29725 BLAKE2B 5a3b66005851934c3380883e815bbd540d08a7e6a3a4a6121932ef78bdc1e0e19a2cb3278047937072a73211abfd31f5418df5e58de2e834e522dfce600419e1 SHA512 72d8b6338c34983760c390a6ffb78fa04f4b6110d4f8a61534fabb12c70412fa38abd158c18d72591f626a81c7ab9332cb48c7c439364165a03fa820e98dd6a1 +EBUILD mariadb-10.1.41-r1.ebuild 29913 BLAKE2B e71bd87f32e5225f319e3b8dfd9e393cc73f86516176c38ac8ba433a0abe958aaa363d97859cbae5e2718a0faf58fda9f2d6a4e911a69b7a7432dea2135e912b SHA512 4a412677b3c18550d4d7cad12a7cb7af6f0e30439e4e001d6e66ca7e066d5b44101a2fb62573a926fb942fac0ba903ab277fa72e7df2b5227bae55c06dd02639 EBUILD mariadb-10.2.22-r1.ebuild 32512 BLAKE2B 560adda28ace5ccf01dc9b4b333226cfbdecb316896a9255179542c4fde26ccd313606fc75fbc15796d1f95bda794c9e7f71cd86adf4e591fece797264934449 SHA512 a6e3ebe0562518da825cf653c034d144f92f5bfed1097038ca10b347992ceaeebd5ac3cfa9f74c89dc2581000d58ffcfee20d8adda22e72b00b9ad0b36e04415 -EBUILD mariadb-10.2.26.ebuild 32717 BLAKE2B 924fc7625dc89822d251f0045c8474c27779bc74657ba79f19e6eb03d7e701da22e9e56908d0fda2ec57fe2568a39f08bb1f60a4627be63bf39cf7415d14ecef SHA512 fac3fb5d92b1f13c89e5fbcc9a02b5952f502e5936cde2720e003a19480167e3a4a9c32d945d862a20f06e4fa34e99aec7abfc9b78547e0d6375df737acda65b -EBUILD mariadb-10.3.17.ebuild 32342 BLAKE2B ec87af7a3b77db49ecf21e91d7638f023b29bd5f0eb6c0edc123d20f4feca389b1912e25dc4453401acb240ca445eb1c3bdfaaac2dbc2cb8c725fe4a26481810 SHA512 960cedabf58fd30c00080f364c225eb0e483587532ff3982cfb54bf50c544110f9d18fd45a1c46a122105a2b9b0a765e0c07674c46bc0499781921f46d14fa05 -EBUILD mariadb-10.4.7.ebuild 32669 BLAKE2B 83cb84631270bd0a5be5657dc85418801f89ed2dff8aad281cf540a7dff14b9e864636454d289ee1fdfa07d596e18ebe64e528f133e8e28fdf85d71bff92c13c SHA512 b66ff12844194a7cff1db03c7bad09457c9d839c3d09257418206f0eac5c37d7a8d95de3e17637ef8f003af8c914d40c95172f23c792e6c715af1bcaa3502ea0 -EBUILD mariadb-5.5.65.ebuild 27101 BLAKE2B 1ac27c83ba4942c415c073e69e27047418237d4b51bdbb2fd471678c27502e67cddb56f794b957e4fed9ab0e4c03bad5d78db0ea9d6c07100bc87a3533d5285e SHA512 602085111323ab3c8049a7c7a40797dde9928c3f70d15d11eae2128773dd5c71c286565f4a4cdec032f6d03327c1e65df88a520874efaf91d0011951cbfab73c +EBUILD mariadb-10.2.26-r1.ebuild 32910 BLAKE2B e9e1bdb826dd0030ec14926ff853aea9393d81c59ecbe7f831354279b5407cda3dda455e4d5034f5d83c57d34f85a5020ef58b6cc6ef98043b6e5fe9e99f6ff5 SHA512 f93cf9ab81fbf7d6e230fc3b6c542ed166a2697888abb78575536bda5a8b3dfce7f23fb0bffc5e2b9efe9a6dc63a57d075d35919f9497d19b17f6ebfac97811f +EBUILD mariadb-10.3.17-r1.ebuild 32535 BLAKE2B 915d81df2a91df4e1081d433d4be73345ba6ca45abd43162cdc441bd292f01b8ddfa27c4f184c2e1a9881c5b9afdd4540f75299ef3d4ea5bf510a307d8017101 SHA512 b9e6befa957e977deb17a7851b2e0cdab5899ff7137d6a80173e9fdbd94b14e232f52a2e747be60b2577f6c0e51f5a82eab80e80978410efcbb9f9efdf3d24c8 +EBUILD mariadb-10.4.7-r1.ebuild 33152 BLAKE2B 7fa934e68dbea2a2e863826696ab4aed1bcc5d9d944b197d2bd85fb2b92dff04beb76f515b2bf3392a15054681fa89cb30bc98ed2c92dd04c77ec2a2b0b605dc SHA512 7c566213e04ea0308bdced74b9beec0381abdcece41789c803c888898626a5c13553d8035bfbc03b825a1a4d494f56e065aae8c77accf62138e0ccbd83a1f955 +EBUILD mariadb-5.5.65.ebuild 27245 BLAKE2B 854c7de84f040511448be77ba09847d1da9b5a2775508695494543d782e9b0c20c40614138595b4030175a1d23003a1608567d22237f0ae5b7e67b0dfcd634c9 SHA512 557e8cdab91d78181c2e741ebc8d6fdd568ffcfb32935142e79385025881f5c666b066347f4311dd3eeaaaf95c0d015c1f0f0e8aa3c902fdd1a11073656dcc47 MISC metadata.xml 2611 BLAKE2B d1b6b11359e92a3d9cb2c58ed35a15e3cf42ab616ed907fa36a5f777168a805ffd03d01bd13fcd30352ef6c5e8b1d80f4e882ffaf8f6445ed3fce2bcc2a92923 SHA512 80395b35839acebbb18ac8d01e8c806bd89f18d32f85fcba41f41ecfc4f1f869dc8c51c90bb21ebd3c9ac30d51d47869a4dcf3b8ce73967e337e6e396b267c97 diff --git a/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch b/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch new file mode 100644 index 000000000000..193f2dd77509 --- /dev/null +++ b/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch @@ -0,0 +1,108 @@ +From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001 +From: Thirunarayanan Balathandayuthapani +Date: Wed, 7 Aug 2019 12:35:04 +0530 +Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never + starts + +- The commit ab6dd774082c57f48d998e03655c06b672799b2d wrongly sets the +condition inside innobase_srv_conc_enter_innodb(). Problem is that +InnoDB makes the thread to sleep indefinitely if it is a replication +slave thread. + +Thanks to Sujatha Sivakumar for contributing the replication test case. +--- + .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++ + .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++ + storage/innobase/handler/ha_innodb.cc | 6 +-- + 4 files changed, 60 insertions(+), 6 deletions(-) + create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result + create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test + +diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result +new file mode 100644 +index 000000000000..0ed894336a1c +--- /dev/null ++++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result +@@ -0,0 +1,18 @@ ++include/master-slave.inc ++[connection master] ++connection slave; ++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; ++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; ++SET GLOBAL innodb_thread_concurrency = 100; ++connection master; ++CREATE TABLE t(f INT) ENGINE=INNODB; ++INSERT INTO t VALUES (10); ++connection slave; ++include/diff_tables.inc [master:t, slave:t] ++"===== Clean up=======" ++connection master; ++DROP TABLE t; ++connection slave; ++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; ++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; ++include/rpl_end.inc +diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test +new file mode 100644 +index 000000000000..b4c2971d2fbc +--- /dev/null ++++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test +@@ -0,0 +1,41 @@ ++# ==== Purpose ==== ++# ++# Test verifies that replication shouldn't hang when number of active threads ++# on the slave server are less than the allowed innodb_thread_concurrency value. ++# ++# ==== Implementation ==== ++# ++# Steps: ++# 0 - Have master slave replication setup with engine being Innodb. ++# 1 - Configure innodb_thread_concurrency = 100. ++# 2 - Do some DML on master and sync the slave with master. ++# 3 - Ensure replication doesn't hang. ++# ++# ==== References ==== ++# ++# MDEV-20247: Replication hangs with "preparing" and never starts ++# ++ ++--source include/master-slave.inc ++--source include/have_innodb.inc ++ ++--connection slave ++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; ++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; ++SET GLOBAL innodb_thread_concurrency = 100; ++ ++--connection master ++CREATE TABLE t(f INT) ENGINE=INNODB; ++INSERT INTO t VALUES (10); ++--sync_slave_with_master ++ ++--let $diff_tables=master:t, slave:t ++--source include/diff_tables.inc ++ ++--echo "===== Clean up=======" ++--connection master ++DROP TABLE t; ++--sync_slave_with_master ++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; ++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; ++--source include/rpl_end.inc +diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc +index 081fcbd9c51e..5dfe240631b8 100644 +--- a/storage/innobase/handler/ha_innodb.cc ++++ b/storage/innobase/handler/ha_innodb.cc +@@ -1686,9 +1686,9 @@ innobase_srv_conc_enter_innodb( + && thd_is_replication_slave_thread(trx->mysql_thd)) { + const ulonglong end = my_interval_timer() + + ulonglong(srv_replication_delay) * 1000000; +- while (srv_conc_get_active_threads() +- >= srv_thread_concurrency +- || my_interval_timer() >= end) { ++ while ((srv_conc_get_active_threads() ++ >= srv_thread_concurrency) ++ && my_interval_timer() < end) { + os_thread_sleep(2000 /* 2 ms */); + } + } else { diff --git a/dev-db/mariadb/files/MDEV-20247-replication.patch b/dev-db/mariadb/files/MDEV-20247-replication.patch new file mode 100644 index 000000000000..92f8e0e1a67d --- /dev/null +++ b/dev-db/mariadb/files/MDEV-20247-replication.patch @@ -0,0 +1,121 @@ +From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001 +From: Thirunarayanan Balathandayuthapani +Date: Wed, 7 Aug 2019 12:35:04 +0530 +Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never + starts + +- The commit ab6dd774082c57f48d998e03655c06b672799b2d wrongly sets the +condition inside innobase_srv_conc_enter_innodb(). Problem is that +InnoDB makes the thread to sleep indefinitely if it is a replication +slave thread. + +Thanks to Sujatha Sivakumar for contributing the replication test case. +--- + .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++ + .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++ + storage/innobase/handler/ha_innodb.cc | 6 +-- + storage/xtradb/handler/ha_innodb.cc | 6 +-- + 4 files changed, 60 insertions(+), 6 deletions(-) + create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result + create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test + +diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result +new file mode 100644 +index 000000000000..0ed894336a1c +--- /dev/null ++++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result +@@ -0,0 +1,13 @@ ++include/master-slave.inc ++[connection master] ++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; ++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; ++SET GLOBAL innodb_thread_concurrency = 100; ++CREATE TABLE t(f INT) ENGINE=INNODB; ++INSERT INTO t VALUES (10); ++include/diff_tables.inc [master:t, slave:t] ++"===== Clean up=======" ++DROP TABLE t; ++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; ++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; ++include/rpl_end.inc +diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test +new file mode 100644 +index 000000000000..b4c2971d2fbc +--- /dev/null ++++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test +@@ -0,0 +1,41 @@ ++# ==== Purpose ==== ++# ++# Test verifies that replication shouldn't hang when number of active threads ++# on the slave server are less than the allowed innodb_thread_concurrency value. ++# ++# ==== Implementation ==== ++# ++# Steps: ++# 0 - Have master slave replication setup with engine being Innodb. ++# 1 - Configure innodb_thread_concurrency = 100. ++# 2 - Do some DML on master and sync the slave with master. ++# 3 - Ensure replication doesn't hang. ++# ++# ==== References ==== ++# ++# MDEV-20247: Replication hangs with "preparing" and never starts ++# ++ ++--source include/master-slave.inc ++--source include/have_innodb.inc ++ ++--connection slave ++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; ++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; ++SET GLOBAL innodb_thread_concurrency = 100; ++ ++--connection master ++CREATE TABLE t(f INT) ENGINE=INNODB; ++INSERT INTO t VALUES (10); ++--sync_slave_with_master ++ ++--let $diff_tables=master:t, slave:t ++--source include/diff_tables.inc ++ ++--echo "===== Clean up=======" ++--connection master ++DROP TABLE t; ++--sync_slave_with_master ++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; ++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; ++--source include/rpl_end.inc +diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc +index 081fcbd9c51e..5dfe240631b8 100644 +--- a/storage/innobase/handler/ha_innodb.cc ++++ b/storage/innobase/handler/ha_innodb.cc +@@ -1686,9 +1686,9 @@ innobase_srv_conc_enter_innodb( + && thd_is_replication_slave_thread(trx->mysql_thd)) { + const ulonglong end = my_interval_timer() + + ulonglong(srv_replication_delay) * 1000000; +- while (srv_conc_get_active_threads() +- >= srv_thread_concurrency +- || my_interval_timer() >= end) { ++ while ((srv_conc_get_active_threads() ++ >= srv_thread_concurrency) ++ && my_interval_timer() < end) { + os_thread_sleep(2000 /* 2 ms */); + } + } else { +diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc +index 5e7482ff6bfa..b5002187e3b2 100644 +--- a/storage/xtradb/handler/ha_innodb.cc ++++ b/storage/xtradb/handler/ha_innodb.cc +@@ -1949,9 +1949,9 @@ innobase_srv_conc_enter_innodb( + && thd_is_replication_slave_thread(trx->mysql_thd)) { + const ulonglong end = my_interval_timer() + + ulonglong(srv_replication_delay) * 1000000; +- while (srv_conc_get_active_threads() +- >= srv_thread_concurrency +- || my_interval_timer() >= end) { ++ while ((srv_conc_get_active_threads() ++ >= srv_thread_concurrency) ++ && my_interval_timer() < end) { + os_thread_sleep(2000 /* 2 ms */); + } + } else { diff --git a/dev-db/mariadb/mariadb-10.1.41-r1.ebuild b/dev-db/mariadb/mariadb-10.1.41-r1.ebuild new file mode 100644 index 000000000000..a94d8c0ce083 --- /dev/null +++ b/dev-db/mariadb/mariadb-10.1.41-r1.ebuild @@ -0,0 +1,898 @@ +# 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 + "${FILESDIR}/MDEV-20247-replication.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 + + # Don't clash with dev-db/mysql-connector-c + sed -i -e 's/ my_print_defaults.1//' \ + -e 's/ perror.1//' \ + "${S}"/man/CMakeLists.txt || die + + 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) + -DPLUGIN_CLIENT_ED25519=NO + -DPLUGIN_AUTH_GSSAPI_CLIENT=NO + ) + + 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 \ + 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" + _disable_test plugins.auth_ed25519 "Needs client libraries built" + fi + + _disable_test main.gis_notembedded "Fails when latin1 USE is not set" + + _disable_test sys_vars.sysvars_server_notembedded "Broken test" # bug #661700 required profiling always on + + # run mysql-test tests + perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" + retstatus_tests=$? + + popd > /dev/null || die + + # Cleanup is important for these testcases. + pkill -9 -f "${S}/ndb" 2>/dev/null + pkill -9 -f "${S}/sql" 2>/dev/null + + local failures="" + [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" + [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" + + [[ -z "$failures" ]] || die "Test failures: $failures" + einfo "Tests successfully completed" +} + +mysql_init_vars() { + MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} + MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} + MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} + MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} + + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="" + if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then + MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ + | sed -e 's/.*=\s*//' \ + | tail -n1` + fi + fi + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="${MY_LOCALSTATEDIR}" + einfo "Using default MY_DATADIR" + fi + elog "MySQL MY_DATADIR is ${MY_DATADIR}" + + if [[ -z "${PREVIOUS_DATADIR}" ]] ; then + if [[ -e "${MY_DATADIR}" ]] ; then + # If you get this and you're wondering about it, see bug #207636 + elog "MySQL datadir found in ${MY_DATADIR}" + elog "A new one will not be created." + PREVIOUS_DATADIR="yes" + else + PREVIOUS_DATADIR="no" + fi + export PREVIOUS_DATADIR + fi + else + if [[ ${EBUILD_PHASE} == "config" ]]; then + local new_MY_DATADIR + new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then + ewarn "MySQL MY_DATADIR has changed" + ewarn "from ${MY_DATADIR}" + ewarn "to ${new_MY_DATADIR}" + MY_DATADIR="${new_MY_DATADIR}" + fi + fi + fi + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LOCALSTATEDIR MY_LOGDIR + export MY_DATADIR +} + +pkg_config() { + _getoptval() { + local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults + local section="$1" + local flag="--${2}=" + local extra_options="${3}" + "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" + } + local old_MY_DATADIR="${MY_DATADIR}" + local old_HOME="${HOME}" + # my_print_defaults needs to read stuff in $HOME/.my.cnf + export HOME=${EPREFIX}/root + + # Make sure the vars are correctly initialized + mysql_init_vars + + [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" + if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then + die "Minimal builds do NOT include the MySQL server" + fi + + if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then + local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" + MY_DATADIR_s="${MY_DATADIR_s%%/}" + local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" + old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" + + if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then + if [[ -d "${MY_DATADIR_s}" ]]; then + ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" + ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" + else + elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" + mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ + || die "Moving MY_DATADIR failed" + fi + else + ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" + if [[ -d "${MY_DATADIR_s}" ]]; then + ewarn "Attempting to use ${MY_DATADIR_s}" + else + eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" + die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" + fi + fi + fi + + local pwd1="a" + local pwd2="b" + local maxtry=15 + + if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then + local tmp_mysqld_password_source= + + for tmp_mysqld_password_source in mysql client; do + einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" + if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then + if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then + ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" + MYSQL_ROOT_PASSWORD= + continue + fi + + einfo "Found password in '${tmp_mysqld_password_source}' section!" + break + fi + done + + # Sometimes --show is required to display passwords in some implementations of my_print_defaults + if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" + fi + + unset tmp_mysqld_password_source + fi + MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" + MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} + + if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then + einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" + fi + if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then + einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" + fi + if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then + einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" + fi + + if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then + ewarn "You have already a MySQL database in place." + ewarn "(${ROOT}/${MY_DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." + die "MySQL database already exists!" + fi + + # Bug #213475 - MySQL _will_ object strenously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then + + einfo "Please provide a password for the mysql 'root' user now" + einfo "or through the ${HOME}/.my.cnf file." + ewarn "Avoid [\"'\\_%] characters in the password" + read -rsp " >" pwd1 ; echo + + einfo "Retype the password" + read -rsp " >" pwd2 ; echo + + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same" + fi + MYSQL_ROOT_PASSWORD="${pwd1}" + unset pwd1 pwd2 + fi + + local options + local sqltmp="$(emktemp)" + + # Fix bug 446200. Don't reference host my.cnf, needs to come first, + # see https://bugs.mysql.com/bug.php?id=31312 + use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" + + # Figure out which options we need to disable to do the setup + local helpfile="${TMPDIR}/mysqld-help" + "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null + for opt in grant-tables host-cache name-resolve networking slave-start \ + federated ssl log-bin relay-log slow-query-log external-locking \ + log-slave-updates \ + ; do + optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" + egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" + done + + einfo "Creating the mysql database and setting proper permissions on it ..." + + # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it + PID_DIR="${EROOT}/var/run/mysqld" + if [[ ! -d "${PID_DIR}" ]]; then + install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" + fi + + if [[ ! -d "${MY_DATADIR}" ]]; then + install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" + fi + + pushd "${TMPDIR}" &>/dev/null || die + + # Filling timezones, see + # https://dev.mysql.com/doc/mysql/en/time-zone-support.html + "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null + + local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) + [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) + cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) + einfo "Command: ${cmd[*]}" + su -s /bin/sh -c "${cmd[*]}" mysql \ + >"${TMPDIR}"/mysql_install_db.log 2>&1 + if [ $? -ne 0 ]; then + grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 + die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" + fi + popd &>/dev/null || die + [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ + || die "MySQL databases not installed" + + use prefix || options="${options} --user=mysql" + + local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" + local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" + local mysqld="${EROOT}/usr/sbin/mysqld \ + ${options} \ + --log-warnings=0 \ + --basedir=${EROOT}/usr \ + --datadir=${ROOT}/${MY_DATADIR} \ + --max_allowed_packet=8M \ + --net_buffer_length=16K \ + --socket=${socket} \ + --pid-file=${pidfile} \ + --tmpdir=${ROOT}/${MYSQL_TMPDIR}" + #einfo "About to start mysqld: ${mysqld}" + ebegin "Starting mysqld" + einfo "Command ${mysqld}" + ${mysqld} & + rc=$? + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + eend $rc + + if ! [[ -S "${socket}" ]]; then + die "Completely failed to start up mysqld with: ${mysqld}" + fi + + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -e "${sql}" + eend $? + + if [[ -n "${sqltmp}" ]] ; then + ebegin "Loading \"zoneinfo\", this step may require a few seconds" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -uroot \ + --password="${MYSQL_ROOT_PASSWORD}" \ + mysql < "${sqltmp}" + rc=$? + eend $? + [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" + fi + + # Stop the server and cleanup + einfo "Stopping the server ..." + kill $(< "${pidfile}" ) + rm -f "${sqltmp}" + wait %1 + einfo "Done" +} diff --git a/dev-db/mariadb/mariadb-10.1.41.ebuild b/dev-db/mariadb/mariadb-10.1.41.ebuild deleted file mode 100644 index 8a6a85ca423a..000000000000 --- a/dev-db/mariadb/mariadb-10.1.41.ebuild +++ /dev/null @@ -1,892 +0,0 @@ -# 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) - -DPLUGIN_CLIENT_ED25519=NO - -DPLUGIN_AUTH_GSSAPI_CLIENT=NO - ) - - 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 \ - 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" - _disable_test plugins.auth_ed25519 "Needs client libraries built" - fi - - _disable_test main.gis_notembedded "Fails when latin1 USE is not set" - - _disable_test sys_vars.sysvars_server_notembedded "Broken test" # bug #661700 required profiling always on - - # run mysql-test tests - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" - retstatus_tests=$? - - popd > /dev/null || die - - # Cleanup is important for these testcases. - pkill -9 -f "${S}/ndb" 2>/dev/null - pkill -9 -f "${S}/sql" 2>/dev/null - - local failures="" - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" - - [[ -z "$failures" ]] || die "Test failures: $failures" - einfo "Tests successfully completed" -} - -mysql_init_vars() { - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} - MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} - MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} - MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} - - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR="" - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then - MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ - | sed -ne '/datadir/s|^--datadir=||p' \ - | tail -n1` - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ - | sed -e 's/.*=\s*//' \ - | tail -n1` - fi - fi - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR="${MY_LOCALSTATEDIR}" - einfo "Using default MY_DATADIR" - fi - elog "MySQL MY_DATADIR is ${MY_DATADIR}" - - if [[ -z "${PREVIOUS_DATADIR}" ]] ; then - if [[ -e "${MY_DATADIR}" ]] ; then - # If you get this and you're wondering about it, see bug #207636 - elog "MySQL datadir found in ${MY_DATADIR}" - elog "A new one will not be created." - PREVIOUS_DATADIR="yes" - else - PREVIOUS_DATADIR="no" - fi - export PREVIOUS_DATADIR - fi - else - if [[ ${EBUILD_PHASE} == "config" ]]; then - local new_MY_DATADIR - new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ - | sed -ne '/datadir/s|^--datadir=||p' \ - | tail -n1` - - if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then - ewarn "MySQL MY_DATADIR has changed" - ewarn "from ${MY_DATADIR}" - ewarn "to ${new_MY_DATADIR}" - MY_DATADIR="${new_MY_DATADIR}" - fi - fi - fi - - export MY_SHAREDSTATEDIR MY_SYSCONFDIR - export MY_LOCALSTATEDIR MY_LOGDIR - export MY_DATADIR -} - -pkg_config() { - _getoptval() { - local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults - local section="$1" - local flag="--${2}=" - local extra_options="${3}" - "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" - } - local old_MY_DATADIR="${MY_DATADIR}" - local old_HOME="${HOME}" - # my_print_defaults needs to read stuff in $HOME/.my.cnf - export HOME=${EPREFIX}/root - - # Make sure the vars are correctly initialized - mysql_init_vars - - [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" - if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then - die "Minimal builds do NOT include the MySQL server" - fi - - if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then - local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" - MY_DATADIR_s="${MY_DATADIR_s%%/}" - local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" - old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" - - if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then - if [[ -d "${MY_DATADIR_s}" ]]; then - ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" - ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" - else - elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" - mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ - || die "Moving MY_DATADIR failed" - fi - else - ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" - if [[ -d "${MY_DATADIR_s}" ]]; then - ewarn "Attempting to use ${MY_DATADIR_s}" - else - eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" - die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" - fi - fi - fi - - local pwd1="a" - local pwd2="b" - local maxtry=15 - - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then - local tmp_mysqld_password_source= - - for tmp_mysqld_password_source in mysql client; do - einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then - if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then - ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" - MYSQL_ROOT_PASSWORD= - continue - fi - - einfo "Found password in '${tmp_mysqld_password_source}' section!" - break - fi - done - - # Sometimes --show is required to display passwords in some implementations of my_print_defaults - if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" - fi - - unset tmp_mysqld_password_source - fi - MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" - MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} - - if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" - fi - if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then - einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" - fi - if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then - einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" - fi - - if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then - ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${MY_DATADIR}/*)" - ewarn "Please rename or delete it if you wish to replace it." - die "MySQL database already exists!" - fi - - # Bug #213475 - MySQL _will_ object strenously if your machine is named - # localhost. Also causes weird failures. - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" - - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then - - einfo "Please provide a password for the mysql 'root' user now" - einfo "or through the ${HOME}/.my.cnf file." - ewarn "Avoid [\"'\\_%] characters in the password" - read -rsp " >" pwd1 ; echo - - einfo "Retype the password" - read -rsp " >" pwd2 ; echo - - if [[ "x$pwd1" != "x$pwd2" ]] ; then - die "Passwords are not the same" - fi - MYSQL_ROOT_PASSWORD="${pwd1}" - unset pwd1 pwd2 - fi - - local options - local sqltmp="$(emktemp)" - - # Fix bug 446200. Don't reference host my.cnf, needs to come first, - # see https://bugs.mysql.com/bug.php?id=31312 - use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" - - # Figure out which options we need to disable to do the setup - local helpfile="${TMPDIR}/mysqld-help" - "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null - for opt in grant-tables host-cache name-resolve networking slave-start \ - federated ssl log-bin relay-log slow-query-log external-locking \ - log-slave-updates \ - ; do - optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" - egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" - done - - einfo "Creating the mysql database and setting proper permissions on it ..." - - # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it - PID_DIR="${EROOT}/var/run/mysqld" - if [[ ! -d "${PID_DIR}" ]]; then - install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" - fi - - if [[ ! -d "${MY_DATADIR}" ]]; then - install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" - fi - - pushd "${TMPDIR}" &>/dev/null || die - - # Filling timezones, see - # https://dev.mysql.com/doc/mysql/en/time-zone-support.html - "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null - - local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) - [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) - cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) - einfo "Command: ${cmd[*]}" - su -s /bin/sh -c "${cmd[*]}" mysql \ - >"${TMPDIR}"/mysql_install_db.log 2>&1 - if [ $? -ne 0 ]; then - grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 - die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" - fi - popd &>/dev/null || die - [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ - || die "MySQL databases not installed" - - use prefix || options="${options} --user=mysql" - - local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" - local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" - local mysqld="${EROOT}/usr/sbin/mysqld \ - ${options} \ - --log-warnings=0 \ - --basedir=${EROOT}/usr \ - --datadir=${ROOT}/${MY_DATADIR} \ - --max_allowed_packet=8M \ - --net_buffer_length=16K \ - --socket=${socket} \ - --pid-file=${pidfile} \ - --tmpdir=${ROOT}/${MYSQL_TMPDIR}" - #einfo "About to start mysqld: ${mysqld}" - ebegin "Starting mysqld" - einfo "Command ${mysqld}" - ${mysqld} & - rc=$? - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do - maxtry=$((${maxtry}-1)) - echo -n "." - sleep 1 - done - eend $rc - - if ! [[ -S "${socket}" ]]; then - die "Completely failed to start up mysqld with: ${mysqld}" - fi - - ebegin "Setting root password" - # Do this from memory, as we don't want clear text passwords in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - eend $? - - if [[ -n "${sqltmp}" ]] ; then - ebegin "Loading \"zoneinfo\", this step may require a few seconds" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -uroot \ - --password="${MYSQL_ROOT_PASSWORD}" \ - mysql < "${sqltmp}" - rc=$? - eend $? - [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" - fi - - # Stop the server and cleanup - einfo "Stopping the server ..." - kill $(< "${pidfile}" ) - rm -f "${sqltmp}" - wait %1 - einfo "Done" -} diff --git a/dev-db/mariadb/mariadb-10.2.26-r1.ebuild b/dev-db/mariadb/mariadb-10.2.26-r1.ebuild new file mode 100644 index 000000000000..797d944ec897 --- /dev/null +++ b/dev-db/mariadb/mariadb-10.2.26-r1.ebuild @@ -0,0 +1,981 @@ +# 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 + "${FILESDIR}/MDEV-20247-replication-10.2.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 auth_ed25519 ) + 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 + + # Don't clash with dev-db/mysql-connector-c + sed -i -e 's/ my_print_defaults.1//' \ + -e 's/ perror.1//' \ + "${S}"/man/CMakeLists.txt || die + + 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_CLIENT_ED25519=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 \ + main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do + _disable_test "$t" "False positives in Gentoo" + done + + _disable_test main.gis_notembedded "Needs latin1 USE set" + _disable_test main.plugin_auth "Needs client libraries built" + _disable_test plugins.auth_ed25519 "Needs client libraries built" + _disable_test main.mysqldump "Test fails past 2018-12-31 due to event expiration" + + # Likely environment issues as only number of clients connected fails + _disable_test rpl.rpl_semi_sync_uninstall_plugin \ + "Fails intermittently on parallel testing" + + # run mysql-test tests + perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" + retstatus_tests=$? + + popd > /dev/null || die + + # Cleanup is important for these testcases. + pkill -9 -f "${S}/ndb" 2>/dev/null + pkill -9 -f "${S}/sql" 2>/dev/null + + local failures="" + [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" + [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" + + [[ -z "$failures" ]] || die "Test failures: $failures" + einfo "Tests successfully completed" +} + +mysql_init_vars() { + MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} + MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} + MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} + MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} + + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="" + if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then + MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ + | sed -e 's/.*=\s*//' \ + | tail -n1` + fi + fi + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="${MY_LOCALSTATEDIR}" + einfo "Using default MY_DATADIR" + fi + elog "MySQL MY_DATADIR is ${MY_DATADIR}" + + if [[ -z "${PREVIOUS_DATADIR}" ]] ; then + if [[ -e "${MY_DATADIR}" ]] ; then + # If you get this and you're wondering about it, see bug #207636 + elog "MySQL datadir found in ${MY_DATADIR}" + elog "A new one will not be created." + PREVIOUS_DATADIR="yes" + else + PREVIOUS_DATADIR="no" + fi + export PREVIOUS_DATADIR + fi + else + if [[ ${EBUILD_PHASE} == "config" ]]; then + local new_MY_DATADIR + new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then + ewarn "MySQL MY_DATADIR has changed" + ewarn "from ${MY_DATADIR}" + ewarn "to ${new_MY_DATADIR}" + MY_DATADIR="${new_MY_DATADIR}" + fi + fi + fi + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LOCALSTATEDIR MY_LOGDIR + export MY_DATADIR +} + +pkg_config() { + _getoptval() { + local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults + local section="$1" + local flag="--${2}=" + local extra_options="${3}" + "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" + } + local old_MY_DATADIR="${MY_DATADIR}" + local old_HOME="${HOME}" + # my_print_defaults needs to read stuff in $HOME/.my.cnf + export HOME=${EPREFIX}/root + + # Make sure the vars are correctly initialized + mysql_init_vars + + [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" + if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then + die "Minimal builds do NOT include the MySQL server" + fi + + if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then + local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" + MY_DATADIR_s="${MY_DATADIR_s%%/}" + local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" + old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" + + if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then + if [[ -d "${MY_DATADIR_s}" ]]; then + ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" + ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" + else + elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" + mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ + || die "Moving MY_DATADIR failed" + fi + else + ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" + if [[ -d "${MY_DATADIR_s}" ]]; then + ewarn "Attempting to use ${MY_DATADIR_s}" + else + eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" + die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" + fi + fi + fi + + local pwd1="a" + local pwd2="b" + local maxtry=15 + + if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then + local tmp_mysqld_password_source= + + for tmp_mysqld_password_source in mysql client; do + einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" + if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then + if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then + ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" + MYSQL_ROOT_PASSWORD= + continue + fi + + einfo "Found password in '${tmp_mysqld_password_source}' section!" + break + fi + done + + # Sometimes --show is required to display passwords in some implementations of my_print_defaults + if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" + fi + + unset tmp_mysqld_password_source + fi + MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" + MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} + + if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then + einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" + fi + if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then + einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" + fi + if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then + einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" + fi + + if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then + ewarn "You have already a MySQL database in place." + ewarn "(${ROOT}/${MY_DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." + die "MySQL database already exists!" + fi + + # Bug #213475 - MySQL _will_ object strenously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then + + einfo "Please provide a password for the mysql 'root' user now" + einfo "or through the ${HOME}/.my.cnf file." + ewarn "Avoid [\"'\\_%] characters in the password" + read -rsp " >" pwd1 ; echo + + einfo "Retype the password" + read -rsp " >" pwd2 ; echo + + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same" + fi + MYSQL_ROOT_PASSWORD="${pwd1}" + unset pwd1 pwd2 + fi + + local options + local sqltmp="$(emktemp)" + + # Fix bug 446200. Don't reference host my.cnf, needs to come first, + # see https://bugs.mysql.com/bug.php?id=31312 + use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" + + # Figure out which options we need to disable to do the setup + local helpfile="${TMPDIR}/mysqld-help" + "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null + for opt in grant-tables host-cache name-resolve networking slave-start \ + federated ssl log-bin relay-log slow-query-log external-locking \ + log-slave-updates \ + ; do + optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" + egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" + done + + einfo "Creating the mysql database and setting proper permissions on it ..." + + # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it + PID_DIR="${EROOT}/var/run/mysqld" + if [[ ! -d "${PID_DIR}" ]]; then + install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" + fi + + if [[ ! -d "${MY_DATADIR}" ]]; then + install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" + fi + + pushd "${TMPDIR}" &>/dev/null || die + + # Filling timezones, see + # https://dev.mysql.com/doc/mysql/en/time-zone-support.html + "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null + + local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) + [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) + cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) + einfo "Command: ${cmd[*]}" + su -s /bin/sh -c "${cmd[*]}" mysql \ + >"${TMPDIR}"/mysql_install_db.log 2>&1 + if [ $? -ne 0 ]; then + grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 + die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" + fi + popd &>/dev/null || die + [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ + || die "MySQL databases not installed" + + use prefix || options="${options} --user=mysql" + + local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" + local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" + local mysqld="${EROOT}/usr/sbin/mysqld \ + ${options} \ + --log-warnings=0 \ + --basedir=${EROOT}/usr \ + --datadir=${ROOT}/${MY_DATADIR} \ + --max_allowed_packet=8M \ + --net_buffer_length=16K \ + --socket=${socket} \ + --pid-file=${pidfile} \ + --tmpdir=${ROOT}/${MYSQL_TMPDIR}" + #einfo "About to start mysqld: ${mysqld}" + ebegin "Starting mysqld" + einfo "Command ${mysqld}" + ${mysqld} & + rc=$? + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + eend $rc + + if ! [[ -S "${socket}" ]]; then + die "Completely failed to start up mysqld with: ${mysqld}" + fi + + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -e "${sql}" + eend $? + + if [[ -n "${sqltmp}" ]] ; then + ebegin "Loading \"zoneinfo\", this step may require a few seconds" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -uroot \ + --password="${MYSQL_ROOT_PASSWORD}" \ + mysql < "${sqltmp}" + rc=$? + eend $? + [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" + fi + + # Stop the server and cleanup + einfo "Stopping the server ..." + kill $(< "${pidfile}" ) + rm -f "${sqltmp}" + wait %1 + einfo "Done" +} diff --git a/dev-db/mariadb/mariadb-10.2.26.ebuild b/dev-db/mariadb/mariadb-10.2.26.ebuild deleted file mode 100644 index 5e2edb0efa6b..000000000000 --- a/dev-db/mariadb/mariadb-10.2.26.ebuild +++ /dev/null @@ -1,975 +0,0 @@ -# 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 auth_ed25519 ) - 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_CLIENT_ED25519=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 \ - main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do - _disable_test "$t" "False positives in Gentoo" - done - - _disable_test main.gis_notembedded "Needs latin1 USE set" - _disable_test main.plugin_auth "Needs client libraries built" - _disable_test plugins.auth_ed25519 "Needs client libraries built" - _disable_test main.mysqldump "Test fails past 2018-12-31 due to event expiration" - - # Likely environment issues as only number of clients connected fails - _disable_test rpl.rpl_semi_sync_uninstall_plugin \ - "Fails intermittently on parallel testing" - - # run mysql-test tests - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" - retstatus_tests=$? - - popd > /dev/null || die - - # Cleanup is important for these testcases. - pkill -9 -f "${S}/ndb" 2>/dev/null - pkill -9 -f "${S}/sql" 2>/dev/null - - local failures="" - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" - - [[ -z "$failures" ]] || die "Test failures: $failures" - einfo "Tests successfully completed" -} - -mysql_init_vars() { - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} - MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} - MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} - MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} - - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR="" - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then - MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ - | sed -ne '/datadir/s|^--datadir=||p' \ - | tail -n1` - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ - | sed -e 's/.*=\s*//' \ - | tail -n1` - fi - fi - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR="${MY_LOCALSTATEDIR}" - einfo "Using default MY_DATADIR" - fi - elog "MySQL MY_DATADIR is ${MY_DATADIR}" - - if [[ -z "${PREVIOUS_DATADIR}" ]] ; then - if [[ -e "${MY_DATADIR}" ]] ; then - # If you get this and you're wondering about it, see bug #207636 - elog "MySQL datadir found in ${MY_DATADIR}" - elog "A new one will not be created." - PREVIOUS_DATADIR="yes" - else - PREVIOUS_DATADIR="no" - fi - export PREVIOUS_DATADIR - fi - else - if [[ ${EBUILD_PHASE} == "config" ]]; then - local new_MY_DATADIR - new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ - | sed -ne '/datadir/s|^--datadir=||p' \ - | tail -n1` - - if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then - ewarn "MySQL MY_DATADIR has changed" - ewarn "from ${MY_DATADIR}" - ewarn "to ${new_MY_DATADIR}" - MY_DATADIR="${new_MY_DATADIR}" - fi - fi - fi - - export MY_SHAREDSTATEDIR MY_SYSCONFDIR - export MY_LOCALSTATEDIR MY_LOGDIR - export MY_DATADIR -} - -pkg_config() { - _getoptval() { - local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults - local section="$1" - local flag="--${2}=" - local extra_options="${3}" - "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" - } - local old_MY_DATADIR="${MY_DATADIR}" - local old_HOME="${HOME}" - # my_print_defaults needs to read stuff in $HOME/.my.cnf - export HOME=${EPREFIX}/root - - # Make sure the vars are correctly initialized - mysql_init_vars - - [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" - if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then - die "Minimal builds do NOT include the MySQL server" - fi - - if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then - local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" - MY_DATADIR_s="${MY_DATADIR_s%%/}" - local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" - old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" - - if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then - if [[ -d "${MY_DATADIR_s}" ]]; then - ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" - ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" - else - elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" - mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ - || die "Moving MY_DATADIR failed" - fi - else - ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" - if [[ -d "${MY_DATADIR_s}" ]]; then - ewarn "Attempting to use ${MY_DATADIR_s}" - else - eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" - die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" - fi - fi - fi - - local pwd1="a" - local pwd2="b" - local maxtry=15 - - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then - local tmp_mysqld_password_source= - - for tmp_mysqld_password_source in mysql client; do - einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then - if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then - ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" - MYSQL_ROOT_PASSWORD= - continue - fi - - einfo "Found password in '${tmp_mysqld_password_source}' section!" - break - fi - done - - # Sometimes --show is required to display passwords in some implementations of my_print_defaults - if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" - fi - - unset tmp_mysqld_password_source - fi - MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" - MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} - - if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" - fi - if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then - einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" - fi - if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then - einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" - fi - - if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then - ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${MY_DATADIR}/*)" - ewarn "Please rename or delete it if you wish to replace it." - die "MySQL database already exists!" - fi - - # Bug #213475 - MySQL _will_ object strenously if your machine is named - # localhost. Also causes weird failures. - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" - - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then - - einfo "Please provide a password for the mysql 'root' user now" - einfo "or through the ${HOME}/.my.cnf file." - ewarn "Avoid [\"'\\_%] characters in the password" - read -rsp " >" pwd1 ; echo - - einfo "Retype the password" - read -rsp " >" pwd2 ; echo - - if [[ "x$pwd1" != "x$pwd2" ]] ; then - die "Passwords are not the same" - fi - MYSQL_ROOT_PASSWORD="${pwd1}" - unset pwd1 pwd2 - fi - - local options - local sqltmp="$(emktemp)" - - # Fix bug 446200. Don't reference host my.cnf, needs to come first, - # see https://bugs.mysql.com/bug.php?id=31312 - use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" - - # Figure out which options we need to disable to do the setup - local helpfile="${TMPDIR}/mysqld-help" - "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null - for opt in grant-tables host-cache name-resolve networking slave-start \ - federated ssl log-bin relay-log slow-query-log external-locking \ - log-slave-updates \ - ; do - optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" - egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" - done - - einfo "Creating the mysql database and setting proper permissions on it ..." - - # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it - PID_DIR="${EROOT}/var/run/mysqld" - if [[ ! -d "${PID_DIR}" ]]; then - install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" - fi - - if [[ ! -d "${MY_DATADIR}" ]]; then - install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" - fi - - pushd "${TMPDIR}" &>/dev/null || die - - # Filling timezones, see - # https://dev.mysql.com/doc/mysql/en/time-zone-support.html - "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null - - local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) - [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) - cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) - einfo "Command: ${cmd[*]}" - su -s /bin/sh -c "${cmd[*]}" mysql \ - >"${TMPDIR}"/mysql_install_db.log 2>&1 - if [ $? -ne 0 ]; then - grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 - die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" - fi - popd &>/dev/null || die - [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ - || die "MySQL databases not installed" - - use prefix || options="${options} --user=mysql" - - local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" - local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" - local mysqld="${EROOT}/usr/sbin/mysqld \ - ${options} \ - --log-warnings=0 \ - --basedir=${EROOT}/usr \ - --datadir=${ROOT}/${MY_DATADIR} \ - --max_allowed_packet=8M \ - --net_buffer_length=16K \ - --socket=${socket} \ - --pid-file=${pidfile} \ - --tmpdir=${ROOT}/${MYSQL_TMPDIR}" - #einfo "About to start mysqld: ${mysqld}" - ebegin "Starting mysqld" - einfo "Command ${mysqld}" - ${mysqld} & - rc=$? - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do - maxtry=$((${maxtry}-1)) - echo -n "." - sleep 1 - done - eend $rc - - if ! [[ -S "${socket}" ]]; then - die "Completely failed to start up mysqld with: ${mysqld}" - fi - - ebegin "Setting root password" - # Do this from memory, as we don't want clear text passwords in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - eend $? - - if [[ -n "${sqltmp}" ]] ; then - ebegin "Loading \"zoneinfo\", this step may require a few seconds" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -uroot \ - --password="${MYSQL_ROOT_PASSWORD}" \ - mysql < "${sqltmp}" - rc=$? - eend $? - [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" - fi - - # Stop the server and cleanup - einfo "Stopping the server ..." - kill $(< "${pidfile}" ) - rm -f "${sqltmp}" - wait %1 - einfo "Done" -} diff --git a/dev-db/mariadb/mariadb-10.3.17-r1.ebuild b/dev-db/mariadb/mariadb-10.3.17-r1.ebuild new file mode 100644 index 000000000000..0c288122d446 --- /dev/null +++ b/dev-db/mariadb/mariadb-10.3.17-r1.ebuild @@ -0,0 +1,982 @@ +# 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 + "${FILESDIR}/MDEV-20247-replication-10.2.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 auth_ed25519 ) + 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 + + # Don't clash with dev-db/mysql-connector-c + sed -i -e 's/ my_print_defaults.1//' \ + -e 's/ perror.1//' \ + "${S}"/man/CMakeLists.txt || die + + 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_CLIENT_ED25519=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 main.gis_notembedded \ + 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 plugins.auth_ed25519 "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 | tail -n1)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" + MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} + + if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then + einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" + fi + if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then + einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" + fi + if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then + einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" + fi + + if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then + ewarn "You have already a MySQL database in place." + ewarn "(${ROOT}/${MY_DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." + die "MySQL database already exists!" + fi + + # Bug #213475 - MySQL _will_ object strenously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then + + einfo "Please provide a password for the mysql 'root' user now" + einfo "or through the ${HOME}/.my.cnf file." + ewarn "Avoid [\"'\\_%] characters in the password" + read -rsp " >" pwd1 ; echo + + einfo "Retype the password" + read -rsp " >" pwd2 ; echo + + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same" + fi + MYSQL_ROOT_PASSWORD="${pwd1}" + unset pwd1 pwd2 + fi + + local options + local sqltmp="$(emktemp)" + + # Fix bug 446200. Don't reference host my.cnf, needs to come first, + # see https://bugs.mysql.com/bug.php?id=31312 + use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" + + # Figure out which options we need to disable to do the setup + local helpfile="${TMPDIR}/mysqld-help" + "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null + for opt in grant-tables host-cache name-resolve networking slave-start \ + federated ssl log-bin relay-log slow-query-log external-locking \ + log-slave-updates \ + ; do + optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" + egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" + done + + einfo "Creating the mysql database and setting proper permissions on it ..." + + # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it + PID_DIR="${EROOT}/var/run/mysqld" + if [[ ! -d "${PID_DIR}" ]]; then + install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" + fi + + if [[ ! -d "${MY_DATADIR}" ]]; then + install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" + fi + + pushd "${TMPDIR}" &>/dev/null || die + + # Filling timezones, see + # https://dev.mysql.com/doc/mysql/en/time-zone-support.html + "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null + + local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) + [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) + cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) + einfo "Command: ${cmd[*]}" + su -s /bin/sh -c "${cmd[*]}" mysql \ + >"${TMPDIR}"/mysql_install_db.log 2>&1 + if [ $? -ne 0 ]; then + grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 + die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" + fi + popd &>/dev/null || die + [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ + || die "MySQL databases not installed" + + use prefix || options="${options} --user=mysql" + + local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" + local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" + local mysqld="${EROOT}/usr/sbin/mysqld \ + ${options} \ + --log-warnings=0 \ + --basedir=${EROOT}/usr \ + --datadir=${ROOT}/${MY_DATADIR} \ + --max_allowed_packet=8M \ + --net_buffer_length=16K \ + --socket=${socket} \ + --pid-file=${pidfile} \ + --tmpdir=${ROOT}/${MYSQL_TMPDIR}" + #einfo "About to start mysqld: ${mysqld}" + ebegin "Starting mysqld" + einfo "Command ${mysqld}" + ${mysqld} & + rc=$? + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + eend $rc + + if ! [[ -S "${socket}" ]]; then + die "Completely failed to start up mysqld with: ${mysqld}" + fi + + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -e "${sql}" + eend $? + + if [[ -n "${sqltmp}" ]] ; then + ebegin "Loading \"zoneinfo\", this step may require a few seconds" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -uroot \ + --password="${MYSQL_ROOT_PASSWORD}" \ + mysql < "${sqltmp}" + rc=$? + eend $? + [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" + fi + + # Stop the server and cleanup + einfo "Stopping the server ..." + kill $(< "${pidfile}" ) + rm -f "${sqltmp}" + wait %1 + einfo "Done" +} diff --git a/dev-db/mariadb/mariadb-10.3.17.ebuild b/dev-db/mariadb/mariadb-10.3.17.ebuild deleted file mode 100644 index 958d9f1cb1ed..000000000000 --- a/dev-db/mariadb/mariadb-10.3.17.ebuild +++ /dev/null @@ -1,976 +0,0 @@ -# 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 auth_ed25519 ) - 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_CLIENT_ED25519=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 main.gis_notembedded \ - 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 plugins.auth_ed25519 "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 | tail -n1)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" - MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} - - if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" - fi - if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then - einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" - fi - if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then - einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" - fi - - if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then - ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${MY_DATADIR}/*)" - ewarn "Please rename or delete it if you wish to replace it." - die "MySQL database already exists!" - fi - - # Bug #213475 - MySQL _will_ object strenously if your machine is named - # localhost. Also causes weird failures. - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" - - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then - - einfo "Please provide a password for the mysql 'root' user now" - einfo "or through the ${HOME}/.my.cnf file." - ewarn "Avoid [\"'\\_%] characters in the password" - read -rsp " >" pwd1 ; echo - - einfo "Retype the password" - read -rsp " >" pwd2 ; echo - - if [[ "x$pwd1" != "x$pwd2" ]] ; then - die "Passwords are not the same" - fi - MYSQL_ROOT_PASSWORD="${pwd1}" - unset pwd1 pwd2 - fi - - local options - local sqltmp="$(emktemp)" - - # Fix bug 446200. Don't reference host my.cnf, needs to come first, - # see https://bugs.mysql.com/bug.php?id=31312 - use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" - - # Figure out which options we need to disable to do the setup - local helpfile="${TMPDIR}/mysqld-help" - "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null - for opt in grant-tables host-cache name-resolve networking slave-start \ - federated ssl log-bin relay-log slow-query-log external-locking \ - log-slave-updates \ - ; do - optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" - egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" - done - - einfo "Creating the mysql database and setting proper permissions on it ..." - - # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it - PID_DIR="${EROOT}/var/run/mysqld" - if [[ ! -d "${PID_DIR}" ]]; then - install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" - fi - - if [[ ! -d "${MY_DATADIR}" ]]; then - install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory" - fi - - pushd "${TMPDIR}" &>/dev/null || die - - # Filling timezones, see - # https://dev.mysql.com/doc/mysql/en/time-zone-support.html - "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null - - local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" ) - [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) - cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) - einfo "Command: ${cmd[*]}" - su -s /bin/sh -c "${cmd[*]}" mysql \ - >"${TMPDIR}"/mysql_install_db.log 2>&1 - if [ $? -ne 0 ]; then - grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 - die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" - fi - popd &>/dev/null || die - [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ - || die "MySQL databases not installed" - - use prefix || options="${options} --user=mysql" - - local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" - local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" - local mysqld="${EROOT}/usr/sbin/mysqld \ - ${options} \ - --log-warnings=0 \ - --basedir=${EROOT}/usr \ - --datadir=${ROOT}/${MY_DATADIR} \ - --max_allowed_packet=8M \ - --net_buffer_length=16K \ - --socket=${socket} \ - --pid-file=${pidfile} \ - --tmpdir=${ROOT}/${MYSQL_TMPDIR}" - #einfo "About to start mysqld: ${mysqld}" - ebegin "Starting mysqld" - einfo "Command ${mysqld}" - ${mysqld} & - rc=$? - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do - maxtry=$((${maxtry}-1)) - echo -n "." - sleep 1 - done - eend $rc - - if ! [[ -S "${socket}" ]]; then - die "Completely failed to start up mysqld with: ${mysqld}" - fi - - ebegin "Setting root password" - # Do this from memory, as we don't want clear text passwords in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - eend $? - - if [[ -n "${sqltmp}" ]] ; then - ebegin "Loading \"zoneinfo\", this step may require a few seconds" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -uroot \ - --password="${MYSQL_ROOT_PASSWORD}" \ - mysql < "${sqltmp}" - rc=$? - eend $? - [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" - fi - - # Stop the server and cleanup - einfo "Stopping the server ..." - kill $(< "${pidfile}" ) - rm -f "${sqltmp}" - wait %1 - einfo "Done" -} diff --git a/dev-db/mariadb/mariadb-10.4.7-r1.ebuild b/dev-db/mariadb/mariadb-10.4.7-r1.ebuild new file mode 100644 index 000000000000..5e4da733a884 --- /dev/null +++ b/dev-db/mariadb/mariadb-10.4.7-r1.ebuild @@ -0,0 +1,1010 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +MY_EXTRAS_VER="20190731-2258Z" +SUBSLOT="18" + +JAVA_PKG_OPT_USE="jdbc" + +inherit eutils systemd flag-o-matic prefix toolchain-funcs \ + java-pkg-opt-2 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 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.4.5-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 + "${FILESDIR}/MDEV-20247-replication-10.2.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= +" +BDEPEND="virtual/yacc + || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) +" +DEPEND="static? ( sys-libs/ncurses[static-libs] ) + server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) + test? ( acct-group/mysql acct-user/mysql ) ) + ${COMMON_DEPEND}" +RDEPEND="selinux? ( sec-policy/selinux-mysql ) + !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster + !=virtual/jre-1.6 ) ) + ) + perl? ( !dev-db/mytop + virtual/perl-Getopt-Long + dev-perl/TermReadKey + virtual/perl-Term-ANSIColor + virtual/perl-Time-HiRes ) +" +# For other stuff to bring us in +# dev-perl/DBD-mysql is needed by some scripts installed by MySQL +PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) + 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 + +} + +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 + chown mysql:mysql "${EROOT}/usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir" || die + 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 [[ -n "${REPLACING_VERSIONS}" ]] ; then + local rver + for rver in ${REPLACING_VERSIONS} ; do + if ver_test "${rver}" -lt "10.4.0" ; then + ewarn "Upgrading galera from a previous version requires admin restart of the entire cluster." + ewarn "Please refer to https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-104/#galera-4" + ewarn "for more information" + fi + done + 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/_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 auth_ed25519 ) + 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 + echo > "${S}/plugin/auth_pam/testing/CMakeLists.txt" || die + 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 + + # Fix static bindings in galera replication + sed -i -e 's~add_library(wsrep_api_v26$~add_library(wsrep_api_v26 STATIC~' \ + "${S}"/wsrep-lib/wsrep-API/CMakeLists.txt || die + sed -i -e 's~add_library(wsrep-lib$~add_library(wsrep-lib STATIC~' \ + "${S}"/wsrep-lib/src/CMakeLists.txt || die + + # Don't clash with dev-db/mysql-connector-c + sed -i -e 's/ my_print_defaults.1//' \ + -e 's/ perror.1//' \ + "${S}"/man/CMakeLists.txt || die + + 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_CLIENT_ED25519=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" + + if use pam ; then + keepdir /usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir + fi + 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 \ + main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do + _disable_test "$t" "False positives in Gentoo" + done + + for t in funcs_1.is_columns_mysql main.gis_notembedded main.information_schema \ + main.mysql_upgrade main.system_mysql_db ; do + _disable_test "$t" "Failure for difference between latin1 and utf-8" + done + + _disable_test main.plugin_auth "Needs client libraries built" + _disable_test plugins.auth_ed25519 "Needs client libraries built" + + _disable_test main.func_time "Dependent on time test was written" + + _disable_test compat/oracle.plugin "Needs example plugin which Gentoo disables" + + # run mysql-test tests + perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" + retstatus_tests=$? + + popd > /dev/null || die + + # Cleanup is important for these testcases. + pkill -9 -f "${S}/ndb" 2>/dev/null + pkill -9 -f "${S}/sql" 2>/dev/null + + local failures="" + [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" + [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" + + [[ -z "$failures" ]] || die "Test failures: $failures" + einfo "Tests successfully completed" +} + +mysql_init_vars() { + MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} + MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} + MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} + MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} + + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="" + if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then + MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ + | sed -e 's/.*=\s*//' \ + | tail -n1` + fi + fi + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="${MY_LOCALSTATEDIR}" + einfo "Using default MY_DATADIR" + fi + elog "MySQL MY_DATADIR is ${MY_DATADIR}" + + if [[ -z "${PREVIOUS_DATADIR}" ]] ; then + if [[ -e "${MY_DATADIR}" ]] ; then + # If you get this and you're wondering about it, see bug #207636 + elog "MySQL datadir found in ${MY_DATADIR}" + elog "A new one will not be created." + PREVIOUS_DATADIR="yes" + else + PREVIOUS_DATADIR="no" + fi + export PREVIOUS_DATADIR + fi + else + if [[ ${EBUILD_PHASE} == "config" ]]; then + local new_MY_DATADIR + new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then + ewarn "MySQL MY_DATADIR has changed" + ewarn "from ${MY_DATADIR}" + ewarn "to ${new_MY_DATADIR}" + MY_DATADIR="${new_MY_DATADIR}" + fi + fi + fi + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LOCALSTATEDIR MY_LOGDIR + export MY_DATADIR +} + +pkg_config() { + _getoptval() { + local mypd="${EROOT}"/usr/libexec/mariadb/my_print_defaults + local section="$1" + local flag="--${2}=" + local extra_options="${3}" + "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" + } + local old_MY_DATADIR="${MY_DATADIR}" + local old_HOME="${HOME}" + # my_print_defaults needs to read stuff in $HOME/.my.cnf + export HOME=${EPREFIX}/root + + # Make sure the vars are correctly initialized + mysql_init_vars + + [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" + if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then + die "Minimal builds do NOT include the MySQL server" + fi + + if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then + local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" + MY_DATADIR_s="${MY_DATADIR_s%%/}" + local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" + old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" + + if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then + if [[ -d "${MY_DATADIR_s}" ]]; then + ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" + ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" + else + elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" + mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ + || die "Moving MY_DATADIR failed" + fi + else + ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" + if [[ -d "${MY_DATADIR_s}" ]]; then + ewarn "Attempting to use ${MY_DATADIR_s}" + else + eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" + die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" + fi + fi + fi + + local pwd1="a" + local pwd2="b" + local maxtry=15 + + if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then + local tmp_mysqld_password_source= + + for tmp_mysqld_password_source in mysql client; do + einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" + if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then + if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then + ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" + MYSQL_ROOT_PASSWORD= + continue + fi + + einfo "Found password in '${tmp_mysqld_password_source}' section!" + break + fi + done + + # Sometimes --show is required to display passwords in some implementations of my_print_defaults + if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" + fi + + unset tmp_mysqld_password_source + fi + MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" + # These are dir+prefix + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" + MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} + + if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then + einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" + fi + if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then + einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" + fi + if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then + einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" + install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" + fi + + if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then + ewarn "You have already a MySQL database in place." + ewarn "(${ROOT}/${MY_DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." + die "MySQL database already exists!" + fi + + # Bug #213475 - MySQL _will_ object strenously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]]; then + + einfo "Please provide a password for the mysql 'root'@'localhost' user now" + einfo "or through the ${HOME}/.my.cnf file." + ewarn "Avoid [\"'\\_%] characters in the password" + einfo "Not entering a password defaults to UNIX authentication" + read -rsp " >" pwd1 ; echo + + if [[ -n "${pwd1}" ]] ; then + + 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}" + fi + 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 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" + + if [[ -z ${sqltmp} && -z ${MYSQL_ROOT_PASSWORD} ]] ; then + einfo "Done" + exit 0 + fi + + 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 + + [[ -S "${socket}" ]] || + die "Completely failed to start up mysqld with: ${mysqld}" + + if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}')" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -e "${sql}" + unset sql + eend $? + fi + + 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.4.7.ebuild b/dev-db/mariadb/mariadb-10.4.7.ebuild deleted file mode 100644 index ca6d9f79031e..000000000000 --- a/dev-db/mariadb/mariadb-10.4.7.ebuild +++ /dev/null @@ -1,998 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -MY_EXTRAS_VER="20190731-2258Z" -SUBSLOT="18" - -JAVA_PKG_OPT_USE="jdbc" - -inherit eutils systemd flag-o-matic prefix toolchain-funcs \ - java-pkg-opt-2 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 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.4.5-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= -" -BDEPEND="virtual/yacc - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) -" -DEPEND="static? ( sys-libs/ncurses[static-libs] ) - server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) - test? ( acct-group/mysql acct-user/mysql ) ) - ${COMMON_DEPEND}" -RDEPEND="selinux? ( sec-policy/selinux-mysql ) - !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster - !=virtual/jre-1.6 ) ) - ) - perl? ( !dev-db/mytop - virtual/perl-Getopt-Long - dev-perl/TermReadKey - virtual/perl-Term-ANSIColor - virtual/perl-Time-HiRes ) -" -# For other stuff to bring us in -# dev-perl/DBD-mysql is needed by some scripts installed by MySQL -PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 ) - 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 - -} - -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 - chown mysql:mysql "${EROOT}/usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir" || die - 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 [[ -n "${REPLACING_VERSIONS}" ]] ; then - local rver - for rver in ${REPLACING_VERSIONS} ; do - if ver_test "${rver}" -lt "10.4.0" ; then - ewarn "Upgrading galera from a previous version requires admin restart of the entire cluster." - ewarn "Please refer to https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-104/#galera-4" - ewarn "for more information" - fi - done - 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/_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 auth_ed25519 ) - 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 - echo > "${S}/plugin/auth_pam/testing/CMakeLists.txt" || die - 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_CLIENT_ED25519=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" - - if use pam ; then - keepdir /usr/$(get_libdir)/mariadb/plugin/auth_pam_tool_dir - fi - 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 \ - main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do - _disable_test "$t" "False positives in Gentoo" - done - - for t in funcs_1.is_columns_mysql main.gis_notembedded main.information_schema \ - main.mysql_upgrade main.system_mysql_db ; do - _disable_test "$t" "Failure for difference between latin1 and utf-8" - done - - _disable_test main.plugin_auth "Needs client libraries built" - _disable_test plugins.auth_ed25519 "Needs client libraries built" - - _disable_test main.func_time "Dependent on time test was written" - - _disable_test compat/oracle.plugin "Needs example plugin which Gentoo disables" - - # run mysql-test tests - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" - retstatus_tests=$? - - popd > /dev/null || die - - # Cleanup is important for these testcases. - pkill -9 -f "${S}/ndb" 2>/dev/null - pkill -9 -f "${S}/sql" 2>/dev/null - - local failures="" - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" - - [[ -z "$failures" ]] || die "Test failures: $failures" - einfo "Tests successfully completed" -} - -mysql_init_vars() { - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"} - MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} - MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} - MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} - - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR="" - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then - MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ - | sed -ne '/datadir/s|^--datadir=||p' \ - | tail -n1` - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ - | sed -e 's/.*=\s*//' \ - | tail -n1` - fi - fi - if [[ -z "${MY_DATADIR}" ]] ; then - MY_DATADIR="${MY_LOCALSTATEDIR}" - einfo "Using default MY_DATADIR" - fi - elog "MySQL MY_DATADIR is ${MY_DATADIR}" - - if [[ -z "${PREVIOUS_DATADIR}" ]] ; then - if [[ -e "${MY_DATADIR}" ]] ; then - # If you get this and you're wondering about it, see bug #207636 - elog "MySQL datadir found in ${MY_DATADIR}" - elog "A new one will not be created." - PREVIOUS_DATADIR="yes" - else - PREVIOUS_DATADIR="no" - fi - export PREVIOUS_DATADIR - fi - else - if [[ ${EBUILD_PHASE} == "config" ]]; then - local new_MY_DATADIR - new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ - | sed -ne '/datadir/s|^--datadir=||p' \ - | tail -n1` - - if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then - ewarn "MySQL MY_DATADIR has changed" - ewarn "from ${MY_DATADIR}" - ewarn "to ${new_MY_DATADIR}" - MY_DATADIR="${new_MY_DATADIR}" - fi - fi - fi - - export MY_SHAREDSTATEDIR MY_SYSCONFDIR - export MY_LOCALSTATEDIR MY_LOGDIR - export MY_DATADIR -} - -pkg_config() { - _getoptval() { - local mypd="${EROOT}"/usr/libexec/mariadb/my_print_defaults - local section="$1" - local flag="--${2}=" - local extra_options="${3}" - "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" - } - local old_MY_DATADIR="${MY_DATADIR}" - local old_HOME="${HOME}" - # my_print_defaults needs to read stuff in $HOME/.my.cnf - export HOME=${EPREFIX}/root - - # Make sure the vars are correctly initialized - mysql_init_vars - - [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" - if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then - die "Minimal builds do NOT include the MySQL server" - fi - - if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then - local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" - MY_DATADIR_s="${MY_DATADIR_s%%/}" - local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" - old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" - - if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then - if [[ -d "${MY_DATADIR_s}" ]]; then - ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" - ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" - else - elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}" - mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ - || die "Moving MY_DATADIR failed" - fi - else - ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist" - if [[ -d "${MY_DATADIR_s}" ]]; then - ewarn "Attempting to use ${MY_DATADIR_s}" - else - eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist" - die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}" - fi - fi - fi - - local pwd1="a" - local pwd2="b" - local maxtry=15 - - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then - local tmp_mysqld_password_source= - - for tmp_mysqld_password_source in mysql client; do - einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then - if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then - ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" - MYSQL_ROOT_PASSWORD= - continue - fi - - einfo "Found password in '${tmp_mysqld_password_source}' section!" - break - fi - done - - # Sometimes --show is required to display passwords in some implementations of my_print_defaults - if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" - fi - - unset tmp_mysqld_password_source - fi - MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)" - # These are dir+prefix - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)" - MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} - - if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" - fi - if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then - einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN" - fi - if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then - einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG" - fi - - if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then - ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${MY_DATADIR}/*)" - ewarn "Please rename or delete it if you wish to replace it." - die "MySQL database already exists!" - fi - - # Bug #213475 - MySQL _will_ object strenously if your machine is named - # localhost. Also causes weird failures. - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" - - if [[ -z "${MYSQL_ROOT_PASSWORD}" ]]; then - - einfo "Please provide a password for the mysql 'root'@'localhost' user now" - einfo "or through the ${HOME}/.my.cnf file." - ewarn "Avoid [\"'\\_%] characters in the password" - einfo "Not entering a password defaults to UNIX authentication" - read -rsp " >" pwd1 ; echo - - if [[ -n "${pwd1}" ]] ; then - - 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}" - fi - 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 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" - - if [[ -z ${sqltmp} && -z ${MYSQL_ROOT_PASSWORD} ]] ; then - einfo "Done" - exit 0 - fi - - 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 - - [[ -S "${socket}" ]] || - die "Completely failed to start up mysqld with: ${mysqld}" - - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then - ebegin "Setting root password" - # Do this from memory, as we don't want clear text passwords in temp files - local sql="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}')" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - unset sql - eend $? - fi - - 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-5.5.65.ebuild b/dev-db/mariadb/mariadb-5.5.65.ebuild index c09952b96da1..25cab0615e82 100644 --- a/dev-db/mariadb/mariadb-5.5.65.ebuild +++ b/dev-db/mariadb/mariadb-5.5.65.ebuild @@ -229,6 +229,11 @@ src_prepare() { _disable_engine oqgraph fi + # Don't clash with dev-db/mysql-connector-c + sed -i -e 's/ my_print_defaults.1//' \ + -e 's/ perror.1//' \ + "${S}"/man/CMakeLists.txt || die + cmake-utils_src_prepare } diff --git a/dev-db/mongodb/Manifest b/dev-db/mongodb/Manifest index 033dd9756bf2..14836ef5ef82 100644 --- a/dev-db/mongodb/Manifest +++ b/dev-db/mongodb/Manifest @@ -1,5 +1,3 @@ -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 AUX mongodb-3.6.1-fix-scons.patch 1207 BLAKE2B 3c47d72eb940d67f40e4a12becb6de469255446b74aa5e0b2f27e8e0021e77f1af9cce12ae26ed0b05871e995e29d3da1eaee718997bc6de6e62838285946094 SHA512 70efb9309ff5a2415cec6ddca694c33ebaba29d5fb959ecc79907218205a10d4e7329fe48c8c8515bda83751061245d41f4fb11a5d8cd0c80c1db61217acb90e AUX mongodb-3.6.1-no-compass.patch 2046 BLAKE2B e6b6977b69eb297c6a6340661f906e0206c2b68a1cebfd3c7ca01b27cc05562e0909531a2488159a54db32a05ec0cc4f81b4fe675db51bf3c30d66bc9d484c0b SHA512 5a7257a3670f40453c424ae2e6d2bbe0e3d1c795b57351c24a1b48ea4134146b08310d88a47cbb0c94a0a451a2c4a3c30fb10c44a1b9203681ee9cb5240db412 @@ -12,20 +10,12 @@ AUX mongodb.service 220 BLAKE2B ea55bb2f08066d7399e9e66f981f86395f6a177faa198c66 AUX mongos.conf-r2 648 BLAKE2B 420bebfafc1ef4af4b90580077a803fe30f37d63eca6509e7381ca5fcf4e5bc31e136dfc72b653b4d942fdeda058f9fcecc3dcbec9c61e2c82ac3324b9fc0f44 SHA512 5aa8ced8d83572358e008c0df45dbe72a2e9c0003c9f49514d6b91bf9b75d4fb48b189ffe00d14e5675679943a05215a9873c5c9bde9ab1be4ed4813e75714e3 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.11.tar.gz 40581959 BLAKE2B 86244472ce8cff5180d8833a3415dd8a43fb5c76545034822989d5be90f45ed0ef1d43cb726be1e53241255491a7a516e6f90b1c1218ad10cf4ead4557311088 SHA512 e74af9f2f40ab0e2c20b135db3f0ce17825cfe5da912ff8edb2902226abb662a6cf87038ea57df73b06b4961ba71aa78fffd542153eb30c4ea2729d642b1091d -DIST mongodb-src-r3.6.12.tar.gz 40847074 BLAKE2B 45cc0ec4858fa4c17fb86449e6feaf11df32fd55f8a642031ce9be967127d608842cdc64e0a335af67ab3942a233d905b0778782e54dfe4c5d2ad58b828745ca SHA512 173112a05234e06ef4b6c26a092b285b4d12618b3f131fc2b73bd152c11ec42db11cb003566efefce0c98df87a520d0515a3bb1982ffdb27827cd032b1bb3f68 DIST mongodb-src-r3.6.13.tar.gz 40853787 BLAKE2B de9621de4f570d569df5cfe026ea5da24641c97f1ac9f3e58a0706b1d0bd74757390a075c95c6d3acd12f3c5c7bcbeb9302ac997248c54a5b7910b582debdc82 SHA512 eb84fb22ff871b5ec620d6fc29a6a66072211656e914630ad0f53e4fcad55aa40a76a0e68e68bdbe8ef061bea09ce6ad6aea5d8d865ea8a8fdca0ed829555fcd DIST mongodb-src-r3.6.8.tar.gz 40428295 BLAKE2B cc02f73cfb49fb38ccabaad5a02610ce73fc41895ce944e48669e254bcbc70c8872a1bd7f8e04371fae4fcd9af2466fd8550367dd1d1da5cee50b86fc5023bf2 SHA512 c981f3269be3bafb59aa89d36c39a801fd7007b60db6c09b4616a559aaf8e50b34cabbdac2b59f23552c0a5112913fba468f7e2ed9a5f4daa3702dcffdf34999 DIST mongodb-src-r4.0.10.tar.gz 49870574 BLAKE2B 1babbfa1a6d8fae390ec37042feff896c402772e832cc5b0b82fc4d531a6487ac2bd8d407c37ca75a76d78bc91cc665bfc3b7b223e6ceaaea2d921b337ef4d19 SHA512 891bfdc0d415515d7aa36aeb0618055ac6815c7d704537b88293226cecc1b677134db621fd90dee3913f4ff8174a888bcf68adee0a243d0f55ef6c0033a4f4b9 -DIST mongodb-src-r4.0.6.tar.gz 49511958 BLAKE2B c372bb858528cb825db4edf11db636ad71c63148b84838f64cefe886b37631482c1e22eb99dfc557c3f51706d1d2f61b893bfd301cdeb8772a2d85ad75f8f48c SHA512 72e04154cf221833522bb0c2cc99acc2a86d20e2dcbf1f8c6ff0a870edf7b2529a55b6821c664805c00c12a311ae374a276ef1e3ccea1ed84fb125bb8726906a -DIST mongodb-src-r4.0.9.tar.gz 49852767 BLAKE2B 1dbbc8c75743f0b5cd780fc5b008107972c810530d5c56d26ddfe3a00935036569b2b9fc5dad341c34e9fcbcc6dfa01565c09c93b52513ad29f003bdcd52a43a SHA512 8b88ac3266fe346f5bb92df404a935ecb8ba8bd202b09d515c08f50dc3c0b71bcd5e715a859c1e050f241d82dfdd54e5e4a96441fa984aae2cd1c74de2acd954 -EBUILD mongodb-3.4.16.ebuild 4086 BLAKE2B 09d968fc68f4a3c717ce1e4b2f714464c04251fa8c241c9492a26f3777fcc458d7d27810530129753756012341924773c46bea0474900dd7289edb7778283187 SHA512 6f29c0d7dcb54403fe689f168652586bc4fae81de2b0d28f284046ab33c1e3ad94fbed3815ba2fd2164eacd12e9f43bdd1943179778175d6fe3097165a2410e0 -EBUILD mongodb-3.6.11.ebuild 4230 BLAKE2B 7dcdae9c745188715aab750f024ec651f9c7af64f00d78d5dd293afca61fd1a8e0cc07bf15ae08bb6b6de8a77c19a81cb3fa1dccbe71b022b237d20462038bc7 SHA512 cb123077b262bc4b17ea31a741cf77c48dca7b24d090d0b7428487daba6112a0f21f1397d6e9e03837edf92ed591ed8c2565a2b29463cb1d4a54b3ab5aca91d5 -EBUILD mongodb-3.6.12.ebuild 4230 BLAKE2B 7dcdae9c745188715aab750f024ec651f9c7af64f00d78d5dd293afca61fd1a8e0cc07bf15ae08bb6b6de8a77c19a81cb3fa1dccbe71b022b237d20462038bc7 SHA512 cb123077b262bc4b17ea31a741cf77c48dca7b24d090d0b7428487daba6112a0f21f1397d6e9e03837edf92ed591ed8c2565a2b29463cb1d4a54b3ab5aca91d5 -EBUILD mongodb-3.6.13.ebuild 4230 BLAKE2B 7dcdae9c745188715aab750f024ec651f9c7af64f00d78d5dd293afca61fd1a8e0cc07bf15ae08bb6b6de8a77c19a81cb3fa1dccbe71b022b237d20462038bc7 SHA512 cb123077b262bc4b17ea31a741cf77c48dca7b24d090d0b7428487daba6112a0f21f1397d6e9e03837edf92ed591ed8c2565a2b29463cb1d4a54b3ab5aca91d5 +DIST mongodb-src-r4.0.12.tar.gz 49937644 BLAKE2B 81044a6d68be6420d30fb2d7386ff29871a696cad94ce5977c1aba60c2ce80e18ccb86492c1947a359ef124332ea82ac3cb0fb73a68f51904a008fdf911aa055 SHA512 802eaf57d56c5e8e217344f10104a201acb6f5abef0065fc1bb8e6ceef13fe489b7ae46ed0d55b5bad50fe3579860b1c1471d224b51b0f15f968278cb5f6a47a +EBUILD mongodb-3.6.13.ebuild 4229 BLAKE2B 6f69c6dcceb362a35ae991575db7898574f0ca6fc6c9c0ea7d1edd462e42f2edb0933004c1eb3ab6a2244e78327a453c0a89722e01082b93ae13ea8f3016c4dd SHA512 11ee8037100c1648fd9c798a15d84836ad2c25a5cc2492e157c589128bf7b1c9553b5ae5d28ab66bfef2047c02ccaf8b1a138f2885e8298ad40d4b6947b377fa EBUILD mongodb-3.6.8.ebuild 4196 BLAKE2B 5c5a72caa94102818cc03de85afc8d4c2818775814a9dd04555db4c1676dda953c8e64e3d222e35e96dfa90a26a18d9825c910f48102c6d574e8de816749523e SHA512 f6f83c1dd60eb8887457135b82194dd16c874678369a3b3a29907406b921502100e6d52d08b4dca6d9777d6d6c6453e6f134b08550304b0321138fb296e259dd -EBUILD mongodb-4.0.10.ebuild 4231 BLAKE2B cbcc36b52afa5d2ff4e6482c801297d88902b9a09576d1ac355d922e4c66333ebf62e2cfdeab51145bc0c1717587eceae4c817e5ce25ba22620fd85b9d14c60b SHA512 98180763eb93b00c464e3930eb6f4aca8b71a85299f3990a1e21be5f882a0eefc94c297919e072504c18c59b661aca851c347c8b06c3b96364abdff17266aab4 -EBUILD mongodb-4.0.6.ebuild 4231 BLAKE2B cbcc36b52afa5d2ff4e6482c801297d88902b9a09576d1ac355d922e4c66333ebf62e2cfdeab51145bc0c1717587eceae4c817e5ce25ba22620fd85b9d14c60b SHA512 98180763eb93b00c464e3930eb6f4aca8b71a85299f3990a1e21be5f882a0eefc94c297919e072504c18c59b661aca851c347c8b06c3b96364abdff17266aab4 -EBUILD mongodb-4.0.9.ebuild 4231 BLAKE2B cbcc36b52afa5d2ff4e6482c801297d88902b9a09576d1ac355d922e4c66333ebf62e2cfdeab51145bc0c1717587eceae4c817e5ce25ba22620fd85b9d14c60b SHA512 98180763eb93b00c464e3930eb6f4aca8b71a85299f3990a1e21be5f882a0eefc94c297919e072504c18c59b661aca851c347c8b06c3b96364abdff17266aab4 +EBUILD mongodb-4.0.10.ebuild 4230 BLAKE2B da38b78fd5fd7cdd301f20d90c870d36720b55b328500aca8e39bad28ce705114be57a046639888748c20cb2a8c8227d9bff9d33d490045f66f6509652c1e5ec SHA512 0f381b81c7b6a10ff7274f1065e3a38f1c801b7c7fd2ec202c2c6bd198b496352218e2fd209456eb772d586fbc3662fded83bf17d328c12c6df619159cbf8bad +EBUILD mongodb-4.0.12.ebuild 4231 BLAKE2B cbcc36b52afa5d2ff4e6482c801297d88902b9a09576d1ac355d922e4c66333ebf62e2cfdeab51145bc0c1717587eceae4c817e5ce25ba22620fd85b9d14c60b SHA512 98180763eb93b00c464e3930eb6f4aca8b71a85299f3990a1e21be5f882a0eefc94c297919e072504c18c59b661aca851c347c8b06c3b96364abdff17266aab4 MISC metadata.xml 901 BLAKE2B f7fde58679ba05518634b82bf5fcc371897165364fe5b023a2ec161790c869de82b4a3dd769d5e1bb450f99679869b60bb1e35beb8d41c54d3448dfca580a7ae SHA512 48f133d396aa31b992bac5f947e5a262b2d07a1016c6d49fa3c86dabb85981edfa332abb867413826762d88051ff3981cc77c2ec92e992d7a231c3b542336e36 diff --git a/dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch b/dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch deleted file mode 100644 index 2dd751fad813..000000000000 --- a/dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/SConstruct 2016-12-27 11:10:06.801949538 +0100 -+++ b/SConstruct 2016-12-27 11:12:40.426407713 +0100 -@@ -1557,7 +1557,6 @@ - # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used. - env.Append( CCFLAGS=["-fno-omit-frame-pointer", - "-fno-strict-aliasing", -- "-ggdb", - "-pthread", - "-Wall", - "-Wsign-compare", -@@ -1568,8 +1567,9 @@ - if not has_option("disable-warnings-as-errors"): - env.Append( CCFLAGS=["-Werror"] ) - -- env.Append( CXXFLAGS=["-Woverloaded-virtual"] ) - env.Append( LINKFLAGS=["-pthread"] ) -+ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] ) -+ env.Append( LINKFLAGS=os.environ['LDFLAGS'] ) - - # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program - # startup. -@@ -1579,10 +1579,10 @@ - env.Append( LINKFLAGS=["-Wl,-z,now"] ) - env.Append( LINKFLAGS=["-rdynamic"] ) - -- env.Append( LIBS=[] ) -+ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] ) - -- #make scons colorgcc friendly -- for key in ('HOME', 'TERM'): -+ #make scons colorgcc, distcc, ccache friendly -+ for key in ('HOME', 'PATH', 'TERM'): - try: - env['ENV'][key] = os.environ[key] - except KeyError: diff --git a/dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch b/dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch deleted file mode 100644 index 868ba73e4421..000000000000 --- a/dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch +++ /dev/null @@ -1,38 +0,0 @@ -From e245cac2b3c18015dee8caddd449532785d15c2b Mon Sep 17 00:00:00 2001 -From: Jason Carey -Date: Mon, 26 Jun 2017 11:09:10 -0400 -Subject: [PATCH] SERVER-29855 Pull major/minor from sys/sysmacros.h - -Per newer versions of glibc: - ----- -error: In the GNU C Library, "major" is defined - by . For historical compatibility, it is - currently defined by as well, but we plan to - remove this soon. To use "major", include - directly. If you did not intend to use a system-defined macro - "major", you should undefine it after including . [-Werror] - string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev) ----- - -Including appears to be the correct solution to quiet -the warning ---- - src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp -index 5a784b25dc7..c43e148d3f4 100644 ---- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp -+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp -@@ -36,6 +36,10 @@ - #include - #include - -+#ifdef __linux__ -+#include -+#endif -+ - #include "mongo/db/mongod_options.h" - #include "mongo/db/storage/mmap_v1/data_file_sync.h" - #include "mongo/db/storage/mmap_v1/dur.h" diff --git a/dev-db/mongodb/mongodb-3.4.16.ebuild b/dev-db/mongodb/mongodb-3.4.16.ebuild deleted file mode 100644 index fb7263b16bfd..000000000000 --- a/dev-db/mongodb/mongodb-3.4.16.ebuild +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright 1999-2018 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -PYTHON_COMPAT=( python2_7 ) - -SCONS_MIN_VERSION="2.3.0" -CHECKREQS_DISK_BUILD="2400M" -CHECKREQS_DISK_USR="512M" -CHECKREQS_MEMORY="1024M" - -inherit check-reqs eapi7-ver eutils flag-o-matic multilib 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="AGPL-3 Apache-2.0" -SLOT="0" -KEYWORDS="~amd64" -IUSE="debug kerberos libressl 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-util/scons - sys-libs/ncurses:0= - sys-libs/readline:0= - debug? ( dev-util/valgrind ) - test? ( - dev-python/pymongo[${PYTHON_USEDEP}] - dev-python/pyyaml[${PYTHON_USEDEP}] - )" -PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )" - -PATCHES=( - "${FILESDIR}/${PN}-3.4.0-fix-scons.patch" - "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch" - "${FILESDIR}/${PN}-3.4.7-no-boost-check.patch" -) - -S=${WORKDIR}/${MY_P} - -pkg_pretend() { - if [[ -n ${REPLACING_VERSIONS} ]]; then - if ver_test "$REPLACING_VERSIONS" -lt 3.2; then - ewarn "To upgrade from a version earlier than the 3.2-series, you must" - ewarn "successively upgrade major releases until you have upgraded" - ewarn "to 3.2-series. Then upgrade to 3.4 series." - 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 -} - -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 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() { - # this one test fails - rm jstests/core/jsHeapLimit.js || die - - "${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" ${PN/db/s} - newconfd "${FILESDIR}/mongos.confd-r3" ${PN/db/s} - - insinto /etc - newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf - newins "${FILESDIR}/mongos.conf-r2" ${PN/db/s}.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-3.6.11.ebuild b/dev-db/mongodb/mongodb-3.6.11.ebuild deleted file mode 100644 index 5806eaa2e2e1..000000000000 --- a/dev-db/mongodb/mongodb-3.6.11.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# 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-3.6.12.ebuild b/dev-db/mongodb/mongodb-3.6.12.ebuild deleted file mode 100644 index 5806eaa2e2e1..000000000000 --- a/dev-db/mongodb/mongodb-3.6.12.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# 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-3.6.13.ebuild b/dev-db/mongodb/mongodb-3.6.13.ebuild index 5806eaa2e2e1..2b4b44431d61 100644 --- a/dev-db/mongodb/mongodb-3.6.13.ebuild +++ b/dev-db/mongodb/mongodb-3.6.13.ebuild @@ -20,7 +20,7 @@ SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz" LICENSE="Apache-2.0 SSPL-1" SLOT="0" -KEYWORDS="~amd64" +KEYWORDS="amd64" IUSE="debug kerberos libressl lto mms-agent ssl test +tools" RDEPEND=">=app-arch/snappy-1.1.3 diff --git a/dev-db/mongodb/mongodb-4.0.10.ebuild b/dev-db/mongodb/mongodb-4.0.10.ebuild index bb2a9fb04dc3..e6fa03c39c26 100644 --- a/dev-db/mongodb/mongodb-4.0.10.ebuild +++ b/dev-db/mongodb/mongodb-4.0.10.ebuild @@ -20,7 +20,7 @@ SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz" LICENSE="Apache-2.0 SSPL-1" SLOT="0" -KEYWORDS="~amd64" +KEYWORDS="amd64" IUSE="debug kerberos libressl lto mms-agent ssl test +tools" RDEPEND=">=app-arch/snappy-1.1.3 diff --git a/dev-db/mongodb/mongodb-4.0.12.ebuild b/dev-db/mongodb/mongodb-4.0.12.ebuild new file mode 100644 index 000000000000..bb2a9fb04dc3 --- /dev/null +++ b/dev-db/mongodb/mongodb-4.0.12.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 deleted file mode 100644 index bb2a9fb04dc3..000000000000 --- a/dev-db/mongodb/mongodb-4.0.6.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# 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.9.ebuild b/dev-db/mongodb/mongodb-4.0.9.ebuild deleted file mode 100644 index bb2a9fb04dc3..000000000000 --- a/dev-db/mongodb/mongodb-4.0.9.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# 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/myodbc/Manifest b/dev-db/myodbc/Manifest index 7fc4774c9a4a..4cab5b402ad6 100644 --- a/dev-db/myodbc/Manifest +++ b/dev-db/myodbc/Manifest @@ -10,7 +10,9 @@ DIST mysql-connector-odbc-5.3.10-src.tar.gz 2646571 BLAKE2B e85e179ee8a54c8c98dd DIST mysql-connector-odbc-5.3.9-linux-debian9-x86-32bit.tar.gz 11501665 BLAKE2B e41dd65d940c0c91c67e6ec4c46ea2c3327e96d372c493635d05833862f2aa73919410a9e9a9c090a6fa65fd29e022a9b088c07a5e11089aee04b3b86005ad1e SHA512 02fcf6ac88f6052206aa55b6fc2b37f499da26e596e8e64b1c20e87dc4a24f745416da56c6e1268feff60321f54cb45864b8d34e055ea2f99da37b6efeedc844 DIST mysql-connector-odbc-5.3.9-linux-debian9-x86-64bit.tar.gz 12013057 BLAKE2B e372cfb6ca49f9f01e9e60d7cd497fc009ec38dee76ca2cfb74cc95213b84ef1eebca85e1400f19c9715c0f9b2ef40fc212196e14189f5506be8d0e887507ce4 SHA512 b54ca167f762b4d8b988b4a91f14dc6a4bf49f55bc639ce8eecc9eba6c11400bd3494d74ef77ebe3348bdefd8fb5b8c1b62b3a6beebb926a1899da17ea4a1b44 DIST mysql-connector-odbc-8.0.16-src.tar.gz 3986610 BLAKE2B c91760f8e0352a57adb5400700d22f52f70d5210d85ff0932f5288f19c917c771ce9ea9abad097d27a9723c585d1029d56c09f6865f634f9c41ad852690e016d SHA512 b7ddcdf635441bc3ed0325a8562f453e42d3c9768b0fe0b42d9b5417e268f4631e3fca3c2adc417c124ede37254c7b1890c792593d846ecaf5b158ce4b4808cd +DIST mysql-connector-odbc-8.0.17-src.tar.gz 3953949 BLAKE2B 6d7fcef89c15d9f421f690291e793f1020b5f77f5e2132f130becd1ceed041887ffce77fda4cbc411d06972f1d488d434c8f132c0778af30a436c6b6e372e59e SHA512 474b107eb5d4c23e10c24dcf37b3787418afbd34ea385791fd0d8cdb5d29a6770cde4a61e3591329b344c442ff8f6daad3a2c250e881f9f5837eaa4e951af7e4 EBUILD myodbc-5.3.10-r2.ebuild 3588 BLAKE2B db9749af6dd80c60ae359485e3526258e43ea7003b2302076b0ef39a72098663b27f9413d050809328fe4348f5c129135f163da8d895f65d8c9f76bd53415eb4 SHA512 33d3aced0bc4575baa860dc53f1a6b35b6a5dc2e1815d88922d66c5270e570deaa0dc20018d9329c4651cef00f48b902b208671dd0836e7224d11972491b9e66 EBUILD myodbc-5.3.9.ebuild 3072 BLAKE2B 4922ed231672f11742590007b7b1f5c5dfa27263a6c98893b373793da06088f29c5401917179d479f4c57b24b2a1be9c3507caa752db79f3268fceff4719013d SHA512 4da8b034a745c453a310391a38e5cb1697bfa51838edc6903ee643e7dbe28fa5fb8f7d34264f88bb79b2aba83fa042212c0a2dd251c15150f7f0a2fcf561e052 EBUILD myodbc-8.0.16.ebuild 3101 BLAKE2B 28664fd845b3bfb251e2f754c06b1b21ac1fb0ce85fbcaf620ff4ebea4ee181fe3c2f7c00ff8b47a084dc2e31a893c35f2d28e6176a4a40d508a6b0ebdfd57cd SHA512 856408b130fad4e4fc70fd48d841a2969aa85df46eeebb1d1476e5054b5d78af8e799463a7314f6db4131e4868146d6838c528b85f5bec1c569230231516a2cc +EBUILD myodbc-8.0.17.ebuild 3111 BLAKE2B 4b0f0391bb0b71fc277da100630891bfca04d4ca87c3852eb728c1ba19c3de875654ee7fc1c5c66de1071f9c732c5bd2203ebd83f3654d616617895fa7a936ed SHA512 c5f960395fdb30f398dd182dafd4b75fcb6d7270ac327637e3d2fe169727cb377ee66a4e46e1a14221fc6c7aa34a617d5da636bc96f909eef772f73ec56b6a00 MISC metadata.xml 239 BLAKE2B c4d6706d083b72927d239f41a644a4009c054c1c1a388af7733d3a2daf47d354009eb472573304a6be272601f05535297bcd9ceaea811a741cd905577ffe53d1 SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b diff --git a/dev-db/myodbc/myodbc-8.0.17.ebuild b/dev-db/myodbc/myodbc-8.0.17.ebuild new file mode 100644 index 000000000000..aabca64a42ab --- /dev/null +++ b/dev-db/myodbc/myodbc-8.0.17.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake-multilib + +MAJOR="$(ver_cut 1-2)" +MY_PN="mysql-connector-odbc" +MY_P="${MY_PN}-${PV/_p/r}-src" + +DESCRIPTION="ODBC driver for MySQL" +HOMEPAGE="https://dev.mysql.com/downloads/connector/odbc/" +SRC_URI="https://dev.mysql.com/get/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="${MAJOR}" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="" + +# Broken when built dynamically against libmysqlclient.so +RDEPEND=" + dev-db/unixODBC[${MULTILIB_USEDEP}] + >=dev-db/mysql-connector-c-8.0:0=[static-libs,${MULTILIB_USEDEP}] +" +DEPEND="${RDEPEND}" +S=${WORKDIR}/${MY_P} + +# Careful! +DRIVER_NAME="${PN}-${SLOT}" + +# Patch document path so it doesn't install files to /usr +PATCHES=( + "${FILESDIR}/${MAJOR}-cmake-doc-path.patch" + "${FILESDIR}/8.0.16-cxxlinkage.patch" +) + +src_prepare() { + # Remove Tests + sed -i -e "s/ADD_SUBDIRECTORY(test)//" \ + "${S}/CMakeLists.txt" + + cmake-utils_src_prepare +} + +multilib_src_configure() { + mycmakeargs+=( + -DMYSQLCLIENT_STATIC_LINKING=1 + -DMYSQL_CXX_LINKAGE=1 + -DWITH_UNIXODBC=1 + -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF} + -DLIB_SUBDIR="$(get_libdir)/${PN}-${MAJOR}" + -DMYSQLCLIENT_NO_THREADS=ON + -DDISABLE_GUI=ON + # The NUMA and LIBWRAP options are not really used. + # They are just copied from the server code + -DWITH_NUMA=OFF + -DWITH_LIBWRAP=OFF + ) + cmake-utils_src_configure +} + +multilib_src_install_all() { + debug-print-function ${FUNCNAME} "$@" + + dodir /usr/share/${PN}-${SLOT} + for i in odbc.ini odbcinst.ini; do + einfo "Building $i" + sed \ + -e "s,__PN__,${DRIVER_NAME},g" \ + -e "s,__PF__,${MAJOR},g" \ + -e "s,lib/libmyodbc3.so,$(get_libdir)/${PN}-${MAJOR}/libmyodbc${SLOT:0:1}a.so,g" \ + >"${D}"/usr/share/${PN}-${SLOT}/${i} \ + <"${FILESDIR}"/${i}.m4 \ + || die "Failed to build $i" + done; + mv "${D}/usr/bin/myodbc-installer" \ + "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary" +} + +pkg_config() { + + [ "${ROOT}" != "/" ] && \ + die 'Sorry, non-standard ROOT setting is not supported :-(' + + local msg='MySQL ODBC driver' + local drivers=$(/usr/bin/odbcinst -q -d) + + if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then + ebegin "Installing ${msg}" + /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini + rc=$? + eend $rc + [ $rc -ne 0 ] && die + else + einfo "Skipping already installed ${msg}" + fi + + local sources=$(/usr/bin/odbcinst -q -s) + msg='sample MySQL ODBC DSN' + if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then + ebegin "Installing ${msg}" + /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini + rc=$? + eend $rc + [ $rc -ne 0 ] && die + else + einfo "Skipping already installed ${msg}" + fi +} + +pkg_postinst() { + + elog "If this is a new install, please run the following command" + elog "to configure the MySQL ODBC drivers and sources:" + elog "emerge --config =${CATEGORY}/${PF}" + elog "Please note that the driver name used to form the DSN now includes the SLOT." + elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}" +} diff --git a/dev-db/mysql-cluster/Manifest b/dev-db/mysql-cluster/Manifest index 14c798b28b49..3ada9d070fda 100644 --- a/dev-db/mysql-cluster/Manifest +++ b/dev-db/mysql-cluster/Manifest @@ -5,7 +5,7 @@ DIST mysql-cluster-gpl-7.2.34.tar.gz 25114728 BLAKE2B b9337cf8ae6742c58f92ae64b8 DIST mysql-cluster-gpl-7.3.22.tar.gz 41356026 BLAKE2B 055a3f8590f0e2e53f8620244bd2ca7d619ab5549de7b33c4d41d2fabd260d98eaabdc0169488a6d018bcafc4458433e21b65025827998a31e9abc1deb5101ae SHA512 ccb9f3429e6ccb2dbb53d98f54abeae3c3128e65dc69c41918324630fef665f48d3c3af2d60bf1cce4e28c492e525c6bbc32cc8a39a9ea47988184adeafd5bd3 DIST mysql-cluster-gpl-7.4.21.tar.gz 41718490 BLAKE2B 4578e477b345c85ccf12e4ea79893dda9b33bf35722ff8c6d706f150d8506d07b5e49a8e69e37cb3c8ff449832c80f72430924559b4a6d209d11d31cc2a67ca4 SHA512 48f475806608c0f6e0c45cc9c3b3851678153e17cf5c74114b2ca7a75eee455798c8decb857738eecb3fe664930e378e1d399509a954a7073802285eb87801b5 DIST mysql-extras-20190121-0015Z.tar.bz2 330807 BLAKE2B d5beae3d5a493e01d57130f835cd0d7dcbf53af389f9b933446ab43b86f96c85b5858a7a56ffe882ee63371ab96f0226e04f710dfb119ddd91b5c5685d0999bc SHA512 2f092b8e1e2f836d19e4663d383be876d498bca0ee005a690f48ba1797e9e5b648c4a15c36885faa286ce12a49386bf2898940e19eb1d288e7ee084968821a05 -EBUILD mysql-cluster-7.2.34.ebuild 25700 BLAKE2B 4e3dbdb7f5be6f22d07d501feb77675ac3559abd36314da9399bd421a4d8c6be95a7fe9d6d199ec00d17e0695d99bbcb6c63466d3cd45e958372d92123d1336c SHA512 e2ad3c7fe7918a4a0a9f60528dd988587469f5d785ed79881758ca582cafdb3e9dd09748c9c204639473eaf41ee88c03550844d7f211e2893a6f32ae1a240767 -EBUILD mysql-cluster-7.3.22.ebuild 26133 BLAKE2B 9046f54c9edd9ef1e87023f09e9d5a1e6b79137eb16ac8dc22a362ab7ffdc9deb8bac122eb2143c73f5b7e06584a5bfe57870d17a29bab49772f4401b29bfe33 SHA512 4edd4feb4f0609971c0a4e2f5e845df58f230089c734d0f401d75ec4226d99de87826bb3c2e133e3677ebde511370b204ec0e848db7458f341ebe96369aeea00 -EBUILD mysql-cluster-7.4.21.ebuild 26133 BLAKE2B 21a916a0c37d4f746835b2031250867ba2b2af91e76749e32c685344d73c3ab0da6471cdc1ee317614b8a7352ccc6af2401ed59709c615180a8d9cb265ee8f9d SHA512 597158672f82b55bec72544aabe849352eb64d9629e56e537a567515f0810af2553418f1a1bd57f42e7f525b3ec024ae67a63757cb4a9cee9edd3f300dfcb36c +EBUILD mysql-cluster-7.2.34.ebuild 25600 BLAKE2B 3f82f2f2ca47223eb33450325b1fd5473bf9f9df986edcfb68070d0c640092fe1146547713dd068a5950529b2e9340b91a8dbec7b42c0adf16168a9a85ab5932 SHA512 504e87616dfa471e657c90ed6d724f00f04413f0764eb5cace83836afa89d2f70a64c6ee5a0831aa98e74fb06246703e676e2de23fde210f5185b389f6d2ea25 +EBUILD mysql-cluster-7.3.22.ebuild 26056 BLAKE2B 53ffe5a77a8c6d3b0684b3ddc52f27bc43d0b57ebc4ca3c4ae2a4655099cf7dc9a835936a994d1606c01f97d56fbed85303b388d843f6c8ef8faff59b7277995 SHA512 fb69f17c8d18f23855c2adda0cf27836f8521b5ef41a6df449d5b070e90a430e93ddfb177417076afeca1dc1d6d4ee090d9593f636d39e3d6bb82bb0bed59e02 +EBUILD mysql-cluster-7.4.21.ebuild 26056 BLAKE2B 7e7d4fd1088b8c8189e1e73730f7efc440970e1a908c82d273e497271c44c63e58b088b957b6bdccab15ad52b45f3db304fbad98925879be2e0b49f87ffb0973 SHA512 ea7cd316ddd78c6decb336ecdac06674e3e8ec5aa996e474335d29ba2b630634f04a4feb9fabc783715ac5f3d8148197d46a6260ca0ed0a306a1edf35886e7b9 MISC metadata.xml 1248 BLAKE2B 02eec2cf13c1d1ec71d92a3a6e15a65966e3a6de1595f5027159e8eb6c6c67a38994fe7c051746ff9f820138c51f21afd46214c0a686e9e107668b3eaba9950d SHA512 ce4c1b021cf1d5381c4523b9c047ce3a580ea807cfa81557d398ef5bf92bb0d30d1145d0fde299f1dbab8837b09731eea1767a864964ec9d66393096e61661f5 diff --git a/dev-db/mysql-cluster/mysql-cluster-7.2.34.ebuild b/dev-db/mysql-cluster/mysql-cluster-7.2.34.ebuild index c4b0ad5dc5f7..ee858318fdf3 100644 --- a/dev-db/mysql-cluster/mysql-cluster-7.2.34.ebuild +++ b/dev-db/mysql-cluster/mysql-cluster-7.2.34.ebuild @@ -481,11 +481,11 @@ src_test() { local t for t in main.mysql_client_test \ - binlog.binlog_statement_insert_delayed main.information_schema \ - main.mysqld--help-notwin main.flush_read_lock_kill \ - sys_vars.plugin_dir_basic main.openssl_1 \ - main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \ - ndb.ndbinfo ndb_binlog.ndb_binlog_index ; do + binlog.binlog_statement_insert_delayed main.information_schema \ + main.mysqld--help-notwin main.flush_read_lock_kill \ + sys_vars.plugin_dir_basic main.openssl_1 \ + main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \ + ndb.ndbinfo ndb_binlog.ndb_binlog_index ; do _disable_test "$t" "False positives in Gentoo" done diff --git a/dev-db/mysql-cluster/mysql-cluster-7.3.22.ebuild b/dev-db/mysql-cluster/mysql-cluster-7.3.22.ebuild index 5a1a79830e00..16b657b80515 100644 --- a/dev-db/mysql-cluster/mysql-cluster-7.3.22.ebuild +++ b/dev-db/mysql-cluster/mysql-cluster-7.3.22.ebuild @@ -485,13 +485,13 @@ src_test() { local t for t in main.mysql_client_test \ - binlog.binlog_statement_insert_delayed main.information_schema \ - main.mysqld--help-notwin main.flush_read_lock_kill \ - sys_vars.plugin_dir_basic main.openssl_1 \ - binlog.binlog_mysqlbinlog_filter \ - perfschema.binlog_edge_mix perfschema.binlog_edge_stmt \ - funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers \ - main.mysqlhotcopy_archive main.mysqlhotcopy_myisam ; do + binlog.binlog_statement_insert_delayed main.information_schema \ + main.mysqld--help-notwin main.flush_read_lock_kill \ + sys_vars.plugin_dir_basic main.openssl_1 \ + binlog.binlog_mysqlbinlog_filter \ + perfschema.binlog_edge_mix perfschema.binlog_edge_stmt \ + funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers \ + main.mysqlhotcopy_archive main.mysqlhotcopy_myisam ; do _disable_test "$t" "False positives in Gentoo" done diff --git a/dev-db/mysql-cluster/mysql-cluster-7.4.21.ebuild b/dev-db/mysql-cluster/mysql-cluster-7.4.21.ebuild index 520d6e2f99da..9e8f595ee075 100644 --- a/dev-db/mysql-cluster/mysql-cluster-7.4.21.ebuild +++ b/dev-db/mysql-cluster/mysql-cluster-7.4.21.ebuild @@ -485,13 +485,13 @@ src_test() { local t for t in main.mysql_client_test \ - binlog.binlog_statement_insert_delayed main.information_schema \ - main.mysqld--help-notwin main.flush_read_lock_kill \ - sys_vars.plugin_dir_basic main.openssl_1 \ - binlog.binlog_mysqlbinlog_filter \ - perfschema.binlog_edge_mix perfschema.binlog_edge_stmt \ - funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers \ - main.mysqlhotcopy_archive main.mysqlhotcopy_myisam ; do + binlog.binlog_statement_insert_delayed main.information_schema \ + main.mysqld--help-notwin main.flush_read_lock_kill \ + sys_vars.plugin_dir_basic main.openssl_1 \ + binlog.binlog_mysqlbinlog_filter \ + perfschema.binlog_edge_mix perfschema.binlog_edge_stmt \ + funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers \ + main.mysqlhotcopy_archive main.mysqlhotcopy_myisam ; do _disable_test "$t" "False positives in Gentoo" done diff --git a/dev-db/mysql-connector-c/Manifest b/dev-db/mysql-connector-c/Manifest index bd604f775e49..bcad2b4ef3f3 100644 --- a/dev-db/mysql-connector-c/Manifest +++ b/dev-db/mysql-connector-c/Manifest @@ -5,6 +5,6 @@ AUX mysql-connector-c-8.0.17-libressl.patch 10106 BLAKE2B 5ed9b5f77f35c5079ac13d AUX mysql_com.patch 1787 BLAKE2B 4fbd40325f400586926072927b3f07231d577f18c1e30951c34c36ded9b9e42b7c3dc47ca51df974265c28b40116e30274d8a73d6a843e5d9d0074430bc17b08 SHA512 340365b05d72045af0ef12fd5c260a796be547d9abb97a6ef3d6aaf30aecf29368c1dfa28f1284da544a81656f0436f11ada2f8c5cb481540d1f1c90dd354b49 DIST mysql-boost-8.0.17.tar.gz 189322239 BLAKE2B f9f46e5fdc3e9869b203626bc09edfbcdbabcd68eba43f9c6a33b9a52cffb3a32f39704c6d22a66899aac16fa2efb271c5dc7af7522768b45542ac8dc615cd8a SHA512 a278ee263670cb1f79d67c4b87c4b88632569c3b20a4297a6e77d550155db20902f22992ea851cf59ea523bb97d5e08707e3457f71a678e9f1ac2fa4ca5b7a2d DIST mysql-connector-c-6.1.11-src.tar.gz 3489345 BLAKE2B 813512520ef660521221565a4466e81d902629d0ee731f746b68eed2b9129ea8361fcabe184537ec8ba91aed5a4b02dfb3450b36524c2e98f81fba148eee0cf1 SHA512 271395c888a93b833e0bbe1840b9987ecdb37d0f1cf89904207cc9aa99ed32e538aee8c9529ff39b6533947159776a8f5aa079da86ed51b1d26b086f4ffdd7c6 -EBUILD mysql-connector-c-6.1.11-r2.ebuild 2285 BLAKE2B f739235634fd28fe7a7209aaba18cfaf0e8ae3b69bec6b92af86001cb6fb4d942631278e175f693f20621e839bca9d9f0e636f0c5344b477239603c49a96d438 SHA512 edd57fc96a15a4b1d0098da71c3e2a7de6d6050ee82d0ad80f4089f9a4ebc09815bafd314b7a7dbf10748ce9f3a66a30eb5d835a91d8d19ebfc2779e6716a2b3 -EBUILD mysql-connector-c-8.0.17-r1.ebuild 2369 BLAKE2B 213aaf2d9b0c17e8226bdd9b38f25a2e12fbcc46d723154bd9fcb45efa5e2898c19ebb015372818accc032bfd355cb38e457cdd3ce026ebbbb7b0608f4cf13a4 SHA512 ab3f47b11fa930457e666d6854df921b8ed7114fc0f100600a3badad18009cc32b34a80ed95b052288bf79c7ac6b57c65cab0c786eb1c8efe3e54ac639aa0fb5 +EBUILD mysql-connector-c-6.1.11-r2.ebuild 2289 BLAKE2B edce26b9fea987ad0d3ba93388303f62dfe004779989c6e21ac154275cd9b7e0b3f0749e19375290d625f9a17384853b63a02f4742703030aa7c8dcf863f7ade SHA512 c33ea5754eae88f1628d9d53a81db4aaea2598ebca10f2158617b2a2cd9ac3d7cd34dfc9b0314bd096ba0f531dd27fbe8c42a61727dea91fc21852ee601f409e +EBUILD mysql-connector-c-8.0.17-r1.ebuild 2456 BLAKE2B 8c54db2595c732fb34285f673942bd0df1e07ac982cf8622baebfe81f8a9e8f1dd9f87023f3a73a58d9c59129444030d2cd06de4aade0f35c86a365db3477bcd SHA512 ccb6f68dfccc6f94d2897b7931fed8d0df5d5500f60d64e23908b5864ad7b054cd7b1eebcc008f5b4ee99c0254aa75c0478b1bf2c35e5d42d760adf2118614b4 MISC metadata.xml 239 BLAKE2B c4d6706d083b72927d239f41a644a4009c054c1c1a388af7733d3a2daf47d354009eb472573304a6be272601f05535297bcd9ceaea811a741cd905577ffe53d1 SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r2.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r2.ebuild index 7fffab40fcc2..73f2092c4ba6 100644 --- a/dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r2.ebuild +++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r2.ebuild @@ -18,7 +18,7 @@ LICENSE="GPL-2" SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz" S="${WORKDIR}/${P}-src" -KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86" SUBSLOT="18" SLOT="0/${SUBSLOT}" diff --git a/dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r1.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r1.ebuild index 667251898c9d..c99bb77dd8a1 100644 --- a/dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r1.ebuild +++ b/dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r1.ebuild @@ -13,18 +13,16 @@ HOMEPAGE="https://dev.mysql.com/downloads/" LICENSE="GPL-2" SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${PV}.tar.gz" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" SLOT="0/21" -IUSE="ldap libressl +ssl static-libs" +IUSE="ldap libressl static-libs" RDEPEND=" sys-libs/zlib:=[${MULTILIB_USEDEP}] ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] ) - ssl? ( - libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) - !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) - ) + libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) + !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) " DEPEND="${RDEPEND}" @@ -37,7 +35,8 @@ PATCHES=( "${FILESDIR}"/${PN}-8.0.17-libressl.patch ) src_prepare() { sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "${S}/scripts/CMakeLists.txt" || die - # All these are for the server only + # All these are for the server only. + # Disable rpm call which would trigger sandbox, #692368 sed -i \ -e '/MYSQL_CHECK_LIBEVENT/d' \ -e '/MYSQL_CHECK_RAPIDJSON/d' \ @@ -49,6 +48,7 @@ src_prepare() { -e '/ADD_SUBDIRECTORY(man)/d' \ -e '/ADD_SUBDIRECTORY(share)/d' \ -e '/INCLUDE(cmake\/boost/d' \ + -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \ CMakeLists.txt || die # Skip building clients @@ -72,7 +72,8 @@ multilib_src_configure() { -DENABLED_LOCAL_INFILE=ON -DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock" -DWITH_ZLIB=system - -DWITH_SSL=$(usex ssl system wolfssl) + -DWITH_SSL=system + -DWITH_NUMA=OFF -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient -DSHARED_LIB_PATCH_VERSION="0" -DCMAKE_POSITION_INDEPENDENT_CODE=ON diff --git a/dev-db/mysql-workbench/Manifest b/dev-db/mysql-workbench/Manifest index 7dc7abf73093..a757ddc211bb 100644 --- a/dev-db/mysql-workbench/Manifest +++ b/dev-db/mysql-workbench/Manifest @@ -2,10 +2,8 @@ AUX mysql-workbench-6.2.5-wbcopytables.patch 496 BLAKE2B 4666f32098ec43ad36f1c72 AUX mysql-workbench-6.3.10-i386-json.patch 7167 BLAKE2B 44a6e2446b24cd2f7f096d51b6cfdacfb485634a94733c4ef67a128ec903fec3736cb62ed45d6abbe7c7793b7d3ab668198f663a44b1bcc313f4d02ced4cd578 SHA512 992595df7719c4c958c98b5561f3fea04607213287c72daea6bb331392c417123d6fe5d1126c6dec128a857aa299908221f3a2c0ac08744241bf395e80a9574d AUX mysql-workbench-6.3.9-mariadb-json.patch 2320 BLAKE2B 9dcf7ca5091109ab71a201a68aa16259402dae85d4ea1135fbce476dbc0d4f49ad154005a6fe6195ce86ffba49ebf3d03de8ac94b6adcda2a297600b1ac6d0d3 SHA512 23e4135ee5c8b7cc7b70cc6b5170209c9a6350cfc7e8450d29a1098c31472b68494147ec4f1286365f7802af72570f4822b0078ae269affbbaf98e3ad9e99eb4 DIST antlr-4.7.1-complete.jar 2240116 BLAKE2B 3acf99b3701b2092cad2fb6e91f27791cbedd82f26888d7329e481be29fce4ec644eb57f663e515b92dea46c24222d4fb090aae5cae30c57c412a38932ea72ed SHA512 de1c230d7294e05ac7b451cbc639bab9d416a674b281e21092fb4a9329ca8b6d4b92b9ad78a9771cff475a1610f1d0419819c4619bdff36c683019da67ef13b1 -DIST mysql-workbench-community-8.0.14-src.tar.gz 15631739 BLAKE2B f37dbe83ecc642d08dc4996e343944b4f1c1c00a84d581ce79944d7f431910cd89b0c53fda14e8ff4c912ed8a1eaab517710d24e0bef89f2ed566d0d5f0730e4 SHA512 fc09bb73692956b40b003e23c9b6b6b710082c98393ad4de988dc4f4d5c78d7476a7f56f7fa5d201bf5a267643b13a30db385016fe800b57893355b9225aaf71 DIST mysql-workbench-community-8.0.16-src.tar.gz 15653536 BLAKE2B c76cd35e88167641037a779b85245c620b31e2a2943260309d8ba461391892d9ec5856023c8eb25e1ea40c12ece796a1d2e36f1638187db4bd2739eb273232c9 SHA512 e9495e78aec58f70cc586ad73908408d3b8d5071c815279c1019d5268c97f53f10f4e59a47fe0ffea03b795de8e283c1175e03e2585a81fc58b62461d665cfe9 DIST mysql-workbench-community-8.0.17-src.tar.gz 15777302 BLAKE2B ba1aebfc5f9b55e88529bdbc5ebe42da594fce1da0ea64bd0153294293fe4c2533bbc00aac9c1ba0942577eff90c1b522ef1af803e56edf0c361876ac5dea764 SHA512 c7b5f68e4a2fe30d33fde5f18a03342e034a8c10edc2506278dc09751f264884f1dba3d68c430594ac09d26b692465409d2189c2b2a440d80aca7ad00188a39f -EBUILD mysql-workbench-8.0.14.ebuild 2718 BLAKE2B 4abd1c59b13bf3ce319c9959c8caabd4121a34ca4718aa08e7f508ff5f28326f7a2023d38ed5380666382f25255f831f869e8aca12b9fe70a5110ef86365ada8 SHA512 bd43c28ec80e357841aa9775dfc83367cc9f972f877b30097aa930ca8a03cbfd50376d30a13739cdbcc4ba2960215b209a979249d8365dca867891c70efe755c EBUILD mysql-workbench-8.0.16.ebuild 2637 BLAKE2B 3b51c37e36967fcb2b88693953c18729ef3932ef2c8af677fb36ec9a9fce324d2897364b07cae56753fd4c793b832e55096935959019e8c23446a4a3ed886763 SHA512 a4ca773c4f10e60d3413244f0f7599dce9ce740e3e39bffd4bd150b8a5bcbe30f038f85cd4dee05d9495bf9fb69658867a926f5c15415f2647fa18f7c8bf510c -EBUILD mysql-workbench-8.0.17.ebuild 2626 BLAKE2B f35131ede307c0084de78b4b2c0f131ec9c5e2d01c0a1fb61aa41536333a9605c7f5185c7a9800bfcdf37480632d5240e94b77f986e42f5b546bbbce8e2dd26a SHA512 3a17d3f41be4e6244db474139d76d8a993053df0c57fc0001eb1ed7a43a85c750931a905b5955e99cf2ac64db83b61e5151504a95c9bd115f2f96099afdc9ef2 +EBUILD mysql-workbench-8.0.17.ebuild 2563 BLAKE2B 6a0adebe6937f644d709c55f34017d6ca661517e4424d924fdda4f972c702d7bac081da9a0f869d06873169df9c5066f196e857cb423f63d80286650888a1710 SHA512 2bbab3de08f6cb73c0b606d2a0a19035f3829d28b74a46c257360e21c4c5b0c823f7511193a20d49f4f60acc055c38c117cf9f0aa962e8e09799848ed55f7017 MISC metadata.xml 310 BLAKE2B b0d985e39bb17865a05907e5449723c2bf862d9f3ae7f8570173c9cff443171feef6694db26a51880f8c1a4b1e3834ca7ab9bc7c2057fd6f8930b9d1c1c02cdd SHA512 f284063d72f2218f8ed60a74b43f252d608865682b8c0447f52016a02a7cbf6d45a226787d893328dd31946ade1cca78ff7556896183b4422c4142a8935a2193 diff --git a/dev-db/mysql-workbench/mysql-workbench-8.0.14.ebuild b/dev-db/mysql-workbench/mysql-workbench-8.0.14.ebuild deleted file mode 100644 index 937637fa44f7..000000000000 --- a/dev-db/mysql-workbench/mysql-workbench-8.0.14.ebuild +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 -GCONF_DEBUG="no" - -PYTHON_COMPAT=( python2_7 ) -PYTHON_REQ_USE="sqlite" - -inherit gnome2 eutils flag-o-matic python-single-r1 cmake-utils - -MY_P="${PN}-community-${PV}-src" - -DESCRIPTION="MySQL Workbench" -HOMEPAGE="https://www.mysql.com/products/workbench/" -SRC_URI="mirror://mysql/Downloads/MySQLGUITools/${MY_P}.tar.gz http://www.antlr.org/download/antlr-4.7.1-complete.jar" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux" -IUSE="debug doc gnome-keyring" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -# glibc: deprecated mutex functions, removed in 2.36.0 -CDEPEND="${PYTHON_DEPS} - app-crypt/libsecret - dev-libs/glib:2 - dev-cpp/antlr-cpp:4 - dev-cpp/atkmm - dev-cpp/pangomm - >=dev-cpp/glibmm-2.14:2 - dev-cpp/gtkmm:3.0 - dev-libs/atk - >=net-libs/libssh-0.7.3[server] - x11-libs/pango - x11-libs/gtk+:3 - gnome-base/libglade:2.0 - >=x11-libs/cairo-1.5.12[glib,svg] - dev-libs/libsigc++:2 - >=dev-libs/boost-1.55.0[nls] - >=dev-cpp/ctemplate-0.95 - >=dev-libs/libxml2-2.6.2:2 - dev-libs/libzip - dev-libs/libpcre[cxx] - >=sci-libs/gdal-1.11.1-r1[-mdb] - virtual/opengl - || ( sys-libs/e2fsprogs-libs dev-libs/ossp-uuid ) - dev-libs/tinyxml[stl] - >=dev-db/mysql-connector-c++-1.1.8 - dev-db/vsqlite++ - || ( dev-db/libiodbc dev-db/unixODBC ) - gnome-keyring? ( gnome-base/libgnome-keyring ) - dev-python/pexpect - >=dev-python/paramiko-1.7.4 -" - -RDEPEND="${CDEPEND} - app-admin/sudo - >=sys-apps/net-tools-1.60_p20120127084908" - -DEPEND="${CDEPEND} - dev-lang/swig - virtual/jre - virtual/pkgconfig" - -S="${WORKDIR}"/"${MY_P}" - -PATCHES=( - "${FILESDIR}/${PN}-6.2.5-wbcopytables.patch" - "${FILESDIR}/${PN}-6.3.10-i386-json.patch" -) - -src_unpack() { - unpack ${PN}-community-${PV}-src.tar.gz -} - -src_prepare() { - sed -i -e '/target_link_libraries/ s/sqlparser.grt/sqlparser.grt sqlparser/' \ - modules/db.mysql.sqlparser/CMakeLists.txt - - ## remove hardcoded CXXFLAGS - sed -i -e 's/-O0 -g3//' ext/scintilla/gtk/CMakeLists.txt || die - ## And avoid -Werror - sed -i -e 's/-Werror//' CMakeLists.txt || die - - ## package is very fragile... - strip-flags - - cmake-utils_src_prepare -} - -src_configure() { - if has_version dev-db/libiodbc ; then - IODBC="-DIODBC_CONFIG_PATH=/usr/bin/iodbc-config" - fi - - append-cxxflags -std=c++11 - ANTLR_JAR_PATH="${DISTDIR}/antlr-4.7.1-complete.jar" - local mycmakeargs=( - -DWITH_ANTLR_JAR=${ANTLR_JAR_PATH} - -DLIB_INSTALL_DIR="/usr/$(get_libdir)" - -DIODBC_INCLUDE_PATH="/usr/include/iodbc" - ${IODBC} - -DPYTHON_INCLUDE_DIR="$(python_get_includedir)" - -DPYTHON_LIBRARY="$(python_get_library_path)" - -DMySQL_CONFIG_PATH="/usr/bin/mysql_config" - ) - cmake-utils_src_configure -} diff --git a/dev-db/mysql-workbench/mysql-workbench-8.0.17.ebuild b/dev-db/mysql-workbench/mysql-workbench-8.0.17.ebuild index 885387e35cc7..10955e2f43b5 100644 --- a/dev-db/mysql-workbench/mysql-workbench-8.0.17.ebuild +++ b/dev-db/mysql-workbench/mysql-workbench-8.0.17.ebuild @@ -20,7 +20,7 @@ SRC_URI="mirror://mysql/Downloads/MySQLGUITools/${MY_P}.tar.gz https://www.antlr LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" -IUSE="debug doc gnome-keyring" +IUSE="debug doc" REQUIRED_USE="${PYTHON_REQUIRED_USE}" # glibc: deprecated mutex functions, removed in 2.36.0 @@ -51,7 +51,6 @@ CDEPEND="${PYTHON_DEPS} >=dev-db/mysql-connector-c++-1.1.8 dev-db/vsqlite++ || ( dev-db/libiodbc dev-db/unixODBC ) - gnome-keyring? ( gnome-base/libgnome-keyring ) dev-python/pexpect >=dev-python/paramiko-1.7.4 " diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest index 8e3f3e66af14..f9d3951bcb9f 100644 --- a/dev-db/mysql/Manifest +++ b/dev-db/mysql/Manifest @@ -1,8 +1,8 @@ AUX my.cnf-5.5 4733 BLAKE2B 89af4a9dbd4828a40aa91b294cef15ec8afbcb614ece424614d0bd2d047273906ccb8e4518a48d530f55e898b6c75403d61aa7a733d5bf50f0f0640c55471505 SHA512 6a5d183f1aeb30d9096838ac010c8f2dc004448924b3606bd03c1a5e0336a20fe5fcef1d2cd772977a167268fcff51a4b663f1f73a37d3066983621a8ca6c004 AUX my.cnf-5.6 4504 BLAKE2B 5d904925d12ad4c3826426e7e7790800028c9adf9b42692adf3260cd8dae910338683fbcd3e5148f113c1ab27481e5ffe61871716a069c50f295cf756b3e685c SHA512 866aa700460c2962bad6294b271efad09ef285dd428ab01551078be9972d2f961fbdf56aef7927439784711022e92a96f2eba30cd297f056f6562e8817c89aae AUX my.cnf-5.7 138 BLAKE2B 71862b4b77334ab74002237453d2c7f6b51cd1ae57dba3b00b19e216d3f10034796de9aa618efb11482cef78b7c7e50393b5f665810d03321b5ca770ac8a6144 SHA512 1d7250689005c948f4a849959baf33f5f0fda099f230611651919ed053fb563daa19d996b7ca6714e224174172fb504f4d7d08e9d449a7e1203e32cf3fdec782 -AUX my.cnf-8.0.distro-client 644 BLAKE2B 6bcc7b7842ed5738cf5b8b71e65f570786a5c30c95083f2d21dc75091d4fca8fd8bbb7a392db71b3e3297c80e1341d67d411c77a16807e14717547f69ac2f3df SHA512 e2d6cd2172bf8195568ea49fb16804dbfd42cfc9c9761a4759873099adbb3781211d01ecac492f58c6a3755d7a4648a4c1fd8e75afc78fa14906b9a26c5a42a4 -AUX my.cnf-8.0.distro-server 981 BLAKE2B e4a347f5597bb15f83b27ae0adbe34a42a296f13c1e3a6607a84ed93cda253962fa4559719efb2a3851762c5735bfd4778adc48b531aee7751503558f3603633 SHA512 a8ff382e0361a93a1f709e47ec1d9c902154ea7b40fbe428066778a2bd0958bd1777a7520d48f6d63ed8b85a958033ae905872ad696f4d441524485e611a6bc4 +AUX my.cnf-8.0.distro-client 749 BLAKE2B b01b39c85430714b5a4bfb9923c9ed1df99cdcef0583b25f28c2ebeee264732f4402198b1918e5ec5b4b1091dbda2d321baf31fe87eae00792b20042260969b3 SHA512 62aa589833126c2b78528e103f2de11ba0e339615cb00170a0f9f53bbb123a4bf99f2041819440297ab6cc34cf57333488e6ae12082fa5dcbe1b0ddef5f6108d +AUX my.cnf-8.0.distro-server 1125 BLAKE2B f4d6941aad1fc29e81e6c805ac42f4c8d3c7bc250990a9c432800dbe25b5c31be08d8e3895666b57f21606ffb69e704c57ed2692fd94696b9d325a4442596587 SHA512 82d35b7bc944e5690e1f2670a3d5674845610c2d11d6d8b1c5784ccb3877c6298de70eced3d7c497c0bcaecfa9e339ac43ce0534a97e7d976e950bb1a7f5c75d AUX my.cnf.distro-client 637 BLAKE2B b0812e0e03aa9a3b2e55e08b933a0b41b6afd95ded61f4d9d7c34a2d3810ec38520abd0d89e1c6565f61d4cd8a36d653f9f3199b3dd6a91345cdb5ff962685d8 SHA512 74bd1d9a58075d0a6195be1f94db310bcbe8da532b03844e6fa1ff84676e84843fc9adf9aed06b7e4db53c9aa24ef0885d96de0ccfe4c6ad98afe4c145d43f4f AUX my.cnf.distro-server 994 BLAKE2B 41dceff58edf748f9f60ac3c0d1682d2fc2f026fc1fd14b4c2dea398814beda3c09aabea04dd3a9e145464524c629e7e69dc257d1245e0a46dd8584b7f685172 SHA512 cf172edc23d3dda49c21af6b8adef8aa13694d8ceecddf1d612d4ae34d00ba53c51ae4ae7ca4d11083eeacb5d862f59a855a9d80e9e448ab8bbf17f42aac2650 DIST mysql-5.5.61.tar.gz 21027098 BLAKE2B b7589f632a211349fc34cec94e333b878e07113969bf5cf6f78cd37435d95b15c03eaf188ed09768033b182de125c9f018a5fe902094f17ab891f94cab9de6dd SHA512 978384915c145ec8f0d85deb764154d8d4a9764f2d342928bda6ad43a00bc110aa888895416d2ba5684a4432e433037990dd3fe8c5caf024faa487bc2e153f49 @@ -24,18 +24,18 @@ DIST mysql-extras-20181111-2314Z.tar.bz2 329013 BLAKE2B fa928b699ef0e6f092e028fc DIST mysql-extras-20190303-1852Z.tar.bz2 331026 BLAKE2B ee033fce8f1b6a58f1f690710fb9709a585cd45564b35e71d4f840a3a7f83a5d80f53c24236c9976319abd89c68c62c74a7111517f1b9721d3cbd0898bf0dd8d SHA512 30361a0b848ed27f9170b1116458a9bc13b1b585c5fa1933c99927541c31e9bda4008b0563f2fc7db286f998089ebebf1fe3f18fce7a45e62acbf769ac62d8c1 DIST mysql-extras-20190524-1046Z.tar.bz2 331517 BLAKE2B e6d48e34b0a7f7176de8740971f8151923beb20a520df73c22d44005059ef6779ad5aa8437e30018b9bbfe1d6d69043cbd8522b6f3662746205193b44372a6b3 SHA512 2f7238578f3aabd1701e1c54da36bc0100c9479871e3c77b22131fd6cde865037307f93b3343ea5e52251c45ef35cdc52cc2dec5a26d44fd41700598282c5c2c DIST mysql-extras-20190604-1109Z.tar.bz2 331780 BLAKE2B 48b6f6ff36818ba3d1d9c0580b0ff5e2343d92a42ee78b6804841d7c4f511adcdc3d5cd0590f769f308ca52e271c07cb34219450f9b86e918ddcd0a4b956e18e SHA512 19a85ba5a4c2de1688f39feb6ce1c1802e4d886436dc02afe1ba508b91365a0ac67d668cf7126588145ee55641992ad71b0d094246a94c89065876b9bb897425 -DIST mysql-extras-20190802-1549Z.tar.bz2 335077 BLAKE2B c4c4e38d30c9e4e02cdbcf4117f020e044374370bf32f6e013aa37ae6794445f3ef12e46abbdb5fefd85a68fe5af6b417363012a64d1fd97d79d478bb4b3749d SHA512 5c19a9ce9fe0d95788cc25fed0c2f987b46fa85accf7440a569066f4ac1b9f8522a0855fa884a128d7ccee17fecc25f4b16a16b3cd962c39f3670819eef2f6dc +DIST mysql-extras-20190817-0024Z.tar.bz2 337793 BLAKE2B dfd51a708654aff5bdbbaf2acad7ef966869a8e3adcba544ee15f217d2ba942827445841e73981bccc6c1f145b6225bfa7245114219f0cf52f0dfb85494a6830 SHA512 c2ff81be1c55636f0a2700033af030149f312f0383217054a4b8c65aef174626299fcb4539eaae967ea7d096a5bb09f5b5122dce344b44b0a135d886ba0fdf28 EBUILD mysql-5.5.61.ebuild 25515 BLAKE2B 2e8a5ff36ec6003ff7e4d746157afe8af9d462537d2808ab6cfe4d469cee1a594df38aafddcb010d0157335b42253f12474614f4eec85729f79d2e05a28cb8b3 SHA512 9ea05d2509c6693d71c5ce048e11393a77cf50570fa19f40500900284b9e5e5d1097de5c82fa518058ea773ac8fd30131a9c153b4effb371f4ce04f454e8867e EBUILD mysql-5.5.62.ebuild 25693 BLAKE2B abb1400994767e1a29259fda70531e27e9160b849a6228802baa440f8a5c8244393cb155ac9985f04353c8b35516e653a563c2eb84b72a714c5ee81d016e5d27 SHA512 759b82802fdeb7840b0da3e4ef1d6e7b1f32d7bd815ba780b11e57143b52bcb7eb483c008d25670f4626968028a46f7080abff247e5d2047f6b500ac67888ad4 EBUILD mysql-5.6.40-r2.ebuild 25714 BLAKE2B c78b1d8b2a77d095302f7e203c3ee6c0c2014770944072b87bd77f97972fcb6db52b05088adacbc821ce2e8f3dbb780bd40d850e381b866458b0d530fd11ea5d SHA512 b6301834c7813714f18f9763922d10e6faa33675705ba479c6d76e3c5673d903b0683f64a8281836bd6be396f398ed1bee14f9e6c8ddfe30b84ad1ac66a8be48 EBUILD mysql-5.6.42.ebuild 25955 BLAKE2B de075ce30850d5f2fe17a5aaf02e5888d62634028a042105ac4bff9a90dbec7803c6b1d348e35267be6b4b12afa8f12f4a02f969c536890bf7970cb4e466907c SHA512 56aa82fe363e091a6db7b307318f14ff93ded6eba2a61142eb3e026205740b02dca8587e23accf2ff757e941b0d4b2a0e7ab386b879d7cee35976facbb7aec94 EBUILD mysql-5.6.43.ebuild 26057 BLAKE2B b6162d04f384dc37aabae472cc3998dea0456d672aa906e778d58637edca29fc11257f1fecbcae36d3c1245467768426284743a2aadaab6723540279c615d11c SHA512 857b83b44f185bb0b811005b0f5ee35eff1a2b4d263b199f8a4955330b7fd73fd2038d565fc6fadd9cc31948f0699db6ebb10e628e93e9b223ab87b5517fe16b -EBUILD mysql-5.6.44.ebuild 26134 BLAKE2B bba7798675d50a5c3830459796fec9b82893efab1945b251b4b4d3177696a66c2ad7356ed777063acb94a04c6711f39223c7d54d4a97a7a478273e4dc053857b SHA512 a701cf6326dc1bf95a7f542de86d647dbc9f2116a2dec79503554b8cef335ab221e2193df501b5869a9c155bef631a6e0010382301e264e80e79515d8f48c7c7 -EBUILD mysql-5.6.45.ebuild 26221 BLAKE2B e8480f719bc168eaf0bc4c6fe41f3415607b0371fc242975c3ebcafa1f05958d8cf67181a7360f94d220528117d8b53af172413d8b5c1c20e9427bb591fdb4a3 SHA512 904c85b11ebf383bd6f30e669604bc555406536b76eb18bcaae75cdc70fee65691499f6ad6e3320a2b997b938a955162fa1ee184850b19af6051607b8643e925 +EBUILD mysql-5.6.44-r1.ebuild 27132 BLAKE2B 6b9c9c6e47a3263e5dc454d486f02fe46fefce8e2e7e20a8ef5476bc6191f1cb57f5928e14ee68b30bed0d73152bdbc03f164ae700e3b76e75bcf6cf289cd7f9 SHA512 f9ca576c2076b34c6548543551a8ef9dee5aacc175cd4928a8ec9dc8180993d68c45824ea72628825a9e463d9d8d00c65482545435ae9f26ff7fbbf355fc9e98 +EBUILD mysql-5.6.45-r1.ebuild 27193 BLAKE2B c25435de96c371988464eac6407419dcd608812c5957569cff72e5c0c205584a0c3d8b2f4a8ad82b716e307dac39c9f3db93f8f3e2109eda82e834a593ff2ca4 SHA512 8bb737d1fb8dc00d732940983ccec3d89d4b0580f5e1ca829ff40467830203a060aa16afa4f10db725659f32e1d2d3724b41e3c41723d82e01d98fb49f4ccc86 EBUILD mysql-5.7.23-r2.ebuild 30078 BLAKE2B 57bf58e862639e651335a10a8c4dfc5f7f0f76bfb0545414d697875906d917131fedd3e9d0e58f57b886d8cae55adbd2a104ee3632d49b4ba0669b93a1a68bff SHA512 dfbb88e79b717ceb615246a806123ee2d30c1632cfb40d0bb9e04a9204565a92afbb2b37245794c15985e99a60d2adc46723b97e455fb85e137079d6192b148c EBUILD mysql-5.7.24.ebuild 30386 BLAKE2B ecf0c03821af6a21467b53a02e6e0a0ae2f7e5d267ff4669266d34cdb9fddb7defbd8a4013dd3a1f8a103c84da4c6eddafae06fc1ebc4bf94c9769e64dbbfc1b SHA512 f8b372573d82b513ea1d82a1e00d728501c483ef949a2411c05ac93a8d2d90162d6992b58d3a101fefcbac541f9f37dcfa2263ac49231839d338af158557153f EBUILD mysql-5.7.25.ebuild 30465 BLAKE2B ec639482f3726ea18994c0e3b88ae991d16eda30c5acf7f6abee4f4301d0ada726494e4ebd2f045291faf967940adc8ef1172a48fb00e10ff69a83f837ac3e73 SHA512 6d45fd341a6f0e71d3546134d4bcfd745c6b488b28e848eb2ee1aaebb96745c797da452250a71c2eba87452e61f5ba017f80b88f4e16e23d076be4a70c6936ed -EBUILD mysql-5.7.26.ebuild 30471 BLAKE2B 783b6bbbe3fbe3067c4255da8180ebee2b5de4c9279d87ddda36dce8d70cc0026abca0634d60a98e3b9b4025c1ffe22bc35117b10891ea4011d286091ee2db78 SHA512 8be36c349123429dadb7593c242835274b881d0172b4796f27aa6476450d3ae865a797918c069a078b88f533b4ff861f7d3c8ba7d79024d87a69a936103f1042 -EBUILD mysql-5.7.27.ebuild 30610 BLAKE2B e7aa49d4def7deea79ba2b9bcd369f346cd3f93db11c84b22775fabdb5cb2551978e73ece4540e2ea227757767898a1c99ee2dfdc4fe3670786de6f0a5ed3d02 SHA512 a8ceee6d478fc6f4f1f00966d97188c0e1b3e0af640578723778468b53ba37cf906e784b21842f7e5fd076b289cd3afca0964e95261935a66d2a1ba8f8ff1080 -EBUILD mysql-8.0.17_pre1.ebuild 27573 BLAKE2B e71ba338797d7132475edc3adcb5700ad8ccd5e3049f52725d38e2448eccd84525cdd31dc9d44a32554856801d3fa4b6ebe2adc3041ae298f6bcc3e2a5d882ec SHA512 a8930d804ae3742ae405c9d5e17d11390ab365742636bcab6e331a7ac5ad1e4fe99b68c30b5a8b04eb99d0c28be08127f81056d96eed7b327ff624fa1aad74a9 +EBUILD mysql-5.7.26.ebuild 31719 BLAKE2B c610c458def0a3ffd1c7b7e4cb2375eeeb50496a38f456916f4c8d95b30b45b8011d6d1806487a5e824bd2ed40d284650bac20e5a4756a569ab71a66bcba6a68 SHA512 4579ab74217d9fb01af95afe9fa725676bab729e772494e45f6efb63f08c4fcf7250f22bb3a680db04ffb81959dd5337ff37d1f7f2d18fa2a0ed24ebf130641e +EBUILD mysql-5.7.27.ebuild 31857 BLAKE2B 5ddae4d74eedc28ebcddc6b293261f7fe33a03c446336a07b88a9d8088dc68f2b149405388869267db1c4f2525618ed4f61e3f15033b09a41201349ad4535549 SHA512 6c2b59adabb4f946bf8661a167059730b59f116935324c7ae7ca6b84c32a21be76472bf7055d296211bffddd02d42b226a3af59baf68465d7b22fc425665ac8c +EBUILD mysql-8.0.17.ebuild 36377 BLAKE2B 0aff546e2e9d25c7b37d1a61d3843592cfef9fbf1d8c6e6fcea52f45a6038fdaa50d7ae22b11246a62622961a87ec20ea1283cb9e0067ee6a0c08b1492ba0f22 SHA512 af768c840fcee4eab5278bd5d7e6401f871ad9defc7fa2b461fc83ea8da4a58799a3822f4d149e96b564aeb7c4e6d61fb1541878332415d39d5892fa916d52d0 MISC metadata.xml 1599 BLAKE2B cad6c530634fbf5923276e0b6e10e54aafca0afb7c4cdbb99ee1e3307e6b0004959eb4c8a35e5542ede6fd7d0c181933293acac0ec562988c3f8c8789546671c SHA512 cd18e4f2569e944648d23a21acf0b89c0c84e2b30a9ca6ad9d2d4f8b38b04fd29cecab598e2a836b99822c0356052fa8ada44c10241fcc03fedc5f0ce21cc36f diff --git a/dev-db/mysql/files/my.cnf-8.0.distro-client b/dev-db/mysql/files/my.cnf-8.0.distro-client index 5325c1a6d8fd..1c2ee7da1d92 100644 --- a/dev-db/mysql/files/my.cnf-8.0.distro-client +++ b/dev-db/mysql/files/my.cnf-8.0.distro-client @@ -1,7 +1,9 @@ -# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/50-distro-client.cnf: The global mysql configuration file. +# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/mysql.d/50-distro-client.cnf: The global mysql configuration file. # The following options will be passed to all MySQL clients [client] +# Should match default server to save a round trip +loose-default-auth = mysql_native_password socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock character-sets-dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets loose-default-character-set = utf8mb4 diff --git a/dev-db/mysql/files/my.cnf-8.0.distro-server b/dev-db/mysql/files/my.cnf-8.0.distro-server index 248c68e393ad..ac087963972e 100644 --- a/dev-db/mysql/files/my.cnf-8.0.distro-server +++ b/dev-db/mysql/files/my.cnf-8.0.distro-server @@ -1,7 +1,9 @@ -# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/50-distro-server.cnf: The global mysql configuration file. +# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/mysql.d/50-distro-server.cnf: The global mysql configuration file. # add a section [mysqld-8.0] for specific configurations [mysqld] +# Using "mysql_native_password" for compatibility with Perl, PHP, Ruby... +loose-default-authentication-plugin = mysql_native_password character-set-server = utf8mb4 user = mysql port = 3306 @@ -24,5 +26,5 @@ log-bin server-id = 1 # point the following paths to different dedicated disks -tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/ +#tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/ #log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname diff --git a/dev-db/mysql/mysql-5.6.44-r1.ebuild b/dev-db/mysql/mysql-5.6.44-r1.ebuild new file mode 100644 index 000000000000..e51ea5affde5 --- /dev/null +++ b/dev-db/mysql/mysql-5.6.44-r1.ebuild @@ -0,0 +1,838 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +MY_EXTRAS_VER="20190817-0024Z" + +CMAKE_MAKEFILE_GENERATOR=emake + +# Keeping eutils in EAPI=6 for emktemp in pkg_config + +inherit eutils flag-o-matic prefix toolchain-funcs \ + user cmake-utils multilib-build + +SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.6/${P}.tar.gz + https://cdn.mysql.com/archives/mysql-5.6/${P}.tar.gz + http://downloads.mysql.com/archives/MySQL-5.6/${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://www.mysql.com/" +DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" +LICENSE="GPL-2" +SLOT="0/18" +IUSE="client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux + +server static static-libs systemtap tcmalloc test yassl" + +# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests +RESTRICT="libressl? ( test )" + +REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )" + +KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" + +# 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}"/01050_all_mysql_config_cleanup-5.6.patch + "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch + "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch + "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch + "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch + "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch + "${MY_PATCH_DIR}"/20027_all_mysql-5.5-perl5.26-includes.patch + "${MY_PATCH_DIR}"/20028_all_mysql-5.6-gcc7.patch + "${MY_PATCH_DIR}"/20031_all_mysql-5.6-fix-monitor.test.patch + "${MY_PATCH_DIR}"/20036_all_mysql-5.6-fix-rpl_semi_sync_shutdown_hang.test.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.6.44-fix-libressl-support.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.6.44-add-openssl-1.1-support.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= + ) + net-misc/curl + >=sys-apps/sed-4 + >=sys-apps/texinfo-4.7-r1 + jemalloc? ( dev-libs/jemalloc:0= ) + tcmalloc? ( dev-util/google-perftools:0= ) + systemtap? ( >=dev-util/systemtap-1.3:0= ) + !yassl? ( + !libressl? ( >=dev-libs/openssl-1.0.0:0= ) + libressl? ( =dev-libs/libressl-2.6.5*:0= ) + ) + >=sys-libs/zlib-1.2.3:0= + sys-libs/ncurses:0= + server? ( + numa? ( sys-process/numactl ) + ) + !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) +" +DEPEND="virtual/yacc + static? ( sys-libs/ncurses[static-libs] ) + test? ( dev-perl/JSON ) + || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) + ${COMMON_DEPEND}" +RDEPEND="selinux? ( sec-policy/selinux-mysql ) + client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) + !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster + server? ( !prefix? ( dev-db/mysql-init-scripts ) ) + ${COMMON_DEPEND} +" +# For other stuff to bring us in +# dev-perl/DBD-mysql is needed by some scripts installed by MySQL +PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]] ; then + local GCC_MAJOR_SET=$(gcc-major-version) + local GCC_MINOR_SET=$(gcc-minor-version) + # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on + # non x86{,_64} arches + if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ + ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then + eerror "${PN} needs to be built with gcc-4.7 or later." + eerror "Please use gcc-config to switch to gcc-4.7 or later version." + die + fi + fi + if has test ${FEATURES} && \ + use server && ! has userpriv ${FEATURES} ; then + eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." + fi + + # This should come after all of the die statements + enewgroup mysql 60 || die "problem adding 'mysql' group" + enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" +} + +pkg_preinst() { + # Here we need to see if the implementation switched client libraries + # We check if this is a new instance of the package and a client library already exists + local SHOW_ABI_MESSAGE libpath + if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT%/}/usr/$(get_libdir)/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 [[ -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 + fi +} + +src_unpack() { + unpack ${A} + # Grab the patches + [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack + + mv -f "${WORKDIR}/${P}" "${S}" || die +} + +src_prepare() { + _disable_engine() { + echo > "${S%/}/storage/${1}/CMakeLists.txt" || die + } + + _disable_plugin() { + echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die + } + + if use jemalloc ; then + echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + if use tcmalloc; then + echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux + if [[ -d "${S}/support-files/SELinux" ]] ; then + echo > "${S}/support-files/SELinux/CMakeLists.txt" || die + fi + + if use libressl ; then + sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \ + "${S}/cmake/ssl.cmake" || die + fi + + sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die + + local plugin + local server_plugins=( semisync ) + local test_plugins=( audit_null 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 + + # Don't build example + _disable_engine example + _disable_engine ndb + _disable_plugin innodb_memcached + + 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" + -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/mysql + -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin + -DINSTALL_SCRIPTDIR=share/mysql/scripts + -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" + -DINSTALL_SBINDIR=sbin + -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" + -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" + -DWITH_UNIT_TESTS=$(usex test ON OFF) + ### TODO: make this system but issues with UTF-8 prevent it + -DWITH_EDITLINE=bundled + -DWITH_ZLIB=system + -DWITH_LIBWRAP=0 + -DENABLED_LOCAL_INFILE=1 + -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" + -DWITH_DEFAULT_COMPILER_OPTIONS=0 + -DWITH_DEFAULT_FEATURE_SET=0 + # 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) + -DWITH_LIBEVENT=NO + -DWITHOUT_CLIENTLIBS=YES + -DENABLE_DTRACE=$(usex systemtap) + -DWITH_SSL=$(usex yassl bundled system) + -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mysql/mysql-test' '') + -DWITHOUT_VALIDATE_PASSWORD=1 + ) + + if use server ; then + + 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+=( + -DWITH_NUMA=$(usex numa ON OFF) + -DEXTRA_CHARSETS=all + -DDISABLE_SHARED=$(usex static YES NO) + -DWITH_DEBUG=$(usex debug) + -DWITH_EMBEDDED_SERVER=OFF + ) + + if use profiling ; then + # Setting to OFF doesn't work: Once set, profiling options will be added + # to `mysqld --help` output via sql/sys_vars.cc causing + # "main.mysqld--help-notwin" test to fail + mycmakeargs+=( -DENABLED_PROFILING=ON ) + fi + + if use static; then + mycmakeargs+=( -DWITH_PIC=1 ) + 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 + -DWITH_INNODB_MEMCACHED=0 + ) + + else + mycmakeargs+=( + -DWITHOUT_SERVER=1 + -DWITH_EMBEDDED_SERVER=OFF + -DEXTRA_CHARSETS=none + ) + fi + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_compile +} + +src_install() { + cmake-utils_src_install + + # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. + find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die + # 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 + + if [[ -d "${ED%/}/usr/sql-bench" ]] ; then + mv "${ED%/}/usr/sql-bench" "${ED%/}/usr/share/mysql/" || 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='perl server static-libs' \ +# FEATURES='test userpriv -usersandbox' \ +# ebuild mysql-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 MySQL 5.6 for now and are believed to be + # false positives: + # + local t + + for t in auth_sec.keyring_udf federated.federated_plugin ; do + _disable_test "$t" "False positives in Gentoo" + done + + if ! use latin1 ; then + for t in \ + binlog.binlog_mysqlbinlog_filter \ + binlog.binlog_statement_insert_delayed \ + funcs_1.is_columns_mysql \ + funcs_1.is_tables_mysql \ + funcs_1.is_triggers \ + main.information_schema \ + main.mysql_client_test \ + main.mysqld--help-notwin \ + perfschema.binlog_edge_mix \ + perfschema.binlog_edge_stmt \ + ; do + _disable_test "$t" "Requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set" + done + fi + + if has_version '>=dev-libs/openssl-1.1.0' ; then + # Tests are expecting /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/mysql"} + 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 "${EROOT%/}/$MYSQL_TMPDIR" ]]; then + einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" + install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR" + fi + if [[ ! -d "${EROOT%/}/$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 http://bugs.mysql.com/bug.php?id=31312 + use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" + + local help_tables="${EROOT%/}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" + [[ -r "${help_tables}" ]] \ + && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ + || touch "${TMPDIR}/fill_help_tables.sql" + help_tables="${TMPDIR}/fill_help_tables.sql" + + # 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 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 + # http://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 + chown mysql "${sqltmp}" || die + + local cmd=( "${EROOT%/}/usr/share/mysql/scripts/mysql_install_db" ) + [[ -f "${cmd}" ]] || cmd=( "${EROOT%/}/usr/bin/mysql_install_db" ) + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" + fi + 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} \ + $(use prefix || echo --user=mysql) \ + --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="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}');" + "${EROOT%/}/usr/bin/mysql" \ + --no-defaults \ + "--socket=${socket}" \ + -hlocalhost \ + -e "${sql}" + eend $? + + if [[ -n "${sqltmp}" ]] ; then + ebegin "Loading \"zoneinfo\", this step may require a few seconds" + "${EROOT%/}/usr/bin/mysql" \ + --socket="${socket}" \ + -hlocalhost \ + -uroot \ + --password="${MYSQL_ROOT_PASSWORD}" \ + mysql < "${sqltmp}" + rc=$? + eend $? + [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" + fi + + # Stop the server and cleanup + einfo "Stopping the server ..." + kill $(< "${pidfile}" ) + rm -f "${sqltmp}" + wait %1 + einfo "Done" +} diff --git a/dev-db/mysql/mysql-5.6.44.ebuild b/dev-db/mysql/mysql-5.6.44.ebuild deleted file mode 100644 index 312951b5e589..000000000000 --- a/dev-db/mysql/mysql-5.6.44.ebuild +++ /dev/null @@ -1,800 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20190604-1109Z" - -CMAKE_MAKEFILE_GENERATOR=emake - -# Keeping eutils in EAPI=6 for emktemp in pkg_config - -inherit eutils flag-o-matic prefix toolchain-funcs \ - user cmake-utils multilib-build - -SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.6/${P}.tar.gz - https://cdn.mysql.com/archives/mysql-5.6/${P}.tar.gz - http://downloads.mysql.com/archives/MySQL-5.6/${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://www.mysql.com/" -DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" -LICENSE="GPL-2" -SLOT="0/18" -IUSE="client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux - +server static static-libs systemtap tcmalloc test yassl" - -# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests -RESTRICT="libressl? ( test )" - -REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )" - -KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" - -# 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}"/01050_all_mysql_config_cleanup-5.6.patch - "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch - "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch - "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch - "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch - "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch - "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch - "${MY_PATCH_DIR}"/20027_all_mysql-5.5-perl5.26-includes.patch - "${MY_PATCH_DIR}"/20028_all_mysql-5.6-gcc7.patch - "${MY_PATCH_DIR}"/20031_all_mysql-5.6-fix-monitor.test.patch - "${MY_PATCH_DIR}"/20036_all_mysql-5.6-fix-rpl_semi_sync_shutdown_hang.test.patch - "${MY_PATCH_DIR}"/20018_all_mysql-5.6.44-fix-libressl-support.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= - ) - net-misc/curl - >=sys-apps/sed-4 - >=sys-apps/texinfo-4.7-r1 - jemalloc? ( dev-libs/jemalloc:0= ) - tcmalloc? ( dev-util/google-perftools:0= ) - systemtap? ( >=dev-util/systemtap-1.3:0= ) - !yassl? ( - !libressl? ( =dev-libs/openssl-1.0.2*:0= ) - libressl? ( =dev-libs/libressl-2.6.5*:0= ) - ) - >=sys-libs/zlib-1.2.3:0= - sys-libs/ncurses:0= - server? ( - numa? ( sys-process/numactl ) - ) - !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) -" -DEPEND="virtual/yacc - static? ( sys-libs/ncurses[static-libs] ) - test? ( dev-perl/JSON ) - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) - ${COMMON_DEPEND}" -RDEPEND="selinux? ( sec-policy/selinux-mysql ) - client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) - !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster - server? ( !prefix? ( dev-db/mysql-init-scripts ) ) - ${COMMON_DEPEND} -" -# For other stuff to bring us in -# dev-perl/DBD-mysql is needed by some scripts installed by MySQL -PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" - -pkg_setup() { - if [[ ${MERGE_TYPE} != binary ]] ; then - local GCC_MAJOR_SET=$(gcc-major-version) - local GCC_MINOR_SET=$(gcc-minor-version) - # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on - # non x86{,_64} arches - if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ - ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then - eerror "${PN} needs to be built with gcc-4.7 or later." - eerror "Please use gcc-config to switch to gcc-4.7 or later version." - die - fi - fi - if has test ${FEATURES} && \ - use server && ! has userpriv ${FEATURES} ; then - eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." - fi - - # This should come after all of the die statements - enewgroup mysql 60 || die "problem adding 'mysql' group" - enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" -} - -pkg_preinst() { - # Here we need to see if the implementation switched client libraries - # We check if this is a new instance of the package and a client library already exists - local SHOW_ABI_MESSAGE libpath - if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT%/}/usr/$(get_libdir)/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 [[ -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 - fi -} - -src_unpack() { - unpack ${A} - # Grab the patches - [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack - - mv -f "${WORKDIR}/${P}" "${S}" || die -} - -src_prepare() { - _disable_engine() { - echo > "${S%/}/storage/${1}/CMakeLists.txt" || die - } - - _disable_plugin() { - echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die - } - - if use jemalloc ; then - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - if use tcmalloc; then - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux - if [[ -d "${S}/support-files/SELinux" ]] ; then - echo > "${S}/support-files/SELinux/CMakeLists.txt" || die - fi - - if use libressl ; then - sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \ - "${S}/cmake/ssl.cmake" || die - fi - - sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die - - local plugin - local server_plugins=( semisync ) - local test_plugins=( audit_null 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 - - # Don't build example - _disable_engine example - _disable_engine ndb - _disable_plugin innodb_memcached - - 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" - -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/mysql - -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin - -DINSTALL_SCRIPTDIR=share/mysql/scripts - -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" - -DINSTALL_SBINDIR=sbin - -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" - -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" - -DWITH_UNIT_TESTS=$(usex test ON OFF) - ### TODO: make this system but issues with UTF-8 prevent it - -DWITH_EDITLINE=bundled - -DWITH_ZLIB=system - -DWITH_LIBWRAP=0 - -DENABLED_LOCAL_INFILE=1 - -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" - -DWITH_DEFAULT_COMPILER_OPTIONS=0 - -DWITH_DEFAULT_FEATURE_SET=0 - # 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) - -DWITH_LIBEVENT=NO - -DWITHOUT_CLIENTLIBS=YES - -DENABLE_DTRACE=$(usex systemtap) - -DWITH_SSL=$(usex yassl bundled system) - -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mysql/mysql-test' '') - -DWITHOUT_VALIDATE_PASSWORD=1 - ) - - if use server ; then - - 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+=( - -DWITH_NUMA=$(usex numa ON OFF) - -DEXTRA_CHARSETS=all - -DDISABLE_SHARED=$(usex static YES NO) - -DWITH_DEBUG=$(usex debug) - -DWITH_EMBEDDED_SERVER=OFF - ) - - if use profiling ; then - # Setting to OFF doesn't work: Once set, profiling options will be added - # to `mysqld --help` output via sql/sys_vars.cc causing - # "main.mysqld--help-notwin" test to fail - mycmakeargs+=( -DENABLED_PROFILING=ON ) - fi - - if use static; then - mycmakeargs+=( -DWITH_PIC=1 ) - 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 - -DWITH_INNODB_MEMCACHED=0 - ) - - else - mycmakeargs+=( - -DWITHOUT_SERVER=1 - -DWITH_EMBEDDED_SERVER=OFF - -DEXTRA_CHARSETS=none - ) - fi - - cmake-utils_src_configure -} - -src_compile() { - cmake-utils_src_compile -} - -src_install() { - cmake-utils_src_install - - # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. - find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die - # 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='perl server static-libs' \ -# FEATURES='test userpriv -usersandbox' \ -# ebuild mysql-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 MySQL 5.6 for now and are believed to be - # false positives: - # - local t - - for t in auth_sec.keyring_udf federated.federated_plugin ; do - _disable_test "$t" "False positives in Gentoo" - done - - # Bad test definition - _disable_test main.mysqldump "Test fails after 2018-12-31 with new warnings" - - # 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/mysql"} - 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 "${EROOT%/}/$MYSQL_TMPDIR" ]]; then - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" - install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR" - fi - if [[ ! -d "${EROOT%/}/$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 http://bugs.mysql.com/bug.php?id=31312 - use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" - - local help_tables="${EROOT%/}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" - [[ -r "${help_tables}" ]] \ - && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ - || touch "${TMPDIR}/fill_help_tables.sql" - help_tables="${TMPDIR}/fill_help_tables.sql" - - # 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 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 - # http://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 - chown mysql "${sqltmp}" || die - - local cmd=( "${EROOT%/}/usr/share/mysql/scripts/mysql_install_db" ) - [[ -f "${cmd}" ]] || cmd=( "${EROOT%/}/usr/bin/mysql_install_db" ) - if [[ -r "${help_tables}" ]] ; then - cat "${help_tables}" >> "${sqltmp}" - fi - 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} \ - $(use prefix || echo --user=mysql) \ - --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="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}');" - "${EROOT%/}/usr/bin/mysql" \ - --no-defaults \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - eend $? - - if [[ -n "${sqltmp}" ]] ; then - ebegin "Loading \"zoneinfo\", this step may require a few seconds" - "${EROOT%/}/usr/bin/mysql" \ - --socket="${socket}" \ - -hlocalhost \ - -uroot \ - --password="${MYSQL_ROOT_PASSWORD}" \ - mysql < "${sqltmp}" - rc=$? - eend $? - [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" - fi - - # Stop the server and cleanup - einfo "Stopping the server ..." - kill $(< "${pidfile}" ) - rm -f "${sqltmp}" - wait %1 - einfo "Done" -} diff --git a/dev-db/mysql/mysql-5.6.45-r1.ebuild b/dev-db/mysql/mysql-5.6.45-r1.ebuild new file mode 100644 index 000000000000..dfea0d2a2a47 --- /dev/null +++ b/dev-db/mysql/mysql-5.6.45-r1.ebuild @@ -0,0 +1,843 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +MY_EXTRAS_VER="20190817-0024Z" + +CMAKE_MAKEFILE_GENERATOR=emake + +# Keeping eutils in EAPI=6 for emktemp in pkg_config + +inherit eutils flag-o-matic prefix toolchain-funcs \ + user cmake-utils multilib-build + +SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.6/${P}.tar.gz + https://cdn.mysql.com/archives/mysql-5.6/${P}.tar.gz + http://downloads.mysql.com/archives/MySQL-5.6/${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://www.mysql.com/" +DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" +LICENSE="GPL-2" +SLOT="0/18" +IUSE="client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux + +server static static-libs systemtap tcmalloc test yassl" + +# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests +RESTRICT="libressl? ( test )" + +REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )" + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" + +# 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}"/01050_all_mysql_config_cleanup-5.6.patch + "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch + "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch + "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch + "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch + "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch + "${MY_PATCH_DIR}"/20027_all_mysql-5.5-perl5.26-includes.patch + "${MY_PATCH_DIR}"/20031_all_mysql-5.6-fix-monitor.test.patch + "${MY_PATCH_DIR}"/20036_all_mysql-5.6-fix-rpl_semi_sync_shutdown_hang.test.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.6.44-fix-libressl-support.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.6.44-add-openssl-1.1-support.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= + ) + net-misc/curl + >=sys-apps/sed-4 + >=sys-apps/texinfo-4.7-r1 + jemalloc? ( dev-libs/jemalloc:0= ) + tcmalloc? ( dev-util/google-perftools:0= ) + systemtap? ( >=dev-util/systemtap-1.3:0= ) + !yassl? ( + !libressl? ( >=dev-libs/openssl-1.0.0:0= ) + libressl? ( =dev-libs/libressl-2.6.5*:0= ) + ) + >=sys-libs/zlib-1.2.3:0= + sys-libs/ncurses:0= + server? ( + numa? ( sys-process/numactl ) + ) + !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) +" +DEPEND="virtual/yacc + static? ( sys-libs/ncurses[static-libs] ) + test? ( dev-perl/JSON ) + || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) + ${COMMON_DEPEND}" +RDEPEND="selinux? ( sec-policy/selinux-mysql ) + client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) + !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster + server? ( !prefix? ( dev-db/mysql-init-scripts ) ) + ${COMMON_DEPEND} +" +# For other stuff to bring us in +# dev-perl/DBD-mysql is needed by some scripts installed by MySQL +PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]] ; then + local GCC_MAJOR_SET=$(gcc-major-version) + local GCC_MINOR_SET=$(gcc-minor-version) + # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on + # non x86{,_64} arches + if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ + ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then + eerror "${PN} needs to be built with gcc-4.7 or later." + eerror "Please use gcc-config to switch to gcc-4.7 or later version." + die + fi + fi + if has test ${FEATURES} && \ + use server && ! has userpriv ${FEATURES} ; then + eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." + fi + + # This should come after all of the die statements + enewgroup mysql 60 || die "problem adding 'mysql' group" + enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" +} + +pkg_preinst() { + # Here we need to see if the implementation switched client libraries + # We check if this is a new instance of the package and a client library already exists + local SHOW_ABI_MESSAGE libpath + if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT%/}/usr/$(get_libdir)/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 [[ -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 + fi +} + +src_unpack() { + unpack ${A} + # Grab the patches + [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack + + mv -f "${WORKDIR}/${P}" "${S}" || die +} + +src_prepare() { + _disable_engine() { + echo > "${S%/}/storage/${1}/CMakeLists.txt" || die + } + + _disable_plugin() { + echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die + } + + if use jemalloc ; then + echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + if use tcmalloc; then + echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux + if [[ -d "${S}/support-files/SELinux" ]] ; then + echo > "${S}/support-files/SELinux/CMakeLists.txt" || die + fi + + # Don't clash with dev-db/mysql-connector-c + rm \ + man/my_print_defaults.1 \ + man/perror.1 \ + || die + + if use libressl ; then + sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \ + "${S}/cmake/ssl.cmake" || die + fi + + sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die + + local plugin + local server_plugins=( semisync ) + local test_plugins=( audit_null 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 + + # Don't build example + _disable_engine example + _disable_engine ndb + _disable_plugin innodb_memcached + + 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" + -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/mysql + -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin + -DINSTALL_SCRIPTDIR=share/mysql/scripts + -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" + -DINSTALL_SBINDIR=sbin + -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" + -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" + -DWITH_UNIT_TESTS=$(usex test ON OFF) + ### TODO: make this system but issues with UTF-8 prevent it + -DWITH_EDITLINE=bundled + -DWITH_ZLIB=system + -DWITH_LIBWRAP=0 + -DENABLED_LOCAL_INFILE=1 + -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" + -DWITH_DEFAULT_COMPILER_OPTIONS=0 + -DWITH_DEFAULT_FEATURE_SET=0 + # 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) + -DWITH_LIBEVENT=NO + -DWITHOUT_CLIENTLIBS=YES + -DENABLE_DTRACE=$(usex systemtap) + -DWITH_SSL=$(usex yassl bundled system) + -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mysql/mysql-test' '') + -DWITHOUT_VALIDATE_PASSWORD=1 + ) + + if use server ; then + + 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+=( + -DWITH_NUMA=$(usex numa ON OFF) + -DEXTRA_CHARSETS=all + -DDISABLE_SHARED=$(usex static YES NO) + -DWITH_DEBUG=$(usex debug) + -DWITH_EMBEDDED_SERVER=OFF + ) + + if use profiling ; then + # Setting to OFF doesn't work: Once set, profiling options will be added + # to `mysqld --help` output via sql/sys_vars.cc causing + # "main.mysqld--help-notwin" test to fail + mycmakeargs+=( -DENABLED_PROFILING=ON ) + fi + + if use static; then + mycmakeargs+=( -DWITH_PIC=1 ) + 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 + -DWITH_INNODB_MEMCACHED=0 + ) + + else + mycmakeargs+=( + -DWITHOUT_SERVER=1 + -DWITH_EMBEDDED_SERVER=OFF + -DEXTRA_CHARSETS=none + ) + fi + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_compile +} + +src_install() { + cmake-utils_src_install + + # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. + find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die + # 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 + + if [[ -d "${ED%/}/usr/sql-bench" ]] ; then + mv "${ED%/}/usr/sql-bench" "${ED%/}/usr/share/mysql/" || 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='perl server static-libs' \ +# FEATURES='test userpriv -usersandbox' \ +# ebuild mysql-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 MySQL 5.6 for now and are believed to be + # false positives: + # + local t + + for t in auth_sec.keyring_udf federated.federated_plugin ; do + _disable_test "$t" "False positives in Gentoo" + done + + if ! use latin1 ; then + for t in \ + binlog.binlog_mysqlbinlog_filter \ + binlog.binlog_statement_insert_delayed \ + funcs_1.is_columns_mysql \ + funcs_1.is_tables_mysql \ + funcs_1.is_triggers \ + main.information_schema \ + main.mysql_client_test \ + main.mysqld--help-notwin \ + perfschema.binlog_edge_mix \ + perfschema.binlog_edge_stmt \ + ; do + _disable_test "$t" "Requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set" + done + fi + + if has_version '>=dev-libs/openssl-1.1.0' ; then + # Tests are expecting /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/mysql"} + 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 "${EROOT%/}/$MYSQL_TMPDIR" ]]; then + einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" + install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR" + fi + if [[ ! -d "${EROOT%/}/$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 http://bugs.mysql.com/bug.php?id=31312 + use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" + + local help_tables="${EROOT%/}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" + [[ -r "${help_tables}" ]] \ + && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ + || touch "${TMPDIR}/fill_help_tables.sql" + help_tables="${TMPDIR}/fill_help_tables.sql" + + # 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 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 + # http://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 + chown mysql "${sqltmp}" || die + + local cmd=( "${EROOT%/}/usr/share/mysql/scripts/mysql_install_db" ) + [[ -f "${cmd}" ]] || cmd=( "${EROOT%/}/usr/bin/mysql_install_db" ) + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" + fi + 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} \ + $(use prefix || echo --user=mysql) \ + --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="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}');" + "${EROOT%/}/usr/bin/mysql" \ + --no-defaults \ + "--socket=${socket}" \ + -hlocalhost \ + -e "${sql}" + eend $? + + if [[ -n "${sqltmp}" ]] ; then + ebegin "Loading \"zoneinfo\", this step may require a few seconds" + "${EROOT%/}/usr/bin/mysql" \ + --socket="${socket}" \ + -hlocalhost \ + -uroot \ + --password="${MYSQL_ROOT_PASSWORD}" \ + mysql < "${sqltmp}" + rc=$? + eend $? + [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" + fi + + # Stop the server and cleanup + einfo "Stopping the server ..." + kill $(< "${pidfile}" ) + rm -f "${sqltmp}" + wait %1 + einfo "Done" +} diff --git a/dev-db/mysql/mysql-5.6.45.ebuild b/dev-db/mysql/mysql-5.6.45.ebuild deleted file mode 100644 index 5526aadc9727..000000000000 --- a/dev-db/mysql/mysql-5.6.45.ebuild +++ /dev/null @@ -1,806 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20190604-1109Z" - -CMAKE_MAKEFILE_GENERATOR=emake - -# Keeping eutils in EAPI=6 for emktemp in pkg_config - -inherit eutils flag-o-matic prefix toolchain-funcs \ - user cmake-utils multilib-build - -SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.6/${P}.tar.gz - https://cdn.mysql.com/archives/mysql-5.6/${P}.tar.gz - http://downloads.mysql.com/archives/MySQL-5.6/${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://www.mysql.com/" -DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" -LICENSE="GPL-2" -SLOT="0/18" -IUSE="client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux - +server static static-libs systemtap tcmalloc test yassl" - -# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests -RESTRICT="libressl? ( test )" - -REQUIRED_USE="?? ( tcmalloc jemalloc ) static? ( yassl )" - -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" - -# 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}"/01050_all_mysql_config_cleanup-5.6.patch - "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch - "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch - "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch - "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch - "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch - "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch - "${MY_PATCH_DIR}"/20027_all_mysql-5.5-perl5.26-includes.patch - "${MY_PATCH_DIR}"/20031_all_mysql-5.6-fix-monitor.test.patch - "${MY_PATCH_DIR}"/20036_all_mysql-5.6-fix-rpl_semi_sync_shutdown_hang.test.patch - "${MY_PATCH_DIR}"/20018_all_mysql-5.6.44-fix-libressl-support.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= - ) - net-misc/curl - >=sys-apps/sed-4 - >=sys-apps/texinfo-4.7-r1 - jemalloc? ( dev-libs/jemalloc:0= ) - tcmalloc? ( dev-util/google-perftools:0= ) - systemtap? ( >=dev-util/systemtap-1.3:0= ) - !yassl? ( - !libressl? ( =dev-libs/openssl-1.0.2*:0= ) - libressl? ( =dev-libs/libressl-2.6.5*:0= ) - ) - >=sys-libs/zlib-1.2.3:0= - sys-libs/ncurses:0= - server? ( - numa? ( sys-process/numactl ) - ) - !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) -" -DEPEND="virtual/yacc - static? ( sys-libs/ncurses[static-libs] ) - test? ( dev-perl/JSON ) - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) - ${COMMON_DEPEND}" -RDEPEND="selinux? ( sec-policy/selinux-mysql ) - client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) - !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster - server? ( !prefix? ( dev-db/mysql-init-scripts ) ) - ${COMMON_DEPEND} -" -# For other stuff to bring us in -# dev-perl/DBD-mysql is needed by some scripts installed by MySQL -PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" - -pkg_setup() { - if [[ ${MERGE_TYPE} != binary ]] ; then - local GCC_MAJOR_SET=$(gcc-major-version) - local GCC_MINOR_SET=$(gcc-minor-version) - # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on - # non x86{,_64} arches - if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ - ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then - eerror "${PN} needs to be built with gcc-4.7 or later." - eerror "Please use gcc-config to switch to gcc-4.7 or later version." - die - fi - fi - if has test ${FEATURES} && \ - use server && ! has userpriv ${FEATURES} ; then - eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." - fi - - # This should come after all of the die statements - enewgroup mysql 60 || die "problem adding 'mysql' group" - enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" -} - -pkg_preinst() { - # Here we need to see if the implementation switched client libraries - # We check if this is a new instance of the package and a client library already exists - local SHOW_ABI_MESSAGE libpath - if use client-libs && [[ -z ${REPLACING_VERSIONS} && -e "${EROOT%/}/usr/$(get_libdir)/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 [[ -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 - fi -} - -src_unpack() { - unpack ${A} - # Grab the patches - [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack - - mv -f "${WORKDIR}/${P}" "${S}" || die -} - -src_prepare() { - _disable_engine() { - echo > "${S%/}/storage/${1}/CMakeLists.txt" || die - } - - _disable_plugin() { - echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die - } - - if use jemalloc ; then - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - if use tcmalloc; then - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux - if [[ -d "${S}/support-files/SELinux" ]] ; then - echo > "${S}/support-files/SELinux/CMakeLists.txt" || die - fi - - # Don't clash with dev-db/mysql-connector-c - rm \ - man/my_print_defaults.1 \ - man/perror.1 \ - man/zlib_decompress.1 \ - || die - - if use libressl ; then - sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \ - "${S}/cmake/ssl.cmake" || die - fi - - sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die - - local plugin - local server_plugins=( semisync ) - local test_plugins=( audit_null 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 - - # Don't build example - _disable_engine example - _disable_engine ndb - _disable_plugin innodb_memcached - - 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" - -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/mysql - -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin - -DINSTALL_SCRIPTDIR=share/mysql/scripts - -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" - -DINSTALL_SBINDIR=sbin - -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" - -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" - -DWITH_UNIT_TESTS=$(usex test ON OFF) - ### TODO: make this system but issues with UTF-8 prevent it - -DWITH_EDITLINE=bundled - -DWITH_ZLIB=system - -DWITH_LIBWRAP=0 - -DENABLED_LOCAL_INFILE=1 - -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" - -DWITH_DEFAULT_COMPILER_OPTIONS=0 - -DWITH_DEFAULT_FEATURE_SET=0 - # 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) - -DWITH_LIBEVENT=NO - -DWITHOUT_CLIENTLIBS=YES - -DENABLE_DTRACE=$(usex systemtap) - -DWITH_SSL=$(usex yassl bundled system) - -DINSTALL_MYSQLTESTDIR=$(usex test 'share/mysql/mysql-test' '') - -DWITHOUT_VALIDATE_PASSWORD=1 - ) - - if use server ; then - - 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+=( - -DWITH_NUMA=$(usex numa ON OFF) - -DEXTRA_CHARSETS=all - -DDISABLE_SHARED=$(usex static YES NO) - -DWITH_DEBUG=$(usex debug) - -DWITH_EMBEDDED_SERVER=OFF - ) - - if use profiling ; then - # Setting to OFF doesn't work: Once set, profiling options will be added - # to `mysqld --help` output via sql/sys_vars.cc causing - # "main.mysqld--help-notwin" test to fail - mycmakeargs+=( -DENABLED_PROFILING=ON ) - fi - - if use static; then - mycmakeargs+=( -DWITH_PIC=1 ) - 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 - -DWITH_INNODB_MEMCACHED=0 - ) - - else - mycmakeargs+=( - -DWITHOUT_SERVER=1 - -DWITH_EMBEDDED_SERVER=OFF - -DEXTRA_CHARSETS=none - ) - fi - - cmake-utils_src_configure -} - -src_compile() { - cmake-utils_src_compile -} - -src_install() { - cmake-utils_src_install - - # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. - find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die - # 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='perl server static-libs' \ -# FEATURES='test userpriv -usersandbox' \ -# ebuild mysql-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 MySQL 5.6 for now and are believed to be - # false positives: - # - local t - - for t in auth_sec.keyring_udf federated.federated_plugin ; do - _disable_test "$t" "False positives in Gentoo" - done - - # Bad test definition - _disable_test main.mysqldump "Test fails after 2018-12-31 with new warnings" - - # 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/mysql"} - 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 "${EROOT%/}/$MYSQL_TMPDIR" ]]; then - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" - install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR" - fi - if [[ ! -d "${EROOT%/}/$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 http://bugs.mysql.com/bug.php?id=31312 - use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" - - local help_tables="${EROOT%/}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" - [[ -r "${help_tables}" ]] \ - && cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ - || touch "${TMPDIR}/fill_help_tables.sql" - help_tables="${TMPDIR}/fill_help_tables.sql" - - # 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 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 - # http://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 - chown mysql "${sqltmp}" || die - - local cmd=( "${EROOT%/}/usr/share/mysql/scripts/mysql_install_db" ) - [[ -f "${cmd}" ]] || cmd=( "${EROOT%/}/usr/bin/mysql_install_db" ) - if [[ -r "${help_tables}" ]] ; then - cat "${help_tables}" >> "${sqltmp}" - fi - 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} \ - $(use prefix || echo --user=mysql) \ - --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="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}');" - "${EROOT%/}/usr/bin/mysql" \ - --no-defaults \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - eend $? - - if [[ -n "${sqltmp}" ]] ; then - ebegin "Loading \"zoneinfo\", this step may require a few seconds" - "${EROOT%/}/usr/bin/mysql" \ - --socket="${socket}" \ - -hlocalhost \ - -uroot \ - --password="${MYSQL_ROOT_PASSWORD}" \ - mysql < "${sqltmp}" - rc=$? - eend $? - [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" - fi - - # Stop the server and cleanup - einfo "Stopping the server ..." - kill $(< "${pidfile}" ) - rm -f "${sqltmp}" - wait %1 - einfo "Done" -} diff --git a/dev-db/mysql/mysql-5.7.26.ebuild b/dev-db/mysql/mysql-5.7.26.ebuild index a956940eb6f7..e7550e70b180 100644 --- a/dev-db/mysql/mysql-5.7.26.ebuild +++ b/dev-db/mysql/mysql-5.7.26.ebuild @@ -546,15 +546,29 @@ src_test() { # Unstable tests # - main.xa_prepared_binlog_off: https://bugs.mysql.com/bug.php?id=83340 + # - rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch: https://bugs.mysql.com/bug.php?id=89223 # - rpl.rpl_non_direct_stm_mixing_engines: MDEV-14489 - for t in main.xa_prepared_binlog_off rpl.rpl_non_direct_stm_mixing_engines ; do - _disable_test "$t" "Unstable test" + for t in \ + main.xa_prepared_binlog_off \ + rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch \ + rpl.rpl_non_direct_stm_mixing_engines \ + ; do + _disable_test "$t" "Unstable test" done - if ! use amd64 ; then - # fixed in >=mysql-8 via commit 0a417e84 - _disable_test "gis.gis_bugs_crashes" "Unstable results on non-amd64 architectures due to floating-point operation" - fi + for t in \ + gis.geometry_class_attri_prop \ + gis.geometry_property_function_issimple \ + gis.gis_bugs_crashes \ + gis.spatial_op_testingfunc_mix \ + gis.spatial_analysis_functions_buffer \ + gis.spatial_analysis_functions_distance \ + gis.spatial_utility_function_distance_sphere \ + gis.spatial_utility_function_simplify \ + gis.spatial_analysis_functions_centroid \ + ; do + _disable_test "$t" "Known rounding error with latest AMD processors" + done if use numa && use kernel_linux ; then # bug 584880 @@ -587,7 +601,39 @@ src_test() { rpl.rpl_xa_survive_disconnect_lsu_off \ rpl.rpl_xa_survive_disconnect_table \ ; do - _disable_test "$t" "requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set" + _disable_test "$t" "Requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set" + done + fi + + if has_version '>=dev-libs/openssl-1.1.1' ; then + # Tests are expecting =mysql-8 via commit 0a417e84 - _disable_test "gis.gis_bugs_crashes" "Unstable results on non-amd64 architectures due to floating-point operation" - fi + for t in \ + gis.geometry_class_attri_prop \ + gis.geometry_property_function_issimple \ + gis.gis_bugs_crashes \ + gis.spatial_op_testingfunc_mix \ + gis.spatial_analysis_functions_buffer \ + gis.spatial_analysis_functions_distance \ + gis.spatial_utility_function_distance_sphere \ + gis.spatial_utility_function_simplify \ + gis.spatial_analysis_functions_centroid \ + ; do + _disable_test "$t" "Known rounding error with latest AMD processors" + done if use numa && use kernel_linux ; then # bug 584880 @@ -595,7 +608,39 @@ src_test() { rpl.rpl_xa_survive_disconnect_lsu_off \ rpl.rpl_xa_survive_disconnect_table \ ; do - _disable_test "$t" "requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set" + _disable_test "$t" "Requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set" + done + fi + + if has_version '>=dev-libs/openssl-1.1.1' ; then + # Tests are expecting /dev/null) + [[ -z "${aio_max_nr}" || ${aio_max_nr} -lt 250000 ]] \ + && die "FEATURES=test will require fs.aio-max-nr=250000 at minimum!" + + if use latin1 ; then + # Upstream only supports tests with default charset + die "Testing with USE=latin1 is not supported." + fi + fi + + if use kernel_linux ; then + if use numa ; then + linux-info_get_any_version + + local CONFIG_CHECK="~NUMA" + + local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;" + WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support" + + check_extra_config + fi + fi +} + +src_unpack() { + unpack ${A} + + # Grab the patches + [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack + + mv -f "${WORKDIR}/${MY_P}" "${S}" || die +} + +src_prepare() { + # Avoid rpm call which would trigger sandbox, #692368 + sed -i \ + -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \ + CMakeLists.txt || die + + if use jemalloc ; then + echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + + if use tcmalloc ; then + echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + + # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux + if [[ -d "${S}/support-files/SELinux" ]] ; then + echo > "${S}/support-files/SELinux/CMakeLists.txt" || die + fi + + # Remove man pages for client-lib tools we don't install + rm \ + man/my_print_defaults.1 \ + man/perror.1 \ + man/zlib_decompress.1 \ + || die + + cmake-utils_src_prepare +} + +src_configure(){ + # 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/mysql + -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin + -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" + -DINSTALL_SBINDIR=sbin + -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" + -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" + -DWITH_UNIT_TESTS=$(usex test ON OFF) + -DWITH_EDITLINE=system + -DWITH_ZLIB=system + -DWITH_SSL=system + -DWITH_LIBWRAP=0 + -DENABLED_LOCAL_INFILE=1 + -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" + -DWITH_DEFAULT_COMPILER_OPTIONS=0 + -DWITH_DEFAULT_FEATURE_SET=0 + # 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) + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DWITH_CURL=system + -DWITH_BOOST="${S}/boost" + -DWITH_ROUTER=$(usex router ON OFF) + ) + if use test ; then + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) + else + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) + fi + + mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES ) + + # client/mysql.cc:1131:16: error: redefinition of ‘struct _hist_entry’ + mycmakeargs+=( + -DUSE_LIBEDIT_INTERFACE=0 + -DUSE_NEW_EDITLINE_INTERFACE=1 + -DHAVE_HIST_ENTRY=1 + ) + + mycmakeargs+=( + -DWITH_ICU=system + -DWITH_RE2=system + -DWITH_LIBEVENT=system + -DWITH_LZ4=system + -DWITH_PROTOBUF=system + -DWITH_MECAB=$(usex cjk system OFF) + -DWITH_NUMA=$(usex numa ON OFF) + # Our dev-libs/rapidjson doesn't carry necessary fixes for std::regex + -DWITH_RAPIDJSON=bundled + ) + + 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." + ewarn "Tests will probably fail!" + + mycmakeargs+=( + -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} + -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} + ) + elif use latin1 ; then + mycmakeargs+=( + -DDEFAULT_CHARSET=latin1 + -DDEFAULT_COLLATION=latin1_swedish_ci + ) + else + mycmakeargs+=( + -DDEFAULT_CHARSET=utf8mb4 + -DDEFAULT_COLLATION=utf8mb4_0900_ai_ci + ) + fi + + mycmakeargs+=( + -DWITH_EXTRA_CHARSETS=all + -DDISABLE_SHARED=NO + -DWITH_DEBUG=$(usex debug) + ) + + if use profiling ; then + # Setting to OFF doesn't work: Once set, profiling options will be added + # to `mysqld --help` output via sql/sys_vars.cc causing + # "main.mysqld--help-notwin" test to fail + mycmakeargs+=( -DENABLED_PROFILING=ON ) + fi + + # Storage engines + mycmakeargs+=( + -DWITH_EXAMPLE_STORAGE_ENGINE=0 + -DWITH_ARCHIVE_STORAGE_ENGINE=1 + -DWITH_BLACKHOLE_STORAGE_ENGINE=1 + -DWITH_CSV_STORAGE_ENGINE=1 + -DWITH_FEDERATED_STORAGE_ENGINE=1 + -DWITH_HEAP_STORAGE_ENGINE=1 + -DWITH_INNOBASE_STORAGE_ENGINE=1 + -DWITH_INNODB_MEMCACHED=0 + -DWITH_MYISAMMRG_STORAGE_ENGINE=1 + -DWITH_MYISAM_STORAGE_ENGINE=1 + ) + + cmake-utils_src_configure +} + +# Official test instructions: +# ulimit -n 16500 && \ +# USE='perl server' \ +# FEATURES='test userpriv' \ +# ebuild mysql-X.X.XX.ebuild \ +# digest clean package +src_test() { + _disable_test() { + local rawtestname bug reason + rawtestname="${1}" ; shift + bug="${1}" ; shift + reason="${@}" + ewarn "test '${rawtestname}' disabled: '${reason}' (BUG#${bug})" + echo ${rawtestname} : BUG#${bug} ${reason} >> "${T}/disabled.def" + } + + local TESTDIR="${BUILD_DIR}/mysql-test" + local retstatus_unit + local retstatus_tests + + # Run CTest (test-units) + cmake-utils_src_test + retstatus_unit=$? + + # Ensure that parallel runs don't die + export MTR_BUILD_THREAD="$((${RANDOM} % 100))" + + if [[ -z "${MTR_PARALLEL}" ]] ; then + local -x MTR_PARALLEL=$(makeopts_jobs) + + if [[ ${MTR_PARALLEL} -gt 4 ]] ; then + # Running multiple tests in parallel usually require higher ulimit + # and fs.aio-max-nr setting. In addition, tests like main.multi_update + # are known to hit timeout when system is busy. + # To avoid test failure we will limit MTR_PARALLEL to 4 instead of + # using "auto". + local info_msg="Parallel MySQL test suite jobs limited to 4 (MAKEOPTS=${MTR_PARALLEL})" + info_msg+=" to avoid test failures. Set MTR_PARALLEL if you know what you are doing!" + einfo "${info_msg}" + unset info_msg + MTR_PARALLEL=4 + fi + fi + + # 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" + + local -a disabled_tests + disabled_tests+=( "auth_sec.keyring_file_data_qa;0;Won't work with user privileges") + disabled_tests+=( "gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "main.mysqlslap;1253001;Known failure - no upstream bug yet (RH)" ) + disabled_tests+=( "main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet") + disabled_tests+=( "main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet") + disabled_tests+=( "perfschema.idx_threads;0;Know failure - no upstream bug yet" ) + disabled_tests+=( "perfschema.idx_session_connect_attrs;0;Know failure - no upstream bug yet" ) + disabled_tests+=( "perfschema.idx_session_account_connect_attrs;0;Know failure - no upstream bug yet" ) + disabled_tests+=( "rpl_gtid.rpl_gtid_stm_drop_table;90612;Known test failure" ) + disabled_tests+=( "rpl_gtid.rpl_multi_source_mtr_includes;0;Know failure - no upstream bug yet" ) + disabled_tests+=( "sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware") + disabled_tests+=( "x.connection;0;Know failure - no upstream bug yet" ) + + local test_ds + for test_infos_str in "${disabled_tests[@]}" ; do + IFS=';' read -r -a test_infos_arr <<< "${test_infos_str}" + + if [[ ${#test_infos_arr[@]} != 3 ]] ; then + die "Invalid test data set, not matching format: ${test_infos_str}" + fi + + _disable_test "${test_infos_arr[0]}" "${test_infos_arr[1]}" "${test_infos_arr[2]}" + done + unset test_ds test_infos_str test_infos_arr + + # Try to increase file limits to increase test coverage + if ! ulimit -n 16500 1>/dev/null 2>&1 ; then + # Upper limit comes from parts.partition_* tests + ewarn "For maximum test coverage please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager." + + if ! ulimit -n 4162 1>/dev/null 2>&1 ; then + # Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)' + ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager." + + if ! ulimit -n 3000 1>/dev/null 2>&1 ; then + ewarn "For minimum test coverage please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager." + else + einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)." + fi + else + einfo "Will run test suite with open file limit set to 4162 (medium test coverage)." + fi + else + einfo "Will run test suite with open file limit set to 16500 (best test coverage)." + 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" +} + +src_install() { + cmake-utils_src_install + + # 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 "${ED}/${MY_SHAREDSTATEDIR#${EPREFIX}}/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-5.7" "${TMPDIR}/my.cnf" || die + eprefixify "${TMPDIR}/my.cnf" + doins "${TMPDIR}/my.cnf" + insinto "${MY_SYSCONFDIR#${EPREFIX}}/mysql.d" + cp "${FILESDIR}/my.cnf-8.0.distro-client" "${TMPDIR}/50-distro-client.cnf" || die + eprefixify "${TMPDIR}/50-distro-client.cnf" + doins "${TMPDIR}/50-distro-client.cnf" + + mycnf_src="my.cnf-8.0.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|utf8mb4|latin1|g" \ + "${TMPDIR}/my.cnf.ok" || die + fi + + eprefixify "${TMPDIR}/my.cnf.ok" + + newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf + + #Remove mytop if perl is not selected + [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" + + if use router ; then + rm -rf \ + "${ED}/usr/LICENSE.router" \ + "${ED}/usr/README.router" \ + "${ED}/usr/run" \ + "${ED}/usr/var" \ + || die + fi + + # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. + find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die +} + +pkg_postinst() { + # Make sure the vars are correctly initialized + mysql_init_vars + + # Create log directory securely if it does not exist + # NOTE: $MY_LOGDIR contains $EPREFIX by default + [[ -d "${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${MY_LOGDIR}" + + # Note about configuration change + einfo + elog "This version of ${PN} reorganizes the configuration from a single my.cnf" + elog "to several files in /etc/mysql/mysql.d." + elog "Please backup any changes you made to /etc/mysql/my.cnf" + elog "and add them as a new file under /etc/mysql/mysql.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 + + if [[ -z "${REPLACING_VERSIONS}" ]] ; then + einfo + elog "You might want to run:" + elog " \"emerge --config =${CATEGORY}/${PF}\"" + elog "if this is a new install." + einfo + else + einfo + elog "Upgrade process for ${PN}-8.x has changed. Please read" + elog "https://dev.mysql.com/doc/refman/8.0/en/upgrade-binary-package.html" + einfo + fi +} + +pkg_config() { + local mysqld_binary="${EROOT}/usr/sbin/mysqld" + if [[ ! -x "${mysqld_binary}" ]] ; then + die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local mysql_binary="${EROOT}/usr/bin/mysql" + if [[ ! -x "${mysql_binary}" ]] ; then + die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" + if [[ ! -x "${my_print_defaults_binary}" ]] ; then + die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" + fi + + if [[ -z "${MYSQL_USER}" ]] ; then + MYSQL_USER=mysql + if use prefix ; then + MYSQL_USER=$(id -u -n 2>/dev/null) + if [[ -z "${MYSQL_USER}" ]] ; then + die "Failed to determine current username!" + fi + fi + fi + + if [[ -z "${MYSQL_GROUP}" ]] ; then + MYSQL_GROUP=mysql + if use prefix ; then + MYSQL_GROUP=$(id -g -n 2>/dev/null) + if [[ -z "${MYSQL_GROUP}" ]] ; then + die "Failed to determine current user groupname!" + fi + fi + fi + + einfo "Will use username '${MYSQL_USER}' and group '${MYSQL_GROUP}' ..." + + _getoptval() { + local section="$1" + local flag="--${2}=" + local extra_options="${3}" + local cmd=( + "${my_print_defaults_binary}" + "${extra_options}" + "${section}" + ) + local results=( $(eval "${cmd[@]}" 2>/dev/null | sed -n "/^${flag}/s,${flag},,gp") ) + + if [[ ${#results[@]} -gt 0 ]] ; then + # When option is set multiple times only return last value + echo "${results[-1]}" + fi + } + + _mktemp_dry() { + # emktemp has no --dry-run option + local template="${1}" + + if [[ -z "${template}" ]] ; then + if [[ -z "${T}" ]] ; then + template="/tmp/XXXXXXX" + else + template="${T}/XXXXXXX" + fi + fi + + local template_wo_X=${template//X/} + local n_X + let n_X=${#template}-${#template_wo_X} + if [[ ${n_X} -lt 3 ]] ; then + echo "${FUNCNAME[0]}: too few X's in template ‘${template}’" >&2 + return + fi + + local attempts=0 + local character tmpfile + while [[ true ]] ; do + let attempts=attempts+1 + + new_file= + while read -n1 character ; do + if [[ "${character}" == "X" ]] ; then + tmpfile+="${RANDOM:0:1}" + else + tmpfile+="${character}" + fi + done < <(echo -n "${template}") + + if [[ ! -f "${tmpfile}" ]] + then + echo "${tmpfile}" + return + fi + + if [[ ${attempts} -ge 100 ]] ; then + echo "${FUNCNAME[0]}: Cannot create temporary file after 100 attempts." >&2 + return + fi + done + } + + # my_print_defaults needs to read stuff in $HOME/.my.cnf + local -x HOME="${EROOT}/root" + + # Make sure the vars are correctly initialized + mysql_init_vars + + # Read currently set data directory + MY_DATADIR="$(_getoptval mysqld datadir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + + # 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 "${MY_DATADIR}" ]] ; then + die "Sorry, unable to find MY_DATADIR!" + elif [[ -d "${MY_DATADIR}/mysql" ]] ; then + ewarn "Looks like your data directory '${MY_DATADIR}' is already initialized!" + ewarn "Please rename or delete its content if you wish to initialize a new data directory." + die "${PN} data directory at '${MY_DATADIR}' looks already initialized!" + else + einfo "${PN} data directory detected as '${MY_DATADIR}' ..." + fi + + MYSQL_TMPDIR="$(_getoptval mysqld tmpdir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + # These are dir+prefix + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + + # Create missing directories. + # Always check if mysql user can write to directory even if we just + # created directory because a parent directory might be not + # accessible for that user. + PID_DIR="${EROOT}/run/mysqld" + if [[ ! -d "${PID_DIR}" ]] ; then + einfo "Creating ${PN} PID directory '${PID_DIR}' ..." + install -d -m 755 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${PID_DIR}" \ + || die "Failed to create PID directory '${PID_DIR}'!" + fi + + local _pid_dir_testfile="$(_mktemp_dry "${PID_DIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_pid_dir_testfile}" ]] \ + && die "_mktemp_dry() for '${PID_DIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_pid_dir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_pid_dir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into PID dir '${PID_DIR}'!" + else + rm "${_pid_dir_testfile}" || die + unset _pid_dir_testfile + fi + + if [[ ! -d "${MY_DATADIR}" ]] ; then + einfo "Creating ${PN} data directory '${MY_DATADIR}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MY_DATADIR}" \ + || die "Failed to create ${PN} data directory '${MY_DATADIR}'!" + fi + + local _my_datadir_testfile="$(_mktemp_dry "${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_datadir_testfile}" ]] \ + && die "_mktemp_dry() for '${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_datadir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_datadir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into data directory '${MY_DATADIR}'!" + else + rm "${_my_datadir_testfile}" || die + unset _my_datadir_testfile + fi + + if [[ -n "${MYSQL_TMPDIR}" && ! -d "${MYSQL_TMPDIR}" ]] ; then + einfo "Creating ${PN} tmpdir '${MYSQL_TMPDIR}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_TMPDIR}" \ + || die "Failed to create ${PN} tmpdir '${MYSQL_TMPDIR}'!" + fi + + if [[ -n "${MYSQL_TMPDIR}" ]] ; then + local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_tmpdir_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_tmpdir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into data directory '${MYSQL_TMPDIR}'!" + else + rm "${_my_tmpdir_testfile}" || die + unset _my_tmpdir_testfile + fi + else + # If no tmpdir is set, mysqld will use default system tmpdir. + # However, we are using tmpdir from package manager at the + # moment which maybe isn't writeable for $MYSQL_USER... + MYSQL_TMPDIR="$(_mktemp_dry "${T}/mysqld-tmp.XXXXXXXXX")" + [[ -z "${MYSQL_TMPDIR}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}' failed!" + + mkdir "${MYSQL_TMPDIR}" || die + chown ${MYSQL_USER} "${MYSQL_TMPDIR}" || die + fi + + if [[ -n "${MYSQL_LOG_BIN}" && ! -d "${MYSQL_LOG_BIN}" ]] ; then + einfo "Creating ${PN} log-bin directory '${MYSQL_LOG_BIN}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_LOG_BIN}" \ + || die "Failed to create ${PN} log-bin directory '${MYSQL_LOG_BIN}'" + fi + + if [[ -n "${MYSQL_LOG_BIN}" ]] ; then + local _my_logbin_testfile="$(_mktemp_dry "${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_logbin_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_logbin_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_logbin_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into log-bin directory '${MYSQL_LOG_BIN}'!" + else + rm "${_my_logbin_testfile}" || die + unset _my_logbin_testfile + fi + fi + + if [[ -n "${MYSQL_RELAY_LOG}" && ! -d "${MYSQL_RELAY_LOG}" ]] ; then + einfo "Creating ${PN} relay-log directory '${MYSQL_RELAY_LOG}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_RELAY_LOG}" \ + || die "Failed to create ${PN} relay-log directory '${MYSQL_RELAY_LOG}'!" + fi + + if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then + local _my_relaylog_testfile="$(_mktemp_dry "${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_relaylog_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_relaylog_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_relaylog_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into relay-log directory '${MYSQL_RELAY_LOG}'!" + else + rm "${_my_relaylog_testfile}" || die + unset _my_relaylog_testfile + fi + fi + + local -a config_files + + local config_file="${EROOT}/etc/mysql/mysql.d/50-distro-client.cnf" + if [[ -f "${config_file}" ]] ; then + config_files+=( "${config_file}" ) + else + ewarn "Client configuration '${config_file}' not found; Skipping configuration of default authentication plugin for client ..." + fi + + config_file="${EROOT}/etc/mysql/mysql.d/50-distro-server.cnf" + if [[ -f "${config_file}" ]] ; then + config_files+=( "${config_file}" ) + else + ewarn "Server configuration '${config_file}' not found; Skipping configuration of default authentication plugin for mysqld ..." + fi + + if [[ ${#config_files[@]} -gt 0 ]] ; then + if [[ -z "${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" ]] ; then + local user_answer + + echo + einfo "Please select default authentication plugin (enter number or plugin name):" + einfo "1) caching_sha2_password [MySQL 8.0 default]" + einfo "2) mysql_native_password [MySQL 5.7 default]" + einfo + einfo "For details see:" + einfo "https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password" + read -p " >" user_answer + echo + + case "${user_answer}" in + 1|caching_sha2_password) + MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=caching_sha2_password + ;; + 2|mysql_native_password) + MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=mysql_native_password + ;; + '') + die "No authentication plugin selected!" + ;; + *) + die "Authentication plugin '${user_answer}' is unknown/unsupported!" + ;; + esac + + unset user_answer + fi + + local cfg_option cfg_option_tabs cfg_section + for config_file in "${config_files[@]}" ; do + cfg_option="default-authentication-plugin" + cfg_section="mysqld" + cfg_option_tabs="\t\t" + if [[ "${config_file}" == *client.cnf ]] ; then + cfg_option="default-auth" + cfg_section="client" + cfg_option_tabs="\t\t\t\t" + fi + + if grep -qE "^(loose-)?${cfg_option}\b.*=" "${config_file}" 2>/dev/null ; then + einfo "Ensuring that ${cfg_option} is set to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." + sed -i \ + -e "s/^\(loose-\)\?${cfg_option}\b.*=.*/loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}/" \ + "${config_file}" || die "Failed to change ${cfg_option} in '${config_file}'!" + else + einfo "Setting ${cfg_option} to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." + sed -i \ + -e "/^\[${cfg_section}\]$/a loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" \ + "${config_file}" || die "Failed to add ${cfg_option} to '${config_file}'!" + fi + done + unset cfg_option cfg_option_tabs cfg_section + fi + unset config_files config_file + + echo + + 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 + + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then + local pwd1="a" + local pwd2="b" + + echo + einfo "No password for mysql 'root' user was specified via environment" + einfo "variable MYSQL_ROOT_PASSWORD and no password was found in config" + einfo "file like '${HOME}/.my.cnf'." + einfo "To continue please provide a password for the mysql 'root' user" + einfo "now on console:" + ewarn "NOTE: Please 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 + + echo + fi + + local -a mysqld_options + + # Fix bug 446200. Don't reference host my.cnf, needs to come first, + # see http://bugs.mysql.com/bug.php?id=31312 + use prefix && mysqld_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 + + local opt optexp optfull + for opt in 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}" && mysqld_options+=( "${optfull}" ) + done + + # Prepare timezones, see + # https://dev.mysql.com/doc/mysql/en/time-zone-support.html + local tz_sql="${TMPDIR}/tz.sql" + echo "USE mysql;" >"${tz_sql}" + "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${tz_sql}" 2>/dev/null + if [[ $? -ne 0 ]] ; then + die "mysql_tzinfo_to_sql failed!" + fi + + chown ${MYSQL_USER} "${tz_sql}" || die + + local mysql_install_log="${TMPDIR}/mysql_install_db.log" + touch "${mysql_install_log}" || die + chown ${MYSQL_USER} "${mysql_install_log}" || die + + # --initialize-insecure will not set root password + # --initialize would set a random one in the log which we don't need as we set it ourselves + local cmd=( + "${mysqld_binary}" + "${mysqld_options[@]}" + "--initialize-insecure" + "--init-file='${tz_sql}'" + "--basedir='${EROOT}/usr'" + "--datadir='${MY_DATADIR}'" + "--tmpdir='${MYSQL_TMPDIR}'" + "--log-error='${mysql_install_log}'" + "--user=${MYSQL_USER}" + ) + + einfo "Initializing ${PN} data directory: ${cmd[@]}" + eval "${cmd[@]}" >>"${mysql_install_log}" 2>&1 + + if [[ $? -ne 0 || ! -f "${MY_DATADIR}/mysql.ibd" ]] ; then + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_install_log}" 1>&2 + die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!" + fi + + local x=${RANDOM} + local socket="${EROOT}/run/mysqld/mysqld${x}.sock" + local pidfile="${EROOT}/run/mysqld/mysqld${x}.pid" + unset x + + local mysqld_logfile="${TMPDIR}/mysqld.log" + touch "${mysqld_logfile}" || die + chown ${MYSQL_USER} "${mysqld_logfile}" || die + + cmd=( + "${mysqld_binary}" + "${mysqld_options[@]}" + "--basedir='${EROOT}/usr'" + "--datadir='${MY_DATADIR}'" + "--tmpdir='${MYSQL_TMPDIR}'" + --max_allowed_packet=8M + --net_buffer_length=16K + "--socket='${socket}'" + "--pid-file='${pidfile}'" + "--log-error='${mysqld_logfile}'" + "--user=${MYSQL_USER}" + ) + + einfo "Starting mysqld to finalize initialization: ${cmd[@]}" + eval "${cmd[@]}" >>"${mysqld_logfile}" 2>&1 & + + echo -n "Waiting for mysqld to accept connections " + local maxtry=15 + while [[ ! -S "${socket}" && "${maxtry}" -gt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + + if [[ -S "${socket}" ]] ; then + # Even with a socket we don't know if mysqld will abort + # start due to an error so just wait a little bit more... + maxtry=5 + while [[ -S "${socket}" && "${maxtry}" -gt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + fi + + echo + + if [[ ! -S "${socket}" ]] ; then + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysqld_logfile}" 1>&2 + die "mysqld was unable to start from initialized data directory. Please review '${mysqld_logfile}'!" + fi + + local mysql_logfile="${TMPDIR}/set_root_pw.log" + touch "${mysql_logfile}" || die + + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'" + cmd=( + "${mysql_binary}" + --no-defaults + "--socket='${socket}'" + -hlocalhost + "-e \"${sql}\"" + ) + eval "${cmd[@]}" >"${mysql_logfile}" 2>&1 + local rc=$? + eend ${rc} + + if [[ ${rc} -ne 0 ]] ; then + # Poor man's solution which tries to avoid having password + # in log. NOTE: sed can fail if user didn't follow advice + # and included character which will require escaping... + sed -i -e "s/${MYSQL_ROOT_PASSWORD}/*****/" "${mysql_logfile}" 2>/dev/null + + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_logfile}" + die "Failed to set ${PN} root password. Please review '${mysql_logfile}'!" + fi + + # Stop the server + if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then + echo -n "Stopping the server " + pkill -F "${pidfile}" &>/dev/null + + maxtry=10 + while [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + + echo + + if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then + # We somehow failed to stop server. + # However, not a fatal error. Just warn the user. + ewarn "WARNING: mysqld[$(cat "${pidfile}")] is still running!" + fi + fi + + einfo "${PN} data directory at '${MY_DATADIR}' successfully initialized!" +} diff --git a/dev-db/mysql/mysql-8.0.17_pre1.ebuild b/dev-db/mysql/mysql-8.0.17_pre1.ebuild deleted file mode 100644 index a1c1a4d312e8..000000000000 --- a/dev-db/mysql/mysql-8.0.17_pre1.ebuild +++ /dev/null @@ -1,815 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -MY_EXTRAS_VER="20190802-1549Z" - -CMAKE_MAKEFILE_GENERATOR=emake - -# Keeping eutils in EAPI=6 for emktemp in pkg_config - -inherit cmake-utils eutils flag-o-matic linux-info \ - prefix toolchain-funcs - -MY_PV="${PV//_pre*}" -MY_P="${PN}-${MY_PV}" - -S="${WORKDIR}/${PN}-${MY_PV}" - -SRC_URI="https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-boost-${MY_PV}.tar.gz - https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-${MY_PV}.tar.gz - http://downloads.mysql.com/archives/MySQL-8.0/${PN}-boost-${MY_PV}.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" -fi - -HOMEPAGE="https://www.mysql.com/" -DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" -LICENSE="GPL-2" -SLOT="0/21" -IUSE="cjk cracklib debug experimental jemalloc latin1 libressl numa +perl profiling - router selinux ssl static tcmalloc test" - -# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests -RESTRICT="libressl? ( test )" - -REQUIRED_USE="?? ( tcmalloc jemalloc )" - -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" - -# Shorten the path because the socket path length must be shorter than 107 chars -# and we will run a mysql server during test phase -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}"/20001_all_fix-minimal-build-cmake-mysql-8.0.17.patch - "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-8.0.17.patch - "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-grant_user_lock-a-root.patch - "${MY_PATCH_DIR}"/20018_all_mysql-8.0.17-without-clientlibs-tools.patch - "${MY_PATCH_DIR}"/20018_all_mysql-8.0.17-fix-libressl-support.patch -) - -# Be warned, *DEPEND are version-dependant -# These are used for both runtime and compiletime -COMMON_DEPEND="net-misc/curl:= - >=sys-apps/sed-4 - >=sys-apps/texinfo-4.7-r1 - sys-libs/ncurses:0= - dev-db/mysql-connector-c - >=dev-libs/protobuf-3.8 - >=app-arch/lz4-0_p131:= - dev-libs/libedit - cjk? ( app-text/mecab:= ) - dev-libs/libevent:= - net-libs/libtirpc:= - numa? ( sys-process/numactl ) - >=sys-libs/zlib-1.2.3:0= - jemalloc? ( dev-libs/jemalloc:0= ) - kernel_linux? ( - dev-libs/libaio:0= - sys-process/procps:0= - ) - tcmalloc? ( dev-util/google-perftools:0= ) - ssl? ( - !libressl? ( >=dev-libs/openssl-1.0.0:0= ) - libressl? ( dev-libs/libressl:0= ) - ) -" -DEPEND="${COMMON_DEPEND} - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) - virtual/yacc - dev-libs/libevent - experimental? ( net-libs/rpcsvc-proto ) - static? ( sys-libs/ncurses[static-libs] ) - test? ( - acct-group/mysql acct-user/mysql - dev-perl/JSON - ) -" -RDEPEND="${COMMON_DEPEND} - !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster - selinux? ( sec-policy/selinux-mysql ) - !prefix? ( - acct-group/mysql acct-user/mysql - dev-db/mysql-init-scripts - ) -" -# 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 )" - -mysql_init_vars() { - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"} - 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_pretend() { - if use numa ; then - local CONFIG_CHECK="~NUMA" - - local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;" - WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support" - - check_extra_config - 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 [[ -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 - - # Note about configuration change - einfo - elog "This version of ${PN} reorganizes the configuration from a single my.cnf" - elog "to several files in /etc/mysql/mysql.d." - elog "Please backup any changes you made to /etc/mysql/my.cnf" - elog "and add them as a new file under /etc/mysql/mysql.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}/${MY_P}" "${S}" || die -} - -src_prepare() { - if use jemalloc ; then - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - - if use tcmalloc ; then - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - - # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux - if [[ -d "${S}/support-files/SELinux" ]] ; then - echo > "${S}/support-files/SELinux/CMakeLists.txt" || die - fi - - # man pages for client-lib tools we don't install - rm \ - man/my_print_defaults.1 \ - man/perror.1 \ - man/zlib_decompress.1 \ - || die - - cmake-utils_src_prepare -} - -src_configure(){ - # 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/mysql - -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin - -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" - -DINSTALL_SBINDIR=sbin - -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" - -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" - -DWITH_UNIT_TESTS=$(usex test ON OFF) - ### TODO: make this system but issues with UTF-8 prevent it - -DWITH_EDITLINE=system - -DWITH_ZLIB=system - -DWITH_SSL=$(usex ssl system wolfssl) - -DWITH_LIBWRAP=0 - -DENABLED_LOCAL_INFILE=1 - -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" - -DWITH_DEFAULT_COMPILER_OPTIONS=0 - -DWITH_DEFAULT_FEATURE_SET=0 - # 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) - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DWITH_CURL=system - -DWITH_BOOST="${S}/boost" - -DWITH_ROUTER=$(usex router ON OFF) - ) - if use test ; then - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) - else - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) - fi - - mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES ) - - # client/mysql.cc:1131:16: error: redefinition of ‘struct _hist_entry’ - mycmakeargs+=( - -DUSE_LIBEDIT_INTERFACE=0 - -DUSE_NEW_EDITLINE_INTERFACE=1 - -DHAVE_HIST_ENTRY=1 - ) - - mycmakeargs+=( - -DWITH_ICU=system - -DWITH_RE2=system - -DWITH_LIBEVENT=system - -DWITH_LZ4=system - -DWITH_PROTOBUF=bundled - -DWITH_MECAB=$(usex cjk system OFF) - -DWITH_NUMA=$(usex numa ON OFF) - # Our dev-libs/rapidjson doesn't carry necessary fixes for std::regex - -DWITH_RAPIDJSON=bundled - ) - - 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." - ewarn "Tests will probably fail!" - - mycmakeargs+=( - -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} - -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} - ) - elif use latin1 ; then - mycmakeargs+=( - -DDEFAULT_CHARSET=latin1 - -DDEFAULT_COLLATION=latin1_swedish_ci - ) - else - mycmakeargs+=( - -DDEFAULT_CHARSET=utf8mb4 - -DDEFAULT_COLLATION=utf8mb4_0900_ai_ci - ) - fi - - mycmakeargs+=( - -DWITH_EXTRA_CHARSETS=all - -DDISABLE_SHARED=$(usex static YES NO) - -DWITH_DEBUG=$(usex debug) - ) - - if use profiling ; then - # Setting to OFF doesn't work: Once set, profiling options will be added - # to `mysqld --help` output via sql/sys_vars.cc causing - # "main.mysqld--help-notwin" test to fail - mycmakeargs+=( -DENABLED_PROFILING=ON ) - fi - - if use static ; then - mycmakeargs+=( -DWITH_PIC=1 ) - fi - - # Storage engines - mycmakeargs+=( - -DWITH_EXAMPLE_STORAGE_ENGINE=0 - -DWITH_ARCHIVE_STORAGE_ENGINE=1 - -DWITH_BLACKHOLE_STORAGE_ENGINE=1 - -DWITH_CSV_STORAGE_ENGINE=1 - -DWITH_FEDERATED_STORAGE_ENGINE=1 - -DWITH_HEAP_STORAGE_ENGINE=1 - -DWITH_INNOBASE_STORAGE_ENGINE=1 - -DWITH_INNODB_MEMCACHED=0 - -DWITH_MYISAMMRG_STORAGE_ENGINE=1 - -DWITH_MYISAM_STORAGE_ENGINE=1 - ) - - cmake-utils_src_configure -} - -# Official test instructions: -# ulimit -n 16500 && \ -# USE='perl server' \ -# FEATURES='test userpriv -usersandbox' \ -# ebuild mysql-X.X.XX.ebuild \ -# digest clean package -src_test() { - _disable_test() { - local rawtestname bug reason - rawtestname="${1}" ; shift - bug="${1}" ; shift - reason="${@}" - ewarn "test '${rawtestname}' disabled: '${reason}' (BUG#${bug})" - echo ${rawtestname} : BUG#${bug} ${reason} >> "${T}/disabled.def" - } - - local TESTDIR="${BUILD_DIR}/mysql-test" - local retstatus_unit - local retstatus_tests - - # 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" - - if use latin1 ; then - # Upstream only supports tests with default charset - die "Testing with USE=latin1 is not supported." - fi - - 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" - - local -a disabled_tests - disabled_tests+=( "gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet") - disabled_tests+=( "main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet") - disabled_tests+=( "sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware") - disabled_tests+=( "rpl_gtid.rpl_gtid_stm_drop_table;90612;Known test failure" ) - disabled_tests+=( "rpl_gtid.rpl_multi_source_mtr_includes;0;Know failure - no upstream bug yet" ) - disabled_tests+=( "x.connection;0;Know failure - no upstream bug yet" ) - disabled_tests+=( "main.mysqlslap;1253001;Known failure - no upstream bug yet (RH)" ) - disabled_tests+=( "perfschema.idx_threads;0;Know failure - no upstream bug yet" ) - disabled_tests+=( "perfschema.idx_session_connect_attrs;0;Know failure - no upstream bug yet" ) - disabled_tests+=( "perfschema.idx_session_account_connect_attrs;0;Know failure - no upstream bug yet" ) - - local test_ds - for test_infos_str in "${disabled_tests[@]}" ; do - IFS=';' read -r -a test_infos_arr <<< "${test_infos_str}" - - if [[ ${#test_infos_arr[@]} != 3 ]] ; then - die "Invalid test data set, not matching format: ${test_infos_str}" - fi - - _disable_test "${test_infos_arr[0]}" "${test_infos_arr[1]}" "${test_infos_arr[2]}" - done - unset test_ds test_infos_str test_infos_arr - - # Try to increase file limits to increase test coverage - if ! ulimit -n 16500 1>/dev/null 2>&1 ; then - # Upper limit comes from parts.partition_* tests - ewarn "For maximum test coverage please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager." - - if ! ulimit -n 4162 1>/dev/null 2>&1 ; then - # Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)' - ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager." - - if ! ulimit -n 3000 1>/dev/null 2>&1 ; then - ewarn "For minimum test coverage please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager." - else - einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)." - fi - else - einfo "Will run test suite with open file limit set to 4162 (medium test coverage)." - fi - else - einfo "Will run test suite with open file limit set to 16500 (best test coverage)." - fi - - local aio_max_nr=$(sysctl -n fs.aio-max-nr 2>/dev/null) - if [[ ${aio_max_nr} -lt 250000 ]] ; then - if ! sysctl -w fs.aio-max-nr=250000 2>&1 ; then - ewarn "Failed to rais fs.aio-max-nr to >=250000! Expect test failures ..." - else - einfo "fs.aio-max-nr raised to 250000!" - fi - 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" -} - -src_install() { - cmake-utils_src_install - - # 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-5.7" "${TMPDIR}/my.cnf" || die - eprefixify "${TMPDIR}/my.cnf" - doins "${TMPDIR}/my.cnf" - insinto "${MY_SYSCONFDIR#${EPREFIX}}/mysql.d" - cp "${FILESDIR}/my.cnf-8.0.distro-client" "${TMPDIR}/50-distro-client.cnf" || die - eprefixify "${TMPDIR}/50-distro-client.cnf" - doins "${TMPDIR}/50-distro-client.cnf" - - mycnf_src="my.cnf-8.0.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|utf8mb4|latin1|g" \ - "${TMPDIR}/my.cnf.ok" || die - fi - - eprefixify "${TMPDIR}/my.cnf.ok" - - newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf - - #Remove mytop if perl is not selected - [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" - - if use router ; then - rm -rf \ - "${ED}/usr/LICENSE.router" \ - "${ED}/usr/README.router" \ - "${ED}/usr/run" \ - "${ED}/usr/var" \ - || die - fi - - # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. - find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die -} - -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 "${EROOT}/$MYSQL_TMPDIR" ]] ; then - einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" - install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR" - fi - - if [[ ! -d "${EROOT}/$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 http://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 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 - # http://dev.mysql.com/doc/mysql/en/time-zone-support.html - echo "USE mysql;" >"${sqltmp}" - "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${sqltmp}" 2>/dev/null - chown mysql "${sqltmp}" || die - - # --initialize-insecure will not set root password - # --initialize would set a random one in the log which we don't need as we set it ourselves - local cmd=( "${EROOT}/usr/sbin/mysqld" "--initialize-insecure" "--init-file='${sqltmp}'" ) - 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} \ - $(use prefix || echo --user=mysql) \ - --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="ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${MYSQL_ROOT_PASSWORD}'" - "${EROOT}/usr/bin/mysql" \ - --no-defaults \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - eend $? - - # Stop the server and cleanup - einfo "Stopping the server ..." - kill $(< "${pidfile}" ) - rm -f "${sqltmp}" - wait %1 - einfo "Done" -} diff --git a/dev-db/pgbadger/Manifest b/dev-db/pgbadger/Manifest index f69a74998467..092c489fcc08 100644 --- a/dev-db/pgbadger/Manifest +++ b/dev-db/pgbadger/Manifest @@ -1,7 +1,5 @@ -DIST pgbadger-10.0.tar.gz 775322 BLAKE2B 072a3b4c2d2d109734fdbf68ff466e34065a852948ae7961e8ba6a40a6881a98653258ee7b483c2a3c9d2d8238370fd842c9b525a0dd11baf1fbf98a0d322406 SHA512 dd1633f1186069a9d59d271cbf0913cf80bcfa88af8236a194f7580c96c84a3513ca0658628069b38ef43a9c9ca7c5573afb2b35e2b1b6d3526f240c2c673bff DIST pgbadger-10.3.tar.gz 1645573 BLAKE2B 583ad35f416b6d989996ae48500dcee5734bc4867095abe1eb49be971c6190cf68dd4e127a47163c8ee49400cdf2fcee14645c98f4853b6f66c2bef0db0b83e4 SHA512 f8aac47d92ddb92292c572c47d6d32f1aa673b972b2488eede7fbe0b55feddc6ce0cb1b58994e83b93a5f84fcb5b871c7c080863d17554810cc1c1b8c1e1609a DIST pgbadger-11.0.tar.gz 1661028 BLAKE2B d83be01017d69b83cf288b23fe5066d5c691b630ce748fe42b33514346183f7b8f18efceeefe0533e534c669e986c30388a6df5b620ea654ae89b3dc3c08d342 SHA512 167534d61cb28df6cb7eae7efe788d3f6bbad1c614468e905a9b678a76b3a2dfc0eb192b595ac4dc332cd694e820f1603b79d83bc934b7dfe3d226019f6a9c15 -EBUILD pgbadger-10.0.ebuild 432 BLAKE2B 42ab8eb5952d04d2ab5ed39ab016c9849821f3e814173a3b7310cd4eeb7f9a1865de5fc332ffa05b7c51c1891881e01157f8011840a4c9478fc3a35e54741b07 SHA512 dd2a897d1741130a35049959bfe636bd522d96fd19ccb447e44f77bcc5ae3b854ab02bee64065992cb3ed4327de3d3f21aa74cb8422f430f4f947f2653a566b4 EBUILD pgbadger-10.3.ebuild 454 BLAKE2B f0fde0f81f5af4fe540bfc652b607686b574a0f4edbc4e7ed251421c8962223e8357955da642b525b5dea3fa6ae498c46232502a628df04373b28b52b7da6f8f SHA512 f1140736e8be887d864e7579e0da07b5f4f774ad4ed8bb7993c29173ff87735f02e168be4a1d955cfed9dad795b051f5d65eb773b856c35e613096ce26cc2fce EBUILD pgbadger-11.0.ebuild 455 BLAKE2B 3c335bdb99af786159c5291af9aaa48791b9ce7005d43a998457eb899cfcc7eaca8a97d165c20c864614b03b59b6638aea2fb04f41c3b18bc06135def2fe362c SHA512 7a6fa03a5f344974c9b6ade8e7c3336fbf71ec8b09f55501ab8143419bba8039c06ca7bb2004327deda7e9c6fcf28c7aa712ed16724b396a122028a633f098fb MISC metadata.xml 413 BLAKE2B 9b4f24620b42d2cf5befbaed7d52ed2e03d4619ebb547d36e207a900fe481a825a5be0a6fac073d7b278076ced053ae9a3c4b5d05597e5fb4d7ea66c1bff7988 SHA512 6bf32dc50ecd2d51d450413500b00773177109ab3ad26d74b458ec902973fa38542dbc65e65fbbe103b4be63589f61c2b9a6ab6ea5492b1954142afc5c2f8f93 diff --git a/dev-db/pgbadger/pgbadger-10.0.ebuild b/dev-db/pgbadger/pgbadger-10.0.ebuild deleted file mode 100644 index 9af05d162eb5..000000000000 --- a/dev-db/pgbadger/pgbadger-10.0.ebuild +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 1999-2018 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit perl-module - -DESCRIPTION="pgBadger is a PostgreSQL log analyzer." -HOMEPAGE="https://pgbadger.darold.net/" -SRC_URI="https://github.com/darold/pgbadger/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64" -IUSE="" - -DEPEND=" - dev-perl/JSON-XS - dev-perl/Text-CSV_XS -" -RDEPEND="${DEPEND}" diff --git a/dev-db/pgpool2/Manifest b/dev-db/pgpool2/Manifest index b9d152954e84..0c4fb51c8f47 100644 --- a/dev-db/pgpool2/Manifest +++ b/dev-db/pgpool2/Manifest @@ -3,16 +3,10 @@ AUX pgpool-configure-pam.patch 1077 BLAKE2B 4dad8c20faf2ecb1c65e95b87d394d1c17c3 AUX pgpool-configure-pthread.patch 251 BLAKE2B 69ae31095583e4615117fbeb08ceff520b9462955c3986a675971215a6ac109e6b5bebee9b5b9c49f8005a8c68c144a741307fbe3c0aab318ae324b2d8527261 SHA512 b6cae4159919d22cd63aa13efae31d1270b07da203c0abc3ea96387570543134397873668484db205a0221dbd9f87d74dcf19f3f6d103d586b3c8f21e7f4000c AUX pgpool2.confd 649 BLAKE2B 1c520c4fa954c7411c1b700c03bf4e39196c599eb239cf86412fcf491759ca6f46b1264e7647a8d278ac45da3e20702f6f077dfbcccf83cb3f45575dd3571308 SHA512 5f9a4fa1e68161049ad767d64c764fbf70e84a4239e58119455a45a7e45d86ea2d19b617147cf891053e0dad4420c84704d67015334c7d41bad05b260d70e910 AUX pgpool2.initd 2162 BLAKE2B b04f6b952507b8e4815c7b27f09b59ffe64f6262719c5490377fdbc5f8490cdead18fdbeb0ce8379d9cbd4bbb1aa21221d61853ff49a456a5ef6a8d78f3f5129 SHA512 05dd358d20bae60cfdefd7116b1111288b5a2be6d68a9dc40eaf6ba641524d422f2faac79bd3c629cee4f8b1ca601a9b6e303d4228e538d742ea407b6190ee53 -AUX pgpool_run_paths-3.6.5.patch 11626 BLAKE2B 5d0b7a49b3c8bf2f2d69d369894e9976037025b289b0ec0f2cf11ed9862347dc4cb166af2cbd65637de40fdae09809a9232b0638cf69339901d6f3f67e9ddcd5 SHA512 ea718378d0ea14fa48975a899df26bc8aafa1e61b0d3f264ead81031a21d68284f4af5ce065c5534d113faf36724c880ce280665e148ec623e9fea9c8f91c77c AUX pgpool_run_paths-3.7.10.patch 14548 BLAKE2B 89a18a3c3d4426d82978e303836ff4fafc8d7b4c36154a015c0dadf2e3eb1fa8f19ecf75f39a513b15bca8bfb543ea99e718fff0fa8ef5fde39ecbbe40469df9 SHA512 ea9541a5f9d27011005ab0fd04e2945dea1befaf060429c6a66e0c2091ac8b73a74b01174e5e409c189420405734e73fe2458fce56f4d7b56303957c450bd42d -AUX pgpool_run_paths-9999.patch 11759 BLAKE2B 35df553f704846cc4ff8d67e5e6b54ca8ed0a5817a148c359b47cae7ff388fe2bb57600113d7f8ac9afe760ea75e3ddd410d111c2ef87aea3c3fb38671d59260 SHA512 109be0f3bcda49db14ebb86d6e9347aa0a47d582ac1a1438b07719f9fa503045cc5b65a27964c3c0b1690ef489f752a497e3b050b816569d0ce01193dc007259 DIST pgpool-II-3.7.10.tar.gz 3375419 BLAKE2B 96d589e9a3eff631bd4bffdcf321b3b532e5f0985dd4a5948fabc3228400305dc98fbf17ba64e162ecbaecca400e1bb3cad6fc954b2d624292f6f22deb48a789 SHA512 a89c392e336f5dd608c6876011f996fa1e4d7cb4b0eef31c24b2338ac287b72b73948e82429715d38fd9a7a6598f56828192722a2a8ee0d473738b804c4a2a48 -DIST pgpool-II-3.7.8.tar.gz 3337039 BLAKE2B bce75be04d3c37dffecbc0a1f029d6e97f316cc2497de032ccd4862acc6e7ae64f12ffffdb42a99141e548a2cc616ed02d7eef6ca2f63e222fb400cbad72828c SHA512 0f4e337c2307368cfd38f29c63b9267dd3171dc4b9cd2c59cff564295908e2f561230156a5b690e4d87ce4c8b3174d01b081147e7f5d8ff403d3adc8e7cea7e7 -DIST pgpool-II-4.0.3.tar.gz 3715976 BLAKE2B c5ecfebc44ee4d6ab8fda5ae0854bb51423252ba518b356a37d3b125bc8f4fac048f6f944fdf9b1ee785aae5ac3eca4c4196adf218bc071dd90b93da5c6e6c08 SHA512 76ffbc8df120d4ef68b761684a1805c0349665375f549cd3a194f7d09b9bbdf70d0824da0cbe975e6d15f850704c4fc7c1a2218f551f88f2ce56f542bdfee9b8 DIST pgpool-II-4.0.5.tar.gz 3768842 BLAKE2B 2756d23db950a037a9203aae41293535de25d11bf9860f509040bf5b483ae5fb9e651c8189ee5f0a9398a45d20d2c54566769945e38c52361c160a1162a8e3af SHA512 897df553dba3a1800adae5d22ed4f4fe210a3013fb533730837591244877eeaf0e4090d1a0c65e189b71798b5c303ea22e2198f6317b54f74f10ba48fa2188c6 EBUILD pgpool2-3.7.10.ebuild 2640 BLAKE2B 706f1648357185590654e6c8ed30a0660e811f716ac66c6e210c986246a0e7d69c6ccad29e70c3eb89729dc06b3452009ad888eae1f89d53ed50ec2b02befb5a SHA512 22b822a9bb249d3370eeed47d7dd14ee8c073a1ebfe80a47fc4b59137d5339119843f5623b8882bb6ce53b19813dad271639b3b6ff10656b1f70cdba36e36c81 -EBUILD pgpool2-3.7.8.ebuild 2639 BLAKE2B 5b6f0fb2a88d981bfdc685fceda7d46be1542c77900553bf1347dc9f33623bc0fa758db6cbe076ae6b40c9c845ce708e6b6fb5f6a773417ac9bb9a89738af496 SHA512 ce5b7248099553db4d31d009e0a7fba2beeb0cb748f28a4c1f6fa934ec27a6f0ef1d488b01e000bf6cface2a2f74b79fb871234a222fca2e98354b69b8574b53 -EBUILD pgpool2-4.0.3.ebuild 2645 BLAKE2B e2fefc4fda048aa97559fd0b29c0d9480941b4fe4c7951d6ebc1915c5c1f32faa6029602c19ddee16892cf114deada3cbae13564e4d55c274e687f3e578edb0b SHA512 73ef79cc3f04037ebcfeb6dda1ba082e7b3e80f69e33bc651145fea6288dc8288c977c8cdfaba3b9dc440b52472aa200e71945620d7bea4145a03e23cfd58fca EBUILD pgpool2-4.0.5.ebuild 2646 BLAKE2B 5baae984a5bbe47e9866f29da69c95d955c71fdb42ec140bff2d0c7736285526279654547af311dcbd07ac439d390e5d91c0e1225ea3c4ad18d097afb03dfbda SHA512 1cfed6e9f01955d0580845d63172a571ade0fa254302aac8ad376c59374228c83290f302861d8553341bb5c88bd4171916d386c51b055c2acab947deafd7303f EBUILD pgpool2-9999.ebuild 2723 BLAKE2B 4c593cebf5c8f46ffe83697d500b3bb0151c27a58c1aff005f4668d88ddb35d41ce2b18078cff1bd90b6ea4b2b1010ef40ea313f20595d5e1def107b2bae9cf7 SHA512 5a90ab19128765d850037360b7595338364875a4b17e18d91fff167371a3cf8b0439706388fcbc9a89f54909b5dc4d46129e326acabb1e8dbea488b9b452b5ef MISC metadata.xml 390 BLAKE2B d6a0560051449e95bb43e81589eee966a477a75d7ec8211ae96b15f2d51ce9555181b8640d9d830f2b42f8159989e9126423c6ccbbc2bf2dd8121f4920a87a16 SHA512 ce26ee116c3c7ff77a771294ed07f38d8f940dc380915c339eb4c543d86fa5bde025ba83e70af2b7bf4a1bef1e51957f151131836855e0dae2e1daed73ffae8d diff --git a/dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch b/dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch deleted file mode 100644 index 06c1b3711bd4..000000000000 --- a/dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch +++ /dev/null @@ -1,268 +0,0 @@ -diff -ur a/src/include/parser/pg_config_manual.h b/src/include/parser/pg_config_manual.h ---- a/src/include/parser/pg_config_manual.h 2017-07-10 04:56:18.000000000 -0400 -+++ b/src/include/parser/pg_config_manual.h 2017-07-11 09:38:46.612907898 -0400 -@@ -193,7 +193,7 @@ - * here's where to twiddle it. You can also override this at runtime - * with the postmaster's -k switch. - */ --#define DEFAULT_PGSOCKET_DIR "/tmp" -+#define DEFAULT_PGSOCKET_DIR "/run/postgresql" - - /* - * This is the default event source for Windows event log. -Only in b/src/include/parser: pg_config_manual.h.orig -diff -ur a/src/include/pcp/pcp_stream.h b/src/include/pcp/pcp_stream.h ---- a/src/include/pcp/pcp_stream.h 2017-07-10 04:39:14.000000000 -0400 -+++ b/src/include/pcp/pcp_stream.h 2017-07-11 09:38:46.612907898 -0400 -@@ -48,6 +48,6 @@ - extern int pcp_write(PCP_CONNECTION *pc, void *buf, int len); - extern int pcp_flush(PCP_CONNECTION *pc); - --#define UNIX_DOMAIN_PATH "/tmp" -+#define UNIX_DOMAIN_PATH "/run/pgpool" - - #endif /* PCP_STREAM_H */ -diff -ur a/src/include/pool.h b/src/include/pool.h ---- a/src/include/pool.h 2017-07-10 04:56:18.000000000 -0400 -+++ b/src/include/pool.h 2017-07-11 09:38:46.612907898 -0400 -@@ -73,16 +73,16 @@ - #define HBA_CONF_FILE_NAME "pool_hba.conf" - - /* pid file directory */ --#define DEFAULT_LOGDIR "/tmp" -+#define DEFAULT_LOGDIR "/run/pgpool" - - /* Unix domain socket directory */ --#define DEFAULT_SOCKET_DIR "/tmp" -+#define DEFAULT_SOCKET_DIR "/run/postgresql" - - /* Unix domain socket directory for watchdog IPC */ --#define DEFAULT_WD_IPC_SOCKET_DIR "/tmp" -+#define DEFAULT_WD_IPC_SOCKET_DIR "/run/pgpool" - - /* pid file name */ --#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid" -+#define DEFAULT_PID_FILE_NAME "/run/pgpool/pgpool.pid" - - /* status file name */ - #define STATUS_FILE_NAME "pgpool_status" -diff -ur a/src/sample/pgpool.conf.sample b/src/sample/pgpool.conf.sample ---- a/src/sample/pgpool.conf.sample 2017-07-10 04:56:18.000000000 -0400 -+++ b/src/sample/pgpool.conf.sample 2017-07-11 11:05:00.174030914 -0400 -@@ -31,10 +31,8 @@ - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -53,10 +51,8 @@ - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Backend Connection Settings - -@@ -210,13 +206,13 @@ - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/var/log/pgpool' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -493,10 +489,8 @@ - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - -diff -ur a/src/sample/pgpool.conf.sample-master-slave b/src/sample/pgpool.conf.sample-master-slave ---- a/src/sample/pgpool.conf.sample-master-slave 2017-07-10 04:56:18.000000000 -0400 -+++ b/src/sample/pgpool.conf.sample-master-slave 2017-07-11 11:13:57.700698647 -0400 -@@ -31,10 +31,8 @@ - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -53,10 +51,8 @@ - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Backend Connection Settings - -@@ -210,13 +206,13 @@ - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/tmp' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -492,10 +488,8 @@ - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Virtual IP control Setting - -diff -ur a/src/sample/pgpool.conf.sample-replication b/src/sample/pgpool.conf.sample-replication ---- a/src/sample/pgpool.conf.sample-replication 2017-07-10 04:56:18.000000000 -0400 -+++ b/src/sample/pgpool.conf.sample-replication 2017-07-11 11:15:10.613588243 -0400 -@@ -31,10 +31,8 @@ - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -53,10 +51,8 @@ - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Backend Connection Settings - -@@ -210,13 +206,13 @@ - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/tmp' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -492,10 +488,8 @@ - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - -diff -ur a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream ---- a/src/sample/pgpool.conf.sample-stream 2017-07-10 04:56:18.000000000 -0400 -+++ b/src/sample/pgpool.conf.sample-stream 2017-07-11 11:15:50.996675811 -0400 -@@ -31,10 +31,8 @@ - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - -@@ -47,10 +45,8 @@ - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -211,13 +207,13 @@ - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/tmp' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -492,10 +488,8 @@ - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - diff --git a/dev-db/pgpool2/files/pgpool_run_paths-9999.patch b/dev-db/pgpool2/files/pgpool_run_paths-9999.patch deleted file mode 100644 index 691d6e867ef5..000000000000 --- a/dev-db/pgpool2/files/pgpool_run_paths-9999.patch +++ /dev/null @@ -1,274 +0,0 @@ -diff --git a/src/include/parser/pg_config_manual.h b/src/include/parser/pg_config_manual.h -index d7e153b2..a4c9e87a 100644 ---- a/src/include/parser/pg_config_manual.h -+++ b/src/include/parser/pg_config_manual.h -@@ -193,7 +193,7 @@ - * here's where to twiddle it. You can also override this at runtime - * with the postmaster's -k switch. - */ --#define DEFAULT_PGSOCKET_DIR "/tmp" -+#define DEFAULT_PGSOCKET_DIR "/run/postgresql" - - /* - * This is the default event source for Windows event log. -diff --git a/src/include/pcp/pcp_stream.h b/src/include/pcp/pcp_stream.h -index 254b98cb..5883ad31 100644 ---- a/src/include/pcp/pcp_stream.h -+++ b/src/include/pcp/pcp_stream.h -@@ -48,6 +48,6 @@ extern int pcp_read(PCP_CONNECTION *pc, void *buf, int len); - extern int pcp_write(PCP_CONNECTION *pc, void *buf, int len); - extern int pcp_flush(PCP_CONNECTION *pc); - --#define UNIX_DOMAIN_PATH "/tmp" -+#define UNIX_DOMAIN_PATH "/run/pgpool" - - #endif /* PCP_STREAM_H */ -diff --git a/src/include/pool.h b/src/include/pool.h -index d5dd63aa..a3ae197f 100644 ---- a/src/include/pool.h -+++ b/src/include/pool.h -@@ -73,16 +73,16 @@ - #define HBA_CONF_FILE_NAME "pool_hba.conf" - - /* pid file directory */ --#define DEFAULT_LOGDIR "/tmp" -+#define DEFAULT_LOGDIR "/run/pgpool" - - /* Unix domain socket directory */ --#define DEFAULT_SOCKET_DIR "/tmp" -+#define DEFAULT_SOCKET_DIR "/run/postgresql" - - /* Unix domain socket directory for watchdog IPC */ --#define DEFAULT_WD_IPC_SOCKET_DIR "/tmp" -+#define DEFAULT_WD_IPC_SOCKET_DIR "/run/pgpool" - - /* pid file name */ --#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid" -+#define DEFAULT_PID_FILE_NAME "/run/pgpool/pgpool.pid" - - /* status file name */ - #define STATUS_FILE_NAME "pgpool_status" -diff --git a/src/sample/pgpool.conf.sample b/src/sample/pgpool.conf.sample -index d73c9bca..e95815ba 100644 ---- a/src/sample/pgpool.conf.sample -+++ b/src/sample/pgpool.conf.sample -@@ -31,10 +31,8 @@ listen_addresses = 'localhost' - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -53,10 +51,8 @@ pcp_listen_addresses = '*' - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Backend Connection Settings - -@@ -210,13 +206,13 @@ syslog_ident = 'pgpool' - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/var/log/pgpool' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -505,10 +501,8 @@ wd_authkey = '' - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - -diff --git a/src/sample/pgpool.conf.sample-master-slave b/src/sample/pgpool.conf.sample-master-slave -index 612c10a7..ad385ba6 100644 ---- a/src/sample/pgpool.conf.sample-master-slave -+++ b/src/sample/pgpool.conf.sample-master-slave -@@ -31,10 +31,8 @@ listen_addresses = 'localhost' - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -53,10 +51,8 @@ pcp_listen_addresses = '*' - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Backend Connection Settings - -@@ -210,13 +206,13 @@ syslog_ident = 'pgpool' - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/tmp' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -504,10 +500,8 @@ wd_authkey = '' - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Virtual IP control Setting - -diff --git a/src/sample/pgpool.conf.sample-replication b/src/sample/pgpool.conf.sample-replication -index f47a7957..bd7ce73e 100644 ---- a/src/sample/pgpool.conf.sample-replication -+++ b/src/sample/pgpool.conf.sample-replication -@@ -31,10 +31,8 @@ listen_addresses = 'localhost' - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -53,10 +51,8 @@ pcp_listen_addresses = '*' - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - # - Backend Connection Settings - -@@ -210,13 +206,13 @@ syslog_ident = 'pgpool' - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/tmp' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -504,10 +500,8 @@ wd_authkey = '' - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - -diff --git a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream -index d57226b0..669a31d4 100644 ---- a/src/sample/pgpool.conf.sample-stream -+++ b/src/sample/pgpool.conf.sample-stream -@@ -31,10 +31,8 @@ listen_addresses = 'localhost' - port = 9999 - # Port number - # (change requires restart) --socket_dir = '/tmp' -+socket_dir = '/run/postgresql' - # Unix domain socket path -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - -@@ -47,10 +45,8 @@ pcp_listen_addresses = '*' - pcp_port = 9898 - # Port number for pcp - # (change requires restart) --pcp_socket_dir = '/tmp' -+pcp_socket_dir = '/run/pgpool' - # Unix domain socket path for pcp -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - listen_backlog_multiplier = 2 - # Set the backlog parameter of listen(2) to -@@ -211,13 +207,13 @@ syslog_ident = 'pgpool' - # FILE LOCATIONS - #------------------------------------------------------------------------------ - --pid_file_name = '/var/run/pgpool/pgpool.pid' -+pid_file_name = '/run/pgpool/pgpool.pid' - # PID file name - # Can be specified as relative to the" - # location of pgpool.conf file or - # as an absolute path - # (change requires restart) --logdir = '/tmp' -+logdir = '/run/pgpool' - # Directory of pgPool status file - # (change requires restart) - -@@ -504,10 +500,8 @@ wd_authkey = '' - # Authentication key for watchdog communication - # (change requires restart) - --wd_ipc_socket_dir = '/tmp' -+wd_ipc_socket_dir = '/run/pgpool' - # Unix domain socket path for watchdog IPC socket -- # The Debian package defaults to -- # /var/run/postgresql - # (change requires restart) - - diff --git a/dev-db/pgpool2/pgpool2-3.7.8.ebuild b/dev-db/pgpool2/pgpool2-3.7.8.ebuild deleted file mode 100644 index 837b6cdad01b..000000000000 --- a/dev-db/pgpool2/pgpool2-3.7.8.ebuild +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -POSTGRES_COMPAT=( 9.{4..6} 10 ) - -inherit autotools postgres-multi - -MY_P="${PN/2/-II}-${PV}" - -DESCRIPTION="Connection pool server for PostgreSQL" -HOMEPAGE="https://www.pgpool.net/" -SRC_URI="https://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz" -LICENSE="BSD" -SLOT="0" - -KEYWORDS="amd64 x86" - -IUSE="doc libressl memcached pam ssl static-libs" - -RDEPEND=" - ${POSTGRES_DEP} - net-libs/libnsl:0= - memcached? ( dev-libs/libmemcached ) - pam? ( sys-auth/pambase ) - ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:= ) - ) -" -DEPEND="${RDEPEND} - !!dev-db/pgpool - sys-devel/bison - virtual/pkgconfig -" - -S=${WORKDIR}/${MY_P} - -pkg_setup() { - postgres_new_user pgpool - - postgres-multi_pkg_setup -} - -src_prepare() { - eapply \ - "${FILESDIR}/pgpool-configure-memcached.patch" \ - "${FILESDIR}/pgpool-configure-pam.patch" \ - "${FILESDIR}/pgpool-configure-pthread.patch" \ - "${FILESDIR}/pgpool_run_paths-3.6.5.patch" - - eautoreconf - - postgres-multi_src_prepare -} - -src_configure() { - postgres-multi_foreach econf \ - --disable-rpath \ - --sysconfdir="${EROOT%/}/etc/${PN}" \ - --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \ - --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \ - $(use_enable static-libs static) \ - $(use_with memcached) \ - $(use_with pam) \ - $(use_with ssl openssl) -} - -src_compile() { - # Even though we're only going to do an install for the best slot - # available, the extension bits in src/sql need some things outside - # of that directory built, too. - postgres-multi_foreach emake - postgres-multi_foreach emake -C src/sql -} - -src_install() { - # We only need the best stuff installed - postgres-multi_forbest emake DESTDIR="${D}" install - - # Except for the extension and .so files that each PostgreSQL slot needs - postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install - - newinitd "${FILESDIR}/${PN}.initd" ${PN} - newconfd "${FILESDIR}/${PN}.confd" ${PN} - - # Documentation! - dodoc NEWS TODO - doman doc/src/sgml/man{1,8}/* - use doc && dodoc -r doc/src/sgml/html - - # Examples and extras - # mv some files that get installed to /usr/share/pgpool-II so that - # they all wind up in the same place - mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die - into "/usr/share/${PN}" - dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start} - insinto "/usr/share/${PN}" - doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam} - - # One more thing: Evil la files! - find "${ED}" -name '*.la' -exec rm -f {} + -} diff --git a/dev-db/pgpool2/pgpool2-4.0.3.ebuild b/dev-db/pgpool2/pgpool2-4.0.3.ebuild deleted file mode 100644 index 7b6bede15504..000000000000 --- a/dev-db/pgpool2/pgpool2-4.0.3.ebuild +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -POSTGRES_COMPAT=( 9.{4..6} {10..11} ) - -inherit autotools postgres-multi - -MY_P="${PN/2/-II}-${PV}" - -DESCRIPTION="Connection pool server for PostgreSQL" -HOMEPAGE="https://www.pgpool.net/" -SRC_URI="https://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz" -LICENSE="BSD" -SLOT="0" - -KEYWORDS="amd64 x86" - -IUSE="doc libressl memcached pam ssl static-libs" - -RDEPEND=" - ${POSTGRES_DEP} - net-libs/libnsl:0= - memcached? ( dev-libs/libmemcached ) - pam? ( sys-auth/pambase ) - ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:= ) - ) -" -DEPEND="${RDEPEND} - !!dev-db/pgpool - sys-devel/bison - virtual/pkgconfig -" - -S=${WORKDIR}/${MY_P} - -pkg_setup() { - postgres_new_user pgpool - - postgres-multi_pkg_setup -} - -src_prepare() { - eapply \ - "${FILESDIR}/pgpool-configure-memcached.patch" \ - "${FILESDIR}/pgpool-configure-pam.patch" \ - "${FILESDIR}/pgpool-configure-pthread.patch" \ - "${FILESDIR}/pgpool_run_paths-3.6.5.patch" - - eautoreconf - - postgres-multi_src_prepare -} - -src_configure() { - postgres-multi_foreach econf \ - --disable-rpath \ - --sysconfdir="${EROOT%/}/etc/${PN}" \ - --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \ - --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \ - $(use_enable static-libs static) \ - $(use_with memcached) \ - $(use_with pam) \ - $(use_with ssl openssl) -} - -src_compile() { - # Even though we're only going to do an install for the best slot - # available, the extension bits in src/sql need some things outside - # of that directory built, too. - postgres-multi_foreach emake - postgres-multi_foreach emake -C src/sql -} - -src_install() { - # We only need the best stuff installed - postgres-multi_forbest emake DESTDIR="${D}" install - - # Except for the extension and .so files that each PostgreSQL slot needs - postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install - - newinitd "${FILESDIR}/${PN}.initd" ${PN} - newconfd "${FILESDIR}/${PN}.confd" ${PN} - - # Documentation! - dodoc NEWS TODO - doman doc/src/sgml/man{1,8}/* - use doc && dodoc -r doc/src/sgml/html - - # Examples and extras - # mv some files that get installed to /usr/share/pgpool-II so that - # they all wind up in the same place - mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die - into "/usr/share/${PN}" - dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start} - insinto "/usr/share/${PN}" - doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam} - - # One more thing: Evil la files! - find "${ED}" -name '*.la' -exec rm -f {} + -} diff --git a/dev-db/pgrouting/Manifest b/dev-db/pgrouting/Manifest index 48a31c564417..3b9a268cc7d7 100644 --- a/dev-db/pgrouting/Manifest +++ b/dev-db/pgrouting/Manifest @@ -1,5 +1,6 @@ DIST pgrouting-2.5.2.tar.gz 7221479 BLAKE2B afbf29b7cbd52df526203198fb76d9e9e37e88a4b92d2139975238a14fe5a30c8102449d157e391913e690129a1ca8ac718763d9242193cac4080bc7347e1553 SHA512 9d9d9ebbcbc003f62bf1f0d548363e756012cdce55a9c3ef56ae9a5a510f25337898becf42f3e04bf10e8d3672ebf698def03833bba33410b65e0d2bdd42aecd DIST pgrouting-2.6.2.tar.gz 6065517 BLAKE2B e27e28cf988040de1e894a857e3d210bc7676271f69d898afc2d6116d5b88d87404723b2cb1283ef77b4449b4aa62a03e2dbcd489ac641a4721a596d29f8fecd SHA512 6e37f66e631d0cc87e135be7d095822aae21656bb56b3d18afa5bececaad8cee6324d37e8e152bbf69e3374ded1f10aa4b9a4c52b873e3a4c43e73cd877fddcb EBUILD pgrouting-2.5.2.ebuild 1388 BLAKE2B 5b87b2a0af8aa23f1ba34980b3bfa5520aed9f6a35d21c05334bc8bdc43c233efeb3c396e7f7179babf7eb8083c84510d6a6b7f389aabe45b399badad54f2134 SHA512 4c9aa0761df88209b8d3b0c5cc8bbede6dba141f502463778102d0ee6b3d1112ae4de2da1202f4656dedbdcf2b47a96317426195abaa623c94ee5bc0bf57f189 +EBUILD pgrouting-2.6.2-r1.ebuild 1226 BLAKE2B b8775e6ff9cf5898f00ef2a7a2b605f0f223e9e9ff5e06cb8066e318626fd4870d4ea7c37edd90251a9f9bafc2e5f6983a584f8197a77573a2e04f1e25c0e6e0 SHA512 81e203b637c329d4817786fff1e79b22da1f07b3f78f29ba9d8fbf2a747b2b490727d263b39908e1c542c033fef8492269139c2b312f812b8393c17f58b4023b EBUILD pgrouting-2.6.2.ebuild 1293 BLAKE2B 78a4d910a7facae8ec70bad522ad1e982e4e951d848104a3186287d155487065139993d9d6093924be70b6bea41fd33370b2b4c05574574b221584a3d3af622b SHA512 827e6629765549d670fd63f31ede456f178456c955734677bb697d4b222772ee717efeea1b049d49bba9b2aa176c8f1e5e2f88734131f414fe160fa499b12b23 MISC metadata.xml 534 BLAKE2B 3bc33ee8118ea199f4261665ffd62fd7cde78928ed64556ed0ea84346da4405b6f5b4765b9a11c02a9f3e719eac3ff9d8392accd11361372437eea26ac0b6e3c SHA512 2892a64cf6e8e34e1ede87ddbcbaabd7e66bc5a45c5a8e21b33103af83e1a6a92c665fbfc02af6ae8fa6aec9df6ba340a40d3332d2da557789c95a312439a55f diff --git a/dev-db/pgrouting/pgrouting-2.6.2-r1.ebuild b/dev-db/pgrouting/pgrouting-2.6.2-r1.ebuild new file mode 100644 index 000000000000..db35bce832a3 --- /dev/null +++ b/dev-db/pgrouting/pgrouting-2.6.2-r1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +POSTGRES_COMPAT=( 9.{4..6} 10 11 ) +POSTGRES_USEDEP="server" + +inherit postgres cmake-utils + +DESCRIPTION="pgRouting extends PostGIS and PostgreSQL with geospatial routing functionality." +HOMEPAGE="http://pgrouting.org/" +LICENSE="GPL-2 MIT Boost-1.0" + +SLOT="0" +KEYWORDS="~amd64 ~x86" +SRC_URI="https://github.com/pgRouting/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +IUSE="pdf html" + +RDEPEND="${POSTGRES_DEP} + >=dev-db/postgis-2.0 + dev-libs/boost + sci-mathematics/cgal +" + +# Sphinx is needed to build the man pages +DEPEND="${RDEPEND} + >=dev-python/sphinx-1.2 + pdf? ( >=dev-python/sphinx-1.2[latex] ) +" + +# Needs a running psql instance, doesn't work out of the box +RESTRICT="test" + +pkg_setup() { + postgres_pkg_setup +} + +src_configure() { + local mycmakeargs=( + -DBUILD_HTML=$(usex html) + -DBUILD_LATEX=$(usex pdf) + -DBUILD_MAN=ON + -DWITH_DOC=ON + ) + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_make all doc +} + +src_install() { + cmake-utils_src_install + + doman "${BUILD_DIR}"/doc/man/en/pgrouting.7 + + use html && dodoc -r "${BUILD_DIR}"/doc/html + use pdf && dodoc "${BUILD_DIR}"/doc/latex/en/*.pdf +} diff --git a/dev-db/postgis/Manifest b/dev-db/postgis/Manifest index e1a7485d0bac..2781f4169ecb 100644 --- a/dev-db/postgis/Manifest +++ b/dev-db/postgis/Manifest @@ -1,11 +1,17 @@ AUX postgis-2.2.0-arflags.patch 535 BLAKE2B 6420573e9623d4e2115ed3616bc3b8648ae7782bf4624ee60d3827a4d61cbdac1dc62b4937f36113ed6d0856af4728f5cc1b544d502512e88dd87a7b590135ab SHA512 7f8b92a582dd11b3040832278b75e65036315ca0e438cb9b19cc5b63a7b5c5bcae8ec274a487a29abadfbbc31cdfacf6c668e46f249d4bf88c09607501cacf66 DIST postgis-2.4.6.tar.gz 12616474 BLAKE2B 8e33ae7e8ca5ef2a4dd90f64a8e9910118e4ef711444b196f46e4a63f98ff6044709d65a853c5c10de91308658a206965503b6a85a16438ea422becdbbd9bb40 SHA512 eec4276a58549f3cc57d6574186aebc72df0dd7dc2ab9acbaf410604b4d271dee6d5154caacd7297d20493d879434ca78050672e8197ff0fc63a36100c20c66c DIST postgis-2.4.7.tar.gz 12831401 BLAKE2B 0069a339cc778a02a008835189b5560ffb1724aceaaeeec5264750cdfaa4346310ca1d112f698556e750b6559f0dabb727584c9d41ff8747ed7673e147c9723e SHA512 832f039e582227cd1c6edef98af8dfcceb90db75b18d4ba605b7baf2842227b23fe2d15c3b1cde941182c93230ba41ab94da59e97506c77e79f2016bbd98c885 +DIST postgis-2.4.8.tar.gz 12846228 BLAKE2B dc7cd26f08774011bddba362040f35fd46dab5f58870643d4e6d939fb107a8e93ccb8c2d57ac67bf5ba44a7dd05c25eee77358548d9d7d9a8b3e2f7538e49538 SHA512 afeddbdcbad68358c3bc36beec5f1baf74c328daba90f0ac7d6322e4330d18da2e5534fa200f8ae3f19e7e897221989a564f6e2855e9181eadfd9cc32315b666 DIST postgis-2.5.1.tar.gz 16041872 BLAKE2B 589cf7168d3698737a19d817b8efb91695c2c3f63d6c3aa24189d9a37459a28ca8a7db0450aa2d557699f76cd8e3ab1eec198bd332b294d976330fdc9d8a7f60 SHA512 c6c9c8c5befd945614e92d1062df1d753ca8b7fd69b70226065c2dac77a59783b14ece4da994187079b683ee090ba5a79389ba679f22fce8c20a5afc2c8dfca0 DIST postgis-2.5.2.tar.gz 16252761 BLAKE2B 181ecc41e659c1df32392d0dfea9cc081c2a647fd23401b8b0470f99e1136b6b8ed900eaea38afdf87cc801bf13ede4247f9c188fcf0da6782624239c77b434f SHA512 b10781f0b74bad8162c33eb111a6090fba184b45fe5874d22cd3a5b0acfb057f3407c073bc44c9d4cd20ed8c2cb1fbb34480b0cf331340bc8b52580d4eccb819 +DIST postgis-2.5.3.tar.gz 16424752 BLAKE2B 94c2ccd41eb88a39c6db48ad7f4d142742a1b0791e3abe57adb2c778406dcc8286afc6d55c80067e0b94a1300eff1c76a227d3cfd813e12541c715edeea11a9b SHA512 1c9f873ba8f8ff4aeae248c68c001eb4174416de1e00ce6a0d0c9ea129b475e887a83235027068d52f587ab95c549adbfaa7e5dccdda77855e39c55dac0fdc2d +DIST postgis-3.0.0alpha4.tar.gz 17488411 BLAKE2B ef819793ee431e54ab69e9434d45fc9c59ecb014dc18ccfb93705bc0ec6dec99ec05cedf687db17a8d65da5b6f2bd8760589ed00d1c51328f84f01461deb0922 SHA512 85eb8380772e7be0520617b23d74ab729be0a2ea6f2cbea4f765f38c9522312366723b6972f75017e7675e32b89692c2c25f7e355a18edf1fbb84d4eaa10e52a EBUILD postgis-2.4.6.ebuild 3062 BLAKE2B 54c4f4682a7803a425a590ade547d178aab1a07722d825a10d25a22b77c7e58f21d6aa7b2756ea5faa96bf8ff309dd40cb80b0145333be1407ac7e8fb826e4a8 SHA512 cd36e3462489fcdf97fc5935d6705906342c6ee178502c06918e230308e245fb22141d49889f692c4e6eee251e21ab8d34b1cb88abc4617fc2cf3476a056aacf EBUILD postgis-2.4.7.ebuild 3062 BLAKE2B 54c4f4682a7803a425a590ade547d178aab1a07722d825a10d25a22b77c7e58f21d6aa7b2756ea5faa96bf8ff309dd40cb80b0145333be1407ac7e8fb826e4a8 SHA512 cd36e3462489fcdf97fc5935d6705906342c6ee178502c06918e230308e245fb22141d49889f692c4e6eee251e21ab8d34b1cb88abc4617fc2cf3476a056aacf +EBUILD postgis-2.4.8.ebuild 3064 BLAKE2B 49d50ffe6855984a43429167b72495d7b4ce7a25e572a17e31d798412879d3cce9606b4c724edefb19bfde200b2ae0e009eed06c744cd45ff6a2509d3a0780b5 SHA512 386d7ca69f4a45277c6b5a9089a922121c55f21ac0fb44eb4ba299001c922920eaa52967af668bb8bd3f39aa67d245eefb4e6759f4e35f46ef9b9b9790a9aa71 EBUILD postgis-2.5.1-r1.ebuild 3044 BLAKE2B ea7dd912c43f34cc13c596cea4f2169475c49d3318d4b5b2456889c52ef503c5300dcfc245220e9eacf8275c4443b6273c25da71f7d77831f888cc8d4f943f41 SHA512 3265db95c4debdf04068eafce9fef15466851b226752d90e6a4ebc8da0edb4f38f101cec4a59e1303700cfcabb0fe9382df25fbb68fe919bd639d61b9d9ba322 EBUILD postgis-2.5.2.ebuild 3044 BLAKE2B ea7dd912c43f34cc13c596cea4f2169475c49d3318d4b5b2456889c52ef503c5300dcfc245220e9eacf8275c4443b6273c25da71f7d77831f888cc8d4f943f41 SHA512 3265db95c4debdf04068eafce9fef15466851b226752d90e6a4ebc8da0edb4f38f101cec4a59e1303700cfcabb0fe9382df25fbb68fe919bd639d61b9d9ba322 +EBUILD postgis-2.5.3.ebuild 3046 BLAKE2B f2664d46785b9bb43bb35a23435649a785893dcbab78161e7afd9f56a8f1daecfe5c4e923f17266e06e560c2bd9113b4cb7858d8322bbc29eb31c33cdb5d809c SHA512 1182ea0a9fdd8430d4d43fc0bcc13825dec8531b6b0be111cdf480c634263b1599cc544630a20cd56073ded452d507fe895b95a5f5987a5df6e8b5bed152015b +EBUILD postgis-3.0.0_alpha4.ebuild 3011 BLAKE2B dc6ad62c0612a554f8795a8da27a4071983bce755a9528f0b6a244a1879e575ec6c9302fa62e95aa4a8dbd223c79ea3b41ed27c79eaac0f502a43f16dc582e28 SHA512 fe2434616586fe768a66b78a20174bb8517e3b82d8baf37ff110078d6bad339c62d8d7302e9d6d555d48b2647769ba4db65bea7565436414d3553febcc5cc10f EBUILD postgis-9999.ebuild 2999 BLAKE2B 258cac486a7405c8c539bb747c1bc50570fc2433cf67b96af7335d04c80cf329cbdd9cfa26b4eb6339bc81a3fa5102459051d6082de719fc116b6379c25c9ba5 SHA512 3789549924568079ae52b48ec5d754dd4eb05d9f7e9104e246a3cb1df3f26b921bb59d82fe97ead03d727415b23e990a65b4e0284fb0a88728bbd650ae4cb767 MISC metadata.xml 779 BLAKE2B 9dfbc86514c5f6e0c859dc41a46890e4f518f23c572786bf340112eadf21b35f5f583a3835f6ba58bef8c99a7ef8483f3a98898d372d1c0e5cc537bb9ecc2b12 SHA512 33ad2ddabf49e97af2cf188f2c0f72e1a936c228b43d8d3637230c43be0df82ec2aa20b63cb5f2385e936c215263fcd009332afe504bc5f30746a387b9b37ada diff --git a/dev-db/postgis/postgis-2.4.8.ebuild b/dev-db/postgis/postgis-2.4.8.ebuild new file mode 100644 index 000000000000..7248b26049ea --- /dev/null +++ b/dev-db/postgis/postgis-2.4.8.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +POSTGRES_COMPAT=( 9.{4..6} {10..11} ) +POSTGRES_USEDEP="server" + +inherit autotools eutils postgres-multi versionator + +MY_PV=$(replace_version_separator 3 '') +MY_P="${PN}-${MY_PV}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Geographic Objects for PostgreSQL" +HOMEPAGE="http://postgis.net" +SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="address-standardizer doc gtk static-libs mapbox test topology" + +RDEPEND=" + ${POSTGRES_DEP} + dev-libs/json-c:= + dev-libs/libxml2:2 + >=sci-libs/geos-3.5.0 + >=sci-libs/proj-4.6.0 + >=sci-libs/gdal-1.10.0 + address-standardizer? ( dev-libs/libpcre ) + gtk? ( x11-libs/gtk+:2 ) + mapbox? ( dev-libs/protobuf ) +" + +DEPEND="${RDEPEND} + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.5 + dev-libs/libxslt + || ( + media-gfx/imagemagick[png] + media-gfx/graphicsmagick[imagemagick,png] + ) + ) + virtual/pkgconfig + test? ( dev-util/cunit ) +" + +PGIS="$(get_version_component_range 1-2)" + +REQUIRED_USE="test? ( doc ) ${POSTGRES_REQ_USE}" + +# Needs a running psql instance, doesn't work out of the box +RESTRICT="test" + +MAKEOPTS+=' -j1' + +# These modules are built using the same *FLAGS that were used to build +# dev-db/postgresql. The right thing to do is to ignore the current +# *FLAGS settings. +QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" + +src_prepare() { + eapply "${FILESDIR}/${PN}-2.2.0-arflags.patch" + + local AT_M4DIR="macros" + eautoreconf + + postgres-multi_src_prepare +} + +src_configure() { + local myargs="" + + use gtk && myargs+=" --with-gui" + + use address-standardizer || myargs+=" --without-address-standardizer" + use mapbox || myargs+=" --without-protobuf" + use topology || myargs+=" --without-topology" + + postgres-multi_foreach econf ${myargs} +} + +src_compile() { + postgres-multi_foreach emake + postgres-multi_foreach emake -C topology + + if use doc ; then + postgres-multi_foreach emake comments + postgres-multi_foreach emake cheatsheets + postgres-multi_forbest emake -C doc html + fi +} + +src_install() { + postgres-multi_foreach emake DESTDIR="${D}" install + postgres-multi_foreach emake -C topology DESTDIR="${D}" install + postgres-multi_forbest dobin ./utils/postgis_restore.pl + + dodoc CREDITS TODO loader/README.* doc/*txt + + docinto topology + dodoc topology/{TODO,README} + + if use doc ; then + postgres-multi_foreach emake DESTDIR="${D}" comments-install + + docinto html + postgres-multi_forbest dodoc doc/html/{postgis.html,style.css} + + docinto html/images + postgres-multi_forbest dodoc doc/html/images/* + fi + + use static-libs || find "${ED}" -name '*.a' -delete +} + +pkg_postinst() { + ebegin "Refreshing PostgreSQL symlinks" + postgresql-config update + eend $? + + elog "To finish installing PostGIS, follow the directions detailed at:" + elog "http://postgis.net/docs/manual-${PGIS}/postgis_installation.html#create_new_db_extensions" +} diff --git a/dev-db/postgis/postgis-2.5.3.ebuild b/dev-db/postgis/postgis-2.5.3.ebuild new file mode 100644 index 000000000000..23608a5b3b00 --- /dev/null +++ b/dev-db/postgis/postgis-2.5.3.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +POSTGRES_COMPAT=( 9.{4..6} {10..12} ) +POSTGRES_USEDEP="server" + +inherit autotools eutils postgres-multi versionator + +MY_PV=$(replace_version_separator 3 '') +MY_P="${PN}-${MY_PV}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Geographic Objects for PostgreSQL" +HOMEPAGE="http://postgis.net" +SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="address-standardizer doc gtk static-libs mapbox test topology" + +RDEPEND=" + ${POSTGRES_DEP} + dev-libs/json-c:= + dev-libs/libxml2:2 + >=sci-libs/geos-3.5.0 + >=sci-libs/proj-4.6.0 + >=sci-libs/gdal-1.10.0 + address-standardizer? ( dev-libs/libpcre ) + gtk? ( x11-libs/gtk+:2 ) + mapbox? ( dev-libs/protobuf ) +" + +DEPEND="${RDEPEND} + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.5 + dev-libs/libxslt + || ( + media-gfx/imagemagick[png] + media-gfx/graphicsmagick[imagemagick,png] + ) + ) + virtual/pkgconfig + test? ( dev-util/cunit ) +" + +PGIS="$(get_version_component_range 1-2)" + +REQUIRED_USE="test? ( doc ) ${POSTGRES_REQ_USE}" + +# Needs a running psql instance, doesn't work out of the box +RESTRICT="test" + +# These modules are built using the same *FLAGS that were used to build +# dev-db/postgresql. The right thing to do is to ignore the current +# *FLAGS settings. +QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" + +src_prepare() { + eapply "${FILESDIR}/${PN}-2.2.0-arflags.patch" + + local AT_M4DIR="macros" + eautoreconf + + postgres-multi_src_prepare +} + +src_configure() { + local myargs="" + + use gtk && myargs+=" --with-gui" + + use address-standardizer || myargs+=" --without-address-standardizer" + use mapbox || myargs+=" --without-protobuf" + use topology || myargs+=" --without-topology" + + postgres-multi_foreach econf ${myargs} +} + +src_compile() { + postgres-multi_foreach emake + postgres-multi_foreach emake -C topology + + if use doc ; then + postgres-multi_foreach emake comments + postgres-multi_foreach emake cheatsheets + postgres-multi_forbest emake -C doc html + fi +} + +src_install() { + postgres-multi_foreach emake DESTDIR="${D}" install + postgres-multi_foreach emake -C topology DESTDIR="${D}" install + postgres-multi_forbest dobin ./utils/postgis_restore.pl + + dodoc CREDITS TODO loader/README.* doc/*txt + + docinto topology + dodoc topology/{TODO,README} + + if use doc ; then + postgres-multi_foreach emake DESTDIR="${D}" comments-install + + docinto html + postgres-multi_forbest dodoc doc/html/{postgis.html,style.css} + + docinto html/images + postgres-multi_forbest dodoc doc/html/images/* + fi + + use static-libs || find "${ED}" -name '*.a' -delete +} + +pkg_postinst() { + ebegin "Refreshing PostgreSQL symlinks" + postgresql-config update + eend $? + + elog "To finish installing PostGIS, follow the directions detailed at:" + elog "http://postgis.net/docs/manual-${PGIS}/postgis_installation.html#create_new_db_extensions" +} diff --git a/dev-db/postgis/postgis-3.0.0_alpha4.ebuild b/dev-db/postgis/postgis-3.0.0_alpha4.ebuild new file mode 100644 index 000000000000..4376ffab4a31 --- /dev/null +++ b/dev-db/postgis/postgis-3.0.0_alpha4.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +POSTGRES_COMPAT=( 9.{5..6} {10..12} ) +POSTGRES_USEDEP="server" + +inherit autotools eutils postgres-multi versionator + +MY_PV=$(replace_version_separator 3 '') +MY_P="${PN}-${MY_PV}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Geographic Objects for PostgreSQL" +HOMEPAGE="http://postgis.net" +SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +IUSE="address-standardizer doc gtk static-libs mapbox test topology" + +RDEPEND=" + ${POSTGRES_DEP} + dev-libs/json-c:= + dev-libs/libxml2:2 + >=sci-libs/geos-3.5.0 + >=sci-libs/proj-4.6.0 + >=sci-libs/gdal-1.10.0 + address-standardizer? ( dev-libs/libpcre ) + gtk? ( x11-libs/gtk+:2 ) + mapbox? ( dev-libs/protobuf ) +" + +DEPEND="${RDEPEND} + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.5 + dev-libs/libxslt + || ( + media-gfx/imagemagick[png] + media-gfx/graphicsmagick[imagemagick,png] + ) + ) + virtual/pkgconfig + test? ( dev-util/cunit ) +" + +PGIS="$(get_version_component_range 1-2)" + +REQUIRED_USE="test? ( doc ) ${POSTGRES_REQ_USE}" + +# Needs a running psql instance, doesn't work out of the box +RESTRICT="test" + +# These modules are built using the same *FLAGS that were used to build +# dev-db/postgresql. The right thing to do is to ignore the current +# *FLAGS settings. +QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" + +src_prepare() { + eapply "${FILESDIR}/${PN}-2.2.0-arflags.patch" + + local AT_M4DIR="macros" + eautoreconf + + postgres-multi_src_prepare +} + +src_configure() { + local myargs="" + + use gtk && myargs+=" --with-gui" + + use address-standardizer || myargs+=" --without-address-standardizer" + use mapbox || myargs+=" --without-protobuf" + use topology || myargs+=" --without-topology" + + postgres-multi_foreach econf ${myargs} +} + +src_compile() { + postgres-multi_foreach emake + postgres-multi_foreach emake -C topology + + if use doc ; then + postgres-multi_foreach emake comments + postgres-multi_foreach emake cheatsheets + postgres-multi_forbest emake -C doc html + fi +} + +src_install() { + postgres-multi_foreach emake DESTDIR="${D}" install + postgres-multi_foreach emake -C topology DESTDIR="${D}" install + postgres-multi_forbest dobin ./utils/postgis_restore.pl + + dodoc CREDITS TODO loader/README.* doc/*txt + + docinto topology + dodoc topology/{TODO,README} + + if use doc ; then + postgres-multi_foreach emake DESTDIR="${D}" comments-install + + docinto html + postgres-multi_forbest dodoc doc/html/{postgis.html,style.css} + + docinto html/images + postgres-multi_forbest dodoc doc/html/images/* + fi + + use static-libs || find "${ED}" -name '*.a' -delete +} + +pkg_postinst() { + ebegin "Refreshing PostgreSQL symlinks" + postgresql-config update + eend $? + + elog "To finish installing PostGIS, follow the directions detailed at:" + elog "http://postgis.net/docs/manual-${PGIS}/postgis_installation.html#create_new_db_extensions" +} diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest index 65b8bbe5e00b..1d837ef714e6 100644 --- a/dev-db/postgresql/Manifest +++ b/dev-db/postgresql/Manifest @@ -9,26 +9,38 @@ AUX postgresql.init-9.3-r1 4999 BLAKE2B f2bc23a51b6d9643bbc14320aaa9c41b7eb1df86 AUX postgresql.service-9.2 1666 BLAKE2B d4b81415539db3d78e0f5908185f903b70966ce3a27feed9bdf80eb6a9065ca6bd4b49e4bb822c41548b7efa9de37656378c395a8bd00a7a3daaa52911a2f674 SHA512 8c64b59f1e80096382a7166e1e8f183a5b9cf14c75138c15a39de74b983bfbed2f41cf9b33b2c72c3b9c79130c10104836a3505c96cb18ac1be1297c0fce1af0 AUX postgresql.service-9.6-r1 1477 BLAKE2B 2a652d5b2892f3a52f484fcc0b4f4dad09cf4b46c3739c3f805072040a26128cb2ad9a25d4a7c9f109a95696d739538d379af6bac53c656f5c41af45b6110de5 SHA512 9e2b04923f6ebec1424c0f276c58a6a0c4933f2de5e2a9776169227729afd06ce5284461be8b6ed70e5aaff2a68b9f96c6893d867d35761c9977f9847ccfe93d AUX postgresql.tmpfiles 39 BLAKE2B 25a5725af53c8e4e4009887e998172dd863ce218a5438351194548c4fc8ea15308dfba3602d5a922cf49b46015198268a4a4528119d8a74dcef4cc4c1767c052 SHA512 498060f2a597cf374f4fb31deaa2d6c5b00edef68efc0e71b82bfc20b717ae12518ba18fcb455a0c518ebba1a0868f38321470616151d02fa79b889a66dcb9f8 +DIST postgresql-10.10.tar.bz2 19012049 BLAKE2B 44ed5cfe2dc57ff3533faa1e921c981e0e437fe19adccc2ad87b939ec0c1bd5772ed8b0d6a7815dfc70c15149725250cb9431d58388fd3331a2bc2623b9959fb SHA512 60cafe4b27a194949aff482dcce4fa096a9916f37205868437a32afb8964df71934b619a0b891fe85eb7c7f9b11775cffbbedca589e78feb6c4184eb224b48bc DIST postgresql-10.9.tar.bz2 18981395 BLAKE2B ef2ac003b393ea7cbf24c45fac6b3dc69df2a8694a9e891d5a68f7310d63fb816649d16a7351d03b63a4eb2256703efcab616a0146324478335267c39f3b9829 SHA512 4e2f30a0fd262f2e3ce5fc836425be635326600cd6cd4e117c57f59ea7ab2e9ea463a8d357fe7adb8c0dd0094e43d08efc2a137f8f9975715a5908e35920f98e DIST postgresql-11.4.tar.bz2 19759635 BLAKE2B a3f35df40d31dce52073eeacf4e16bc7ccb487dc0a6e15b84d087f04fd130b66b1168ece3edc63927c377ca1044b54ccb3db5fb9b4a5c86a5b0e179a6678c73c SHA512 159fb84134e05ddc58e40a879ca52ed4d58ced7bcd1e7310d59bda84f9055339a31a92cfaab2c063a88685f7417b9a828534394bf9a2477fc33d1fb6cd26186b +DIST postgresql-11.5.tar.bz2 19773087 BLAKE2B 32dca67ddfe2f6a6801a5d82a25fe7df0cc2dd89c35eee87a57ebe6391b8d7d4bccc59d6cac3e821ad76731ab319e3303f2fcbce9ee8cda1cfef13b2185c0ab1 SHA512 537148079dc6c33cfb9bf9722171e524707b42ef01369deb968d0d6e8fa9b7f16f6ce67139d9dc45fb7385defbf56aa2c0affe5ee9d76e996f31e47486192141 DIST postgresql-12beta2.tar.bz2 20605047 BLAKE2B 133c453b180c800bf7e8dc15d26453db6e2b86011a1dd175157d46e5dec26199e42ac37f494b9a154352d144c93c4e8dc8410469d52ca31c1bdfef69a25190e2 SHA512 64b3ffd7e61ece5572ca72b3168618150214f89d21b113c6f630687372f6f7212bdfa086fa5b22e466a529a0e929c76d34e5b3ed5c04c94299589822fbff4935 +DIST postgresql-12beta3.tar.bz2 20698785 BLAKE2B 438ed0345730bd94478f73d4f1481b0a184aab8fd04c7097e41913d0648587e728e219f88f6ed37409acd41b3cef9a92b0c3c5de421cf845f643bd7c5f8288bc SHA512 c437fa0292ec770b0ad4f8c99ab9d0824a33aa1e4e609904b22cbfe0412ea7e54671fd08657d191932231a637d2356e76eaa2f690c6a9e3cf2e68006df04b299 DIST postgresql-9.4.22.tar.bz2 16848787 BLAKE2B 5c2aaef13ef0cf33c421e6839877a8e4e1fc5dbe41d9cabefddd369925869f92f6c6b8a124b5778f9b25359103f0a7ada1eddcaf4bac498709f563928f25e7e3 SHA512 f11623a89b2320616fd53eda52da544bdfcb63bff08cb78fccde134ef628eee7ee90b3de6952f4e08c10297d356624faabf0e5b181b0105f51797796cd04efef DIST postgresql-9.4.23.tar.bz2 16848808 BLAKE2B fd747fb3f6f540190ecbd53116ef7b8b812d05f5968e32c9d09c5902239eaf073281262dba9836514344303a3c894f48c617e050ce713be7c09f53ee49c7b3cd SHA512 b1eb392b939ac8369c76e4ecc142c78f380afc498b60ec0ea97acb16c21ffa5c11a24c2c46463032865955b7c531492c08feb6ef1efc46a549369f026594ea61 +DIST postgresql-9.4.24.tar.bz2 16842941 BLAKE2B 999a33addd493d1169ba3222a269fea827f4ed866453727bf9545d6a8873943d56b8e71773daf0f116150dc557afaf2e80dc570e8f351ba64b196ae8bcd8fbc9 SHA512 8e7b4da8a5cf48cf4d98cce117614f7ab594087d0002f996c1fedc2a38af6eaa663ad3ce67ced6d6b0fd6d0b00aee932025bf50a4314933ba535716577e9393f DIST postgresql-9.5.17.tar.bz2 17563469 BLAKE2B d40b7f95d03db594144b4882f36bbe22f348faab0b8d67eda3f946448bb0e09188eccdeb4d1c92742fb29a920b30ede55e536a863b22d2009283eab66679122d SHA512 bb468528b1f18166cda0be136f31a632859ffe6e6800233b1cb0e91ce11d2d00d3dc108a74580b5552a4d30b9f1b6849c91576cd497beac788c429815c66eac5 DIST postgresql-9.5.18.tar.bz2 17570161 BLAKE2B aee7e4570f2571e507fd972e86d3a6a9243d8fd33c356305998a8dce461bc9b06b45e1ff4267a9eb47f58a793c0b70bce0babfc0dce939cb34b1436a55a5d9fd SHA512 0487ac2891c800de045135d4b153659ec10c28750a09e0b87343f8e7145a11f1783ed0b6ca60829776faae1430c8050cc7661c780f171f1b2621f1673a32e6d1 +DIST postgresql-9.5.19.tar.bz2 17571998 BLAKE2B 24bd617ecef4d0add443d20ea3528eb8d48d83f31a3eaf726213c98211418efd2f35d846964049284332c9d20228308c7441cb3e8ee35f0188d060fc75239788 SHA512 46de40e49910311bf5291e1ece421ab9628641b18bf84cd1cb8093a584dd0358e3b6d2b086f82e9b06ce699a6e38018c3515ea591355078392e8d3d2fe4a7c64 DIST postgresql-9.6.13.tar.bz2 18767279 BLAKE2B c1ec780a7f938f878425cbd6556145e60a613135129daaacc52e9a699cc448a22481b01fac20d0c09373ea6a026f39bc58234aae4f1126333b94f621981a8135 SHA512 65cc70410ad4a1a738b92855b92eecdbb9efbbca0eb9a45a138d47b696c8f9c9cd19073fbfdf5c80eea7633d0be29b4ed8acbadd38724acf8f18c90bb30f9b26 DIST postgresql-9.6.14.tar.bz2 18787744 BLAKE2B be5a0d90fe1cd5ea682d8446e512271175f705bc49514215535d7aa4b631669846c0bd6167f985028c07dc5d6d394a1ea809028c5a5e15a5f010e85c2bede8cf SHA512 dccc183a6992ef4ece4ef5c638339708ab484e571ecd66ed993c9071cd55f250b4277fd3367f9a5ee545aa83e29dc5f7a239200e200e3314d5acc847f35e790c +DIST postgresql-9.6.15.tar.bz2 18799121 BLAKE2B 5dee0fac7592cecf4412deaef54cedbd86eb6081fc268b6ef8a5f01c31af930747749fb54a77d766e1d6ef705bab5d550a7bace25c86d201f25ed69163d920fc SHA512 cc35a059bf59ea3487c17a8432b791ca2a19afaa24b07403a8d33904b3a97ebe601e3036ca8ec766c54cb87a7def7d4618a425a4446e6832391185d7c71117db +EBUILD postgresql-10.10.ebuild 13936 BLAKE2B f5e02688e7d569e8905f3501b8d2d6842130dbea5becad4e6cd073b7785f20c8ac26b0fc91ef3ceac5d480c4774ed1002124d0e44a881e994b6f494181330c3e SHA512 39ef59111f296500dac0f5ce88cdf8e51d446e11256ab6a6be01657935b7285159447e368a32fb05c60c6d67ac65674da1ceeb432ad645b0a3d8406b3d34d309 EBUILD postgresql-10.9.ebuild 13928 BLAKE2B e9df06af21c478279778b92d268ae532dc8b4c477027eeac9a67c6047b2c823291bd4c32749ac651ce6f5f6f044fc47411fa6d0a40fe4b137237035db0d87f86 SHA512 0148c7289460c0a6e88bc9e64df5a44baba55fb8e3795ddfd3d9d2e0299a963e6bbdd42a9813636e783b84be33e40ae409d945ef360a638b775e9ab806577c4b EBUILD postgresql-11.4.ebuild 14054 BLAKE2B 2e346a9b6996c82e4e0b091a7f466fb25d9b4f2fb6612056767c2104dec8a085f2f59a26f913f9d4d9e67717e79e572c5f6f883f4b7f2a8af7d6aa7250212ad3 SHA512 081a24ff08b3f48a7f494385acfe5a24f6fa3eaee4c13054c9d64912787d65d06b138003dddb70debb9c436de99961993a0999695ddc5d101730fb0c6d4f2fa0 +EBUILD postgresql-11.5.ebuild 14063 BLAKE2B a69f06a1568db9dab996ced9b678c73f45d93225ccda020748e1cd982369cf65b9df5a112a0e15cdbce03fdbc4e5e72b1f76c86f0112259eef79c8a57fea1201 SHA512 2e1cb50782816e9aa9acf4ee2fbc9e4e9b1ebbd56b1cb66301ab27766be200ab76d185c1e074108cf96465dd346ede4559a0b0606c68d5d2fcaa96addc921352 EBUILD postgresql-12_beta2.ebuild 14038 BLAKE2B 564a933fcbb4923566e2e448d7fc20c39f5e594ccea41402fb7b8c918a60b4a55ac9594beb6863d2e7eee8140f51d8fe912fd8fffec7e2e8d7db4d84df82f5e2 SHA512 900b22509b7fe4042f862e35f18da355ac48d702d8183418bf96f45c6050dcea12a1f5fe270800eb51ce666c5d7999b6f7d45b7c8942f91293645ff5a2ece147 +EBUILD postgresql-12_beta3.ebuild 14038 BLAKE2B 51e7197cc718e5bd5e41399a4900eea5fc78b1cb72e7af8aee0b16f574dd482de430c357cce0b5c1cdf81b3eb082707de4e2200c2c7be8b8a8b842199ce2de9f SHA512 80e15aa3ed10c4529f789ab84792e5b9df7597757f4a4b29fe029b5414df230358c314daa435535dcf18295db1ecf03b663eb008f62fd4f3c97fa7e3539c69a9 EBUILD postgresql-9.4.22-r1.ebuild 14532 BLAKE2B 93742f760ff30542947bb3d9ad51108b545152dce34a4082a0c90c57a0d18612c98b07ffae9ba40ec46741eeb561f7ff80ba344dc2fb9e1fb373c496f5e0e74e SHA512 94c63fba357b837d877d60bc0b6fba33af18de0fda8bda7a39ecfe47490ef4e4d93c4111c3e647b978e3af7dcb53974144f38ce8ce1ad5da88c00aa67fd8e912 EBUILD postgresql-9.4.22.ebuild 14368 BLAKE2B 2c6b46d98d0cb9f9b4e2063d86b7b1b353c3edffc5386c3f1225dde7430633e539714d98b8ec179b13a612dbbd2cb8a32b2aa321a4cf60e74e64c6b793a1a711 SHA512 6de69907fce6835510de53a961d54cc2dc7e0464d48115c29195d3384ba7447ba472d6b89946545c02b4f42cc2e778f4dbdee75728d212ffc651f75076f59ceb EBUILD postgresql-9.4.23.ebuild 14523 BLAKE2B de5ed60cc93035f587f94ab1e7ae7b28be094019b5a38760a5584f72d31c15d34c939bac1c0d7cdfc2e5ba054dc869ecf6a1f3130df333655e422d9413cb3594 SHA512 499a9fa0b07bc31ed8e8db0f42e00ca8af6ffcf3ec437b2e518eeac8fe1f74f343db084032b7ce2802c3bf1f4db1aec1eb6b9d92f9183d15610c97ed48521350 +EBUILD postgresql-9.4.24.ebuild 14532 BLAKE2B 93742f760ff30542947bb3d9ad51108b545152dce34a4082a0c90c57a0d18612c98b07ffae9ba40ec46741eeb561f7ff80ba344dc2fb9e1fb373c496f5e0e74e SHA512 94c63fba357b837d877d60bc0b6fba33af18de0fda8bda7a39ecfe47490ef4e4d93c4111c3e647b978e3af7dcb53974144f38ce8ce1ad5da88c00aa67fd8e912 EBUILD postgresql-9.5.17-r1.ebuild 14760 BLAKE2B 14562ac30db311132b4317c548d92c3d0006a19174e9b33a9a01099ddbb0e6d6389478fe021828c0a733141e1442098a848a11180ec3a3a2bc17baa032e24db6 SHA512 b14450932342e323cfcca615a165f4a4c83cd34b047edc70ca201d9460fee0c6603f0980fcdf736a0db86bdf5c75f0cfc39ef9c8956edb69e3671c399b8556e1 EBUILD postgresql-9.5.17.ebuild 14596 BLAKE2B f12b4c612d4360b93f363fdd0a7eda9285db0122a7e663bd7bec8222289e2a2da0bfdaaff9ed2398a154976cf1f13cd9e2e717b23accc7e528f76565942a5976 SHA512 9e9a7aa496a65e036d1fd4528cbfb06f5014059dd96b581ebee38f3a3e65faefad222cb5f2e54dc95b640a89f362275ce0f3d942a092ceeef50973f2937686fa EBUILD postgresql-9.5.18.ebuild 14751 BLAKE2B fd1d57d82a4d4d76ab34b5c7d36f5592a8b5d3c43fe2de8eca65e975be5829b023b7f91772fe4480f54af8ac4f3df173820bdc822e917e170755abb5c7a374f0 SHA512 86302a8ce3d00466d206154b5cc2e43d828c3e36dac2574eaa4f71e645dd55eddb299cd25b31a1f602caf3219b5d3a66f7ec713ae2e78d5a5cca386864757580 +EBUILD postgresql-9.5.19.ebuild 14760 BLAKE2B 14562ac30db311132b4317c548d92c3d0006a19174e9b33a9a01099ddbb0e6d6389478fe021828c0a733141e1442098a848a11180ec3a3a2bc17baa032e24db6 SHA512 b14450932342e323cfcca615a165f4a4c83cd34b047edc70ca201d9460fee0c6603f0980fcdf736a0db86bdf5c75f0cfc39ef9c8956edb69e3671c399b8556e1 EBUILD postgresql-9.6.13-r1.ebuild 14993 BLAKE2B e62949c713914f8fd68fab5e70c66695c092c8c28b9d6c51a9e853c294281a017c15541e4fe1c879a2bd4997b7ae4a2cdc233fa55ab735ae27049bca3ead1113 SHA512 f3d6093665243f2c95f89bc20d84275c16d194eb7d5108fce5d4f8ba72b4224bf5ef43d6157db4489198bda6c3b9c401e51768877618521f1029c13ecbe0d24f EBUILD postgresql-9.6.13.ebuild 14829 BLAKE2B fffb2f1e956b93a561d289f657cf678f4e414e21787c73d1ebddf7182aba7b8374307e878841edb25de82feb866f88d79b89ed115bb4d916b8ed929c1a30b5d1 SHA512 c8c70732f1390285906e45cbce8afa3e3435814210c53e092bc0c2fa9f0ebe8d86b3f782e6eaed989a4c2a9a766a158232623e203e2d4917cfa95a05ab88d213 EBUILD postgresql-9.6.14.ebuild 14984 BLAKE2B 08316d3f38924aea07f8dee69a823eb82277c0e15332c243de2218419155bde7103c062d644d38f08615b9035c244aabccd9b7df719c11bcc48bd64270047c34 SHA512 2f6e0e0aeb148e8e3e6fccf7f913ad902ff27aaac97cec43024b5e6fd8799ae77832d7aa7d312a08baaef1621f1ab4aaa29ac3fb2e4af8ef74c063112a72eba6 +EBUILD postgresql-9.6.15.ebuild 14993 BLAKE2B e62949c713914f8fd68fab5e70c66695c092c8c28b9d6c51a9e853c294281a017c15541e4fe1c879a2bd4997b7ae4a2cdc233fa55ab735ae27049bca3ead1113 SHA512 f3d6093665243f2c95f89bc20d84275c16d194eb7d5108fce5d4f8ba72b4224bf5ef43d6157db4489198bda6c3b9c401e51768877618521f1029c13ecbe0d24f EBUILD postgresql-9999.ebuild 14485 BLAKE2B 386379214652708fc23727970999371b77804bd9a0a13dcbdcd94e6f8a0d5b30b3657063884177a0f903f88845f2fd202bf6b05e1fb51fd82c6aa5bdc3d290e2 SHA512 4173d20a00da315d9bb15a32474f202edfb0580494fd37501e8a9c5f61ae334421ad092da408783690557621ca95455baa7d5e22436973c723c5de6f9d79e286 MISC metadata.xml 715 BLAKE2B 59ad51ae06a697fe649054d9fe13040423f425b95abdcf3797e1d0d5abba8c62d54cc8c1afb0be0d0a29d1a39d379912bd931925b5df480fb0bb9b238c36e598 SHA512 03027757eaf95313a6825710b1054a9671aa8396381789397006dfe2f66cd41e85cde418e792bf7d71d7db2413905816ff39685774219c1ea5e8b8d35c5cffd0 diff --git a/dev-db/postgresql/postgresql-10.10.ebuild b/dev-db/postgresql/postgresql-10.10.ebuild new file mode 100644 index 000000000000..88115ec2c2a7 --- /dev/null +++ b/dev-db/postgresql/postgresql-10.10.ebuild @@ -0,0 +1,466 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) + +PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN + zh_TW" + +inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ + systemd user + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc icu kerberos kernel_linux ldap libressl nls pam perl + python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( + !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) + libressl? ( dev-libs/libressl:= ) +) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +!! /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-11.5.ebuild b/dev-db/postgresql/postgresql-11.5.ebuild new file mode 100644 index 000000000000..b55fe07666c3 --- /dev/null +++ b/dev-db/postgresql/postgresql-11.5.ebuild @@ -0,0 +1,468 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) + +PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN + zh_TW" + +inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ + systemd user + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="http://www.postgresql.org/" + +IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam + perl python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +llvm? ( + sys-devel/llvm:= + sys-devel/clang:= +) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( + !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) + libressl? ( dev-libs/libressl:= ) +) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +!! /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" + mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" + chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-12_beta3.ebuild b/dev-db/postgresql/postgresql-12_beta3.ebuild new file mode 100644 index 000000000000..56f37570a009 --- /dev/null +++ b/dev-db/postgresql/postgresql-12_beta3.ebuild @@ -0,0 +1,467 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) + +PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN + zh_TW" + +inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ + systemd user + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" +SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="http://www.postgresql.org/" + +IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam + perl python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +llvm? ( + sys-devel/llvm:= + sys-devel/clang:= +) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( + !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) + libressl? ( dev-libs/libressl:= ) +) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +!! /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" + mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" + chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-9.4.24.ebuild b/dev-db/postgresql/postgresql-9.4.24.ebuild new file mode 100644 index 000000000000..b08e6262967a --- /dev/null +++ b/dev-db/postgresql/postgresql-9.4.24.ebuild @@ -0,0 +1,480 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) + +PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN + zh_TW" + +inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ + systemd user + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT=$(ver_cut 1-2) + +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl + -pg_legacytimestamp python +readline selinux +server systemd ssl + static-libs tcl threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( + !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) + libressl? ( dev-libs/libressl:= ) +) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +!! /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + # Temporarily tack on tmp to workaround a file collision + # issue. This is only necessary for 9.7 and earlier. 10 never + # had this issue. + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}tmp" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.2" | \ + systemd_newunit - ${PN}-${SLOT}.service + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_preinst() { + # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., + # /usr/bin/psql96). They may have been created by the + # postgresql.eselect module, but they're handled within this ebuild + # now. It's alright if we momentarily delete /usr/bin/psql as it + # will be recreated by the eselect module in pkg_ppostinst(). This + # is only necessary for 9.7 and earlier. 10 and later were never + # handled in this manner. + local canonicalise + if type -p realpath > /dev/null; then + canonicalise=realpath + elif type -p readlink > /dev/null; then + canonicalise='readlink -f' + else + # can't die, subshell + die "No readlink nor realpath found, cannot canonicalise" + fi + + local l + # First remove any symlinks in /usr/bin that may have been created + # by the old eselect + for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do + if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then + rm "${l}" || ewarn "Couldn't remove ${l}" + fi + done + + # Then move the symlinks created by the ebuild to their proper place. + for l in "${ED}"/usr/bin/*tmp ; do + mv "${l}" "${l%tmp}" \ + || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" + done +} + +pkg_postinst() { + use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-9.5.19.ebuild b/dev-db/postgresql/postgresql-9.5.19.ebuild new file mode 100644 index 000000000000..14d84350ff6b --- /dev/null +++ b/dev-db/postgresql/postgresql-9.5.19.ebuild @@ -0,0 +1,486 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) + +PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN + zh_TW" + +inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ + systemd user + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT=$(ver_cut 1-2) + +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl + -pg_legacytimestamp python +readline selinux +server systemd ssl + static-libs tcl threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( + !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) + libressl? ( dev-libs/libressl:= ) +) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +!! /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + # Temporarily tack on tmp to workaround a file collision + # issue. This is only necessary for 9.7 and earlier. 10 never + # had this issue. + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}tmp" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.2" | \ + systemd_newunit - ${PN}-${SLOT}.service + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_preinst() { + # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., + # /usr/bin/psql96). They may have been created by the + # postgresql.eselect module, but they're handled within this ebuild + # now. It's alright if we momentarily delete /usr/bin/psql as it + # will be recreated by the eselect module in pkg_ppostinst(). This + # is only necessary for 9.7 and earlier. 10 and later were never + # handled in this manner. + local canonicalise + if type -p realpath > /dev/null; then + canonicalise=realpath + elif type -p readlink > /dev/null; then + canonicalise='readlink -f' + else + # can't die, subshell + die "No readlink nor realpath found, cannot canonicalise" + fi + + local l + # First remove any symlinks in /usr/bin that may have been created + # by the old eselect + for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do + if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then + rm "${l}" || ewarn "Couldn't remove ${l}" + fi + done + + # Then move the symlinks created by the ebuild to their proper place. + for l in "${ED}"/usr/bin/*tmp ; do + mv "${l}" "${l%tmp}" \ + || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" + done +} + +pkg_postinst() { + use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf + postgresql-config update + + if use alpha && use server ; then + ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." + ewarn "As a result, performance will be extremely degraded." + fi + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-9.6.15.ebuild b/dev-db/postgresql/postgresql-9.6.15.ebuild new file mode 100644 index 000000000000..a6c2ed402e20 --- /dev/null +++ b/dev-db/postgresql/postgresql-9.6.15.ebuild @@ -0,0 +1,491 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) + +PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN + zh_TW" + +inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ + systemd user + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1-2) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl + -pg_legacytimestamp python +readline selinux +server systemd ssl + static-libs tcl threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( + !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) + libressl? ( dev-libs/libressl:= ) +) +server? ( systemd? ( sys-apps/systemd ) ) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +!! /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + # Temporarily tack on tmp to workaround a file collision + # issue. This is only necessary for 9.7 and earlier. 10 never + # had this issue. + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}tmp" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_preinst() { + # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., + # /usr/bin/psql96). They may have been created by the + # postgresql.eselect module, but they're handled within this ebuild + # now. It's alright if we momentarily delete /usr/bin/psql as it + # will be recreated by the eselect module in pkg_ppostinst(). This + # is only necessary for 9.7 and earlier. 10 and later were never + # handled in this manner. + local canonicalise + if type -p realpath > /dev/null; then + canonicalise=realpath + elif type -p readlink > /dev/null; then + canonicalise='readlink -f' + else + # can't die, subshell + die "No readlink nor realpath found, cannot canonicalise" + fi + + local l + # First remove any symlinks in /usr/bin that may have been created + # by the old eselect + for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do + if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then + rm "${l}" || ewarn "Couldn't remove ${l}" + fi + done + + # Then move the symlinks created by the ebuild to their proper place. + for l in "${ED}"/usr/bin/*tmp ; do + mv "${l}" "${l%tmp}" \ + || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" + done +} + +pkg_postinst() { + use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/pspg/Manifest b/dev-db/pspg/Manifest index 68039c9368c9..7db59a9f378d 100644 --- a/dev-db/pspg/Manifest +++ b/dev-db/pspg/Manifest @@ -1,5 +1,5 @@ -DIST pspg-1.3.0.tar.gz 885210 BLAKE2B 4a6f41b915603a96eef8cd5de9a76322bf0cfec94afe5c54707ab290e657159d7e8f6d29f5c4c1de07770047e45d3566d3a4f09c53d80461a50be48afade289b SHA512 6c6e4b12008ca36ea4ecf6c60d474f897622427590d8326db73f7d5a6d2134c479db17b0765cd8861ccf422e5fab292e10fc7f7e7a548c5d3773c64c5e11d1dd DIST pspg-1.6.5.tar.gz 1005525 BLAKE2B 2befb8a7081e1fcf5df60eca48f34b819d9de3d07920613b7f759887b4ddcccbc52e46ea8f407666a50a53bbfda582a10b1b2ca65d0c4452bc46db8cd971a802 SHA512 755e40dd6c68a01ad235e6fc2751af76c8ed63c2832bfa26356fa80e62bd59a076413cf7fc075685f9267bc7339fadf4975a695d681fc7821b7da0589805c1f0 -EBUILD pspg-1.3.0.ebuild 387 BLAKE2B b2f49b9e1bc7a032b064e2d65cb832c1177a51fabfaaf2b466d024346635bb9af319f0c656328d0084519ba12697f4a385627194f34330cdcc28b7644298acd2 SHA512 27636211a65612ed5424d4984e737e751677048f41c91cfab69f5de351f875622a8edc68c26e69ad9a2cf13b0e294dff07742c037f57262f1149966ca53717b8 +DIST pspg-1.6.8.tar.gz 1017316 BLAKE2B 0150b4577365000b2fdd9de93307acbb5133915917c92affd1a598b3f16769ff0afa6e0b9c0d4639b771dcd62f1f7364a028a3b9d96cc6c40e3ac41c550a8d48 SHA512 337ae1eb9e92dc97ca32127322aaa3d0c5edb8766e5cab16e778148b3256119c7c5b1b2e4b6ab0b520113ede07c464d1c1c5e460c8efb7714f5a29acfa845e9d EBUILD pspg-1.6.5.ebuild 376 BLAKE2B 13fe8b4b7bbab57ea001be0d3473a62e40ed31cc6c0b3f37e8e924aefb71b50b445bd4ddc351ed85d9aff00454dc4858ce3cc452042edd925981c2d2a1fb3f8a SHA512 dbc7ea9e5187802bb5b810cdaaf35d544cd910a52f196b1e96d6ba3d63ea93eaa651b67a9457894aae5f2f3eb8f22470b6cf635859c464dd3f87d164c77102ff +EBUILD pspg-1.6.8.ebuild 378 BLAKE2B 9bd9920de54fd7e3122025d78659d21c13335a0b9d65abfabd948776f3c074ed8bafae6679754cf6ce8b72fc0d7cb93d2d7689bdc2f666b1f23cb17bbd6595a9 SHA512 11791d983aff85e9a535c81f432270d7a4ba26bb8d4fc36dbff90dcb96573d7afd31e21ec37017cc0f0721fbc57be685c542c715cb6f1427ba62c5c74e70d819 MISC metadata.xml 298 BLAKE2B 40abb765b052aa2cbbf749c54c686f1c98968cb1af2e93c149bfbfe6244d3c17e827189d7a1da90a566016758bfbed63b16ad0a0328725349748d1b18b2437b1 SHA512 167896d1d92ccb4b171cce16d63405369a9e28b0d01c12b2ed94fcec1f982892e179c007287fc3386e1c00393d6570a2ae9e8efe9420e53a82308426075d5c89 diff --git a/dev-db/pspg/pspg-1.3.0.ebuild b/dev-db/pspg/pspg-1.3.0.ebuild deleted file mode 100644 index d9846d4a7335..000000000000 --- a/dev-db/pspg/pspg-1.3.0.ebuild +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -DESCRIPTION="A better pager for psql and mysql" -HOMEPAGE="https://github.com/okbob/${PN}" -SRC_URI="https://github.com/okbob/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="BSD-2" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="" - -DEPEND="sys-libs/ncurses:*" -RDEPEND="${DEPEND}" diff --git a/dev-db/pspg/pspg-1.6.8.ebuild b/dev-db/pspg/pspg-1.6.8.ebuild new file mode 100644 index 000000000000..a537b5d8c3a9 --- /dev/null +++ b/dev-db/pspg/pspg-1.6.8.ebuild @@ -0,0 +1,15 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="A better pager for psql and mysql" +HOMEPAGE="https://github.com/okbob/${PN}" +SRC_URI="https://github.com/okbob/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND="sys-libs/ncurses:*" +RDEPEND="${DEPEND}" diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest index 1d2dd5eab647..f1534a2ee87c 100644 --- a/dev-db/sqlite/Manifest +++ b/dev-db/sqlite/Manifest @@ -1,16 +1,16 @@ AUX sqlite-3.25.0-nonfull_archive-build.patch 416 BLAKE2B 37faa30235c1b668d3cf510c353730a932a807f650c638ac0d07d3a1c0534dedef233c06cef52b6569eb1d58b5bcd910dd59c8d2e792726945f49f882d4181be SHA512 44db89a32b51713cf59fb3f071cca08648deebf6e2830dd61b033a5160ce6ddcbf54a191be42b3b252ea4bc16614fbcfa569207f34f268f1da5acd5fadcda668 -AUX sqlite-3.27.0-full_archive-build.patch 15538 BLAKE2B ee4705bd5ef166437deaaee97b406e0e8775ebea0bcb086c88a07e91451a6cc677e95c47f681c55e7e477a4b84ed5f1520935729bf394146a6c177d5af9caaf8 SHA512 91daf2092608732ab5ad31f8b06b64e67988af846b47d9c9430bc15853e9be12f32d6a10b614f3ce7c009649c0baf710c2c4e03e18b3ae847ea0be8c235129dd -AUX sqlite-3.27.2-full_archive-tests.patch 964 BLAKE2B 1206311d20be560fb6b6868099c74bea91c210515afa6d727035041231edac67422f61a158411446e7dc7430b221b9a8f581a1f82cf9bc1af63260a6bfe5ab67 SHA512 126863bbe32aa3ffec21651afdf1cd8057fdd441bb176bca481afa73afceb36992067274bea464dd047bf2df542111170ec29a9bfe6104e197969057eb049c6e AUX sqlite-3.28.0-full_archive-build.patch 15538 BLAKE2B 35b95c237a06c14cb315df044154a2533954b745e045d3038af48803853df46b5d3b075cd702ae5be72ccd291608f4382d254e1e792029f16aa47541009645fc SHA512 f8faa1d582391a6162fb032f2078adcd410736512991acd38ea5b1a735c825109d8608ce753cf2bd6a670871852cec92fc03147050265154c57b1d81bf9427a3 AUX sqlite-3.28.0-full_archive-segmentation_fault_fixes.patch 56920 BLAKE2B f4edd8a213e6aaa2cb87500c1b16b082850f2ddcfd4ab08f559a8c1430f306f954ad1c6b8697fa9c4cdb8c0bbdb760564404816b8544bba16c65f5ae82c6d3c8 SHA512 6fefcf5a4e391db69a0eedbb50a9266d8224743f2fe1a9efa8c7c2e2d5fbe40fa406400b7e71907cc3c961ec58339382e61ec86587494339251727de2e33b3a8 AUX sqlite-3.28.0-full_archive-tests.patch 493 BLAKE2B 53baa103b0abefe0d24431f4372d14bf58f0b69943b41b94c5b506577930deadcd9494c35e5aba1e9e7709d6dbbebad700041655bba2fb84b1208e320db2a5d6 SHA512 2b70fbfd448b287f88e5b2792df3ce9bf728eefd92e06f93f2d33f2392eca0f81bc689e27bead65653d732b025e583f7496044c39e155a8704eb09163253ec46 AUX sqlite-3.28.0-nonfull_archive-segmentation_fault_fixes.patch 3975 BLAKE2B dbdcbec6584c64d662fe0a9a808695e62623844ff08da3e3d38d4027669f84ebb7b757b6e9772d90e12a474dd04b5bdc51efc5d0287a1551f7ba1c37ad7d728b SHA512 0a0c9f748f4bd0e07e743641b58d4068d8f88f9346edf9802cd79ddba47f9dcaf19843677321df78d2912c03e591ee5a72d87391b36f4006f93e00d433f04a78 -DIST sqlite-autoconf-3270200.tar.gz 2797531 BLAKE2B e4d0de32308e519e4f5f68dc0ff1e2098209325ab962a09814aa6af517cb408d1ac70f32fff56cca4ad78bec7d6dedb5b21f222ae391e0fe7e20df5abd37f65a SHA512 0ac2515c7816932a4f725e657122c9f202bd7aba637bad9af5b4592b85efdd10a55ad34ac621b60a7aea91b1021c2ef0924c6ddfe05b2edb4f70e3d34b005972 +AUX sqlite-3.29.0-full_archive-build.patch 15915 BLAKE2B ccc439a441bede4d6b380cae77b97929d342a54f0fc3ee4ac000ca52b1d8d3d63a86e0d9c89dbf3f3a9235ed03ad51c29cbde27a6929e4fe25fb2304977affb9 SHA512 a551bd1c54a7fe7e1581c2682cc0a76f16a00d8513386d85d939ffd1494f29ee266fbe3bc97db74f72435616f30855d14b76dfd4e205c61c5c91c7af3eb97851 +AUX sqlite-3.29.0-full_archive-tests.patch 4122 BLAKE2B e41f62e1efa354c8b5dda6f79328384f0c19f40830e71268e2a3741961248db5c3ca6159deca9bd47983d8ca47ce0caf2fcc8b406cf2f1bc1ff21910fa51d9d6 SHA512 f8cf5f8fc6a53459187cec92823f0982d0d48d9f0b0ab75bcaf713f5486a40193578d187cbc7272371e868b95990a48c794efe300b18a63b9ae273cfcc2f8757 DIST sqlite-autoconf-3280000.tar.gz 2810415 BLAKE2B e1af03476d97f96ef78d4e0a9df6ae69a06fb08e48046c843ed668b3f8c00c58263df07a4e8a22a1c7cfc920fd005fa6c2525dceeec4f724b43df7589ca3f777 SHA512 e800c0d9e6c8c01ccf1d714c6c4da4b98e9610c4c06557dda6393d0792a8ae09788703d4a74dcb21844c49b3629ff7ed95a4a86ff79872aafd2b49c672c7a570 -DIST sqlite-doc-3270200.zip 9371606 BLAKE2B 6d65f59f21eafab82ede6c89d09b8828e5a5e6f7ad7233877fe938773be0aee6fd347d7bba0101cc1d2e376181e4cfbcc2e36d47567b65af9167c4d1ba7f3540 SHA512 00a7c51aeaea2d9338662553c331addca8cd4ae656f4090630b4b2c2e6ceffffd9bd3c6a97117915577cfd6dafeddf9da21f865ab378f86c4832ba0b1c419a2f +DIST sqlite-autoconf-3290000.tar.gz 2833613 BLAKE2B b68a4f9bfe90653f5ce9dbf94b44cecc843fbb639883a7be9dd40150749f8d2eca0c231b215137d2f8da78d33356d72640a943ba06516c6d7c10ebd04cae4766 SHA512 85dcaa72cc2476c628e801d4ce46cf10ed8997f56cb0334062df5553f18c29d607883a1049bf75258204f2f53a29a02a01f014dcca383b05dfac1e2123778024 DIST sqlite-doc-3280000.zip 9421770 BLAKE2B 695eab96f718307a7aff8a171d9e416ddb4b17039ef7230a458dc7d256e2f07a5b41d3aa1a3f085e5e418c297b5dd1d2ba5e4827434329d1ed61d3dd1f618f3d SHA512 83e23dff00614d31d501c66c29d8d4aa780b38859242b58937243235d185fe3db2f9f3c1accf9bf2df0b457a6e32612a00e82f503a8665aad4f19602e2b36396 -DIST sqlite-src-3270200.zip 12248529 BLAKE2B b3c79b85bbfa376b31ebb4ad33aea3f0b60c1f6d1e6505e02758cffff41e44ea0c5b8c24892f0757502ed6213c0f97f00957632ddf0e5ffe25e9f8b7f62c6e9a SHA512 52f61e2fa54558b953dba62b27961eef8563f40e6b4a62638087cb22c7d1fdf2c915ea1071939e2e98f3ce6041da2c9bfb1bdbc1e8b8b4a049b8148e878a4e5e +DIST sqlite-doc-3290000.zip 9415641 BLAKE2B 97fef1f01d3e7730e5220541ad9ccdf9f8538aa43939c0f513919c8505b3a4f4b4c89eb2e04fddae80b7eeed440eb0f06f7cfd93cd56f0539bd6fdd5f47e1ff7 SHA512 ca856cf250e395d9c7e9817337adb5a16b1d96a20548a4010f5137188d35bb9d49a4a6da47bf2a696deffa68d2976dbb35a036adce19b8320e0e286876ac094f DIST sqlite-src-3280000.zip 12477204 BLAKE2B e62e0f36f0bebf89990f8ec91cb1e508a5ebc92bb212eaf9c80eb0febecb5623f5938ecd31c210837314f1f9aab19a18189824f82a106799384d8184ca5f65ab SHA512 49c35c65fa686a2326e13218db583c54fa5fe8f48f0caddd11a942601803b3023f7d32ffbab16641e0d72dc9ed288ad26eaa7226c865ac54e1f181859125651f -EBUILD sqlite-3.27.2.ebuild 9949 BLAKE2B 2f377a97be15eabca01ba031906aea8a05ad8c19c3b88aa00fa18b3fd8ae875478210471e83b8e670d7ff3da0f8cafd5419810f8e178d49fd79d514b9da3af2f SHA512 8b6bf4e9b9120b7bac35382f6bb4058be193e8295a1d21f18c2d1c6ebbdcbc123f02a398cba01e0100091c760ca0a4137110b66a94993cdbad78c555428654be -EBUILD sqlite-3.28.0.ebuild 10121 BLAKE2B 40e29e4001dc429cd87e524c9b7db9bcc9baa5aa2ca2b083534450290ae6436d9051b0e89fa5b7a7729fdadda0716f52039055c95016e54717954b33cca46b6d SHA512 47997416d3bb8165a0f355c246a521502d02982e8fe15a2cfbbdefd51628f23450d04774d1c0d17d325091ce48574c71f1fdc0c6fe96278b0de25b37e9bd22cf -MISC metadata.xml 723 BLAKE2B 8866fbde770e7b8582de27303c72df047db80e0d70b1a1ceca0951a05b51bb704452071ceb6c29ecf3704d523888351615d1798aaab092e6b7505d4c6e3698ad SHA512 40616710b1d4edd3e24b5ac0797c1c9b606aeacac9f9543722bc9529e7c2c704a0c10b0ca68a5ba6e0a0ee8bc605212e8a49a050c8687afbdd7dbf28d6d4506a +DIST sqlite-src-3290000.zip 12557725 BLAKE2B b1aeb80734a2cb7d45c6f2e278bad2996b56ecaf792a8f26322bf50aeaa430eea267f23edb1721bb80ecb6e0c8e14c7a5d8f26178d056fd23efb52f496cc03e1 SHA512 575398fbe20c6471ee2abcbde170b8d48efbb3cb2716a65f42f05c52429a45d14e8046e50c59bbf75bfe2d8f151c34abd50b440c50af571f19e19f3290b230df +EBUILD sqlite-3.28.0.ebuild 10089 BLAKE2B 4913c8929b24cbea00d1231b6cf6a6bd0c630ab1cc13577e1e9cc728da80f1f48c11f2a19d754fadc59b33f21dbcb7051b1e5249a536e1c3f94ca6a71a1f2ca2 SHA512 73eb7223d5d6fe6b5b2ee954dd04fcd48d6743ae2cf0a85489437e5183921b46edb39547c865e9f245f2a30a0cb272d26e0419dcef0c3431b15181ebea2b233f +EBUILD sqlite-3.29.0.ebuild 12045 BLAKE2B 64ccc0e483577de360627a95b1550d8c7d4566d0d78500b3668b16a5bc66a8cb9d5076be5e4961794d04a7427a9a8188837391b39f7c24608fcf33e897871fa9 SHA512 abed3dc42f0ae4f07a9add0c17595eed046bf376458ee37743f6307f13e33f44236adaa6d023e5ad1b772d94885eecd5c98dd2d384e0137bb1915e25c492b0dd +MISC metadata.xml 606 BLAKE2B 003e4c40dcfdac591df25e197f037d5f8a9b3dca515f71d85f6d5bd91705fd5053f99fcaf4a3e55d9aa827048597f84aba861e3507cf88de571cb7a134a179c5 SHA512 19d616062c139eb0f32379c6f7d69c5ced561f1799785732e51cbd7f8ec2ca600ff724feed4c594ceedd7fc50ea76400fa1563c8fcbe789279cb743f31ae7575 diff --git a/dev-db/sqlite/files/sqlite-3.27.0-full_archive-build.patch b/dev-db/sqlite/files/sqlite-3.27.0-full_archive-build.patch deleted file mode 100644 index 18c6d4d7bd30..000000000000 --- a/dev-db/sqlite/files/sqlite-3.27.0-full_archive-build.patch +++ /dev/null @@ -1,461 +0,0 @@ -Move some code to libsqlite3.so to avoid duplication. -Link executables against libsqlite3.so. -Increase timeout for fuzzcheck. -Fix building with dlopen() not available. - ---- /Makefile.in -+++ /Makefile.in -@@ -311,6 +311,9 @@ - # Source code for extensions - # - SRC += \ -+ $(TOP)/ext/expert/sqlite3expert.c \ -+ $(TOP)/ext/expert/sqlite3expert.h -+SRC += \ - $(TOP)/ext/fts1/fts1.c \ - $(TOP)/ext/fts1/fts1.h \ - $(TOP)/ext/fts1/fts1_hash.c \ -@@ -363,8 +366,11 @@ - $(TOP)/ext/rbu/sqlite3rbu.h \ - $(TOP)/ext/rbu/sqlite3rbu.c - SRC += \ -+ $(TOP)/ext/misc/appendvfs.c \ - $(TOP)/ext/misc/json1.c \ -- $(TOP)/ext/misc/stmt.c -+ $(TOP)/ext/misc/sqlar.c \ -+ $(TOP)/ext/misc/stmt.c \ -+ $(TOP)/ext/misc/zipfile.c - - # Generated source code files - # -@@ -434,7 +440,6 @@ - # Statically linked extensions - # - TESTSRC += \ -- $(TOP)/ext/expert/sqlite3expert.c \ - $(TOP)/ext/expert/test_expert.c \ - $(TOP)/ext/misc/amatch.c \ - $(TOP)/ext/misc/carray.c \ -@@ -460,7 +465,6 @@ - $(TOP)/ext/misc/totype.c \ - $(TOP)/ext/misc/unionvtab.c \ - $(TOP)/ext/misc/wholenumber.c \ -- $(TOP)/ext/misc/zipfile.c \ - $(TOP)/ext/userauth/userauth.c - - # Source code to the library files needed by the test fixture -@@ -639,25 +643,25 @@ - - libtclsqlite3.la: tclsqlite.lo libsqlite3.la - $(LTLINK) -no-undefined -o $@ tclsqlite.lo \ -- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \ -+ libsqlite3.la @TCL_STUB_LIB_SPEC@ \ - -rpath "$(TCLLIBDIR)" \ - -version-info "8:6:8" \ - -avoid-version - --sqlite3$(TEXE): shell.c sqlite3.c -- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \ -- shell.c sqlite3.c \ -- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)" -+sqlite3$(TEXE): shell.c libsqlite3.la -+ $(LTLINK) $(READLINE_FLAGS) -o $@ \ -+ shell.c libsqlite3.la \ -+ $(LIBREADLINE) - --sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h -- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS) -+sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la -+ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la - --dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h -- $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS) -+dbhash$(TEXE): $(TOP)/tool/dbhash.c libsqlite3.la -+ $(LTLINK) -o $@ $(TOP)/tool/dbhash.c libsqlite3.la - --scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo -+scrub$(TEXE): $(TOP)/ext/misc/scrub.c libsqlite3.la - $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \ -- $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS) -+ $(TOP)/ext/misc/scrub.c libsqlite3.la - - srcck1$(BEXE): $(TOP)/tool/srcck1.c - $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c -@@ -767,7 +771,7 @@ - # Rule to build the amalgamation - # - sqlite3.lo: sqlite3.c -- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c -+ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c - - # Rules to build the LEMON compiler generator - # -@@ -1067,14 +1071,9 @@ - # Source files that go into making shell.c - SHELL_SRC = \ - $(TOP)/src/shell.c.in \ -- $(TOP)/ext/misc/appendvfs.c \ - $(TOP)/ext/misc/shathree.c \ - $(TOP)/ext/misc/fileio.c \ - $(TOP)/ext/misc/completion.c \ -- $(TOP)/ext/misc/sqlar.c \ -- $(TOP)/ext/expert/sqlite3expert.c \ -- $(TOP)/ext/expert/sqlite3expert.h \ -- $(TOP)/ext/misc/zipfile.c \ - $(TOP)/ext/misc/memtrace.c \ - $(TOP)/src/test_windirent.c - -@@ -1242,15 +1241,15 @@ - - # Fuzz testing - fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db -- ./fuzzcheck$(TEXE) $(FUZZDATA) -+ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA) - ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db - - fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db -- ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA) -+ ./fuzzcheck$(TEXE) --limit-mem 100M --timeout 3600 $(FUZZDATA) - ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db - - valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db -- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA) -+ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA) - valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db - - # The veryquick.test TCL tests. -@@ -1281,24 +1280,23 @@ - smoketest: $(TESTPROGS) fuzzcheck$(TEXE) - ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS) - --sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in -+sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in - $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c - --sqlite3_analyzer$(TEXE): sqlite3_analyzer.c -- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS) -+sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la -+ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL) - --sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in -+sqltclsh.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in - $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c - --sqltclsh$(TEXE): sqltclsh.c -- $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS) -+sqltclsh$(TEXE): sqltclsh.c libsqlite3.la -+ $(LTLINK) sqltclsh.c -o $@ libsqlite3.la $(LIBTCL) - --sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -- $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS) -+sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/expert.c libsqlite3.la -+ $(LTLINK) $(TOP)/ext/expert/expert.c -o sqlite3_expert libsqlite3.la - - CHECKER_DEPS =\ - $(TOP)/tool/mkccode.tcl \ -- sqlite3.c \ - $(TOP)/src/tclsqlite.c \ - $(TOP)/ext/repair/sqlite3_checker.tcl \ - $(TOP)/ext/repair/checkindex.c \ -@@ -1309,36 +1307,36 @@ - sqlite3_checker.c: $(CHECKER_DEPS) - $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@ - --sqlite3_checker$(TEXE): sqlite3_checker.c -- $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS) -+sqlite3_checker$(TEXE): sqlite3_checker.c libsqlite3.la -+ $(LTLINK) sqlite3_checker.c -o $@ libsqlite3.la $(LIBTCL) - --dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo -+dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c libsqlite3.la - $(LTLINK) -DDBDUMP_STANDALONE -o $@ \ -- $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS) -+ $(TOP)/ext/misc/dbdump.c libsqlite3.la - --dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c -- $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c -+dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c -+ $(LTLINK) -o $@ $(TOP)/tool/dbtotxt.c - --showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo -- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS) -+showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la -+ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la - --showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo -- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS) -+showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la -+ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la - --showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo -- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS) -+showjournal$(TEXE): $(TOP)/tool/showjournal.c -+ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c - --showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo -- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS) -+showwal$(TEXE): $(TOP)/tool/showwal.c -+ $(LTLINK) -o $@ $(TOP)/tool/showwal.c - - showshm$(TEXE): $(TOP)/tool/showshm.c - $(LTLINK) -o $@ $(TOP)/tool/showshm.c - --index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo -- $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS) -+index_usage$(TEXE): $(TOP)/tool/index_usage.c libsqlite3.la -+ $(LTLINK) -o $@ $(TOP)/tool/index_usage.c libsqlite3.la - --changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo -- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS) -+changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la -+ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la - - changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo - $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS) -@@ -1363,11 +1361,11 @@ - kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c - $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS) - --rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo -- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS) -+rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la -+ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la - --loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la -- $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS) -+loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la -+ $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ - - # This target will fail if the SQLite amalgamation contains any exported - # symbols that do not begin with "sqlite3_". It is run as part of the ---- /configure.ac -+++ /configure.ac -@@ -587,6 +587,9 @@ - if test "${enable_load_extension}" = "yes" ; then - OPT_FEATURE_FLAGS="" - AC_SEARCH_LIBS(dlopen, dl) -+ if test "${ac_cv_search_dlopen}" = "no" ; then -+ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" -+ fi - else - OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" - fi ---- /ext/misc/sqlar.c -+++ /ext/misc/sqlar.c -@@ -14,6 +14,8 @@ - ** for working with sqlar archives and used by the shell tool's built-in - ** sqlar support. - */ -+#ifdef SQLITE_HAVE_ZLIB -+ - #include "sqlite3ext.h" - SQLITE_EXTENSION_INIT1 - #include -@@ -119,3 +121,5 @@ - } - return rc; - } -+ -+#endif /* SQLITE_HAVE_ZLIB */ ---- /ext/misc/zipfile.c -+++ /ext/misc/zipfile.c -@@ -24,6 +24,8 @@ - ** * No support for zip64 extensions - ** * Only the "inflate/deflate" (zlib) compression method is supported - */ -+#ifdef SQLITE_HAVE_ZLIB -+ - #include "sqlite3ext.h" - SQLITE_EXTENSION_INIT1 - #include -@@ -2176,3 +2178,5 @@ - (void)pzErrMsg; /* Unused parameter */ - return zipfileRegister(db); - } -+ -+#endif /* SQLITE_HAVE_ZLIB */ ---- /ext/repair/sqlite3_checker.c.in -+++ /ext/repair/sqlite3_checker.c.in -@@ -2,6 +2,7 @@ - ** Read an SQLite database file and analyze its space utilization. Generate - ** text on standard output. - */ -+#define SQLITE_CORE 1 - #define TCLSH_INIT_PROC sqlite3_checker_init_proc - #define SQLITE_ENABLE_DBPAGE_VTAB 1 - #define SQLITE_ENABLE_JSON1 1 -@@ -14,7 +15,7 @@ - #define SQLITE_OMIT_SHARED_CACHE 1 - #define SQLITE_DEFAULT_MEMSTATUS 0 - #define SQLITE_MAX_EXPR_DEPTH 0 --INCLUDE sqlite3.c -+#include "sqlite3.h" - INCLUDE $ROOT/src/tclsqlite.c - INCLUDE $ROOT/ext/misc/btreeinfo.c - INCLUDE $ROOT/ext/repair/checkindex.c ---- /src/shell.c.in -+++ /src/shell.c.in -@@ -61,6 +61,7 @@ - #include - #include - #include "sqlite3.h" -+#include "ext/expert/sqlite3expert.h" - typedef sqlite3_int64 i64; - typedef sqlite3_uint64 u64; - typedef unsigned char u8; -@@ -127,6 +128,10 @@ - # define SHELL_USE_LOCAL_GETLINE 1 - #endif - -+#ifdef SQLITE_HAVE_ZLIB -+#include -+#endif -+ - - #if defined(_WIN32) || defined(WIN32) - # include -@@ -939,14 +944,7 @@ - INCLUDE ../ext/misc/shathree.c - INCLUDE ../ext/misc/fileio.c - INCLUDE ../ext/misc/completion.c --INCLUDE ../ext/misc/appendvfs.c - INCLUDE ../ext/misc/memtrace.c --#ifdef SQLITE_HAVE_ZLIB --INCLUDE ../ext/misc/zipfile.c --INCLUDE ../ext/misc/sqlar.c --#endif --INCLUDE ../ext/expert/sqlite3expert.h --INCLUDE ../ext/expert/sqlite3expert.c - - #if defined(SQLITE_ENABLE_SESSION) - /* -@@ -3934,7 +3932,9 @@ - sqlite3_shathree_init(p->db, 0, 0); - sqlite3_completion_init(p->db, 0, 0); - #ifdef SQLITE_HAVE_ZLIB -+ extern int sqlite3_zipfile_init(sqlite3 *, char **, const sqlite3_api_routines *); - sqlite3_zipfile_init(p->db, 0, 0); -+ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *); - sqlite3_sqlar_init(p->db, 0, 0); - #endif - sqlite3_create_function(p->db, "shell_add_schema", 3, SQLITE_UTF8, 0, -@@ -5868,6 +5868,7 @@ - goto end_ar_command; - } - sqlite3_fileio_init(cmd.db, 0, 0); -+ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *); - sqlite3_sqlar_init(cmd.db, 0, 0); - sqlite3_create_function(cmd.db, "shell_putsnl", 1, SQLITE_UTF8, cmd.p, - shellPutsFunc, 0, 0); -@@ -9045,6 +9046,7 @@ - #endif - } - data.out = stdout; -+ extern int sqlite3_appendvfs_init(sqlite3 *, char **, const sqlite3_api_routines *); - sqlite3_appendvfs_init(0,0,0); - - /* Go ahead and open the database file if it already exists. If the ---- /test/sessionfuzz.c -+++ /test/sessionfuzz.c -@@ -700,42 +700,6 @@ - #include - #include "zlib.h" - --/* --** Implementation of the "sqlar_uncompress(X,SZ)" SQL function --** --** Parameter SZ is interpreted as an integer. If it is less than or --** equal to zero, then this function returns a copy of X. Or, if --** SZ is equal to the size of X when interpreted as a blob, also --** return a copy of X. Otherwise, decompress blob X using zlib --** utility function uncompress() and return the results (another --** blob). --*/ --static void sqlarUncompressFunc( -- sqlite3_context *context, -- int argc, -- sqlite3_value **argv --){ -- uLong nData; -- uLongf sz; -- -- assert( argc==2 ); -- sz = sqlite3_value_int(argv[1]); -- -- if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){ -- sqlite3_result_value(context, argv[0]); -- }else{ -- const Bytef *pData= sqlite3_value_blob(argv[0]); -- Bytef *pOut = sqlite3_malloc(sz); -- if( Z_OK!=uncompress(pOut, &sz, pData, nData) ){ -- sqlite3_result_error(context, "error in uncompress()", -1); -- }else{ -- sqlite3_result_blob(context, pOut, sz, SQLITE_TRANSIENT); -- } -- sqlite3_free(pOut); -- } --} -- -- - /* Run a chunk of SQL. If any errors happen, print an error message - ** and exit. - */ ---- /tool/mksqlite3c.tcl -+++ /tool/mksqlite3c.tcl -@@ -117,6 +117,7 @@ - rtree.h - sqlite3session.h - sqlite3.h -+ sqlite3expert.h - sqlite3ext.h - sqlite3rbu.h - sqliteicu.h -@@ -403,6 +404,10 @@ - sqlite3session.c - fts5.c - stmt.c -+ appendvfs.c -+ sqlar.c -+ sqlite3expert.c -+ zipfile.c - } { - copy_file tsrc/$file - } ---- /tool/sqlite3_analyzer.c.in -+++ /tool/sqlite3_analyzer.c.in -@@ -14,9 +14,6 @@ - #define SQLITE_DEFAULT_MEMSTATUS 0 - #define SQLITE_MAX_EXPR_DEPTH 0 - #define SQLITE_OMIT_LOAD_EXTENSION 1 --#ifndef USE_EXTERNAL_SQLITE --INCLUDE sqlite3.c --#endif - INCLUDE $ROOT/src/tclsqlite.c - - const char *sqlite3_analyzer_init_proc(Tcl_Interp *interp){ ---- /tool/sqltclsh.c.in -+++ /tool/sqltclsh.c.in -@@ -27,19 +27,17 @@ - #define SQLITE_OMIT_SHARED_CACHE 1 - #define SQLITE_DEFAULT_MEMSTATUS 0 - #define SQLITE_MAX_EXPR_DEPTH 0 --INCLUDE sqlite3.c --INCLUDE $ROOT/ext/misc/appendvfs.c --#ifdef SQLITE_HAVE_ZLIB --INCLUDE $ROOT/ext/misc/zipfile.c --INCLUDE $ROOT/ext/misc/sqlar.c --#endif -+#include "sqlite3.h" - INCLUDE $ROOT/src/tclsqlite.c - - const char *sqlite3_tclapp_init_proc(Tcl_Interp *interp){ - (void)interp; -+ extern int sqlite3_appendvfs_init(sqlite3 *,char **, const sqlite3_api_routines *); - sqlite3_appendvfs_init(0,0,0); - #ifdef SQLITE_HAVE_ZLIB -+ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *); - sqlite3_auto_extension((void(*)(void))sqlite3_sqlar_init); -+ extern int sqlite3_zipfile_init(sqlite3 *, char **, const sqlite3_api_routines *); - sqlite3_auto_extension((void(*)(void))sqlite3_zipfile_init); - #endif - diff --git a/dev-db/sqlite/files/sqlite-3.27.2-full_archive-tests.patch b/dev-db/sqlite/files/sqlite-3.27.2-full_archive-tests.patch deleted file mode 100644 index 92959579b542..000000000000 --- a/dev-db/sqlite/files/sqlite-3.27.2-full_archive-tests.patch +++ /dev/null @@ -1,36 +0,0 @@ -https://sqlite.org/src/info/29d02bf2fa9ecacb - ---- /ext/session/sessionB.test -+++ /ext/session/sessionB.test -@@ -258,8 +258,7 @@ - INSERT INTO t2 VALUES('a', 'a', 'a', 'a'); - } { - DELETE FROM t2 WHERE c = 'a'; --} { --} -+} {} - - # INSERT + UPDATE - do_patchconcat_test 4.3.4 { ---- /test/fts3expr4.test -+++ /test/fts3expr4.test -@@ -68,7 +68,7 @@ - AND {AND {AND {PHRASE 3 0 *} {PHRASE 3 0 lol+}} {PHRASE 3 0 *}} {PHRASE 3 0 h4h+} - } - --do_simple_expr_test 3.3 { * } { } -+do_simple_expr_test 3.3 { * } {} - do_simple_expr_test 3.4 { *a } { PHRASE 3 0 a } - do_simple_expr_test 3.5 { a*b } { AND {PHRASE 3 0 a+} {PHRASE 3 0 b} } - do_simple_expr_test 3.6 { *a*b } { AND {PHRASE 3 0 a+} {PHRASE 3 0 b} } ---- /test/scanstatus.test -+++ /test/scanstatus.test -@@ -254,7 +254,7 @@ - } - - do_execsql_test 4.1.1 { INSERT INTO t1 VALUES(1, 2, 3); } --do_scanstatus_test 4.1.2 { } -+do_scanstatus_test 4.1.2 {} - - do_execsql_test 4.2 { - CREATE TABLE p1(x PRIMARY KEY); diff --git a/dev-db/sqlite/files/sqlite-3.29.0-full_archive-build.patch b/dev-db/sqlite/files/sqlite-3.29.0-full_archive-build.patch new file mode 100644 index 000000000000..290d286e4892 --- /dev/null +++ b/dev-db/sqlite/files/sqlite-3.29.0-full_archive-build.patch @@ -0,0 +1,471 @@ +Move some code to libsqlite3.so to avoid duplication. +Link executables against libsqlite3.so. +Increase timeout for fuzzcheck. +Fix building with dlopen() not available. + +--- /Makefile.in ++++ /Makefile.in +@@ -311,6 +311,9 @@ + # Source code for extensions + # + SRC += \ ++ $(TOP)/ext/expert/sqlite3expert.c \ ++ $(TOP)/ext/expert/sqlite3expert.h ++SRC += \ + $(TOP)/ext/fts1/fts1.c \ + $(TOP)/ext/fts1/fts1.h \ + $(TOP)/ext/fts1/fts1_hash.c \ +@@ -363,8 +366,12 @@ + $(TOP)/ext/rbu/sqlite3rbu.h \ + $(TOP)/ext/rbu/sqlite3rbu.c + SRC += \ ++ $(TOP)/ext/misc/appendvfs.c \ ++ $(TOP)/ext/misc/dbdata.c \ + $(TOP)/ext/misc/json1.c \ +- $(TOP)/ext/misc/stmt.c ++ $(TOP)/ext/misc/sqlar.c \ ++ $(TOP)/ext/misc/stmt.c \ ++ $(TOP)/ext/misc/zipfile.c + + # Generated source code files + # +@@ -435,7 +442,6 @@ + # Statically linked extensions + # + TESTSRC += \ +- $(TOP)/ext/expert/sqlite3expert.c \ + $(TOP)/ext/expert/test_expert.c \ + $(TOP)/ext/misc/amatch.c \ + $(TOP)/ext/misc/carray.c \ +@@ -461,7 +467,6 @@ + $(TOP)/ext/misc/totype.c \ + $(TOP)/ext/misc/unionvtab.c \ + $(TOP)/ext/misc/wholenumber.c \ +- $(TOP)/ext/misc/zipfile.c \ + $(TOP)/ext/userauth/userauth.c + + # Source code to the library files needed by the test fixture +@@ -640,25 +645,25 @@ + + libtclsqlite3.la: tclsqlite.lo libsqlite3.la + $(LTLINK) -no-undefined -o $@ tclsqlite.lo \ +- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \ ++ libsqlite3.la @TCL_STUB_LIB_SPEC@ \ + -rpath "$(TCLLIBDIR)" \ + -version-info "8:6:8" \ + -avoid-version + +-sqlite3$(TEXE): shell.c sqlite3.c +- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \ +- shell.c sqlite3.c \ +- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)" ++sqlite3$(TEXE): shell.c libsqlite3.la ++ $(LTLINK) $(READLINE_FLAGS) -o $@ \ ++ shell.c libsqlite3.la \ ++ $(LIBREADLINE) + +-sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h +- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS) ++sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la ++ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la + +-dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h +- $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS) ++dbhash$(TEXE): $(TOP)/tool/dbhash.c libsqlite3.la ++ $(LTLINK) -o $@ $(TOP)/tool/dbhash.c libsqlite3.la + +-scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo ++scrub$(TEXE): $(TOP)/ext/misc/scrub.c libsqlite3.la + $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \ +- $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS) ++ $(TOP)/ext/misc/scrub.c libsqlite3.la + + srcck1$(BEXE): $(TOP)/tool/srcck1.c + $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c +@@ -768,7 +773,7 @@ + # Rule to build the amalgamation + # + sqlite3.lo: sqlite3.c +- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c ++ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c + + # Rules to build the LEMON compiler generator + # +@@ -1065,14 +1070,9 @@ + # Source files that go into making shell.c + SHELL_SRC = \ + $(TOP)/src/shell.c.in \ +- $(TOP)/ext/misc/appendvfs.c \ + $(TOP)/ext/misc/shathree.c \ + $(TOP)/ext/misc/fileio.c \ + $(TOP)/ext/misc/completion.c \ +- $(TOP)/ext/misc/sqlar.c \ +- $(TOP)/ext/expert/sqlite3expert.c \ +- $(TOP)/ext/expert/sqlite3expert.h \ +- $(TOP)/ext/misc/zipfile.c \ + $(TOP)/ext/misc/memtrace.c \ + $(TOP)/src/test_windirent.c + +@@ -1240,15 +1240,15 @@ + + # Fuzz testing + fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db +- ./fuzzcheck$(TEXE) $(FUZZDATA) ++ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA) + ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db + + fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db +- ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA) ++ ./fuzzcheck$(TEXE) --limit-mem 100M --timeout 3600 $(FUZZDATA) + ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db + + valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db +- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA) ++ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA) + valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db + + # The veryquick.test TCL tests. +@@ -1279,24 +1279,23 @@ + smoketest: $(TESTPROGS) fuzzcheck$(TEXE) + ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS) + +-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in ++sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c + +-sqlite3_analyzer$(TEXE): sqlite3_analyzer.c +- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS) ++sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la ++ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL) + +-sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in ++sqltclsh.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c + +-sqltclsh$(TEXE): sqltclsh.c +- $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS) ++sqltclsh$(TEXE): sqltclsh.c libsqlite3.la ++ $(LTLINK) sqltclsh.c -o $@ libsqlite3.la $(LIBTCL) + +-sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c +- $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS) ++sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/expert.c libsqlite3.la ++ $(LTLINK) $(TOP)/ext/expert/expert.c -o sqlite3_expert libsqlite3.la + + CHECKER_DEPS =\ + $(TOP)/tool/mkccode.tcl \ +- sqlite3.c \ + $(TOP)/src/tclsqlite.c \ + $(TOP)/ext/repair/sqlite3_checker.tcl \ + $(TOP)/ext/repair/checkindex.c \ +@@ -1307,36 +1306,36 @@ + sqlite3_checker.c: $(CHECKER_DEPS) + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@ + +-sqlite3_checker$(TEXE): sqlite3_checker.c +- $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS) ++sqlite3_checker$(TEXE): sqlite3_checker.c libsqlite3.la ++ $(LTLINK) sqlite3_checker.c -o $@ libsqlite3.la $(LIBTCL) + +-dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo ++dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c libsqlite3.la + $(LTLINK) -DDBDUMP_STANDALONE -o $@ \ +- $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS) ++ $(TOP)/ext/misc/dbdump.c libsqlite3.la + +-dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c +- $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c ++dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c ++ $(LTLINK) -o $@ $(TOP)/tool/dbtotxt.c + +-showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo +- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS) ++showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la ++ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la + +-showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo +- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS) ++showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la ++ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la + +-showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo +- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS) ++showjournal$(TEXE): $(TOP)/tool/showjournal.c ++ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c + +-showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo +- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS) ++showwal$(TEXE): $(TOP)/tool/showwal.c ++ $(LTLINK) -o $@ $(TOP)/tool/showwal.c + + showshm$(TEXE): $(TOP)/tool/showshm.c + $(LTLINK) -o $@ $(TOP)/tool/showshm.c + +-index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo +- $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS) ++index_usage$(TEXE): $(TOP)/tool/index_usage.c libsqlite3.la ++ $(LTLINK) -o $@ $(TOP)/tool/index_usage.c libsqlite3.la + +-changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo +- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS) ++changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la ++ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la + + changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo + $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS) +@@ -1361,11 +1360,11 @@ + kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c + $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS) + +-rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo +- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS) ++rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la ++ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la + +-loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la +- $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS) ++loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la ++ $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ + + # This target will fail if the SQLite amalgamation contains any exported + # symbols that do not begin with "sqlite3_". It is run as part of the +--- /configure.ac ++++ /configure.ac +@@ -587,6 +587,9 @@ + if test "${enable_load_extension}" = "yes" ; then + OPT_FEATURE_FLAGS="" + AC_SEARCH_LIBS(dlopen, dl) ++ if test "${ac_cv_search_dlopen}" = "no" ; then ++ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" ++ fi + else + OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" + fi +--- /ext/misc/sqlar.c ++++ /ext/misc/sqlar.c +@@ -14,6 +14,8 @@ + ** for working with sqlar archives and used by the shell tool's built-in + ** sqlar support. + */ ++#ifdef SQLITE_HAVE_ZLIB ++ + #include "sqlite3ext.h" + SQLITE_EXTENSION_INIT1 + #include +@@ -119,3 +121,5 @@ + } + return rc; + } ++ ++#endif /* SQLITE_HAVE_ZLIB */ +--- /ext/misc/zipfile.c ++++ /ext/misc/zipfile.c +@@ -24,6 +24,8 @@ + ** * No support for zip64 extensions + ** * Only the "inflate/deflate" (zlib) compression method is supported + */ ++#ifdef SQLITE_HAVE_ZLIB ++ + #include "sqlite3ext.h" + SQLITE_EXTENSION_INIT1 + #include +@@ -2176,3 +2178,5 @@ + (void)pzErrMsg; /* Unused parameter */ + return zipfileRegister(db); + } ++ ++#endif /* SQLITE_HAVE_ZLIB */ +--- /ext/repair/sqlite3_checker.c.in ++++ /ext/repair/sqlite3_checker.c.in +@@ -2,6 +2,7 @@ + ** Read an SQLite database file and analyze its space utilization. Generate + ** text on standard output. + */ ++#define SQLITE_CORE 1 + #define TCLSH_INIT_PROC sqlite3_checker_init_proc + #define SQLITE_ENABLE_DBPAGE_VTAB 1 + #define SQLITE_ENABLE_JSON1 1 +@@ -14,7 +15,7 @@ + #define SQLITE_OMIT_SHARED_CACHE 1 + #define SQLITE_DEFAULT_MEMSTATUS 0 + #define SQLITE_MAX_EXPR_DEPTH 0 +-INCLUDE sqlite3.c ++#include "sqlite3.h" + INCLUDE $ROOT/src/tclsqlite.c + INCLUDE $ROOT/ext/misc/btreeinfo.c + INCLUDE $ROOT/ext/repair/checkindex.c +--- /src/shell.c.in ++++ /src/shell.c.in +@@ -61,6 +61,7 @@ + #include + #include + #include "sqlite3.h" ++#include "ext/expert/sqlite3expert.h" + typedef sqlite3_int64 i64; + typedef sqlite3_uint64 u64; + typedef unsigned char u8; +@@ -127,6 +128,10 @@ + # define SHELL_USE_LOCAL_GETLINE 1 + #endif + ++#ifdef SQLITE_HAVE_ZLIB ++#include ++#endif ++ + + #if defined(_WIN32) || defined(WIN32) + # include +@@ -939,18 +944,7 @@ + INCLUDE ../ext/misc/shathree.c + INCLUDE ../ext/misc/fileio.c + INCLUDE ../ext/misc/completion.c +-INCLUDE ../ext/misc/appendvfs.c + INCLUDE ../ext/misc/memtrace.c +-#ifdef SQLITE_HAVE_ZLIB +-INCLUDE ../ext/misc/zipfile.c +-INCLUDE ../ext/misc/sqlar.c +-#endif +-INCLUDE ../ext/expert/sqlite3expert.h +-INCLUDE ../ext/expert/sqlite3expert.c +- +-#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) +-INCLUDE ../ext/misc/dbdata.c +-#endif + + #if defined(SQLITE_ENABLE_SESSION) + /* +@@ -4135,10 +4129,13 @@ + sqlite3_shathree_init(p->db, 0, 0); + sqlite3_completion_init(p->db, 0, 0); + #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) ++ extern int sqlite3_dbdata_init(sqlite3 *, char **, const sqlite3_api_routines *); + sqlite3_dbdata_init(p->db, 0, 0); + #endif + #ifdef SQLITE_HAVE_ZLIB ++ extern int sqlite3_zipfile_init(sqlite3 *, char **, const sqlite3_api_routines *); + sqlite3_zipfile_init(p->db, 0, 0); ++ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *); + sqlite3_sqlar_init(p->db, 0, 0); + #endif + sqlite3_create_function(p->db, "shell_add_schema", 3, SQLITE_UTF8, 0, +@@ -6135,6 +6132,7 @@ + goto end_ar_command; + } + sqlite3_fileio_init(cmd.db, 0, 0); ++ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *); + sqlite3_sqlar_init(cmd.db, 0, 0); + sqlite3_create_function(cmd.db, "shell_putsnl", 1, SQLITE_UTF8, cmd.p, + shellPutsFunc, 0, 0); +@@ -10187,6 +10185,7 @@ + #endif + } + data.out = stdout; ++ extern int sqlite3_appendvfs_init(sqlite3 *, char **, const sqlite3_api_routines *); + sqlite3_appendvfs_init(0,0,0); + + /* Go ahead and open the database file if it already exists. If the +--- /test/sessionfuzz.c ++++ /test/sessionfuzz.c +@@ -700,42 +700,6 @@ + #include + #include "zlib.h" + +-/* +-** Implementation of the "sqlar_uncompress(X,SZ)" SQL function +-** +-** Parameter SZ is interpreted as an integer. If it is less than or +-** equal to zero, then this function returns a copy of X. Or, if +-** SZ is equal to the size of X when interpreted as a blob, also +-** return a copy of X. Otherwise, decompress blob X using zlib +-** utility function uncompress() and return the results (another +-** blob). +-*/ +-static void sqlarUncompressFunc( +- sqlite3_context *context, +- int argc, +- sqlite3_value **argv +-){ +- uLong nData; +- uLongf sz; +- +- assert( argc==2 ); +- sz = sqlite3_value_int(argv[1]); +- +- if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){ +- sqlite3_result_value(context, argv[0]); +- }else{ +- const Bytef *pData= sqlite3_value_blob(argv[0]); +- Bytef *pOut = sqlite3_malloc(sz); +- if( Z_OK!=uncompress(pOut, &sz, pData, nData) ){ +- sqlite3_result_error(context, "error in uncompress()", -1); +- }else{ +- sqlite3_result_blob(context, pOut, sz, SQLITE_TRANSIENT); +- } +- sqlite3_free(pOut); +- } +-} +- +- + /* Run a chunk of SQL. If any errors happen, print an error message + ** and exit. + */ +--- /tool/mksqlite3c.tcl ++++ /tool/mksqlite3c.tcl +@@ -117,6 +117,7 @@ + rtree.h + sqlite3session.h + sqlite3.h ++ sqlite3expert.h + sqlite3ext.h + sqlite3rbu.h + sqliteicu.h +@@ -403,6 +404,11 @@ + sqlite3session.c + fts5.c + stmt.c ++ appendvfs.c ++ dbdata.c ++ sqlar.c ++ sqlite3expert.c ++ zipfile.c + } { + copy_file tsrc/$file + } +--- /tool/sqlite3_analyzer.c.in ++++ /tool/sqlite3_analyzer.c.in +@@ -14,9 +14,6 @@ + #define SQLITE_DEFAULT_MEMSTATUS 0 + #define SQLITE_MAX_EXPR_DEPTH 0 + #define SQLITE_OMIT_LOAD_EXTENSION 1 +-#ifndef USE_EXTERNAL_SQLITE +-INCLUDE sqlite3.c +-#endif + INCLUDE $ROOT/src/tclsqlite.c + + const char *sqlite3_analyzer_init_proc(Tcl_Interp *interp){ +--- /tool/sqltclsh.c.in ++++ /tool/sqltclsh.c.in +@@ -27,19 +27,17 @@ + #define SQLITE_OMIT_SHARED_CACHE 1 + #define SQLITE_DEFAULT_MEMSTATUS 0 + #define SQLITE_MAX_EXPR_DEPTH 0 +-INCLUDE sqlite3.c +-INCLUDE $ROOT/ext/misc/appendvfs.c +-#ifdef SQLITE_HAVE_ZLIB +-INCLUDE $ROOT/ext/misc/zipfile.c +-INCLUDE $ROOT/ext/misc/sqlar.c +-#endif ++#include "sqlite3.h" + INCLUDE $ROOT/src/tclsqlite.c + + const char *sqlite3_tclapp_init_proc(Tcl_Interp *interp){ + (void)interp; ++ extern int sqlite3_appendvfs_init(sqlite3 *,char **, const sqlite3_api_routines *); + sqlite3_appendvfs_init(0,0,0); + #ifdef SQLITE_HAVE_ZLIB ++ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *); + sqlite3_auto_extension((void(*)(void))sqlite3_sqlar_init); ++ extern int sqlite3_zipfile_init(sqlite3 *, char **, const sqlite3_api_routines *); + sqlite3_auto_extension((void(*)(void))sqlite3_zipfile_init); + #endif + diff --git a/dev-db/sqlite/files/sqlite-3.29.0-full_archive-tests.patch b/dev-db/sqlite/files/sqlite-3.29.0-full_archive-tests.patch new file mode 100644 index 000000000000..3f3779d644e6 --- /dev/null +++ b/dev-db/sqlite/files/sqlite-3.29.0-full_archive-tests.patch @@ -0,0 +1,121 @@ +https://sqlite.org/src/info/408144a1832569ce + +--- /test/vtab1.test ++++ /test/vtab1.test +@@ -1303,25 +1303,27 @@ + CREATE VIRTUAL TABLE e6 USING echo(t6); + } + +-foreach {tn sql res filter} { +- 1.1 "SELECT a FROM e6 WHERE b>'8James'" {4 2 6 1 5} +- {xFilter {SELECT rowid, a, b FROM 't6' WHERE b > ?} 8James} +- +- 1.2 "SELECT a FROM e6 WHERE b>='8' AND b<'9'" {3 4} +- {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ?} 8 9} +- +- 1.3 "SELECT a FROM e6 WHERE b LIKE '8J%'" {3 4} +- {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8J%} +- +- 1.4 "SELECT a FROM e6 WHERE b LIKE '8j%'" {3 4} +- {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8j%} +- +- 1.5 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4} +- {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%} +-} { +- set echo_module {} +- do_execsql_test 18.$tn.1 $sql $res +- do_test 18.$tn.2 { lrange $::echo_module 2 end } $filter ++ifcapable !icu { ++ foreach {tn sql res filter} { ++ 1.1 "SELECT a FROM e6 WHERE b>'8James'" {4 2 6 1 5} ++ {xFilter {SELECT rowid, a, b FROM 't6' WHERE b > ?} 8James} ++ ++ 1.2 "SELECT a FROM e6 WHERE b>='8' AND b<'9'" {3 4} ++ {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ?} 8 9} ++ ++ 1.3 "SELECT a FROM e6 WHERE b LIKE '8J%'" {3 4} ++ {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8J%} ++ ++ 1.4 "SELECT a FROM e6 WHERE b LIKE '8j%'" {3 4} ++ {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8j%} ++ ++ 1.5 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4} ++ {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%} ++ } { ++ set echo_module {} ++ do_execsql_test 18.$tn.1 $sql $res ++ do_test 18.$tn.2 { lrange $::echo_module 2 end } $filter ++ } + } + + do_execsql_test 18.2.0 { PRAGMA case_sensitive_like = ON } +--- /test/vtabH.test ++++ /test/vtabH.test +@@ -30,36 +30,38 @@ + CREATE VIRTUAL TABLE e6 USING echo(t6); + } + +-foreach {tn sql expect} { +- 1 "SELECT * FROM e6 WHERE b LIKE '8abc'" { +- xBestIndex +- {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} +- xFilter +- {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} +- 8ABC 8abd 8abc ++ifcapable !icu { ++ foreach {tn sql expect} { ++ 1 "SELECT * FROM e6 WHERE b LIKE '8abc'" { ++ xBestIndex ++ {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} ++ xFilter ++ {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} ++ 8ABC 8abd 8abc ++ } ++ ++ 2 "SELECT * FROM e6 WHERE b GLOB '8abc'" { ++ xBestIndex ++ {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?} ++ xFilter ++ {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?} ++ 8abc 8abd 8abc ++ } ++ 3 "SELECT * FROM e6 WHERE b LIKE '8e/'" { ++ xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b like ?} ++ xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8e/ ++ } ++ 4 "SELECT * FROM e6 WHERE b GLOB '8e/'" { ++ xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b glob ?} ++ xFilter {SELECT rowid, a, b FROM 't6' WHERE b glob ?} 8e/ ++ } ++ } { ++ do_test 1.$tn { ++ set echo_module {} ++ execsql $sql ++ set ::echo_module ++ } [list {*}$expect] + } +- +- 2 "SELECT * FROM e6 WHERE b GLOB '8abc'" { +- xBestIndex +- {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?} +- xFilter +- {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?} +- 8abc 8abd 8abc +- } +- 3 "SELECT * FROM e6 WHERE b LIKE '8e/'" { +- xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b like ?} +- xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8e/ +- } +- 4 "SELECT * FROM e6 WHERE b GLOB '8e/'" { +- xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b glob ?} +- xFilter {SELECT rowid, a, b FROM 't6' WHERE b glob ?} 8e/ +- } +-} { +- do_test 1.$tn { +- set echo_module {} +- execsql $sql +- set ::echo_module +- } [list {*}$expect] + } + + diff --git a/dev-db/sqlite/metadata.xml b/dev-db/sqlite/metadata.xml index ae2540a300e5..271ee2dfe208 100644 --- a/dev-db/sqlite/metadata.xml +++ b/dev-db/sqlite/metadata.xml @@ -5,10 +5,6 @@ arfrever.fta@gmail.com Arfrever Frehtes Taifersar Arahesis - - proxy-maint@gentoo.org - Proxy Maintainers - Enable overwriting of deleted content with zeros by default (http://sqlite.org/pragma.html#pragma_secure_delete), causing some performance penalty Install additional tools diff --git a/dev-db/sqlite/sqlite-3.27.2.ebuild b/dev-db/sqlite/sqlite-3.27.2.ebuild deleted file mode 100644 index 39aa0485a829..000000000000 --- a/dev-db/sqlite/sqlite-3.27.2.ebuild +++ /dev/null @@ -1,328 +0,0 @@ -# Copyright 1999-2019 Arfrever Frehtes Taifersar Arahesis and others -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -inherit autotools flag-o-matic multilib-minimal toolchain-funcs - -SRC_PV="$(printf "%u%02u%02u%02u" $(ver_rs 1- " "))" -DOC_PV="${SRC_PV}" -# DOC_PV="$(printf "%u%02u%02u00" $(ver_rs 1-3 " "))" - -DESCRIPTION="SQL database engine" -HOMEPAGE="https://sqlite.org/" -SRC_URI="doc? ( https://sqlite.org/2019/${PN}-doc-${DOC_PV}.zip ) - tcl? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip ) - test? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip ) - tools? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip ) - !tcl? ( !test? ( !tools? ( https://sqlite.org/2019/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )" - -LICENSE="public-domain" -SLOT="3" -KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="debug doc icu +readline secure-delete static-libs tcl test tools" -RESTRICT="!test? ( test )" - -BDEPEND="doc? ( app-arch/unzip ) - tcl? ( - app-arch/unzip - >=dev-lang/tcl-8.6:0 - ) - test? ( - app-arch/unzip - >=dev-lang/tcl-8.6:0 - ) - tools? ( - app-arch/unzip - >=dev-lang/tcl-8.6:0 - )" -RDEPEND="sys-libs/zlib:0=[${MULTILIB_USEDEP}] - icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] ) - readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] ) - tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] ) - tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )" -DEPEND="${RDEPEND} - test? ( >=dev-lang/tcl-8.6:0[${MULTILIB_USEDEP}] )" - -full_archive() { - use tcl || use test || use tools -} - -pkg_setup() { - if full_archive; then - S="${WORKDIR}/${PN}-src-${SRC_PV}" - else - S="${WORKDIR}/${PN}-autoconf-${SRC_PV}" - fi -} - -src_prepare() { - if full_archive; then - eapply "${FILESDIR}/${PN}-3.27.0-full_archive-build.patch" - eapply "${FILESDIR}/${PN}-3.27.2-full_archive-tests.patch" - - eapply_user - - # Fix AC_CHECK_FUNCS. - # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html - sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed" - else - eapply "${FILESDIR}/${PN}-3.25.0-nonfull_archive-build.patch" - - eapply_user - - # Fix AC_CHECK_FUNCS. - # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html - sed \ - -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \ - -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \ - -i configure.ac || die "sed failed" - fi - - eautoreconf - - multilib_copy_sources -} - -multilib_src_configure() { - local CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" options=() - - options+=( - --enable-$(full_archive && echo load-extension || echo dynamic-extensions) - --enable-threadsafe - ) - if ! full_archive; then - options+=(--disable-static-shell) - fi - - # Support detection of misuse of SQLite API. - # https://sqlite.org/compile.html#enable_api_armor - append-cppflags -DSQLITE_ENABLE_API_ARMOR - - # Support column metadata functions. - # https://sqlite.org/c3ref/column_database_name.html - append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA - - # Support sqlite_dbpage virtual table. - # https://sqlite.org/compile.html#enable_dbpage_vtab - append-cppflags -DSQLITE_ENABLE_DBPAGE_VTAB - - # Support dbstat virtual table. - # https://sqlite.org/dbstat.html - append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB - - # Support sqlite3_serialize() and sqlite3_deserialize() functions. - # https://sqlite.org/compile.html#enable_deserialize - # https://sqlite.org/c3ref/serialize.html - # https://sqlite.org/c3ref/deserialize.html - append-cppflags -DSQLITE_ENABLE_DESERIALIZE - - # Support comments in output of EXPLAIN. - # https://sqlite.org/compile.html#enable_explain_comments - append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS - - # Support Full-Text Search versions 3, 4 and 5. - # https://sqlite.org/fts3.html - # https://sqlite.org/fts5.html - append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 - options+=(--enable-fts5) - - # Support hidden columns. - append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS - - # Support JSON1 extension. - # https://sqlite.org/json1.html - append-cppflags -DSQLITE_ENABLE_JSON1 - - # Support memsys5 memory allocator. - # https://sqlite.org/malloc.html#memsys5 - append-cppflags -DSQLITE_ENABLE_MEMSYS5 - - # Support sqlite3_normalized_sql() function. - # https://sqlite.org/c3ref/expanded_sql.html - append-cppflags -DSQLITE_ENABLE_NORMALIZE - - # Support sqlite_offset() function. - # https://sqlite.org/lang_corefunc.html#sqlite_offset - append-cppflags -DSQLITE_ENABLE_OFFSET_SQL_FUNC - - # Support pre-update hook functions. - # https://sqlite.org/c3ref/preupdate_count.html - append-cppflags -DSQLITE_ENABLE_PREUPDATE_HOOK - - # Support Resumable Bulk Update extension. - # https://sqlite.org/rbu.html - append-cppflags -DSQLITE_ENABLE_RBU - - # Support R*Trees. - # https://sqlite.org/rtree.html - # https://sqlite.org/geopoly.html - append-cppflags -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY - - # Support scan status functions. - # https://sqlite.org/c3ref/stmt_scanstatus.html - # https://sqlite.org/c3ref/stmt_scanstatus_reset.html - append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS - - # Support sqlite_stmt virtual table. - # https://sqlite.org/stmt.html - append-cppflags -DSQLITE_ENABLE_STMTVTAB - - # Support Session extension. - # https://sqlite.org/sessionintro.html - options+=(--enable-session) - - # Support unknown() function. - # https://sqlite.org/compile.html#enable_unknown_sql_function - append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION - - # Support unlock notification. - # https://sqlite.org/unlock_notify.html - append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY - - # Support LIMIT and ORDER BY clauses on DELETE and UPDATE statements. - # https://sqlite.org/compile.html#enable_update_delete_limit - append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT - - # Support PRAGMA function_list, PRAGMA module_list and PRAGMA pragma_list statements. - # https://sqlite.org/pragma.html#pragma_function_list - # https://sqlite.org/pragma.html#pragma_module_list - # https://sqlite.org/pragma.html#pragma_pragma_list - append-cppflags -DSQLITE_INTROSPECTION_PRAGMAS - - # Support soundex() function. - # https://sqlite.org/lang_corefunc.html#soundex - append-cppflags -DSQLITE_SOUNDEX - - # Support URI filenames. - # https://sqlite.org/uri.html - append-cppflags -DSQLITE_USE_URI - - # debug USE flag. - if full_archive; then - options+=($(use_enable debug)) - else - if use debug; then - append-cppflags -DSQLITE_DEBUG - else - append-cppflags -DNDEBUG - fi - fi - - # icu USE flag. - if use icu; then - # Support ICU extension. - # https://sqlite.org/compile.html#enable_icu - append-cppflags -DSQLITE_ENABLE_ICU - if full_archive; then - sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed" - else - sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed" - fi - fi - - # readline USE flag. - options+=( - --disable-editline - $(use_enable readline) - ) - if full_archive && use readline; then - options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline") - fi - - # secure-delete USE flag. - if use secure-delete; then - # Enable secure_delete pragma by default. - # https://sqlite.org/pragma.html#pragma_secure_delete - append-cppflags -DSQLITE_SECURE_DELETE - fi - - # static-libs USE flag. - options+=($(use_enable static-libs static)) - - # tcl, test, tools USE flags. - if full_archive; then - options+=(--enable-tcl) - fi - - if [[ "${CHOST}" == *-mint* ]]; then - append-cppflags -DSQLITE_OMIT_WAL - fi - - if [[ "${ABI}" == "x86" ]]; then - if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P -dM - < /dev/null 2> /dev/null | grep -q "^#define __SSE__ 1$"; then - append-cflags -mfpmath=sse - else - append-cflags -ffloat-store - fi - fi - - econf "${options[@]}" -} - -multilib_src_compile() { - emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" - - if use tools && multilib_is_native_abi; then - emake changeset dbdump dbhash dbtotxt index_usage rbu scrub showdb showjournal showshm showstat4 showwal sqldiff sqlite3_analyzer sqlite3_checker sqlite3_expert sqltclsh - fi -} - -multilib_src_test() { - if [[ "${EUID}" -eq 0 ]]; then - ewarn "Skipping tests due to root permissions" - return - fi - - local -x SQLITE_HISTORY="${T}/sqlite_history_${ABI}" - - emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test) -} - -multilib_src_install() { - emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install - - if use tools && multilib_is_native_abi; then - install_tool() { - if [[ -f ".libs/${1}" ]]; then - newbin ".libs/${1}" "${2}" - else - newbin "${1}" "${2}" - fi - } - - install_tool changeset sqlite3-changeset - install_tool dbdump sqlite3-db-dump - install_tool dbhash sqlite3-db-hash - install_tool dbtotxt sqlite3-db-to-txt - install_tool index_usage sqlite3-index-usage - install_tool rbu sqlite3-rbu - install_tool scrub sqlite3-scrub - install_tool showdb sqlite3-show-db - install_tool showjournal sqlite3-show-journal - install_tool showshm sqlite3-show-shm - install_tool showstat4 sqlite3-show-stat4 - install_tool showwal sqlite3-show-wal - install_tool sqldiff sqlite3-diff - install_tool sqlite3_analyzer sqlite3-analyzer - install_tool sqlite3_checker sqlite3-checker - install_tool sqlite3_expert sqlite3-expert - install_tool sqltclsh sqlite3-tclsh - - unset -f install_tool - fi -} - -multilib_src_install_all() { - find "${D}" -name "*.la" -delete || die - - doman sqlite3.1 - - if use doc; then - rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt} - ( - docinto html - dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"* - ) - fi -} diff --git a/dev-db/sqlite/sqlite-3.28.0.ebuild b/dev-db/sqlite/sqlite-3.28.0.ebuild index 588413694afe..5a3e05325439 100644 --- a/dev-db/sqlite/sqlite-3.28.0.ebuild +++ b/dev-db/sqlite/sqlite-3.28.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Arfrever Frehtes Taifersar Arahesis and others +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="7" diff --git a/dev-db/sqlite/sqlite-3.29.0.ebuild b/dev-db/sqlite/sqlite-3.29.0.ebuild new file mode 100644 index 000000000000..13490ccf5635 --- /dev/null +++ b/dev-db/sqlite/sqlite-3.29.0.ebuild @@ -0,0 +1,395 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit autotools flag-o-matic multilib-minimal toolchain-funcs + +if [[ "${PV}" != "9999" ]]; then + SRC_PV="$(printf "%u%02u%02u%02u" $(ver_rs 1- " "))" + DOC_PV="${SRC_PV}" + # DOC_PV="$(printf "%u%02u%02u00" $(ver_rs 1-3 " "))" +fi + +DESCRIPTION="SQL database engine" +HOMEPAGE="https://sqlite.org/" +if [[ "${PV}" == "9999" ]]; then + SRC_URI="" +else + SRC_URI="doc? ( https://sqlite.org/2019/${PN}-doc-${DOC_PV}.zip ) + tcl? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip ) + test? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip ) + tools? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip ) + !tcl? ( !test? ( !tools? ( https://sqlite.org/2019/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )" +fi + +LICENSE="public-domain" +SLOT="3" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="debug doc icu +readline secure-delete static-libs tcl test tools" +if [[ "${PV}" == "9999" ]]; then + PROPERTIES="live" +fi +RESTRICT="!test? ( test )" + +if [[ "${PV}" == "9999" ]]; then + BDEPEND=">=dev-lang/tcl-8.6:0 + dev-vcs/fossil" +else + BDEPEND="doc? ( app-arch/unzip ) + tcl? ( + app-arch/unzip + >=dev-lang/tcl-8.6:0 + ) + test? ( + app-arch/unzip + >=dev-lang/tcl-8.6:0 + ) + tools? ( + app-arch/unzip + >=dev-lang/tcl-8.6:0 + )" +fi +RDEPEND="sys-libs/zlib:0=[${MULTILIB_USEDEP}] + icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] ) + readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] ) + tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] ) + tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + test? ( >=dev-lang/tcl-8.6:0[${MULTILIB_USEDEP}] )" + +full_archive() { + [[ "${PV}" == "9999" ]] || use tcl || use test || use tools +} + +pkg_setup() { + if [[ "${PV}" == "9999" ]]; then + S="${WORKDIR}/${PN}" + else + if full_archive; then + S="${WORKDIR}/${PN}-src-${SRC_PV}" + else + S="${WORKDIR}/${PN}-autoconf-${SRC_PV}" + fi + fi +} + +src_unpack() { + if [[ "${PV}" == "9999" ]]; then + local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}" + addwrite "${distdir}" + mkdir -p "${distdir}/fossil-src/${PN}" || die + + mkdir "${WORKDIR}/${PN}" || die + pushd "${WORKDIR}/${PN}" > /dev/null || die + if [[ ! -f "${distdir}/fossil-src/${PN}/sqlite.fossil" ]]; then + einfo fossil clone --verbose https://sqlite.org/src sqlite.fossil + fossil clone --verbose https://sqlite.org/src sqlite.fossil || die + echo + else + cp -p "${distdir}/fossil-src/${PN}/sqlite.fossil" . || die + einfo fossil pull --repository sqlite.fossil --verbose https://sqlite.org/src + fossil pull --repository sqlite.fossil --verbose https://sqlite.org/src || die + echo + fi + cp -p sqlite.fossil "${distdir}/fossil-src/${PN}" || die + einfo fossil open --quiet sqlite.fossil + fossil open --quiet sqlite.fossil || die + echo + popd > /dev/null || die + + if use doc; then + mkdir "${WORKDIR}/${PN}-doc" || die + pushd "${WORKDIR}/${PN}-doc" > /dev/null || die + if [[ ! -f "${distdir}/fossil-src/${PN}/sqlite-doc.fossil" ]]; then + einfo fossil clone --verbose https://sqlite.org/docsrc sqlite-doc.fossil + fossil clone --verbose https://sqlite.org/docsrc sqlite-doc.fossil || die + echo + else + cp -p "${distdir}/fossil-src/${PN}/sqlite-doc.fossil" . || die + einfo fossil pull --repository sqlite-doc.fossil --verbose https://sqlite.org/docsrc + fossil pull --repository sqlite-doc.fossil --verbose https://sqlite.org/docsrc || die + echo + fi + cp -p sqlite-doc.fossil "${distdir}/fossil-src/${PN}" || die + einfo fossil open --quiet sqlite-doc.fossil + fossil open --quiet sqlite-doc.fossil || die + echo + popd > /dev/null || die + fi + else + default + fi +} + +src_prepare() { + if full_archive; then + eapply "${FILESDIR}/${PN}-3.29.0-full_archive-build.patch" + eapply "${FILESDIR}/${PN}-3.29.0-full_archive-tests.patch" + + eapply_user + + # Fix AC_CHECK_FUNCS. + # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html + sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed" + else + eapply "${FILESDIR}/${PN}-3.25.0-nonfull_archive-build.patch" + + eapply_user + + # Fix AC_CHECK_FUNCS. + # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html + sed \ + -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \ + -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \ + -i configure.ac || die "sed failed" + fi + + eautoreconf + + multilib_copy_sources +} + +multilib_src_configure() { + local -x CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" + local options=() + + options+=( + --enable-$(full_archive && echo load-extension || echo dynamic-extensions) + --enable-threadsafe + ) + if ! full_archive; then + options+=(--disable-static-shell) + fi + + # Support detection of misuse of SQLite API. + # https://sqlite.org/compile.html#enable_api_armor + append-cppflags -DSQLITE_ENABLE_API_ARMOR + + # Support column metadata functions. + # https://sqlite.org/c3ref/column_database_name.html + append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA + + # Support sqlite_dbpage virtual table. + # https://sqlite.org/compile.html#enable_dbpage_vtab + append-cppflags -DSQLITE_ENABLE_DBPAGE_VTAB + + # Support dbstat virtual table. + # https://sqlite.org/dbstat.html + append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB + + # Support sqlite3_serialize() and sqlite3_deserialize() functions. + # https://sqlite.org/compile.html#enable_deserialize + # https://sqlite.org/c3ref/serialize.html + # https://sqlite.org/c3ref/deserialize.html + append-cppflags -DSQLITE_ENABLE_DESERIALIZE + + # Support comments in output of EXPLAIN. + # https://sqlite.org/compile.html#enable_explain_comments + append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS + + # Support Full-Text Search versions 3, 4 and 5. + # https://sqlite.org/fts3.html + # https://sqlite.org/fts5.html + append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 + options+=(--enable-fts5) + + # Support hidden columns. + append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS + + # Support JSON1 extension. + # https://sqlite.org/json1.html + append-cppflags -DSQLITE_ENABLE_JSON1 + + # Support memsys5 memory allocator. + # https://sqlite.org/malloc.html#memsys5 + append-cppflags -DSQLITE_ENABLE_MEMSYS5 + + # Support sqlite3_normalized_sql() function. + # https://sqlite.org/c3ref/expanded_sql.html + append-cppflags -DSQLITE_ENABLE_NORMALIZE + + # Support sqlite_offset() function. + # https://sqlite.org/lang_corefunc.html#sqlite_offset + append-cppflags -DSQLITE_ENABLE_OFFSET_SQL_FUNC + + # Support pre-update hook functions. + # https://sqlite.org/c3ref/preupdate_count.html + append-cppflags -DSQLITE_ENABLE_PREUPDATE_HOOK + + # Support Resumable Bulk Update extension. + # https://sqlite.org/rbu.html + append-cppflags -DSQLITE_ENABLE_RBU + + # Support R*Trees. + # https://sqlite.org/rtree.html + # https://sqlite.org/geopoly.html + append-cppflags -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY + + # Support scan status functions. + # https://sqlite.org/c3ref/stmt_scanstatus.html + # https://sqlite.org/c3ref/stmt_scanstatus_reset.html + append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS + + # Support sqlite_stmt virtual table. + # https://sqlite.org/stmt.html + append-cppflags -DSQLITE_ENABLE_STMTVTAB + + # Support Session extension. + # https://sqlite.org/sessionintro.html + options+=(--enable-session) + + # Support unknown() function. + # https://sqlite.org/compile.html#enable_unknown_sql_function + append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION + + # Support unlock notification. + # https://sqlite.org/unlock_notify.html + append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY + + # Support LIMIT and ORDER BY clauses on DELETE and UPDATE statements. + # https://sqlite.org/compile.html#enable_update_delete_limit + append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT + + # Support PRAGMA function_list, PRAGMA module_list and PRAGMA pragma_list statements. + # https://sqlite.org/pragma.html#pragma_function_list + # https://sqlite.org/pragma.html#pragma_module_list + # https://sqlite.org/pragma.html#pragma_pragma_list + append-cppflags -DSQLITE_INTROSPECTION_PRAGMAS + + # Support soundex() function. + # https://sqlite.org/lang_corefunc.html#soundex + append-cppflags -DSQLITE_SOUNDEX + + # Support URI filenames. + # https://sqlite.org/uri.html + append-cppflags -DSQLITE_USE_URI + + # debug USE flag. + if full_archive; then + options+=($(use_enable debug)) + else + if use debug; then + append-cppflags -DSQLITE_DEBUG + else + append-cppflags -DNDEBUG + fi + fi + + # icu USE flag. + if use icu; then + # Support ICU extension. + # https://sqlite.org/compile.html#enable_icu + append-cppflags -DSQLITE_ENABLE_ICU + if full_archive; then + sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed" + else + sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed" + fi + fi + + # readline USE flag. + options+=( + --disable-editline + $(use_enable readline) + ) + if full_archive && use readline; then + options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline") + fi + + # secure-delete USE flag. + if use secure-delete; then + # Enable secure_delete pragma by default. + # https://sqlite.org/pragma.html#pragma_secure_delete + append-cppflags -DSQLITE_SECURE_DELETE + fi + + # static-libs USE flag. + options+=($(use_enable static-libs static)) + + # tcl, test, tools USE flags. + if full_archive; then + options+=(--enable-tcl) + fi + + if [[ "${CHOST}" == *-mint* ]]; then + append-cppflags -DSQLITE_OMIT_WAL + fi + + if [[ "${ABI}" == "x86" ]]; then + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P -dM - < /dev/null 2> /dev/null | grep -q "^#define __SSE__ 1$"; then + append-cflags -mfpmath=sse + else + append-cflags -ffloat-store + fi + fi + + econf "${options[@]}" +} + +multilib_src_compile() { + emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" + + if use tools && multilib_is_native_abi; then + emake changeset dbdump dbhash dbtotxt index_usage rbu scrub showdb showjournal showshm showstat4 showwal sqldiff sqlite3_analyzer sqlite3_checker sqlite3_expert sqltclsh + fi +} + +multilib_src_test() { + if [[ "${EUID}" -eq 0 ]]; then + ewarn "Skipping tests due to root permissions" + return + fi + + local -x SQLITE_HISTORY="${T}/sqlite_history_${ABI}" + + emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test) +} + +multilib_src_install() { + emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install + + if use tools && multilib_is_native_abi; then + install_tool() { + if [[ -f ".libs/${1}" ]]; then + newbin ".libs/${1}" "${2}" + else + newbin "${1}" "${2}" + fi + } + + install_tool changeset sqlite3-changeset + install_tool dbdump sqlite3-db-dump + install_tool dbhash sqlite3-db-hash + install_tool dbtotxt sqlite3-db-to-txt + install_tool index_usage sqlite3-index-usage + install_tool rbu sqlite3-rbu + install_tool scrub sqlite3-scrub + install_tool showdb sqlite3-show-db + install_tool showjournal sqlite3-show-journal + install_tool showshm sqlite3-show-shm + install_tool showstat4 sqlite3-show-stat4 + install_tool showwal sqlite3-show-wal + install_tool sqldiff sqlite3-diff + install_tool sqlite3_analyzer sqlite3-analyzer + install_tool sqlite3_checker sqlite3-checker + install_tool sqlite3_expert sqlite3-expert + install_tool sqltclsh sqlite3-tclsh + + unset -f install_tool + fi +} + +multilib_src_install_all() { + find "${D}" -name "*.la" -type f -delete || die + + doman sqlite3.1 + + if use doc; then + rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt} || die + ( + docinto html + dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"* + ) + fi +} -- cgit v1.2.3