diff options
author | Aaron Swenson <titanofold@gentoo.org> | 2011-03-20 15:03:31 +0000 |
---|---|---|
committer | Aaron Swenson <titanofold@gentoo.org> | 2011-03-20 15:03:31 +0000 |
commit | 0d070568d2793d403e30be4fe2bdb3bd2fd78b0b (patch) | |
tree | a747f3988f9370a72db142c1294989d99afc5535 /dev-db | |
parent | Adding 9.1 pre-release (diff) | |
download | historical-0d070568d2793d403e30be4fe2bdb3bd2fd78b0b.tar.gz historical-0d070568d2793d403e30be4fe2bdb3bd2fd78b0b.tar.bz2 historical-0d070568d2793d403e30be4fe2bdb3bd2fd78b0b.zip |
Adding 9.1 pre-release
Package-Manager: portage-2.1.9.42/cvs/Linux i686
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/postgresql-server/ChangeLog | 8 | ||||
-rw-r--r-- | dev-db/postgresql-server/Manifest | 16 | ||||
-rw-r--r-- | dev-db/postgresql-server/postgresql-server-9.1_alpha4.ebuild | 299 |
3 files changed, 311 insertions, 12 deletions
diff --git a/dev-db/postgresql-server/ChangeLog b/dev-db/postgresql-server/ChangeLog index abbcadf162fa..7652235bb5d7 100644 --- a/dev-db/postgresql-server/ChangeLog +++ b/dev-db/postgresql-server/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-db/postgresql-server # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.113 2011/03/20 02:38:12 titanofold Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.114 2011/03/20 15:03:31 titanofold Exp $ + +*postgresql-server-9.1_alpha4 (20 Mar 2011) + + 20 Mar 2011; Aaron W. Swenson <titanofold@gentoo.org> + +postgresql-server-9.1_alpha4.ebuild: + Adding 9.1 pre-release 20 Mar 2011; Mr. Aaron W. Swenson (TitanOfOld) <titanofold@gentoo.org> -files/postgresql.conf-8.1, -files/postgresql.init-8.1, diff --git a/dev-db/postgresql-server/Manifest b/dev-db/postgresql-server/Manifest index 02c260f53081..6b8269b8645d 100644 --- a/dev-db/postgresql-server/Manifest +++ b/dev-db/postgresql-server/Manifest @@ -1,5 +1,3 @@ -AUX postgresql-8.1-common.patch 2290 RMD160 ba1f803b045a8d3f430231b0c22b8817e2eb8cf6 SHA1 facf27b2c396fe9f2347eb4cec3b2714a8587b70 SHA256 f80c8dd5a31b88df330c15de4331db1600ae078a789650ab28d61620f27056f5 -AUX postgresql-8.1-server.patch 6862 RMD160 94dc4c22f1f480bf5844f6e654d8a4e0534059eb SHA1 8fbf5d0b4d24b675f6812ff89465527263f51012 SHA256 97f3b3d889af08aeb92e6583dd970763cdc662621e34e13a5298fe9cd5ad4b4d AUX postgresql-8.2-common.patch 2640 RMD160 b25ba915d5d6ad9c12c1d51426363c196b830923 SHA1 7b946d57bfed34e2e7e1338c3ab3004341d7ab12 SHA256 36ca9cb4f26424c302fdd704b7c1a268e87612afa3006bf008d4594dabe080f8 AUX postgresql-8.2-server.patch 5319 RMD160 9aae5832defd2e43879246e773fd1aada0680716 SHA1 ea726704fc85118c27f511bfd9324b136ced3eb1 SHA256 2687fa5159a34da59e36af4c894f43b2136e8e88c965a682607cb48acb61d8ee AUX postgresql-8.3-common.patch 2641 RMD160 0822bf1512457e91d5f32f9d192de6f197db9c55 SHA1 e4bdbd5eee1023e8f0b42ef408b34b57495d1e2b SHA256 e416c26d9c3d266b306ddbc0a2b648054739b7ace35e2b4e449fbdaf094bc197 @@ -13,8 +11,6 @@ AUX postgresql-9.0-makefile.patch 468 RMD160 0f6d1d393e224b1c566c167af439e6eb0b2 AUX postgresql-9.0-server.2.patch 8189 RMD160 28b1997935c933abe49a60fd07f10bcf08399e02 SHA1 8718e972b94a61438b81d6f449074cf45d1be8c4 SHA256 a4cc1163c37187b97143d53d44997ad71c3766f41dff04baaad09f2f6cbdd773 AUX postgresql-9.0-server.3.patch 8076 RMD160 03883f576e9307876fa47236b498f0dd9e833d8f SHA1 bc640b3bafff25d21bb1f274b3e1d05bc00bc474 SHA256 0e0c13d3cea708dc5d512a53ace1b77ff3c94f2cde98815e417cc2fba70481c7 AUX postgresql-9.0-server.patch 8149 RMD160 c0d49200afe500f74ae1e9f205b236de2c1fcf82 SHA1 3bcc8a0f6745b7579ba3bb132e84095c2de96333 SHA256 bd7a8ec7c6b9b16813837b2609646103e9663c3dc77e9b089230718f30e4e6c4 -AUX postgresql.conf-8.1 1532 RMD160 69ce81cb490d73b1c6fd373ff6d4f76abbaec4f9 SHA1 6120fcbc61cce8da2b02eb5608def3e65a6ff04d SHA256 e28635d2abb43a30fe58d0d35c7266e40cb323c94797b8a98a0b7f2a4caf507d -AUX postgresql.conf-8.1-r1 1510 RMD160 49bd9e04457b52ad6799580c778541291a3f8155 SHA1 e37375c48f50e8827b1e4e39ad91528c584a5749 SHA256 1b0e09c99804d526ddbfc63d7c586d0fb36f0fa99ee03c005204b5d385ad173d AUX postgresql.conf-8.2 1725 RMD160 9f52e0262bdbc42bef1847e986a303b4462d3b2e SHA1 7f3765371e38b6a3c14c7a89bdc7cb548b3b98bb SHA256 e0101dfd82cb3e4362a2563cc75b76cb822b0ccc1b5958b92bdc16b4e1af9aea AUX postgresql.conf-8.2-r1 1510 RMD160 7801c8e338975851e19b12d532d4f17366460fc6 SHA1 a301104fcdc7d80942c0f7d227b654c466302890 SHA256 fed7efa0142fc6b37b4648cf38cf0c2f385ec29b1d2a9ec57ba7183ecf0847a3 AUX postgresql.conf-8.3 1725 RMD160 5bdd027b82013feddcba5d68c09e4122e219ecd2 SHA1 c1bc9ba72623efa12bfad55a0e12a57350955409 SHA256 15cb0f8052d0ecc1bced449777f76875c06ab088f67c1f7f3148b84e97082233 @@ -23,8 +19,6 @@ AUX postgresql.conf-8.4 1734 RMD160 baf6d8b27df72bcfcf8271bc2930a67ea591c3f3 SHA AUX postgresql.conf-8.4-r1 1691 RMD160 1d7a66c3bd55295e65c89ff9af4f66a802e0fb41 SHA1 8a68f9b85165eccd6af99dc05a9d6059706ed0cb SHA256 bec794f6fd139fc6b1598cc111697ba3ba7137ccea409112f352631b285380fa AUX postgresql.conf-9.0 1725 RMD160 b72fd596441579f67f89acd74edd68815e19ae17 SHA1 610096cc74ec37ab452f14d1204ec4263eb9703f SHA256 75806e136e341020ca8baeea2d2cc2e1e777fb78a345e0bbc8f15dd4cfa8c90e AUX postgresql.conf-9.0-r1 1691 RMD160 752a860bf07f4bc0b340179d460a965aa6908820 SHA1 13b1c810e402bc67b940b721bde7872f6ec078ed SHA256 389c104d73647b9e9199d93836f8b38c280a844e3e1f1d39552871be0023b7bd -AUX postgresql.init-8.1 2979 RMD160 da0119c95bcf29f295a94a21be8e711d83953b90 SHA1 c0ad473f8670a3a262b8d14cbe2d3ff2dae88474 SHA256 136eb2d2ba8db0fc0a5018c2093e6cc665c536d4347837c574888f8a54ebeb33 -AUX postgresql.init-8.1-r1 3709 RMD160 754a772248820a51da8062a07f59be36b264b0be SHA1 b71c961454a5b412b4e69c8a139944bd29a2d6e7 SHA256 f1a34fad867c8bd4c5d1542d69cdbc54d639e6fe78653e9aa63e4e48d3dd9ef7 AUX postgresql.init-8.2 3033 RMD160 9f063a0521bacabcf8b0b30d22b101dcde967769 SHA1 039acfdda06a25b999869422d9e388ecbc7250f0 SHA256 678c7627a26a5cf2875054138757e8b8d7a4ee80bfc659de86242b4e40e90802 AUX postgresql.init-8.2-r1 3709 RMD160 2a675846c634f11ed1a2fa5817f818d1c13eae0d SHA1 5abc1afc856d08a6a10d7fc4ca1b930474dea4a1 SHA256 28c5251c359c21bfb41600e826ee0958847389117dea6fe2722caea6b1f0a534 AUX postgresql.init-8.3 3033 RMD160 b1a666473a03860d509c21d3a00f23f2134a0c18 SHA1 af5852d5b3d8895331d1a960d55f1d795c662460 SHA256 4ced52dcbfc35483346764a9fff641320477b7d8a70f4e16b733b8a96eee7da1 @@ -33,8 +27,6 @@ AUX postgresql.init-8.4 3053 RMD160 517d00309769d3343def79e98e3867c464b38875 SHA AUX postgresql.init-8.4-r1 3947 RMD160 31ac63d4f849f2aedfaca7ae0f3aca50f155890c SHA1 6428c91f8378bd5f46004639d753f625cfc0c953 SHA256 ddbfde9d2934581a97665adc7982b384a8e3852bf3b478c59ae57f943fb1ca27 AUX postgresql.init-9.0 3033 RMD160 90063475bdb11926ecb22b649eb4ed9b594e8da8 SHA1 289f67a6cb86e2eb55f207d47d96b3fbb316ab7b SHA256 97bd5cf2110a9e7c28927167e3f8c058bfa77dbcdaeae2bfa46b960747df0780 AUX postgresql.init-9.0-r1 3861 RMD160 f8c9a1d874e81932e6df6dcb0c68287dad68d44f SHA1 ac761e2b0d95e5d87422f8552427987363fd8894 SHA256 707a65b4fe1b5f379a7fc865c81e9ba083b4dab0dab8652c2fbe1174a1fc7c46 -DIST postgresql-8.1.22.tar.bz2 11905401 RMD160 d3429d35d63933b9ec052c4e4ef94cc898de77d8 SHA1 019602660b4184402f77004e03ab178a8de99745 SHA256 a01e6baa2ee08868f5318cdaec592d8ca68b5a8ef956b8304a07b3a1c208fefc -DIST postgresql-8.1.23.tar.bz2 11920401 RMD160 cb2c9572ecefe49303e49f458116d51d3f1e6c36 SHA1 418b8c2e5a076e2e3c3e28455ee16b6550210352 SHA256 5a79eb814b4933f95deb704dfbbd6e1966b520ec12b8f4b48bcea9c3266c10ea DIST postgresql-8.2.18.tar.bz2 12723850 RMD160 b1aa60338c3f6dc886caedc60e924128d64971dd SHA1 ec6bd4cd830b5df50c3d6038186cf1af03b609ff SHA256 9dd6d9a11ee8725d921a57af11bc3b83c7496e1b1324b39e09ab1b6eb547b0ca DIST postgresql-8.2.19.tar.bz2 12749881 RMD160 a2b0782cad74ba03a9c003d81943e5d2ad12e8c2 SHA1 f43da20065ca97edc00f10c9db635c6c4279e520 SHA256 9ae639ec9320830c60c7e6b2151ed744c51564d0664d6b5c896b9ed7b4285f5e DIST postgresql-8.2.20.tar.bz2 12756288 RMD160 9fbcf8cfb3dc5efdd29579f44b18112ea2bb2148 SHA1 b401d71fcf199e470e602b058ec175d1a2c19afa SHA256 77674a5804fb96ae28966c3950e38455720b23d9acfd87a092a6f2f3d7520a57 @@ -47,8 +39,9 @@ DIST postgresql-8.4.7.tar.bz2 14133535 RMD160 15721cddd4ee916d44ed7e656c0570ef4c DIST postgresql-9.0.1.tar.bz2 13773951 RMD160 5e4b31d9ff075099671ced015ac0272ae1c04543 SHA1 7adeb3c4b661115ec6eb4e5896edfee71f87245e SHA256 5310cd490127845f1473a0f73f7b0d18277d81d51534ddfe17ea3e78286a3196 DIST postgresql-9.0.2.tar.bz2 14024244 RMD160 3313b4bafe3af6282f68f198da7d50af4d5c01c4 SHA1 42a9518a2f11fa1d09a23bc628b00e992d3bcf4a SHA256 ffb58195850aa0ec9b7b3dcdac51a6dee0c76ea3387b76c805e1c4d186fe2af5 DIST postgresql-9.0.3.tar.bz2 14040705 RMD160 9f5e0584018265282a75be8597fb7ac51ccaa23a SHA1 ea7b4729427f668cbf36184efbc58fd828a2d3ab SHA256 cf429421dea73a7bd5ef9fbdd1212a0d01c0f63c2059e0218a0e350891867b35 -EBUILD postgresql-server-8.1.22.ebuild 9851 RMD160 eb859a2fac7fa7a4514b47fd258c8cdc22b921c6 SHA1 39b8f1c896a090aeb6f7bcb7bcd7a57edddf95c8 SHA256 9dfcefbf0383ba3e1ce38c3a820e3520d534159648a2d6b3684243dd4fbace1f -EBUILD postgresql-server-8.1.23.ebuild 9861 RMD160 86adb2336748f36ef86bf70b989f3717d7f8173e SHA1 01969efc2aeb124f19140dfb1c5ff45406258487 SHA256 a3fa2c5316447a548b2736a51ee9ea9c9efe1d94cc7c9b723000e830c90fbf7a +DIST postgresql-9.1alpha4-patches.tbz2 4326 RMD160 d30f1e3ea673eddba0821c07b3335723d9331769 SHA1 8ac563990d6b0ad5845f68d0eb6f22e7a01acde9 SHA256 5a8297ffb61e9f93ec1b828caddf15d89a9fcc5d1d839501caf47f8a199c1399 +DIST postgresql-9.1alpha4.tar.bz2 14296555 RMD160 71962c5e0833bd42bbea3e7494c24aedbdab6f76 SHA1 9f7d5a663e14caebecb22dbedd07f7d28223ee9a SHA256 5d09764d05dca68cbafc133fd079d312751b0b22722c3ee9e2f33b1f26f78dc6 +DIST postgresql-initscript-1.1.tbz2 2624 RMD160 a365a30d687b0d1f5310634fdb365a8a35d341fb SHA1 2cc5a548004f4d0f4e53444ac84682cb0b17fb61 SHA256 cbf4822afaa0c91fc6a5e2e8f1a51afb49e8473a2b94f0d968706102064f6033 EBUILD postgresql-server-8.2.18.ebuild 10146 RMD160 866f7f61fb2980b7a8f19de51857b8a16e3d2b4b SHA1 fd053ee16ba8be74f06e6a541e9b2f2cbddf0f5e SHA256 428cf6122e463c65209f47f519b5ee6718ab027484ba53df3bcf01e5bc7fdba7 EBUILD postgresql-server-8.2.19.ebuild 10156 RMD160 3b6c3ec4ff02999ca6d2e59f4966efe8120e4f3e SHA1 eda937fbafcf0772740e448051478249092635d1 SHA256 6f6032f54bca4dc1dc942ea89d1ff3d0f9f4487b09722fb734b80730a00eae87 EBUILD postgresql-server-8.2.20.ebuild 10152 RMD160 64af69ec0d89c71008265269638821c3e54e1122 SHA1 cd1caaa0c20baf2e30823af7cd743cb63db87d6b SHA256 2d5c9890103f09175384473dc0eb91703a13e81e90172692402135671b202b02 @@ -61,5 +54,6 @@ EBUILD postgresql-server-8.4.7.ebuild 10348 RMD160 178c71ad91031dcb725d811a0b432 EBUILD postgresql-server-9.0.1.ebuild 10183 RMD160 ea6fd12a8f09c7699aa778d5c98bbcd335c630e1 SHA1 c14311df967c46ffba9b2a255d29e8f301b403b8 SHA256 e84ba8420cbed78b27af8694682cf8ffed521c483e8f99275e22624d4444561f EBUILD postgresql-server-9.0.2.ebuild 10183 RMD160 a689f44bb8d4e14a43605b6774775d86b8fcc254 SHA1 2006f9f68db8b39dd7e4969e7a021cc4713eb8dd SHA256 415f2ca5433850e7a8d9e0c35b5f8991ba78981cc7fc6699e4736e1a20681ecc EBUILD postgresql-server-9.0.3.ebuild 10178 RMD160 65da0866e062f1254e5e082aa3d6e5460035c972 SHA1 629aba6be85464b7e32548e05accc1cb86eeada9 SHA256 5f931b0c7a5ba5265cc1e3386243e18bba02fa1ff415b79d9f78ecbb5d3734de -MISC ChangeLog 35939 RMD160 11fccdc9ac12c7ff45efe3977a92aaf2c263ad50 SHA1 eb82a9c28840c370f94e6e2b2ad9a2a449ada5df SHA256 8a31688c4d09e8ee4f8249edd6b083cb15dc9b63be912e8d37f56d5593b22164 +EBUILD postgresql-server-9.1_alpha4.ebuild 10337 RMD160 bd2fdab0f859120ca077594ebbda4c3c428f9509 SHA1 f18528e8a27f21004f464b0139c05c71d9767cdb SHA256 230a1f29d8965a32e5557ef235ea2fd53c085ef383d935a50195f575f8d08f4a +MISC ChangeLog 36467 RMD160 8035510326cc835076eee7dab55fd267334d9a94 SHA1 abf0ac942a0d0c1af50d8bb310fa022bc38db859 SHA256 1be4893bd3ac485b159eba3dbfd61f38d5efc282f0e9ebb879aedd70a8472dc4 MISC metadata.xml 420 RMD160 789f5a0ce45d05125098fd7e74a816cf08f4c39b SHA1 d308d7434a37f12cd320f74ed85e1d3ca7dabc75 SHA256 ac37a5084450a782d02510149d030bd0d4a63164f2ffb7bdda3ddf344606ca62 diff --git a/dev-db/postgresql-server/postgresql-server-9.1_alpha4.ebuild b/dev-db/postgresql-server/postgresql-server-9.1_alpha4.ebuild new file mode 100644 index 000000000000..aee09d83eeea --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-9.1_alpha4.ebuild @@ -0,0 +1,299 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.1_alpha4.ebuild,v 1.1 2011/03/20 15:03:31 titanofold Exp $ + +EAPI="3" +PYTHON_DEPEND="python? 2" + +WANT_AUTOMAKE="none" +inherit autotools eutils multilib pam prefix python versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" + +# Upstream doesn't have an underscore in the file name +MY_PV=${PV/_/} + +DESCRIPTION="PostgreSQL server" +HOMEPAGE="http://www.postgresql.org/" +SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2 + http://dev.gentoo.org/~titanofold/postgresql-${MY_PV}-patches.tbz2 + http://dev.gentoo.org/~titanofold/postgresql-initscript-1.1.tbz2" +LICENSE="POSTGRESQL" + +S=${WORKDIR}/postgresql-${MY_PV} +SLOT="$(get_version_component_range 1-2)" + +LINGUAS="af cs de es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW" +IUSE="doc kernel_linux nls pam perl -pg_legacytimestamp python selinux tcl uuid xml" + +for lingua in ${LINGUAS}; do + IUSE+=" linguas_${lingua}" +done + +wanted_languages() { + local enable_langs + + for lingua in ${LINGUAS} ; do + use linguas_${lingua} && enable_langs+="${lingua} " + done + + echo -n ${enable_langs} +} + +RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pam?,pg_legacytimestamp=,nls=] + perl? ( >=dev-lang/perl-5.8 ) + python? ( dev-python/egenix-mx-base ) + selinux? ( sec-policy/selinux-postgresql ) + tcl? ( >=dev-lang/tcl-8 ) + uuid? ( dev-libs/ossp-uuid ) + xml? ( dev-libs/libxml2 dev-libs/libxslt )" +DEPEND="${RDEPEND} + sys-devel/flex + xml? ( dev-util/pkgconfig )" +PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )" + +pkg_setup() { + enewgroup postgres 70 + enewuser postgres 70 /bin/bash ${EROOT%/}/var/lib/postgresql postgres + + use python && python_set_active_version 2 +} + +src_prepare() { + epatch "${WORKDIR}/postgresql-${MY_PV}-autoconf.patch" \ + "${WORKDIR}/postgresql-${MY_PV}-server.patch" + + eprefixify src/include/pg_config_manual.h + + if use test ; then + epatch "${WORKDIR}/postgresql-${MY_PV}-regress.patch" + sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c + 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_configure() { + # eval is needed to get along with pg_config quotation of space-rich entities. + eval econf "$(${EROOT%/}/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) \ + $(use_with xml libxslt) \ + $(use_with uuid ossp-uuid) \ + --with-system-tzdata="${EROOT%/}/usr/share/zoneinfo" \ + --with-includes="${EROOT%/}/usr/include/postgresql-${SLOT}/" \ + --with-libraries="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \ + "$(use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + local bd + for bd in . contrib $(use xml && echo contrib/xml2); do + PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 || 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="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake install -C $bd -j1 DESTDIR="${D}" || die "emake install in $bd failed" + done + + dodoc README HISTORY doc/{README.*,TODO,bug.template} + + dodir /etc/eselect/postgresql/slots/${SLOT} + cat > "${ED}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + sed -e "s/@SLOT@/${SLOT}/g" -i "${WORKDIR}"/postgresql.confd + newconfd "${WORKDIR}/postgresql.confd" postgresql-${SLOT} || die "Inserting conf failed" + sed -e "s/@SLOT@/${SLOT}/g" -i "${WORKDIR}"/postgresql.init + newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT} || die "Inserting conf failed" + + use pam && pamd_mimic system-auth postgresql auth account session + + keepdir /var/run/postgresql + fperms 0770 /var/run/postgresql + fowners postgres:postgres /var/run/postgresql +} + +pkg_postinst() { + eselect postgresql update + [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT} + [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT} + + elog "The Unix-domain socket is located in:" + elog " ${EROOT%/}/var/run/postgresql/" + elog + elog "If you have users and/or services that you would like to utilize the socket," + elog "you must add them to the 'postgres' system group:" + elog " usermod -a -G postgres <user>" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that" + elog "it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f ${EROOT%/}/etc/conf.d/postgresql-${SLOT} ]] && source ${EROOT%/}/etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f ${EROOT%/}/etc/env.d/02locale ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source ${EROOT%/}/etc/env.d/02locale + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (Y/n)" + read answer + if [[ $answer =~ ^[Yy](|[Ee][Ss])$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn](|[Oo])$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + einfo "Skipped." + einfo " Tests not supported on this OS (yet)" + else + if [ -z ${SKIP_SYSTEM_TESTS} ] ; then + einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..." + + local SEMMSL=$(sysctl -n kernel.sem | cut -f1) + local SEMMNS=$(sysctl -n kernel.sem | cut -f2) + local SEMMNI=$(sysctl -n kernel.sem | cut -f4) + local SHMMAX=$(sysctl -n kernel.shmmax) + + local SEMMSL_MIN=17 + local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 )) + local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 )) + local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) )) + + for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do + if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then + eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)" + eerror "You have now several options:" + eerror " - Change the mentioned system parameter" + eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a" + eerror " value lower than ${PG_MAX_CONNECTIONS}" + eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely" + eerror "More information can be found here:" + eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html" + die "System test failed." + fi + done + einfo "Passed." + else + ewarn "SKIP_SYSTEM_TESTS set, so skipping." + fi + fi + + einfo "Creating the data directory ..." + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + + einfo "Initializing the database ..." + + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + + mv ${DATA_DIR%/}/*.conf ${PGDATA} + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + einfo "You can use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + + if [ ${UID} -ne 0 ] ; then + emake -j1 check || die "Make check failed. See above for details." + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + ewarn "Tests cannot be run as root. Skipping." + ewarn "HINT: FEATURES=\"userpriv\"" + fi +} |