From f625b9919a60a30f1bd860f7d1b2eac183ced593 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 8 Aug 2018 20:11:47 +0100 Subject: gentoo resync : 08.08.2018 --- dev-db/Manifest.gz | Bin 20649 -> 20646 bytes dev-db/couchdb/Manifest | 4 +- dev-db/couchdb/couchdb-1.7.2.ebuild | 2 +- dev-db/couchdb/metadata.xml | 4 +- dev-db/freetds/Manifest | 4 +- dev-db/freetds/freetds-1.00.341.ebuild | 44 +- dev-db/freetds/metadata.xml | 2 +- dev-db/mysql/Manifest | 13 +- dev-db/mysql/mysql-5.5.60-r1.ebuild | 791 ------------------- dev-db/mysql/mysql-5.5.61.ebuild | 791 +++++++++++++++++++ dev-db/mysql/mysql-5.6.40-r1.ebuild | 768 ------------------- dev-db/mysql/mysql-5.6.41.ebuild | 768 +++++++++++++++++++ dev-db/mysql/mysql-5.7.22.ebuild | 843 -------------------- dev-db/mysql/mysql-5.7.23.ebuild | 845 +++++++++++++++++++++ dev-db/percona-toolkit/Manifest | 2 + .../percona-toolkit/percona-toolkit-3.0.11.ebuild | 51 ++ dev-db/percona-xtrabackup-bin/Manifest | 9 +- .../percona-xtrabackup-bin-2.4.10.ebuild | 64 -- .../percona-xtrabackup-bin-2.4.12.ebuild | 64 ++ .../percona-xtrabackup-bin-2.4.9.ebuild | 61 -- 20 files changed, 2563 insertions(+), 2567 deletions(-) delete mode 100644 dev-db/mysql/mysql-5.5.60-r1.ebuild create mode 100644 dev-db/mysql/mysql-5.5.61.ebuild delete mode 100644 dev-db/mysql/mysql-5.6.40-r1.ebuild create mode 100644 dev-db/mysql/mysql-5.6.41.ebuild delete mode 100644 dev-db/mysql/mysql-5.7.22.ebuild create mode 100644 dev-db/mysql/mysql-5.7.23.ebuild create mode 100644 dev-db/percona-toolkit/percona-toolkit-3.0.11.ebuild delete mode 100644 dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.10.ebuild create mode 100644 dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.12.ebuild delete mode 100644 dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.9.ebuild (limited to 'dev-db') diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz index 7599545ce915..f3856dbfd703 100644 Binary files a/dev-db/Manifest.gz and b/dev-db/Manifest.gz differ diff --git a/dev-db/couchdb/Manifest b/dev-db/couchdb/Manifest index 0beff913cf0d..90a82af5fa2c 100644 --- a/dev-db/couchdb/Manifest +++ b/dev-db/couchdb/Manifest @@ -3,5 +3,5 @@ AUX couchdb.init-4 439 BLAKE2B 4b334d42238616a1bfef41f915e7e42038457b6e52b713af6 DIST apache-couchdb-1.7.1.tar.gz 9963069 BLAKE2B 69a3f835f6a7b5752e4707b02edfa726cfdb76813e36e570566641b999eea556ff788b0ca8ce1e66beb819119d90e387beab3bba8618e3b7a606870794307fef SHA512 cd7417ef4b1eaeb1fe4251b559d904238fd25881c542f1498e6e9f1c4a55a79e34e06e711f90ce39e5e65fcac8be9c611943b8ed57d4a7465859b5811ac0a21f DIST apache-couchdb-1.7.2.tar.gz 10009424 BLAKE2B 3d3b4922fe5b2c55e4851e48993442ba23369753fb17d5cafba936947624af0d3dac70e0a23d0c22c79e7e2776a3a441d5b1020a4a420b7d9a621fb59aad48d9 SHA512 507a35a7f1e826b1562eec86146cc6fcff3c65fa7762f9742e6e8fdacfca735473105772757624183778f7a532c742f6644b301677607bb81c1f3f0ceb742867 EBUILD couchdb-1.7.1.ebuild 1833 BLAKE2B 40ee843a46d254f64cf4b7de9927db335f2c928f8ceca249b8cdfc3e45dc5051a28da81a8bbd286f9a0e45ece27b0a21872067f59c5fff50ecf9792fec795b83 SHA512 48561428b5da0cf6afc118c782e9d627dc82208e7bc9825cdf186e51c746d0bca6040dac52586b56d42f4ecb01d08fb7b12c431641a23de47cd814a2648372f0 -EBUILD couchdb-1.7.2.ebuild 1834 BLAKE2B d1a4e1798cfa27f549d5e3703695bb1d1f91a54e583ce854454707d81b55a2ae7fc499e880a7e656fc96715be7ebbe899a2c6cddd87afaf57c3a20a21ee58dc8 SHA512 a98b412cb52af5fad53dc725f8bbd258d1d0a6a4653c86f6b509c73d70b7bd1e217f05ab1d003bc6812d6eabca7cb5e1a6f87984248b6065806e6a971e5c75ef -MISC metadata.xml 212 BLAKE2B 99a9c24bc730c412eb431bd6853c25ac91329aa9be6e6db58f56e4831aa66fd93d779c08f3569ec7c5b45940bc23d0cb90c508605d27e502d2b9a70ca436d7ba SHA512 e4f4b6dbbf6bf039ff5c19bb6a209ad4e0b1286f8cf7cc0cbafcc04fcf93fb92766c8cae06ff19f980a069c7fe9a1686437ab215f84ce10e301275ae107d00bd +EBUILD couchdb-1.7.2.ebuild 1833 BLAKE2B 7f7e685bf752daf2b0a968543956b8b3debf293e01441c9e812f9740407b6df6d324f75c146f0eec8be39dc423f37991cd4b69b68cf0a3e2c7688c93dd00799e SHA512 cb0ce76bdef08e39fa286486da0b0787ef9d5c0c894aa31eb750875de5f5562c19a4ecc8216c67c5c7cb87ccee6f9ce53bc33b3acdf8e41bcc9d8c1827616b1c +MISC metadata.xml 168 BLAKE2B 28995e217ebfd4a11f4738455bcd495fccb2214a7e4f48a820d2057a7d29a1d510707f94d15bff49abf69d68fdecd658381f34692181502eb587de9f2c7e0f9e SHA512 9f2101e330a89b03cbbc1814dcf7ad75f3dd4117abeeed5047cb695f81cd8f0719d3285b39acfb93f3ea1ba1b98911cc452b5d332d266b84a19791190ca123b6 diff --git a/dev-db/couchdb/couchdb-1.7.2.ebuild b/dev-db/couchdb/couchdb-1.7.2.ebuild index 8f033f12687b..85ea96ed35b8 100644 --- a/dev-db/couchdb/couchdb-1.7.2.ebuild +++ b/dev-db/couchdb/couchdb-1.7.2.ebuild @@ -11,7 +11,7 @@ SRC_URI="mirror://apache/couchdb/source/${PV}/apache-${P}.tar.gz" LICENSE="Apache-2.0" SLOT="0" -KEYWORDS="amd64 ~ppc x86" +KEYWORDS="amd64 ppc x86" IUSE="libressl selinux test" RDEPEND=">=dev-libs/icu-4.3.1:= diff --git a/dev-db/couchdb/metadata.xml b/dev-db/couchdb/metadata.xml index 37f6a3033902..cc08d6296c93 100644 --- a/dev-db/couchdb/metadata.xml +++ b/dev-db/couchdb/metadata.xml @@ -1,7 +1,5 @@ - - djc@gentoo.org - + diff --git a/dev-db/freetds/Manifest b/dev-db/freetds/Manifest index aad44179f26b..2e680aa13a11 100644 --- a/dev-db/freetds/Manifest +++ b/dev-db/freetds/Manifest @@ -2,8 +2,8 @@ AUX without-flags.patch 1859 BLAKE2B 846c177b9773c27b329a23f54592a2b789b0d8d123a DIST freetds-1.00.41.tar.gz 2904915 BLAKE2B d92789c9a08dc9f7f04e8efc828841c3cace0e5a3affd11d8751a785db70db79fedffb3745a681b960d30a11efbb4fa457805eb4f72444eecc20eb65d46e2d82 SHA512 dec3197a6478fc59b7386f9a7a562df8b581bba7184210c42f26827e957b9746e6820d687a9c6cbcd7c825fc5d4f556547c0483d06c786a064d5c4859db4daa1 DIST freetds-1.00.54.tar.gz 2907015 BLAKE2B 332888565c2890657ca6440e4bbe92e0324daf6c6e67f3fa2243bd2d5746e7e9aa100a7838d33cc8fa93e71e5d6a650976ce5164317f3147b192ceb915362534 SHA512 a2a5034705fe06ee38b085f980f6ddf086789abc9485331fdaf829e7243f7ba95a5f0c612d7e3ec9e10f28a5c8b3a3fd8e7853d66f67110bd860afce949c798c DIST freetds-dev.1.00.341.tar.gz 3002134 BLAKE2B c9396c1f205e13c9f3449bef19830cf3b6c2fa72539555ebd6bc1532c014472c862ba2ac7f495bee8f53d640d628c6b15bb50183585d43cf3dbbea4e314636d2 SHA512 fd691535dfa5c97463ff72056cfa5721557b71e41b6186ffcb08e193e51214cf966a33ee55b8e538a6f035aeeef14ac5b15fe8758f1afea9e1252a3b8951ba58 -EBUILD freetds-1.00.341.ebuild 1856 BLAKE2B 8cf069020ba0fa8a06b2b4af9e760a0cc46ce5a7fdd4a48ec5286f1550ceb316cfa096a0281e4e6f115d8f83a1535bfb51015b79eea7c86c202d6ab3758b8a42 SHA512 08a74242a8df775fc7360e7dac588713acce0abb1cdeee06219aeb051083622992fdaa94369fed37cefb1afac911af3d3b59f2cf35e8362e77f63ad0c43c5e32 +EBUILD freetds-1.00.341.ebuild 1891 BLAKE2B c033f9851e0cd02697976652d48fc50d40faf24282f7c337b9df6bb12c6a2d5443ff35c710d7460f3691f927256475c4cd60d0b4113da93e54e719d181a83a83 SHA512 ebcb93cd255f63f5f8d6fa67eb149853d6d21b392f8371cd2f696a69563a48eaabfbf4499f59569309c59ac44b463f66703454ff7e993073611f7922cedb31cc EBUILD freetds-1.00.41.ebuild 1988 BLAKE2B 58e5b9ecc1ec5196c3e4e50cfccefa6ca44510ba344b1d024f1280667e47d4351ce1946dea1f963cc3feb0a8a5382812e046173579fd961d522b3155ad422261 SHA512 a48ffe06b8303885d2e795d9cfe756979652460da4912de33dde0a06b635c3466f3abebfdad17ef7aa8cc35fb5f79eeca8457f18c2999108b13367eb2a8d7e02 EBUILD freetds-1.00.54-r1.ebuild 2064 BLAKE2B 6ec6575c86163e8678fbf841fbe8aa85e5fc7fd6e1839ff423dc542718e8ef88c2ef19e178bc7f76493e78b8e6edbbcfec87af85ebad2ca1153e07cdbb15e664 SHA512 48931c5f0e49cdd9f07e413339a0e647a4b48eec562cfe337a6c57243d11a99d47977d8987902a6ecafa3930a94a1102912c57359e146f155f6fcf6ee5753ce0 EBUILD freetds-9999.ebuild 1603 BLAKE2B 4a6149df3ad684b7246fed4f19c457f8a74c12a6ad89114d04890a86f9a41a02f7023c07dc55c139865091aed89a70accf993dc77bae4ffdc1f0bb3ff1698794 SHA512 264144b12f57bd34d1ace56458e4ea2cda0f4f5fd9f789373d8e7b4695cdf910562441359218b0c7c8bac446c8fa5673c56a37d0cfef444fc6d11fe57f2121b9 -MISC metadata.xml 166 BLAKE2B c254f1fb642881aba57637be14fb0a89b10384f91a128feaec3a8c870d76efc2cbacb92caccc0dee2dd19a5ac5eaf8643080dafa05c4e2ac96a68568927e5afd SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 +MISC metadata.xml 167 BLAKE2B e4dadf27fd344484f2bccb5b904909c89aac568c32e5b3c44bdf139eacefd4b4fae74419f503d2b7da0dccc1b68ba05d777d11292c0f89270d1ac5c9c703e8ca SHA512 7c8decb24ee3a850e38186cf3c7f8933a28017426806870ad6ef9ceb2533be147a2681fc789b535a81cb528af8c29d90d3006e4f250aee23bd7dea4561294e33 diff --git a/dev-db/freetds/freetds-1.00.341.ebuild b/dev-db/freetds/freetds-1.00.341.ebuild index f975c08fe565..77ec3228c82b 100644 --- a/dev-db/freetds/freetds-1.00.341.ebuild +++ b/dev-db/freetds/freetds-1.00.341.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 # This is from the "current" release series, because the "stable" series # is a little too stable for us (missing bug fixes, and so on). @@ -13,25 +13,23 @@ SRC_URI="ftp://ftp.freetds.org/pub/${PN}/current/${MY_PN}.${PV}.tar.gz" LICENSE="GPL-2" SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 - ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos" -IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos" +IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl static-libs" RESTRICT="test" # sed, grep, and awk are used by the build system and the osql script. COMMON_DEPEND="sys-apps/sed sys-apps/grep virtual/awk - gnutls? ( net-libs/gnutls ) + gnutls? ( net-libs/gnutls:= ) iconv? ( virtual/libiconv ) iodbc? ( dev-db/libiodbc ) kerberos? ( virtual/krb5 ) odbc? ( dev-db/unixODBC ) ssl? ( - !libressl? ( dev-libs/openssl:0 ) - libressl? ( dev-libs/libressl ) + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) )" - DEPEND="${COMMON_DEPEND}" # bind-tools is needed because the osql script calls "host". @@ -48,15 +46,23 @@ REQUIRED_USE="?? ( iodbc odbc )" S="${WORKDIR}/${MY_PN}.${PV}" src_configure() { - local myconf=( $(use_with iodbc) ) - myconf+=( $(use_with odbc unixodbc "${EPREFIX}/usr") ) - myconf+=( $(use_enable iconv libiconv) ) - myconf+=( $(use_with iconv libiconv-prefix "${EPREFIX}/usr") ) - myconf+=( $(use_enable kerberos krb5) ) - myconf+=( $(use_enable mssql msdblib) ) - myconf+=( $(use_with gnutls) ) - myconf+=( $(use_with ssl openssl "${EPREFIX}/usr") ) - myconf+=( --docdir="/usr/share/doc/${PF}" ) - - econf "${myconf[@]}" + econf \ + --enable-shared \ + $(use_enable iconv libiconv) \ + $(use_enable kerberos krb5) \ + $(use_enable mssql msdblib) \ + $(use_enable static-libs static) \ + $(use_with iodbc) \ + $(use_with odbc unixodbc "${EPREFIX}/usr") \ + $(use_with iconv libiconv-prefix "${EPREFIX}/usr") \ + $(use_with gnutls) \ + $(use_with ssl openssl "${EPREFIX}/usr") +} + +src_install() { + default + + if ! use static-libs; then + find "${D}" -name '*.la' -delete || die + fi } diff --git a/dev-db/freetds/metadata.xml b/dev-db/freetds/metadata.xml index 6f49eba8f496..7a38bb900964 100644 --- a/dev-db/freetds/metadata.xml +++ b/dev-db/freetds/metadata.xml @@ -1,5 +1,5 @@ - + diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest index 0b594103ffef..bccfeb18f525 100644 --- a/dev-db/mysql/Manifest +++ b/dev-db/mysql/Manifest @@ -5,19 +5,20 @@ AUX my.cnf-5.7 138 BLAKE2B 71862b4b77334ab74002237453d2c7f6b51cd1ae57dba3b00b19e AUX my.cnf.distro-client 631 BLAKE2B 9ba4edf4398410ef40bf7312a485edd70a807a9da37c69bb6f6bee2c58a722fef1b9f37d28f09f41912722451cc0e9913218d15be472a853a942119f019bf486 SHA512 f40539a56afe79b7c0dff14de46690fd67e8350755b27fbb490d914001c01836cdf9f851aa461bd8b60943ef2ca084b70e48d995f5c18bcc241309f3473c610c AUX my.cnf.distro-server 994 BLAKE2B 41dceff58edf748f9f60ac3c0d1682d2fc2f026fc1fd14b4c2dea398814beda3c09aabea04dd3a9e145464524c629e7e69dc257d1245e0a46dd8584b7f685172 SHA512 cf172edc23d3dda49c21af6b8adef8aa13694d8ceecddf1d612d4ae34d00ba53c51ae4ae7ca4d11083eeacb5d862f59a855a9d80e9e448ab8bbf17f42aac2650 DIST mysql-5.5.60.tar.gz 21025041 BLAKE2B c4010c64b30ca72aff011053189981cc0676806ed9f18a0ac584e07f71e1f7fe062a3ca78db6f109a2b96d324d778b239880f96852fdc058892b09d0d09e740b SHA512 734395f3ce2c12e7703fe48d5bb2ce85ff8d7f04ae51cbe2d04a46b72b9689f804e5b498ae0b4722b0c098e2eed43d4f93b622964059525e6d9d14a47d55f775 +DIST mysql-5.5.61.tar.gz 21027098 BLAKE2B b7589f632a211349fc34cec94e333b878e07113969bf5cf6f78cd37435d95b15c03eaf188ed09768033b182de125c9f018a5fe902094f17ab891f94cab9de6dd SHA512 978384915c145ec8f0d85deb764154d8d4a9764f2d342928bda6ad43a00bc110aa888895416d2ba5684a4432e433037990dd3fe8c5caf024faa487bc2e153f49 DIST mysql-5.6.38.tar.gz 32197625 BLAKE2B 5edd6d05e562568d2418edd81c6822b397103013e92beacc00964401c6df67f8a934f05b57c6679aa25a49ef6db2e4a06056f3f1850e0f2afe4de895c7b8f686 SHA512 8144aec822f053fbdfa11ae542e96d3e7da93552b60ed131f041ec4832f48c95025b322340a2e90a82c18b6ee6bfd708f209735f82e37532198245aad697b93d DIST mysql-5.6.39.tar.gz 32110958 BLAKE2B 2f279c6745bc995c860bb4f2868409136e112cc8b9fb0c04fa7673bb6d5612f3ef6d3462666de736d6e7fe5439275ab49908a6609175d1cb8c096d5db5ecb59c SHA512 e1e60854c82d71f9600bf611df964f441815d9d0f896134110a749b29fe340fa216d7c89f4da63d492929565f19a2502463549b8c8c038c658e0be8409a3ffb5 DIST mysql-5.6.40.tar.gz 32083035 BLAKE2B efcc078341bae239df28ac0504111aa34926885ae47edb5011352b56552a5a3abd1f824f8cbdc23d8d667592b8f5510946ef18c3efa61865dbbc7f4bb8a2d4a0 SHA512 c8e458b4cd34cae87f1b088ed2188bd00de8cdc42709d5964e82fa2e4aaecfc12a75ae006c54ffa0d3d286fbdef9704d0cbb83436437d5705fb8921d960e758c -DIST mysql-boost-5.7.22.tar.gz 48985783 BLAKE2B 208d684e038366824de4bfbe87b6761f91d05fc5cd46cfa89eb627025fb726efe2d7a08a8ce252fed369e399d2d4921bb93c446a296b617320c53ce351fc17c2 SHA512 186c9e9735114e312c65531c70e6b0b9b48b0fe14384b7a6ebfac2c1f91c3f4ac223d06e27a424fc75f57e0aaf2f74d6a8411a8ab9c6fed45c499068d0f1dc2a +DIST mysql-5.6.41.tar.gz 32111985 BLAKE2B 5ccad59333525b354db4fa892857e237cddf8fe1a4d289c6e410c31d6142a71d3ce4dab8d954fa9932ec1f83b50e8eccd5845e082deaaa56f1c0c5e21b2ce6c0 SHA512 a62d7a68c6bb49de33f8c9e634bce53cb453a87238e92967115e8e928fa9ed291727b8bd5a5271a0b5b634d957eb310c745edfb14b6be1deb9099bb757aa2cff +DIST mysql-boost-5.7.23.tar.gz 49025014 BLAKE2B 669f10779bc2cda866d6bd876b4efe55fb4b0c796f596f66513a3ca85f322e2a03e9879eecd72a69729a0cb71d408c46cdd9086ae456712b4adff6ae7c584c97 SHA512 e4317f89d108a68652cd95e41ffd670c37b6663aabd6af3985d18052fb7e8d8879b5822399caf9091cecc0a949ec588c121c87cfd60d69941f68d0ecbedd0953 DIST mysql-extras-20171121-1518Z.tar.bz2 313539 BLAKE2B c397fdf7ffb3fcbcecda20933e18234062a9500dcf4031e9b17131e2a1f23dca7535ed33ff541fc075eb9995c67a9a8fd7261d7524dd42d8d333543c368b4c15 SHA512 dd0d4a00c0ed710e786d157a73f02c6f555ab7a68e57014d958627096a4245a0b45d22ec860dc5389002d106554e80166661c0b6ddcadff1f737e3fa195badda DIST mysql-extras-20180214-0024Z.tar.bz2 316686 BLAKE2B a893e2975a8062ab236f642d158a7833656942adb31d467b784a9224e7dd87872c3784bb29e93b620a58cd9a835d65248f1a817cdbafa574b5949e2b4262108a SHA512 ad0e81695a70954ad107fe104f9140be24e53d499aed6c123e68e1a062ec5cc90c70f6272fdc014e567794e331301e656ba01b22c2c7a1afaf11e14a9190fb0b -DIST mysql-extras-20180312-2011Z.tar.bz2 319047 BLAKE2B 1da22a0c763a85a6350122c0c56aef4999279c1ef7cf99bcec28348acc83964eb257bb4340c1a21bdcd3b1eb024b23fa62879bed8679c410d847324cb7e24b82 SHA512 b0aa9fc8fbc050451ef147cee99b00cf10d34a71641837821e78655241f7d79a94fe2efb4cef9a23fe9741e08ada2fc0b58ef3b3663752bc567babfbcaa547c8 -DIST mysql-extras-20180628-0201Z.tar.bz2 322141 BLAKE2B fce35cfea4ffa9860908fcdf440cd0d714c402c42ee2afb22cec9e727971c216310c7db561ca1b37deebb2cea5137fe24f19b491ad500949e3170ccec3de0b13 SHA512 71a3800ec091b41e41d25536199149eb714c0bbfc0f6fc478e8e4dcaf4cf87a7e4d49c513da3c9badc0de810d7d78c05ad91dd898e45005b42136346237de42a -EBUILD mysql-5.5.60-r1.ebuild 25523 BLAKE2B 7d6f2e438d58e91a7f4f3f01df3e2b8ac98b82c8e38ab1b97ef259ca5d1d19c804e2a79cf2d270dfd1e7d51b83546f65a8a06cd5cfd19c575dc94c6c60e18c76 SHA512 8ecb7f79481736dc30d65d237485b1afaa5e29804efe3b53e6ba3bfe2dcf02ecc94ce8154ca1ff7b57c2de345ec0b463c2fc929b8ef37beab465e8e77a0e1516 +DIST mysql-extras-20180804-2323Z.tar.bz2 322215 BLAKE2B cca9e502e375bf43473335868517f6c450fc7bcf03e55de5a294c8bdcfcac2bb783dec09bbb3b6c30a561ba7e3a943543c017e2d42b61d466e699acdef4c0231 SHA512 efd9d416f394cc61b977ab76f05ab3acc5803ff8bdee8e1dbc65cc5b3f07e4f9742140d9586c028908b10fcc44f21c98ebffdebcc5c3578acbe05b07526bcb3d EBUILD mysql-5.5.60.ebuild 4381 BLAKE2B c48db634322354aeb487df4df4eff2a27b2e69d9aa5785f349c45f8e947a7e3572e86f013d71e0063b69731fda9155811928336f270d0fee3230caf6eeeae6ed SHA512 f3e4946ede777c0bc39ae415f3f30bb33be145f15f452829683fcbd2e191cd65d6d0f3c6d372651468bb25ea7bfab3f5c8dbadcf4021ca3f0cebf1590eed6ce9 +EBUILD mysql-5.5.61.ebuild 25516 BLAKE2B 3363fc9f99fb6a3085a7de3cf540ddd853365b5865a418c752255417040ca568fa16a02e0b74cd98502eeadda4d11e7bd37269d1416232db279eedee15630320 SHA512 ccfbdef198de75215efb498a76525e03f469a5c596b9fe366f9e1973969f928263be1628b378369d76899eea6d7750c45ce07827d11b0f277b2aee2242540645 EBUILD mysql-5.6.38.ebuild 6466 BLAKE2B c85ee0bd78a7b75a328a72120444277c9425886e06dc9134662669c73af4d1da45c6d49943f44fbe518379d0babd0590a3ae127f7552862aeb6eacbc18e6cd1c SHA512 e4272584a5de91df2b5f4fee2060e3ca3b5151472bc5e9d472004fdc213f0fc9527874958995bb039847f7f5da97047fc3e9b12f61cecdf03b9d3f65d707be78 EBUILD mysql-5.6.39.ebuild 6520 BLAKE2B d21e873fb57b7b311e7c06d680963794f1b7eb63c118a90aba8d4d036b0449c109e7c50c58a7616bf0b6545225f505fa5a6bcbcb3c0b095ba7c09dc3d296cc63 SHA512 e3c0b406a9c738d0474428c3007888d70832cd61c5a1d1bfad9ff9842f54c67f9494ca81e9647621b68a7e8ccb40af2ecc7fec4118538e569aeb58fe797c54e5 -EBUILD mysql-5.6.40-r1.ebuild 25132 BLAKE2B 294e3d6f059684e5e83948652dfd9afc93b9c4deb9ea087bf0a3560c3920b4cf56a9d30a1ebe36e71d6e899d42590280f8dc876a71f2ef74079271e2915e9c43 SHA512 83975be32ff344515d81d405be5cbc3b29942e8e78eea1f5c3eaa9b5d9035b095843cdea6f81cf225caf2c905670948cda54924b1597beeaadc25891e294784a EBUILD mysql-5.6.40.ebuild 6522 BLAKE2B 827d56358a9ce44501ca273f8d8029e66f93c07bf1668ca3e35cba65e226f8ca5cd95652e14c7cd27e5ea447897a3848f5faae6c5106349dd9a9ec60345a0999 SHA512 f5b76ad45fe1ff384126c4ca034fcace50e116d2748e242102a14f335b937187abaaea7d86e9ffcfd3c9bd74a06fed97a1c634704aabc7c62641804c0f5f7dad -EBUILD mysql-5.7.22.ebuild 26968 BLAKE2B 12c16254b4173f661462e5b65a84966e60816d40294defaa3cf8d2dd21b1d2cc3d5210230527bbbe4f3e40ed38c99704e059d810001eaa008811b23ee6bd0e76 SHA512 4d10eb23cd398739dac2234ba33cf4009b8ca01acf3b0549bd8e48f427b702102c9a01b7c5e3f699ca7faa1e068d600bcd0a3d8e758f02bc98f617d3f51e9e4a +EBUILD mysql-5.6.41.ebuild 25132 BLAKE2B c4a4eda7d5d55f30caf4f500c5e67ddc4b3b129fbdd71e10a9cbec07f1da04d931e35caf5ba0ab6cdc08d6da9f86ec575a100538c945d73069ba89f819272501 SHA512 531fbecde63be61078dd7be79b3a11abb11ff8e266dd3ef093775e5c2f66b5f2305735242939f53d047be1494c630f4cfb14fdea2f0c0451f67c33fd5bd13352 +EBUILD mysql-5.7.23.ebuild 27020 BLAKE2B b430c1582c802202d25a13049fccbbfa761d729b868ac7a22930f685c40d8e6a122a7a4c8bf8b830b17328592cb353cc33a4b32094675dac95aa957e6332652d SHA512 f1284dc26df2fee22d8f3dcdcbe3a0c34da350849fa99fcd30e661310eb51dc09ad18cdf2b65d2527d91a9bc37f96f6553b9c3994f8110b4f134bd8656711430 MISC metadata.xml 1916 BLAKE2B da2c681ac07c234aa7ecc6f52a1ed63bf49241f7cb270733d0acf523ae5c420bb8f91628bf8510f9365b137ddd63224fd9da6a00df976832947ce043da49a602 SHA512 eac8cb1f76264b46137794c7c47907579af51ac9184aba324f3951135f60dc58c642efdd0a7a3e5c438322f8de4066425ec306d0924472853413be2fd19cbaf9 diff --git a/dev-db/mysql/mysql-5.5.60-r1.ebuild b/dev-db/mysql/mysql-5.5.60-r1.ebuild deleted file mode 100644 index 36a1e5f70c45..000000000000 --- a/dev-db/mysql/mysql-5.5.60-r1.ebuild +++ /dev/null @@ -1,791 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20180628-0201Z" -SUBSLOT="18" - -# Keeping eutils in EAPI=6 for emktemp in pkg_config - -inherit eutils flag-o-matic prefix toolchain-funcs user cmake-utils multilib-build - -SRC_URI="https://cdn.mysql.com/Downloads/MySQL-5.5/${P}.tar.gz - https://downloads.mysql.com/archives/MySQL-5.5/${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://mysql.com/" -DESCRIPTION="An enhanced, drop-in replacement for MySQL" -LICENSE="GPL-2" -SLOT="0/${SUBSLOT:-0}" -IUSE="bindist client-libs debug extraengine jemalloc latin1 libressl - +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="!bindist? ( bindist ) libressl? ( test )" - -REQUIRED_USE="?? ( tcmalloc jemalloc ) - static? ( yassl )" - -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" - -# Shorten the path because the socket path length must be shorter than 107 chars -# and we will run a mysql server during test phase -S="${WORKDIR}/mysql" - -if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then - MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" - inherit git-r3 - EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git" - EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" - EGIT_CLONE_TYPE=shallow -else - MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" -fi - -PATCHES=( - "${MY_PATCH_DIR}/01050_all_mysql_config_cleanup-5.5.patch" - "${MY_PATCH_DIR}/02040_all_embedded-library-shared-5.5.10.patch" - "${MY_PATCH_DIR}/20001_all_fix-minimal-build-cmake-mysql-5.5.41.patch" - "${MY_PATCH_DIR}/20002_all_mysql-va-list.patch" - "${MY_PATCH_DIR}/20006_all_cmake_elib-mysql-5.5.53.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.5.38.patch" - "${MY_PATCH_DIR}/20018_all_mysql-5.5.60-without-clientlibs-tools.patch" - "${MY_PATCH_DIR}/20027_all_mysql-5.5-perl5.26-includes.patch" - "${MY_PATCH_DIR}/20030_all_mysql-5.5-fix-client-mysql-type.patch" -) - -# Be warned, *DEPEND are version-dependant -# These are used for both runtime and compiletime -COMMON_DEPEND=" - kernel_linux? ( - sys-process/procps:0= - dev-libs/libaio:0= - ) - >=sys-apps/sed-4 - >=sys-apps/texinfo-4.7-r1 - jemalloc? ( dev-libs/jemalloc:0= ) - tcmalloc? ( dev-util/google-perftools:0= ) - systemtap? ( >=dev-util/systemtap-1.3:0= ) - !yassl? ( - !libressl? ( dev-libs/openssl:0= !>=dev-libs/openssl-1.1 ) - libressl? ( dev-libs/libressl:0= ) - ) - >=sys-libs/zlib-1.2.3:0= - sys-libs/ncurses:0= - !bindist? ( - >=sys-libs/readline-4.1:0= - ) - !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) -" -DEPEND="virtual/yacc - static? ( sys-libs/ncurses[static-libs] ) - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) - ${COMMON_DEPEND}" -RDEPEND="selinux? ( sec-policy/selinux-mysql ) - client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) - !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster - server? ( !prefix? ( dev-db/mysql-init-scripts ) ) - ${COMMON_DEPEND} - perl? ( !dev-db/mytop - virtual/perl-Getopt-Long - dev-perl/TermReadKey - virtual/perl-Term-ANSIColor - virtual/perl-Time-HiRes ) -" -# For other stuff to bring us in -# dev-perl/DBD-mysql is needed by some scripts installed by MySQL -PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" - -pkg_setup() { - if [[ ${MERGE_TYPE} != binary ]] ; then - local GCC_MAJOR_SET=$(gcc-major-version) - local GCC_MINOR_SET=$(gcc-minor-version) - # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on - # non x86{,_64} arches - if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ - ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then - eerror "${PN} needs to be built with gcc-4.7 or later." - eerror "Please use gcc-config to switch to gcc-4.7 or later version." - die - fi - fi - if has test ${FEATURES} && \ - use server && ! has userpriv ${FEATURES} ; then - eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." - fi - - # This should come after all of the die statements - enewgroup mysql 60 || die "problem adding 'mysql' group" - enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" -} - -pkg_postinst() { - # Make sure the vars are correctly initialized - mysql_init_vars - - # Create log directory securely if it does not exist - [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" - - if use server ; then - if [[ -z "${REPLACING_VERSIONS}" ]] ; then - einfo - elog "You might want to run:" - elog "\"emerge --config =${CATEGORY}/${PF}\"" - elog "if this is a new install." - elog - elog "If you are switching server implentations, you should run the" - elog "mysql_upgrade tool." - einfo - else - einfo - elog "If you are upgrading major versions, you should run the" - elog "mysql_upgrade tool." - einfo - fi - - einfo - elog "Be sure to edit the my.cnf file to activate your cluster settings." - elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" - elog "The first time the cluster is activated, you should add" - elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." - elog "This option should then be removed for subsequent starts." - einfo - fi -} - -src_unpack() { - unpack ${A} - # Grab the patches - [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack - - mv -f "${WORKDIR%/}/${P}" "${S}" || die -} - -src_prepare() { - _disable_engine() { - echo > "${S%/}/storage/${1}/CMakeLists.txt" || die - } - - _disable_plugin() { - echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die - } - - if use tcmalloc; then - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die - fi - - if use jemalloc; then - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${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 - - 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 - - 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" - -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/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) - -DWITH_ZLIB=system - -DENABLED_LOCAL_INFILE=1 - -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" - # The build forces this to be defined when cross-compiling. We pass it - # all the time for simplicity and to make sure it is actually correct. - -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) - -DWITHOUT_CLIENTLIBS=YES - -DWITH_READLINE=$(usex bindist 1 0) - -DENABLE_DTRACE=$(usex systemtap) - ) - if use test ; then - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) - else - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) - fi - - if ! use yassl ; then - mycmakeargs+=( -DWITH_SSL=system ) - else - mycmakeargs+=( -DWITH_SSL=bundled ) - fi - - if use server ; then - - # Federated{,X} must be treated special otherwise they will not be built as plugins - if ! use extraengine ; then - mycmakeargs+=( - -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 - -DWITHOUT_FEDERATEDX_STORAGE_ENGINE=1 ) - fi - - 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+=( - -DINSTALL_SQLBENCHDIR=share/mysql - -DEXTRA_CHARSETS=all - -DDISABLE_SHARED=$(usex static YES NO) - -DWITH_EMBEDDED_SERVER=OFF - -DENABLED_PROFILING=$(usex profiling) - ) - - if use static; then - mycmakeargs+=( -DWITH_PIC=1 ) - fi - - # Storage engines - mycmakeargs+=( - -DWITH_ARCHIVE_STORAGE_ENGINE=1 - -DWITH_BLACKHOLE_STORAGE_ENGINE=1 - -DWITH_CSV_STORAGE_ENGINE=1 - -DWITH_HEAP_STORAGE_ENGINE=1 - -DWITH_INNOBASE_STORAGE_ENGINE=1 - -DWITH_MYISAMMRG_STORAGE_ENGINE=1 - -DWITH_MYISAM_STORAGE_ENGINE=1 - -DWITH_PARTITION_STORAGE_ENGINE=1 - ) - - else - mycmakeargs+=( - -DWITHOUT_SERVER=1 - -DEXTRA_CHARSETS=none - -DINSTALL_SQLBENCHDIR= - ) - fi - - cmake-utils_src_configure -} - -src_compile() { - cmake-utils_src_compile -} - -src_install() { - cmake-utils_src_install - - # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used - if [[ -f "${ED%/}/usr/include/mysql/server/private/config.h" ]] ; then - rm "${ED%/}/usr/include/mysql/server/private/config.h" || die - fi - - # Make sure the vars are correctly initialized - mysql_init_vars - - # Convenience links - einfo "Making Convenience links for mysqlcheck multi-call binary" - dosym "mysqlcheck" "/usr/bin/mysqlanalyze" - dosym "mysqlcheck" "/usr/bin/mysqlrepair" - dosym "mysqlcheck" "/usr/bin/mysqloptimize" - - # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir - if [[ -d "${ED%/}/usr/data" ]] ; then - rm -Rf "${ED%/}/usr/data" || die - fi - - # Unless they explicitly specific USE=test, then do not install the - # testsuite. It DOES have a use to be installed, esp. when you want to do a - # validation of your database configuration after tuning it. - if ! use test ; then - rm -rf "${D%/}/${MY_SHAREDSTATEDIR}/mysql-test" - fi - - # Configuration stuff - einfo "Building default configuration ..." - insinto "${MY_SYSCONFDIR#${EPREFIX}}" - [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf - local mycnf_src="my.cnf-5.5" - sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ - "${FILESDIR%/}/${mycnf_src}" \ - > "${TMPDIR%/}/my.cnf.ok" || die - use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok" - if use latin1 ; then - sed -i \ - -e "/character-set/s|utf8|latin1|g" \ - "${TMPDIR%/}/my.cnf.ok" || die - fi - eprefixify "${TMPDIR%/}/my.cnf.ok" - newins "${TMPDIR}/my.cnf.ok" my.cnf - - if use server ; then - einfo "Including support files and sample configurations" - docinto "support-files" - local script - for script in \ - "${S%/}"/support-files/magic - do - [[ -f "$script" ]] && dodoc "${script}" - done - - docinto "scripts" - for script in "${S%/}"/scripts/mysql* ; do - [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" - done - 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 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.5 for now and are believed to be - # false positives: - # - # main.mysql_client_test, main.mysql_client_test_nonblock - # main.mysql_client_test_comp: - # segfaults at random under Portage only, suspect resource limits. - - local t - for t in main.mysql_client_test main.mysql_client_test_nonblock \ - main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam \ - main.mysqlhotcopy_archive main.mysqlhotcopy_myisam main.openssl_1 \ - rpl.rpl_semi_sync_uninstall_plugin ; do - _disable_test "$t" "False positives in Gentoo" - done - - if ! use client-libs ; then - _disable_test main.plugin_auth "Needs client libraries built" - fi - - # run mysql-test tests - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" - retstatus_tests=$? - - popd > /dev/null || die - - # Cleanup is important for these testcases. - pkill -9 -f "${S}/ndb" 2>/dev/null - pkill -9 -f "${S}/sql" 2>/dev/null - - local failures="" - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" - - [[ -z "$failures" ]] || die "Test failures: $failures" - einfo "Tests successfully completed" -} - -mysql_init_vars() { - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/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 "${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 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 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 - # 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 - - local cmd=( "${EROOT}usr/share/mysql/scripts/mysql_install_db" ) - [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) - cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) - einfo "Command: ${cmd[*]}" - su -s /bin/sh -c "${cmd[*]}" mysql \ - >"${TMPDIR}"/mysql_install_db.log 2>&1 - if [ $? -ne 0 ]; then - grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 - die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" - fi - popd &>/dev/null || die - [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ - || die "MySQL databases not installed" - - use prefix || options="${options} --user=mysql" - - local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" - local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" - local mysqld="${EROOT}/usr/sbin/mysqld \ - ${options} \ - --log-warnings=0 \ - --basedir=${EROOT}/usr \ - --datadir=${ROOT}/${MY_DATADIR} \ - --max_allowed_packet=8M \ - --net_buffer_length=16K \ - --socket=${socket} \ - --pid-file=${pidfile} - --tmpdir=${ROOT}/${MYSQL_TMPDIR}" - #einfo "About to start mysqld: ${mysqld}" - ebegin "Starting mysqld" - einfo "Command ${mysqld}" - ${mysqld} & - rc=$? - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do - maxtry=$((${maxtry}-1)) - echo -n "." - sleep 1 - done - eend $rc - - if ! [[ -S "${socket}" ]]; then - die "Completely failed to start up mysqld with: ${mysqld}" - fi - - ebegin "Setting root password" - # Do this from memory, as we don't want clear text passwords in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -e "${sql}" - eend $? - - if [[ -n "${sqltmp}" ]] ; then - ebegin "Loading \"zoneinfo\", this step may require a few seconds" - "${EROOT}/usr/bin/mysql" \ - "--socket=${socket}" \ - -hlocalhost \ - -uroot \ - --password="${MYSQL_ROOT_PASSWORD}" \ - mysql < "${sqltmp}" - rc=$? - eend $? - [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" - fi - - # Stop the server and cleanup - einfo "Stopping the server ..." - kill $(< "${pidfile}" ) - rm -f "${sqltmp}" - wait %1 - einfo "Done" -} diff --git a/dev-db/mysql/mysql-5.5.61.ebuild b/dev-db/mysql/mysql-5.5.61.ebuild new file mode 100644 index 000000000000..b2c26da97b4f --- /dev/null +++ b/dev-db/mysql/mysql-5.5.61.ebuild @@ -0,0 +1,791 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +MY_EXTRAS_VER="20180804-2323Z" +SUBSLOT="18" + +# Keeping eutils in EAPI=6 for emktemp in pkg_config + +inherit eutils flag-o-matic prefix toolchain-funcs user cmake-utils multilib-build + +SRC_URI="https://cdn.mysql.com/Downloads/MySQL-5.5/${P}.tar.gz + https://downloads.mysql.com/archives/MySQL-5.5/${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://mysql.com/" +DESCRIPTION="An enhanced, drop-in replacement for MySQL" +LICENSE="GPL-2" +SLOT="0/${SUBSLOT:-0}" +IUSE="bindist client-libs debug extraengine jemalloc latin1 libressl + +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="!bindist? ( bindist ) libressl? ( test )" + +REQUIRED_USE="?? ( tcmalloc jemalloc ) + static? ( yassl )" + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" + +# Shorten the path because the socket path length must be shorter than 107 chars +# and we will run a mysql server during test phase +S="${WORKDIR}/mysql" + +if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then + MY_PATCH_DIR="${WORKDIR%/}/mysql-extras" + inherit git-r3 + EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git" + EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras" + EGIT_CLONE_TYPE=shallow +else + MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}" +fi + +PATCHES=( + "${MY_PATCH_DIR}/01050_all_mysql_config_cleanup-5.5.patch" + "${MY_PATCH_DIR}/02040_all_embedded-library-shared-5.5.10.patch" + "${MY_PATCH_DIR}/20001_all_fix-minimal-build-cmake-mysql-5.5.41.patch" + "${MY_PATCH_DIR}/20002_all_mysql-va-list.patch" + "${MY_PATCH_DIR}/20006_all_cmake_elib-mysql-5.5.53.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.5.38.patch" + "${MY_PATCH_DIR}/20018_all_mysql-5.5.60-without-clientlibs-tools.patch" + "${MY_PATCH_DIR}/20027_all_mysql-5.5-perl5.26-includes.patch" + "${MY_PATCH_DIR}/20030_all_mysql-5.5-fix-client-mysql-type.patch" +) + +# Be warned, *DEPEND are version-dependant +# These are used for both runtime and compiletime +COMMON_DEPEND=" + kernel_linux? ( + sys-process/procps:0= + dev-libs/libaio:0= + ) + >=sys-apps/sed-4 + >=sys-apps/texinfo-4.7-r1 + jemalloc? ( dev-libs/jemalloc:0= ) + tcmalloc? ( dev-util/google-perftools:0= ) + systemtap? ( >=dev-util/systemtap-1.3:0= ) + !yassl? ( + !libressl? ( dev-libs/openssl:0= !>=dev-libs/openssl-1.1 ) + libressl? ( dev-libs/libressl:0= ) + ) + >=sys-libs/zlib-1.2.3:0= + sys-libs/ncurses:0= + !bindist? ( + >=sys-libs/readline-4.1:0= + ) + !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) +" +DEPEND="virtual/yacc + static? ( sys-libs/ncurses[static-libs] ) + || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) + ${COMMON_DEPEND}" +RDEPEND="selinux? ( sec-policy/selinux-mysql ) + client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) + !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster + server? ( !prefix? ( dev-db/mysql-init-scripts ) ) + ${COMMON_DEPEND} + perl? ( !dev-db/mytop + virtual/perl-Getopt-Long + dev-perl/TermReadKey + virtual/perl-Term-ANSIColor + virtual/perl-Time-HiRes ) +" +# For other stuff to bring us in +# dev-perl/DBD-mysql is needed by some scripts installed by MySQL +PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]] ; then + local GCC_MAJOR_SET=$(gcc-major-version) + local GCC_MINOR_SET=$(gcc-minor-version) + # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on + # non x86{,_64} arches + if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \ + ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then + eerror "${PN} needs to be built with gcc-4.7 or later." + eerror "Please use gcc-config to switch to gcc-4.7 or later version." + die + fi + fi + if has test ${FEATURES} && \ + use server && ! has userpriv ${FEATURES} ; then + eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." + fi + + # This should come after all of the die statements + enewgroup mysql 60 || die "problem adding 'mysql' group" + enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" +} + +pkg_postinst() { + # Make sure the vars are correctly initialized + mysql_init_vars + + # Create log directory securely if it does not exist + [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" + + if use server ; then + if [[ -z "${REPLACING_VERSIONS}" ]] ; then + einfo + elog "You might want to run:" + elog "\"emerge --config =${CATEGORY}/${PF}\"" + elog "if this is a new install." + elog + elog "If you are switching server implentations, you should run the" + elog "mysql_upgrade tool." + einfo + else + einfo + elog "If you are upgrading major versions, you should run the" + elog "mysql_upgrade tool." + einfo + fi + + einfo + elog "Be sure to edit the my.cnf file to activate your cluster settings." + elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" + elog "The first time the cluster is activated, you should add" + elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node." + elog "This option should then be removed for subsequent starts." + einfo + fi +} + +src_unpack() { + unpack ${A} + # Grab the patches + [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR%/}/mysql-extras" git-r3_src_unpack + + mv -f "${WORKDIR%/}/${P}" "${S}" || die +} + +src_prepare() { + _disable_engine() { + echo > "${S%/}/storage/${1}/CMakeLists.txt" || die + } + + _disable_plugin() { + echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die + } + + if use tcmalloc; then + echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S%/}/sql/CMakeLists.txt" || die + fi + + if use jemalloc; then + echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${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 + + 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 + + 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" + -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/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) + -DWITH_ZLIB=system + -DENABLED_LOCAL_INFILE=1 + -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock" + # The build forces this to be defined when cross-compiling. We pass it + # all the time for simplicity and to make sure it is actually correct. + -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) + -DWITHOUT_CLIENTLIBS=YES + -DWITH_READLINE=$(usex bindist 1 0) + -DENABLE_DTRACE=$(usex systemtap) + ) + if use test ; then + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) + else + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) + fi + + if ! use yassl ; then + mycmakeargs+=( -DWITH_SSL=system ) + else + mycmakeargs+=( -DWITH_SSL=bundled ) + fi + + if use server ; then + + # Federated{,X} must be treated special otherwise they will not be built as plugins + if ! use extraengine ; then + mycmakeargs+=( + -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 + -DWITHOUT_FEDERATEDX_STORAGE_ENGINE=1 ) + fi + + 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+=( + -DINSTALL_SQLBENCHDIR=share/mysql + -DEXTRA_CHARSETS=all + -DDISABLE_SHARED=$(usex static YES NO) + -DWITH_EMBEDDED_SERVER=OFF + -DENABLED_PROFILING=$(usex profiling) + ) + + if use static; then + mycmakeargs+=( -DWITH_PIC=1 ) + fi + + # Storage engines + mycmakeargs+=( + -DWITH_ARCHIVE_STORAGE_ENGINE=1 + -DWITH_BLACKHOLE_STORAGE_ENGINE=1 + -DWITH_CSV_STORAGE_ENGINE=1 + -DWITH_HEAP_STORAGE_ENGINE=1 + -DWITH_INNOBASE_STORAGE_ENGINE=1 + -DWITH_MYISAMMRG_STORAGE_ENGINE=1 + -DWITH_MYISAM_STORAGE_ENGINE=1 + -DWITH_PARTITION_STORAGE_ENGINE=1 + ) + + else + mycmakeargs+=( + -DWITHOUT_SERVER=1 + -DEXTRA_CHARSETS=none + -DINSTALL_SQLBENCHDIR= + ) + fi + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_compile +} + +src_install() { + cmake-utils_src_install + + # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used + if [[ -f "${ED%/}/usr/include/mysql/server/private/config.h" ]] ; then + rm "${ED%/}/usr/include/mysql/server/private/config.h" || die + fi + + # Make sure the vars are correctly initialized + mysql_init_vars + + # Convenience links + einfo "Making Convenience links for mysqlcheck multi-call binary" + dosym "mysqlcheck" "/usr/bin/mysqlanalyze" + dosym "mysqlcheck" "/usr/bin/mysqlrepair" + dosym "mysqlcheck" "/usr/bin/mysqloptimize" + + # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir + if [[ -d "${ED%/}/usr/data" ]] ; then + rm -Rf "${ED%/}/usr/data" || die + fi + + # Unless they explicitly specific USE=test, then do not install the + # testsuite. It DOES have a use to be installed, esp. when you want to do a + # validation of your database configuration after tuning it. + if ! use test ; then + rm -rf "${D%/}/${MY_SHAREDSTATEDIR}/mysql-test" + fi + + # Configuration stuff + einfo "Building default configuration ..." + insinto "${MY_SYSCONFDIR#${EPREFIX}}" + [[ -f "${S%/}/scripts/mysqlaccess.conf" ]] && doins "${S%/}"/scripts/mysqlaccess.conf + local mycnf_src="my.cnf-5.5" + sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ + "${FILESDIR%/}/${mycnf_src}" \ + > "${TMPDIR%/}/my.cnf.ok" || die + use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR%/}/my.cnf.ok" + if use latin1 ; then + sed -i \ + -e "/character-set/s|utf8|latin1|g" \ + "${TMPDIR%/}/my.cnf.ok" || die + fi + eprefixify "${TMPDIR%/}/my.cnf.ok" + newins "${TMPDIR}/my.cnf.ok" my.cnf + + if use server ; then + einfo "Including support files and sample configurations" + docinto "support-files" + local script + for script in \ + "${S%/}"/support-files/magic + do + [[ -f "$script" ]] && dodoc "${script}" + done + + docinto "scripts" + for script in "${S%/}"/scripts/mysql* ; do + [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}" + done + 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 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.5 for now and are believed to be + # false positives: + # + # main.mysql_client_test, main.mysql_client_test_nonblock + # main.mysql_client_test_comp: + # segfaults at random under Portage only, suspect resource limits. + + local t + for t in main.mysql_client_test main.mysql_client_test_nonblock \ + main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam \ + main.mysqlhotcopy_archive main.mysqlhotcopy_myisam main.openssl_1 \ + rpl.rpl_semi_sync_uninstall_plugin ; do + _disable_test "$t" "False positives in Gentoo" + done + + if ! use client-libs ; then + _disable_test main.plugin_auth "Needs client libraries built" + fi + + # run mysql-test tests + perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" + retstatus_tests=$? + + popd > /dev/null || die + + # Cleanup is important for these testcases. + pkill -9 -f "${S}/ndb" 2>/dev/null + pkill -9 -f "${S}/sql" 2>/dev/null + + local failures="" + [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" + [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" + + [[ -z "$failures" ]] || die "Test failures: $failures" + einfo "Tests successfully completed" +} + +mysql_init_vars() { + MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/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 "${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 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 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 + # 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 + + local cmd=( "${EROOT}usr/share/mysql/scripts/mysql_install_db" ) + [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" ) + cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" ) + einfo "Command: ${cmd[*]}" + su -s /bin/sh -c "${cmd[*]}" mysql \ + >"${TMPDIR}"/mysql_install_db.log 2>&1 + if [ $? -ne 0 ]; then + grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 + die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" + fi + popd &>/dev/null || die + [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ + || die "MySQL databases not installed" + + use prefix || options="${options} --user=mysql" + + local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" + local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" + local mysqld="${EROOT}/usr/sbin/mysqld \ + ${options} \ + --log-warnings=0 \ + --basedir=${EROOT}/usr \ + --datadir=${ROOT}/${MY_DATADIR} \ + --max_allowed_packet=8M \ + --net_buffer_length=16K \ + --socket=${socket} \ + --pid-file=${pidfile} + --tmpdir=${ROOT}/${MYSQL_TMPDIR}" + #einfo "About to start mysqld: ${mysqld}" + ebegin "Starting mysqld" + einfo "Command ${mysqld}" + ${mysqld} & + rc=$? + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + eend $rc + + if ! [[ -S "${socket}" ]]; then + die "Completely failed to start up mysqld with: ${mysqld}" + fi + + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -e "${sql}" + eend $? + + if [[ -n "${sqltmp}" ]] ; then + ebegin "Loading \"zoneinfo\", this step may require a few seconds" + "${EROOT}/usr/bin/mysql" \ + "--socket=${socket}" \ + -hlocalhost \ + -uroot \ + --password="${MYSQL_ROOT_PASSWORD}" \ + mysql < "${sqltmp}" + rc=$? + eend $? + [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" + fi + + # Stop the server and cleanup + einfo "Stopping the server ..." + kill $(< "${pidfile}" ) + rm -f "${sqltmp}" + wait %1 + einfo "Done" +} diff --git a/dev-db/mysql/mysql-5.6.40-r1.ebuild b/dev-db/mysql/mysql-5.6.40-r1.ebuild deleted file mode 100644 index 38515733ba7b..000000000000 --- a/dev-db/mysql/mysql-5.6.40-r1.ebuild +++ /dev/null @@ -1,768 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20180628-0201Z" - -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 -) - -# 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: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] ) - || ( >=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 - -DENABLED_PROFILING=$(usex profiling) - ) - - 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.7 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 - - # 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'" - - # 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/mysql/mysql-5.6.41.ebuild b/dev-db/mysql/mysql-5.6.41.ebuild new file mode 100644 index 000000000000..7ec34a50aadc --- /dev/null +++ b/dev-db/mysql/mysql-5.6.41.ebuild @@ -0,0 +1,768 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +MY_EXTRAS_VER="20180804-2323Z" + +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 +) + +# 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: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] ) + || ( >=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 + -DENABLED_PROFILING=$(usex profiling) + ) + + 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.7 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 + + # 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'" + + # 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/mysql/mysql-5.7.22.ebuild b/dev-db/mysql/mysql-5.7.22.ebuild deleted file mode 100644 index 3c0a0ac7c387..000000000000 --- a/dev-db/mysql/mysql-5.7.22.ebuild +++ /dev/null @@ -1,843 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -MY_EXTRAS_VER="20180312-2011Z" - -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-minimal - -SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz - https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-${PV}.tar.gz - http://downloads.mysql.com/archives/MySQL-5.7/${PN}-boost-${PV}.tar.gz" - -# Gentoo patches to MySQL -if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then - 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}"/20001_all_fix-minimal-build-cmake-mysql-5.7.patch - "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.7.patch -# "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.7.6.patch - "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.7.10.patch - "${MY_PATCH_DIR}"/20018_all_mysql-5.7.21-without-clientlibs-tools.patch -) - -# Be warned, *DEPEND are version-dependant -# These are used for both runtime and compiletime -# MULTILIB_USEDEP only set for libraries used by the client library -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? ( - client-libs? ( - !libressl? ( >=dev-libs/openssl-1.0.0:0=[${MULTILIB_USEDEP},static-libs?] ) - libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP},static-libs?] ) - ) - !client-libs? ( - !libressl? ( >=dev-libs/openssl-1.0.0:0= ) - libressl? ( dev-libs/libressl:0= ) - ) - ) - client-libs? ( >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?] ) - !client-libs? ( >=sys-libs/zlib-1.2.3:0= ) - sys-libs/ncurses:0= - server? ( - >=app-arch/lz4-0_p131:= - >=dev-libs/boost-1.65.0:= - numa? ( sys-process/numactl ) - ) - !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) -" -DEPEND="virtual/yacc - static? ( sys-libs/ncurses[static-libs] ) - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) - ${COMMON_DEPEND}" -RDEPEND="selinux? ( sec-policy/selinux-mysql ) - client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c ) - !dev-db/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 - - # Note about configuration change - einfo - elog "This version of mysql 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 appropitate 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() { - 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 - - 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 - - if use client-libs ; then - multilib-minimal_src_configure - else - multilib_src_configure - fi -} - -multilib_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - if ! multilib_is_native_abi && ! use client-libs ; then - return - fi - - 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_RAPID=OFF - -DWITH_LIBEVENT=NO - -DWITH_CURL=system - -DWITH_BOOST="${S}/boost" - ) - if use test ; then - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) - else - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) - fi - - if ! use yassl ; then - mycmakeargs+=( -DWITH_SSL=system ) - else - mycmakeargs+=( -DWITH_SSL=bundled ) - fi - - if ! use client-libs ; then - mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES ) - fi - - # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION - # systemtap only works on native ABI bug 530132 - if multilib_is_native_abi; then - mycmakeargs+=( - -DENABLE_DTRACE=$(usex systemtap) - ) - else - mycmakeargs+=( - -DWITHOUT_TOOLS=1 - -DWITH_READLINE=1 - -DENABLE_DTRACE=0 - ) - fi - - if multilib_is_native_abi && use server ; then - - mycmakeargs+=( - -DWITH_LZ4=system - -DWITH_NUMA=$(usex numa ON OFF) - ) - - if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then - ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" - ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." - ewarn "You MUST file bugs without these variables set." - - mycmakeargs+=( - -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} - -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} - ) - - elif ! use latin1 ; then - mycmakeargs+=( - -DDEFAULT_CHARSET=utf8 - -DDEFAULT_COLLATION=utf8_general_ci - ) - else - mycmakeargs+=( - -DDEFAULT_CHARSET=latin1 - -DDEFAULT_COLLATION=latin1_swedish_ci - ) - fi - mycmakeargs+=( - -DEXTRA_CHARSETS=all - -DDISABLE_SHARED=$(usex static YES NO) - -DWITH_DEBUG=$(usex debug) - -DWITH_EMBEDDED_SERVER=OFF - -DENABLED_PROFILING=$(usex profiling) - ) - - 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_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() { - if use client-libs ; then - multilib-minimal_src_compile - else - multilib_src_compile - fi -} - -multilib_src_compile() { - cmake-utils_src_compile -} - -src_install() { - local MULTILIB_WRAPPED_HEADERS - local MULTILIB_CHOST_TOOLS - if use client-libs ; then - # headers with ABI specific data - MULTILIB_WRAPPED_HEADERS=( - /usr/include/mysql/server/my_config.h - /usr/include/mysql/server/mysql_version.h ) - - # wrap the config scripts - MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config ) - multilib-minimal_src_install - else - multilib_src_install - multilib_src_install_all - fi -} - -# Intentionally override eclass function -multilib_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 -} - -multilib_src_install_all() { - # 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.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 - 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.7 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 - - # 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'" - - # 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/mysql/mysql-5.7.23.ebuild b/dev-db/mysql/mysql-5.7.23.ebuild new file mode 100644 index 000000000000..aad033f5ecc8 --- /dev/null +++ b/dev-db/mysql/mysql-5.7.23.ebuild @@ -0,0 +1,845 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +MY_EXTRAS_VER="20180804-2323Z" + +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-minimal + +SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz + https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-${PV}.tar.gz + http://downloads.mysql.com/archives/MySQL-5.7/${PN}-boost-${PV}.tar.gz" + +# Gentoo patches to MySQL +if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then + 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}"/20001_all_fix-minimal-build-cmake-mysql-5.7.patch + "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.7.patch +# "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.7.6.patch + "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.7.10.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.7.21-without-clientlibs-tools.patch +) + +# Be warned, *DEPEND are version-dependant +# These are used for both runtime and compiletime +# MULTILIB_USEDEP only set for libraries used by the client library +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? ( + client-libs? ( + !libressl? ( >=dev-libs/openssl-1.0.0:0=[${MULTILIB_USEDEP},static-libs?] ) + libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP},static-libs?] ) + ) + !client-libs? ( + !libressl? ( >=dev-libs/openssl-1.0.0:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + ) + client-libs? ( >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?] ) + !client-libs? ( >=sys-libs/zlib-1.2.3:0= ) + sys-libs/ncurses:0= + server? ( + >=app-arch/lz4-0_p131:= + >=dev-libs/boost-1.65.0:= + numa? ( sys-process/numactl ) + ) + !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] ) +" +DEPEND="virtual/yacc + dev-libs/protobuf + static? ( sys-libs/ncurses[static-libs] ) + || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) + ${COMMON_DEPEND}" +RDEPEND="selinux? ( sec-policy/selinux-mysql ) + client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c dev-libs/protobuf:= ) + !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 + + # Note about configuration change + einfo + elog "This version of mysql 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 appropitate 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() { + 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 + + 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 + + if use client-libs ; then + multilib-minimal_src_configure + else + multilib_src_configure + fi +} + +multilib_src_configure() { + debug-print-function ${FUNCNAME} "$@" + + if ! multilib_is_native_abi && ! use client-libs ; then + return + fi + + 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_RAPID=OFF + -DWITH_LIBEVENT=NO + -DWITH_CURL=system + -DWITH_BOOST="${S}/boost" + -DWITH_PROTOBUF=system + ) + if use test ; then + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) + else + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) + fi + + if ! use yassl ; then + mycmakeargs+=( -DWITH_SSL=system ) + else + mycmakeargs+=( -DWITH_SSL=bundled ) + fi + + if ! use client-libs ; then + mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES ) + fi + + # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION + # systemtap only works on native ABI bug 530132 + if multilib_is_native_abi; then + mycmakeargs+=( + -DENABLE_DTRACE=$(usex systemtap) + ) + else + mycmakeargs+=( + -DWITHOUT_TOOLS=1 + -DWITH_READLINE=1 + -DENABLE_DTRACE=0 + ) + fi + + if multilib_is_native_abi && use server ; then + + mycmakeargs+=( + -DWITH_LZ4=system + -DWITH_NUMA=$(usex numa ON OFF) + ) + + if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then + ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" + ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." + ewarn "You MUST file bugs without these variables set." + + mycmakeargs+=( + -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} + -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} + ) + + elif ! use latin1 ; then + mycmakeargs+=( + -DDEFAULT_CHARSET=utf8 + -DDEFAULT_COLLATION=utf8_general_ci + ) + else + mycmakeargs+=( + -DDEFAULT_CHARSET=latin1 + -DDEFAULT_COLLATION=latin1_swedish_ci + ) + fi + mycmakeargs+=( + -DEXTRA_CHARSETS=all + -DDISABLE_SHARED=$(usex static YES NO) + -DWITH_DEBUG=$(usex debug) + -DWITH_EMBEDDED_SERVER=OFF + -DENABLED_PROFILING=$(usex profiling) + ) + + 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_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() { + if use client-libs ; then + multilib-minimal_src_compile + else + multilib_src_compile + fi +} + +multilib_src_compile() { + cmake-utils_src_compile +} + +src_install() { + local MULTILIB_WRAPPED_HEADERS + local MULTILIB_CHOST_TOOLS + if use client-libs ; then + # headers with ABI specific data + MULTILIB_WRAPPED_HEADERS=( + /usr/include/mysql/server/my_config.h + /usr/include/mysql/server/mysql_version.h ) + + # wrap the config scripts + MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config ) + multilib-minimal_src_install + else + multilib_src_install + multilib_src_install_all + fi +} + +# Intentionally override eclass function +multilib_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 +} + +multilib_src_install_all() { + # 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.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 + 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' \ +# 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.7 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 + + # 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'" + + # 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/percona-toolkit/Manifest b/dev-db/percona-toolkit/Manifest index 67bdf5415b17..ddff65af59bf 100644 --- a/dev-db/percona-toolkit/Manifest +++ b/dev-db/percona-toolkit/Manifest @@ -10,6 +10,7 @@ DIST percona-toolkit-2.2.17.tar.gz 1420968 BLAKE2B 886634cb4f1ed196595c0ebe9d2d5 DIST percona-toolkit-2.2.19.tar.gz 1425623 BLAKE2B fe9b363ec924b1af9110ea7e7dab70ad4471ddf30868391f9e02a2f6d5a5698a2cb0238dd1cca81428adcac2f21262f10ea2da272ffd881dee1b8b88be1405e0 SHA512 8da35e2ee4d81465131623e5b423c2c49c0bf0faf01862952dd5ca72c2ffea64fabcaf88dda883e633e23de8ae4a6c75a095a751708bac6a8136fc8daaae2383 DIST percona-toolkit-2.2.20.tar.gz 1431840 BLAKE2B 76565662b4037010f7e8de98316f568c2994f55d042ae3a21b80dc3b839444a11014b61db675cc21c149f26c3b7df52013d7b06c9c1127ec325dae2942a4e4c0 SHA512 f7a5f47e9ca05c43dcb80866a1eacd13066e1f036f4f58d51145fc6354ddc86dd6515a9aa33c8f736029800bf4c80f7ba5fcb9f1e6ac41653b3351597885f679 DIST percona-toolkit-3.0.10.tar.gz 17335242 BLAKE2B c24103576c537eb9afbdcedc6acf51671853c8e0764092f76d3ee4a1de338a521d91b956b13665ca92a06a70726b92cb9d530ab04b50ed30990868305bd0a7a0 SHA512 e9477f908bbcc5c975f11d42fe9b2b61adebe823657e23a2c74c639767c73f3f71ebdf2bec1d839ad14f2d5080c5f1f9620db07c6bf9694bd7623e86f390e902 +DIST percona-toolkit-3.0.11.tar.gz 18254993 BLAKE2B a6c582bdda96bf5c74e7b5340c465d71f4f119d8364c1d36fc02c650d741972e706bb5eee86fd5bc22ed4f7298a45f0d5c5d9e4438230a8b7b09a58498dda7e8 SHA512 f722ccc8b0fde8f61d4cf269ec89df410f656153da06cf396d222cbb817e88b50e23c0ace383429acf39ddec0501e75d6d3e358fb5ed53ee50a0162eaed9a717 DIST percona-toolkit-3.0.7.tar.gz 79294306 BLAKE2B e3a556c823d355e5af504210dfb360e6fcf217ca6bfb7ba729e83e66cfdd09231c09d05fb51df1eac6bee0c6615620ac96ffce47c4f0473394d9c008ce8bdabe SHA512 e5a23ce6f4fd74f0956187679810de23a9d60f8073609289d641411c9f397f49b02c05cbcd0a68d78992849f17b70fb3ae411ac967e25c7be45f95ec374414fe DIST percona-toolkit-3.0.8.tar.gz 79316265 BLAKE2B 5d6efdbaa4fd3ac914c059c9240f6dcd0de89c6b2ea444c407b115b380bb676c51266f907f6e37a62a40032fd5aa6e1816752c8ec08150dddf71c7568f42c739 SHA512 d5380395b052aebe651806649ff22f259d1af9401112b7ffe86b10664b87f917fecfe91bdc72b401d00471fc9c141391006cd322c9464fca1343f704ecaa8623 DIST percona-toolkit-3.0.9.tar.gz 15197340 BLAKE2B 095d8c0b26853caa6d2515de1d8fb8ff13b3084caa46498c8c789cd4e7b18473d41992701e393ad91cd7fdda8b3e56a099600285aeb4ba788110d36a028f76b6 SHA512 56a8732cfdbd58d0602e482d7bf049d2049104b7ae203d756db81a052cd837f16d2a35f75def4f23748534d0d2eb6441cb9fe49175a931fbcdbb6adeb42f1c53 @@ -19,6 +20,7 @@ EBUILD percona-toolkit-2.2.19.ebuild 1213 BLAKE2B 784c406e8b359b1c75c49725ee670c EBUILD percona-toolkit-2.2.20.ebuild 1213 BLAKE2B 2bcc433599d64b15225e508fa16c50634b34c9963c38fae7d8ac412e730c9566751bfa1c784254018e40b5a6d8fcb6b4e52c2f85df7362d43bcf153282f7766b SHA512 f1b0b8a48e99d616d9a54a5bf6c39a06ef5e6f48992fe3e0584d464d7ed1abc5f6f08a14488cbffd4fcf4d8afe8791112094438baf06a5a4b788a953d539288b EBUILD percona-toolkit-3.0.10-r1.ebuild 1330 BLAKE2B acf05bb59b278883dece85f7a60a6ae114a5a5253a867b0f2c5259196eddb4a95acdf66809c1ecb5ad47140f220b9cff47efeedc0ddc1f370db1ee6181c4f12c SHA512 cb5d77f6f689989ae2aa5e4eb4ca7273981b9f18e6308d67dd5ca25ddb163db24655b3d54e84f70f911ffd098bacf5d114dd8afd1a4b2c06198ad55f9fcbcff4 EBUILD percona-toolkit-3.0.10.ebuild 1249 BLAKE2B bd743a722e60cade6307bd04c774a77d0e01b2272e82974be486b47d0462120910c1182ba6fc3f7cf268f4ebfa04d432e456f62079010621aeaf6b325c743b54 SHA512 988d423c3125592608caa659543b508dcea2048b0c905a24c924e75894ca7c93924908e49f5c6c2c5d660a7b90a242e558e874849f0793d58a82abec1ad38982 +EBUILD percona-toolkit-3.0.11.ebuild 1330 BLAKE2B acf05bb59b278883dece85f7a60a6ae114a5a5253a867b0f2c5259196eddb4a95acdf66809c1ecb5ad47140f220b9cff47efeedc0ddc1f370db1ee6181c4f12c SHA512 cb5d77f6f689989ae2aa5e4eb4ca7273981b9f18e6308d67dd5ca25ddb163db24655b3d54e84f70f911ffd098bacf5d114dd8afd1a4b2c06198ad55f9fcbcff4 EBUILD percona-toolkit-3.0.7.ebuild 1167 BLAKE2B f61aaf597895efa1b68a04f889e93fef6207d4e2cc9f14e986aee81cccb6ca7888d7479bc01bf11bea554bb9f860615ebfb95111420c641ad7e8b16808121a24 SHA512 940474cb8cf56cff984dffc33c3848808d184c33f6d31a4bcafdc2ee16feecbe6f4084c80e243d18eb62c9f09759f274144aff2c3f45d465bc01c8f82d1e5ac1 EBUILD percona-toolkit-3.0.8.ebuild 1249 BLAKE2B bd743a722e60cade6307bd04c774a77d0e01b2272e82974be486b47d0462120910c1182ba6fc3f7cf268f4ebfa04d432e456f62079010621aeaf6b325c743b54 SHA512 988d423c3125592608caa659543b508dcea2048b0c905a24c924e75894ca7c93924908e49f5c6c2c5d660a7b90a242e558e874849f0793d58a82abec1ad38982 EBUILD percona-toolkit-3.0.9.ebuild 1249 BLAKE2B bd743a722e60cade6307bd04c774a77d0e01b2272e82974be486b47d0462120910c1182ba6fc3f7cf268f4ebfa04d432e456f62079010621aeaf6b325c743b54 SHA512 988d423c3125592608caa659543b508dcea2048b0c905a24c924e75894ca7c93924908e49f5c6c2c5d660a7b90a242e558e874849f0793d58a82abec1ad38982 diff --git a/dev-db/percona-toolkit/percona-toolkit-3.0.11.ebuild b/dev-db/percona-toolkit/percona-toolkit-3.0.11.ebuild new file mode 100644 index 000000000000..4a54323f4338 --- /dev/null +++ b/dev-db/percona-toolkit/percona-toolkit-3.0.11.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit perl-module + +DESCRIPTION="Advanced command-line tools to perform a variety of MySQL and system tasks" +HOMEPAGE="https://www.percona.com/software/mysql-tools/percona-toolkit" +SRC_URI="https://www.percona.com/downloads/${PN}/${PV}/source/tarball/${P}.tar.gz" + +LICENSE="|| ( GPL-2 Artistic )" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +# Package warrants IUSE doc +IUSE="" + +COMMON_DEPEND="dev-perl/DBI + dev-perl/DBD-mysql + virtual/perl-Time-HiRes" +RDEPEND="${COMMON_DEPEND} + dev-perl/JSON + dev-perl/libwww-perl + dev-perl/Role-Tiny + virtual/perl-File-Path + virtual/perl-Getopt-Long + virtual/perl-Time-Local + virtual/perl-Digest-MD5 + virtual/perl-IO-Compress + virtual/perl-File-Temp + virtual/perl-File-Spec + virtual/perl-Scalar-List-Utils + dev-perl/TermReadKey" +DEPEND="${COMMON_DEPEND} + virtual/perl-ExtUtils-MakeMaker" + +# Bug #501904 - CVE-2014-2029 +# sed -i -e '/^=item --\[no\]version-check/,/^default: yes/{/^default: yes/d}' bin/* +# ^ is *-no-versioncheck.patch +PATCHES=( + "${FILESDIR}"/${PN}-3.0.7-no-versioncheck.patch + "${FILESDIR}"/${PN}-3.0.10-slave-delay-fix.patch +) + +src_prepare() { + default + + sed -i \ + -e "s/=> 'percona-toolkit',/=> 'Percona::Toolkit',/g" \ + Makefile.PL || die +} diff --git a/dev-db/percona-xtrabackup-bin/Manifest b/dev-db/percona-xtrabackup-bin/Manifest index 0f932b09d2a7..038b0287eb66 100644 --- a/dev-db/percona-xtrabackup-bin/Manifest +++ b/dev-db/percona-xtrabackup-bin/Manifest @@ -1,10 +1,7 @@ -DIST percona-xtrabackup-2.4.10-Linux-i686.libgcrypt20.tar.gz 84004091 BLAKE2B 0fde32a53aaba54d71e34b729ba4d3dc94c21d8852a4c87da221b6967b6e9c6b59c7fc4966724cbdf3fd474082b3e14717dc34b30b3f235b2271c0f7fdbf52e8 SHA512 07e75c0770736f2566d44395a5ed455b5f90a64244754e621e9c90d8e7a0ad3fe1d7a05037b9f0ecba53b821a8f1ad4d51914ef0b414ae470091ccd489379b19 -DIST percona-xtrabackup-2.4.10-Linux-x86_64.libgcrypt20.tar.gz 86736776 BLAKE2B b55915b1ad34bb55668b90de2441502491e98d2a685932848e756ea61562592416a05eba33d0c6df2bcad9f113b867b64eca39813a3683b25c18574535ba2b70 SHA512 1293e9511e09cd8cac2ef2a117282d3f79573974b7b7c3ffe6e80fe1c57edb27f32fe19e14c0ea643084c62ad83f6e5e25b5f01671628735fae940fcfb7795f1 DIST percona-xtrabackup-2.4.11-Linux-i686.libgcrypt20.tar.gz 85158090 BLAKE2B 3d6565542208d1a9c74154d0a7e23610a34416f4840bcff240a262958fe4e4b0f489883349760934469619d225dccc7a2d531919e716dfdc3c2f10b1f98263e2 SHA512 bd6419f1b2e79e8e41817c677209a0d08912b247314f611689e0208028d4870e1e2a2b559fe8d60a3a369704aaee57e300643d9d355f083bb89c950f13d724bb DIST percona-xtrabackup-2.4.11-Linux-x86_64.libgcrypt20.tar.gz 87975988 BLAKE2B 850b06d3e063b2884f0731ada7ad20e09816e38f60ee5eef2b1150c2b1f0cd59082d26fa026bf7e80ccebdf6b513ab8af6c7d228ade96d532ef41a74490093e9 SHA512 dc412e3ad65a5d3aed6053e107a79094760b868f008171c9aaee190c97e666a38716b0c7d3e7f3db74eecff98b35c114be29114d50630f554a0c2cb0b1b71cfe -DIST percona-xtrabackup-2.4.9-Linux-i686.tar.gz 79816483 BLAKE2B 0fd97ee14c97f66edf629fa0300bfa2d6b333ac5942f5cee46dd9d0ad04ef2fe12750209971ff8f6a8ca225a85deaa42ca64c484e12e60c85789153689e55c42 SHA512 014921b0ea9fec783adbdd4556301e8df77f801729faae5b2b7245c349df069fc3af33ebef5ec65ef0e020c7b0ec8ebf4aa7a7acc0e9936c6f4a90b721a5de19 -DIST percona-xtrabackup-2.4.9-Linux-x86_64.tar.gz 90282874 BLAKE2B 2c4cdb8c6da443baf01857fbe4b27be002df370b67687f417a9fde6b08a5e72482552b165a9f27fda305787b42089fb138a4fca2f1d683afbd42efa23746b13c SHA512 24138c098d8e674de291dc494c38f2fce52f4d6a5a2552a62b34ea801b867431917449656f990043c7bbbc1e18a8806c4343eadbe1fea17e36ff1b10109e5047 -EBUILD percona-xtrabackup-bin-2.4.10.ebuild 1530 BLAKE2B 87233dfc8725ce661367ff5d426fdf0b4e1f9335295abbe1f154715a19cc2658a60d84e4040ea837d2c6b0b0d61b493fe1836dd632cec01211e8eb96b803d308 SHA512 87ab06a801645538a5d8a335c22ab16a21a507681ffbefeeaeb2fa0069e231cf8f332ffce63481bd6ffd8a185d451cbdd56f93ce74fd9b70693f62a660efbc29 +DIST percona-xtrabackup-2.4.12-Linux-i686.libgcrypt20.tar.gz 85181957 BLAKE2B b066ff9efa8c57829a441c2e416ac1eeeff60cb0839ccdab4cd685bff9b2ead552ba9b7105541e0a824ca8aaeeb47d89d66180fe428842470c4743dfd149f31d SHA512 adbaae8ad3347e15b13fe360dd5d4721330d6b17e75696128dfe770d03ad85056abeb861ffcbfe1d08020c8b9d726dd9e5650f63b7199804fe4d3cd9806debe2 +DIST percona-xtrabackup-2.4.12-Linux-x86_64.libgcrypt20.tar.gz 87975175 BLAKE2B b21ab8dd4fac27ae8c731b5fbd816dfc39572bc52a9273255a4c89ddf99ee490cc66ed4f92945b18f4ec58e731ae036a16e08674cb9837544ca5150cb6b91c7b SHA512 355b9f7f052a1242e502ddcbdc26cb931d16366be4db405730a2bb04de3030e0d0e6d4d15eb87f68fe232648dd435c85505a6d895b7c27b3baea0cb851214766 EBUILD percona-xtrabackup-bin-2.4.11.ebuild 1530 BLAKE2B 87233dfc8725ce661367ff5d426fdf0b4e1f9335295abbe1f154715a19cc2658a60d84e4040ea837d2c6b0b0d61b493fe1836dd632cec01211e8eb96b803d308 SHA512 87ab06a801645538a5d8a335c22ab16a21a507681ffbefeeaeb2fa0069e231cf8f332ffce63481bd6ffd8a185d451cbdd56f93ce74fd9b70693f62a660efbc29 -EBUILD percona-xtrabackup-bin-2.4.9.ebuild 1461 BLAKE2B fbe02435623b2c09f811dc5683733fbc2768e67a498f4e465c27f0f28a6341eb2ce92ab1192dc99aaed1a590da8a9c4f0183e1a030ad49253a35ff7cd81779e1 SHA512 9227a8efb509e94bd6be062959de7447bc8461b7278a0b7b633a58ac2a65f17726902ba9ec5d5a407d5e913cbe1c62620d01b139fd303d798567ce1b81b92dd2 +EBUILD percona-xtrabackup-bin-2.4.12.ebuild 1530 BLAKE2B 4e0b7346ea30fa263debd715fae3175677ffe3a217db3766b151b489bef906b4c62f0f3428ea1f122da5758a03408bab3ff82c554d80eeafc960b2c077355f4c SHA512 9551643af7e6b93f8ecb164b6f0663f252859222eb0e4f7249708d4f015ee31b29a2d7bbc71868b15bedbad6a9a6644d09b97069e8afca161628e7374ef42f47 MISC metadata.xml 139 BLAKE2B b4a59c22790dfec3fbcfaea41ef363401766736b68a85bedae00e1944d0a848aa97104c2f34244c0fe7b6363029281f965fc1b3545301d341cda371eaa976274 SHA512 8be912ace7468a4396eb1da00a9785030a8ce35da4357a01591876a1056fd45e44da65de2af3e1eb0506ce6551714962c40c3ae5a3aefa2ad231de35af2519be diff --git a/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.10.ebuild b/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.10.ebuild deleted file mode 100644 index 2e9e7ddc7525..000000000000 --- a/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.10.ebuild +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -MY_PN="${PN%-bin}" -MY_P="${MY_PN}-${PV}" - -DESCRIPTION="MySQL hot backup software. non-blocking backups for InnoDB/XtraDB databases" -HOMEPAGE="https://www.percona.com/software/percona-xtrabackup" -SRC_URI=" - amd64? ( - https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-x86_64.libgcrypt20.tar.gz - ) - x86? ( - https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-i686.libgcrypt20.tar.gz - )" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -# NOTE: dev-perl/DBD-mysql still necessary, now for bin/xtrabackup? -DEPEND="" -RDEPEND="dev-libs/libaio - dev-libs/libgcrypt:0/20 - dev-libs/libgpg-error - dev-perl/DBD-mysql - sys-libs/zlib - sys-process/numactl" - -QA_PREBUILT="usr/bin/*" - -src_unpack() { - default - - if use amd64; then - S="${WORKDIR}/${MY_P}-Linux-x86_64" - elif use x86; then - S="${WORKDIR}/${MY_P}-Linux-i686" - fi -} - -src_install() { - # Two new tools with an old libcurl.so.3 dep... - # TODO: Wait for a new release using libcurl.so.4 - # net-misc/curl dev-libs/libev - # dobin bin/xbcloud{,_osenv} - - for tool in xbcrypt xbstream xtrabackup; do - dobin bin/${tool} - done - - for man in innobackupex xbcrypt xbstream xtrabackup; do - doman man/man1/${man}.1 - done - - dosym xtrabackup /usr/bin/innobackupex -} - -pkg_postinst() { - ewarn "innobackupex got deprecated in 2.3.x series and is just a symlink to xtrabackup" -} diff --git a/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.12.ebuild b/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.12.ebuild new file mode 100644 index 000000000000..29a995636cfc --- /dev/null +++ b/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.12.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +MY_PN="${PN%-bin}" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="MySQL hot backup software. non-blocking backups for InnoDB/XtraDB databases" +HOMEPAGE="https://www.percona.com/software/percona-xtrabackup" +SRC_URI=" + amd64? ( + https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-x86_64.libgcrypt20.tar.gz + ) + x86? ( + https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-i686.libgcrypt20.tar.gz + )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +# NOTE: dev-perl/DBD-mysql still necessary, now for bin/xtrabackup? +DEPEND="" +RDEPEND="dev-libs/libaio + dev-libs/libgcrypt:0/20 + dev-libs/libgpg-error + dev-perl/DBD-mysql + sys-libs/zlib + sys-process/numactl" + +QA_PREBUILT="usr/bin/*" + +src_unpack() { + default + + if use amd64; then + S="${WORKDIR}/${MY_P}-Linux-x86_64" + elif use x86; then + S="${WORKDIR}/${MY_P}-Linux-i686" + fi +} + +src_install() { + # Two new tools with an old libcurl.so.3 dep... + # TODO: Wait for a new release using libcurl.so.4 + # net-misc/curl dev-libs/libev + # dobin bin/xbcloud{,_osenv} + + for tool in xbcrypt xbstream xtrabackup; do + dobin bin/${tool} + done + + for man in innobackupex xbcrypt xbstream xtrabackup; do + doman man/man1/${man}.1 + done + + dosym xtrabackup /usr/bin/innobackupex +} + +pkg_postinst() { + ewarn "innobackupex got deprecated in 2.3.x series and is just a symlink to xtrabackup" +} diff --git a/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.9.ebuild b/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.9.ebuild deleted file mode 100644 index 061d2fc6a0c8..000000000000 --- a/dev-db/percona-xtrabackup-bin/percona-xtrabackup-bin-2.4.9.ebuild +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -MY_PN="${PN%-bin}" -MY_P="${MY_PN}-${PV}" - -DESCRIPTION="MySQL hot backup software. non-blocking backups for InnoDB/XtraDB databases" -HOMEPAGE="https://www.percona.com/software/percona-xtrabackup" -SRC_URI=" - amd64? ( - https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-x86_64.tar.gz - ) - x86? ( - https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-i686.tar.gz - )" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -# NOTE: dev-perl/DBD-mysql still necessary, now for bin/xtrabackup? -DEPEND="" -RDEPEND="dev-libs/libaio - dev-libs/libgcrypt:11/11 - dev-libs/libgpg-error - dev-perl/DBD-mysql - sys-libs/zlib" - -src_unpack() { - default - - if use amd64; then - S="${WORKDIR}/${MY_P}-Linux-x86_64" - elif use x86; then - S="${WORKDIR}/${MY_P}-Linux-i686" - fi -} - -src_install() { - # Two new tools with an old libcurl.so.3 dep... - # TODO: Wait for a new release using libcurl.so.4 - # net-misc/curl dev-libs/libev - # dobin bin/xbcloud{,_osenv} - - for tool in xbcrypt xbstream xtrabackup; do - dobin bin/${tool} - done - - for man in innobackupex xbcrypt xbstream xtrabackup; do - doman man/man1/${man}.1 - done - - dosym xtrabackup /usr/bin/innobackupex -} - -pkg_postinst() { - ewarn "innobackupex got deprecated in 2.3.x series and is just a symlink to xtrabackup" -} -- cgit v1.2.3