summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/Manifest.gzbin20328 -> 20327 bytes
-rw-r--r--dev-db/cockroach/Manifest2
-rw-r--r--dev-db/cockroach/cockroach-2.0.1.ebuild65
-rw-r--r--dev-db/kdb/Manifest2
-rw-r--r--dev-db/kdb/kdb-3.0.2.ebuild45
-rw-r--r--dev-db/mariadb-galera/Manifest2
-rw-r--r--dev-db/mariadb-galera/mariadb-galera-10.0.34.ebuild4
-rw-r--r--dev-db/mariadb/Manifest16
-rw-r--r--dev-db/mariadb/mariadb-10.0.35.ebuild210
-rw-r--r--dev-db/mariadb/mariadb-10.1.24-r1.ebuild4
-rw-r--r--dev-db/mariadb/mariadb-10.1.29.ebuild4
-rw-r--r--dev-db/mariadb/mariadb-10.1.31-r1.ebuild4
-rw-r--r--dev-db/mariadb/mariadb-10.1.32.ebuild4
-rw-r--r--dev-db/mariadb/mariadb-10.1.33.ebuild243
-rw-r--r--dev-db/mariadb/mariadb-10.2.14.ebuild4
-rw-r--r--dev-db/mariadb/mariadb-10.3.6_rc.ebuild4
-rw-r--r--dev-db/postgresql/Manifest10
-rw-r--r--dev-db/postgresql/postgresql-10.4.ebuild460
-rw-r--r--dev-db/postgresql/postgresql-9.3.23.ebuild450
-rw-r--r--dev-db/postgresql/postgresql-9.4.18.ebuild482
-rw-r--r--dev-db/postgresql/postgresql-9.5.13.ebuild488
-rw-r--r--dev-db/postgresql/postgresql-9.6.9.ebuild493
22 files changed, 2928 insertions, 68 deletions
diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz
index 1ff85fd7cce9..5b83c6a1cf54 100644
--- a/dev-db/Manifest.gz
+++ b/dev-db/Manifest.gz
Binary files differ
diff --git a/dev-db/cockroach/Manifest b/dev-db/cockroach/Manifest
index 5e84c3d4ded1..d754aca3fc5a 100644
--- a/dev-db/cockroach/Manifest
+++ b/dev-db/cockroach/Manifest
@@ -10,6 +10,7 @@ DIST cockroach-v1.0.3.src.tgz 69127502 BLAKE2B 803f88e19a6128f18024748610c1af3e9
DIST cockroach-v1.0.src.tgz 68753479 BLAKE2B 6377614e9fee896a0115909b02d8a191a7aabe8da341c98547c0ac496d2e8fcce801e35f93a8a126c9d65c1106e0217359b161825a11597da1db113ca6a51216 SHA512 d74ad9546908535f9a7ad4172a04a5f86f5ed22698bbb005aec7478a52632e0497a966b859fd68b40894eb7ee68bfa80dc4188d198f2f23725b9cadd50a55191
DIST cockroach-v1.1.2.src.tgz 79607942 BLAKE2B 39ce9db2ada1c9a5727431438d4d8fe0d5a31af3161816ee7af672c69909aa6b4681edabdfabc332c00ba3b0a142ea7d700851c8833b80947fdbcc88b7fa2c7e SHA512 385e33ec30c23d84403938420a2fcd66edff02a5c4b9d6220ce3683d833f065010953fd78ee57120c24f2947509b2fd29eeee2a45fd3ad47c16a6c8d779534d2
DIST cockroach-v1.1.3.src.tgz 79615899 BLAKE2B 86d9a63a5e5e8f21114dda500f30a007bf64769b76322fae282d06fa9eb63eb8a965bf990378c624ccac66124efadf1a0dfdebbc8dc8c6f04173e20334341e89 SHA512 f6dc4178e91fd47aec1fce658c9d621183f0bdcdc6101b87f8187757ab9b965c27e48d0d628dd9c10a386bc1a2f184d9d03270243baf0ec4758c812caac5fda1
+DIST cockroach-v2.0.1.src.tgz 45511681 BLAKE2B 9d0828e5e6bd41bb5590e58f0e18b8a07169335b9ff1284daf89b48dae6eea3cdb683bf8af703b5bac46978e8c37b4a092c53a3d7e18de626acc2095a7daf2a2 SHA512 ad7c64dc70cde6bbd10cabafe595ce35deeda9284880bebde75e41a4b1355aa85f01fb8c6b6ff0bae498b4b04a8d7d60bafc986c49875cff9ccf0ead0bc481a7
EBUILD cockroach-1.0-r1.ebuild 1703 BLAKE2B 263b32177c96e6c5f4512c6eb60cbef7310fdbac297f5219f3e3d8ba708befe6ccc7a0eb43467c6dbc4c01542e5eddd899b01d61b0b6aa67fa3950d38b879767 SHA512 f9d54c7b9395e8ef6552211535641b9241df50d922f6c2e8c74c1782538ea25953c8c15fd89bf6ab17c6264b75bcfd23b5fd27ea9b4054f6579a2753b81c9eb3
EBUILD cockroach-1.0.1.ebuild 1701 BLAKE2B e011a698cd2493fe26d24112a8ae8b9184ff66c7a1bcf25f6933c19374f036781ff093f7d84048c4df219aa93b66b4f3879af68b6835f9c02e62c503d8597841 SHA512 61ded57cbd28008a27b3b8a2e048a89a70be76317d350c29554ac0450de8932c275aedb63f6d032997013abb63b8a29aff4dae107bccf7876d7afe7ed14149df
EBUILD cockroach-1.0.3.ebuild 1701 BLAKE2B f9e7fb748c2495586fc600dec992a0272cb89a39a48131ae687a469d1ffcda0b6fe5bad83751b514d8f3906c9f6defdfadb3175db34dbf0c9317143865c7cdbb SHA512 b1a0a2adb8555a227bdb9caff6a91efba4c010a82372b5ad446ab2feb9b68a98456b5b60c14513e5aeebae290a56fd936a8c17194821d12f2b910e8e0f3d1979
@@ -17,4 +18,5 @@ EBUILD cockroach-1.0.ebuild 1689 BLAKE2B 1a9afdfb31ac9142f4a21cda3274eea404593ec
EBUILD cockroach-1.0_rc1.ebuild 1593 BLAKE2B 511ff8271f507e055d792d98f12f1adce3eba73b15d198e4adf33d7ac1ba61eefa5c9a436ae8b1b474aac802e961205a49195187067f53320ffe038308a8df13 SHA512 6f273468fd5b869144d474027dd644a9031c18f1b18525c89775c9d8eacdeb59d64b195216189ebe6a2251973abc500b2f3047fc88af7d97aa9798c0db8fa16a
EBUILD cockroach-1.1.2.ebuild 1701 BLAKE2B f9e7fb748c2495586fc600dec992a0272cb89a39a48131ae687a469d1ffcda0b6fe5bad83751b514d8f3906c9f6defdfadb3175db34dbf0c9317143865c7cdbb SHA512 b1a0a2adb8555a227bdb9caff6a91efba4c010a82372b5ad446ab2feb9b68a98456b5b60c14513e5aeebae290a56fd936a8c17194821d12f2b910e8e0f3d1979
EBUILD cockroach-1.1.3.ebuild 1784 BLAKE2B a23a4d6971c40d68bd280917159ef280c534da3339a48ff1d60351ed63f78be331e323a2d311b3a051db072f4dac88dadf7cc460cd2a2f7f59d19dbc7656176d SHA512 48e34da012ea4ffe51278e2d921a6a93e444b9e4a07855664e468d966f867c341c478afa9ea1f41fb31fcb8f6f94e373811e6bea879a4042a3d23f05d24d220b
+EBUILD cockroach-2.0.1.ebuild 1820 BLAKE2B b16dd86cb9bb805db65d47c36bcab1942443942473b96c74c95a53ee55a1878e61247dc58945119bd6a09a1a0ac3bdc5cb9f9ec6fd28db2ab8acdea55b540ca2 SHA512 e8d4fac1f1463ea4643630662d92d187207fcd299bce5c92532ca184fdbf73981e98f07ce5ea56044f255f70a579a46bbfcd202f35a5b1563c0c7b842fddaca2
MISC metadata.xml 409 BLAKE2B 0fa2933efa8102fa19917f3268b4424257f26efdd94698d22253ed62b562dddc53e09a9312069a9bcf817ccd3f6a0b4423c04c8d8dcbe387e7b30d727e8bdd0c SHA512 e4494324632e55e32fdfe7c1d1b25301b8f7cff3f7475efaf7c6c59d435777eab7245bb200b39b90121babce4e1573038fb0f42e586854a820e1489c1afddd19
diff --git a/dev-db/cockroach/cockroach-2.0.1.ebuild b/dev-db/cockroach/cockroach-2.0.1.ebuild
new file mode 100644
index 000000000000..6549c0aea3b0
--- /dev/null
+++ b/dev-db/cockroach/cockroach-2.0.1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PV=v${PV}
+CHECKREQS_MEMORY="2G"
+
+inherit check-reqs toolchain-funcs user
+
+DESCRIPTION="open source database for building cloud services"
+HOMEPAGE="https://www.cockroachlabs.com"
+SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
+
+LICENSE="Cockroach Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=app-arch/xz-utils-5.2.3
+ >=dev-lang/go-1.8.3
+ >=dev-util/cmake-3.8.1"
+
+S="${WORKDIR}/cockroach-${MY_PV}"
+
+QA_EXECSTACK="usr/bin/cockroach"
+
+pkg_pretend() {
+ check-reqs_pkg_pretend
+ if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
+ eerror "Cockroach cannot be built with this version of gcc."
+ eerror "You need at least gcc-6.0"
+ die "Your C compiler is too old for this package."
+ fi
+}
+
+pkg_setup() {
+ check-reqs_pkg_setup
+ enewgroup cockroach
+ enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
+}
+
+src_compile() {
+ # workaround for https://github.com/cockroachdb/cockroach/issues/20596
+ unset CMAKE_MODULE_PATH
+ emake build
+}
+
+src_install() {
+ dobin src/github.com/cockroachdb/cockroach/cockroach
+insinto /etc/security/limits.d
+newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
+newconfd "${FILESDIR}"/cockroach.confd-1.0 cockroach
+newinitd "${FILESDIR}"/cockroach.initd-1.0.1 cockroach
+keepdir /var/log/cockroach
+fowners cockroach:cockroach /var/log/cockroach
+if [[ -z ${REPLACING_VERSIONS} ]]; then
+ ewarn "The default setup is for the first node of an insecure"
+ ewarn "cluster that only listens on localhost."
+ ewarn "Please read the cockroach manual at the following url"
+ ewarn "and configure /etc/conf.d/cockroach correctly if you"
+ ewarn "plan to use it in production."
+ ewarn
+ ewarn "http://cockroachlabs.com/docs"
+ fi
+}
diff --git a/dev-db/kdb/Manifest b/dev-db/kdb/Manifest
index 7596a3141b93..4cc3aeb9622d 100644
--- a/dev-db/kdb/Manifest
+++ b/dev-db/kdb/Manifest
@@ -1,5 +1,3 @@
-DIST kdb-3.0.2.tar.xz 478576 BLAKE2B 66982ddae77eeca4238de5045729c049ab41a86471d896f8199af58c9ce6a88abffa1b65975b3e138579bb244e18095e95ddddd11c7c79008f18cbffa63a2076 SHA512 e2fcc09d9477b707bc5af23d23ebfedd21ee7445b0de8fa160969795eb608d712d74572618334fcef4aa06095fa69ce9861542851f5609e83287b23ef01fae90
DIST kdb-3.1.0.tar.xz 543780 BLAKE2B d874765758e245fc939bf88312b064d2dcff3460b2c9e968277e0ce7b8821314273cb3086e821645f9d7605de1a4268e25d11c40f8bf847a8dc98c410bd4d9eb SHA512 f94f1ff87cb5133570f7e9b0ab48202a516eabe1c3f2ed750cd1794800d9b9936bbd62e1479ca6877c293f6473b7f4e2d4a144b928b5bc0f228af327131b43c2
-EBUILD kdb-3.0.2.ebuild 973 BLAKE2B 9d48afdba85f51b9d2f90edc30a48c90beeb2d750bce840e432bf785613740bdd8bc749dd8de07c157f54dd978ebf91f2e6bae2de2ac7eff2ecc8ee8c077ffeb SHA512 5c04d286a7cf2d873d47d05ac71041ab61c8ebffc176f8ee82f3b37c65087592d921922d0b3674bdeb35b9b9516d8843ce6beb384076b61da7847928e93a3041
EBUILD kdb-3.1.0-r1.ebuild 1051 BLAKE2B fdb334e923fe982490712bb019e3318a1b5a91d2e2aae531db58dcc0c95c05f602f9372f4157215a51922a7859656a5aafd91d7b2f06a87de1bff32fbb616675 SHA512 b0c3b31c9c35bd8cc27d35763baac99952753685beafca43a20c21e528965471f8e01ef7b72aa021a20b2ee166a01a5887d497fac07875dd0811e450503db737
MISC metadata.xml 249 BLAKE2B ad415db89e5dee1627aa77f44ded9d4e1e5b8217d06c7ca25bbaa3fe92ce67c2b1090957c45a821b407d7927e5af798498aa6a5b903895ee1af8ee20a446c7f7 SHA512 76a5a340b13f0053ca3c5e94ed24380ea8d29b45ac8655419e22eaadb1e4a827c04d2e7e36b65145c4964e6526f656618fc6ac144e277ef53cb7373e6239e3c3
diff --git a/dev-db/kdb/kdb-3.0.2.ebuild b/dev-db/kdb/kdb-3.0.2.ebuild
deleted file mode 100644
index 2c4e4c1d9041..000000000000
--- a/dev-db/kdb/kdb-3.0.2.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 )
-
-inherit kde5 python-any-r1
-
-DESCRIPTION="Database connectivity and creation framework for various vendors"
-[[ ${KDE_BUILD_TYPE} != live ]] && SRC_URI="mirror://kde/stable/${PN}/src/${P}.tar.xz"
-
-LICENSE="LGPL-2+"
-KEYWORDS="amd64 x86"
-IUSE="mysql postgres sqlite"
-
-RDEPEND="
- $(add_frameworks_dep kcoreaddons)
- $(add_qt_dep qtgui)
- $(add_qt_dep qtwidgets)
- $(add_qt_dep qtxml)
- dev-libs/icu:=
- mysql? ( virtual/mysql )
- postgres? (
- $(add_qt_dep qtnetwork)
- dev-db/postgresql:*
- )
- sqlite? ( dev-db/sqlite:3 )
-"
-DEPEND="${RDEPEND}
- ${PYTHON_DEPS}
- dev-qt/linguist-tools:5
-"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-src_configure() {
- local mycmakeargs=(
- $(cmake-utils_use_find_package mysql MySQL)
- $(cmake-utils_use_find_package postgres PostgreSQL)
- $(cmake-utils_use_find_package sqlite Sqlite)
- )
-
- kde5_src_configure
-}
diff --git a/dev-db/mariadb-galera/Manifest b/dev-db/mariadb-galera/Manifest
index 21bc03dc59f4..670e6b0455e0 100644
--- a/dev-db/mariadb-galera/Manifest
+++ b/dev-db/mariadb-galera/Manifest
@@ -2,5 +2,5 @@ AUX my.cnf-5.5 5244 BLAKE2B f6e22850e34454d7b48566b3e3e1731940933e00611cf5c3c79a
AUX my.cnf-5.6 5144 BLAKE2B 2f977b6a92524cfabbdd19058430c62dd4d03a0587036f49057eff69fda04c148a4dca8e58abe418a2bdc0fe1ef3c780cf53d7214fb51f13d5a4b2a4f7a3b8e9 SHA512 db4bdde6f82d9bd33026477d89d8191ddc4099586273ca4aa3f2dcd09572f887d03f79c2ce00bf74d01c21a18384b05516982bdcf31a6c458631315ea75c4cab
DIST mariadb-galera-10.0.34.tar.gz 69661677 BLAKE2B a905e24c217843e04d35393af9eee06e2e42d6b6d4f7202645a795dd17ee60394b19228332dca9f0d078748f5d02893ad3f367c8c449147811abf78e502b7997 SHA512 e0226e6032d5ff0080a97ea486726a44d8e1b977b93c8d07b517be70098df4149d119d325ebcba6c6affa95a586c94ec8f99a5e5a74a7d2314311748029dc7ab
DIST mysql-extras-20170926-1321Z.tar.bz2 312466 BLAKE2B 3e3e19a905961570cea9c1eb14dec3780da80409e996b1aeddb08625da875f5d08798a862cb1b80566b0d8be0d9ec2aab0a390ca90f991203c9871538b11f00a SHA512 556e782ccc40d8cffb2fde8c46038c90023440c07785ec667f898afdb8c802faeb4dbfe8b3918a1e563b46d1dc8c0de1172f7843ce08ee1ded435b344f8f0cf5
-EBUILD mariadb-galera-10.0.34.ebuild 5497 BLAKE2B 2daef9bc4a961bc9c8d15ce728144c91a108e3c6deddcb6c0f3f80a82b01f55b25889f8a0c1a32be4fc07e2a12062b4ab4355874f1dbc69de13efc0aed05377d SHA512 a627e03eda10237d5b68f4aebc5014689c197cb510c963801cdb88729ee6fb52d38b532f9e50a563470360e2ef4fae4ebded4d540bf4111b866c12130278eda1
+EBUILD mariadb-galera-10.0.34.ebuild 5513 BLAKE2B 412007d9afe155237e15f4e4368af04034cf1e7844c464693a86d0e220941fccd7cd3ea6e90312fb4dc7e84dc916ae1fb1ac961c5306ab8f69299fe08b42e6f3 SHA512 9517231142d4da14839309bd4a2c0a12b04962e84ccd255030b7fa757b961af58c619f2310e706bb9663cf98d890ca7809df84370daf71ab153994104eb23e39
MISC metadata.xml 1848 BLAKE2B 8046367163d7adcf0f31b9972486ed3d6fcf157574b775f1ad871c67d28998777fa7b03b10cc20d7fa85adc7ceb7910f90f25480546ac78f3d47d4be2685219f SHA512 57f604c9f265f3b4873b681fda8005a0241bc8474bf966b83209ec56b3de70172a70401f2ac9818068ae79656e78b1dfb13b616f3ddc9254669c1ccdc43749aa
diff --git a/dev-db/mariadb-galera/mariadb-galera-10.0.34.ebuild b/dev-db/mariadb-galera/mariadb-galera-10.0.34.ebuild
index 2279222e828d..46f8aa0649d6 100644
--- a/dev-db/mariadb-galera/mariadb-galera-10.0.34.ebuild
+++ b/dev-db/mariadb-galera/mariadb-galera-10.0.34.ebuild
@@ -59,8 +59,8 @@ RDEPEND="${RDEPEND} ${COMMON_DEPEND}
virtual/perl-Time-HiRes )
server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
"
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
-PDEPEND="sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) )"
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) )"
MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h )
diff --git a/dev-db/mariadb/Manifest b/dev-db/mariadb/Manifest
index 8da3249ac21e..a0b7acb2b589 100644
--- a/dev-db/mariadb/Manifest
+++ b/dev-db/mariadb/Manifest
@@ -7,10 +7,12 @@ AUX my.cnf.distro-server 998 BLAKE2B a7f2977a96d394cb7e24d72d82a1c21095c4b55607e
DIST mariadb-10.0.30.tar.gz 63433598 BLAKE2B ccf5b1650a4134cdcdd99bf52b0e6441f3255a938bddc050418ac8766e8301dadde92e7a349fa6f0b9338304790121ace7d5da9fe8bb86f2ed553f37809c8daa SHA512 b9f4bdf2b19edc661c80b0c19b09979ad765e6a7f76e038436660d29bc05c2c9882c39f557aa407828ba2917632a9a0f6a96090279912e78f04b54ca2d9f14e7
DIST mariadb-10.0.33.tar.gz 69211872 BLAKE2B 02efa97a75ff13655e9a6d6ba562c4d14bd749b4873ac2f783f32494104f00517c2af63805afa552b6ba707aa412d61b8b3561d5d4d534bf9ad5c6f67b33cfe4 SHA512 9369399553ab336ba1ab20393b69fe5ba49e88ff86d9a448034a9d521e8d85216eb1093e040dd893fc2fb15344da3d57995074bd489be66a3b1457abab097104
DIST mariadb-10.0.34.tar.gz 69266294 BLAKE2B ee8157d1b4d5d4cc096159efb3a20321486092eb28f35d120ee99b2260e52f46d1803b62df29a4fc905de23aa009dbb4666e8457903d97d5fdb14dcbfdda4b2c SHA512 46539ef37ec3b2fb00e7d546f3bbfe48eb86d0403d33e50b1bca40c145d69ca3ac8ddaa72ddb0c1f0aa41f3177aedfe1c6c0bdb7949d47efe49aed3ed52bd47b
+DIST mariadb-10.0.35.tar.gz 66551252 BLAKE2B 69cc9c78f7c47a4b1760940cb0f395b4053fcc47c1087a0c2af873d4a998ee60915e1f4e64f7fe6474c7c1fa3dabe48a3b6621c67893b20526f01e56b0542e7a SHA512 01fc8d48be3f3847bb222835436ab938c6c5b5ac8ba6cc87b3b6d2a2201b7ab4b152dc1f7d9749c89de90097d50052714ac08aafbbb117fffac32bfb47e74779
DIST mariadb-10.1.24.tar.gz 61780687 BLAKE2B 38df67a1b26aab559e41f44b129f2e57388634b80a8b10637744c3d11f9cad15329c9a1725cb836f7249352d5bdf9471bc9c3f254e1ef96229716543f235f7ed SHA512 0b8d81b53f6866a81f33559ce57ebf956fec3ba25da0bd58c8bee3b2ecc00a6c370340000209d18463f84501d3ba35994b51ef99224616c37cd38d2fc87b73e9
DIST mariadb-10.1.29.tar.gz 67885370 BLAKE2B 40b94ed519522f16ee4687a9c569a0e52632d2aeccf65b87070de31118bf5e719cce78cf36afd4f1386166b14e418e0262ffbc3a61098c95e6ee101faf871ec5 SHA512 c169dfa2878f9fa9e0e9d12ca79fcbfa644e9b51bb0b78b8dd51d6c5679f3184d139fa96a1ddb25f3ae5d1c0489708c2c624f96a24020f77bf7e5247fac45ecd
DIST mariadb-10.1.31.tar.gz 67982786 BLAKE2B 1fabbea67345024157be4be34a50c4e9c73b1a60def452321b6e9209d9fb16aace92e7ab1c37c168e5c9f6c52b623245e9df3171ce3f84e8fd0e840948b3e57f SHA512 db37ddb8ae5daf35b37d5132860c19c4a9b51c40005d05c5107f956ac5b4ecd447375b6f3a09bf59ea5aef2f4009314ed6e969ca2ac516722702b4da286dbd89
DIST mariadb-10.1.32.tar.gz 68001321 BLAKE2B 8ecdf12b10697576b3550d962c6090726f515e0f1f99f786e2b8882e1b81c053e9e43e423f83afd6955357ef85cd539db6fb1ff613d3c553f2f3801293c7ee07 SHA512 fcaeb8005b08b3ac5b7c070f07fe669593bd8a2eb8ea1bbdcb4d8e9ba4856420039f39542ecf920eec352ee4a26179899f9c6cb1f9f26040f557ae4b4b63660a
+DIST mariadb-10.1.33.tar.gz 65292094 BLAKE2B 3223f9476e946112f7c1d23cc82ff52636801244136343413ae00336173ec58bb4af8dc36e065f6cd27e9aa3f9f999b1d19f9257b928bd92555b34b614b9cf76 SHA512 1d30e06d0c19e338bfbbe6815cf5eee8e1b839b525950f7f54c7cf8f89034658a284df4756f54719ab0f55875546d4713b03bab7dd094ec13291732b069f737e
DIST mariadb-10.2.14.tar.gz 72607526 BLAKE2B ca0c73e30e15265a7a1599d9bd4b64e030aaf92fcdbe18fda39eaf071c88c90b32a16ea5d9c63130e3853572a30a0c5870e6389e6dcb2a3eb690311cdb9bde3c SHA512 12195cc8c7a97619024d6b8b37558a43f4f543efff257a7a3dbb10e8a6e064ec2f0740554cf50cc83576b74ba355cf00f3c99855bc2bcf68b90c1fa90c850026
DIST mariadb-10.3.6.tar.gz 71064269 BLAKE2B 681150a26de95cc276276a9b8d0b2c6e4a842dac80f20c2e8b0caeec5823cb956feffb494d18b1f2832e220c392c437424813de7720fb83a5d5c1fca71a4aef9 SHA512 cf146752be5857e702a3c88f42c7b6be3117bd92ac304eb217f902c1ffe478dc3043d3cf6a9a9305b51babb3bafc2612a8e4f5dfa7731cfa53634014d86438d1
DIST mariadb-5.5.60.tar.gz 45822878 BLAKE2B 150a2d7108db2db18d66b56d961b05f8746f744e9453e341fde21f93bd846a3091a44c5df3baed6774d0ad12b8dc806b9bfdd177b4149f5be9d37af2a298f807 SHA512 eacf6ec57d46b00701b5038a67745174060d592b0e425466149c9a1b6dc1ac0659a36e57e82bf7e9f7865d8eac3dd50d0737630bd6220002d168b5b574437e4c
@@ -22,11 +24,13 @@ DIST mysql-extras-20180308-1938Z.tar.bz2 318238 BLAKE2B 003389434dc52d5e49be77d0
EBUILD mariadb-10.0.30-r1.ebuild 6874 BLAKE2B f599097904869476a5a30ce264a2c27683ae1c59129bc6c4e4d73d5268fe5788027a2f9056309a9b97fa00881f63b7f8b88560f38272866d0d89767b10f602dd SHA512 370fa3e79b5aea1b89e2136da06a3d7b3a3bcfb49dfdcf030346764fbcee81b4c365e43be6a994e4bc6ad067aba126bd4be66ec94096dca25eb45b8fc0a136bd
EBUILD mariadb-10.0.33.ebuild 6718 BLAKE2B 46e9980c6d4143e621aee1341b88b8021bc80e42faf54f0f7dd8a9c830ba88939a292016cf07c9e39a2c3c2addcd7de6d7724d3404cab8daae4002fa81a98f7f SHA512 f46c1b1e827d283d930ad6a4059b4d3e8f8ab5cf9bbf33c0f985646119b000eca0474f2447d0bf6dd22243b859de2496e29c5b9b862ab3f8610cf5fb3a674bcd
EBUILD mariadb-10.0.34.ebuild 6719 BLAKE2B 207819cf6c1801e61b35d45f554398db561359cb0520dda02125e2dbe249ae44214cd35481cbd00bc71fc18a66eedacf6d290451a8e9658dfe259c6f6994e00e SHA512 151cb1497b83db5ead56643e41467469e1abd8390e30bac31a49d75889f4fc37c6a354f0f226f66f02feb36f558b43e7592ff718bca94c085da18e6674e40fab
-EBUILD mariadb-10.1.24-r1.ebuild 7175 BLAKE2B 6d92e08b3197423710e91f0f56e1fff64b694204e40d4a89ceeee742395965067f4ca4dd301a832db5db9804237e6f9aa5da2b6840fdddfc80aee768ce32c804 SHA512 3c164ee1598deb014be1dad3ab4f11d20e4a560cb19b34f407db51ddaedb7a24f8c9910a7d4f40adc6f552c9db5594248e273c8cca13e9a3a6cef26bd83b23c7
-EBUILD mariadb-10.1.29.ebuild 7305 BLAKE2B b5828f97361eb989638654f3399e1a036c12356c5cb90c2e62caf1055497b6f0e1c4f3587d1fe599d2da4cb1059c5aa676109e0aad88306d8136753c22c87854 SHA512 a0b25e416d701f557a017c4b6c454c6359406da3c43da0dda3c892020961b27888412582a892fedce4484c4412ce774fab45f868074b7ac053ba530339288337
-EBUILD mariadb-10.1.31-r1.ebuild 7804 BLAKE2B 67d90c7ef1ef2f1f93be7772a7d7495f0c7f3d24079ea2c4784357cd269b3e154a03ae9d9e96a68e10ee466adf41fdfaf509f3c7a497d990e1f38abcdab22d35 SHA512 b307c86ff8908afd2ad7b3969f7e98b3397407e0df669a1d0ae75d8a7cf29ba59c1ac556d182284f86fbb722f758f022e1877ec33ecfae449302448b803a0f18
-EBUILD mariadb-10.1.32.ebuild 7746 BLAKE2B e180454e92e0d59b5d4aa2c4bebd4df0e7dbdc4cee8f48b008efaba06086a7a221d89926356afc97187386527a332d7f59c0d15e1dbe8ae113050354026e4c72 SHA512 f54f62ac128d9b03bef2f67eb2e35cdcf85f22b212388263c86bbf16108196cb689c08f67d7fe2cc1c259921357bf6aac364954a321e45ff710fb58493399c85
-EBUILD mariadb-10.2.14.ebuild 32954 BLAKE2B e88b0bf8492b22ad896af8c2934c7d21433d9a6da44d8f0e9dd40395fdcaae7336833dbe1f26ca0ac407a8399e084e77dcdb1d48401478204a424b5c1533a2dc SHA512 a1ddf8ceabf13882ea2fd962181e0a7003b00211143b194ecfc3668ba8631db8ef1fde99b00527bdfede2225ddff75e6ee97afc082841075f56eafd27c79fe01
-EBUILD mariadb-10.3.6_rc.ebuild 33323 BLAKE2B 0619ee1f8972e1d3b56a20967494ef0f0cb512021452aba0d6c0e31828311864b989e1862efc754c6a184ab7d3dab4fae950b6ebc29f998d96c6a6bbb6397b8b SHA512 0d0e8e52c7c50a850c91896d5a7a53fc169803b3b5a3f141c42d9edc2d67e8fc1a2851c0e08e6fcaf721f53728d6d614c2e6228346efbc8b616ad69d18954d9a
+EBUILD mariadb-10.0.35.ebuild 6762 BLAKE2B 847296154e6ad3e3f4ec37bb773755cd395817a8360da0dbc8a7e2b54fd865dd548e65d6291bdde7001b0a8a4c7422538e02128a50562654f28a3a3e006953fc SHA512 80ada9ea2cdf2884b36e49c13d8161e0e2b099f7b2f727d2123a5f20404761ec60289b4b5dd5ac4283718ed231e2c22f4263feb694466b8c0421b9a51660ff0c
+EBUILD mariadb-10.1.24-r1.ebuild 7191 BLAKE2B 345cfd4108bc191b749989d44bcb39842225011411d7cc8ea55b85941affe2f12e938911b958f7223bd4fbd6cc8b88d1c972cfb6c586f1dbe42a9e78184e243a SHA512 50e37053275b85e2fb6464a6e1e81434ec365e4963bddd73037663f7878d4110b5bbac1700cc35c4c5c559cd5fe6de303b5f81718887fa655786bcc3209fd08e
+EBUILD mariadb-10.1.29.ebuild 7321 BLAKE2B 55e437ba42c4b02edb500952e54827c8a168c30e310ad1ca5373075a053dadcab325716bd2b9cea20d1fd8ee618604b45778e5fe7008a133dc7bf8bb20d4ab24 SHA512 e40f6a200fc6914603ff5b4ca8e4e4c645a169e79bc96904a67a264c0172b83b3c54ab4f8394ee7ccb560e468500692544201c07df97cf64c1907185fd3d4276
+EBUILD mariadb-10.1.31-r1.ebuild 7820 BLAKE2B 1e1ce7d9733467b79e71ca16f2d124f6644ff744b43734d20e104198e35259a2b736b9b7963ae9cd84d22279d5d0b00ecd3449671d20d7b66e95b02ffb0b7e87 SHA512 d74968950d6aeb0d37b406afb7e914cd9d071d51000a095c150068cec60fedd50356dc22b30705e016eb6b76062a05253e8272142922d500d978b4214b7e9b13
+EBUILD mariadb-10.1.32.ebuild 7762 BLAKE2B adcd84563e2e168b1a0b492b72e4c5db4268f89b4eef4a201f4e77e2c98a0d90c9587ea321783126dc99fd0addae1d6d69ab50f40b180da1ddc0b4546b68936d SHA512 7b673aaebe26d928a14dd7eee57cc6cfbbc549d4673e02dda9ccc91d9579f269f4e57146bc2dbcc5c32050459e8dea533d84f58c7655236865044fb1387cabcc
+EBUILD mariadb-10.1.33.ebuild 7802 BLAKE2B 20dda9f5fc8efe81c19784252fb13683933b79d2edd5e85703b2df42fbdb504b406327fa17a651f561c6aab5b9439bca69e260ca863ff050f41d849ca7243ad5 SHA512 f0b1447659f98f3f6b5867caa9623fa14e05a5a687a242e6d5f49738765e4cfdad56b118def26c831711d62988d77e5560bfc85762b4ffdf096d5e306f4e1d6d
+EBUILD mariadb-10.2.14.ebuild 32970 BLAKE2B 8b1ca349b93799a0ac273092287c0c5085aacd85badb16e6cb0cbc1f7acef22c57e6fffcec7497c5ab02932910db772f86159139d8cea0a597f40d087de0ceb0 SHA512 1a112e9401a9cb3fe458852816ca6a799d9941724ab989cdff3ca7f36661dcee99f0961b0bc773ae47a5d12bde5f809b1f6eb63a947b87331218a2faab55021a
+EBUILD mariadb-10.3.6_rc.ebuild 33339 BLAKE2B 5c62a08062212b83f649e2aaae97827b1323667a180a145ac4325ed7b8592576fe1f6e04ea3ab36a51d00a12918ba2bf1a095816ef7a760d32d7bbf07baf94e4 SHA512 515355b9b8c940407a2b2b3f2620480a0641059cbe93405825412108b39222d73a5e4857f9c8fe94c2dd9af971af65af79bddcc4130cc10090971d3650f3a65d
EBUILD mariadb-5.5.60.ebuild 4254 BLAKE2B ee31137be4020cdb3626a93981eb2c667b4c9f8a543d52e272f4c2721f8ded71305a1caab6319a3a7cad25cbdf17a736abae3eb01062ffe5cc54c66da1b9703d SHA512 9d9ffc8ca65d6e4f7a64f4e6c1477096d46404d3a4401db1687ab5507452bbf4afb294667a2b01f7db8ba6953b8d935a40211fb006273462723846b960248920
MISC metadata.xml 3172 BLAKE2B 9b546b51359c0881ee5ce452c89e788ff27300471433fb9d1eb28b3f72d47cd84787eac1d7fd536a8133aa56dd4dd9c1139afb4b3e83b463ce12b7d6cb0fa35f SHA512 143381d9443b778b4f8fb5545c6e8ac59e54eaba20458eecb757e292650a1fd5a470ded204f25c173f456cc222bd32f8b9885e00ecb00c9b4abfd639c9e98391
diff --git a/dev-db/mariadb/mariadb-10.0.35.ebuild b/dev-db/mariadb/mariadb-10.0.35.ebuild
new file mode 100644
index 000000000000..ae3a0089276b
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.0.35.ebuild
@@ -0,0 +1,210 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170926-1321Z"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="bindist jdbc odbc oqgraph pam sphinx tokudb xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+PATCHES=(
+ "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch"
+ "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-10.0.33.patch"
+ "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch"
+ "${MY_PATCH_DIR}/20018_all_mariadb-10.0.20-without-clientlibs-tools.patch"
+)
+COMMON_DEPEND="
+ !bindist? ( >=sys-libs/readline-4.1:0= )
+ server? (
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.41-r1:3=[${MULTILIB_USEDEP}]
+ openssl? ( !>=dev-libs/openssl-1.1 )
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DWITHOUT_FEDERATED=1
+ -DWITHOUT_FEDERATEDX=1 )
+ fi
+
+ # Connect with Zip is currently broken and does not compile
+ # Reported upstream https://jira.mariadb.org/browse/MDEV-11809
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ $(mysql-cmake_use_plugin oqgraph OQGRAPH)
+ $(mysql-cmake_use_plugin sphinx SPHINX)
+ $(mysql-cmake_use_plugin tokudb TOKUDB)
+ $(mysql-cmake_use_plugin pam AUTH_PAM)
+ $(mysql-cmake_use_plugin extraengine SEQUENCE)
+ $(mysql-cmake_use_plugin extraengine SPIDER)
+ $(mysql-cmake_use_plugin extraengine CONNECT)
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITHOUT_MROONGA=1
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if use server ; then
+
+ # 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 && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # 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}
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help, funcs_1.is_triggers, funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql main.bootstrap
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+
+#main.bootstrap \
+ for t in connect.drop-open-error ; do
+# main.mysql_client_test_comp \
+# binlog.binlog_statement_insert_delayed main.information_schema \
+# main.mysqld--help \
+# archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+# funcs_1.is_triggers funcs_1.is_tables_mysql funcs_1.is_columns_mysql ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mariadb/mariadb-10.1.24-r1.ebuild b/dev-db/mariadb/mariadb-10.1.24-r1.ebuild
index 6340ea651b31..1e63d720f7b6 100644
--- a/dev-db/mariadb/mariadb-10.1.24-r1.ebuild
+++ b/dev-db/mariadb/mariadb-10.1.24-r1.ebuild
@@ -74,8 +74,8 @@ RDEPEND="${RDEPEND} ${COMMON_DEPEND}
virtual/perl-Time-HiRes )
server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
"
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
-PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
/usr/include/mysql/private/probes_mysql_nodtrace.h
diff --git a/dev-db/mariadb/mariadb-10.1.29.ebuild b/dev-db/mariadb/mariadb-10.1.29.ebuild
index 0d36f069a0e8..4418e76ddbe2 100644
--- a/dev-db/mariadb/mariadb-10.1.29.ebuild
+++ b/dev-db/mariadb/mariadb-10.1.29.ebuild
@@ -76,8 +76,8 @@ RDEPEND="${RDEPEND} ${COMMON_DEPEND}
virtual/perl-Time-HiRes )
server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
"
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
-PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
/usr/include/mysql/private/probes_mysql_nodtrace.h
diff --git a/dev-db/mariadb/mariadb-10.1.31-r1.ebuild b/dev-db/mariadb/mariadb-10.1.31-r1.ebuild
index c8a9ce24bc7b..7b86ca62c035 100644
--- a/dev-db/mariadb/mariadb-10.1.31-r1.ebuild
+++ b/dev-db/mariadb/mariadb-10.1.31-r1.ebuild
@@ -79,8 +79,8 @@ RDEPEND="${RDEPEND} ${COMMON_DEPEND}
virtual/perl-Time-HiRes )
server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
"
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
-PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
/usr/include/mysql/private/probes_mysql_nodtrace.h
diff --git a/dev-db/mariadb/mariadb-10.1.32.ebuild b/dev-db/mariadb/mariadb-10.1.32.ebuild
index b0ac461ad4d9..c436772d9d76 100644
--- a/dev-db/mariadb/mariadb-10.1.32.ebuild
+++ b/dev-db/mariadb/mariadb-10.1.32.ebuild
@@ -78,8 +78,8 @@ RDEPEND="${RDEPEND} ${COMMON_DEPEND}
virtual/perl-Time-HiRes )
server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
"
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
-PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
/usr/include/mysql/private/probes_mysql_nodtrace.h
diff --git a/dev-db/mariadb/mariadb-10.1.33.ebuild b/dev-db/mariadb/mariadb-10.1.33.ebuild
new file mode 100644
index 000000000000..ce4d15d2d12d
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.1.33.ebuild
@@ -0,0 +1,243 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20180308-1938Z"
+# The wsrep API version must match between upstream WSREP and sys-cluster/galera major number
+WSREP_REVISION="25"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="+backup bindist cracklib galera kerberos innodb-lz4 innodb-lzo innodb-snappy jdbc mroonga numa odbc oqgraph pam sphinx sst-rsync sst-mariabackup sst-xtrabackup tokudb systemd xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mariadb-10.1.27.patch
+ "${MY_PATCH_DIR}"/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.1.16-without-clientlibs-tools.patch
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch
+ "${MY_PATCH_DIR}"/20029_all_mariadb-10.1.31-enable-numa.patch
+)
+
+COMMON_DEPEND="
+ mroonga? ( app-text/groonga-normalizer-mysql )
+ kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+ !bindist? (
+ sys-libs/binutils-libs:0=
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ backup? ( app-arch/libarchive:0= )
+ cracklib? ( sys-libs/cracklib:0= )
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ innodb-lz4? ( app-arch/lz4 )
+ innodb-lzo? ( dev-libs/lzo )
+ innodb-snappy? ( app-arch/snappy )
+ numa? ( sys-process/numactl )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ systemd? ( sys-apps/systemd:= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.41-r1:3=
+ openssl? ( !>=dev-libs/openssl-1.1.0 )
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ galera? (
+ sys-apps/iproute2
+ =sys-cluster/galera-${WSREP_REVISION}*
+ sst-rsync? ( sys-process/lsof )
+ sst-mariabackup? ( net-misc/socat[ssl] )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ local MYSQL_CMAKE_EXTRA_DEFINES=(
+ -DPLUGIN_AUTH_GSSAPI_CLIENT=$(usex kerberos YES NO)
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_FEDERATED=NO
+ -DPLUGIN_FEDERATEDX=NO )
+ fi
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_OQGRAPH=$(usex oqgraph YES NO)
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO)
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO)
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO)
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
+ -DPLUGIN_CASSANDRA=NO
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO)
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ # Build failure and autodep wrt bug 639144
+ -DCONNECT_WITH_MONGO=OFF
+ -DWITH_WSREP=$(usex galera)
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
+ -DPLUGIN_MROONGA=$(usex mroonga YES NO)
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos YES NO)
+ -DWITH_MARIABACKUP=$(usex backup ON OFF)
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF)
+ -DWITH_NUMA=$(usex numa ON OFF)
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ _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}
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ touch "${T}/disabled.def"
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+
+ local t
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do
+ _disable_test "$t" "False positive due to varying policies"
+ done
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ main.mysql_client_test_comp ; 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-list="${T}/disabled.def"
+ retstatus_tests=$?
+
+ popd || 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" ]] || eerror "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
diff --git a/dev-db/mariadb/mariadb-10.2.14.ebuild b/dev-db/mariadb/mariadb-10.2.14.ebuild
index d866c8cf098e..893927aa1797 100644
--- a/dev-db/mariadb/mariadb-10.2.14.ebuild
+++ b/dev-db/mariadb/mariadb-10.2.14.ebuild
@@ -140,11 +140,11 @@ RDEPEND="selinux? ( sec-policy/selinux-mysql )
"
# For other stuff to bring us in
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )
!client-libs? ( dev-db/mariadb-connector-c[${MULTILIB_USEDEP}] dev-db/mysql-connector-c[${MULTILIB_USEDEP}] )
server? ( ~virtual/mysql-5.6[static=]
- galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )"
+ galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )"
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]] ; then
diff --git a/dev-db/mariadb/mariadb-10.3.6_rc.ebuild b/dev-db/mariadb/mariadb-10.3.6_rc.ebuild
index 420372960c2d..1f583f11a9d2 100644
--- a/dev-db/mariadb/mariadb-10.3.6_rc.ebuild
+++ b/dev-db/mariadb/mariadb-10.3.6_rc.ebuild
@@ -149,11 +149,11 @@ RDEPEND="selinux? ( sec-policy/selinux-mysql )
"
# For other stuff to bring us in
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
-# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+# percona-xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )
!client-libs? ( dev-db/mariadb-connector-c[${MULTILIB_USEDEP}] dev-db/mysql-connector-c[${MULTILIB_USEDEP}] )
server? ( ~virtual/mysql-5.6[static=]
- galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )"
+ galera? ( sst-xtrabackup? ( || ( >=dev-db/percona-xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )"
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]] ; then
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
index 46bae5cf636b..faf385eacd1c 100644
--- a/dev-db/postgresql/Manifest
+++ b/dev-db/postgresql/Manifest
@@ -15,27 +15,37 @@ AUX postgresql.service-9.6-r1 1477 BLAKE2B 2a652d5b2892f3a52f484fcc0b4f4dad09cf4
AUX postgresql.tmpfiles 39 BLAKE2B 25a5725af53c8e4e4009887e998172dd863ce218a5438351194548c4fc8ea15308dfba3602d5a922cf49b46015198268a4a4528119d8a74dcef4cc4c1767c052 SHA512 498060f2a597cf374f4fb31deaa2d6c5b00edef68efc0e71b82bfc20b717ae12518ba18fcb455a0c518ebba1a0868f38321470616151d02fa79b889a66dcb9f8
DIST postgresql-10.1.tar.bz2 19669989 BLAKE2B 2fbe782023b6d55c6fadaba38e517c60038b3b7b0a14fa8793043f7b9c4719a692440f286bb1f898045b5f56ef1c064f97f36e821990755077dc8d9bb0dbd639 SHA512 06050d353aa43f32e0de0199d833d8a4652aff893b718b1c40ed31837838f73fe4d977ac0f2164ab97b3eeff4aae3409f440601740898a893877d96bc0ed1882
DIST postgresql-10.3.tar.bz2 19959653 BLAKE2B ba3b05f53b0f879b18d6d0649bf819697c77a066b49d941a96d13a4741854b01aeb0c8b868d6550a08ad52572c9463c968660aa83c16cbaa5b4bf7a89387a524 SHA512 05cf82d3483bdf38734e6ff0fef6b80e7f8fd3cb5ea6792ffe222a599d97d1a29638970bf28ebf5bd1f877e8dcd9986d88f5c5e5379e74fe79ce83e20d2babba
+DIST postgresql-10.4.tar.bz2 20201838 BLAKE2B 6d1cdc44547740c8f9fbc2e989364640409c6d2a365568b75731277dd0fba473ce07e2ee27e8ebfad507a6ce0ab3d3a44156c0e3a069d96d320771d8a97ba82f SHA512 b7c0d2fdc724e2eb1cda9fc1eb01b47352bbe6ba6357b3e898b7f5990fd78499c8c68dcb3aa9bde7821d71b5882d8856131384e899f8055d89d51cdfdbc9e663
DIST postgresql-9.2.24.tar.bz2 16552576 BLAKE2B 15e1fcc72830630c6c919113ed53c30c08f97c2543e678cac914b86456434d036f2efc262810e8f7ca0be714a8f690592a271ea5f6fb39777e73e94a9555e0ee SHA512 a6f043e5ef5e12e23c1c43b26a5ecafce62f3a86f38b5b85e7cb0cb7aa376d40e460a526baf67ae40de40525e4744fb5e48650ee5e007db4ce9742fcf548bd56
DIST postgresql-9.3.20.tar.bz2 17197360 BLAKE2B 2b07f6ee78294a490a8902d0129ac6b5e729e2d9a30631becc193cb7561294354a779ffc62bd61e807b1f540f01ce095e8ae4ad77adf2ea135389143809c9d48 SHA512 40098661bf00b64ad2d773b242613c44fe269b5ae984ad8990f85ce705b27138b127493c507103052fb6705d52f2e63a1df6692c7024d43c3c6b18154f2ef407
DIST postgresql-9.3.22.tar.bz2 17022938 BLAKE2B 198705e438717d0d9e12c73e0c0e3eff0ba89ea50a1b183de70f065e13c153c164890fe56bc6ec13b0cb9617df4f66894c122eeddaf9303b9a02b8e08b19b085 SHA512 667ff496172626d2fe35c6795935fb07f4f7967a3b0631dd3b96278f8dc00b3d08794f091a5ab060a45d6f2a861e0f10f0e9660f9e343ab34eeabd693104c47f
+DIST postgresql-9.3.23.tar.bz2 17033683 BLAKE2B f02ad25f6b8755a9a57c3a6dcb63b78672e29473b061ad1616be2fb97fbfd83fe0dc9fc9fda66ac0231fb30fb13f9ef8975ba5a9701d83f33495bcf2c2651b4a SHA512 bb2d54312de728aa0379ea5bc6385036bbe69d3b7f85bbd78c210840eed19ace29840849caf38d0689e21130a0c94818a362b3927805d8eded53b68e240a52b0
DIST postgresql-9.4.15.tar.bz2 17921677 BLAKE2B a41c81c7acc92265a6558c26370ff2afd258922a7158bbf40f8b1d6c7a3dbfb548502f42d646c96982dd5a87e5991f9d03046ae91e216704b97691666966d795 SHA512 be69f184cf18fb4c611d31a128f3593dc537551606f1db84a3ce9899b72f546876f05b29792435c3780c6c2b571759f4db2c172d62b2c012bd58574df80b4eb1
DIST postgresql-9.4.17.tar.bz2 17807762 BLAKE2B 7640c29a71c6aeff47d9b43dd1e4f52edac4295b646b34da3a0ed9c26a8a826061bfd892e9907b62f31b7f01ee3aaf437c88d79b84d1d786d608dcd088309ecf SHA512 9ac03d460e521dcd142ac463dd5bb0f3e3f47333367bf8d61499ec7e8d0129d338c6f111667d0006df0c8ced9ae8a337d4c1b40eb5f55e6bc8dd5a24dfd376f0
+DIST postgresql-9.4.18.tar.bz2 17828085 BLAKE2B 346584e7d74264a7d58b3793cfd6247ae3cad3bb946bedec8df8d97278ffe6f8e881d31ad50e9f5d622aa4ae9b9711b36258bb60d520bb9a1d458af63c343e9e SHA512 2e64c3130c3dfc5183a77d72f61714bea34bfe549f55720eee25046e00b913a7effec3d7e43a021766ac957c1fa3c8c5e6c26ccbd8be1b434ae618e1fe9daab6
DIST postgresql-9.5.10.tar.bz2 18701419 BLAKE2B bdd9a191f4de2ba1cb501476a5eabb377b60899b524f50e5baa1f47b95ce491634b7e69a9c37017614f48789d2b97fdff98e0b12ea06611d1ca76988a8db62c8 SHA512 24e31adabb0b88be882ab0440c560f0e4d5d69203be0581ca0ce22316555d92219ea0a2fd5254f12b2508bd3e58bbe0f1a7c8837228c96d9d5f00caac45af95a
DIST postgresql-9.5.12.tar.bz2 18589538 BLAKE2B 4246eb2bf5fe2e3bb48bdc411ebd3c87015570f0be4d8b1ed2a0f2ed20a8374e3244fa0aa17f9145f4f951c88f5b0717a4dd2186bf1621ce3334789f5f8dd50f SHA512 ab81bc95fd587f76a1986db5616b63d861b84da0eb9e54478f5298248a81d7a608d1bb1a9e30662c8190d05630106ddb3bb6413c34b003de948417214d342654
+DIST postgresql-9.5.13.tar.bz2 18600185 BLAKE2B 7560f08648ec1417d304aa8c53c3220d7a4b2fdaf2cb4920a0196273466d1dbab4c12dbceb3dc9a136458c0089dd5f5dc595c95353584d49da0d2ab6e7903bba SHA512 807b22aabee38326934213de04b782a6b22cd8fe5c5bfd8b6cfa44281924527a715dcd78adbee276746446a7b05036b4714b00a16c650027543dcbafe1888082
DIST postgresql-9.6.6.tar.bz2 19605724 BLAKE2B efdb13a4e32133b31a0ee368aed9bf76f0511596a2d77ade60129c2c76b0ba2c7dafad532cf09ae007d7110175a153968cfa151cf8aa7008b59d36ed00ed18ed SHA512 ac2f0fe6ef7c4e14f85cd7592d1306d9657b7f35efa6f43a089d7785ab970b8c25aa1e66d83df056c23513d6dbac0a9f54717b3d85758560d02e7f8141914ebc
DIST postgresql-9.6.7.tar.bz2 19504886 BLAKE2B 04ed26987f3a38826b7e04bf364d8f59fc93aa700fdf74b4fc6afdb2fcf12697945c8354e49507af9c4d48fcc05173182cb164778c97845bf84250fd9e5ad882 SHA512 6a66cdd5b74ea6dc95628b89bb7663555370be56b3e938f635950628ad5d77443ac8f40c747be1fc1cfc19ca8b0a27f41e52fe4db83a43c7a7bab9bb076c7844
DIST postgresql-9.6.8.tar.bz2 19528927 BLAKE2B 6aab5dbe4b13e1624befc33c2fa5241804dff71879e2d60c166db19c2fe015cd19cfc35054e6aede82bfe6b83a7146b6d2eedaabb94111c163da732526ff1723 SHA512 6b7595c0046308c725d77360b156e979d6bc469b78ac6500f631112f19b2607ca2d816781f8c5fd3bd835c48e079e79ada7af687fbd306a8fec5e160f20dd211
+DIST postgresql-9.6.9.tar.bz2 19566222 BLAKE2B e92a5ffaa8f4400364a174fc21ab11bb18c96dce9be721e6073ff7ad21b828859c2ac5fe8da81cad6a3d2a63a62d8fcb067d4bb02a9d23903525ad1f78955470 SHA512 3ce2a8f3a017d9c0bd0f1b475a9ee02bcb6a4119b0d436757911f444f49f5024bb1a1be07ce16a79e71af77799de1bf952b32279b4566bae075f23a50b8545c6
EBUILD postgresql-10.1.ebuild 13697 BLAKE2B d356373a27d27fdd2447f93691847816fd089019206d7371cbd6c84a513b6d490b20278232769fe1de63d60d6bdd1e0ff9afce5fbf7b0da66296a57167d689df SHA512 65bbb3d9d6e64dbf46d8d24c0aacaa930c417b262fa01442cdb09820bf47d37e81fa272e5afe808cb96bd5a3fdad3d23540c1d08a2d5a8de8bb6e8f4b0a3db11
EBUILD postgresql-10.3.ebuild 13691 BLAKE2B 8414d44a4af307caa14e06d3b34e631ff4a1ae5a1a5c9311dc57f5d97998f3743c9bab734d03d8246f6966b3e57f0df94f1c403e6247213fe160d65da781ffeb SHA512 582ae144d826eaf3bda9a8a170caf5b75d7e7fdf362e2f38e605e150b4978fea72be0f4b0e28b9a531aa3f88c3b4ed317e2fa1fa5f397b463a431f295964fb72
+EBUILD postgresql-10.4.ebuild 13698 BLAKE2B 1a836945073f8d6bbb1edec840a188e322765567463df31dbee81c18e1fdcf1f4d0a9165f7a9666efc94bd82cee4cdc5d17f87256a9867647908c1865ab60d7c SHA512 b6596e599263774973f38a5158d2e679e82b5081e685e60d186c36ecf564e1328d123e5f0b6e6849e66a9ba8dee810d8073482d86acc321117e3f9602e619a0b
EBUILD postgresql-9.2.24.ebuild 13483 BLAKE2B ef135a71dfb8f2349c106ddfa34c164058567dbc516d269487dba7b686200ea43e22ca18d5259d6ec321bbff4eb3c369faab14bdce558ecbaed424469732f53e SHA512 0220041ff150b574f7b2a7de0aa902813251abc192521e343f17d8b4aba1cdfb4c95545c8432372dd6bbf0b16c9f0628079dcfadd1c519f840be9b51bbca5444
EBUILD postgresql-9.3.20.ebuild 13742 BLAKE2B 8c6a98061068a6ee781f77fa994c683d80c2c7a1fc4ba7b7cf08a8a4932ff6b7d2522563a9da03b537034da7ecc84b3ab4974b5d1cbdbdab9d64f0e24779cc9c SHA512 21a54b6e8d4483bd15b464e6ab23cc04dbfe2b38fda30131b0d5c26a6cb156aca3ddd09b7228b32b64e4edadd9f24fe0a779efa9f04e633078a4153fcb11086f
EBUILD postgresql-9.3.22.ebuild 13744 BLAKE2B 18192645bd6ca52355673ab8f9567293250fdc4c802165d78c61ba1d1a3a1b92e7e6c2a67fa1754e1ad800d792030d358bcdda99b52159d9cfaeb58e20ac4122 SHA512 3b5143ae3600b936124ca2a008c538e0563d08ccc589a3177fe0dc5d25c35b379b9d704dbede0cfedb0ffbb293515f4625701291df6f31cff376fcf39f6393ea
+EBUILD postgresql-9.3.23.ebuild 13751 BLAKE2B 1730adadd67e5b93b7d3e3dd8db055e5c7e3f7e91db5069dc29075c6ab2dd96fa70df8b1c579e66425deb6dff8c19edc11b29c9634b4b5d2480a12d68bdd283f SHA512 bf08d33c60165edc38490d72c3694f1cbef6410ba5ad15dd3688dc809a6f944c01deaef2e6b78028771997ff627868c115f37bd229f46a3d89f064702ae2e187
EBUILD postgresql-9.4.15.ebuild 14552 BLAKE2B 5e343b4b7c24bfe2cab725491f41c4ec7eb12ca81595e268325adedad80e1266737ce3a18b5d4bd2dae8b3ebaf11b0ae55bed298aa9263eade7e2e7da00b3ff7 SHA512 afa0b8c349c8bd9c10b512f02c8dd16e6857d1a52acaa3ec7d695eb4ca3b7273c2cdcdc7b4b20f7c005570e4bdfd78126c890b6eaa60088ff9170cb5ec1b9595
EBUILD postgresql-9.4.17.ebuild 14554 BLAKE2B e24143470f9844174c241473671f9b422a3080d740048b532e9dda0cc8f347cd087845b01014b8ca3f6a3f96ed8389ed5cffd9f83c0bde6adc95ad02361da842 SHA512 4a5fc54ceb68528483bac90469ce1fa009e49a4f5148426633fff9f9b96799c1cd18aeb514931963905cd81d876d9c952fddd84405562b1dfbf8054e4cacd76c
+EBUILD postgresql-9.4.18.ebuild 14561 BLAKE2B 5256dc5e253fc837649426959ba6a710ef3b2a234b4088b46db08a35b2bacf5d45fba2357bd66c5c6e11a9e138d71d5495806d544fa4b60aca0a554656df1a61 SHA512 40d3a1aed466df25a5c855c420bced8741bd0d7cde03693ab7325c3d24fa64fda20db15c49e5f5b84b84468990f07ce1fd233d3e52e9b1ab9d8f28a3dffac0e4
EBUILD postgresql-9.5.10.ebuild 14780 BLAKE2B 988e6270060614715936959b06867137f0629884d98cb50643d7d0fc4314c8192fa4205125bb376b3d9ac8d0b17cbceabd89b79671e9bd78017ca13a7c40ecc2 SHA512 26f93ac88c51609e62ea3d2dce5dbbc63cf8ad52ac76f029a437befd907d17d5b343a77a651c362b3292f8cb81784c480febe3909431a2f24ac51b9335d0b149
EBUILD postgresql-9.5.12.ebuild 14782 BLAKE2B 778b7eddd38fbd46b772d4b8c26d131d5ba74c2aed3a3b601151f97548947759b546b58d9d926c3e5309c0dfb29acad4cb5ae4c207c33ec6ef85b59af6fb590a SHA512 fc2d167d0058c1134d0e40b57e7ba22846307aa56e091467ed8ea339235c5728b9ed969aac6c55196201af83ebc38f4739f531a5e069e19ecb82ebfcf723072b
+EBUILD postgresql-9.5.13.ebuild 14789 BLAKE2B d58a0098ea848973501beaa11e1842ca3cb9b1a0885c13966b51c12d6631f7060fd078219472402f55068cbcc64028d021687d7251540da618b1fb5693951924 SHA512 42bb6d13163d4cbd9ccbbd6dd1089fe8174a84df3d37d6d2ffbc3c2d65036ffbf75a3c7e022419b2cba7de7b4d9226fa77fb3d7985f8a9c9bc4ff5ff94d3d795
EBUILD postgresql-9.6.6.ebuild 14922 BLAKE2B 25182d0ccbf475123d876bc4ad825b9b5049b7bd8edd8e96ef7390ab8d371515df12cc95426ba503366e81fe04be01c3a4c40a688caeb60fdb972f8f5e7c8ec4 SHA512 385e3c883cfe4926be01f760205a4c0827f6f20c0e465a082cd474e7b68c2a9977a2ebe4acc90c04171ff32f265abedcd12d225dcc3215981fe59216b1dbf6a2
EBUILD postgresql-9.6.7.ebuild 14927 BLAKE2B 1cba06e2425db4f19790ca672da27626850f16ca33b372ea140b561c65b8d5523657c4e88d82281cb551390f6247a79d3bbc2d859a28812d85c752fba1d2dc57 SHA512 6ba1b0fead0c121700f090c73e3d1b05faa8d69c4cb6f3fb73ec90fef20f0c7610c5adf0fea0c2934689ee9310aa2f975594198a5d434ab9ccf6f6a1159024cd
EBUILD postgresql-9.6.8.ebuild 14924 BLAKE2B 8d176dcd6d821460338ee10e7ffcde99b7a41f65b934f0c71c4402239e848098af82fd81b3b37b0cc115b8c15378019028a5e8c7b5cc13cfbeb6e3cdc25ddc0b SHA512 23f6c89751d424c85b9babecd74a552af3d2edb65c6db079d2c3502aa7ecb42c476cb689fc1986fd65bffba52908fb13f3b36646417dc8174a50bb51ba6778f5
+EBUILD postgresql-9.6.9.ebuild 14931 BLAKE2B 4987e4eed2a0eda2fb2a6a997648e60dffcf80b3b3ed0e06ae9f20bcc4257b460fa4add991c3baf8785c0abe9a5cda6b5a50f668b94aed951be6c19e80d577cb SHA512 6b8a5982697a8b4dbf6722330829f260af5715925d68ab0a6190b0a16b7669eb947b81fe35f332c70122bb820bc8342bcdc92a7c3420e4a88da3122e27542824
EBUILD postgresql-9999.ebuild 13544 BLAKE2B 2a1f9c50e21e7b9981adb38d18d4814903578a461d81f8a250fccc73b5680232f9d53d3c56486e65007b90a954f31939775ce5e4bcc621672e8b29e0ee332b0d SHA512 7c579c0a60b1e10e2d0c254fc9f60f2908db3634371d359c88ebf0acf581eaadf24ba5e8d3ee0ebd4aa05d840a97d0df74385578c0d792ee7ba87402b6931813
MISC metadata.xml 751 BLAKE2B 4628a6d379a41b4646be34dfcfca2be58bc93b883ccd6f4d21a426aacb34dd7d5347c5f9d61f9211f4f91bff67d2d5935b203959ab0790c74031944a9ab799f6 SHA512 726f30ec991194427b2dbcdf650778dbe0f169cb305d569918404d403deef397aef7ec3f1a5269c15f7ec7fc5506dc534203323379f1d0acc475eeb8d75d0cf1
diff --git a/dev-db/postgresql/postgresql-10.4.ebuild b/dev-db/postgresql/postgresql-10.4.ebuild
new file mode 100644
index 000000000000..aeb8a7a0850f
--- /dev/null
+++ b/dev-db/postgresql/postgresql-10.4.ebuild
@@ -0,0 +1,460 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT=$(get_major_version)
+
+MY_PV=${PV/_/}
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="http://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl python +readline
+ selinux +server systemd ssl static-libs tcl threads uuid xml zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+wanted_languages() {
+ local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru
+ sk sl sv tr zh_CN zh_TW"
+ local enable_langs lingua
+
+ for lingua in ${linguas} ; do
+ has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} "
+ done
+
+ echo -n ${enable_langs}
+}
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+server? ( systemd? ( sys-apps/systemd ) )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !alpha spinlocks) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(usex server "$(use_with systemd)" '--without-systemd') \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ "$(use_enable nls nls "$(wanted_languages)")"
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ serverman=(
+ initdb
+ pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
+ pg_{test_{fsync,timing},upgrade,waldump}
+ post{gres,master}
+ )
+ for m in ${serverman[@]} ; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.6-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ if ! use systemd; then
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ fi
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ elif use systemd; then
+ einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-9.3.23.ebuild b/dev-db/postgresql/postgresql-9.3.23.ebuild
new file mode 100644
index 000000000000..9bd6eb22b922
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.3.23.ebuild
@@ -0,0 +1,450 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT="$(get_version_component_range 1-2)"
+
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="http://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+ +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+wanted_languages() {
+ local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru
+ sk sl sv tr zh_CN zh_TW"
+ local enable_langs lingua
+
+ for lingua in ${linguas} ; do
+ has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} "
+ done
+
+ echo -n ${enable_langs}
+}
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+uuid? ( dev-libs/ossp-uuid )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !pg_legacytimestamp integer-datetimes) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with kerberos krb5) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ $(use_with uuid ossp-uuid) \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ "$(use_enable nls nls "$(wanted_languages)")"
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}tmp"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql96). They may have been created by the
+ # postgresql.eselect module, but they're handled within this ebuild
+ # now. It's alright if we momentarily delete /usr/bin/psql as it
+ # will be recreated by the eselect module in pkg_ppostinst(). This
+ # is only necessary for 9.7 and earlier. 10 and later were never
+ # handled in this manner.
+ local canonicalise
+ if type -p realpath > /dev/null; then
+ canonicalise=realpath
+ elif type -p readlink > /dev/null; then
+ canonicalise='readlink -f'
+ else
+ # can't die, subshell
+ die "No readlink nor realpath found, cannot canonicalise"
+ fi
+
+ local l
+ # First remove any symlinks in /usr/bin that may have been created
+ # by the old eselect
+ for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
+ if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
+ rm "${l}" || ewarn "Couldn't remove ${l}"
+ fi
+ done
+
+ # Then move the symlinks created by the ebuild to their proper place.
+ for l in "${ED}"/usr/bin/*tmp ; do
+ mv "${l}" "${l%tmp}" \
+ || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
+ done
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-9.4.18.ebuild b/dev-db/postgresql/postgresql-9.4.18.ebuild
new file mode 100644
index 000000000000..2f448ba1c0c0
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.4.18.ebuild
@@ -0,0 +1,482 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT="$(get_version_component_range 1-2)"
+
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="http://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+ +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+wanted_languages() {
+ local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru
+ sk sl sv tr zh_CN zh_TW"
+ local enable_langs lingua
+
+ for lingua in ${linguas} ; do
+ has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} "
+ done
+
+ echo -n ${enable_langs}
+}
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !pg_legacytimestamp integer-datetimes) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ "$(use_enable nls nls "$(wanted_languages)")"
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}tmp"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql96). They may have been created by the
+ # postgresql.eselect module, but they're handled within this ebuild
+ # now. It's alright if we momentarily delete /usr/bin/psql as it
+ # will be recreated by the eselect module in pkg_ppostinst(). This
+ # is only necessary for 9.7 and earlier. 10 and later were never
+ # handled in this manner.
+ local canonicalise
+ if type -p realpath > /dev/null; then
+ canonicalise=realpath
+ elif type -p readlink > /dev/null; then
+ canonicalise='readlink -f'
+ else
+ # can't die, subshell
+ die "No readlink nor realpath found, cannot canonicalise"
+ fi
+
+ local l
+ # First remove any symlinks in /usr/bin that may have been created
+ # by the old eselect
+ for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
+ if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
+ rm "${l}" || ewarn "Couldn't remove ${l}"
+ fi
+ done
+
+ # Then move the symlinks created by the ebuild to their proper place.
+ for l in "${ED}"/usr/bin/*tmp ; do
+ mv "${l}" "${l%tmp}" \
+ || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
+ done
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-9.5.13.ebuild b/dev-db/postgresql/postgresql-9.5.13.ebuild
new file mode 100644
index 000000000000..4e1148a89f37
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.5.13.ebuild
@@ -0,0 +1,488 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT="$(get_version_component_range 1-2)"
+
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="http://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+ +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+wanted_languages() {
+ local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru
+ sk sl sv tr zh_CN zh_TW"
+ local enable_langs lingua
+
+ for lingua in ${linguas} ; do
+ has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} "
+ done
+
+ echo -n ${enable_langs}
+}
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !alpha spinlocks) \
+ $(use_enable !pg_legacytimestamp integer-datetimes) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ "$(use_enable nls nls "$(wanted_languages)")"
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}tmp"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql96). They may have been created by the
+ # postgresql.eselect module, but they're handled within this ebuild
+ # now. It's alright if we momentarily delete /usr/bin/psql as it
+ # will be recreated by the eselect module in pkg_ppostinst(). This
+ # is only necessary for 9.7 and earlier. 10 and later were never
+ # handled in this manner.
+ local canonicalise
+ if type -p realpath > /dev/null; then
+ canonicalise=realpath
+ elif type -p readlink > /dev/null; then
+ canonicalise='readlink -f'
+ else
+ # can't die, subshell
+ die "No readlink nor realpath found, cannot canonicalise"
+ fi
+
+ local l
+ # First remove any symlinks in /usr/bin that may have been created
+ # by the old eselect
+ for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
+ if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
+ rm "${l}" || ewarn "Couldn't remove ${l}"
+ fi
+ done
+
+ # Then move the symlinks created by the ebuild to their proper place.
+ for l in "${ED}"/usr/bin/*tmp ; do
+ mv "${l}" "${l%tmp}" \
+ || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
+ done
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ if use alpha && use server ; then
+ ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
+ ewarn "As a result, performance will be extremely degraded."
+ fi
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-9.6.9.ebuild b/dev-db/postgresql/postgresql-9.6.9.ebuild
new file mode 100644
index 000000000000..1d5a335c5909
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.6.9.ebuild
@@ -0,0 +1,493 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
+ systemd user versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
+
+SLOT="$(get_version_component_range 1-2)"
+
+MY_PV=${PV/_/}
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="http://www.postgresql.org/"
+
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+ +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+wanted_languages() {
+ local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru
+ sk sl sv tr zh_CN zh_TW"
+ local enable_langs lingua
+
+ for lingua in ${linguas} ; do
+ has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} "
+ done
+
+ echo -n ${enable_langs}
+}
+
+CDEPEND="
+>=app-eselect/eselect-postgresql-2.0
+sys-apps/less
+virtual/libintl
+kerberos? ( virtual/krb5 )
+ldap? ( net-nds/openldap )
+pam? ( virtual/pam )
+perl? ( >=dev-lang/perl-5.8:= )
+python? ( ${PYTHON_DEPS} )
+readline? ( sys-libs/readline:0= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+server? ( systemd? ( sys-apps/systemd ) )
+tcl? ( >=dev-lang/tcl-8:0= )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
+# the libc includes UUID functions.
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
+BSD_LIBC=( elibc_{Free,Net,Open}BSD )
+
+nest_usedep() {
+ local front back
+ while [[ ${#} -gt 1 ]]; do
+ front+="${1}? ( "
+ back+=" )"
+ shift
+ done
+ echo "${front}${1}${back}"
+}
+
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
+CDEPEND+="
+uuid? (
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
+)"
+
+DEPEND="${CDEPEND}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+RDEPEND="${CDEPEND}
+!dev-db/postgresql-docs:${SLOT}
+!dev-db/postgresql-base:${SLOT}
+!dev-db/postgresql-server:${SLOT}
+selinux? ( sec-policy/selinux-postgresql )
+"
+
+pkg_setup() {
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Work around PPC{,64} compilation bug where bool is already defined
+ sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
+
+ # Set proper run directory
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
+ -i src/include/pg_config_manual.h || die
+
+ # Rely on $PATH being in the proper order so that the correct
+ # install program is used for modules utilizing PGXS in both
+ # hardened and non-hardened environments. (Bug #528786)
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
+
+ use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ case ${CHOST} in
+ *-darwin*|*-solaris*)
+ use nls && append-libs intl
+ ;;
+ esac
+
+ export LDFLAGS_SL="${LDFLAGS}"
+ export LDFLAGS_EX="${LDFLAGS}"
+
+ local PO="${EPREFIX%/}"
+
+ local i uuid_config=""
+ if use uuid; then
+ for i in ${UTIL_LINUX_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=e2fs"
+ done
+ for i in ${BSD_LIBC[@]}; do
+ use ${i} && uuid_config="--with-uuid=bsd"
+ done
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
+ fi
+
+ econf \
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \
+ --docdir="${PO}/usr/share/doc/${PF}" \
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \
+ $(use_enable !alpha spinlocks) \
+ $(use_enable !pg_legacytimestamp integer-datetimes) \
+ $(use_enable threads thread-safety) \
+ $(use_with kerberos gssapi) \
+ $(use_with ldap) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(usex server "$(use_with systemd)" '--without-systemd') \
+ $(use_with tcl) \
+ ${uuid_config} \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with zlib) \
+ "$(use_enable nls nls "$(wanted_languages)")"
+}
+
+src_compile() {
+ emake
+ emake -C contrib
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install -C contrib
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ # man pages are already built, but if we have the target make them,
+ # they'll be generated from source before being installed so we
+ # manually install man pages.
+ # We use ${SLOT} instead of doman for postgresql.eselect
+ insinto /usr/share/postgresql-${SLOT}/man/
+ doins -r doc/src/sgml/man{1,3,7}
+ if ! use server; then
+ # Remove man pages for non-existent binaries
+ for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
+ done
+ fi
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
+
+ # Create slot specific man pages
+ local bn f mansec slotted_name
+ for mansec in 1 3 7 ; do
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
+
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
+
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
+ bn=$(basename "${f}")
+ slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
+ case ${bn} in
+ TABLE.7|WITH.7)
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
+ ;;
+ *)
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
+ ;;
+ esac
+ done
+
+ popd > /dev/null
+ done
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ local f bn
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
+ -mindepth 1 -maxdepth 1)
+ do
+ bn=$(basename "${f}")
+ # Temporarily tack on tmp to workaround a file collision
+ # issue. This is only necessary for 9.7 and earlier. 10 never
+ # had this issue.
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
+ "/usr/bin/${bn}${SLOT/.}tmp"
+ done
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.6-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql96). They may have been created by the
+ # postgresql.eselect module, but they're handled within this ebuild
+ # now. It's alright if we momentarily delete /usr/bin/psql as it
+ # will be recreated by the eselect module in pkg_ppostinst(). This
+ # is only necessary for 9.7 and earlier. 10 and later were never
+ # handled in this manner.
+ local canonicalise
+ if type -p realpath > /dev/null; then
+ canonicalise=realpath
+ elif type -p readlink > /dev/null; then
+ canonicalise='readlink -f'
+ else
+ # can't die, subshell
+ die "No readlink nor realpath found, cannot canonicalise"
+ fi
+
+ local l
+ # First remove any symlinks in /usr/bin that may have been created
+ # by the old eselect
+ for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
+ if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
+ rm "${l}" || ewarn "Couldn't remove ${l}"
+ fi
+ done
+
+ # Then move the symlinks created by the ebuild to their proper place.
+ for l in "${ED}"/usr/bin/*tmp ; do
+ mv "${l}" "${l%tmp}" \
+ || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
+ done
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ if use server ; then
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_prerm() {
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
+
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
+ sleep 10
+ eend 0
+ fi
+}
+
+pkg_postrm() {
+ postgresql-config update
+}
+
+pkg_config() {
+ use server || die "USE flag 'server' not enabled. Nothing to configure."
+
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
+ [[ -z "${DATA_DIR}" ]] \
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
+
+ # environment.bz2 may not contain the same locale as the current system
+ # locale. Unset and source from the current system locale.
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
+ unset LANG
+ unset LC_CTYPE
+ unset LC_NUMERIC
+ unset LC_TIME
+ unset LC_COLLATE
+ unset LC_MONETARY
+ unset LC_MESSAGES
+ unset LC_ALL
+ source "${EROOT%/}/etc/env.d/02locale"
+ [ -n "${LANG}" ] && export LANG
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
+ [ -n "${LC_TIME}" ] && export LC_TIME
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
+ [ -n "${LC_ALL}" ] && export LC_ALL
+ fi
+
+ einfo "You can modify the paths and options passed to initdb by editing:"
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ einfo
+ einfo "Information on options that can be passed to initdb are found at:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then
+ einfo " (none)"
+ else
+ einfo " ${PG_INITDB_OPTS}"
+ fi
+ einfo
+ einfo "Configuration files will be installed to:"
+ einfo " ${PGDATA}"
+ einfo
+ einfo "The database cluster will be created in:"
+ einfo " ${DATA_DIR}"
+ einfo
+
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
+ sleep 5
+ eend 0
+
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
+ eerror "The given directory, '${DATA_DIR}', is not empty."
+ eerror "Modify DATA_DIR to point to an empty directory."
+ die "${DATA_DIR} is not empty."
+ fi
+
+ einfo "Creating the data directory ..."
+ if [[ ${EUID} == 0 ]] ; then
+ mkdir -p "${DATA_DIR}"
+ chown -Rf postgres:postgres "${DATA_DIR}"
+ chmod 0700 "${DATA_DIR}"
+ fi
+
+ einfo "Initializing the database ..."
+
+ if [[ ${EUID} == 0 ]] ; then
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
+ else
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
+ fi
+
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
+ fi
+
+ # unix_socket_directory has no effect in postgresql.conf as it's
+ # overridden in the initscript
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
+
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
+ # On the off-chance that you might need to work with UTF-8 encoded
+ # characters in PL/Perl
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
+ EOF
+
+ einfo "The autovacuum function, which was in contrib, has been moved to the main"
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
+ einfo "by default. You can disable it in the cluster's:"
+ einfo " ${PGDATA%/}/postgresql.conf"
+ einfo
+ if ! use systemd; then
+ einfo "The PostgreSQL server, by default, will log events to:"
+ einfo " ${DATA_DIR%/}/postmaster.log"
+ einfo
+ fi
+ if use prefix ; then
+ einfo "The location of the configuration files have moved to:"
+ einfo " ${PGDATA}"
+ einfo "To start the server:"
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
+ einfo "To stop:"
+ einfo " pg_ctl stop -D ${DATA_DIR}"
+ einfo
+ einfo "Or move the configuration files back:"
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
+ elif use systemd; then
+ einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ else
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
+ einfo "instead of 'pg_ctl'."
+ fi
+}
+
+src_test() {
+ if use server && [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ use server || \
+ ewarn 'Tests cannot be run without the "server" use flag enabled.'
+ [[ ${UID} -eq 0 ]] || \
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
+
+ ewarn 'Skipping.'
+ fi
+}