summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2008-04-15 09:29:55 +0000
committerTiziano Müller <dev-zero@gentoo.org>2008-04-15 09:29:55 +0000
commit5499a42491398f3fe4221d03a2e29f675f97ef26 (patch)
tree8695c25824d96522ce93df411ee74841bbc323a4 /dev-db/postgresql-server
parentAdded uuid USE-flag for dev-db/postgresql-server (diff)
downloadhistorical-5499a42491398f3fe4221d03a2e29f675f97ef26.tar.gz
historical-5499a42491398f3fe4221d03a2e29f675f97ef26.tar.bz2
historical-5499a42491398f3fe4221d03a2e29f675f97ef26.zip
Moved into the tree. Thanks to Michael Krelin (polyonymous).
Package-Manager: portage-2.1.5_rc2
Diffstat (limited to 'dev-db/postgresql-server')
-rw-r--r--dev-db/postgresql-server/ChangeLog157
-rw-r--r--dev-db/postgresql-server/Manifest42
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.3-cubeparse.patch36
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.3-regress.patch87
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.3-server.patch109
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.3.21-autoconf.patch57
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.4-regress.patch87
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.4-server.patch108
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.4-vacuum-delay.patch284
-rw-r--r--dev-db/postgresql-server/files/postgresql-7.4.19-autoconf.patch48
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.0-common.patch76
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.0-server.patch230
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.1-common.patch74
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.1-server.patch219
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.2-common.patch88
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.2-server.patch178
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.3-common.patch88
-rw-r--r--dev-db/postgresql-server/files/postgresql-8.3-server.patch217
-rw-r--r--dev-db/postgresql-server/files/postgresql.conf-7.348
-rw-r--r--dev-db/postgresql-server/files/postgresql.conf-7.448
-rw-r--r--dev-db/postgresql-server/files/postgresql.conf-8.048
-rw-r--r--dev-db/postgresql-server/files/postgresql.conf-8.148
-rw-r--r--dev-db/postgresql-server/files/postgresql.conf-8.248
-rw-r--r--dev-db/postgresql-server/files/postgresql.conf-8.348
-rw-r--r--dev-db/postgresql-server/files/postgresql.init-7.375
-rw-r--r--dev-db/postgresql-server/files/postgresql.init-7.475
-rw-r--r--dev-db/postgresql-server/files/postgresql.init-8.075
-rw-r--r--dev-db/postgresql-server/files/postgresql.init-8.175
-rw-r--r--dev-db/postgresql-server/files/postgresql.init-8.275
-rw-r--r--dev-db/postgresql-server/files/postgresql.init-8.375
-rw-r--r--dev-db/postgresql-server/metadata.xml5
-rw-r--r--dev-db/postgresql-server/postgresql-server-7.3.21.ebuild238
-rw-r--r--dev-db/postgresql-server/postgresql-server-7.4.19.ebuild234
-rw-r--r--dev-db/postgresql-server/postgresql-server-8.0.15.ebuild239
-rw-r--r--dev-db/postgresql-server/postgresql-server-8.1.11.ebuild238
-rw-r--r--dev-db/postgresql-server/postgresql-server-8.2.7.ebuild243
-rw-r--r--dev-db/postgresql-server/postgresql-server-8.3.1.ebuild248
37 files changed, 4368 insertions, 0 deletions
diff --git a/dev-db/postgresql-server/ChangeLog b/dev-db/postgresql-server/ChangeLog
new file mode 100644
index 000000000000..a45dbcc80faf
--- /dev/null
+++ b/dev-db/postgresql-server/ChangeLog
@@ -0,0 +1,157 @@
+# ChangeLog for dev-db/postgresql-server
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.1 2008/04/15 09:29:54 dev-zero Exp $
+
+*postgresql-server-8.3.1 (15 Apr 2008)
+*postgresql-server-8.2.7 (15 Apr 2008)
+*postgresql-server-8.1.11 (15 Apr 2008)
+*postgresql-server-8.0.15 (15 Apr 2008)
+*postgresql-server-7.4.19 (15 Apr 2008)
+*postgresql-server-7.3.21 (15 Apr 2008)
+
+ 15 Apr 2008; Tiziano Müller <dev-zero@gentoo.org>
+ +files/postgresql.conf-7.3, +files/postgresql.init-7.3,
+ +files/postgresql-7.3.21-autoconf.patch,
+ +files/postgresql-7.3-cubeparse.patch,
+ +files/postgresql-7.3-regress.patch, +files/postgresql-7.3-server.patch,
+ +files/postgresql.conf-7.4, +files/postgresql.init-7.4,
+ +files/postgresql-7.4.19-autoconf.patch,
+ +files/postgresql-7.4-regress.patch, +files/postgresql-7.4-server.patch,
+ +files/postgresql-7.4-vacuum-delay.patch, +files/postgresql.conf-8.0,
+ +files/postgresql.init-8.0, +files/postgresql-8.0-common.patch,
+ +files/postgresql-8.0-server.patch, +files/postgresql.conf-8.1,
+ +files/postgresql.init-8.1, +files/postgresql-8.1-common.patch,
+ +files/postgresql-8.1-server.patch, +files/postgresql.conf-8.2,
+ +files/postgresql.init-8.2, +files/postgresql-8.2-common.patch,
+ +files/postgresql-8.2-server.patch, +files/postgresql.conf-8.3,
+ +files/postgresql.init-8.3, +files/postgresql-8.3-common.patch,
+ +files/postgresql-8.3-server.patch, +metadata.xml,
+ +postgresql-server-7.3.21.ebuild, +postgresql-server-7.4.19.ebuild,
+ +postgresql-server-8.0.15.ebuild, +postgresql-server-8.1.11.ebuild,
+ +postgresql-server-8.2.7.ebuild, +postgresql-server-8.3.1.ebuild:
+ Moved into the tree. Thanks to Michael Krelin (polyonymous).
+
+ 10 Apr 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild, postgresql-server-7.4.19.ebuild,
+ postgresql-server-8.0.15.ebuild, postgresql-server-8.1.11.ebuild,
+ postgresql-server-8.2.7.ebuild, postgresql-server-8.3.1.ebuild:
+ slot-files should be kept in /etc/eselect/postgresql/slots as from now.
+ Added workaround for paludis for /var/run/postgresql/.keep collision.
+
+ 07 Apr 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-8.3.1.ebuild:
+ Re-added keywords ~alpha ~hppa ~ia64 ~ppc64 ~sparc (since ossp-uuid has been
+ keyworded).
+
+ 07 Apr 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild, postgresql-server-7.4.19.ebuild,
+ postgresql-server-8.0.15.ebuild, postgresql-server-8.1.11.ebuild,
+ postgresql-server-8.2.7.ebuild, postgresql-server-8.3.1.ebuild:
+ Removed pkg_setup check whether there's an older database cluster installed
+ because it's pointless now that we have slotting available. Added some more
+ einfo/ewarns to inform the user how to change the database cluster location.
+
+ 07 Apr 2008; Tiziano Müller <dev-zero@gentoo.org>
+ files/postgresql.conf-7.3, postgresql-server-7.3.21.ebuild,
+ files/postgresql-7.3-server.patch, files/postgresql.conf-7.4,
+ postgresql-server-7.4.19.ebuild, files/postgresql-7.4-server.patch,
+ files/postgresql.conf-8.0, postgresql-server-8.0.15.ebuild,
+ files/postgresql-8.0-server.patch, files/postgresql.conf-8.1,
+ postgresql-server-8.1.11.ebuild, files/postgresql-8.1-server.patch,
+ files/postgresql.conf-8.2, postgresql-server-8.2.7.ebuild,
+ files/postgresql-8.2-server.patch, files/postgresql.conf-8.3,
+ postgresql-server-8.3.1.ebuild, files/postgresql-8.3-server.patch:
+ Removed old digest files. Refactored pkg_config: It now asks the user to
+ continue and the tests are much saner. Changed the default sockets directory
+ from /tmp to /var/run/postgresql and added warning for it.
+
+ 30 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ files/postgresql.init-7.3, files/postgresql.conf-7.3,
+ files/postgresql.init-7.4, files/postgresql.conf-7.4,
+ files/postgresql.init-8.0, files/postgresql.conf-8.0,
+ files/postgresql.init-8.1, files/postgresql.conf-8.1,
+ files/postgresql.init-8.2, files/postgresql.conf-8.2,
+ files/postgresql.init-8.3, files/postgresql.conf-8.3:
+ Changed init.d/conf.d scripts to wait until the server started up/shut down
+ completely. WAIT_FOR_{DISCONNET,CLEANUP,QUIT} should now work independently
+ of the baselayout-version.
+
+ 29 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-8.3.1.ebuild, files/postgresql-8.3-server.patch:
+ Added uuid USE-flag, dependency and modified patch. Had to drop all keywords
+ besides ~amd64 and ~x86.
+
+ 27 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-8.3.1.ebuild:
+ Will now use system's zoneinfo. Added $(use_with xml libxslt).
+
+ 19 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ -postgresql-server-8.2.6.ebuild, +postgresql-server-8.2.7.ebuild,
+ -postgresql-server-8.3.0.ebuild, +postgresql-server-8.3.1.ebuild:
+ Version bump.
+
+ 15 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild, postgresql-server-7.4.19.ebuild,
+ files/postgresql-7.4-server.patch, postgresql-server-8.0.15.ebuild,
+ postgresql-server-8.1.11.ebuild, postgresql-server-8.2.6.ebuild,
+ postgresql-server-8.3.0.ebuild:
+ Fixed the patch for 7.4 (accidentally removed pgtcl-support even if
+ specified. Removed the 'test' USE flag. Removed stalled gnuconfig
+ inheritance. Added -lpq to the LIBS list for 7.4 since it doesn't build
+ otherwise.
+
+ 11 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-8.0.15.ebuild, files/postgresql-8.3-server.patch:
+ Removed oid2name since installed by postgresql-base.
+
+ 10 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild:
+ Disabled horology test since it's too unreliable.
+
+ 10 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild:
+ Removed unused sed.
+
+ 10 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild, files/postgresql-7.3-regress.patch,
+ postgresql-server-7.4.19.ebuild, files/postgresql-7.4-regress.patch,
+ postgresql-server-8.0.15.ebuild, files/postgresql-8.0-server.patch,
+ postgresql-server-8.1.11.ebuild, files/postgresql-8.1-server.patch,
+ postgresql-server-8.2.6.ebuild, files/postgresql-8.2-server.patch,
+ postgresql-server-8.3.0.ebuild, files/postgresql-8.3-server.patch:
+ A lot of /usr/lib -> /usr/ fixes. Removed chown and 'su -' lines from the
+ patches since it makes tests fail when using paludis and a sane workaround
+ is not possible atm.
+
+ 10 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild, postgresql-server-7.4.19.ebuild,
+ postgresql-server-8.0.15.ebuild, postgresql-server-8.1.11.ebuild:
+ Changed some more dependencies on postgresql-libs to postgresql-base
+
+ 10 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild, postgresql-server-7.4.19.ebuild,
+ postgresql-server-8.0.15.ebuild, postgresql-server-8.1.11.ebuild,
+ postgresql-server-8.2.6.ebuild, postgresql-server-8.3.0.ebuild,
+ +metadata.xml:
+ Changed dependency in 7.3 for new postgresql-base package. Added metadata.xml.
+
+ 07 Mar 2008; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.21.ebuild, postgresql-server-7.4.19.ebuild,
+ postgresql-server-8.0.15.ebuild, postgresql-server-8.1.11.ebuild,
+ postgresql-server-8.2.6.ebuild, -postgresql-server-8.3_rc1.ebuild,
+ +postgresql-server-8.3.0.ebuild:
+ Version bump to final 8.3.0. Changed dependencies to match postgresql-base
+ (will likely break people's update scripts since we now block libpq.
+ Transition will be: 1.put virtual/postgresql-{server,base} in the tree and
+ let them depend on ||(dev-db/libpq dev-db/postgresql-libs) (respective
+ dev-db/postgresql and postgresql-server), 2. change all ebuilds in the tree
+ to depend on virtual/..., 3. people only have to unmerge libpq and
+ postgresql and merge dev-db/postgresql-{base,server} with _no_
+ revdep-rebuild run needed.
+
+ 20 Mar 2007; Tiziano Müller <dev-zero@gentoo.org>
+ postgresql-server-7.3.18.ebuild, postgresql-server-7.4.16.ebuild,
+ postgresql-server-8.0.12.ebuild, postgresql-server-8.1.8.ebuild,
+ postgresql-server-8.2.3.ebuild:
+ Added postgresql-docs dependency via doc-USE-flag in PDEPEND.
+
diff --git a/dev-db/postgresql-server/Manifest b/dev-db/postgresql-server/Manifest
new file mode 100644
index 000000000000..76efdac879df
--- /dev/null
+++ b/dev-db/postgresql-server/Manifest
@@ -0,0 +1,42 @@
+AUX postgresql-7.3-cubeparse.patch 1296 RMD160 9b9c0fcf4d58fb989ae77d9ada4588b1876400a6 SHA1 c128746e9938d7aaa4f2be6521530d07c7e207a8 SHA256 1844950b55509b83f38bfdd113350df7422f96ca4c773def6d38ca2f48fcfada
+AUX postgresql-7.3-regress.patch 3294 RMD160 babb74fa25f69bdc5b7a31fc590cc9b8c56b6cb8 SHA1 32be69b830f7fb93b39bba085a240a57b63ce16a SHA256 89f552ebe592677887c086b92c16104b7db47839ad889c3f91546191005d1016
+AUX postgresql-7.3-server.patch 2773 RMD160 14db25b2a9f20b6f1e6c87b2aea1879b3c9873f9 SHA1 605a4efee3a05922a4387206f807c68c2625aa9c SHA256 b963985a5c6fadbb79b359549d482ebd108008eaf1755fbc29ff500bd9677b2f
+AUX postgresql-7.3.21-autoconf.patch 2141 RMD160 3bff01abeeeb094f04469960d4725c977657fb1c SHA1 aceb7ebafde14fde0efe6eefc68115fd8b4cb95a SHA256 9444af9ac2908f18fc69ef2db6fe78584384a46d28dd4c8af10740f9138796a8
+AUX postgresql-7.4-regress.patch 3337 RMD160 dcd1eef99595c5ae070a6778179a1b4611810ad8 SHA1 b58a22970ff3f6c489e55fa6fc1f2a5ba27f1aec SHA256 0679c01c80b0a789789cc5e4b0317e3d8e1ec4acdbe1bd42b63eab37097fa872
+AUX postgresql-7.4-server.patch 2811 RMD160 07a11c84497d7ddeaac1266821d2dd4a75f2ea01 SHA1 3d09b0cdffdddd93de0b97b626fc91772342f640 SHA256 d31c37a7821421e289e0dcc57b743e219fe97745053a2750703647f4e2a4bd5c
+AUX postgresql-7.4-vacuum-delay.patch 8918 RMD160 dcd4fc4774277b0bf4a2158584c18bae2dc04232 SHA1 fe701fd6ca6cc9519417ab1053ef61a50ca51281 SHA256 7112ea61b84ce5c6974cd74687039f2ef871e0b4b25a34b4394225c2695fc123
+AUX postgresql-7.4.19-autoconf.patch 1870 RMD160 92e49d3bc82ebfce6c798b4d56008da5c8f46d33 SHA1 a42d03a9c4d7b5df7a69a3d23c9e527c6d901eba SHA256 dccd9553b9cfdc88ffe98e445e27d1714426b4f1e6f405af438243ba06b93b6e
+AUX postgresql-8.0-common.patch 2294 RMD160 4f0028f6b5e95d74328f2c3981aa558420739181 SHA1 be649bf09bd5082e6e2af58c44cc470456e37780 SHA256 eca25d56bd157a3a7883d4c4305e4e0b7d22b8dd0cbca93da88add24da28b681
+AUX postgresql-8.0-server.patch 6918 RMD160 de96cda82597098fbfb595fac5069164d7e4f30e SHA1 9f5b5e3bff058f75fe5e25e968e96c1c0147cc43 SHA256 5d8ff711ec83eb8660edc129519bd67ae76553fca22ced379439d31938173346
+AUX postgresql-8.1-common.patch 2290 RMD160 ba1f803b045a8d3f430231b0c22b8817e2eb8cf6 SHA1 facf27b2c396fe9f2347eb4cec3b2714a8587b70 SHA256 f80c8dd5a31b88df330c15de4331db1600ae078a789650ab28d61620f27056f5
+AUX postgresql-8.1-server.patch 6862 RMD160 94dc4c22f1f480bf5844f6e654d8a4e0534059eb SHA1 8fbf5d0b4d24b675f6812ff89465527263f51012 SHA256 97f3b3d889af08aeb92e6583dd970763cdc662621e34e13a5298fe9cd5ad4b4d
+AUX postgresql-8.2-common.patch 2640 RMD160 b25ba915d5d6ad9c12c1d51426363c196b830923 SHA1 7b946d57bfed34e2e7e1338c3ab3004341d7ab12 SHA256 36ca9cb4f26424c302fdd704b7c1a268e87612afa3006bf008d4594dabe080f8
+AUX postgresql-8.2-server.patch 5319 RMD160 9aae5832defd2e43879246e773fd1aada0680716 SHA1 ea726704fc85118c27f511bfd9324b136ced3eb1 SHA256 2687fa5159a34da59e36af4c894f43b2136e8e88c965a682607cb48acb61d8ee
+AUX postgresql-8.3-common.patch 2641 RMD160 0822bf1512457e91d5f32f9d192de6f197db9c55 SHA1 e4bdbd5eee1023e8f0b42ef408b34b57495d1e2b SHA256 e416c26d9c3d266b306ddbc0a2b648054739b7ace35e2b4e449fbdaf094bc197
+AUX postgresql-8.3-server.patch 6683 RMD160 58fb842a74512a94b24a85a4268a61b095cfedf0 SHA1 5041fe54bfe00b29b9abeb4bc6cd6139ef247f00 SHA256 fd44afe3fdb3109bdd3c849543e2065efc9aef2511a80ba711961ab9e879a02f
+AUX postgresql.conf-7.3 1532 RMD160 fa088eb5742efbce852d6dcff1dba420857aa67e SHA1 22ac6f3632d6baa1a97017f27001951ccf6a224c SHA256 c0e2ae8c22895bde591302234735ceaddcf4c2a4b1e17ed8cee53b66dad32a24
+AUX postgresql.conf-7.4 1532 RMD160 8897005145112dc1782174fcac512531a32ce88a SHA1 f7e1e1c6cac39d1c7ecc371c9391214d6a8c8055 SHA256 4084c99ad0fff027876c82375c4d99d1669090398137ef5ed19c8e74cecb6e0c
+AUX postgresql.conf-8.0 1532 RMD160 de03805c18ac079b830bcc412c838eb67cbf4f2b SHA1 a7e288d80b0fd24ddf55bdd560f1e8b216b1f540 SHA256 471cd40a0f9100789d238722e5e5efb923dd4f526b564341a5401b3df236721a
+AUX postgresql.conf-8.1 1532 RMD160 69ce81cb490d73b1c6fd373ff6d4f76abbaec4f9 SHA1 6120fcbc61cce8da2b02eb5608def3e65a6ff04d SHA256 e28635d2abb43a30fe58d0d35c7266e40cb323c94797b8a98a0b7f2a4caf507d
+AUX postgresql.conf-8.2 1532 RMD160 8712059a8898ff65aff6d8dd6287726ebfc7719f SHA1 ca6547ac197a81a84b3de5c6f41d1b824fa6cef4 SHA256 775d1aa953c1d5a82f16e013249c6c29c4907f810536bfc4852eca72a2228780
+AUX postgresql.conf-8.3 1532 RMD160 90f201a80549b663fccb3dd90fd507845b27a958 SHA1 7c4f44369064e81b5092491b5327254022e12492 SHA256 7d9814b4bc11c3ca50c0891ac8c57b0793d92d5eb9814d43ef0ef31d0d2eee46
+AUX postgresql.init-7.3 2269 RMD160 cb0d93467e18c07f97e7d82acc1ac357c8cc94b1 SHA1 f88ca0b0e791c2ffb22e70e1f27a2ad70f78e9ca SHA256 e9750a5f38184ad69bc722ba46fe66ad2cf5f5018dd28bdb9f9a32959827946f
+AUX postgresql.init-7.4 2269 RMD160 05b87888911800c8988db49e52e567f446938088 SHA1 c0edd1728312107408712bc090b576824c4a1369 SHA256 af8f6153b24190a9240f19c40d8404fbff1338aec74be4f820b184fc62d71d4c
+AUX postgresql.init-8.0 2269 RMD160 7c1ca65c5667d5873fa0f6628bbb2cd0d1e9d1f8 SHA1 dea0cf8bf017daa56cdebdc25c80ffa905568c5a SHA256 572bc9eb536ddedba327fe72a5c4e5733a4a6da593f886ef9856f1efce3a2654
+AUX postgresql.init-8.1 2269 RMD160 49e87fe3e2c3de4d68015391f59082dbd5051fc9 SHA1 0fde2855982feff06413a4a2ff13cff7a17f41a2 SHA256 8ddb7db9012587800eb1ea09c4bca618888a69b9a361ecb7b2d6bc40fdca5b0b
+AUX postgresql.init-8.2 2269 RMD160 cf85381e793aba0aa45b9b3809f4642034afa82d SHA1 39cac0283f4f30ba3d69d541d0205c92b8df4dfb SHA256 5481163b44802446a1ed95fc5ce81663c5765e4b44e9706f80e3cc0e736896b1
+AUX postgresql.init-8.3 2269 RMD160 87354a9aaf37d1f66af0f568b5c6d2338f6499b4 SHA1 d919fea67a5b39e9e25b5b44f301ec18ad11dff8 SHA256 45048120fa11b64917978d954374116ab6099b9ffd40be6eb9f3edce3c55da44
+DIST postgresql-7.3.21.tar.bz2 9284558 RMD160 f9de4676b4fbe3d96e6d1462b8bc3c05600d6525 SHA1 bdfa3bddc483c6642cc2ee271d076bfaa4c20c92 SHA256 bf44e0ac259e9f6e14ac102f2977496b6996ecea2fd227fbdcea5fa70e342888
+DIST postgresql-7.4.19.tar.bz2 10307396 RMD160 c9a1c7dc8e7bf9ce93c3b4f061af0563b1cc2627 SHA1 19c563d47b0d5deeef03b5ca7707c9f1917853ce SHA256 447ac7070aa0a547f17a307e842734fc27e2716cb4a251fa9a810b178d44c389
+DIST postgresql-8.0.15.tar.bz2 11253897 RMD160 6aff5c63dce73eea609f0b6e013cd043ae8b7a37 SHA1 66a6fef7749afb91471200005511c04fc1ac2706 SHA256 59408a00db1c73e638a11af10438a827507b7a72b53916d58f2d44c477718714
+DIST postgresql-8.1.11.tar.bz2 11735420 RMD160 9fb98eadc4f1015205970f26b31b68ea0378bda9 SHA1 73c0f09754fc8e3c7f8d7de49d70244b76927416 SHA256 3e91cdfc1353fa9c6416d9fc8ae9d6ab3171565f00aeb6c882214c2f08a03e2e
+DIST postgresql-8.2.7.tar.bz2 12576126 RMD160 96700e91c3b9e733c686b0fe377c7ba661710942 SHA1 0be0dbaa488810ebcba77ac7246180c5b2a9b669 SHA256 39528d1ba50f5abc51569e8b9bdeb47d0d4650d289a2c2e465621864b1ff3584
+DIST postgresql-8.3.1.tar.bz2 13995572 RMD160 075efb67126f2b308d2a5fe4f9097fdbfbe94c89 SHA1 7397e0d8fd3c420ee845d9ae4995ae347bfaea1d SHA256 7ccf1e5c987920e4d6eb98b8589939e29d3a361d285055d5af35ddd8e1a2d992
+EBUILD postgresql-server-7.3.21.ebuild 9005 RMD160 311388286293f2056ecbe8661ca473bfa09d4407 SHA1 ad97143f16826d157377941a2d4c676cb4c32f15 SHA256 5d198eb9fc094e22c87b1e8b949bdb510a9af530ecfe776eb24508ba2dcf48ef
+EBUILD postgresql-server-7.4.19.ebuild 8935 RMD160 f13f75440a0a1abf66c99b75e537361c9f629018 SHA1 43bf52014175350a90264de1398daf4a817efc83 SHA256 4ef86d53b2c902aee845c089368c1103af44bed0ea60587b055dd64491cfe630
+EBUILD postgresql-server-8.0.15.ebuild 9131 RMD160 0fe98d0211654df7fe71269d78b6d71fec122267 SHA1 cdb30085035807cbb54d9fc4bb47e13e6e0fed16 SHA256 c5aed28bb22ca377cd6d42fdf20ac0b8a69e5229aff6a6c67a230536f1e2618c
+EBUILD postgresql-server-8.1.11.ebuild 9252 RMD160 5ac91b6cea145854a048d4e1fcd1a6b25ae49fdb SHA1 7fd48a555136c1e0d90b5fbb444a5dfc3c9e4f0f SHA256 721b46ec2b1d21171e620fbb9020868b22d1b9f16de77cdf403d3603fe7f73ce
+EBUILD postgresql-server-8.2.7.ebuild 9480 RMD160 3fd42d2567a24a0a1da0946074ba9e96fe83ecba SHA1 1d8f952d308ba02ef568c082593c4b9864c2a93b SHA256 ada69e68da43d39ef4a276ab10c2168c404acdf9e2fc92f1c4b1d11637251a2a
+EBUILD postgresql-server-8.3.1.ebuild 9649 RMD160 3711d1c616eeccfff832a33026ad69d58f473eef SHA1 9b73e7784fc4ec7d8527e48066a866cb99d9f0b6 SHA256 3d7631c1ebc4dcb32f8a4ceeb9718a25d06f4132634a77a3844108b44457abfd
+MISC ChangeLog 8193 RMD160 a5087acc410271d968f8ae6370d8b94e8bc56db1 SHA1 77c57b0fc650a239a6f31c7b54b3a0b6b7dd3a08 SHA256 0ba42ef9967d138aba09d0866f34286b647e798096b70b72cb5a93af6ae95cc2
+MISC metadata.xml 164 RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc SHA1 f67b7ac1c5e6e65ef5a19a589d4759c84918f86c SHA256 7e8e8126bc8701c4a42c7dfed8bb755ac6040fe3d0e3f994d888f8b2b4fa7d8b
diff --git a/dev-db/postgresql-server/files/postgresql-7.3-cubeparse.patch b/dev-db/postgresql-server/files/postgresql-7.3-cubeparse.patch
new file mode 100644
index 000000000000..705e073c8e45
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.3-cubeparse.patch
@@ -0,0 +1,36 @@
+--- contrib/cube/cubescan.l.orig 2006-07-05 06:56:04.000000000 +0000
++++ contrib/cube/cubescan.l 2006-07-05 06:56:12.000000000 +0000
+@@ -9,6 +9,10 @@
+
+
+ /* flex screws a couple symbols when used with the -P option; fix those */
++#ifndef YY_PROTO
++#define YY_PROTO(proto) proto
++#endif
++
+ #define YY_DECL int cube_yylex YY_PROTO(( void )); \
+ int cube_yylex YY_PROTO(( void ))
+ #define yylval cube_yylval
+--- contrib/seg/segscan.l.orig 2006-07-05 07:08:26.000000000 +0000
++++ contrib/seg/segscan.l 2006-07-05 07:08:51.000000000 +0000
+@@ -9,6 +9,10 @@
+
+
+ /* flex screws a couple symbols when used with the -P option; fix those */
++#ifndef YY_PROTO
++#define YY_PROTO(proto) proto
++#endif
++
+ #define YY_DECL int seg_yylex YY_PROTO(( void )); \
+ int seg_yylex YY_PROTO(( void ))
+ #define yylval seg_yylval
+--- contrib/tsearch/parser.l.orig 2006-07-05 07:22:36.000000000 +0000
++++ contrib/tsearch/parser.l 2006-07-05 07:23:33.000000000 +0000
+@@ -18,6 +18,7 @@
+ char *s = NULL; /* to return WHOLE hyphenated-word */
+
+ YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string */
++static YY_BUFFER_STATE yy_current_buffer = 0;
+
+ int lrlimit = -1; /* for limiting read from filehandle ( -1 - unlimited read ) */
+ int bytestoread = 0; /* for limiting read from filehandle */
diff --git a/dev-db/postgresql-server/files/postgresql-7.3-regress.patch b/dev-db/postgresql-server/files/postgresql-7.3-regress.patch
new file mode 100644
index 000000000000..ce2258e74f4e
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.3-regress.patch
@@ -0,0 +1,87 @@
+diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
+index ebf14e5..bb07726 100644
+--- a/src/test/regress/GNUmakefile
++++ b/src/test/regress/GNUmakefile
+@@ -113,7 +113,7 @@ all-spi:
+ ##
+
+ check: all
+- $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE)
++ clientbindir="/usr/lib/postgresql-${SLOT}/bin" $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE)
+
+ installcheck: all
+ $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
+diff --git a/src/test/regress/pg_regress.sh b/src/test/regress/pg_regress.sh
+index 9657ed3..b1b1a7f 100644
+--- a/src/test/regress/pg_regress.sh
++++ b/src/test/regress/pg_regress.sh
+@@ -77,6 +77,8 @@ host_platform='@host_tuple@'
+ enable_shared='@enable_shared@'
+ GCC=@GCC@
+
++test -z "${clientbindir}" && clientbindir="${bindir}"
++
+ if [ "$GCC" = yes ]; then
+ compiler=gcc
+ else
+@@ -364,7 +366,7 @@ then
+ # wait forever, however.
+ i=0
+ max=60
+- until "$bindir/psql" $psql_options template1 </dev/null 2>/dev/null
++ until "$clientbindir/psql" $psql_options template1 </dev/null 2>/dev/null
+ do
+ i=`expr $i + 1`
+ if [ $i -ge $max ]
+@@ -411,7 +413,7 @@ else # not temp-install
+ echo "(using postmaster on Unix socket, $port_info)"
+ fi
+ message "dropping database \"$dbname\""
+- "$bindir/dropdb" $psql_options "$dbname"
++ "$clientbindir/dropdb" $psql_options "$dbname"
+ # errors can be ignored
+ fi
+
+@@ -420,7 +422,7 @@ fi
+ # Set up SQL shell for the test.
+ # ----------
+
+-PSQL="$bindir/psql -q -X $psql_options"
++PSQL="$clientbindir/psql -q -X $psql_options"
+
+
+ # ----------
+@@ -451,13 +453,13 @@ fi
+ # ----------
+
+ message "creating database \"$dbname\""
+-"$bindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
++"$clientbindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
+ if [ $? -ne 0 ]; then
+ echo "$me: createdb failed"
+ (exit 2); exit
+ fi
+
+-"$bindir/psql" $psql_options -c "\
++"$clientbindir/psql" $psql_options -c "\
+ alter database \"$dbname\" set lc_messages to 'C';
+ alter database \"$dbname\" set lc_monetary to 'C';
+ alter database \"$dbname\" set lc_numeric to 'C';
+@@ -473,7 +475,7 @@ fi
+ # ----------
+
+ message "dropping regression test user accounts"
+-"$bindir/psql" $psql_options -c 'SET autocommit TO on;DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
++"$clientbindir/psql" $psql_options -c 'SET autocommit TO on;DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
+ if [ $? -eq 2 ]; then
+ echo "$me: could not drop user accounts"
+ (exit 2); exit
+@@ -486,7 +488,7 @@ fi
+
+ if [ "$enable_shared" = yes ]; then
+ message "installing PL/pgSQL"
+- "$bindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
++ "$clientbindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
+ if [ $? -ne 0 ] && [ $? -ne 2 ]; then
+ echo "$me: createlang failed"
+ (exit 2); exit
diff --git a/dev-db/postgresql-server/files/postgresql-7.3-server.patch b/dev-db/postgresql-server/files/postgresql-7.3-server.patch
new file mode 100644
index 000000000000..5d2e0fbfcdae
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.3-server.patch
@@ -0,0 +1,109 @@
+=== GNUmakefile.in
+==================================================================
+--- GNUmakefile.in (revision 14)
++++ GNUmakefile.in (local)
+@@ -23,7 +23,6 @@
+ $(MAKE) -C src $@
+
+ install-all-headers:
+- $(MAKE) -C src $@
+
+ # clean, distclean, etc should apply to contrib too, even though
+ # it's not built by default
+=== contrib/Makefile
+==================================================================
+--- contrib/Makefile (revision 14)
++++ contrib/Makefile (local)
+@@ -14,7 +14,6 @@
+ dbmirror \
+ dbsize \
+ earthdistance \
+- findoidjoins \
+ fulltextindex \
+ fuzzystrmatch \
+ intagg \
+@@ -24,10 +23,7 @@
+ ltree \
+ miscutil \
+ noupdate \
+- oid2name \
+- pg_dumplo \
+ pg_logger \
+- pgbench \
+ pgcrypto \
+ pgstattuple \
+ rserv \
+@@ -38,8 +34,7 @@
+ tablefunc \
+ tips \
+ tsearch \
+- userlock \
+- vacuumlo
++ userlock
+
+ # Missing:
+ # ipc_check \ (does not have a makefile)
+=== src/Makefile
+==================================================================
+--- src/Makefile (revision 14)
++++ src/Makefile (local)
+@@ -17,13 +17,10 @@
+ $(MAKE) -C port $@
+ $(MAKE) -C backend $@
+ $(MAKE) -C backend/utils/mb/conversion_procs $@
+- $(MAKE) -C include $@
+- $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+
+ install-all-headers:
+- $(MAKE) -C include $@
+
+ clean:
+ $(MAKE) -C port $@
+=== src/Makefile.global.in
+==================================================================
+--- src/Makefile.global.in (revision 14)
++++ src/Makefile.global.in (local)
+@@ -286,10 +286,10 @@
+ libpq = -L$(libpq_builddir) -lpq
+
+ submake-libpq:
+- $(MAKE) -C $(libpq_builddir) all
++ @true $(MAKE) -C $(libpq_builddir) all
+
+ submake-libpgport:
+- $(MAKE) -C $(top_builddir)/src/port all
++ @true $(MAKE) -C $(top_builddir)/src/port all
+
+ .PHONY: submake-libpq submake-libpgport
+
+=== src/bin/Makefile
+==================================================================
+--- src/bin/Makefile (revision 14)
++++ src/bin/Makefile (local)
+@@ -13,9 +13,8 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \
+- psql scripts pg_config pg_controldata pg_resetxlog \
+- pg_encoding
++DIRS := initdb initlocation ipcclean pg_ctl pg_id \
++ pg_controldata pg_resetxlog
+
+ ifeq ($(with_tcl), yes)
+ DIRS += pgtclsh
+=== src/include/pg_config.h.in
+==================================================================
+--- src/include/pg_config.h.in (revision 14)
++++ src/include/pg_config.h.in (local)
+@@ -244,7 +244,7 @@
+ * just hate the idea of sockets in /tmp, here's where to twiddle it.
+ * You can also override this at runtime with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
+
+
+ /*
diff --git a/dev-db/postgresql-server/files/postgresql-7.3.21-autoconf.patch b/dev-db/postgresql-server/files/postgresql-7.3.21-autoconf.patch
new file mode 100644
index 000000000000..0b526b208831
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.3.21-autoconf.patch
@@ -0,0 +1,57 @@
+diff --git a/config/programs.m4 b/config/programs.m4
+index 35d9e2b..c681983 100644
+--- a/config/programs.m4
++++ b/config/programs.m4
+@@ -153,13 +153,13 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
+ dnl FIXME: We should probably check for version >=0.10.36.
+ AC_CHECK_PROGS(XGETTEXT, xgettext)
+
+- # Note: share/locale is always the default, independent of $datadir
+- localedir='${prefix}/share/locale'
+- if test x"$prefix" = x"NONE"; then
+- exp_localedir="$ac_default_prefix/share/locale"
+- else
+- exp_localedir="$prefix/share/locale"
+- fi
++ # Note: share/locale *WAS* always the default, independent of $datadir
++ AC_ARG_WITH([locale-dir],
++ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]),
++ [ localedir="${withval}" ],
++ [ localedir='${prefix}/share/locale' ]
++ )
++ exp_localedir="${localedir}"
+
+ AC_SUBST(localedir)
+ AC_DEFINE_UNQUOTED(LOCALEDIR, ["$exp_localedir"],
+diff --git a/configure.in b/configure.in
+index 07cc529..37fdded 100644
+--- a/configure.in
++++ b/configure.in
+@@ -19,17 +19,8 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
+ dnl
+ dnl The GNU folks apparently haven't heard that some people don't use
+ dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir".
+-m4_define([info], [doc])
+-m4_define([infodir], [docdir])
+ AC_INIT([PostgreSQL], [7.3.21], [pgsql-bugs@postgresql.org])
+-m4_undefine([infodir])
+-m4_undefine([info])
+-AC_SUBST(docdir)
+-
+-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.53], [], [m4_fatal([Autoconf version 2.59 is required.
+-Untested combinations of 'autoconf' and PostgreSQL versions are not
+-recommended. You can remove the check from 'configure.in' but it is then
+-your responsibility whether the result works or not.])])
++
+ AC_COPYRIGHT([Copyright 2002 PostgreSQL Global Development Group])
+ AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
+ AC_CONFIG_AUX_DIR(config)
+@@ -626,7 +617,7 @@ AC_CHECK_LIB(PW, main)
+ AC_CHECK_LIB(resolv, main)
+ AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt])
+ # QNX:
+-AC_CHECK_LIB([[unix]], main)
++AC_CHECK_LIB([unix], main)
+ AC_SEARCH_LIBS(crypt, crypt)
+ # BeOS:
+ AC_CHECK_LIB(bind, __inet_ntoa)
diff --git a/dev-db/postgresql-server/files/postgresql-7.4-regress.patch b/dev-db/postgresql-server/files/postgresql-7.4-regress.patch
new file mode 100644
index 000000000000..fbb7eacfbfc6
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.4-regress.patch
@@ -0,0 +1,87 @@
+diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
+index 3d6a939..865351a 100644
+--- a/src/test/regress/GNUmakefile
++++ b/src/test/regress/GNUmakefile
+@@ -122,7 +122,7 @@ all-spi:
+ ##
+
+ check: all
+- $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT)
++ clientbindir="/usr/lib/postgresql-${SLOT}/bin/" $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT)
+
+ installcheck: all
+ $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
+diff --git a/src/test/regress/pg_regress.sh b/src/test/regress/pg_regress.sh
+index 47f2cb9..130c671 100644
+--- a/src/test/regress/pg_regress.sh
++++ b/src/test/regress/pg_regress.sh
+@@ -80,6 +80,8 @@ host_platform='@host_tuple@'
+ enable_shared='@enable_shared@'
+ GCC=@GCC@
+
++test -z "${clientbindir}" && clientbindir="${bindir}"
++
+ if [ "$GCC" = yes ]; then
+ compiler=gcc
+ else
+@@ -409,7 +411,7 @@ then
+ # wait forever, however.
+ i=0
+ max=60
+- until "$bindir/psql" $psql_options template1 </dev/null 2>/dev/null
++ until "$clientbindir/psql" $psql_options template1 </dev/null 2>/dev/null
+ do
+ i=`expr $i + 1`
+ if [ $i -ge $max ]
+@@ -457,7 +459,7 @@ else # not temp-install
+ echo "(using postmaster on Unix socket, $port_info)"
+ fi
+ message "dropping database \"$dbname\""
+- "$bindir/dropdb" $psql_options "$dbname"
++ "$clientbindir/dropdb" $psql_options "$dbname"
+ # errors can be ignored
+ fi
+
+@@ -466,7 +468,7 @@ fi
+ # Set up SQL shell for the test.
+ # ----------
+
+-PSQL="$bindir/psql -a -q -X $psql_options"
++PSQL="$clientbindir/psql -a -q -X $psql_options"
+
+
+ # ----------
+@@ -497,13 +499,13 @@ fi
+ # ----------
+
+ message "creating database \"$dbname\""
+-"$bindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
++"$clientbindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
+ if [ $? -ne 0 ]; then
+ echo "$me: createdb failed"
+ (exit 2); exit
+ fi
+
+-"$bindir/psql" $psql_options -c "\
++"$clientbindir/psql" $psql_options -c "\
+ alter database \"$dbname\" set lc_messages to 'C';
+ alter database \"$dbname\" set lc_monetary to 'C';
+ alter database \"$dbname\" set lc_numeric to 'C';
+@@ -519,7 +521,7 @@ fi
+ # ----------
+
+ message "dropping regression test user accounts"
+-"$bindir/psql" $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
++"$clientbindir/psql" $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
+ if [ $? -eq 2 ]; then
+ echo "$me: could not drop user accounts"
+ (exit 2); exit
+@@ -532,7 +534,7 @@ fi
+
+ if [ "$enable_shared" = yes ]; then
+ message "installing PL/pgSQL"
+- "$bindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
++ "$clientbindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
+ if [ $? -ne 0 ] && [ $? -ne 2 ]; then
+ echo "$me: createlang failed"
+ (exit 2); exit
diff --git a/dev-db/postgresql-server/files/postgresql-7.4-server.patch b/dev-db/postgresql-server/files/postgresql-7.4-server.patch
new file mode 100644
index 000000000000..22878dcfe112
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.4-server.patch
@@ -0,0 +1,108 @@
+=== GNUmakefile.in
+==================================================================
+--- GNUmakefile.in (revision 12)
++++ GNUmakefile.in (local)
+@@ -23,7 +23,6 @@
+ $(MAKE) -C src $@
+
+ install-all-headers:
+- $(MAKE) -C src $@
+
+ # clean, distclean, etc should apply to contrib too, even though
+ # it's not built by default
+=== contrib/Makefile
+==================================================================
+--- contrib/Makefile (revision 12)
++++ contrib/Makefile (local)
+@@ -13,7 +13,6 @@
+ dbmirror \
+ dbsize \
+ earthdistance \
+- findoidjoins \
+ fulltextindex \
+ fuzzystrmatch \
+ intagg \
+@@ -23,11 +22,7 @@
+ ltree \
+ miscutil \
+ noupdate \
+- oid2name \
+- pg_autovacuum \
+- pg_dumplo \
+ pg_logger \
+- pgbench \
+ pgcrypto \
+ pgstattuple \
+ rserv \
+@@ -39,8 +34,7 @@
+ tips \
+ tsearch \
+ tsearch2 \
+- userlock \
+- vacuumlo
++ userlock
+
+ # Missing:
+ # array \ (removed all but the README)
+=== src/Makefile
+==================================================================
+--- src/Makefile (revision 12)
++++ src/Makefile (local)
+@@ -14,11 +14,8 @@
+
+
+ all install installdirs uninstall dep depend distprep:
+- $(MAKE) -C port $@
+ $(MAKE) -C backend $@
+ $(MAKE) -C backend/utils/mb/conversion_procs $@
+- $(MAKE) -C include $@
+- $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+
+=== src/Makefile.global.in
+==================================================================
+--- src/Makefile.global.in (revision 12)
++++ src/Makefile.global.in (local)
+@@ -291,10 +291,10 @@
+ libpq = -L$(libpq_builddir) -lpq
+
+ submake-libpq:
+- $(MAKE) -C $(libpq_builddir) all
++ @true $(MAKE) -C $(libpq_builddir) all
+
+ submake-libpgport:
+- $(MAKE) -C $(top_builddir)/src/port all
++ @true $(MAKE) -C $(top_builddir)/src/port all
+
+ .PHONY: submake-libpq submake-libpgport
+
+=== src/bin/Makefile
+==================================================================
+--- src/bin/Makefile (revision 12)
++++ src/bin/Makefile (local)
+@@ -13,9 +13,8 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \
+- psql scripts pg_config pg_controldata pg_resetxlog \
+- pg_encoding
++DIRS := initdb initlocation ipcclean pg_ctl pg_id \
++ pg_controldata pg_resetxlog
+
+ ifeq ($(with_tcl), yes)
+ DIRS += pgtclsh
+=== src/include/pg_config_manual.h
+==================================================================
+--- src/include/pg_config_manual.h (revision 12)
++++ src/include/pg_config_manual.h (local)
+@@ -165,7 +165,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
+
+ /*
+ * Defining this will make float4 and float8 operations faster by
diff --git a/dev-db/postgresql-server/files/postgresql-7.4-vacuum-delay.patch b/dev-db/postgresql-server/files/postgresql-7.4-vacuum-delay.patch
new file mode 100644
index 000000000000..e0f499859009
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.4-vacuum-delay.patch
@@ -0,0 +1,284 @@
+ * From: Jan Wieck <JanWieck ( at ) Yahoo ( dot ) com>
+ * To: "Matthew T. O'Connor" <matthew ( at ) zeut ( dot ) net>
+ * Subject: Re: Performance features the 4th
+ * Date: Sun, 09 Nov 2003 18:42:53 -0500
+
+Matthew T. O'Connor wrote:
+
+ ----- Original Message ----- From: "Jan Wieck" <JanWieck ( at ) Yahoo ( dot ) com>
+
+Tom Lane wrote:
+> Gaetano and a couple of other people did experiments that seemed to show
+> it was useful. I think we'd want to change the shape of the knob per
+> later suggestions (sleep 10 ms every N blocks, instead of N ms every
+> block) but it did seem that there was useful bang for little buck there.
+
+
+ I thought it was "sleep N ms every M blocks".
+
+Have we seen any numbers? Anything at all? Something that gives us a
+clue by what factor one has to multiply the total time a "VACUUM
+ANALYZE" takes, to get what effect in return?
+
+
+I have some time on sunday to do some testing. Is there a patch that I can
+apply that implements either of the two options? (sleep 10ms every M blocks
+or sleep N ms every M blocks).
+
+
+I know Tom posted the original patch that sleept N ms every 1 block (where N
+is > 10 due to OS limitations). Jan can you post a patch that has just the
+sleep code in it? Or should it be easy enough for me to cull out of the
+larger patch you posted?
+
+
+Sorry for the delay, had to finish some other concept yesterday (will be published soon).
+
+The attached patch adds
+
+ vacuum_group_delay_size = 10 (range 1-1000)
+ vacuum_group_delay_msec = 0 (range 0-1000)
+
+
+and does the sleeping via select(2). It does it only at the same places where Tom had done the usleep() in his hack, so I guess there is still some more to do besides the documentation, before it can be added to 7.4.1. But it should be enough to get some testing done.
+
+
+Jan
+
+--
+#======================================================================#
+# It's easier to get forgiveness for being wrong than for being right. #
+# Let's break this rule - forgive me. #
+#================================================== JanWieck ( at ) Yahoo ( dot ) com #
+
+Index: src/backend/access/nbtree/nbtree.c
+===================================================================
+RCS file: /home/pgsql/CvsRoot/pgsql-server/src/backend/access/nbtree/nbtree.c,v
+retrieving revision 1.106
+diff -c -b -r1.106 nbtree.c
+*** src/backend/access/nbtree/nbtree.c 2003/09/29 23:40:26 1.106
+--- src/backend/access/nbtree/nbtree.c 2003/11/09 23:39:36
+***************
+*** 27,32 ****
+--- 27,40 ----
+ #include "storage/smgr.h"
+
+
++ /*
++ * Variables for vacuum_group_delay option (in commands/vacuumlazy.c)
++ */
++ extern int vacuum_group_delay_size; /* vacuum N pages */
++ extern int vacuum_group_delay_msec; /* then sleep M msec */
++ extern int vacuum_group_delay_count;
++
++
+ /* Working state for btbuild and its callback */
+ typedef struct
+ {
+***************
+*** 610,615 ****
+--- 618,632 ----
+
+ CHECK_FOR_INTERRUPTS();
+
++ if (vacuum_group_delay_msec > 0)
++ {
++ if (++vacuum_group_delay_count >= vacuum_group_delay_size)
++ {
++ PG_DELAY(vacuum_group_delay_msec);
++ vacuum_group_delay_count = 0;
++ }
++ }
++
+ ndeletable = 0;
+ page = BufferGetPage(buf);
+ opaque = (BTPageOpaque) PageGetSpecialPointer(page);
+***************
+*** 736,741 ****
+--- 753,769 ----
+ Buffer buf;
+ Page page;
+ BTPageOpaque opaque;
++
++ CHECK_FOR_INTERRUPTS();
++
++ if (vacuum_group_delay_msec > 0)
++ {
++ if (++vacuum_group_delay_count >= vacuum_group_delay_size)
++ {
++ PG_DELAY(vacuum_group_delay_msec);
++ vacuum_group_delay_count = 0;
++ }
++ }
+
+ buf = _bt_getbuf(rel, blkno, BT_READ);
+ page = BufferGetPage(buf);
+Index: src/backend/commands/vacuumlazy.c
+===================================================================
+RCS file: /home/pgsql/CvsRoot/pgsql-server/src/backend/commands/vacuumlazy.c,v
+retrieving revision 1.32
+diff -c -b -r1.32 vacuumlazy.c
+*** src/backend/commands/vacuumlazy.c 2003/09/25 06:57:59 1.32
+--- src/backend/commands/vacuumlazy.c 2003/11/09 23:40:13
+***************
+*** 88,93 ****
+--- 88,100 ----
+ static TransactionId OldestXmin;
+ static TransactionId FreezeLimit;
+
++ /*
++ * Variables for vacuum_group_delay option (in commands/vacuumlazy.c)
++ */
++ int vacuum_group_delay_size = 10; /* vacuum N pages */
++ int vacuum_group_delay_msec = 0; /* then sleep M msec */
++ int vacuum_group_delay_count = 0;
++
+
+ /* non-export function prototypes */
+ static void lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
+***************
+*** 228,233 ****
+--- 235,249 ----
+
+ CHECK_FOR_INTERRUPTS();
+
++ if (vacuum_group_delay_msec > 0)
++ {
++ if (++vacuum_group_delay_count >= vacuum_group_delay_size)
++ {
++ PG_DELAY(vacuum_group_delay_msec);
++ vacuum_group_delay_count = 0;
++ }
++ }
++
+ /*
+ * If we are close to overrunning the available space for
+ * dead-tuple TIDs, pause and do a cycle of vacuuming before we
+***************
+*** 469,474 ****
+--- 485,499 ----
+
+ CHECK_FOR_INTERRUPTS();
+
++ if (vacuum_group_delay_msec > 0)
++ {
++ if (++vacuum_group_delay_count >= vacuum_group_delay_size)
++ {
++ PG_DELAY(vacuum_group_delay_msec);
++ vacuum_group_delay_count = 0;
++ }
++ }
++
+ tblk = ItemPointerGetBlockNumber(&vacrelstats->dead_tuples[tupindex]);
+ buf = ReadBuffer(onerel, tblk);
+ LockBufferForCleanup(buf);
+***************
+*** 799,804 ****
+--- 824,838 ----
+ hastup;
+
+ CHECK_FOR_INTERRUPTS();
++
++ if (vacuum_group_delay_msec > 0)
++ {
++ if (++vacuum_group_delay_count >= vacuum_group_delay_size)
++ {
++ PG_DELAY(vacuum_group_delay_msec);
++ vacuum_group_delay_count = 0;
++ }
++ }
+
+ blkno--;
+
+Index: src/backend/utils/misc/guc.c
+===================================================================
+RCS file: /home/pgsql/CvsRoot/pgsql-server/src/backend/utils/misc/guc.c,v
+retrieving revision 1.164.2.1
+diff -c -b -r1.164.2.1 guc.c
+*** src/backend/utils/misc/guc.c 2003/11/07 21:27:50 1.164.2.1
+--- src/backend/utils/misc/guc.c 2003/11/09 23:27:49
+***************
+*** 73,78 ****
+--- 73,80 ----
+ extern int CommitDelay;
+ extern int CommitSiblings;
+ extern char *preload_libraries_string;
++ extern int vacuum_group_delay_size;
++ extern int vacuum_group_delay_msec;
+
+ #ifdef HAVE_SYSLOG
+ extern char *Syslog_facility;
+***************
+*** 1188,1193 ****
+--- 1190,1213 ----
+ },
+ &log_min_duration_statement,
+ -1, -1, INT_MAX / 1000, NULL, NULL
++ },
++
++ {
++ {"vacuum_group_delay_msec", PGC_USERSET, RESOURCES,
++ gettext_noop("Sets VACUUM's delay in milliseconds between processing groups of pages."),
++ NULL
++ },
++ &vacuum_group_delay_msec,
++ 0, 0, 1000, NULL, NULL
++ },
++
++ {
++ {"vacuum_group_delay_size", PGC_USERSET, RESOURCES,
++ gettext_noop("Sets VACUUM's group size for the vacuum_group_delay_msec option."),
++ NULL
++ },
++ &vacuum_group_delay_size,
++ 10, 1, 1000, NULL, NULL
+ },
+
+ /* End-of-list marker */
+Index: src/backend/utils/misc/postgresql.conf.sample
+===================================================================
+RCS file: /home/pgsql/CvsRoot/pgsql-server/src/backend/utils/misc/postgresql.conf.sample,v
+retrieving revision 1.92
+diff -c -b -r1.92 postgresql.conf.sample
+*** src/backend/utils/misc/postgresql.conf.sample 2003/10/08 03:49:38 1.92
+--- src/backend/utils/misc/postgresql.conf.sample 2003/11/09 23:04:21
+***************
+*** 69,74 ****
+--- 69,79 ----
+ #max_files_per_process = 1000 # min 25
+ #preload_libraries = ''
+
++ # - Vacuum napping -
++
++ #vacuum_group_delay_size = 10 # range 1-1000 pages ; vacuum this many pages
++ #vacuum_group_delay_msec = 0 # range 0-1000 msec ; then nap this long
++
+
+ #---------------------------------------------------------------------------
+ # WRITE AHEAD LOG
+Index: src/include/miscadmin.h
+===================================================================
+RCS file: /home/pgsql/CvsRoot/pgsql-server/src/include/miscadmin.h,v
+retrieving revision 1.134
+diff -c -b -r1.134 miscadmin.h
+*** src/include/miscadmin.h 2003/09/24 18:54:01 1.134
+--- src/include/miscadmin.h 2003/11/09 23:02:03
+***************
+*** 96,101 ****
+--- 96,111 ----
+ CritSectionCount--; \
+ } while(0)
+
++ /*
++ * Macro using select(2) to nap for milliseconds
++ */
++ #define PG_DELAY(_msec) \
++ { \
++ struct timeval _delay; \
++ _delay.tv_sec = (_msec) / 1000; \
++ _delay.tv_usec = ((_msec) % 1000) * 1000; \
++ (void) select(0, NULL, NULL, NULL, &_delay);\
++ }
+
+ /*****************************************************************************
+ * globals.h -- *
diff --git a/dev-db/postgresql-server/files/postgresql-7.4.19-autoconf.patch b/dev-db/postgresql-server/files/postgresql-7.4.19-autoconf.patch
new file mode 100644
index 000000000000..3913a0b86a52
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-7.4.19-autoconf.patch
@@ -0,0 +1,48 @@
+diff --git a/config/programs.m4 b/config/programs.m4
+index ae3b91a..6af24d2 100644
+--- a/config/programs.m4
++++ b/config/programs.m4
+@@ -153,13 +153,13 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
+ dnl FIXME: We should probably check for version >=0.10.36.
+ AC_CHECK_PROGS(XGETTEXT, xgettext)
+
+- # Note: share/locale is always the default, independent of $datadir
+- localedir='${prefix}/share/locale'
+- if test x"$prefix" = x"NONE"; then
+- exp_localedir="$ac_default_prefix/share/locale"
+- else
+- exp_localedir="$prefix/share/locale"
+- fi
++ # Note: share/locale *WAS* always the default, independent of $datadir
++ AC_ARG_WITH([locale-dir],
++ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]),
++ [ localedir="${withval}" ],
++ [ localedir='${prefix}/share/locale' ]
++ )
++ exp_localedir="${localedir}"
+
+ AC_SUBST(localedir)
+ AC_DEFINE_UNQUOTED(LOCALEDIR, ["$exp_localedir"],
+diff --git a/configure.in b/configure.in
+index f7bdec3..c8b5b7e 100644
+--- a/configure.in
++++ b/configure.in
+@@ -19,17 +19,8 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
+ dnl
+ dnl The GNU folks apparently haven't heard that some people don't use
+ dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir".
+-m4_define([info], [doc])
+-m4_define([infodir], [docdir])
+ AC_INIT([PostgreSQL], [7.4.19], [pgsql-bugs@postgresql.org])
+-m4_undefine([infodir])
+-m4_undefine([info])
+-AC_SUBST(docdir)
+-
+-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.53], [], [m4_fatal([Autoconf version 2.59 is required.
+-Untested combinations of 'autoconf' and PostgreSQL versions are not
+-recommended. You can remove the check from 'configure.in' but it is then
+-your responsibility whether the result works or not.])])
++
+ AC_COPYRIGHT([Copyright 2004 PostgreSQL Global Development Group])
+ AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
+ AC_CONFIG_AUX_DIR(config)
diff --git a/dev-db/postgresql-server/files/postgresql-8.0-common.patch b/dev-db/postgresql-server/files/postgresql-8.0-common.patch
new file mode 100644
index 000000000000..40932ecf4bc7
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.0-common.patch
@@ -0,0 +1,76 @@
+diff --git a/config/programs.m4 b/config/programs.m4
+index 3f87396..9c7fbf0 100644
+--- a/config/programs.m4
++++ b/config/programs.m4
+@@ -153,13 +153,13 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
+ dnl FIXME: We should probably check for version >=0.10.36.
+ AC_CHECK_PROGS(XGETTEXT, xgettext)
+
+- # Note: share/locale is always the default, independent of $datadir
+- localedir='${prefix}/share/locale'
+- if test x"$prefix" = x"NONE"; then
+- exp_localedir="$ac_default_prefix/share/locale"
+- else
+- exp_localedir="$prefix/share/locale"
+- fi
++ # Note: share/locale *WAS* always the default, independent of $datadir
++ AC_ARG_WITH([locale-dir],
++ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]),
++ [ localedir="${withval}" ],
++ [ localedir='${prefix}/share/locale' ]
++ )
++ exp_localedir="${localedir}"
+
+ AC_SUBST(localedir)
+ AC_DEFINE_UNQUOTED(LOCALEDIR, ["$exp_localedir"],
+diff --git a/configure.in b/configure.in
+index c71b175..674036a 100644
+--- a/configure.in
++++ b/configure.in
+@@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
+
+ AC_INIT([PostgreSQL], [8.0.15], [pgsql-bugs@postgresql.org])
+
+-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.53], [], [m4_fatal([Autoconf version 2.59 is required.
+-Untested combinations of 'autoconf' and PostgreSQL versions are not
+-recommended. You can remove the check from 'configure.in' but it is then
+-your responsibility whether the result works or not.])])
+ AC_COPYRIGHT([Copyright (c) 1996-2005, PostgreSQL Global Development Group])
+ AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
+ AC_CONFIG_AUX_DIR(config)
+diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
+index 0c2dff0..d548d4d 100644
+--- a/src/include/storage/s_lock.h
++++ b/src/include/storage/s_lock.h
+@@ -239,6 +239,31 @@ tas(volatile slock_t *lock)
+ #endif /* __s390__ || __s390x__ */
+
+
++#if defined(__sh__)
++#define HAS_TEST_AND_SET
++
++typedef unsigned char slock_t;
++
++#define TAS(lock) tas(lock)
++
++static __inline__ int
++tas(volatile slock_t *lock)
++{
++ register int _res = 1;
++
++ __asm__ __volatile__(
++ "tas.b @%1\n\t"
++ "movt %0\n\t"
++ "xor #1,%0"
++: "=z"(_res)
++: "r"(lock)
++: "t","memory");
++ return _res;
++}
++
++#endif /* __sh__ */
++
++
+ #if defined(__sparc__)
+ #define HAS_TEST_AND_SET
+
diff --git a/dev-db/postgresql-server/files/postgresql-8.0-server.patch b/dev-db/postgresql-server/files/postgresql-8.0-server.patch
new file mode 100644
index 000000000000..e45330ad1c18
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.0-server.patch
@@ -0,0 +1,230 @@
+=== GNUmakefile.in
+==================================================================
+--- GNUmakefile.in (revision 14)
++++ GNUmakefile.in (local)
+@@ -11,19 +11,16 @@
+ all:
+ $(MAKE) -C doc all
+ $(MAKE) -C src all
+- $(MAKE) -C config all
+ @echo "All of PostgreSQL successfully made. Ready to install."
+
+ install:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+ @echo "PostgreSQL installation complete."
+
+ installdirs uninstall distprep:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+
+ # clean, distclean, etc should apply to contrib too, even though
+ # it's not built by default
+=== contrib/Makefile
+==================================================================
+--- contrib/Makefile (revision 14)
++++ contrib/Makefile (local)
+@@ -13,7 +13,6 @@
+ dbmirror \
+ dbsize \
+ earthdistance \
+- findoidjoins \
+ fulltextindex \
+ fuzzystrmatch \
+ intagg \
+@@ -22,13 +21,8 @@
+ lo \
+ ltree \
+ miscutil \
+- mysql \
+ noupdate \
+- oid2name \
+- pg_autovacuum \
+- pg_dumplo \
+ pg_trgm \
+- pgbench \
+ pgcrypto \
+ pgstattuple \
+ rtree_gist \
+@@ -39,8 +33,7 @@
+ tips \
+ tsearch \
+ tsearch2 \
+- userlock \
+- vacuumlo
++ userlock
+
+ # Missing:
+ # adddepend \ (does not have a makefile)
+=== src/Makefile
+==================================================================
+--- src/Makefile (revision 14)
++++ src/Makefile (local)
+@@ -18,14 +18,10 @@
+ $(MAKE) -C timezone $@
+ $(MAKE) -C backend $@
+ $(MAKE) -C backend/utils/mb/conversion_procs $@
+- $(MAKE) -C include $@
+- $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+- $(MAKE) -C makefiles $@
+- $(MAKE) -C utils $@
+
+-install: install-local
++install:
+
+ install-local: installdirs-local
+ $(INSTALL_DATA) Makefile.global $(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global
+=== src/Makefile.global.in
+==================================================================
+--- src/Makefile.global.in (revision 14)
++++ src/Makefile.global.in (local)
+@@ -336,10 +336,10 @@
+
+
+ submake-libpq:
+- $(MAKE) -C $(libpq_builddir) all
++ @true $(MAKE) -C $(libpq_builddir) all
+
+ submake-libpgport:
+- $(MAKE) -C $(top_builddir)/src/port all
++ @true $(MAKE) -C $(top_builddir)/src/port all
+
+ .PHONY: submake-libpq submake-libpgport
+
+=== src/bin/Makefile
+==================================================================
+--- src/bin/Makefile (revision 14)
++++ src/bin/Makefile (local)
+@@ -13,8 +13,8 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := initdb ipcclean pg_ctl pg_dump \
+- psql scripts pg_config pg_controldata pg_resetxlog
++DIRS := initdb ipcclean pg_ctl \
++ pg_controldata pg_resetxlog
+ ifeq ($(PORTNAME), win32)
+ DIRS+=pgevent
+ endif
+=== src/include/pg_config_manual.h
+==================================================================
+--- src/include/pg_config_manual.h (revision 14)
++++ src/include/pg_config_manual.h (local)
+@@ -160,7 +160,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
+
+ /*
+ * The random() function is expected to yield values between 0 and
+=== src/port/Makefile
+==================================================================
+--- src/port/Makefile (revision 14)
++++ src/port/Makefile (local)
+@@ -29,11 +29,10 @@
+ # Replace all object files so they use FRONTEND define
+ LIBOBJS_SRV := $(LIBOBJS:%.o=%_srv.o)
+
+-all: libpgport.a libpgport_srv.a
++all: libpgport_srv.a
+
+ # libpgport is needed by some contrib
+-install: all
+- $(INSTALL_STLIB) libpgport.a $(DESTDIR)$(libdir)
++install:
+
+ uninstall:
+ $(RM) $(DESTDIR)$(libdir)/libpgport.a
+=== src/test/regress/GNUmakefile
+==================================================================
+--- src/test/regress/GNUmakefile (revision 14)
++++ src/test/regress/GNUmakefile (local)
+@@ -138,7 +138,7 @@
+ check: all
+ -rm -rf ./testtablespace
+ mkdir ./testtablespace
+- $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) $(NOLOCALE)
++ clientbindir="/usr/lib/postgresql-${SLOT}/bin/" $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) $(NOLOCALE)
+
+ installcheck: all
+ -rm -rf ./testtablespace
+=== src/test/regress/pg_regress.sh
+==================================================================
+--- src/test/regress/pg_regress.sh (revision 14)
++++ src/test/regress/pg_regress.sh (local)
+@@ -89,6 +89,8 @@
+ enable_shared='@enable_shared@'
+ GCC=@GCC@
+
++test -z "${clientbindir}" && clientbindir="${bindir}"
++
+ if [ "$GCC" = yes ]; then
+ compiler=gcc
+ else
+@@ -446,7 +448,7 @@
+ # wait forever, however.
+ i=0
+ max=60
+- until "$bindir/psql" -X $psql_options template1 </dev/null 2>/dev/null
++ until "$clientbindir/psql" -X $psql_options template1 </dev/null 2>/dev/null
+ do
+ i=`expr $i + 1`
+ if [ $i -ge $max ]
+@@ -503,7 +505,7 @@
+ fi
+
+ message "dropping database \"$dbname\""
+- "$bindir/dropdb" $psql_options "$dbname"
++ "$clientbindir/dropdb" $psql_options "$dbname"
+ # errors can be ignored
+ fi
+
+@@ -512,7 +514,7 @@
+ # Set up SQL shell for the test.
+ # ----------
+
+-PSQL="$bindir/psql -a -q -X $psql_options"
++PSQL="$clientbindir/psql -a -q -X $psql_options"
+
+
+ # ----------
+@@ -546,13 +548,13 @@
+ # ----------
+
+ message "creating database \"$dbname\""
+-"$bindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
++"$clientbindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
+ if [ $? -ne 0 ]; then
+ echo "$me: createdb failed"
+ (exit 2); exit
+ fi
+
+-"$bindir/psql" -q -X $psql_options -c "\
++"$clientbindir/psql" -q -X $psql_options -c "\
+ checkpoint;
+ alter database \"$dbname\" set lc_messages to 'C';
+ alter database \"$dbname\" set lc_monetary to 'C';
+@@ -569,7 +571,7 @@
+ # ----------
+
+ message "dropping regression test user accounts"
+-"$bindir/psql" -q -X $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
++"$clientbindir/psql" -q -X $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
+ if [ $? -eq 2 ]; then
+ echo "$me: could not drop user accounts"
+ (exit 2); exit
+@@ -582,7 +584,7 @@
+
+ if [ "$enable_shared" = yes ]; then
+ message "installing PL/pgSQL"
+- "$bindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
++ "$clientbindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
+ if [ $? -ne 0 ] && [ $? -ne 2 ]; then
+ echo "$me: createlang failed"
+ (exit 2); exit
diff --git a/dev-db/postgresql-server/files/postgresql-8.1-common.patch b/dev-db/postgresql-server/files/postgresql-8.1-common.patch
new file mode 100644
index 000000000000..56704f0c5afa
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.1-common.patch
@@ -0,0 +1,74 @@
+diff --git a/config/programs.m4 b/config/programs.m4
+index 3f87396..9c7fbf0 100644
+--- a/config/programs.m4
++++ b/config/programs.m4
+@@ -153,13 +153,13 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
+ dnl FIXME: We should probably check for version >=0.10.36.
+ AC_CHECK_PROGS(XGETTEXT, xgettext)
+
+- # Note: share/locale is always the default, independent of $datadir
+- localedir='${prefix}/share/locale'
+- if test x"$prefix" = x"NONE"; then
+- exp_localedir="$ac_default_prefix/share/locale"
+- else
+- exp_localedir="$prefix/share/locale"
+- fi
++ # Note: share/locale *WAS* always the default, independent of $datadir
++ AC_ARG_WITH([locale-dir],
++ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]),
++ [ localedir="${withval}" ],
++ [ localedir='${prefix}/share/locale' ]
++ )
++ exp_localedir="${localedir}"
+
+ AC_SUBST(localedir)
+ AC_DEFINE_UNQUOTED(LOCALEDIR, ["$exp_localedir"],
+diff --git a/configure.in b/configure.in
+index d071f00..b203648 100644
+--- a/configure.in
++++ b/configure.in
+@@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
+
+ AC_INIT([PostgreSQL], [8.1.11], [pgsql-bugs@postgresql.org])
+
+-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.59], [], [m4_fatal([Autoconf version 2.59 is required.
+-Untested combinations of 'autoconf' and PostgreSQL versions are not
+-recommended. You can remove the check from 'configure.in' but it is then
+-your responsibility whether the result works or not.])])
+ AC_COPYRIGHT([Copyright (c) 1996-2005, PostgreSQL Global Development Group])
+ AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
+ AC_CONFIG_AUX_DIR(config)
+diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
+index c5731fd..8ec70b4 100644
+--- a/src/include/storage/s_lock.h
++++ b/src/include/storage/s_lock.h
+@@ -299,6 +299,29 @@ tas(volatile slock_t *lock)
+
+ #endif /* __s390__ || __s390x__ */
+
++#if defined(__sh__)
++#define HAS_TEST_AND_SET
++
++typedef unsigned char slock_t;
++
++#define TAS(lock) tas(lock)
++
++static __inline__ int
++tas(volatile slock_t *lock)
++{
++ register int _res = 1;
++
++ __asm__ __volatile__(
++ "tas.b @%1\n\t"
++ "movt %0\n\t"
++ "xor #1,%0"
++: "=z"(_res)
++: "r"(lock)
++: "t","memory");
++ return _res;
++}
++
++#endif /* __sh__ */
+
+ #if defined(__sparc__)
+ #define HAS_TEST_AND_SET
diff --git a/dev-db/postgresql-server/files/postgresql-8.1-server.patch b/dev-db/postgresql-server/files/postgresql-8.1-server.patch
new file mode 100644
index 000000000000..c68fcffb682a
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.1-server.patch
@@ -0,0 +1,219 @@
+=== GNUmakefile.in
+==================================================================
+--- GNUmakefile.in (revision 14)
++++ GNUmakefile.in (local)
+@@ -11,19 +11,16 @@
+ all:
+ $(MAKE) -C doc all
+ $(MAKE) -C src all
+- $(MAKE) -C config all
+ @echo "All of PostgreSQL successfully made. Ready to install."
+
+ install:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+ @echo "PostgreSQL installation complete."
+
+ installdirs uninstall distprep:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+
+ # clean, distclean, etc should apply to contrib too, even though
+ # it's not built by default
+=== contrib/Makefile
+==================================================================
+--- contrib/Makefile (revision 14)
++++ contrib/Makefile (local)
+@@ -19,10 +19,8 @@
+ isbn_issn \
+ lo \
+ ltree \
+- oid2name \
+ pg_buffercache \
+ pg_trgm \
+- pgbench \
+ pgcrypto \
+ pgstattuple \
+ seg \
+@@ -30,8 +28,7 @@
+ tablefunc \
+ tips \
+ tsearch2 \
+- userlock \
+- vacuumlo
++ userlock
+
+ # Missing:
+ # adddepend \ (does not have a makefile)
+=== src/Makefile
+==================================================================
+--- src/Makefile (revision 14)
++++ src/Makefile (local)
+@@ -18,14 +18,10 @@
+ $(MAKE) -C timezone $@
+ $(MAKE) -C backend $@
+ $(MAKE) -C backend/utils/mb/conversion_procs $@
+- $(MAKE) -C include $@
+- $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+- $(MAKE) -C makefiles $@
+- $(MAKE) -C utils $@
+
+-install: install-local
++install:
+
+ install-local: installdirs-local
+ $(INSTALL_DATA) Makefile.global $(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global
+=== src/Makefile.global.in
+==================================================================
+--- src/Makefile.global.in (revision 14)
++++ src/Makefile.global.in (local)
+@@ -360,10 +360,10 @@
+
+
+ submake-libpq:
+- $(MAKE) -C $(libpq_builddir) all
++ @true $(MAKE) -C $(libpq_builddir) all
+
+ submake-libpgport:
+- $(MAKE) -C $(top_builddir)/src/port all
++ @true $(MAKE) -C $(top_builddir)/src/port all
+
+ .PHONY: submake-libpq submake-libpgport
+
+=== src/bin/Makefile
+==================================================================
+--- src/bin/Makefile (revision 14)
++++ src/bin/Makefile (local)
+@@ -13,8 +13,8 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := initdb ipcclean pg_ctl pg_dump \
+- psql scripts pg_config pg_controldata pg_resetxlog
++DIRS := initdb ipcclean pg_ctl \
++ pg_controldata pg_resetxlog
+ ifeq ($(PORTNAME), win32)
+ DIRS+=pgevent
+ endif
+=== src/include/pg_config_manual.h
+==================================================================
+--- src/include/pg_config_manual.h (revision 14)
++++ src/include/pg_config_manual.h (local)
+@@ -175,7 +175,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
+
+ /*
+ * The random() function is expected to yield values between 0 and
+=== src/port/Makefile
+==================================================================
+--- src/port/Makefile (revision 14)
++++ src/port/Makefile (local)
+@@ -29,11 +29,10 @@
+ # Replace all object files so they use FRONTEND define
+ LIBOBJS_SRV := $(LIBOBJS:%.o=%_srv.o)
+
+-all: libpgport.a libpgport_srv.a
++all: libpgport_srv.a
+
+ # libpgport is needed by some contrib
+-install: all
+- $(INSTALL_STLIB) libpgport.a $(DESTDIR)$(libdir)
++install:
+
+ uninstall:
+ $(RM) $(DESTDIR)$(libdir)/libpgport.a
+=== src/test/regress/GNUmakefile
+==================================================================
+--- src/test/regress/GNUmakefile (revision 14)
++++ src/test/regress/GNUmakefile (local)
+@@ -137,7 +137,7 @@
+ check: all
+ -rm -rf ./testtablespace
+ mkdir ./testtablespace
+- $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
++ clientbindir="/usr/lib/postgresql-${SLOT}/bin/" $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
+
+ installcheck: all
+ -rm -rf ./testtablespace
+=== src/test/regress/pg_regress.sh
+==================================================================
+--- src/test/regress/pg_regress.sh (revision 14)
++++ src/test/regress/pg_regress.sh (local)
+@@ -91,6 +91,8 @@
+ enable_shared='@enable_shared@'
+ GCC=@GCC@
+
++test -z "${clientbindir}" && clientbindir="${bindir}"
++
+ if [ "$GCC" = yes ]; then
+ compiler=gcc
+ else
+@@ -441,7 +443,7 @@
+ # wait forever, however.
+ i=0
+ max=60
+- until "$bindir/psql" -X $psql_options postgres </dev/null 2>/dev/null
++ until "$clientbindir/psql" -X $psql_options postgres </dev/null 2>/dev/null
+ do
+ i=`expr $i + 1`
+ if [ $i -ge $max ]
+@@ -498,7 +500,7 @@
+ fi
+
+ message "dropping database \"$dbname\""
+- "$bindir/dropdb" $psql_options "$dbname"
++ "$clientbindir/dropdb" $psql_options "$dbname"
+ # errors can be ignored
+ fi
+
+@@ -507,7 +509,7 @@
+ # Set up SQL shell for the test.
+ # ----------
+
+-PSQL="$bindir/psql -a -q -X $psql_options"
++PSQL="$clientbindir/psql -a -q -X $psql_options"
+
+
+ # ----------
+@@ -538,13 +540,13 @@
+ # ----------
+
+ message "creating database \"$dbname\""
+-"$bindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
++"$clientbindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
+ if [ $? -ne 0 ]; then
+ echo "$me: createdb failed"
+ (exit 2); exit
+ fi
+
+-"$bindir/psql" -q -X $psql_options -c "\
++"$clientbindir/psql" -q -X $psql_options -c "\
+ alter database \"$dbname\" set lc_messages to 'C';
+ alter database \"$dbname\" set lc_monetary to 'C';
+ alter database \"$dbname\" set lc_numeric to 'C';
+@@ -560,7 +562,7 @@
+ # ----------
+
+ message "dropping regression test user accounts"
+-"$bindir/psql" -q -X $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
++"$clientbindir/psql" -q -X $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
+ if [ $? -eq 2 ]; then
+ echo "$me: could not drop user accounts"
+ (exit 2); exit
+@@ -575,7 +577,7 @@
+ for lang in xyzzy $load_langs ; do
+ if [ "$lang" != "xyzzy" ]; then
+ message "installing $lang"
+- "$bindir/createlang" $psql_options $lang $dbname
++ "$clientbindir/createlang" $psql_options $lang $dbname
+ if [ $? -ne 0 ] && [ $? -ne 2 ]; then
+ echo "$me: createlang $lang failed"
+ (exit 2); exit
diff --git a/dev-db/postgresql-server/files/postgresql-8.2-common.patch b/dev-db/postgresql-server/files/postgresql-8.2-common.patch
new file mode 100644
index 000000000000..e6e8e46f3a0b
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.2-common.patch
@@ -0,0 +1,88 @@
+diff --git a/config/programs.m4 b/config/programs.m4
+index fb9793f..3510942 100644
+--- a/config/programs.m4
++++ b/config/programs.m4
+@@ -162,8 +162,12 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
+ dnl FIXME: We should probably check for version >=0.10.36.
+ AC_CHECK_PROGS(XGETTEXT, xgettext)
+
+- # Note: share/locale is always the default, independent of $datadir
+- localedir='${prefix}/share/locale'
++ # Note: share/locale *WAS* always the default, independent of $datadir
++ AC_ARG_WITH([locale-dir],
++ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]),
++ [ localedir="${withval}" ],
++ [ localedir='${prefix}/share/locale' ]
++ )
+ AC_SUBST(localedir)
+ ])# PGAC_CHECK_GETTEXT
+
+diff --git a/configure.in b/configure.in
+index 908a1ae..30dd3bb 100644
+--- a/configure.in
++++ b/configure.in
+@@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
+
+ AC_INIT([PostgreSQL], [8.2.6], [pgsql-bugs@postgresql.org])
+
+-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.59], [], [m4_fatal([Autoconf version 2.59 is required.
+-Untested combinations of 'autoconf' and PostgreSQL versions are not
+-recommended. You can remove the check from 'configure.in' but it is then
+-your responsibility whether the result works or not.])])
+ AC_COPYRIGHT([Copyright (c) 1996-2006, PostgreSQL Global Development Group])
+ AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
+ AC_CONFIG_AUX_DIR(config)
+diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
+index 23f4cc9..707c303 100644
+--- a/src/include/storage/s_lock.h
++++ b/src/include/storage/s_lock.h
+@@ -298,6 +298,29 @@ tas(volatile slock_t *lock)
+
+ #endif /* __s390__ || __s390x__ */
+
++#if defined(__sh__)
++#define HAS_TEST_AND_SET
++
++typedef unsigned char slock_t;
++
++#define TAS(lock) tas(lock)
++
++static __inline__ int
++tas(volatile slock_t *lock)
++{
++ register int _res = 1;
++
++ __asm__ __volatile__(
++ "tas.b @%1\n\t"
++ "movt %0\n\t"
++ "xor #1,%0"
++: "=z"(_res)
++: "r"(lock)
++: "t","memory");
++ return _res;
++}
++
++#endif /* __sh__ */
+
+ #if defined(__sparc__) /* Sparc */
+ #define HAS_TEST_AND_SET
+diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin
+index 9f761d4..83b2974 100644
+--- a/src/makefiles/Makefile.darwin
++++ b/src/makefiles/Makefile.darwin
+@@ -5,7 +5,15 @@ DLSUFFIX = .so
+ CFLAGS_SL =
+
+ ifdef PGXS
++ifdef PGXS_IN_SERVER
++ifndef PGXS_WITH_SERVER
++BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres
++else
++BE_DLLLIBS= -bundle_loader ${PGXS_WITH_SERVER}
++endif
++else
+ BE_DLLLIBS= -bundle_loader $(bindir)/postgres
++endif
+ else
+ BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres
+ endif
diff --git a/dev-db/postgresql-server/files/postgresql-8.2-server.patch b/dev-db/postgresql-server/files/postgresql-8.2-server.patch
new file mode 100644
index 000000000000..9e23f6ae5ef2
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.2-server.patch
@@ -0,0 +1,178 @@
+=== GNUmakefile.in
+==================================================================
+--- GNUmakefile.in (revision 14)
++++ GNUmakefile.in (local)
+@@ -11,19 +11,16 @@
+ all:
+ $(MAKE) -C doc all
+ $(MAKE) -C src all
+- $(MAKE) -C config all
+ @echo "All of PostgreSQL successfully made. Ready to install."
+
+ install:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+ @echo "PostgreSQL installation complete."
+
+ installdirs uninstall:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+
+ distprep:
+ $(MAKE) -C doc $@
+=== contrib/Makefile
+==================================================================
+--- contrib/Makefile (revision 14)
++++ contrib/Makefile (local)
+@@ -18,19 +18,16 @@
+ isn \
+ lo \
+ ltree \
+- oid2name \
+ pg_buffercache \
+ pg_freespacemap \
+ pg_trgm \
+- pgbench \
+ pgcrypto \
+ pgrowlocks \
+ pgstattuple \
+ seg \
+ spi \
+ tablefunc \
+- tsearch2 \
+- vacuumlo
++ tsearch2
+
+ ifeq ($(with_openssl),yes)
+ WANTED_DIRS += sslinfo
+=== contrib/adminpack/Makefile
+==================================================================
+--- contrib/adminpack/Makefile (revision 14)
++++ contrib/adminpack/Makefile (local)
+@@ -1,5 +1,5 @@
+ MODULE_big = adminpack
+-PG_CPPFLAGS = -I$(libpq_srcdir)
++PG_CPPFLAGS = -I$(libpq_srcdir) -I../../src/include/
+ DATA_built = adminpack.sql
+ DATA = uninstall_adminpack.sql
+ DOCS = README.adminpack
+=== src/Makefile
+==================================================================
+--- src/Makefile (revision 14)
++++ src/Makefile (local)
+@@ -18,14 +18,11 @@
+ $(MAKE) -C timezone $@
+ $(MAKE) -C backend $@
+ $(MAKE) -C backend/utils/mb/conversion_procs $@
+- $(MAKE) -C include $@
+- $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+- $(MAKE) -C makefiles $@
+ $(MAKE) -C test/regress $@
+
+-install: install-local
++install:
+
+ install-local: installdirs-local
+ $(INSTALL_DATA) Makefile.global '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global'
+=== src/Makefile.global.in
+==================================================================
+--- src/Makefile.global.in (revision 14)
++++ src/Makefile.global.in (local)
+@@ -365,10 +365,10 @@
+
+
+ submake-libpq:
+- $(MAKE) -C $(libpq_builddir) all
++ @true $(MAKE) -C $(libpq_builddir) all
+
+ submake-libpgport:
+- $(MAKE) -C $(top_builddir)/src/port all
++ @true $(MAKE) -C $(top_builddir)/src/port all
+
+ .PHONY: submake-libpq submake-libpgport
+
+=== src/bin/Makefile
+==================================================================
+--- src/bin/Makefile (revision 14)
++++ src/bin/Makefile (local)
+@@ -13,8 +13,8 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := initdb ipcclean pg_ctl pg_dump \
+- psql scripts pg_config pg_controldata pg_resetxlog
++DIRS := initdb ipcclean pg_ctl \
++ pg_controldata pg_resetxlog
+ ifeq ($(PORTNAME), win32)
+ DIRS+=pgevent
+ endif
+=== src/include/pg_config_manual.h
+==================================================================
+--- src/include/pg_config_manual.h (revision 14)
++++ src/include/pg_config_manual.h (local)
+@@ -175,7 +175,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
+
+ /*
+ * The random() function is expected to yield values between 0 and
+=== src/port/Makefile
+==================================================================
+--- src/port/Makefile (revision 14)
++++ src/port/Makefile (local)
+@@ -29,11 +29,10 @@
+ # Replace all object files so they use FRONTEND define
+ LIBOBJS_SRV := $(LIBOBJS:%.o=%_srv.o)
+
+-all: libpgport.a libpgport_srv.a
++all: libpgport_srv.a
+
+ # libpgport is needed by some contrib
+-install: all installdirs
+- $(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(libdir)/libpgport.a'
++install:
+
+ installdirs:
+ $(mkinstalldirs) '$(DESTDIR)$(libdir)'
+=== src/test/regress/GNUmakefile
+==================================================================
+--- src/test/regress/GNUmakefile (revision 14)
++++ src/test/regress/GNUmakefile (local)
+@@ -148,7 +148,7 @@
+ check: all
+ -rm -rf ./testtablespace
+ mkdir ./testtablespace
+- ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
++ ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) --psqldir=/usr/lib/postgresql-${SLOT}/bin/
+
+ installcheck: all
+ -rm -rf ./testtablespace
+=== src/test/regress/pg_regress.c
+==================================================================
+--- src/test/regress/pg_regress.c (revision 14)
++++ src/test/regress/pg_regress.c (local)
+@@ -502,7 +502,7 @@
+ datadir = tmp;
+
+ /* psql will be installed into temp-install bindir */
+- psqldir = bindir;
++ /* psqldir = bindir; */
+
+ /*
+ * Set up shared library paths to include the temp install.
+@@ -1535,7 +1535,7 @@
+ */
+ snprintf(buf, sizeof(buf),
+ SYSTEMQUOTE "\"%s/psql\" -X postgres <%s 2>%s" SYSTEMQUOTE,
+- bindir, DEVNULL, DEVNULL);
++ psqldir, DEVNULL, DEVNULL);
+ for (i = 0; i < 60; i++)
+ {
+ /* Done if psql succeeds */
diff --git a/dev-db/postgresql-server/files/postgresql-8.3-common.patch b/dev-db/postgresql-server/files/postgresql-8.3-common.patch
new file mode 100644
index 000000000000..c9f2ad22052a
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.3-common.patch
@@ -0,0 +1,88 @@
+diff --git a/config/programs.m4 b/config/programs.m4
+index 9434113..d72b35c 100644
+--- a/config/programs.m4
++++ b/config/programs.m4
+@@ -202,8 +202,12 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
+ dnl FIXME: We should probably check for version >=0.10.36.
+ AC_CHECK_PROGS(XGETTEXT, xgettext)
+
+- # Note: share/locale is always the default, independent of $datadir
+- localedir='${prefix}/share/locale'
++ # Note: share/locale *WAS* always the default, independent of $datadir
++ AC_ARG_WITH([locale-dir],
++ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]),
++ [ localedir="${withval}" ],
++ [ localedir='${prefix}/share/locale' ]
++ )
+ AC_SUBST(localedir)
+ ])# PGAC_CHECK_GETTEXT
+
+diff --git a/configure.in b/configure.in
+index 58cc61c..07ffc38 100644
+--- a/configure.in
++++ b/configure.in
+@@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
+
+ AC_INIT([PostgreSQL], [8.3RC1], [pgsql-bugs@postgresql.org])
+
+-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.59], [], [m4_fatal([Autoconf version 2.59 is required.
+-Untested combinations of 'autoconf' and PostgreSQL versions are not
+-recommended. You can remove the check from 'configure.in' but it is then
+-your responsibility whether the result works or not.])])
+ AC_COPYRIGHT([Copyright (c) 1996-2008, PostgreSQL Global Development Group])
+ AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
+ AC_CONFIG_AUX_DIR(config)
+diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
+index 7d9448f..07799bc 100644
+--- a/src/include/storage/s_lock.h
++++ b/src/include/storage/s_lock.h
+@@ -298,6 +298,29 @@ tas(volatile slock_t *lock)
+
+ #endif /* __s390__ || __s390x__ */
+
++#if defined(__sh__)
++#define HAS_TEST_AND_SET
++
++typedef unsigned char slock_t;
++
++#define TAS(lock) tas(lock)
++
++static __inline__ int
++tas(volatile slock_t *lock)
++{
++ register int _res = 1;
++
++ __asm__ __volatile__(
++ "tas.b @%1\n\t"
++ "movt %0\n\t"
++ "xor #1,%0"
++: "=z"(_res)
++: "r"(lock)
++: "t","memory");
++ return _res;
++}
++
++#endif /* __sh__ */
+
+ #if defined(__sparc__) /* Sparc */
+ #define HAS_TEST_AND_SET
+diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin
+index 9f761d4..83b2974 100644
+--- a/src/makefiles/Makefile.darwin
++++ b/src/makefiles/Makefile.darwin
+@@ -5,7 +5,15 @@ DLSUFFIX = .so
+ CFLAGS_SL =
+
+ ifdef PGXS
++ifdef PGXS_IN_SERVER
++ifndef PGXS_WITH_SERVER
++BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres
++else
++BE_DLLLIBS= -bundle_loader ${PGXS_WITH_SERVER}
++endif
++else
+ BE_DLLLIBS= -bundle_loader $(bindir)/postgres
++endif
+ else
+ BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres
+ endif
diff --git a/dev-db/postgresql-server/files/postgresql-8.3-server.patch b/dev-db/postgresql-server/files/postgresql-8.3-server.patch
new file mode 100644
index 000000000000..756127c5d188
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql-8.3-server.patch
@@ -0,0 +1,217 @@
+=== GNUmakefile.in
+==================================================================
+--- GNUmakefile.in (revision 12)
++++ GNUmakefile.in (local)
+@@ -11,19 +11,16 @@
+ all:
+ $(MAKE) -C doc all
+ $(MAKE) -C src all
+- $(MAKE) -C config all
+ @echo "All of PostgreSQL successfully made. Ready to install."
+
+ install:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+ @echo "PostgreSQL installation complete."
+
+ installdirs uninstall:
+ $(MAKE) -C doc $@
+ $(MAKE) -C src $@
+- $(MAKE) -C config $@
+
+ distprep:
+ $(MAKE) -C doc $@
+=== contrib/Makefile
+==================================================================
+--- contrib/Makefile (revision 12)
++++ contrib/Makefile (local)
+@@ -20,22 +20,18 @@
+ isn \
+ lo \
+ ltree \
+- oid2name \
+ pageinspect \
+ pg_buffercache \
+ pg_freespacemap \
+ pg_standby \
+ pg_trgm \
+- pgbench \
+ pgcrypto \
+ pgrowlocks \
+ pgstattuple \
+ seg \
+ spi \
+ tablefunc \
+- test_parser \
+- tsearch2 \
+- vacuumlo
++ test_parser
+
+ ifeq ($(with_openssl),yes)
+ WANTED_DIRS += sslinfo
+=== contrib/adminpack/Makefile
+==================================================================
+--- contrib/adminpack/Makefile (revision 12)
++++ contrib/adminpack/Makefile (local)
+@@ -1,7 +1,7 @@
+ # $PostgreSQL: pgsql/contrib/adminpack/Makefile,v 1.6 2007/11/10 23:59:50 momjian Exp $
+
+ MODULE_big = adminpack
+-PG_CPPFLAGS = -I$(libpq_srcdir)
++PG_CPPFLAGS = -I$(libpq_srcdir) -I../../src/include/
+ DATA_built = adminpack.sql
+ DATA = uninstall_adminpack.sql
+ OBJS = adminpack.o
+=== contrib/uuid-ossp/Makefile
+==================================================================
+--- contrib/uuid-ossp/Makefile (revision 12)
++++ contrib/uuid-ossp/Makefile (local)
+@@ -1,5 +1,7 @@
+ # $PostgreSQL: pgsql/contrib/uuid-ossp/Makefile,v 1.4 2007/11/13 00:13:19 tgl Exp $
+
++PG_CPPFLAGS="-DHAVE_OSSP_UUID_H"
++
+ MODULE_big = uuid-ossp
+ OBJS = uuid-ossp.o
+ DATA_built = uuid-ossp.sql
+=== src/Makefile
+==================================================================
+--- src/Makefile (revision 12)
++++ src/Makefile (local)
+@@ -19,14 +19,11 @@
+ $(MAKE) -C backend $@
+ $(MAKE) -C backend/utils/mb/conversion_procs $@
+ $(MAKE) -C backend/snowball $@
+- $(MAKE) -C include $@
+- $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+- $(MAKE) -C makefiles $@
+ $(MAKE) -C test/regress $@
+
+-install: install-local
++install:
+
+ install-local: installdirs-local
+ $(INSTALL_DATA) Makefile.global '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global'
+=== src/Makefile.global.in
+==================================================================
+--- src/Makefile.global.in (revision 12)
++++ src/Makefile.global.in (local)
+@@ -373,10 +373,8 @@
+
+
+ submake-libpq:
+- $(MAKE) -C $(libpq_builddir) all
+
+ submake-libpgport:
+- $(MAKE) -C $(top_builddir)/src/port all
+
+ .PHONY: submake-libpq submake-libpgport
+
+@@ -419,7 +417,9 @@
+ LDFLAGS += $(PROFILE)
+ endif
+
++CFLAGS += -I${top_srcdir}/src/include
+
++
+ ##########################################################################
+ #
+ # substitute implementations of C library routines (see src/port/)
+=== src/bin/Makefile
+==================================================================
+--- src/bin/Makefile (revision 12)
++++ src/bin/Makefile (local)
+@@ -13,8 +13,8 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS = initdb ipcclean pg_ctl pg_dump \
+- psql scripts pg_config pg_controldata pg_resetxlog
++DIRS = initdb ipcclean pg_ctl \
++ pg_controldata pg_resetxlog
+ ifeq ($(PORTNAME), win32)
+ DIRS+=pgevent
+ endif
+=== src/bin/initdb/Makefile
+==================================================================
+--- src/bin/initdb/Makefile (revision 12)
++++ src/bin/initdb/Makefile (local)
+@@ -14,7 +14,7 @@
+ top_builddir = ../../..
+ include $(top_builddir)/src/Makefile.global
+
+-override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
++override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/libpq $(CPPFLAGS)
+
+ OBJS= initdb.o encnames.o pqsignal.o $(WIN32RES)
+
+=== src/include/pg_config_manual.h
+==================================================================
+--- src/include/pg_config_manual.h (revision 12)
++++ src/include/pg_config_manual.h (local)
+@@ -184,7 +184,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
+
+ /*
+ * The random() function is expected to yield values between 0 and
+=== src/port/Makefile
+==================================================================
+--- src/port/Makefile (revision 12)
++++ src/port/Makefile (local)
+@@ -35,11 +35,10 @@
+ # foo_srv.o and foo.o are both built from foo.c, but only foo.o has -DFRONTEND
+ OBJS_SRV = $(OBJS:%.o=%_srv.o)
+
+-all: libpgport.a libpgport_srv.a
++all: libpgport_srv.a
+
+ # libpgport is needed by some contrib
+-install: all installdirs
+- $(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(libdir)/libpgport.a'
++install:
+
+ installdirs:
+ $(mkinstalldirs) '$(DESTDIR)$(libdir)'
+=== src/test/regress/GNUmakefile
+==================================================================
+--- src/test/regress/GNUmakefile (revision 12)
++++ src/test/regress/GNUmakefile (local)
+@@ -141,7 +141,7 @@
+ ##
+
+ check: all
+- ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) $(TEMP_CONF)
++ ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) $(TEMP_CONF) --psqldir=/usr/lib/postgresql-${SLOT}/bin/
+
+ installcheck: all
+ ./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
+=== src/test/regress/pg_regress.c
+==================================================================
+--- src/test/regress/pg_regress.c (revision 12)
++++ src/test/regress/pg_regress.c (local)
+@@ -781,9 +781,6 @@
+ sprintf(tmp, "%s/install/%s", temp_install, datadir);
+ datadir = tmp;
+
+- /* psql will be installed into temp-install bindir */
+- psqldir = bindir;
+-
+ /*
+ * Set up shared library paths to include the temp install.
+ *
+@@ -2053,7 +2050,7 @@
+ */
+ snprintf(buf, sizeof(buf),
+ SYSTEMQUOTE "\"%s/psql\" -X postgres <%s 2>%s" SYSTEMQUOTE,
+- bindir, DEVNULL, DEVNULL);
++ psqldir, DEVNULL, DEVNULL);
+ for (i = 0; i < 60; i++)
+ {
+ /* Done if psql succeeds */
diff --git a/dev-db/postgresql-server/files/postgresql.conf-7.3 b/dev-db/postgresql-server/files/postgresql.conf-7.3
new file mode 100644
index 000000000000..4e06ea09a4d3
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.conf-7.3
@@ -0,0 +1,48 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/7.3/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
+
+
+# SERVER SHUTDOWN:
+# The server will receive 3 signals in the worst case:
+# 1. SIGTERM
+# This signals the server to ignore new connections and to
+# wait for all clients to end their transactions before shutting down.
+# Use WAIT_FOR_DISCONNECT to control how much time the clients
+# should have until the next signal is being sent.
+# 2. SIGINT
+# Tell the server to forcefully disconnect all clients.
+# Terminating a client results in a rollback of the open transactions for this client.
+# Use WAIT_FOR_CLEANUP to determine how much time the server has
+# for cleanup.
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect
+WAIT_FOR_DISCONNECT=30
+
+# Time the server has to clean up
+WAIT_FOR_CLEANUP=60
+
+# Time the server has to quit (with a recover-run on next startup)
+# Set to 0 to deactivate it
+WAIT_FOR_QUIT=60
+
+
+# If you have to export environment variables for the database process,
+# this can be done here.
+#
+# Example:
+# export R_HOME="/usr/lib/R"
diff --git a/dev-db/postgresql-server/files/postgresql.conf-7.4 b/dev-db/postgresql-server/files/postgresql.conf-7.4
new file mode 100644
index 000000000000..d59ac96d6d8f
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.conf-7.4
@@ -0,0 +1,48 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/7.4/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
+
+
+# SERVER SHUTDOWN:
+# The server will receive 3 signals in the worst case:
+# 1. SIGTERM
+# This signals the server to ignore new connections and to
+# wait for all clients to end their transactions before shutting down.
+# Use WAIT_FOR_DISCONNECT to control how much time the clients
+# should have until the next signal is being sent.
+# 2. SIGINT
+# Tell the server to forcefully disconnect all clients.
+# Terminating a client results in a rollback of the open transactions for this client.
+# Use WAIT_FOR_CLEANUP to determine how much time the server has
+# for cleanup.
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect
+WAIT_FOR_DISCONNECT=30
+
+# Time the server has to clean up
+WAIT_FOR_CLEANUP=60
+
+# Time the server has to quit (with a recover-run on next startup)
+# Set to 0 to deactivate it
+WAIT_FOR_QUIT=60
+
+
+# If you have to export environment variables for the database process,
+# this can be done here.
+#
+# Example:
+# export R_HOME="/usr/lib/R"
diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.0 b/dev-db/postgresql-server/files/postgresql.conf-8.0
new file mode 100644
index 000000000000..2e00577fb96e
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.conf-8.0
@@ -0,0 +1,48 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/8.0/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
+
+
+# SERVER SHUTDOWN:
+# The server will receive 3 signals in the worst case:
+# 1. SIGTERM
+# This signals the server to ignore new connections and to
+# wait for all clients to end their transactions before shutting down.
+# Use WAIT_FOR_DISCONNECT to control how much time the clients
+# should have until the next signal is being sent.
+# 2. SIGINT
+# Tell the server to forcefully disconnect all clients.
+# Terminating a client results in a rollback of the open transactions for this client.
+# Use WAIT_FOR_CLEANUP to determine how much time the server has
+# for cleanup.
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect
+WAIT_FOR_DISCONNECT=30
+
+# Time the server has to clean up
+WAIT_FOR_CLEANUP=60
+
+# Time the server has to quit (with a recover-run on next startup)
+# Set to 0 to deactivate it
+WAIT_FOR_QUIT=60
+
+
+# If you have to export environment variables for the database process,
+# this can be done here.
+#
+# Example:
+# export R_HOME="/usr/lib/R"
diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.1 b/dev-db/postgresql-server/files/postgresql.conf-8.1
new file mode 100644
index 000000000000..a8fb8544eb41
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.conf-8.1
@@ -0,0 +1,48 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/8.1/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
+
+
+# SERVER SHUTDOWN:
+# The server will receive 3 signals in the worst case:
+# 1. SIGTERM
+# This signals the server to ignore new connections and to
+# wait for all clients to end their transactions before shutting down.
+# Use WAIT_FOR_DISCONNECT to control how much time the clients
+# should have until the next signal is being sent.
+# 2. SIGINT
+# Tell the server to forcefully disconnect all clients.
+# Terminating a client results in a rollback of the open transactions for this client.
+# Use WAIT_FOR_CLEANUP to determine how much time the server has
+# for cleanup.
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect
+WAIT_FOR_DISCONNECT=30
+
+# Time the server has to clean up
+WAIT_FOR_CLEANUP=60
+
+# Time the server has to quit (with a recover-run on next startup)
+# Set to 0 to deactivate it
+WAIT_FOR_QUIT=60
+
+
+# If you have to export environment variables for the database process,
+# this can be done here.
+#
+# Example:
+# export R_HOME="/usr/lib/R"
diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.2 b/dev-db/postgresql-server/files/postgresql.conf-8.2
new file mode 100644
index 000000000000..2cf92587cdbb
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.conf-8.2
@@ -0,0 +1,48 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/8.2/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
+
+
+# SERVER SHUTDOWN:
+# The server will receive 3 signals in the worst case:
+# 1. SIGTERM
+# This signals the server to ignore new connections and to
+# wait for all clients to end their transactions before shutting down.
+# Use WAIT_FOR_DISCONNECT to control how much time the clients
+# should have until the next signal is being sent.
+# 2. SIGINT
+# Tell the server to forcefully disconnect all clients.
+# Terminating a client results in a rollback of the open transactions for this client.
+# Use WAIT_FOR_CLEANUP to determine how much time the server has
+# for cleanup.
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect
+WAIT_FOR_DISCONNECT=30
+
+# Time the server has to clean up
+WAIT_FOR_CLEANUP=60
+
+# Time the server has to quit (with a recover-run on next startup)
+# Set to 0 to deactivate it
+WAIT_FOR_QUIT=60
+
+
+# If you have to export environment variables for the database process,
+# this can be done here.
+#
+# Example:
+# export R_HOME="/usr/lib/R"
diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.3 b/dev-db/postgresql-server/files/postgresql.conf-8.3
new file mode 100644
index 000000000000..01e42f51d2b4
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.conf-8.3
@@ -0,0 +1,48 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/8.3/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
+
+
+# SERVER SHUTDOWN:
+# The server will receive 3 signals in the worst case:
+# 1. SIGTERM
+# This signals the server to ignore new connections and to
+# wait for all clients to end their transactions before shutting down.
+# Use WAIT_FOR_DISCONNECT to control how much time the clients
+# should have until the next signal is being sent.
+# 2. SIGINT
+# Tell the server to forcefully disconnect all clients.
+# Terminating a client results in a rollback of the open transactions for this client.
+# Use WAIT_FOR_CLEANUP to determine how much time the server has
+# for cleanup.
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect
+WAIT_FOR_DISCONNECT=30
+
+# Time the server has to clean up
+WAIT_FOR_CLEANUP=60
+
+# Time the server has to quit (with a recover-run on next startup)
+# Set to 0 to deactivate it
+WAIT_FOR_QUIT=60
+
+
+# If you have to export environment variables for the database process,
+# this can be done here.
+#
+# Example:
+# export R_HOME="/usr/lib/R"
diff --git a/dev-db/postgresql-server/files/postgresql.init-7.3 b/dev-db/postgresql-server/files/postgresql.init-7.3
new file mode 100644
index 000000000000..0c852763e270
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.init-7.3
@@ -0,0 +1,75 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-7.3,v 1.1 2008/04/15 09:29:55 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+ if [ -L /etc/eselect/postgresql/service ] ; then
+ local p_service="$(for f in /etc/eselect/postgresql/service/* ; do source $f ; done ; echo $postgres_service )"
+ test "${p_service}" = "${SVCNAME}" && provide postgresql
+ fi
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "Please make sure that PGDATA points to the right path."
+ eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+
+ su -l ${PGUSER} \
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-7.3/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'"
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL (this can take up to $(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)"
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}
+ [ $? -eq 0 ] && eend $? && exit
+
+ ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds."
+ ewarn "Going to shutdown the server anyway."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -INT/${WAIT_FOR_CLEANUP}
+ [ $? -eq 0 ] && eend $? && exit
+
+ if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then
+ eerror "Server did not shut down and sending the SIGQUIT has been disabled."
+ eend $?
+ fi
+
+ ewarn "Shutting down the server gracefully failed."
+ ewarn "Forcing it to shutdown which leads to a recover-run on next startup."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -QUIT/${WAIT_FOR_QUIT}
+
+ [ $? -eq 0 ] && eend $? && exit
+
+ eerror "Forced shutdown failed!!! Something is wrong with your system, please take care of it manually."
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql-server/files/postgresql.init-7.4 b/dev-db/postgresql-server/files/postgresql.init-7.4
new file mode 100644
index 000000000000..cdb11581fb2d
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.init-7.4
@@ -0,0 +1,75 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-7.4,v 1.1 2008/04/15 09:29:55 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+ if [ -L /etc/eselect/postgresql/service ] ; then
+ local p_service="$(for f in /etc/eselect/postgresql/service/* ; do source $f ; done ; echo $postgres_service )"
+ test "${p_service}" = "${SVCNAME}" && provide postgresql
+ fi
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "Please make sure that PGDATA points to the right path."
+ eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+
+ su -l ${PGUSER} \
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-7.4/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'"
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL (this can take up to $(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)"
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}
+ [ $? -eq 0 ] && eend $? && exit
+
+ ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds."
+ ewarn "Going to shutdown the server anyway."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -INT/${WAIT_FOR_CLEANUP}
+ [ $? -eq 0 ] && eend $? && exit
+
+ if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then
+ eerror "Server did not shut down and sending the SIGQUIT has been disabled."
+ eend $?
+ fi
+
+ ewarn "Shutting down the server gracefully failed."
+ ewarn "Forcing it to shutdown which leads to a recover-run on next startup."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -QUIT/${WAIT_FOR_QUIT}
+
+ [ $? -eq 0 ] && eend $? && exit
+
+ eerror "Forced shutdown failed!!! Something is wrong with your system, please take care of it manually."
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql-server/files/postgresql.init-8.0 b/dev-db/postgresql-server/files/postgresql.init-8.0
new file mode 100644
index 000000000000..b02d1e6450ea
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.init-8.0
@@ -0,0 +1,75 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.0,v 1.1 2008/04/15 09:29:55 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+ if [ -L /etc/eselect/postgresql/service ] ; then
+ local p_service="$(for f in /etc/eselect/postgresql/service/* ; do source $f ; done ; echo $postgres_service )"
+ test "${p_service}" = "${SVCNAME}" && provide postgresql
+ fi
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "Please make sure that PGDATA points to the right path."
+ eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+
+ su -l ${PGUSER} \
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.0/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'"
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL (this can take up to $(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)"
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}
+ [ $? -eq 0 ] && eend $? && exit
+
+ ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds."
+ ewarn "Going to shutdown the server anyway."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -INT/${WAIT_FOR_CLEANUP}
+ [ $? -eq 0 ] && eend $? && exit
+
+ if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then
+ eerror "Server did not shut down and sending the SIGQUIT has been disabled."
+ eend $?
+ fi
+
+ ewarn "Shutting down the server gracefully failed."
+ ewarn "Forcing it to shutdown which leads to a recover-run on next startup."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -QUIT/${WAIT_FOR_QUIT}
+
+ [ $? -eq 0 ] && eend $? && exit
+
+ eerror "Forced shutdown failed!!! Something is wrong with your system, please take care of it manually."
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql-server/files/postgresql.init-8.1 b/dev-db/postgresql-server/files/postgresql.init-8.1
new file mode 100644
index 000000000000..5d498e0cddc4
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.init-8.1
@@ -0,0 +1,75 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.1,v 1.1 2008/04/15 09:29:55 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+ if [ -L /etc/eselect/postgresql/service ] ; then
+ local p_service="$(for f in /etc/eselect/postgresql/service/* ; do source $f ; done ; echo $postgres_service )"
+ test "${p_service}" = "${SVCNAME}" && provide postgresql
+ fi
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "Please make sure that PGDATA points to the right path."
+ eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+
+ su -l ${PGUSER} \
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.1/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'"
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL (this can take up to $(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)"
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}
+ [ $? -eq 0 ] && eend $? && exit
+
+ ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds."
+ ewarn "Going to shutdown the server anyway."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -INT/${WAIT_FOR_CLEANUP}
+ [ $? -eq 0 ] && eend $? && exit
+
+ if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then
+ eerror "Server did not shut down and sending the SIGQUIT has been disabled."
+ eend $?
+ fi
+
+ ewarn "Shutting down the server gracefully failed."
+ ewarn "Forcing it to shutdown which leads to a recover-run on next startup."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -QUIT/${WAIT_FOR_QUIT}
+
+ [ $? -eq 0 ] && eend $? && exit
+
+ eerror "Forced shutdown failed!!! Something is wrong with your system, please take care of it manually."
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql-server/files/postgresql.init-8.2 b/dev-db/postgresql-server/files/postgresql.init-8.2
new file mode 100644
index 000000000000..212a4ca3fd3a
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.init-8.2
@@ -0,0 +1,75 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.2,v 1.1 2008/04/15 09:29:55 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+ if [ -L /etc/eselect/postgresql/service ] ; then
+ local p_service="$(for f in /etc/eselect/postgresql/service/* ; do source $f ; done ; echo $postgres_service )"
+ test "${p_service}" = "${SVCNAME}" && provide postgresql
+ fi
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "Please make sure that PGDATA points to the right path."
+ eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+
+ su -l ${PGUSER} \
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.2/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'"
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL (this can take up to $(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)"
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}
+ [ $? -eq 0 ] && eend $? && exit
+
+ ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds."
+ ewarn "Going to shutdown the server anyway."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -INT/${WAIT_FOR_CLEANUP}
+ [ $? -eq 0 ] && eend $? && exit
+
+ if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then
+ eerror "Server did not shut down and sending the SIGQUIT has been disabled."
+ eend $?
+ fi
+
+ ewarn "Shutting down the server gracefully failed."
+ ewarn "Forcing it to shutdown which leads to a recover-run on next startup."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -QUIT/${WAIT_FOR_QUIT}
+
+ [ $? -eq 0 ] && eend $? && exit
+
+ eerror "Forced shutdown failed!!! Something is wrong with your system, please take care of it manually."
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql-server/files/postgresql.init-8.3 b/dev-db/postgresql-server/files/postgresql.init-8.3
new file mode 100644
index 000000000000..a936c7296167
--- /dev/null
+++ b/dev-db/postgresql-server/files/postgresql.init-8.3
@@ -0,0 +1,75 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3,v 1.1 2008/04/15 09:29:55 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+ if [ -L /etc/eselect/postgresql/service ] ; then
+ local p_service="$(for f in /etc/eselect/postgresql/service/* ; do source $f ; done ; echo $postgres_service )"
+ test "${p_service}" = "${SVCNAME}" && provide postgresql
+ fi
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "Please make sure that PGDATA points to the right path."
+ eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+
+ su -l ${PGUSER} \
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'"
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL (this can take up to $(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)"
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}
+ [ $? -eq 0 ] && eend $? && exit
+
+ ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds."
+ ewarn "Going to shutdown the server anyway."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -INT/${WAIT_FOR_CLEANUP}
+ [ $? -eq 0 ] && eend $? && exit
+
+ if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then
+ eerror "Server did not shut down and sending the SIGQUIT has been disabled."
+ eend $?
+ fi
+
+ ewarn "Shutting down the server gracefully failed."
+ ewarn "Forcing it to shutdown which leads to a recover-run on next startup."
+
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -QUIT/${WAIT_FOR_QUIT}
+
+ [ $? -eq 0 ] && eend $? && exit
+
+ eerror "Forced shutdown failed!!! Something is wrong with your system, please take care of it manually."
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql-server/metadata.xml b/dev-db/postgresql-server/metadata.xml
new file mode 100644
index 000000000000..d06e452b35af
--- /dev/null
+++ b/dev-db/postgresql-server/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>postgresql</herd>
+</pkgmetadata>
diff --git a/dev-db/postgresql-server/postgresql-server-7.3.21.ebuild b/dev-db/postgresql-server/postgresql-server-7.3.21.ebuild
new file mode 100644
index 000000000000..add46b1a496a
--- /dev/null
+++ b/dev-db/postgresql-server/postgresql-server-7.3.21.ebuild
@@ -0,0 +1,238 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-7.3.21.ebuild,v 1.1 2008/04/15 09:29:54 dev-zero Exp $
+
+EAPI="1"
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="none"
+inherit eutils multilib toolchain-funcs versionator autotools
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="PostgreSQL server"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="$(get_version_component_range 1-2)"
+IUSE_LINGUAS="
+ linguas_cs linguas_de linguas_es linguas_fr linguas_hr linguas_hu
+ linguas_pt_BR linguas_ru linguas_sv linguas_tr linguas_zh_CN
+ linguas_zh_TW"
+IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}"
+
+wanted_languages() {
+ for u in ${IUSE_LINGUAS} ; do
+ use $u && echo ${u#linguas_}
+ done
+}
+
+RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ selinux? ( sec-policy/selinux-postgresql )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )"
+DEPEND="${RDEPEND}
+ xml? ( dev-util/pkgconfig )"
+PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
+
+S="${WORKDIR}/postgresql-${PV}"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/postgresql-${PV}-autoconf.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-server.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-cubeparse.patch"
+
+ if hasq test ${FEATURES}; then
+ epatch "${FILESDIR}/postgresql-${SLOT}-regress.patch"
+ fi
+
+ eautoconf
+}
+
+src_compile() {
+
+ # eval is needed to get along with pg_config quotation of space-rich entities.
+ eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with tcl) \
+ --with-includes="/usr/include/postgresql-${SLOT}/" \
+ --with-libs="/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)/" \
+ "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
+ "CFLAGS='${CFLAGS} $(use xml && pkg-config --cflags libxml-2.0)'" \
+ "LIBS='${LIBS} $(use xml && pkg-config --libs libxml-2.0) -L/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)'" \
+ || die "configure failed"
+
+ for bd in . contrib $(use xml && echo contrib/xml) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \
+ docdir=/usr/share/doc/${PF} SLOT=${SLOT} || die "emake in $bd failed"
+ done
+}
+
+src_install() {
+ if use perl ; then
+ mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
+ sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
+ "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
+ fi
+
+ for bd in . contrib $(use xml && echo contrib/xml) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake install -C $bd -j1 DESTDIR="${D}" \
+ docdir=/usr/share/doc/${PF} SLOT=${SLOT} || die "emake install in $bd failed"
+ done
+ rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/"
+ rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,vacuumdb,pgtksh,pgtclsh}.1
+
+ dodoc README HISTORY doc/{README.*,TODO,bug.template}
+
+ dodir /etc/eselect/postgresql/slots/${SLOT}
+ cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
+ postgres_ebuilds="\${postgres_ebuilds} ${PF}"
+ postgres_service="postgresql-${SLOT}"
+ __EOF__
+
+ newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
+
+ # Workaround for paludis
+ [ -f "${ROOT}/var/run/postgresql/.keep" ] || keepdir /var/run/postgresql
+ fperms 0770 /var/run/postgresql
+ fowners postgres:postgres /var/run/postgresql
+}
+
+pkg_postinst() {
+ eselect postgresql update
+ [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
+ [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
+
+ ewarn "Please note that the standard location of the socket has changed from /tmp"
+ ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
+ ewarn "the socket."
+ ewarn "This can break applications which have the standard location hard-coded."
+ ewarn "If such an application links against the libpq, please re-emerge it,"
+ ewarn "if that doesn't help or the application accesses the socket without using libpq,"
+ ewarn "please file a bug-report."
+ ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
+
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+}
+
+pkg_postrm() {
+ eselect postgresql update
+}
+
+pkg_config() {
+ [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
+
+ einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
+ einfo "More information can be found here:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
+ einfo
+ einfo "You can change the directory where the database cluster is being created by setting"
+ einfo "the PGDATA variable."
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ einfo " \"${PG_INITDB_OPTS}\""
+ einfo "and the database cluster will be created in:"
+ einfo " \"${PGDATA}\""
+ einfo "Are you ready to continue? (Y/n)"
+ read answer
+ [ -z $answer ] && answer=Y
+ [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
+
+ if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
+ eerror "The given directory \"${PGDATA}\" already contains a database cluster."
+ die "cluster already exists"
+ fi
+
+ [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
+ einfo "Checking system parameters..."
+
+ if ! use kernel_linux ; then
+ SKIP_SYSTEM_TESTS=yes
+ einfo " Tests not supported on this OS (yet)"
+ fi
+
+ 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 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
+ einfo "Skipped."
+ fi
+
+ einfo "Creating the data directory ..."
+ mkdir -p "${PGDATA}"
+ chown -Rf postgres:postgres "${PGDATA}"
+ chmod 0700 "${PGDATA}"
+
+ einfo "Initializing the database ..."
+
+ su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+
+ if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
+ ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
+ ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
+ fi
+}
+
+src_test() {
+ sed -i \
+ -e '/test: horology/d' \
+ src/test/regress/{parallel_schedule,serial_schedule} || die "sed failed"
+
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -j1 check \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details."
+
+ einfo "Yes, there are other tests which could be run."
+ einfo "... and no, we don't plan to add/support them."
+ einfo "For now, the main regressions tests will suffice."
+ einfo "If you think other tests are necessary, please submit a"
+ einfo "bug including a patch for this ebuild to enable them."
+}
diff --git a/dev-db/postgresql-server/postgresql-server-7.4.19.ebuild b/dev-db/postgresql-server/postgresql-server-7.4.19.ebuild
new file mode 100644
index 000000000000..3166c691bbcf
--- /dev/null
+++ b/dev-db/postgresql-server/postgresql-server-7.4.19.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-7.4.19.ebuild,v 1.1 2008/04/15 09:29:54 dev-zero Exp $
+
+EAPI="1"
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="none"
+inherit eutils multilib toolchain-funcs versionator autotools
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="PostgreSQL server"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="$(get_version_component_range 1-2)"
+IUSE_LINGUAS="
+ linguas_cs linguas_de linguas_es linguas_fr linguas_hr linguas_hu
+ linguas_it linguas_nb linguas_pt_BR linguas_ru linguas_sl linguas_sv
+ linguas_tr linguas_zh_CN linguas_zh_TW"
+IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}"
+
+wanted_languages() {
+ for u in ${IUSE_LINGUAS} ; do
+ use $u && echo ${u#linguas_}
+ done
+}
+
+RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ selinux? ( sec-policy/selinux-postgresql )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )"
+DEPEND="${RDEPEND}
+ xml? ( dev-util/pkgconfig )"
+PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
+
+S="${WORKDIR}/postgresql-${PV}"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/postgresql-${PV}-autoconf.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-vacuum-delay.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-server.patch"
+
+ if hasq test ${FEATURES}; then
+ epatch "${FILESDIR}/postgresql-${SLOT}-regress.patch"
+ fi
+
+ eautoreconf
+}
+
+src_compile() {
+
+ # eval is needed to get along with pg_config quotation of space-rich entities.
+ eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with tcl) \
+ --with-includes="/usr/include/postgresql-${SLOT}/" \
+ --with-libs="/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)/" \
+ "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
+ "CFLAGS='${CFLAGS} $(use xml && pkg-config --cflags libxml-2.0)'" \
+ "LIBS='${LIBS} -lpq $(use xml && pkg-config --libs libxml-2.0) -L/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)'" \
+ || die "configure failed"
+
+ for bd in . contrib $(use xml && echo contrib/xml) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \
+ docdir=/usr/share/doc/${PF} SLOT=${SLOT} || die "emake in $bd failed"
+ done
+}
+
+src_install() {
+ if use perl ; then
+ mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
+ sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
+ "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
+ fi
+
+ for bd in . contrib $(use xml && echo contrib/xml) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake install -C $bd -j1 DESTDIR="${D}" \
+ docdir=/usr/share/doc/${PF} SLOT=${SLOT} || die "emake install in $bd failed"
+ done
+ rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/"
+ rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,vacuumdb,pgtksh,pgtclsh}.1
+
+ dodoc README HISTORY doc/{README.*,TODO,bug.template}
+
+ dodir /etc/eselect/postgresql/slots/${SLOT}
+ cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
+ postgres_ebuilds="\${postgres_ebuilds} ${PF}"
+ postgres_service="postgresql-${SLOT}"
+ __EOF__
+
+ newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
+
+ # Workaround for paludis
+ [ -f "${ROOT}/var/run/postgresql/.keep" ] || keepdir /var/run/postgresql
+ fperms 0770 /var/run/postgresql
+ fowners postgres:postgres /var/run/postgresql
+}
+
+pkg_postinst() {
+ eselect postgresql update
+ [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
+ [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
+
+ ewarn "Please note that the standard location of the socket has changed from /tmp"
+ ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
+ ewarn "the socket."
+ ewarn "This can break applications which have the standard location hard-coded."
+ ewarn "If such an application links against the libpq, please re-emerge it,"
+ ewarn "if that doesn't help or the application accesses the socket without using libpq,"
+ ewarn "please file a bug-report."
+ ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
+
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+}
+
+pkg_postrm() {
+ eselect postgresql update
+}
+
+pkg_config() {
+ [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
+
+ einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
+ einfo "More information can be found here:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
+ einfo
+ einfo "You can change the directory where the database cluster is being created by setting"
+ einfo "the PGDATA variable."
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ einfo " \"${PG_INITDB_OPTS}\""
+ einfo "and the database cluster will be created in:"
+ einfo " \"${PGDATA}\""
+ einfo "Are you ready to continue? (Y/n)"
+ read answer
+ [ -z $answer ] && answer=Y
+ [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
+
+ if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
+ eerror "The given directory \"${PGDATA}\" already contains a database cluster."
+ die "cluster already exists"
+ fi
+
+ [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
+ einfo "Checking system parameters..."
+
+ if ! use kernel_linux ; then
+ SKIP_SYSTEM_TESTS=yes
+ einfo " Tests not supported on this OS (yet)"
+ fi
+
+ 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 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
+ einfo "Skipped."
+ fi
+
+ einfo "Creating the data directory ..."
+ mkdir -p "${PGDATA}"
+ chown -Rf postgres:postgres "${PGDATA}"
+ chmod 0700 "${PGDATA}"
+
+ einfo "Initializing the database ..."
+
+ su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+
+ if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
+ ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
+ ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
+ fi
+}
+
+src_test() {
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -j1 check \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details."
+
+ einfo "Yes, there are other tests which could be run."
+ einfo "... and no, we don't plan to add/support them."
+ einfo "For now, the main regressions tests will suffice."
+ einfo "If you think other tests are necessary, please submit a"
+ einfo "bug including a patch for this ebuild to enable them."
+}
diff --git a/dev-db/postgresql-server/postgresql-server-8.0.15.ebuild b/dev-db/postgresql-server/postgresql-server-8.0.15.ebuild
new file mode 100644
index 000000000000..e4767554f2ce
--- /dev/null
+++ b/dev-db/postgresql-server/postgresql-server-8.0.15.ebuild
@@ -0,0 +1,239 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.0.15.ebuild,v 1.1 2008/04/15 09:29:54 dev-zero Exp $
+
+EAPI="1"
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="none"
+inherit eutils multilib toolchain-funcs versionator autotools
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="PostgreSQL server"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="$(get_version_component_range 1-2)"
+IUSE_LINGUAS="
+ linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr
+ linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl
+ linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv
+ linguas_tr linguas_zh_CN linguas_zh_TW"
+IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}"
+
+wanted_languages() {
+ for u in ${IUSE_LINGUAS} ; do
+ use $u && echo ${u#linguas_}
+ done
+}
+
+RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ selinux? ( sec-policy/selinux-postgresql )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )"
+DEPEND="${RDEPEND}
+ xml? ( dev-util/pkgconfig )"
+PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
+
+S="${WORKDIR}/postgresql-${PV}"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-server.patch"
+
+ if hasq test ${FEATURES}; then
+ sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+ fi
+
+ eautoconf
+}
+
+src_compile() {
+ # TODO: test if PPC really cannot work with other CFLAGS settings
+ # use ppc && CFLAGS="-pipe -fsigned-char"
+
+ # eval is needed to get along with pg_config quotation of space-rich entities.
+ eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with tcl) \
+ --with-includes="/usr/include/postgresql-${SLOT}/" \
+ "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
+ || die "configure failed"
+
+ for bd in . contrib $(use xml && echo contrib/xml2) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed"
+ done
+}
+
+src_install() {
+ if use perl ; then
+ mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
+ sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
+ "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
+ fi
+
+ for bd in . contrib $(use xml && echo contrib/xml2) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake install -C $bd -j1 DESTDIR="${D}" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed"
+ done
+ rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/"
+ rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,vacuumdb}.1
+
+ dodoc README HISTORY doc/{README.*,TODO,bug.template}
+
+ dodir /etc/eselect/postgresql/slots/${SLOT}
+ cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
+ postgres_ebuilds="\${postgres_ebuilds} ${PF}"
+ postgres_service="postgresql-${SLOT}"
+ __EOF__
+
+ newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
+
+ # Workaround for paludis
+ [ -f "${ROOT}/var/run/postgresql/.keep" ] || keepdir /var/run/postgresql
+ fperms 0770 /var/run/postgresql
+ fowners postgres:postgres /var/run/postgresql
+}
+
+pkg_postinst() {
+ eselect postgresql update
+ [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
+ [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
+
+ ewarn "Please note that the standard location of the socket has changed from /tmp"
+ ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
+ ewarn "the socket."
+ ewarn "This can break applications which have the standard location hard-coded."
+ ewarn "If such an application links against the libpq, please re-emerge it,"
+ ewarn "if that doesn't help or the application accesses the socket without using libpq,"
+ ewarn "please file a bug-report."
+ ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
+
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+}
+
+pkg_postrm() {
+ eselect postgresql update
+}
+
+pkg_config() {
+ [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
+
+ einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
+ einfo "More information can be found here:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
+ einfo
+ einfo "You can change the directory where the database cluster is being created by setting"
+ einfo "the PGDATA variable."
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ einfo " \"${PG_INITDB_OPTS}\""
+ einfo "and the database cluster will be created in:"
+ einfo " \"${PGDATA}\""
+ einfo "Are you ready to continue? (Y/n)"
+ read answer
+ [ -z $answer ] && answer=Y
+ [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
+
+ if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
+ eerror "The given directory \"${PGDATA}\" already contains a database cluster."
+ die "cluster already exists"
+ fi
+
+ [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
+ einfo "Checking system parameters..."
+
+ if ! use kernel_linux ; then
+ SKIP_SYSTEM_TESTS=yes
+ einfo " Tests not supported on this OS (yet)"
+ fi
+
+ 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 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
+ einfo "Skipped."
+ fi
+
+ einfo "Creating the data directory ..."
+ mkdir -p "${PGDATA}"
+ chown -Rf postgres:postgres "${PGDATA}"
+ chmod 0700 "${PGDATA}"
+
+ einfo "Initializing the database ..."
+
+ su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+
+ if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
+ ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
+ ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
+ fi
+}
+
+src_test() {
+ sed -i \
+ -e '/test: horology/d' \
+ src/test/regress/{parallel_schedule,serial_schedule} || die "sed failed"
+
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -j1 check \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details."
+
+ einfo "Yes, there are other tests which could be run."
+ einfo "... and no, we don't plan to add/support them."
+ einfo "For now, the main regressions tests will suffice."
+ einfo "If you think other tests are necessary, please submit a"
+ einfo "bug including a patch for this ebuild to enable them."
+}
diff --git a/dev-db/postgresql-server/postgresql-server-8.1.11.ebuild b/dev-db/postgresql-server/postgresql-server-8.1.11.ebuild
new file mode 100644
index 000000000000..e80ce9204a5d
--- /dev/null
+++ b/dev-db/postgresql-server/postgresql-server-8.1.11.ebuild
@@ -0,0 +1,238 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.1.11.ebuild,v 1.1 2008/04/15 09:29:54 dev-zero Exp $
+
+EAPI="1"
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="none"
+inherit eutils multilib toolchain-funcs versionator autotools
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="PostgreSQL server"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="$(get_version_component_range 1-2)"
+IUSE_LINGUAS="
+ linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr
+ linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl
+ linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv
+ linguas_tr linguas_zh_CN linguas_zh_TW"
+IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}"
+
+wanted_languages() {
+ for u in ${IUSE_LINGUAS} ; do
+ use $u && echo ${u#linguas_}
+ done
+}
+
+RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ selinux? ( sec-policy/selinux-postgresql )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )"
+DEPEND="${RDEPEND}
+ xml? ( dev-util/pkgconfig )"
+PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
+
+S="${WORKDIR}/postgresql-${PV}"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-server.patch"
+
+ if hasq test ${FEATURES}; then
+ sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+ fi
+
+ eautoconf
+}
+
+src_compile() {
+ # TODO: test if PPC really cannot work with other CFLAGS settings
+ # use ppc && CFLAGS="-pipe -fsigned-char"
+
+ # eval is needed to get along with pg_config quotation of space-rich entities.
+ eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with tcl) \
+ --with-includes="/usr/include/postgresql-${SLOT}/" \
+ "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
+ || die "configure failed"
+
+ for bd in . contrib $(use xml && echo contrib/xml2) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed"
+ done
+}
+
+src_install() {
+ if use perl ; then
+ mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
+ sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
+ "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
+ fi
+
+ for bd in . contrib $(use xml && echo contrib/xml2) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake install -C $bd -j1 DESTDIR="${D}" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed"
+ done
+ rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/"
+ rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1
+
+ dodoc README HISTORY doc/{README.*,TODO,bug.template}
+
+ dodir /etc/eselect/postgresql/slots/${SLOT}
+ cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
+ postgres_ebuilds="\${postgres_ebuilds} ${PF}"
+ postgres_service="postgresql-${SLOT}"
+ __EOF__
+
+ newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
+
+ # Workaround for paludis
+ [ -f "${ROOT}/var/run/postgresql/.keep" ] || keepdir /var/run/postgresql
+ fperms 0770 /var/run/postgresql
+ fowners postgres:postgres /var/run/postgresql
+}
+
+pkg_postinst() {
+ eselect postgresql update
+ [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
+ [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
+
+ ewarn "Please note that the standard location of the socket has changed from /tmp"
+ ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
+ ewarn "the socket."
+ ewarn "This can break applications which have the standard location hard-coded."
+ ewarn "If such an application links against the libpq, please re-emerge it,"
+ ewarn "if that doesn't help or the application accesses the socket without using libpq,"
+ ewarn "please file a bug-report."
+ ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
+
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+ elog "The autovacuum function, which was in contrib, has been moved to the main"
+ elog "PostgreSQL functions starting with 8.1."
+ elog "You can enable it for all clusters in ${ROOT}/etc/postgresql-${SLOT}/postgresql.conf."
+}
+
+pkg_postrm() {
+ eselect postgresql update
+}
+
+pkg_config() {
+ [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
+
+ einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
+ einfo "More information can be found here:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
+ einfo
+ einfo "You can change the directory where the database cluster is being created by setting"
+ einfo "the PGDATA variable."
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ einfo " \"${PG_INITDB_OPTS}\""
+ einfo "and the database cluster will be created in:"
+ einfo " \"${PGDATA}\""
+ einfo "Are you ready to continue? (Y/n)"
+ read answer
+ [ -z $answer ] && answer=Y
+ [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
+
+ if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
+ eerror "The given directory \"${PGDATA}\" already contains a database cluster."
+ die "cluster already exists"
+ fi
+
+ [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
+ einfo "Checking system parameters..."
+
+ if ! use kernel_linux ; then
+ SKIP_SYSTEM_TESTS=yes
+ einfo " Tests not supported on this OS (yet)"
+ fi
+
+ 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 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
+ einfo "Skipped."
+ fi
+
+ einfo "Creating the data directory ..."
+ mkdir -p "${PGDATA}"
+ chown -Rf postgres:postgres "${PGDATA}"
+ chmod 0700 "${PGDATA}"
+
+ einfo "Initializing the database ..."
+
+ su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+
+ if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
+ ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
+ ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
+ fi
+}
+
+src_test() {
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -j1 check \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details."
+
+ einfo "Yes, there are other tests which could be run."
+ einfo "... and no, we don't plan to add/support them."
+ einfo "For now, the main regressions tests will suffice."
+ einfo "If you think other tests are necessary, please submit a"
+ einfo "bug including a patch for this ebuild to enable them."
+}
diff --git a/dev-db/postgresql-server/postgresql-server-8.2.7.ebuild b/dev-db/postgresql-server/postgresql-server-8.2.7.ebuild
new file mode 100644
index 000000000000..118e662d5955
--- /dev/null
+++ b/dev-db/postgresql-server/postgresql-server-8.2.7.ebuild
@@ -0,0 +1,243 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.2.7.ebuild,v 1.1 2008/04/15 09:29:54 dev-zero Exp $
+
+EAPI="1"
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="none"
+inherit eutils multilib toolchain-funcs versionator autotools
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="PostgreSQL server"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="$(get_version_component_range 1-2)"
+IUSE_LINGUAS="
+ linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr
+ linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl
+ linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv
+ linguas_tr linguas_zh_CN linguas_zh_TW"
+IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}"
+
+wanted_languages() {
+ for u in ${IUSE_LINGUAS} ; do
+ use $u && echo ${u#linguas_}
+ done
+}
+
+RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ selinux? ( sec-policy/selinux-postgresql )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )"
+DEPEND="${RDEPEND}
+ xml? ( dev-util/pkgconfig )"
+PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
+
+S="${WORKDIR}/postgresql-${PV}"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-server.patch"
+
+ if hasq test ${FEATURES}; then
+ sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+ else
+ echo "all install:" > "${S}/src/test/regress/GNUmakefile"
+ fi
+
+ eautoconf
+}
+
+src_compile() {
+ # TODO: test if PPC really cannot work with other CFLAGS settings
+ # use ppc && CFLAGS="-pipe -fsigned-char"
+
+ # eval is needed to get along with pg_config quotation of space-rich entities.
+ eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
+ --disable-thread-safety \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with tcl) \
+ --with-includes="/usr/include/postgresql-${SLOT}/" \
+ "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
+ || die "configure failed"
+
+ for bd in . contrib $(use xml && echo contrib/xml2); do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed"
+ done
+}
+
+src_install() {
+ if use perl ; then
+ mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
+ sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
+ "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
+ fi
+
+ for bd in . contrib $(use xml && echo contrib/xml2) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake install -C $bd -j1 DESTDIR="${D}" \
+ PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed"
+ done
+ rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/"
+ rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1
+
+ dodoc README HISTORY doc/{README.*,TODO,bug.template}
+
+ dodir /etc/eselect/postgresql/slots/${SLOT}
+ cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
+ postgres_ebuilds="\${postgres_ebuilds} ${PF}"
+ postgres_service="postgresql-${SLOT}"
+ __EOF__
+
+ newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
+
+ # Workaround for paludis
+ [ -f "${ROOT}/var/run/postgresql/.keep" ] || keepdir /var/run/postgresql
+ fperms 0770 /var/run/postgresql
+ fowners postgres:postgres /var/run/postgresql
+}
+
+pkg_postinst() {
+ eselect postgresql update
+ [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
+ [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
+
+ ewarn "Please note that the standard location of the socket has changed from /tmp"
+ ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
+ ewarn "the socket."
+ ewarn "This can break applications which have the standard location hard-coded."
+ ewarn "If such an application links against the libpq, please re-emerge it,"
+ ewarn "if that doesn't help or the application accesses the socket without using libpq,"
+ ewarn "please file a bug-report."
+ ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
+
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+ elog "The autovacuum function, which was in contrib, has been moved to the main"
+ elog "PostgreSQL functions starting with 8.1."
+ elog "You can enable it for all clusters in ${ROOT}/etc/postgresql-${SLOT}/postgresql.conf."
+}
+
+pkg_postrm() {
+ eselect postgresql update
+}
+
+pkg_config() {
+ [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
+
+ einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
+ einfo "More information can be found here:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
+ einfo
+ einfo "You can change the directory where the database cluster is being created by setting"
+ einfo "the PGDATA variable."
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ einfo " \"${PG_INITDB_OPTS}\""
+ einfo "and the database cluster will be created in:"
+ einfo " \"${PGDATA}\""
+ einfo "Are you ready to continue? (Y/n)"
+ read answer
+ [ -z $answer ] && answer=Y
+ [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
+
+ if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
+ eerror "The given directory \"${PGDATA}\" already contains a database cluster."
+ die "cluster already exists"
+ fi
+
+ [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
+ einfo "Checking system parameters..."
+
+ if ! use kernel_linux ; then
+ SKIP_SYSTEM_TESTS=yes
+ einfo " Tests not supported on this OS (yet)"
+ fi
+
+ 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 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
+ einfo "Skipped."
+ fi
+
+ einfo "Creating the data directory ..."
+ mkdir -p "${PGDATA}"
+ chown -Rf postgres:postgres "${PGDATA}"
+ chmod 0700 "${PGDATA}"
+
+ einfo "Initializing the database ..."
+
+ su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+
+ if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
+ ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
+ ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
+ fi
+}
+
+src_test() {
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -j1 check \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details."
+
+ einfo "Yes, there are other tests which could be run."
+ einfo "... and no, we don't plan to add/support them."
+ einfo "For now, the main regressions tests will suffice."
+ einfo "If you think other tests are necessary, please submit a"
+ einfo "bug including a patch for this ebuild to enable them."
+}
diff --git a/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild b/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild
new file mode 100644
index 000000000000..33a306592ac8
--- /dev/null
+++ b/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild
@@ -0,0 +1,248 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild,v 1.1 2008/04/15 09:29:54 dev-zero Exp $
+
+EAPI="1"
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="none"
+inherit eutils multilib toolchain-funcs versionator autotools
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="PostgreSQL server"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="$(get_version_component_range 1-2)"
+IUSE_LINGUAS="
+ linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr
+ linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl
+ linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv
+ linguas_tr linguas_zh_CN linguas_zh_TW"
+IUSE="doc perl python selinux tcl uuid xml nls kernel_linux ${IUSE_LINGUAS}"
+
+wanted_languages() {
+ for u in ${IUSE_LINGUAS} ; do
+ use $u && echo ${u#linguas_}
+ done
+}
+
+RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ selinux? ( sec-policy/selinux-postgresql )
+ tcl? ( >=dev-lang/tcl-8 )
+ uuid? ( dev-libs/ossp-uuid )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )"
+DEPEND="${RDEPEND}
+ xml? ( dev-util/pkgconfig )"
+PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
+
+S="${WORKDIR}/postgresql-${PV}"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \
+ "${FILESDIR}/postgresql-${SLOT}-server.patch"
+
+ if hasq test ${FEATURES}; then
+ sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+ else
+ echo "all install:" > "${S}/src/test/regress/GNUmakefile"
+ fi
+
+ eautoconf
+}
+
+src_compile() {
+ # TODO: test if PPC really cannot work with other CFLAGS settings
+ # use ppc && CFLAGS="-pipe -fsigned-char"
+
+ # eval is needed to get along with pg_config quotation of space-rich entities.
+ eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
+ --disable-thread-safety \
+ $(use_with perl) \
+ $(use_with python) \
+ $(use_with tcl) \
+ $(use_with xml libxml) \
+ $(use_with xml libxslt) \
+ $(use_with uuid ossp-uuid) \
+ --with-system-tzdata="/usr/share/zoneinfo" \
+ --with-includes="/usr/include/postgresql-${SLOT}/" \
+ "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
+ || die "configure failed"
+
+ for bd in . contrib $(use xml && echo contrib/xml2); do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed"
+ done
+}
+
+src_install() {
+ if use perl ; then
+ mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
+ sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
+ "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
+ fi
+
+ for bd in . contrib $(use xml && echo contrib/xml2) ; do
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake install -C $bd -j1 DESTDIR="${D}" \
+ PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed"
+ done
+ rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/"
+ rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1
+
+ dodoc README HISTORY doc/{README.*,TODO,bug.template}
+
+ dodir /etc/eselect/postgresql/slots/${SLOT}
+ cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
+ postgres_ebuilds="\${postgres_ebuilds} ${PF}"
+ postgres_service="postgresql-${SLOT}"
+ __EOF__
+
+ newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
+
+ # Workaround for paludis
+ [ -f "${ROOT}/var/run/postgresql/.keep" ] || keepdir /var/run/postgresql
+ fperms 0770 /var/run/postgresql
+ fowners postgres:postgres /var/run/postgresql
+}
+
+pkg_postinst() {
+ eselect postgresql update
+ [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
+ [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
+
+ ewarn "Please note that the standard location of the socket has changed from /tmp"
+ ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
+ ewarn "the socket."
+ ewarn "This can break applications which have the standard location hard-coded."
+ ewarn "If such an application links against the libpq, please re-emerge it,"
+ ewarn "if that doesn't help or the application accesses the socket without using libpq,"
+ ewarn "please file a bug-report."
+ ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
+
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+ elog "The autovacuum function, which was in contrib, has been moved to the main"
+ elog "PostgreSQL functions starting with 8.1."
+ elog "You can enable it for all clusters in ${ROOT}/etc/postgresql-${SLOT}/postgresql.conf."
+}
+
+pkg_postrm() {
+ eselect postgresql update
+}
+
+pkg_config() {
+ [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
+
+ einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
+ einfo "More information can be found here:"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
+ einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
+ einfo
+ einfo "You can change the directory where the database cluster is being created by setting"
+ einfo "the PGDATA variable."
+ einfo
+ einfo "PG_INITDB_OPTS is currently set to:"
+ einfo " \"${PG_INITDB_OPTS}\""
+ einfo "and the database cluster will be created in:"
+ einfo " \"${PGDATA}\""
+ einfo "Are you ready to continue? (Y/n)"
+ read answer
+ [ -z $answer ] && answer=Y
+ [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
+
+ if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
+ eerror "The given directory \"${PGDATA}\" already contains a database cluster."
+ die "cluster already exists"
+ fi
+
+ [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
+ einfo "Checking system parameters..."
+
+ if ! use kernel_linux ; then
+ SKIP_SYSTEM_TESTS=yes
+ einfo " Tests not supported on this OS (yet)"
+ fi
+
+ 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 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
+ einfo "Skipped."
+ fi
+
+ einfo "Creating the data directory ..."
+ mkdir -p "${PGDATA}"
+ chown -Rf postgres:postgres "${PGDATA}"
+ chmod 0700 "${PGDATA}"
+
+ einfo "Initializing the database ..."
+
+ su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+
+ if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
+ ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
+ ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
+ fi
+}
+
+src_test() {
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
+ emake -j1 check \
+ PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
+ NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details."
+
+ einfo "Yes, there are other tests which could be run."
+ einfo "... and no, we don't plan to add/support them."
+ einfo "For now, the main regressions tests will suffice."
+ einfo "If you think other tests are necessary, please submit a"
+ einfo "bug including a patch for this ebuild to enable them."
+}