summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/postgresql/files')
-rw-r--r--dev-db/postgresql/files/digest-postgresql-7.3.1912
-rw-r--r--dev-db/postgresql/files/digest-postgresql-7.4.1712
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.0.1312
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.1.912
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.2.4-r112
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.conf-7.418
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.conf-8.018
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.init-7.453
-rw-r--r--dev-db/postgresql/files/pg_autovacuum.init-8.053
-rw-r--r--dev-db/postgresql/files/postgresql-7.3.19-cubeparse.patch36
-rw-r--r--dev-db/postgresql/files/postgresql-7.4.17-hppa-testandset.patch50
-rw-r--r--dev-db/postgresql/files/postgresql-8.0.13-sh.patch34
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.9-regress_su.patch116
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.9-sh.patch34
-rw-r--r--dev-db/postgresql/files/postgresql-8.2.4-gentoo.patch58
-rw-r--r--dev-db/postgresql/files/postgresql-8.2.4-no-test.patch12
-rw-r--r--dev-db/postgresql/files/postgresql-8.2.4-regress_fix.patch31
-rw-r--r--dev-db/postgresql/files/postgresql-8.2.4-regress_su.patch15
-rw-r--r--dev-db/postgresql/files/postgresql-8.2.4-sh.patch34
-rw-r--r--dev-db/postgresql/files/postgresql.conf-7.313
-rw-r--r--dev-db/postgresql/files/postgresql.conf-7.420
-rw-r--r--dev-db/postgresql/files/postgresql.conf-8.042
-rw-r--r--dev-db/postgresql/files/postgresql.conf-8.142
-rw-r--r--dev-db/postgresql/files/postgresql.conf-8.242
-rw-r--r--dev-db/postgresql/files/postgresql.init-7.367
-rw-r--r--dev-db/postgresql/files/postgresql.init-7.467
-rw-r--r--dev-db/postgresql/files/postgresql.init-8.056
-rw-r--r--dev-db/postgresql/files/postgresql.init-8.156
-rw-r--r--dev-db/postgresql/files/postgresql.init-8.256
29 files changed, 1083 insertions, 0 deletions
diff --git a/dev-db/postgresql/files/digest-postgresql-7.3.19 b/dev-db/postgresql/files/digest-postgresql-7.3.19
new file mode 100644
index 0000000..770e854
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-7.3.19
@@ -0,0 +1,12 @@
+MD5 b9b2dca0468bafff72486bd54812c317 postgresql-base-7.3.19.tar.bz2 5691127
+RMD160 802bbba70d1368097a74de6b67589ab9645597cc postgresql-base-7.3.19.tar.bz2 5691127
+SHA256 1804e0424e4444f67acfb98b4e4ad2ede26748d1ddb4a9201cbff7627e394e6a postgresql-base-7.3.19.tar.bz2 5691127
+MD5 de4888125bef49f9f53824d4f9ae7bf6 postgresql-docs-7.3.19.tar.bz2 2365906
+RMD160 acad805217a5b16badc5ea1c5f88e2780d48e849 postgresql-docs-7.3.19.tar.bz2 2365906
+SHA256 0a4910cf776b6be8017eaf68a60c541be59288079fe5696d955bdace22ebde0a postgresql-docs-7.3.19.tar.bz2 2365906
+MD5 1fe88fa959492155518787c0eb197b14 postgresql-opt-7.3.19.tar.bz2 342076
+RMD160 7ee1dea5c906d88ba3384ea805368a9dcb8af47d postgresql-opt-7.3.19.tar.bz2 342076
+SHA256 2735bceed9f0d27befb3ec26b5d76f9272da1cdf2434ceb9d68327494912017f postgresql-opt-7.3.19.tar.bz2 342076
+MD5 a0958b2352586b7cd4083f46e1ba1ae8 postgresql-test-7.3.19.tar.bz2 891109
+RMD160 4f5ee0f9c4dd86b6ee54a818e25e929c2fc2334f postgresql-test-7.3.19.tar.bz2 891109
+SHA256 8df80f3fb5f61d61fe6348e037c614b3c0f2114ae5c8a7f3050b5fadde517ba3 postgresql-test-7.3.19.tar.bz2 891109
diff --git a/dev-db/postgresql/files/digest-postgresql-7.4.17 b/dev-db/postgresql/files/digest-postgresql-7.4.17
new file mode 100644
index 0000000..d0643a9
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-7.4.17
@@ -0,0 +1,12 @@
+MD5 c513ae755abd4fb011378351be9e1ba0 postgresql-base-7.4.17.tar.bz2 6609512
+RMD160 cd5aed1fb45cc42e12cca0cd31174b6726dae97b postgresql-base-7.4.17.tar.bz2 6609512
+SHA256 f1b7ff754ccb43d4a3a62a9124b1c8ac215e48e5549e620bfcde59124c6f1bc5 postgresql-base-7.4.17.tar.bz2 6609512
+MD5 e9a33e70add61f6a1018870c88dbf0ea postgresql-docs-7.4.17.tar.bz2 2434028
+RMD160 a7470801732f7458c4a6dec6b441b151a2963d88 postgresql-docs-7.4.17.tar.bz2 2434028
+SHA256 855b08821fa06cce280d63c1c57a1a51cc02eee1af0a53ba9a550cc3e66c2696 postgresql-docs-7.4.17.tar.bz2 2434028
+MD5 43a87be48f3e43c5fce957af000bff60 postgresql-opt-7.4.17.tar.bz2 333513
+RMD160 55b7d1c9900f590d778c915d586d8cafd14dc633 postgresql-opt-7.4.17.tar.bz2 333513
+SHA256 8ff6ca8f726ce39d873d495273c31ceb3d647d75a85a7940b38d38ae7b2eff3e postgresql-opt-7.4.17.tar.bz2 333513
+MD5 493b0b142f0ca6fb52dbdfc5c32e0c5b postgresql-test-7.4.17.tar.bz2 902524
+RMD160 5d2580ac74e01a65d9c00bc7a2900630e2c5720d postgresql-test-7.4.17.tar.bz2 902524
+SHA256 0486999f89b38996c15a91a66638f40718d5fb702ac592f4f2a22e9377b6b6bf postgresql-test-7.4.17.tar.bz2 902524
diff --git a/dev-db/postgresql/files/digest-postgresql-8.0.13 b/dev-db/postgresql/files/digest-postgresql-8.0.13
new file mode 100644
index 0000000..1a68a72
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.0.13
@@ -0,0 +1,12 @@
+MD5 d3b5185dc6a12f2443f06f83cdee03d0 postgresql-base-8.0.13.tar.bz2 7848290
+RMD160 de34ef01b76d777e9b22bcd16dd29328a11d35cf postgresql-base-8.0.13.tar.bz2 7848290
+SHA256 5627ad76e6a6c8eb85c1debe5fce2c12b42611434dabe0fd5763b8a72c7ac49d postgresql-base-8.0.13.tar.bz2 7848290
+MD5 877fc8417555cff0a889d38013afefd6 postgresql-docs-8.0.13.tar.bz2 2271196
+RMD160 fdb9775d082da9c10aebb9394d84c55cfea3f4d7 postgresql-docs-8.0.13.tar.bz2 2271196
+SHA256 a703a22b11288eb20b5c4f28e34cfeeed11c730cebf51671049ad37ace5e204d postgresql-docs-8.0.13.tar.bz2 2271196
+MD5 824caf8451dec685a0d5886eb4892807 postgresql-opt-8.0.13.tar.bz2 134769
+RMD160 f3fb741c5dcff23045a58baf57f4386099e3c563 postgresql-opt-8.0.13.tar.bz2 134769
+SHA256 9f63fc12ede1a605934cdc462ff45c0e924288284f411ae38dec1c5b6e87ce25 postgresql-opt-8.0.13.tar.bz2 134769
+MD5 e736c9887ca4c66051501ce2b95a88f8 postgresql-test-8.0.13.tar.bz2 932945
+RMD160 d1a1c5e05337d82fb1fc2a7249e98ce8df375978 postgresql-test-8.0.13.tar.bz2 932945
+SHA256 ea7e45aa8d9d8f127704e659575a0e860fd53abdaefa7c0f256f246c283ff1cf postgresql-test-8.0.13.tar.bz2 932945
diff --git a/dev-db/postgresql/files/digest-postgresql-8.1.9 b/dev-db/postgresql/files/digest-postgresql-8.1.9
new file mode 100644
index 0000000..a20386c
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.1.9
@@ -0,0 +1,12 @@
+MD5 44582cd7184badf63d9c558f91cdd128 postgresql-base-8.1.9.tar.bz2 8108212
+RMD160 e10c91f95e16cfcdf10235d533855676f8e03ceb postgresql-base-8.1.9.tar.bz2 8108212
+SHA256 4d11584d545d5f18566bc1bf65409794adceef1825dc4850514238f6b5d3f5fd postgresql-base-8.1.9.tar.bz2 8108212
+MD5 a13ad4fbe78aa2ab4f86381cfcec8eb7 postgresql-docs-8.1.9.tar.bz2 2503673
+RMD160 68df3beb8c8f2ccdcf0f3875d4d1bacf1ad3017d postgresql-docs-8.1.9.tar.bz2 2503673
+SHA256 9b1f5d47345067baf9ecc71941707199d055d2f147a206b1b70245a9d5c45b30 postgresql-docs-8.1.9.tar.bz2 2503673
+MD5 26fed39417431ff56e213caf11dc7215 postgresql-opt-8.1.9.tar.bz2 144737
+RMD160 3541c7c2d86e7a9d129d521c3a7bac189758d1a5 postgresql-opt-8.1.9.tar.bz2 144737
+SHA256 b8c5c3098c53e8c8b722ba8928787eb7478beeb3c6b42adbaad1d8ca24d2e49f postgresql-opt-8.1.9.tar.bz2 144737
+MD5 abd4d19d536f846eb37f63d50bbfc02f postgresql-test-8.1.9.tar.bz2 948085
+RMD160 80f20a3353ee437efc78390d8d2d0d12c5cb519f postgresql-test-8.1.9.tar.bz2 948085
+SHA256 2dd60f661df70d43b261af0722e768f6ec4dc856c765c3dd9cd24042089323ba postgresql-test-8.1.9.tar.bz2 948085
diff --git a/dev-db/postgresql/files/digest-postgresql-8.2.4-r1 b/dev-db/postgresql/files/digest-postgresql-8.2.4-r1
new file mode 100644
index 0000000..6035a30
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.2.4-r1
@@ -0,0 +1,12 @@
+MD5 5c0576627c9969a3cedb6b014fb6ae05 postgresql-base-8.2.4.tar.bz2 8549159
+RMD160 876105c3cc9d36b66cf9dc9b687d4b6f6b2c3d9c postgresql-base-8.2.4.tar.bz2 8549159
+SHA256 8ee5ad364ee21079ce3d726b4abcfa0f318015a331e37e9856a3500fcce74cca postgresql-base-8.2.4.tar.bz2 8549159
+MD5 7d520a0fc88c8b59338c25cf18331f6a postgresql-docs-8.2.4.tar.bz2 2769630
+RMD160 bcdb176f509f69141524ababa0f6c9b1a1dd5c3f postgresql-docs-8.2.4.tar.bz2 2769630
+SHA256 2bb5bea974a68f562e40104d756ea87dbd831cf8fbd4bb54faca38f23c87de4c postgresql-docs-8.2.4.tar.bz2 2769630
+MD5 b71b0526e7c8af22d82fbc7b6f81a750 postgresql-opt-8.2.4.tar.bz2 167612
+RMD160 aaacb743be86afbfe0f885b7994c15c94fef2413 postgresql-opt-8.2.4.tar.bz2 167612
+SHA256 5977ca1f0913aa98bc889e49b38768621865959b14e2674e7716d44b7fe9eb35 postgresql-opt-8.2.4.tar.bz2 167612
+MD5 0fefe28b8c9d16ebdf6f05c366477a9d postgresql-test-8.2.4.tar.bz2 985819
+RMD160 c5fcbef081565f7ba02fc4ac96ce8e1f4141c3ae postgresql-test-8.2.4.tar.bz2 985819
+SHA256 fc4471ecece04251289cfe7feb0acbafa3a18cf8f35c2d61ce3f68bd4394e504 postgresql-test-8.2.4.tar.bz2 985819
diff --git a/dev-db/postgresql/files/pg_autovacuum.conf-7.4 b/dev-db/postgresql/files/pg_autovacuum.conf-7.4
new file mode 100644
index 0000000..7a745c9
--- /dev/null
+++ b/dev-db/postgresql/files/pg_autovacuum.conf-7.4
@@ -0,0 +1,18 @@
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PG_AUTOVACUUM_LOG="/var/lib/postgresql/data/pg_autovacuum.log"
+
+# PostgreSQL user
+PGUSER="postgres"
+
+# If you changed the default database port, you have to set
+# PGPORT to the new port number, otherwise pg_autovacuum won't work.
+#PGPORT=5432
+
+# See the pg_autovacuum documentation for the details of how these
+# parameters affect pg_autovacuum's aggressiveness.
+
+VACUUM_BASE="1000"
+VACUUM_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
new file mode 100644
index 0000000..7a745c9
--- /dev/null
+++ b/dev-db/postgresql/files/pg_autovacuum.conf-8.0
@@ -0,0 +1,18 @@
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PG_AUTOVACUUM_LOG="/var/lib/postgresql/data/pg_autovacuum.log"
+
+# PostgreSQL user
+PGUSER="postgres"
+
+# If you changed the default database port, you have to set
+# PGPORT to the new port number, otherwise pg_autovacuum won't work.
+#PGPORT=5432
+
+# See the pg_autovacuum documentation for the details of how these
+# parameters affect pg_autovacuum's aggressiveness.
+
+VACUUM_BASE="1000"
+VACUUM_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
new file mode 100644
index 0000000..ec157a2
--- /dev/null
+++ b/dev-db/postgresql/files/pg_autovacuum.init-7.4
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# 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.3 2006/11/11 13:39:14 dev-zero Exp $
+
+depend() {
+ need postgresql logger
+}
+
+start() {
+ ebegin "Starting pg_autovacuum"
+
+ echo
+ echo -n "Waiting max. 20 sec. for PostgreSQL to start "
+ CONTINUE=0
+ TOO_LONG=0
+ 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 ]
+ then
+ CONTINUE=1
+ else
+ echo -n "."
+ TOO_LONG=`expr $TOO_LONG + 1`
+ sleep 1
+ fi
+ done
+
+ start-stop-daemon -o --chuid $PGUSER --start --quiet --exec /usr/bin/pg_autovacuum -- -D ${PGPORT:+-p ${PGPORT}} -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
+ eend 0
+ else
+ 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
+ eerror "Please read ___DOCDIR___/contrib/README.pg_autovacuum for details!"
+ eerror
+ eend 1
+ fi
+}
+
+stop() {
+ ebegin "Stopping pg_autovacuum"
+ start-stop-daemon --stop --quiet --exec /usr/bin/pg_autovacuum
+ eend $?
+}
diff --git a/dev-db/postgresql/files/pg_autovacuum.init-8.0 b/dev-db/postgresql/files/pg_autovacuum.init-8.0
new file mode 100644
index 0000000..a7b4cb9
--- /dev/null
+++ b/dev-db/postgresql/files/pg_autovacuum.init-8.0
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# 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.3 2006/11/11 13:39:14 dev-zero Exp $
+
+depend() {
+ need postgresql logger
+}
+
+start() {
+ ebegin "Starting pg_autovacuum"
+
+ echo
+ echo -n "Waiting max. 20 sec. for PostgreSQL to start "
+ CONTINUE=0
+ TOO_LONG=0
+ 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 ]
+ then
+ CONTINUE=1
+ else
+ echo -n "."
+ TOO_LONG=`expr $TOO_LONG + 1`
+ sleep 1
+ fi
+ done
+
+ start-stop-daemon -o --chuid $PGUSER --start --quiet --exec /usr/bin/pg_autovacuum -- -D ${PGPORT:+-p ${PGPORT}} -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
+ eend 0
+ else
+ 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
+ eerror "Please read ___DOCDIR___/contrib/README.pg_autovacuum for details!"
+ eerror
+ eend 1
+ fi
+}
+
+stop() {
+ ebegin "Stopping pg_autovacuum"
+ start-stop-daemon --stop --quiet --exec /usr/bin/pg_autovacuum
+ eend $?
+}
diff --git a/dev-db/postgresql/files/postgresql-7.3.19-cubeparse.patch b/dev-db/postgresql/files/postgresql-7.3.19-cubeparse.patch
new file mode 100644
index 0000000..705e073
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-7.3.19-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.4.17-hppa-testandset.patch b/dev-db/postgresql/files/postgresql-7.4.17-hppa-testandset.patch
new file mode 100644
index 0000000..d5f916d
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-7.4.17-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.13-sh.patch b/dev-db/postgresql/files/postgresql-8.0.13-sh.patch
new file mode 100644
index 0000000..fc1dafe
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.0.13-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.9-regress_su.patch b/dev-db/postgresql/files/postgresql-8.1.9-regress_su.patch
new file mode 100644
index 0000000..28e2925
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.9-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.9-sh.patch b/dev-db/postgresql/files/postgresql-8.1.9-sh.patch
new file mode 100644
index 0000000..6350771
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.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
+@@ -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-8.2.4-gentoo.patch b/dev-db/postgresql/files/postgresql-8.2.4-gentoo.patch
new file mode 100644
index 0000000..6d47d25
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.2.4-gentoo.patch
@@ -0,0 +1,58 @@
+--- postgresql-8.2.3.orig/src/bin/Makefile 2006-03-05 16:58:50.000000000 +0100
++++ postgresql-8.2.3/src/bin/Makefile 2007-03-29 12:12:26.000000000 +0200
+@@ -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
+--- postgresql-8.2.3.orig/src/interfaces/Makefile 2004-04-20 02:33:51.000000000 +0200
++++ postgresql-8.2.3/src/interfaces/Makefile 2007-03-29 12:14:01.000000000 +0200
+@@ -12,7 +12,7 @@
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
+-DIRS := libpq ecpg
++DIRS := ecpg
+
+ ALLDIRS := $(DIRS)
+
+--- postgresql-8.2.3.orig/src/Makefile 2006-06-23 01:50:35.000000000 +0200
++++ postgresql-8.2.3/src/Makefile 2007-03-29 12:54:59.000000000 +0200
+@@ -18,12 +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 test/regress $@
+
+ install: install-local
+
+@@ -47,7 +45,6 @@
+ $(MAKE) -C port $@
+ $(MAKE) -C timezone $@
+ $(MAKE) -C backend $@
+- $(MAKE) -C include $@
+ $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+@@ -60,12 +57,10 @@
+ -$(MAKE) -C port $@
+ -$(MAKE) -C timezone $@
+ -$(MAKE) -C backend $@
+- -$(MAKE) -C include $@
+ -$(MAKE) -C interfaces $@
+ -$(MAKE) -C bin $@
+ -$(MAKE) -C pl $@
+ -$(MAKE) -C makefiles $@
+- -$(MAKE) -C test $@
+ -$(MAKE) -C tutorial NO_PGXS=1 $@
+ -$(MAKE) -C test/thread $@
+ rm -f Makefile.port Makefile.global
diff --git a/dev-db/postgresql/files/postgresql-8.2.4-no-test.patch b/dev-db/postgresql/files/postgresql-8.2.4-no-test.patch
new file mode 100644
index 0000000..0f887e2
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.2.4-no-test.patch
@@ -0,0 +1,12 @@
+diff --git a/src/Makefile b/src/Makefile
+index 5eb7c4a..0f9fff0 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -22,7 +22,6 @@ all install installdirs uninstall dep de
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+ $(MAKE) -C makefiles $@
+- $(MAKE) -C test/regress $@
+
+ install: install-local
+
diff --git a/dev-db/postgresql/files/postgresql-8.2.4-regress_fix.patch b/dev-db/postgresql/files/postgresql-8.2.4-regress_fix.patch
new file mode 100644
index 0000000..0af8c3f
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.2.4-regress_fix.patch
@@ -0,0 +1,31 @@
+diff --git a/src/test/regress/expected/interval.out b/src/test/regress/expected/interval.out
+index f7c35de..183a963 100644
+--- a/src/test/regress/expected/interval.out
++++ b/src/test/regress/expected/interval.out
+@@ -293,12 +293,6 @@ (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 10 days 4 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/src/test/regress/sql/interval.sql b/src/test/regress/sql/interval.sql
+index 9b2e625..cb44d12 100644
+--- a/src/test/regress/sql/interval.sql
++++ b/src/test/regress/sql/interval.sql
+@@ -101,9 +101,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;
+
diff --git a/dev-db/postgresql/files/postgresql-8.2.4-regress_su.patch b/dev-db/postgresql/files/postgresql-8.2.4-regress_su.patch
new file mode 100644
index 0000000..83c56d7
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.2.4-regress_su.patch
@@ -0,0 +1,15 @@
+diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
+index f2319d2..b14a6f0 100644
+--- a/src/test/regress/GNUmakefile
++++ b/src/test/regress/GNUmakefile
+@@ -148,7 +148,8 @@ ##
+ 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)
++ chown portage testtablespace .
++ su -s /bin/sh portage -c "./pg_regress --psqldir=`pwd`/../../bin/psql --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)"
+
+ installcheck: all
+ -rm -rf ./testtablespace
+diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
diff --git a/dev-db/postgresql/files/postgresql-8.2.4-sh.patch b/dev-db/postgresql/files/postgresql-8.2.4-sh.patch
new file mode 100644
index 0000000..295bb6c
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.2.4-sh.patch
@@ -0,0 +1,34 @@
+--- postgresql-8.2.3.orig/src/include/storage/s_lock.h 2006-06-08 00:24:45.000000000 +0200
++++ postgresql-8.2.3/src/include/storage/s_lock.h 2007-03-29 12:25:56.000000000 +0200
+@@ -299,6 +299,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__) /* 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
new file mode 100644
index 0000000..c6fd787
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.conf-7.3
@@ -0,0 +1,13 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/data"
+
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PGLOG="/var/lib/postgresql/data/postgresql.log"
+
+# 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
new file mode 100644
index 0000000..6c8ecc5
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.conf-7.4
@@ -0,0 +1,20 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/data"
+
+# Alternate database data locations
+# Please read http://www.postgresql.org/docs/7.4/static/manage-ag-alternate-locs.html
+# for more information.
+# Example:
+# PGDATA_ALT="PGDATA_RAID=/mnt/superfastraid"
+PGDATA_ALT=
+
+# Logfile path (NOTE: This must be owned by the uid/gid of $PGUSER!)
+PGLOG="/var/lib/postgresql/data/postgresql.log"
+
+# 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
new file mode 100644
index 0000000..6e439fc
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.conf-8.0
@@ -0,0 +1,42 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with
+# -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. (Set it to "forever" if you want to wait forever.)
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect (seconds or "forever")
+WAIT_FOR_DISCONNECT=10
+
+# Time the server has to clean up (seconds or "forever")
+WAIT_FOR_CLEANUP=10
+
+# 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/files/postgresql.conf-8.1 b/dev-db/postgresql/files/postgresql.conf-8.1
new file mode 100644
index 0000000..6e439fc
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.conf-8.1
@@ -0,0 +1,42 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with
+# -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. (Set it to "forever" if you want to wait forever.)
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect (seconds or "forever")
+WAIT_FOR_DISCONNECT=10
+
+# Time the server has to clean up (seconds or "forever")
+WAIT_FOR_CLEANUP=10
+
+# 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/files/postgresql.conf-8.2 b/dev-db/postgresql/files/postgresql.conf-8.2
new file mode 100644
index 0000000..6e439fc
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.conf-8.2
@@ -0,0 +1,42 @@
+# PostgreSQL's Database Directory
+PGDATA="/var/lib/postgresql/data"
+
+# PostgreSQL User
+PGUSER="postgres"
+
+# PostgreSQL Group
+PGGROUP="postgres"
+
+# Extra options to run postmaster with
+# -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. (Set it to "forever" if you want to wait forever.)
+# 3. SIGQUIT
+# This will terminate the server immediately and results in a recovery run for the next start.
+
+# Wait for clients to disconnect (seconds or "forever")
+WAIT_FOR_DISCONNECT=10
+
+# Time the server has to clean up (seconds or "forever")
+WAIT_FOR_CLEANUP=10
+
+# 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/files/postgresql.init-7.3 b/dev-db/postgresql/files/postgresql.init-7.3
new file mode 100644
index 0000000..0d94d14
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-7.3
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# 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.2 2006/11/07 22:48:22 chtekk Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "You must create the $PGDATA directory first!"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ 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
+ ret=0
+ break
+ fi
+
+ if [ $cnt -eq 30 ] ; then
+ eerror
+ eerror "Please check the $PGLOG log file for errors."
+ eerror
+ ret=1
+ break
+ fi
+ sleep 1
+ done
+ eend $ret
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL"
+ su - $PGUSER -c "/usr/bin/pg_ctl stop -D '$PGDATA' -s -m fast"
+ eend $?
+}
+
+svc_restart() {
+ ebegin "Restarting PostgreSQL"
+ su - $PGUSER -c "/usr/bin/pg_ctl restart -D '$PGDATA' -s -m fast -l '$PGLOG' -o '$PGOPTS'"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ su - $PGUSER -c "/usr/bin/pg_ctl reload -D '$PGDATA' -s"
+ eend $?
+}
diff --git a/dev-db/postgresql/files/postgresql.init-7.4 b/dev-db/postgresql/files/postgresql.init-7.4
new file mode 100644
index 0000000..4efe434
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-7.4
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# 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.6 2006/11/11 12:15:02 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+}
+
+checkconfig() {
+ if [ ! -d "$PGDATA" ] ; then
+ eerror "Directory not found: $PGDATA"
+ eerror "You must create the $PGDATA directory first!"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL"
+
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+
+ su - $PGUSER -c "${PGDATA_ALT} /usr/bin/pg_ctl start -D '$PGDATA' -s -l '$PGLOG' -o '$PGOPTS'"
+
+ while :
+ do
+ cnt=$(($cnt + 1))
+ if [ -f "$PGDATA/postmaster.pid" ] ; then
+ ret=0
+ break
+ fi
+
+ if [ $cnt -eq 30 ] ; then
+ eerror
+ eerror "Please check the $PGLOG log file for errors."
+ eerror
+ ret=1
+ break
+ fi
+ sleep 1
+ done
+ eend $ret
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL"
+ su - $PGUSER -c "/usr/bin/pg_ctl stop -D '$PGDATA' -s -m fast"
+ eend $?
+}
+
+svc_restart() {
+ ebegin "Restarting PostgreSQL"
+ su - $PGUSER -c "/usr/bin/pg_ctl restart -D '$PGDATA' -s -m fast -l '$PGLOG' -o '$PGOPTS'"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ su - $PGUSER -c "/usr/bin/pg_ctl reload -D '$PGDATA' -s"
+ eend $?
+}
diff --git a/dev-db/postgresql/files/postgresql.init-8.0 b/dev-db/postgresql/files/postgresql.init-8.0
new file mode 100644
index 0000000..60a2237
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-8.0
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2007 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.4 2007/07/11 08:46:51 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+}
+
+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 --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
+
+ start-stop-daemon --start \
+ --pidfile "${PGDATA}/postmaster.pid" \
+ --chuid ${PGUSER}:${PGGROUP} \
+ --exec /usr/bin/postmaster \
+ -- \
+ -D "${PGDATA}" \
+ --silent-mode=true \
+ ${PGOPTS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL"
+ # Note: we have to do --oknodo here, otherwise it will always fail
+ # when there are open transactions. This bug has been corrected
+ # in baselayout-1.13.0_alpha8.
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}/-INT/${WAIT_FOR_CLEANUP}/-QUIT --oknodo
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql/files/postgresql.init-8.1 b/dev-db/postgresql/files/postgresql.init-8.1
new file mode 100644
index 0000000..666fad2
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-8.1
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2007 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.4 2007/07/11 08:46:51 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+}
+
+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 --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
+
+ start-stop-daemon --start \
+ --pidfile "${PGDATA}/postmaster.pid" \
+ --chuid ${PGUSER}:${PGGROUP} \
+ --exec /usr/bin/postmaster \
+ -- \
+ -D "${PGDATA}" \
+ --silent-mode=true \
+ ${PGOPTS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL"
+ # Note: we have to do --oknodo here, otherwise it will always fail
+ # when there are open transactions. This bug has been corrected
+ # in baselayout-1.13.0_alpha8.
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}/-INT/${WAIT_FOR_CLEANUP}/-QUIT --oknodo
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}
diff --git a/dev-db/postgresql/files/postgresql.init-8.2 b/dev-db/postgresql/files/postgresql.init-8.2
new file mode 100644
index 0000000..0178c2c
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-8.2
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2007 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.2,v 1.2 2007/07/11 08:46:51 dev-zero Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use net
+}
+
+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 --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
+
+ start-stop-daemon --start \
+ --pidfile "${PGDATA}/postmaster.pid" \
+ --chuid ${PGUSER}:${PGGROUP} \
+ --exec /usr/bin/postmaster \
+ -- \
+ -D "${PGDATA}" \
+ --silent-mode=true \
+ ${PGOPTS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PostgreSQL"
+ # Note: we have to do --oknodo here, otherwise it will always fail
+ # when there are open transactions. This bug has been corrected
+ # in baselayout-1.13.0_alpha8.
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
+ --retry -TERM/${WAIT_FOR_DISCONNECT}/-INT/${WAIT_FOR_CLEANUP}/-QUIT --oknodo
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PostgreSQL configuration"
+ start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo
+ eend $?
+}