diff options
author | 2008-01-13 20:14:55 +0000 | |
---|---|---|
committer | 2008-01-13 20:14:55 +0000 | |
commit | 63d73a9a3bcbecbf04622c67697c701d89e9d4fe (patch) | |
tree | 852280c14ccec90a6c9fc481cd36415c0531d0d4 /dev-db/postgresql | |
parent | Initial import to the tree as per bug 205646. (diff) | |
download | historical-63d73a9a3bcbecbf04622c67697c701d89e9d4fe.tar.gz historical-63d73a9a3bcbecbf04622c67697c701d89e9d4fe.tar.bz2 historical-63d73a9a3bcbecbf04622c67697c701d89e9d4fe.zip |
Bump to 7.4.19 for #204760
Package-Manager: portage-2.1.4
Diffstat (limited to 'dev-db/postgresql')
-rw-r--r-- | dev-db/postgresql/ChangeLog | 8 | ||||
-rw-r--r-- | dev-db/postgresql/Manifest | 20 | ||||
-rw-r--r-- | dev-db/postgresql/files/digest-postgresql-7.4.19 | 3 | ||||
-rw-r--r-- | dev-db/postgresql/files/postgresql-7.4.19-hppa-testandset.patch | 50 | ||||
-rw-r--r-- | dev-db/postgresql/postgresql-7.4.19.ebuild | 273 |
5 files changed, 349 insertions, 5 deletions
diff --git a/dev-db/postgresql/ChangeLog b/dev-db/postgresql/ChangeLog index 3dad2a29a601..fa9a51d6e59f 100644 --- a/dev-db/postgresql/ChangeLog +++ b/dev-db/postgresql/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-db/postgresql # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.355 2008/01/13 19:33:55 mjolnir Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.356 2008/01/13 20:14:55 mjolnir Exp $ + +*postgresql-7.4.19 (13 Jan 2008) + + 13 Jan 2008; Martin Jackson <mjolnir@gentoo.org> + +files/postgresql-7.4.19-hppa-testandset.patch, +postgresql-7.4.19.ebuild: + Bump to 7.4.19 for #204760 *postgresql-8.0.15 (13 Jan 2008) diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest index 02e85d18c993..ad9957f650f1 100644 --- a/dev-db/postgresql/Manifest +++ b/dev-db/postgresql/Manifest @@ -22,6 +22,10 @@ AUX postgresql-7.4.17-hppa-testandset.patch 1394 RMD160 8f65f37b7e6cf251c4ab1342 MD5 2bf25091efb109eaf759b63e39b08716 files/postgresql-7.4.17-hppa-testandset.patch 1394 RMD160 8f65f37b7e6cf251c4ab134227570ee9974915a8 files/postgresql-7.4.17-hppa-testandset.patch 1394 SHA256 226f17c6064f53be2908325153b64e5f3b7d3e2275b7bd0f1abac27404b4678e files/postgresql-7.4.17-hppa-testandset.patch 1394 +AUX postgresql-7.4.19-hppa-testandset.patch 1394 RMD160 8f65f37b7e6cf251c4ab134227570ee9974915a8 SHA1 359a4b598aa419d5ae92d746d13abd4a6e05a0cf SHA256 226f17c6064f53be2908325153b64e5f3b7d3e2275b7bd0f1abac27404b4678e +MD5 2bf25091efb109eaf759b63e39b08716 files/postgresql-7.4.19-hppa-testandset.patch 1394 +RMD160 8f65f37b7e6cf251c4ab134227570ee9974915a8 files/postgresql-7.4.19-hppa-testandset.patch 1394 +SHA256 226f17c6064f53be2908325153b64e5f3b7d3e2275b7bd0f1abac27404b4678e files/postgresql-7.4.19-hppa-testandset.patch 1394 AUX postgresql-8.0.13-sh.patch 617 RMD160 d826fbb45265d09880000ea33ac3323beabb0f50 SHA1 e9a271f0fae2bad9150dbb8579615c90253e538b SHA256 420023f4789c650189da203d43b134d511ff1b976d17a3948774b0c7bf72d683 MD5 0616d8126fb38e59b56f2922654e4724 files/postgresql-8.0.13-sh.patch 617 RMD160 d826fbb45265d09880000ea33ac3323beabb0f50 files/postgresql-8.0.13-sh.patch 617 @@ -126,6 +130,7 @@ AUX postgresql.init-8.2 1427 RMD160 74393b4eb2b851c01deaa3dea10757c9bb74bd73 SHA MD5 525da9f09a404f188622921a3318efad files/postgresql.init-8.2 1427 RMD160 74393b4eb2b851c01deaa3dea10757c9bb74bd73 files/postgresql.init-8.2 1427 SHA256 c42e7ba85638a31826b4ed7a92a9f95cd242bbe7c846e52a8b87e0db28c17da5 files/postgresql.init-8.2 1427 +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.2.6.tar.bz2 12559117 RMD160 fa12ce310919cb52be3558d38a7e329bc73bbe33 SHA1 8934dfbd4c1d8c4f2945cb80f02072611681f967 SHA256 ee41327e821f933de2894d6e0c319edc4b63e80cb902e673b490b7eaf4ead114 DIST postgresql-base-7.3.19.tar.bz2 5691127 RMD160 802bbba70d1368097a74de6b67589ab9645597cc SHA1 09206cd4d9c2b5648756eff70f101cec89365776 SHA256 1804e0424e4444f67acfb98b4e4ad2ede26748d1ddb4a9201cbff7627e394e6a @@ -156,6 +161,10 @@ EBUILD postgresql-7.4.17.ebuild 9840 RMD160 2de253137ef58fbe0fc9f81abdacf6186843 MD5 a8866f3e9d1112c1bf3b2b0660188d76 postgresql-7.4.17.ebuild 9840 RMD160 2de253137ef58fbe0fc9f81abdacf6186843c518 postgresql-7.4.17.ebuild 9840 SHA256 6999d6d6f7e78e93b7692f5c3e97f33bc5d2b4b9ca86ced1427594b0ddbbcecd postgresql-7.4.17.ebuild 9840 +EBUILD postgresql-7.4.19.ebuild 9645 RMD160 e82358b292eb8734db981f15a8ab233187f836b5 SHA1 2c9162c5bfac015de74b8ca17803be0271396c22 SHA256 cee401035d470cd10b868d2f95eb525d7f4c9a804268f9e26fc607ce50184cc2 +MD5 eb3c0d3dcf4c4eb44b478d4ff7a46f36 postgresql-7.4.19.ebuild 9645 +RMD160 e82358b292eb8734db981f15a8ab233187f836b5 postgresql-7.4.19.ebuild 9645 +SHA256 cee401035d470cd10b868d2f95eb525d7f4c9a804268f9e26fc607ce50184cc2 postgresql-7.4.19.ebuild 9645 EBUILD postgresql-8.0.13.ebuild 9813 RMD160 fada6bedfc03afc0ed9dab6793e39fe713309f51 SHA1 fd18cb090ba9c5bc5b2c5558c0a121b70cd2aa03 SHA256 47c1e26eca8aff0d5e6ee8f17370f53071eac4c6726e49a1212f254dc4276a9c MD5 1be2ccc70c2df8e3d66c95b87ec05bd4 postgresql-8.0.13.ebuild 9813 RMD160 fada6bedfc03afc0ed9dab6793e39fe713309f51 postgresql-8.0.13.ebuild 9813 @@ -176,10 +185,10 @@ EBUILD postgresql-8.2.6.ebuild 8105 RMD160 bd276f9f2146e9f2cd8ee4b5f8268a44f4910 MD5 c1ad598e4670a17e38c672d69ffb0e9a postgresql-8.2.6.ebuild 8105 RMD160 bd276f9f2146e9f2cd8ee4b5f8268a44f4910f64 postgresql-8.2.6.ebuild 8105 SHA256 acd5a1244c989880082430ea1343789d8f7990ce046172758a99cffb1b6ac7eb postgresql-8.2.6.ebuild 8105 -MISC ChangeLog 76078 RMD160 bdac733a7c44d8a37298296c2ec3a0f3508c8876 SHA1 6baaccf61838a3a64e991b52427002e89cda314e SHA256 0612379d1e0cd47001408145c2780c502d20c1f02cb4a3f08a799043c2e7c717 -MD5 cf471faf9bb06439323808cb76d2f869 ChangeLog 76078 -RMD160 bdac733a7c44d8a37298296c2ec3a0f3508c8876 ChangeLog 76078 -SHA256 0612379d1e0cd47001408145c2780c502d20c1f02cb4a3f08a799043c2e7c717 ChangeLog 76078 +MISC ChangeLog 76270 RMD160 aaa54ab4cd87f0f56e8be3fe1774ad083dcbd718 SHA1 24bf5cde350bee2a46f1c241e158308a9b7da1a5 SHA256 782acad988dbce662eca7d7c327e9ebb109428293c1c97e2262911825ddf0f2c +MD5 bbee4c707da8c2411165b8ceedb590e1 ChangeLog 76270 +RMD160 aaa54ab4cd87f0f56e8be3fe1774ad083dcbd718 ChangeLog 76270 +SHA256 782acad988dbce662eca7d7c327e9ebb109428293c1c97e2262911825ddf0f2c ChangeLog 76270 MISC metadata.xml 164 RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc SHA1 f67b7ac1c5e6e65ef5a19a589d4759c84918f86c SHA256 7e8e8126bc8701c4a42c7dfed8bb755ac6040fe3d0e3f994d888f8b2b4fa7d8b MD5 6fe52df942ef15801d56449cd8299604 metadata.xml 164 RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc metadata.xml 164 @@ -190,6 +199,9 @@ SHA256 59079fe9d80de56c7e6eef5e64f106bbf5143462d9472953a192e33a4b6201b7 files/di MD5 561024989ce7be36fa4474211ae7b7c2 files/digest-postgresql-7.4.17 1087 RMD160 811b466e6e54693166ac405d7c0dbb750728f6e0 files/digest-postgresql-7.4.17 1087 SHA256 e1b60261487e99d6101290910dc22449e743c54e17c404c3f995bfca6940ea41 files/digest-postgresql-7.4.17 1087 +MD5 d98b405b951efbaa919ed890118f3262 files/digest-postgresql-7.4.19 262 +RMD160 fa3e756851fbf3b72ea22b402837260263e6371c files/digest-postgresql-7.4.19 262 +SHA256 e68f25453b492b1b956e0fe7a6511d375befb38d43a3a456f52db0af80b6c18a files/digest-postgresql-7.4.19 262 MD5 cacd8257d8fc0d524abc6e5f2dfcdb42 files/digest-postgresql-8.0.13 1087 RMD160 8da664bd5067ebe6957f407f6020dc3f4056cc6a files/digest-postgresql-8.0.13 1087 SHA256 b307557da314dd1a813501cfbf1054e18221024f2dc5b8410f62ee37030ffe72 files/digest-postgresql-8.0.13 1087 diff --git a/dev-db/postgresql/files/digest-postgresql-7.4.19 b/dev-db/postgresql/files/digest-postgresql-7.4.19 new file mode 100644 index 000000000000..fb3a4311c94d --- /dev/null +++ b/dev-db/postgresql/files/digest-postgresql-7.4.19 @@ -0,0 +1,3 @@ +MD5 0be8c193fb73113930d043c60200598b postgresql-7.4.19.tar.bz2 10307396 +RMD160 c9a1c7dc8e7bf9ce93c3b4f061af0563b1cc2627 postgresql-7.4.19.tar.bz2 10307396 +SHA256 447ac7070aa0a547f17a307e842734fc27e2716cb4a251fa9a810b178d44c389 postgresql-7.4.19.tar.bz2 10307396 diff --git a/dev-db/postgresql/files/postgresql-7.4.19-hppa-testandset.patch b/dev-db/postgresql/files/postgresql-7.4.19-hppa-testandset.patch new file mode 100644 index 000000000000..d5f916d455eb --- /dev/null +++ b/dev-db/postgresql/files/postgresql-7.4.19-hppa-testandset.patch @@ -0,0 +1,50 @@ +--- postgresql-7.4.12.orig/src/include/port/linux.h 2003-10-26 01:41:10.000000000 +0000 ++++ postgresql-7.4.12/src/include/port/linux.h 2004-01-09 20:22:50.000000000 +0000 +@@ -3,6 +3,11 @@ + + #define HAS_TEST_AND_SET + ++#elif defined(__hppa__) ++typedef struct { int sema[4]; } slock_t; ++ ++#define HAS_TEST_AND_SET ++ + #elif defined(__sparc__) + typedef unsigned char slock_t; + +--- postgresql-7.4.12.orig/src/include/storage/s_lock.h 2003-11-04 09:43:56.000000000 +0000 ++++ postgresql-7.4.12/src/include/storage/s_lock.h 2004-01-09 20:12:15.000000000 +0000 +@@ -112,6 +112,33 @@ + + #endif /* __i386__ || __x86_64__ */ + ++#if defined(__hppa__) || defined(__hppa) ++#define TAS(lock) tas(lock) ++ ++#define __ldcw(a) ({ \ ++ unsigned int __ret; \ ++ __asm__ __volatile__("ldcw 0(%2),%0" \ ++ : "=r" (__ret), "=m" (*(a)) : "r" (a)); \ ++ __ret; \ ++}) ++ ++#define __PA_LDCW_ALIGNMENT 16 ++#define __ldcw_align(a) ({ \ ++ volatile unsigned int __ret = (unsigned int) a; \ ++ if ((__ret & ~(__PA_LDCW_ALIGNMENT - 1)) < (unsigned int) a) \ ++ __ret = (__ret & ~(__PA_LDCW_ALIGNMENT - 1)) + __PA_LDCW_ALIGNMENT; \ ++ (unsigned int *) __ret; \ ++}) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ volatile unsigned int *a = __ldcw_align (lock); ++ return (__ldcw(a) == 0); ++} ++ ++#endif /* __hppa__ || __hppa */ ++ + + /* Intel Itanium */ + #if defined(__ia64__) || defined(__ia64) diff --git a/dev-db/postgresql/postgresql-7.4.19.ebuild b/dev-db/postgresql/postgresql-7.4.19.ebuild new file mode 100644 index 000000000000..b59210939640 --- /dev/null +++ b/dev-db/postgresql/postgresql-7.4.19.ebuild @@ -0,0 +1,273 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.4.19.ebuild,v 1.1 2008/01/13 20:14:55 mjolnir Exp $ + +inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" + +DESCRIPTION="Sophisticated and powerful Object-Relational DBMS." +HOMEPAGE="http://www.postgresql.org/" +SRC_URI="mirror://postgresql/source/v${PV}/${PN}-${PV}.tar.bz2" +LICENSE="POSTGRESQL" +SLOT="0" +IUSE="doc kerberos nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib" + +RDEPEND="~dev-db/libpq-${PV} + >=sys-libs/ncurses-5.2 + kerberos? ( virtual/krb5 ) + pam? ( virtual/pam ) + perl? ( >=dev-lang/perl-5.6.1-r2 ) + python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base ) + readline? ( >=sys-libs/readline-4.1 ) + selinux? ( sec-policy/selinux-postgresql ) + ssl? ( >=dev-libs/openssl-0.9.6-r1 ) + tcl? ( >=dev-lang/tcl-8 ) + xml? ( dev-libs/libxml2 dev-libs/libxslt ) + zlib? ( >=sys-libs/zlib-1.1.3 ) + virtual/logger" +DEPEND="${RDEPEND} + sys-devel/autoconf + >=sys-devel/bison-1.875 + nls? ( sys-devel/gettext ) + xml? ( dev-util/pkgconfig )" + +PG_DIR="/var/lib/postgresql" +[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512" + +cluster_exists() { + [[ -f "${PG_DIR}/data/PG_VERSION" ]] && return 0 + return 1 +} + +pkg_setup() { + if hasq pg-hier ${USE} ; then + ewarn "Warning: pg-hier USE-flag detected:" + ewarn "The hier-patch has been dropped for this version and the pg-hier USE-flag is therefore deprecated." + ewarn "If you really used the 'hier' patch in your database with the 'CONNECT BY' statement," + ewarn "you should stop now and reconsider. You will be able to reuse your data, but not" + ewarn "any VIEWS or QUERIES based on that statement." + ewarn "Please disable the pg-hier USE-flag!" + ebeep 3 + if cluster_exists ; then + eerror "There is already a database in '${PG_DIR}/data' and you have the pg-hier USE-flag set." + eerror "Please read the message above first. If you decide that the warnings there don't" + eerror "apply to your situation, dump the database using pg_dump and move the '${PG_DIR}/data'" + eerror "away. Then restart the merge. After that create a new database cluster and use pg_restore to" + eerror "re-import the previously dumped data." + eerror "Moving '${PG_DIR}/data' temporarely away or just disable the 'pg-hier' USE-flag won't work." + die "Can't update this database." + fi + fi + if cluster_exists ; then + local cluster_version=$(cat "${PG_DIR}/data/PG_VERSION") + if [[ ${cluster_version} != $(get_version_component_range 1-2) ]] ; then + eerror "There is a database in '${PG_DIR}/data' from PostgreSQL version ${cluster_version}." + eerror "PostgreSQL doesn't support upgrades between major versions, you have to use pg_dump" + eerror "to dump your existing database. Then move your '${PG_DIR}/data' directory away and" + eerror "restart the merge. After that create a new database cluster and use pg_restore to" + eerror "re-import the previously dumped data." + die "Can't update this database." + fi + fi + + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib postgres +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # libpq is provided separately as dev-db/libpq + sed -i -e 's/^DIRS := libpq ecpg/DIRS := ecpg/' src/interfaces/Makefile + sed -i -e '/\W\+\$.MAKE. -C include \$/d' src/Makefile + sed -i -e '/^\W\+psql scripts pg_config pg_controldata/ s/pg_config //' src/bin/Makefile + + epatch "${FILESDIR}/${P}-hppa-testandset.patch" + + # Prepare package for future tests + if use test ; then + # 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, well, we + # don't support that in this version of PostgreSQL ... :) + mkdir -p "${S}/src/test/regress/tmp_check" + chown portage "${S}/src/test/regress/tmp_check" + einfo "Tests will be run as user portage." + fi +} + +src_compile() { + filter-flags -ffast-math -feliminate-dwarf2-dups + + # Correctly support the XML stuff + if use xml ; then + CFLAGS="${CFLAGS} $(pkg-config --cflags libxml-2.0)" + LIBS="${LIBS} $(pkg-config --libs libxml-2.0)" + fi + + # 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} \ + --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) \ + --without-tk \ + $(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/xml" + emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib/xml 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/xml" + emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib/xml 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" + + newinitd "${FILESDIR}/pg_autovacuum.init-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum init.d-file failed" + newconfd "${FILESDIR}/pg_autovacuum.conf-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum conf.d-file failed" + dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum +} + +pkg_postinst() { + elog "Execute the following command to setup the initial database environment:" + elog + elog "emerge --config =${PF}" + 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 hasq userpriv ${FEATURES} ; then + 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 + else + eerror "Tests won't be run if FEATURES=userpriv is disabled!" + 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." +} |