summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Longinotti <chtekk@gentoo.org>2006-11-07 22:48:22 +0000
committerLuca Longinotti <chtekk@gentoo.org>2006-11-07 22:48:22 +0000
commit52e49891c469858242a3fe17733d8051de1ca108 (patch)
tree85e236873bb2e820b87d71211798527d84283272 /dev-db/postgresql
parentNew generation libpq/pgsql ebuilds. (diff)
downloadgentoo-2-52e49891c469858242a3fe17733d8051de1ca108.tar.gz
gentoo-2-52e49891c469858242a3fe17733d8051de1ca108.tar.bz2
gentoo-2-52e49891c469858242a3fe17733d8051de1ca108.zip
New generation libpq/pgsql ebuilds.
(Portage version: 2.1.2_rc1-r4)
Diffstat (limited to 'dev-db/postgresql')
-rw-r--r--dev-db/postgresql/ChangeLog27
-rw-r--r--dev-db/postgresql/files/digest-postgresql-7.3.1612
-rw-r--r--dev-db/postgresql/files/digest-postgresql-7.4.1412
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.0.912
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.1.512
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.conf-7.416
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.conf-8.016
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.init-7.428
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.init-8.028
-rw-r--r--dev-db/postgresql/files/postgresql-7.3.16-cubeparse.patch36
-rw-r--r--dev-db/postgresql/files/postgresql-7.3.16-gentoo.patch63
-rw-r--r--dev-db/postgresql/files/postgresql-7.4.14-gentoo.patch63
-rw-r--r--dev-db/postgresql/files/postgresql-7.4.14-hppa-testandset.patch50
-rw-r--r--dev-db/postgresql/files/postgresql-8.0.9-gentoo.patch51
-rw-r--r--dev-db/postgresql/files/postgresql-8.0.9-sh.patch34
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.5-gentoo.patch51
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.5-regress_fix.patch33
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.5-regress_su.patch116
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.5-sh.patch34
-rw-r--r--dev-db/postgresql/files/postgresql.conf-7.319
-rw-r--r--dev-db/postgresql/files/postgresql.conf-7.419
-rw-r--r--dev-db/postgresql/files/postgresql.conf-8.019
-rw-r--r--dev-db/postgresql/files/postgresql.conf-8.119
-rw-r--r--dev-db/postgresql/files/postgresql.init-7.324
-rw-r--r--dev-db/postgresql/files/postgresql.init-7.424
-rw-r--r--dev-db/postgresql/files/postgresql.init-8.024
-rw-r--r--dev-db/postgresql/files/postgresql.init-8.124
-rw-r--r--dev-db/postgresql/postgresql-7.3.15-r1.ebuild4
-rw-r--r--dev-db/postgresql/postgresql-7.3.16.ebuild240
-rw-r--r--dev-db/postgresql/postgresql-7.4.14.ebuild244
-rw-r--r--dev-db/postgresql/postgresql-8.0.9.ebuild240
-rw-r--r--dev-db/postgresql/postgresql-8.1.5.ebuild245
32 files changed, 1714 insertions, 125 deletions
diff --git a/dev-db/postgresql/ChangeLog b/dev-db/postgresql/ChangeLog
index a1a9267a6ac8..7cc3e1d82759 100644
--- a/dev-db/postgresql/ChangeLog
+++ b/dev-db/postgresql/ChangeLog
@@ -1,6 +1,31 @@
# ChangeLog for dev-db/postgresql
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.293 2006/10/24 17:41:29 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.294 2006/11/07 22:48:22 chtekk Exp $
+
+*postgresql-8.1.5 (07 Nov 2006)
+*postgresql-8.0.9 (07 Nov 2006)
+*postgresql-7.4.14 (07 Nov 2006)
+*postgresql-7.3.16 (07 Nov 2006)
+
+ 07 Nov 2006; Luca Longinotti <chtekk@gentoo.org>
+ files/postgresql.conf-7.3, files/postgresql.init-7.3,
+ +files/postgresql-7.3.16-cubeparse.patch,
+ +files/postgresql-7.3.16-gentoo.patch, files/pg_autovacuum.conf-7.4,
+ files/pg_autovacuum.init-7.4, files/postgresql.conf-7.4,
+ files/postgresql.init-7.4, +files/postgresql-7.4.14-gentoo.patch,
+ +files/postgresql-7.4.14-hppa-testandset.patch,
+ files/pg_autovacuum.conf-8.0, files/pg_autovacuum.init-8.0,
+ files/postgresql.conf-8.0, files/postgresql.init-8.0,
+ +files/postgresql-8.0.9-gentoo.patch, +files/postgresql-8.0.9-sh.patch,
+ files/postgresql.conf-8.1, files/postgresql.init-8.1,
+ +files/postgresql-8.1.5-gentoo.patch,
+ +files/postgresql-8.1.5-regress_fix.patch,
+ +files/postgresql-8.1.5-regress_su.patch,
+ +files/postgresql-8.1.5-sh.patch, -postgresql-7.3.11.ebuild,
+ postgresql-7.3.15-r1.ebuild, +postgresql-7.3.16.ebuild,
+ +postgresql-7.4.14.ebuild, +postgresql-8.0.9.ebuild,
+ -postgresql-8.1.4.ebuild, +postgresql-8.1.5.ebuild:
+ New PostgreSQL ebuilds.
24 Oct 2006; Roy Marples <uberlord@gentoo.org> postgresql-8.1.4.ebuild:
Added ~sparc-fbsd keyword.
diff --git a/dev-db/postgresql/files/digest-postgresql-7.3.16 b/dev-db/postgresql/files/digest-postgresql-7.3.16
new file mode 100644
index 000000000000..d68088475ae1
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-7.3.16
@@ -0,0 +1,12 @@
+MD5 ae269400f68118233e9e65b4c2c93a68 postgresql-base-7.3.16.tar.bz2 5696231
+RMD160 aaf7e4743bc67c0a45d8d44cef840283e7ead6f9 postgresql-base-7.3.16.tar.bz2 5696231
+SHA256 96046fc13596e4d9f7a4dcd5882fed51ec5905760cc828594443272a69c140e5 postgresql-base-7.3.16.tar.bz2 5696231
+MD5 12123bfca15f077260a6fbcd952abbf2 postgresql-docs-7.3.16.tar.bz2 2361886
+RMD160 ae36bf748e8a8a0b4842ddab48c2d8a2471b2940 postgresql-docs-7.3.16.tar.bz2 2361886
+SHA256 2d8cc0d745a3f8edd773a06c462f98c143388060feb1775e97ecf85bb5260b2f postgresql-docs-7.3.16.tar.bz2 2361886
+MD5 8025d8314993b9e57d0f308e01c37b40 postgresql-opt-7.3.16.tar.bz2 341908
+RMD160 00e0f059910eed3021ba5b096e86bdc6878c34d6 postgresql-opt-7.3.16.tar.bz2 341908
+SHA256 0e1ab00b1439c5930b6c74ed5c4382c01fdb54434857ac3c1599d32fcce2c8d1 postgresql-opt-7.3.16.tar.bz2 341908
+MD5 9da7ff0ef77b87053804838a1f40f15a postgresql-test-7.3.16.tar.bz2 891104
+RMD160 7510ed474d4c86610c14c232cf5be13c4ca0b32b postgresql-test-7.3.16.tar.bz2 891104
+SHA256 5844984770b326cfc62580d88f878196e304867fa339925fef20c017bb298d56 postgresql-test-7.3.16.tar.bz2 891104
diff --git a/dev-db/postgresql/files/digest-postgresql-7.4.14 b/dev-db/postgresql/files/digest-postgresql-7.4.14
new file mode 100644
index 000000000000..14709e723e84
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-7.4.14
@@ -0,0 +1,12 @@
+MD5 8fb231e5cdf7fe4d8954edaa63fd9410 postgresql-base-7.4.14.tar.bz2 6575201
+RMD160 c5b8ecd20ad2783c3f254f0e7402aab9ad722d0a postgresql-base-7.4.14.tar.bz2 6575201
+SHA256 5a34fcd56d2d8eebcd2728e5971c0d39d2971dc25e49d88bfeb84d69b5e8ebc9 postgresql-base-7.4.14.tar.bz2 6575201
+MD5 213c668f072aa56c77f85a23d11ad0ab postgresql-docs-7.4.14.tar.bz2 2427724
+RMD160 dd67ae2c4552986ced80d1ba52df50a5ae63db9b postgresql-docs-7.4.14.tar.bz2 2427724
+SHA256 6739dcb6876e1f76933f88feae0b7d0a5e528e9677dac4175e3223ef379ed789 postgresql-docs-7.4.14.tar.bz2 2427724
+MD5 5ad27f2d9673dcabaaad7729a6838cc2 postgresql-opt-7.4.14.tar.bz2 333417
+RMD160 a6279f5b9d52f72ce786bc468c114befb5a1f29a postgresql-opt-7.4.14.tar.bz2 333417
+SHA256 e670d22812c50512807edd692d867e2b62c6b79f9d7b84cad56ef038cc12475d postgresql-opt-7.4.14.tar.bz2 333417
+MD5 3e7fccb8c02e4b4c2822ea5e5d054f07 postgresql-test-7.4.14.tar.bz2 902074
+RMD160 c6e1f57c77815b5395882cd482ef8bc952adabbf postgresql-test-7.4.14.tar.bz2 902074
+SHA256 39c87c0227f8c757d29141bb8c24e2a95d3a06d9bc459667fdee4d0028d6d12d postgresql-test-7.4.14.tar.bz2 902074
diff --git a/dev-db/postgresql/files/digest-postgresql-8.0.9 b/dev-db/postgresql/files/digest-postgresql-8.0.9
new file mode 100644
index 000000000000..f2e11e02313b
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.0.9
@@ -0,0 +1,12 @@
+MD5 f9a044227ad6dc9c937d4853100733cb postgresql-base-8.0.9.tar.bz2 7824961
+RMD160 40cbea0b0a3a0f67670dfbe1670e08b48dbb1999 postgresql-base-8.0.9.tar.bz2 7824961
+SHA256 8ed190ee5468f3685a1edbc5279490819ffa6fe64f1b6f0139bdbec365852417 postgresql-base-8.0.9.tar.bz2 7824961
+MD5 0529eb29ac2c248a3b244b7bfc007456 postgresql-docs-8.0.9.tar.bz2 2262698
+RMD160 55df79bfc347147c33db925a1138c2341043f887 postgresql-docs-8.0.9.tar.bz2 2262698
+SHA256 b55d4a77c0c3b0f42c7233c08112b884e1463157160007efd70a63806ede632b postgresql-docs-8.0.9.tar.bz2 2262698
+MD5 363e009214bfde8235d900da09c7c675 postgresql-opt-8.0.9.tar.bz2 134706
+RMD160 be148e079c20c13aec1767180d993933b91c2116 postgresql-opt-8.0.9.tar.bz2 134706
+SHA256 007d5cded329dfbcc91b4f1d1ddb9473efb4316b1621294446ee611065393020 postgresql-opt-8.0.9.tar.bz2 134706
+MD5 8992a878fe5aa32e3da7fb84270614db postgresql-test-8.0.9.tar.bz2 931363
+RMD160 ae38c2225daff32449ebe6b483096f2f35aa8067 postgresql-test-8.0.9.tar.bz2 931363
+SHA256 f2b81b3cf7ade17a748fa84570c295817d82fd05b53d2e0fb9d9e922b0c613ea postgresql-test-8.0.9.tar.bz2 931363
diff --git a/dev-db/postgresql/files/digest-postgresql-8.1.5 b/dev-db/postgresql/files/digest-postgresql-8.1.5
new file mode 100644
index 000000000000..ac72d06c9b7b
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.1.5
@@ -0,0 +1,12 @@
+MD5 30a42fd5fc5326edc217e28651e5053b postgresql-base-8.1.5.tar.bz2 8044522
+RMD160 3460f38b720ce3a9687052d5523bcbd027655d6e postgresql-base-8.1.5.tar.bz2 8044522
+SHA256 cb878499848aa8abb82f1ae79574923174851b0396a5befa31f49089a3abb4df postgresql-base-8.1.5.tar.bz2 8044522
+MD5 d104e7e645ea36407831ca59470c7a12 postgresql-docs-8.1.5.tar.bz2 2489400
+RMD160 a29a5d1738f6f776597d162d9fc6d69805c74943 postgresql-docs-8.1.5.tar.bz2 2489400
+SHA256 01c0a848b0016598adfcebea74960340edf80fc037051d106b62bea14e1cd0c9 postgresql-docs-8.1.5.tar.bz2 2489400
+MD5 bcd3eec7cfc759dbfdde4f9e8fa07d27 postgresql-opt-8.1.5.tar.bz2 144784
+RMD160 5ac9b1ffdf1357316ceb1736f7b9be3ee339be3b postgresql-opt-8.1.5.tar.bz2 144784
+SHA256 4fe0dc14e02d65516348ec0e90633be2a3ada002c151fca8f2e7eba6556c8b1c postgresql-opt-8.1.5.tar.bz2 144784
+MD5 b3e050a0af7998d78f928b96d95fa6d7 postgresql-test-8.1.5.tar.bz2 947271
+RMD160 644b352354743eb5250bf422c62e1f2c340c1ed2 postgresql-test-8.1.5.tar.bz2 947271
+SHA256 60ed8d466a66dfe72994f7c8e45324e81e8ce6b91343eee07df5939f10559166 postgresql-test-8.1.5.tar.bz2 947271
diff --git a/dev-db/postgresql/files/pg_autovacuum.conf-7.4 b/dev-db/postgresql/files/pg_autovacuum.conf-7.4
index f342ebfd2a47..45d436d9cfcf 100644
--- a/dev-db/postgresql/files/pg_autovacuum.conf-7.4
+++ b/dev-db/postgresql/files/pg_autovacuum.conf-7.4
@@ -1,14 +1,14 @@
-# The PostgreSQL user is:
-PGUSER=postgres
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PG_AUTOVACUUM_LOG="/var/lib/postgresql/data/pg_autovacuum.log"
-# LOG file is:
-PG_AUTOVACUUM_LOG=/var/lib/postgresql/data/pg_autovacuum.log
+# PostgreSQL user
+PGUSER="postgres"
# See the pg_autovacuum documentation for the details of how these
# parameters affect pg_autovacuum's aggressiveness.
-VACUUM_BASE=1000
-VACUUM_SCALE=2
+VACUUM_BASE="1000"
+VACUUM_SCALE="2"
-SLEEP_BASE=300
-SLEEP_SCALE=2
+SLEEP_BASE="300"
+SLEEP_SCALE="2"
diff --git a/dev-db/postgresql/files/pg_autovacuum.conf-8.0 b/dev-db/postgresql/files/pg_autovacuum.conf-8.0
index f342ebfd2a47..45d436d9cfcf 100644
--- a/dev-db/postgresql/files/pg_autovacuum.conf-8.0
+++ b/dev-db/postgresql/files/pg_autovacuum.conf-8.0
@@ -1,14 +1,14 @@
-# The PostgreSQL user is:
-PGUSER=postgres
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PG_AUTOVACUUM_LOG="/var/lib/postgresql/data/pg_autovacuum.log"
-# LOG file is:
-PG_AUTOVACUUM_LOG=/var/lib/postgresql/data/pg_autovacuum.log
+# PostgreSQL user
+PGUSER="postgres"
# See the pg_autovacuum documentation for the details of how these
# parameters affect pg_autovacuum's aggressiveness.
-VACUUM_BASE=1000
-VACUUM_SCALE=2
+VACUUM_BASE="1000"
+VACUUM_SCALE="2"
-SLEEP_BASE=300
-SLEEP_SCALE=2
+SLEEP_BASE="300"
+SLEEP_SCALE="2"
diff --git a/dev-db/postgresql/files/pg_autovacuum.init-7.4 b/dev-db/postgresql/files/pg_autovacuum.init-7.4
index 812b8a8cf666..2ad1ac621683 100644
--- a/dev-db/postgresql/files/pg_autovacuum.init-7.4
+++ b/dev-db/postgresql/files/pg_autovacuum.init-7.4
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/pg_autovacuum.init-7.4,v 1.1 2006/07/30 22:30:54 chtekk Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/pg_autovacuum.init-7.4,v 1.2 2006/11/07 22:48:22 chtekk Exp $
depend() {
need postgresql logger
@@ -9,11 +9,12 @@ depend() {
start() {
ebegin "Starting pg_autovacuum"
- echo ""
- echo -n "Waiting max. 10 sec. for postgresql to start "
+
+ echo
+ echo -n "Waiting max. 20 sec. for PostgreSQL to start "
CONTINUE=0
TOO_LONG=0
- while [ "$CONTINUE" -eq 0 ] && [ $TOO_LONG -lt 10 ]
+ while [ "$CONTINUE" -eq 0 ] && [ $TOO_LONG -lt 20 ]
do
psql -U $PGUSER -d template1 -c "SELECT 1" 1> /dev/null 2> /dev/null
if [ "$?" -eq 0 ]
@@ -25,20 +26,22 @@ start() {
sleep 1
fi
done
+
start-stop-daemon -o --chuid $PGUSER --start --quiet --exec /usr/bin/pg_autovacuum -- -D -v $VACUUM_BASE -V $VACUUM_SCALE -s $SLEEP_BASE -S $SLEEP_SCALE -L $PG_AUTOVACUUM_LOG
sleep 1
pidof /usr/bin/pg_autovacuum > /dev/null
- if [ $? -eq 0 ]; then
+ if [ $? -eq 0 ] ; then
eend 0
else
- eerror ""
- eerror "Please see log file: $PG_AUTOVACUUM_LOG"
- eerror "You may need to add following lines in /var/lib/postgresql/data/postgresql.conf and restart PostgreSQL."
+ eerror
+ eerror "Please check the $PG_AUTOVACUUM_LOG log file for errors."
+ eerror "You may need to add the following lines to /var/lib/postgresql/data/postgresql.conf and restart PostgreSQL."
eerror " stats_start_collector = true"
eerror " stats_row_level = true"
-
- eerror "Please read ___DOCDIR___/contrib/README.pg_autovacuum for details."
+ eerror
+ eerror "Please read ___DOCDIR___/contrib/README.pg_autovacuum for details!"
+ eerror
eend 1
fi
}
@@ -46,6 +49,5 @@ start() {
stop() {
ebegin "Stopping pg_autovacuum"
start-stop-daemon --stop --quiet --exec /usr/bin/pg_autovacuum
- result=$?
- eend $result
+ eend $?
}
diff --git a/dev-db/postgresql/files/pg_autovacuum.init-8.0 b/dev-db/postgresql/files/pg_autovacuum.init-8.0
index 2cef27845156..2478fe96471a 100644
--- a/dev-db/postgresql/files/pg_autovacuum.init-8.0
+++ b/dev-db/postgresql/files/pg_autovacuum.init-8.0
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/pg_autovacuum.init-8.0,v 1.1 2006/07/30 22:30:54 chtekk Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/pg_autovacuum.init-8.0,v 1.2 2006/11/07 22:48:22 chtekk Exp $
depend() {
need postgresql logger
@@ -9,11 +9,12 @@ depend() {
start() {
ebegin "Starting pg_autovacuum"
- echo ""
- echo -n "Waiting max. 10 sec. for postgresql to start "
+
+ echo
+ echo -n "Waiting max. 20 sec. for PostgreSQL to start "
CONTINUE=0
TOO_LONG=0
- while [ "$CONTINUE" -eq 0 ] && [ $TOO_LONG -lt 10 ]
+ while [ "$CONTINUE" -eq 0 ] && [ $TOO_LONG -lt 20 ]
do
psql -U $PGUSER -d template1 -c "SELECT 1" 1> /dev/null 2> /dev/null
if [ "$?" -eq 0 ]
@@ -25,20 +26,22 @@ start() {
sleep 1
fi
done
+
start-stop-daemon -o --chuid $PGUSER --start --quiet --exec /usr/bin/pg_autovacuum -- -D -v $VACUUM_BASE -V $VACUUM_SCALE -s $SLEEP_BASE -S $SLEEP_SCALE -L $PG_AUTOVACUUM_LOG
sleep 1
pidof /usr/bin/pg_autovacuum > /dev/null
- if [ $? -eq 0 ]; then
+ if [ $? -eq 0 ] ; then
eend 0
else
- eerror ""
- eerror "Please see log file: $PG_AUTOVACUUM_LOG"
- eerror "You may need to add following lines in /var/lib/postgresql/data/postgresql.conf and restart PostgreSQL."
+ eerror
+ eerror "Please check the $PG_AUTOVACUUM_LOG log file for errors."
+ eerror "You may need to add the following lines to /var/lib/postgresql/data/postgresql.conf and restart PostgreSQL."
eerror " stats_start_collector = true"
eerror " stats_row_level = true"
-
- eerror "Please read ___DOCDIR___/contrib/README.pg_autovacuum for details."
+ eerror
+ eerror "Please read ___DOCDIR___/contrib/README.pg_autovacuum for details!"
+ eerror
eend 1
fi
}
@@ -46,6 +49,5 @@ start() {
stop() {
ebegin "Stopping pg_autovacuum"
start-stop-daemon --stop --quiet --exec /usr/bin/pg_autovacuum
- result=$?
- eend $result
+ eend $?
}
diff --git a/dev-db/postgresql/files/postgresql-7.3.16-cubeparse.patch b/dev-db/postgresql/files/postgresql-7.3.16-cubeparse.patch
new file mode 100644
index 000000000000..705e073c8e45
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-7.3.16-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/files/postgresql-7.3.16-gentoo.patch b/dev-db/postgresql/files/postgresql-7.3.16-gentoo.patch
new file mode 100644
index 000000000000..079f7c6a9f50
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-7.3.16-gentoo.patch
@@ -0,0 +1,63 @@
+diff -Nru postgresql-7.3.16.orig/configure postgresql-7.3.16/configure
+--- postgresql-7.3.16.orig/configure 2006-11-05 13:20:08.000000000 +0100
++++ postgresql-7.3.16/configure 2006-11-05 14:10:03.000000000 +0100
+@@ -5871,7 +5871,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ pgac_cv_check_readline=no
+-for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
++for pgac_lib in "" " -lncurses" " -lcurses" ; do
+ for pgac_rllib in -lreadline -ledit ; do
+ pgac_save_LIBS=$LIBS
+ LIBS="${pgac_rllib}${pgac_lib} $LIBS"
+diff -Nru postgresql-7.3.16.orig/src/bin/Makefile postgresql-7.3.16/src/bin/Makefile
+--- postgresql-7.3.16.orig/src/bin/Makefile 2006-11-05 13:20:09.000000000 +0100
++++ postgresql-7.3.16/src/bin/Makefile 2006-11-05 15:46:42.000000000 +0100
+@@ -14,7 +14,7 @@
+ include $(top_builddir)/src/Makefile.global
+
+ DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \
+- psql scripts pg_config pg_controldata pg_resetxlog \
++ psql scripts pg_controldata pg_resetxlog \
+ pg_encoding
+
+ ifeq ($(with_tcl), yes)
+diff -Nru postgresql-7.3.16.orig/src/interfaces/Makefile postgresql-7.3.16/src/interfaces/Makefile
+--- postgresql-7.3.16.orig/src/interfaces/Makefile 2006-11-05 13:20:09.000000000 +0100
++++ postgresql-7.3.16/src/interfaces/Makefile 2006-11-05 14:10:03.000000000 +0100
+@@ -12,7 +12,7 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := libpq ecpg
++DIRS := ecpg
+
+ ALLDIRS := $(DIRS) libpgtcl python jdbc
+
+diff -Nru postgresql-7.3.16.orig/src/Makefile postgresql-7.3.16/src/Makefile
+--- postgresql-7.3.16.orig/src/Makefile 2006-11-05 13:20:09.000000000 +0100
++++ postgresql-7.3.16/src/Makefile 2006-11-05 14:10:03.000000000 +0100
+@@ -17,7 +17,6 @@
+ $(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 $@
+@@ -28,7 +27,6 @@
+ clean:
+ $(MAKE) -C port $@
+ $(MAKE) -C backend $@
+- $(MAKE) -C include $@
+ $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+@@ -39,7 +37,6 @@
+ distclean maintainer-clean:
+ -$(MAKE) -C port $@
+ -$(MAKE) -C backend $@
+- -$(MAKE) -C include $@
+ -$(MAKE) -C interfaces $@
+ -$(MAKE) -C bin $@
+ -$(MAKE) -C pl $@
diff --git a/dev-db/postgresql/files/postgresql-7.4.14-gentoo.patch b/dev-db/postgresql/files/postgresql-7.4.14-gentoo.patch
new file mode 100644
index 000000000000..e50f94adaaad
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-7.4.14-gentoo.patch
@@ -0,0 +1,63 @@
+diff -Nru postgresql-7.4.14.orig/configure postgresql-7.4.14/configure
+--- postgresql-7.4.14.orig/configure 2006-11-05 13:20:18.000000000 +0100
++++ postgresql-7.4.14/configure 2006-11-05 15:48:27.000000000 +0100
+@@ -6003,7 +6003,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ pgac_cv_check_readline=no
+-for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
++for pgac_lib in "" " -lncurses" " -lcurses" ; do
+ for pgac_rllib in -lreadline -ledit ; do
+ pgac_save_LIBS=$LIBS
+ LIBS="${pgac_rllib}${pgac_lib} $LIBS"
+diff -Nru postgresql-7.4.14.orig/src/bin/Makefile postgresql-7.4.14/src/bin/Makefile
+--- postgresql-7.4.14.orig/src/bin/Makefile 2006-11-05 13:20:18.000000000 +0100
++++ postgresql-7.4.14/src/bin/Makefile 2006-11-05 15:49:06.000000000 +0100
+@@ -14,7 +14,7 @@
+ include $(top_builddir)/src/Makefile.global
+
+ DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \
+- psql scripts pg_config pg_controldata pg_resetxlog \
++ psql scripts pg_controldata pg_resetxlog \
+ pg_encoding
+
+ ifeq ($(with_tcl), yes)
+diff -Nru postgresql-7.4.14.orig/src/interfaces/Makefile postgresql-7.4.14/src/interfaces/Makefile
+--- postgresql-7.4.14.orig/src/interfaces/Makefile 2006-11-05 13:20:18.000000000 +0100
++++ postgresql-7.4.14/src/interfaces/Makefile 2006-11-05 15:48:27.000000000 +0100
+@@ -12,7 +12,7 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := libpq ecpg
++DIRS := ecpg
+
+ ALLDIRS := $(DIRS) libpgtcl jdbc
+
+diff -Nru postgresql-7.4.14.orig/src/Makefile postgresql-7.4.14/src/Makefile
+--- postgresql-7.4.14.orig/src/Makefile 2006-11-05 13:20:18.000000000 +0100
++++ postgresql-7.4.14/src/Makefile 2006-11-05 15:48:27.000000000 +0100
+@@ -17,7 +17,6 @@
+ $(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 $@
+@@ -28,7 +27,6 @@
+ clean:
+ $(MAKE) -C port $@
+ $(MAKE) -C backend $@
+- $(MAKE) -C include $@
+ $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+@@ -39,7 +37,6 @@
+ distclean maintainer-clean:
+ -$(MAKE) -C port $@
+ -$(MAKE) -C backend $@
+- -$(MAKE) -C include $@
+ -$(MAKE) -C interfaces $@
+ -$(MAKE) -C bin $@
+ -$(MAKE) -C pl $@
diff --git a/dev-db/postgresql/files/postgresql-7.4.14-hppa-testandset.patch b/dev-db/postgresql/files/postgresql-7.4.14-hppa-testandset.patch
new file mode 100644
index 000000000000..d5f916d455eb
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-7.4.14-hppa-testandset.patch
@@ -0,0 +1,50 @@
+--- postgresql-7.4.12.orig/src/include/port/linux.h 2003-10-26 01:41:10.000000000 +0000
++++ postgresql-7.4.12/src/include/port/linux.h 2004-01-09 20:22:50.000000000 +0000
+@@ -3,6 +3,11 @@
+
+ #define HAS_TEST_AND_SET
+
++#elif defined(__hppa__)
++typedef struct { int sema[4]; } slock_t;
++
++#define HAS_TEST_AND_SET
++
+ #elif defined(__sparc__)
+ typedef unsigned char slock_t;
+
+--- postgresql-7.4.12.orig/src/include/storage/s_lock.h 2003-11-04 09:43:56.000000000 +0000
++++ postgresql-7.4.12/src/include/storage/s_lock.h 2004-01-09 20:12:15.000000000 +0000
+@@ -112,6 +112,33 @@
+
+ #endif /* __i386__ || __x86_64__ */
+
++#if defined(__hppa__) || defined(__hppa)
++#define TAS(lock) tas(lock)
++
++#define __ldcw(a) ({ \
++ unsigned int __ret; \
++ __asm__ __volatile__("ldcw 0(%2),%0" \
++ : "=r" (__ret), "=m" (*(a)) : "r" (a)); \
++ __ret; \
++})
++
++#define __PA_LDCW_ALIGNMENT 16
++#define __ldcw_align(a) ({ \
++ volatile unsigned int __ret = (unsigned int) a; \
++ if ((__ret & ~(__PA_LDCW_ALIGNMENT - 1)) < (unsigned int) a) \
++ __ret = (__ret & ~(__PA_LDCW_ALIGNMENT - 1)) + __PA_LDCW_ALIGNMENT; \
++ (unsigned int *) __ret; \
++})
++
++static __inline__ int
++tas(volatile slock_t *lock)
++{
++ volatile unsigned int *a = __ldcw_align (lock);
++ return (__ldcw(a) == 0);
++}
++
++#endif /* __hppa__ || __hppa */
++
+
+ /* Intel Itanium */
+ #if defined(__ia64__) || defined(__ia64)
diff --git a/dev-db/postgresql/files/postgresql-8.0.9-gentoo.patch b/dev-db/postgresql/files/postgresql-8.0.9-gentoo.patch
new file mode 100644
index 000000000000..f1308ee0e898
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.0.9-gentoo.patch
@@ -0,0 +1,51 @@
+diff -Nru postgresql-8.0.9.orig/src/bin/Makefile postgresql-8.0.9/src/bin/Makefile
+--- postgresql-8.0.9.orig/src/bin/Makefile 2006-11-05 13:20:26.000000000 +0100
++++ postgresql-8.0.9/src/bin/Makefile 2006-11-05 15:50:05.000000000 +0100
+@@ -14,7 +14,7 @@
+ include $(top_builddir)/src/Makefile.global
+
+ DIRS := initdb ipcclean pg_ctl pg_dump \
+- psql scripts pg_config pg_controldata pg_resetxlog
++ psql scripts pg_controldata pg_resetxlog
+ ifeq ($(PORTNAME), win32)
+ DIRS+=pgevent
+ endif
+diff -Nru postgresql-8.0.9.orig/src/interfaces/Makefile postgresql-8.0.9/src/interfaces/Makefile
+--- postgresql-8.0.9.orig/src/interfaces/Makefile 2006-11-05 13:20:26.000000000 +0100
++++ postgresql-8.0.9/src/interfaces/Makefile 2006-11-05 15:50:05.000000000 +0100
+@@ -12,7 +12,7 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := libpq ecpg
++DIRS := ecpg
+
+ ALLDIRS := $(DIRS)
+
+diff -Nru postgresql-8.0.9.orig/src/Makefile postgresql-8.0.9/src/Makefile
+--- postgresql-8.0.9.orig/src/Makefile 2006-11-05 13:20:26.000000000 +0100
++++ postgresql-8.0.9/src/Makefile 2006-11-05 15:50:05.000000000 +0100
+@@ -18,7 +18,6 @@
+ $(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 $@
+@@ -47,7 +46,6 @@
+ $(MAKE) -C port $@
+ $(MAKE) -C timezone $@
+ $(MAKE) -C backend $@
+- $(MAKE) -C include $@
+ $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+@@ -61,7 +59,6 @@
+ -$(MAKE) -C port $@
+ -$(MAKE) -C timezone $@
+ -$(MAKE) -C backend $@
+- -$(MAKE) -C include $@
+ -$(MAKE) -C interfaces $@
+ -$(MAKE) -C bin $@
+ -$(MAKE) -C pl $@
diff --git a/dev-db/postgresql/files/postgresql-8.0.9-sh.patch b/dev-db/postgresql/files/postgresql-8.0.9-sh.patch
new file mode 100644
index 000000000000..fc1dafe83d15
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.0.9-sh.patch
@@ -0,0 +1,34 @@
+--- src/include/storage/s_lock.h 2005-01-01 07:03:42.000000000 +0900
++++ src/include/storage/s_lock.h 2005-08-17 23:09:19.000000000 +0900
+@@ -239,6 +239,31 @@
+ #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/files/postgresql-8.1.5-gentoo.patch b/dev-db/postgresql/files/postgresql-8.1.5-gentoo.patch
new file mode 100644
index 000000000000..13c36350e049
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.5-gentoo.patch
@@ -0,0 +1,51 @@
+diff -Nru postgresql-8.1.5.orig/src/bin/Makefile postgresql-8.1.5/src/bin/Makefile
+--- postgresql-8.1.5.orig/src/bin/Makefile 2006-11-05 13:20:34.000000000 +0100
++++ postgresql-8.1.5/src/bin/Makefile 2006-11-05 15:50:53.000000000 +0100
+@@ -14,7 +14,7 @@
+ include $(top_builddir)/src/Makefile.global
+
+ DIRS := initdb ipcclean pg_ctl pg_dump \
+- psql scripts pg_config pg_controldata pg_resetxlog
++ psql scripts pg_controldata pg_resetxlog
+ ifeq ($(PORTNAME), win32)
+ DIRS+=pgevent
+ endif
+diff -Nru postgresql-8.1.5.orig/src/interfaces/Makefile postgresql-8.1.5/src/interfaces/Makefile
+--- postgresql-8.1.5.orig/src/interfaces/Makefile 2006-11-05 13:20:34.000000000 +0100
++++ postgresql-8.1.5/src/interfaces/Makefile 2006-11-05 15:50:53.000000000 +0100
+@@ -12,7 +12,7 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := libpq ecpg
++DIRS := ecpg
+
+ ALLDIRS := $(DIRS)
+
+diff -Nru postgresql-8.1.5.orig/src/Makefile postgresql-8.1.5/src/Makefile
+--- postgresql-8.1.5.orig/src/Makefile 2006-11-05 13:20:34.000000000 +0100
++++ postgresql-8.1.5/src/Makefile 2006-11-05 15:50:53.000000000 +0100
+@@ -18,7 +18,6 @@
+ $(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 $@
+@@ -47,7 +46,6 @@
+ $(MAKE) -C port $@
+ $(MAKE) -C timezone $@
+ $(MAKE) -C backend $@
+- $(MAKE) -C include $@
+ $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+@@ -61,7 +59,6 @@
+ -$(MAKE) -C port $@
+ -$(MAKE) -C timezone $@
+ -$(MAKE) -C backend $@
+- -$(MAKE) -C include $@
+ -$(MAKE) -C interfaces $@
+ -$(MAKE) -C bin $@
+ -$(MAKE) -C pl $@
diff --git a/dev-db/postgresql/files/postgresql-8.1.5-regress_fix.patch b/dev-db/postgresql/files/postgresql-8.1.5-regress_fix.patch
new file mode 100644
index 000000000000..0cb39d576f34
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.5-regress_fix.patch
@@ -0,0 +1,33 @@
+--- src/test/regress/sql/interval.sql 2006-08-05 14:45:52.000000000 +0200
++++ src/test/regress/sql/interval.sql 2006-08-05 14:46:15.000000000 +0200
+@@ -61,12 +61,6 @@
+
+ SELECT '' AS ten, * FROM INTERVAL_TBL;
+
+--- test avg(interval), which is somewhat fragile since people have been
+--- known to change the allowed input syntax for type interval without
+--- updating pg_aggregate.agginitval
+-
+-select avg(f1) from interval_tbl;
+-
+ -- test long interval input
+ select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
+
+--- src/test/regress/expected/interval.out 2006-08-05 14:46:23.000000000 +0200
++++ src/test/regress/expected/interval.out 2006-08-05 14:46:51.000000000 +0200
+@@ -212,15 +212,6 @@
+ | @ 5 mons 12 hours
+ (10 rows)
+
+--- test avg(interval), which is somewhat fragile since people have been
+--- known to change the allowed input syntax for type interval without
+--- updating pg_aggregate.agginitval
+-select avg(f1) from interval_tbl;
+- avg
+--------------------------------------------------
+- @ 4 years 1 mon 9 days 28 hours 18 mins 23 secs
+-(1 row)
+-
+ -- test long interval input
+ select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
+ interval
diff --git a/dev-db/postgresql/files/postgresql-8.1.5-regress_su.patch b/dev-db/postgresql/files/postgresql-8.1.5-regress_su.patch
new file mode 100644
index 000000000000..28e29253dacb
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.5-regress_su.patch
@@ -0,0 +1,116 @@
+--- src/test/regress/pg_regress.sh 2006-08-01 10:57:17.000000000 +0200
++++ src/test/regress/pg_regress.sh 2006-08-04 00:14:39.000000000 +0200
+@@ -81,8 +81,8 @@
+ # Initialize default settings
+ # ----------
+
+-: ${inputdir=.}
+-: ${outputdir=.}
++: ${inputdir=PORTAGETEMPDIRPG}
++: ${outputdir=PORTAGETEMPDIRPG}
+
+ libdir='@libdir@'
+ bindir='@bindir@'
+@@ -410,7 +410,8 @@
+ message "initializing database system"
+ [ "$debug" = yes ] && initdb_options="--debug"
+ [ "$nolocale" = yes ] && initdb_options="$initdb_options --no-locale"
+- "$bindir/initdb" -D "$PGDATA" -L "$datadir" --noclean $initdb_options >"$LOGDIR/initdb.log" 2>&1
++ chown portage "${datadir}" "${temp_install}" "${inputdir}/testtablespace"
++ su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/initdb -D '$PGDATA' -L '$datadir' --noclean $initdb_options" >"$LOGDIR/initdb.log" 2>&1
+
+ if [ $? -ne 0 ]
+ then
+@@ -433,7 +434,7 @@
+ else
+ postmaster_options="$postmaster_options -c listen_addresses="
+ fi
+- "$bindir/postmaster" -D "$PGDATA" -F $postmaster_options >"$LOGDIR/postmaster.log" 2>&1 &
++ su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/postmaster -D '$PGDATA' -F $postmaster_options" >"$LOGDIR/postmaster.log" 2>&1 &
+ postmaster_pid=$!
+
+ # Wait till postmaster is able to accept connections (normally only
+@@ -441,7 +442,7 @@
+ # wait forever, however.
+ i=0
+ max=60
+- until "$bindir/psql" -X $psql_options postgres </dev/null 2>/dev/null
++ until su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/psql -X $psql_options postgres </dev/null 2>/dev/null"
+ do
+ i=`expr $i + 1`
+ if [ $i -ge $max ]
+@@ -498,7 +499,7 @@
+ fi
+
+ message "dropping database \"$dbname\""
+- "$bindir/dropdb" $psql_options "$dbname"
++ su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/dropdb $psql_options '$dbname'"
+ # errors can be ignored
+ fi
+
+@@ -538,17 +539,17 @@
+ # ----------
+
+ message "creating database \"$dbname\""
+-"$bindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
++su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/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 "\
++su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/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';
+-alter database \"$dbname\" set lc_time to 'C';" "$dbname"
++alter database \"$dbname\" set lc_time to 'C';\" '$dbname'"
+ if [ $? -ne 0 ]; then
+ echo "$me: could not set database default locales"
+ (exit 2); exit
+@@ -560,7 +561,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
++su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/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 +576,7 @@
+ for lang in xyzzy $load_langs ; do
+ if [ "$lang" != "xyzzy" ]; then
+ message "installing $lang"
+- "$bindir/createlang" $psql_options $lang $dbname
++ su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/createlang $psql_options $lang '$dbname'"
+ if [ $? -ne 0 ] && [ $? -ne 2 ]; then
+ echo "$me: createlang $lang failed"
+ (exit 2); exit
+@@ -635,7 +636,7 @@
+ # Run a single test
+ formatted=`echo $1 | awk '{printf "%-20.20s", $1;}'`
+ $ECHO_N "test $formatted ... $ECHO_C"
+- ( $PSQL -d "$dbname" <"$inputdir/sql/$1.sql" >"$outputdir/results/$1.out" 2>&1 )&
++ ( su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' ${PSQL} -d '${dbname}' < '${inputdir}/sql/${1}.sql' > '${outputdir}/results/${1}.out' 2>&1" )&
+ wait
+ else
+ # Start a parallel group
+@@ -646,7 +647,7 @@
+ fi
+ for name do
+ (
+- $PSQL -d "$dbname" <"$inputdir/sql/$name.sql" >"$outputdir/results/$name.out" 2>&1
++ su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' ${PSQL} -d '${dbname}' < '${inputdir}/sql/${name}.sql' > '${outputdir}/results/${name}.out' 2>&1"
+ $ECHO_N " $name$ECHO_C"
+ ) &
+ if [ $maxconnections -gt 0 ] ; then
+@@ -740,7 +741,7 @@
+
+ if [ -n "$postmaster_pid" ]; then
+ message "shutting down postmaster"
+- "$bindir/pg_ctl" -s -D "$PGDATA" stop
++ su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/pg_ctl -s -D '$PGDATA' stop"
+ wait "$postmaster_pid"
+ unset postmaster_pid
+ fi
diff --git a/dev-db/postgresql/files/postgresql-8.1.5-sh.patch b/dev-db/postgresql/files/postgresql-8.1.5-sh.patch
new file mode 100644
index 000000000000..6350771080e8
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.5-sh.patch
@@ -0,0 +1,34 @@
+--- src/include/storage/s_lock.h 2005-01-01 07:03:42.000000000 +0900
++++ src/include/storage/s_lock.h 2005-08-17 23:09:19.000000000 +0900
+@@ -300,6 +300,31 @@
+ #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/files/postgresql.conf-7.3 b/dev-db/postgresql/files/postgresql.conf-7.3
index e8dab3e4c827..c6fd787f744d 100644
--- a/dev-db/postgresql/files/postgresql.conf-7.3
+++ b/dev-db/postgresql/files/postgresql.conf-7.3
@@ -1,14 +1,13 @@
# PostgreSQL's Database Directory
-PGDATA=/var/lib/postgresql/data
+PGDATA="/var/lib/postgresql/data"
-# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
-PGLOG=/var/lib/postgresql/data/postgresql.log
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PGLOG="/var/lib/postgresql/data/postgresql.log"
-# Run the PostgreSQL user as:
-PGUSER=postgres
-
-# Extra options to run postmaster with.
-# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
-# PGOPTS="-N 1024 -B 2048 -i"
-PGOPTS=""
+# PostgreSQL User
+PGUSER="postgres"
+# Extra options to run postmaster with
+# If you want to enable TCP/IP for PostgreSQL, add -i, like the following:
+# PGOPTS="-N 512 -B 1024 -i"
+PGOPTS="-N 512 -B 1024"
diff --git a/dev-db/postgresql/files/postgresql.conf-7.4 b/dev-db/postgresql/files/postgresql.conf-7.4
index e8dab3e4c827..c6fd787f744d 100644
--- a/dev-db/postgresql/files/postgresql.conf-7.4
+++ b/dev-db/postgresql/files/postgresql.conf-7.4
@@ -1,14 +1,13 @@
# PostgreSQL's Database Directory
-PGDATA=/var/lib/postgresql/data
+PGDATA="/var/lib/postgresql/data"
-# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
-PGLOG=/var/lib/postgresql/data/postgresql.log
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PGLOG="/var/lib/postgresql/data/postgresql.log"
-# Run the PostgreSQL user as:
-PGUSER=postgres
-
-# Extra options to run postmaster with.
-# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
-# PGOPTS="-N 1024 -B 2048 -i"
-PGOPTS=""
+# PostgreSQL User
+PGUSER="postgres"
+# Extra options to run postmaster with
+# If you want to enable TCP/IP for PostgreSQL, add -i, like the following:
+# PGOPTS="-N 512 -B 1024 -i"
+PGOPTS="-N 512 -B 1024"
diff --git a/dev-db/postgresql/files/postgresql.conf-8.0 b/dev-db/postgresql/files/postgresql.conf-8.0
index e8dab3e4c827..c6fd787f744d 100644
--- a/dev-db/postgresql/files/postgresql.conf-8.0
+++ b/dev-db/postgresql/files/postgresql.conf-8.0
@@ -1,14 +1,13 @@
# PostgreSQL's Database Directory
-PGDATA=/var/lib/postgresql/data
+PGDATA="/var/lib/postgresql/data"
-# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
-PGLOG=/var/lib/postgresql/data/postgresql.log
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PGLOG="/var/lib/postgresql/data/postgresql.log"
-# Run the PostgreSQL user as:
-PGUSER=postgres
-
-# Extra options to run postmaster with.
-# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
-# PGOPTS="-N 1024 -B 2048 -i"
-PGOPTS=""
+# PostgreSQL User
+PGUSER="postgres"
+# Extra options to run postmaster with
+# If you want to enable TCP/IP for PostgreSQL, add -i, like the following:
+# PGOPTS="-N 512 -B 1024 -i"
+PGOPTS="-N 512 -B 1024"
diff --git a/dev-db/postgresql/files/postgresql.conf-8.1 b/dev-db/postgresql/files/postgresql.conf-8.1
index e8dab3e4c827..c6fd787f744d 100644
--- a/dev-db/postgresql/files/postgresql.conf-8.1
+++ b/dev-db/postgresql/files/postgresql.conf-8.1
@@ -1,14 +1,13 @@
# PostgreSQL's Database Directory
-PGDATA=/var/lib/postgresql/data
+PGDATA="/var/lib/postgresql/data"
-# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
-PGLOG=/var/lib/postgresql/data/postgresql.log
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PGLOG="/var/lib/postgresql/data/postgresql.log"
-# Run the PostgreSQL user as:
-PGUSER=postgres
-
-# Extra options to run postmaster with.
-# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
-# PGOPTS="-N 1024 -B 2048 -i"
-PGOPTS=""
+# PostgreSQL User
+PGUSER="postgres"
+# Extra options to run postmaster with
+# If you want to enable TCP/IP for PostgreSQL, add -i, like the following:
+# PGOPTS="-N 512 -B 1024 -i"
+PGOPTS="-N 512 -B 1024"
diff --git a/dev-db/postgresql/files/postgresql.init-7.3 b/dev-db/postgresql/files/postgresql.init-7.3
index 82f32fd272e4..0d94d141dbfc 100644
--- a/dev-db/postgresql/files/postgresql.init-7.3
+++ b/dev-db/postgresql/files/postgresql.init-7.3
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-7.3,v 1.1 2006/07/30 22:30:54 chtekk Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-7.3,v 1.2 2006/11/07 22:48:22 chtekk Exp $
opts="${opts} reload"
@@ -10,9 +10,9 @@ depend() {
}
checkconfig() {
- if [ ! -d $PGDATA ]; then
- eerror "directory not found: $PGDATA"
- eerror "You should create PGDATA directory first."
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "You must create the $PGDATA directory first!"
return 1
fi
}
@@ -21,21 +21,25 @@ start() {
checkconfig || return 1
ebegin "Starting PostgreSQL"
- if [ -f $PGDATA/postmaster.pid ]; then
- rm $PGDATA/postmaster.pid
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
fi
+
su - $PGUSER -c "/usr/bin/pg_ctl start -D '$PGDATA' -s -l '$PGLOG' -o '$PGOPTS'"
while :
do
cnt=$(($cnt + 1))
- if [ -f "$PGDATA/postmaster.pid" ]; then
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
ret=0
break
fi
- if [ $cnt -eq 30 ]; then
- eerror "Please see log file: $PGLOG"
+ if [ $cnt -eq 30 ] ; then
+ eerror
+ eerror "Please check the $PGLOG log file for errors."
+ eerror
ret=1
break
fi
diff --git a/dev-db/postgresql/files/postgresql.init-7.4 b/dev-db/postgresql/files/postgresql.init-7.4
index e4b2022990b0..453b93dc0748 100644
--- a/dev-db/postgresql/files/postgresql.init-7.4
+++ b/dev-db/postgresql/files/postgresql.init-7.4
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-7.4,v 1.4 2006/07/30 22:30:54 chtekk Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-7.4,v 1.5 2006/11/07 22:48:22 chtekk Exp $
opts="${opts} reload"
@@ -10,9 +10,9 @@ depend() {
}
checkconfig() {
- if [ ! -d $PGDATA ]; then
- eerror "directory not found: $PGDATA"
- eerror "You should create PGDATA directory first."
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "You must create the $PGDATA directory first!"
return 1
fi
}
@@ -21,21 +21,25 @@ start() {
checkconfig || return 1
ebegin "Starting PostgreSQL"
- if [ -f $PGDATA/postmaster.pid ]; then
- rm $PGDATA/postmaster.pid
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
fi
+
su - $PGUSER -c "/usr/bin/pg_ctl start -D '$PGDATA' -s -l '$PGLOG' -o '$PGOPTS'"
while :
do
cnt=$(($cnt + 1))
- if [ -f "$PGDATA/postmaster.pid" ]; then
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
ret=0
break
fi
- if [ $cnt -eq 30 ]; then
- eerror "Please see log file: $PGLOG"
+ if [ $cnt -eq 30 ] ; then
+ eerror
+ eerror "Please check the $PGLOG log file for errors."
+ eerror
ret=1
break
fi
diff --git a/dev-db/postgresql/files/postgresql.init-8.0 b/dev-db/postgresql/files/postgresql.init-8.0
index c23ffa776e9f..74a762d44712 100644
--- a/dev-db/postgresql/files/postgresql.init-8.0
+++ b/dev-db/postgresql/files/postgresql.init-8.0
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-8.0,v 1.1 2006/07/30 22:30:54 chtekk Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-8.0,v 1.2 2006/11/07 22:48:22 chtekk Exp $
opts="${opts} reload"
@@ -10,9 +10,9 @@ depend() {
}
checkconfig() {
- if [ ! -d $PGDATA ]; then
- eerror "directory not found: $PGDATA"
- eerror "You should create PGDATA directory first."
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "You must create the $PGDATA directory first!"
return 1
fi
}
@@ -21,21 +21,25 @@ start() {
checkconfig || return 1
ebegin "Starting PostgreSQL"
- if [ -f $PGDATA/postmaster.pid ]; then
- rm $PGDATA/postmaster.pid
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
fi
+
su - $PGUSER -c "/usr/bin/pg_ctl start -D '$PGDATA' -s -l '$PGLOG' -o '$PGOPTS'"
while :
do
cnt=$(($cnt + 1))
- if [ -f "$PGDATA/postmaster.pid" ]; then
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
ret=0
break
fi
- if [ $cnt -eq 30 ]; then
- eerror "Please see log file: $PGLOG"
+ if [ $cnt -eq 30 ] ; then
+ eerror
+ eerror "Please check the $PGLOG log file for errors."
+ eerror
ret=1
break
fi
diff --git a/dev-db/postgresql/files/postgresql.init-8.1 b/dev-db/postgresql/files/postgresql.init-8.1
index fa1a0669b336..cd432ec29151 100644
--- a/dev-db/postgresql/files/postgresql.init-8.1
+++ b/dev-db/postgresql/files/postgresql.init-8.1
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-8.1,v 1.1 2006/07/30 22:30:54 chtekk Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.init-8.1,v 1.2 2006/11/07 22:48:22 chtekk Exp $
opts="${opts} reload"
@@ -10,9 +10,9 @@ depend() {
}
checkconfig() {
- if [ ! -d $PGDATA ]; then
- eerror "directory not found: $PGDATA"
- eerror "You should create PGDATA directory first."
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "You must create the $PGDATA directory first!"
return 1
fi
}
@@ -21,21 +21,25 @@ start() {
checkconfig || return 1
ebegin "Starting PostgreSQL"
- if [ -f $PGDATA/postmaster.pid ]; then
- rm $PGDATA/postmaster.pid
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
fi
+
su - $PGUSER -c "/usr/bin/pg_ctl start -D '$PGDATA' -s -l '$PGLOG' -o '$PGOPTS'"
while :
do
cnt=$(($cnt + 1))
- if [ -f "$PGDATA/postmaster.pid" ]; then
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
ret=0
break
fi
- if [ $cnt -eq 30 ]; then
- eerror "Please see log file: $PGLOG"
+ if [ $cnt -eq 30 ] ; then
+ eerror
+ eerror "Please check the $PGLOG log file for errors."
+ eerror
ret=1
break
fi
diff --git a/dev-db/postgresql/postgresql-7.3.15-r1.ebuild b/dev-db/postgresql/postgresql-7.3.15-r1.ebuild
index abe727744b44..2bab9ddafb46 100644
--- a/dev-db/postgresql/postgresql-7.3.15-r1.ebuild
+++ b/dev-db/postgresql/postgresql-7.3.15-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.3.15-r1.ebuild,v 1.10 2006/10/14 20:31:15 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.3.15-r1.ebuild,v 1.11 2006/11/07 22:48:22 chtekk Exp $
inherit eutils gnuconfig flag-o-matic java-pkg multilib
@@ -13,7 +13,7 @@ SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${PV}.tar.bz2
LICENSE="POSTGRESQL"
SLOT="0"
-KEYWORDS="alpha amd64 ~arm hppa ia64 mips ppc ~s390 ~sh sparc x86"
+KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ~ppc64 s390 sh sparc x86"
IUSE="doc java libg++ nls pam perl python readline ssl tcl tk zlib threads selinux"
DEPEND="virtual/libc
diff --git a/dev-db/postgresql/postgresql-7.3.16.ebuild b/dev-db/postgresql/postgresql-7.3.16.ebuild
new file mode 100644
index 000000000000..fe4042276aec
--- /dev/null
+++ b/dev-db/postgresql/postgresql-7.3.16.ebuild
@@ -0,0 +1,240 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.3.16.ebuild,v 1.1 2006/11/07 22:48:22 chtekk Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+DESCRIPTION="Sophisticated and powerful Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/${PN}-opt-${PV}.tar.bz2
+ doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${PV}.tar.bz2 )
+ test? ( mirror://postgresql/source/v${PV}/${PN}-test-${PV}.tar.bz2 )"
+LICENSE="POSTGRESQL"
+SLOT="0"
+IUSE="doc kerberos nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib"
+
+RDEPEND="~dev-db/libpq-${PV}
+ >=sys-libs/ncurses-5.2
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ readline? ( >=sys-libs/readline-4.1 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )
+ zlib? ( >=sys-libs/zlib-1.1.3 )"
+DEPEND="${RDEPEND}
+ sys-devel/autoconf
+ >=sys-devel/bison-1.875
+ nls? ( sys-devel/gettext )
+ xml? ( dev-util/pkgconfig )"
+
+PG_DIR="/var/lib/postgresql"
+[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
+
+pkg_setup() {
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ if [[ $(cat "${PG_DIR}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
+ eerror "use pg_dump to export your existing databases to a file, and then"
+ eerror "pg_restore to import them when you have upgraded completely."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ fi
+ fi
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-${PV}-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-${PV}-cubeparse.patch"
+
+ # Prepare package for future tests
+ if use test ; then
+ # We need to run the tests as a non-root user, portage seems the most fitting here,
+ # so if userpriv is enabled, we use it directly. If userpriv is disabled, well, we
+ # don't support that in this version of PostgreSQL ... :)
+ mkdir -p "${S}/src/test/regress/tmp_check"
+ chown portage "${S}/src/test/regress/tmp_check"
+ einfo "Tests will be run as user portage."
+ fi
+}
+
+src_compile() {
+ filter-flags -ffast-math -feliminate-dwarf2-dups
+
+ # Correctly support the XML stuff
+ if use xml ; then
+ CFLAGS="${CFLAGS} $(pkg-config --cflags libxml-2.0)"
+ LIBS="${LIBS} $(pkg-config --libs libxml-2.0)"
+ fi
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ cd "${S}"
+
+ ./configure --prefix=/usr \
+ --includedir=/usr/include/postgresql/pgsql \
+ --sysconfdir=/etc/postgresql \
+ --mandir=/usr/share/man \
+ --host=${CHOST} \
+ --docdir=/usr/share/doc/${PF} \
+ --libdir=/usr/$(get_libdir) \
+ --enable-depend \
+ $(use_with kerberos krb5) \
+ $(use_enable nls ) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_enable pg-intdatetime integer-datetimes ) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ --without-tk \
+ $(use_with zlib) \
+ || die "configure failed"
+
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "main emake failed"
+
+ cd "${S}/contrib"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib emake failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib/xml emake failed"
+ fi
+}
+
+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
+
+ cd "${S}"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "main emake install failed"
+
+ cd "${S}/contrib"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib emake install failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib/xml emake install failed"
+ fi
+
+ cd "${S}"
+ dodoc README HISTORY
+ dodoc contrib/adddepend/*
+
+ cd "${S}/doc"
+ dodoc FAQ* README.* TODO bug.template
+
+ if use doc ; then
+ cd "${S}/doc"
+ docinto FAQ_html
+ dodoc src/FAQ/*
+ docinto sgml
+ dodoc src/sgml/*.{sgml,dsl}
+ docinto sgml/ref
+ dodoc src/sgml/ref/*.sgml
+ docinto TODO.detail
+ dodoc TODO.detail/*
+ fi
+
+ newinitd "${FILESDIR}/postgresql.init-${PV%.*}" postgresql || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${PV%.*}" postgresql || die "Inserting conf.d-file failed"
+}
+
+pkg_postinst() {
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${PF}"
+}
+
+pkg_config() {
+ einfo "Creating the data directory ..."
+ mkdir -p "${PG_DIR}/data"
+ chown -Rf postgres:postgres "${PG_DIR}"
+ chmod 0700 "${PG_DIR}/data"
+
+ einfo "Initializing the database ..."
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ else
+ if use kernel_linux ; then
+ local SEM=`sysctl -n kernel.sem | cut -f-3`
+ local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+ local SEMMNI_MIN=`expr \( ${PG_MAX_CONNECTIONS} + 15 \) / 16`
+ local SHMMAX=`sysctl -n kernel.shmmax`
+ local SHMMAX_MIN=`expr 500000 + 30600 \* ${PG_MAX_CONNECTIONS}`
+
+ if [ ${SEMMNI} -lt ${SEMMNI_MIN} ] ; then
+ eerror "The current value of SEMMNI is too low"
+ eerror "for PostgreSQL to run ${PG_MAX_CONNECTIONS} connections!"
+ eerror "Temporary setting this value to ${SEMMNI_MIN} while creating the initial database."
+ echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
+ fi
+
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+
+ if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
+ echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
+ ewarn "Restoring the SEMMNI value to the previous value."
+ ewarn "Please edit the last value of kernel.sem in /etc/sysctl.conf"
+ ewarn "and set it to at least ${SEMMNI_MIN}:"
+ ewarn
+ ewarn " kernel.sem = ${SEM} ${SEMMNI_MIN}"
+ ewarn
+ fi
+
+ if [ ${SHMMAX} -lt ${SHMMAX_MIN} ] ; then
+ eerror "The current value of SHMMAX is too low for postgresql to run."
+ eerror "Please edit /etc/sysctl.conf and set this value to at least ${SHMMAX_MIN}:"
+ eerror
+ eerror " kernel.shmmax = ${SHMMAX_MIN}"
+ eerror
+ fi
+ else
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+ fi
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+ fi
+}
+
+src_test() {
+ cd "${S}"
+
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ if hasq userpriv ${FEATURES} ; then
+ if ! emake -j1 check ; then
+ hasq test ${FEATURES} && die "Make check failed. See above for details."
+ hasq test ${FEATURES} || eerror "Make check failed. See above for details."
+ fi
+ else
+ eerror "Tests won't be run if FEATURES=userpriv is disabled!"
+ fi
+
+ 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/postgresql-7.4.14.ebuild b/dev-db/postgresql/postgresql-7.4.14.ebuild
new file mode 100644
index 000000000000..dcb8b7cf11ae
--- /dev/null
+++ b/dev-db/postgresql/postgresql-7.4.14.ebuild
@@ -0,0 +1,244 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.4.14.ebuild,v 1.1 2006/11/07 22:48:22 chtekk Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+DESCRIPTION="Sophisticated and powerful Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/${PN}-opt-${PV}.tar.bz2
+ doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${PV}.tar.bz2 )
+ test? ( mirror://postgresql/source/v${PV}/${PN}-test-${PV}.tar.bz2 )"
+LICENSE="POSTGRESQL"
+SLOT="0"
+IUSE="doc kerberos nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib"
+
+RDEPEND="~dev-db/libpq-${PV}
+ >=sys-libs/ncurses-5.2
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ readline? ( >=sys-libs/readline-4.1 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )
+ zlib? ( >=sys-libs/zlib-1.1.3 )"
+DEPEND="${RDEPEND}
+ sys-devel/autoconf
+ >=sys-devel/bison-1.875
+ nls? ( sys-devel/gettext )
+ xml? ( dev-util/pkgconfig )"
+
+PG_DIR="/var/lib/postgresql"
+[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
+
+pkg_setup() {
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ if [[ $(cat "${PG_DIR}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
+ eerror "use pg_dump to export your existing databases to a file, and then"
+ eerror "pg_restore to import them when you have upgraded completely."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ fi
+ fi
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-${PV}-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-${PV}-hppa-testandset.patch"
+
+ # Prepare package for future tests
+ if use test ; then
+ # We need to run the tests as a non-root user, portage seems the most fitting here,
+ # so if userpriv is enabled, we use it directly. If userpriv is disabled, well, we
+ # don't support that in this version of PostgreSQL ... :)
+ mkdir -p "${S}/src/test/regress/tmp_check"
+ chown portage "${S}/src/test/regress/tmp_check"
+ einfo "Tests will be run as user portage."
+ fi
+}
+
+src_compile() {
+ filter-flags -ffast-math -feliminate-dwarf2-dups
+
+ # Correctly support the XML stuff
+ if use xml ; then
+ CFLAGS="${CFLAGS} $(pkg-config --cflags libxml-2.0)"
+ LIBS="${LIBS} $(pkg-config --libs libxml-2.0)"
+ fi
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ cd "${S}"
+
+ ./configure --prefix=/usr \
+ --includedir=/usr/include/postgresql/pgsql \
+ --sysconfdir=/etc/postgresql \
+ --mandir=/usr/share/man \
+ --host=${CHOST} \
+ --docdir=/usr/share/doc/${PF} \
+ --libdir=/usr/$(get_libdir) \
+ --enable-depend \
+ $(use_with kerberos krb5) \
+ $(use_enable nls ) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_enable pg-intdatetime integer-datetimes ) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ --without-tk \
+ $(use_with zlib) \
+ || die "configure failed"
+
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "main emake failed"
+
+ cd "${S}/contrib"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib emake failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib/xml emake failed"
+ fi
+}
+
+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
+
+ cd "${S}"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "main emake install failed"
+
+ cd "${S}/contrib"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib emake install failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib/xml emake install failed"
+ fi
+
+ cd "${S}"
+ dodoc README HISTORY
+ dodoc contrib/adddepend/*
+
+ cd "${S}/doc"
+ dodoc FAQ* README.* TODO bug.template
+
+ if use doc ; then
+ cd "${S}/doc"
+ docinto FAQ_html
+ dodoc src/FAQ/*
+ docinto sgml
+ dodoc src/sgml/*.{sgml,dsl}
+ docinto sgml/ref
+ dodoc src/sgml/ref/*.sgml
+ docinto TODO.detail
+ dodoc TODO.detail/*
+ fi
+
+ newinitd "${FILESDIR}/postgresql.init-${PV%.*}" postgresql || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${PV%.*}" postgresql || die "Inserting conf.d-file failed"
+
+ newinitd "${FILESDIR}/pg_autovacuum.init-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum init.d-file failed"
+ newconfd "${FILESDIR}/pg_autovacuum.conf-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum conf.d-file failed"
+ dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum
+}
+
+pkg_postinst() {
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${PF}"
+}
+
+pkg_config() {
+ einfo "Creating the data directory ..."
+ mkdir -p "${PG_DIR}/data"
+ chown -Rf postgres:postgres "${PG_DIR}"
+ chmod 0700 "${PG_DIR}/data"
+
+ einfo "Initializing the database ..."
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ else
+ if use kernel_linux ; then
+ local SEM=`sysctl -n kernel.sem | cut -f-3`
+ local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+ local SEMMNI_MIN=`expr \( ${PG_MAX_CONNECTIONS} + 15 \) / 16`
+ local SHMMAX=`sysctl -n kernel.shmmax`
+ local SHMMAX_MIN=`expr 500000 + 30600 \* ${PG_MAX_CONNECTIONS}`
+
+ if [ ${SEMMNI} -lt ${SEMMNI_MIN} ] ; then
+ eerror "The current value of SEMMNI is too low"
+ eerror "for PostgreSQL to run ${PG_MAX_CONNECTIONS} connections!"
+ eerror "Temporary setting this value to ${SEMMNI_MIN} while creating the initial database."
+ echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
+ fi
+
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+
+ if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
+ echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
+ ewarn "Restoring the SEMMNI value to the previous value."
+ ewarn "Please edit the last value of kernel.sem in /etc/sysctl.conf"
+ ewarn "and set it to at least ${SEMMNI_MIN}:"
+ ewarn
+ ewarn " kernel.sem = ${SEM} ${SEMMNI_MIN}"
+ ewarn
+ fi
+
+ if [ ${SHMMAX} -lt ${SHMMAX_MIN} ] ; then
+ eerror "The current value of SHMMAX is too low for postgresql to run."
+ eerror "Please edit /etc/sysctl.conf and set this value to at least ${SHMMAX_MIN}:"
+ eerror
+ eerror " kernel.shmmax = ${SHMMAX_MIN}"
+ eerror
+ fi
+ else
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+ fi
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+ fi
+}
+
+src_test() {
+ cd "${S}"
+
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ if hasq userpriv ${FEATURES} ; then
+ if ! emake -j1 check ; then
+ hasq test ${FEATURES} && die "Make check failed. See above for details."
+ hasq test ${FEATURES} || eerror "Make check failed. See above for details."
+ fi
+ else
+ eerror "Tests won't be run if FEATURES=userpriv is disabled!"
+ fi
+
+ 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/postgresql-8.0.9.ebuild b/dev-db/postgresql/postgresql-8.0.9.ebuild
new file mode 100644
index 000000000000..b41f80e57e4f
--- /dev/null
+++ b/dev-db/postgresql/postgresql-8.0.9.ebuild
@@ -0,0 +1,240 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.0.9.ebuild,v 1.1 2006/11/07 22:48:22 chtekk Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+DESCRIPTION="Sophisticated and powerful Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/${PN}-opt-${PV}.tar.bz2
+ doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${PV}.tar.bz2 )
+ test? ( mirror://postgresql/source/v${PV}/${PN}-test-${PV}.tar.bz2 )"
+LICENSE="POSTGRESQL"
+SLOT="0"
+IUSE="doc kerberos nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib"
+
+RDEPEND="~dev-db/libpq-${PV}
+ >=sys-libs/ncurses-5.2
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ readline? ( >=sys-libs/readline-4.1 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )
+ zlib? ( >=sys-libs/zlib-1.1.3 )"
+DEPEND="${RDEPEND}
+ sys-devel/autoconf
+ >=sys-devel/bison-1.875
+ nls? ( sys-devel/gettext )
+ xml? ( dev-util/pkgconfig )"
+
+PG_DIR="/var/lib/postgresql"
+[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
+
+pkg_setup() {
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ if [[ $(cat "${PG_DIR}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
+ eerror "use pg_dump to export your existing databases to a file, and then"
+ eerror "pg_restore to import them when you have upgraded completely."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ fi
+ fi
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-${PV}-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-${PV}-sh.patch"
+
+ # Prepare package for future tests
+ if use test ; then
+ # Fix sandbox violation
+ sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+
+ # We need to run the tests as a non-root user, portage seems the most fitting here,
+ # so if userpriv is enabled, we use it directly. If userpriv is disabled, well, we
+ # don't support that in this version of PostgreSQL ... :)
+ mkdir -p "${S}/src/test/regress/tmp_check"
+ chown portage "${S}/src/test/regress/tmp_check"
+ einfo "Tests will be run as user portage."
+ fi
+}
+
+src_compile() {
+ filter-flags -ffast-math -feliminate-dwarf2-dups
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ cd "${S}"
+
+ ./configure --prefix=/usr \
+ --includedir=/usr/include/postgresql/pgsql \
+ --sysconfdir=/etc/postgresql \
+ --mandir=/usr/share/man \
+ --host=${CHOST} \
+ --with-docdir=/usr/share/doc/${PF} \
+ --libdir=/usr/$(get_libdir) \
+ --enable-depend \
+ $(use_with kerberos krb5) \
+ $(use_enable nls ) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_enable pg-intdatetime integer-datetimes ) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ $(use_with zlib) \
+ || die "configure failed"
+
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "main emake failed"
+
+ cd "${S}/contrib"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib emake failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml2"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib/xml2 emake failed"
+ fi
+}
+
+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
+
+ cd "${S}"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "main emake install failed"
+
+ cd "${S}/contrib"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib emake install failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml2"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib/xml2 emake install failed"
+ fi
+
+ cd "${S}"
+ dodoc README HISTORY
+ dodoc contrib/adddepend/*
+
+ cd "${S}/doc"
+ dodoc FAQ* README.* TODO bug.template
+
+ if use doc ; then
+ cd "${S}/doc"
+ docinto FAQ_html
+ dodoc src/FAQ/*
+ docinto sgml
+ dodoc src/sgml/*.{sgml,dsl}
+ docinto sgml/ref
+ dodoc src/sgml/ref/*.sgml
+ docinto TODO.detail
+ dodoc TODO.detail/*
+ fi
+
+ newinitd "${FILESDIR}/postgresql.init-${PV%.*}" postgresql || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${PV%.*}" postgresql || die "Inserting conf.d-file failed"
+
+ newinitd "${FILESDIR}/pg_autovacuum.init-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum init.d-file failed"
+ newconfd "${FILESDIR}/pg_autovacuum.conf-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum conf.d-file failed"
+ dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum
+}
+
+pkg_postinst() {
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${PF}"
+}
+
+pkg_config() {
+ einfo "Creating the data directory ..."
+ mkdir -p "${PG_DIR}/data"
+ chown -Rf postgres:postgres "${PG_DIR}"
+ chmod 0700 "${PG_DIR}/data"
+
+ einfo "Initializing the database ..."
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ else
+ if use kernel_linux ; then
+ local SEM=`sysctl -n kernel.sem | cut -f-3`
+ local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+ local SEMMNI_MIN=`expr \( ${PG_MAX_CONNECTIONS} + 15 \) / 16`
+ local SHMMAX=`sysctl -n kernel.shmmax`
+ local SHMMAX_MIN=`expr 500000 + 30600 \* ${PG_MAX_CONNECTIONS}`
+
+ if [ ${SEMMNI} -lt ${SEMMNI_MIN} ] ; then
+ eerror "The current value of SEMMNI is too low"
+ eerror "for PostgreSQL to run ${PG_MAX_CONNECTIONS} connections!"
+ eerror "Temporary setting this value to ${SEMMNI_MIN} while creating the initial database."
+ echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
+ fi
+
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+
+ if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
+ echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
+ ewarn "Restoring the SEMMNI value to the previous value."
+ ewarn "Please edit the last value of kernel.sem in /etc/sysctl.conf"
+ ewarn "and set it to at least ${SEMMNI_MIN}:"
+ ewarn
+ ewarn " kernel.sem = ${SEM} ${SEMMNI_MIN}"
+ ewarn
+ fi
+
+ if [ ${SHMMAX} -lt ${SHMMAX_MIN} ] ; then
+ eerror "The current value of SHMMAX is too low for postgresql to run."
+ eerror "Please edit /etc/sysctl.conf and set this value to at least ${SHMMAX_MIN}:"
+ eerror
+ eerror " kernel.shmmax = ${SHMMAX_MIN}"
+ eerror
+ fi
+ else
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+ fi
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+ fi
+}
+
+src_test() {
+ cd "${S}"
+
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ if hasq userpriv ${FEATURES} ; then
+ if ! emake -j1 check ; then
+ hasq test ${FEATURES} && die "Make check failed. See above for details."
+ hasq test ${FEATURES} || eerror "Make check failed. See above for details."
+ fi
+ else
+ eerror "Tests won't be run if FEATURES=userpriv is disabled!"
+ fi
+
+ 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/postgresql-8.1.5.ebuild b/dev-db/postgresql/postgresql-8.1.5.ebuild
new file mode 100644
index 000000000000..4a6779b0a8a6
--- /dev/null
+++ b/dev-db/postgresql/postgresql-8.1.5.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.1.5.ebuild,v 1.1 2006/11/07 22:48:22 chtekk Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+
+DESCRIPTION="Sophisticated and powerful Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/${PN}-opt-${PV}.tar.bz2
+ doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${PV}.tar.bz2 )
+ test? ( mirror://postgresql/source/v${PV}/${PN}-test-${PV}.tar.bz2 )"
+LICENSE="POSTGRESQL"
+SLOT="0"
+IUSE="doc kerberos nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib"
+
+RDEPEND="~dev-db/libpq-${PV}
+ >=sys-libs/ncurses-5.2
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ readline? ( >=sys-libs/readline-4.1 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )
+ zlib? ( >=sys-libs/zlib-1.1.3 )"
+DEPEND="${RDEPEND}
+ sys-devel/autoconf
+ >=sys-devel/bison-1.875
+ nls? ( sys-devel/gettext )
+ xml? ( dev-util/pkgconfig )"
+
+PG_DIR="/var/lib/postgresql"
+[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
+
+pkg_setup() {
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ if [[ $(cat "${PG_DIR}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
+ eerror "use pg_dump to export your existing databases to a file, and then"
+ eerror "pg_restore to import them when you have upgraded completely."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ fi
+ fi
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}-${PV}-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-${PV}-sh.patch"
+
+ # Prepare package for future tests
+ if use test ; then
+ # Fix sandbox violation
+ sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+
+ # Fix broken tests
+ epatch "${FILESDIR}/${PN}-${PV}-regress_fix.patch"
+
+ # We need to run the tests as a non-root user, portage seems the most fitting here,
+ # so if userpriv is enabled, we use it directly. If userpriv is disabled, we need to
+ # su - to a valid user, portage again, so we patch the test-scripts to do that.
+ mkdir -p "${S}/src/test/regress/tmp_check"
+ chown portage "${S}/src/test/regress/tmp_check"
+ einfo "Tests will be run as user portage."
+ if ! hasq userpriv ${FEATURES} ; then
+ mkdir -p "${S}/src/test/regress/results"
+ chown portage "${S}/src/test/regress/results"
+ epatch "${FILESDIR}/${PN}-${PV}-regress_su.patch"
+ sed -e "s|PORTAGETEMPDIRPG|${S}/src/test/regress|g" -i src/test/regress/pg_regress.sh
+ fi
+ fi
+}
+
+src_compile() {
+ filter-flags -ffast-math -feliminate-dwarf2-dups
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ cd "${S}"
+
+ ./configure --prefix=/usr \
+ --includedir=/usr/include/postgresql/pgsql \
+ --sysconfdir=/etc/postgresql \
+ --mandir=/usr/share/man \
+ --host=${CHOST} \
+ --with-docdir=/usr/share/doc/${PF} \
+ --libdir=/usr/$(get_libdir) \
+ --enable-depend \
+ $(use_with kerberos krb5) \
+ $(use_enable nls ) \
+ $(use_with pam) \
+ $(use_with perl) \
+ $(use_enable pg-intdatetime integer-datetimes ) \
+ $(use_with python) \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ $(use_with tcl) \
+ $(use_with zlib) \
+ || die "configure failed"
+
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "main emake failed"
+
+ cd "${S}/contrib"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib emake failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml2"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib/xml2 emake failed"
+ fi
+}
+
+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
+
+ cd "${S}"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "main emake install failed"
+
+ cd "${S}/contrib"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib emake install failed"
+
+ if use xml ; then
+ cd "${S}/contrib/xml2"
+ emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib/xml2 emake install failed"
+ fi
+
+ cd "${S}"
+ dodoc README HISTORY
+ dodoc contrib/adddepend/*
+
+ cd "${S}/doc"
+ dodoc FAQ* README.* TODO bug.template
+
+ if use doc ; then
+ cd "${S}/doc"
+ docinto FAQ_html
+ dodoc src/FAQ/*
+ docinto sgml
+ dodoc src/sgml/*.{sgml,dsl}
+ docinto sgml/ref
+ dodoc src/sgml/ref/*.sgml
+ docinto TODO.detail
+ dodoc TODO.detail/*
+ fi
+
+ newinitd "${FILESDIR}/postgresql.init-${PV%.*}" postgresql || die "Inserting init.d-file failed"
+ newconfd "${FILESDIR}/postgresql.conf-${PV%.*}" postgresql || die "Inserting conf.d-file failed"
+}
+
+pkg_postinst() {
+ elog "Execute the following command to setup the initial database environment:"
+ elog
+ elog "emerge --config =${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 in ${ROOT}/etc/postgresql/postgresql.conf."
+}
+
+pkg_config() {
+ einfo "Creating the data directory ..."
+ mkdir -p "${PG_DIR}/data"
+ chown -Rf postgres:postgres "${PG_DIR}"
+ chmod 0700 "${PG_DIR}/data"
+
+ einfo "Initializing the database ..."
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ else
+ if use kernel_linux ; then
+ local SEM=`sysctl -n kernel.sem | cut -f-3`
+ local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+ local SEMMNI_MIN=`expr \( ${PG_MAX_CONNECTIONS} + 15 \) / 16`
+ local SHMMAX=`sysctl -n kernel.shmmax`
+ local SHMMAX_MIN=`expr 500000 + 30600 \* ${PG_MAX_CONNECTIONS}`
+
+ if [ ${SEMMNI} -lt ${SEMMNI_MIN} ] ; then
+ eerror "The current value of SEMMNI is too low"
+ eerror "for PostgreSQL to run ${PG_MAX_CONNECTIONS} connections!"
+ eerror "Temporary setting this value to ${SEMMNI_MIN} while creating the initial database."
+ echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
+ fi
+
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+
+ if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
+ echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
+ ewarn "Restoring the SEMMNI value to the previous value."
+ ewarn "Please edit the last value of kernel.sem in /etc/sysctl.conf"
+ ewarn "and set it to at least ${SEMMNI_MIN}:"
+ ewarn
+ ewarn " kernel.sem = ${SEM} ${SEMMNI_MIN}"
+ ewarn
+ fi
+
+ if [ ${SHMMAX} -lt ${SHMMAX_MIN} ] ; then
+ eerror "The current value of SHMMAX is too low for postgresql to run."
+ eerror "Please edit /etc/sysctl.conf and set this value to at least ${SHMMAX_MIN}:"
+ eerror
+ eerror " kernel.shmmax = ${SHMMAX_MIN}"
+ eerror
+ fi
+ else
+ su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+ fi
+
+ einfo
+ einfo "You can use the '${ROOT}/etc/init.d/postgresql' script to run PostgreSQL instead of 'pg_ctl'."
+ einfo
+ fi
+}
+
+src_test() {
+ cd "${S}"
+
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ if ! emake -j1 check ; then
+ hasq test ${FEATURES} && die "Make check failed. See above for details."
+ hasq test ${FEATURES} || eerror "Make check failed. See above for details."
+ fi
+
+ 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."
+}