commit:     fcfc94349d709fff8645a467873bf19d7bdfe566
Author:     Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 13 15:33:54 2017 +0000
Commit:     Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Thu Jul 13 15:33:54 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcfc9434

dev-db/postgresql: 10_beta2 Version Bump

Added 10_beta2, and bumped the slot on the live ebuild.

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 dev-db/postgresql/Manifest                         |   1 +
 .../files/postgresql-10beta2-no-server.patch       | 146 +++++++++++
 ...esql-9999.ebuild => postgresql-10_beta2.ebuild} | 277 ++++++++++++---------
 dev-db/postgresql/postgresql-9999.ebuild           |  28 ++-
 4 files changed, 325 insertions(+), 127 deletions(-)

diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
index 2058e113e42..e6c7f829533 100644
--- a/dev-db/postgresql/Manifest
+++ b/dev-db/postgresql/Manifest
@@ -1,3 +1,4 @@
+DIST postgresql-10beta2.tar.bz2 19790809 SHA256 
0d6b50236039fc92e8784bd908b452c38ef63c0f9029f34e7115fbc30e17b195 SHA512 
58abb8e38252ddf50d975588c9d43bf28d1169b499d068ace9324c6380ac1916975ca9a9a708dffb499e333e8b85c381efe8821166e2071236d6c8c4498f97a0
 WHIRLPOOL 
920fbc7459f0f9a9a3b72200ab2a4042672f351dc5b63dc7b63e2fafe0a74838fff1da0d814c37d81d28dc07e85bd4f14330ac367df2fb61f1ed0f56927e2131
 DIST postgresql-9.1.24.tar.bz2 15863767 SHA256 
de0d84e9f32af145fcd66d8d324f6ef1a0b17944ea344b7bbe9d99fff68ae5d3 SHA512 
a9ad0d62846598afee317eeda83406b5f85a658bfe7eb78aff6c59c904223dd165adbd5870598b74aa0e012878489f0c285e6ac7b07ebddf3cf8d81ba70bea7e
 WHIRLPOOL 
f58d79df5562c3fc22dae96ba064e19a4c83f42358911575f854cb2e062457f9331547cb19f9970003a2e15b7e8c609b9aab2a1e17099a446c89786581ccb13b
 DIST postgresql-9.2.19.tar.bz2 16466698 SHA256 
1d29d73a4f590fcc348280f13ac2ff6a0f72c94908c54e3c20b7ab1560e8dbad SHA512 
d3b4c5578bf6d6580028e775bff81a921258cb53b6b06567d96a352d14f3b63063adb480b2f5e2029baf8a034e14b5cd75eebc04f1ed7b16c849e1a5ec1f4867
 WHIRLPOOL 
c13b45fd7aee08ea472557c9f40d79c45abd572fefcc215002b562b8046b1937bf522f6f7f6e280ff1e434c9698734cda9f1c3dacd3c8fee5f33dad0da21f75f
 DIST postgresql-9.2.20.tar.bz2 16480653 SHA256 
0b8abdae8400cabea5587a726003c9dd71c73c049bdae523abc35f9312dd8f26 SHA512 
16f7861e0372481dbc5c69ac977bab46f592045f32951a245f3677121261640fcc169a75e730d592e36c15c9a120e7d06755550bdabf121ad89d76a17535d0f9
 WHIRLPOOL 
af5005564056185fa240fd97bec862738f9951bb57082485beba3eacf5d8bf709c58d01f8bde656a391eee173d592d9cf792be87de04a09869aa3d82c8719320

diff --git a/dev-db/postgresql/files/postgresql-10beta2-no-server.patch 
b/dev-db/postgresql/files/postgresql-10beta2-no-server.patch
new file mode 100644
index 00000000000..8c88465e7bd
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-10beta2-no-server.patch
@@ -0,0 +1,146 @@
+diff -Naruw a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2017-07-10 16:26:20.000000000 -0400
++++ b/contrib/Makefile 2017-07-12 09:35:05.025053646 -0400
+@@ -5,57 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+ 
+ SUBDIRS = \
+-              adminpack       \
+-              amcheck         \
+-              auth_delay      \
+-              auto_explain    \
+-              bloom           \
+-              btree_gin       \
+-              btree_gist      \
+-              chkpass         \
+-              citext          \
+-              cube            \
+-              dblink          \
+-              dict_int        \
+-              dict_xsyn       \
+-              earthdistance   \
+-              file_fdw        \
+-              fuzzystrmatch   \
+-              hstore          \
+-              intagg          \
+-              intarray        \
+-              isn             \
+-              lo              \
+-              ltree           \
+               oid2name        \
+-              pageinspect     \
+-              passwordcheck   \
+-              pg_buffercache  \
+-              pg_freespacemap \
+-              pg_prewarm      \
+-              pg_standby      \
+-              pg_stat_statements \
+-              pg_trgm         \
+-              pgcrypto        \
+-              pgrowlocks      \
+-              pgstattuple     \
+-              pg_visibility   \
+-              postgres_fdw    \
+-              seg             \
+-              spi             \
+-              tablefunc       \
+-              tcn             \
+-              test_decoding   \
+-              tsm_system_rows \
+-              tsm_system_time \
+-              unaccent        \
+               vacuumlo
+ 
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+ 
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+diff -Naruw a/src/backend/Makefile b/src/backend/Makefile
+--- a/src/backend/Makefile     2017-07-10 16:26:20.000000000 -0400
++++ b/src/backend/Makefile     2017-07-12 10:02:15.890642203 -0400
+@@ -51,7 +51,7 @@
+ 
+ ##########################################################################
+ 
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: generated-headers
+ 
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -226,23 +226,7 @@
+ 
+ ##########################################################################
+ 
+-install: all installdirs install-bin
+-ifeq ($(PORTNAME), cygwin)
+-ifeq ($(MAKE_DLL), true)
+-      $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
+-endif
+-endif
+-ifeq ($(PORTNAME), win32)
+-ifeq ($(MAKE_DLL), true)
+-      $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
+-endif
+-endif
+-      $(MAKE) -C catalog install-data
+-      $(MAKE) -C tsearch install-data
+-      $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample 
'$(DESTDIR)$(datadir)/pg_hba.conf.sample'
+-      $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample 
'$(DESTDIR)$(datadir)/pg_ident.conf.sample'
+-      $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample 
'$(DESTDIR)$(datadir)/postgresql.conf.sample'
+-      $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample 
'$(DESTDIR)$(datadir)/recovery.conf.sample'
++install:
+ 
+ install-bin: postgres $(POSTGRES_IMP) installdirs
+       $(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
+diff -Naruw a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2017-07-10 16:26:20.000000000 -0400
++++ b/src/bin/Makefile 2017-07-12 10:06:45.609174107 -0400
+@@ -14,19 +14,8 @@
+ include $(top_builddir)/src/Makefile.global
+ 
+ SUBDIRS = \
+-      initdb \
+-      pg_archivecleanup \
+-      pg_basebackup \
+       pg_config \
+-      pg_controldata \
+-      pg_ctl \
+       pg_dump \
+-      pg_resetwal \
+-      pg_rewind \
+-      pg_test_fsync \
+-      pg_test_timing \
+-      pg_upgrade \
+-      pg_waldump \
+       pgbench \
+       psql \
+       scripts
+diff -Naruw a/src/Makefile b/src/Makefile
+--- a/src/Makefile     2017-07-10 16:26:20.000000000 -0400
++++ b/src/Makefile     2017-07-12 10:10:04.128087426 -0400
+@@ -15,20 +15,12 @@
+ SUBDIRS = \
+       common \
+       port \
+-      timezone \
+       backend \
+-      backend/utils/mb/conversion_procs \
+-      backend/snowball \
+       include \
+       interfaces \
+-      backend/replication/libpqwalreceiver \
+-      backend/replication/pgoutput \
+       fe_utils \
+       bin \
+-      pl \
+-      makefiles \
+-      test/regress \
+-      test/perl
++      makefiles
+ 
+ # There are too many interdependencies between the subdirectories, so
+ # don't attempt parallel make here.

diff --git a/dev-db/postgresql/postgresql-9999.ebuild 
b/dev-db/postgresql/postgresql-10_beta2.ebuild
similarity index 63%
copy from dev-db/postgresql/postgresql-9999.ebuild
copy to dev-db/postgresql/postgresql-10_beta2.ebuild
index cbc1266c206..6ccc0c76d15 100644
--- a/dev-db/postgresql/postgresql-9999.ebuild
+++ b/dev-db/postgresql/postgresql-10_beta2.ebuild
@@ -1,28 +1,31 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="5"
+EAPI="6"
 
 PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
 
-inherit eutils flag-o-matic git-2 linux-info multilib pam prefix \
-               python-single-r1 systemd user versionator
+inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
+               systemd user versionator
 
-KEYWORDS=""
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh 
~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
 
-# Bump when rc released.
-SLOT="10"
+SLOT=$(get_major_version)
 
-EGIT_REPO_URI="git://git.postgresql.org/git/postgresql.git"
+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/";
 
-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="kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp 
python
-         +readline selinux +server systemd ssl static-libs tcl threads uuid 
xml zlib"
+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 libressl nls pam perl -pg_legacytimestamp
+         python +readline selinux +server systemd ssl static-libs tcl threads 
uuid
+         xml zlib"
 
 for lingua in ${LINGUAS}; do
        IUSE+=" linguas_${lingua}"
@@ -49,36 +52,46 @@ 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:= )
 )
-server? ( systemd? ( sys-apps/systemd ) )
 tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
 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
->=dev-lang/perl-5.8
-app-text/docbook-dsssl-stylesheets
-app-text/docbook-sgml-dtd:4.2
-app-text/docbook-xml-dtd:4.2
-app-text/docbook-xsl-stylesheets
-app-text/openjade
-dev-libs/libxml2
-dev-libs/libxslt
 sys-devel/bison
 sys-devel/flex
 nls? ( sys-devel/gettext )
 xml? ( virtual/pkgconfig )
 "
-src_unpack() {
-       base_src_unpack
-       git-2_src_unpack
-}
 
 RDEPEND="${CDEPEND}
 !dev-db/postgresql-docs:${SLOT}
@@ -87,17 +100,8 @@ RDEPEND="${CDEPEND}
 selinux? ( sec-policy/selinux-postgresql )
 "
 
-pkg_pretend() {
-       ewarn "You are using a live ebuild that uses the current source code as 
it is"
-       ewarn "available from PostgreSQL's Git repository at emerge time. Given 
such,"
-       ewarn "the GNU Makefiles may be altered by upstream without notice and 
the"
-       ewarn "documentation for this live version is not readily available"
-       ewarn "online. Ergo, the ebuild maintainers will not support building a"
-       ewarn "client-only and/or document-free version."
-}
-
 pkg_setup() {
-       CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
+       use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
 
        enewgroup postgres 70
        enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
@@ -118,13 +122,19 @@ src_prepare() {
        # 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}beta2-no-server.patch"
+
+       # Fix bug 486556 where the server would crash at start up because of
+       # an infinite loop caused by a self-referencing symlink.
+       #eapply "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.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
 
-       epatch_user
+       eapply_user
 }
 
 src_configure() {
@@ -139,6 +149,17 @@ src_configure() {
 
        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}" \
@@ -158,7 +179,7 @@ src_configure() {
                $(use_with ssl openssl) \
                $(usex server "$(use_with systemd)" '--without-systemd') \
                $(use_with tcl) \
-               $(use_with uuid ossp-uuid) \
+               ${uuid_config} \
                $(use_with xml libxml) \
                $(use_with xml libxslt) \
                $(use_with zlib) \
@@ -166,34 +187,64 @@ src_configure() {
 }
 
 src_compile() {
-       emake world
+       emake
+       emake -C contrib
 }
 
 src_install() {
-       emake DESTDIR="${D}" install-world
+       emake DESTDIR="${D}" install
+       emake DESTDIR="${D}" install -C contrib
 
        dodoc README HISTORY doc/{TODO,bug.template}
 
-       insinto /etc/postgresql-${SLOT}
-       newins src/bin/psql/psqlrc.sample psqlrc
+       # 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}
 
-       use static-libs || find "${ED}" -name '*.a' -delete
+       # 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}"
 
-       sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
-               "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
+               mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man 
dir"
+               pushd "${ED}"/usr/share/man/man${mansec} > /dev/null
 
-       sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
-               "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
+               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
 
-       if use systemd; then
-               sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
-                       "${FILESDIR}/${PN}.service-9.6" | \
-                       systemd_newunit - ${PN}-${SLOT}.service
-       fi
+               popd > /dev/null
+       done
 
-       newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+       insinto /etc/postgresql-${SLOT}
+       newins src/bin/psql/psqlrc.sample psqlrc
 
-       use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+       use static-libs || find "${ED}" -name '*.a' -delete
 
        local f bn
        for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
@@ -204,57 +255,39 @@ src_install() {
                # 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"
+                         "/usr/bin/${bn}${SLOT/.}"
        done
 
-       local linkname mansec
-       for mansec in {1,3,7} ; do
-               for f in 
"${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
-                       bn=$(basename "${f}")
-                       linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
-                       dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
-                                 /usr/share/man/man${mansec}/${linkname}
-               done
-       done
+       if use doc ; then
+               docinto html
+               dodoc doc/src/sgml/html/*
 
-       if use prefix ; then
-               keepdir /run/postgresql
-               fperms 0775 /run/postgresql
+               docinto sgml
+               dodoc doc/src/sgml/*.{sgml,dsl}
        fi
-}
 
-pkg_preinst() {
-       # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
-       # /usr/bin/psql97). 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().  We
-       # only worry about the 9.7 slot as that's the last slot that had its
-       # slot-specific links generated by eselect.
-       #
-       # This can be removed when 10 is the lowest slot in the tree.
-       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
+       if use server; then
+               sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+                       "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
 
-       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
-               [[ $(${canonicalise} "${l}") == *postgresql-9.7* ]] && rm "${l}"
-       done
+               sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+                       "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - 
${PN}-${SLOT}
 
-       # 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
+               if use systemd; then
+                       sed -e "s|@SLOT@|${SLOT}|g" -e 
"s|@LIBDIR@|$(get_libdir)|g" \
+                               "${FILESDIR}/${PN}.service-9.6" | \
+                               systemd_newunit - ${PN}-${SLOT}.service
+               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 0775 /run/postgresql
+               fi
+       fi
 }
 
 pkg_postinst() {
@@ -263,27 +296,29 @@ pkg_postinst() {
        elog "If you need a global psqlrc-file, you can place it in:"
        elog "    ${EROOT%/}/etc/postgresql-${SLOT}/"
 
-       elog
-       elog "Gentoo specific documentation:"
-       elog "https://wiki.gentoo.org/wiki/PostgreSQL";
-       elog
-       elog "Official documentation:"
-       elog "${EROOT%/}/usr/share/doc/${PF}/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, and other options, in:"
-       elog "    ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
-       elog
-       elog "Then, execute the following command to setup the initial database"
-       elog "environment:"
-       elog "    emerge --config =${CATEGORY}/${PF}"
+       if 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 [[ -z ${REPLACED_BY_VERSION} ]] ; then
+       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";
 
@@ -298,6 +333,8 @@ pkg_postrm() {
 }
 
 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}/"
@@ -418,17 +455,17 @@ pkg_config() {
 }
 
 src_test() {
-       einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
-
-       if [[ ${UID} -ne 0 ]] ; then
+       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 'Tests cannot be run as root. Enable "userpriv" 
in FEATURES.'
 
-               ewarn "Skipping."
+               ewarn 'Skipping.'
        fi
 }

diff --git a/dev-db/postgresql/postgresql-9999.ebuild 
b/dev-db/postgresql/postgresql-9999.ebuild
index cbc1266c206..0245d247103 100644
--- a/dev-db/postgresql/postgresql-9999.ebuild
+++ b/dev-db/postgresql/postgresql-9999.ebuild
@@ -11,7 +11,7 @@ inherit eutils flag-o-matic git-2 linux-info multilib pam 
prefix \
 KEYWORDS=""
 
 # Bump when rc released.
-SLOT="10"
+SLOT="11"
 
 EGIT_REPO_URI="git://git.postgresql.org/git/postgresql.git"
 
@@ -207,14 +207,28 @@ src_install() {
                          "/usr/bin/${bn}${SLOT/.}tmp"
        done
 
-       local linkname mansec
-       for mansec in {1,3,7} ; do
-               for f in 
"${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
+       # 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
+
+               for f in 
"${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
                        bn=$(basename "${f}")
-                       linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
-                       dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
-                                 /usr/share/man/man${mansec}/${linkname}
+                       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
 
        if use prefix ; then

Reply via email to