diff options
author | Patrick Lauer <patrick@gentoo.org> | 2010-06-04 14:18:53 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2010-06-04 14:18:53 +0000 |
commit | 27b741d564c1a17d4949964bdeb7ecf8d4010ff1 (patch) | |
tree | 0d1d104b27d4dbd029a215f0d043a56c1d394fce /dev-db | |
parent | hppa stable, #308521 (diff) | |
download | historical-27b741d564c1a17d4949964bdeb7ecf8d4010ff1.tar.gz historical-27b741d564c1a17d4949964bdeb7ecf8d4010ff1.tar.bz2 historical-27b741d564c1a17d4949964bdeb7ecf8d4010ff1.zip |
Bugfixes, thanks to Aaron Swenson for collecting and testing. Fixes #312939, #311047, #189854, #237315, #274568, #284094, #255004, #310045, #310619
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64
Diffstat (limited to 'dev-db')
23 files changed, 3214 insertions, 2 deletions
diff --git a/dev-db/postgresql-server/ChangeLog b/dev-db/postgresql-server/ChangeLog index 562e8717ef03..e7e911167e3c 100644 --- a/dev-db/postgresql-server/ChangeLog +++ b/dev-db/postgresql-server/ChangeLog @@ -1,6 +1,30 @@ # ChangeLog for dev-db/postgresql-server # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.61 2010/05/17 13:21:32 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.62 2010/06/04 14:18:53 patrick Exp $ + +*postgresql-server-9.0_beta1-r1 (04 Jun 2010) +*postgresql-server-8.4.4-r1 (04 Jun 2010) +*postgresql-server-8.3.11-r1 (04 Jun 2010) +*postgresql-server-8.2.17-r1 (04 Jun 2010) +*postgresql-server-8.1.21-r1 (04 Jun 2010) +*postgresql-server-8.0.25-r1 (04 Jun 2010) +*postgresql-server-7.4.29-r1 (04 Jun 2010) + + 04 Jun 2010; Patrick Lauer <patrick@gentoo.org> + +files/postgresql.conf-7.4-r1, +files/postgresql.init-7.4-r1, + +postgresql-server-7.4.29-r1.ebuild, +files/postgresql.conf-8.0-r1, + +files/postgresql.init-8.0-r1, +postgresql-server-8.0.25-r1.ebuild, + +files/postgresql.conf-8.1-r1, +files/postgresql.init-8.1-r1, + +postgresql-server-8.1.21-r1.ebuild, +files/postgresql.conf-8.2-r1, + +files/postgresql.init-8.2-r1, +postgresql-server-8.2.17-r1.ebuild, + +files/postgresql.conf-8.3-r1, +files/postgresql.init-8.3-r1, + +postgresql-server-8.3.11-r1.ebuild, +files/postgresql.conf-8.4-r1, + +files/postgresql.init-8.4-r1, +postgresql-server-8.4.4-r1.ebuild, + +postgresql-server-9.0_beta1-r1.ebuild, +files/postgresql.conf-9.0-r1, + +files/postgresql.init-9.0-r1: + Bugfixes, thanks to Aaron Swenson for collecting and testing. Fixes + #312939, #311047, #189854, #237315, #274568, #284094, #255004, #310045, + #310619 *postgresql-server-8.4.4 (17 May 2010) *postgresql-server-8.3.11 (17 May 2010) diff --git a/dev-db/postgresql-server/Manifest b/dev-db/postgresql-server/Manifest index f36bd935f782..c28796cd4620 100644 --- a/dev-db/postgresql-server/Manifest +++ b/dev-db/postgresql-server/Manifest @@ -25,19 +25,33 @@ AUX postgresql-9.0-common.patch 2062 RMD160 75f622bb99583990431672ffdc376c7a1177 AUX postgresql-9.0-makefile.patch 468 RMD160 0f6d1d393e224b1c566c167af439e6eb0b282ee3 SHA1 3ce71590a1e41ce49d65fac64a6f49ab8b2d3d67 SHA256 ccf39a7081f7a830bb46af5571a6b58dd6102659ce0721d64123094b85d161a2 AUX postgresql-9.0-server.patch 8149 RMD160 c0d49200afe500f74ae1e9f205b236de2c1fcf82 SHA1 3bcc8a0f6745b7579ba3bb132e84095c2de96333 SHA256 bd7a8ec7c6b9b16813837b2609646103e9663c3dc77e9b089230718f30e4e6c4 AUX postgresql.conf-7.4 1532 RMD160 8897005145112dc1782174fcac512531a32ce88a SHA1 f7e1e1c6cac39d1c7ecc371c9391214d6a8c8055 SHA256 4084c99ad0fff027876c82375c4d99d1669090398137ef5ed19c8e74cecb6e0c +AUX postgresql.conf-7.4-r1 1510 RMD160 e31248c10c8a657a23a5841a2c232ec989bd6837 SHA1 38dff6229a9bf83abf72197d1551d8a77da1c186 SHA256 614066f51fb0dcb4df0e5811c1b85a61753a5175a2c6edfb13d78b0561d203ea AUX postgresql.conf-8.0 1532 RMD160 de03805c18ac079b830bcc412c838eb67cbf4f2b SHA1 a7e288d80b0fd24ddf55bdd560f1e8b216b1f540 SHA256 471cd40a0f9100789d238722e5e5efb923dd4f526b564341a5401b3df236721a +AUX postgresql.conf-8.0-r1 1509 RMD160 f635fbdf69ea59ba5807515a762e0c0883c2029f SHA1 590b6b5802fa4069949c7a8871b0fb0c140ab724 SHA256 e776063b008d8afe7e08dc6b49808917d8dad02c6d01590ff5ec170e20103a42 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 +AUX postgresql.conf-8.3-r1 1691 RMD160 9a4f583f96e94fc32ffa73e7d13986fca27d01b9 SHA1 8c070a13f6caff17834937b61227cf152e0f58e8 SHA256 0052817a24fc6328dc6c0775b85a333e629306b8966f92935cb5295ac96f5283 AUX postgresql.conf-8.4 1734 RMD160 baf6d8b27df72bcfcf8271bc2930a67ea591c3f3 SHA1 9d0e0bf7b9af999099966edb41427c9ae1081990 SHA256 647b965eaf580fa5d2743e2faecd2ffab7016a541e3e2eec3b8aac2a5c7f9096 +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-7.4 3024 RMD160 703bb92dcc61ebecd97751a68161fd66183b4d4a SHA1 05dc261ec8ff642206b35eb42c8c5c29c4c9ed7b SHA256 0a5b0f9998b848bf9bdf2b1180d7c07280aeaf02012b97a0f096ad199b7ee6be +AUX postgresql.init-7.4-r1 3709 RMD160 a4637b255e891d9e6cd05e2ed3d86b3dda9354d6 SHA1 4fe0d6df4572cd4c515ac3288b186fd0736572ec SHA256 2830b48cdaed87cc46fdf58aedf4c44b4e30775d021ba7a1bc4f5f97414e2364 AUX postgresql.init-8.0 2979 RMD160 5abb830974a5b4287a7768479488d8ee6ed872c1 SHA1 c6dfa1846609abbcb96d88998d34e60d0b84d360 SHA256 383b22086c931cad33a7b04b2bc9269e18e54e8dc1756f8b61a54d0801bd4d6c +AUX postgresql.init-8.0-r1 3709 RMD160 db6a7cca7cf7c8e7564d86fe5cd1f484edaaf4dc SHA1 94a451fe9b22166d0185fecf00c679b00112324c SHA256 271fe74e3bd07078fd94fd2271ad4c1c34c53b0055150c7e57e184dd14c94549 AUX postgresql.init-8.1 2979 RMD160 da0119c95bcf29f295a94a21be8e711d83953b90 SHA1 c0ad473f8670a3a262b8d14cbe2d3ff2dae88474 SHA256 136eb2d2ba8db0fc0a5018c2093e6cc665c536d4347837c574888f8a54ebeb33 +AUX postgresql.init-8.1-r1 3686 RMD160 ed5413b7d5d60940c0e231eb916d5ca755f2c355 SHA1 c66551de38f92eb3a9a5907330b7cd39f4f478ec SHA256 13a5097b1123ceb5d53418b6fc25751deae806a36f259aa8983015e57df56a26 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 +AUX postgresql.init-8.3-r1 3860 RMD160 5e8c98cf779053a0745a50cd42d8accd5322b7a4 SHA1 fa1f44aab31df8e6aace45010e170e94bcd2cc3d SHA256 c04f42d230c5ca0291bb1366d07a564558ee7f2207f0f9618237858f3f693d95 AUX postgresql.init-8.4 3053 RMD160 517d00309769d3343def79e98e3867c464b38875 SHA1 5e1f398d07747a268fd48cb23b44c834e47ddb47 SHA256 eeee33e6e2ad3d816b2caa3e2de6bf6a4bd5933cbcf913d6bb5eadadd5e64da1 +AUX postgresql.init-8.4-r1 3924 RMD160 6cebb109124f325ebb56f6f10ff60973bc266a23 SHA1 65ee8d747cc56d302cccf2b26cbbe655fbb2aedc SHA256 82f041122dda015bdda3aad8a7f902dc573fc06ab25cc509dee6dc381bb962a0 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-7.4.26.tar.bz2 10340993 RMD160 c92093ffee634ba140ac176182ad80f7226eaa52 SHA1 cb7638b492aeb5a44ce071862bf9f1c2fdcc5515 SHA256 ae91cdcf8cd57336634a40d73a194fafd7128f6a98e61e5f183743abd1100a64 DIST postgresql-7.4.27.tar.bz2 10348758 RMD160 4888672ba15a8041097ed20d80a81716e6ac7074 SHA1 bb35cc844157b8a0d0b2e9e1ab25b6597c82dd1c SHA256 24453f07d325d77884d43c42868685e0d2c1b63fa5b9ad641252ffcb49a39425 DIST postgresql-7.4.28.tar.bz2 10347433 RMD160 893502e518612248153d42d233aee8e95cbcbab5 SHA1 28c6d6a04607f4b305e2428c5526f5a8053602ff SHA256 3d2b55a41c4f5a6e66f1a6462b6c2b023dbc439c64d2d21e35a5b7719bda49e4 @@ -67,20 +81,25 @@ DIST postgresql-9.0beta1.tar.bz2 13606310 RMD160 3d938b394d330f66987b1b8d387a576 EBUILD postgresql-server-7.4.26.ebuild 9058 RMD160 ef79f9c78012319f3ed34134e08a18f47a68c4dd SHA1 06c6541aef03092c297ab46f039fae62c8f80331 SHA256 c5e67ba8a2252b87e91d209ceeb281e49a52c138d7d20c4f1e8a0e4b602afd69 EBUILD postgresql-server-7.4.27.ebuild 9205 RMD160 1726c0da9090e7769936c66245bc3426769117b9 SHA1 cdaa4b107127a9b57c63953d16b47d84d8adff06 SHA256 b0ab06e86d30bd4acd35852da883c59af82aeebf4466287cb7a29d0f0e69a58f EBUILD postgresql-server-7.4.28.ebuild 11950 RMD160 a424e0626bdd735971e55a2d600ca96711479c79 SHA1 62f416f4895c6f9495c5c8db0b49ffaba0726bfa SHA256 ca393de5686ca74e0eb0e71a738d6114f8366f9b5227295cfcac8ebe895a9f65 +EBUILD postgresql-server-7.4.29-r1.ebuild 9979 RMD160 c6de3d0c99399b8cffb28a8906bc8c290f865fcd SHA1 a6c55c5a81f71217dcb7d22630fd73e7badaf834 SHA256 587d587846c76310e454763120642a42ec0fdc3b7e6d5a91d4c28df37f233e14 EBUILD postgresql-server-7.4.29.ebuild 11950 RMD160 386a987474df5be66588b82dada91cc1ae7e5758 SHA1 addc5eb8d92da426a6f40bf3c7cf9c908061cd1c SHA256 1f99aa5eede6f8ee7250d6c4272a409f16a9e25694df59f0a41f2e6699201e10 EBUILD postgresql-server-8.0.22.ebuild 9155 RMD160 1c4215648517f40d6a33225339752c7d55969d71 SHA1 addc00cd12899bd1eb248c672f020b365170eba3 SHA256 24236279dfc499449e7c6e5efe5d29d024bdb3661f6711eab44333b88cdeac96 EBUILD postgresql-server-8.0.23.ebuild 9164 RMD160 da81632b566b1adb582dd027e1e3f37ed9b30524 SHA1 605ba789bee0508398830090ea40a27489af8de4 SHA256 a9ef6e8a382e2d28bcb07c0356f5beffecfccf8c85934ff179fc7130a7ee2b73 EBUILD postgresql-server-8.0.24.ebuild 11923 RMD160 2a446b8dfa62edc33b44753c91c9931f90cf51df SHA1 dcf415418d234968a503efe1318c8f5273b26e5d SHA256 924a5303308c60a569c7bfa8b8ac511575caca66743b76ba67c5c0662647de63 +EBUILD postgresql-server-8.0.25-r1.ebuild 9754 RMD160 170ae15ae2855f961e161e84060e9a31b437d2e7 SHA1 aa2ef9a54fee3621895b0ae13d28acfa2ab1e6ca SHA256 4d744dac1d86b04dd16995981fcd895939aab42c61c07f85986c0295fcef00d6 EBUILD postgresql-server-8.0.25.ebuild 11923 RMD160 9751358fc10caa411f452db8278ced757b6f2f5f SHA1 352e51f6d2bf222b17027a7d23d664797faa0425 SHA256 68c8d6ec777ddb81d53ddd7fe0e4cccc1cffba2fc7f17fd7c3061e5239c9eb4b EBUILD postgresql-server-8.1.18.ebuild 9237 RMD160 5e172bbf74e91581f7507bbdee842133399c9b8e SHA1 4ecbcc11609f4323daa9edff6134da5b1b432b2a SHA256 b4b5359934a5e9b361aa92dc73f89a39ab4ce417e3f9fecf565b00c599ce90b1 EBUILD postgresql-server-8.1.19.ebuild 9245 RMD160 1e03207fbba8616031ee06b5ca74a8f1079ed455 SHA1 f65deed212e386ad11dc9754247a6dc518b02c91 SHA256 6590b8b67ba4b3dae028bcf3d297789d09e63cc1c78178d4996de9187a23af8d EBUILD postgresql-server-8.1.20.ebuild 11843 RMD160 7c8362b496f688a6944518d56b5a2b20c670000f SHA1 9761e1908f88a268925e4abb80e40073806c36e6 SHA256 5a99614f7d042c651e1fbf3d659b1d0ec80f04b137555b393f1d36ef9322e14e +EBUILD postgresql-server-8.1.21-r1.ebuild 9824 RMD160 e7ce380b6c031aac8cda1df8ca70b5a8666e4554 SHA1 5a5fd8863df451434fbeef473313088e234e9d74 SHA256 a7a162cfe1c7ffb92c1c679a6c2eb0a6dd6e5a0849595a2ad969d486ffd3781e EBUILD postgresql-server-8.1.21.ebuild 11843 RMD160 12a4b250f2a52ae06c24f1d0858d9683502fb8cd SHA1 5a3cc1bcbf2e59006aa3d49b0281838db9dfc5a7 SHA256 0fdec81b9394b74468e3cd6b36cef6e21e10676768ce6d9d96bcdf8f41014f54 EBUILD postgresql-server-8.2.14.ebuild 9541 RMD160 5cd205489dfe9d1cfb29163ae66519f853efa70b SHA1 bf10c9375d3170fdaa50f0aae42327ee88a351f1 SHA256 a2a1cd9b10a25314a6a47ed25c1e47a80116ad0070bed7e9b6bb5a50dab325d5 EBUILD postgresql-server-8.2.15.ebuild 9550 RMD160 d82671b76d689164a8e75576114dd6d6257ab96a SHA1 bc31187e438b01e33f8633e2adb2c22b189be611 SHA256 1e488ff1df066dd8e8a5eae00c5a27607cb43dcbe5854c66f7dc46b79f15eec3 EBUILD postgresql-server-8.2.16.ebuild 12147 RMD160 31075394dc93d37914bc6fdd700018f4620e126a SHA1 6cb99eb8ed6ec36936771cff298401e3f072f825 SHA256 13af530743614e75cd26d1322bf99aa3ddc2a9e6ed1cbcfa8bb81ede688dc4b4 +EBUILD postgresql-server-8.2.17-r1.ebuild 10124 RMD160 32dbb017baa45a6404178122bac475e5c5f2bb03 SHA1 54c1d83f322644362d8a21067635a99a33028b96 SHA256 d89ada7ddda9d535888a07c6562e2d138149ece641b002bd7b1ca699a1ca55af EBUILD postgresql-server-8.2.17.ebuild 12147 RMD160 76215ff868c32a3284ebacb5f798468d45789c5d SHA1 278bd52c31c41436aa5bef1e00e2fa9b9833f2a9 SHA256 68c52f6522aff473d1549e4a150fc89a5e1c065bb3c0feddf62e35ba08825eda EBUILD postgresql-server-8.3.10.ebuild 12268 RMD160 30b2615735d67813e6f952307b3ed671c97a4949 SHA1 df8bec24f83f43fd46218fb1ef6322d65b2e8322 SHA256 f408623432954bdc498a9527987fd6b28233c7f0bf0611697e2b6db29687423b +EBUILD postgresql-server-8.3.11-r1.ebuild 10282 RMD160 048cf897d97e5d1c4d29589545c1fbd0adad755e SHA1 d6169f0a6ef82c69dd64fbc9dead08712d355a59 SHA256 3945fb2707d7bdf2f26f904fb51e738448c0ff2ffbbb8dc0dc61ccbaf55765e7 EBUILD postgresql-server-8.3.11.ebuild 12268 RMD160 f71a58548885bf1d5e6d32251840678be0c0513c SHA1 fdac93b9186b7c778c14a0ae4abdb2b93ddff2ba SHA256 184269f74898c927d6dc3f0ec30d38758c43eef6724f95f54f448c8be3cd150f EBUILD postgresql-server-8.3.8.ebuild 9660 RMD160 c3047085113038a6244f3619ee659eaa61efe754 SHA1 0d1cc8035ad697f409d5a52057930286c54134b5 SHA256 702a83cfca3f1bd9a597fba7ab1b154eb577100b6e1486815cc1b6d7a7b0441b EBUILD postgresql-server-8.3.9.ebuild 9669 RMD160 8bf0c293368da81afc923c1e06528fb0fa145d54 SHA1 bf82535df3e8ba513bb04fd928768f615eebc067 SHA256 5196a72ac8b186c535ea41a5bf88f2f031ae1cf7a7de0833bea66b1f4bf500a3 @@ -89,8 +108,10 @@ EBUILD postgresql-server-8.4.1.ebuild 9219 RMD160 7e0e75dc007bb6cd90ad7641ee6317 EBUILD postgresql-server-8.4.2-r1.ebuild 9702 RMD160 dbe483ea9651b98cb754f8e7bbf27dcbe8bdcf4c SHA1 dadf4f91725418f2e532dc7ec6a99eaafa445699 SHA256 65db2a1651a35165f06fd08348bfc433dd04570c9e98d5a5b3c0109dd03af189 EBUILD postgresql-server-8.4.2.ebuild 9296 RMD160 2d27f0aed5c9e75e9038af481398d433a4e3b823 SHA1 d9d57c292cad85ba66196d728d48521ce3592900 SHA256 c429a9ead9d2d04cd50e6d9786da1f404bccf4b225eff22650fe603237a1c072 EBUILD postgresql-server-8.4.3.ebuild 12314 RMD160 53f5b09340d58e96ba0f3c2bdd2fb7cfce2bc7e8 SHA1 4a877bd878664a13c0909933b7d3ea1930db804f SHA256 4bb430970075f16168287dd64d073b3be03480ae3bb314fea6110c49ba0b5c71 +EBUILD postgresql-server-8.4.4-r1.ebuild 10350 RMD160 7ebf502a7a810d5602631cab2e9bf3b71b8637c6 SHA1 60a6dfaef11fe8d80bbc2955268d037e73aea6d6 SHA256 71742b2a379e7d8548e1f320cbbfe7e3849da4d584c6841410ceff2f0a544ffd EBUILD postgresql-server-8.4.4.ebuild 12314 RMD160 c0ff4dbe4f99cae42edafe1ab1f80bd50fd1d314 SHA1 9fb3520e16c258b3edf0f8b54bfc81fe5a570391 SHA256 8d797bed3d6e6677997531153da12bad5f46dce8520021a6369cb462d398ea3f EBUILD postgresql-server-9.0_alpha4.ebuild 12416 RMD160 449baf2ed5a18d8482487738ac44d3c846a4f56b SHA1 918a2a31d11e255dfb404bc80124a32af9f1fad1 SHA256 725ba5922a506de9d7e30161506a530e4d2f322ac066a2eb66f46da06b09fc9e +EBUILD postgresql-server-9.0_beta1-r1.ebuild 10408 RMD160 55fe44b125c0e1b3465ffbc2065086c61c70f617 SHA1 be75f8cfea9622aabe32b3b260fc819a99c5e873 SHA256 953ca6616f8eb0dd5536b8801081cccc6903eb8063d7091b402e627151e66f55 EBUILD postgresql-server-9.0_beta1.ebuild 12364 RMD160 b030f571858dc46cd39ade0d3a8651b396569ecd SHA1 5abdec94284c1ccc8b5bd8c27145e916d06d2ae1 SHA256 77fc16c51d5e4845f7807acfdc529628a929d6fd221fb8e605f238e072bcd91e -MISC ChangeLog 23488 RMD160 37fc599a02ca2f89dd1e4c9243aeec0f03a0c76a SHA1 de176389371bc6a58bb57910104eef448ae3078a SHA256 c31c93d6c0d947d032a27be82cd515aca7bf352ba64f3530aee5cfca986d555a +MISC ChangeLog 24714 RMD160 f44698adbc5ffdc8b039af68498065fc466e38c4 SHA1 c88a1d8d84c765226761ae3c905ef3a0d49753fc SHA256 9e6908fe9f019f2219d20befe80f7ca38ea3f6abf510140c28cb9bfbde4c44b0 MISC metadata.xml 420 RMD160 789f5a0ce45d05125098fd7e74a816cf08f4c39b SHA1 d308d7434a37f12cd320f74ed85e1d3ca7dabc75 SHA256 ac37a5084450a782d02510149d030bd0d4a63164f2ffb7bdda3ddf344606ca62 diff --git a/dev-db/postgresql-server/files/postgresql.conf-7.4-r1 b/dev-db/postgresql-server/files/postgresql.conf-7.4-r1 new file mode 100644 index 000000000000..331325da051d --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.conf-7.4-r1 @@ -0,0 +1,44 @@ +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/7.4/data" + +# Options to pass to PostgreSQL's initdb. +#PG_INITDB_OPTS="--locale=en_US.UTF-8" + +# PostgreSQL User +PGUSER="postgres" + +# Which port and socket to bind PostgreSQL +PGPORT="5432" + +# Extra options to run postmaster with, e.g.: +# -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" + +# Allow server 60 seconds to start or stop. +# Can disable waiting by changing to '-W' (capital W) +WAIT_FOR_START="-w" +WAIT_FOR_STOP="-w" + +# Ignore new connections and wait for clients to disconnect from server +# before shutting down. +# Set NICE_QUIT to "NO" to disable. +NICE_QUIT="YES" + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminating a client results in a rollback of open +# transactions for that client. +# Set RUDE_QUIT to "NO" to disable. +RUDE_QUIT="YES" + +# If the server still fails to shutdown, you can force it to quit by setting +# this to yes and a recover-run will execute on the next startup. +# Set FORCE_QUIT to "YES" to enable. +FORCE_QUIT="NO" + +# Pass extra environment variables. If you have to export environment variables +# for the database process, this can be done here. +# Don't forget to escape quotes. +#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\"" diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.0-r1 b/dev-db/postgresql-server/files/postgresql.conf-8.0-r1 new file mode 100644 index 000000000000..335e367069b1 --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.conf-8.0-r1 @@ -0,0 +1,44 @@ +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/8.0/data" + +# Options to pass to PostgreSQL's initdb. +#PG_INITDB_OPTS="--locale=en_US.UTF-8" + +# PostgreSQL User +PGUSER="postgres" + +# Which port and socket to bind PostgreSQL +PGPORT="5432" + +# Extra options to run postmaster with, e.g.: +# -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" + +# Allow server 60 seconds to start or stop. +# Can disable waiting by changing to '-W' (capital W) +WAIT_FOR_START="-w" +WAIT_FOR_STOP="-w" + +# Ignore new connections and wait for clients to disconnect from server +# before shutting down. +# Set NICE_QUIT to "NO" to disable. +NICE_QUIT="YES" + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminating a client results in a rollback of open +# transactions for that client. +# Set RUDE_QUIT to "NO" to disable. +RUDE_QUIT="YES" + +# If the server still fails to shutdown, you can force it to quit by setting +# this to yes and a recover-run will execute on the next startup. +# Set FORCE_QUIT to "YES" to enable. +FORCE_QUIT="NO" + +# Pass extra environment variables. If you have to export environment variables +# for the database process, this can be done here. +# Don't forget to escape quotes. +#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\""
\ No newline at end of file diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.1-r1 b/dev-db/postgresql-server/files/postgresql.conf-8.1-r1 new file mode 100644 index 000000000000..c44eb74f31d4 --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.conf-8.1-r1 @@ -0,0 +1,44 @@ +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/8.1/data" + +# Options to pass to PostgreSQL's initdb. +#PG_INITDB_OPTS="--locale=en_US.UTF-8" + +# PostgreSQL User +PGUSER="postgres" + +# Which port and socket to bind PostgreSQL +PGPORT="5432" + +# Extra options to run postmaster with, e.g.: +# -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" + +# Allow server 60 seconds to start or stop. +# Can disable waiting by changing to '-W' (capital W) +WAIT_FOR_START="-w" +WAIT_FOR_STOP="-w" + +# Ignore new connections and wait for clients to disconnect from server +# before shutting down. +# Set NICE_QUIT to "NO" to disable. +NICE_QUIT="YES" + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminating a client results in a rollback of open +# transactions for that client. +# Set RUDE_QUIT to "NO" to disable. +RUDE_QUIT="YES" + +# If the server still fails to shutdown, you can force it to quit by setting +# this to yes and a recover-run will execute on the next startup. +# Set FORCE_QUIT to "YES" to enable. +FORCE_QUIT="NO" + +# Pass extra environment variables. If you have to export environment variables +# for the database process, this can be done here. +# Don't forget to escape quotes. +#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\"" diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.2-r1 b/dev-db/postgresql-server/files/postgresql.conf-8.2-r1 new file mode 100644 index 000000000000..7ff22b7aaa57 --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.conf-8.2-r1 @@ -0,0 +1,44 @@ +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/8.2/data" + +# Options to pass to PostgreSQL's initdb. +#PG_INITDB_OPTS="--locale=en_US.UTF-8" + +# PostgreSQL User +PGUSER="postgres" + +# Which port and socket to bind PostgreSQL +PGPORT="5432" + +# Extra options to run postmaster with, e.g.: +# -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" + +# Allow server 60 seconds to start or stop. +# Can disable waiting by changing to '-W' (capital W) +WAIT_FOR_START="-w" +WAIT_FOR_STOP="-w" + +# Ignore new connections and wait for clients to disconnect from server +# before shutting down. +# Set NICE_QUIT to "NO" to disable. +NICE_QUIT="YES" + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminating a client results in a rollback of open +# transactions for that client. +# Set RUDE_QUIT to "NO" to disable. +RUDE_QUIT="YES" + +# If the server still fails to shutdown, you can force it to quit by setting +# this to yes and a recover-run will execute on the next startup. +# Set FORCE_QUIT to "YES" to enable. +FORCE_QUIT="NO" + +# Pass extra environment variables. If you have to export environment variables +# for the database process, this can be done here. +# Don't forget to escape quotes. +#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\"" diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.3-r1 b/dev-db/postgresql-server/files/postgresql.conf-8.3-r1 new file mode 100644 index 000000000000..0a6b858b17b2 --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.conf-8.3-r1 @@ -0,0 +1,50 @@ +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/8.3/data" + +# Options to pass to PostgreSQL's initdb. +#PG_INITDB_OPTS="--locale=en_US.UTF-8" + +# PostgreSQL User +PGUSER="postgres" + +# Which port and socket to bind PostgreSQL +PGPORT="5432" + +# Extra options to run postmaster with, e.g.: +# -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" + +# Allow *_TIMEOUT to run its course. +# Can be overriden by changing to '-W' (capital W) +WAIT_FOR_START="-w" +WAIT_FOR_STOP="-w" + +# How long to wait for server to start in seconds +START_TIMEOUT=60 + +# Ignore new connections and wait for clients to disconnect from server +# before shutting down. +# Set NICE_QUIT to "NO" to disable. NICE_TIMEOUT in seconds. +NICE_QUIT="YES" +NICE_TIMEOUT=60 + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminating a client results in a rollback of open +# transactions for that client. +# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds. +RUDE_QUIT="YES" +RUDE_TIMEOUT=30 + +# If the server still fails to shutdown, you can force it to quit by setting +# this to yes and a recover-run will execute on the next startup. +# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds. +FORCE_QUIT="NO" +FORCE_TIMEOUT=2 + +# Pass extra environment variables. If you have to export environment variables +# for the database process, this can be done here. +# Don't forget to escape quotes. +#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\"" diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.4-r1 b/dev-db/postgresql-server/files/postgresql.conf-8.4-r1 new file mode 100644 index 000000000000..0a6af9c84a67 --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.conf-8.4-r1 @@ -0,0 +1,50 @@ +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/8.4/data" + +# Options to pass to PostgreSQL's initdb. +#PG_INITDB_OPTS="--locale=en_US.UTF-8" + +# PostgreSQL User +PGUSER="postgres" + +# Which port and socket to bind PostgreSQL +PGPORT="5432" + +# Extra options to run postmaster with, e.g.: +# -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" + +# Allow *_TIMEOUT to run its course. +# Can be overriden by changing to '-W' (capital W) +WAIT_FOR_START="-w" +WAIT_FOR_STOP="-w" + +# How long to wait for server to start in seconds +START_TIMEOUT=60 + +# Ignore new connections and wait for clients to disconnect from server +# before shutting down. +# Set NICE_QUIT to "NO" to disable. NICE_TIMEOUT in seconds. +NICE_QUIT="YES" +NICE_TIMEOUT=60 + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminating a client results in a rollback of open +# transactions for that client. +# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds. +RUDE_QUIT="YES" +RUDE_TIMEOUT=30 + +# If the server still fails to shutdown, you can force it to quit by setting +# this to yes and a recover-run will execute on the next startup. +# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds. +FORCE_QUIT="NO" +FORCE_TIMEOUT=2 + +# Pass extra environment variables. If you have to export environment variables +# for the database process, this can be done here. +# Don't forget to escape quotes. +#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\"" diff --git a/dev-db/postgresql-server/files/postgresql.conf-9.0-r1 b/dev-db/postgresql-server/files/postgresql.conf-9.0-r1 new file mode 100644 index 000000000000..8f43360acceb --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.conf-9.0-r1 @@ -0,0 +1,50 @@ +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/9.0/data" + +# Options to pass to PostgreSQL's initdb. +#PG_INITDB_OPTS="--locale=en_US.UTF-8" + +# PostgreSQL User +PGUSER="postgres" + +# Which port and socket to bind PostgreSQL +PGPORT="5432" + +# Extra options to run postmaster with, e.g.: +# -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" + +# Allow *_TIMEOUT to run its course. +# Can be overriden by changing to '-W' (capital W) +WAIT_FOR_START="-w" +WAIT_FOR_STOP="-w" + +# How long to wait for server to start in seconds +START_TIMEOUT=60 + +# Ignore new connections and wait for clients to disconnect from server before +# shutting down. +# Set NICE_QUIT to "NO" to disable. NICE_TIMEOUT in seconds. +NICE_QUIT="YES" +NICE_TIMEOUT=60 + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminating a client results in a rollback of open +# transactions for that client. +# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds. +RUDE_QUIT="YES" +RUDE_TIMEOUT=30 + +# If the server still fails to shutdown, you can force it to quit by setting +# this to yes and a recover-run will execute on the next startup. +# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds. +FORCE_QUIT="NO" +FORCE_TIMEOUT=2 + +# Pass extra environment variables. If you have to export environment variables +# for the database process, this can be done here. +# Don't forget to escape quotes. +#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\"" diff --git a/dev-db/postgresql-server/files/postgresql.init-7.4-r1 b/dev-db/postgresql-server/files/postgresql.init-7.4-r1 new file mode 100644 index 000000000000..f712de9a5c6d --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.init-7.4-r1 @@ -0,0 +1,136 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-7.4-r1,v 1.1 2010/06/04 14:18:52 patrick Exp $ + +opts="${opts} reload" + +depend() { + use net + if [ -L /etc/eselect/postgresql/service ] ; then + local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" + test "${p_service}" = "${SVCNAME}" && provide postgresql + fi +} + +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-server --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 retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl start ${WAIT_FOR_START} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + +# The following is to catch the case of an already running server +# in which pg_ctl doesn't know to which server it connected to and +# falsely reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The PID file doesn't exist but pg_ctl reported a running server." + eerror "Please check whether there is another server running on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() { + ebegin "Stopping PostgreSQL (this can take a few minutes)" + + local retval + + if [[ "${NICE_QUIT}" != "NO" ]] ; then + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m smart" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Probably because some clients did not disconnect within 60 seconds." + else + ewarn "NICE_QUIT disabled." + ewarn "You really should have it enabled." + fi + + if [[ "${RUDE_QUIT}" != "NO" ]] ; then + ewarn "RUDE_QUIT enabled." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m fast" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + eerror "Failed to shutdown server." + else + ewarn "RUDE_QUIT disabled." + fi + + if [[ "${FORCE_QUIT}" == "YES" ]] ; then + ewarn "FORCE_QUIT enabled." + ewarn "Forcing server to shutdown." + ewarn "A recover-run will be executed on the next startup." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m immediate" + + retval=$? + + if [[ $retval == 0 ]] ; then + ewarn "Server forced down." + eend $retval + return $retval + fi + + eerror "Forced shutdown failed!!!" + eerror "Something is wrong with your system." + eerror "Please take care of it manually." + eerror "Unable to stop server." + eend $retval + return $retval + else + ewarn "FORCE_QUIT disabled." + eerror "Unable to shutdown server." + eend 1 + return 1 + fi +} + +reload() { + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl reload -s" + eend $? +} diff --git a/dev-db/postgresql-server/files/postgresql.init-8.0-r1 b/dev-db/postgresql-server/files/postgresql.init-8.0-r1 new file mode 100644 index 000000000000..a4130ab5e9ed --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.init-8.0-r1 @@ -0,0 +1,136 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.0-r1,v 1.1 2010/06/04 14:18:52 patrick Exp $ + +opts="${opts} reload" + +depend() { + use net + if [ -L /etc/eselect/postgresql/service ] ; then + local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" + test "${p_service}" = "${SVCNAME}" && provide postgresql + fi +} + +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-server --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 retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.0/bin/pg_ctl start ${WAIT_FOR_START} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + +# The following is to catch the case of an already running server +# in which pg_ctl doesn't know to which server it connected to and +# falsely reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The PID file doesn't exist but pg_ctl reported a running server." + eerror "Please check whether there is another server running on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() { + ebegin "Stopping PostgreSQL (this can take a few minutes)" + + local retval + + if [[ "${NICE_QUIT}" != "NO" ]] ; then + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.0/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m smart" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Probably because some clients did not disconnect within 60 seconds." + else + ewarn "NICE_QUIT disabled." + ewarn "You really should have it enabled." + fi + + if [[ "${RUDE_QUIT}" != "NO" ]] ; then + ewarn "RUDE_QUIT enabled." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.0/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m fast" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + eerror "Failed to shutdown server." + else + ewarn "RUDE_QUIT disabled." + fi + + if [[ "${FORCE_QUIT}" == "YES" ]] ; then + ewarn "FORCE_QUIT enabled." + ewarn "Forcing server to shutdown." + ewarn "A recover-run will be executed on the next startup." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.0/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m immediate" + + retval=$? + + if [[ $retval == 0 ]] ; then + ewarn "Server forced down." + eend $retval + return $retval + fi + + eerror "Forced shutdown failed!!!" + eerror "Something is wrong with your system." + eerror "Please take care of it manually." + eerror "Unable to stop server." + eend $retval + return $retval + else + ewarn "FORCE_QUIT disabled." + eerror "Unable to shutdown server." + eend 1 + return 1 + fi +} + +reload() { + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.0/bin/pg_ctl reload -s" + eend $? +} diff --git a/dev-db/postgresql-server/files/postgresql.init-8.1-r1 b/dev-db/postgresql-server/files/postgresql.init-8.1-r1 new file mode 100644 index 000000000000..aa11d439bab9 --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.init-8.1-r1 @@ -0,0 +1,134 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.1-r1,v 1.1 2010/06/04 14:18:52 patrick Exp $ + +depend() { + use net + if [ -L /etc/eselect/postgresql/service ] ; then + local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" + test "${p_service}" = "${SVCNAME}" && provide postgresql + fi +} + +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-server --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 retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.1/bin/pg_ctl start ${WAIT_FOR_START} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + +# The following is to catch the case of an already running server +# in which pg_ctl doesn't know to which server it connected to and +# falsely reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The PID file doesn't exist but pg_ctl reported a running server." + eerror "Please check whether there is another server running on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() { + ebegin "Stopping PostgreSQL (this can take a few minutes)" + + local retval + + if [[ "${NICE_QUIT}" != "NO" ]] ; then + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.1/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m smart" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Probably because some clients did not disconnect within 60 seconds." + else + ewarn "NICE_QUIT disabled." + ewarn "You really should have it enabled." + fi + + if [[ "${RUDE_QUIT}" != "NO" ]] ; then + ewarn "RUDE_QUIT enabled." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.1/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m fast" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + eerror "Failed to shutdown server." + else + ewarn "RUDE_QUIT disabled." + fi + + if [[ "${FORCE_QUIT}" == "YES" ]] ; then + ewarn "FORCE_QUIT enabled." + ewarn "Forcing server to shutdown." + ewarn "A recover-run will be executed on the next startup." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.1/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m immediate" + + retval=$? + + if [[ $retval == 0 ]] ; then + ewarn "Server forced down." + eend $retval + return $retval + fi + + eerror "Forced shutdown failed!!!" + eerror "Something is wrong with your system." + eerror "Please take care of it manually." + eerror "Unable to stop server." + eend $retval + return $retval + else + ewarn "FORCE_QUIT disabled." + eerror "Unable to shutdown server." + eend 1 + return 1 + fi +} + +reload() { + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.1/bin/pg_ctl reload -s" + eend $? +} diff --git a/dev-db/postgresql-server/files/postgresql.init-8.2-r1 b/dev-db/postgresql-server/files/postgresql.init-8.2-r1 new file mode 100644 index 000000000000..127da8eed3cb --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.init-8.2-r1 @@ -0,0 +1,136 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.2-r1,v 1.1 2010/06/04 14:18:52 patrick Exp $ + +opts="${opts} reload" + +depend() { + use net + if [ -L /etc/eselect/postgresql/service ] ; then + local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" + test "${p_service}" = "${SVCNAME}" && provide postgresql + fi +} + +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-server --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 retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.2/bin/pg_ctl start ${WAIT_FOR_START} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + +# The following is to catch the case of an already running server +# in which pg_ctl doesn't know to which server it connected to and +# falsely reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The PID file doesn't exist but pg_ctl reported a running server." + eerror "Please check whether there is another server running on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() { + ebegin "Stopping PostgreSQL (this can take a few minutes)" + + local retval + + if [[ "${NICE_QUIT}" != "NO" ]] ; then + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.2/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m smart" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Probably because some clients did not disconnect within 60 seconds." + else + ewarn "NICE_QUIT disabled." + ewarn "You really should have it enabled." + fi + + if [[ "${RUDE_QUIT}" != "NO" ]] ; then + ewarn "RUDE_QUIT enabled." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.2/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m fast" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + eerror "Failed to shutdown server." + else + ewarn "RUDE_QUIT disabled." + fi + + if [[ "${FORCE_QUIT}" == "YES" ]] ; then + ewarn "FORCE_QUIT enabled." + ewarn "Forcing server to shutdown." + ewarn "A recover-run will be executed on the next startup." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.2/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m immediate" + + retval=$? + + if [[ $retval == 0 ]] ; then + ewarn "Server forced down." + eend $retval + return $retval + fi + + eerror "Forced shutdown failed!!!" + eerror "Something is wrong with your system." + eerror "Please take care of it manually." + eerror "Unable to stop server." + eend $retval + return $retval + else + ewarn "FORCE_QUIT disabled." + eerror "Unable to shutdown server." + eend 1 + return 1 + fi +} + +reload() { + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.2/bin/pg_ctl reload -s" + eend $? +} diff --git a/dev-db/postgresql-server/files/postgresql.init-8.3-r1 b/dev-db/postgresql-server/files/postgresql.init-8.3-r1 new file mode 100644 index 000000000000..e7f6bc38e182 --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.init-8.3-r1 @@ -0,0 +1,136 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3-r1,v 1.1 2010/06/04 14:18:52 patrick Exp $ + +opts="${opts} reload" + +depend() { + use net + if [ -L /etc/eselect/postgresql/service ] ; then + local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" + test "${p_service}" = "${SVCNAME}" && provide postgresql + fi +} + +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-server --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 retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.3/bin/pg_ctl start ${WAIT_FOR_START} -t ${START_TIMEOUT} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + +# The following is to catch the case of an already running server +# in which pg_ctl doesn't know to which server it connected to and +# falsely reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The PID file doesn't exist but pg_ctl reported a running server." + eerror "Please check whether there is another server running on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() { + ebegin "Stopping PostgreSQL (this can take up to $(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} )) seconds)" + + local retval + + if [[ "${NICE_QUIT}" != "NO" ]] ; then + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.3/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${NICE_TIMEOUT} -s -m smart" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Probably because some clients did not disconnect within ${NICE_TIMEOUT} seconds." + else + ewarn "NICE_QUIT disabled." + ewarn "You really should have it enabled." + fi + + if [[ "${RUDE_QUIT}" != "NO" ]] ; then + ewarn "RUDE_QUIT enabled." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.3/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${RUDE_TIMEOUT} -s -m fast" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + eerror "Failed to shutdown server." + else + ewarn "RUDE_QUIT disabled." + fi + + if [[ "${FORCE_QUIT}" == "YES" ]] ; then + ewarn "FORCE_QUIT enabled." + ewarn "Forcing server to shutdown." + ewarn "A recover-run will be executed on the next startup." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.3/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${FORCE_TIMEOUT} -s -m immediate" + + retval=$? + + if [[ $retval == 0 ]] ; then + ewarn "Server forced down." + eend $retval + return $retval + fi + + eerror "Forced shutdown failed!!!" + eerror "Something is wrong with your system." + eerror "Please take care of it manually." + eerror "Unable to stop server." + eend $retval + return $retval + else + ewarn "FORCE_QUIT disabled." + eerror "Unable to shutdown server." + eend 1 + return 1 + fi +} + +reload() { + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.3/bin/pg_ctl reload -s" + eend $? +} diff --git a/dev-db/postgresql-server/files/postgresql.init-8.4-r1 b/dev-db/postgresql-server/files/postgresql.init-8.4-r1 new file mode 100644 index 000000000000..4144581e356d --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.init-8.4-r1 @@ -0,0 +1,134 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.4-r1,v 1.1 2010/06/04 14:18:52 patrick Exp $ + +depend() { + use net + if [ -L /etc/eselect/postgresql/service ] ; then + local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" + test "${p_service}" = "${SVCNAME}" && provide postgresql + fi +} + +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-server --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 retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.4/bin/pg_ctl start ${WAIT_FOR_START} -t ${START_TIMEOUT} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + + # The following is to catch the case of an already running server + # in which pg_ctl doesn't know to which server it connected to and + # falsely reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The PID file doesn't exist but pg_ctl reported a running server." + eerror "Please check whether there is another server running on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() { + ebegin "Stopping PostgreSQL (this can take up to $(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} )) seconds)" + + local retval + + if [[ "${NICE_QUIT}" != "NO" ]] ; then + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${NICE_TIMEOUT} -s -m smart" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Probably because some clients did not disconnect within ${NICE_TIMEOUT} seconds." + else + ewarn "NICE_QUIT disabled." + ewarn "You really should have it enabled." + fi + + if [[ "${RUDE_QUIT}" != "NO" ]] ; then + ewarn "RUDE_QUIT enabled." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${RUDE_TIMEOUT} -s -m fast" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + eerror "Failed to shutdown server." + else + ewarn "RUDE_QUIT disabled." + fi + + if [[ "${FORCE_QUIT}" == "YES" ]] ; then + ewarn "FORCE_QUIT enabled." + ewarn "Forcing server to shutdown." + ewarn "A recover-run will be executed on the next startup." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${FORCE_TIMEOUT} -s -m immediate" + + retval=$? + + if [[ $retval == 0 ]] ; then + ewarn "Server forced down." + eend $retval + return $retval + fi + + eerror "Forced shutdown failed!!!" + eerror "Something is wrong with your system." + eerror "Please take care of it manually." + eerror "Unable to stop server." + eend $retval + return $retval + else + ewarn "FORCE_QUIT disabled." + eerror "Unable to shutdown server." + eend 1 + return 1 + fi +} + +reload() { + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.4/bin/pg_ctl reload -s" + eend $? +} diff --git a/dev-db/postgresql-server/files/postgresql.init-9.0-r1 b/dev-db/postgresql-server/files/postgresql.init-9.0-r1 new file mode 100644 index 000000000000..684a8e8f86bd --- /dev/null +++ b/dev-db/postgresql-server/files/postgresql.init-9.0-r1 @@ -0,0 +1,136 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-9.0-r1,v 1.1 2010/06/04 14:18:52 patrick Exp $ + +opts="${opts} reload" + +depend() { + use net + if [ -L /etc/eselect/postgresql/service ] ; then + local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" + test "${p_service}" = "${SVCNAME}" && provide postgresql + fi +} + +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-server --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 retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-9.0/bin/pg_ctl start ${WAIT_FOR_START} -t ${START_TIMEOUT} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + +# The following is to catch the case of an already running server +# in which pg_ctl doesn't know to which server it connected to and +# falsely reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The PID file doesn't exist but pg_ctl reported a running server." + eerror "Please check whether there is another server running on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() { + ebegin "Stopping PostgreSQL (this can take up to $(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} )) seconds)" + + local retval + + if [[ "${NICE_QUIT}" != "NO" ]] ; then + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-9.0/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${NICE_TIMEOUT} -s -m smart" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Probably because some clients did not disconnect within ${NICE_TIMEOUT} seconds." + else + ewarn "NICE_QUIT disabled." + ewarn "You really should have it enabled." + fi + + if [[ "${RUDE_QUIT}" != "NO" ]] ; then + ewarn "RUDE_QUIT enabled." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-9.0/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${RUDE_TIMEOUT} -s -m fast" + retval=$? + + if [[ $retval == 0 ]] ; then + eend $retval + return $retval + fi + + eerror "Failed to shutdown server." + else + ewarn "RUDE_QUIT disabled." + fi + + if [[ "${FORCE_QUIT}" == "YES" ]] ; then + ewarn "FORCE_QUIT enabled." + ewarn "Forcing server to shutdown." + ewarn "A recover-run will be executed on the next startup." + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-9.0/bin/pg_ctl stop ${WAIT_FOR_STOP} -t ${FORCE_TIMEOUT} -s -m immediate" + + retval=$? + + if [[ $retval == 0 ]] ; then + ewarn "Server forced down." + eend $retval + return $retval + fi + + eerror "Forced shutdown failed!!!" + eerror "Something is wrong with your system." + eerror "Please take care of it manually." + eerror "Unable to stop server." + eend $retval + return $retval + else + ewarn "FORCE_QUIT disabled." + eerror "Unable to shutdown server." + eend 1 + return 1 + fi +} + +reload() { + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-9.0/bin/pg_ctl reload -s" + eend $? +} diff --git a/dev-db/postgresql-server/postgresql-server-7.4.29-r1.ebuild b/dev-db/postgresql-server/postgresql-server-7.4.29-r1.ebuild new file mode 100644 index 000000000000..fe9a0f4ff435 --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-7.4.29-r1.ebuild @@ -0,0 +1,266 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-7.4.29-r1.ebuild,v 1.1 2010/06/04 14:18:53 patrick Exp $ + +EAPI="2" + +WANT_AUTOMAKE="none" +inherit eutils multilib versionator autotools + +KEYWORDS="~amd64 ~hppa ~ppc ~x86" + +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_cs linguas_de linguas_es linguas_fr linguas_hr linguas_hu + linguas_it linguas_nb linguas_pt_BR linguas_ru 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 -n "${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} + sys-devel/flex + xml? ( dev-util/pkgconfig )" +PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres +} + +src_prepare() { + # vacuum-delay patch doesn't apply anymore + epatch "${FILESDIR}/postgresql-${PV}-autoconf.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" \ + "${FILESDIR}/postgresql-${SLOT}-hppa.patch" \ + "${FILESDIR}/postgresql-${SLOT}-com_err.patch" + + if use test; then + epatch "${FILESDIR}/postgresql-${SLOT}-regress.patch" + fi + + eautoreconf +} + +src_configure() { + # 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)" \ + $(use_with perl) \ + $(use_with python) \ + $(use_with tcl) \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + --with-libs="/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)/" \ + "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")" \ + "CFLAGS='${CFLAGS} $(use xml && pkg-config --cflags libxml-2.0)'" \ + "LIBS='${LIBS} -lpq $(use xml && pkg-config --libs libxml-2.0) -L/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)'" \ + || die "configure failed" +} + +src_compile() { + for bd in . contrib $(use xml && echo contrib/xml) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 \ + docdir=/usr/share/doc/${PF} SLOT=${SLOT} || 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/xml) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake install -C $bd -j1 DESTDIR="${D}" \ + docdir=/usr/share/doc/${PF} SLOT=${SLOT} || die "emake install in $bd failed" + done + + rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" "${D}/usr/share/doc/${PF}/html" + rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,vacuumdb,pgtksh,pgtclsh}.1 + + dodoc README HISTORY doc/{README.*,TODO,bug.template} + + dodir /etc/eselect/postgresql/slots/${SLOT} + cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed" + + 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} + + ewarn "Also note, that upstream support for the 7.4 branch will end June 2010. If you" + ewarn "haven't made plans to update to a more recent, or the latest stable branch," + ewarn "start planning now." + ewarn + ewarn "Please note that the standard location of the socket has changed from /tmp to" + ewarn "/var/run/postgresql and you have to be in the 'postgres' group to access the" + ewarn "socket. This can break applications which have the standard location" + ewarn "hard-coded. If such an application links against the libpq, please reemerge" + ewarn "it. If that doesn't help or the application accesses the socket without using" + ewarn "libpq, please file a bug-report." + ewarn + ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the" + ewarn "original location." + ewarn + + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it" + elog "contains your preferred locale in:" + elog + elog " /etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database environment:" + elog + elog " emerge --config =${CATEGORY}/${PF}" + elog +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="/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 /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 /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 pass options to initdb by setting the PG_INITDB_OPTS variable. More" + einfo "information can be found here:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable." + einfo + einfo "You can change the directory where the database cluster is being created by" + einfo "setting the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" + einfo "Are you ready to continue? (Y/n)" + read answer + [ -z $answer ] && answer=Y + [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + SKIP_SYSTEM_TESTS=yes + einfo " Tests not supported on this OS (yet)" + fi + + 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 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 + einfo "Skipped." + fi + + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + + su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'." + einfo +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + if [[ $UID -eq 0 ]]; then + die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." + fi + 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.0.25-r1.ebuild b/dev-db/postgresql-server/postgresql-server-8.0.25-r1.ebuild new file mode 100644 index 000000000000..4e85c58047db --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-8.0.25-r1.ebuild @@ -0,0 +1,265 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.0.25-r1.ebuild,v 1.1 2010/06/04 14:18:53 patrick Exp $ + +EAPI="2" + +WANT_AUTOMAKE="none" +inherit eutils multilib versionator autotools + +KEYWORDS="~amd64 ~hppa ~ppc ~x86" + +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 -n "${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} + sys-devel/flex + xml? ( dev-util/pkgconfig )" +PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres +} + +src_prepare() { + + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if use test; 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 + fi + + eautoconf +} + +src_configure() { + # 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)" \ + $(use_with perl) \ + $(use_with python) \ + $(use_with tcl) \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")" \ + || die "configure failed" +} + +src_compile() { + for bd in . contrib $(use xml && echo contrib/xml2) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + 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=$(/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/" "${D}/usr/share/doc/${PF}/html" + rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,vacuumdb}.1 + + dodoc README HISTORY doc/{README.*,TODO,bug.template} + + dodir /etc/eselect/postgresql/slots/${SLOT} + cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed" + + 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} + + ewarn "Please note that the standard location of the socket has changed from /tmp to" + ewarn "/var/run/postgresql and you have to be in the 'postgres' group to access the" + ewarn "socket. This can break applications which have the standard location" + ewarn "hard-coded. If such an application links against the libpq, please re-emerge" + ewarn "it. If that doesn't help or the application accesses the socket without using" + ewarn "libpq, please file a bug-report." + ewarn + ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the" + ewarn "original location." + ewarn + + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it" + elog "contains your preferred locale in:" + elog + elog " /etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database environment:" + elog + elog " emerge --config =${CATEGORY}/${PF}" + elog +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="/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 /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 /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 pass options to initdb by setting the PG_INITDB_OPTS variable." + einfo "More information can be found here:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS" + einfo "variable." + einfo + einfo "You can change the directory where the database cluster is being created by" + einfo "setting the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" + einfo "Are you ready to continue? (Y/n)" + read answer + [ -z $answer ] && answer=Y + [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + SKIP_SYSTEM_TESTS=yes + einfo " Tests not supported on this OS (yet)" + fi + + 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 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 + einfo "Skipped." + fi + + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + + su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." +} + +src_test() { + sed -i \ + -e '/test: horology/d' \ + src/test/regress/{parallel_schedule,serial_schedule} || die "sed failed" + + 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 bug including a patch" + einfo "for this ebuild to enable them." +}
\ No newline at end of file diff --git a/dev-db/postgresql-server/postgresql-server-8.1.21-r1.ebuild b/dev-db/postgresql-server/postgresql-server-8.1.21-r1.ebuild new file mode 100644 index 000000000000..5d1492409363 --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-8.1.21-r1.ebuild @@ -0,0 +1,263 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.1.21-r1.ebuild,v 1.1 2010/06/04 14:18:53 patrick Exp $ + +EAPI="2" + +WANT_AUTOMAKE="none" +inherit eutils multilib versionator autotools + +KEYWORDS="~amd64 ~hppa ~x86" + +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 -n "${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} + sys-devel/flex + xml? ( dev-util/pkgconfig )" +PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres +} + +src_prepare() { + + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if use test; 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 + fi + + eautoconf +} + +src_configure() { + # 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)" \ + $(use_with perl) \ + $(use_with python) \ + $(use_with tcl) \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")" \ + || die "configure failed" +} + +src_compile() { + for bd in . contrib $(use xml && echo contrib/xml2) ; do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 \ + PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ + 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=$(/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/" "${D}/usr/share/doc/${PF}/html" + 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 /etc/eselect/postgresql/slots/${SLOT} + cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed" + + 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} + + ewarn "Please note that the standard location of the socket has changed from /tmp to" + ewarn "/var/run/postgresql and you have to be in the 'postgres' group to access the" + ewarn "socket. This can break applications which have the standard location" + ewarn "hard-coded. If such an application links against the libpq, please reemerge" + ewarn "it. If that doesn't help or the application accesses the socket without using" + ewarn "libpq, please file a bug-report." + ewarn + ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location." + ewarn + + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it" + elog "contains your preferred locale in:" + elog + elog " /etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, 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. You can enable it in the clusters" + elog "postgresql.conf." +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="/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 /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 /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 pass options to initdb by setting the PG_INITDB_OPTS variable." + einfo "More information can be found here:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS" + einfo "variable." + einfo + einfo "You can change the directory where the database cluster is being created by" + einfo "setting the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" + einfo "Are you ready to continue? (Y/n)" + read answer + [ -z $answer ] && answer=Y + [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + SKIP_SYSTEM_TESTS=yes + einfo " Tests not supported on this OS (yet)" + fi + + 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 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 + einfo "Skipped." + fi + + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + + su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + einfo +} + +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. If you think other tests are" + einfo "necessary, please submit a bug including a patch for this ebuild to enable them." +} diff --git a/dev-db/postgresql-server/postgresql-server-8.2.17-r1.ebuild b/dev-db/postgresql-server/postgresql-server-8.2.17-r1.ebuild new file mode 100644 index 000000000000..89c347ff2fe9 --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-8.2.17-r1.ebuild @@ -0,0 +1,267 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.2.17-r1.ebuild,v 1.1 2010/06/04 14:18:53 patrick Exp $ + +EAPI="2" + +WANT_AUTOMAKE="none" +inherit eutils multilib versionator autotools + +KEYWORDS="~amd64 ~hppa ~ppc ~x86" + +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 -n "${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} + sys-devel/flex + xml? ( dev-util/pkgconfig )" +PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres +} + +src_prepare() { + + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if use test; 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_configure() { + # 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}/" \ + "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")" \ + || die "configure failed" +} +src_compile() { + for bd in . contrib $(use xml && echo contrib/xml2); do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 \ + 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/" "${D}/usr/share/doc/${PF}/html" + 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 /etc/eselect/postgresql/slots/${SLOT} + cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed" + + # Workaround for paludis + [ -f "${ROOT}/var/run/postgresql/.keep" ] || 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} + + ewarn "Please note that the standard location of the socket has changed from /tmp" + ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access" + ewarn "the socket." + ewarn "This can break applications which have the standard location hard-coded." + ewarn "If such an application links against the libpq, please re-emerge it," + ewarn "if that doesn't help or the application accesses the socket without using libpq," + ewarn "please file a bug-report." + ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location." + + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it" + elog "contains your preferred locale in:" + elog + elog " /etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, 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 in the clusters postgresql.conf." +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="/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 /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 /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 pass options to initdb by setting the PG_INITDB_OPTS variable." + einfo "More information can be found here:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS" + einfo "variable." + einfo + einfo "You can change the directory where the database cluster is being created by" + einfo "setting the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" + einfo "Are you ready to continue? (Y/n)" + read answer + [ -z $answer ] && answer=Y + [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + SKIP_SYSTEM_TESTS=yes + einfo " Tests not supported on this OS (yet)" + fi + + 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 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 + einfo "Skipped." + fi + + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + + su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + einfo +} + +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. If you think other tests are" + einfo "necessary, please submit a bug including a patch for this ebuild to enable them." +} diff --git a/dev-db/postgresql-server/postgresql-server-8.3.11-r1.ebuild b/dev-db/postgresql-server/postgresql-server-8.3.11-r1.ebuild new file mode 100644 index 000000000000..949245d66d53 --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-8.3.11-r1.ebuild @@ -0,0 +1,274 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.3.11-r1.ebuild,v 1.1 2010/06/04 14:18:53 patrick Exp $ + +EAPI="2" + +WANT_AUTOMAKE="none" +inherit eutils multilib versionator autotools + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~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 uuid xml nls kernel_linux ${IUSE_LINGUAS}" + +wanted_languages() { + for u in ${IUSE_LINGUAS} ; do + use $u && echo -n "${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 ) + 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} )" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres +} + +src_prepare() { + + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if use test; 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_configure() { + # 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) \ + $(use_with xml libxslt) \ + $(use_with uuid ossp-uuid) \ + --with-system-tzdata="/usr/share/zoneinfo" \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")" \ + || die "configure failed" +} + +src_compile() { + for bd in . contrib $(use xml && echo contrib/xml2); do + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -C $bd -j1 \ + 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/" "${D}/usr/share/doc/${PF}/html" + 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 /etc/eselect/postgresql/slots/${SLOT} + cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed" + + 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} + + ewarn "Please note that the standard location of the socket has changed from /tmp to" + ewarn "/var/run/postgresql and you have to be in the 'postgres' group to access the" + ewarn "socket. This can break applications which have the standard location" + ewarn "hard-coded. If such an application links against the libpq, please re-emerge" + ewarn "it. If that doesn't help or the application accesses the socket without using" + ewarn "libpq, please file a bug-report." + ewarn + ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the" + ewarn "original location." + ewarn + + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it" + elog "contains your preferred locale in:" + elog + elog " /etc/conf.d/postgresql-${SLOT}" + elog + 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. You can enable it in the clusters" + elog "postgresql.conf." +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="/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 /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 /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 pass options to initdb by setting the PG_INITDB_OPTS variable." + einfo "More information can be found here:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS" + einfo "variable." + einfo + einfo "You can change the directory where the database cluster is being created by" + einfo "setting the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" + einfo "Are you ready to continue? (Y/n)" + read answer + [ -z $answer ] && answer=Y + [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + SKIP_SYSTEM_TESTS=yes + einfo " Tests not supported on this OS (yet)" + fi + + 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 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 + einfo "Skipped." + fi + + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + + su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + einfo +} + +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. If you think other tests are" + einfo "necessary, please submit a bug including a patch for this ebuild to enable them." +} diff --git a/dev-db/postgresql-server/postgresql-server-8.4.4-r1.ebuild b/dev-db/postgresql-server/postgresql-server-8.4.4-r1.ebuild new file mode 100644 index 000000000000..d325a657e1d0 --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-8.4.4-r1.ebuild @@ -0,0 +1,277 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.4.4-r1.ebuild,v 1.1 2010/06/04 14:18:53 patrick Exp $ + +EAPI="2" +PYTHON_DEPEND="python? 2" + +# weird test failures. +RESTRICT="test" + +WANT_AUTOMAKE="none" +inherit autotools eutils multilib python versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~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="pg_legacytimestamp doc perl python selinux tcl uuid xml nls kernel_linux ${IUSE_LINGUAS}" + +wanted_languages() { + for u in ${IUSE_LINGUAS} ; do + use $u && echo -n "${u#linguas_} " + done +} + +RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pg_legacytimestamp=,nls=] + perl? ( >=dev-lang/perl-5.6.1-r2 ) + 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} )" + +S="${WORKDIR}/postgresql-${PV}" + +pkg_setup() { + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres + + if use python; then + python_set_active_version 2 + fi +} + +src_prepare() { + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if use test; 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_configure() { + # 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)" \ + $(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="/usr/share/zoneinfo" \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + --with-libraries="/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \ + "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + local bd + for bd in . contrib $(use xml && echo contrib/xml2); do + PATH="/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="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake install -C $bd -j1 DESTDIR="${D}" || die "emake install in $bd failed" + done + + rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" "${D}/usr/share/doc/postgresql-${SLOT}/html" + 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 /etc/eselect/postgresql/slots/${SLOT} + cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed" + + 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} + + ewarn "Please note that the standard location of the socket has changed from /tmp to" + ewarn "/var/run/postgresql and you have to be in the 'postgres' group to access the" + ewarn "socket. This can break applications which have the standard location" + ewarn "hard-coded. If such an application links against the libpq, please reemerge" + ewarn "it. If that doesn't help or the application accesses the socket without using" + ewarn "libpq, please file a bug-report." + ewarn + ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the" + ewarn "original location." + ewarn + + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it" + elog "contains your preferred locale and character encoding in:" + elog + elog " /etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, 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, and starting with 8.4 is now enabled by" + elog "default. You can disable it in the cluster's postgresql.conf." + elog + elog "The timestamp format is 64 bit integers now. If you upgrade from older" + elog "databases, this may force you to either do a dump and reload or enable" + elog "pg_legacytimestamp until you find time to do so. If the database can't start" + elog "please try enabling pg_legacytimestamp and rebuild." +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="/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 /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 /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 pass options to initdb by setting the PG_INITDB_OPTS variable." + einfo "More information can be found here:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable." + einfo + einfo "You can change the directory where the database cluster is being created by setting" + einfo "the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" + einfo "Are you ready to continue? (Y/n)" + read answer + [ -z $answer ] && answer=Y + [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + SKIP_SYSTEM_TESTS=yes + einfo " Tests not supported on this OS (yet)" + fi + + 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 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 + einfo "Skipped." + fi + + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + + su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + einfo +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -j1 check || 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. If you think other tests are" + einfo "necessary, please submit a bug including a patch for this ebuild to enable them." +} diff --git a/dev-db/postgresql-server/postgresql-server-9.0_beta1-r1.ebuild b/dev-db/postgresql-server/postgresql-server-9.0_beta1-r1.ebuild new file mode 100644 index 000000000000..f7594530c9a9 --- /dev/null +++ b/dev-db/postgresql-server/postgresql-server-9.0_beta1-r1.ebuild @@ -0,0 +1,281 @@ +# Copyright 1999-2010 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.0_beta1-r1.ebuild,v 1.1 2010/06/04 14:18:53 patrick Exp $ + +EAPI="2" +PYTHON_DEPEND="python? 2" + +# weird test failures. +RESTRICT="test" + +WANT_AUTOMAKE="none" +inherit autotools eutils multilib python versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" + +DESCRIPTION="PostgreSQL server" +HOMEPAGE="http://www.postgresql.org/" + +MY_PV=${PV/_/} +SRC_URI="mirror://postgresql/source/${MY_PV}/postgresql-${MY_PV}.tar.bz2" +S=${WORKDIR}/postgresql-${MY_PV} + +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="pg_legacytimestamp doc perl python selinux tcl uuid xml nls kernel_linux ${IUSE_LINGUAS}" + +wanted_languages() { + for u in ${IUSE_LINGUAS} ; do + use $u && echo -n "${u#linguas_} " + done +} + +RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pg_legacytimestamp=] + perl? ( >=dev-lang/perl-5.6.1-r2 ) + 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 /var/lib/postgresql postgres + + if use python; then + python_set_active_version 2 + fi +} + +src_prepare() { + epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ + "${FILESDIR}/postgresql-${SLOT}-server.patch" + + if use test; 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_configure() { + # 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) \ + $(use_with xml libxslt) \ + $(use_with uuid ossp-uuid) \ + --with-system-tzdata="/usr/share/zoneinfo" \ + --with-includes="/usr/include/postgresql-${SLOT}/" \ + --with-libraries="/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \ + "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + local bd + for bd in . contrib $(use xml && echo contrib/xml2); do + PATH="/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="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake install -C $bd -j1 DESTDIR="${D}" || die "emake install in $bd failed" + done + + rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" "${D}/usr/share/doc/postgresql-${SLOT}/html" + 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 /etc/eselect/postgresql/slots/${SLOT} + cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ + postgres_ebuilds="\${postgres_ebuilds} ${PF}" + postgres_service="postgresql-${SLOT}" + __EOF__ + + newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed" + newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed" + + 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} + + ewarn "Please note that the standard location of the socket has changed from /tmp to" + ewarn "/var/run/postgresql and you have to be in the 'postgres' group to access the" + ewarn "socket. This can break applications which have the standard location" + ewarn "hard-coded. If such an application links against the libpq, please reemerge" + ewarn "it. If that doesn't help or the application accesses the socket without using" + ewarn "libpq, please file a bug-report." + ewarn + ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the" + ewarn "original location." + ewarn + + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it" + elog "contains your preferred locale and character encoding in:" + elog + elog " /etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, 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, and starting with 8.4 is now enabled by" + elog "default. You can disable it in the cluster's postgresql.conf." + elog + elog "The timestamp format is 64 bit integers now. If you upgrade from older" + elog "databases, this may force you to either do a dump and reload or enable" + elog "pg_legacytimestamp until you find time to do so. If the database can't start" + elog "please try enabling pg_legacytimestamp and rebuild." +} + +pkg_postrm() { + eselect postgresql update +} + +pkg_config() { + [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} + [[ -z "${PGDATA}" ]] && PGDATA="/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 /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 /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 pass options to initdb by setting the PG_INITDB_OPTS variable." + einfo "More information can be found here:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS" + einfo "variable." + einfo + einfo "You can change the directory where the database cluster is being created by" + einfo "setting the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" + einfo "Are you ready to continue? (Y/n)" + read answer + [ -z $answer ] && answer=Y + [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" + einfo "Checking system parameters..." + + if ! use kernel_linux ; then + SKIP_SYSTEM_TESTS=yes + einfo " Tests not supported on this OS (yet)" + fi + + 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 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 + einfo "Skipped." + fi + + einfo "Creating the data directory ..." + mkdir -p "${PGDATA}" + chown -Rf postgres:postgres "${PGDATA}" + chmod 0700 "${PGDATA}" + + einfo "Initializing the database ..." + + su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" + + einfo + einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + einfo +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ + emake -j1 check || 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. If you think other tests are" + einfo "necessary, please submit a bug including a patch for this ebuild to enable them." +} |