1 |
commit: 92634e10850338c32fa7b3f7751fd83c3a22bee8 |
2 |
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 18 11:22:38 2022 +0000 |
4 |
Commit: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 18 11:22:38 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92634e10 |
7 |
|
8 |
dev-db/postgresql: Cleanup insecure |
9 |
|
10 |
Bug: https://bugs.gentoo.org/865255 |
11 |
|
12 |
Signed-off-by: Aaron W. Swenson <titanofold <AT> gentoo.org> |
13 |
|
14 |
dev-db/postgresql/Manifest | 16 - |
15 |
dev-db/postgresql/files/postgres-llvm14.patch | 154 ------- |
16 |
.../files/postgresql-13_beta1-no-server.patch | 149 ------- |
17 |
.../files/postgresql-14_rc1-no-server.patch | 151 ------- |
18 |
.../files/postgresql-9.6.3-no-server.patch | 141 ------- |
19 |
dev-db/postgresql/postgresql-10.19-r1.ebuild | 453 -------------------- |
20 |
dev-db/postgresql/postgresql-10.20-r1.ebuild | 453 -------------------- |
21 |
dev-db/postgresql/postgresql-10.21.ebuild | 453 -------------------- |
22 |
dev-db/postgresql/postgresql-11.14-r1.ebuild | 453 -------------------- |
23 |
dev-db/postgresql/postgresql-11.15-r1.ebuild | 453 -------------------- |
24 |
dev-db/postgresql/postgresql-11.16.ebuild | 453 -------------------- |
25 |
dev-db/postgresql/postgresql-12.10-r1.ebuild | 454 -------------------- |
26 |
dev-db/postgresql/postgresql-12.11.ebuild | 453 -------------------- |
27 |
dev-db/postgresql/postgresql-12.9-r1.ebuild | 454 -------------------- |
28 |
dev-db/postgresql/postgresql-13.5-r1.ebuild | 466 --------------------- |
29 |
dev-db/postgresql/postgresql-13.6-r2.ebuild | 466 --------------------- |
30 |
dev-db/postgresql/postgresql-13.7.ebuild | 465 -------------------- |
31 |
dev-db/postgresql/postgresql-14.1-r1.ebuild | 466 --------------------- |
32 |
dev-db/postgresql/postgresql-14.2-r1.ebuild | 463 -------------------- |
33 |
dev-db/postgresql/postgresql-14.4.ebuild | 462 -------------------- |
34 |
dev-db/postgresql/postgresql-15_beta2.ebuild | 464 -------------------- |
35 |
21 files changed, 7942 deletions(-) |
36 |
|
37 |
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest |
38 |
index 9728a27e7cda..856686626085 100644 |
39 |
--- a/dev-db/postgresql/Manifest |
40 |
+++ b/dev-db/postgresql/Manifest |
41 |
@@ -1,22 +1,6 @@ |
42 |
-DIST postgresql-10.19.tar.bz2 19261478 BLAKE2B 3ccd44d68980ddb0e394b811af20c213cf89eb8d4374d2c49c9cda5165f222ca849a2db4fe4d521991f15f9cc84ec35bafa91083b9625f2a6729159f490a94c9 SHA512 41b0f5026be7d563e41b54e9ea7199dd466a132d355be0b71a91d41f533d97fbf550eccf2a2ece3d60c5dab5921ebeea3ac4780c18c54b924df52d7423305a22 |
43 |
-DIST postgresql-10.20.tar.bz2 19371473 BLAKE2B 24ce3e3dda749375e999206307154e79bf15d20b3cd598ba0b78bf27976241d71e88e6fa4cd459b675bc9a9047e9315321b1535dbb41ed9e558858c2a7e9dd31 SHA512 44cfca541947d58c70593b767d3c2423f20cc6904f3d4cea8f63c1802ccbc569130c4a2a15f1af152285926f6a200e13d59c21584295dafd6f6e74bd38251428 |
44 |
-DIST postgresql-10.21.tar.bz2 19409454 BLAKE2B 5e43abaee8156b9eb99360efeb25ba268f93a60ac2c29044d9025c4faa8753d84cb3c0c8cbcd65eb9e0eb094ebf63e0cc1cbd0ef12c0a2faa360754e63ae106a SHA512 1053e15505c0448df491119c9aad1617889b66118628a2155e3ec87e6648b2071a0a54e10d8fbbe00161b2aa86d1a6194d932a8cf5808c626e7972d135bb05c5 |
45 |
DIST postgresql-10.22.tar.bz2 19455874 BLAKE2B 10a8a894ba6e649abcc68abfd829bd30bca04b6e90f987ae5771fe02474517254ea2b48c7c9f2a899309de7b84aeaf13bac025965a9cc44814727ba257a633d7 SHA512 2e1ea75be7696ffbbb947351a8e8e55aaf067f86ad318308499a6a58797f0bf86227ed33e257e261c5c71ebba2f73ba514ef195a2394b91414ce6a0c3ab62532 |
46 |
-DIST postgresql-11.14.tar.bz2 20172910 BLAKE2B a033752fc5fc593c96fe63a258b2cc0d4b896548a366e3fefa8afde1f96ab64aab97eb395b10ae10494709963ed924623279f76f66870c4faee435969400c1b7 SHA512 ab71461ee6fb4cdc5b4240f7ecd8af2497ce6780283fde2abf5951ffdb616bd0c8ed22b26fdfca402a346e663ff77c4d17f3284c9d700e6fd6795b2aec97c9be |
47 |
-DIST postgresql-11.15.tar.bz2 20245750 BLAKE2B f6a632606fe4b34b2a44df2c165ccfa6e890b85f4f6048994f781428bbd1de6888a24493fb5d0c231f3f34e6a4e94cfd23078a9afdaf5925d284b4854847d23f SHA512 1eba7bddee1edf034617102c1d61ad0aa1b58927dad63de1d054817966c4c9a1d7d3fa6f6896af3fe5a6880b09a6ec86be298256ee6ecc3705ff2654d3d00c74 |
48 |
-DIST postgresql-11.16.tar.bz2 20347100 BLAKE2B 240e86b68ff8833265f10802da2fb847d72e38ac9325fc56bb6864266b2ad98939170038ccdb7044ae16f9fd29e7a9e1d404456d8bc7d53430067d714b9bb563 SHA512 e1b6be0a97e60cdd95cd0ebc756b1de6abf2f33f41f6a80da3dff25483a30146fb6bf750ab787bb5bb4f2a04718946c7429e71f891cbd491001e9f9c2ea8e63c |
49 |
DIST postgresql-11.17.tar.bz2 20385599 BLAKE2B d145bc0f5e0f277be91bf46868c78c9ce5bb2eebbbd84fbdcdbb1ec115911d124a0a054df783739fb912eeae1322fb7eb58b7b1b8d40a8f81cffe2f24d3dda01 SHA512 35304279c06577eca134581490710db976edeac8cca169d3436fcdce8eebb18159459ea3b5ef403f6a8efe85542726f9960c4ca653da4619e081ce5869866032 |
50 |
-DIST postgresql-12.10.tar.bz2 20990621 BLAKE2B a7a56cf75944c558ae9bb9165dfb17b30cc5f7a865961e0a588677e4dd3e53d1fab15a212a21ec12f8e7b669a448d78efa0dfe985fd4902e16485a298c7adc62 SHA512 befedb14320aa033dc55bbb93bbbec4e67d9cfced63be0e4f631c7495a0fbc6fe280bd6d2fb941d7a2e6b2ac570b7f40d8db7f07a192a81bd9cd63c6c244a9c5 |
51 |
-DIST postgresql-12.11.tar.bz2 21086745 BLAKE2B 7062d334f3ef3b98f69e709f5de744324c7ce53ea516384902632a454a2ccadfd7bcc0c9ef4d51a685dd7a06e1fdccc292109294517831181c3db30bc2b7be91 SHA512 705e9e1ccf8202062cce61069b5ddb7db5f804dd0736c620640ce5622b9e42fdcbc1417771e77d51aa54beb4562a09b4307f2ff7dec135bd0e31f4941ca36ac8 |
52 |
DIST postgresql-12.12.tar.bz2 21089064 BLAKE2B 7285dcfc8ed6cf2dbbe29d894dbcef53fad18cbeddbfdb3a43893234a1ee75a9bf5d966968a0c481a8ab15bf8a37400bf6eb4b57a83359501b729e70398e3551 SHA512 eeff79279ac11db04fdddeb2c52ba1ec6b549223b862222540e1f659fbfc3617130699c22694b465bde46b1a4a665c01aef70b68b86d80e58a5657efd019407d |
53 |
-DIST postgresql-12.9.tar.bz2 20904260 BLAKE2B fc88d61d369569a3054b889848eaf1405a4f5137cd8c2cf27282115f70853dd4d5d8b4bf0a9fc60c63db936246a0a64077c9bfdb90685d4dfe375558e4519b2b SHA512 11697d8283f5df5a9c74c2406e94d1b6da6df8358ad48f3b773825aab98e8395f9fd4e3fc8b1e6ebad3743c3dadbda8b795d4fe84a447d7913223e136cf2b88f |
54 |
-DIST postgresql-13.5.tar.bz2 21186674 BLAKE2B 3e51d6d67bba09fb134cd71c48349674e0cacfaefee299620482c93f0b09edbfead578deb63083686ab691563b088fc0ea60a6281a0bcf9145689fb3ce1ec0f0 SHA512 c76effbca8ee63be48fa3aeb39c7038221848fe83ca2afc4e0904ba8c6a50b89aa2ad37080d4e3be75e9bdc2d6ca6dfefcda334ef55a5e1a8954bb955ce905e5 |
55 |
-DIST postgresql-13.6.tar.bz2 21257213 BLAKE2B f5ea95fd9ffc8846e0aaf5bac03b02afa71e62e796bbe40f68af727a2f3c74eddd98cb68427bcc13b87b6fa00a8e2a7b18dd7749318f0a4a32cfdbf9b0e0a873 SHA512 2852726a3031b8d469f1c38f3019af02fc5afe40ec27b22288a29acefd30c63a98806bce88a214d0c2f9177f547b0b5010ad64e70bcbe2c2f1d97a27ae1984f8 |
56 |
-DIST postgresql-13.7.tar.bz2 21364433 BLAKE2B 2d8a505f6de4eb31cae415529eeac750a60abafcf45e7fde29043597b385a8150fac55df659f8c2ad200822e8063d388ed606dff9108d4407f9e26b893fa62f4 SHA512 9254f21519c8d4e926f70082503bb5593c91064a3d2a4ea18ac503dfd9aa94751d6f01ce00fca9fec9b2b7af40caf8d0951b661dd8be4d6aa87c1e35b6fa7a41 |
57 |
DIST postgresql-13.8.tar.bz2 21397381 BLAKE2B eb076382027a175789652a6ae8579d9b9c8856918741e8058456d22f1ef89525cff5fafe863bf615f658bc94b740b00d1268825969e37a7cefed6b5c90f402c5 SHA512 3b39448b291342a5e9b610d410c222aeb85f8acf95632e73e138ae316133af3dadc795a6e706f6447f543cf10df3c786da4f1afa1d91489b50eb77e2d9ed5d84 |
58 |
-DIST postgresql-14.1.tar.bz2 21887101 BLAKE2B a496dfd513c52339d1b3cb72773f9611721fd7c5d2a702d6fd71f650a1d41c3d7bf6574eba23671c7f9f11718e007f51f9547949bdc3d7fe1ea2248ebfb8d70b SHA512 4a0bec157d5464bb9e5f5c0eb0efdede55526e03f6f4d660b87d161a47705eb152fa0878960b1581bce42a5ed28a1f457825ea54e8d22e34b5b8eb36473ceefd |
59 |
-DIST postgresql-14.2.tar.bz2 21964841 BLAKE2B 6460533a40064404f18642147b949cf7c85d036c45ede478fb9af8919895ee7b09dc78b89ed08a292226911f07cfc9e46d7f2d42e0aaea546c5e97a291d599b9 SHA512 19aeb6528605dbcf5df84048b2eed8f54b202576134d3fe3900bb8f073179c4258d2581acd745887e7e6fa86ebdb5f7b159ffaa0a645d601efee7c5f7730456b |
60 |
-DIST postgresql-14.4.tar.bz2 22094218 BLAKE2B 05b65083d826ed2f451b31b29b4b247dfd76b3d24ef05f6be128ee9e58d521d506a3ec4ae4839cbb74d8e217dfae81a95bd97894a778ef3c47b907b85b1fb25e SHA512 dd2f80248684e331d2ffb1e26cd2a285df1fb18710807a0c31aedabf917912ce9267f8ca26318e5371d916c6fe476f8a17886d82d3ff86a974e6f24c19a6aafb |
61 |
DIST postgresql-14.5.tar.bz2 22132996 BLAKE2B 6d303850ef1e8f9f5d66a53275fc814475646c762b9747a4f0401a472ebaf59be06d6e7c08e9c1c5ad5d3b9dbc3bb3c06d58bae137806e1a437c86bcc8cae501 SHA512 3051c5ab729f6a55952c6108098b022517398b1de64f7fefbdd6c806c7e2eb0637d00f3c98a6203c5bee654656528c4ff3530db5a69470e7888864c77900178a |
62 |
-DIST postgresql-15beta2.tar.bz2 23511057 BLAKE2B d1e6d8ce67998d4295587780c2cb75f33b930556e11fd95bbd4d828086f63faed6bbddbb809ebc1fddf0980c83c7cf51e3d37f110d7bb68959dab34f61b5b8c9 SHA512 139bf4f95e2bc8942666009c6680d2b61d8ea2898e9e7eb3a0afb118f0bf6acfac5f21676525cccd82e9ee5c43ad79e07e23a55333e1318426d8b9bc95a4f00d |
63 |
DIST postgresql-15beta3.tar.bz2 23585136 BLAKE2B cdea196fb62587800f7fceafcbbd781f5636323fc6b205a0e5e0081964f2d08fcb421d0d66f710150dba37f30c2b0e7f7b3119a9a83a0cc573104968b16fc043 SHA512 caf79b889ca1325bcbdce3bbbcb3a0707b8928c8bd7b97f594cfedaedc06826e829a561b2fde73210c1e2596a0201305fa350bb3f12c05783014fc0c8564298a |
64 |
|
65 |
diff --git a/dev-db/postgresql/files/postgres-llvm14.patch b/dev-db/postgresql/files/postgres-llvm14.patch |
66 |
deleted file mode 100644 |
67 |
index 2c7b91d75153..000000000000 |
68 |
--- a/dev-db/postgresql/files/postgres-llvm14.patch |
69 |
+++ /dev/null |
70 |
@@ -1,154 +0,0 @@ |
71 |
-From d9f7ad54e552262ee0090e88d5abd3e04fcdeac8 Mon Sep 17 00:00:00 2001 |
72 |
-From: Thomas Munro <tmunro@××××××××××.org> |
73 |
-Date: Wed, 16 Mar 2022 11:35:00 +1300 |
74 |
-Subject: [PATCH] Back-patch LLVM 14 API changes. |
75 |
- |
76 |
-Since LLVM 14 has stopped changing and is about to be released, |
77 |
-back-patch the following changes from the master branch: |
78 |
- |
79 |
- e6a7600202105919bffd62b3dfd941f4a94e082b |
80 |
- 807fee1a39de6bb8184082012e643951abb9ad1d |
81 |
- a56e7b66010f330782243de9e25ac2a6596be0e1 |
82 |
- |
83 |
-Back-patch to 11, where LLVM JIT support came in. |
84 |
---- |
85 |
- src/backend/jit/llvm/Makefile | 6 +++++ |
86 |
- src/backend/jit/llvm/llvmjit_error.cpp | 35 +++++++++++++++++++++---- |
87 |
- src/backend/jit/llvm/llvmjit_inline.cpp | 12 ++++++++- |
88 |
- 3 files changed, 47 insertions(+), 6 deletions(-) |
89 |
- |
90 |
-diff --git a/src/backend/jit/llvm/Makefile b/src/backend/jit/llvm/Makefile |
91 |
-index 0268bd46d5..2da122a391 100644 |
92 |
---- a/src/backend/jit/llvm/Makefile |
93 |
-+++ b/src/backend/jit/llvm/Makefile |
94 |
-@@ -22,6 +22,12 @@ endif |
95 |
- PGFILEDESC = "llvmjit - JIT using LLVM" |
96 |
- NAME = llvmjit |
97 |
- |
98 |
-+# LLVM 14 produces deprecation warnings. We'll need to make some changes |
99 |
-+# before the relevant functions are removed, but for now silence the warnings. |
100 |
-+ifeq ($(GCC), yes) |
101 |
-+LLVM_CFLAGS += -Wno-deprecated-declarations |
102 |
-+endif |
103 |
-+ |
104 |
- # All files in this directory use LLVM. |
105 |
- CFLAGS += $(LLVM_CFLAGS) |
106 |
- CXXFLAGS += $(LLVM_CXXFLAGS) |
107 |
-diff --git a/src/backend/jit/llvm/llvmjit_error.cpp b/src/backend/jit/llvm/llvmjit_error.cpp |
108 |
-index f4720732a3..5ad92f3090 100644 |
109 |
---- a/src/backend/jit/llvm/llvmjit_error.cpp |
110 |
-+++ b/src/backend/jit/llvm/llvmjit_error.cpp |
111 |
-@@ -23,15 +23,22 @@ extern "C" |
112 |
- |
113 |
- #include "jit/llvmjit.h" |
114 |
- |
115 |
-+#include <new> |
116 |
- |
117 |
- static int fatal_new_handler_depth = 0; |
118 |
- static std::new_handler old_new_handler = NULL; |
119 |
- |
120 |
- static void fatal_system_new_handler(void); |
121 |
- #if LLVM_VERSION_MAJOR > 4 |
122 |
-+static void fatal_llvm_new_handler(void *user_data, const char *reason, bool gen_crash_diag); |
123 |
-+#if LLVM_VERSION_MAJOR < 14 |
124 |
- static void fatal_llvm_new_handler(void *user_data, const std::string& reason, bool gen_crash_diag); |
125 |
- #endif |
126 |
-+#endif |
127 |
-+static void fatal_llvm_error_handler(void *user_data, const char *reason, bool gen_crash_diag); |
128 |
-+#if LLVM_VERSION_MAJOR < 14 |
129 |
- static void fatal_llvm_error_handler(void *user_data, const std::string& reason, bool gen_crash_diag); |
130 |
-+#endif |
131 |
- |
132 |
- |
133 |
- /* |
134 |
-@@ -129,23 +136,41 @@ fatal_system_new_handler(void) |
135 |
- #if LLVM_VERSION_MAJOR > 4 |
136 |
- static void |
137 |
- fatal_llvm_new_handler(void *user_data, |
138 |
-- const std::string& reason, |
139 |
-+ const char *reason, |
140 |
- bool gen_crash_diag) |
141 |
- { |
142 |
- ereport(FATAL, |
143 |
- (errcode(ERRCODE_OUT_OF_MEMORY), |
144 |
- errmsg("out of memory"), |
145 |
-- errdetail("While in LLVM: %s", reason.c_str()))); |
146 |
-+ errdetail("While in LLVM: %s", reason))); |
147 |
-+} |
148 |
-+#if LLVM_VERSION_MAJOR < 14 |
149 |
-+static void |
150 |
-+fatal_llvm_new_handler(void *user_data, |
151 |
-+ const std::string& reason, |
152 |
-+ bool gen_crash_diag) |
153 |
-+{ |
154 |
-+ fatal_llvm_new_handler(user_data, reason.c_str(), gen_crash_diag); |
155 |
- } |
156 |
- #endif |
157 |
-+#endif |
158 |
- |
159 |
- static void |
160 |
- fatal_llvm_error_handler(void *user_data, |
161 |
-- const std::string& reason, |
162 |
-+ const char *reason, |
163 |
- bool gen_crash_diag) |
164 |
- { |
165 |
- ereport(FATAL, |
166 |
- (errcode(ERRCODE_OUT_OF_MEMORY), |
167 |
-- errmsg("fatal llvm error: %s", |
168 |
-- reason.c_str()))); |
169 |
-+ errmsg("fatal llvm error: %s", reason))); |
170 |
- } |
171 |
-+ |
172 |
-+#if LLVM_VERSION_MAJOR < 14 |
173 |
-+static void |
174 |
-+fatal_llvm_error_handler(void *user_data, |
175 |
-+ const std::string& reason, |
176 |
-+ bool gen_crash_diag) |
177 |
-+{ |
178 |
-+ fatal_llvm_error_handler(user_data, reason.c_str(), gen_crash_diag); |
179 |
-+} |
180 |
-+#endif |
181 |
-diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp |
182 |
-index 6f03595db5..9bb4b672a7 100644 |
183 |
---- a/src/backend/jit/llvm/llvmjit_inline.cpp |
184 |
-+++ b/src/backend/jit/llvm/llvmjit_inline.cpp |
185 |
-@@ -594,7 +594,11 @@ function_inlinable(llvm::Function &F, |
186 |
- if (F.materialize()) |
187 |
- elog(FATAL, "failed to materialize metadata"); |
188 |
- |
189 |
-- if (F.getAttributes().hasFnAttribute(llvm::Attribute::NoInline)) |
190 |
-+#if LLVM_VERSION_MAJOR < 14 |
191 |
-+#define hasFnAttr hasFnAttribute |
192 |
-+#endif |
193 |
-+ |
194 |
-+ if (F.getAttributes().hasFnAttr(llvm::Attribute::NoInline)) |
195 |
- { |
196 |
- ilog(DEBUG1, "ineligibile to import %s due to noinline", |
197 |
- F.getName().data()); |
198 |
-@@ -871,7 +875,9 @@ create_redirection_function(std::unique_ptr<llvm::Module> &importMod, |
199 |
- llvm::Function *AF; |
200 |
- llvm::BasicBlock *BB; |
201 |
- llvm::CallInst *fwdcall; |
202 |
-+#if LLVM_VERSION_MAJOR < 14 |
203 |
- llvm::Attribute inlineAttribute; |
204 |
-+#endif |
205 |
- |
206 |
- AF = llvm::Function::Create(F->getFunctionType(), |
207 |
- LinkageTypes::AvailableExternallyLinkage, |
208 |
-@@ -880,9 +886,13 @@ create_redirection_function(std::unique_ptr<llvm::Module> &importMod, |
209 |
- |
210 |
- Builder.SetInsertPoint(BB); |
211 |
- fwdcall = Builder.CreateCall(F, &*AF->arg_begin()); |
212 |
-+#if LLVM_VERSION_MAJOR < 14 |
213 |
- inlineAttribute = llvm::Attribute::get(Context, |
214 |
- llvm::Attribute::AlwaysInline); |
215 |
- fwdcall->addAttribute(~0U, inlineAttribute); |
216 |
-+#else |
217 |
-+ fwdcall->addFnAttr(llvm::Attribute::AlwaysInline); |
218 |
-+#endif |
219 |
- Builder.CreateRet(fwdcall); |
220 |
- |
221 |
- return AF; |
222 |
--- |
223 |
-2.30.2 |
224 |
- |
225 |
|
226 |
diff --git a/dev-db/postgresql/files/postgresql-13_beta1-no-server.patch b/dev-db/postgresql/files/postgresql-13_beta1-no-server.patch |
227 |
deleted file mode 100644 |
228 |
index ceb0e3a61d25..000000000000 |
229 |
--- a/dev-db/postgresql/files/postgresql-13_beta1-no-server.patch |
230 |
+++ /dev/null |
231 |
@@ -1,149 +0,0 @@ |
232 |
-diff -Naruw postgresql-13beta1.orig/contrib/Makefile postgresql-13beta1/contrib/Makefile |
233 |
---- postgresql-13beta1.orig/contrib/Makefile 2020-05-18 16:09:19.000000000 -0400 |
234 |
-+++ postgresql-13beta1/contrib/Makefile 2020-05-22 19:56:42.560113731 -0400 |
235 |
-@@ -5,56 +5,9 @@ |
236 |
- include $(top_builddir)/src/Makefile.global |
237 |
- |
238 |
- SUBDIRS = \ |
239 |
-- adminpack \ |
240 |
-- amcheck \ |
241 |
-- auth_delay \ |
242 |
-- auto_explain \ |
243 |
-- bloom \ |
244 |
-- btree_gin \ |
245 |
-- btree_gist \ |
246 |
-- citext \ |
247 |
-- cube \ |
248 |
-- dblink \ |
249 |
-- dict_int \ |
250 |
-- dict_xsyn \ |
251 |
-- earthdistance \ |
252 |
-- file_fdw \ |
253 |
-- fuzzystrmatch \ |
254 |
-- hstore \ |
255 |
-- intagg \ |
256 |
-- intarray \ |
257 |
-- isn \ |
258 |
-- lo \ |
259 |
-- ltree \ |
260 |
- oid2name \ |
261 |
-- pageinspect \ |
262 |
-- passwordcheck \ |
263 |
-- pg_buffercache \ |
264 |
-- pg_freespacemap \ |
265 |
-- pg_prewarm \ |
266 |
-- pg_standby \ |
267 |
-- pg_stat_statements \ |
268 |
-- pg_trgm \ |
269 |
-- pgcrypto \ |
270 |
-- pgrowlocks \ |
271 |
-- pgstattuple \ |
272 |
-- pg_visibility \ |
273 |
-- postgres_fdw \ |
274 |
-- seg \ |
275 |
-- spi \ |
276 |
-- tablefunc \ |
277 |
-- tcn \ |
278 |
-- test_decoding \ |
279 |
-- tsm_system_rows \ |
280 |
-- tsm_system_time \ |
281 |
-- unaccent \ |
282 |
- vacuumlo |
283 |
- |
284 |
--ifeq ($(with_openssl),yes) |
285 |
--SUBDIRS += sslinfo |
286 |
--else |
287 |
--ALWAYS_SUBDIRS += sslinfo |
288 |
--endif |
289 |
- |
290 |
- ifneq ($(with_uuid),no) |
291 |
- SUBDIRS += uuid-ossp |
292 |
-diff -Naruw postgresql-13beta1.orig/src/backend/Makefile postgresql-13beta1/src/backend/Makefile |
293 |
---- postgresql-13beta1.orig/src/backend/Makefile 2020-05-18 16:09:19.000000000 -0400 |
294 |
-+++ postgresql-13beta1/src/backend/Makefile 2020-05-22 19:58:14.403299909 -0400 |
295 |
-@@ -56,7 +56,7 @@ |
296 |
- |
297 |
- ########################################################################## |
298 |
- |
299 |
--all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP) |
300 |
-+all: generated-headers |
301 |
- |
302 |
- ifneq ($(PORTNAME), cygwin) |
303 |
- ifneq ($(PORTNAME), win32) |
304 |
-@@ -195,23 +195,7 @@ |
305 |
- |
306 |
- ########################################################################## |
307 |
- |
308 |
--install: all installdirs install-bin |
309 |
--ifeq ($(PORTNAME), cygwin) |
310 |
--ifeq ($(MAKE_DLL), true) |
311 |
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
312 |
--endif |
313 |
--endif |
314 |
--ifeq ($(PORTNAME), win32) |
315 |
--ifeq ($(MAKE_DLL), true) |
316 |
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
317 |
--endif |
318 |
--endif |
319 |
-- $(MAKE) -C catalog install-data |
320 |
-- $(MAKE) -C tsearch install-data |
321 |
-- $(MAKE) -C utils install-data |
322 |
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' |
323 |
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' |
324 |
-- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' |
325 |
-+install: |
326 |
- |
327 |
- ifeq ($(with_llvm), yes) |
328 |
- install-bin: install-postgres-bitcode |
329 |
-diff -Naruw postgresql-13beta1.orig/src/bin/Makefile postgresql-13beta1/src/bin/Makefile |
330 |
---- postgresql-13beta1.orig/src/bin/Makefile 2020-05-18 16:09:19.000000000 -0400 |
331 |
-+++ postgresql-13beta1/src/bin/Makefile 2020-05-22 19:59:11.399875256 -0400 |
332 |
-@@ -14,22 +14,8 @@ |
333 |
- include $(top_builddir)/src/Makefile.global |
334 |
- |
335 |
- SUBDIRS = \ |
336 |
-- initdb \ |
337 |
-- pg_archivecleanup \ |
338 |
-- pg_basebackup \ |
339 |
-- pg_checksums \ |
340 |
- pg_config \ |
341 |
-- pg_controldata \ |
342 |
-- pg_ctl \ |
343 |
- pg_dump \ |
344 |
-- pg_resetwal \ |
345 |
-- pg_rewind \ |
346 |
-- pg_test_fsync \ |
347 |
-- pg_test_timing \ |
348 |
-- pg_upgrade \ |
349 |
-- pg_verifybackup \ |
350 |
-- pg_waldump \ |
351 |
-- pgbench \ |
352 |
- psql \ |
353 |
- scripts |
354 |
- |
355 |
-diff -Naruw postgresql-13beta1.orig/src/Makefile postgresql-13beta1/src/Makefile |
356 |
---- postgresql-13beta1.orig/src/Makefile 2020-05-18 16:09:19.000000000 -0400 |
357 |
-+++ postgresql-13beta1/src/Makefile 2020-05-22 19:59:59.656464613 -0400 |
358 |
-@@ -15,21 +15,12 @@ |
359 |
- SUBDIRS = \ |
360 |
- common \ |
361 |
- port \ |
362 |
-- timezone \ |
363 |
- backend \ |
364 |
-- backend/utils/mb/conversion_procs \ |
365 |
-- backend/snowball \ |
366 |
- include \ |
367 |
- interfaces \ |
368 |
-- backend/replication/libpqwalreceiver \ |
369 |
-- backend/replication/pgoutput \ |
370 |
- fe_utils \ |
371 |
- bin \ |
372 |
-- pl \ |
373 |
-- makefiles \ |
374 |
-- test/regress \ |
375 |
-- test/isolation \ |
376 |
-- test/perl |
377 |
-+ makefiles |
378 |
- |
379 |
- ifeq ($(with_llvm), yes) |
380 |
- SUBDIRS += backend/jit/llvm |
381 |
|
382 |
diff --git a/dev-db/postgresql/files/postgresql-14_rc1-no-server.patch b/dev-db/postgresql/files/postgresql-14_rc1-no-server.patch |
383 |
deleted file mode 100644 |
384 |
index 4f2d388386a2..000000000000 |
385 |
--- a/dev-db/postgresql/files/postgresql-14_rc1-no-server.patch |
386 |
+++ /dev/null |
387 |
@@ -1,151 +0,0 @@ |
388 |
-diff -Naruw a/contrib/Makefile b/contrib/Makefile |
389 |
---- a/contrib/Makefile 2021-09-20 17:33:01.000000000 -0400 |
390 |
-+++ b/contrib/Makefile 2021-09-23 16:28:52.919265033 -0400 |
391 |
-@@ -5,57 +5,9 @@ |
392 |
- include $(top_builddir)/src/Makefile.global |
393 |
- |
394 |
- SUBDIRS = \ |
395 |
-- adminpack \ |
396 |
-- amcheck \ |
397 |
-- auth_delay \ |
398 |
-- auto_explain \ |
399 |
-- bloom \ |
400 |
-- btree_gin \ |
401 |
-- btree_gist \ |
402 |
-- citext \ |
403 |
-- cube \ |
404 |
-- dblink \ |
405 |
-- dict_int \ |
406 |
-- dict_xsyn \ |
407 |
-- earthdistance \ |
408 |
-- file_fdw \ |
409 |
-- fuzzystrmatch \ |
410 |
-- hstore \ |
411 |
-- intagg \ |
412 |
-- intarray \ |
413 |
-- isn \ |
414 |
-- lo \ |
415 |
-- ltree \ |
416 |
- oid2name \ |
417 |
-- old_snapshot \ |
418 |
-- pageinspect \ |
419 |
-- passwordcheck \ |
420 |
-- pg_buffercache \ |
421 |
-- pg_freespacemap \ |
422 |
-- pg_prewarm \ |
423 |
-- pg_stat_statements \ |
424 |
-- pg_surgery \ |
425 |
-- pg_trgm \ |
426 |
-- pgcrypto \ |
427 |
-- pgrowlocks \ |
428 |
-- pgstattuple \ |
429 |
-- pg_visibility \ |
430 |
-- postgres_fdw \ |
431 |
-- seg \ |
432 |
-- spi \ |
433 |
-- tablefunc \ |
434 |
-- tcn \ |
435 |
-- test_decoding \ |
436 |
-- tsm_system_rows \ |
437 |
-- tsm_system_time \ |
438 |
-- unaccent \ |
439 |
- vacuumlo |
440 |
- |
441 |
--ifeq ($(with_ssl),openssl) |
442 |
--SUBDIRS += sslinfo |
443 |
--else |
444 |
--ALWAYS_SUBDIRS += sslinfo |
445 |
--endif |
446 |
- |
447 |
- ifneq ($(with_uuid),no) |
448 |
- SUBDIRS += uuid-ossp |
449 |
-diff -Naruw a/src/backend/Makefile b/src/backend/Makefile |
450 |
---- a/src/backend/Makefile 2021-09-20 17:33:01.000000000 -0400 |
451 |
-+++ b/src/backend/Makefile 2021-09-23 16:30:03.015728022 -0400 |
452 |
-@@ -56,7 +56,7 @@ |
453 |
- |
454 |
- ########################################################################## |
455 |
- |
456 |
--all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP) |
457 |
-+all: generated-headers |
458 |
- |
459 |
- ifneq ($(PORTNAME), cygwin) |
460 |
- ifneq ($(PORTNAME), win32) |
461 |
-@@ -194,23 +194,7 @@ |
462 |
- |
463 |
- ########################################################################## |
464 |
- |
465 |
--install: all installdirs install-bin |
466 |
--ifeq ($(PORTNAME), cygwin) |
467 |
--ifeq ($(MAKE_DLL), true) |
468 |
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
469 |
--endif |
470 |
--endif |
471 |
--ifeq ($(PORTNAME), win32) |
472 |
--ifeq ($(MAKE_DLL), true) |
473 |
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
474 |
--endif |
475 |
--endif |
476 |
-- $(MAKE) -C catalog install-data |
477 |
-- $(MAKE) -C tsearch install-data |
478 |
-- $(MAKE) -C utils install-data |
479 |
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' |
480 |
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' |
481 |
-- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' |
482 |
-+install: |
483 |
- |
484 |
- ifeq ($(with_llvm), yes) |
485 |
- install-bin: install-postgres-bitcode |
486 |
-diff -Naruw a/src/bin/Makefile b/src/bin/Makefile |
487 |
---- a/src/bin/Makefile 2021-09-20 17:33:01.000000000 -0400 |
488 |
-+++ b/src/bin/Makefile 2021-09-23 16:30:50.718922745 -0400 |
489 |
-@@ -14,23 +14,8 @@ |
490 |
- include $(top_builddir)/src/Makefile.global |
491 |
- |
492 |
- SUBDIRS = \ |
493 |
-- initdb \ |
494 |
-- pg_amcheck \ |
495 |
-- pg_archivecleanup \ |
496 |
-- pg_basebackup \ |
497 |
-- pg_checksums \ |
498 |
- pg_config \ |
499 |
-- pg_controldata \ |
500 |
-- pg_ctl \ |
501 |
- pg_dump \ |
502 |
-- pg_resetwal \ |
503 |
-- pg_rewind \ |
504 |
-- pg_test_fsync \ |
505 |
-- pg_test_timing \ |
506 |
-- pg_upgrade \ |
507 |
-- pg_verifybackup \ |
508 |
-- pg_waldump \ |
509 |
-- pgbench \ |
510 |
- psql \ |
511 |
- scripts |
512 |
- |
513 |
-diff -Naruw a/src/Makefile b/src/Makefile |
514 |
---- a/src/Makefile 2021-09-20 17:33:01.000000000 -0400 |
515 |
-+++ b/src/Makefile 2021-09-23 16:31:41.842107531 -0400 |
516 |
-@@ -15,21 +15,12 @@ |
517 |
- SUBDIRS = \ |
518 |
- common \ |
519 |
- port \ |
520 |
-- timezone \ |
521 |
- backend \ |
522 |
-- backend/utils/mb/conversion_procs \ |
523 |
-- backend/snowball \ |
524 |
- include \ |
525 |
- interfaces \ |
526 |
-- backend/replication/libpqwalreceiver \ |
527 |
-- backend/replication/pgoutput \ |
528 |
- fe_utils \ |
529 |
- bin \ |
530 |
-- pl \ |
531 |
-- makefiles \ |
532 |
-- test/regress \ |
533 |
-- test/isolation \ |
534 |
-- test/perl |
535 |
-+ makefiles |
536 |
- |
537 |
- ifeq ($(with_llvm), yes) |
538 |
- SUBDIRS += backend/jit/llvm |
539 |
|
540 |
diff --git a/dev-db/postgresql/files/postgresql-9.6.3-no-server.patch b/dev-db/postgresql/files/postgresql-9.6.3-no-server.patch |
541 |
deleted file mode 100644 |
542 |
index aa7cf773a39a..000000000000 |
543 |
--- a/dev-db/postgresql/files/postgresql-9.6.3-no-server.patch |
544 |
+++ /dev/null |
545 |
@@ -1,141 +0,0 @@ |
546 |
---- a/contrib/Makefile |
547 |
-+++ b/contrib/Makefile |
548 |
-@@ -5,57 +5,9 @@ |
549 |
- include $(top_builddir)/src/Makefile.global |
550 |
- |
551 |
- SUBDIRS = \ |
552 |
-- adminpack \ |
553 |
-- auth_delay \ |
554 |
-- auto_explain \ |
555 |
-- bloom \ |
556 |
-- btree_gin \ |
557 |
-- btree_gist \ |
558 |
-- chkpass \ |
559 |
-- citext \ |
560 |
-- cube \ |
561 |
-- dblink \ |
562 |
-- dict_int \ |
563 |
-- dict_xsyn \ |
564 |
-- earthdistance \ |
565 |
-- file_fdw \ |
566 |
-- fuzzystrmatch \ |
567 |
-- hstore \ |
568 |
-- intagg \ |
569 |
-- intarray \ |
570 |
-- isn \ |
571 |
-- lo \ |
572 |
-- ltree \ |
573 |
- oid2name \ |
574 |
-- pageinspect \ |
575 |
-- passwordcheck \ |
576 |
-- pg_buffercache \ |
577 |
-- pg_freespacemap \ |
578 |
-- pg_prewarm \ |
579 |
-- pg_standby \ |
580 |
-- pg_stat_statements \ |
581 |
-- pg_trgm \ |
582 |
-- pgcrypto \ |
583 |
-- pgrowlocks \ |
584 |
-- pgstattuple \ |
585 |
-- pg_visibility \ |
586 |
-- postgres_fdw \ |
587 |
-- seg \ |
588 |
-- spi \ |
589 |
-- tablefunc \ |
590 |
-- tcn \ |
591 |
-- test_decoding \ |
592 |
-- tsm_system_rows \ |
593 |
-- tsm_system_time \ |
594 |
-- tsearch2 \ |
595 |
-- unaccent \ |
596 |
- vacuumlo |
597 |
- |
598 |
--ifeq ($(with_openssl),yes) |
599 |
--SUBDIRS += sslinfo |
600 |
--else |
601 |
--ALWAYS_SUBDIRS += sslinfo |
602 |
--endif |
603 |
- |
604 |
- ifneq ($(with_uuid),no) |
605 |
- SUBDIRS += uuid-ossp |
606 |
---- a/src/backend/Makefile |
607 |
-+++ b/src/backend/Makefile |
608 |
-@@ -51,7 +51,7 @@ |
609 |
- |
610 |
- ########################################################################## |
611 |
- |
612 |
--all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP) |
613 |
-+all: generated-headers |
614 |
- |
615 |
- ifneq ($(PORTNAME), cygwin) |
616 |
- ifneq ($(PORTNAME), win32) |
617 |
-@@ -218,23 +218,7 @@ |
618 |
- |
619 |
- ########################################################################## |
620 |
- |
621 |
--install: all installdirs install-bin |
622 |
--ifeq ($(PORTNAME), cygwin) |
623 |
--ifeq ($(MAKE_DLL), true) |
624 |
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
625 |
--endif |
626 |
--endif |
627 |
--ifeq ($(PORTNAME), win32) |
628 |
--ifeq ($(MAKE_DLL), true) |
629 |
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
630 |
--endif |
631 |
--endif |
632 |
-- $(MAKE) -C catalog install-data |
633 |
-- $(MAKE) -C tsearch install-data |
634 |
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' |
635 |
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' |
636 |
-- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' |
637 |
-- $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample' |
638 |
-+install: |
639 |
- |
640 |
- install-bin: postgres $(POSTGRES_IMP) installdirs |
641 |
- $(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)' |
642 |
---- a/src/bin/Makefile |
643 |
-+++ b/src/bin/Makefile |
644 |
-@@ -14,19 +14,8 @@ |
645 |
- include $(top_builddir)/src/Makefile.global |
646 |
- |
647 |
- SUBDIRS = \ |
648 |
-- initdb \ |
649 |
-- pg_archivecleanup \ |
650 |
-- pg_basebackup \ |
651 |
- pg_config \ |
652 |
-- pg_controldata \ |
653 |
-- pg_ctl \ |
654 |
- pg_dump \ |
655 |
-- pg_resetxlog \ |
656 |
-- pg_rewind \ |
657 |
-- pg_test_fsync \ |
658 |
-- pg_test_timing \ |
659 |
-- pg_upgrade \ |
660 |
-- pg_xlogdump \ |
661 |
- pgbench \ |
662 |
- psql \ |
663 |
- scripts |
664 |
---- a/src/Makefile |
665 |
-+++ b/src/Makefile |
666 |
-@@ -15,19 +15,12 @@ |
667 |
- SUBDIRS = \ |
668 |
- common \ |
669 |
- port \ |
670 |
-- timezone \ |
671 |
- backend \ |
672 |
-- backend/utils/mb/conversion_procs \ |
673 |
-- backend/snowball \ |
674 |
- include \ |
675 |
- interfaces \ |
676 |
-- backend/replication/libpqwalreceiver \ |
677 |
- fe_utils \ |
678 |
- bin \ |
679 |
-- pl \ |
680 |
-- makefiles \ |
681 |
-- test/regress \ |
682 |
-- test/perl |
683 |
-+ makefiles |
684 |
- |
685 |
- # There are too many interdependencies between the subdirectories, so |
686 |
- # don't attempt parallel make here. |
687 |
|
688 |
diff --git a/dev-db/postgresql/postgresql-10.19-r1.ebuild b/dev-db/postgresql/postgresql-10.19-r1.ebuild |
689 |
deleted file mode 100644 |
690 |
index 2bab39336a23..000000000000 |
691 |
--- a/dev-db/postgresql/postgresql-10.19-r1.ebuild |
692 |
+++ /dev/null |
693 |
@@ -1,453 +0,0 @@ |
694 |
-# Copyright 1999-2022 Gentoo Authors |
695 |
-# Distributed under the terms of the GNU General Public License v2 |
696 |
- |
697 |
-EAPI=7 |
698 |
- |
699 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
700 |
- |
701 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd tmpfiles |
702 |
- |
703 |
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris" |
704 |
- |
705 |
-SLOT=$(ver_cut 1) |
706 |
- |
707 |
-MY_PV=${PV/_/} |
708 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
709 |
- |
710 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
711 |
- |
712 |
-LICENSE="POSTGRESQL GPL-2" |
713 |
-DESCRIPTION="PostgreSQL RDBMS" |
714 |
-HOMEPAGE="https://www.postgresql.org/" |
715 |
- |
716 |
-IUSE="debug doc icu kerberos ldap nls pam perl |
717 |
- python +readline selinux +server systemd ssl static-libs tcl |
718 |
- threads uuid xml zlib" |
719 |
- |
720 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
721 |
- |
722 |
-CDEPEND=" |
723 |
->=app-eselect/eselect-postgresql-2.0 |
724 |
-acct-group/postgres |
725 |
-acct-user/postgres |
726 |
-sys-apps/less |
727 |
-virtual/libcrypt:= |
728 |
-virtual/libintl |
729 |
-icu? ( dev-libs/icu:= ) |
730 |
-kerberos? ( virtual/krb5 ) |
731 |
-ldap? ( net-nds/openldap:= ) |
732 |
-pam? ( sys-libs/pam ) |
733 |
-perl? ( >=dev-lang/perl-5.8:= ) |
734 |
-python? ( ${PYTHON_DEPS} ) |
735 |
-readline? ( sys-libs/readline:0= ) |
736 |
-server? ( systemd? ( sys-apps/systemd ) ) |
737 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
738 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
739 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
740 |
-zlib? ( sys-libs/zlib ) |
741 |
-" |
742 |
- |
743 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
744 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
745 |
-# the libc includes UUID functions. |
746 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
747 |
- |
748 |
-nest_usedep() { |
749 |
- local front back |
750 |
- while [[ ${#} -gt 1 ]]; do |
751 |
- front+="${1}? ( " |
752 |
- back+=" )" |
753 |
- shift |
754 |
- done |
755 |
- echo "${front}${1}${back}" |
756 |
-} |
757 |
- |
758 |
-CDEPEND+=" |
759 |
-uuid? ( |
760 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
761 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
762 |
-)" |
763 |
- |
764 |
-DEPEND="${CDEPEND} |
765 |
-sys-devel/bison |
766 |
-sys-devel/flex |
767 |
-nls? ( sys-devel/gettext ) |
768 |
-xml? ( virtual/pkgconfig ) |
769 |
-" |
770 |
- |
771 |
-RDEPEND="${CDEPEND} |
772 |
-selinux? ( sec-policy/selinux-postgresql ) |
773 |
-" |
774 |
- |
775 |
-pkg_setup() { |
776 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
777 |
- |
778 |
- use python && python-single-r1_pkg_setup |
779 |
-} |
780 |
- |
781 |
-src_prepare() { |
782 |
- # Work around PPC{,64} compilation bug where bool is already defined |
783 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
784 |
- |
785 |
- # Set proper run directory |
786 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
787 |
- -i src/include/pg_config_manual.h || die |
788 |
- |
789 |
- # Rely on $PATH being in the proper order so that the correct |
790 |
- # install program is used for modules utilizing PGXS in both |
791 |
- # hardened and non-hardened environments. (Bug #528786) |
792 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
793 |
- |
794 |
- use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch" |
795 |
- |
796 |
- if use pam ; then |
797 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
798 |
- -i src/backend/libpq/auth.c || \ |
799 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
800 |
- fi |
801 |
- |
802 |
- # https://bugs.gentoo.org/753257 |
803 |
- # https://bugs.gentoo.org/766225 |
804 |
- eapply "${FILESDIR}"/postgresql-10.0-icu68.patch |
805 |
- |
806 |
- eapply_user |
807 |
-} |
808 |
- |
809 |
-src_configure() { |
810 |
- case ${CHOST} in |
811 |
- *-darwin*|*-solaris*) |
812 |
- use nls && append-libs intl |
813 |
- ;; |
814 |
- esac |
815 |
- |
816 |
- export LDFLAGS_SL="${LDFLAGS}" |
817 |
- export LDFLAGS_EX="${LDFLAGS}" |
818 |
- |
819 |
- local PO="${EPREFIX}" |
820 |
- |
821 |
- local i uuid_config="" |
822 |
- if use uuid; then |
823 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
824 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
825 |
- done |
826 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
827 |
- fi |
828 |
- |
829 |
- econf \ |
830 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
831 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
832 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
833 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
834 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
835 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
836 |
- $(use_enable !alpha spinlocks) \ |
837 |
- $(use_enable debug) \ |
838 |
- $(use_enable threads thread-safety) \ |
839 |
- $(use_with icu) \ |
840 |
- $(use_with kerberos gssapi) \ |
841 |
- $(use_with ldap) \ |
842 |
- $(use_with pam) \ |
843 |
- $(use_with perl) \ |
844 |
- $(use_with python) \ |
845 |
- $(use_with readline) \ |
846 |
- $(use_with ssl openssl) \ |
847 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
848 |
- $(use_with tcl) \ |
849 |
- ${uuid_config} \ |
850 |
- $(use_with xml libxml) \ |
851 |
- $(use_with xml libxslt) \ |
852 |
- $(use_with zlib) \ |
853 |
- $(use_enable nls) |
854 |
-} |
855 |
- |
856 |
-src_compile() { |
857 |
- emake |
858 |
- emake -C contrib |
859 |
-} |
860 |
- |
861 |
-src_install() { |
862 |
- emake DESTDIR="${D}" install |
863 |
- emake DESTDIR="${D}" install -C contrib |
864 |
- |
865 |
- dodoc README HISTORY doc/{TODO,bug.template} |
866 |
- |
867 |
- # man pages are already built, but if we have the target make them, |
868 |
- # they'll be generated from source before being installed so we |
869 |
- # manually install man pages. |
870 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
871 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
872 |
- doins -r doc/src/sgml/man{1,3,7} |
873 |
- if ! use server; then |
874 |
- # Remove man pages for non-existent binaries |
875 |
- serverman=( |
876 |
- initdb |
877 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
878 |
- pg_{test_{fsync,timing},upgrade,waldump} |
879 |
- post{gres,master} |
880 |
- ) |
881 |
- for m in ${serverman[@]} ; do |
882 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
883 |
- done |
884 |
- fi |
885 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
886 |
- |
887 |
- # Create slot specific man pages |
888 |
- local bn f mansec slotted_name |
889 |
- for mansec in 1 3 7 ; do |
890 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
891 |
- |
892 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
893 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
894 |
- |
895 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
896 |
- bn=$(basename "${f}") |
897 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
898 |
- case ${bn} in |
899 |
- TABLE.7|WITH.7) |
900 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
901 |
- ;; |
902 |
- *) |
903 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
904 |
- ;; |
905 |
- esac |
906 |
- done |
907 |
- |
908 |
- popd > /dev/null |
909 |
- done |
910 |
- |
911 |
- insinto /etc/postgresql-${SLOT} |
912 |
- newins src/bin/psql/psqlrc.sample psqlrc |
913 |
- |
914 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
915 |
- # needed by extensions utilizing PGXS. |
916 |
- use static-libs || \ |
917 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
918 |
- -delete |
919 |
- |
920 |
- # Make slot specific links to programs |
921 |
- local f bn |
922 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
923 |
- -mindepth 1 -maxdepth 1) |
924 |
- do |
925 |
- bn=$(basename "${f}") |
926 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
927 |
- "/usr/bin/${bn}${SLOT/.}" |
928 |
- done |
929 |
- |
930 |
- if use doc ; then |
931 |
- docinto html |
932 |
- dodoc doc/src/sgml/html/* |
933 |
- fi |
934 |
- |
935 |
- if use server; then |
936 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
937 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
938 |
- |
939 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
940 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
941 |
- |
942 |
- if use systemd; then |
943 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
944 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
945 |
- systemd_newunit - ${PN}-${SLOT}.service |
946 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
947 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
948 |
- fi |
949 |
- |
950 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
951 |
- |
952 |
- if use prefix ; then |
953 |
- keepdir /run/postgresql |
954 |
- fperms 1775 /run/postgresql |
955 |
- fi |
956 |
- fi |
957 |
-} |
958 |
- |
959 |
-pkg_postinst() { |
960 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
961 |
- postgresql-config update |
962 |
- |
963 |
- elog "If you need a global psqlrc-file, you can place it in:" |
964 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
965 |
- |
966 |
- if use server ; then |
967 |
- elog |
968 |
- elog "Gentoo specific documentation:" |
969 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
970 |
- elog |
971 |
- elog "Official documentation:" |
972 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
973 |
- elog |
974 |
- elog "The default location of the Unix-domain socket is:" |
975 |
- elog " ${EROOT}/run/postgresql/" |
976 |
- elog |
977 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
978 |
- elog "so that it contains your preferred locale in:" |
979 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
980 |
- elog |
981 |
- elog "Then, execute the following command to setup the initial database" |
982 |
- elog "environment:" |
983 |
- elog " emerge --config =${CATEGORY}/${PF}" |
984 |
- |
985 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
986 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
987 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
988 |
- ewarn "the following command after upgrading:" |
989 |
- ewarn |
990 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
991 |
- fi |
992 |
- fi |
993 |
-} |
994 |
- |
995 |
-pkg_prerm() { |
996 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
997 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
998 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
999 |
- |
1000 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1001 |
- sleep 10 |
1002 |
- eend 0 |
1003 |
- fi |
1004 |
-} |
1005 |
- |
1006 |
-pkg_postrm() { |
1007 |
- postgresql-config update |
1008 |
-} |
1009 |
- |
1010 |
-pkg_config() { |
1011 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1012 |
- |
1013 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1014 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1015 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
1016 |
- [[ -z "${DATA_DIR}" ]] \ |
1017 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
1018 |
- |
1019 |
- # environment.bz2 may not contain the same locale as the current system |
1020 |
- # locale. Unset and source from the current system locale. |
1021 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
1022 |
- unset LANG |
1023 |
- unset LC_CTYPE |
1024 |
- unset LC_NUMERIC |
1025 |
- unset LC_TIME |
1026 |
- unset LC_COLLATE |
1027 |
- unset LC_MONETARY |
1028 |
- unset LC_MESSAGES |
1029 |
- unset LC_ALL |
1030 |
- source "${EROOT}/etc/env.d/02locale" |
1031 |
- [ -n "${LANG}" ] && export LANG |
1032 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1033 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1034 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1035 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1036 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1037 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1038 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1039 |
- fi |
1040 |
- |
1041 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1042 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1043 |
- einfo |
1044 |
- einfo "Information on options that can be passed to initdb are found at:" |
1045 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1046 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1047 |
- einfo |
1048 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1049 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1050 |
- einfo " (none)" |
1051 |
- else |
1052 |
- einfo " ${PG_INITDB_OPTS}" |
1053 |
- fi |
1054 |
- einfo |
1055 |
- einfo "Configuration files will be installed to:" |
1056 |
- einfo " ${PGDATA}" |
1057 |
- einfo |
1058 |
- einfo "The database cluster will be created in:" |
1059 |
- einfo " ${DATA_DIR}" |
1060 |
- einfo |
1061 |
- |
1062 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
1063 |
- sleep 5 |
1064 |
- eend 0 |
1065 |
- |
1066 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1067 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1068 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1069 |
- die "${DATA_DIR} is not empty." |
1070 |
- fi |
1071 |
- |
1072 |
- einfo "Creating the data directory ..." |
1073 |
- if [[ ${EUID} == 0 ]] ; then |
1074 |
- mkdir -p "${DATA_DIR}" |
1075 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1076 |
- chmod 0700 "${DATA_DIR}" |
1077 |
- fi |
1078 |
- |
1079 |
- einfo "Initializing the database ..." |
1080 |
- |
1081 |
- if [[ ${EUID} == 0 ]] ; then |
1082 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1083 |
- else |
1084 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1085 |
- fi |
1086 |
- |
1087 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1088 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1089 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1090 |
- fi |
1091 |
- |
1092 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
1093 |
- # overridden in the initscript |
1094 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
1095 |
- |
1096 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1097 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1098 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1099 |
- # characters in PL/Perl |
1100 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1101 |
- EOF |
1102 |
- |
1103 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1104 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1105 |
- einfo "by default. You can disable it in the cluster's:" |
1106 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1107 |
- einfo |
1108 |
- if ! use systemd; then |
1109 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1110 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1111 |
- einfo |
1112 |
- fi |
1113 |
- if use prefix ; then |
1114 |
- einfo "The location of the configuration files have moved to:" |
1115 |
- einfo " ${PGDATA}" |
1116 |
- einfo "To start the server:" |
1117 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1118 |
- einfo "To stop:" |
1119 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1120 |
- einfo |
1121 |
- einfo "Or move the configuration files back:" |
1122 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1123 |
- elif use systemd; then |
1124 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
1125 |
- einfo "instead of 'pg_ctl'." |
1126 |
- else |
1127 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1128 |
- einfo "instead of 'pg_ctl'." |
1129 |
- fi |
1130 |
-} |
1131 |
- |
1132 |
-src_test() { |
1133 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
1134 |
- emake check |
1135 |
- |
1136 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
1137 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
1138 |
- else |
1139 |
- use server || \ |
1140 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
1141 |
- [[ ${UID} -eq 0 ]] || \ |
1142 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
1143 |
- |
1144 |
- ewarn 'Skipping.' |
1145 |
- fi |
1146 |
-} |
1147 |
|
1148 |
diff --git a/dev-db/postgresql/postgresql-10.20-r1.ebuild b/dev-db/postgresql/postgresql-10.20-r1.ebuild |
1149 |
deleted file mode 100644 |
1150 |
index 93f17aa04271..000000000000 |
1151 |
--- a/dev-db/postgresql/postgresql-10.20-r1.ebuild |
1152 |
+++ /dev/null |
1153 |
@@ -1,453 +0,0 @@ |
1154 |
-# Copyright 1999-2022 Gentoo Authors |
1155 |
-# Distributed under the terms of the GNU General Public License v2 |
1156 |
- |
1157 |
-EAPI=7 |
1158 |
- |
1159 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
1160 |
- |
1161 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd tmpfiles |
1162 |
- |
1163 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris" |
1164 |
- |
1165 |
-SLOT=$(ver_cut 1) |
1166 |
- |
1167 |
-MY_PV=${PV/_/} |
1168 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
1169 |
- |
1170 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
1171 |
- |
1172 |
-LICENSE="POSTGRESQL GPL-2" |
1173 |
-DESCRIPTION="PostgreSQL RDBMS" |
1174 |
-HOMEPAGE="https://www.postgresql.org/" |
1175 |
- |
1176 |
-IUSE="debug doc icu kerberos ldap nls pam perl |
1177 |
- python +readline selinux +server systemd ssl static-libs tcl |
1178 |
- threads uuid xml zlib" |
1179 |
- |
1180 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1181 |
- |
1182 |
-CDEPEND=" |
1183 |
->=app-eselect/eselect-postgresql-2.0 |
1184 |
-acct-group/postgres |
1185 |
-acct-user/postgres |
1186 |
-sys-apps/less |
1187 |
-virtual/libcrypt:= |
1188 |
-virtual/libintl |
1189 |
-icu? ( dev-libs/icu:= ) |
1190 |
-kerberos? ( virtual/krb5 ) |
1191 |
-ldap? ( net-nds/openldap:= ) |
1192 |
-pam? ( sys-libs/pam ) |
1193 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1194 |
-python? ( ${PYTHON_DEPS} ) |
1195 |
-readline? ( sys-libs/readline:0= ) |
1196 |
-server? ( systemd? ( sys-apps/systemd ) ) |
1197 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1198 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1199 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1200 |
-zlib? ( sys-libs/zlib ) |
1201 |
-" |
1202 |
- |
1203 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
1204 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
1205 |
-# the libc includes UUID functions. |
1206 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
1207 |
- |
1208 |
-nest_usedep() { |
1209 |
- local front back |
1210 |
- while [[ ${#} -gt 1 ]]; do |
1211 |
- front+="${1}? ( " |
1212 |
- back+=" )" |
1213 |
- shift |
1214 |
- done |
1215 |
- echo "${front}${1}${back}" |
1216 |
-} |
1217 |
- |
1218 |
-CDEPEND+=" |
1219 |
-uuid? ( |
1220 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
1221 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
1222 |
-)" |
1223 |
- |
1224 |
-DEPEND="${CDEPEND} |
1225 |
-sys-devel/bison |
1226 |
-sys-devel/flex |
1227 |
-nls? ( sys-devel/gettext ) |
1228 |
-xml? ( virtual/pkgconfig ) |
1229 |
-" |
1230 |
- |
1231 |
-RDEPEND="${CDEPEND} |
1232 |
-selinux? ( sec-policy/selinux-postgresql ) |
1233 |
-" |
1234 |
- |
1235 |
-pkg_setup() { |
1236 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1237 |
- |
1238 |
- use python && python-single-r1_pkg_setup |
1239 |
-} |
1240 |
- |
1241 |
-src_prepare() { |
1242 |
- # Work around PPC{,64} compilation bug where bool is already defined |
1243 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
1244 |
- |
1245 |
- # Set proper run directory |
1246 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1247 |
- -i src/include/pg_config_manual.h || die |
1248 |
- |
1249 |
- # Rely on $PATH being in the proper order so that the correct |
1250 |
- # install program is used for modules utilizing PGXS in both |
1251 |
- # hardened and non-hardened environments. (Bug #528786) |
1252 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
1253 |
- |
1254 |
- use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch" |
1255 |
- |
1256 |
- if use pam ; then |
1257 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1258 |
- -i src/backend/libpq/auth.c || \ |
1259 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1260 |
- fi |
1261 |
- |
1262 |
- # https://bugs.gentoo.org/753257 |
1263 |
- # https://bugs.gentoo.org/766225 |
1264 |
- eapply "${FILESDIR}"/postgresql-10.0-icu68.patch |
1265 |
- |
1266 |
- eapply_user |
1267 |
-} |
1268 |
- |
1269 |
-src_configure() { |
1270 |
- case ${CHOST} in |
1271 |
- *-darwin*|*-solaris*) |
1272 |
- use nls && append-libs intl |
1273 |
- ;; |
1274 |
- esac |
1275 |
- |
1276 |
- export LDFLAGS_SL="${LDFLAGS}" |
1277 |
- export LDFLAGS_EX="${LDFLAGS}" |
1278 |
- |
1279 |
- local PO="${EPREFIX}" |
1280 |
- |
1281 |
- local i uuid_config="" |
1282 |
- if use uuid; then |
1283 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
1284 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
1285 |
- done |
1286 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
1287 |
- fi |
1288 |
- |
1289 |
- econf \ |
1290 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1291 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1292 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1293 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1294 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1295 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1296 |
- $(use_enable !alpha spinlocks) \ |
1297 |
- $(use_enable debug) \ |
1298 |
- $(use_enable threads thread-safety) \ |
1299 |
- $(use_with icu) \ |
1300 |
- $(use_with kerberos gssapi) \ |
1301 |
- $(use_with ldap) \ |
1302 |
- $(use_with pam) \ |
1303 |
- $(use_with perl) \ |
1304 |
- $(use_with python) \ |
1305 |
- $(use_with readline) \ |
1306 |
- $(use_with ssl openssl) \ |
1307 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
1308 |
- $(use_with tcl) \ |
1309 |
- ${uuid_config} \ |
1310 |
- $(use_with xml libxml) \ |
1311 |
- $(use_with xml libxslt) \ |
1312 |
- $(use_with zlib) \ |
1313 |
- $(use_enable nls) |
1314 |
-} |
1315 |
- |
1316 |
-src_compile() { |
1317 |
- emake |
1318 |
- emake -C contrib |
1319 |
-} |
1320 |
- |
1321 |
-src_install() { |
1322 |
- emake DESTDIR="${D}" install |
1323 |
- emake DESTDIR="${D}" install -C contrib |
1324 |
- |
1325 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1326 |
- |
1327 |
- # man pages are already built, but if we have the target make them, |
1328 |
- # they'll be generated from source before being installed so we |
1329 |
- # manually install man pages. |
1330 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1331 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1332 |
- doins -r doc/src/sgml/man{1,3,7} |
1333 |
- if ! use server; then |
1334 |
- # Remove man pages for non-existent binaries |
1335 |
- serverman=( |
1336 |
- initdb |
1337 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
1338 |
- pg_{test_{fsync,timing},upgrade,waldump} |
1339 |
- post{gres,master} |
1340 |
- ) |
1341 |
- for m in ${serverman[@]} ; do |
1342 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1343 |
- done |
1344 |
- fi |
1345 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1346 |
- |
1347 |
- # Create slot specific man pages |
1348 |
- local bn f mansec slotted_name |
1349 |
- for mansec in 1 3 7 ; do |
1350 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
1351 |
- |
1352 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
1353 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
1354 |
- |
1355 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
1356 |
- bn=$(basename "${f}") |
1357 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
1358 |
- case ${bn} in |
1359 |
- TABLE.7|WITH.7) |
1360 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
1361 |
- ;; |
1362 |
- *) |
1363 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
1364 |
- ;; |
1365 |
- esac |
1366 |
- done |
1367 |
- |
1368 |
- popd > /dev/null |
1369 |
- done |
1370 |
- |
1371 |
- insinto /etc/postgresql-${SLOT} |
1372 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1373 |
- |
1374 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
1375 |
- # needed by extensions utilizing PGXS. |
1376 |
- use static-libs || \ |
1377 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
1378 |
- -delete |
1379 |
- |
1380 |
- # Make slot specific links to programs |
1381 |
- local f bn |
1382 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
1383 |
- -mindepth 1 -maxdepth 1) |
1384 |
- do |
1385 |
- bn=$(basename "${f}") |
1386 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
1387 |
- "/usr/bin/${bn}${SLOT/.}" |
1388 |
- done |
1389 |
- |
1390 |
- if use doc ; then |
1391 |
- docinto html |
1392 |
- dodoc doc/src/sgml/html/* |
1393 |
- fi |
1394 |
- |
1395 |
- if use server; then |
1396 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1397 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
1398 |
- |
1399 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1400 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
1401 |
- |
1402 |
- if use systemd; then |
1403 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1404 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
1405 |
- systemd_newunit - ${PN}-${SLOT}.service |
1406 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1407 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
1408 |
- fi |
1409 |
- |
1410 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1411 |
- |
1412 |
- if use prefix ; then |
1413 |
- keepdir /run/postgresql |
1414 |
- fperms 1775 /run/postgresql |
1415 |
- fi |
1416 |
- fi |
1417 |
-} |
1418 |
- |
1419 |
-pkg_postinst() { |
1420 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
1421 |
- postgresql-config update |
1422 |
- |
1423 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1424 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
1425 |
- |
1426 |
- if use server ; then |
1427 |
- elog |
1428 |
- elog "Gentoo specific documentation:" |
1429 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1430 |
- elog |
1431 |
- elog "Official documentation:" |
1432 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
1433 |
- elog |
1434 |
- elog "The default location of the Unix-domain socket is:" |
1435 |
- elog " ${EROOT}/run/postgresql/" |
1436 |
- elog |
1437 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1438 |
- elog "so that it contains your preferred locale in:" |
1439 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1440 |
- elog |
1441 |
- elog "Then, execute the following command to setup the initial database" |
1442 |
- elog "environment:" |
1443 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1444 |
- |
1445 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
1446 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
1447 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
1448 |
- ewarn "the following command after upgrading:" |
1449 |
- ewarn |
1450 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
1451 |
- fi |
1452 |
- fi |
1453 |
-} |
1454 |
- |
1455 |
-pkg_prerm() { |
1456 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1457 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1458 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1459 |
- |
1460 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1461 |
- sleep 10 |
1462 |
- eend 0 |
1463 |
- fi |
1464 |
-} |
1465 |
- |
1466 |
-pkg_postrm() { |
1467 |
- postgresql-config update |
1468 |
-} |
1469 |
- |
1470 |
-pkg_config() { |
1471 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1472 |
- |
1473 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1474 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1475 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
1476 |
- [[ -z "${DATA_DIR}" ]] \ |
1477 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
1478 |
- |
1479 |
- # environment.bz2 may not contain the same locale as the current system |
1480 |
- # locale. Unset and source from the current system locale. |
1481 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
1482 |
- unset LANG |
1483 |
- unset LC_CTYPE |
1484 |
- unset LC_NUMERIC |
1485 |
- unset LC_TIME |
1486 |
- unset LC_COLLATE |
1487 |
- unset LC_MONETARY |
1488 |
- unset LC_MESSAGES |
1489 |
- unset LC_ALL |
1490 |
- source "${EROOT}/etc/env.d/02locale" |
1491 |
- [ -n "${LANG}" ] && export LANG |
1492 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1493 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1494 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1495 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1496 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1497 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1498 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1499 |
- fi |
1500 |
- |
1501 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1502 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1503 |
- einfo |
1504 |
- einfo "Information on options that can be passed to initdb are found at:" |
1505 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1506 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1507 |
- einfo |
1508 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1509 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1510 |
- einfo " (none)" |
1511 |
- else |
1512 |
- einfo " ${PG_INITDB_OPTS}" |
1513 |
- fi |
1514 |
- einfo |
1515 |
- einfo "Configuration files will be installed to:" |
1516 |
- einfo " ${PGDATA}" |
1517 |
- einfo |
1518 |
- einfo "The database cluster will be created in:" |
1519 |
- einfo " ${DATA_DIR}" |
1520 |
- einfo |
1521 |
- |
1522 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
1523 |
- sleep 5 |
1524 |
- eend 0 |
1525 |
- |
1526 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1527 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1528 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1529 |
- die "${DATA_DIR} is not empty." |
1530 |
- fi |
1531 |
- |
1532 |
- einfo "Creating the data directory ..." |
1533 |
- if [[ ${EUID} == 0 ]] ; then |
1534 |
- mkdir -p "${DATA_DIR}" |
1535 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1536 |
- chmod 0700 "${DATA_DIR}" |
1537 |
- fi |
1538 |
- |
1539 |
- einfo "Initializing the database ..." |
1540 |
- |
1541 |
- if [[ ${EUID} == 0 ]] ; then |
1542 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1543 |
- else |
1544 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1545 |
- fi |
1546 |
- |
1547 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1548 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1549 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1550 |
- fi |
1551 |
- |
1552 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
1553 |
- # overridden in the initscript |
1554 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
1555 |
- |
1556 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1557 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1558 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1559 |
- # characters in PL/Perl |
1560 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1561 |
- EOF |
1562 |
- |
1563 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1564 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1565 |
- einfo "by default. You can disable it in the cluster's:" |
1566 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1567 |
- einfo |
1568 |
- if ! use systemd; then |
1569 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1570 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1571 |
- einfo |
1572 |
- fi |
1573 |
- if use prefix ; then |
1574 |
- einfo "The location of the configuration files have moved to:" |
1575 |
- einfo " ${PGDATA}" |
1576 |
- einfo "To start the server:" |
1577 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1578 |
- einfo "To stop:" |
1579 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1580 |
- einfo |
1581 |
- einfo "Or move the configuration files back:" |
1582 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1583 |
- elif use systemd; then |
1584 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
1585 |
- einfo "instead of 'pg_ctl'." |
1586 |
- else |
1587 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1588 |
- einfo "instead of 'pg_ctl'." |
1589 |
- fi |
1590 |
-} |
1591 |
- |
1592 |
-src_test() { |
1593 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
1594 |
- emake check |
1595 |
- |
1596 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
1597 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
1598 |
- else |
1599 |
- use server || \ |
1600 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
1601 |
- [[ ${UID} -eq 0 ]] || \ |
1602 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
1603 |
- |
1604 |
- ewarn 'Skipping.' |
1605 |
- fi |
1606 |
-} |
1607 |
|
1608 |
diff --git a/dev-db/postgresql/postgresql-10.21.ebuild b/dev-db/postgresql/postgresql-10.21.ebuild |
1609 |
deleted file mode 100644 |
1610 |
index f2b4125d2922..000000000000 |
1611 |
--- a/dev-db/postgresql/postgresql-10.21.ebuild |
1612 |
+++ /dev/null |
1613 |
@@ -1,453 +0,0 @@ |
1614 |
-# Copyright 1999-2022 Gentoo Authors |
1615 |
-# Distributed under the terms of the GNU General Public License v2 |
1616 |
- |
1617 |
-EAPI=7 |
1618 |
- |
1619 |
-PYTHON_COMPAT=( python3_{8,9,10,11} ) |
1620 |
- |
1621 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd tmpfiles |
1622 |
- |
1623 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris" |
1624 |
- |
1625 |
-SLOT=$(ver_cut 1) |
1626 |
- |
1627 |
-MY_PV=${PV/_/} |
1628 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
1629 |
- |
1630 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
1631 |
- |
1632 |
-LICENSE="POSTGRESQL GPL-2" |
1633 |
-DESCRIPTION="PostgreSQL RDBMS" |
1634 |
-HOMEPAGE="https://www.postgresql.org/" |
1635 |
- |
1636 |
-IUSE="debug doc icu kerberos ldap nls pam perl |
1637 |
- python +readline selinux +server systemd ssl static-libs tcl |
1638 |
- threads uuid xml zlib" |
1639 |
- |
1640 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1641 |
- |
1642 |
-CDEPEND=" |
1643 |
->=app-eselect/eselect-postgresql-2.0 |
1644 |
-acct-group/postgres |
1645 |
-acct-user/postgres |
1646 |
-sys-apps/less |
1647 |
-virtual/libcrypt:= |
1648 |
-virtual/libintl |
1649 |
-icu? ( dev-libs/icu:= ) |
1650 |
-kerberos? ( virtual/krb5 ) |
1651 |
-ldap? ( net-nds/openldap:= ) |
1652 |
-pam? ( sys-libs/pam ) |
1653 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1654 |
-python? ( ${PYTHON_DEPS} ) |
1655 |
-readline? ( sys-libs/readline:0= ) |
1656 |
-server? ( systemd? ( sys-apps/systemd ) ) |
1657 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1658 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1659 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1660 |
-zlib? ( sys-libs/zlib ) |
1661 |
-" |
1662 |
- |
1663 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
1664 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
1665 |
-# the libc includes UUID functions. |
1666 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
1667 |
- |
1668 |
-nest_usedep() { |
1669 |
- local front back |
1670 |
- while [[ ${#} -gt 1 ]]; do |
1671 |
- front+="${1}? ( " |
1672 |
- back+=" )" |
1673 |
- shift |
1674 |
- done |
1675 |
- echo "${front}${1}${back}" |
1676 |
-} |
1677 |
- |
1678 |
-CDEPEND+=" |
1679 |
-uuid? ( |
1680 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
1681 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
1682 |
-)" |
1683 |
- |
1684 |
-DEPEND="${CDEPEND} |
1685 |
-sys-devel/bison |
1686 |
-sys-devel/flex |
1687 |
-nls? ( sys-devel/gettext ) |
1688 |
-xml? ( virtual/pkgconfig ) |
1689 |
-" |
1690 |
- |
1691 |
-RDEPEND="${CDEPEND} |
1692 |
-selinux? ( sec-policy/selinux-postgresql ) |
1693 |
-" |
1694 |
- |
1695 |
-pkg_setup() { |
1696 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1697 |
- |
1698 |
- use python && python-single-r1_pkg_setup |
1699 |
-} |
1700 |
- |
1701 |
-src_prepare() { |
1702 |
- # Work around PPC{,64} compilation bug where bool is already defined |
1703 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
1704 |
- |
1705 |
- # Set proper run directory |
1706 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1707 |
- -i src/include/pg_config_manual.h || die |
1708 |
- |
1709 |
- # Rely on $PATH being in the proper order so that the correct |
1710 |
- # install program is used for modules utilizing PGXS in both |
1711 |
- # hardened and non-hardened environments. (Bug #528786) |
1712 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
1713 |
- |
1714 |
- use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch" |
1715 |
- |
1716 |
- if use pam ; then |
1717 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1718 |
- -i src/backend/libpq/auth.c || \ |
1719 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1720 |
- fi |
1721 |
- |
1722 |
- # https://bugs.gentoo.org/753257 |
1723 |
- # https://bugs.gentoo.org/766225 |
1724 |
- eapply "${FILESDIR}"/postgresql-10.0-icu68.patch |
1725 |
- |
1726 |
- eapply_user |
1727 |
-} |
1728 |
- |
1729 |
-src_configure() { |
1730 |
- case ${CHOST} in |
1731 |
- *-darwin*|*-solaris*) |
1732 |
- use nls && append-libs intl |
1733 |
- ;; |
1734 |
- esac |
1735 |
- |
1736 |
- export LDFLAGS_SL="${LDFLAGS}" |
1737 |
- export LDFLAGS_EX="${LDFLAGS}" |
1738 |
- |
1739 |
- local PO="${EPREFIX}" |
1740 |
- |
1741 |
- local i uuid_config="" |
1742 |
- if use uuid; then |
1743 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
1744 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
1745 |
- done |
1746 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
1747 |
- fi |
1748 |
- |
1749 |
- econf \ |
1750 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1751 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1752 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1753 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1754 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1755 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1756 |
- $(use_enable !alpha spinlocks) \ |
1757 |
- $(use_enable debug) \ |
1758 |
- $(use_enable threads thread-safety) \ |
1759 |
- $(use_with icu) \ |
1760 |
- $(use_with kerberos gssapi) \ |
1761 |
- $(use_with ldap) \ |
1762 |
- $(use_with pam) \ |
1763 |
- $(use_with perl) \ |
1764 |
- $(use_with python) \ |
1765 |
- $(use_with readline) \ |
1766 |
- $(use_with ssl openssl) \ |
1767 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
1768 |
- $(use_with tcl) \ |
1769 |
- ${uuid_config} \ |
1770 |
- $(use_with xml libxml) \ |
1771 |
- $(use_with xml libxslt) \ |
1772 |
- $(use_with zlib) \ |
1773 |
- $(use_enable nls) |
1774 |
-} |
1775 |
- |
1776 |
-src_compile() { |
1777 |
- emake |
1778 |
- emake -C contrib |
1779 |
-} |
1780 |
- |
1781 |
-src_install() { |
1782 |
- emake DESTDIR="${D}" install |
1783 |
- emake DESTDIR="${D}" install -C contrib |
1784 |
- |
1785 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1786 |
- |
1787 |
- # man pages are already built, but if we have the target make them, |
1788 |
- # they'll be generated from source before being installed so we |
1789 |
- # manually install man pages. |
1790 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1791 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1792 |
- doins -r doc/src/sgml/man{1,3,7} |
1793 |
- if ! use server; then |
1794 |
- # Remove man pages for non-existent binaries |
1795 |
- serverman=( |
1796 |
- initdb |
1797 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
1798 |
- pg_{test_{fsync,timing},upgrade,waldump} |
1799 |
- post{gres,master} |
1800 |
- ) |
1801 |
- for m in ${serverman[@]} ; do |
1802 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1803 |
- done |
1804 |
- fi |
1805 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1806 |
- |
1807 |
- # Create slot specific man pages |
1808 |
- local bn f mansec slotted_name |
1809 |
- for mansec in 1 3 7 ; do |
1810 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
1811 |
- |
1812 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
1813 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
1814 |
- |
1815 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
1816 |
- bn=$(basename "${f}") |
1817 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
1818 |
- case ${bn} in |
1819 |
- TABLE.7|WITH.7) |
1820 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
1821 |
- ;; |
1822 |
- *) |
1823 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
1824 |
- ;; |
1825 |
- esac |
1826 |
- done |
1827 |
- |
1828 |
- popd > /dev/null |
1829 |
- done |
1830 |
- |
1831 |
- insinto /etc/postgresql-${SLOT} |
1832 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1833 |
- |
1834 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
1835 |
- # needed by extensions utilizing PGXS. |
1836 |
- use static-libs || \ |
1837 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
1838 |
- -delete |
1839 |
- |
1840 |
- # Make slot specific links to programs |
1841 |
- local f bn |
1842 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
1843 |
- -mindepth 1 -maxdepth 1) |
1844 |
- do |
1845 |
- bn=$(basename "${f}") |
1846 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
1847 |
- "/usr/bin/${bn}${SLOT/.}" |
1848 |
- done |
1849 |
- |
1850 |
- if use doc ; then |
1851 |
- docinto html |
1852 |
- dodoc doc/src/sgml/html/* |
1853 |
- fi |
1854 |
- |
1855 |
- if use server; then |
1856 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1857 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
1858 |
- |
1859 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1860 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
1861 |
- |
1862 |
- if use systemd; then |
1863 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1864 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
1865 |
- systemd_newunit - ${PN}-${SLOT}.service |
1866 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1867 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
1868 |
- fi |
1869 |
- |
1870 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1871 |
- |
1872 |
- if use prefix ; then |
1873 |
- keepdir /run/postgresql |
1874 |
- fperms 1775 /run/postgresql |
1875 |
- fi |
1876 |
- fi |
1877 |
-} |
1878 |
- |
1879 |
-pkg_postinst() { |
1880 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
1881 |
- postgresql-config update |
1882 |
- |
1883 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1884 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
1885 |
- |
1886 |
- if use server ; then |
1887 |
- elog |
1888 |
- elog "Gentoo specific documentation:" |
1889 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1890 |
- elog |
1891 |
- elog "Official documentation:" |
1892 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
1893 |
- elog |
1894 |
- elog "The default location of the Unix-domain socket is:" |
1895 |
- elog " ${EROOT}/run/postgresql/" |
1896 |
- elog |
1897 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1898 |
- elog "so that it contains your preferred locale in:" |
1899 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1900 |
- elog |
1901 |
- elog "Then, execute the following command to setup the initial database" |
1902 |
- elog "environment:" |
1903 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1904 |
- |
1905 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
1906 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
1907 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
1908 |
- ewarn "the following command after upgrading:" |
1909 |
- ewarn |
1910 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
1911 |
- fi |
1912 |
- fi |
1913 |
-} |
1914 |
- |
1915 |
-pkg_prerm() { |
1916 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1917 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1918 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1919 |
- |
1920 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1921 |
- sleep 10 |
1922 |
- eend 0 |
1923 |
- fi |
1924 |
-} |
1925 |
- |
1926 |
-pkg_postrm() { |
1927 |
- postgresql-config update |
1928 |
-} |
1929 |
- |
1930 |
-pkg_config() { |
1931 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1932 |
- |
1933 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1934 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1935 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
1936 |
- [[ -z "${DATA_DIR}" ]] \ |
1937 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
1938 |
- |
1939 |
- # environment.bz2 may not contain the same locale as the current system |
1940 |
- # locale. Unset and source from the current system locale. |
1941 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
1942 |
- unset LANG |
1943 |
- unset LC_CTYPE |
1944 |
- unset LC_NUMERIC |
1945 |
- unset LC_TIME |
1946 |
- unset LC_COLLATE |
1947 |
- unset LC_MONETARY |
1948 |
- unset LC_MESSAGES |
1949 |
- unset LC_ALL |
1950 |
- source "${EROOT}/etc/env.d/02locale" |
1951 |
- [ -n "${LANG}" ] && export LANG |
1952 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1953 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1954 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1955 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1956 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1957 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1958 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1959 |
- fi |
1960 |
- |
1961 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1962 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1963 |
- einfo |
1964 |
- einfo "Information on options that can be passed to initdb are found at:" |
1965 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1966 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1967 |
- einfo |
1968 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1969 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1970 |
- einfo " (none)" |
1971 |
- else |
1972 |
- einfo " ${PG_INITDB_OPTS}" |
1973 |
- fi |
1974 |
- einfo |
1975 |
- einfo "Configuration files will be installed to:" |
1976 |
- einfo " ${PGDATA}" |
1977 |
- einfo |
1978 |
- einfo "The database cluster will be created in:" |
1979 |
- einfo " ${DATA_DIR}" |
1980 |
- einfo |
1981 |
- |
1982 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
1983 |
- sleep 5 |
1984 |
- eend 0 |
1985 |
- |
1986 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1987 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1988 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1989 |
- die "${DATA_DIR} is not empty." |
1990 |
- fi |
1991 |
- |
1992 |
- einfo "Creating the data directory ..." |
1993 |
- if [[ ${EUID} == 0 ]] ; then |
1994 |
- mkdir -p "${DATA_DIR}" |
1995 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1996 |
- chmod 0700 "${DATA_DIR}" |
1997 |
- fi |
1998 |
- |
1999 |
- einfo "Initializing the database ..." |
2000 |
- |
2001 |
- if [[ ${EUID} == 0 ]] ; then |
2002 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2003 |
- else |
2004 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2005 |
- fi |
2006 |
- |
2007 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2008 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2009 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2010 |
- fi |
2011 |
- |
2012 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
2013 |
- # overridden in the initscript |
2014 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
2015 |
- |
2016 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2017 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2018 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2019 |
- # characters in PL/Perl |
2020 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2021 |
- EOF |
2022 |
- |
2023 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2024 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2025 |
- einfo "by default. You can disable it in the cluster's:" |
2026 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2027 |
- einfo |
2028 |
- if ! use systemd; then |
2029 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2030 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2031 |
- einfo |
2032 |
- fi |
2033 |
- if use prefix ; then |
2034 |
- einfo "The location of the configuration files have moved to:" |
2035 |
- einfo " ${PGDATA}" |
2036 |
- einfo "To start the server:" |
2037 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2038 |
- einfo "To stop:" |
2039 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2040 |
- einfo |
2041 |
- einfo "Or move the configuration files back:" |
2042 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2043 |
- elif use systemd; then |
2044 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
2045 |
- einfo "instead of 'pg_ctl'." |
2046 |
- else |
2047 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2048 |
- einfo "instead of 'pg_ctl'." |
2049 |
- fi |
2050 |
-} |
2051 |
- |
2052 |
-src_test() { |
2053 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2054 |
- emake check |
2055 |
- |
2056 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2057 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2058 |
- else |
2059 |
- use server || \ |
2060 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2061 |
- [[ ${UID} -eq 0 ]] || \ |
2062 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2063 |
- |
2064 |
- ewarn 'Skipping.' |
2065 |
- fi |
2066 |
-} |
2067 |
|
2068 |
diff --git a/dev-db/postgresql/postgresql-11.14-r1.ebuild b/dev-db/postgresql/postgresql-11.14-r1.ebuild |
2069 |
deleted file mode 100644 |
2070 |
index 314f76723449..000000000000 |
2071 |
--- a/dev-db/postgresql/postgresql-11.14-r1.ebuild |
2072 |
+++ /dev/null |
2073 |
@@ -1,453 +0,0 @@ |
2074 |
-# Copyright 1999-2022 Gentoo Authors |
2075 |
-# Distributed under the terms of the GNU General Public License v2 |
2076 |
- |
2077 |
-EAPI=7 |
2078 |
- |
2079 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
2080 |
-LLVM_MAX_SLOT=13 |
2081 |
- |
2082 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
2083 |
- |
2084 |
-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" |
2085 |
- |
2086 |
-SLOT=$(ver_cut 1) |
2087 |
- |
2088 |
-MY_PV=${PV/_/} |
2089 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
2090 |
- |
2091 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
2092 |
- |
2093 |
-LICENSE="POSTGRESQL GPL-2" |
2094 |
-DESCRIPTION="PostgreSQL RDBMS" |
2095 |
-HOMEPAGE="https://www.postgresql.org/" |
2096 |
- |
2097 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
2098 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
2099 |
- threads uuid xml zlib" |
2100 |
- |
2101 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
2102 |
- |
2103 |
-CDEPEND=" |
2104 |
->=app-eselect/eselect-postgresql-2.0 |
2105 |
-acct-group/postgres |
2106 |
-acct-user/postgres |
2107 |
-sys-apps/less |
2108 |
-virtual/libintl |
2109 |
-icu? ( dev-libs/icu:= ) |
2110 |
-kerberos? ( virtual/krb5 ) |
2111 |
-ldap? ( net-nds/openldap:= ) |
2112 |
-llvm? ( |
2113 |
- <sys-devel/llvm-14:= |
2114 |
- <sys-devel/clang-14:= |
2115 |
-) |
2116 |
-pam? ( sys-libs/pam ) |
2117 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2118 |
-python? ( ${PYTHON_DEPS} ) |
2119 |
-readline? ( sys-libs/readline:0= ) |
2120 |
-server? ( systemd? ( sys-apps/systemd ) ) |
2121 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2122 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2123 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2124 |
-zlib? ( sys-libs/zlib ) |
2125 |
-" |
2126 |
- |
2127 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
2128 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
2129 |
-# the libc includes UUID functions. |
2130 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
2131 |
- |
2132 |
-nest_usedep() { |
2133 |
- local front back |
2134 |
- while [[ ${#} -gt 1 ]]; do |
2135 |
- front+="${1}? ( " |
2136 |
- back+=" )" |
2137 |
- shift |
2138 |
- done |
2139 |
- echo "${front}${1}${back}" |
2140 |
-} |
2141 |
- |
2142 |
-CDEPEND+=" |
2143 |
-uuid? ( |
2144 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
2145 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
2146 |
-)" |
2147 |
- |
2148 |
-DEPEND="${CDEPEND} |
2149 |
-sys-devel/bison |
2150 |
-sys-devel/flex |
2151 |
-nls? ( sys-devel/gettext ) |
2152 |
-xml? ( virtual/pkgconfig ) |
2153 |
-" |
2154 |
- |
2155 |
-RDEPEND="${CDEPEND} |
2156 |
-selinux? ( sec-policy/selinux-postgresql ) |
2157 |
-" |
2158 |
- |
2159 |
-pkg_setup() { |
2160 |
- use llvm && llvm_pkg_setup |
2161 |
- |
2162 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2163 |
- |
2164 |
- use python && python-single-r1_pkg_setup |
2165 |
-} |
2166 |
- |
2167 |
-src_prepare() { |
2168 |
- # Set proper run directory |
2169 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2170 |
- -i src/include/pg_config_manual.h || die |
2171 |
- |
2172 |
- # Rely on $PATH being in the proper order so that the correct |
2173 |
- # install program is used for modules utilizing PGXS in both |
2174 |
- # hardened and non-hardened environments. (Bug #528786) |
2175 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
2176 |
- |
2177 |
- use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch" |
2178 |
- |
2179 |
- if use pam ; then |
2180 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2181 |
- -i src/backend/libpq/auth.c || \ |
2182 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2183 |
- fi |
2184 |
- |
2185 |
- eapply_user |
2186 |
-} |
2187 |
- |
2188 |
-src_configure() { |
2189 |
- case ${CHOST} in |
2190 |
- *-darwin*|*-solaris*) |
2191 |
- use nls && append-libs intl |
2192 |
- ;; |
2193 |
- esac |
2194 |
- |
2195 |
- export LDFLAGS_SL="${LDFLAGS}" |
2196 |
- export LDFLAGS_EX="${LDFLAGS}" |
2197 |
- |
2198 |
- local PO="${EPREFIX}" |
2199 |
- |
2200 |
- local i uuid_config="" |
2201 |
- if use uuid; then |
2202 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
2203 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
2204 |
- done |
2205 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
2206 |
- fi |
2207 |
- |
2208 |
- econf \ |
2209 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2210 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2211 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2212 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2213 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2214 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2215 |
- $(use_enable !alpha spinlocks) \ |
2216 |
- $(use_enable debug) \ |
2217 |
- $(use_enable threads thread-safety) \ |
2218 |
- $(use_with icu) \ |
2219 |
- $(use_with kerberos gssapi) \ |
2220 |
- $(use_with ldap) \ |
2221 |
- $(use_with llvm) \ |
2222 |
- $(use_with pam) \ |
2223 |
- $(use_with perl) \ |
2224 |
- $(use_with python) \ |
2225 |
- $(use_with readline) \ |
2226 |
- $(use_with ssl openssl) \ |
2227 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
2228 |
- $(use_with tcl) \ |
2229 |
- ${uuid_config} \ |
2230 |
- $(use_with xml libxml) \ |
2231 |
- $(use_with xml libxslt) \ |
2232 |
- $(use_with zlib) \ |
2233 |
- $(use_enable nls) |
2234 |
-} |
2235 |
- |
2236 |
-src_compile() { |
2237 |
- emake |
2238 |
- emake -C contrib |
2239 |
-} |
2240 |
- |
2241 |
-src_install() { |
2242 |
- emake DESTDIR="${D}" install |
2243 |
- emake DESTDIR="${D}" install -C contrib |
2244 |
- |
2245 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2246 |
- |
2247 |
- # man pages are already built, but if we have the target make them, |
2248 |
- # they'll be generated from source before being installed so we |
2249 |
- # manually install man pages. |
2250 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2251 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2252 |
- doins -r doc/src/sgml/man{1,3,7} |
2253 |
- if ! use server; then |
2254 |
- # Remove man pages for non-existent binaries |
2255 |
- serverman=( |
2256 |
- initdb |
2257 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
2258 |
- pg_{test_{fsync,timing},upgrade,waldump} |
2259 |
- post{gres,master} |
2260 |
- ) |
2261 |
- for m in ${serverman[@]} ; do |
2262 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2263 |
- done |
2264 |
- fi |
2265 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2266 |
- |
2267 |
- # Create slot specific man pages |
2268 |
- local bn f mansec slotted_name |
2269 |
- for mansec in 1 3 7 ; do |
2270 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
2271 |
- |
2272 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
2273 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
2274 |
- |
2275 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
2276 |
- bn=$(basename "${f}") |
2277 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
2278 |
- case ${bn} in |
2279 |
- TABLE.7|WITH.7) |
2280 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
2281 |
- ;; |
2282 |
- *) |
2283 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
2284 |
- ;; |
2285 |
- esac |
2286 |
- done |
2287 |
- |
2288 |
- popd > /dev/null |
2289 |
- done |
2290 |
- |
2291 |
- insinto /etc/postgresql-${SLOT} |
2292 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2293 |
- |
2294 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
2295 |
- # needed by extensions utilizing PGXS. |
2296 |
- use static-libs || \ |
2297 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
2298 |
- -delete |
2299 |
- |
2300 |
- # Make slot specific links to programs |
2301 |
- local f bn |
2302 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
2303 |
- -mindepth 1 -maxdepth 1) |
2304 |
- do |
2305 |
- bn=$(basename "${f}") |
2306 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
2307 |
- "/usr/bin/${bn}${SLOT/.}" |
2308 |
- done |
2309 |
- |
2310 |
- if use doc ; then |
2311 |
- docinto html |
2312 |
- dodoc doc/src/sgml/html/* |
2313 |
- fi |
2314 |
- |
2315 |
- if use server; then |
2316 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2317 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
2318 |
- |
2319 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2320 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
2321 |
- |
2322 |
- if use systemd; then |
2323 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2324 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
2325 |
- systemd_newunit - ${PN}-${SLOT}.service |
2326 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2327 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
2328 |
- fi |
2329 |
- |
2330 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2331 |
- |
2332 |
- if use prefix ; then |
2333 |
- keepdir /run/postgresql |
2334 |
- fperms 1775 /run/postgresql |
2335 |
- fi |
2336 |
- fi |
2337 |
-} |
2338 |
- |
2339 |
-pkg_postinst() { |
2340 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
2341 |
- postgresql-config update |
2342 |
- |
2343 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2344 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
2345 |
- |
2346 |
- if use server ; then |
2347 |
- elog |
2348 |
- elog "Gentoo specific documentation:" |
2349 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2350 |
- elog |
2351 |
- elog "Official documentation:" |
2352 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
2353 |
- elog |
2354 |
- elog "The default location of the Unix-domain socket is:" |
2355 |
- elog " ${EROOT}/run/postgresql/" |
2356 |
- elog |
2357 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2358 |
- elog "so that it contains your preferred locale in:" |
2359 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2360 |
- elog |
2361 |
- elog "Then, execute the following command to setup the initial database" |
2362 |
- elog "environment:" |
2363 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2364 |
- |
2365 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
2366 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
2367 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
2368 |
- ewarn "the following command after upgrading:" |
2369 |
- ewarn |
2370 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
2371 |
- fi |
2372 |
- fi |
2373 |
-} |
2374 |
- |
2375 |
-pkg_prerm() { |
2376 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2377 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2378 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2379 |
- |
2380 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2381 |
- sleep 10 |
2382 |
- eend 0 |
2383 |
- fi |
2384 |
-} |
2385 |
- |
2386 |
-pkg_postrm() { |
2387 |
- postgresql-config update |
2388 |
-} |
2389 |
- |
2390 |
-pkg_config() { |
2391 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2392 |
- |
2393 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2394 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2395 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
2396 |
- [[ -z "${DATA_DIR}" ]] \ |
2397 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
2398 |
- |
2399 |
- # environment.bz2 may not contain the same locale as the current system |
2400 |
- # locale. Unset and source from the current system locale. |
2401 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
2402 |
- unset LANG |
2403 |
- unset LC_CTYPE |
2404 |
- unset LC_NUMERIC |
2405 |
- unset LC_TIME |
2406 |
- unset LC_COLLATE |
2407 |
- unset LC_MONETARY |
2408 |
- unset LC_MESSAGES |
2409 |
- unset LC_ALL |
2410 |
- source "${EROOT}/etc/env.d/02locale" |
2411 |
- [ -n "${LANG}" ] && export LANG |
2412 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2413 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2414 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2415 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2416 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2417 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2418 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2419 |
- fi |
2420 |
- |
2421 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2422 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2423 |
- einfo |
2424 |
- einfo "Information on options that can be passed to initdb are found at:" |
2425 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2426 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2427 |
- einfo |
2428 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2429 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2430 |
- einfo " (none)" |
2431 |
- else |
2432 |
- einfo " ${PG_INITDB_OPTS}" |
2433 |
- fi |
2434 |
- einfo |
2435 |
- einfo "Configuration files will be installed to:" |
2436 |
- einfo " ${PGDATA}" |
2437 |
- einfo |
2438 |
- einfo "The database cluster will be created in:" |
2439 |
- einfo " ${DATA_DIR}" |
2440 |
- einfo |
2441 |
- |
2442 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
2443 |
- sleep 5 |
2444 |
- eend 0 |
2445 |
- |
2446 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2447 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2448 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2449 |
- die "${DATA_DIR} is not empty." |
2450 |
- fi |
2451 |
- |
2452 |
- einfo "Creating the data directory ..." |
2453 |
- if [[ ${EUID} == 0 ]] ; then |
2454 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
2455 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
2456 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
2457 |
- fi |
2458 |
- |
2459 |
- einfo "Initializing the database ..." |
2460 |
- |
2461 |
- if [[ ${EUID} == 0 ]] ; then |
2462 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2463 |
- else |
2464 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2465 |
- fi |
2466 |
- |
2467 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2468 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2469 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2470 |
- fi |
2471 |
- |
2472 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
2473 |
- # overridden in the initscript |
2474 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
2475 |
- |
2476 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2477 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2478 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2479 |
- # characters in PL/Perl |
2480 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2481 |
- EOF |
2482 |
- |
2483 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2484 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2485 |
- einfo "by default. You can disable it in the cluster's:" |
2486 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2487 |
- einfo |
2488 |
- if ! use systemd; then |
2489 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2490 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2491 |
- einfo |
2492 |
- fi |
2493 |
- if use prefix ; then |
2494 |
- einfo "The location of the configuration files have moved to:" |
2495 |
- einfo " ${PGDATA}" |
2496 |
- einfo "To start the server:" |
2497 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2498 |
- einfo "To stop:" |
2499 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2500 |
- einfo |
2501 |
- einfo "Or move the configuration files back:" |
2502 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2503 |
- elif use systemd; then |
2504 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
2505 |
- einfo "instead of 'pg_ctl'." |
2506 |
- else |
2507 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2508 |
- einfo "instead of 'pg_ctl'." |
2509 |
- fi |
2510 |
-} |
2511 |
- |
2512 |
-src_test() { |
2513 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2514 |
- emake check |
2515 |
- |
2516 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2517 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2518 |
- else |
2519 |
- use server || \ |
2520 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2521 |
- [[ ${UID} -eq 0 ]] || \ |
2522 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2523 |
- |
2524 |
- ewarn 'Skipping.' |
2525 |
- fi |
2526 |
-} |
2527 |
|
2528 |
diff --git a/dev-db/postgresql/postgresql-11.15-r1.ebuild b/dev-db/postgresql/postgresql-11.15-r1.ebuild |
2529 |
deleted file mode 100644 |
2530 |
index 4be0a8926b5d..000000000000 |
2531 |
--- a/dev-db/postgresql/postgresql-11.15-r1.ebuild |
2532 |
+++ /dev/null |
2533 |
@@ -1,453 +0,0 @@ |
2534 |
-# Copyright 1999-2022 Gentoo Authors |
2535 |
-# Distributed under the terms of the GNU General Public License v2 |
2536 |
- |
2537 |
-EAPI=7 |
2538 |
- |
2539 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
2540 |
-LLVM_MAX_SLOT=13 |
2541 |
- |
2542 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
2543 |
- |
2544 |
-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" |
2545 |
- |
2546 |
-SLOT=$(ver_cut 1) |
2547 |
- |
2548 |
-MY_PV=${PV/_/} |
2549 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
2550 |
- |
2551 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
2552 |
- |
2553 |
-LICENSE="POSTGRESQL GPL-2" |
2554 |
-DESCRIPTION="PostgreSQL RDBMS" |
2555 |
-HOMEPAGE="https://www.postgresql.org/" |
2556 |
- |
2557 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
2558 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
2559 |
- threads uuid xml zlib" |
2560 |
- |
2561 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
2562 |
- |
2563 |
-CDEPEND=" |
2564 |
->=app-eselect/eselect-postgresql-2.0 |
2565 |
-acct-group/postgres |
2566 |
-acct-user/postgres |
2567 |
-sys-apps/less |
2568 |
-virtual/libintl |
2569 |
-icu? ( dev-libs/icu:= ) |
2570 |
-kerberos? ( virtual/krb5 ) |
2571 |
-ldap? ( net-nds/openldap:= ) |
2572 |
-llvm? ( |
2573 |
- <sys-devel/llvm-14:= |
2574 |
- <sys-devel/clang-14:= |
2575 |
-) |
2576 |
-pam? ( sys-libs/pam ) |
2577 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2578 |
-python? ( ${PYTHON_DEPS} ) |
2579 |
-readline? ( sys-libs/readline:0= ) |
2580 |
-server? ( systemd? ( sys-apps/systemd ) ) |
2581 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2582 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2583 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2584 |
-zlib? ( sys-libs/zlib ) |
2585 |
-" |
2586 |
- |
2587 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
2588 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
2589 |
-# the libc includes UUID functions. |
2590 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
2591 |
- |
2592 |
-nest_usedep() { |
2593 |
- local front back |
2594 |
- while [[ ${#} -gt 1 ]]; do |
2595 |
- front+="${1}? ( " |
2596 |
- back+=" )" |
2597 |
- shift |
2598 |
- done |
2599 |
- echo "${front}${1}${back}" |
2600 |
-} |
2601 |
- |
2602 |
-CDEPEND+=" |
2603 |
-uuid? ( |
2604 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
2605 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
2606 |
-)" |
2607 |
- |
2608 |
-DEPEND="${CDEPEND} |
2609 |
-sys-devel/bison |
2610 |
-sys-devel/flex |
2611 |
-nls? ( sys-devel/gettext ) |
2612 |
-xml? ( virtual/pkgconfig ) |
2613 |
-" |
2614 |
- |
2615 |
-RDEPEND="${CDEPEND} |
2616 |
-selinux? ( sec-policy/selinux-postgresql ) |
2617 |
-" |
2618 |
- |
2619 |
-pkg_setup() { |
2620 |
- use llvm && llvm_pkg_setup |
2621 |
- |
2622 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2623 |
- |
2624 |
- use python && python-single-r1_pkg_setup |
2625 |
-} |
2626 |
- |
2627 |
-src_prepare() { |
2628 |
- # Set proper run directory |
2629 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2630 |
- -i src/include/pg_config_manual.h || die |
2631 |
- |
2632 |
- # Rely on $PATH being in the proper order so that the correct |
2633 |
- # install program is used for modules utilizing PGXS in both |
2634 |
- # hardened and non-hardened environments. (Bug #528786) |
2635 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
2636 |
- |
2637 |
- use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch" |
2638 |
- |
2639 |
- if use pam ; then |
2640 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2641 |
- -i src/backend/libpq/auth.c || \ |
2642 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2643 |
- fi |
2644 |
- |
2645 |
- eapply_user |
2646 |
-} |
2647 |
- |
2648 |
-src_configure() { |
2649 |
- case ${CHOST} in |
2650 |
- *-darwin*|*-solaris*) |
2651 |
- use nls && append-libs intl |
2652 |
- ;; |
2653 |
- esac |
2654 |
- |
2655 |
- export LDFLAGS_SL="${LDFLAGS}" |
2656 |
- export LDFLAGS_EX="${LDFLAGS}" |
2657 |
- |
2658 |
- local PO="${EPREFIX}" |
2659 |
- |
2660 |
- local i uuid_config="" |
2661 |
- if use uuid; then |
2662 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
2663 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
2664 |
- done |
2665 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
2666 |
- fi |
2667 |
- |
2668 |
- econf \ |
2669 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2670 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2671 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2672 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2673 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2674 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2675 |
- $(use_enable !alpha spinlocks) \ |
2676 |
- $(use_enable debug) \ |
2677 |
- $(use_enable threads thread-safety) \ |
2678 |
- $(use_with icu) \ |
2679 |
- $(use_with kerberos gssapi) \ |
2680 |
- $(use_with ldap) \ |
2681 |
- $(use_with llvm) \ |
2682 |
- $(use_with pam) \ |
2683 |
- $(use_with perl) \ |
2684 |
- $(use_with python) \ |
2685 |
- $(use_with readline) \ |
2686 |
- $(use_with ssl openssl) \ |
2687 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
2688 |
- $(use_with tcl) \ |
2689 |
- ${uuid_config} \ |
2690 |
- $(use_with xml libxml) \ |
2691 |
- $(use_with xml libxslt) \ |
2692 |
- $(use_with zlib) \ |
2693 |
- $(use_enable nls) |
2694 |
-} |
2695 |
- |
2696 |
-src_compile() { |
2697 |
- emake |
2698 |
- emake -C contrib |
2699 |
-} |
2700 |
- |
2701 |
-src_install() { |
2702 |
- emake DESTDIR="${D}" install |
2703 |
- emake DESTDIR="${D}" install -C contrib |
2704 |
- |
2705 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2706 |
- |
2707 |
- # man pages are already built, but if we have the target make them, |
2708 |
- # they'll be generated from source before being installed so we |
2709 |
- # manually install man pages. |
2710 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2711 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2712 |
- doins -r doc/src/sgml/man{1,3,7} |
2713 |
- if ! use server; then |
2714 |
- # Remove man pages for non-existent binaries |
2715 |
- serverman=( |
2716 |
- initdb |
2717 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
2718 |
- pg_{test_{fsync,timing},upgrade,waldump} |
2719 |
- post{gres,master} |
2720 |
- ) |
2721 |
- for m in ${serverman[@]} ; do |
2722 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2723 |
- done |
2724 |
- fi |
2725 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2726 |
- |
2727 |
- # Create slot specific man pages |
2728 |
- local bn f mansec slotted_name |
2729 |
- for mansec in 1 3 7 ; do |
2730 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
2731 |
- |
2732 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
2733 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
2734 |
- |
2735 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
2736 |
- bn=$(basename "${f}") |
2737 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
2738 |
- case ${bn} in |
2739 |
- TABLE.7|WITH.7) |
2740 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
2741 |
- ;; |
2742 |
- *) |
2743 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
2744 |
- ;; |
2745 |
- esac |
2746 |
- done |
2747 |
- |
2748 |
- popd > /dev/null |
2749 |
- done |
2750 |
- |
2751 |
- insinto /etc/postgresql-${SLOT} |
2752 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2753 |
- |
2754 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
2755 |
- # needed by extensions utilizing PGXS. |
2756 |
- use static-libs || \ |
2757 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
2758 |
- -delete |
2759 |
- |
2760 |
- # Make slot specific links to programs |
2761 |
- local f bn |
2762 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
2763 |
- -mindepth 1 -maxdepth 1) |
2764 |
- do |
2765 |
- bn=$(basename "${f}") |
2766 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
2767 |
- "/usr/bin/${bn}${SLOT/.}" |
2768 |
- done |
2769 |
- |
2770 |
- if use doc ; then |
2771 |
- docinto html |
2772 |
- dodoc doc/src/sgml/html/* |
2773 |
- fi |
2774 |
- |
2775 |
- if use server; then |
2776 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2777 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
2778 |
- |
2779 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2780 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
2781 |
- |
2782 |
- if use systemd; then |
2783 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2784 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
2785 |
- systemd_newunit - ${PN}-${SLOT}.service |
2786 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2787 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
2788 |
- fi |
2789 |
- |
2790 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2791 |
- |
2792 |
- if use prefix ; then |
2793 |
- keepdir /run/postgresql |
2794 |
- fperms 1775 /run/postgresql |
2795 |
- fi |
2796 |
- fi |
2797 |
-} |
2798 |
- |
2799 |
-pkg_postinst() { |
2800 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
2801 |
- postgresql-config update |
2802 |
- |
2803 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2804 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
2805 |
- |
2806 |
- if use server ; then |
2807 |
- elog |
2808 |
- elog "Gentoo specific documentation:" |
2809 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2810 |
- elog |
2811 |
- elog "Official documentation:" |
2812 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
2813 |
- elog |
2814 |
- elog "The default location of the Unix-domain socket is:" |
2815 |
- elog " ${EROOT}/run/postgresql/" |
2816 |
- elog |
2817 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2818 |
- elog "so that it contains your preferred locale in:" |
2819 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2820 |
- elog |
2821 |
- elog "Then, execute the following command to setup the initial database" |
2822 |
- elog "environment:" |
2823 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2824 |
- |
2825 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
2826 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
2827 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
2828 |
- ewarn "the following command after upgrading:" |
2829 |
- ewarn |
2830 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
2831 |
- fi |
2832 |
- fi |
2833 |
-} |
2834 |
- |
2835 |
-pkg_prerm() { |
2836 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2837 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2838 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2839 |
- |
2840 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2841 |
- sleep 10 |
2842 |
- eend 0 |
2843 |
- fi |
2844 |
-} |
2845 |
- |
2846 |
-pkg_postrm() { |
2847 |
- postgresql-config update |
2848 |
-} |
2849 |
- |
2850 |
-pkg_config() { |
2851 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2852 |
- |
2853 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2854 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2855 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
2856 |
- [[ -z "${DATA_DIR}" ]] \ |
2857 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
2858 |
- |
2859 |
- # environment.bz2 may not contain the same locale as the current system |
2860 |
- # locale. Unset and source from the current system locale. |
2861 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
2862 |
- unset LANG |
2863 |
- unset LC_CTYPE |
2864 |
- unset LC_NUMERIC |
2865 |
- unset LC_TIME |
2866 |
- unset LC_COLLATE |
2867 |
- unset LC_MONETARY |
2868 |
- unset LC_MESSAGES |
2869 |
- unset LC_ALL |
2870 |
- source "${EROOT}/etc/env.d/02locale" |
2871 |
- [ -n "${LANG}" ] && export LANG |
2872 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2873 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2874 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2875 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2876 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2877 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2878 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2879 |
- fi |
2880 |
- |
2881 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2882 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2883 |
- einfo |
2884 |
- einfo "Information on options that can be passed to initdb are found at:" |
2885 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2886 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2887 |
- einfo |
2888 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2889 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2890 |
- einfo " (none)" |
2891 |
- else |
2892 |
- einfo " ${PG_INITDB_OPTS}" |
2893 |
- fi |
2894 |
- einfo |
2895 |
- einfo "Configuration files will be installed to:" |
2896 |
- einfo " ${PGDATA}" |
2897 |
- einfo |
2898 |
- einfo "The database cluster will be created in:" |
2899 |
- einfo " ${DATA_DIR}" |
2900 |
- einfo |
2901 |
- |
2902 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
2903 |
- sleep 5 |
2904 |
- eend 0 |
2905 |
- |
2906 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2907 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2908 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2909 |
- die "${DATA_DIR} is not empty." |
2910 |
- fi |
2911 |
- |
2912 |
- einfo "Creating the data directory ..." |
2913 |
- if [[ ${EUID} == 0 ]] ; then |
2914 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
2915 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
2916 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
2917 |
- fi |
2918 |
- |
2919 |
- einfo "Initializing the database ..." |
2920 |
- |
2921 |
- if [[ ${EUID} == 0 ]] ; then |
2922 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2923 |
- else |
2924 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2925 |
- fi |
2926 |
- |
2927 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2928 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2929 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2930 |
- fi |
2931 |
- |
2932 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
2933 |
- # overridden in the initscript |
2934 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
2935 |
- |
2936 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2937 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2938 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2939 |
- # characters in PL/Perl |
2940 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2941 |
- EOF |
2942 |
- |
2943 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2944 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2945 |
- einfo "by default. You can disable it in the cluster's:" |
2946 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2947 |
- einfo |
2948 |
- if ! use systemd; then |
2949 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2950 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2951 |
- einfo |
2952 |
- fi |
2953 |
- if use prefix ; then |
2954 |
- einfo "The location of the configuration files have moved to:" |
2955 |
- einfo " ${PGDATA}" |
2956 |
- einfo "To start the server:" |
2957 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2958 |
- einfo "To stop:" |
2959 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2960 |
- einfo |
2961 |
- einfo "Or move the configuration files back:" |
2962 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2963 |
- elif use systemd; then |
2964 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
2965 |
- einfo "instead of 'pg_ctl'." |
2966 |
- else |
2967 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2968 |
- einfo "instead of 'pg_ctl'." |
2969 |
- fi |
2970 |
-} |
2971 |
- |
2972 |
-src_test() { |
2973 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2974 |
- emake check |
2975 |
- |
2976 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2977 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2978 |
- else |
2979 |
- use server || \ |
2980 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2981 |
- [[ ${UID} -eq 0 ]] || \ |
2982 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2983 |
- |
2984 |
- ewarn 'Skipping.' |
2985 |
- fi |
2986 |
-} |
2987 |
|
2988 |
diff --git a/dev-db/postgresql/postgresql-11.16.ebuild b/dev-db/postgresql/postgresql-11.16.ebuild |
2989 |
deleted file mode 100644 |
2990 |
index 2fca671b4f2d..000000000000 |
2991 |
--- a/dev-db/postgresql/postgresql-11.16.ebuild |
2992 |
+++ /dev/null |
2993 |
@@ -1,453 +0,0 @@ |
2994 |
-# Copyright 1999-2022 Gentoo Authors |
2995 |
-# Distributed under the terms of the GNU General Public License v2 |
2996 |
- |
2997 |
-EAPI=7 |
2998 |
- |
2999 |
-PYTHON_COMPAT=( python3_{8,9,10,11} ) |
3000 |
-LLVM_MAX_SLOT=13 |
3001 |
- |
3002 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
3003 |
- |
3004 |
-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" |
3005 |
- |
3006 |
-SLOT=$(ver_cut 1) |
3007 |
- |
3008 |
-MY_PV=${PV/_/} |
3009 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
3010 |
- |
3011 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
3012 |
- |
3013 |
-LICENSE="POSTGRESQL GPL-2" |
3014 |
-DESCRIPTION="PostgreSQL RDBMS" |
3015 |
-HOMEPAGE="https://www.postgresql.org/" |
3016 |
- |
3017 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
3018 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
3019 |
- threads uuid xml zlib" |
3020 |
- |
3021 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
3022 |
- |
3023 |
-CDEPEND=" |
3024 |
->=app-eselect/eselect-postgresql-2.0 |
3025 |
-acct-group/postgres |
3026 |
-acct-user/postgres |
3027 |
-sys-apps/less |
3028 |
-virtual/libintl |
3029 |
-icu? ( dev-libs/icu:= ) |
3030 |
-kerberos? ( virtual/krb5 ) |
3031 |
-ldap? ( net-nds/openldap:= ) |
3032 |
-llvm? ( |
3033 |
- <sys-devel/llvm-14:= |
3034 |
- <sys-devel/clang-14:= |
3035 |
-) |
3036 |
-pam? ( sys-libs/pam ) |
3037 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3038 |
-python? ( ${PYTHON_DEPS} ) |
3039 |
-readline? ( sys-libs/readline:0= ) |
3040 |
-server? ( systemd? ( sys-apps/systemd ) ) |
3041 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3042 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3043 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3044 |
-zlib? ( sys-libs/zlib ) |
3045 |
-" |
3046 |
- |
3047 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
3048 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
3049 |
-# the libc includes UUID functions. |
3050 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
3051 |
- |
3052 |
-nest_usedep() { |
3053 |
- local front back |
3054 |
- while [[ ${#} -gt 1 ]]; do |
3055 |
- front+="${1}? ( " |
3056 |
- back+=" )" |
3057 |
- shift |
3058 |
- done |
3059 |
- echo "${front}${1}${back}" |
3060 |
-} |
3061 |
- |
3062 |
-CDEPEND+=" |
3063 |
-uuid? ( |
3064 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
3065 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
3066 |
-)" |
3067 |
- |
3068 |
-DEPEND="${CDEPEND} |
3069 |
-sys-devel/bison |
3070 |
-sys-devel/flex |
3071 |
-nls? ( sys-devel/gettext ) |
3072 |
-xml? ( virtual/pkgconfig ) |
3073 |
-" |
3074 |
- |
3075 |
-RDEPEND="${CDEPEND} |
3076 |
-selinux? ( sec-policy/selinux-postgresql ) |
3077 |
-" |
3078 |
- |
3079 |
-pkg_setup() { |
3080 |
- use llvm && llvm_pkg_setup |
3081 |
- |
3082 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3083 |
- |
3084 |
- use python && python-single-r1_pkg_setup |
3085 |
-} |
3086 |
- |
3087 |
-src_prepare() { |
3088 |
- # Set proper run directory |
3089 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3090 |
- -i src/include/pg_config_manual.h || die |
3091 |
- |
3092 |
- # Rely on $PATH being in the proper order so that the correct |
3093 |
- # install program is used for modules utilizing PGXS in both |
3094 |
- # hardened and non-hardened environments. (Bug #528786) |
3095 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3096 |
- |
3097 |
- use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch" |
3098 |
- |
3099 |
- if use pam ; then |
3100 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3101 |
- -i src/backend/libpq/auth.c || \ |
3102 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3103 |
- fi |
3104 |
- |
3105 |
- eapply_user |
3106 |
-} |
3107 |
- |
3108 |
-src_configure() { |
3109 |
- case ${CHOST} in |
3110 |
- *-darwin*|*-solaris*) |
3111 |
- use nls && append-libs intl |
3112 |
- ;; |
3113 |
- esac |
3114 |
- |
3115 |
- export LDFLAGS_SL="${LDFLAGS}" |
3116 |
- export LDFLAGS_EX="${LDFLAGS}" |
3117 |
- |
3118 |
- local PO="${EPREFIX}" |
3119 |
- |
3120 |
- local i uuid_config="" |
3121 |
- if use uuid; then |
3122 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
3123 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
3124 |
- done |
3125 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
3126 |
- fi |
3127 |
- |
3128 |
- econf \ |
3129 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3130 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3131 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3132 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3133 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3134 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3135 |
- $(use_enable !alpha spinlocks) \ |
3136 |
- $(use_enable debug) \ |
3137 |
- $(use_enable threads thread-safety) \ |
3138 |
- $(use_with icu) \ |
3139 |
- $(use_with kerberos gssapi) \ |
3140 |
- $(use_with ldap) \ |
3141 |
- $(use_with llvm) \ |
3142 |
- $(use_with pam) \ |
3143 |
- $(use_with perl) \ |
3144 |
- $(use_with python) \ |
3145 |
- $(use_with readline) \ |
3146 |
- $(use_with ssl openssl) \ |
3147 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
3148 |
- $(use_with tcl) \ |
3149 |
- ${uuid_config} \ |
3150 |
- $(use_with xml libxml) \ |
3151 |
- $(use_with xml libxslt) \ |
3152 |
- $(use_with zlib) \ |
3153 |
- $(use_enable nls) |
3154 |
-} |
3155 |
- |
3156 |
-src_compile() { |
3157 |
- emake |
3158 |
- emake -C contrib |
3159 |
-} |
3160 |
- |
3161 |
-src_install() { |
3162 |
- emake DESTDIR="${D}" install |
3163 |
- emake DESTDIR="${D}" install -C contrib |
3164 |
- |
3165 |
- dodoc README HISTORY doc/{TODO,bug.template} |
3166 |
- |
3167 |
- # man pages are already built, but if we have the target make them, |
3168 |
- # they'll be generated from source before being installed so we |
3169 |
- # manually install man pages. |
3170 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3171 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3172 |
- doins -r doc/src/sgml/man{1,3,7} |
3173 |
- if ! use server; then |
3174 |
- # Remove man pages for non-existent binaries |
3175 |
- serverman=( |
3176 |
- initdb |
3177 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
3178 |
- pg_{test_{fsync,timing},upgrade,waldump} |
3179 |
- post{gres,master} |
3180 |
- ) |
3181 |
- for m in ${serverman[@]} ; do |
3182 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3183 |
- done |
3184 |
- fi |
3185 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3186 |
- |
3187 |
- # Create slot specific man pages |
3188 |
- local bn f mansec slotted_name |
3189 |
- for mansec in 1 3 7 ; do |
3190 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
3191 |
- |
3192 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
3193 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
3194 |
- |
3195 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
3196 |
- bn=$(basename "${f}") |
3197 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
3198 |
- case ${bn} in |
3199 |
- TABLE.7|WITH.7) |
3200 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
3201 |
- ;; |
3202 |
- *) |
3203 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
3204 |
- ;; |
3205 |
- esac |
3206 |
- done |
3207 |
- |
3208 |
- popd > /dev/null |
3209 |
- done |
3210 |
- |
3211 |
- insinto /etc/postgresql-${SLOT} |
3212 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3213 |
- |
3214 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
3215 |
- # needed by extensions utilizing PGXS. |
3216 |
- use static-libs || \ |
3217 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
3218 |
- -delete |
3219 |
- |
3220 |
- # Make slot specific links to programs |
3221 |
- local f bn |
3222 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
3223 |
- -mindepth 1 -maxdepth 1) |
3224 |
- do |
3225 |
- bn=$(basename "${f}") |
3226 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
3227 |
- "/usr/bin/${bn}${SLOT/.}" |
3228 |
- done |
3229 |
- |
3230 |
- if use doc ; then |
3231 |
- docinto html |
3232 |
- dodoc doc/src/sgml/html/* |
3233 |
- fi |
3234 |
- |
3235 |
- if use server; then |
3236 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3237 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
3238 |
- |
3239 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3240 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
3241 |
- |
3242 |
- if use systemd; then |
3243 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3244 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
3245 |
- systemd_newunit - ${PN}-${SLOT}.service |
3246 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3247 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
3248 |
- fi |
3249 |
- |
3250 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3251 |
- |
3252 |
- if use prefix ; then |
3253 |
- keepdir /run/postgresql |
3254 |
- fperms 1775 /run/postgresql |
3255 |
- fi |
3256 |
- fi |
3257 |
-} |
3258 |
- |
3259 |
-pkg_postinst() { |
3260 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
3261 |
- postgresql-config update |
3262 |
- |
3263 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3264 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
3265 |
- |
3266 |
- if use server ; then |
3267 |
- elog |
3268 |
- elog "Gentoo specific documentation:" |
3269 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3270 |
- elog |
3271 |
- elog "Official documentation:" |
3272 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
3273 |
- elog |
3274 |
- elog "The default location of the Unix-domain socket is:" |
3275 |
- elog " ${EROOT}/run/postgresql/" |
3276 |
- elog |
3277 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3278 |
- elog "so that it contains your preferred locale in:" |
3279 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3280 |
- elog |
3281 |
- elog "Then, execute the following command to setup the initial database" |
3282 |
- elog "environment:" |
3283 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3284 |
- |
3285 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
3286 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
3287 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
3288 |
- ewarn "the following command after upgrading:" |
3289 |
- ewarn |
3290 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
3291 |
- fi |
3292 |
- fi |
3293 |
-} |
3294 |
- |
3295 |
-pkg_prerm() { |
3296 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3297 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3298 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3299 |
- |
3300 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3301 |
- sleep 10 |
3302 |
- eend 0 |
3303 |
- fi |
3304 |
-} |
3305 |
- |
3306 |
-pkg_postrm() { |
3307 |
- postgresql-config update |
3308 |
-} |
3309 |
- |
3310 |
-pkg_config() { |
3311 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3312 |
- |
3313 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3314 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3315 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
3316 |
- [[ -z "${DATA_DIR}" ]] \ |
3317 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
3318 |
- |
3319 |
- # environment.bz2 may not contain the same locale as the current system |
3320 |
- # locale. Unset and source from the current system locale. |
3321 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
3322 |
- unset LANG |
3323 |
- unset LC_CTYPE |
3324 |
- unset LC_NUMERIC |
3325 |
- unset LC_TIME |
3326 |
- unset LC_COLLATE |
3327 |
- unset LC_MONETARY |
3328 |
- unset LC_MESSAGES |
3329 |
- unset LC_ALL |
3330 |
- source "${EROOT}/etc/env.d/02locale" |
3331 |
- [ -n "${LANG}" ] && export LANG |
3332 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3333 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3334 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3335 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3336 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3337 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3338 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3339 |
- fi |
3340 |
- |
3341 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3342 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3343 |
- einfo |
3344 |
- einfo "Information on options that can be passed to initdb are found at:" |
3345 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3346 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3347 |
- einfo |
3348 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3349 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3350 |
- einfo " (none)" |
3351 |
- else |
3352 |
- einfo " ${PG_INITDB_OPTS}" |
3353 |
- fi |
3354 |
- einfo |
3355 |
- einfo "Configuration files will be installed to:" |
3356 |
- einfo " ${PGDATA}" |
3357 |
- einfo |
3358 |
- einfo "The database cluster will be created in:" |
3359 |
- einfo " ${DATA_DIR}" |
3360 |
- einfo |
3361 |
- |
3362 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
3363 |
- sleep 5 |
3364 |
- eend 0 |
3365 |
- |
3366 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3367 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3368 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3369 |
- die "${DATA_DIR} is not empty." |
3370 |
- fi |
3371 |
- |
3372 |
- einfo "Creating the data directory ..." |
3373 |
- if [[ ${EUID} == 0 ]] ; then |
3374 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
3375 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
3376 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
3377 |
- fi |
3378 |
- |
3379 |
- einfo "Initializing the database ..." |
3380 |
- |
3381 |
- if [[ ${EUID} == 0 ]] ; then |
3382 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3383 |
- else |
3384 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3385 |
- fi |
3386 |
- |
3387 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3388 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3389 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3390 |
- fi |
3391 |
- |
3392 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
3393 |
- # overridden in the initscript |
3394 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
3395 |
- |
3396 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3397 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3398 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3399 |
- # characters in PL/Perl |
3400 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3401 |
- EOF |
3402 |
- |
3403 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3404 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3405 |
- einfo "by default. You can disable it in the cluster's:" |
3406 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3407 |
- einfo |
3408 |
- if ! use systemd; then |
3409 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3410 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3411 |
- einfo |
3412 |
- fi |
3413 |
- if use prefix ; then |
3414 |
- einfo "The location of the configuration files have moved to:" |
3415 |
- einfo " ${PGDATA}" |
3416 |
- einfo "To start the server:" |
3417 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3418 |
- einfo "To stop:" |
3419 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3420 |
- einfo |
3421 |
- einfo "Or move the configuration files back:" |
3422 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3423 |
- elif use systemd; then |
3424 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
3425 |
- einfo "instead of 'pg_ctl'." |
3426 |
- else |
3427 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3428 |
- einfo "instead of 'pg_ctl'." |
3429 |
- fi |
3430 |
-} |
3431 |
- |
3432 |
-src_test() { |
3433 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3434 |
- emake check |
3435 |
- |
3436 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3437 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3438 |
- else |
3439 |
- use server || \ |
3440 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3441 |
- [[ ${UID} -eq 0 ]] || \ |
3442 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3443 |
- |
3444 |
- ewarn 'Skipping.' |
3445 |
- fi |
3446 |
-} |
3447 |
|
3448 |
diff --git a/dev-db/postgresql/postgresql-12.10-r1.ebuild b/dev-db/postgresql/postgresql-12.10-r1.ebuild |
3449 |
deleted file mode 100644 |
3450 |
index b34da8d7f42d..000000000000 |
3451 |
--- a/dev-db/postgresql/postgresql-12.10-r1.ebuild |
3452 |
+++ /dev/null |
3453 |
@@ -1,454 +0,0 @@ |
3454 |
-# Copyright 1999-2022 Gentoo Authors |
3455 |
-# Distributed under the terms of the GNU General Public License v2 |
3456 |
- |
3457 |
-EAPI=7 |
3458 |
- |
3459 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
3460 |
-LLVM_MAX_SLOT=14 |
3461 |
- |
3462 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
3463 |
- |
3464 |
-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" |
3465 |
- |
3466 |
-SLOT=$(ver_cut 1) |
3467 |
- |
3468 |
-MY_PV=${PV/_/} |
3469 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
3470 |
- |
3471 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
3472 |
- |
3473 |
-LICENSE="POSTGRESQL GPL-2" |
3474 |
-DESCRIPTION="PostgreSQL RDBMS" |
3475 |
-HOMEPAGE="https://www.postgresql.org/" |
3476 |
- |
3477 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
3478 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
3479 |
- threads uuid xml zlib" |
3480 |
- |
3481 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
3482 |
- |
3483 |
-CDEPEND=" |
3484 |
->=app-eselect/eselect-postgresql-2.0 |
3485 |
-acct-group/postgres |
3486 |
-acct-user/postgres |
3487 |
-sys-apps/less |
3488 |
-virtual/libintl |
3489 |
-icu? ( dev-libs/icu:= ) |
3490 |
-kerberos? ( virtual/krb5 ) |
3491 |
-ldap? ( net-nds/openldap:= ) |
3492 |
-llvm? ( |
3493 |
- <sys-devel/llvm-15:= |
3494 |
- <sys-devel/clang-15:= |
3495 |
-) |
3496 |
-pam? ( sys-libs/pam ) |
3497 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3498 |
-python? ( ${PYTHON_DEPS} ) |
3499 |
-readline? ( sys-libs/readline:0= ) |
3500 |
-server? ( systemd? ( sys-apps/systemd ) ) |
3501 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3502 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3503 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3504 |
-zlib? ( sys-libs/zlib ) |
3505 |
-" |
3506 |
- |
3507 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
3508 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
3509 |
-# the libc includes UUID functions. |
3510 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
3511 |
- |
3512 |
-nest_usedep() { |
3513 |
- local front back |
3514 |
- while [[ ${#} -gt 1 ]]; do |
3515 |
- front+="${1}? ( " |
3516 |
- back+=" )" |
3517 |
- shift |
3518 |
- done |
3519 |
- echo "${front}${1}${back}" |
3520 |
-} |
3521 |
- |
3522 |
-CDEPEND+=" |
3523 |
-uuid? ( |
3524 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
3525 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
3526 |
-)" |
3527 |
- |
3528 |
-DEPEND="${CDEPEND} |
3529 |
-sys-devel/bison |
3530 |
-sys-devel/flex |
3531 |
-nls? ( sys-devel/gettext ) |
3532 |
-xml? ( virtual/pkgconfig ) |
3533 |
-" |
3534 |
- |
3535 |
-RDEPEND="${CDEPEND} |
3536 |
-selinux? ( sec-policy/selinux-postgresql ) |
3537 |
-" |
3538 |
- |
3539 |
-pkg_setup() { |
3540 |
- use llvm && llvm_pkg_setup |
3541 |
- |
3542 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3543 |
- |
3544 |
- use python && python-single-r1_pkg_setup |
3545 |
-} |
3546 |
- |
3547 |
-src_prepare() { |
3548 |
- # Set proper run directory |
3549 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3550 |
- -i src/include/pg_config_manual.h || die |
3551 |
- |
3552 |
- # Rely on $PATH being in the proper order so that the correct |
3553 |
- # install program is used for modules utilizing PGXS in both |
3554 |
- # hardened and non-hardened environments. (Bug #528786) |
3555 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3556 |
- |
3557 |
- use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch" |
3558 |
- use llvm && eapply "${FILESDIR}/postgres-llvm14.patch" |
3559 |
- |
3560 |
- if use pam ; then |
3561 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3562 |
- -i src/backend/libpq/auth.c || \ |
3563 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3564 |
- fi |
3565 |
- |
3566 |
- eapply_user |
3567 |
-} |
3568 |
- |
3569 |
-src_configure() { |
3570 |
- case ${CHOST} in |
3571 |
- *-darwin*|*-solaris*) |
3572 |
- use nls && append-libs intl |
3573 |
- ;; |
3574 |
- esac |
3575 |
- |
3576 |
- export LDFLAGS_SL="${LDFLAGS}" |
3577 |
- export LDFLAGS_EX="${LDFLAGS}" |
3578 |
- |
3579 |
- local PO="${EPREFIX}" |
3580 |
- |
3581 |
- local i uuid_config="" |
3582 |
- if use uuid; then |
3583 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
3584 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
3585 |
- done |
3586 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
3587 |
- fi |
3588 |
- |
3589 |
- econf \ |
3590 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3591 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3592 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3593 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3594 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3595 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3596 |
- $(use_enable !alpha spinlocks) \ |
3597 |
- $(use_enable debug) \ |
3598 |
- $(use_enable threads thread-safety) \ |
3599 |
- $(use_with icu) \ |
3600 |
- $(use_with kerberos gssapi) \ |
3601 |
- $(use_with ldap) \ |
3602 |
- $(use_with llvm) \ |
3603 |
- $(use_with pam) \ |
3604 |
- $(use_with perl) \ |
3605 |
- $(use_with python) \ |
3606 |
- $(use_with readline) \ |
3607 |
- $(use_with ssl openssl) \ |
3608 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
3609 |
- $(use_with tcl) \ |
3610 |
- ${uuid_config} \ |
3611 |
- $(use_with xml libxml) \ |
3612 |
- $(use_with xml libxslt) \ |
3613 |
- $(use_with zlib) \ |
3614 |
- $(use_enable nls) |
3615 |
-} |
3616 |
- |
3617 |
-src_compile() { |
3618 |
- emake |
3619 |
- emake -C contrib |
3620 |
-} |
3621 |
- |
3622 |
-src_install() { |
3623 |
- emake DESTDIR="${D}" install |
3624 |
- emake DESTDIR="${D}" install -C contrib |
3625 |
- |
3626 |
- dodoc README HISTORY |
3627 |
- |
3628 |
- # man pages are already built, but if we have the target make them, |
3629 |
- # they'll be generated from source before being installed so we |
3630 |
- # manually install man pages. |
3631 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3632 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3633 |
- doins -r doc/src/sgml/man{1,3,7} |
3634 |
- if ! use server; then |
3635 |
- # Remove man pages for non-existent binaries |
3636 |
- serverman=( |
3637 |
- initdb |
3638 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
3639 |
- pg_{test_{fsync,timing},upgrade,waldump} |
3640 |
- post{gres,master} |
3641 |
- ) |
3642 |
- for m in ${serverman[@]} ; do |
3643 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3644 |
- done |
3645 |
- fi |
3646 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3647 |
- |
3648 |
- # Create slot specific man pages |
3649 |
- local bn f mansec slotted_name |
3650 |
- for mansec in 1 3 7 ; do |
3651 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
3652 |
- |
3653 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
3654 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
3655 |
- |
3656 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
3657 |
- bn=$(basename "${f}") |
3658 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
3659 |
- case ${bn} in |
3660 |
- TABLE.7|WITH.7) |
3661 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
3662 |
- ;; |
3663 |
- *) |
3664 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
3665 |
- ;; |
3666 |
- esac |
3667 |
- done |
3668 |
- |
3669 |
- popd > /dev/null |
3670 |
- done |
3671 |
- |
3672 |
- insinto /etc/postgresql-${SLOT} |
3673 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3674 |
- |
3675 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
3676 |
- # needed by extensions utilizing PGXS. |
3677 |
- use static-libs || \ |
3678 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
3679 |
- -delete |
3680 |
- |
3681 |
- # Make slot specific links to programs |
3682 |
- local f bn |
3683 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
3684 |
- -mindepth 1 -maxdepth 1) |
3685 |
- do |
3686 |
- bn=$(basename "${f}") |
3687 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
3688 |
- "/usr/bin/${bn}${SLOT/.}" |
3689 |
- done |
3690 |
- |
3691 |
- if use doc ; then |
3692 |
- docinto html |
3693 |
- dodoc doc/src/sgml/html/* |
3694 |
- fi |
3695 |
- |
3696 |
- if use server; then |
3697 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3698 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
3699 |
- |
3700 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3701 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
3702 |
- |
3703 |
- if use systemd; then |
3704 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3705 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
3706 |
- systemd_newunit - ${PN}-${SLOT}.service |
3707 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3708 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
3709 |
- fi |
3710 |
- |
3711 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3712 |
- |
3713 |
- if use prefix ; then |
3714 |
- keepdir /run/postgresql |
3715 |
- fperms 1775 /run/postgresql |
3716 |
- fi |
3717 |
- fi |
3718 |
-} |
3719 |
- |
3720 |
-pkg_postinst() { |
3721 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
3722 |
- postgresql-config update |
3723 |
- |
3724 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3725 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
3726 |
- |
3727 |
- if use server ; then |
3728 |
- elog |
3729 |
- elog "Gentoo specific documentation:" |
3730 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3731 |
- elog |
3732 |
- elog "Official documentation:" |
3733 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
3734 |
- elog |
3735 |
- elog "The default location of the Unix-domain socket is:" |
3736 |
- elog " ${EROOT}/run/postgresql/" |
3737 |
- elog |
3738 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3739 |
- elog "so that it contains your preferred locale in:" |
3740 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3741 |
- elog |
3742 |
- elog "Then, execute the following command to setup the initial database" |
3743 |
- elog "environment:" |
3744 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3745 |
- |
3746 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
3747 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
3748 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
3749 |
- ewarn "the following command after upgrading:" |
3750 |
- ewarn |
3751 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
3752 |
- fi |
3753 |
- fi |
3754 |
-} |
3755 |
- |
3756 |
-pkg_prerm() { |
3757 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3758 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3759 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3760 |
- |
3761 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3762 |
- sleep 10 |
3763 |
- eend 0 |
3764 |
- fi |
3765 |
-} |
3766 |
- |
3767 |
-pkg_postrm() { |
3768 |
- postgresql-config update |
3769 |
-} |
3770 |
- |
3771 |
-pkg_config() { |
3772 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3773 |
- |
3774 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3775 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3776 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
3777 |
- [[ -z "${DATA_DIR}" ]] \ |
3778 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
3779 |
- |
3780 |
- # environment.bz2 may not contain the same locale as the current system |
3781 |
- # locale. Unset and source from the current system locale. |
3782 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
3783 |
- unset LANG |
3784 |
- unset LC_CTYPE |
3785 |
- unset LC_NUMERIC |
3786 |
- unset LC_TIME |
3787 |
- unset LC_COLLATE |
3788 |
- unset LC_MONETARY |
3789 |
- unset LC_MESSAGES |
3790 |
- unset LC_ALL |
3791 |
- source "${EROOT}/etc/env.d/02locale" |
3792 |
- [ -n "${LANG}" ] && export LANG |
3793 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3794 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3795 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3796 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3797 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3798 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3799 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3800 |
- fi |
3801 |
- |
3802 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3803 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3804 |
- einfo |
3805 |
- einfo "Information on options that can be passed to initdb are found at:" |
3806 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3807 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3808 |
- einfo |
3809 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3810 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3811 |
- einfo " (none)" |
3812 |
- else |
3813 |
- einfo " ${PG_INITDB_OPTS}" |
3814 |
- fi |
3815 |
- einfo |
3816 |
- einfo "Configuration files will be installed to:" |
3817 |
- einfo " ${PGDATA}" |
3818 |
- einfo |
3819 |
- einfo "The database cluster will be created in:" |
3820 |
- einfo " ${DATA_DIR}" |
3821 |
- einfo |
3822 |
- |
3823 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
3824 |
- sleep 5 |
3825 |
- eend 0 |
3826 |
- |
3827 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3828 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3829 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3830 |
- die "${DATA_DIR} is not empty." |
3831 |
- fi |
3832 |
- |
3833 |
- einfo "Creating the data directory ..." |
3834 |
- if [[ ${EUID} == 0 ]] ; then |
3835 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
3836 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
3837 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
3838 |
- fi |
3839 |
- |
3840 |
- einfo "Initializing the database ..." |
3841 |
- |
3842 |
- if [[ ${EUID} == 0 ]] ; then |
3843 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3844 |
- else |
3845 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3846 |
- fi |
3847 |
- |
3848 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3849 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3850 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3851 |
- fi |
3852 |
- |
3853 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
3854 |
- # overridden in the initscript |
3855 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
3856 |
- |
3857 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3858 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3859 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3860 |
- # characters in PL/Perl |
3861 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3862 |
- EOF |
3863 |
- |
3864 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3865 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3866 |
- einfo "by default. You can disable it in the cluster's:" |
3867 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3868 |
- einfo |
3869 |
- if ! use systemd; then |
3870 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3871 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3872 |
- einfo |
3873 |
- fi |
3874 |
- if use prefix ; then |
3875 |
- einfo "The location of the configuration files have moved to:" |
3876 |
- einfo " ${PGDATA}" |
3877 |
- einfo "To start the server:" |
3878 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3879 |
- einfo "To stop:" |
3880 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3881 |
- einfo |
3882 |
- einfo "Or move the configuration files back:" |
3883 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3884 |
- elif use systemd; then |
3885 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
3886 |
- einfo "instead of 'pg_ctl'." |
3887 |
- else |
3888 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3889 |
- einfo "instead of 'pg_ctl'." |
3890 |
- fi |
3891 |
-} |
3892 |
- |
3893 |
-src_test() { |
3894 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3895 |
- emake check |
3896 |
- |
3897 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3898 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3899 |
- else |
3900 |
- use server || \ |
3901 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3902 |
- [[ ${UID} -eq 0 ]] || \ |
3903 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3904 |
- |
3905 |
- ewarn 'Skipping.' |
3906 |
- fi |
3907 |
-} |
3908 |
|
3909 |
diff --git a/dev-db/postgresql/postgresql-12.11.ebuild b/dev-db/postgresql/postgresql-12.11.ebuild |
3910 |
deleted file mode 100644 |
3911 |
index 1930b6f2927d..000000000000 |
3912 |
--- a/dev-db/postgresql/postgresql-12.11.ebuild |
3913 |
+++ /dev/null |
3914 |
@@ -1,453 +0,0 @@ |
3915 |
-# Copyright 1999-2022 Gentoo Authors |
3916 |
-# Distributed under the terms of the GNU General Public License v2 |
3917 |
- |
3918 |
-EAPI=7 |
3919 |
- |
3920 |
-PYTHON_COMPAT=( python3_{8,9,10,11} ) |
3921 |
-LLVM_MAX_SLOT=14 |
3922 |
- |
3923 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
3924 |
- |
3925 |
-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" |
3926 |
- |
3927 |
-SLOT=$(ver_cut 1) |
3928 |
- |
3929 |
-MY_PV=${PV/_/} |
3930 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
3931 |
- |
3932 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
3933 |
- |
3934 |
-LICENSE="POSTGRESQL GPL-2" |
3935 |
-DESCRIPTION="PostgreSQL RDBMS" |
3936 |
-HOMEPAGE="https://www.postgresql.org/" |
3937 |
- |
3938 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
3939 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
3940 |
- threads uuid xml zlib" |
3941 |
- |
3942 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
3943 |
- |
3944 |
-CDEPEND=" |
3945 |
->=app-eselect/eselect-postgresql-2.0 |
3946 |
-acct-group/postgres |
3947 |
-acct-user/postgres |
3948 |
-sys-apps/less |
3949 |
-virtual/libintl |
3950 |
-icu? ( dev-libs/icu:= ) |
3951 |
-kerberos? ( virtual/krb5 ) |
3952 |
-ldap? ( net-nds/openldap:= ) |
3953 |
-llvm? ( |
3954 |
- <sys-devel/llvm-15:= |
3955 |
- <sys-devel/clang-15:= |
3956 |
-) |
3957 |
-pam? ( sys-libs/pam ) |
3958 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3959 |
-python? ( ${PYTHON_DEPS} ) |
3960 |
-readline? ( sys-libs/readline:0= ) |
3961 |
-server? ( systemd? ( sys-apps/systemd ) ) |
3962 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3963 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3964 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3965 |
-zlib? ( sys-libs/zlib ) |
3966 |
-" |
3967 |
- |
3968 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
3969 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
3970 |
-# the libc includes UUID functions. |
3971 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
3972 |
- |
3973 |
-nest_usedep() { |
3974 |
- local front back |
3975 |
- while [[ ${#} -gt 1 ]]; do |
3976 |
- front+="${1}? ( " |
3977 |
- back+=" )" |
3978 |
- shift |
3979 |
- done |
3980 |
- echo "${front}${1}${back}" |
3981 |
-} |
3982 |
- |
3983 |
-CDEPEND+=" |
3984 |
-uuid? ( |
3985 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
3986 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
3987 |
-)" |
3988 |
- |
3989 |
-DEPEND="${CDEPEND} |
3990 |
-sys-devel/bison |
3991 |
-sys-devel/flex |
3992 |
-nls? ( sys-devel/gettext ) |
3993 |
-xml? ( virtual/pkgconfig ) |
3994 |
-" |
3995 |
- |
3996 |
-RDEPEND="${CDEPEND} |
3997 |
-selinux? ( sec-policy/selinux-postgresql ) |
3998 |
-" |
3999 |
- |
4000 |
-pkg_setup() { |
4001 |
- use llvm && llvm_pkg_setup |
4002 |
- |
4003 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4004 |
- |
4005 |
- use python && python-single-r1_pkg_setup |
4006 |
-} |
4007 |
- |
4008 |
-src_prepare() { |
4009 |
- # Set proper run directory |
4010 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4011 |
- -i src/include/pg_config_manual.h || die |
4012 |
- |
4013 |
- # Rely on $PATH being in the proper order so that the correct |
4014 |
- # install program is used for modules utilizing PGXS in both |
4015 |
- # hardened and non-hardened environments. (Bug #528786) |
4016 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4017 |
- |
4018 |
- use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch" |
4019 |
- |
4020 |
- if use pam ; then |
4021 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4022 |
- -i src/backend/libpq/auth.c || \ |
4023 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4024 |
- fi |
4025 |
- |
4026 |
- eapply_user |
4027 |
-} |
4028 |
- |
4029 |
-src_configure() { |
4030 |
- case ${CHOST} in |
4031 |
- *-darwin*|*-solaris*) |
4032 |
- use nls && append-libs intl |
4033 |
- ;; |
4034 |
- esac |
4035 |
- |
4036 |
- export LDFLAGS_SL="${LDFLAGS}" |
4037 |
- export LDFLAGS_EX="${LDFLAGS}" |
4038 |
- |
4039 |
- local PO="${EPREFIX}" |
4040 |
- |
4041 |
- local i uuid_config="" |
4042 |
- if use uuid; then |
4043 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4044 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4045 |
- done |
4046 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4047 |
- fi |
4048 |
- |
4049 |
- econf \ |
4050 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4051 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4052 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4053 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4054 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4055 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4056 |
- $(use_enable !alpha spinlocks) \ |
4057 |
- $(use_enable debug) \ |
4058 |
- $(use_enable threads thread-safety) \ |
4059 |
- $(use_with icu) \ |
4060 |
- $(use_with kerberos gssapi) \ |
4061 |
- $(use_with ldap) \ |
4062 |
- $(use_with llvm) \ |
4063 |
- $(use_with pam) \ |
4064 |
- $(use_with perl) \ |
4065 |
- $(use_with python) \ |
4066 |
- $(use_with readline) \ |
4067 |
- $(use_with ssl openssl) \ |
4068 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
4069 |
- $(use_with tcl) \ |
4070 |
- ${uuid_config} \ |
4071 |
- $(use_with xml libxml) \ |
4072 |
- $(use_with xml libxslt) \ |
4073 |
- $(use_with zlib) \ |
4074 |
- $(use_enable nls) |
4075 |
-} |
4076 |
- |
4077 |
-src_compile() { |
4078 |
- emake |
4079 |
- emake -C contrib |
4080 |
-} |
4081 |
- |
4082 |
-src_install() { |
4083 |
- emake DESTDIR="${D}" install |
4084 |
- emake DESTDIR="${D}" install -C contrib |
4085 |
- |
4086 |
- dodoc README HISTORY |
4087 |
- |
4088 |
- # man pages are already built, but if we have the target make them, |
4089 |
- # they'll be generated from source before being installed so we |
4090 |
- # manually install man pages. |
4091 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4092 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4093 |
- doins -r doc/src/sgml/man{1,3,7} |
4094 |
- if ! use server; then |
4095 |
- # Remove man pages for non-existent binaries |
4096 |
- serverman=( |
4097 |
- initdb |
4098 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
4099 |
- pg_{test_{fsync,timing},upgrade,waldump} |
4100 |
- post{gres,master} |
4101 |
- ) |
4102 |
- for m in ${serverman[@]} ; do |
4103 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4104 |
- done |
4105 |
- fi |
4106 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4107 |
- |
4108 |
- # Create slot specific man pages |
4109 |
- local bn f mansec slotted_name |
4110 |
- for mansec in 1 3 7 ; do |
4111 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
4112 |
- |
4113 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
4114 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
4115 |
- |
4116 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
4117 |
- bn=$(basename "${f}") |
4118 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
4119 |
- case ${bn} in |
4120 |
- TABLE.7|WITH.7) |
4121 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
4122 |
- ;; |
4123 |
- *) |
4124 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
4125 |
- ;; |
4126 |
- esac |
4127 |
- done |
4128 |
- |
4129 |
- popd > /dev/null |
4130 |
- done |
4131 |
- |
4132 |
- insinto /etc/postgresql-${SLOT} |
4133 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4134 |
- |
4135 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
4136 |
- # needed by extensions utilizing PGXS. |
4137 |
- use static-libs || \ |
4138 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
4139 |
- -delete |
4140 |
- |
4141 |
- # Make slot specific links to programs |
4142 |
- local f bn |
4143 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
4144 |
- -mindepth 1 -maxdepth 1) |
4145 |
- do |
4146 |
- bn=$(basename "${f}") |
4147 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
4148 |
- "/usr/bin/${bn}${SLOT/.}" |
4149 |
- done |
4150 |
- |
4151 |
- if use doc ; then |
4152 |
- docinto html |
4153 |
- dodoc doc/src/sgml/html/* |
4154 |
- fi |
4155 |
- |
4156 |
- if use server; then |
4157 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4158 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
4159 |
- |
4160 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4161 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
4162 |
- |
4163 |
- if use systemd; then |
4164 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4165 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
4166 |
- systemd_newunit - ${PN}-${SLOT}.service |
4167 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4168 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
4169 |
- fi |
4170 |
- |
4171 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4172 |
- |
4173 |
- if use prefix ; then |
4174 |
- keepdir /run/postgresql |
4175 |
- fperms 1775 /run/postgresql |
4176 |
- fi |
4177 |
- fi |
4178 |
-} |
4179 |
- |
4180 |
-pkg_postinst() { |
4181 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
4182 |
- postgresql-config update |
4183 |
- |
4184 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4185 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
4186 |
- |
4187 |
- if use server ; then |
4188 |
- elog |
4189 |
- elog "Gentoo specific documentation:" |
4190 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4191 |
- elog |
4192 |
- elog "Official documentation:" |
4193 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
4194 |
- elog |
4195 |
- elog "The default location of the Unix-domain socket is:" |
4196 |
- elog " ${EROOT}/run/postgresql/" |
4197 |
- elog |
4198 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4199 |
- elog "so that it contains your preferred locale in:" |
4200 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4201 |
- elog |
4202 |
- elog "Then, execute the following command to setup the initial database" |
4203 |
- elog "environment:" |
4204 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4205 |
- |
4206 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
4207 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
4208 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
4209 |
- ewarn "the following command after upgrading:" |
4210 |
- ewarn |
4211 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
4212 |
- fi |
4213 |
- fi |
4214 |
-} |
4215 |
- |
4216 |
-pkg_prerm() { |
4217 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4218 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4219 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4220 |
- |
4221 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4222 |
- sleep 10 |
4223 |
- eend 0 |
4224 |
- fi |
4225 |
-} |
4226 |
- |
4227 |
-pkg_postrm() { |
4228 |
- postgresql-config update |
4229 |
-} |
4230 |
- |
4231 |
-pkg_config() { |
4232 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4233 |
- |
4234 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4235 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4236 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
4237 |
- [[ -z "${DATA_DIR}" ]] \ |
4238 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
4239 |
- |
4240 |
- # environment.bz2 may not contain the same locale as the current system |
4241 |
- # locale. Unset and source from the current system locale. |
4242 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
4243 |
- unset LANG |
4244 |
- unset LC_CTYPE |
4245 |
- unset LC_NUMERIC |
4246 |
- unset LC_TIME |
4247 |
- unset LC_COLLATE |
4248 |
- unset LC_MONETARY |
4249 |
- unset LC_MESSAGES |
4250 |
- unset LC_ALL |
4251 |
- source "${EROOT}/etc/env.d/02locale" |
4252 |
- [ -n "${LANG}" ] && export LANG |
4253 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4254 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4255 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4256 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4257 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4258 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4259 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4260 |
- fi |
4261 |
- |
4262 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4263 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4264 |
- einfo |
4265 |
- einfo "Information on options that can be passed to initdb are found at:" |
4266 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4267 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4268 |
- einfo |
4269 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4270 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4271 |
- einfo " (none)" |
4272 |
- else |
4273 |
- einfo " ${PG_INITDB_OPTS}" |
4274 |
- fi |
4275 |
- einfo |
4276 |
- einfo "Configuration files will be installed to:" |
4277 |
- einfo " ${PGDATA}" |
4278 |
- einfo |
4279 |
- einfo "The database cluster will be created in:" |
4280 |
- einfo " ${DATA_DIR}" |
4281 |
- einfo |
4282 |
- |
4283 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
4284 |
- sleep 5 |
4285 |
- eend 0 |
4286 |
- |
4287 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4288 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4289 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4290 |
- die "${DATA_DIR} is not empty." |
4291 |
- fi |
4292 |
- |
4293 |
- einfo "Creating the data directory ..." |
4294 |
- if [[ ${EUID} == 0 ]] ; then |
4295 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
4296 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
4297 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
4298 |
- fi |
4299 |
- |
4300 |
- einfo "Initializing the database ..." |
4301 |
- |
4302 |
- if [[ ${EUID} == 0 ]] ; then |
4303 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4304 |
- else |
4305 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4306 |
- fi |
4307 |
- |
4308 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4309 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4310 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4311 |
- fi |
4312 |
- |
4313 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
4314 |
- # overridden in the initscript |
4315 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
4316 |
- |
4317 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4318 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4319 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4320 |
- # characters in PL/Perl |
4321 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4322 |
- EOF |
4323 |
- |
4324 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4325 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4326 |
- einfo "by default. You can disable it in the cluster's:" |
4327 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4328 |
- einfo |
4329 |
- if ! use systemd; then |
4330 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4331 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4332 |
- einfo |
4333 |
- fi |
4334 |
- if use prefix ; then |
4335 |
- einfo "The location of the configuration files have moved to:" |
4336 |
- einfo " ${PGDATA}" |
4337 |
- einfo "To start the server:" |
4338 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4339 |
- einfo "To stop:" |
4340 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4341 |
- einfo |
4342 |
- einfo "Or move the configuration files back:" |
4343 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4344 |
- elif use systemd; then |
4345 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
4346 |
- einfo "instead of 'pg_ctl'." |
4347 |
- else |
4348 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4349 |
- einfo "instead of 'pg_ctl'." |
4350 |
- fi |
4351 |
-} |
4352 |
- |
4353 |
-src_test() { |
4354 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4355 |
- emake check |
4356 |
- |
4357 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4358 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4359 |
- else |
4360 |
- use server || \ |
4361 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4362 |
- [[ ${UID} -eq 0 ]] || \ |
4363 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4364 |
- |
4365 |
- ewarn 'Skipping.' |
4366 |
- fi |
4367 |
-} |
4368 |
|
4369 |
diff --git a/dev-db/postgresql/postgresql-12.9-r1.ebuild b/dev-db/postgresql/postgresql-12.9-r1.ebuild |
4370 |
deleted file mode 100644 |
4371 |
index e59f0a032797..000000000000 |
4372 |
--- a/dev-db/postgresql/postgresql-12.9-r1.ebuild |
4373 |
+++ /dev/null |
4374 |
@@ -1,454 +0,0 @@ |
4375 |
-# Copyright 1999-2022 Gentoo Authors |
4376 |
-# Distributed under the terms of the GNU General Public License v2 |
4377 |
- |
4378 |
-EAPI=7 |
4379 |
- |
4380 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
4381 |
-LLVM_MAX_SLOT=14 |
4382 |
- |
4383 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
4384 |
- |
4385 |
-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" |
4386 |
- |
4387 |
-SLOT=$(ver_cut 1) |
4388 |
- |
4389 |
-MY_PV=${PV/_/} |
4390 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
4391 |
- |
4392 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
4393 |
- |
4394 |
-LICENSE="POSTGRESQL GPL-2" |
4395 |
-DESCRIPTION="PostgreSQL RDBMS" |
4396 |
-HOMEPAGE="https://www.postgresql.org/" |
4397 |
- |
4398 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
4399 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
4400 |
- threads uuid xml zlib" |
4401 |
- |
4402 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
4403 |
- |
4404 |
-CDEPEND=" |
4405 |
->=app-eselect/eselect-postgresql-2.0 |
4406 |
-acct-group/postgres |
4407 |
-acct-user/postgres |
4408 |
-sys-apps/less |
4409 |
-virtual/libintl |
4410 |
-icu? ( dev-libs/icu:= ) |
4411 |
-kerberos? ( virtual/krb5 ) |
4412 |
-ldap? ( net-nds/openldap:= ) |
4413 |
-llvm? ( |
4414 |
- <sys-devel/llvm-15:= |
4415 |
- <sys-devel/clang-15:= |
4416 |
-) |
4417 |
-pam? ( sys-libs/pam ) |
4418 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4419 |
-python? ( ${PYTHON_DEPS} ) |
4420 |
-readline? ( sys-libs/readline:0= ) |
4421 |
-server? ( systemd? ( sys-apps/systemd ) ) |
4422 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4423 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4424 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4425 |
-zlib? ( sys-libs/zlib ) |
4426 |
-" |
4427 |
- |
4428 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4429 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4430 |
-# the libc includes UUID functions. |
4431 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
4432 |
- |
4433 |
-nest_usedep() { |
4434 |
- local front back |
4435 |
- while [[ ${#} -gt 1 ]]; do |
4436 |
- front+="${1}? ( " |
4437 |
- back+=" )" |
4438 |
- shift |
4439 |
- done |
4440 |
- echo "${front}${1}${back}" |
4441 |
-} |
4442 |
- |
4443 |
-CDEPEND+=" |
4444 |
-uuid? ( |
4445 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4446 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4447 |
-)" |
4448 |
- |
4449 |
-DEPEND="${CDEPEND} |
4450 |
-sys-devel/bison |
4451 |
-sys-devel/flex |
4452 |
-nls? ( sys-devel/gettext ) |
4453 |
-xml? ( virtual/pkgconfig ) |
4454 |
-" |
4455 |
- |
4456 |
-RDEPEND="${CDEPEND} |
4457 |
-selinux? ( sec-policy/selinux-postgresql ) |
4458 |
-" |
4459 |
- |
4460 |
-pkg_setup() { |
4461 |
- use llvm && llvm_pkg_setup |
4462 |
- |
4463 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4464 |
- |
4465 |
- use python && python-single-r1_pkg_setup |
4466 |
-} |
4467 |
- |
4468 |
-src_prepare() { |
4469 |
- # Set proper run directory |
4470 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4471 |
- -i src/include/pg_config_manual.h || die |
4472 |
- |
4473 |
- # Rely on $PATH being in the proper order so that the correct |
4474 |
- # install program is used for modules utilizing PGXS in both |
4475 |
- # hardened and non-hardened environments. (Bug #528786) |
4476 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4477 |
- |
4478 |
- use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch" |
4479 |
- use llvm && eapply "${FILESDIR}/postgres-llvm14.patch" |
4480 |
- |
4481 |
- if use pam ; then |
4482 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4483 |
- -i src/backend/libpq/auth.c || \ |
4484 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4485 |
- fi |
4486 |
- |
4487 |
- eapply_user |
4488 |
-} |
4489 |
- |
4490 |
-src_configure() { |
4491 |
- case ${CHOST} in |
4492 |
- *-darwin*|*-solaris*) |
4493 |
- use nls && append-libs intl |
4494 |
- ;; |
4495 |
- esac |
4496 |
- |
4497 |
- export LDFLAGS_SL="${LDFLAGS}" |
4498 |
- export LDFLAGS_EX="${LDFLAGS}" |
4499 |
- |
4500 |
- local PO="${EPREFIX}" |
4501 |
- |
4502 |
- local i uuid_config="" |
4503 |
- if use uuid; then |
4504 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4505 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4506 |
- done |
4507 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4508 |
- fi |
4509 |
- |
4510 |
- econf \ |
4511 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4512 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4513 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4514 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4515 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4516 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4517 |
- $(use_enable !alpha spinlocks) \ |
4518 |
- $(use_enable debug) \ |
4519 |
- $(use_enable threads thread-safety) \ |
4520 |
- $(use_with icu) \ |
4521 |
- $(use_with kerberos gssapi) \ |
4522 |
- $(use_with ldap) \ |
4523 |
- $(use_with llvm) \ |
4524 |
- $(use_with pam) \ |
4525 |
- $(use_with perl) \ |
4526 |
- $(use_with python) \ |
4527 |
- $(use_with readline) \ |
4528 |
- $(use_with ssl openssl) \ |
4529 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
4530 |
- $(use_with tcl) \ |
4531 |
- ${uuid_config} \ |
4532 |
- $(use_with xml libxml) \ |
4533 |
- $(use_with xml libxslt) \ |
4534 |
- $(use_with zlib) \ |
4535 |
- $(use_enable nls) |
4536 |
-} |
4537 |
- |
4538 |
-src_compile() { |
4539 |
- emake |
4540 |
- emake -C contrib |
4541 |
-} |
4542 |
- |
4543 |
-src_install() { |
4544 |
- emake DESTDIR="${D}" install |
4545 |
- emake DESTDIR="${D}" install -C contrib |
4546 |
- |
4547 |
- dodoc README HISTORY |
4548 |
- |
4549 |
- # man pages are already built, but if we have the target make them, |
4550 |
- # they'll be generated from source before being installed so we |
4551 |
- # manually install man pages. |
4552 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4553 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4554 |
- doins -r doc/src/sgml/man{1,3,7} |
4555 |
- if ! use server; then |
4556 |
- # Remove man pages for non-existent binaries |
4557 |
- serverman=( |
4558 |
- initdb |
4559 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
4560 |
- pg_{test_{fsync,timing},upgrade,waldump} |
4561 |
- post{gres,master} |
4562 |
- ) |
4563 |
- for m in ${serverman[@]} ; do |
4564 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4565 |
- done |
4566 |
- fi |
4567 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4568 |
- |
4569 |
- # Create slot specific man pages |
4570 |
- local bn f mansec slotted_name |
4571 |
- for mansec in 1 3 7 ; do |
4572 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
4573 |
- |
4574 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
4575 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
4576 |
- |
4577 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
4578 |
- bn=$(basename "${f}") |
4579 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
4580 |
- case ${bn} in |
4581 |
- TABLE.7|WITH.7) |
4582 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
4583 |
- ;; |
4584 |
- *) |
4585 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
4586 |
- ;; |
4587 |
- esac |
4588 |
- done |
4589 |
- |
4590 |
- popd > /dev/null |
4591 |
- done |
4592 |
- |
4593 |
- insinto /etc/postgresql-${SLOT} |
4594 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4595 |
- |
4596 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
4597 |
- # needed by extensions utilizing PGXS. |
4598 |
- use static-libs || \ |
4599 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
4600 |
- -delete |
4601 |
- |
4602 |
- # Make slot specific links to programs |
4603 |
- local f bn |
4604 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
4605 |
- -mindepth 1 -maxdepth 1) |
4606 |
- do |
4607 |
- bn=$(basename "${f}") |
4608 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
4609 |
- "/usr/bin/${bn}${SLOT/.}" |
4610 |
- done |
4611 |
- |
4612 |
- if use doc ; then |
4613 |
- docinto html |
4614 |
- dodoc doc/src/sgml/html/* |
4615 |
- fi |
4616 |
- |
4617 |
- if use server; then |
4618 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4619 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
4620 |
- |
4621 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4622 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
4623 |
- |
4624 |
- if use systemd; then |
4625 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4626 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
4627 |
- systemd_newunit - ${PN}-${SLOT}.service |
4628 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4629 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
4630 |
- fi |
4631 |
- |
4632 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4633 |
- |
4634 |
- if use prefix ; then |
4635 |
- keepdir /run/postgresql |
4636 |
- fperms 1775 /run/postgresql |
4637 |
- fi |
4638 |
- fi |
4639 |
-} |
4640 |
- |
4641 |
-pkg_postinst() { |
4642 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
4643 |
- postgresql-config update |
4644 |
- |
4645 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4646 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
4647 |
- |
4648 |
- if use server ; then |
4649 |
- elog |
4650 |
- elog "Gentoo specific documentation:" |
4651 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4652 |
- elog |
4653 |
- elog "Official documentation:" |
4654 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
4655 |
- elog |
4656 |
- elog "The default location of the Unix-domain socket is:" |
4657 |
- elog " ${EROOT}/run/postgresql/" |
4658 |
- elog |
4659 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4660 |
- elog "so that it contains your preferred locale in:" |
4661 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4662 |
- elog |
4663 |
- elog "Then, execute the following command to setup the initial database" |
4664 |
- elog "environment:" |
4665 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4666 |
- |
4667 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
4668 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
4669 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
4670 |
- ewarn "the following command after upgrading:" |
4671 |
- ewarn |
4672 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
4673 |
- fi |
4674 |
- fi |
4675 |
-} |
4676 |
- |
4677 |
-pkg_prerm() { |
4678 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4679 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4680 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4681 |
- |
4682 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4683 |
- sleep 10 |
4684 |
- eend 0 |
4685 |
- fi |
4686 |
-} |
4687 |
- |
4688 |
-pkg_postrm() { |
4689 |
- postgresql-config update |
4690 |
-} |
4691 |
- |
4692 |
-pkg_config() { |
4693 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4694 |
- |
4695 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4696 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4697 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
4698 |
- [[ -z "${DATA_DIR}" ]] \ |
4699 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
4700 |
- |
4701 |
- # environment.bz2 may not contain the same locale as the current system |
4702 |
- # locale. Unset and source from the current system locale. |
4703 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
4704 |
- unset LANG |
4705 |
- unset LC_CTYPE |
4706 |
- unset LC_NUMERIC |
4707 |
- unset LC_TIME |
4708 |
- unset LC_COLLATE |
4709 |
- unset LC_MONETARY |
4710 |
- unset LC_MESSAGES |
4711 |
- unset LC_ALL |
4712 |
- source "${EROOT}/etc/env.d/02locale" |
4713 |
- [ -n "${LANG}" ] && export LANG |
4714 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4715 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4716 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4717 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4718 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4719 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4720 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4721 |
- fi |
4722 |
- |
4723 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4724 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4725 |
- einfo |
4726 |
- einfo "Information on options that can be passed to initdb are found at:" |
4727 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4728 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4729 |
- einfo |
4730 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4731 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4732 |
- einfo " (none)" |
4733 |
- else |
4734 |
- einfo " ${PG_INITDB_OPTS}" |
4735 |
- fi |
4736 |
- einfo |
4737 |
- einfo "Configuration files will be installed to:" |
4738 |
- einfo " ${PGDATA}" |
4739 |
- einfo |
4740 |
- einfo "The database cluster will be created in:" |
4741 |
- einfo " ${DATA_DIR}" |
4742 |
- einfo |
4743 |
- |
4744 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
4745 |
- sleep 5 |
4746 |
- eend 0 |
4747 |
- |
4748 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4749 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4750 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4751 |
- die "${DATA_DIR} is not empty." |
4752 |
- fi |
4753 |
- |
4754 |
- einfo "Creating the data directory ..." |
4755 |
- if [[ ${EUID} == 0 ]] ; then |
4756 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
4757 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
4758 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
4759 |
- fi |
4760 |
- |
4761 |
- einfo "Initializing the database ..." |
4762 |
- |
4763 |
- if [[ ${EUID} == 0 ]] ; then |
4764 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4765 |
- else |
4766 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4767 |
- fi |
4768 |
- |
4769 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4770 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4771 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4772 |
- fi |
4773 |
- |
4774 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
4775 |
- # overridden in the initscript |
4776 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
4777 |
- |
4778 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4779 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4780 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4781 |
- # characters in PL/Perl |
4782 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4783 |
- EOF |
4784 |
- |
4785 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4786 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4787 |
- einfo "by default. You can disable it in the cluster's:" |
4788 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4789 |
- einfo |
4790 |
- if ! use systemd; then |
4791 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4792 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4793 |
- einfo |
4794 |
- fi |
4795 |
- if use prefix ; then |
4796 |
- einfo "The location of the configuration files have moved to:" |
4797 |
- einfo " ${PGDATA}" |
4798 |
- einfo "To start the server:" |
4799 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4800 |
- einfo "To stop:" |
4801 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4802 |
- einfo |
4803 |
- einfo "Or move the configuration files back:" |
4804 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4805 |
- elif use systemd; then |
4806 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
4807 |
- einfo "instead of 'pg_ctl'." |
4808 |
- else |
4809 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4810 |
- einfo "instead of 'pg_ctl'." |
4811 |
- fi |
4812 |
-} |
4813 |
- |
4814 |
-src_test() { |
4815 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4816 |
- emake check |
4817 |
- |
4818 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4819 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4820 |
- else |
4821 |
- use server || \ |
4822 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4823 |
- [[ ${UID} -eq 0 ]] || \ |
4824 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4825 |
- |
4826 |
- ewarn 'Skipping.' |
4827 |
- fi |
4828 |
-} |
4829 |
|
4830 |
diff --git a/dev-db/postgresql/postgresql-13.5-r1.ebuild b/dev-db/postgresql/postgresql-13.5-r1.ebuild |
4831 |
deleted file mode 100644 |
4832 |
index 6e0f3bba6848..000000000000 |
4833 |
--- a/dev-db/postgresql/postgresql-13.5-r1.ebuild |
4834 |
+++ /dev/null |
4835 |
@@ -1,466 +0,0 @@ |
4836 |
-# Copyright 1999-2022 Gentoo Authors |
4837 |
-# Distributed under the terms of the GNU General Public License v2 |
4838 |
- |
4839 |
-EAPI=7 |
4840 |
- |
4841 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
4842 |
-LLVM_MAX_SLOT=14 |
4843 |
- |
4844 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
4845 |
- |
4846 |
-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" |
4847 |
- |
4848 |
-SLOT=$(ver_cut 1) |
4849 |
- |
4850 |
-MY_PV=${PV/_/} |
4851 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
4852 |
- |
4853 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
4854 |
- |
4855 |
-LICENSE="POSTGRESQL GPL-2" |
4856 |
-DESCRIPTION="PostgreSQL RDBMS" |
4857 |
-HOMEPAGE="https://www.postgresql.org/" |
4858 |
- |
4859 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
4860 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
4861 |
- threads uuid xml zlib" |
4862 |
- |
4863 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
4864 |
- |
4865 |
-CDEPEND=" |
4866 |
->=app-eselect/eselect-postgresql-2.0 |
4867 |
-acct-group/postgres |
4868 |
-acct-user/postgres |
4869 |
-sys-apps/less |
4870 |
-virtual/libintl |
4871 |
-icu? ( dev-libs/icu:= ) |
4872 |
-kerberos? ( virtual/krb5 ) |
4873 |
-ldap? ( net-nds/openldap:= ) |
4874 |
-llvm? ( |
4875 |
- <sys-devel/llvm-15:= |
4876 |
- <sys-devel/clang-15:= |
4877 |
-) |
4878 |
-pam? ( sys-libs/pam ) |
4879 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4880 |
-python? ( ${PYTHON_DEPS} ) |
4881 |
-readline? ( sys-libs/readline:0= ) |
4882 |
-server? ( systemd? ( sys-apps/systemd ) ) |
4883 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4884 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4885 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4886 |
-zlib? ( sys-libs/zlib ) |
4887 |
-" |
4888 |
- |
4889 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4890 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4891 |
-# the libc includes UUID functions. |
4892 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
4893 |
- |
4894 |
-nest_usedep() { |
4895 |
- local front back |
4896 |
- while [[ ${#} -gt 1 ]]; do |
4897 |
- front+="${1}? ( " |
4898 |
- back+=" )" |
4899 |
- shift |
4900 |
- done |
4901 |
- echo "${front}${1}${back}" |
4902 |
-} |
4903 |
- |
4904 |
-CDEPEND+=" |
4905 |
-uuid? ( |
4906 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4907 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4908 |
-)" |
4909 |
- |
4910 |
-DEPEND="${CDEPEND} |
4911 |
-sys-devel/bison |
4912 |
-sys-devel/flex |
4913 |
-nls? ( sys-devel/gettext ) |
4914 |
-xml? ( virtual/pkgconfig ) |
4915 |
-" |
4916 |
- |
4917 |
-RDEPEND="${CDEPEND} |
4918 |
-selinux? ( sec-policy/selinux-postgresql ) |
4919 |
-" |
4920 |
- |
4921 |
-pkg_setup() { |
4922 |
- use llvm && llvm_pkg_setup |
4923 |
- |
4924 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4925 |
- |
4926 |
- use python && python-single-r1_pkg_setup |
4927 |
-} |
4928 |
- |
4929 |
-src_prepare() { |
4930 |
- eapply "${FILESDIR}"/${PN}-13.3-riscv-spinlocks.patch |
4931 |
- |
4932 |
- # Set proper run directory |
4933 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4934 |
- -i src/include/pg_config_manual.h || die |
4935 |
- |
4936 |
- # Rely on $PATH being in the proper order so that the correct |
4937 |
- # install program is used for modules utilizing PGXS in both |
4938 |
- # hardened and non-hardened environments. (Bug #528786) |
4939 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4940 |
- |
4941 |
- use server || eapply "${FILESDIR}/${PN}-13_beta1-no-server.patch" |
4942 |
- use llvm && eapply "${FILESDIR}/postgres-llvm14.patch" |
4943 |
- |
4944 |
- if use pam ; then |
4945 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4946 |
- -i src/backend/libpq/auth.c || \ |
4947 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4948 |
- fi |
4949 |
- |
4950 |
- eapply_user |
4951 |
-} |
4952 |
- |
4953 |
-src_configure() { |
4954 |
- case ${CHOST} in |
4955 |
- *-darwin*|*-solaris*) |
4956 |
- use nls && append-libs intl |
4957 |
- ;; |
4958 |
- esac |
4959 |
- |
4960 |
- export LDFLAGS_SL="${LDFLAGS}" |
4961 |
- export LDFLAGS_EX="${LDFLAGS}" |
4962 |
- |
4963 |
- local PO="${EPREFIX}" |
4964 |
- |
4965 |
- local i uuid_config="" |
4966 |
- if use uuid; then |
4967 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4968 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4969 |
- done |
4970 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4971 |
- fi |
4972 |
- |
4973 |
- local myconf="\ |
4974 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4975 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4976 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4977 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4978 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4979 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4980 |
- $(use_enable debug) \ |
4981 |
- $(use_enable threads thread-safety) \ |
4982 |
- $(use_with icu) \ |
4983 |
- $(use_with kerberos gssapi) \ |
4984 |
- $(use_with ldap) \ |
4985 |
- $(use_with llvm) \ |
4986 |
- $(use_with pam) \ |
4987 |
- $(use_with perl) \ |
4988 |
- $(use_with python) \ |
4989 |
- $(use_with readline) \ |
4990 |
- $(use_with ssl openssl) \ |
4991 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
4992 |
- $(use_with tcl) \ |
4993 |
- ${uuid_config} \ |
4994 |
- $(use_with xml libxml) \ |
4995 |
- $(use_with xml libxslt) \ |
4996 |
- $(use_with zlib) \ |
4997 |
- $(use_enable nls)" |
4998 |
- if use alpha; then |
4999 |
- myconf+=" --disable-spinlocks" |
5000 |
- else |
5001 |
- # Should be the default but just in case |
5002 |
- myconf+=" --enable-spinlocks" |
5003 |
- fi |
5004 |
- econf ${myconf} |
5005 |
-} |
5006 |
- |
5007 |
-src_compile() { |
5008 |
- emake |
5009 |
- emake -C contrib |
5010 |
-} |
5011 |
- |
5012 |
-src_install() { |
5013 |
- emake DESTDIR="${D}" install |
5014 |
- emake DESTDIR="${D}" install -C contrib |
5015 |
- |
5016 |
- dodoc README HISTORY |
5017 |
- |
5018 |
- # man pages are already built, but if we have the target make them, |
5019 |
- # they'll be generated from source before being installed so we |
5020 |
- # manually install man pages. |
5021 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
5022 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
5023 |
- doins -r doc/src/sgml/man{1,3,7} |
5024 |
- if ! use server; then |
5025 |
- # Remove man pages for non-existent binaries |
5026 |
- serverman=( |
5027 |
- initdb |
5028 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
5029 |
- pg_{test_{fsync,timing},upgrade,waldump} |
5030 |
- post{gres,master} |
5031 |
- ) |
5032 |
- for m in ${serverman[@]} ; do |
5033 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
5034 |
- done |
5035 |
- fi |
5036 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
5037 |
- |
5038 |
- # Create slot specific man pages |
5039 |
- local bn f mansec slotted_name |
5040 |
- for mansec in 1 3 7 ; do |
5041 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
5042 |
- |
5043 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
5044 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
5045 |
- |
5046 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
5047 |
- bn=$(basename "${f}") |
5048 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
5049 |
- case ${bn} in |
5050 |
- TABLE.7|WITH.7) |
5051 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
5052 |
- ;; |
5053 |
- *) |
5054 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
5055 |
- ;; |
5056 |
- esac |
5057 |
- done |
5058 |
- |
5059 |
- popd > /dev/null |
5060 |
- done |
5061 |
- |
5062 |
- insinto /etc/postgresql-${SLOT} |
5063 |
- newins src/bin/psql/psqlrc.sample psqlrc |
5064 |
- |
5065 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
5066 |
- # needed by extensions utilizing PGXS. |
5067 |
- use static-libs || \ |
5068 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
5069 |
- -delete |
5070 |
- |
5071 |
- # Make slot specific links to programs |
5072 |
- local f bn |
5073 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
5074 |
- -mindepth 1 -maxdepth 1) |
5075 |
- do |
5076 |
- bn=$(basename "${f}") |
5077 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
5078 |
- "/usr/bin/${bn}${SLOT/.}" |
5079 |
- done |
5080 |
- |
5081 |
- if use doc ; then |
5082 |
- docinto html |
5083 |
- dodoc doc/src/sgml/html/* |
5084 |
- fi |
5085 |
- |
5086 |
- if use server; then |
5087 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5088 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
5089 |
- |
5090 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5091 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
5092 |
- |
5093 |
- if use systemd; then |
5094 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5095 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
5096 |
- systemd_newunit - ${PN}-${SLOT}.service |
5097 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
5098 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
5099 |
- fi |
5100 |
- |
5101 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
5102 |
- |
5103 |
- if use prefix ; then |
5104 |
- keepdir /run/postgresql |
5105 |
- fperms 1775 /run/postgresql |
5106 |
- fi |
5107 |
- fi |
5108 |
-} |
5109 |
- |
5110 |
-pkg_postinst() { |
5111 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
5112 |
- postgresql-config update |
5113 |
- |
5114 |
- elog "If you need a global psqlrc-file, you can place it in:" |
5115 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
5116 |
- |
5117 |
- if use server ; then |
5118 |
- elog |
5119 |
- elog "Gentoo specific documentation:" |
5120 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
5121 |
- elog |
5122 |
- elog "Official documentation:" |
5123 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
5124 |
- elog |
5125 |
- elog "The default location of the Unix-domain socket is:" |
5126 |
- elog " ${EROOT}/run/postgresql/" |
5127 |
- elog |
5128 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
5129 |
- elog "so that it contains your preferred locale in:" |
5130 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5131 |
- elog |
5132 |
- elog "Then, execute the following command to setup the initial database" |
5133 |
- elog "environment:" |
5134 |
- elog " emerge --config =${CATEGORY}/${PF}" |
5135 |
- |
5136 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
5137 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
5138 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
5139 |
- ewarn "the following command after upgrading:" |
5140 |
- ewarn |
5141 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
5142 |
- fi |
5143 |
- fi |
5144 |
-} |
5145 |
- |
5146 |
-pkg_prerm() { |
5147 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
5148 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
5149 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
5150 |
- |
5151 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
5152 |
- sleep 10 |
5153 |
- eend 0 |
5154 |
- fi |
5155 |
-} |
5156 |
- |
5157 |
-pkg_postrm() { |
5158 |
- postgresql-config update |
5159 |
-} |
5160 |
- |
5161 |
-pkg_config() { |
5162 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
5163 |
- |
5164 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
5165 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5166 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
5167 |
- [[ -z "${DATA_DIR}" ]] \ |
5168 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
5169 |
- |
5170 |
- # environment.bz2 may not contain the same locale as the current system |
5171 |
- # locale. Unset and source from the current system locale. |
5172 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
5173 |
- unset LANG |
5174 |
- unset LC_CTYPE |
5175 |
- unset LC_NUMERIC |
5176 |
- unset LC_TIME |
5177 |
- unset LC_COLLATE |
5178 |
- unset LC_MONETARY |
5179 |
- unset LC_MESSAGES |
5180 |
- unset LC_ALL |
5181 |
- source "${EROOT}/etc/env.d/02locale" |
5182 |
- [ -n "${LANG}" ] && export LANG |
5183 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
5184 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
5185 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
5186 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
5187 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
5188 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
5189 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
5190 |
- fi |
5191 |
- |
5192 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
5193 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5194 |
- einfo |
5195 |
- einfo "Information on options that can be passed to initdb are found at:" |
5196 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
5197 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
5198 |
- einfo |
5199 |
- einfo "PG_INITDB_OPTS is currently set to:" |
5200 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
5201 |
- einfo " (none)" |
5202 |
- else |
5203 |
- einfo " ${PG_INITDB_OPTS}" |
5204 |
- fi |
5205 |
- einfo |
5206 |
- einfo "Configuration files will be installed to:" |
5207 |
- einfo " ${PGDATA}" |
5208 |
- einfo |
5209 |
- einfo "The database cluster will be created in:" |
5210 |
- einfo " ${DATA_DIR}" |
5211 |
- einfo |
5212 |
- |
5213 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
5214 |
- sleep 5 |
5215 |
- eend 0 |
5216 |
- |
5217 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
5218 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
5219 |
- eerror "Modify DATA_DIR to point to an empty directory." |
5220 |
- die "${DATA_DIR} is not empty." |
5221 |
- fi |
5222 |
- |
5223 |
- einfo "Creating the data directory ..." |
5224 |
- if [[ ${EUID} == 0 ]] ; then |
5225 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
5226 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
5227 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
5228 |
- fi |
5229 |
- |
5230 |
- einfo "Initializing the database ..." |
5231 |
- |
5232 |
- if [[ ${EUID} == 0 ]] ; then |
5233 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
5234 |
- else |
5235 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
5236 |
- fi |
5237 |
- |
5238 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
5239 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
5240 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
5241 |
- fi |
5242 |
- |
5243 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
5244 |
- # overridden in the initscript |
5245 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
5246 |
- |
5247 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
5248 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
5249 |
- # On the off-chance that you might need to work with UTF-8 encoded |
5250 |
- # characters in PL/Perl |
5251 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
5252 |
- EOF |
5253 |
- |
5254 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
5255 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
5256 |
- einfo "by default. You can disable it in the cluster's:" |
5257 |
- einfo " ${PGDATA%/}/postgresql.conf" |
5258 |
- einfo |
5259 |
- if ! use systemd; then |
5260 |
- einfo "The PostgreSQL server, by default, will log events to:" |
5261 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
5262 |
- einfo |
5263 |
- fi |
5264 |
- if use prefix ; then |
5265 |
- einfo "The location of the configuration files have moved to:" |
5266 |
- einfo " ${PGDATA}" |
5267 |
- einfo "To start the server:" |
5268 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
5269 |
- einfo "To stop:" |
5270 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
5271 |
- einfo |
5272 |
- einfo "Or move the configuration files back:" |
5273 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
5274 |
- elif use systemd; then |
5275 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
5276 |
- einfo "instead of 'pg_ctl'." |
5277 |
- else |
5278 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
5279 |
- einfo "instead of 'pg_ctl'." |
5280 |
- fi |
5281 |
-} |
5282 |
- |
5283 |
-src_test() { |
5284 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
5285 |
- # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set |
5286 |
- # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. |
5287 |
- local old_ctype=${LC_CTYPE} |
5288 |
- export LC_CTYPE=${LC_COLLATE} |
5289 |
- emake check |
5290 |
- export LC_CTYPE=${old_ctype} |
5291 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
5292 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
5293 |
- else |
5294 |
- use server || \ |
5295 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
5296 |
- [[ ${UID} -eq 0 ]] || \ |
5297 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
5298 |
- |
5299 |
- ewarn 'Skipping.' |
5300 |
- fi |
5301 |
-} |
5302 |
|
5303 |
diff --git a/dev-db/postgresql/postgresql-13.6-r2.ebuild b/dev-db/postgresql/postgresql-13.6-r2.ebuild |
5304 |
deleted file mode 100644 |
5305 |
index 3ecf907af22e..000000000000 |
5306 |
--- a/dev-db/postgresql/postgresql-13.6-r2.ebuild |
5307 |
+++ /dev/null |
5308 |
@@ -1,466 +0,0 @@ |
5309 |
-# Copyright 1999-2022 Gentoo Authors |
5310 |
-# Distributed under the terms of the GNU General Public License v2 |
5311 |
- |
5312 |
-EAPI=7 |
5313 |
- |
5314 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
5315 |
-LLVM_MAX_SLOT=14 |
5316 |
- |
5317 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
5318 |
- |
5319 |
-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" |
5320 |
- |
5321 |
-SLOT=$(ver_cut 1) |
5322 |
- |
5323 |
-MY_PV=${PV/_/} |
5324 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
5325 |
- |
5326 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
5327 |
- |
5328 |
-LICENSE="POSTGRESQL GPL-2" |
5329 |
-DESCRIPTION="PostgreSQL RDBMS" |
5330 |
-HOMEPAGE="https://www.postgresql.org/" |
5331 |
- |
5332 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
5333 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
5334 |
- threads uuid xml zlib" |
5335 |
- |
5336 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
5337 |
- |
5338 |
-CDEPEND=" |
5339 |
->=app-eselect/eselect-postgresql-2.0 |
5340 |
-acct-group/postgres |
5341 |
-acct-user/postgres |
5342 |
-sys-apps/less |
5343 |
-virtual/libintl |
5344 |
-icu? ( dev-libs/icu:= ) |
5345 |
-kerberos? ( virtual/krb5 ) |
5346 |
-ldap? ( net-nds/openldap:= ) |
5347 |
-llvm? ( |
5348 |
- <sys-devel/llvm-15:= |
5349 |
- <sys-devel/clang-15:= |
5350 |
-) |
5351 |
-pam? ( sys-libs/pam ) |
5352 |
-perl? ( >=dev-lang/perl-5.8:= ) |
5353 |
-python? ( ${PYTHON_DEPS} ) |
5354 |
-readline? ( sys-libs/readline:0= ) |
5355 |
-server? ( systemd? ( sys-apps/systemd ) ) |
5356 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
5357 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
5358 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
5359 |
-zlib? ( sys-libs/zlib ) |
5360 |
-" |
5361 |
- |
5362 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
5363 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
5364 |
-# the libc includes UUID functions. |
5365 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
5366 |
- |
5367 |
-nest_usedep() { |
5368 |
- local front back |
5369 |
- while [[ ${#} -gt 1 ]]; do |
5370 |
- front+="${1}? ( " |
5371 |
- back+=" )" |
5372 |
- shift |
5373 |
- done |
5374 |
- echo "${front}${1}${back}" |
5375 |
-} |
5376 |
- |
5377 |
-CDEPEND+=" |
5378 |
-uuid? ( |
5379 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
5380 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
5381 |
-)" |
5382 |
- |
5383 |
-DEPEND="${CDEPEND} |
5384 |
-sys-devel/bison |
5385 |
-sys-devel/flex |
5386 |
-nls? ( sys-devel/gettext ) |
5387 |
-xml? ( virtual/pkgconfig ) |
5388 |
-" |
5389 |
- |
5390 |
-RDEPEND="${CDEPEND} |
5391 |
-selinux? ( sec-policy/selinux-postgresql ) |
5392 |
-" |
5393 |
- |
5394 |
-pkg_setup() { |
5395 |
- use llvm && llvm_pkg_setup |
5396 |
- |
5397 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
5398 |
- |
5399 |
- use python && python-single-r1_pkg_setup |
5400 |
-} |
5401 |
- |
5402 |
-src_prepare() { |
5403 |
- eapply "${FILESDIR}"/${PN}-13.3-riscv-spinlocks.patch |
5404 |
- |
5405 |
- # Set proper run directory |
5406 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
5407 |
- -i src/include/pg_config_manual.h || die |
5408 |
- |
5409 |
- # Rely on $PATH being in the proper order so that the correct |
5410 |
- # install program is used for modules utilizing PGXS in both |
5411 |
- # hardened and non-hardened environments. (Bug #528786) |
5412 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
5413 |
- |
5414 |
- use server || eapply "${FILESDIR}/${PN}-13_beta1-no-server.patch" |
5415 |
- use llvm && eapply "${FILESDIR}/postgres-llvm14.patch" |
5416 |
- |
5417 |
- if use pam ; then |
5418 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
5419 |
- -i src/backend/libpq/auth.c || \ |
5420 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
5421 |
- fi |
5422 |
- |
5423 |
- eapply_user |
5424 |
-} |
5425 |
- |
5426 |
-src_configure() { |
5427 |
- case ${CHOST} in |
5428 |
- *-darwin*|*-solaris*) |
5429 |
- use nls && append-libs intl |
5430 |
- ;; |
5431 |
- esac |
5432 |
- |
5433 |
- export LDFLAGS_SL="${LDFLAGS}" |
5434 |
- export LDFLAGS_EX="${LDFLAGS}" |
5435 |
- |
5436 |
- local PO="${EPREFIX}" |
5437 |
- |
5438 |
- local i uuid_config="" |
5439 |
- if use uuid; then |
5440 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
5441 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
5442 |
- done |
5443 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
5444 |
- fi |
5445 |
- |
5446 |
- local myconf="\ |
5447 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
5448 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
5449 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
5450 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
5451 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
5452 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
5453 |
- $(use_enable debug) \ |
5454 |
- $(use_enable threads thread-safety) \ |
5455 |
- $(use_with icu) \ |
5456 |
- $(use_with kerberos gssapi) \ |
5457 |
- $(use_with ldap) \ |
5458 |
- $(use_with llvm) \ |
5459 |
- $(use_with pam) \ |
5460 |
- $(use_with perl) \ |
5461 |
- $(use_with python) \ |
5462 |
- $(use_with readline) \ |
5463 |
- $(use_with ssl openssl) \ |
5464 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
5465 |
- $(use_with tcl) \ |
5466 |
- ${uuid_config} \ |
5467 |
- $(use_with xml libxml) \ |
5468 |
- $(use_with xml libxslt) \ |
5469 |
- $(use_with zlib) \ |
5470 |
- $(use_enable nls)" |
5471 |
- if use alpha; then |
5472 |
- myconf+=" --disable-spinlocks" |
5473 |
- else |
5474 |
- # Should be the default but just in case |
5475 |
- myconf+=" --enable-spinlocks" |
5476 |
- fi |
5477 |
- econf ${myconf} |
5478 |
-} |
5479 |
- |
5480 |
-src_compile() { |
5481 |
- emake |
5482 |
- emake -C contrib |
5483 |
-} |
5484 |
- |
5485 |
-src_install() { |
5486 |
- emake DESTDIR="${D}" install |
5487 |
- emake DESTDIR="${D}" install -C contrib |
5488 |
- |
5489 |
- dodoc README HISTORY |
5490 |
- |
5491 |
- # man pages are already built, but if we have the target make them, |
5492 |
- # they'll be generated from source before being installed so we |
5493 |
- # manually install man pages. |
5494 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
5495 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
5496 |
- doins -r doc/src/sgml/man{1,3,7} |
5497 |
- if ! use server; then |
5498 |
- # Remove man pages for non-existent binaries |
5499 |
- serverman=( |
5500 |
- initdb |
5501 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
5502 |
- pg_{test_{fsync,timing},upgrade,waldump} |
5503 |
- post{gres,master} |
5504 |
- ) |
5505 |
- for m in ${serverman[@]} ; do |
5506 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
5507 |
- done |
5508 |
- fi |
5509 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
5510 |
- |
5511 |
- # Create slot specific man pages |
5512 |
- local bn f mansec slotted_name |
5513 |
- for mansec in 1 3 7 ; do |
5514 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
5515 |
- |
5516 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
5517 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
5518 |
- |
5519 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
5520 |
- bn=$(basename "${f}") |
5521 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
5522 |
- case ${bn} in |
5523 |
- TABLE.7|WITH.7) |
5524 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
5525 |
- ;; |
5526 |
- *) |
5527 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
5528 |
- ;; |
5529 |
- esac |
5530 |
- done |
5531 |
- |
5532 |
- popd > /dev/null |
5533 |
- done |
5534 |
- |
5535 |
- insinto /etc/postgresql-${SLOT} |
5536 |
- newins src/bin/psql/psqlrc.sample psqlrc |
5537 |
- |
5538 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
5539 |
- # needed by extensions utilizing PGXS. |
5540 |
- use static-libs || \ |
5541 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
5542 |
- -delete |
5543 |
- |
5544 |
- # Make slot specific links to programs |
5545 |
- local f bn |
5546 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
5547 |
- -mindepth 1 -maxdepth 1) |
5548 |
- do |
5549 |
- bn=$(basename "${f}") |
5550 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
5551 |
- "/usr/bin/${bn}${SLOT/.}" |
5552 |
- done |
5553 |
- |
5554 |
- if use doc ; then |
5555 |
- docinto html |
5556 |
- dodoc doc/src/sgml/html/* |
5557 |
- fi |
5558 |
- |
5559 |
- if use server; then |
5560 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5561 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
5562 |
- |
5563 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5564 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
5565 |
- |
5566 |
- if use systemd; then |
5567 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5568 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
5569 |
- systemd_newunit - ${PN}-${SLOT}.service |
5570 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
5571 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
5572 |
- fi |
5573 |
- |
5574 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
5575 |
- |
5576 |
- if use prefix ; then |
5577 |
- keepdir /run/postgresql |
5578 |
- fperms 1775 /run/postgresql |
5579 |
- fi |
5580 |
- fi |
5581 |
-} |
5582 |
- |
5583 |
-pkg_postinst() { |
5584 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
5585 |
- postgresql-config update |
5586 |
- |
5587 |
- elog "If you need a global psqlrc-file, you can place it in:" |
5588 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
5589 |
- |
5590 |
- if use server ; then |
5591 |
- elog |
5592 |
- elog "Gentoo specific documentation:" |
5593 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
5594 |
- elog |
5595 |
- elog "Official documentation:" |
5596 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
5597 |
- elog |
5598 |
- elog "The default location of the Unix-domain socket is:" |
5599 |
- elog " ${EROOT}/run/postgresql/" |
5600 |
- elog |
5601 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
5602 |
- elog "so that it contains your preferred locale in:" |
5603 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5604 |
- elog |
5605 |
- elog "Then, execute the following command to setup the initial database" |
5606 |
- elog "environment:" |
5607 |
- elog " emerge --config =${CATEGORY}/${PF}" |
5608 |
- |
5609 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
5610 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
5611 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
5612 |
- ewarn "the following command after upgrading:" |
5613 |
- ewarn |
5614 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
5615 |
- fi |
5616 |
- fi |
5617 |
-} |
5618 |
- |
5619 |
-pkg_prerm() { |
5620 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
5621 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
5622 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
5623 |
- |
5624 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
5625 |
- sleep 10 |
5626 |
- eend 0 |
5627 |
- fi |
5628 |
-} |
5629 |
- |
5630 |
-pkg_postrm() { |
5631 |
- postgresql-config update |
5632 |
-} |
5633 |
- |
5634 |
-pkg_config() { |
5635 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
5636 |
- |
5637 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
5638 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5639 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
5640 |
- [[ -z "${DATA_DIR}" ]] \ |
5641 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
5642 |
- |
5643 |
- # environment.bz2 may not contain the same locale as the current system |
5644 |
- # locale. Unset and source from the current system locale. |
5645 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
5646 |
- unset LANG |
5647 |
- unset LC_CTYPE |
5648 |
- unset LC_NUMERIC |
5649 |
- unset LC_TIME |
5650 |
- unset LC_COLLATE |
5651 |
- unset LC_MONETARY |
5652 |
- unset LC_MESSAGES |
5653 |
- unset LC_ALL |
5654 |
- source "${EROOT}/etc/env.d/02locale" |
5655 |
- [ -n "${LANG}" ] && export LANG |
5656 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
5657 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
5658 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
5659 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
5660 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
5661 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
5662 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
5663 |
- fi |
5664 |
- |
5665 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
5666 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5667 |
- einfo |
5668 |
- einfo "Information on options that can be passed to initdb are found at:" |
5669 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
5670 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
5671 |
- einfo |
5672 |
- einfo "PG_INITDB_OPTS is currently set to:" |
5673 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
5674 |
- einfo " (none)" |
5675 |
- else |
5676 |
- einfo " ${PG_INITDB_OPTS}" |
5677 |
- fi |
5678 |
- einfo |
5679 |
- einfo "Configuration files will be installed to:" |
5680 |
- einfo " ${PGDATA}" |
5681 |
- einfo |
5682 |
- einfo "The database cluster will be created in:" |
5683 |
- einfo " ${DATA_DIR}" |
5684 |
- einfo |
5685 |
- |
5686 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
5687 |
- sleep 5 |
5688 |
- eend 0 |
5689 |
- |
5690 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
5691 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
5692 |
- eerror "Modify DATA_DIR to point to an empty directory." |
5693 |
- die "${DATA_DIR} is not empty." |
5694 |
- fi |
5695 |
- |
5696 |
- einfo "Creating the data directory ..." |
5697 |
- if [[ ${EUID} == 0 ]] ; then |
5698 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
5699 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
5700 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
5701 |
- fi |
5702 |
- |
5703 |
- einfo "Initializing the database ..." |
5704 |
- |
5705 |
- if [[ ${EUID} == 0 ]] ; then |
5706 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
5707 |
- else |
5708 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
5709 |
- fi |
5710 |
- |
5711 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
5712 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
5713 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
5714 |
- fi |
5715 |
- |
5716 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
5717 |
- # overridden in the initscript |
5718 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
5719 |
- |
5720 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
5721 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
5722 |
- # On the off-chance that you might need to work with UTF-8 encoded |
5723 |
- # characters in PL/Perl |
5724 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
5725 |
- EOF |
5726 |
- |
5727 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
5728 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
5729 |
- einfo "by default. You can disable it in the cluster's:" |
5730 |
- einfo " ${PGDATA%/}/postgresql.conf" |
5731 |
- einfo |
5732 |
- if ! use systemd; then |
5733 |
- einfo "The PostgreSQL server, by default, will log events to:" |
5734 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
5735 |
- einfo |
5736 |
- fi |
5737 |
- if use prefix ; then |
5738 |
- einfo "The location of the configuration files have moved to:" |
5739 |
- einfo " ${PGDATA}" |
5740 |
- einfo "To start the server:" |
5741 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
5742 |
- einfo "To stop:" |
5743 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
5744 |
- einfo |
5745 |
- einfo "Or move the configuration files back:" |
5746 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
5747 |
- elif use systemd; then |
5748 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
5749 |
- einfo "instead of 'pg_ctl'." |
5750 |
- else |
5751 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
5752 |
- einfo "instead of 'pg_ctl'." |
5753 |
- fi |
5754 |
-} |
5755 |
- |
5756 |
-src_test() { |
5757 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
5758 |
- # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set |
5759 |
- # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. |
5760 |
- local old_ctype=${LC_CTYPE} |
5761 |
- export LC_CTYPE=${LC_COLLATE} |
5762 |
- emake check |
5763 |
- export LC_CTYPE=${old_ctype} |
5764 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
5765 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
5766 |
- else |
5767 |
- use server || \ |
5768 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
5769 |
- [[ ${UID} -eq 0 ]] || \ |
5770 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
5771 |
- |
5772 |
- ewarn 'Skipping.' |
5773 |
- fi |
5774 |
-} |
5775 |
|
5776 |
diff --git a/dev-db/postgresql/postgresql-13.7.ebuild b/dev-db/postgresql/postgresql-13.7.ebuild |
5777 |
deleted file mode 100644 |
5778 |
index bec67b2f0353..000000000000 |
5779 |
--- a/dev-db/postgresql/postgresql-13.7.ebuild |
5780 |
+++ /dev/null |
5781 |
@@ -1,465 +0,0 @@ |
5782 |
-# Copyright 1999-2022 Gentoo Authors |
5783 |
-# Distributed under the terms of the GNU General Public License v2 |
5784 |
- |
5785 |
-EAPI=7 |
5786 |
- |
5787 |
-PYTHON_COMPAT=( python3_{8,9,10,11} ) |
5788 |
-LLVM_MAX_SLOT=14 |
5789 |
- |
5790 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
5791 |
- |
5792 |
-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" |
5793 |
- |
5794 |
-SLOT=$(ver_cut 1) |
5795 |
- |
5796 |
-MY_PV=${PV/_/} |
5797 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
5798 |
- |
5799 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
5800 |
- |
5801 |
-LICENSE="POSTGRESQL GPL-2" |
5802 |
-DESCRIPTION="PostgreSQL RDBMS" |
5803 |
-HOMEPAGE="https://www.postgresql.org/" |
5804 |
- |
5805 |
-IUSE="debug doc icu kerberos ldap llvm nls pam |
5806 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
5807 |
- threads uuid xml zlib" |
5808 |
- |
5809 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
5810 |
- |
5811 |
-CDEPEND=" |
5812 |
->=app-eselect/eselect-postgresql-2.0 |
5813 |
-acct-group/postgres |
5814 |
-acct-user/postgres |
5815 |
-sys-apps/less |
5816 |
-virtual/libintl |
5817 |
-icu? ( dev-libs/icu:= ) |
5818 |
-kerberos? ( virtual/krb5 ) |
5819 |
-ldap? ( net-nds/openldap:= ) |
5820 |
-llvm? ( |
5821 |
- <sys-devel/llvm-15:= |
5822 |
- <sys-devel/clang-15:= |
5823 |
-) |
5824 |
-pam? ( sys-libs/pam ) |
5825 |
-perl? ( >=dev-lang/perl-5.8:= ) |
5826 |
-python? ( ${PYTHON_DEPS} ) |
5827 |
-readline? ( sys-libs/readline:0= ) |
5828 |
-server? ( systemd? ( sys-apps/systemd ) ) |
5829 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
5830 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
5831 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
5832 |
-zlib? ( sys-libs/zlib ) |
5833 |
-" |
5834 |
- |
5835 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
5836 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
5837 |
-# the libc includes UUID functions. |
5838 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
5839 |
- |
5840 |
-nest_usedep() { |
5841 |
- local front back |
5842 |
- while [[ ${#} -gt 1 ]]; do |
5843 |
- front+="${1}? ( " |
5844 |
- back+=" )" |
5845 |
- shift |
5846 |
- done |
5847 |
- echo "${front}${1}${back}" |
5848 |
-} |
5849 |
- |
5850 |
-CDEPEND+=" |
5851 |
-uuid? ( |
5852 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
5853 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
5854 |
-)" |
5855 |
- |
5856 |
-DEPEND="${CDEPEND} |
5857 |
-sys-devel/bison |
5858 |
-sys-devel/flex |
5859 |
-nls? ( sys-devel/gettext ) |
5860 |
-xml? ( virtual/pkgconfig ) |
5861 |
-" |
5862 |
- |
5863 |
-RDEPEND="${CDEPEND} |
5864 |
-selinux? ( sec-policy/selinux-postgresql ) |
5865 |
-" |
5866 |
- |
5867 |
-pkg_setup() { |
5868 |
- use llvm && llvm_pkg_setup |
5869 |
- |
5870 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
5871 |
- |
5872 |
- use python && python-single-r1_pkg_setup |
5873 |
-} |
5874 |
- |
5875 |
-src_prepare() { |
5876 |
- eapply "${FILESDIR}"/${PN}-13.3-riscv-spinlocks.patch |
5877 |
- |
5878 |
- # Set proper run directory |
5879 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
5880 |
- -i src/include/pg_config_manual.h || die |
5881 |
- |
5882 |
- # Rely on $PATH being in the proper order so that the correct |
5883 |
- # install program is used for modules utilizing PGXS in both |
5884 |
- # hardened and non-hardened environments. (Bug #528786) |
5885 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
5886 |
- |
5887 |
- use server || eapply "${FILESDIR}/${PN}-13_beta1-no-server.patch" |
5888 |
- |
5889 |
- if use pam ; then |
5890 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
5891 |
- -i src/backend/libpq/auth.c || \ |
5892 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
5893 |
- fi |
5894 |
- |
5895 |
- eapply_user |
5896 |
-} |
5897 |
- |
5898 |
-src_configure() { |
5899 |
- case ${CHOST} in |
5900 |
- *-darwin*|*-solaris*) |
5901 |
- use nls && append-libs intl |
5902 |
- ;; |
5903 |
- esac |
5904 |
- |
5905 |
- export LDFLAGS_SL="${LDFLAGS}" |
5906 |
- export LDFLAGS_EX="${LDFLAGS}" |
5907 |
- |
5908 |
- local PO="${EPREFIX}" |
5909 |
- |
5910 |
- local i uuid_config="" |
5911 |
- if use uuid; then |
5912 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
5913 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
5914 |
- done |
5915 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
5916 |
- fi |
5917 |
- |
5918 |
- local myconf="\ |
5919 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
5920 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
5921 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
5922 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
5923 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
5924 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
5925 |
- $(use_enable debug) \ |
5926 |
- $(use_enable threads thread-safety) \ |
5927 |
- $(use_with icu) \ |
5928 |
- $(use_with kerberos gssapi) \ |
5929 |
- $(use_with ldap) \ |
5930 |
- $(use_with llvm) \ |
5931 |
- $(use_with pam) \ |
5932 |
- $(use_with perl) \ |
5933 |
- $(use_with python) \ |
5934 |
- $(use_with readline) \ |
5935 |
- $(use_with ssl openssl) \ |
5936 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
5937 |
- $(use_with tcl) \ |
5938 |
- ${uuid_config} \ |
5939 |
- $(use_with xml libxml) \ |
5940 |
- $(use_with xml libxslt) \ |
5941 |
- $(use_with zlib) \ |
5942 |
- $(use_enable nls)" |
5943 |
- if use alpha; then |
5944 |
- myconf+=" --disable-spinlocks" |
5945 |
- else |
5946 |
- # Should be the default but just in case |
5947 |
- myconf+=" --enable-spinlocks" |
5948 |
- fi |
5949 |
- econf ${myconf} |
5950 |
-} |
5951 |
- |
5952 |
-src_compile() { |
5953 |
- emake |
5954 |
- emake -C contrib |
5955 |
-} |
5956 |
- |
5957 |
-src_install() { |
5958 |
- emake DESTDIR="${D}" install |
5959 |
- emake DESTDIR="${D}" install -C contrib |
5960 |
- |
5961 |
- dodoc README HISTORY |
5962 |
- |
5963 |
- # man pages are already built, but if we have the target make them, |
5964 |
- # they'll be generated from source before being installed so we |
5965 |
- # manually install man pages. |
5966 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
5967 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
5968 |
- doins -r doc/src/sgml/man{1,3,7} |
5969 |
- if ! use server; then |
5970 |
- # Remove man pages for non-existent binaries |
5971 |
- serverman=( |
5972 |
- initdb |
5973 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
5974 |
- pg_{test_{fsync,timing},upgrade,waldump} |
5975 |
- post{gres,master} |
5976 |
- ) |
5977 |
- for m in ${serverman[@]} ; do |
5978 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
5979 |
- done |
5980 |
- fi |
5981 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
5982 |
- |
5983 |
- # Create slot specific man pages |
5984 |
- local bn f mansec slotted_name |
5985 |
- for mansec in 1 3 7 ; do |
5986 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
5987 |
- |
5988 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
5989 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
5990 |
- |
5991 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
5992 |
- bn=$(basename "${f}") |
5993 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
5994 |
- case ${bn} in |
5995 |
- TABLE.7|WITH.7) |
5996 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
5997 |
- ;; |
5998 |
- *) |
5999 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
6000 |
- ;; |
6001 |
- esac |
6002 |
- done |
6003 |
- |
6004 |
- popd > /dev/null |
6005 |
- done |
6006 |
- |
6007 |
- insinto /etc/postgresql-${SLOT} |
6008 |
- newins src/bin/psql/psqlrc.sample psqlrc |
6009 |
- |
6010 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
6011 |
- # needed by extensions utilizing PGXS. |
6012 |
- use static-libs || \ |
6013 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
6014 |
- -delete |
6015 |
- |
6016 |
- # Make slot specific links to programs |
6017 |
- local f bn |
6018 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
6019 |
- -mindepth 1 -maxdepth 1) |
6020 |
- do |
6021 |
- bn=$(basename "${f}") |
6022 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
6023 |
- "/usr/bin/${bn}${SLOT/.}" |
6024 |
- done |
6025 |
- |
6026 |
- if use doc ; then |
6027 |
- docinto html |
6028 |
- dodoc doc/src/sgml/html/* |
6029 |
- fi |
6030 |
- |
6031 |
- if use server; then |
6032 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6033 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
6034 |
- |
6035 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6036 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
6037 |
- |
6038 |
- if use systemd; then |
6039 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6040 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
6041 |
- systemd_newunit - ${PN}-${SLOT}.service |
6042 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
6043 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
6044 |
- fi |
6045 |
- |
6046 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
6047 |
- |
6048 |
- if use prefix ; then |
6049 |
- keepdir /run/postgresql |
6050 |
- fperms 1775 /run/postgresql |
6051 |
- fi |
6052 |
- fi |
6053 |
-} |
6054 |
- |
6055 |
-pkg_postinst() { |
6056 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
6057 |
- postgresql-config update |
6058 |
- |
6059 |
- elog "If you need a global psqlrc-file, you can place it in:" |
6060 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
6061 |
- |
6062 |
- if use server ; then |
6063 |
- elog |
6064 |
- elog "Gentoo specific documentation:" |
6065 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
6066 |
- elog |
6067 |
- elog "Official documentation:" |
6068 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
6069 |
- elog |
6070 |
- elog "The default location of the Unix-domain socket is:" |
6071 |
- elog " ${EROOT}/run/postgresql/" |
6072 |
- elog |
6073 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
6074 |
- elog "so that it contains your preferred locale in:" |
6075 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
6076 |
- elog |
6077 |
- elog "Then, execute the following command to setup the initial database" |
6078 |
- elog "environment:" |
6079 |
- elog " emerge --config =${CATEGORY}/${PF}" |
6080 |
- |
6081 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
6082 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
6083 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
6084 |
- ewarn "the following command after upgrading:" |
6085 |
- ewarn |
6086 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
6087 |
- fi |
6088 |
- fi |
6089 |
-} |
6090 |
- |
6091 |
-pkg_prerm() { |
6092 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
6093 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
6094 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
6095 |
- |
6096 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
6097 |
- sleep 10 |
6098 |
- eend 0 |
6099 |
- fi |
6100 |
-} |
6101 |
- |
6102 |
-pkg_postrm() { |
6103 |
- postgresql-config update |
6104 |
-} |
6105 |
- |
6106 |
-pkg_config() { |
6107 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
6108 |
- |
6109 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
6110 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
6111 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
6112 |
- [[ -z "${DATA_DIR}" ]] \ |
6113 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
6114 |
- |
6115 |
- # environment.bz2 may not contain the same locale as the current system |
6116 |
- # locale. Unset and source from the current system locale. |
6117 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
6118 |
- unset LANG |
6119 |
- unset LC_CTYPE |
6120 |
- unset LC_NUMERIC |
6121 |
- unset LC_TIME |
6122 |
- unset LC_COLLATE |
6123 |
- unset LC_MONETARY |
6124 |
- unset LC_MESSAGES |
6125 |
- unset LC_ALL |
6126 |
- source "${EROOT}/etc/env.d/02locale" |
6127 |
- [ -n "${LANG}" ] && export LANG |
6128 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
6129 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
6130 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
6131 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
6132 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
6133 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
6134 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
6135 |
- fi |
6136 |
- |
6137 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
6138 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
6139 |
- einfo |
6140 |
- einfo "Information on options that can be passed to initdb are found at:" |
6141 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
6142 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
6143 |
- einfo |
6144 |
- einfo "PG_INITDB_OPTS is currently set to:" |
6145 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
6146 |
- einfo " (none)" |
6147 |
- else |
6148 |
- einfo " ${PG_INITDB_OPTS}" |
6149 |
- fi |
6150 |
- einfo |
6151 |
- einfo "Configuration files will be installed to:" |
6152 |
- einfo " ${PGDATA}" |
6153 |
- einfo |
6154 |
- einfo "The database cluster will be created in:" |
6155 |
- einfo " ${DATA_DIR}" |
6156 |
- einfo |
6157 |
- |
6158 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
6159 |
- sleep 5 |
6160 |
- eend 0 |
6161 |
- |
6162 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
6163 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
6164 |
- eerror "Modify DATA_DIR to point to an empty directory." |
6165 |
- die "${DATA_DIR} is not empty." |
6166 |
- fi |
6167 |
- |
6168 |
- einfo "Creating the data directory ..." |
6169 |
- if [[ ${EUID} == 0 ]] ; then |
6170 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
6171 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
6172 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
6173 |
- fi |
6174 |
- |
6175 |
- einfo "Initializing the database ..." |
6176 |
- |
6177 |
- if [[ ${EUID} == 0 ]] ; then |
6178 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
6179 |
- else |
6180 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
6181 |
- fi |
6182 |
- |
6183 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
6184 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
6185 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
6186 |
- fi |
6187 |
- |
6188 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
6189 |
- # overridden in the initscript |
6190 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
6191 |
- |
6192 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
6193 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
6194 |
- # On the off-chance that you might need to work with UTF-8 encoded |
6195 |
- # characters in PL/Perl |
6196 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
6197 |
- EOF |
6198 |
- |
6199 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
6200 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
6201 |
- einfo "by default. You can disable it in the cluster's:" |
6202 |
- einfo " ${PGDATA%/}/postgresql.conf" |
6203 |
- einfo |
6204 |
- if ! use systemd; then |
6205 |
- einfo "The PostgreSQL server, by default, will log events to:" |
6206 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
6207 |
- einfo |
6208 |
- fi |
6209 |
- if use prefix ; then |
6210 |
- einfo "The location of the configuration files have moved to:" |
6211 |
- einfo " ${PGDATA}" |
6212 |
- einfo "To start the server:" |
6213 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
6214 |
- einfo "To stop:" |
6215 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
6216 |
- einfo |
6217 |
- einfo "Or move the configuration files back:" |
6218 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
6219 |
- elif use systemd; then |
6220 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
6221 |
- einfo "instead of 'pg_ctl'." |
6222 |
- else |
6223 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
6224 |
- einfo "instead of 'pg_ctl'." |
6225 |
- fi |
6226 |
-} |
6227 |
- |
6228 |
-src_test() { |
6229 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
6230 |
- # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set |
6231 |
- # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. |
6232 |
- local old_ctype=${LC_CTYPE} |
6233 |
- export LC_CTYPE=${LC_COLLATE} |
6234 |
- emake check |
6235 |
- export LC_CTYPE=${old_ctype} |
6236 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
6237 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
6238 |
- else |
6239 |
- use server || \ |
6240 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
6241 |
- [[ ${UID} -eq 0 ]] || \ |
6242 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
6243 |
- |
6244 |
- ewarn 'Skipping.' |
6245 |
- fi |
6246 |
-} |
6247 |
|
6248 |
diff --git a/dev-db/postgresql/postgresql-14.1-r1.ebuild b/dev-db/postgresql/postgresql-14.1-r1.ebuild |
6249 |
deleted file mode 100644 |
6250 |
index 4865e372312f..000000000000 |
6251 |
--- a/dev-db/postgresql/postgresql-14.1-r1.ebuild |
6252 |
+++ /dev/null |
6253 |
@@ -1,466 +0,0 @@ |
6254 |
-# Copyright 1999-2022 Gentoo Authors |
6255 |
-# Distributed under the terms of the GNU General Public License v2 |
6256 |
- |
6257 |
-EAPI=7 |
6258 |
- |
6259 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
6260 |
-LLVM_MAX_SLOT=14 |
6261 |
- |
6262 |
-inherit flag-o-matic linux-info llvm multilib pam prefix python-single-r1 systemd tmpfiles |
6263 |
- |
6264 |
-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" |
6265 |
- |
6266 |
-SLOT=$(ver_cut 1) |
6267 |
- |
6268 |
-MY_PV=${PV/_/} |
6269 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
6270 |
- |
6271 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
6272 |
- |
6273 |
-LICENSE="POSTGRESQL GPL-2" |
6274 |
-DESCRIPTION="PostgreSQL RDBMS" |
6275 |
-HOMEPAGE="https://www.postgresql.org/" |
6276 |
- |
6277 |
-IUSE="debug doc icu kerberos ldap llvm lz4 nls pam |
6278 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
6279 |
- threads uuid xml zlib" |
6280 |
- |
6281 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
6282 |
- |
6283 |
-CDEPEND=" |
6284 |
->=app-eselect/eselect-postgresql-2.0 |
6285 |
-acct-group/postgres |
6286 |
-acct-user/postgres |
6287 |
-sys-apps/less |
6288 |
-virtual/libintl |
6289 |
-icu? ( dev-libs/icu:= ) |
6290 |
-kerberos? ( virtual/krb5 ) |
6291 |
-ldap? ( net-nds/openldap:= ) |
6292 |
-llvm? ( |
6293 |
- <sys-devel/llvm-15:= |
6294 |
- <sys-devel/clang-15:= |
6295 |
-) |
6296 |
-lz4? ( app-arch/lz4 ) |
6297 |
-pam? ( sys-libs/pam ) |
6298 |
-perl? ( >=dev-lang/perl-5.8:= ) |
6299 |
-python? ( ${PYTHON_DEPS} ) |
6300 |
-readline? ( sys-libs/readline:0= ) |
6301 |
-server? ( systemd? ( sys-apps/systemd ) ) |
6302 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
6303 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
6304 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
6305 |
-zlib? ( sys-libs/zlib ) |
6306 |
-" |
6307 |
- |
6308 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
6309 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
6310 |
-# the libc includes UUID functions. |
6311 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
6312 |
- |
6313 |
-nest_usedep() { |
6314 |
- local front back |
6315 |
- while [[ ${#} -gt 1 ]]; do |
6316 |
- front+="${1}? ( " |
6317 |
- back+=" )" |
6318 |
- shift |
6319 |
- done |
6320 |
- echo "${front}${1}${back}" |
6321 |
-} |
6322 |
- |
6323 |
-CDEPEND+=" |
6324 |
-uuid? ( |
6325 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
6326 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
6327 |
-)" |
6328 |
- |
6329 |
-DEPEND="${CDEPEND} |
6330 |
-sys-devel/bison |
6331 |
-sys-devel/flex |
6332 |
-nls? ( sys-devel/gettext ) |
6333 |
-xml? ( virtual/pkgconfig ) |
6334 |
-" |
6335 |
- |
6336 |
-RDEPEND="${CDEPEND} |
6337 |
-selinux? ( sec-policy/selinux-postgresql ) |
6338 |
-" |
6339 |
- |
6340 |
-pkg_setup() { |
6341 |
- use llvm && llvm_pkg_setup |
6342 |
- |
6343 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
6344 |
- |
6345 |
- use python && python-single-r1_pkg_setup |
6346 |
-} |
6347 |
- |
6348 |
-src_prepare() { |
6349 |
- # Set proper run directory |
6350 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
6351 |
- -i src/include/pg_config_manual.h || die |
6352 |
- |
6353 |
- # Rely on $PATH being in the proper order so that the correct |
6354 |
- # install program is used for modules utilizing PGXS in both |
6355 |
- # hardened and non-hardened environments. (Bug #528786) |
6356 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
6357 |
- |
6358 |
- use server || eapply "${FILESDIR}/${PN}-14_rc1-no-server.patch" |
6359 |
- use llvm && eapply "${FILESDIR}/postgres-llvm14.patch" |
6360 |
- |
6361 |
- if use pam ; then |
6362 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
6363 |
- -i src/backend/libpq/auth.c || \ |
6364 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
6365 |
- fi |
6366 |
- |
6367 |
- eapply_user |
6368 |
-} |
6369 |
- |
6370 |
-src_configure() { |
6371 |
- case ${CHOST} in |
6372 |
- *-darwin*|*-solaris*) |
6373 |
- use nls && append-libs intl |
6374 |
- ;; |
6375 |
- esac |
6376 |
- |
6377 |
- export LDFLAGS_SL="${LDFLAGS}" |
6378 |
- export LDFLAGS_EX="${LDFLAGS}" |
6379 |
- |
6380 |
- local PO="${EPREFIX}" |
6381 |
- |
6382 |
- local i uuid_config="" |
6383 |
- if use uuid; then |
6384 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
6385 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
6386 |
- done |
6387 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
6388 |
- fi |
6389 |
- |
6390 |
- local myconf="\ |
6391 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
6392 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
6393 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
6394 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
6395 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
6396 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
6397 |
- $(use_enable debug) \ |
6398 |
- $(use_enable threads thread-safety) \ |
6399 |
- $(use_with icu) \ |
6400 |
- $(use_with kerberos gssapi) \ |
6401 |
- $(use_with ldap) \ |
6402 |
- $(use_with llvm) \ |
6403 |
- $(use_with lz4) \ |
6404 |
- $(use_with pam) \ |
6405 |
- $(use_with perl) \ |
6406 |
- $(use_with python) \ |
6407 |
- $(use_with readline) \ |
6408 |
- $(use_with ssl openssl) \ |
6409 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
6410 |
- $(use_with tcl) \ |
6411 |
- ${uuid_config} \ |
6412 |
- $(use_with xml libxml) \ |
6413 |
- $(use_with xml libxslt) \ |
6414 |
- $(use_with zlib) \ |
6415 |
- $(use_enable nls)" |
6416 |
- if use alpha; then |
6417 |
- myconf+=" --disable-spinlocks" |
6418 |
- else |
6419 |
- # Should be the default but just in case |
6420 |
- myconf+=" --enable-spinlocks" |
6421 |
- fi |
6422 |
- econf ${myconf} |
6423 |
-} |
6424 |
- |
6425 |
-src_compile() { |
6426 |
- emake |
6427 |
- emake -C contrib |
6428 |
-} |
6429 |
- |
6430 |
-src_install() { |
6431 |
- emake DESTDIR="${D}" install |
6432 |
- emake DESTDIR="${D}" install -C contrib |
6433 |
- |
6434 |
- dodoc README HISTORY |
6435 |
- |
6436 |
- # man pages are already built, but if we have the target make them, |
6437 |
- # they'll be generated from source before being installed so we |
6438 |
- # manually install man pages. |
6439 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
6440 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
6441 |
- doins -r doc/src/sgml/man{1,3,7} |
6442 |
- if ! use server; then |
6443 |
- # Remove man pages for non-existent binaries |
6444 |
- serverman=( |
6445 |
- initdb |
6446 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
6447 |
- pg_{test_{fsync,timing},upgrade,waldump} |
6448 |
- post{gres,master} |
6449 |
- ) |
6450 |
- for m in ${serverman[@]} ; do |
6451 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
6452 |
- done |
6453 |
- fi |
6454 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
6455 |
- |
6456 |
- # Create slot specific man pages |
6457 |
- local bn f mansec slotted_name |
6458 |
- for mansec in 1 3 7 ; do |
6459 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
6460 |
- |
6461 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
6462 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
6463 |
- |
6464 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
6465 |
- bn=$(basename "${f}") |
6466 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
6467 |
- case ${bn} in |
6468 |
- TABLE.7|WITH.7) |
6469 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
6470 |
- ;; |
6471 |
- *) |
6472 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
6473 |
- ;; |
6474 |
- esac |
6475 |
- done |
6476 |
- |
6477 |
- popd > /dev/null |
6478 |
- done |
6479 |
- |
6480 |
- insinto /etc/postgresql-${SLOT} |
6481 |
- newins src/bin/psql/psqlrc.sample psqlrc |
6482 |
- |
6483 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
6484 |
- # needed by extensions utilizing PGXS. |
6485 |
- use static-libs || \ |
6486 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
6487 |
- -delete |
6488 |
- |
6489 |
- # Make slot specific links to programs |
6490 |
- local f bn |
6491 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
6492 |
- -mindepth 1 -maxdepth 1) |
6493 |
- do |
6494 |
- bn=$(basename "${f}") |
6495 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
6496 |
- "/usr/bin/${bn}${SLOT/.}" |
6497 |
- done |
6498 |
- |
6499 |
- if use doc ; then |
6500 |
- docinto html |
6501 |
- dodoc doc/src/sgml/html/* |
6502 |
- fi |
6503 |
- |
6504 |
- if use server; then |
6505 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6506 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
6507 |
- |
6508 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6509 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
6510 |
- |
6511 |
- if use systemd; then |
6512 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6513 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
6514 |
- systemd_newunit - ${PN}-${SLOT}.service |
6515 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
6516 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
6517 |
- fi |
6518 |
- |
6519 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
6520 |
- |
6521 |
- if use prefix ; then |
6522 |
- keepdir /run/postgresql |
6523 |
- fperms 1775 /run/postgresql |
6524 |
- fi |
6525 |
- fi |
6526 |
-} |
6527 |
- |
6528 |
-pkg_postinst() { |
6529 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
6530 |
- postgresql-config update |
6531 |
- |
6532 |
- elog "If you need a global psqlrc-file, you can place it in:" |
6533 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
6534 |
- |
6535 |
- if use server ; then |
6536 |
- elog |
6537 |
- elog "Gentoo specific documentation:" |
6538 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
6539 |
- elog |
6540 |
- elog "Official documentation:" |
6541 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
6542 |
- elog |
6543 |
- elog "The default location of the Unix-domain socket is:" |
6544 |
- elog " ${EROOT}/run/postgresql/" |
6545 |
- elog |
6546 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
6547 |
- elog "so that it contains your preferred locale in:" |
6548 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
6549 |
- elog |
6550 |
- elog "Then, execute the following command to setup the initial database" |
6551 |
- elog "environment:" |
6552 |
- elog " emerge --config =${CATEGORY}/${PF}" |
6553 |
- |
6554 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
6555 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
6556 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
6557 |
- ewarn "the following command after upgrading:" |
6558 |
- ewarn |
6559 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
6560 |
- fi |
6561 |
- fi |
6562 |
-} |
6563 |
- |
6564 |
-pkg_prerm() { |
6565 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
6566 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
6567 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
6568 |
- |
6569 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
6570 |
- sleep 10 |
6571 |
- eend 0 |
6572 |
- fi |
6573 |
-} |
6574 |
- |
6575 |
-pkg_postrm() { |
6576 |
- postgresql-config update |
6577 |
-} |
6578 |
- |
6579 |
-pkg_config() { |
6580 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
6581 |
- |
6582 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
6583 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
6584 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
6585 |
- [[ -z "${DATA_DIR}" ]] \ |
6586 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
6587 |
- |
6588 |
- # environment.bz2 may not contain the same locale as the current system |
6589 |
- # locale. Unset and source from the current system locale. |
6590 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
6591 |
- unset LANG |
6592 |
- unset LC_CTYPE |
6593 |
- unset LC_NUMERIC |
6594 |
- unset LC_TIME |
6595 |
- unset LC_COLLATE |
6596 |
- unset LC_MONETARY |
6597 |
- unset LC_MESSAGES |
6598 |
- unset LC_ALL |
6599 |
- source "${EROOT}/etc/env.d/02locale" |
6600 |
- [ -n "${LANG}" ] && export LANG |
6601 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
6602 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
6603 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
6604 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
6605 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
6606 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
6607 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
6608 |
- fi |
6609 |
- |
6610 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
6611 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
6612 |
- einfo |
6613 |
- einfo "Information on options that can be passed to initdb are found at:" |
6614 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
6615 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
6616 |
- einfo |
6617 |
- einfo "PG_INITDB_OPTS is currently set to:" |
6618 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
6619 |
- einfo " (none)" |
6620 |
- else |
6621 |
- einfo " ${PG_INITDB_OPTS}" |
6622 |
- fi |
6623 |
- einfo |
6624 |
- einfo "Configuration files will be installed to:" |
6625 |
- einfo " ${PGDATA}" |
6626 |
- einfo |
6627 |
- einfo "The database cluster will be created in:" |
6628 |
- einfo " ${DATA_DIR}" |
6629 |
- einfo |
6630 |
- |
6631 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
6632 |
- sleep 5 |
6633 |
- eend 0 |
6634 |
- |
6635 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
6636 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
6637 |
- eerror "Modify DATA_DIR to point to an empty directory." |
6638 |
- die "${DATA_DIR} is not empty." |
6639 |
- fi |
6640 |
- |
6641 |
- einfo "Creating the data directory ..." |
6642 |
- if [[ ${EUID} == 0 ]] ; then |
6643 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
6644 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
6645 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
6646 |
- fi |
6647 |
- |
6648 |
- einfo "Initializing the database ..." |
6649 |
- |
6650 |
- if [[ ${EUID} == 0 ]] ; then |
6651 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
6652 |
- else |
6653 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
6654 |
- fi |
6655 |
- |
6656 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
6657 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
6658 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
6659 |
- fi |
6660 |
- |
6661 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
6662 |
- # overridden in the initscript |
6663 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
6664 |
- |
6665 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
6666 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
6667 |
- # On the off-chance that you might need to work with UTF-8 encoded |
6668 |
- # characters in PL/Perl |
6669 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
6670 |
- EOF |
6671 |
- |
6672 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
6673 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
6674 |
- einfo "by default. You can disable it in the cluster's:" |
6675 |
- einfo " ${PGDATA%/}/postgresql.conf" |
6676 |
- einfo |
6677 |
- if ! use systemd; then |
6678 |
- einfo "The PostgreSQL server, by default, will log events to:" |
6679 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
6680 |
- einfo |
6681 |
- fi |
6682 |
- if use prefix ; then |
6683 |
- einfo "The location of the configuration files have moved to:" |
6684 |
- einfo " ${PGDATA}" |
6685 |
- einfo "To start the server:" |
6686 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
6687 |
- einfo "To stop:" |
6688 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
6689 |
- einfo |
6690 |
- einfo "Or move the configuration files back:" |
6691 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
6692 |
- elif use systemd; then |
6693 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
6694 |
- einfo "instead of 'pg_ctl'." |
6695 |
- else |
6696 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
6697 |
- einfo "instead of 'pg_ctl'." |
6698 |
- fi |
6699 |
-} |
6700 |
- |
6701 |
-src_test() { |
6702 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
6703 |
- # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set |
6704 |
- # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. |
6705 |
- local old_ctype=${LC_CTYPE} |
6706 |
- export LC_CTYPE=${LC_COLLATE} |
6707 |
- emake check |
6708 |
- export LC_CTYPE=${old_ctype} |
6709 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
6710 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
6711 |
- else |
6712 |
- use server || \ |
6713 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
6714 |
- [[ ${UID} -eq 0 ]] || \ |
6715 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
6716 |
- |
6717 |
- ewarn 'Skipping.' |
6718 |
- fi |
6719 |
-} |
6720 |
|
6721 |
diff --git a/dev-db/postgresql/postgresql-14.2-r1.ebuild b/dev-db/postgresql/postgresql-14.2-r1.ebuild |
6722 |
deleted file mode 100644 |
6723 |
index ba00ea41f4e1..000000000000 |
6724 |
--- a/dev-db/postgresql/postgresql-14.2-r1.ebuild |
6725 |
+++ /dev/null |
6726 |
@@ -1,463 +0,0 @@ |
6727 |
-# Copyright 1999-2022 Gentoo Authors |
6728 |
-# Distributed under the terms of the GNU General Public License v2 |
6729 |
- |
6730 |
-EAPI=7 |
6731 |
- |
6732 |
-PYTHON_COMPAT=( python3_{8,9,10} ) |
6733 |
- |
6734 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd tmpfiles |
6735 |
- |
6736 |
-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" |
6737 |
- |
6738 |
-SLOT=$(ver_cut 1) |
6739 |
- |
6740 |
-MY_PV=${PV/_/} |
6741 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
6742 |
- |
6743 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
6744 |
- |
6745 |
-LICENSE="POSTGRESQL GPL-2" |
6746 |
-DESCRIPTION="PostgreSQL RDBMS" |
6747 |
-HOMEPAGE="https://www.postgresql.org/" |
6748 |
- |
6749 |
-IUSE="debug doc icu kerberos ldap llvm lz4 nls pam |
6750 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
6751 |
- threads uuid xml zlib" |
6752 |
- |
6753 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
6754 |
- |
6755 |
-CDEPEND=" |
6756 |
->=app-eselect/eselect-postgresql-2.0 |
6757 |
-acct-group/postgres |
6758 |
-acct-user/postgres |
6759 |
-sys-apps/less |
6760 |
-virtual/libintl |
6761 |
-icu? ( dev-libs/icu:= ) |
6762 |
-kerberos? ( virtual/krb5 ) |
6763 |
-ldap? ( net-nds/openldap:= ) |
6764 |
-llvm? ( |
6765 |
- sys-devel/llvm:= |
6766 |
- sys-devel/clang:= |
6767 |
-) |
6768 |
-lz4? ( app-arch/lz4 ) |
6769 |
-pam? ( sys-libs/pam ) |
6770 |
-perl? ( >=dev-lang/perl-5.8:= ) |
6771 |
-python? ( ${PYTHON_DEPS} ) |
6772 |
-readline? ( sys-libs/readline:0= ) |
6773 |
-server? ( systemd? ( sys-apps/systemd ) ) |
6774 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
6775 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
6776 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
6777 |
-zlib? ( sys-libs/zlib ) |
6778 |
-" |
6779 |
- |
6780 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
6781 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
6782 |
-# the libc includes UUID functions. |
6783 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
6784 |
- |
6785 |
-nest_usedep() { |
6786 |
- local front back |
6787 |
- while [[ ${#} -gt 1 ]]; do |
6788 |
- front+="${1}? ( " |
6789 |
- back+=" )" |
6790 |
- shift |
6791 |
- done |
6792 |
- echo "${front}${1}${back}" |
6793 |
-} |
6794 |
- |
6795 |
-CDEPEND+=" |
6796 |
-uuid? ( |
6797 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
6798 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
6799 |
-)" |
6800 |
- |
6801 |
-DEPEND="${CDEPEND} |
6802 |
-sys-devel/bison |
6803 |
-sys-devel/flex |
6804 |
-nls? ( sys-devel/gettext ) |
6805 |
-xml? ( virtual/pkgconfig ) |
6806 |
-" |
6807 |
- |
6808 |
-RDEPEND="${CDEPEND} |
6809 |
-selinux? ( sec-policy/selinux-postgresql ) |
6810 |
-" |
6811 |
- |
6812 |
-pkg_setup() { |
6813 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
6814 |
- |
6815 |
- use python && python-single-r1_pkg_setup |
6816 |
-} |
6817 |
- |
6818 |
-src_prepare() { |
6819 |
- # Set proper run directory |
6820 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
6821 |
- -i src/include/pg_config_manual.h || die |
6822 |
- |
6823 |
- # Rely on $PATH being in the proper order so that the correct |
6824 |
- # install program is used for modules utilizing PGXS in both |
6825 |
- # hardened and non-hardened environments. (Bug #528786) |
6826 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
6827 |
- |
6828 |
- use server || eapply "${FILESDIR}/${PN}-14_rc1-no-server.patch" |
6829 |
- use llvm && eapply "${FILESDIR}/postgres-llvm14.patch" |
6830 |
- |
6831 |
- if use pam ; then |
6832 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
6833 |
- -i src/backend/libpq/auth.c || \ |
6834 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
6835 |
- fi |
6836 |
- |
6837 |
- eapply_user |
6838 |
-} |
6839 |
- |
6840 |
-src_configure() { |
6841 |
- case ${CHOST} in |
6842 |
- *-darwin*|*-solaris*) |
6843 |
- use nls && append-libs intl |
6844 |
- ;; |
6845 |
- esac |
6846 |
- |
6847 |
- export LDFLAGS_SL="${LDFLAGS}" |
6848 |
- export LDFLAGS_EX="${LDFLAGS}" |
6849 |
- |
6850 |
- local PO="${EPREFIX}" |
6851 |
- |
6852 |
- local i uuid_config="" |
6853 |
- if use uuid; then |
6854 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
6855 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
6856 |
- done |
6857 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
6858 |
- fi |
6859 |
- |
6860 |
- local myconf="\ |
6861 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
6862 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
6863 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
6864 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
6865 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
6866 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
6867 |
- $(use_enable debug) \ |
6868 |
- $(use_enable threads thread-safety) \ |
6869 |
- $(use_with icu) \ |
6870 |
- $(use_with kerberos gssapi) \ |
6871 |
- $(use_with ldap) \ |
6872 |
- $(use_with llvm) \ |
6873 |
- $(use_with lz4) \ |
6874 |
- $(use_with pam) \ |
6875 |
- $(use_with perl) \ |
6876 |
- $(use_with python) \ |
6877 |
- $(use_with readline) \ |
6878 |
- $(use_with ssl openssl) \ |
6879 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
6880 |
- $(use_with tcl) \ |
6881 |
- ${uuid_config} \ |
6882 |
- $(use_with xml libxml) \ |
6883 |
- $(use_with xml libxslt) \ |
6884 |
- $(use_with zlib) \ |
6885 |
- $(use_enable nls)" |
6886 |
- if use alpha; then |
6887 |
- myconf+=" --disable-spinlocks" |
6888 |
- else |
6889 |
- # Should be the default but just in case |
6890 |
- myconf+=" --enable-spinlocks" |
6891 |
- fi |
6892 |
- econf ${myconf} |
6893 |
-} |
6894 |
- |
6895 |
-src_compile() { |
6896 |
- emake |
6897 |
- emake -C contrib |
6898 |
-} |
6899 |
- |
6900 |
-src_install() { |
6901 |
- emake DESTDIR="${D}" install |
6902 |
- emake DESTDIR="${D}" install -C contrib |
6903 |
- |
6904 |
- dodoc README HISTORY |
6905 |
- |
6906 |
- # man pages are already built, but if we have the target make them, |
6907 |
- # they'll be generated from source before being installed so we |
6908 |
- # manually install man pages. |
6909 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
6910 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
6911 |
- doins -r doc/src/sgml/man{1,3,7} |
6912 |
- if ! use server; then |
6913 |
- # Remove man pages for non-existent binaries |
6914 |
- serverman=( |
6915 |
- initdb |
6916 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
6917 |
- pg_{test_{fsync,timing},upgrade,waldump} |
6918 |
- post{gres,master} |
6919 |
- ) |
6920 |
- for m in ${serverman[@]} ; do |
6921 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
6922 |
- done |
6923 |
- fi |
6924 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
6925 |
- |
6926 |
- # Create slot specific man pages |
6927 |
- local bn f mansec slotted_name |
6928 |
- for mansec in 1 3 7 ; do |
6929 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
6930 |
- |
6931 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
6932 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
6933 |
- |
6934 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
6935 |
- bn=$(basename "${f}") |
6936 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
6937 |
- case ${bn} in |
6938 |
- TABLE.7|WITH.7) |
6939 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
6940 |
- ;; |
6941 |
- *) |
6942 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
6943 |
- ;; |
6944 |
- esac |
6945 |
- done |
6946 |
- |
6947 |
- popd > /dev/null |
6948 |
- done |
6949 |
- |
6950 |
- insinto /etc/postgresql-${SLOT} |
6951 |
- newins src/bin/psql/psqlrc.sample psqlrc |
6952 |
- |
6953 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
6954 |
- # needed by extensions utilizing PGXS. |
6955 |
- use static-libs || \ |
6956 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
6957 |
- -delete |
6958 |
- |
6959 |
- # Make slot specific links to programs |
6960 |
- local f bn |
6961 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
6962 |
- -mindepth 1 -maxdepth 1) |
6963 |
- do |
6964 |
- bn=$(basename "${f}") |
6965 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
6966 |
- "/usr/bin/${bn}${SLOT/.}" |
6967 |
- done |
6968 |
- |
6969 |
- if use doc ; then |
6970 |
- docinto html |
6971 |
- dodoc doc/src/sgml/html/* |
6972 |
- fi |
6973 |
- |
6974 |
- if use server; then |
6975 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6976 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
6977 |
- |
6978 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6979 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
6980 |
- |
6981 |
- if use systemd; then |
6982 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6983 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
6984 |
- systemd_newunit - ${PN}-${SLOT}.service |
6985 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
6986 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
6987 |
- fi |
6988 |
- |
6989 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
6990 |
- |
6991 |
- if use prefix ; then |
6992 |
- keepdir /run/postgresql |
6993 |
- fperms 1775 /run/postgresql |
6994 |
- fi |
6995 |
- fi |
6996 |
-} |
6997 |
- |
6998 |
-pkg_postinst() { |
6999 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
7000 |
- postgresql-config update |
7001 |
- |
7002 |
- elog "If you need a global psqlrc-file, you can place it in:" |
7003 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
7004 |
- |
7005 |
- if use server ; then |
7006 |
- elog |
7007 |
- elog "Gentoo specific documentation:" |
7008 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
7009 |
- elog |
7010 |
- elog "Official documentation:" |
7011 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
7012 |
- elog |
7013 |
- elog "The default location of the Unix-domain socket is:" |
7014 |
- elog " ${EROOT}/run/postgresql/" |
7015 |
- elog |
7016 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
7017 |
- elog "so that it contains your preferred locale in:" |
7018 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7019 |
- elog |
7020 |
- elog "Then, execute the following command to setup the initial database" |
7021 |
- elog "environment:" |
7022 |
- elog " emerge --config =${CATEGORY}/${PF}" |
7023 |
- |
7024 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
7025 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
7026 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
7027 |
- ewarn "the following command after upgrading:" |
7028 |
- ewarn |
7029 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
7030 |
- fi |
7031 |
- fi |
7032 |
-} |
7033 |
- |
7034 |
-pkg_prerm() { |
7035 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
7036 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
7037 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
7038 |
- |
7039 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
7040 |
- sleep 10 |
7041 |
- eend 0 |
7042 |
- fi |
7043 |
-} |
7044 |
- |
7045 |
-pkg_postrm() { |
7046 |
- postgresql-config update |
7047 |
-} |
7048 |
- |
7049 |
-pkg_config() { |
7050 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
7051 |
- |
7052 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
7053 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7054 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
7055 |
- [[ -z "${DATA_DIR}" ]] \ |
7056 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
7057 |
- |
7058 |
- # environment.bz2 may not contain the same locale as the current system |
7059 |
- # locale. Unset and source from the current system locale. |
7060 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
7061 |
- unset LANG |
7062 |
- unset LC_CTYPE |
7063 |
- unset LC_NUMERIC |
7064 |
- unset LC_TIME |
7065 |
- unset LC_COLLATE |
7066 |
- unset LC_MONETARY |
7067 |
- unset LC_MESSAGES |
7068 |
- unset LC_ALL |
7069 |
- source "${EROOT}/etc/env.d/02locale" |
7070 |
- [ -n "${LANG}" ] && export LANG |
7071 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
7072 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
7073 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
7074 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
7075 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
7076 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
7077 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
7078 |
- fi |
7079 |
- |
7080 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
7081 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7082 |
- einfo |
7083 |
- einfo "Information on options that can be passed to initdb are found at:" |
7084 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
7085 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
7086 |
- einfo |
7087 |
- einfo "PG_INITDB_OPTS is currently set to:" |
7088 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
7089 |
- einfo " (none)" |
7090 |
- else |
7091 |
- einfo " ${PG_INITDB_OPTS}" |
7092 |
- fi |
7093 |
- einfo |
7094 |
- einfo "Configuration files will be installed to:" |
7095 |
- einfo " ${PGDATA}" |
7096 |
- einfo |
7097 |
- einfo "The database cluster will be created in:" |
7098 |
- einfo " ${DATA_DIR}" |
7099 |
- einfo |
7100 |
- |
7101 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
7102 |
- sleep 5 |
7103 |
- eend 0 |
7104 |
- |
7105 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
7106 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
7107 |
- eerror "Modify DATA_DIR to point to an empty directory." |
7108 |
- die "${DATA_DIR} is not empty." |
7109 |
- fi |
7110 |
- |
7111 |
- einfo "Creating the data directory ..." |
7112 |
- if [[ ${EUID} == 0 ]] ; then |
7113 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
7114 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
7115 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
7116 |
- fi |
7117 |
- |
7118 |
- einfo "Initializing the database ..." |
7119 |
- |
7120 |
- if [[ ${EUID} == 0 ]] ; then |
7121 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
7122 |
- else |
7123 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
7124 |
- fi |
7125 |
- |
7126 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
7127 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
7128 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
7129 |
- fi |
7130 |
- |
7131 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
7132 |
- # overridden in the initscript |
7133 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
7134 |
- |
7135 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
7136 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
7137 |
- # On the off-chance that you might need to work with UTF-8 encoded |
7138 |
- # characters in PL/Perl |
7139 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
7140 |
- EOF |
7141 |
- |
7142 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
7143 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
7144 |
- einfo "by default. You can disable it in the cluster's:" |
7145 |
- einfo " ${PGDATA%/}/postgresql.conf" |
7146 |
- einfo |
7147 |
- if ! use systemd; then |
7148 |
- einfo "The PostgreSQL server, by default, will log events to:" |
7149 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
7150 |
- einfo |
7151 |
- fi |
7152 |
- if use prefix ; then |
7153 |
- einfo "The location of the configuration files have moved to:" |
7154 |
- einfo " ${PGDATA}" |
7155 |
- einfo "To start the server:" |
7156 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
7157 |
- einfo "To stop:" |
7158 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
7159 |
- einfo |
7160 |
- einfo "Or move the configuration files back:" |
7161 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
7162 |
- elif use systemd; then |
7163 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
7164 |
- einfo "instead of 'pg_ctl'." |
7165 |
- else |
7166 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
7167 |
- einfo "instead of 'pg_ctl'." |
7168 |
- fi |
7169 |
-} |
7170 |
- |
7171 |
-src_test() { |
7172 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
7173 |
- # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set |
7174 |
- # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. |
7175 |
- local old_ctype=${LC_CTYPE} |
7176 |
- export LC_CTYPE=${LC_COLLATE} |
7177 |
- emake check |
7178 |
- export LC_CTYPE=${old_ctype} |
7179 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
7180 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
7181 |
- else |
7182 |
- use server || \ |
7183 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
7184 |
- [[ ${UID} -eq 0 ]] || \ |
7185 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
7186 |
- |
7187 |
- ewarn 'Skipping.' |
7188 |
- fi |
7189 |
-} |
7190 |
|
7191 |
diff --git a/dev-db/postgresql/postgresql-14.4.ebuild b/dev-db/postgresql/postgresql-14.4.ebuild |
7192 |
deleted file mode 100644 |
7193 |
index 9e6e14b865be..000000000000 |
7194 |
--- a/dev-db/postgresql/postgresql-14.4.ebuild |
7195 |
+++ /dev/null |
7196 |
@@ -1,462 +0,0 @@ |
7197 |
-# Copyright 1999-2022 Gentoo Authors |
7198 |
-# Distributed under the terms of the GNU General Public License v2 |
7199 |
- |
7200 |
-EAPI=7 |
7201 |
- |
7202 |
-PYTHON_COMPAT=( python3_{8,9,10,11} ) |
7203 |
- |
7204 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd tmpfiles |
7205 |
- |
7206 |
-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" |
7207 |
- |
7208 |
-SLOT=$(ver_cut 1) |
7209 |
- |
7210 |
-MY_PV=${PV/_/} |
7211 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
7212 |
- |
7213 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
7214 |
- |
7215 |
-LICENSE="POSTGRESQL GPL-2" |
7216 |
-DESCRIPTION="PostgreSQL RDBMS" |
7217 |
-HOMEPAGE="https://www.postgresql.org/" |
7218 |
- |
7219 |
-IUSE="debug doc icu kerberos ldap llvm lz4 nls pam |
7220 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
7221 |
- threads uuid xml zlib" |
7222 |
- |
7223 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
7224 |
- |
7225 |
-CDEPEND=" |
7226 |
->=app-eselect/eselect-postgresql-2.0 |
7227 |
-acct-group/postgres |
7228 |
-acct-user/postgres |
7229 |
-sys-apps/less |
7230 |
-virtual/libintl |
7231 |
-icu? ( dev-libs/icu:= ) |
7232 |
-kerberos? ( virtual/krb5 ) |
7233 |
-ldap? ( net-nds/openldap:= ) |
7234 |
-llvm? ( |
7235 |
- sys-devel/llvm:= |
7236 |
- sys-devel/clang:= |
7237 |
-) |
7238 |
-lz4? ( app-arch/lz4 ) |
7239 |
-pam? ( sys-libs/pam ) |
7240 |
-perl? ( >=dev-lang/perl-5.8:= ) |
7241 |
-python? ( ${PYTHON_DEPS} ) |
7242 |
-readline? ( sys-libs/readline:0= ) |
7243 |
-server? ( systemd? ( sys-apps/systemd ) ) |
7244 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
7245 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
7246 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
7247 |
-zlib? ( sys-libs/zlib ) |
7248 |
-" |
7249 |
- |
7250 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
7251 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
7252 |
-# the libc includes UUID functions. |
7253 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
7254 |
- |
7255 |
-nest_usedep() { |
7256 |
- local front back |
7257 |
- while [[ ${#} -gt 1 ]]; do |
7258 |
- front+="${1}? ( " |
7259 |
- back+=" )" |
7260 |
- shift |
7261 |
- done |
7262 |
- echo "${front}${1}${back}" |
7263 |
-} |
7264 |
- |
7265 |
-CDEPEND+=" |
7266 |
-uuid? ( |
7267 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
7268 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
7269 |
-)" |
7270 |
- |
7271 |
-DEPEND="${CDEPEND} |
7272 |
-sys-devel/bison |
7273 |
-sys-devel/flex |
7274 |
-nls? ( sys-devel/gettext ) |
7275 |
-xml? ( virtual/pkgconfig ) |
7276 |
-" |
7277 |
- |
7278 |
-RDEPEND="${CDEPEND} |
7279 |
-selinux? ( sec-policy/selinux-postgresql ) |
7280 |
-" |
7281 |
- |
7282 |
-pkg_setup() { |
7283 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
7284 |
- |
7285 |
- use python && python-single-r1_pkg_setup |
7286 |
-} |
7287 |
- |
7288 |
-src_prepare() { |
7289 |
- # Set proper run directory |
7290 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
7291 |
- -i src/include/pg_config_manual.h || die |
7292 |
- |
7293 |
- # Rely on $PATH being in the proper order so that the correct |
7294 |
- # install program is used for modules utilizing PGXS in both |
7295 |
- # hardened and non-hardened environments. (Bug #528786) |
7296 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
7297 |
- |
7298 |
- use server || eapply "${FILESDIR}/${PN}-14_rc1-no-server.patch" |
7299 |
- |
7300 |
- if use pam ; then |
7301 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
7302 |
- -i src/backend/libpq/auth.c || \ |
7303 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
7304 |
- fi |
7305 |
- |
7306 |
- eapply_user |
7307 |
-} |
7308 |
- |
7309 |
-src_configure() { |
7310 |
- case ${CHOST} in |
7311 |
- *-darwin*|*-solaris*) |
7312 |
- use nls && append-libs intl |
7313 |
- ;; |
7314 |
- esac |
7315 |
- |
7316 |
- export LDFLAGS_SL="${LDFLAGS}" |
7317 |
- export LDFLAGS_EX="${LDFLAGS}" |
7318 |
- |
7319 |
- local PO="${EPREFIX}" |
7320 |
- |
7321 |
- local i uuid_config="" |
7322 |
- if use uuid; then |
7323 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
7324 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
7325 |
- done |
7326 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
7327 |
- fi |
7328 |
- |
7329 |
- local myconf="\ |
7330 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
7331 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
7332 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
7333 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
7334 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
7335 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
7336 |
- $(use_enable debug) \ |
7337 |
- $(use_enable threads thread-safety) \ |
7338 |
- $(use_with icu) \ |
7339 |
- $(use_with kerberos gssapi) \ |
7340 |
- $(use_with ldap) \ |
7341 |
- $(use_with llvm) \ |
7342 |
- $(use_with lz4) \ |
7343 |
- $(use_with pam) \ |
7344 |
- $(use_with perl) \ |
7345 |
- $(use_with python) \ |
7346 |
- $(use_with readline) \ |
7347 |
- $(use_with ssl openssl) \ |
7348 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
7349 |
- $(use_with tcl) \ |
7350 |
- ${uuid_config} \ |
7351 |
- $(use_with xml libxml) \ |
7352 |
- $(use_with xml libxslt) \ |
7353 |
- $(use_with zlib) \ |
7354 |
- $(use_enable nls)" |
7355 |
- if use alpha; then |
7356 |
- myconf+=" --disable-spinlocks" |
7357 |
- else |
7358 |
- # Should be the default but just in case |
7359 |
- myconf+=" --enable-spinlocks" |
7360 |
- fi |
7361 |
- econf ${myconf} |
7362 |
-} |
7363 |
- |
7364 |
-src_compile() { |
7365 |
- emake |
7366 |
- emake -C contrib |
7367 |
-} |
7368 |
- |
7369 |
-src_install() { |
7370 |
- emake DESTDIR="${D}" install |
7371 |
- emake DESTDIR="${D}" install -C contrib |
7372 |
- |
7373 |
- dodoc README HISTORY |
7374 |
- |
7375 |
- # man pages are already built, but if we have the target make them, |
7376 |
- # they'll be generated from source before being installed so we |
7377 |
- # manually install man pages. |
7378 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
7379 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
7380 |
- doins -r doc/src/sgml/man{1,3,7} |
7381 |
- if ! use server; then |
7382 |
- # Remove man pages for non-existent binaries |
7383 |
- serverman=( |
7384 |
- initdb |
7385 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
7386 |
- pg_{test_{fsync,timing},upgrade,waldump} |
7387 |
- post{gres,master} |
7388 |
- ) |
7389 |
- for m in ${serverman[@]} ; do |
7390 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
7391 |
- done |
7392 |
- fi |
7393 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
7394 |
- |
7395 |
- # Create slot specific man pages |
7396 |
- local bn f mansec slotted_name |
7397 |
- for mansec in 1 3 7 ; do |
7398 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
7399 |
- |
7400 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
7401 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
7402 |
- |
7403 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
7404 |
- bn=$(basename "${f}") |
7405 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
7406 |
- case ${bn} in |
7407 |
- TABLE.7|WITH.7) |
7408 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
7409 |
- ;; |
7410 |
- *) |
7411 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
7412 |
- ;; |
7413 |
- esac |
7414 |
- done |
7415 |
- |
7416 |
- popd > /dev/null |
7417 |
- done |
7418 |
- |
7419 |
- insinto /etc/postgresql-${SLOT} |
7420 |
- newins src/bin/psql/psqlrc.sample psqlrc |
7421 |
- |
7422 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
7423 |
- # needed by extensions utilizing PGXS. |
7424 |
- use static-libs || \ |
7425 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
7426 |
- -delete |
7427 |
- |
7428 |
- # Make slot specific links to programs |
7429 |
- local f bn |
7430 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
7431 |
- -mindepth 1 -maxdepth 1) |
7432 |
- do |
7433 |
- bn=$(basename "${f}") |
7434 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
7435 |
- "/usr/bin/${bn}${SLOT/.}" |
7436 |
- done |
7437 |
- |
7438 |
- if use doc ; then |
7439 |
- docinto html |
7440 |
- dodoc doc/src/sgml/html/* |
7441 |
- fi |
7442 |
- |
7443 |
- if use server; then |
7444 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
7445 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
7446 |
- |
7447 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
7448 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
7449 |
- |
7450 |
- if use systemd; then |
7451 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
7452 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
7453 |
- systemd_newunit - ${PN}-${SLOT}.service |
7454 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
7455 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
7456 |
- fi |
7457 |
- |
7458 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
7459 |
- |
7460 |
- if use prefix ; then |
7461 |
- keepdir /run/postgresql |
7462 |
- fperms 1775 /run/postgresql |
7463 |
- fi |
7464 |
- fi |
7465 |
-} |
7466 |
- |
7467 |
-pkg_postinst() { |
7468 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
7469 |
- postgresql-config update |
7470 |
- |
7471 |
- elog "If you need a global psqlrc-file, you can place it in:" |
7472 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
7473 |
- |
7474 |
- if use server ; then |
7475 |
- elog |
7476 |
- elog "Gentoo specific documentation:" |
7477 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
7478 |
- elog |
7479 |
- elog "Official documentation:" |
7480 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
7481 |
- elog |
7482 |
- elog "The default location of the Unix-domain socket is:" |
7483 |
- elog " ${EROOT}/run/postgresql/" |
7484 |
- elog |
7485 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
7486 |
- elog "so that it contains your preferred locale in:" |
7487 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7488 |
- elog |
7489 |
- elog "Then, execute the following command to setup the initial database" |
7490 |
- elog "environment:" |
7491 |
- elog " emerge --config =${CATEGORY}/${PF}" |
7492 |
- |
7493 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
7494 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
7495 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
7496 |
- ewarn "the following command after upgrading:" |
7497 |
- ewarn |
7498 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
7499 |
- fi |
7500 |
- fi |
7501 |
-} |
7502 |
- |
7503 |
-pkg_prerm() { |
7504 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
7505 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
7506 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
7507 |
- |
7508 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
7509 |
- sleep 10 |
7510 |
- eend 0 |
7511 |
- fi |
7512 |
-} |
7513 |
- |
7514 |
-pkg_postrm() { |
7515 |
- postgresql-config update |
7516 |
-} |
7517 |
- |
7518 |
-pkg_config() { |
7519 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
7520 |
- |
7521 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
7522 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7523 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
7524 |
- [[ -z "${DATA_DIR}" ]] \ |
7525 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
7526 |
- |
7527 |
- # environment.bz2 may not contain the same locale as the current system |
7528 |
- # locale. Unset and source from the current system locale. |
7529 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
7530 |
- unset LANG |
7531 |
- unset LC_CTYPE |
7532 |
- unset LC_NUMERIC |
7533 |
- unset LC_TIME |
7534 |
- unset LC_COLLATE |
7535 |
- unset LC_MONETARY |
7536 |
- unset LC_MESSAGES |
7537 |
- unset LC_ALL |
7538 |
- source "${EROOT}/etc/env.d/02locale" |
7539 |
- [ -n "${LANG}" ] && export LANG |
7540 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
7541 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
7542 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
7543 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
7544 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
7545 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
7546 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
7547 |
- fi |
7548 |
- |
7549 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
7550 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7551 |
- einfo |
7552 |
- einfo "Information on options that can be passed to initdb are found at:" |
7553 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
7554 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
7555 |
- einfo |
7556 |
- einfo "PG_INITDB_OPTS is currently set to:" |
7557 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
7558 |
- einfo " (none)" |
7559 |
- else |
7560 |
- einfo " ${PG_INITDB_OPTS}" |
7561 |
- fi |
7562 |
- einfo |
7563 |
- einfo "Configuration files will be installed to:" |
7564 |
- einfo " ${PGDATA}" |
7565 |
- einfo |
7566 |
- einfo "The database cluster will be created in:" |
7567 |
- einfo " ${DATA_DIR}" |
7568 |
- einfo |
7569 |
- |
7570 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
7571 |
- sleep 5 |
7572 |
- eend 0 |
7573 |
- |
7574 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
7575 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
7576 |
- eerror "Modify DATA_DIR to point to an empty directory." |
7577 |
- die "${DATA_DIR} is not empty." |
7578 |
- fi |
7579 |
- |
7580 |
- einfo "Creating the data directory ..." |
7581 |
- if [[ ${EUID} == 0 ]] ; then |
7582 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
7583 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
7584 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
7585 |
- fi |
7586 |
- |
7587 |
- einfo "Initializing the database ..." |
7588 |
- |
7589 |
- if [[ ${EUID} == 0 ]] ; then |
7590 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
7591 |
- else |
7592 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
7593 |
- fi |
7594 |
- |
7595 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
7596 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
7597 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
7598 |
- fi |
7599 |
- |
7600 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
7601 |
- # overridden in the initscript |
7602 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
7603 |
- |
7604 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
7605 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
7606 |
- # On the off-chance that you might need to work with UTF-8 encoded |
7607 |
- # characters in PL/Perl |
7608 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
7609 |
- EOF |
7610 |
- |
7611 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
7612 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
7613 |
- einfo "by default. You can disable it in the cluster's:" |
7614 |
- einfo " ${PGDATA%/}/postgresql.conf" |
7615 |
- einfo |
7616 |
- if ! use systemd; then |
7617 |
- einfo "The PostgreSQL server, by default, will log events to:" |
7618 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
7619 |
- einfo |
7620 |
- fi |
7621 |
- if use prefix ; then |
7622 |
- einfo "The location of the configuration files have moved to:" |
7623 |
- einfo " ${PGDATA}" |
7624 |
- einfo "To start the server:" |
7625 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
7626 |
- einfo "To stop:" |
7627 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
7628 |
- einfo |
7629 |
- einfo "Or move the configuration files back:" |
7630 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
7631 |
- elif use systemd; then |
7632 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
7633 |
- einfo "instead of 'pg_ctl'." |
7634 |
- else |
7635 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
7636 |
- einfo "instead of 'pg_ctl'." |
7637 |
- fi |
7638 |
-} |
7639 |
- |
7640 |
-src_test() { |
7641 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
7642 |
- # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set |
7643 |
- # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. |
7644 |
- local old_ctype=${LC_CTYPE} |
7645 |
- export LC_CTYPE=${LC_COLLATE} |
7646 |
- emake check |
7647 |
- export LC_CTYPE=${old_ctype} |
7648 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
7649 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
7650 |
- else |
7651 |
- use server || \ |
7652 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
7653 |
- [[ ${UID} -eq 0 ]] || \ |
7654 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
7655 |
- |
7656 |
- ewarn 'Skipping.' |
7657 |
- fi |
7658 |
-} |
7659 |
|
7660 |
diff --git a/dev-db/postgresql/postgresql-15_beta2.ebuild b/dev-db/postgresql/postgresql-15_beta2.ebuild |
7661 |
deleted file mode 100644 |
7662 |
index 0207dd4f4251..000000000000 |
7663 |
--- a/dev-db/postgresql/postgresql-15_beta2.ebuild |
7664 |
+++ /dev/null |
7665 |
@@ -1,464 +0,0 @@ |
7666 |
-# Copyright 1999-2022 Gentoo Authors |
7667 |
-# Distributed under the terms of the GNU General Public License v2 |
7668 |
- |
7669 |
-EAPI=7 |
7670 |
- |
7671 |
-PYTHON_COMPAT=( python3_{8,9,10,11} ) |
7672 |
- |
7673 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd tmpfiles |
7674 |
- |
7675 |
-KEYWORDS="" |
7676 |
- |
7677 |
-SLOT=$(ver_cut 1) |
7678 |
- |
7679 |
-MY_PV=${PV/_/} |
7680 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
7681 |
- |
7682 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
7683 |
- |
7684 |
-LICENSE="POSTGRESQL GPL-2" |
7685 |
-DESCRIPTION="PostgreSQL RDBMS" |
7686 |
-HOMEPAGE="https://www.postgresql.org/" |
7687 |
- |
7688 |
-IUSE="debug doc icu kerberos ldap llvm lz4 nls pam |
7689 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
7690 |
- threads uuid xml zlib zstd" |
7691 |
- |
7692 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
7693 |
- |
7694 |
-CDEPEND=" |
7695 |
->=app-eselect/eselect-postgresql-2.0 |
7696 |
-acct-group/postgres |
7697 |
-acct-user/postgres |
7698 |
-sys-apps/less |
7699 |
-virtual/libintl |
7700 |
-icu? ( dev-libs/icu:= ) |
7701 |
-kerberos? ( virtual/krb5 ) |
7702 |
-ldap? ( net-nds/openldap:= ) |
7703 |
-llvm? ( |
7704 |
- sys-devel/llvm:= |
7705 |
- sys-devel/clang:= |
7706 |
-) |
7707 |
-lz4? ( app-arch/lz4 ) |
7708 |
-pam? ( sys-libs/pam ) |
7709 |
-perl? ( >=dev-lang/perl-5.8:= ) |
7710 |
-python? ( ${PYTHON_DEPS} ) |
7711 |
-readline? ( sys-libs/readline:0= ) |
7712 |
-server? ( systemd? ( sys-apps/systemd ) ) |
7713 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
7714 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
7715 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
7716 |
-zlib? ( sys-libs/zlib ) |
7717 |
-zstd? ( app-arch/zstd ) |
7718 |
-" |
7719 |
- |
7720 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
7721 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
7722 |
-# the libc includes UUID functions. |
7723 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
7724 |
- |
7725 |
-nest_usedep() { |
7726 |
- local front back |
7727 |
- while [[ ${#} -gt 1 ]]; do |
7728 |
- front+="${1}? ( " |
7729 |
- back+=" )" |
7730 |
- shift |
7731 |
- done |
7732 |
- echo "${front}${1}${back}" |
7733 |
-} |
7734 |
- |
7735 |
-CDEPEND+=" |
7736 |
-uuid? ( |
7737 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
7738 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
7739 |
-)" |
7740 |
- |
7741 |
-DEPEND="${CDEPEND} |
7742 |
-sys-devel/bison |
7743 |
-sys-devel/flex |
7744 |
-nls? ( sys-devel/gettext ) |
7745 |
-xml? ( virtual/pkgconfig ) |
7746 |
-" |
7747 |
- |
7748 |
-RDEPEND="${CDEPEND} |
7749 |
-selinux? ( sec-policy/selinux-postgresql ) |
7750 |
-" |
7751 |
- |
7752 |
-pkg_setup() { |
7753 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
7754 |
- |
7755 |
- use python && python-single-r1_pkg_setup |
7756 |
-} |
7757 |
- |
7758 |
-src_prepare() { |
7759 |
- # Set proper run directory |
7760 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
7761 |
- -i src/include/pg_config_manual.h || die |
7762 |
- |
7763 |
- # Rely on $PATH being in the proper order so that the correct |
7764 |
- # install program is used for modules utilizing PGXS in both |
7765 |
- # hardened and non-hardened environments. (Bug #528786) |
7766 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
7767 |
- |
7768 |
- use server || eapply "${FILESDIR}/${PN}-14_rc1-no-server.patch" |
7769 |
- |
7770 |
- if use pam ; then |
7771 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
7772 |
- -i src/backend/libpq/auth.c || \ |
7773 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
7774 |
- fi |
7775 |
- |
7776 |
- eapply_user |
7777 |
-} |
7778 |
- |
7779 |
-src_configure() { |
7780 |
- case ${CHOST} in |
7781 |
- *-darwin*|*-solaris*) |
7782 |
- use nls && append-libs intl |
7783 |
- ;; |
7784 |
- esac |
7785 |
- |
7786 |
- export LDFLAGS_SL="${LDFLAGS}" |
7787 |
- export LDFLAGS_EX="${LDFLAGS}" |
7788 |
- |
7789 |
- local PO="${EPREFIX}" |
7790 |
- |
7791 |
- local i uuid_config="" |
7792 |
- if use uuid; then |
7793 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
7794 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
7795 |
- done |
7796 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
7797 |
- fi |
7798 |
- |
7799 |
- local myconf="\ |
7800 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
7801 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
7802 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
7803 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
7804 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
7805 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
7806 |
- $(use_enable debug) \ |
7807 |
- $(use_enable threads thread-safety) \ |
7808 |
- $(use_with icu) \ |
7809 |
- $(use_with kerberos gssapi) \ |
7810 |
- $(use_with ldap) \ |
7811 |
- $(use_with llvm) \ |
7812 |
- $(use_with lz4) \ |
7813 |
- $(use_with pam) \ |
7814 |
- $(use_with perl) \ |
7815 |
- $(use_with python) \ |
7816 |
- $(use_with readline) \ |
7817 |
- $(use_with ssl openssl) \ |
7818 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
7819 |
- $(use_with tcl) \ |
7820 |
- ${uuid_config} \ |
7821 |
- $(use_with xml libxml) \ |
7822 |
- $(use_with xml libxslt) \ |
7823 |
- $(use_with zlib) \ |
7824 |
- $(use_with zstd) \ |
7825 |
- $(use_enable nls)" |
7826 |
- if use alpha; then |
7827 |
- myconf+=" --disable-spinlocks" |
7828 |
- else |
7829 |
- # Should be the default but just in case |
7830 |
- myconf+=" --enable-spinlocks" |
7831 |
- fi |
7832 |
- econf ${myconf} |
7833 |
-} |
7834 |
- |
7835 |
-src_compile() { |
7836 |
- emake |
7837 |
- emake -C contrib |
7838 |
-} |
7839 |
- |
7840 |
-src_install() { |
7841 |
- emake DESTDIR="${D}" install |
7842 |
- emake DESTDIR="${D}" install -C contrib |
7843 |
- |
7844 |
- dodoc README HISTORY |
7845 |
- |
7846 |
- # man pages are already built, but if we have the target make them, |
7847 |
- # they'll be generated from source before being installed so we |
7848 |
- # manually install man pages. |
7849 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
7850 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
7851 |
- doins -r doc/src/sgml/man{1,3,7} |
7852 |
- if ! use server; then |
7853 |
- # Remove man pages for non-existent binaries |
7854 |
- serverman=( |
7855 |
- initdb |
7856 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
7857 |
- pg_{test_{fsync,timing},upgrade,waldump} |
7858 |
- post{gres,master} |
7859 |
- ) |
7860 |
- for m in ${serverman[@]} ; do |
7861 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
7862 |
- done |
7863 |
- fi |
7864 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
7865 |
- |
7866 |
- # Create slot specific man pages |
7867 |
- local bn f mansec slotted_name |
7868 |
- for mansec in 1 3 7 ; do |
7869 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
7870 |
- |
7871 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
7872 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
7873 |
- |
7874 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
7875 |
- bn=$(basename "${f}") |
7876 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
7877 |
- case ${bn} in |
7878 |
- TABLE.7|WITH.7) |
7879 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
7880 |
- ;; |
7881 |
- *) |
7882 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
7883 |
- ;; |
7884 |
- esac |
7885 |
- done |
7886 |
- |
7887 |
- popd > /dev/null |
7888 |
- done |
7889 |
- |
7890 |
- insinto /etc/postgresql-${SLOT} |
7891 |
- newins src/bin/psql/psqlrc.sample psqlrc |
7892 |
- |
7893 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
7894 |
- # needed by extensions utilizing PGXS. |
7895 |
- use static-libs || \ |
7896 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
7897 |
- -delete |
7898 |
- |
7899 |
- # Make slot specific links to programs |
7900 |
- local f bn |
7901 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
7902 |
- -mindepth 1 -maxdepth 1) |
7903 |
- do |
7904 |
- bn=$(basename "${f}") |
7905 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
7906 |
- "/usr/bin/${bn}${SLOT/.}" |
7907 |
- done |
7908 |
- |
7909 |
- if use doc ; then |
7910 |
- docinto html |
7911 |
- dodoc doc/src/sgml/html/* |
7912 |
- fi |
7913 |
- |
7914 |
- if use server; then |
7915 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
7916 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
7917 |
- |
7918 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
7919 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
7920 |
- |
7921 |
- if use systemd; then |
7922 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
7923 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
7924 |
- systemd_newunit - ${PN}-${SLOT}.service |
7925 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
7926 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
7927 |
- fi |
7928 |
- |
7929 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
7930 |
- |
7931 |
- if use prefix ; then |
7932 |
- keepdir /run/postgresql |
7933 |
- fperms 1775 /run/postgresql |
7934 |
- fi |
7935 |
- fi |
7936 |
-} |
7937 |
- |
7938 |
-pkg_postinst() { |
7939 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
7940 |
- postgresql-config update |
7941 |
- |
7942 |
- elog "If you need a global psqlrc-file, you can place it in:" |
7943 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
7944 |
- |
7945 |
- if use server ; then |
7946 |
- elog |
7947 |
- elog "Gentoo specific documentation:" |
7948 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
7949 |
- elog |
7950 |
- elog "Official documentation:" |
7951 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
7952 |
- elog |
7953 |
- elog "The default location of the Unix-domain socket is:" |
7954 |
- elog " ${EROOT}/run/postgresql/" |
7955 |
- elog |
7956 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
7957 |
- elog "so that it contains your preferred locale in:" |
7958 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7959 |
- elog |
7960 |
- elog "Then, execute the following command to setup the initial database" |
7961 |
- elog "environment:" |
7962 |
- elog " emerge --config =${CATEGORY}/${PF}" |
7963 |
- |
7964 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
7965 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
7966 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
7967 |
- ewarn "the following command after upgrading:" |
7968 |
- ewarn |
7969 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
7970 |
- fi |
7971 |
- fi |
7972 |
-} |
7973 |
- |
7974 |
-pkg_prerm() { |
7975 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
7976 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
7977 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
7978 |
- |
7979 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
7980 |
- sleep 10 |
7981 |
- eend 0 |
7982 |
- fi |
7983 |
-} |
7984 |
- |
7985 |
-pkg_postrm() { |
7986 |
- postgresql-config update |
7987 |
-} |
7988 |
- |
7989 |
-pkg_config() { |
7990 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
7991 |
- |
7992 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
7993 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
7994 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
7995 |
- [[ -z "${DATA_DIR}" ]] \ |
7996 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
7997 |
- |
7998 |
- # environment.bz2 may not contain the same locale as the current system |
7999 |
- # locale. Unset and source from the current system locale. |
8000 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
8001 |
- unset LANG |
8002 |
- unset LC_CTYPE |
8003 |
- unset LC_NUMERIC |
8004 |
- unset LC_TIME |
8005 |
- unset LC_COLLATE |
8006 |
- unset LC_MONETARY |
8007 |
- unset LC_MESSAGES |
8008 |
- unset LC_ALL |
8009 |
- source "${EROOT}/etc/env.d/02locale" |
8010 |
- [ -n "${LANG}" ] && export LANG |
8011 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
8012 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
8013 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
8014 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
8015 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
8016 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
8017 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
8018 |
- fi |
8019 |
- |
8020 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
8021 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
8022 |
- einfo |
8023 |
- einfo "Information on options that can be passed to initdb are found at:" |
8024 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
8025 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
8026 |
- einfo |
8027 |
- einfo "PG_INITDB_OPTS is currently set to:" |
8028 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
8029 |
- einfo " (none)" |
8030 |
- else |
8031 |
- einfo " ${PG_INITDB_OPTS}" |
8032 |
- fi |
8033 |
- einfo |
8034 |
- einfo "Configuration files will be installed to:" |
8035 |
- einfo " ${PGDATA}" |
8036 |
- einfo |
8037 |
- einfo "The database cluster will be created in:" |
8038 |
- einfo " ${DATA_DIR}" |
8039 |
- einfo |
8040 |
- |
8041 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
8042 |
- sleep 5 |
8043 |
- eend 0 |
8044 |
- |
8045 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
8046 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
8047 |
- eerror "Modify DATA_DIR to point to an empty directory." |
8048 |
- die "${DATA_DIR} is not empty." |
8049 |
- fi |
8050 |
- |
8051 |
- einfo "Creating the data directory ..." |
8052 |
- if [[ ${EUID} == 0 ]] ; then |
8053 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
8054 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
8055 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
8056 |
- fi |
8057 |
- |
8058 |
- einfo "Initializing the database ..." |
8059 |
- |
8060 |
- if [[ ${EUID} == 0 ]] ; then |
8061 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
8062 |
- else |
8063 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
8064 |
- fi |
8065 |
- |
8066 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
8067 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
8068 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
8069 |
- fi |
8070 |
- |
8071 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
8072 |
- # overridden in the initscript |
8073 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
8074 |
- |
8075 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
8076 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
8077 |
- # On the off-chance that you might need to work with UTF-8 encoded |
8078 |
- # characters in PL/Perl |
8079 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
8080 |
- EOF |
8081 |
- |
8082 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
8083 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
8084 |
- einfo "by default. You can disable it in the cluster's:" |
8085 |
- einfo " ${PGDATA%/}/postgresql.conf" |
8086 |
- einfo |
8087 |
- if ! use systemd; then |
8088 |
- einfo "The PostgreSQL server, by default, will log events to:" |
8089 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
8090 |
- einfo |
8091 |
- fi |
8092 |
- if use prefix ; then |
8093 |
- einfo "The location of the configuration files have moved to:" |
8094 |
- einfo " ${PGDATA}" |
8095 |
- einfo "To start the server:" |
8096 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
8097 |
- einfo "To stop:" |
8098 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
8099 |
- einfo |
8100 |
- einfo "Or move the configuration files back:" |
8101 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
8102 |
- elif use systemd; then |
8103 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
8104 |
- einfo "instead of 'pg_ctl'." |
8105 |
- else |
8106 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
8107 |
- einfo "instead of 'pg_ctl'." |
8108 |
- fi |
8109 |
-} |
8110 |
- |
8111 |
-src_test() { |
8112 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
8113 |
- # Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set |
8114 |
- # LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage. |
8115 |
- local old_ctype=${LC_CTYPE} |
8116 |
- export LC_CTYPE=${LC_COLLATE} |
8117 |
- emake check |
8118 |
- export LC_CTYPE=${old_ctype} |
8119 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
8120 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
8121 |
- else |
8122 |
- use server || \ |
8123 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
8124 |
- [[ ${UID} -eq 0 ]] || \ |
8125 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
8126 |
- |
8127 |
- ewarn 'Skipping.' |
8128 |
- fi |
8129 |
-} |