From 0e0de984f20bf8071eeb7d2d6d32acd130b3ff32 Mon Sep 17 00:00:00 2001 From: Tiziano Müller Date: Wed, 19 Mar 2008 14:49:18 +0000 Subject: dev-db/postgresql-server: Version bump. svn path=/experimental/; revision=334 --- dev-db/postgresql-server/ChangeLog | 5 + dev-db/postgresql-server/Manifest | 10 +- .../postgresql-server-8.2.6.ebuild | 214 -------------------- .../postgresql-server-8.2.7.ebuild | 214 ++++++++++++++++++++ .../postgresql-server-8.3.0.ebuild | 215 --------------------- .../postgresql-server-8.3.1.ebuild | 215 +++++++++++++++++++++ 6 files changed, 439 insertions(+), 434 deletions(-) delete mode 100644 dev-db/postgresql-server/postgresql-server-8.2.6.ebuild create mode 100644 dev-db/postgresql-server/postgresql-server-8.2.7.ebuild delete mode 100644 dev-db/postgresql-server/postgresql-server-8.3.0.ebuild create mode 100644 dev-db/postgresql-server/postgresql-server-8.3.1.ebuild diff --git a/dev-db/postgresql-server/ChangeLog b/dev-db/postgresql-server/ChangeLog index d565786..b2ebef0 100644 --- a/dev-db/postgresql-server/ChangeLog +++ b/dev-db/postgresql-server/ChangeLog @@ -2,6 +2,11 @@ # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 19 Mar 2008; Tiziano Müller + -postgresql-server-8.2.6.ebuild, +postgresql-server-8.2.7.ebuild, + -postgresql-server-8.3.0.ebuild, +postgresql-server-8.3.1.ebuild: + Version bump. + 15 Mar 2008; Tiziano Müller postgresql-server-7.3.21.ebuild, postgresql-server-7.4.19.ebuild, files/postgresql-7.4-server.patch, postgresql-server-8.0.15.ebuild, diff --git a/dev-db/postgresql-server/Manifest b/dev-db/postgresql-server/Manifest index 2a44ec1..2b7f4a4 100644 --- a/dev-db/postgresql-server/Manifest +++ b/dev-db/postgresql-server/Manifest @@ -30,13 +30,13 @@ DIST postgresql-7.3.21.tar.bz2 9284558 RMD160 f9de4676b4fbe3d96e6d1462b8bc3c0560 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-8.3.0.tar.bz2 13923051 RMD160 99f48d26d9b0fb0cfda0de7156ad6a9554017d9e SHA1 b221e9a82fdb10af1a2b527551a4e30b7ccb958d SHA256 85356d6ab577e21bb528eb5d672e4373b21fe98ac046e77a0eed975608066ea6 +DIST postgresql-8.2.7.tar.bz2 12576126 RMD160 96700e91c3b9e733c686b0fe377c7ba661710942 SHA1 0be0dbaa488810ebcba77ac7246180c5b2a9b669 SHA256 39528d1ba50f5abc51569e8b9bdeb47d0d4650d289a2c2e465621864b1ff3584 +DIST postgresql-8.3.1.tar.bz2 13995572 RMD160 075efb67126f2b308d2a5fe4f9097fdbfbe94c89 SHA1 7397e0d8fd3c420ee845d9ae4995ae347bfaea1d SHA256 7ccf1e5c987920e4d6eb98b8589939e29d3a361d285055d5af35ddd8e1a2d992 EBUILD postgresql-server-7.3.21.ebuild 7841 RMD160 5fa170f04a318060f5edce49a794e35159c4b00f SHA1 198f25e6ae53c0adecfb8328708c3ce08b847f7c SHA256 2acc7e0173d4c42d8debdb613f66f351ca58fa6b94f4f13c262a63b211587dc6 EBUILD postgresql-server-7.4.19.ebuild 7771 RMD160 b9d086687680e477256b39f1480973ee0ac3bff0 SHA1 604a708ec1bcce5763883a8c15bddb43cb56c94a SHA256 3b9a8f1903a1f7e7159348af8272f9922f607d9448d0e906fb3cebe83f35f49e EBUILD postgresql-server-8.0.15.ebuild 7967 RMD160 98623ab4e26874b90d2befec864f967387e821eb SHA1 d32df8948592b46345efde8d7285f4a3759160b9 SHA256 d941f29028c4f84ea8174bf05aa5b84fa72b46110d4d95f4d8c2c3231d4465c7 EBUILD postgresql-server-8.1.11.ebuild 8088 RMD160 c81b49aba166f90faf87b5ae278763cd09fe30e6 SHA1 2f2b0d475775ee412cc72703f9c7841b443abc03 SHA256 83172e0cf272926ca9715511a0ca00301e738b643c4d50ea66d6d46c418146e0 -EBUILD postgresql-server-8.2.6.ebuild 8318 RMD160 e130264005bb0c8a0e17d8814e1de510b84908ad SHA1 a1519eebba917ca9b9e2b3e0ebfd2a2e3286f7a7 SHA256 fac930c548d777292622f6c0c663015eb15bcec9715bc31b62f37d9c540ffe5a -EBUILD postgresql-server-8.3.0.ebuild 8345 RMD160 0c31bc3f690c97f9ff44a5dffddf16acf7f73a4f SHA1 dc8bc162c78620c37aad2772f2ce716ad2f3bbe1 SHA256 95e28601a56327579ea50f7de3007d18b84fee9c27e4473b85fdcc1d88ef8cfc -MISC ChangeLog 3459 RMD160 92140056a955bb998d9e22f32dd50e7718e54196 SHA1 be67c7bd3d70554d2681959824b5a241b0c0cd72 SHA256 73ab317005d8d1bbf4b29df4939cfbd4480cb7fc2c194c32274ea169fa037de3 +EBUILD postgresql-server-8.2.7.ebuild 8318 RMD160 e130264005bb0c8a0e17d8814e1de510b84908ad SHA1 a1519eebba917ca9b9e2b3e0ebfd2a2e3286f7a7 SHA256 fac930c548d777292622f6c0c663015eb15bcec9715bc31b62f37d9c540ffe5a +EBUILD postgresql-server-8.3.1.ebuild 8345 RMD160 0c31bc3f690c97f9ff44a5dffddf16acf7f73a4f SHA1 dc8bc162c78620c37aad2772f2ce716ad2f3bbe1 SHA256 95e28601a56327579ea50f7de3007d18b84fee9c27e4473b85fdcc1d88ef8cfc +MISC ChangeLog 3665 RMD160 55d23472c431292c5c110b144d21a793faf46e3d SHA1 a187c5161bbf1c2e0c8e075c03404d571adc4c40 SHA256 9a303cfbb29f6e5a547dcf1a21a44f1e2fc0bad5eb1013ef9a1eb8267915681b MISC metadata.xml 164 RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc SHA1 f67b7ac1c5e6e65ef5a19a589d4759c84918f86c SHA256 7e8e8126bc8701c4a42c7dfed8bb755ac6040fe3d0e3f994d888f8b2b4fa7d8b diff --git a/dev-db/postgresql-server/postgresql-server-8.2.6.ebuild b/dev-db/postgresql-server/postgresql-server-8.2.6.ebuild deleted file mode 100644 index 4998e22..0000000 --- a/dev-db/postgresql-server/postgresql-server-8.2.6.ebuild +++ /dev/null @@ -1,214 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="1" - -WANT_AUTOCONF="latest" -WANT_AUTOMAKE="none" -inherit eutils multilib toolchain-funcs versionator autotools - -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" - -DESCRIPTION="PostgreSQL server" -HOMEPAGE="http://www.postgresql.org/" -SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" -LICENSE="POSTGRESQL" -SLOT="$(get_version_component_range 1-2)" -IUSE_LINGUAS=" - linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr - linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl - linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv - linguas_tr linguas_zh_CN linguas_zh_TW" -IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}" - -wanted_languages() { - for u in ${IUSE_LINGUAS} ; do - use $u && echo ${u#linguas_} - done -} - -RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT} - perl? ( >=dev-lang/perl-5.6.1-r2 ) - python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base ) - selinux? ( sec-policy/selinux-postgresql ) - tcl? ( >=dev-lang/tcl-8 ) - xml? ( dev-libs/libxml2 dev-libs/libxslt )" -DEPEND="${RDEPEND} - xml? ( dev-util/pkgconfig )" -PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )" - -[[ -r /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} -[[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data" -[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512" - -S="${WORKDIR}/postgresql-${PV}" - -pkg_setup() { - if [[ -f "${PGDATA}/PG_VERSION" ]] ; then - if [[ $(cat "${PGDATA}/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 = ${PGDATA})." - die "Remove your database directory to continue" - fi - fi - enewgroup postgres 70 - enewuser postgres 70 /bin/bash /var/lib postgres -} - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ - "${FILESDIR}/postgresql-${SLOT}-server.patch" - - if hasq test ${FEATURES}; then - sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source - else - echo "all install:" > "${S}/src/test/regress/GNUmakefile" - fi - - eautoconf -} - -src_compile() { - # TODO: test if PPC really cannot work with other CFLAGS settings - # use ppc && CFLAGS="-pipe -fsigned-char" - - # eval is needed to get along with pg_config quotation of space-rich entities. - eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \ - --disable-thread-safety \ - $(use_with perl) \ - $(use_with python) \ - $(use_with tcl) \ - --with-includes="/usr/include/postgresql-${SLOT}/" \ - "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \ - || die "configure failed" - - for bd in . contrib $(use xml && echo contrib/xml2) ; do - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ - NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed" - done -} - -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 - - for bd in . contrib $(use xml && echo contrib/xml2) ; do - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake install -C $bd -j1 DESTDIR="${D}" \ - PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed" - done - rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" - rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1 - - dodoc README HISTORY doc/{README.*,TODO,bug.template} - - dodir /usr/$(get_libdir)/eselect-postgresql/slots/${SLOT} - cat >"${D}/usr/$(get_libdir)/eselect-postgresql/slots/${SLOT}/service" <<-__EOF__ - postgres_ebuilds="\${postgres_ebuilds} ${PF}" - postgres_service="postgresql-${SLOT}" - __EOF__ - - newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed" - newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed" -} - -pkg_postinst() { - eselect postgresql update - [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT} - [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT} - elog "Execute the following command to setup the initial database environment:" - elog - elog "emerge --config =${CATEGORY}/${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 for all clusters in ${ROOT}/etc/postgresql-${SLOT}/postgresql.conf." -} - -pkg_postrm() { - eselect postgresql update -} - -pkg_config() { - einfo "Creating the data directory ..." - mkdir -p "${PGDATA}" - chown -Rf postgres:postgres "${PGDATA}" - chmod 0700 "${PGDATA}" - - einfo "Initializing the database ..." - if [[ -f "${PGDATA}/PG_VERSION" ]] ; then - eerror "PostgreSQL ${PV} cannot upgrade your existing databases." - eerror "You must remove your entire database directory to continue." - eerror "(database directory = ${PGDATA})." - 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" - - 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" - fi - - einfo - einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'." - einfo - fi -} - -src_test() { - einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake -j1 check \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details." - - einfo "Yes, there are other tests which could be run." - einfo "... and no, we don't plan to add/support them." - einfo "For now, the main regressions tests will suffice." - einfo "If you think other tests are necessary, please submit a" - einfo "bug including a patch for this ebuild to enable them." -} diff --git a/dev-db/postgresql-server/postgresql-server-8.2.7.ebuild b/dev-db/postgresql-server/postgresql-server-8.2.7.ebuild new file mode 100644 index 0000000..4998e22 --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-8.2.7.ebuild @@ -0,0 +1,214 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="1" + +WANT_AUTOCONF="latest" +WANT_AUTOMAKE="none" +inherit eutils multilib toolchain-funcs versionator autotools + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" + +DESCRIPTION="PostgreSQL server" +HOMEPAGE="http://www.postgresql.org/" +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" +LICENSE="POSTGRESQL" +SLOT="$(get_version_component_range 1-2)" +IUSE_LINGUAS=" + linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr + linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl + linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv + linguas_tr linguas_zh_CN linguas_zh_TW" +IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}" + +wanted_languages() { + for u in ${IUSE_LINGUAS} ; do + use $u && echo ${u#linguas_} + done +} + +RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT} + perl? ( >=dev-lang/perl-5.6.1-r2 ) + python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base ) + selinux? ( sec-policy/selinux-postgresql ) + tcl? ( >=dev-lang/tcl-8 ) + xml? ( dev-libs/libxml2 dev-libs/libxslt )" +DEPEND="${RDEPEND} + xml? ( dev-util/pkgconfig )" +PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )" + +[[ -r /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} +[[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data" +[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + if [[ $(cat "${PGDATA}/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 = ${PGDATA})." + die "Remove your database directory to continue" + fi + fi + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib postgres +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if hasq test ${FEATURES}; then + sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source + else + echo "all install:" > "${S}/src/test/regress/GNUmakefile" + fi + + eautoconf +} + +src_compile() { + # TODO: test if PPC really cannot work with other CFLAGS settings + # use ppc && CFLAGS="-pipe -fsigned-char" + + # eval is needed to get along with pg_config quotation of space-rich entities. + eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \ + --disable-thread-safety \ + $(use_with perl) \ + $(use_with python) \ + $(use_with tcl) \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \ + || die "configure failed" + + for bd in . contrib $(use xml && echo contrib/xml2) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ + NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed" + done +} + +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 + + for bd in . contrib $(use xml && echo contrib/xml2) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake install -C $bd -j1 DESTDIR="${D}" \ + PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed" + done + rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" + rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1 + + dodoc README HISTORY doc/{README.*,TODO,bug.template} + + dodir /usr/$(get_libdir)/eselect-postgresql/slots/${SLOT} + cat >"${D}/usr/$(get_libdir)/eselect-postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed" +} + +pkg_postinst() { + eselect postgresql update + [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT} + [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT} + elog "Execute the following command to setup the initial database environment:" + elog + elog "emerge --config =${CATEGORY}/${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 for all clusters in ${ROOT}/etc/postgresql-${SLOT}/postgresql.conf." +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "PostgreSQL ${PV} cannot upgrade your existing databases." + eerror "You must remove your entire database directory to continue." + eerror "(database directory = ${PGDATA})." + 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" + + 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" + fi + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'." + einfo + fi +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -j1 check \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details." + + einfo "Yes, there are other tests which could be run." + einfo "... and no, we don't plan to add/support them." + einfo "For now, the main regressions tests will suffice." + einfo "If you think other tests are necessary, please submit a" + einfo "bug including a patch for this ebuild to enable them." +} diff --git a/dev-db/postgresql-server/postgresql-server-8.3.0.ebuild b/dev-db/postgresql-server/postgresql-server-8.3.0.ebuild deleted file mode 100644 index c28af9e..0000000 --- a/dev-db/postgresql-server/postgresql-server-8.3.0.ebuild +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="1" - -WANT_AUTOCONF="latest" -WANT_AUTOMAKE="none" -inherit eutils multilib toolchain-funcs versionator autotools - -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" - -DESCRIPTION="PostgreSQL server" -HOMEPAGE="http://www.postgresql.org/" -SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" -LICENSE="POSTGRESQL" -SLOT="$(get_version_component_range 1-2)" -IUSE_LINGUAS=" - linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr - linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl - linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv - linguas_tr linguas_zh_CN linguas_zh_TW" -IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}" - -wanted_languages() { - for u in ${IUSE_LINGUAS} ; do - use $u && echo ${u#linguas_} - done -} - -RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT} - perl? ( >=dev-lang/perl-5.6.1-r2 ) - python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base ) - selinux? ( sec-policy/selinux-postgresql ) - tcl? ( >=dev-lang/tcl-8 ) - xml? ( dev-libs/libxml2 dev-libs/libxslt )" -DEPEND="${RDEPEND} - xml? ( dev-util/pkgconfig )" -PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )" - -[[ -r /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} -[[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data" -[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512" - -S="${WORKDIR}/postgresql-${PV}" - -pkg_setup() { - if [[ -f "${PGDATA}/PG_VERSION" ]] ; then - if [[ $(cat "${PGDATA}/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 = ${PGDATA})." - die "Remove your database directory to continue" - fi - fi - enewgroup postgres 70 - enewuser postgres 70 /bin/bash /var/lib postgres -} - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ - "${FILESDIR}/postgresql-${SLOT}-server.patch" - - if hasq test ${FEATURES}; then - sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source - else - echo "all install:" > "${S}/src/test/regress/GNUmakefile" - fi - - eautoconf -} - -src_compile() { - # TODO: test if PPC really cannot work with other CFLAGS settings - # use ppc && CFLAGS="-pipe -fsigned-char" - - # eval is needed to get along with pg_config quotation of space-rich entities. - eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \ - --disable-thread-safety \ - $(use_with perl) \ - $(use_with python) \ - $(use_with tcl) \ - $(use_with xml libxml) \ - --with-includes="/usr/include/postgresql-${SLOT}/" \ - "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \ - || die "configure failed" - - for bd in . contrib $(use xml && echo contrib/xml2) ; do - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ - NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed" - done -} - -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 - - for bd in . contrib $(use xml && echo contrib/xml2) ; do - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake install -C $bd -j1 DESTDIR="${D}" \ - PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed" - done - rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" - rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1 - - dodoc README HISTORY doc/{README.*,TODO,bug.template} - - dodir /usr/$(get_libdir)/eselect-postgresql/slots/${SLOT} - cat >"${D}/usr/$(get_libdir)/eselect-postgresql/slots/${SLOT}/service" <<-__EOF__ - postgres_ebuilds="\${postgres_ebuilds} ${PF}" - postgres_service="postgresql-${SLOT}" - __EOF__ - - newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed" - newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed" -} - -pkg_postinst() { - eselect postgresql update - [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT} - [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT} - elog "Execute the following command to setup the initial database environment:" - elog - elog "emerge --config =${CATEGORY}/${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 for all clusters in ${ROOT}/etc/postgresql-${SLOT}/postgresql.conf." -} - -pkg_postrm() { - eselect postgresql update -} - -pkg_config() { - einfo "Creating the data directory ..." - mkdir -p "${PGDATA}" - chown -Rf postgres:postgres "${PGDATA}" - chmod 0700 "${PGDATA}" - - einfo "Initializing the database ..." - if [[ -f "${PGDATA}/PG_VERSION" ]] ; then - eerror "PostgreSQL ${PV} cannot upgrade your existing databases." - eerror "You must remove your entire database directory to continue." - eerror "(database directory = ${PGDATA})." - 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" - - 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" - fi - - einfo - einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'." - einfo - fi -} - -src_test() { - einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake -j1 check \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details." - - einfo "Yes, there are other tests which could be run." - einfo "... and no, we don't plan to add/support them." - einfo "For now, the main regressions tests will suffice." - einfo "If you think other tests are necessary, please submit a" - einfo "bug including a patch for this ebuild to enable them." -} diff --git a/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild b/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild new file mode 100644 index 0000000..c28af9e --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild @@ -0,0 +1,215 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="1" + +WANT_AUTOCONF="latest" +WANT_AUTOMAKE="none" +inherit eutils multilib toolchain-funcs versionator autotools + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" + +DESCRIPTION="PostgreSQL server" +HOMEPAGE="http://www.postgresql.org/" +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" +LICENSE="POSTGRESQL" +SLOT="$(get_version_component_range 1-2)" +IUSE_LINGUAS=" + linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr + linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl + linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv + linguas_tr linguas_zh_CN linguas_zh_TW" +IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}" + +wanted_languages() { + for u in ${IUSE_LINGUAS} ; do + use $u && echo ${u#linguas_} + done +} + +RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT} + perl? ( >=dev-lang/perl-5.6.1-r2 ) + python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base ) + selinux? ( sec-policy/selinux-postgresql ) + tcl? ( >=dev-lang/tcl-8 ) + xml? ( dev-libs/libxml2 dev-libs/libxslt )" +DEPEND="${RDEPEND} + xml? ( dev-util/pkgconfig )" +PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )" + +[[ -r /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} +[[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data" +[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + if [[ $(cat "${PGDATA}/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 = ${PGDATA})." + die "Remove your database directory to continue" + fi + fi + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib postgres +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if hasq test ${FEATURES}; then + sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source + else + echo "all install:" > "${S}/src/test/regress/GNUmakefile" + fi + + eautoconf +} + +src_compile() { + # TODO: test if PPC really cannot work with other CFLAGS settings + # use ppc && CFLAGS="-pipe -fsigned-char" + + # eval is needed to get along with pg_config quotation of space-rich entities. + eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \ + --disable-thread-safety \ + $(use_with perl) \ + $(use_with python) \ + $(use_with tcl) \ + $(use_with xml libxml) \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \ + || die "configure failed" + + for bd in . contrib $(use xml && echo contrib/xml2) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ + NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed" + done +} + +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 + + for bd in . contrib $(use xml && echo contrib/xml2) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake install -C $bd -j1 DESTDIR="${D}" \ + PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed" + done + rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" + rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1 + + dodoc README HISTORY doc/{README.*,TODO,bug.template} + + dodir /usr/$(get_libdir)/eselect-postgresql/slots/${SLOT} + cat >"${D}/usr/$(get_libdir)/eselect-postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed" +} + +pkg_postinst() { + eselect postgresql update + [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT} + [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT} + elog "Execute the following command to setup the initial database environment:" + elog + elog "emerge --config =${CATEGORY}/${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 for all clusters in ${ROOT}/etc/postgresql-${SLOT}/postgresql.conf." +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "PostgreSQL ${PV} cannot upgrade your existing databases." + eerror "You must remove your entire database directory to continue." + eerror "(database directory = ${PGDATA})." + 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" + + 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/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata ${PGDATA} ${PG_INITDB_OPTS}" + fi + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'." + einfo + fi +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -j1 check \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details." + + 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." +} -- cgit v1.2.3-65-gdbad