From 7255c5d5fcd8fcdd07d2791563dc43bf4e14cf3a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 15 Aug 2022 20:28:49 +0100 Subject: gentoo auto-resync : 15:08:2022 - 20:28:49 --- dev-db/postgresql/Manifest | 17 +- .../files/postgresql-13.8-no-server.patch | 144 +++++++ .../files/postgresql-14.5-no-server.patch | 146 +++++++ .../files/postgresql-15_beta3-no-server.patch | 146 +++++++ dev-db/postgresql/postgresql-10.22.ebuild | 453 ++++++++++++++++++++ dev-db/postgresql/postgresql-11.17.ebuild | 453 ++++++++++++++++++++ dev-db/postgresql/postgresql-12.12.ebuild | 453 ++++++++++++++++++++ dev-db/postgresql/postgresql-13.8.ebuild | 465 +++++++++++++++++++++ dev-db/postgresql/postgresql-14.5.ebuild | 462 ++++++++++++++++++++ dev-db/postgresql/postgresql-15_beta3.ebuild | 464 ++++++++++++++++++++ dev-db/postgresql/postgresql-9999.ebuild | 7 +- 11 files changed, 3205 insertions(+), 5 deletions(-) create mode 100644 dev-db/postgresql/files/postgresql-13.8-no-server.patch create mode 100644 dev-db/postgresql/files/postgresql-14.5-no-server.patch create mode 100644 dev-db/postgresql/files/postgresql-15_beta3-no-server.patch create mode 100644 dev-db/postgresql/postgresql-10.22.ebuild create mode 100644 dev-db/postgresql/postgresql-11.17.ebuild create mode 100644 dev-db/postgresql/postgresql-12.12.ebuild create mode 100644 dev-db/postgresql/postgresql-13.8.ebuild create mode 100644 dev-db/postgresql/postgresql-14.5.ebuild create mode 100644 dev-db/postgresql/postgresql-15_beta3.ebuild (limited to 'dev-db/postgresql') diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest index 226835cb795e..0238f4e23b61 100644 --- a/dev-db/postgresql/Manifest +++ b/dev-db/postgresql/Manifest @@ -4,8 +4,11 @@ AUX postgresql-10.2-no-server.patch 3117 BLAKE2B 399e295e393aa84aeaefbe236bf63e0 AUX postgresql-11_beta1-no-server.patch 3080 BLAKE2B 29d4f5d8e26e9360490876d2d51cb29cc340128fe77c0bd76248073157c9e5be09c788cc4344e09c0c2bf2f57e274d5f31f211d1950ee3f47660dfdc4cb7b455 SHA512 42c39e602a019d1d44c39795904fb37a7f14b4623fa90b066f4f26a743d80b6eeaef2e8c7de4c47dddf53d7e89cbe5a2a3473b456ddc76fc0e96f57ff6a9df69 AUX postgresql-12.1-no-server.patch 2965 BLAKE2B 168f39c02f0614c57a60c0ce3bb540e0d29dc407c569661d0cd29ddb57657bfada44aa90ca915c8474ca5541ac1f4cc152fbd70c105efcbe83f9e5b9f918eeb5 SHA512 5e025da1cb5f696821b19093ab893667426a08b1bbc8e3f748d34207730026625b61a8cfd2596af124080a4a292363546dce5b703ce6164efceceabc6b170aa2 AUX postgresql-13.3-riscv-spinlocks.patch 966 BLAKE2B 4834d47b01e1f8e122fa940a84e1e790686d96b538d27f253724f7be454c455c6853cdadf41da5cafeb8767012b45a6eef742685117afaaa78e0e9a930c728c8 SHA512 1c217ec177a1669fcaeffe2cce241b5ba2cba6425d9eee8bf50dce6626e70e2d063776e1ced4590cbf9ffc046ede02dbe4f06bdfb7bc4c3dcb0f028c128c15ea +AUX postgresql-13.8-no-server.patch 2985 BLAKE2B 81a4a7c1d3c9e104ea7a575a14eecada57b62ed652b4401b459886250518179b1f68efd73246773cf7b745c298ac59f0e5f693f2ac0e6e0fd4a29c4c431e3715 SHA512 7a3fd3f8411c59b812da6deaf743247c0e728aca653fb66860a7a6e55704bc732327dcf917ce17fe089003740131d4d92879e171b4b9ff262fef0743f6f50122 AUX postgresql-13_beta1-no-server.patch 3787 BLAKE2B 35a01d479262cf21699043d65bb0d71539198ca30e8a627fc134183fa57ac6e1cc3856848bbbe9916a99569c79f4af1e2b6ed50b3d029bdb8f58d050e08552d3 SHA512 2fbd07eb865bac3e9381a0b851f7c92c1c08c2e6521a02a42cc7435bccdce70823eb752afc67aa221b804ff4baee1a2fd5a2762a6b82b14a6f77ef739233bca1 +AUX postgresql-14.5-no-server.patch 3018 BLAKE2B cbb900bcb7bcc8e788369829811da0d57a45682a77ac54f430cab7ebf6df9ff10489d50d129fa5b24bfff80929497b3107a8e650962b8e772d6b0bee610f05a9 SHA512 90e88567af5f30969e946295c4c058cd245bdd7dce01d48b70aa3dd000cf9e54570ed1b6bcc423a10ed0b7102047927da19bd26f5714e003ccffde967c77db26 AUX postgresql-14_rc1-no-server.patch 3508 BLAKE2B edd8525df7ec0505a8468c8f79a32a989f13bf3e0bd48efd00bfa3adff5b69735768ab4a1269d168076905b8ddda4467357e161714a205dd7cb3e66a0552784c SHA512 35c5e32b973fb683452773f93f45b69ad7eabfe13539c1764ed3919c0b0ebbc9e2e373cf101b1a224d1d5c93db4cb8f1936e0dddd86c6c28d2da5f4998cde002 +AUX postgresql-15_beta3-no-server.patch 3061 BLAKE2B aeba13501762f4e21653ad65ab10f708d604c393797766c1acad207a7889e02eb2806c0f6823fcbf9f2891be85d17ff7d3ba6066afe5f5fde3b9b39e56bfa5f7 SHA512 a41d01f994c4301ec059615446a3cc03cd16af67e3a3c1c0fa73b145c1b910de38d5a4a4757ad861c9cd11124f1d2d13f6503be2e5a2bb28f803fb03b055edb5 AUX postgresql-9.6.3-no-server.patch 3067 BLAKE2B 49822723f1e90b05b56bd4714a2480b366a1fad8d6db23cd2e99ad74eb389310077e12580c312a8ccefe0058218e8354a8665e82bcb7b27be6f744433425b0ec SHA512 314f5cea74dde55d054b43cf890dbbd216b65843f2a863a32cf8ba9fdaead1f74ad01905b7f93d2996068addd8705ff2119e1efc709cf84c18f6685937e969bc AUX postgresql-check-db-dir 1013 BLAKE2B 2be45942d0442822113879708c11dfde267938b6e7118bd225f567ca9fdacb11082792eabcb40b8a39cd6017fdedb18100576fea0895dae2dcda83c2d51de34d SHA512 2f34ee0cb6a889500ccfca7621ada6ee1bb06dc146f3c556938152dd3d7c0312266bb4db5f4099838d93ade26e2b8866dfddb3576cb5a737431ea2befd0cec6f AUX postgresql.confd-9.3 2477 BLAKE2B 0d42eedb99c951c8c60ed02abb5d4526bc288e8dd50b048cb3ab374239f1929aa80d10306037e45188a81593163121c029b91f9149365bff02ff7bfd0fe52ac4 SHA512 6c9e7c2de31eace2b3ce771a29eb354b143ea81f85d9d7ef601f302b7ae71c1c3badde8765fb7757dadcf0c49dcfa1116977e8b7f1e238350d3732962267147f @@ -15,34 +18,46 @@ AUX postgresql.tmpfiles 39 BLAKE2B 25a5725af53c8e4e4009887e998172dd863ce218a5438 DIST postgresql-10.19.tar.bz2 19261478 BLAKE2B 3ccd44d68980ddb0e394b811af20c213cf89eb8d4374d2c49c9cda5165f222ca849a2db4fe4d521991f15f9cc84ec35bafa91083b9625f2a6729159f490a94c9 SHA512 41b0f5026be7d563e41b54e9ea7199dd466a132d355be0b71a91d41f533d97fbf550eccf2a2ece3d60c5dab5921ebeea3ac4780c18c54b924df52d7423305a22 DIST postgresql-10.20.tar.bz2 19371473 BLAKE2B 24ce3e3dda749375e999206307154e79bf15d20b3cd598ba0b78bf27976241d71e88e6fa4cd459b675bc9a9047e9315321b1535dbb41ed9e558858c2a7e9dd31 SHA512 44cfca541947d58c70593b767d3c2423f20cc6904f3d4cea8f63c1802ccbc569130c4a2a15f1af152285926f6a200e13d59c21584295dafd6f6e74bd38251428 DIST postgresql-10.21.tar.bz2 19409454 BLAKE2B 5e43abaee8156b9eb99360efeb25ba268f93a60ac2c29044d9025c4faa8753d84cb3c0c8cbcd65eb9e0eb094ebf63e0cc1cbd0ef12c0a2faa360754e63ae106a SHA512 1053e15505c0448df491119c9aad1617889b66118628a2155e3ec87e6648b2071a0a54e10d8fbbe00161b2aa86d1a6194d932a8cf5808c626e7972d135bb05c5 +DIST postgresql-10.22.tar.bz2 19455874 BLAKE2B 10a8a894ba6e649abcc68abfd829bd30bca04b6e90f987ae5771fe02474517254ea2b48c7c9f2a899309de7b84aeaf13bac025965a9cc44814727ba257a633d7 SHA512 2e1ea75be7696ffbbb947351a8e8e55aaf067f86ad318308499a6a58797f0bf86227ed33e257e261c5c71ebba2f73ba514ef195a2394b91414ce6a0c3ab62532 DIST postgresql-11.14.tar.bz2 20172910 BLAKE2B a033752fc5fc593c96fe63a258b2cc0d4b896548a366e3fefa8afde1f96ab64aab97eb395b10ae10494709963ed924623279f76f66870c4faee435969400c1b7 SHA512 ab71461ee6fb4cdc5b4240f7ecd8af2497ce6780283fde2abf5951ffdb616bd0c8ed22b26fdfca402a346e663ff77c4d17f3284c9d700e6fd6795b2aec97c9be DIST postgresql-11.15.tar.bz2 20245750 BLAKE2B f6a632606fe4b34b2a44df2c165ccfa6e890b85f4f6048994f781428bbd1de6888a24493fb5d0c231f3f34e6a4e94cfd23078a9afdaf5925d284b4854847d23f SHA512 1eba7bddee1edf034617102c1d61ad0aa1b58927dad63de1d054817966c4c9a1d7d3fa6f6896af3fe5a6880b09a6ec86be298256ee6ecc3705ff2654d3d00c74 DIST postgresql-11.16.tar.bz2 20347100 BLAKE2B 240e86b68ff8833265f10802da2fb847d72e38ac9325fc56bb6864266b2ad98939170038ccdb7044ae16f9fd29e7a9e1d404456d8bc7d53430067d714b9bb563 SHA512 e1b6be0a97e60cdd95cd0ebc756b1de6abf2f33f41f6a80da3dff25483a30146fb6bf750ab787bb5bb4f2a04718946c7429e71f891cbd491001e9f9c2ea8e63c +DIST postgresql-11.17.tar.bz2 20385599 BLAKE2B d145bc0f5e0f277be91bf46868c78c9ce5bb2eebbbd84fbdcdbb1ec115911d124a0a054df783739fb912eeae1322fb7eb58b7b1b8d40a8f81cffe2f24d3dda01 SHA512 35304279c06577eca134581490710db976edeac8cca169d3436fcdce8eebb18159459ea3b5ef403f6a8efe85542726f9960c4ca653da4619e081ce5869866032 DIST postgresql-12.10.tar.bz2 20990621 BLAKE2B a7a56cf75944c558ae9bb9165dfb17b30cc5f7a865961e0a588677e4dd3e53d1fab15a212a21ec12f8e7b669a448d78efa0dfe985fd4902e16485a298c7adc62 SHA512 befedb14320aa033dc55bbb93bbbec4e67d9cfced63be0e4f631c7495a0fbc6fe280bd6d2fb941d7a2e6b2ac570b7f40d8db7f07a192a81bd9cd63c6c244a9c5 DIST postgresql-12.11.tar.bz2 21086745 BLAKE2B 7062d334f3ef3b98f69e709f5de744324c7ce53ea516384902632a454a2ccadfd7bcc0c9ef4d51a685dd7a06e1fdccc292109294517831181c3db30bc2b7be91 SHA512 705e9e1ccf8202062cce61069b5ddb7db5f804dd0736c620640ce5622b9e42fdcbc1417771e77d51aa54beb4562a09b4307f2ff7dec135bd0e31f4941ca36ac8 +DIST postgresql-12.12.tar.bz2 21089064 BLAKE2B 7285dcfc8ed6cf2dbbe29d894dbcef53fad18cbeddbfdb3a43893234a1ee75a9bf5d966968a0c481a8ab15bf8a37400bf6eb4b57a83359501b729e70398e3551 SHA512 eeff79279ac11db04fdddeb2c52ba1ec6b549223b862222540e1f659fbfc3617130699c22694b465bde46b1a4a665c01aef70b68b86d80e58a5657efd019407d DIST postgresql-12.9.tar.bz2 20904260 BLAKE2B fc88d61d369569a3054b889848eaf1405a4f5137cd8c2cf27282115f70853dd4d5d8b4bf0a9fc60c63db936246a0a64077c9bfdb90685d4dfe375558e4519b2b SHA512 11697d8283f5df5a9c74c2406e94d1b6da6df8358ad48f3b773825aab98e8395f9fd4e3fc8b1e6ebad3743c3dadbda8b795d4fe84a447d7913223e136cf2b88f DIST postgresql-13.5.tar.bz2 21186674 BLAKE2B 3e51d6d67bba09fb134cd71c48349674e0cacfaefee299620482c93f0b09edbfead578deb63083686ab691563b088fc0ea60a6281a0bcf9145689fb3ce1ec0f0 SHA512 c76effbca8ee63be48fa3aeb39c7038221848fe83ca2afc4e0904ba8c6a50b89aa2ad37080d4e3be75e9bdc2d6ca6dfefcda334ef55a5e1a8954bb955ce905e5 DIST postgresql-13.6.tar.bz2 21257213 BLAKE2B f5ea95fd9ffc8846e0aaf5bac03b02afa71e62e796bbe40f68af727a2f3c74eddd98cb68427bcc13b87b6fa00a8e2a7b18dd7749318f0a4a32cfdbf9b0e0a873 SHA512 2852726a3031b8d469f1c38f3019af02fc5afe40ec27b22288a29acefd30c63a98806bce88a214d0c2f9177f547b0b5010ad64e70bcbe2c2f1d97a27ae1984f8 DIST postgresql-13.7.tar.bz2 21364433 BLAKE2B 2d8a505f6de4eb31cae415529eeac750a60abafcf45e7fde29043597b385a8150fac55df659f8c2ad200822e8063d388ed606dff9108d4407f9e26b893fa62f4 SHA512 9254f21519c8d4e926f70082503bb5593c91064a3d2a4ea18ac503dfd9aa94751d6f01ce00fca9fec9b2b7af40caf8d0951b661dd8be4d6aa87c1e35b6fa7a41 +DIST postgresql-13.8.tar.bz2 21397381 BLAKE2B eb076382027a175789652a6ae8579d9b9c8856918741e8058456d22f1ef89525cff5fafe863bf615f658bc94b740b00d1268825969e37a7cefed6b5c90f402c5 SHA512 3b39448b291342a5e9b610d410c222aeb85f8acf95632e73e138ae316133af3dadc795a6e706f6447f543cf10df3c786da4f1afa1d91489b50eb77e2d9ed5d84 DIST postgresql-14.1.tar.bz2 21887101 BLAKE2B a496dfd513c52339d1b3cb72773f9611721fd7c5d2a702d6fd71f650a1d41c3d7bf6574eba23671c7f9f11718e007f51f9547949bdc3d7fe1ea2248ebfb8d70b SHA512 4a0bec157d5464bb9e5f5c0eb0efdede55526e03f6f4d660b87d161a47705eb152fa0878960b1581bce42a5ed28a1f457825ea54e8d22e34b5b8eb36473ceefd DIST postgresql-14.2.tar.bz2 21964841 BLAKE2B 6460533a40064404f18642147b949cf7c85d036c45ede478fb9af8919895ee7b09dc78b89ed08a292226911f07cfc9e46d7f2d42e0aaea546c5e97a291d599b9 SHA512 19aeb6528605dbcf5df84048b2eed8f54b202576134d3fe3900bb8f073179c4258d2581acd745887e7e6fa86ebdb5f7b159ffaa0a645d601efee7c5f7730456b DIST postgresql-14.4.tar.bz2 22094218 BLAKE2B 05b65083d826ed2f451b31b29b4b247dfd76b3d24ef05f6be128ee9e58d521d506a3ec4ae4839cbb74d8e217dfae81a95bd97894a778ef3c47b907b85b1fb25e SHA512 dd2f80248684e331d2ffb1e26cd2a285df1fb18710807a0c31aedabf917912ce9267f8ca26318e5371d916c6fe476f8a17886d82d3ff86a974e6f24c19a6aafb +DIST postgresql-14.5.tar.bz2 22132996 BLAKE2B 6d303850ef1e8f9f5d66a53275fc814475646c762b9747a4f0401a472ebaf59be06d6e7c08e9c1c5ad5d3b9dbc3bb3c06d58bae137806e1a437c86bcc8cae501 SHA512 3051c5ab729f6a55952c6108098b022517398b1de64f7fefbdd6c806c7e2eb0637d00f3c98a6203c5bee654656528c4ff3530db5a69470e7888864c77900178a DIST postgresql-15beta2.tar.bz2 23511057 BLAKE2B d1e6d8ce67998d4295587780c2cb75f33b930556e11fd95bbd4d828086f63faed6bbddbb809ebc1fddf0980c83c7cf51e3d37f110d7bb68959dab34f61b5b8c9 SHA512 139bf4f95e2bc8942666009c6680d2b61d8ea2898e9e7eb3a0afb118f0bf6acfac5f21676525cccd82e9ee5c43ad79e07e23a55333e1318426d8b9bc95a4f00d +DIST postgresql-15beta3.tar.bz2 23585136 BLAKE2B cdea196fb62587800f7fceafcbbd781f5636323fc6b205a0e5e0081964f2d08fcb421d0d66f710150dba37f30c2b0e7f7b3119a9a83a0cc573104968b16fc043 SHA512 caf79b889ca1325bcbdce3bbbcb3a0707b8928c8bd7b97f594cfedaedc06826e829a561b2fde73210c1e2596a0201305fa350bb3f12c05783014fc0c8564298a EBUILD postgresql-10.19-r1.ebuild 13408 BLAKE2B 242cefd43604dfa557e83172783731f608a350467b1e546a935d1507acb54a2a714bc67175ce5846f82577516b07f4f74de59ae59481363c6c8cf40cb090e5e3 SHA512 2f02d8194f9a1eb51a69e6b8bf1f5b6bf461ce7b77dd983d13d2ccda3c10c1daab2a24c6472c7bd367548eeef53b5ce2dbcb77cfc3a00104787d426c140dbc09 EBUILD postgresql-10.20-r1.ebuild 13416 BLAKE2B d70e618b0bc07941ff8dd794a64c3cf94798f470c24b0222f505e5c36188ccf51477e1c9a35e71dd753250a7f5fe744297a017289006bcffe2b38ddd3c744179 SHA512 aa03b4ac07f61e75b71ea664546f0a6011d6afe93e6e487c36a634156441422465f6e2680587f8ff3bde2fba04f071c60ab35502099a8657e942a5b24f76754c EBUILD postgresql-10.21.ebuild 13419 BLAKE2B a7ee8b15038673ecc77165bfe85bb4235b250cc29e2fe876e16483cc0e051990a0e275156ce0dccace75637e2dbd65e157a07076e0025321581d1eba017df40f SHA512 a7b5a64b2177bfa85e66589ffdaff8b52373f55f63dd3760060b077c70fce87b1a350969e944031d6246d4fac0ad839f1025d44d23ec9597e4a74a004f9de3e0 +EBUILD postgresql-10.22.ebuild 13403 BLAKE2B 33ed819ed8ce49deb8f43281e4c38c7925f92b4fbbee85dd6d14c96e73a4c817c88e0b8f7af3bd6c3aa84693894c859df96e56b6dd903674bf21ba5eddc5358f SHA512 1fafb3c7a673d683e65a78095dfe85db0202912385cdbdf2609450c0d71cd4c1f35ba05c26143b61bf63b5a89bc683e401278d5bec8a3c7fc9b0e9903b07816c EBUILD postgresql-11.14-r1.ebuild 13449 BLAKE2B f077ebe227322eb51ed8a1a24c2fd4e22662eb277acbec3d536b87f8d1baa09fd728d5a790106b1a1acc25ec0e2605d5d3d6111d4bb69c956d6c972caaafc71e SHA512 2f31ca8f2a23c9a98dc43d6af8314105f761293d78cb9efdb59579e02abc20403cac0e06bca1d25c3fb6e09811dbe1b3774ccd4a8bb2a6ebe505bc45e105d972 EBUILD postgresql-11.15-r1.ebuild 13457 BLAKE2B dee96904f9cdcbd4ba3bdfde139235901e42d8152c9d3450706a8bfbb65d612da6df97e68a441c65e0a156f2ded4f59ed19d084941683fcb64b46a05310fc9d8 SHA512 35a5a7ce237ffddd3d3267f78c4f89307a8c959d2d4f541d9dc5776554c16fab540d32fee34b67215300f02cc0d3a02e06ad8f818a841e0ec0778c2d84bbef28 EBUILD postgresql-11.16.ebuild 13460 BLAKE2B 2c293e0cbd9a5a85a600f0736511cd04fcbfb4f973ffcfb8da11bb70648b8f03ebd14a1df3371710768b82a5c6ffa8367cfce16f94b4e5d14aa1cd2a80cc3d5e SHA512 a83bce28182383fcda369e900452867a425ece6d91042958bdf321253e6a061d0b15be40314ae953ac47126fbabc9302cbd137dbaa93c76a35a688f7e1e27047 +EBUILD postgresql-11.17.ebuild 13444 BLAKE2B 6f93191d14d7ac0be995a7e46ceb28f5564ad7116fb0398d9d1ecf0f436ffc1e04a9d7dd7dba0afcb69190c5fd64e717f9517cb12d917bafe17f514df3c407bd SHA512 14f4abfcf1b7dc78817337dcb02725bdfcc68bc86b0fa20c91659e0ac7d1f2b1c493cd64193aae953443db44bcee5d25116850f56d1ae01477d77c5b272d565c EBUILD postgresql-12.10-r1.ebuild 13485 BLAKE2B 17be08192ba86e5046e54d5b76d57dee6bceae73f296e974640df028c641795cdb410d8f096dc51256756c76f4fc4aee843e83aa495eee4c5013568a51588da7 SHA512 cf0adab3e839c94ac3ac2f5d7367f70d15a23417ea60ea8122bce6355409abb82f8d29dc4ab2b39cef46cd9b38476981c3e882a89388affb69fcd46d7a2cdc1b EBUILD postgresql-12.11.ebuild 13432 BLAKE2B db1f67a15ec8655a0f5389b87411957ac478763ef617e81f6970834491ba628916411e78d625d48c262bbbbb5a748a582a6f7815ccfb46353fd94a67c12b43e1 SHA512 9d15681dcf8e1dbf70dc7c53fb6b9e8db0589beebf93b8ea1644bf8844c5cd6704be65f7cad3fb180d7b4e13c72eb088ecfe7437ff2f1f210641d6d94995c159 +EBUILD postgresql-12.12.ebuild 13416 BLAKE2B e9a5f9bc3c63910f5063ae6d93caafd54dafaa72835c28f683a3e5ba1ef452a45b6aa190a31d3d3086cc4c7eb81fb605cab73ff9260930974c1384ec0db9b3a0 SHA512 ebb3c4798583381023bd7165605f9a1b39143e354fcb8cccd6023250bb54b9decf2e77608085fabc2d052239cf15c6664590cd2e874bf6b6325ef94fc9843e30 EBUILD postgresql-12.9-r1.ebuild 13477 BLAKE2B 73da16f9f304441f554a0aff0b16fbcb0c283c45698862143c2e6d8432ffad15f912b10107d46f418da27d7bfa0462d96f91c124d5c33301188d5309db2c88da SHA512 741dde1ca4d9e8e2148c332cb657d3c86a3e7f8543a0f74cea4548e164cf53438246d487db2feffae302332bbcfe2273f96ab20d1bb1205224445cc27723f820 EBUILD postgresql-13.5-r1.ebuild 13915 BLAKE2B 4e26527c9f181560e26c12dbad6c4ec4efa1541ef3e4c95aadecc634daac60aec4407ab050b4c1d8f2626d5ecf32f466f6e2c361a9502c21933d5a063b42c51d SHA512 c404c73cb8b61074329c6185e2a760b77b782f042e81a9b4e839f2554a3ee1b23f5a87519996777e8506cc461803f81ac585919eb0e5de8b6ab576f5c0f02a05 EBUILD postgresql-13.6-r2.ebuild 13923 BLAKE2B 4affe91b5f0d9a50c5c4151614da2aa51f53c1c1a009e3bee1cdc9bf948ef1f393943192a7d7bc697b2e76ec7a34ff5cf3862f2d1f12a8a85a6e87ae9d01d6a3 SHA512 3b564b616a8a33a8f16c35d2d9360b35b6682169875de9cc79f00e44aea6d29a7324ea641c1df9613226db3f83e0bf860c131fae18b609ad3e817e21df97de19 EBUILD postgresql-13.7.ebuild 13870 BLAKE2B 20258249b38c7d6785a520e1905d07b9893e2324c74fa18b48380d91912bbc0a45031539abe48e586d8856d26ec535b60eedf3a3805c564b353ee11492f033ce SHA512 0d36a3191649a989243283a0d21cd36efc8c01aa3f217449a9d64e1846bec033e281fc4afc40f85e3b0c7ecab05a8c558d247acf765594b561d1082a95f37139 +EBUILD postgresql-13.8.ebuild 13850 BLAKE2B 5b1be6c36bfa8564670a22d725470ecace7f7e0153af5822e6bb338b19b85f07df8ac7cf9190d9b0d8528f4c8554cb5c36acea2ab4bbbcff7c67b9c9aee3c278 SHA512 886d528e644c49822e257006877dffebc0e50e2440c06edc26d4898913946a8ef55d0280741f96afd2960f6535799d39f3b80eb1ab42aaa034efab2e44f8428e EBUILD postgresql-14.1-r1.ebuild 13911 BLAKE2B 579d9eb3d1b3ecbbaabfe44c2fefc590ebc7cc3a638e7affc9e4c5235c0da9cfccbd5b21b91cca5455924adbb5cca033b7d0fbfcc444119dce2ce570741f580c SHA512 4a9839e479f1c851f28b9d8738b65ec973346a650190c94b3968bbfa2dd45807a24efeba806a973dff83a7dc90f685616d659735528eff4113b9fbf658c64642 EBUILD postgresql-14.2-r1.ebuild 13844 BLAKE2B 96791ac26849a47c86282170d2bec9c1b0c2c794664f2429154d1f34ceb3f12c59fbf6ac54e12ecf3dc025f884520260dec8e317f8a28df83878c366e1d9d0f9 SHA512 717076f2136ee41a43825b30733801edc2717222b0dc103ccba74f2b600a3b36d51a9b669cd91adff7c2a2954138bc544738b30936906dda2340671299635108 EBUILD postgresql-14.4.ebuild 13799 BLAKE2B 40af950a78f56c80e6ea14e3930e67408b53985a7298d857c634dabfe7b15f34cfd6b2c8559c4ae5000f59e5ad19b53000bf4eea1abed345f1697bee711178e9 SHA512 295043db0513669e2e23d6cf1ed36d78da2df4db21bd9dcb8d39497738b1638238b0ce0b7992ae0adda37fbfa8b440a60dd2ba3610a291a1fba923e0e9aa0a76 +EBUILD postgresql-14.5.ebuild 13781 BLAKE2B 72b97c481f58cc4771b7edce1a8a58f351e4de4ec740d50686544f6958c17d98f77725d46503c99bf19305adc07ad5764d59433e3113bf03e41db37c9d9e96fa SHA512 bf2be62c50d3c69267b2d23fa621a57a71d3a5f46dbfa195e329a5f7fe858ca80d6200a3b6a804fe07d953af0a3186a43b428b25678a9d9d2a8e00c1ca638b31 EBUILD postgresql-15_beta2.ebuild 13665 BLAKE2B ce6a7544e317469603a81dbab5072a8d142bc2b3ada6f9dc7a72606176f64a1a8f9678e6734893ce320a6795839a8f9aee0d95e82044947999de51a63cc7a922 SHA512 5eb71847b3744f1f8145531e97a10089482631d28121d652fb91ddd2900cb7d4ffb70de58cd3c94fe312fe0777ea2a33f821f0967efe6aa9ea531b0a7cf214ef -EBUILD postgresql-9999.ebuild 14102 BLAKE2B 821a52a05174b6b4d9c539d01563a45a0edded846b1533b5cc87ccfd45fcfd56bf2e77c49ec8ee1f5cf79d7174f0aaade405591e70aa5d7d81c068fc33fee923 SHA512 e1d8c3ce0347b9db2ba4aeec48cf08d99e522eb5663ae0b84b510baf07be4a06c83a9b6c951952a949a7c3984e373048db0f518ce234117d54ce773fc735ccb2 +EBUILD postgresql-15_beta3.ebuild 13651 BLAKE2B 51bed616c3f486b95fd56ec3106d68463cef32b0c1e86717ffca2c267af195ed3d7443ec8fe210dc5147bd2dfbef340d71eab6df4f2cffca00f27c972451ba85 SHA512 02f91cc698c1c3eac7fc03f772d1937cd1d0c412b2a4395066a36b59e44389952a9f030f0cc9b7a2c8dcef4960409cf4ec0f921e8f19dee9bc30332c6d33dd89 +EBUILD postgresql-9999.ebuild 14085 BLAKE2B 451cd42e7fede68e3c27c77a86ec19bf29eecd254d12f235aaf07cb5ab58aa74e3ef9d8c4ea1b8a1bdafb6590608387eb1b30f1c7387e9eb2bce466cbb170fbe SHA512 90d7c1b53706a4015c7292b1f3bce730f2326541071eb08c84a6b0aa76b0d2e5f98b43f7b6f677df1a1a926cdf270b7b2fb076efca4d7f48bc67942d44d994bb MISC metadata.xml 653 BLAKE2B b5b85d83ee78ac502e2707d156e2fadf6fea857160e2f48da51c755e221c52a14b9eb04354202287f4aba15c274c07ba7b0911c76fd034bfa774ce3500ccb165 SHA512 fd543af224f6f8677e138cb1db7154d2444295c45df8696e3584911943176023d8d1b179f6b16d88ffc6d290265ec1b2f4c902cf95cc79eb37599ae3635b0942 diff --git a/dev-db/postgresql/files/postgresql-13.8-no-server.patch b/dev-db/postgresql/files/postgresql-13.8-no-server.patch new file mode 100644 index 000000000000..295df7087c14 --- /dev/null +++ b/dev-db/postgresql/files/postgresql-13.8-no-server.patch @@ -0,0 +1,144 @@ +--- a/contrib/Makefile ++++ b/contrib/Makefile +@@ -5,56 +5,9 @@ + include $(top_builddir)/src/Makefile.global + + SUBDIRS = \ +- adminpack \ +- amcheck \ +- auth_delay \ +- auto_explain \ +- bloom \ +- btree_gin \ +- btree_gist \ +- citext \ +- cube \ +- dblink \ +- dict_int \ +- dict_xsyn \ +- earthdistance \ +- file_fdw \ +- fuzzystrmatch \ +- hstore \ +- intagg \ +- intarray \ +- isn \ +- lo \ +- ltree \ + oid2name \ +- pageinspect \ +- passwordcheck \ +- pg_buffercache \ +- pg_freespacemap \ +- pg_prewarm \ +- pg_standby \ +- pg_stat_statements \ +- pg_trgm \ +- pgcrypto \ +- pgrowlocks \ +- pgstattuple \ +- pg_visibility \ +- postgres_fdw \ +- seg \ +- spi \ +- tablefunc \ +- tcn \ +- test_decoding \ +- tsm_system_rows \ +- tsm_system_time \ +- unaccent \ + vacuumlo + +-ifeq ($(with_openssl),yes) +-SUBDIRS += sslinfo +-else +-ALWAYS_SUBDIRS += sslinfo +-endif + + ifneq ($(with_uuid),no) + SUBDIRS += uuid-ossp +--- a/src/backend/Makefile ++++ b/src/backend/Makefile +@@ -56,7 +56,7 @@ + + ########################################################################## + +-all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP) ++all: generated-headers + + ifneq ($(PORTNAME), cygwin) + ifneq ($(PORTNAME), win32) +@@ -195,23 +195,7 @@ + + ########################################################################## + +-install: all installdirs install-bin +-ifeq ($(PORTNAME), cygwin) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +-ifeq ($(PORTNAME), win32) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +- $(MAKE) -C catalog install-data +- $(MAKE) -C tsearch install-data +- $(MAKE) -C utils install-data +- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' +- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' +- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' ++install: + + ifeq ($(with_llvm), yes) + install-bin: install-postgres-bitcode +--- a/src/bin/Makefile ++++ b/src/bin/Makefile +@@ -14,21 +14,8 @@ + include $(top_builddir)/src/Makefile.global + + SUBDIRS = \ +- initdb \ +- pg_archivecleanup \ +- pg_basebackup \ +- pg_checksums \ + pg_config \ +- pg_controldata \ +- pg_ctl \ + pg_dump \ +- pg_resetwal \ +- pg_rewind \ +- pg_test_fsync \ +- pg_test_timing \ +- pg_upgrade \ +- pg_verifybackup \ +- pg_waldump \ + pgbench \ + psql \ + scripts +--- a/src/Makefile ++++ b/src/Makefile +@@ -15,21 +15,12 @@ + SUBDIRS = \ + common \ + port \ +- timezone \ + backend \ +- backend/utils/mb/conversion_procs \ +- backend/snowball \ + include \ + interfaces \ +- backend/replication/libpqwalreceiver \ +- backend/replication/pgoutput \ + fe_utils \ + bin \ +- pl \ +- makefiles \ +- test/regress \ +- test/isolation \ +- test/perl ++ makefiles + + ifeq ($(with_llvm), yes) + SUBDIRS += backend/jit/llvm diff --git a/dev-db/postgresql/files/postgresql-14.5-no-server.patch b/dev-db/postgresql/files/postgresql-14.5-no-server.patch new file mode 100644 index 000000000000..87bd89b68f19 --- /dev/null +++ b/dev-db/postgresql/files/postgresql-14.5-no-server.patch @@ -0,0 +1,146 @@ +--- a/contrib/Makefile ++++ b/contrib/Makefile +@@ -5,57 +5,9 @@ + include $(top_builddir)/src/Makefile.global + + SUBDIRS = \ +- adminpack \ +- amcheck \ +- auth_delay \ +- auto_explain \ +- bloom \ +- btree_gin \ +- btree_gist \ +- citext \ +- cube \ +- dblink \ +- dict_int \ +- dict_xsyn \ +- earthdistance \ +- file_fdw \ +- fuzzystrmatch \ +- hstore \ +- intagg \ +- intarray \ +- isn \ +- lo \ +- ltree \ + oid2name \ +- old_snapshot \ +- pageinspect \ +- passwordcheck \ +- pg_buffercache \ +- pg_freespacemap \ +- pg_prewarm \ +- pg_stat_statements \ +- pg_surgery \ +- pg_trgm \ +- pgcrypto \ +- pgrowlocks \ +- pgstattuple \ +- pg_visibility \ +- postgres_fdw \ +- seg \ +- spi \ +- tablefunc \ +- tcn \ +- test_decoding \ +- tsm_system_rows \ +- tsm_system_time \ +- unaccent \ + vacuumlo + +-ifeq ($(with_ssl),openssl) +-SUBDIRS += sslinfo +-else +-ALWAYS_SUBDIRS += sslinfo +-endif + + ifneq ($(with_uuid),no) + SUBDIRS += uuid-ossp +--- a/src/backend/Makefile ++++ b/src/backend/Makefile +@@ -56,7 +56,7 @@ + + ########################################################################## + +-all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP) ++all: generated-headers + + ifneq ($(PORTNAME), cygwin) + ifneq ($(PORTNAME), win32) +@@ -194,23 +194,7 @@ + + ########################################################################## + +-install: all installdirs install-bin +-ifeq ($(PORTNAME), cygwin) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +-ifeq ($(PORTNAME), win32) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +- $(MAKE) -C catalog install-data +- $(MAKE) -C tsearch install-data +- $(MAKE) -C utils install-data +- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' +- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' +- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' ++install: + + ifeq ($(with_llvm), yes) + install-bin: install-postgres-bitcode +--- a/src/bin/Makefile ++++ b/src/bin/Makefile +@@ -14,22 +14,8 @@ + include $(top_builddir)/src/Makefile.global + + SUBDIRS = \ +- initdb \ +- pg_amcheck \ +- pg_archivecleanup \ +- pg_basebackup \ +- pg_checksums \ + pg_config \ +- pg_controldata \ +- pg_ctl \ + pg_dump \ +- pg_resetwal \ +- pg_rewind \ +- pg_test_fsync \ +- pg_test_timing \ +- pg_upgrade \ +- pg_verifybackup \ +- pg_waldump \ + pgbench \ + psql \ + scripts +--- a/src/Makefile ++++ b/src/Makefile +@@ -15,21 +15,12 @@ + SUBDIRS = \ + common \ + port \ +- timezone \ + backend \ +- backend/utils/mb/conversion_procs \ +- backend/snowball \ + include \ + interfaces \ +- backend/replication/libpqwalreceiver \ +- backend/replication/pgoutput \ + fe_utils \ + bin \ +- pl \ +- makefiles \ +- test/regress \ +- test/isolation \ +- test/perl ++ makefiles + + ifeq ($(with_llvm), yes) + SUBDIRS += backend/jit/llvm diff --git a/dev-db/postgresql/files/postgresql-15_beta3-no-server.patch b/dev-db/postgresql/files/postgresql-15_beta3-no-server.patch new file mode 100644 index 000000000000..9ada0a71d5a0 --- /dev/null +++ b/dev-db/postgresql/files/postgresql-15_beta3-no-server.patch @@ -0,0 +1,146 @@ +--- a/contrib/Makefile ++++ b/contrib/Makefile +@@ -5,59 +5,9 @@ + include $(top_builddir)/src/Makefile.global + + SUBDIRS = \ +- adminpack \ +- amcheck \ +- auth_delay \ +- auto_explain \ +- basic_archive \ +- basebackup_to_shell \ +- bloom \ +- btree_gin \ +- btree_gist \ +- citext \ +- cube \ +- dblink \ +- dict_int \ +- dict_xsyn \ +- earthdistance \ +- file_fdw \ +- fuzzystrmatch \ +- hstore \ +- intagg \ +- intarray \ +- isn \ +- lo \ +- ltree \ + oid2name \ +- old_snapshot \ +- pageinspect \ +- passwordcheck \ +- pg_buffercache \ +- pg_freespacemap \ +- pg_prewarm \ +- pg_stat_statements \ +- pg_surgery \ +- pg_trgm \ +- pgrowlocks \ +- pgstattuple \ +- pg_visibility \ +- pg_walinspect \ +- postgres_fdw \ +- seg \ +- spi \ +- tablefunc \ +- tcn \ +- test_decoding \ +- tsm_system_rows \ +- tsm_system_time \ +- unaccent \ + vacuumlo + +-ifeq ($(with_ssl),openssl) +-SUBDIRS += pgcrypto sslinfo +-else +-ALWAYS_SUBDIRS += pgcrypto sslinfo +-endif + + ifneq ($(with_uuid),no) + SUBDIRS += uuid-ossp +--- a/src/backend/Makefile ++++ b/src/backend/Makefile +@@ -56,7 +56,7 @@ + + ########################################################################## + +-all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP) ++all: generated-headers + + ifneq ($(PORTNAME), cygwin) + ifneq ($(PORTNAME), win32) +@@ -194,23 +194,7 @@ + + ########################################################################## + +-install: all installdirs install-bin +-ifeq ($(PORTNAME), cygwin) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +-ifeq ($(PORTNAME), win32) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +- $(MAKE) -C catalog install-data +- $(MAKE) -C tsearch install-data +- $(MAKE) -C utils install-data +- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' +- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' +- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' ++install: + + ifeq ($(with_llvm), yes) + install-bin: install-postgres-bitcode +--- a/src/bin/Makefile ++++ b/src/bin/Makefile +@@ -14,22 +14,8 @@ + include $(top_builddir)/src/Makefile.global + + SUBDIRS = \ +- initdb \ +- pg_amcheck \ +- pg_archivecleanup \ +- pg_basebackup \ +- pg_checksums \ + pg_config \ +- pg_controldata \ +- pg_ctl \ + pg_dump \ +- pg_resetwal \ +- pg_rewind \ +- pg_test_fsync \ +- pg_test_timing \ +- pg_upgrade \ +- pg_verifybackup \ +- pg_waldump \ + pgbench \ + psql \ + scripts +--- a/src/Makefile ++++ b/src/Makefile +@@ -17,19 +17,11 @@ + port \ + timezone \ + backend \ +- backend/utils/mb/conversion_procs \ +- backend/snowball \ + include \ + interfaces \ +- backend/replication/libpqwalreceiver \ +- backend/replication/pgoutput \ + fe_utils \ + bin \ +- pl \ +- makefiles \ +- test/regress \ +- test/isolation \ +- test/perl ++ makefiles + + ifeq ($(with_llvm), yes) + SUBDIRS += backend/jit/llvm diff --git a/dev-db/postgresql/postgresql-10.22.ebuild b/dev-db/postgresql/postgresql-10.22.ebuild new file mode 100644 index 000000000000..bf8414a03338 --- /dev/null +++ b/dev-db/postgresql/postgresql-10.22.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8,9,10,11} ) + +inherit flag-o-matic linux-info pam python-single-r1 systemd tmpfiles + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc icu kerberos ldap nls pam perl + python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +acct-group/postgres +acct-user/postgres +sys-apps/less +virtual/libcrypt:= +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap:= ) +pam? ( sys-libs/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Work around PPC{,64} compilation bug where bool is already defined + sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die + + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + # Rely on $PATH being in the proper order so that the correct + # install program is used for modules utilizing PGXS in both + # hardened and non-hardened environments. (Bug #528786) + sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die + + use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch" + + if use pam ; then + sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + # https://bugs.gentoo.org/753257 + # https://bugs.gentoo.org/766225 + eapply "${FILESDIR}"/postgresql-10.0-icu68.patch + + eapply_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX}" + + local i uuid_config="" + if use uuid; then + for i in ${UTIL_LINUX_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=e2fs" + done + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" + fi + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !alpha spinlocks) \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(use_with icu) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(usex server "$(use_with systemd)" '--without-systemd') \ + $(use_with tcl) \ + ${uuid_config} \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + $(use_enable nls) +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY doc/{TODO,bug.template} + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + serverman=( + initdb + pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} + pg_{test_{fsync,timing},upgrade,waldump} + post{gres,master} + ) + for m in ${serverman[@]} ; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + # Create slot specific man pages + local bn f mansec slotted_name + for mansec in 1 3 7 ; do + local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" + + mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" + pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-11.17.ebuild b/dev-db/postgresql/postgresql-11.17.ebuild new file mode 100644 index 000000000000..f806fd11b70d --- /dev/null +++ b/dev-db/postgresql/postgresql-11.17.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8,9,10,11} ) +LLVM_MAX_SLOT=13 + +inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc icu kerberos ldap llvm nls pam + perl python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +acct-group/postgres +acct-user/postgres +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap:= ) +llvm? ( + =dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use llvm && llvm_pkg_setup + + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + # Rely on $PATH being in the proper order so that the correct + # install program is used for modules utilizing PGXS in both + # hardened and non-hardened environments. (Bug #528786) + sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die + + use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch" + + if use pam ; then + sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + eapply_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX}" + + local i uuid_config="" + if use uuid; then + for i in ${UTIL_LINUX_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=e2fs" + done + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" + fi + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !alpha spinlocks) \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(use_with icu) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with llvm) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(usex server "$(use_with systemd)" '--without-systemd') \ + $(use_with tcl) \ + ${uuid_config} \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + $(use_enable nls) +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY doc/{TODO,bug.template} + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + serverman=( + initdb + pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} + pg_{test_{fsync,timing},upgrade,waldump} + post{gres,master} + ) + for m in ${serverman[@]} ; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + # Create slot specific man pages + local bn f mansec slotted_name + for mansec in 1 3 7 ; do + local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" + + mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" + pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" + mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" + chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-12.12.ebuild b/dev-db/postgresql/postgresql-12.12.ebuild new file mode 100644 index 000000000000..389cb9f39c9d --- /dev/null +++ b/dev-db/postgresql/postgresql-12.12.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8,9,10,11} ) +LLVM_MAX_SLOT=14 + +inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc icu kerberos ldap llvm nls pam + perl python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +acct-group/postgres +acct-user/postgres +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap:= ) +llvm? ( + =dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use llvm && llvm_pkg_setup + + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + # Rely on $PATH being in the proper order so that the correct + # install program is used for modules utilizing PGXS in both + # hardened and non-hardened environments. (Bug #528786) + sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die + + use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch" + + if use pam ; then + sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + eapply_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX}" + + local i uuid_config="" + if use uuid; then + for i in ${UTIL_LINUX_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=e2fs" + done + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" + fi + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !alpha spinlocks) \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(use_with icu) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with llvm) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(usex server "$(use_with systemd)" '--without-systemd') \ + $(use_with tcl) \ + ${uuid_config} \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + $(use_enable nls) +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + serverman=( + initdb + pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} + pg_{test_{fsync,timing},upgrade,waldump} + post{gres,master} + ) + for m in ${serverman[@]} ; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + # Create slot specific man pages + local bn f mansec slotted_name + for mansec in 1 3 7 ; do + local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" + + mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" + pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" + mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" + chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-13.8.ebuild b/dev-db/postgresql/postgresql-13.8.ebuild new file mode 100644 index 000000000000..875acbe52592 --- /dev/null +++ b/dev-db/postgresql/postgresql-13.8.ebuild @@ -0,0 +1,465 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8,9,10,11} ) +LLVM_MAX_SLOT=14 + +inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc icu kerberos ldap llvm nls pam + perl python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +acct-group/postgres +acct-user/postgres +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap:= ) +llvm? ( + =dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use llvm && llvm_pkg_setup + + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + eapply "${FILESDIR}"/${PN}-13.3-riscv-spinlocks.patch + + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + # Rely on $PATH being in the proper order so that the correct + # install program is used for modules utilizing PGXS in both + # hardened and non-hardened environments. (Bug #528786) + sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die + + use server || eapply "${FILESDIR}/${PN}-13.8-no-server.patch" + + if use pam ; then + sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + eapply_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX}" + + local i uuid_config="" + if use uuid; then + for i in ${UTIL_LINUX_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=e2fs" + done + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" + fi + + local myconf="\ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(use_with icu) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with llvm) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(usex server "$(use_with systemd)" '--without-systemd') \ + $(use_with tcl) \ + ${uuid_config} \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + $(use_enable nls)" + if use alpha; then + myconf+=" --disable-spinlocks" + else + # Should be the default but just in case + myconf+=" --enable-spinlocks" + fi + econf ${myconf} +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + serverman=( + initdb + pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} + pg_{test_{fsync,timing},upgrade,waldump} + post{gres,master} + ) + for m in ${serverman[@]} ; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + # Create slot specific man pages + local bn f mansec slotted_name + for mansec in 1 3 7 ; do + local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" + + mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" + pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" + mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" + chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set + # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. + local old_ctype=${LC_CTYPE} + export LC_CTYPE=${LC_COLLATE} + emake check + export LC_CTYPE=${old_ctype} + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-14.5.ebuild b/dev-db/postgresql/postgresql-14.5.ebuild new file mode 100644 index 000000000000..6c2b0fe290d3 --- /dev/null +++ b/dev-db/postgresql/postgresql-14.5.ebuild @@ -0,0 +1,462 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8,9,10,11} ) + +inherit flag-o-matic linux-info pam python-single-r1 systemd tmpfiles + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc icu kerberos ldap llvm lz4 nls pam + perl python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +acct-group/postgres +acct-user/postgres +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap:= ) +llvm? ( + sys-devel/llvm:= + sys-devel/clang:= +) +lz4? ( app-arch/lz4 ) +pam? ( sys-libs/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + # Rely on $PATH being in the proper order so that the correct + # install program is used for modules utilizing PGXS in both + # hardened and non-hardened environments. (Bug #528786) + sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die + + use server || eapply "${FILESDIR}/${PN}-14.5-no-server.patch" + + if use pam ; then + sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + eapply_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX}" + + local i uuid_config="" + if use uuid; then + for i in ${UTIL_LINUX_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=e2fs" + done + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" + fi + + local myconf="\ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(use_with icu) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with llvm) \ + $(use_with lz4) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(usex server "$(use_with systemd)" '--without-systemd') \ + $(use_with tcl) \ + ${uuid_config} \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + $(use_enable nls)" + if use alpha; then + myconf+=" --disable-spinlocks" + else + # Should be the default but just in case + myconf+=" --enable-spinlocks" + fi + econf ${myconf} +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + serverman=( + initdb + pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} + pg_{test_{fsync,timing},upgrade,waldump} + post{gres,master} + ) + for m in ${serverman[@]} ; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + # Create slot specific man pages + local bn f mansec slotted_name + for mansec in 1 3 7 ; do + local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" + + mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" + pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" + mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" + chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set + # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. + local old_ctype=${LC_CTYPE} + export LC_CTYPE=${LC_COLLATE} + emake check + export LC_CTYPE=${old_ctype} + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-15_beta3.ebuild b/dev-db/postgresql/postgresql-15_beta3.ebuild new file mode 100644 index 000000000000..a805f1d90ea9 --- /dev/null +++ b/dev-db/postgresql/postgresql-15_beta3.ebuild @@ -0,0 +1,464 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8,9,10,11} ) + +inherit flag-o-matic linux-info pam python-single-r1 systemd tmpfiles + +KEYWORDS="" + +SLOT=$(ver_cut 1) + +MY_PV=${PV/_/} +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc icu kerberos ldap llvm lz4 nls pam + perl python +readline selinux +server systemd ssl static-libs tcl + threads uuid xml zlib zstd" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +CDEPEND=" +>=app-eselect/eselect-postgresql-2.0 +acct-group/postgres +acct-user/postgres +sys-apps/less +virtual/libintl +icu? ( dev-libs/icu:= ) +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap:= ) +llvm? ( + sys-devel/llvm:= + sys-devel/clang:= +) +lz4? ( app-arch/lz4 ) +pam? ( sys-libs/pam ) +perl? ( >=dev-lang/perl-5.8:= ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +zstd? ( app-arch/zstd ) +" + +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, +# the libc includes UUID functions. +UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) +)" + +DEPEND="${CDEPEND} +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + # Rely on $PATH being in the proper order so that the correct + # install program is used for modules utilizing PGXS in both + # hardened and non-hardened environments. (Bug #528786) + sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die + + use server || eapply "${FILESDIR}/${PN}-15_beta3-no-server.patch" + + if use pam ; then + sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + eapply_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX}" + + local i uuid_config="" + if use uuid; then + for i in ${UTIL_LINUX_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=e2fs" + done + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" + fi + + local myconf="\ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(use_with icu) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with llvm) \ + $(use_with lz4) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(usex server "$(use_with systemd)" '--without-systemd') \ + $(use_with tcl) \ + ${uuid_config} \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + $(use_with zstd) \ + $(use_enable nls)" + if use alpha; then + myconf+=" --disable-spinlocks" + else + # Should be the default but just in case + myconf+=" --enable-spinlocks" + fi + econf ${myconf} +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + serverman=( + initdb + pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} + pg_{test_{fsync,timing},upgrade,waldump} + post{gres,master} + ) + for m in ${serverman[@]} ; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + # Create slot specific man pages + local bn f mansec slotted_name + for mansec in 1 3 7 ; do + local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" + + mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" + pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" + + for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do + bn=$(basename "${f}") + slotted_name=${bn%.${mansec}}${SLOT}.${mansec} + case ${bn} in + TABLE.7|WITH.7) + echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} + ;; + *) + echo ".so ${rel_manpath}/${bn}" > ${slotted_name} + ;; + esac + done + + popd > /dev/null + done + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + # Don't delete libpg{port,common}.a (Bug #571046). They're always + # needed by extensions utilizing PGXS. + use static-libs || \ + find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ + -delete + + # Make slot specific links to programs + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} + + if use systemd; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service-9.6-r1" | \ + systemd_newunit - ${PN}-${SLOT}.service + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 1775 /run/postgresql + fi + fi +} + +pkg_postinst() { + use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + + if [[ -n ${REPLACING_VERSIONS} ]] ; then + ewarn "If your system is using 'pg_stat_statements' and you are running a" + ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" + ewarn "the following command after upgrading:" + ewarn + ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" + fi + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + + ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" + sleep 5 + eend 0 + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" + mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" + chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + # unix_socket_directory has no effect in postgresql.conf as it's + # overridden in the initscript + sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + if ! use systemd; then + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + fi + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + elif use systemd; then + einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" + einfo "instead of 'pg_ctl'." + else + einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + if use server && [[ ${UID} -ne 0 ]] ; then + # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set + # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. + local old_ctype=${LC_CTYPE} + export LC_CTYPE=${LC_COLLATE} + emake check + export LC_CTYPE=${old_ctype} + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9999.ebuild index cce0a2f8499a..92b4cf038a8d 100644 --- a/dev-db/postgresql/postgresql-9999.ebuild +++ b/dev-db/postgresql/postgresql-9999.ebuild @@ -1,12 +1,11 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -PYTHON_COMPAT=( python3_{8,9,10} ) +PYTHON_COMPAT=( python3_{8,9,10,11} ) -inherit flag-o-matic git-r3 linux-info multilib pam prefix python-single-r1 \ - systemd tmpfiles +inherit flag-o-matic git-r3 linux-info pam python-single-r1 systemd tmpfiles KEYWORDS="" -- cgit v1.2.3