summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorMatsuu Takuto <matsuu@gentoo.org>2005-05-07 08:35:01 +0000
committerMatsuu Takuto <matsuu@gentoo.org>2005-05-07 08:35:01 +0000
commitfb45b89804491b038e5882d9d63723951b529784 (patch)
treef3c1c4cccbca2a29d9afcd60f6a3eb466c0aa08d /dev-db
parentno longer uses mad (diff)
downloadhistorical-fb45b89804491b038e5882d9d63723951b529784.tar.gz
historical-fb45b89804491b038e5882d9d63723951b529784.tar.bz2
historical-fb45b89804491b038e5882d9d63723951b529784.zip
security bump - CAN-2005-1409, CAN-2005-1410 - bug 91231.
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/postgresql/ChangeLog12
-rw-r--r--dev-db/postgresql/Manifest21
-rw-r--r--dev-db/postgresql/files/CAN-2005-1409-doc.patch37
-rw-r--r--dev-db/postgresql/files/CAN-2005-1409.patch24
-rw-r--r--dev-db/postgresql/files/CAN-2005-1410.patch83
-rw-r--r--dev-db/postgresql/files/digest-postgresql-7.4.7-r24
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.0.1-r34
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.0.2-r13
-rw-r--r--dev-db/postgresql/postgresql-7.4.7-r2.ebuild314
-rw-r--r--dev-db/postgresql/postgresql-8.0.1-r3.ebuild234
-rw-r--r--dev-db/postgresql/postgresql-8.0.2-r1.ebuild236
11 files changed, 960 insertions, 12 deletions
diff --git a/dev-db/postgresql/ChangeLog b/dev-db/postgresql/ChangeLog
index 5b357ffc1b66..0425e3db7619 100644
--- a/dev-db/postgresql/ChangeLog
+++ b/dev-db/postgresql/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for dev-db/postgresql
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.203 2005/05/05 23:04:01 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.204 2005/05/07 08:35:01 matsuu Exp $
+
+*postgresql-8.0.2-r1 (07 May 2005)
+*postgresql-8.0.1-r3 (07 May 2005)
+*postgresql-7.4.7-r2 (07 May 2005)
+
+ 07 May 2005; MATSUU Takuto <matsuu@gentoo.org>
+ +files/CAN-2005-1409-doc.patch, +files/CAN-2005-1409.patch,
+ +files/CAN-2005-1410.patch, +postgresql-7.4.7-r2.ebuild,
+ +postgresql-8.0.1-r3.ebuild, +postgresql-8.0.2-r1.ebuild:
+ security bump - CAN-2005-1409, CAN-2005-1410 - bug 91231.
05 May 2005; Sven Wegener <swegener@gentoo.org>
postgresql-7.3.6-r2.ebuild, postgresql-7.3.9-r1.ebuild,
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
index 4bf722228a3f..2f5ea0fc18e3 100644
--- a/dev-db/postgresql/Manifest
+++ b/dev-db/postgresql/Manifest
@@ -1,16 +1,21 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
MD5 7c4985fe29bbff02173bccc94a3fafcb postgresql-8.0.2.ebuild 7718
+MD5 843575b4a141ca48bf3e1c6044f132d5 postgresql-8.0.1-r3.ebuild 7791
MD5 7df0eb9c1b199df87cf6a16309fdba7c postgresql-7.4.7-r1.ebuild 10750
MD5 1bf725f1e46685699f62d97f7ca0e821 postgresql-7.3.9-r1.ebuild 8078
MD5 461bda3ff314acce4f6a587a61864385 postgresql-8.0.1-r2.ebuild 7633
+MD5 3ccd9f609f0cdc19cb5d5472d05e832d postgresql-8.0.2-r1.ebuild 7870
+MD5 7064655b3e209bdd575f3b2602761e22 postgresql-7.4.7-r2.ebuild 10907
MD5 b97f1ff215bab634316e5cf9cee6598e postgresql-7.3.6-r2.ebuild 7869
-MD5 193bd3c14384969224d5e9a7d4483212 ChangeLog 38269
+MD5 f6b7f45b24a7348348b250594c5da9bb ChangeLog 38664
MD5 f8d3d207746da2a3cd14dcaab8daab76 metadata.xml 163
+MD5 90acacf5efb7b8a73ec5d34128358c32 files/CAN-2005-1409.patch 1698
MD5 2e87af398df0a957bf2f2dff754ac174 files/postgresql-7.4.7-vacuum-delay.patch 8918
MD5 df4fedbfa30df690a6f78da9f5a44196 files/postgresql-7.4.7-securityfix.patch 1773
+MD5 8ca6301197c0d45d7530d4117d087b15 files/CAN-2005-1409-doc.patch 1749
+MD5 3c53278e59e16caa55429700c0da42f9 files/CAN-2005-1410.patch 2843
MD5 80e1a39d06466a396d8a2a1a5ff3b04a files/digest-postgresql-8.0.1-r2 293
+MD5 80e1a39d06466a396d8a2a1a5ff3b04a files/digest-postgresql-8.0.1-r3 293
+MD5 9ba8eab19589a7ab8044a83fca22e928 files/digest-postgresql-8.0.2-r1 223
MD5 6237c18ae647e118e23425e3cb28c8aa files/postgresql.init-7.3.6 1279
MD5 5d90779b8c5b7d63ea0846f2a534fc87 files/postgresql.init-7.3.9 1279
MD5 8b2a2b4c8f40a1fdbe73d7a6fbcfb6fe files/postgresql.init-7.4.7 1279
@@ -34,13 +39,7 @@ MD5 3665230043dd69d562482d92f2d08286 files/postgresql-8.0.1-gentoo.patch 808
MD5 3b4cbf59561d655b882ab335b892909d files/digest-postgresql-7.3.6-r2 223
MD5 f96713c7df9eb83197d57a6e22cdeedf files/digest-postgresql-7.3.9-r1 223
MD5 b6200bc7bb2b1078ce182692c618f8a5 files/digest-postgresql-7.4.7-r1 290
+MD5 b6200bc7bb2b1078ce182692c618f8a5 files/digest-postgresql-7.4.7-r2 290
MD5 e91e3b293273f041b209aa65ff6ceebc files/postgresql-7.4.7-gentoo.patch 1160
MD5 bd8092be6ccc6918973d9654caacbfab files/postgresql-7.4.7-hppa-testandset.patch 1596
MD5 2b0c84d2c26622573d4e2b7e0518fdad files/postgresql.conf 375
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
-
-iD8DBQFCeqZpI1lqEGTUzyQRAswnAKDddUITAmF9+233YUfSWPtyRJECgACgx7wS
-94tHJJmq09cOju2hnZpfEDU=
-=0cao
------END PGP SIGNATURE-----
diff --git a/dev-db/postgresql/files/CAN-2005-1409-doc.patch b/dev-db/postgresql/files/CAN-2005-1409-doc.patch
new file mode 100644
index 000000000000..85ff53329cb2
--- /dev/null
+++ b/dev-db/postgresql/files/CAN-2005-1409-doc.patch
@@ -0,0 +1,37 @@
+diff -ruN postgresql-7.4.5-old/doc/src/sgml/ref/create_conversion.sgml postgresql-7.4.5/doc/src/sgml/ref/create_conversion.sgml
+--- postgresql-7.4.5-old/doc/src/sgml/ref/create_conversion.sgml 2003-09-22 02:16:57.000000000 +0200
++++ postgresql-7.4.5/doc/src/sgml/ref/create_conversion.sgml 2005-05-04 12:49:46.643170384 +0200
+@@ -8,7 +8,7 @@
+
+ <refnamediv>
+ <refname>CREATE CONVERSION</refname>
+- <refpurpose>define a new conversion</refpurpose>
++ <refpurpose>define a new encoding conversion</refpurpose>
+ </refnamediv>
+
+ <indexterm zone="sql-createconversion">
+@@ -26,10 +26,12 @@
+ <title>Description</title>
+
+ <para>
+- <command>CREATE CONVERSION</command> defines a new encoding
+- conversion. Conversion names may be used in the <function>convert</function> function
++ <command>CREATE CONVERSION</command> defines a new conversion between
++ character set encodings. Conversion names may be used in the
++ <function>convert</function> function
+ to specify a particular encoding conversion. Also, conversions that
+- are marked <literal>DEFAULT</> can be used for automatic encoding conversion between
++ are marked <literal>DEFAULT</> can be used for automatic encoding
++ conversion between
+ client and server. For this purpose, two conversions, from encoding A to
+ B <emphasis>and</emphasis> from encoding B to A, must be defined.
+ </para>
+@@ -109,7 +111,7 @@
+ integer, -- source encoding ID
+ integer, -- destination encoding ID
+ cstring, -- source string (null terminated C string)
+- cstring, -- destination string (null terminated C string)
++ internal, -- destination (fill with a null terminated C string)
+ integer -- source string length
+ ) RETURNS void;
+ </programlisting>
diff --git a/dev-db/postgresql/files/CAN-2005-1409.patch b/dev-db/postgresql/files/CAN-2005-1409.patch
new file mode 100644
index 000000000000..38070f2d34fd
--- /dev/null
+++ b/dev-db/postgresql/files/CAN-2005-1409.patch
@@ -0,0 +1,24 @@
+diff -ruN postgresql-7.4.5-old/src/backend/commands/conversioncmds.c postgresql-7.4.5/src/backend/commands/conversioncmds.c
+--- postgresql-7.4.5-old/src/backend/commands/conversioncmds.c 2003-08-04 04:39:58.000000000 +0200
++++ postgresql-7.4.5/src/backend/commands/conversioncmds.c 2005-05-04 12:49:46.654168712 +0200
+@@ -46,7 +46,7 @@
+ const char *from_encoding_name = stmt->for_encoding_name;
+ const char *to_encoding_name = stmt->to_encoding_name;
+ List *func_name = stmt->func_name;
+- static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, CSTRINGOID, INT4OID};
++ static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, INTERNALOID, INT4OID};
+
+ /* Convert list of names to a name and namespace */
+ namespaceId = QualifiedNameGetCreationNamespace(stmt->conversion_name,
+diff -ruN postgresql-7.4.5-old/src/backend/utils/mb/conversion_procs/Makefile postgresql-7.4.5/src/backend/utils/mb/conversion_procs/Makefile
+--- postgresql-7.4.5-old/src/backend/utils/mb/conversion_procs/Makefile 2004-01-21 20:25:11.000000000 +0100
++++ postgresql-7.4.5/src/backend/utils/mb/conversion_procs/Makefile 2005-05-04 12:49:46.671166128 +0200
+@@ -157,7 +157,7 @@
+ func=$$1; shift; \
+ obj=$$1; shift; \
+ echo "-- $$se --> $$de"; \
+- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, CSTRING, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;"; \
++ echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;"; \
+ echo "DROP CONVERSION pg_catalog.$$name;"; \
+ echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
+ done > $@
diff --git a/dev-db/postgresql/files/CAN-2005-1410.patch b/dev-db/postgresql/files/CAN-2005-1410.patch
new file mode 100644
index 000000000000..611f0770b7ff
--- /dev/null
+++ b/dev-db/postgresql/files/CAN-2005-1410.patch
@@ -0,0 +1,83 @@
+diff -ruN postgresql-7.4.5-old/contrib/tsearch2/gendict/sql.IN postgresql-7.4.5/contrib/tsearch2/gendict/sql.IN
+--- postgresql-7.4.5-old/contrib/tsearch2/gendict/sql.IN 2003-07-21 12:27:00.000000000 +0200
++++ postgresql-7.4.5/contrib/tsearch2/gendict/sql.IN 2005-05-04 12:58:47.886888832 +0200
+@@ -1,7 +1,7 @@
+ SET search_path = public;
+ BEGIN;
+
+-HASINIT create function dinit_CFG_MODNAME(text)
++HASINIT create function dinit_CFG_MODNAME(internal)
+ HASINIT returns internal
+ HASINIT as 'MODULE_PATHNAME'
+ HASINIT language 'C';
+diff -ruN postgresql-7.4.5-old/contrib/tsearch2/tsearch.sql.in postgresql-7.4.5/contrib/tsearch2/tsearch.sql.in
+--- postgresql-7.4.5-old/contrib/tsearch2/tsearch.sql.in 2004-02-21 04:48:55.000000000 +0100
++++ postgresql-7.4.5/contrib/tsearch2/tsearch.sql.in 2005-05-04 12:58:47.888888528 +0200
+@@ -44,7 +44,7 @@
+ with (isstrict);
+
+ --built-in dictionaries
+-CREATE FUNCTION dex_init(text)
++CREATE FUNCTION dex_init(internal)
+ returns internal
+ as 'MODULE_PATHNAME'
+ language 'C';
+@@ -63,7 +63,7 @@
+ 'Simple example of dictionary.'
+ ;
+
+-CREATE FUNCTION snb_en_init(text)
++CREATE FUNCTION snb_en_init(internal)
+ returns internal
+ as 'MODULE_PATHNAME'
+ language 'C';
+@@ -82,7 +82,7 @@
+ 'English Stemmer. Snowball.'
+ ;
+
+-CREATE FUNCTION snb_ru_init(text)
++CREATE FUNCTION snb_ru_init(internal)
+ returns internal
+ as 'MODULE_PATHNAME'
+ language 'C';
+@@ -95,7 +95,7 @@
+ 'Russian Stemmer. Snowball.'
+ ;
+
+-CREATE FUNCTION spell_init(text)
++CREATE FUNCTION spell_init(internal)
+ returns internal
+ as 'MODULE_PATHNAME'
+ language 'C';
+@@ -114,7 +114,7 @@
+ 'ISpell interface. Must have .dict and .aff files'
+ ;
+
+-CREATE FUNCTION syn_init(text)
++CREATE FUNCTION syn_init(internal)
+ returns internal
+ as 'MODULE_PATHNAME'
+ language 'C';
+diff -ruN postgresql-7.4.5-old/contrib/tsearch2/untsearch.sql.in postgresql-7.4.5/contrib/tsearch2/untsearch.sql.in
+--- postgresql-7.4.5-old/contrib/tsearch2/untsearch.sql.in 2003-08-06 11:19:20.000000000 +0200
++++ postgresql-7.4.5/contrib/tsearch2/untsearch.sql.in 2005-05-04 12:58:47.891888072 +0200
+@@ -34,14 +34,14 @@
+ DROP FUNCTION lexize(text);
+ DROP FUNCTION set_curdict(int);
+ DROP FUNCTION set_curdict(text);
+-DROP FUNCTION dex_init(text);
++DROP FUNCTION dex_init(internal);
+ DROP FUNCTION dex_lexize(internal,internal,int4);
+-DROP FUNCTION snb_en_init(text);
++DROP FUNCTION snb_en_init(internal);
+ DROP FUNCTION snb_lexize(internal,internal,int4);
+-DROP FUNCTION snb_ru_init(text);
+-DROP FUNCTION spell_init(text);
++DROP FUNCTION snb_ru_init(internal);
++DROP FUNCTION spell_init(internal);
+ DROP FUNCTION spell_lexize(internal,internal,int4);
+-DROP FUNCTION syn_init(text);
++DROP FUNCTION syn_init(internal);
+ DROP FUNCTION syn_lexize(internal,internal,int4);
+ DROP FUNCTION set_curprs(int);
+ DROP FUNCTION set_curprs(text);
diff --git a/dev-db/postgresql/files/digest-postgresql-7.4.7-r2 b/dev-db/postgresql/files/digest-postgresql-7.4.7-r2
new file mode 100644
index 000000000000..1b1c931e6d98
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-7.4.7-r2
@@ -0,0 +1,4 @@
+MD5 70c07688c89f5fc7dbd9b8caee123582 postgresql-base-7.4.7.tar.bz2 6582981
+MD5 b72409a2d57c73bf6347e0d19b2cfb6e postgresql-opt-7.4.7.tar.bz2 332158
+MD5 4fed2346dd0ec798554c055afaa84a89 postgresql-docs-7.4.7.tar.bz2 2417733
+MD5 16d037213b879963724da7809a0a1589 hier-Pg7.4-0.5.3.tar.gz 34662
diff --git a/dev-db/postgresql/files/digest-postgresql-8.0.1-r3 b/dev-db/postgresql/files/digest-postgresql-8.0.1-r3
new file mode 100644
index 000000000000..ac51ef3dcc05
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.0.1-r3
@@ -0,0 +1,4 @@
+MD5 b8f8edce5b29bcf785251693c6225885 postgresql-base-8.0.1.tar.bz2 7798118
+MD5 130474770b88fd059c2dff457fb06b0a postgresql-opt-8.0.1.tar.bz2 133466
+MD5 f51624e70b9fca4ebd6bb56ba8587b97 postgresql-docs-8.0.1.tar.bz2 2198650
+MD5 1d410cfb38253675fee36c8f9ee655e2 hier-Pg8.0.1-0.5.4.diff.gz 30662
diff --git a/dev-db/postgresql/files/digest-postgresql-8.0.2-r1 b/dev-db/postgresql/files/digest-postgresql-8.0.2-r1
new file mode 100644
index 000000000000..462e8d577622
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.0.2-r1
@@ -0,0 +1,3 @@
+MD5 39ef5bfca3d573b356c755b5429aea8b postgresql-base-8.0.2.tar.bz2 7806083
+MD5 ed57846ed0b4a0044fe545437fcf6f6f postgresql-opt-8.0.2.tar.bz2 133708
+MD5 9840cc8892ac52e7ae0ac5a357b5b610 postgresql-docs-8.0.2.tar.bz2 2202096
diff --git a/dev-db/postgresql/postgresql-7.4.7-r2.ebuild b/dev-db/postgresql/postgresql-7.4.7-r2.ebuild
new file mode 100644
index 000000000000..252e05d5e2a6
--- /dev/null
+++ b/dev-db/postgresql/postgresql-7.4.7-r2.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.4.7-r2.ebuild,v 1.1 2005/05/07 08:35:01 matsuu Exp $
+
+inherit eutils gnuconfig flag-o-matic java-pkg multilib toolchain-funcs
+
+DESCRIPTION="sophisticated Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+P_HIERPG="hier-Pg7.4-0.5.3"
+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 )
+ pg-hier? ( ftp://gborg.postgresql.org/pub/hierpg/stable/${P_HIERPG}.tar.gz )"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~s390 ~ppc64"
+IUSE="ssl nls java python tcltk perl libg++ pam readline zlib doc pg-hier pg-vacuumdelay pg-intdatetime threads xml2 selinux"
+
+DEPEND="virtual/libc
+ sys-devel/autoconf
+ >=sys-libs/ncurses-5.2
+ >=sys-devel/bison-1.875
+ zlib? ( >=sys-libs/zlib-1.1.3 )
+ readline? ( >=sys-libs/readline-4.1 )
+ tcltk? ( >=dev-lang/tcl-8 >=dev-lang/tk-8.3.3-r1 )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ java? ( >=virtual/jdk-1.3 >=dev-java/ant-1.3
+ dev-java/java-config )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ nls? ( sys-devel/gettext )
+ xml2? ( dev-libs/libxml2 dev-libs/libxslt dev-util/pkgconfig )"
+# java dep workaround for portage bug
+# x86? ( java? ( =dev-java/sun-jdk-1.3* >=dev-java/ant-1.3 ) )
+RDEPEND="virtual/libc
+ zlib? ( >=sys-libs/zlib-1.1.3 )
+ tcltk? ( >=dev-lang/tcl-8 )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 )
+ java? ( >=virtual/jdk-1.3 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ xml2? ( dev-libs/libxml2 dev-libs/libxslt )"
+
+PG_DIR="/var/lib/postgresql"
+MAX_CONNECTIONS=1024
+
+pkg_setup() {
+ if [ -f ${PG_DIR}/data/PG_VERSION ] ; then
+ PG_MAJOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f1 -d.`
+ PG_MINOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f2 -d.`
+ if [ ${PG_MAJOR} -lt 7 ] || [ ${PG_MAJOR} -eq 7 -a ${PG_MINOR} -lt 4 ] ; then
+ eerror "Postgres ${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})."
+ exit 1
+ fi
+ fi
+}
+
+check_java_config() {
+ JDKHOME="`java-config --jdk-home`"
+ if [[ -z "${JDKHOME}" || ! -d "${JDKHOME}" ]]; then
+ NOJDKERROR="You need to use java-config to set your JVM to a JDK!"
+ eerror "${NOJDKERROR}"
+ die "${NOJDKERROR}"
+ fi
+}
+
+src_unpack() {
+ unpack ${A} || die
+ epatch ${FILESDIR}/${P}-gentoo.patch
+ cd ${S}
+ epatch ${FILESDIR}/${P}-securityfix.patch
+
+ if use pg-hier; then
+ cd ${S} || die
+ epatch ${WORKDIR}/${P_HIERPG}.diff
+ fi
+
+ if use pg-vacuumdelay; then
+ cd ${S} || die
+ epatch ${FILESDIR}/${P}-vacuum-delay.patch
+ fi
+
+ if [ "${ARCH}" = "hppa" ]
+ then
+ cd ${S}
+ epatch ${FILESDIR}/${P}-hppa-testandset.patch
+ fi
+
+ # Bug 91231
+ epatch ${FILESDIR}/CAN-2005-1409.patch
+ epatch ${FILESDIR}/CAN-2005-1410.patch
+ use doc && epatch ${FILESDIR}/CAN-2005-1409-doc.patch
+}
+
+src_compile() {
+ filter-flags -ffast-math
+
+ if use java; then
+ check_java_config
+ fi
+
+ local myconf
+ use tcltk && myconf="--with-tcl"
+ use python && myconf="$myconf --with-python"
+ use perl && myconf="$myconf --with-perl"
+ use java && myconf="$myconf --with-java"
+ use ssl && myconf="$myconf --with-openssl"
+ use nls && myconf="$myconf --enable-nls"
+ use libg++ && myconf="$myconf --with-CXX"
+ use pam && myconf="$myconf --with-pam"
+ use readline || myconf="$myconf --without-readline"
+ use zlib || myconf="$myconf --without-zlib"
+ use pg-intdatetime && myconf="$myconf --enable-integer-datetimes"
+ use threads && myconf="$myconf --enable-thread-safety"
+
+ # these are the only working CFLAGS I could get on ppc, so locking them
+ # down, anything more aggressive fails (i.e. -mcpu or -Ox)
+ # Gerk - Nov 26, 2002
+ use ppc && CFLAGS="-pipe -fsigned-char"
+ use xml2 && CFLAGS="${CFLAGS} $(pkg-config --cflags libxml-2.0)"
+ use xml2 && LIBS="${LIBS} $(pkg-config --libs libxml-2.0)"
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --host=${CHOST} \
+ --docdir=/usr/share/doc/${PF} \
+ --libdir=/usr/$(get_libdir) \
+ --includedir=/usr/include/postgresql/pgsql \
+ --enable-depend \
+ --with-gnu-ld \
+ --with-maxbackends=${MAX_CONNECTIONS} \
+ $myconf || die
+
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ cd contrib
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ if use xml2; then
+ make -C xml LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ fi
+}
+
+src_install() {
+ if use perl; then
+ mv ${S}/src/pl/plperl/Makefile ${S}/src/pl/plperl/Makefile_orig
+ sed -e "s:(INST_DYNAMIC) /usr/lib:(INST_DYNAMIC) ${D}/usr/lib:" \
+ ${S}/src/pl/plperl/Makefile_orig > ${S}/src/pl/plperl/Makefile
+ mv ${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
+
+ make DESTDIR=${D} includedir_server=/usr/include/postgresql/server includedir_internal=/usr/include/postgresql/internal LIBDIR=${D}/usr/lib install || die
+ make DESTDIR=${D} includedir_server=/usr/include/postgresql/server includedir_internal=/usr/include/postgresql/internal install-all-headers || die
+ cd ${S}/contrib
+ make DESTDIR=${D} LIBDIR=${D}/usr/lib install || die
+ if use xml2; then
+ make -C xml DESTDIR=${D} IBDIR=${D}/usr/lib install || die
+ fi
+ cd ${S}
+ if use pg-hier; then
+ dodoc ${WORKDIR}/README-${P_HIERPG}.html || die
+ fi
+ dodoc README HISTORY COPYRIGHT INSTALL
+ dodoc contrib/adddepend/*
+
+ exeinto /usr/bin
+
+ if use java; then
+ # we need to remove jar file after dojar; otherwise two same jar
+ # file are installed.
+ java-pkg_dojar ${D}/usr/share/postgresql/java/postgresql.jar || die
+ rm ${D}/usr/share/postgresql/java/postgresql.jar
+ java-pkg_dojar ${D}/usr/share/postgresql/java/postgresql-examples.jar || die
+ rm ${D}/usr/share/postgresql/java/postgresql-examples.jar
+ fi
+
+ # backward compatibility
+ for i in ${D}/usr/include/postgresql/pgsql/*
+ do
+ ln -s ${i} ${D}/usr/include/
+ done
+
+ cd ${S}/doc
+ dodoc FAQ* README.* TODO bug.template
+ if use doc; then
+ cd ${S}/doc
+ docinto FAQ_html || die
+ dodoc src/FAQ/* || die
+ docinto sgml || die
+ dodoc src/sgml/*.{sgml,dsl} || die
+ docinto sgml/ref || die
+ dodoc src/sgml/ref/*.sgml || die
+ docinto TODO.detail || die
+ dodoc TODO.detail/* || die
+ fi
+
+ cd ${S}
+ exeinto /etc/init.d/
+ newexe ${FILESDIR}/postgresql.init-${PV} postgresql || die
+ newexe ${FILESDIR}/pg_autovacuum.init-${PV} pg_autovacuum || die
+ dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum
+
+ insinto /etc/conf.d/
+ newins ${FILESDIR}/postgresql.conf-${PV} postgresql || die
+ newins ${FILESDIR}/pg_autovacuum.conf-${PV} pg_autovacuum || die
+}
+
+pkg_postinst() {
+ einfo "Make sure the postgres user in /etc/passwd has an account setup with /bin/bash as the shell"
+
+ if [ -f ${PG_DIR}/data/PG_VERSION ] ; then
+ PG_MAJOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f1 -d.`
+ PG_MINOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f2 -d.`
+ if [ ${PG_MAJOR} -lt 7 ] || [ ${PG_MAJOR} -eq 7 -a ${PG_MINOR} -eq 4 ] ; then
+ ewarn ""
+ ewarn "If you are upgrading from PostgreSQL 7.4 or 7.4.1, it is strongly recommended"
+ ewarn "that you read the release notes concerning changes to the system catalogs."
+ ewarn "You can run 7.4.2 without rerunning initdb, however you may still experience"
+ ewarn "random crashes due to an error in pg_statistic."
+ ewarn ""
+ ewarn "If you prefer not to re-initdb your installation, the release notes contain"
+ ewarn "a procedure for manually correcting the problem."
+ ewarn ""
+ fi
+
+ if use pg-hier; then
+ ewarn ""
+ ewarn "REQUIRED!! After installing patched PostgreSQL by pg-hier"
+ ewarn "it is required to run 'initdb'. Without this Pg will fail "
+ ewarn "with error "
+ ewarn "ERROR: did not find '}' at end of input node. "
+ ewarn ""
+ fi
+ else
+ einfo ""
+ einfo "Execute the following command"
+ einfo "ebuild /var/db/pkg/dev-db/${PF}/${PF}.ebuild config"
+ einfo "to setup the initial database environment."
+ einfo ""
+ fi
+
+ einfo ""
+ einfo "Python modules was removed from PostgreSQL package."
+ einfo "If you need it, please run \"emerge dev-db/pygresql\"."
+ einfo ""
+}
+
+pkg_config() {
+ einfo "Creating the data directory ..."
+ mkdir -p ${PG_DIR}/data
+ chown -Rf postgres:postgres ${PG_DIR}
+ chmod 700 ${PG_DIR}/data
+
+ einfo "Initializing the database ..."
+ if [ -f ${PG_DIR}/data/PG_VERSION ] ; then
+ PG_MAJOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f1 -d.`
+ PG_MINOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f2 -d.`
+ if [ ${PG_MAJOR} -lt 7 ] || [ ${PG_MAJOR} -eq 7 -a ${PG_MINOR} -lt 3 ] ; then
+ eerror "Postgres ${PV} cannot upgrade your existing databases."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ exit 1
+ else
+ einfon "A postgres data directory already exists from version "; cat ${PG_DIR}/data/PG_VERSION
+ einfo "Read the documentation to check how to upgrade to version ${PV}."
+ fi
+ else
+ local SEM=`sysctl -n kernel.sem | cut -f-3`
+ local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+ local SEMMNI_MIN=`expr \( ${MAX_CONNECTIONS} + 15 \) / 16`
+ local SHMMAX=`sysctl -n kernel.shmmax`
+ local SHMMAX_MIN=`expr 250000 + 30600 \* ${MAX_CONNECTIONS}`
+
+ if [ ${SEMMNI} -lt ${SEMMNI_MIN} ]; then
+ eerror "The current value of SEMMNI is too low"
+ eerror "for postgresql to run ${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
+
+ einfo "If you are upgrading from a pre-7.3 version of PostgreSQL, please read"
+ einfo "the README.adddepend file for information on how to properly migrate"
+ einfo "all serial columns, unique keys and foreign keys to this version."
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-8.0.1-r3.ebuild b/dev-db/postgresql/postgresql-8.0.1-r3.ebuild
new file mode 100644
index 000000000000..cd170cb29858
--- /dev/null
+++ b/dev-db/postgresql/postgresql-8.0.1-r3.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.0.1-r3.ebuild,v 1.1 2005/05/07 08:35:01 matsuu Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="sophisticated Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+P_HIERPG="hier-Pg8.0.1-0.5.4"
+MY_PV=${PV/_/}
+MY_P=${PN}-${MY_PV}
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${MY_PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/${PN}-opt-${MY_PV}.tar.bz2
+ doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${MY_PV}.tar.bz2 )
+ pg-hier? ( http://gppl.moonbone.ru/${P_HIERPG}.diff.gz )"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~s390 ~ppc64"
+IUSE="ssl nls python tcltk perl libg++ pam readline xml2 zlib doc selinux kerberos pg-intdatetime pg-hier"
+
+S=${WORKDIR}/${MY_P}
+DEPEND="virtual/libc
+ sys-devel/autoconf
+ >=sys-libs/ncurses-5.2
+ >=sys-devel/bison-1.875
+ zlib? ( >=sys-libs/zlib-1.1.3 )
+ readline? ( >=sys-libs/readline-4.1 )
+ tcltk? ( >=dev-lang/tcl-8 >=dev-lang/tk-8.3.3-r1 )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ xml2? ( dev-libs/libxml2 dev-libs/libxslt dev-util/pkgconfig )
+ nls? ( sys-devel/gettext )
+ kerberos? ( virtual/krb5 )"
+RDEPEND="virtual/libc
+ app-admin/sudo
+ zlib? ( >=sys-libs/zlib-1.1.3 )
+ tcltk? ( >=dev-lang/tcl-8 )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ xml2? ( dev-libs/libxml2 dev-libs/libxslt )
+ kerberos? ( virtual/krb5 )"
+
+PG_DIR="/var/lib/postgresql"
+
+pkg_setup() {
+ if [ -f ${PG_DIR}/data/PG_VERSION ] ; then
+ PG_MAJOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f1 -d.`
+ PG_MINOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f2 -d.`
+ if [ ${PG_MAJOR} -lt 8 ] || [ ${PG_MAJOR} -eq 8 -a ${PG_MINOR} -lt 0 ] ; then
+ eerror "Postgres ${MY_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})."
+ exit 1
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack ${A} || die
+ epatch ${FILESDIR}/${P}-gentoo.patch
+ cd ${S}
+ epatch ${FILESDIR}/${P}-securityfix.patch
+ use pg-hier && epatch ${WORKDIR}/${P_HIERPG}.diff
+
+ # Bug 91231
+ epatch ${FILESDIR}/CAN-2005-1409.patch
+ epatch ${FILESDIR}/CAN-2005-1410.patch
+ use doc && epatch ${FILESDIR}/CAN-2005-1409-doc.patch
+}
+
+src_compile() {
+ filter-flags -ffast-math -feliminate-dwarf2-dups
+
+ local myconf
+ use tcltk && myconf="--with-tcl"
+ use python && myconf="$myconf --with-python"
+ use perl && myconf="$myconf --with-perl"
+ use ssl && myconf="$myconf --with-openssl"
+ use nls && myconf="$myconf --enable-nls"
+ use libg++ && myconf="$myconf --with-CXX"
+ use pam && myconf="$myconf --with-pam"
+ use readline || myconf="$myconf --without-readline"
+ use zlib || myconf="$myconf --without-zlib"
+ use kerberos && myconf="$myconf --with-krb5"
+ use pg-intdatetime && myconf="$myconf --enable-integer-datetimes"
+
+ # these are the only working CFLAGS I could get on ppc, so locking them
+ # down, anything more aggressive fails (i.e. -mcpu or -Ox)
+ # Gerk - Nov 26, 2002
+ use ppc && CFLAGS="-pipe -fsigned-char"
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --host=${CHOST} \
+ --with-docdir=/usr/share/doc/${PF} \
+ --libdir=/usr/$(get_libdir) \
+ --enable-depend \
+ --with-gnu-ld \
+ $myconf || die
+
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ cd contrib
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ if use xml2; then
+ cd xml2
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ fi
+}
+
+src_install() {
+ if use perl; then
+ mv ${S}/src/pl/plperl/Makefile ${S}/src/pl/plperl/Makefile_orig
+ sed -e "s:(INST_DYNAMIC) /usr/lib:(INST_DYNAMIC) ${D}/usr/lib:" \
+ ${S}/src/pl/plperl/Makefile_orig > ${S}/src/pl/plperl/Makefile
+ mv ${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
+
+ make DESTDIR=${D} LIBDIR=${D}/usr/lib install || die
+# make DESTDIR=${D} install-all-headers || die
+ cd ${S}/contrib
+ make DESTDIR=${D} LIBDIR=${D}/usr/lib install || die
+ if use xml2; then
+ cd ${S}/contrib/xml2
+ make DESTDIR=${D} LIBDIR=${D}/usr/lib install || die
+ fi
+ cd ${S}
+ dodoc README HISTORY COPYRIGHT INSTALL
+ dodoc contrib/adddepend/*
+
+ exeinto /usr/bin
+
+ dodir /usr/include/postgresql/pgsql
+ cp ${D}/usr/include/*.h ${D}/usr/include/postgresql/pgsql
+
+ cd ${S}/doc
+ dodoc FAQ* README.* TODO bug.template
+ if use doc; then
+ cd ${S}/doc
+ docinto FAQ_html || die
+ dodoc src/FAQ/* || die
+ docinto sgml || die
+ dodoc src/sgml/*.{sgml,dsl} || die
+ docinto sgml/ref || die
+ dodoc src/sgml/ref/*.sgml || die
+ docinto TODO.detail || die
+ dodoc TODO.detail/* || die
+ fi
+
+ cd ${S}
+ exeinto /etc/init.d/
+ newexe ${FILESDIR}/postgresql.init-${PV} postgresql || die
+ newexe ${FILESDIR}/pg_autovacuum.init-${PV} pg_autovacuum || die
+ dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum
+
+ insinto /etc/conf.d/
+ newins ${FILESDIR}/postgresql.conf-${PV} postgresql || die
+ newins ${FILESDIR}/pg_autovacuum.conf-${PV} pg_autovacuum || die
+}
+
+pkg_postinst() {
+ einfo "Make sure the postgres user in /etc/passwd has an account setup with /bin/bash as the shell"
+
+ if [ ! -f ${PG_DIR}/data/PG_VERSION ] ; then
+ einfo ""
+ einfo "Execute the following command"
+ einfo "ebuild /var/db/pkg/dev-db/${PF}/${PF}.ebuild config"
+ einfo "to setup the initial database environment."
+ einfo ""
+ fi
+
+ einfo ""
+ einfo "Python modules was removed from PostgreSQL package."
+ einfo "If you need it, please run \"emerge dev-db/pygresql\"."
+ einfo ""
+}
+
+pkg_config() {
+ einfo "Creating the data directory ..."
+ mkdir -p ${PG_DIR}/data
+ chown -Rf postgres:postgres ${PG_DIR}
+ chmod 700 ${PG_DIR}/data
+
+ einfo "Initializing the database ..."
+ if [ -f ${PG_DIR}/data/PG_VERSION ] ; then
+ eerror "Postgres ${MY_PV} cannot upgrade your existing databases."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ exit 1
+ else
+ local SEM=`sysctl -n kernel.sem | cut -f-3`
+ local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+ local SEMMNI_MIN=`expr \( ${MAX_CONNECTIONS} + 15 \) / 16`
+ local SHMMAX=`sysctl -n kernel.shmmax`
+ local SHMMAX_MIN=`expr 250000 + 8200 \* 1000 + 14200 \* 100`
+
+ if [ ${SEMMNI} -lt ${SEMMNI_MIN} ]; then
+ eerror "The current value of SEMMNI is too low"
+ eerror "for postgresql to run ${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
+ sudo -u postgres /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
+ fi
+}
diff --git a/dev-db/postgresql/postgresql-8.0.2-r1.ebuild b/dev-db/postgresql/postgresql-8.0.2-r1.ebuild
new file mode 100644
index 000000000000..76f5f67be3df
--- /dev/null
+++ b/dev-db/postgresql/postgresql-8.0.2-r1.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.0.2-r1.ebuild,v 1.1 2005/05/07 08:35:01 matsuu Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="sophisticated Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+P_HIERPG="hier-Pg8.0.1-0.5.4"
+MY_PV=${PV/_/}
+MY_P=${PN}-${MY_PV}
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${MY_PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/${PN}-opt-${MY_PV}.tar.bz2
+ doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${MY_PV}.tar.bz2 )"
+# pg-hier? ( http://gppl.moonbone.ru/${P_HIERPG}.diff.gz )"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~s390 ~ppc64"
+IUSE="ssl nls python tcltk perl libg++ pam readline xml2 zlib doc selinux kerberos pg-intdatetime"
+#pg-hier"
+
+S=${WORKDIR}/${MY_P}
+DEPEND="virtual/libc
+ sys-devel/autoconf
+ >=sys-libs/ncurses-5.2
+ >=sys-devel/bison-1.875
+ zlib? ( >=sys-libs/zlib-1.1.3 )
+ readline? ( >=sys-libs/readline-4.1 )
+ tcltk? ( >=dev-lang/tcl-8 >=dev-lang/tk-8.3.3-r1 )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ xml2? ( dev-libs/libxml2 dev-libs/libxslt dev-util/pkgconfig )
+ nls? ( sys-devel/gettext )
+ kerberos? ( virtual/krb5 )"
+RDEPEND="virtual/libc
+ app-admin/sudo
+ zlib? ( >=sys-libs/zlib-1.1.3 )
+ tcltk? ( >=dev-lang/tcl-8 )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ xml2? ( dev-libs/libxml2 dev-libs/libxslt )
+ kerberos? ( virtual/krb5 )"
+
+PG_DIR="/var/lib/postgresql"
+
+pkg_setup() {
+ if [ -f ${PG_DIR}/data/PG_VERSION ] ; then
+ PG_MAJOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f1 -d.`
+ PG_MINOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f2 -d.`
+ if [ ${PG_MAJOR} -lt 8 ] || [ ${PG_MAJOR} -eq 8 -a ${PG_MINOR} -lt 0 ] ; then
+ eerror "Postgres ${MY_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})."
+ exit 1
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack ${A} || die
+ epatch ${FILESDIR}/${P}-gentoo.patch
+ cd ${S}
+# use pg-hier && epatch ${WORKDIR}/${P_HIERPG}.diff
+
+ # Bug 91231
+ epatch ${FILESDIR}/CAN-2005-1409.patch
+ epatch ${FILESDIR}/CAN-2005-1410.patch
+ use doc && epatch ${FILESDIR}/CAN-2005-1409-doc.patch
+}
+
+src_compile() {
+ filter-flags -ffast-math -feliminate-dwarf2-dups
+
+ local myconf
+ use tcltk && myconf="--with-tcl"
+ use python && myconf="$myconf --with-python"
+ use perl && myconf="$myconf --with-perl"
+ use ssl && myconf="$myconf --with-openssl"
+ use nls && myconf="$myconf --enable-nls"
+ use libg++ && myconf="$myconf --with-CXX"
+ use pam && myconf="$myconf --with-pam"
+ use readline || myconf="$myconf --without-readline"
+ use zlib || myconf="$myconf --without-zlib"
+ use kerberos && myconf="$myconf --with-krb5"
+ use pg-intdatetime && myconf="$myconf --enable-integer-datetimes"
+
+ # these are the only working CFLAGS I could get on ppc, so locking them
+ # down, anything more aggressive fails (i.e. -mcpu or -Ox)
+ # Gerk - Nov 26, 2002
+ use ppc && CFLAGS="-pipe -fsigned-char"
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --host=${CHOST} \
+ --with-docdir=/usr/share/doc/${PF} \
+ --libdir=/usr/$(get_libdir) \
+ --enable-depend \
+ --with-gnu-ld \
+ $myconf || die
+
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ cd contrib
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ if use xml2; then
+ cd xml2
+ make LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
+ fi
+}
+
+src_install() {
+ if use perl; then
+ mv ${S}/src/pl/plperl/Makefile ${S}/src/pl/plperl/Makefile_orig
+ sed -e "s:(INST_DYNAMIC) /usr/lib:(INST_DYNAMIC) ${D}/usr/lib:" \
+ ${S}/src/pl/plperl/Makefile_orig > ${S}/src/pl/plperl/Makefile
+ mv ${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
+
+ make DESTDIR=${D} LIBDIR=${D}/usr/lib install || die
+# make DESTDIR=${D} install-all-headers || die
+ cd ${S}/contrib
+ make DESTDIR=${D} LIBDIR=${D}/usr/lib install || die
+ if use xml2; then
+ cd ${S}/contrib/xml2
+ make DESTDIR=${D} LIBDIR=${D}/usr/lib install || die
+ fi
+ cd ${S}
+ dodoc README HISTORY COPYRIGHT INSTALL
+ dodoc contrib/adddepend/*
+
+ exeinto /usr/bin
+
+ dodir /usr/include/postgresql/pgsql
+ cp ${D}/usr/include/*.h ${D}/usr/include/postgresql/pgsql
+
+ cd ${S}/doc
+ dodoc FAQ* README.* TODO bug.template
+ if use doc; then
+ cd ${S}/doc
+ docinto FAQ_html || die
+ dodoc src/FAQ/* || die
+ docinto sgml || die
+ dodoc src/sgml/*.{sgml,dsl} || die
+ docinto sgml/ref || die
+ dodoc src/sgml/ref/*.sgml || die
+ docinto TODO.detail || die
+ dodoc TODO.detail/* || die
+ fi
+
+ cd ${S}
+ exeinto /etc/init.d/
+ newexe ${FILESDIR}/postgresql.init-${PV} postgresql || die
+ newexe ${FILESDIR}/pg_autovacuum.init-${PV} pg_autovacuum || die
+ dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum
+
+ insinto /etc/conf.d/
+ newins ${FILESDIR}/postgresql.conf-${PV} postgresql || die
+ newins ${FILESDIR}/pg_autovacuum.conf-${PV} pg_autovacuum || die
+}
+
+pkg_postinst() {
+ einfo "Make sure the postgres user in /etc/passwd has an account setup with /bin/bash as the shell"
+
+ if [ ! -f ${PG_DIR}/data/PG_VERSION ] ; then
+ einfo ""
+ einfo "Execute the following command"
+ einfo "ebuild /var/db/pkg/dev-db/${PF}/${PF}.ebuild config"
+ einfo "to setup the initial database environment."
+ einfo ""
+ fi
+
+ einfo ""
+ einfo "The PostgreSQL library libpq has changed major number."
+ einfo "You will need to rebuild applications that use it."
+ einfo "You might want to use revdep-rebuild for this upgrade."
+ einfo "e.g.) # revdep-rebuild --soname 'libpq.so.3'"
+ einfo ""
+}
+
+pkg_config() {
+ einfo "Creating the data directory ..."
+ mkdir -p ${PG_DIR}/data
+ chown -Rf postgres:postgres ${PG_DIR}
+ chmod 700 ${PG_DIR}/data
+
+ einfo "Initializing the database ..."
+ if [ -f ${PG_DIR}/data/PG_VERSION ] ; then
+ eerror "Postgres ${MY_PV} cannot upgrade your existing databases."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ exit 1
+ else
+ local SEM=`sysctl -n kernel.sem | cut -f-3`
+ local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+ local SEMMNI_MIN=`expr \( ${MAX_CONNECTIONS} + 15 \) / 16`
+ local SHMMAX=`sysctl -n kernel.shmmax`
+ local SHMMAX_MIN=`expr 250000 + 8200 \* 1000 + 14200 \* 100`
+
+ if [ ${SEMMNI} -lt ${SEMMNI_MIN} ]; then
+ eerror "The current value of SEMMNI is too low"
+ eerror "for postgresql to run ${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
+ sudo -u postgres /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
+ fi
+}