summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jackson <mjolnir@gentoo.org>2008-01-13 21:20:33 +0000
committerMartin Jackson <mjolnir@gentoo.org>2008-01-13 21:20:33 +0000
commit5b3c4bf1c8cd06ed969336b77c70f580bf1fbff2 (patch)
tree65a2ee48e9f6568f33df4bbd216b38fd0d43a84f /dev-db/postgresql
parentmask openldap 2.4 for testing (diff)
downloadhistorical-5b3c4bf1c8cd06ed969336b77c70f580bf1fbff2.tar.gz
historical-5b3c4bf1c8cd06ed969336b77c70f580bf1fbff2.tar.bz2
historical-5b3c4bf1c8cd06ed969336b77c70f580bf1fbff2.zip
Bump to 8.1.11 for #204760
Package-Manager: portage-2.1.4
Diffstat (limited to 'dev-db/postgresql')
-rw-r--r--dev-db/postgresql/ChangeLog9
-rw-r--r--dev-db/postgresql/Manifest24
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.1.113
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.11-regress_su.patch116
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.11-sh.patch34
-rw-r--r--dev-db/postgresql/postgresql-8.1.11.ebuild249
6 files changed, 430 insertions, 5 deletions
diff --git a/dev-db/postgresql/ChangeLog b/dev-db/postgresql/ChangeLog
index 7c5f13a3367c..ec92d37b27dd 100644
--- a/dev-db/postgresql/ChangeLog
+++ b/dev-db/postgresql/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-db/postgresql
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.357 2008/01/13 20:41:44 mjolnir Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.358 2008/01/13 21:20:32 mjolnir Exp $
+
+*postgresql-8.1.11 (13 Jan 2008)
+
+ 13 Jan 2008; Martin Jackson <mjolnir@gentoo.org>
+ +files/postgresql-8.1.11-regress_su.patch,
+ +files/postgresql-8.1.11-sh.patch, +postgresql-8.1.11.ebuild:
+ Bump to 8.1.11 for #204760
*postgresql-7.3.21 (13 Jan 2008)
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
index 61fcd1e7da88..59e4fc1393c9 100644
--- a/dev-db/postgresql/Manifest
+++ b/dev-db/postgresql/Manifest
@@ -38,6 +38,14 @@ AUX postgresql-8.0.15-sh.patch 617 RMD160 d826fbb45265d09880000ea33ac3323beabb0f
MD5 0616d8126fb38e59b56f2922654e4724 files/postgresql-8.0.15-sh.patch 617
RMD160 d826fbb45265d09880000ea33ac3323beabb0f50 files/postgresql-8.0.15-sh.patch 617
SHA256 420023f4789c650189da203d43b134d511ff1b976d17a3948774b0c7bf72d683 files/postgresql-8.0.15-sh.patch 617
+AUX postgresql-8.1.11-regress_su.patch 5256 RMD160 7fe3080e015dd329e4502958a743f625e1ce9ccd SHA1 da1a69d3a622ebb1f3af68aa6fd0d4939c8e72b7 SHA256 a7ee073ac2940db3d7a8241923a58836c4e0c6b85b3dd3845ee6024cf4b83a05
+MD5 3caefdecf0acf62c7c41bd71a485a8ff files/postgresql-8.1.11-regress_su.patch 5256
+RMD160 7fe3080e015dd329e4502958a743f625e1ce9ccd files/postgresql-8.1.11-regress_su.patch 5256
+SHA256 a7ee073ac2940db3d7a8241923a58836c4e0c6b85b3dd3845ee6024cf4b83a05 files/postgresql-8.1.11-regress_su.patch 5256
+AUX postgresql-8.1.11-sh.patch 617 RMD160 56d0cb67f9b35402aa18dfce97fef343b78e1def SHA1 9ea425884b643a2ab364c4d4baa45e54a782206a SHA256 02ed0204e5075d6989e6d7f99def819396672468f829ce13b03e4763b74c0cad
+MD5 baa6ba3092f75fcde19f31d46909a9dd files/postgresql-8.1.11-sh.patch 617
+RMD160 56d0cb67f9b35402aa18dfce97fef343b78e1def files/postgresql-8.1.11-sh.patch 617
+SHA256 02ed0204e5075d6989e6d7f99def819396672468f829ce13b03e4763b74c0cad files/postgresql-8.1.11-sh.patch 617
AUX postgresql-8.1.9-regress_su.patch 5256 RMD160 7fe3080e015dd329e4502958a743f625e1ce9ccd SHA1 da1a69d3a622ebb1f3af68aa6fd0d4939c8e72b7 SHA256 a7ee073ac2940db3d7a8241923a58836c4e0c6b85b3dd3845ee6024cf4b83a05
MD5 3caefdecf0acf62c7c41bd71a485a8ff files/postgresql-8.1.9-regress_su.patch 5256
RMD160 7fe3080e015dd329e4502958a743f625e1ce9ccd files/postgresql-8.1.9-regress_su.patch 5256
@@ -137,6 +145,7 @@ SHA256 c42e7ba85638a31826b4ed7a92a9f95cd242bbe7c846e52a8b87e0db28c17da5 files/po
DIST postgresql-7.3.21.tar.bz2 9284558 RMD160 f9de4676b4fbe3d96e6d1462b8bc3c05600d6525 SHA1 bdfa3bddc483c6642cc2ee271d076bfaa4c20c92 SHA256 bf44e0ac259e9f6e14ac102f2977496b6996ecea2fd227fbdcea5fa70e342888
DIST postgresql-7.4.19.tar.bz2 10307396 RMD160 c9a1c7dc8e7bf9ce93c3b4f061af0563b1cc2627 SHA1 19c563d47b0d5deeef03b5ca7707c9f1917853ce SHA256 447ac7070aa0a547f17a307e842734fc27e2716cb4a251fa9a810b178d44c389
DIST postgresql-8.0.15.tar.bz2 11253897 RMD160 6aff5c63dce73eea609f0b6e013cd043ae8b7a37 SHA1 66a6fef7749afb91471200005511c04fc1ac2706 SHA256 59408a00db1c73e638a11af10438a827507b7a72b53916d58f2d44c477718714
+DIST postgresql-8.1.11.tar.bz2 11735420 RMD160 9fb98eadc4f1015205970f26b31b68ea0378bda9 SHA1 73c0f09754fc8e3c7f8d7de49d70244b76927416 SHA256 3e91cdfc1353fa9c6416d9fc8ae9d6ab3171565f00aeb6c882214c2f08a03e2e
DIST postgresql-8.2.6.tar.bz2 12559117 RMD160 fa12ce310919cb52be3558d38a7e329bc73bbe33 SHA1 8934dfbd4c1d8c4f2945cb80f02072611681f967 SHA256 ee41327e821f933de2894d6e0c319edc4b63e80cb902e673b490b7eaf4ead114
DIST postgresql-base-7.3.19.tar.bz2 5691127 RMD160 802bbba70d1368097a74de6b67589ab9645597cc SHA1 09206cd4d9c2b5648756eff70f101cec89365776 SHA256 1804e0424e4444f67acfb98b4e4ad2ede26748d1ddb4a9201cbff7627e394e6a
DIST postgresql-base-7.4.17.tar.bz2 6609512 RMD160 cd5aed1fb45cc42e12cca0cd31174b6726dae97b SHA1 2e413d570ed657f941ca77b1ac00ef1eeecddbcc SHA256 f1b7ff754ccb43d4a3a62a9124b1c8ac215e48e5549e620bfcde59124c6f1bc5
@@ -182,6 +191,10 @@ EBUILD postgresql-8.0.15.ebuild 9619 RMD160 ca2a2e8e43313b7cb55caa83bc73a7186958
MD5 153345f366c3cf253a401211df4e72bc postgresql-8.0.15.ebuild 9619
RMD160 ca2a2e8e43313b7cb55caa83bc73a71869581ed1 postgresql-8.0.15.ebuild 9619
SHA256 7a97d603e67cc2dc5acc945d8de99acaad6f8145e47d7b0c426cba93b7608ae9 postgresql-8.0.15.ebuild 9619
+EBUILD postgresql-8.1.11.ebuild 8512 RMD160 fd1e3e761658f1fa937fb72f085269c66c10d027 SHA1 0c3c0b85675184cde28e45fcbce42b26a47cc60d SHA256 b971c804c88ba3960087cf21b538117506582ba75bf8fcf97b826f0c563634b9
+MD5 9d598b03b2099c535419398930107dd8 postgresql-8.1.11.ebuild 8512
+RMD160 fd1e3e761658f1fa937fb72f085269c66c10d027 postgresql-8.1.11.ebuild 8512
+SHA256 b971c804c88ba3960087cf21b538117506582ba75bf8fcf97b826f0c563634b9 postgresql-8.1.11.ebuild 8512
EBUILD postgresql-8.1.9.ebuild 8716 RMD160 5938cfe83a8933fb697c0d836b2793955f018a9e SHA1 d42bb50c7f35f2c1ff87f360759f2ddb74f9a939 SHA256 9346ad55eefd92538a134a6b11ec2c73206ada58fffb6f79ea966cdfb7c83ab7
MD5 5114d2e6a45d0e4c99f081e31fa66f33 postgresql-8.1.9.ebuild 8716
RMD160 5938cfe83a8933fb697c0d836b2793955f018a9e postgresql-8.1.9.ebuild 8716
@@ -194,10 +207,10 @@ EBUILD postgresql-8.2.6.ebuild 8105 RMD160 bd276f9f2146e9f2cd8ee4b5f8268a44f4910
MD5 c1ad598e4670a17e38c672d69ffb0e9a postgresql-8.2.6.ebuild 8105
RMD160 bd276f9f2146e9f2cd8ee4b5f8268a44f4910f64 postgresql-8.2.6.ebuild 8105
SHA256 acd5a1244c989880082430ea1343789d8f7990ce046172758a99cffb1b6ac7eb postgresql-8.2.6.ebuild 8105
-MISC ChangeLog 76456 RMD160 14a0203bd7174f92677dbb3ee09cab80305f1535 SHA1 abae63322a25db3320f3776f246e7ab5c1a1ec2f SHA256 4629f03e0846ae9a836ceb7717ebd032d09d46340a7f2ff61734d5b41c34c8a7
-MD5 595f1c8cdb8f038dec49447a8bc4288a ChangeLog 76456
-RMD160 14a0203bd7174f92677dbb3ee09cab80305f1535 ChangeLog 76456
-SHA256 4629f03e0846ae9a836ceb7717ebd032d09d46340a7f2ff61734d5b41c34c8a7 ChangeLog 76456
+MISC ChangeLog 76680 RMD160 df0749fbb5afaf4e3676c689cd51b45941146cb4 SHA1 f82bb37a40bffb4d44d8469a827077372e366151 SHA256 92e073f5a9d30c674223f1a2258abb213f07d20cae031065d6c1175b8178d0f2
+MD5 c706ff8a75740c9a0b0d64a81a6698f9 ChangeLog 76680
+RMD160 df0749fbb5afaf4e3676c689cd51b45941146cb4 ChangeLog 76680
+SHA256 92e073f5a9d30c674223f1a2258abb213f07d20cae031065d6c1175b8178d0f2 ChangeLog 76680
MISC metadata.xml 164 RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc SHA1 f67b7ac1c5e6e65ef5a19a589d4759c84918f86c SHA256 7e8e8126bc8701c4a42c7dfed8bb755ac6040fe3d0e3f994d888f8b2b4fa7d8b
MD5 6fe52df942ef15801d56449cd8299604 metadata.xml 164
RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc metadata.xml 164
@@ -220,6 +233,9 @@ SHA256 b307557da314dd1a813501cfbf1054e18221024f2dc5b8410f62ee37030ffe72 files/di
MD5 e0438519efec2797b6430212965d56eb files/digest-postgresql-8.0.15 262
RMD160 1ad7b4f3a03631b3b6dbcf2fcf75bd8b3facb344 files/digest-postgresql-8.0.15 262
SHA256 b7dedc99319f205c529bfc325277f1df69e4b605c49772db743936f31945f11f files/digest-postgresql-8.0.15 262
+MD5 8e0b9ba7ccb589a185904e1b7e564181 files/digest-postgresql-8.1.11 262
+RMD160 7f74888cad6f2898b7066b15796e33793986bfc7 files/digest-postgresql-8.1.11 262
+SHA256 0f8bbcf23f2f4a78191e2354d70d371e2fcdbf5bd931907c360b65270245d68e files/digest-postgresql-8.1.11 262
MD5 55e13506c44ed85e1bac4fb9261c6c51 files/digest-postgresql-8.1.9 1075
RMD160 cec4abffe35cc6dc7157421a4899f70534ece108 files/digest-postgresql-8.1.9 1075
SHA256 6093606fa8b0a2a30a482349bdb4c3aa88e29f2f4db3b393ca6fac95d9494390 files/digest-postgresql-8.1.9 1075
diff --git a/dev-db/postgresql/files/digest-postgresql-8.1.11 b/dev-db/postgresql/files/digest-postgresql-8.1.11
new file mode 100644
index 000000000000..86701fa789ce
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.1.11
@@ -0,0 +1,3 @@
+MD5 48922512bcf683d5ea22a99df5eaaecd postgresql-8.1.11.tar.bz2 11735420
+RMD160 9fb98eadc4f1015205970f26b31b68ea0378bda9 postgresql-8.1.11.tar.bz2 11735420
+SHA256 3e91cdfc1353fa9c6416d9fc8ae9d6ab3171565f00aeb6c882214c2f08a03e2e postgresql-8.1.11.tar.bz2 11735420
diff --git a/dev-db/postgresql/files/postgresql-8.1.11-regress_su.patch b/dev-db/postgresql/files/postgresql-8.1.11-regress_su.patch
new file mode 100644
index 000000000000..28e29253dacb
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.11-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.11-sh.patch b/dev-db/postgresql/files/postgresql-8.1.11-sh.patch
new file mode 100644
index 000000000000..6350771080e8
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.11-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/postgresql-8.1.11.ebuild b/dev-db/postgresql/postgresql-8.1.11.ebuild
new file mode 100644
index 000000000000..f8795eb090bf
--- /dev/null
+++ b/dev-db/postgresql/postgresql-8.1.11.ebuild
@@ -0,0 +1,249 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.1.11.ebuild,v 1.1 2008/01/13 21:20:32 mjolnir 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}-${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 )
+ virtual/logger"
+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}"
+
+ # libpq is provided separately as dev-db/libpq
+ sed -i -e 's/^DIRS := libpq ecpg/DIRS := ecpg/' src/interfaces/Makefile
+ sed -i -e '/\W\+\$.MAKE. -C include \$/d' src/Makefile
+ sed -i -e '/^\W\+psql scripts pg_config pg_controldata/ s/pg_config //' src/bin/Makefile
+
+ epatch "${FILESDIR}/${P}-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}/${P}-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}/${P}-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."
+ elog
+ elog "If you need a global psqlrc-file, you can place it in '${ROOT%/}/etc/postgresql/'."
+}
+
+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."
+}