summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2014-10-26 02:22:58 +0000
committerPatrick Lauer <patrick@gentoo.org>2014-10-26 02:22:58 +0000
commit69e5048755c9e715f94909114409a1c44dc8f703 (patch)
treee8dc7a17153f0c1c03584d3c83b6ad81f95f165f /dev-db/postgresql
parentAdd ~arm keyword for bug 508072 and me (diff)
downloadhistorical-69e5048755c9e715f94909114409a1c44dc8f703.tar.gz
historical-69e5048755c9e715f94909114409a1c44dc8f703.tar.bz2
historical-69e5048755c9e715f94909114409a1c44dc8f703.zip
Bump 9.4_beta3
Package-Manager: portage-2.2.14/cvs/Linux x86_64
Diffstat (limited to 'dev-db/postgresql')
-rw-r--r--dev-db/postgresql/ChangeLog8
-rw-r--r--dev-db/postgresql/Manifest14
-rw-r--r--dev-db/postgresql/postgresql-9.4_beta3.ebuild405
3 files changed, 414 insertions, 13 deletions
diff --git a/dev-db/postgresql/ChangeLog b/dev-db/postgresql/ChangeLog
index ede82a13d3d9..918f956592f5 100644
--- a/dev-db/postgresql/ChangeLog
+++ b/dev-db/postgresql/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-db/postgresql
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.389 2014/10/11 19:35:08 titanofold Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.390 2014/10/26 02:22:46 patrick Exp $
+
+*postgresql-9.4_beta3 (26 Oct 2014)
+
+ 26 Oct 2014; Patrick Lauer <patrick@gentoo.org> +postgresql-9.4_beta3.ebuild:
+ Bump 9.4_beta3
*postgresql-9999 (11 Oct 2014)
*postgresql-9.4_beta2 (11 Oct 2014)
@@ -14,4 +19,3 @@
+postgresql-9.2.9.ebuild, +postgresql-9.3.5.ebuild,
+postgresql-9.4_beta2.ebuild, +postgresql-9999.ebuild, +metadata.xml:
Initial commit.
-
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
index bc82a6483242..4e651a2f5faf 100644
--- a/dev-db/postgresql/Manifest
+++ b/dev-db/postgresql/Manifest
@@ -1,11 +1,9 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
DIST postgresql-9.0.18.tar.bz2 14984096 SHA256 7c8a07d0ab78fe39522c6bb268a7b357f456d9d4796f57d7b43a004e4a9d3003 SHA512 90bd04202a9ff5d663b0ce6d4cc48fd891431c8bfa93aaf3fd29649133759da1783cfa0972cdd11f471534bf3faf490d9da0cbb71bf55acd8602147fc08c3b43 WHIRLPOOL 93a3844119aa0cdeb5f051d50ec4fe0c55c2713929f2adaa77657c1b47d045579ed7b9115588a2b6b916919229af5c90b17c951a1b103d4b9c1d965bc91644b4
DIST postgresql-9.1.14.tar.bz2 15666442 SHA256 d0647ce563d18ae02bf68c5dd646a4c75e8b45b3a4fada64d481371fdc16f522 SHA512 b32fa24bc34b7f16ab5bb0e9065ffaeafe299009d5889201a12a46998a29e1fd4ffb81bc225eb4cfc740c3b51aea3a2c9ebac2c1252f71219b0a203550cc32a0 WHIRLPOOL 20738768c86b0ba6470b5717e66aa4e1a970b58015ae8e3bd7ef0811dc9989a5e47ef3eac5f917d9a6c2a0dd945bb832d7685b71cc63bf56b28db6703e641f2f
DIST postgresql-9.2.9.tar.bz2 16269349 SHA256 94ec6d330f125b6fc725741293073b07d7d20cc3e7b8ed127bc3d14ad2370197 SHA512 a319af5781f528b5fcd384d133d0dc0d0f4302784c650b7d934670717a07e6af8cef51abaa9a34bdfc82f925ba9e8a81770242fa69a2e2105684be2a62be2db3 WHIRLPOOL 736afcc694cf60cf574d0ff4633637e50f6e3a951d9e5ed09b3afdf2e685291b5d073db801a1260543149576509e82a7cbe94842b6dc71a5d840a58cab390799
DIST postgresql-9.3.5.tar.bz2 16727725 SHA256 14176ffb1f90a189e7626214365be08ea2bfc26f26994bafb4235be314b9b4b0 SHA512 a49bc8ea7635be5082044f5ebd6b81de7198583aedb072dffec8425521af90f2cb8e9f6e7b55b361ff24cbebc0670afefe365e8f5b80b8248ddf492b8092a746 WHIRLPOOL 15baa94b42f14bb815f84cc2009c018f68dcf26e0adf3e9550db2939e601df4ef817eccb029fea796446e6a16c22829c323a92f1f3f1c5276a387b81e3b29d24
DIST postgresql-9.4beta2.tar.bz2 17271387 SHA256 567406cf58386917916d8ef7ac892bf79e98742cd16909bb00fc920dd31a388c SHA512 ab8bac10508c8e5508cf68102e53e3fe1e0fbfbdb024d042ae7fc8ab801e47bb623716ed662da4614d4e938e5913cfb5d665018297e27b4d33851bb0f61adde8 WHIRLPOOL 8ab9a8ca218394ed658c981c4321885355c6803da78e93ba1dd6410f7d4f570688fa88a91f8516c6849cc0dd9d73e32021688fe088263f315955499f35d08659
+DIST postgresql-9.4beta3.tar.bz2 17355677 SHA256 5ad1d86a5b9a70d5c153dd862b306a930c6cf67fb4a3f00813eef19fabe6aa5d SHA512 a9226edf2af0f0c147c2a3ec74d0007dd7161b491b767fe1511e1303916693610ddbde9fb7862e3b052c3605de91d732c53833642c88891b2eaa390436b61ba6 WHIRLPOOL dffc24a51e55cd6be3bc5fad3238abcb20690eb0cb8068995ded371a163161b37b1bb118854e190356d02325ed8f183ee7c58ddc59efb5cddf0351699b46fcf9
DIST postgresql-initscript-2.7.tbz2 3836 SHA256 fecc05fb75f782da1d8215af49134bfe593b94547458ff90692c14058384bfa2 SHA512 8ad9eba3e83d8b296ed1a035716c11c3a7b6a316470327919f168ef8fe861261b5eeb5275e8b643c94b17a94b38e2011c85dde5459b2f9c6f462a2f967f8f315 WHIRLPOOL 4de1ed1b0d8c1a3d56cf3b62456756764a9670e9655ee9f904dc2fba764f32313a74be9676544cca1fc684370b633950ccc4443ed2e59bb053e2a315b5c76b4e
DIST postgresql-initscript-pre92-2.6.tbz2 7826 SHA256 eb041a09011eb47da5daa62e0971a5fed6e7e308c54b5c7f840d9f49e42adc28 SHA512 b9d15ae6812a747907008606b8e89499b228cc10eda38c503a133b02c1151316ef414b6e72a9d26c3dcc87d153f26f38b0901e338e6bdd530327bf474394df8a WHIRLPOOL a218f715aa02acae27a25daedc72c2a5069060a0d4f3cd572a95ca295d0ed822453bb468fba461adf57f36978c6968bb8ebeb6c6d786f9c3baca4a346f483480
DIST postgresql-patches-9.0-r2.tbz2 4527 SHA256 c7f5e77d16ecc384a8b7802ac2c35ed5b0de68f3dc30cb767a96b49501f8219f SHA512 271ba4c6f6e19f76ac8078409d4618dc22ba45f1f74ac0760a3c0f035283cc571ff854c25518635bcf67ed68147b5930c12e4cad85e59bd342f7c35bd25fc4c4 WHIRLPOOL e6d673fe105b8f4f69696e029d5ebfdc027507d1b5666fc3d118602dc0966704144090e60e328b801306e892d28ee8ce3887ba85b0723385d646119447e53c41
@@ -19,13 +17,7 @@ EBUILD postgresql-9.1.14.ebuild 12316 SHA256 9554e99b077fb12f86eca8e7c2142500cd1
EBUILD postgresql-9.2.9.ebuild 12668 SHA256 31c7ce32acdc716990896459f5550134fa32b02c74178d1cdf51f98c813530cf SHA512 007e480904cb35337a095f9c069ff0cec5e62e4267e9f613d9b7989fb69b331f67dcd97f11ffbc43656dcae3fab2a2e54e131de01b83e107d40e49509dea2d87 WHIRLPOOL ce77ff1990870f2bd8ceb010d306b203e4273dc3fa4a85871ab11aaf4914c461ea28482bebf1ed24fc1a6b37d2ca1080ecc32635e77508f27065e39984e19149
EBUILD postgresql-9.3.5.ebuild 12668 SHA256 c6125ec45deb97780d3bf40b56dcf3caa09e8ba4f6ea3891086bc2032d264b69 SHA512 8309b54cafb31ccf623c8e2e62d4afd1c5041d070bb72ba48e867883c9b33c4c0ff3c5340a13b42e62cff1c71883d54d22bb583ec836f2b498a70d94b698bc49 WHIRLPOOL 21172cf8558d3bb9fd285f2fb3f3355fcfee628a187c85ddcad04eeff4a280dc8105666014e527db313685b0dc9dddfd93e026236e3790f75b0486d9eca8fb8c
EBUILD postgresql-9.4_beta2.ebuild 12697 SHA256 d9d033c14d676ec5d0cee4f2198c18fb061538e08215a31f1dd90abc634916e6 SHA512 3c674a325c780ed3245c7c94879aefc8b828a3d255ff262a08ef6e50030daad16475c6219c9c51dc85ded66147fbc1b74ff9a7334f306e35914fd674b4806c7b WHIRLPOOL ee4214c33c36169f52acf874d39a2f5edd413d3c1d2b95c3f529cdc25d232a9acd0ec8e5ccec722cad5d6cbfb9085b50e36690ea888612c40ac7cf0b60b6c4f2
+EBUILD postgresql-9.4_beta3.ebuild 12694 SHA256 6207737e7c236b10b9a66b2fca020e1a7d1bffd0c575021dc9a654f8d417d1f2 SHA512 e9057c85668f1eceadc0458e30fbcb4c685e37752f0612b6cbde31d0b99a991cf4913a182172947402f21c5129f2d1b545b73175987ca0b30af8358ae85baf35 WHIRLPOOL eababd345cdb823e0ad90b2a05a34e7a5c44420673ca4534dba23456c71953ceb602aec4afb95e972be362c2857bf1501a321054fc77318cef97a2c27a7e759e
EBUILD postgresql-9999.ebuild 12655 SHA256 ce31a7dea6f4b88cf1c6f9cd9275765ec66ee24e84ead01d412999f41464c88c SHA512 19311be95e08d4598f0c93b9c77ff6c9fde40608de388e0790b1410fbd793a697a39289b32ca2452b80f8020d918103d0509b3da30b7df19de20fa3f38629237 WHIRLPOOL 03d0021a34470840082917c21f6a5e55565a66291b251438b9c3d863d52cc82d39ec0d0638cb3d9f0d755fff457b2c1da325303fa6fcb39d6d4c0d9aeb75df58
-MISC ChangeLog 668 SHA256 dc269a7154a36aea931143b7d05c99adcaeeaf9c0af4967ec50896157ada05d5 SHA512 41121dbe72fff12cb2af2fb2272ec5ca0ab14bd08faa06491273b738e3a7aec219d83d3188acfc201f94d25f527d76e6e3632a5ea808d39286fc939c9f234db0 WHIRLPOOL edea17275871f15b323ef71986a9de971c14606a4c676c832129e646c6804e9201d485e000b9b85b4d4f979ea213d5f69ab54127c9cd96ecc1a272a8cbc43098
+MISC ChangeLog 799 SHA256 0717122f66407302821b845fff9d2c63106002de64f69e6e3d8868d25780caad SHA512 422fdeebef57c8d1642508f3fba8667083810900b0647529888d0632d30f0fb0d573e23eb0e4eba7ee7bdc665d373a8572d4e05206ff31de20230e51af78e353 WHIRLPOOL 7271d40b44a86911c5fe7a0cfd56da40b07f2b0bb904a112fb5bad6ac6dafaa01133142a5278abe4a7cfdf3359044998203e8d6e0d04f797042b417c0ab4ecc1
MISC metadata.xml 620 SHA256 85335fdf06be777d6fa46902094b666ddd7e0a64d12f03b0ba54c181641822c0 SHA512 00a3f52a73add4922a366534f50decb308254a27c64130c9b4fde4f27fbed318ff65a5065a95e0d99219f5f4c439d502b0b0a3951f4589393617385ad656e003 WHIRLPOOL b0a0bf7d88a585d04cdc7acb7aa46d455fff5508100c3a81485ecb9cf221dbbc13f10501652ff084253eacde019d4c79c7b4f997bc8408ade041edb8a23cb1cd
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-
-iF4EAREIAAYFAlQ5hnYACgkQVxOqA9G7/aADVgEAlaZHsH4eIHSbbKPsO+9xgXPP
-sqv9JDcjePDgQR6a8s8A/RtICubFTymXTZrPBqAxnsN3vS0YLLx6OxRvokzTdkP7
-=VZrg
------END PGP SIGNATURE-----
diff --git a/dev-db/postgresql/postgresql-9.4_beta3.ebuild b/dev-db/postgresql/postgresql-9.4_beta3.ebuild
new file mode 100644
index 000000000000..a62c177bf3da
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.4_beta3.ebuild
@@ -0,0 +1,405 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9.4_beta3.ebuild,v 1.1 2014/10/26 02:22:46 patrick Exp $
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} )
+WANT_AUTOMAKE="none"
+
+inherit autotools eutils flag-o-matic multilib pam prefix python-single-r1 systemd user versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~ppc-macos ~sparc-fbsd ~x86-fbsd ~x86-solaris"
+
+MY_PV=${PV/_/}
+SLOT="$(get_version_component_range 1-2)"
+S="${WORKDIR}/postgresql-${MY_PV}"
+SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
+
+# Add patch and initscript source.
+SRC_URI+=" http://dev.gentoo.org/~patrick/postgresql-patches-${SLOT}-r1.tbz2
+ http://dev.gentoo.org/~floppym/dist/postgresql-initscript-2.7.tbz2"
+
+LICENSE="POSTGRESQL GPL-2"
+DESCRIPTION="PostgreSQL RDBMS"
+HOMEPAGE="http://www.postgresql.org/"
+
+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"
+IUSE="doc kerberos kernel_linux ldap nls pam perl -pg_legacytimestamp python +readline selinux server ssl tcl threads uuid xml zlib"
+
+for lingua in ${LINGUAS}; do
+ IUSE+=" linguas_${lingua}"
+done
+
+wanted_languages() {
+ local enable_langs
+
+ for lingua in ${LINGUAS} ; do
+ use linguas_${lingua} && enable_langs+="${lingua} "
+ done
+
+ echo -n ${enable_langs}
+}
+
+RDEPEND="
+>=app-admin/eselect-postgresql-1.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 )
+selinux? ( sec-policy/selinux-postgresql )
+ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+tcl? ( >=dev-lang/tcl-8 )
+uuid? ( dev-libs/ossp-uuid )
+xml? ( dev-libs/libxml2 dev-libs/libxslt )
+zlib? ( sys-libs/zlib )
+"
+
+DEPEND="${RDEPEND}
+!!dev-db/postgresql-docs:${SLOT}
+!!dev-db/postgresql-base:${SLOT}
+!!dev-db/postgresql-server:${SLOT}
+!!<sys-apps/sandbox-2.0
+sys-devel/bison
+sys-devel/flex
+nls? ( sys-devel/gettext )
+xml? ( virtual/pkgconfig )
+"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Eliminate autotools version check
+ sed '/m4_PACKAGE_VERSION/,+3d' -i configure.in || die
+
+ # 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
+
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ -i "${WORKDIR}"/postgresql{.{init,confd,service},-check-db-dir} || \
+ die "SLOT/LIBDIR sed failed"
+
+ use server || epatch "${WORKDIR}/base.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
+
+ eautoconf
+}
+
+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/postgresql-${SLOT}" \
+ --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) \
+ $(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}
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ dodir /etc/eselect/postgresql/slots/${SLOT}
+ echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
+ "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
+
+ if use doc ; then
+ docinto html
+ dodoc doc/src/sgml/html/*
+
+ docinto sgml
+ dodoc doc/src/sgml/*.{sgml,dsl}
+ fi
+
+ if use server; then
+ newconfd "${WORKDIR}/postgresql.confd" postgresql-${SLOT}
+ newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT}
+
+ systemd_newunit "${WORKDIR}"/postgresql.service postgresql-${SLOT}.service
+ systemd_newtmpfilesd "${WORKDIR}"/postgresql.tmpfilesd postgresql-${SLOT}.conf
+ newbin "${WORKDIR}"/postgresql-check-db-dir postgresql-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth postgresql-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 0775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_postinst() {
+ 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 "http://www.gentoo.org/doc/en/postgres-howto.xml"
+ 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 "\thttp://www.gentoo.org/doc/en/postgres-howto.xml#doc_chap5"
+
+ 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
+ while [ "$correct" != "true" ] ; do
+ einfo "Are you ready to continue? (y/n)"
+ read answer
+ if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
+ correct="true"
+ elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
+ die "Aborting initialization."
+ else
+ echo "Answer not recognized"
+ fi
+ done
+
+ 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
+
+ [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
+ einfo "Checking system parameters..."
+
+ if ! use kernel_linux ; then
+ einfo "Skipped."
+ einfo " Tests not supported on this OS (yet)"
+ else
+ if [ -z ${SKIP_SYSTEM_TESTS} ] ; then
+ einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
+
+ local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
+ local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
+ local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
+ local SHMMAX=$(sysctl -n kernel.shmmax)
+
+ local SEMMSL_MIN=17
+ local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
+ local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
+ local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
+
+ for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
+ if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then
+ eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
+ eerror "You have now several options:"
+ eerror " - Change the mentioned system parameter"
+ eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a"
+ eerror " value lower than ${PG_MAX_CONNECTIONS}"
+ eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
+ eerror "More information can be found here:"
+ eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
+ die "System test failed."
+ fi
+ done
+ einfo "Passed."
+ else
+ ewarn "SKIP_SYSTEM_TESTS set, so skipping."
+ fi
+ 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
+
+ mv "${DATA_DIR%/}"/*.conf "${PGDATA}"
+
+ 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() {
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+
+ if [[ $(use server) -eq 0 && ${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
+}