summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/libpq/Manifest9
-rw-r--r--dev-db/libpq/files/digest-libpq-8.2.36
-rw-r--r--dev-db/libpq/libpq-8.2.3.ebuild114
-rw-r--r--dev-db/postgresql/Manifest19
-rw-r--r--dev-db/postgresql/files/digest-postgresql-8.2.312
-rw-r--r--dev-db/postgresql/files/postgresql.conf-8.247
-rw-r--r--dev-db/postgresql/files/postgresql.init-8.258
-rw-r--r--dev-db/postgresql/postgresql-8.2.3.ebuild241
8 files changed, 506 insertions, 0 deletions
diff --git a/dev-db/libpq/Manifest b/dev-db/libpq/Manifest
new file mode 100644
index 0000000..3c25ed7
--- /dev/null
+++ b/dev-db/libpq/Manifest
@@ -0,0 +1,9 @@
+DIST postgresql-base-8.2.3.tar.bz2 8500472 RMD160 8ec01f0ea8ad3a7d380ea2a0564109c718207864 SHA1 a2948e2affdeafc5e81526bb10582a53e6b3601f SHA256 6ad1274bd8e7f3df1c4295d73b93b2176278b4f9b0dc375737bfe75cecefc6e8
+DIST postgresql-opt-8.2.3.tar.bz2 167549 RMD160 f9dad95527f22aaef809b52acbde2b80b0a1ed5a SHA1 ff37f7a5eaacdaaa4993023554ed180b636b1fcf SHA256 fc82d271c988b27515735db463e6f656f0417104f8f0cabfda5c515e15b1876e
+EBUILD libpq-8.2.3.ebuild 3291 RMD160 5d13bf95fba39acf8040117476f2fb5cb8e896c4 SHA1 6359dcb170f2699f458c1949b87bb727d78272da SHA256 ba2a11f8e4b533b752880a4a6faab512c42160cf34a7aa732373cfdc5acebc48
+MD5 ad090ca637ebd4b5fa9720948e607184 libpq-8.2.3.ebuild 3291
+RMD160 5d13bf95fba39acf8040117476f2fb5cb8e896c4 libpq-8.2.3.ebuild 3291
+SHA256 ba2a11f8e4b533b752880a4a6faab512c42160cf34a7aa732373cfdc5acebc48 libpq-8.2.3.ebuild 3291
+MD5 99d0e94c29c81071b0e90121fd8d5c10 files/digest-libpq-8.2.3 536
+RMD160 2d77d5254876d35e02ea34bb044d916d3b5ee17f files/digest-libpq-8.2.3 536
+SHA256 69a41c059e70800b80e5a00543c50cde097d8dc44459030cce9ae48e356560c5 files/digest-libpq-8.2.3 536
diff --git a/dev-db/libpq/files/digest-libpq-8.2.3 b/dev-db/libpq/files/digest-libpq-8.2.3
new file mode 100644
index 0000000..c98f44c
--- /dev/null
+++ b/dev-db/libpq/files/digest-libpq-8.2.3
@@ -0,0 +1,6 @@
+MD5 c19b529c2a7b3c4850ae65b0a89f1883 postgresql-base-8.2.3.tar.bz2 8500472
+RMD160 8ec01f0ea8ad3a7d380ea2a0564109c718207864 postgresql-base-8.2.3.tar.bz2 8500472
+SHA256 6ad1274bd8e7f3df1c4295d73b93b2176278b4f9b0dc375737bfe75cecefc6e8 postgresql-base-8.2.3.tar.bz2 8500472
+MD5 2381dc8db8d90f78f4db940dc5544d9f postgresql-opt-8.2.3.tar.bz2 167549
+RMD160 f9dad95527f22aaef809b52acbde2b80b0a1ed5a postgresql-opt-8.2.3.tar.bz2 167549
+SHA256 fc82d271c988b27515735db463e6f656f0417104f8f0cabfda5c515e15b1876e postgresql-opt-8.2.3.tar.bz2 167549
diff --git a/dev-db/libpq/libpq-8.2.3.ebuild b/dev-db/libpq/libpq-8.2.3.ebuild
new file mode 100644
index 0000000..f70e7c0
--- /dev/null
+++ b/dev-db/libpq/libpq-8.2.3.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvs/lportage/dev-db/libpq/libpq-8.2.3.ebuild,v 1.1 2007-02-16 16:34:28 randomdan Exp $
+
+inherit eutils gnuconfig flag-o-matic toolchain-funcs
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+
+DESCRIPTION="PostgreSQL libraries."
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/postgresql-base-${PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/postgresql-opt-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="4"
+IUSE="kerberos nls pam pg-intdatetime readline ssl threads zlib"
+
+RDEPEND="!<=dev-db/postgresql-8.1.4
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )
+ readline? ( >=sys-libs/readline-4.1 )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ zlib? ( >=sys-libs/zlib-1.1.3 )"
+DEPEND="${RDEPEND}
+ sys-devel/autoconf
+ >=sys-devel/bison-1.875
+ nls? ( sys-devel/gettext )"
+
+S="${WORKDIR}/postgresql-${PV}"
+
+pkg_preinst() {
+ # Removing wrong symlink created by previous ebuild
+ if [[ -L "${ROOT}/usr/include/libpq" ]] ; then
+ rm -f "${ROOT}/usr/include/libpq"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+}
+
+src_compile() {
+ filter-flags -ffast-math -feliminate-dwarf2-dups
+
+ # Detect mips systems properly
+ gnuconfig_update
+
+ cd "${S}"
+
+ ./configure --prefix=/usr \
+ --includedir=/usr/include/postgresql/libpq-${SLOT} \
+ --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) \
+ --without-perl \
+ $(use_enable pg-intdatetime integer-datetimes ) \
+ --without-python \
+ $(use_with readline) \
+ $(use_with ssl openssl) \
+ --without-tcl \
+ $(use_enable threads thread-safety ) \
+ $(use_with zlib) \
+ || die "configure failed"
+
+ cd "${S}/src/interfaces/libpq"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake libpq failed"
+
+ cd "${S}/src/bin/pg_config"
+ emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake pg_config failed"
+}
+
+src_install() {
+ cd "${S}/src/interfaces/libpq"
+ emake DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "emake install libpq failed"
+
+ cd "${S}/src/include"
+ emake DESTDIR="${D}" install || die "emake install headers failed"
+
+ cd "${S}/src/bin/pg_config"
+ emake DESTDIR="${D}" install || die "emake install pg_config failed"
+
+ cd "${S}"
+ dodoc README HISTORY
+
+ dosym libpq-${SLOT}.a /usr/$(get_libdir)/libpq.a
+
+ for f in $(ls -1 "${D}"/usr/include/postgresql/libpq-${SLOT}/*.h) ; do
+ dosym postgresql/libpq-${SLOT}/$(basename ${f}) /usr/include/
+ done
+
+ dodir /usr/include/libpq
+ for f in $(ls -1 "${D}"/usr/include/postgresql/libpq-${SLOT}/libpq/*.h) ; do
+ dosym ../postgresql/libpq-${SLOT}/libpq/$(basename ${f}) /usr/include/libpq/
+ done
+
+ cd "${D}/usr/include/postgresql/libpq-${SLOT}"
+ for f in $(find * -name '*.h' -print) ; do
+ destdir=$(dirname ${f})
+ if [[ ! -d "${D}/usr/include/postgresql/${destdir}" ]] ; then
+ dodir "/usr/include/postgresql/${destdir}"
+ fi
+ dosym /usr/include/postgresql/libpq-${SLOT}/${f} "/usr/include/postgresql/${destdir}/"
+ done
+}
+
+src_test() {
+ einfo "No tests available for libpq."
+}
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
new file mode 100644
index 0000000..0d8a69c
--- /dev/null
+++ b/dev-db/postgresql/Manifest
@@ -0,0 +1,19 @@
+AUX postgresql.conf-8.2 1714 RMD160 d726aaffa860620b8b8c30f6f713d3a388adf1e5 SHA1 eb2e7ead1a24f655f513ae68c34e879d58a41928 SHA256 29ae16457bb8e356f84a3368948876480858ed7d346734649ba7049431cb11eb
+MD5 fa89b0f3a1fb05a19d803bf69099eda8 files/postgresql.conf-8.2 1714
+RMD160 d726aaffa860620b8b8c30f6f713d3a388adf1e5 files/postgresql.conf-8.2 1714
+SHA256 29ae16457bb8e356f84a3368948876480858ed7d346734649ba7049431cb11eb files/postgresql.conf-8.2 1714
+AUX postgresql.init-8.2 1523 RMD160 4776cc4989bdc153d77f66d6c8c92a560f99fe82 SHA1 db6c7d5ceedc9ec236aea932c42f1923550d6d28 SHA256 d79d9bf91873697ab3be5da578630fcaa5ac07d3bd9bdc44f7f0543a1e6cae82
+MD5 102f0dc365606c088f903371d0b0d6c1 files/postgresql.init-8.2 1523
+RMD160 4776cc4989bdc153d77f66d6c8c92a560f99fe82 files/postgresql.init-8.2 1523
+SHA256 d79d9bf91873697ab3be5da578630fcaa5ac07d3bd9bdc44f7f0543a1e6cae82 files/postgresql.init-8.2 1523
+DIST postgresql-base-8.2.3.tar.bz2 8500472 RMD160 8ec01f0ea8ad3a7d380ea2a0564109c718207864 SHA1 a2948e2affdeafc5e81526bb10582a53e6b3601f SHA256 6ad1274bd8e7f3df1c4295d73b93b2176278b4f9b0dc375737bfe75cecefc6e8
+DIST postgresql-docs-8.2.3.tar.bz2 2757963 RMD160 924a86210eca33cef9d373fc702ee7c911e27524 SHA1 8d9a48faed5442f8cade8738df2a89bb167902cc SHA256 88cf0a17ee03dd4e9d0cef282a7a730837abea1bcc804678029778b0dd456094
+DIST postgresql-opt-8.2.3.tar.bz2 167549 RMD160 f9dad95527f22aaef809b52acbde2b80b0a1ed5a SHA1 ff37f7a5eaacdaaa4993023554ed180b636b1fcf SHA256 fc82d271c988b27515735db463e6f656f0417104f8f0cabfda5c515e15b1876e
+DIST postgresql-test-8.2.3.tar.bz2 985623 RMD160 fe6ee516bf5b985bbc374b1cadf9eb68c5f4709b SHA1 a322a5df3252e68c2ceec5c1554ace9b3eb353ca SHA256 4efdb72c8bf6f8784719147002ddd3458122b21f054a8f6a921365ddc753db32
+EBUILD postgresql-8.2.3.ebuild 8269 RMD160 337eb96e8ea84c7950aadbe599252c2c3b07b211 SHA1 fe9b564d1310c677447c92abb7daa6791a76e62c SHA256 2b25aa1ac9e926b138abbbb0f1d4c31ecd420c51099030e0c17d884782514dd8
+MD5 6444d297473678be322f749621262627 postgresql-8.2.3.ebuild 8269
+RMD160 337eb96e8ea84c7950aadbe599252c2c3b07b211 postgresql-8.2.3.ebuild 8269
+SHA256 2b25aa1ac9e926b138abbbb0f1d4c31ecd420c51099030e0c17d884782514dd8 postgresql-8.2.3.ebuild 8269
+MD5 012bb3d54cd96bd8fdd79bcc05cbabcc files/digest-postgresql-8.2.3 1075
+RMD160 786314334e2d716fe6ae7930025f8c66c927422f files/digest-postgresql-8.2.3 1075
+SHA256 29bc5b6dcfafa938976a0766d27ef259a0bfae76bce90a9772b429533c2cd523 files/digest-postgresql-8.2.3 1075
diff --git a/dev-db/postgresql/files/digest-postgresql-8.2.3 b/dev-db/postgresql/files/digest-postgresql-8.2.3
new file mode 100644
index 0000000..dc537e2
--- /dev/null
+++ b/dev-db/postgresql/files/digest-postgresql-8.2.3
@@ -0,0 +1,12 @@
+MD5 c19b529c2a7b3c4850ae65b0a89f1883 postgresql-base-8.2.3.tar.bz2 8500472
+RMD160 8ec01f0ea8ad3a7d380ea2a0564109c718207864 postgresql-base-8.2.3.tar.bz2 8500472
+SHA256 6ad1274bd8e7f3df1c4295d73b93b2176278b4f9b0dc375737bfe75cecefc6e8 postgresql-base-8.2.3.tar.bz2 8500472
+MD5 66a3ed6319e75b7aee2db0a1efedde59 postgresql-docs-8.2.3.tar.bz2 2757963
+RMD160 924a86210eca33cef9d373fc702ee7c911e27524 postgresql-docs-8.2.3.tar.bz2 2757963
+SHA256 88cf0a17ee03dd4e9d0cef282a7a730837abea1bcc804678029778b0dd456094 postgresql-docs-8.2.3.tar.bz2 2757963
+MD5 2381dc8db8d90f78f4db940dc5544d9f postgresql-opt-8.2.3.tar.bz2 167549
+RMD160 f9dad95527f22aaef809b52acbde2b80b0a1ed5a postgresql-opt-8.2.3.tar.bz2 167549
+SHA256 fc82d271c988b27515735db463e6f656f0417104f8f0cabfda5c515e15b1876e postgresql-opt-8.2.3.tar.bz2 167549
+MD5 81e227d2e1393573c5dd5f762fb99b1e postgresql-test-8.2.3.tar.bz2 985623
+RMD160 fe6ee516bf5b985bbc374b1cadf9eb68c5f4709b postgresql-test-8.2.3.tar.bz2 985623
+SHA256 4efdb72c8bf6f8784719147002ddd3458122b21f054a8f6a921365ddc753db32 postgresql-test-8.2.3.tar.bz2 985623
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..2395674
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.conf-8.2
@@ -0,0 +1,47 @@
+# 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.
+# Just define a new variable ENV_identifier="ENV_VAR_NAME=env_var_content",
+# ENV_VAR_NAME will then be exported to the postgresql's environment.
+#
+# Example:
+# ENV_plr="R_HOME=/usr/lib/R"
+# This exports a variable R_HOME with the content "/usr/lib/R"
+
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..39978c6
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-8.2
@@ -0,0 +1,58 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvs/lportage/dev-db/postgresql/files/postgresql.init-8.2,v 1.1 2007-02-16 16:34:28 randomdan 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
+
+ local env_vars
+ for var in ${!ENV_*} ; do env_vars="${env_vars} -e ${!var}" ; done
+ start-stop-daemon --start \
+ --pidfile "${PGDATA}/postmaster.pid" \
+ --chuid ${PGUSER}:${PGGROUP} \
+ --exec /usr/bin/postmaster \
+ ${env_vars} -- \
+ -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/postgresql-8.2.3.ebuild b/dev-db/postgresql/postgresql-8.2.3.ebuild
new file mode 100644
index 0000000..b12894c
--- /dev/null
+++ b/dev-db/postgresql/postgresql-8.2.3.ebuild
@@ -0,0 +1,241 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvs/lportage/dev-db/postgresql/postgresql-8.2.3.ebuild,v 1.1 2007-02-16 16:34:28 randomdan Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+
+DESCRIPTION="Sophisticated and powerful Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${PV}.tar.bz2
+ mirror://postgresql/source/v${PV}/${PN}-opt-${PV}.tar.bz2
+ doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${PV}.tar.bz2 )
+ mirror://postgresql/source/v${PV}/${PN}-test-${PV}.tar.bz2"
+LICENSE="POSTGRESQL"
+SLOT="0"
+IUSE="doc kerberos nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib"
+
+RDEPEND="~dev-db/libpq-${PV}
+ >=sys-libs/ncurses-5.2
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )
+ perl? ( >=dev-lang/perl-5.6.1-r2 )
+ python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+ readline? ( >=sys-libs/readline-4.1 )
+ selinux? ( sec-policy/selinux-postgresql )
+ ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+ tcl? ( >=dev-lang/tcl-8 )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )
+ zlib? ( >=sys-libs/zlib-1.1.3 )"
+DEPEND="${RDEPEND}
+ sys-devel/autoconf
+ >=sys-devel/bison-1.875
+ nls? ( sys-devel/gettext )
+ xml? ( dev-util/pkgconfig )"
+
+PG_DIR="/var/lib/postgresql"
+[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
+
+pkg_setup() {
+ if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+ if [[ $(cat "${PG_DIR}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
+ eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
+ eerror "use pg_dump to export your existing databases to a file, and then"
+ eerror "pg_restore to import them when you have upgraded completely."
+ eerror "You must remove your entire database directory to continue."
+ eerror "(database directory = ${PG_DIR})."
+ die "Remove your database directory to continue"
+ fi
+ fi
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Prepare package for future tests
+ if use test ; then
+ # Fix sandbox violation
+ sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+
+
+ # We need to run the tests as a non-root user, portage seems the most fitting here,
+ # so if userpriv is enabled, we use it directly. If userpriv is disabled, 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"
+ 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."
+}