commit:     d10f1bdd33c918e33ce8a69c6214810a1cb31d04
Author:     Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 16:15:05 2016 +0000
Commit:     Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 16:15:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d10f1bdd

dev-db/postgresql: Fix broken/improve no-server patches

9.4 and 9.5 had a small change to a section that is modified by the
patch, thus causing failure.

Further, pgbench was added back in as it is a client program that does
not need the server to be on the same machine.

Lastly, the 9.6 no-server patch was incomplete and allowed the entire
backend to be built when only the headers are needed…theoretically.

Package-Manager: portage-2.2.28

 .../files/postgresql-9.4.10-no-server.patch        | 151 +++++++++++++++++++++
 .../files/postgresql-9.5.5-no-server.patch         | 151 +++++++++++++++++++++
 .../files/postgresql-9.6.1-no-server.patch         | 130 ++++++++++++++++++
 dev-db/postgresql/postgresql-9.4.10.ebuild         |   2 +-
 dev-db/postgresql/postgresql-9.5.5.ebuild          |   2 +-
 ...sql-9.5.5.ebuild => postgresql-9.6.1-r1.ebuild} |  13 +-
 6 files changed, 439 insertions(+), 10 deletions(-)

diff --git a/dev-db/postgresql/files/postgresql-9.4.10-no-server.patch 
b/dev-db/postgresql/files/postgresql-9.4.10-no-server.patch
new file mode 100644
index 00000000..81fc383
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.4.10-no-server.patch
@@ -0,0 +1,151 @@
+diff -Naruw a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2016-10-24 16:12:53.000000000 -0400
++++ b/contrib/Makefile 2016-10-27 13:38:23.361545396 -0400
+@@ -5,64 +5,10 @@
+ include $(top_builddir)/src/Makefile.global
+ 
+ SUBDIRS = \
+-              adminpack       \
+-              auth_delay      \
+-              auto_explain    \
+-              btree_gin       \
+-              btree_gist      \
+-              chkpass         \
+-              citext          \
+-              cube            \
+-              dblink          \
+-              dict_int        \
+-              dict_xsyn       \
+-              dummy_seclabel  \
+-              earthdistance   \
+-              file_fdw        \
+-              fuzzystrmatch   \
+-              hstore          \
+-              intagg          \
+-              intarray        \
+-              isn             \
+-              lo              \
+-              ltree           \
+               oid2name        \
+-              pageinspect     \
+-              passwordcheck   \
+-              pg_archivecleanup \
+-              pg_buffercache  \
+-              pg_freespacemap \
+-              pg_prewarm      \
+-              pg_standby      \
+-              pg_stat_statements \
+-              pg_test_fsync   \
+-              pg_test_timing  \
+-              pg_trgm         \
+-              pg_upgrade      \
+-              pg_upgrade_support \
+               pgbench         \
+-              pgcrypto        \
+-              pgrowlocks      \
+-              pgstattuple     \
+-              pg_xlogdump     \
+-              postgres_fdw    \
+-              seg             \
+-              spi             \
+-              tablefunc       \
+-              tcn             \
+-              test_decoding   \
+-              test_parser     \
+-              test_shm_mq     \
+-              tsearch2        \
+-              unaccent        \
+-              vacuumlo        \
+-              worker_spi
++              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     2016-10-24 16:12:53.000000000 -0400
++++ b/src/backend/Makefile     2016-10-27 14:04:47.617000374 -0400
+@@ -47,7 +47,7 @@
+ 
+ ##########################################################################
+ 
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: someheaders
+ 
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -106,7 +106,7 @@
+ endif # aix
+ 
+ # Update the commonly used headers before building the subdirectories
+-$(SUBDIRS:%=%-recursive): $(top_builddir)/src/include/parser/gram.h 
$(top_builddir)/src/include/catalog/schemapg.h 
$(top_builddir)/src/include/utils/fmgroids.h 
$(top_builddir)/src/include/utils/errcodes.h 
$(top_builddir)/src/include/utils/probes.h
++someheaders $(SUBDIRS:%=%-recursive): 
$(top_builddir)/src/include/parser/gram.h 
$(top_builddir)/src/include/catalog/schemapg.h 
$(top_builddir)/src/include/utils/fmgroids.h 
$(top_builddir)/src/include/utils/errcodes.h 
$(top_builddir)/src/include/utils/probes.h
+ 
+ # run this unconditionally to avoid needing to know its dependencies here:
+ submake-schemapg:
+@@ -199,23 +199,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 2016-10-24 16:12:53.000000000 -0400
++++ b/src/bin/Makefile 2016-10-27 13:41:34.443930143 -0400
+@@ -13,8 +13,7 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ 
+-SUBDIRS = initdb pg_ctl pg_dump \
+-      psql scripts pg_config pg_controldata pg_resetxlog pg_basebackup
++SUBDIRS = pg_dump psql scripts pg_config
+ 
+ ifeq ($(PORTNAME), win32)
+ SUBDIRS += pgevent
+diff -Naruw a/src/Makefile b/src/Makefile
+--- a/src/Makefile     2016-10-24 16:12:53.000000000 -0400
++++ b/src/Makefile     2016-10-27 13:43:09.296792018 -0400
+@@ -15,18 +15,11 @@
+ SUBDIRS = \
+       common \
+       port \
+-      timezone \
+       backend \
+-      backend/utils/mb/conversion_procs \
+-      backend/snowball \
+       include \
+       interfaces \
+-      backend/replication/libpqwalreceiver \
+       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/files/postgresql-9.5.5-no-server.patch 
b/dev-db/postgresql/files/postgresql-9.5.5-no-server.patch
new file mode 100644
index 00000000..2856678
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.5.5-no-server.patch
@@ -0,0 +1,151 @@
+diff -Naruw postgresql-9.5.5.orig/contrib/Makefile 
postgresql-9.5.5/contrib/Makefile
+--- postgresql-9.5.5.orig/contrib/Makefile     2016-10-24 16:10:50.000000000 
-0400
++++ postgresql-9.5.5/contrib/Makefile  2016-10-27 13:49:19.418285694 -0400
+@@ -5,55 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+ 
+ SUBDIRS = \
+-              adminpack       \
+-              auth_delay      \
+-              auto_explain    \
+-              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     \
+-              postgres_fdw    \
+-              seg             \
+-              spi             \
+-              tablefunc       \
+-              tcn             \
+-              test_decoding   \
+-              tsm_system_rows \
+-              tsm_system_time \
+-              tsearch2        \
+-              unaccent        \
+               vacuumlo
+ 
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+ 
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+diff -Naruw postgresql-9.5.5.orig/src/backend/Makefile 
postgresql-9.5.5/src/backend/Makefile
+--- postgresql-9.5.5.orig/src/backend/Makefile 2016-10-24 16:10:50.000000000 
-0400
++++ postgresql-9.5.5/src/backend/Makefile      2016-10-27 13:51:16.027706097 
-0400
+@@ -47,7 +47,7 @@
+ 
+ ##########################################################################
+ 
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: someheaders
+ 
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -106,7 +106,7 @@
+ endif # aix
+ 
+ # Update the commonly used headers before building the subdirectories
+-$(SUBDIRS:%=%-recursive): $(top_builddir)/src/include/parser/gram.h 
$(top_builddir)/src/include/catalog/schemapg.h 
$(top_builddir)/src/include/utils/fmgroids.h 
$(top_builddir)/src/include/utils/errcodes.h 
$(top_builddir)/src/include/utils/probes.h
++someheaders $(SUBDIRS:%=%-recursive): 
$(top_builddir)/src/include/parser/gram.h 
$(top_builddir)/src/include/catalog/schemapg.h 
$(top_builddir)/src/include/utils/fmgroids.h 
$(top_builddir)/src/include/utils/errcodes.h 
$(top_builddir)/src/include/utils/probes.h
+ 
+ # run this unconditionally to avoid needing to know its dependencies here:
+ submake-schemapg:
+@@ -199,23 +199,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 postgresql-9.5.5.orig/src/bin/Makefile 
postgresql-9.5.5/src/bin/Makefile
+--- postgresql-9.5.5.orig/src/bin/Makefile     2016-10-24 16:10:50.000000000 
-0400
++++ postgresql-9.5.5/src/bin/Makefile  2016-10-27 14:26:26.397161219 -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_resetxlog \
+-      pg_rewind \
+-      pg_test_fsync \
+-      pg_test_timing \
+-      pg_upgrade \
+-      pg_xlogdump \
+       pgbench \
+       psql \
+       scripts
+diff -Naruw postgresql-9.5.5.orig/src/Makefile postgresql-9.5.5/src/Makefile
+--- postgresql-9.5.5.orig/src/Makefile 2016-10-24 16:10:50.000000000 -0400
++++ postgresql-9.5.5/src/Makefile      2016-10-27 14:03:49.513956432 -0400
+@@ -15,18 +15,11 @@
+ SUBDIRS = \
+       common \
+       port \
+-      timezone \
+       backend \
+-      backend/utils/mb/conversion_procs \
+-      backend/snowball \
+       include \
+       interfaces \
+-      backend/replication/libpqwalreceiver \
+       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/files/postgresql-9.6.1-no-server.patch 
b/dev-db/postgresql/files/postgresql-9.6.1-no-server.patch
new file mode 100644
index 00000000..868567c
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.6.1-no-server.patch
@@ -0,0 +1,130 @@
+diff -Naruw a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2016-10-24 16:08:51.000000000 -0400
++++ b/contrib/Makefile 2016-10-28 11:41:00.450589656 -0400
+@@ -5,58 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+ 
+ SUBDIRS = \
+-              adminpack       \
+-              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 \
+-              tsearch2        \
+-              unaccent        \
+               vacuumlo
+ 
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+-
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+ else
+diff -Naruw a/src/backend/Makefile b/src/backend/Makefile
+--- a/src/backend/Makefile     2016-10-24 16:08:51.000000000 -0400
++++ b/src/backend/Makefile     2016-10-28 11:48:58.571353118 -0400
+@@ -51,7 +51,7 @@
+ 
+ ##########################################################################
+ 
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: someheaders
+ 
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -110,7 +110,7 @@
+ endif # aix
+ 
+ # Update the commonly used headers before building the subdirectories
+-$(SUBDIRS:%=%-recursive): | generated-headers
++someheaders $(SUBDIRS:%=%-recursive): | generated-headers
+ 
+ # src/port needs a convenient way to force just errcodes.h to get built
+ submake-errcodes: $(top_builddir)/src/include/utils/errcodes.h
+diff -Naruw a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2016-10-24 16:08:51.000000000 -0400
++++ b/src/bin/Makefile 2016-10-28 11:42:26.000129832 -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_resetxlog \
+-      pg_rewind \
+-      pg_test_fsync \
+-      pg_test_timing \
+-      pg_upgrade \
+-      pg_xlogdump \
+       pgbench \
+       psql \
+       scripts
+diff -Naruw a/src/Makefile b/src/Makefile
+--- a/src/Makefile     2016-10-24 16:08:51.000000000 -0400
++++ b/src/Makefile     2016-10-28 11:41:00.453922971 -0400
+@@ -15,19 +15,11 @@
+ SUBDIRS = \
+       common \
+       port \
+-      timezone \
+       backend \
+-      backend/utils/mb/conversion_procs \
+-      backend/snowball \
+       include \
+       interfaces \
+-      backend/replication/libpqwalreceiver \
+-      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-9.4.10.ebuild 
b/dev-db/postgresql/postgresql-9.4.10.ebuild
index 42b20ad..8882ffc 100644
--- a/dev-db/postgresql/postgresql-9.4.10.ebuild
+++ b/dev-db/postgresql/postgresql-9.4.10.ebuild
@@ -117,7 +117,7 @@ src_prepare() {
        # hardened and non-hardened environments. (Bug #528786)
        sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
 
-       use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+       use server || epatch "${FILESDIR}/${PN}-9.4.10-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.

diff --git a/dev-db/postgresql/postgresql-9.5.5.ebuild 
b/dev-db/postgresql/postgresql-9.5.5.ebuild
index 886d41c..2a094d5 100644
--- a/dev-db/postgresql/postgresql-9.5.5.ebuild
+++ b/dev-db/postgresql/postgresql-9.5.5.ebuild
@@ -117,7 +117,7 @@ src_prepare() {
        # hardened and non-hardened environments. (Bug #528786)
        sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
 
-       use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+       use server || epatch "${FILESDIR}/${PN}-9.5.5-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.

diff --git a/dev-db/postgresql/postgresql-9.5.5.ebuild 
b/dev-db/postgresql/postgresql-9.6.1-r1.ebuild
similarity index 97%
copy from dev-db/postgresql/postgresql-9.5.5.ebuild
copy to dev-db/postgresql/postgresql-9.6.1-r1.ebuild
index 886d41c..1f7b879 100644
--- a/dev-db/postgresql/postgresql-9.5.5.ebuild
+++ b/dev-db/postgresql/postgresql-9.6.1-r1.ebuild
@@ -13,7 +13,10 @@ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc 
~ppc64 ~s390 ~sh ~spa
 
 SLOT="$(get_version_component_range 1-2)"
 
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+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"
@@ -117,7 +120,7 @@ src_prepare() {
        # hardened and non-hardened environments. (Bug #528786)
        sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
 
-       use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+       use server || epatch "${FILESDIR}/${PN}-${SLOT}.1-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.
@@ -163,7 +166,6 @@ src_configure() {
                --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) \
@@ -248,11 +250,6 @@ src_install() {
 pkg_postinst() {
        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}/"
 

Reply via email to