1 |
commit: df4d8da6daa40321673155e46f99646822ef79c7 |
2 |
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 22 16:13:27 2018 +0000 |
4 |
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 22 16:13:27 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df4d8da6 |
7 |
|
8 |
dev-db/postgresql: Partial cleanup |
9 |
|
10 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
11 |
|
12 |
dev-db/postgresql/Manifest | 10 - |
13 |
.../files/postgresql-9.2-9.4-tz-dir-overflow.patch | 16 - |
14 |
dev-db/postgresql/files/postgresql.confd | 58 --- |
15 |
dev-db/postgresql/files/postgresql.init | 137 ------ |
16 |
dev-db/postgresql/files/postgresql.init-9.3 | 142 ------ |
17 |
dev-db/postgresql/files/postgresql.service | 55 --- |
18 |
dev-db/postgresql/files/postgresql.service-9.6 | 56 --- |
19 |
dev-db/postgresql/postgresql-10.2.ebuild | 460 ------------------- |
20 |
dev-db/postgresql/postgresql-9.2.19.ebuild | 390 ---------------- |
21 |
dev-db/postgresql/postgresql-9.2.22.ebuild | 441 ------------------- |
22 |
dev-db/postgresql/postgresql-9.2.23-r1.ebuild | 445 ------------------- |
23 |
dev-db/postgresql/postgresql-9.2.23.ebuild | 441 ------------------- |
24 |
dev-db/postgresql/postgresql-9.3.15.ebuild | 395 ----------------- |
25 |
dev-db/postgresql/postgresql-9.3.21.ebuild | 450 ------------------- |
26 |
dev-db/postgresql/postgresql-9.4.10.ebuild | 427 ------------------ |
27 |
dev-db/postgresql/postgresql-9.4.16.ebuild | 482 -------------------- |
28 |
dev-db/postgresql/postgresql-9.5.11.ebuild | 488 --------------------- |
29 |
dev-db/postgresql/postgresql-9.5.5.ebuild | 438 ------------------ |
30 |
18 files changed, 5331 deletions(-) |
31 |
|
32 |
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest |
33 |
index bcb03981c22..ef78222884f 100644 |
34 |
--- a/dev-db/postgresql/Manifest |
35 |
+++ b/dev-db/postgresql/Manifest |
36 |
@@ -1,22 +1,12 @@ |
37 |
DIST postgresql-10.1.tar.bz2 19669989 BLAKE2B 2fbe782023b6d55c6fadaba38e517c60038b3b7b0a14fa8793043f7b9c4719a692440f286bb1f898045b5f56ef1c064f97f36e821990755077dc8d9bb0dbd639 SHA512 06050d353aa43f32e0de0199d833d8a4652aff893b718b1c40ed31837838f73fe4d977ac0f2164ab97b3eeff4aae3409f440601740898a893877d96bc0ed1882 |
38 |
-DIST postgresql-10.2.tar.bz2 19901836 BLAKE2B ea626774dc11463418b3d0126d04bd2d8eb7e8bb299551bff0c30c7f999f37a1f48e6bbfcde1ee15c0e0519e222bfe14f14d985503fe517a06f127009148ae98 SHA512 bac61644c12c31e2dce97ec0134902a2a7141e922619015425961b963961b21210ca840f59ba585d3d75c7e34cb640f2ebeaa2b25c4a866db68f5e73a8f8a448 |
39 |
DIST postgresql-10.3.tar.bz2 19959653 BLAKE2B ba3b05f53b0f879b18d6d0649bf819697c77a066b49d941a96d13a4741854b01aeb0c8b868d6550a08ad52572c9463c968660aa83c16cbaa5b4bf7a89387a524 SHA512 05cf82d3483bdf38734e6ff0fef6b80e7f8fd3cb5ea6792ffe222a599d97d1a29638970bf28ebf5bd1f877e8dcd9986d88f5c5e5379e74fe79ce83e20d2babba |
40 |
-DIST postgresql-9.2.19.tar.bz2 16466698 BLAKE2B ca5e84ac33923b36639bee403935c14c87bf37cd8061eb1d82bc1816449910ebe1373f74c2467850650fb7c3cadfe049a168ddc4a7e64ce54515731df552992a SHA512 d3b4c5578bf6d6580028e775bff81a921258cb53b6b06567d96a352d14f3b63063adb480b2f5e2029baf8a034e14b5cd75eebc04f1ed7b16c849e1a5ec1f4867 |
41 |
-DIST postgresql-9.2.22.tar.bz2 16531224 BLAKE2B 2d3b73db5c3082872df824b8e14e65c6cf4f7389f88b7ed577ddf59570294e74a6392a27f78e77c5da2c974566b38deaa979511649a6e95f5323d3961c587f78 SHA512 3e5ab04c2be2719579b2ebbf64b220522acfd9ea74029dd2ed699f60230da224bdc99de4ee5529b513e5586de0377764c4e54deb3dd93d5c53c4d666dce2b6b7 |
42 |
-DIST postgresql-9.2.23.tar.bz2 16531436 BLAKE2B df12276856e17693f0f1b2623a96ca15cfea95dc6e67e349391a60ba49d9a252ee94448bc07cbc0290f29546ba8b87fa24f62ca8f27cde41d4400c3aa275d778 SHA512 9715cb9aa34921f7d246837c6c516d588f88fda543ad635520e9575a5ea448ad39062f2c89c086c7f129cc5f61f4dca33e4f5fd94e1df39da428507c56a81ba3 |
43 |
DIST postgresql-9.2.24.tar.bz2 16552576 BLAKE2B 15e1fcc72830630c6c919113ed53c30c08f97c2543e678cac914b86456434d036f2efc262810e8f7ca0be714a8f690592a271ea5f6fb39777e73e94a9555e0ee SHA512 a6f043e5ef5e12e23c1c43b26a5ecafce62f3a86f38b5b85e7cb0cb7aa376d40e460a526baf67ae40de40525e4744fb5e48650ee5e007db4ce9742fcf548bd56 |
44 |
-DIST postgresql-9.3.15.tar.bz2 17059932 BLAKE2B c5afbdf3b1ffe457e137495001eb2f570adcf7844b909b62f3d077336d50b75d9fac456430c99df6449f1ea016252e9a99d96922fc3b5f21796c1361803312d6 SHA512 35c30cdb5599f99c94ab921f9f5e7671a8c0b7bca8fe3b616630ae13d6eda8d329e77e7e802da6a83cb09c3c9ca10fa8ce0de8a184e6fff471130e1cd68ce762 |
45 |
DIST postgresql-9.3.20.tar.bz2 17197360 BLAKE2B 2b07f6ee78294a490a8902d0129ac6b5e729e2d9a30631becc193cb7561294354a779ffc62bd61e807b1f540f01ce095e8ae4ad77adf2ea135389143809c9d48 SHA512 40098661bf00b64ad2d773b242613c44fe269b5ae984ad8990f85ce705b27138b127493c507103052fb6705d52f2e63a1df6692c7024d43c3c6b18154f2ef407 |
46 |
-DIST postgresql-9.3.21.tar.bz2 17014472 BLAKE2B 7735e7150c0418f979110cef083235959d22f4b63756cf76b9715862cc409b89f51b3e49bad9a33771b4df3ed39c515cf356c2ed69b77a3c7cb8d3448c83a024 SHA512 4c34ddf140a28b7095f8853f85c85cdc4ac44e4e5062ef66542c3082ada8509a201e0037e75d880e7909e1b41d0e3577713ad981cea8e693fb87644a0dce9929 |
47 |
DIST postgresql-9.3.22.tar.bz2 17022938 BLAKE2B 198705e438717d0d9e12c73e0c0e3eff0ba89ea50a1b183de70f065e13c153c164890fe56bc6ec13b0cb9617df4f66894c122eeddaf9303b9a02b8e08b19b085 SHA512 667ff496172626d2fe35c6795935fb07f4f7967a3b0631dd3b96278f8dc00b3d08794f091a5ab060a45d6f2a861e0f10f0e9660f9e343ab34eeabd693104c47f |
48 |
-DIST postgresql-9.4.10.tar.bz2 17802812 BLAKE2B 6f93a348ef51979b02c096d2c8fe980ce00e9fd1f9cf0766f3b06fa1ba9f52a146cffc205e7708c7bd16e0686486b21118734f4a1cd9823837abeee2e6fc9175 SHA512 2fcf47769b22c69bc82c9d6edc317e18dfcb4a96534e012bae4355e5088afa83da98b21e08a07766794f0a166888acbd16705a806464ea11711ed97c3b4012fb |
49 |
DIST postgresql-9.4.15.tar.bz2 17921677 BLAKE2B a41c81c7acc92265a6558c26370ff2afd258922a7158bbf40f8b1d6c7a3dbfb548502f42d646c96982dd5a87e5991f9d03046ae91e216704b97691666966d795 SHA512 be69f184cf18fb4c611d31a128f3593dc537551606f1db84a3ce9899b72f546876f05b29792435c3780c6c2b571759f4db2c172d62b2c012bd58574df80b4eb1 |
50 |
-DIST postgresql-9.4.16.tar.bz2 17778763 BLAKE2B 6051bbf042df6f7523ad5f27443c5c4fa8d3405813d40b281883df30f1f6a1709696cb1c0ff981bbe961eb6ba1ff1c49953736b730030111d106c700641954a5 SHA512 2e2bf14e2e63dec7254813e3c3a902a39cbd0aae89d8b3da5f75c6dead5d413a4f260fda6e87c9f84e4378df350c6531e67d972201f731a848b60bacef5b2bc8 |
51 |
DIST postgresql-9.4.17.tar.bz2 17807762 BLAKE2B 7640c29a71c6aeff47d9b43dd1e4f52edac4295b646b34da3a0ed9c26a8a826061bfd892e9907b62f31b7f01ee3aaf437c88d79b84d1d786d608dcd088309ecf SHA512 9ac03d460e521dcd142ac463dd5bb0f3e3f47333367bf8d61499ec7e8d0129d338c6f111667d0006df0c8ced9ae8a337d4c1b40eb5f55e6bc8dd5a24dfd376f0 |
52 |
DIST postgresql-9.5.10.tar.bz2 18701419 BLAKE2B bdd9a191f4de2ba1cb501476a5eabb377b60899b524f50e5baa1f47b95ce491634b7e69a9c37017614f48789d2b97fdff98e0b12ea06611d1ca76988a8db62c8 SHA512 24e31adabb0b88be882ab0440c560f0e4d5d69203be0581ca0ce22316555d92219ea0a2fd5254f12b2508bd3e58bbe0f1a7c8837228c96d9d5f00caac45af95a |
53 |
-DIST postgresql-9.5.11.tar.bz2 18572811 BLAKE2B 7b825d472e3bd6711eb3b4d5b1b5a03098d8d7ec7d0fc35cf7a5a12830bed9ca69922b75ab039fb6f0fcf1865a9fc37d3505d9eb129d03910ae1fa5e74f0a5db SHA512 c196709ddb953fe7ebdcee6e1d4624fc8136b83c5f0f6f010c29036a32f29f73763bdf64613dd57919d4be128e95a7f179c1c69a82f5951593c2fa0c2315fe83 |
54 |
DIST postgresql-9.5.12.tar.bz2 18589538 BLAKE2B 4246eb2bf5fe2e3bb48bdc411ebd3c87015570f0be4d8b1ed2a0f2ed20a8374e3244fa0aa17f9145f4f951c88f5b0717a4dd2186bf1621ce3334789f5f8dd50f SHA512 ab81bc95fd587f76a1986db5616b63d861b84da0eb9e54478f5298248a81d7a608d1bb1a9e30662c8190d05630106ddb3bb6413c34b003de948417214d342654 |
55 |
-DIST postgresql-9.5.5.tar.bz2 18525082 BLAKE2B 1a8e81b1f5b530c670863cfb08e47541c372e62f7ec6083da80b895cf015a80fc8bd3ffc9c7968e288303c71083ceda8ca54bcd3e2cb66c4f20b13396dc16fac SHA512 727ab57796cd393ec3755e9aabf515ebbdc3152b4062c20e64511e866a7e7038ba5c5e2843f13f3a79e2263296451f0e93108346b6f638611fba2449394e338e |
56 |
DIST postgresql-9.6.6.tar.bz2 19605724 BLAKE2B efdb13a4e32133b31a0ee368aed9bf76f0511596a2d77ade60129c2c76b0ba2c7dafad532cf09ae007d7110175a153968cfa151cf8aa7008b59d36ed00ed18ed SHA512 ac2f0fe6ef7c4e14f85cd7592d1306d9657b7f35efa6f43a089d7785ab970b8c25aa1e66d83df056c23513d6dbac0a9f54717b3d85758560d02e7f8141914ebc |
57 |
DIST postgresql-9.6.7.tar.bz2 19504886 BLAKE2B 04ed26987f3a38826b7e04bf364d8f59fc93aa700fdf74b4fc6afdb2fcf12697945c8354e49507af9c4d48fcc05173182cb164778c97845bf84250fd9e5ad882 SHA512 6a66cdd5b74ea6dc95628b89bb7663555370be56b3e938f635950628ad5d77443ac8f40c747be1fc1cfc19ca8b0a27f41e52fe4db83a43c7a7bab9bb076c7844 |
58 |
DIST postgresql-9.6.8.tar.bz2 19528927 BLAKE2B 6aab5dbe4b13e1624befc33c2fa5241804dff71879e2d60c166db19c2fe015cd19cfc35054e6aede82bfe6b83a7146b6d2eedaabb94111c163da732526ff1723 SHA512 6b7595c0046308c725d77360b156e979d6bc469b78ac6500f631112f19b2607ca2d816781f8c5fd3bd835c48e079e79ada7af687fbd306a8fec5e160f20dd211 |
59 |
|
60 |
diff --git a/dev-db/postgresql/files/postgresql-9.2-9.4-tz-dir-overflow.patch b/dev-db/postgresql/files/postgresql-9.2-9.4-tz-dir-overflow.patch |
61 |
deleted file mode 100644 |
62 |
index 59e43c5384e..00000000000 |
63 |
--- a/dev-db/postgresql/files/postgresql-9.2-9.4-tz-dir-overflow.patch |
64 |
+++ /dev/null |
65 |
@@ -1,16 +0,0 @@ |
66 |
---- a/src/timezone/pgtz.c 2015-02-02 15:45:23.000000000 -0500 |
67 |
-+++ b/src/timezone/pgtz.c 2015-04-07 14:21:22.341832190 -0400 |
68 |
-@@ -1615,6 +1615,13 @@ |
69 |
- if (direntry->d_name[0] == '.') |
70 |
- continue; |
71 |
- |
72 |
-+ /* copy current working directory so that there is no risk of modification by basename(), |
73 |
-+ * and compare to current direntry name; skip if they are the same as this is a recursive fs loop |
74 |
-+ */ |
75 |
-+ snprintf(fullname, MAXPGPATH, "%s", dir->dirname[dir->depth]); |
76 |
-+ if (strncmp(direntry->d_name,basename(fullname),strlen(direntry->d_name)) == 0) |
77 |
-+ continue; |
78 |
-+ |
79 |
- snprintf(fullname, MAXPGPATH, "%s/%s", |
80 |
- dir->dirname[dir->depth], direntry->d_name); |
81 |
- if (stat(fullname, &statbuf) != 0) |
82 |
|
83 |
diff --git a/dev-db/postgresql/files/postgresql.confd b/dev-db/postgresql/files/postgresql.confd |
84 |
deleted file mode 100644 |
85 |
index 07b465d9b61..00000000000 |
86 |
--- a/dev-db/postgresql/files/postgresql.confd |
87 |
+++ /dev/null |
88 |
@@ -1,58 +0,0 @@ |
89 |
-# Which port and socket to bind PostgreSQL |
90 |
-PGPORT="5432" |
91 |
- |
92 |
-# How long to wait for server to start in seconds |
93 |
-START_TIMEOUT=10 |
94 |
- |
95 |
-# NICE_QUIT ignores new connections and wait for clients to disconnect from |
96 |
-# server before shutting down. NICE_TIMEOUT in seconds determines how long to |
97 |
-# wait for this to succeed. |
98 |
-NICE_TIMEOUT=60 |
99 |
- |
100 |
-# Forecfully disconnect clients from server and shut down. This is performed |
101 |
-# after NICE_QUIT. Terminated client connections have their open transactions |
102 |
-# rolled back. |
103 |
-# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds. |
104 |
-RUDE_QUIT="YES" |
105 |
-RUDE_TIMEOUT=30 |
106 |
- |
107 |
-# If the server still fails to shutdown, you can force it to quit by setting |
108 |
-# this to YES and a recover-run will execute on the next startup. |
109 |
-# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds. |
110 |
-FORCE_QUIT="NO" |
111 |
-FORCE_TIMEOUT=2 |
112 |
- |
113 |
-# Extra options to run postmaster with, e.g.: |
114 |
-# -N is the maximal number of client connections |
115 |
-# -B is the number of shared buffers and has to be at least 2x the value for -N |
116 |
-# Please read the man-page to postmaster for more options. Many of these |
117 |
-# options can be set directly in the configuration file. |
118 |
-#PGOPTS="-N 512 -B 1024" |
119 |
- |
120 |
-# Pass extra environment variables. If you have to export environment variables |
121 |
-# for the database process, this can be done here. |
122 |
-# Don't forget to escape quotes. |
123 |
-#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\"" |
124 |
- |
125 |
-############################################################################## |
126 |
-# |
127 |
-# The following values should not be arbitrarily changed. |
128 |
-# |
129 |
-# `emerge --config dev-db/postgresql:@SLOT@' uses these values to |
130 |
-# determine where to create the data directory, where to place the |
131 |
-# configuration files, and any additional options to pass to initdb. |
132 |
-# |
133 |
-# The initscript also uses these variables to inform PostgreSQL where to find |
134 |
-# its data directory and configuration files. |
135 |
-# |
136 |
-############################################################################## |
137 |
- |
138 |
-# Location of configuration files |
139 |
-PGDATA="/etc/postgresql-@SLOT@/" |
140 |
- |
141 |
-# Where the data directory is located/to be created |
142 |
-DATA_DIR="/var/lib/postgresql/@SLOT@/data" |
143 |
- |
144 |
-# Additional options to pass to initdb. |
145 |
-# See `man initdb' for available options. |
146 |
-PG_INITDB_OPTS="--encoding=UTF8" |
147 |
|
148 |
diff --git a/dev-db/postgresql/files/postgresql.init b/dev-db/postgresql/files/postgresql.init |
149 |
deleted file mode 100644 |
150 |
index 35dd316e960..00000000000 |
151 |
--- a/dev-db/postgresql/files/postgresql.init |
152 |
+++ /dev/null |
153 |
@@ -1,137 +0,0 @@ |
154 |
-#!/sbin/openrc-run |
155 |
-# Copyright 1999-2014 Gentoo Foundation |
156 |
-# Distributed under the terms of the GNU General Public License v2 |
157 |
- |
158 |
-extra_started_commands="reload" |
159 |
- |
160 |
-get_config() { |
161 |
- [ -f ${PGDATA%/}/postgresql.conf ] || return 1 |
162 |
- |
163 |
- eval echo $(sed -e 's:#.*::' ${PGDATA%/}/postgresql.conf \ |
164 |
- | awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }') |
165 |
-} |
166 |
- |
167 |
-depend() { |
168 |
- use net |
169 |
- provide postgresql |
170 |
- |
171 |
- if [ "$(get_config log_destination)" = "syslog" ]; then |
172 |
- use logger |
173 |
- fi |
174 |
-} |
175 |
- |
176 |
-configured_port=$(get_config port) |
177 |
-: ${configured_port:=${PGPORT}} |
178 |
-socket_path=$(get_config unix_socket_directory) |
179 |
-: ${socket_path:=/run/postgresql} |
180 |
- |
181 |
-checkconfig() { |
182 |
- # Check that DATA_DIR has been set |
183 |
- if [ -z ${DATA_DIR} ] ; then |
184 |
- eerror "DATA_DIR not set" |
185 |
- eerror "HINT: Perhaps you need to update /etc/conf.d/postgresql-@SLOT@" |
186 |
- return 1 |
187 |
- fi |
188 |
- |
189 |
- # Check that DATA_DIR exists |
190 |
- if [ ! -d ${DATA_DIR} ] ; then |
191 |
- eerror "Directory not found: ${DATA_DIR}" |
192 |
- eerror "HINT: Ensure that DATA_DIR points to the right path." |
193 |
- eerror "HINT: Or perhaps you need to create the database cluster:" |
194 |
- eerror " emerge --config dev-db/postgresql:@SLOT@" |
195 |
- return 1 |
196 |
- fi |
197 |
- |
198 |
- # Check for the existence of PostgreSQL's config files, and set the |
199 |
- # proper mode and ownership. |
200 |
- # Only three files should be checked as potentially other files |
201 |
- # may be in PGDATA that should not be touched. |
202 |
- local file |
203 |
- for file in postgresql pg_hba pg_ident ; do |
204 |
- file="${PGDATA%/}/${file}.conf" |
205 |
- if [ -f ${file} ] ; then |
206 |
- checkpath -f -m 0600 -o postgres:postgres ${file} |
207 |
- else |
208 |
- eerror "${file} not found" |
209 |
- eerror "HINT: mv ${DATA_DIR%/}/*.conf ${PGDATA}" |
210 |
- return 1 |
211 |
- fi |
212 |
- done |
213 |
- |
214 |
- # Set the proper permission for the socket path and create it if |
215 |
- # it doesn't exist. |
216 |
- checkpath -d -m 1775 -o postgres:postgres ${socket_path} |
217 |
- if [ -e ${socket_path%/}/.s.PGSQL.${configured_port} ] ; then |
218 |
- eerror "Socket conflict." |
219 |
- eerror "A server is already listening on:" |
220 |
- eerror " ${socket_path%/}/.s.PGSQL.${configured_port}" |
221 |
- eerror "HINT: Change PGPORT to listen on a different socket." |
222 |
- return 1 |
223 |
- fi |
224 |
-} |
225 |
- |
226 |
-start() { |
227 |
- checkconfig || return 1 |
228 |
- |
229 |
- ebegin "Starting PostgreSQL" |
230 |
- |
231 |
- rm -f ${DATA_DIR%/}/postmaster.pid |
232 |
- |
233 |
- local extraenv |
234 |
- local x |
235 |
- for x in ${PG_EXTRA_ENV} ; do |
236 |
- extraenv="${extraenv} --env ${x}" |
237 |
- done |
238 |
- |
239 |
- start-stop-daemon --start \ |
240 |
- --user postgres \ |
241 |
- --env "PGPORT=${configured_port}" \ |
242 |
- ${extraenv} \ |
243 |
- --pidfile ${DATA_DIR%/}/postmaster.pid \ |
244 |
- --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl \ |
245 |
- -- start -s -w -t ${START_TIMEOUT} -l ${DATA_DIR%/}/postmaster.log \ |
246 |
- -D ${PGDATA} -o "--data-directory=${DATA_DIR} ${PGOPTS}" |
247 |
- local retval=$? |
248 |
- |
249 |
- if [ $retval -ne 0 ] ; then |
250 |
- eerror "Check the log for a possible explanation of the above error. The log may be" |
251 |
- eerror " ${DATA_DIR%/}/postmaster.log" |
252 |
- eerror "Or wherever you configured PostgreSQL @SLOT@ log messages to be sent." |
253 |
- eend $retval |
254 |
- return $retval |
255 |
- fi |
256 |
- |
257 |
- eend $retval |
258 |
-} |
259 |
- |
260 |
-stop() { |
261 |
- local seconds=$(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} )) |
262 |
- ebegin "Stopping PostgreSQL (this can take up to ${seconds} seconds)" |
263 |
- |
264 |
- local retval |
265 |
- local retries=SIGTERM/${NICE_TIMEOUT} |
266 |
- |
267 |
- if [ "${RUDE_QUIT}" != "NO" ] ; then |
268 |
- einfo "RUDE_QUIT enabled." |
269 |
- retries="${retries}/SIGINT/${RUDE_TIMEOUT}" |
270 |
- fi |
271 |
- if [ "${FORCE_QUIT}" = "YES" ] ; then |
272 |
- einfo "FORCE_QUIT enabled." |
273 |
- ewarn "A recover-run might be executed on next startup." |
274 |
- retries="${retries}/SIGQUIT/${FORCE_TIMEOUT}" |
275 |
- fi |
276 |
- |
277 |
- # Loops through nice, rude, and force quit in one go. |
278 |
- start-stop-daemon --stop \ |
279 |
- --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/postgres \ |
280 |
- --retry ${retries} \ |
281 |
- --pidfile ${DATA_DIR%/}/postmaster.pid |
282 |
- |
283 |
- eend |
284 |
-} |
285 |
- |
286 |
-reload() { |
287 |
- ebegin "Reloading PostgreSQL configuration" |
288 |
- kill -HUP $(head -n1 ${DATA_DIR%/}/postmaster.pid) |
289 |
- eend $? |
290 |
-} |
291 |
|
292 |
diff --git a/dev-db/postgresql/files/postgresql.init-9.3 b/dev-db/postgresql/files/postgresql.init-9.3 |
293 |
deleted file mode 100644 |
294 |
index ffecea7a757..00000000000 |
295 |
--- a/dev-db/postgresql/files/postgresql.init-9.3 |
296 |
+++ /dev/null |
297 |
@@ -1,142 +0,0 @@ |
298 |
-#!/sbin/openrc-run |
299 |
-# Copyright 1999-2015 Gentoo Foundation |
300 |
-# Distributed under the terms of the GNU General Public License v2 |
301 |
- |
302 |
-extra_started_commands="reload" |
303 |
- |
304 |
-get_config() { |
305 |
- [ -f ${PGDATA%/}/postgresql.conf ] || return 1 |
306 |
- |
307 |
- eval echo $(sed -e 's:#.*::' ${PGDATA%/}/postgresql.conf \ |
308 |
- | awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }') |
309 |
-} |
310 |
- |
311 |
-depend() { |
312 |
- use net |
313 |
- provide postgresql |
314 |
- |
315 |
- if [ "$(get_config log_destination)" = "syslog" ]; then |
316 |
- use logger |
317 |
- fi |
318 |
-} |
319 |
- |
320 |
-configured_port=$(get_config port) |
321 |
-: ${configured_port:=${PGPORT}} |
322 |
-socket_paths=$(get_config unix_socket_directories) |
323 |
-: ${socket_paths:=/run/postgresql} |
324 |
- |
325 |
-checkconfig() { |
326 |
- # Check that DATA_DIR has been set |
327 |
- if [ -z ${DATA_DIR} ] ; then |
328 |
- eerror "DATA_DIR not set" |
329 |
- eerror "HINT: Perhaps you need to update /etc/conf.d/postgresql-@SLOT@" |
330 |
- return 1 |
331 |
- fi |
332 |
- |
333 |
- # Check that DATA_DIR exists |
334 |
- if [ ! -d ${DATA_DIR} ] ; then |
335 |
- eerror "Directory not found: ${DATA_DIR}" |
336 |
- eerror "HINT: Ensure that DATA_DIR points to the right path." |
337 |
- eerror "HINT: Or perhaps you need to create the database cluster:" |
338 |
- eerror " emerge --config dev-db/postgresql:@SLOT@" |
339 |
- return 1 |
340 |
- fi |
341 |
- |
342 |
- # Check for the existence of PostgreSQL's config files, and set the |
343 |
- # proper mode and ownership. |
344 |
- # Only three files should be checked as potentially other files |
345 |
- # may be in PGDATA that should not be touched. |
346 |
- local file |
347 |
- for file in postgresql pg_hba pg_ident ; do |
348 |
- file="${PGDATA%/}/${file}.conf" |
349 |
- if [ -f ${file} ] ; then |
350 |
- checkpath -f -m 0600 -o postgres:postgres ${file} |
351 |
- else |
352 |
- eerror "${file} not found" |
353 |
- eerror "HINT: mv ${DATA_DIR%/}/*.conf ${PGDATA}" |
354 |
- return 1 |
355 |
- fi |
356 |
- done |
357 |
- |
358 |
- # Set the proper permission for the socket paths and create it if |
359 |
- # it doesn't exist. |
360 |
- set -f; IFS=',' |
361 |
- local s |
362 |
- for s in ${socket_paths}; do |
363 |
- checkpath -d -m 1775 -o postgres:postgres ${s} |
364 |
- if [ -e ${s%/}/.s.PGSQL.${configured_port} ] ; then |
365 |
- eerror "Socket conflict." |
366 |
- eerror "A server is already listening on:" |
367 |
- eerror " ${s%/}/.s.PGSQL.${configured_port}" |
368 |
- eerror "HINT: Change PGPORT to listen on a different socket." |
369 |
- return 1 |
370 |
- fi |
371 |
- done |
372 |
- set +f; unset IFS |
373 |
-} |
374 |
- |
375 |
-start() { |
376 |
- checkconfig || return 1 |
377 |
- |
378 |
- ebegin "Starting PostgreSQL" |
379 |
- |
380 |
- rm -f ${DATA_DIR%/}/postmaster.pid |
381 |
- |
382 |
- local extraenv |
383 |
- local x |
384 |
- for x in ${PG_EXTRA_ENV} ; do |
385 |
- extraenv="${extraenv} --env ${x}" |
386 |
- done |
387 |
- |
388 |
- start-stop-daemon --start \ |
389 |
- --user postgres \ |
390 |
- --env "PGPORT=${configured_port}" \ |
391 |
- ${extraenv} \ |
392 |
- --pidfile ${DATA_DIR%/}/postmaster.pid \ |
393 |
- --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl \ |
394 |
- -- start -s -w -t ${START_TIMEOUT} -l ${DATA_DIR%/}/postmaster.log \ |
395 |
- -D ${PGDATA} -o "--data-directory=${DATA_DIR} ${PGOPTS}" |
396 |
- local retval=$? |
397 |
- |
398 |
- if [ $retval -ne 0 ] ; then |
399 |
- eerror "Check the log for a possible explanation of the above error. The log may be" |
400 |
- eerror " ${DATA_DIR%/}/postmaster.log" |
401 |
- eerror "Or wherever you configured PostgreSQL @SLOT@ log messages to be sent." |
402 |
- eend $retval |
403 |
- return $retval |
404 |
- fi |
405 |
- |
406 |
- eend $retval |
407 |
-} |
408 |
- |
409 |
-stop() { |
410 |
- local seconds=$(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} )) |
411 |
- ebegin "Stopping PostgreSQL (this can take up to ${seconds} seconds)" |
412 |
- |
413 |
- local retval |
414 |
- local retries=SIGTERM/${NICE_TIMEOUT} |
415 |
- |
416 |
- if [ "${RUDE_QUIT}" != "NO" ] ; then |
417 |
- einfo "RUDE_QUIT enabled." |
418 |
- retries="${retries}/SIGINT/${RUDE_TIMEOUT}" |
419 |
- fi |
420 |
- if [ "${FORCE_QUIT}" = "YES" ] ; then |
421 |
- einfo "FORCE_QUIT enabled." |
422 |
- ewarn "A recover-run might be executed on next startup." |
423 |
- retries="${retries}/SIGQUIT/${FORCE_TIMEOUT}" |
424 |
- fi |
425 |
- |
426 |
- # Loops through nice, rude, and force quit in one go. |
427 |
- start-stop-daemon --stop \ |
428 |
- --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/postgres \ |
429 |
- --retry ${retries} \ |
430 |
- --pidfile ${DATA_DIR%/}/postmaster.pid |
431 |
- |
432 |
- eend |
433 |
-} |
434 |
- |
435 |
-reload() { |
436 |
- ebegin "Reloading PostgreSQL configuration" |
437 |
- kill -HUP $(head -n1 ${DATA_DIR%/}/postmaster.pid) |
438 |
- eend $? |
439 |
-} |
440 |
|
441 |
diff --git a/dev-db/postgresql/files/postgresql.service b/dev-db/postgresql/files/postgresql.service |
442 |
deleted file mode 100644 |
443 |
index a607169d22f..00000000000 |
444 |
--- a/dev-db/postgresql/files/postgresql.service |
445 |
+++ /dev/null |
446 |
@@ -1,55 +0,0 @@ |
447 |
-# It's not recommended to modify this file in-place, because it will be |
448 |
-# overwritten during package upgrades. If you want to customize, the |
449 |
-# best way is to create file |
450 |
-# "/etc/systemd/system/postgresql-@SLOT@.service.d/*.conf" |
451 |
-# containing your changes |
452 |
- |
453 |
-# For example, if you want to change the server's port number to 5433, |
454 |
-# create a file named |
455 |
-# "/etc/systemd/system/postgresql-@SLOT@.service.d/port.conf" |
456 |
-# containing: |
457 |
-# [Service] |
458 |
-# Environment=PGPORT=5433 |
459 |
-# This will override the setting appearing below. |
460 |
- |
461 |
-[Unit] |
462 |
-Description=PostgreSQL database server |
463 |
-After=network.target |
464 |
- |
465 |
-[Service] |
466 |
-Type=forking |
467 |
- |
468 |
-User=postgres |
469 |
-Group=postgres |
470 |
- |
471 |
-# Port number for server to listen on |
472 |
-Environment=PGPORT=5432 |
473 |
- |
474 |
-# Location of configuration files |
475 |
-Environment=PGDATA=/etc/postgresql-@SLOT@ |
476 |
- |
477 |
-# Where the data directory is located |
478 |
-Environment=DATA_DIR=/var/lib/postgresql/@SLOT@/data |
479 |
- |
480 |
-# Where to send early-startup messages from the server (before the logging |
481 |
-# options of postgresql.conf take effect) |
482 |
-# This is normally controlled by the global default set by systemd |
483 |
-# StandardOutput=syslog |
484 |
- |
485 |
-ExecStartPre=/usr/bin/postgresql-@SLOT@-check-db-dir |
486 |
-ExecStart=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl start -D ${DATA_DIR} -s -l ${DATA_DIR}/postmaster.log -o "-p ${PGPORT} -D ${PGDATA} --data-directory=${DATA_DIR}" -w -t 300 |
487 |
-ExecStop=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl stop -D ${DATA_DIR} -s -m fast |
488 |
-ExecReload=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl reload -D ${DATA_DIR} -s |
489 |
- |
490 |
-# Give a reasonable amount of time for the server to start up/shut down |
491 |
-TimeoutSec=300 |
492 |
- |
493 |
-# Disable OOM kill on the postmaster |
494 |
-OOMScoreAdjust=-1000 |
495 |
- |
496 |
-# Make sure the required runtimedir is present |
497 |
-RuntimeDirectory=postgresql |
498 |
-RuntimeDirectoryMode=1775 |
499 |
- |
500 |
-[Install] |
501 |
-WantedBy=multi-user.target |
502 |
|
503 |
diff --git a/dev-db/postgresql/files/postgresql.service-9.6 b/dev-db/postgresql/files/postgresql.service-9.6 |
504 |
deleted file mode 100644 |
505 |
index 89ec2d5cf7c..00000000000 |
506 |
--- a/dev-db/postgresql/files/postgresql.service-9.6 |
507 |
+++ /dev/null |
508 |
@@ -1,56 +0,0 @@ |
509 |
-# It's not recommended to modify this file in-place, because it will be |
510 |
-# overwritten during package upgrades. If you want to customize, the |
511 |
-# best way is to create file |
512 |
-# "/etc/systemd/system/postgresql-@SLOT@.service.d/*.conf" |
513 |
-# containing your changes |
514 |
- |
515 |
-# For example, if you want to change the server's port number to 5433, |
516 |
-# create a file named |
517 |
-# "/etc/systemd/system/postgresql-@SLOT@.service.d/port.conf" |
518 |
-# containing: |
519 |
-# [Service] |
520 |
-# Environment=PGPORT=5433 |
521 |
-# This will override the setting appearing below. |
522 |
- |
523 |
-[Unit] |
524 |
-Description=PostgreSQL database server |
525 |
-After=network.target |
526 |
- |
527 |
-[Service] |
528 |
-Type=notify |
529 |
- |
530 |
-User=postgres |
531 |
-Group=postgres |
532 |
- |
533 |
-# Port number for server to listen on |
534 |
-Environment=PGPORT=5432 |
535 |
- |
536 |
-# Location of configuration files |
537 |
-Environment=PGDATA=/etc/postgresql-@SLOT@ |
538 |
- |
539 |
-# Where the data directory is located |
540 |
-Environment=DATA_DIR=/var/lib/postgresql/@SLOT@/data |
541 |
- |
542 |
-# Where to send early-startup messages from the server (before the logging |
543 |
-# options of postgresql.conf take effect) |
544 |
-# This is normally controlled by the global default set by systemd |
545 |
-# StandardOutput=syslog |
546 |
- |
547 |
-ExecStartPre=/usr/bin/postgresql-@SLOT@-check-db-dir |
548 |
-ExecStart=/usr/@LIBDIR@/postgresql-@SLOT@/bin/postgres -p ${PGPORT} -D ${DATA_DIR} |
549 |
-ExecReload=/bin/kill -HUP $MAINPID |
550 |
-KillMode=mixed |
551 |
-KillSignal=SIGINT |
552 |
- |
553 |
-# Give a reasonable amount of time for the server to start up/shut down |
554 |
-TimeoutSec=300 |
555 |
- |
556 |
-# Disable OOM kill on the postmaster |
557 |
-OOMScoreAdjust=-1000 |
558 |
- |
559 |
-# Make sure the required runtimedir is present |
560 |
-RuntimeDirectory=postgresql |
561 |
-RuntimeDirectoryMode=1775 |
562 |
- |
563 |
-[Install] |
564 |
-WantedBy=multi-user.target |
565 |
|
566 |
diff --git a/dev-db/postgresql/postgresql-10.2.ebuild b/dev-db/postgresql/postgresql-10.2.ebuild |
567 |
deleted file mode 100644 |
568 |
index 3606fab4916..00000000000 |
569 |
--- a/dev-db/postgresql/postgresql-10.2.ebuild |
570 |
+++ /dev/null |
571 |
@@ -1,460 +0,0 @@ |
572 |
-# Copyright 1999-2018 Gentoo Foundation |
573 |
-# Distributed under the terms of the GNU General Public License v2 |
574 |
- |
575 |
-EAPI="6" |
576 |
- |
577 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
578 |
- |
579 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
580 |
- systemd user versionator |
581 |
- |
582 |
-KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
583 |
- |
584 |
-SLOT=$(get_major_version) |
585 |
- |
586 |
-MY_PV=${PV/_/} |
587 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
588 |
- |
589 |
-SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
590 |
- |
591 |
-LICENSE="POSTGRESQL GPL-2" |
592 |
-DESCRIPTION="PostgreSQL RDBMS" |
593 |
-HOMEPAGE="http://www.postgresql.org/" |
594 |
- |
595 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl python +readline |
596 |
- selinux +server systemd ssl static-libs tcl threads uuid xml zlib" |
597 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
598 |
- |
599 |
-wanted_languages() { |
600 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
601 |
- sk sl sv tr zh_CN zh_TW" |
602 |
- local enable_langs lingua |
603 |
- |
604 |
- for lingua in ${linguas} ; do |
605 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
606 |
- done |
607 |
- |
608 |
- echo -n ${enable_langs} |
609 |
-} |
610 |
- |
611 |
-CDEPEND=" |
612 |
->=app-eselect/eselect-postgresql-2.0 |
613 |
-sys-apps/less |
614 |
-virtual/libintl |
615 |
-kerberos? ( virtual/krb5 ) |
616 |
-ldap? ( net-nds/openldap ) |
617 |
-pam? ( virtual/pam ) |
618 |
-perl? ( >=dev-lang/perl-5.8:= ) |
619 |
-python? ( ${PYTHON_DEPS} ) |
620 |
-readline? ( sys-libs/readline:0= ) |
621 |
-server? ( systemd? ( sys-apps/systemd ) ) |
622 |
-ssl? ( |
623 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
624 |
- libressl? ( dev-libs/libressl:= ) |
625 |
-) |
626 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
627 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
628 |
-zlib? ( sys-libs/zlib ) |
629 |
-" |
630 |
- |
631 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
632 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
633 |
-# the libc includes UUID functions. |
634 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
635 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
636 |
- |
637 |
-nest_usedep() { |
638 |
- local front back |
639 |
- while [[ ${#} -gt 1 ]]; do |
640 |
- front+="${1}? ( " |
641 |
- back+=" )" |
642 |
- shift |
643 |
- done |
644 |
- echo "${front}${1}${back}" |
645 |
-} |
646 |
- |
647 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
648 |
-CDEPEND+=" |
649 |
-uuid? ( |
650 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
651 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
652 |
-)" |
653 |
- |
654 |
-DEPEND="${CDEPEND} |
655 |
-!!<sys-apps/sandbox-2.0 |
656 |
-sys-devel/bison |
657 |
-sys-devel/flex |
658 |
-nls? ( sys-devel/gettext ) |
659 |
-xml? ( virtual/pkgconfig ) |
660 |
-" |
661 |
- |
662 |
-RDEPEND="${CDEPEND} |
663 |
-!dev-db/postgresql-docs:${SLOT} |
664 |
-!dev-db/postgresql-base:${SLOT} |
665 |
-!dev-db/postgresql-server:${SLOT} |
666 |
-selinux? ( sec-policy/selinux-postgresql ) |
667 |
-" |
668 |
- |
669 |
-pkg_setup() { |
670 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
671 |
- |
672 |
- enewgroup postgres 70 |
673 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
674 |
- |
675 |
- use python && python-single-r1_pkg_setup |
676 |
-} |
677 |
- |
678 |
-src_prepare() { |
679 |
- # Work around PPC{,64} compilation bug where bool is already defined |
680 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
681 |
- |
682 |
- # Set proper run directory |
683 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
684 |
- -i src/include/pg_config_manual.h || die |
685 |
- |
686 |
- # Rely on $PATH being in the proper order so that the correct |
687 |
- # install program is used for modules utilizing PGXS in both |
688 |
- # hardened and non-hardened environments. (Bug #528786) |
689 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
690 |
- |
691 |
- use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch" |
692 |
- |
693 |
- if use pam ; then |
694 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
695 |
- -i src/backend/libpq/auth.c || \ |
696 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
697 |
- fi |
698 |
- |
699 |
- eapply_user |
700 |
-} |
701 |
- |
702 |
-src_configure() { |
703 |
- case ${CHOST} in |
704 |
- *-darwin*|*-solaris*) |
705 |
- use nls && append-libs intl |
706 |
- ;; |
707 |
- esac |
708 |
- |
709 |
- export LDFLAGS_SL="${LDFLAGS}" |
710 |
- export LDFLAGS_EX="${LDFLAGS}" |
711 |
- |
712 |
- local PO="${EPREFIX%/}" |
713 |
- |
714 |
- local i uuid_config="" |
715 |
- if use uuid; then |
716 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
717 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
718 |
- done |
719 |
- for i in ${BSD_LIBC[@]}; do |
720 |
- use ${i} && uuid_config="--with-uuid=bsd" |
721 |
- done |
722 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
723 |
- fi |
724 |
- |
725 |
- econf \ |
726 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
727 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
728 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
729 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
730 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
731 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
732 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
733 |
- $(use_enable !alpha spinlocks) \ |
734 |
- $(use_enable threads thread-safety) \ |
735 |
- $(use_with kerberos gssapi) \ |
736 |
- $(use_with ldap) \ |
737 |
- $(use_with pam) \ |
738 |
- $(use_with perl) \ |
739 |
- $(use_with python) \ |
740 |
- $(use_with readline) \ |
741 |
- $(use_with ssl openssl) \ |
742 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
743 |
- $(use_with tcl) \ |
744 |
- ${uuid_config} \ |
745 |
- $(use_with xml libxml) \ |
746 |
- $(use_with xml libxslt) \ |
747 |
- $(use_with zlib) \ |
748 |
- "$(use_enable nls nls "$(wanted_languages)")" |
749 |
-} |
750 |
- |
751 |
-src_compile() { |
752 |
- emake |
753 |
- emake -C contrib |
754 |
-} |
755 |
- |
756 |
-src_install() { |
757 |
- emake DESTDIR="${D}" install |
758 |
- emake DESTDIR="${D}" install -C contrib |
759 |
- |
760 |
- dodoc README HISTORY doc/{TODO,bug.template} |
761 |
- |
762 |
- # man pages are already built, but if we have the target make them, |
763 |
- # they'll be generated from source before being installed so we |
764 |
- # manually install man pages. |
765 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
766 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
767 |
- doins -r doc/src/sgml/man{1,3,7} |
768 |
- if ! use server; then |
769 |
- # Remove man pages for non-existent binaries |
770 |
- serverman=( |
771 |
- initdb |
772 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
773 |
- pg_{test_{fsync,timing},upgrade,waldump} |
774 |
- post{gres,master} |
775 |
- ) |
776 |
- for m in ${serverman[@]} ; do |
777 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
778 |
- done |
779 |
- fi |
780 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
781 |
- |
782 |
- # Create slot specific man pages |
783 |
- local bn f mansec slotted_name |
784 |
- for mansec in 1 3 7 ; do |
785 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
786 |
- |
787 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
788 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
789 |
- |
790 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
791 |
- bn=$(basename "${f}") |
792 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
793 |
- case ${bn} in |
794 |
- TABLE.7|WITH.7) |
795 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
796 |
- ;; |
797 |
- *) |
798 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
799 |
- ;; |
800 |
- esac |
801 |
- done |
802 |
- |
803 |
- popd > /dev/null |
804 |
- done |
805 |
- |
806 |
- insinto /etc/postgresql-${SLOT} |
807 |
- newins src/bin/psql/psqlrc.sample psqlrc |
808 |
- |
809 |
- use static-libs || find "${ED}" -name '*.a' -delete |
810 |
- |
811 |
- local f bn |
812 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
813 |
- -mindepth 1 -maxdepth 1) |
814 |
- do |
815 |
- bn=$(basename "${f}") |
816 |
- # Temporarily tack on tmp to workaround a file collision |
817 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
818 |
- # had this issue. |
819 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
820 |
- "/usr/bin/${bn}${SLOT/.}" |
821 |
- done |
822 |
- |
823 |
- if use doc ; then |
824 |
- docinto html |
825 |
- dodoc doc/src/sgml/html/* |
826 |
- fi |
827 |
- |
828 |
- if use server; then |
829 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
830 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
831 |
- |
832 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
833 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
834 |
- |
835 |
- if use systemd; then |
836 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
837 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
838 |
- systemd_newunit - ${PN}-${SLOT}.service |
839 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
840 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
841 |
- fi |
842 |
- |
843 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
844 |
- |
845 |
- if use prefix ; then |
846 |
- keepdir /run/postgresql |
847 |
- fperms 1775 /run/postgresql |
848 |
- fi |
849 |
- fi |
850 |
-} |
851 |
- |
852 |
-pkg_postinst() { |
853 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
854 |
- postgresql-config update |
855 |
- |
856 |
- elog "If you need a global psqlrc-file, you can place it in:" |
857 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
858 |
- |
859 |
- if use server ; then |
860 |
- elog |
861 |
- elog "Gentoo specific documentation:" |
862 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
863 |
- elog |
864 |
- elog "Official documentation:" |
865 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
866 |
- elog |
867 |
- elog "The default location of the Unix-domain socket is:" |
868 |
- elog " ${EROOT%/}/run/postgresql/" |
869 |
- elog |
870 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
871 |
- elog "so that it contains your preferred locale in:" |
872 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
873 |
- elog |
874 |
- elog "Then, execute the following command to setup the initial database" |
875 |
- elog "environment:" |
876 |
- elog " emerge --config =${CATEGORY}/${PF}" |
877 |
- fi |
878 |
-} |
879 |
- |
880 |
-pkg_prerm() { |
881 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
882 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
883 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
884 |
- |
885 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
886 |
- sleep 10 |
887 |
- eend 0 |
888 |
- fi |
889 |
-} |
890 |
- |
891 |
-pkg_postrm() { |
892 |
- postgresql-config update |
893 |
-} |
894 |
- |
895 |
-pkg_config() { |
896 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
897 |
- |
898 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
899 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
900 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
901 |
- [[ -z "${DATA_DIR}" ]] \ |
902 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
903 |
- |
904 |
- # environment.bz2 may not contain the same locale as the current system |
905 |
- # locale. Unset and source from the current system locale. |
906 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
907 |
- unset LANG |
908 |
- unset LC_CTYPE |
909 |
- unset LC_NUMERIC |
910 |
- unset LC_TIME |
911 |
- unset LC_COLLATE |
912 |
- unset LC_MONETARY |
913 |
- unset LC_MESSAGES |
914 |
- unset LC_ALL |
915 |
- source "${EROOT%/}/etc/env.d/02locale" |
916 |
- [ -n "${LANG}" ] && export LANG |
917 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
918 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
919 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
920 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
921 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
922 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
923 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
924 |
- fi |
925 |
- |
926 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
927 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
928 |
- einfo |
929 |
- einfo "Information on options that can be passed to initdb are found at:" |
930 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
931 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
932 |
- einfo |
933 |
- einfo "PG_INITDB_OPTS is currently set to:" |
934 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
935 |
- einfo " (none)" |
936 |
- else |
937 |
- einfo " ${PG_INITDB_OPTS}" |
938 |
- fi |
939 |
- einfo |
940 |
- einfo "Configuration files will be installed to:" |
941 |
- einfo " ${PGDATA}" |
942 |
- einfo |
943 |
- einfo "The database cluster will be created in:" |
944 |
- einfo " ${DATA_DIR}" |
945 |
- einfo |
946 |
- |
947 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
948 |
- sleep 5 |
949 |
- eend 0 |
950 |
- |
951 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
952 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
953 |
- eerror "Modify DATA_DIR to point to an empty directory." |
954 |
- die "${DATA_DIR} is not empty." |
955 |
- fi |
956 |
- |
957 |
- einfo "Creating the data directory ..." |
958 |
- if [[ ${EUID} == 0 ]] ; then |
959 |
- mkdir -p "${DATA_DIR}" |
960 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
961 |
- chmod 0700 "${DATA_DIR}" |
962 |
- fi |
963 |
- |
964 |
- einfo "Initializing the database ..." |
965 |
- |
966 |
- if [[ ${EUID} == 0 ]] ; then |
967 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
968 |
- else |
969 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
970 |
- fi |
971 |
- |
972 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
973 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
974 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
975 |
- fi |
976 |
- |
977 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
978 |
- # overridden in the initscript |
979 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
980 |
- |
981 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
982 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
983 |
- # On the off-chance that you might need to work with UTF-8 encoded |
984 |
- # characters in PL/Perl |
985 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
986 |
- EOF |
987 |
- |
988 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
989 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
990 |
- einfo "by default. You can disable it in the cluster's:" |
991 |
- einfo " ${PGDATA%/}/postgresql.conf" |
992 |
- einfo |
993 |
- if ! use systemd; then |
994 |
- einfo "The PostgreSQL server, by default, will log events to:" |
995 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
996 |
- einfo |
997 |
- fi |
998 |
- if use prefix ; then |
999 |
- einfo "The location of the configuration files have moved to:" |
1000 |
- einfo " ${PGDATA}" |
1001 |
- einfo "To start the server:" |
1002 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1003 |
- einfo "To stop:" |
1004 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1005 |
- einfo |
1006 |
- einfo "Or move the configuration files back:" |
1007 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1008 |
- elif use systemd; then |
1009 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
1010 |
- einfo "instead of 'pg_ctl'." |
1011 |
- else |
1012 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1013 |
- einfo "instead of 'pg_ctl'." |
1014 |
- fi |
1015 |
-} |
1016 |
- |
1017 |
-src_test() { |
1018 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
1019 |
- emake check |
1020 |
- |
1021 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
1022 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
1023 |
- else |
1024 |
- use server || \ |
1025 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
1026 |
- [[ ${UID} -eq 0 ]] || \ |
1027 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
1028 |
- |
1029 |
- ewarn 'Skipping.' |
1030 |
- fi |
1031 |
-} |
1032 |
|
1033 |
diff --git a/dev-db/postgresql/postgresql-9.2.19.ebuild b/dev-db/postgresql/postgresql-9.2.19.ebuild |
1034 |
deleted file mode 100644 |
1035 |
index 54d1c48fa58..00000000000 |
1036 |
--- a/dev-db/postgresql/postgresql-9.2.19.ebuild |
1037 |
+++ /dev/null |
1038 |
@@ -1,390 +0,0 @@ |
1039 |
-# Copyright 1999-2018 Gentoo Foundation |
1040 |
-# Distributed under the terms of the GNU General Public License v2 |
1041 |
- |
1042 |
-EAPI="5" |
1043 |
- |
1044 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
1045 |
- |
1046 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
1047 |
- systemd user versionator |
1048 |
- |
1049 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
1050 |
- |
1051 |
-SLOT="$(get_version_component_range 1-2)" |
1052 |
- |
1053 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
1054 |
- |
1055 |
-LICENSE="POSTGRESQL GPL-2" |
1056 |
-DESCRIPTION="PostgreSQL RDBMS" |
1057 |
-HOMEPAGE="http://www.postgresql.org/" |
1058 |
- |
1059 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
1060 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
1061 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1062 |
- |
1063 |
-wanted_languages() { |
1064 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
1065 |
- sk sl sv tr zh_CN zh_TW" |
1066 |
- local enable_langs lingua |
1067 |
- |
1068 |
- for lingua in ${linguas} ; do |
1069 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
1070 |
- done |
1071 |
- |
1072 |
- echo -n ${enable_langs} |
1073 |
-} |
1074 |
- |
1075 |
-CDEPEND=" |
1076 |
->=app-eselect/eselect-postgresql-1.2.0 |
1077 |
-sys-apps/less |
1078 |
-virtual/libintl |
1079 |
-kerberos? ( virtual/krb5 ) |
1080 |
-ldap? ( net-nds/openldap ) |
1081 |
-pam? ( virtual/pam ) |
1082 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1083 |
-python? ( ${PYTHON_DEPS} ) |
1084 |
-readline? ( sys-libs/readline:0= ) |
1085 |
-ssl? ( |
1086 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1087 |
- libressl? ( dev-libs/libressl:= ) |
1088 |
-) |
1089 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1090 |
-uuid? ( dev-libs/ossp-uuid ) |
1091 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1092 |
-zlib? ( sys-libs/zlib ) |
1093 |
-" |
1094 |
- |
1095 |
-DEPEND="${CDEPEND} |
1096 |
-!!<sys-apps/sandbox-2.0 |
1097 |
-sys-devel/bison |
1098 |
-sys-devel/flex |
1099 |
-nls? ( sys-devel/gettext ) |
1100 |
-xml? ( virtual/pkgconfig ) |
1101 |
-" |
1102 |
- |
1103 |
-RDEPEND="${CDEPEND} |
1104 |
-!dev-db/postgresql-docs:${SLOT} |
1105 |
-!dev-db/postgresql-base:${SLOT} |
1106 |
-!dev-db/postgresql-server:${SLOT} |
1107 |
-selinux? ( sec-policy/selinux-postgresql ) |
1108 |
-" |
1109 |
- |
1110 |
-pkg_setup() { |
1111 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1112 |
- |
1113 |
- enewgroup postgres 70 |
1114 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
1115 |
- |
1116 |
- use python && python-single-r1_pkg_setup |
1117 |
-} |
1118 |
- |
1119 |
-src_prepare() { |
1120 |
- # Work around PPC{,64} compilation bug where bool is already defined |
1121 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
1122 |
- |
1123 |
- # Set proper run directory |
1124 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1125 |
- -i src/include/pg_config_manual.h || die |
1126 |
- |
1127 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
1128 |
- |
1129 |
- # Fix bug 486556 where the server would crash at start up because of |
1130 |
- # an infinite loop caused by a self-referencing symlink. |
1131 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
1132 |
- |
1133 |
- if use pam ; then |
1134 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1135 |
- -i src/backend/libpq/auth.c || \ |
1136 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1137 |
- fi |
1138 |
- |
1139 |
- epatch_user |
1140 |
-} |
1141 |
- |
1142 |
-src_configure() { |
1143 |
- case ${CHOST} in |
1144 |
- *-darwin*|*-solaris*) |
1145 |
- use nls && append-libs intl |
1146 |
- ;; |
1147 |
- esac |
1148 |
- |
1149 |
- export LDFLAGS_SL="${LDFLAGS}" |
1150 |
- export LDFLAGS_EX="${LDFLAGS}" |
1151 |
- |
1152 |
- local PO="${EPREFIX%/}" |
1153 |
- |
1154 |
- econf \ |
1155 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1156 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1157 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
1158 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1159 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1160 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1161 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1162 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
1163 |
- $(use_enable threads thread-safety) \ |
1164 |
- $(use_with kerberos gssapi) \ |
1165 |
- $(use_with kerberos krb5) \ |
1166 |
- $(use_with ldap) \ |
1167 |
- $(use_with pam) \ |
1168 |
- $(use_with perl) \ |
1169 |
- $(use_with python) \ |
1170 |
- $(use_with readline) \ |
1171 |
- $(use_with ssl openssl) \ |
1172 |
- $(use_with tcl) \ |
1173 |
- $(use_with uuid ossp-uuid) \ |
1174 |
- $(use_with xml libxml) \ |
1175 |
- $(use_with xml libxslt) \ |
1176 |
- $(use_with zlib) \ |
1177 |
- "$(use_enable nls nls "$(wanted_languages)")" |
1178 |
-} |
1179 |
- |
1180 |
-src_compile() { |
1181 |
- emake |
1182 |
- emake -C contrib |
1183 |
-} |
1184 |
- |
1185 |
-src_install() { |
1186 |
- emake DESTDIR="${D}" install |
1187 |
- emake DESTDIR="${D}" install -C contrib |
1188 |
- |
1189 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1190 |
- |
1191 |
- # man pages are already built, but if we have the target make them, |
1192 |
- # they'll be generated from source before being installed so we |
1193 |
- # manually install man pages. |
1194 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1195 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1196 |
- doins -r doc/src/sgml/man{1,3,7} |
1197 |
- if ! use server; then |
1198 |
- # Remove man pages for non-existent binaries |
1199 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
1200 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1201 |
- done |
1202 |
- fi |
1203 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1204 |
- |
1205 |
- insinto /etc/postgresql-${SLOT} |
1206 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1207 |
- |
1208 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
1209 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
1210 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
1211 |
- |
1212 |
- use static-libs || find "${ED}" -name '*.a' -delete |
1213 |
- |
1214 |
- if use doc ; then |
1215 |
- docinto html |
1216 |
- dodoc doc/src/sgml/html/* |
1217 |
- |
1218 |
- docinto sgml |
1219 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
1220 |
- fi |
1221 |
- |
1222 |
- if use server; then |
1223 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1224 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
1225 |
- |
1226 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1227 |
- "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} |
1228 |
- |
1229 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1230 |
- "${FILESDIR}/${PN}.service" | \ |
1231 |
- systemd_newunit - ${PN}-${SLOT}.service |
1232 |
- |
1233 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1234 |
- |
1235 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1236 |
- |
1237 |
- if use prefix ; then |
1238 |
- keepdir /run/postgresql |
1239 |
- fperms 0775 /run/postgresql |
1240 |
- fi |
1241 |
- fi |
1242 |
-} |
1243 |
- |
1244 |
-pkg_postinst() { |
1245 |
- postgresql-config update |
1246 |
- |
1247 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1248 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
1249 |
- |
1250 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
1251 |
- elog |
1252 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
1253 |
- elog "following command in all active shells to pick up changes to the default" |
1254 |
- elog "environment:" |
1255 |
- elog " source /etc/profile" |
1256 |
- fi |
1257 |
- |
1258 |
- if use server ; then |
1259 |
- elog |
1260 |
- elog "Gentoo specific documentation:" |
1261 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1262 |
- elog |
1263 |
- elog "Official documentation:" |
1264 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
1265 |
- elog |
1266 |
- elog "The default location of the Unix-domain socket is:" |
1267 |
- elog " ${EROOT%/}/run/postgresql/" |
1268 |
- elog |
1269 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1270 |
- elog "so that it contains your preferred locale in:" |
1271 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1272 |
- elog |
1273 |
- elog "Then, execute the following command to setup the initial database" |
1274 |
- elog "environment:" |
1275 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1276 |
- fi |
1277 |
-} |
1278 |
- |
1279 |
-pkg_prerm() { |
1280 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1281 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1282 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1283 |
- |
1284 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1285 |
- sleep 10 |
1286 |
- eend 0 |
1287 |
- fi |
1288 |
-} |
1289 |
- |
1290 |
-pkg_postrm() { |
1291 |
- postgresql-config update |
1292 |
-} |
1293 |
- |
1294 |
-pkg_config() { |
1295 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1296 |
- |
1297 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1298 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1299 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
1300 |
- [[ -z "${DATA_DIR}" ]] \ |
1301 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
1302 |
- |
1303 |
- # environment.bz2 may not contain the same locale as the current system |
1304 |
- # locale. Unset and source from the current system locale. |
1305 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
1306 |
- unset LANG |
1307 |
- unset LC_CTYPE |
1308 |
- unset LC_NUMERIC |
1309 |
- unset LC_TIME |
1310 |
- unset LC_COLLATE |
1311 |
- unset LC_MONETARY |
1312 |
- unset LC_MESSAGES |
1313 |
- unset LC_ALL |
1314 |
- source "${EROOT%/}/etc/env.d/02locale" |
1315 |
- [ -n "${LANG}" ] && export LANG |
1316 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1317 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1318 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1319 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1320 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1321 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1322 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1323 |
- fi |
1324 |
- |
1325 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1326 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1327 |
- einfo |
1328 |
- einfo "Information on options that can be passed to initdb are found at:" |
1329 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1330 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1331 |
- einfo |
1332 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1333 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1334 |
- einfo " (none)" |
1335 |
- else |
1336 |
- einfo " ${PG_INITDB_OPTS}" |
1337 |
- fi |
1338 |
- einfo |
1339 |
- einfo "Configuration files will be installed to:" |
1340 |
- einfo " ${PGDATA}" |
1341 |
- einfo |
1342 |
- einfo "The database cluster will be created in:" |
1343 |
- einfo " ${DATA_DIR}" |
1344 |
- einfo |
1345 |
- while [ "$correct" != "true" ] ; do |
1346 |
- einfo "Are you ready to continue? (y/n)" |
1347 |
- read answer |
1348 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
1349 |
- correct="true" |
1350 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
1351 |
- die "Aborting initialization." |
1352 |
- else |
1353 |
- echo "Answer not recognized" |
1354 |
- fi |
1355 |
- done |
1356 |
- |
1357 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1358 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1359 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1360 |
- die "${DATA_DIR} is not empty." |
1361 |
- fi |
1362 |
- |
1363 |
- einfo "Creating the data directory ..." |
1364 |
- if [[ ${EUID} == 0 ]] ; then |
1365 |
- mkdir -p "${DATA_DIR}" |
1366 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1367 |
- chmod 0700 "${DATA_DIR}" |
1368 |
- fi |
1369 |
- |
1370 |
- einfo "Initializing the database ..." |
1371 |
- |
1372 |
- if [[ ${EUID} == 0 ]] ; then |
1373 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1374 |
- else |
1375 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1376 |
- fi |
1377 |
- |
1378 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1379 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1380 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1381 |
- fi |
1382 |
- |
1383 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1384 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1385 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1386 |
- # characters in PL/Perl |
1387 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1388 |
- EOF |
1389 |
- |
1390 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1391 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1392 |
- einfo "by default. You can disable it in the cluster's:" |
1393 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1394 |
- einfo |
1395 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1396 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1397 |
- einfo |
1398 |
- if use prefix ; then |
1399 |
- einfo "The location of the configuration files have moved to:" |
1400 |
- einfo " ${PGDATA}" |
1401 |
- einfo "To start the server:" |
1402 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1403 |
- einfo "To stop:" |
1404 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1405 |
- einfo |
1406 |
- einfo "Or move the configuration files back:" |
1407 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1408 |
- else |
1409 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1410 |
- einfo "instead of 'pg_ctl'." |
1411 |
- fi |
1412 |
-} |
1413 |
- |
1414 |
-src_test() { |
1415 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
1416 |
- emake check |
1417 |
- |
1418 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
1419 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
1420 |
- else |
1421 |
- use server || \ |
1422 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
1423 |
- [[ ${UID} -eq 0 ]] || \ |
1424 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
1425 |
- |
1426 |
- ewarn 'Skipping.' |
1427 |
- fi |
1428 |
-} |
1429 |
|
1430 |
diff --git a/dev-db/postgresql/postgresql-9.2.22.ebuild b/dev-db/postgresql/postgresql-9.2.22.ebuild |
1431 |
deleted file mode 100644 |
1432 |
index f68ece459c1..00000000000 |
1433 |
--- a/dev-db/postgresql/postgresql-9.2.22.ebuild |
1434 |
+++ /dev/null |
1435 |
@@ -1,441 +0,0 @@ |
1436 |
-# Copyright 1999-2018 Gentoo Foundation |
1437 |
-# Distributed under the terms of the GNU General Public License v2 |
1438 |
- |
1439 |
-EAPI="6" |
1440 |
- |
1441 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
1442 |
- |
1443 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
1444 |
- systemd user versionator |
1445 |
- |
1446 |
-KEYWORDS="alpha amd64 arm ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
1447 |
- |
1448 |
-SLOT="$(get_version_component_range 1-2)" |
1449 |
- |
1450 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
1451 |
- |
1452 |
-LICENSE="POSTGRESQL GPL-2" |
1453 |
-DESCRIPTION="PostgreSQL RDBMS" |
1454 |
-HOMEPAGE="http://www.postgresql.org/" |
1455 |
- |
1456 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
1457 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
1458 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1459 |
- |
1460 |
-wanted_languages() { |
1461 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
1462 |
- sk sl sv tr zh_CN zh_TW" |
1463 |
- local enable_langs lingua |
1464 |
- |
1465 |
- for lingua in ${linguas} ; do |
1466 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
1467 |
- done |
1468 |
- |
1469 |
- echo -n ${enable_langs} |
1470 |
-} |
1471 |
- |
1472 |
-CDEPEND=" |
1473 |
->=app-eselect/eselect-postgresql-2.0 |
1474 |
-sys-apps/less |
1475 |
-virtual/libintl |
1476 |
-kerberos? ( virtual/krb5 ) |
1477 |
-ldap? ( net-nds/openldap ) |
1478 |
-pam? ( virtual/pam ) |
1479 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1480 |
-python? ( ${PYTHON_DEPS} ) |
1481 |
-readline? ( sys-libs/readline:0= ) |
1482 |
-ssl? ( |
1483 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1484 |
- libressl? ( dev-libs/libressl:= ) |
1485 |
-) |
1486 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1487 |
-uuid? ( dev-libs/ossp-uuid ) |
1488 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1489 |
-zlib? ( sys-libs/zlib ) |
1490 |
-" |
1491 |
- |
1492 |
-DEPEND="${CDEPEND} |
1493 |
-!!<sys-apps/sandbox-2.0 |
1494 |
-sys-devel/bison |
1495 |
-sys-devel/flex |
1496 |
-nls? ( sys-devel/gettext ) |
1497 |
-xml? ( virtual/pkgconfig ) |
1498 |
-" |
1499 |
- |
1500 |
-RDEPEND="${CDEPEND} |
1501 |
-!dev-db/postgresql-docs:${SLOT} |
1502 |
-!dev-db/postgresql-base:${SLOT} |
1503 |
-!dev-db/postgresql-server:${SLOT} |
1504 |
-selinux? ( sec-policy/selinux-postgresql ) |
1505 |
-" |
1506 |
- |
1507 |
-pkg_setup() { |
1508 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1509 |
- |
1510 |
- enewgroup postgres 70 |
1511 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
1512 |
- |
1513 |
- use python && python-single-r1_pkg_setup |
1514 |
-} |
1515 |
- |
1516 |
-src_prepare() { |
1517 |
- # Work around PPC{,64} compilation bug where bool is already defined |
1518 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
1519 |
- |
1520 |
- # Set proper run directory |
1521 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1522 |
- -i src/include/pg_config_manual.h || die |
1523 |
- |
1524 |
- use server || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
1525 |
- |
1526 |
- if use pam ; then |
1527 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1528 |
- -i src/backend/libpq/auth.c || \ |
1529 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1530 |
- fi |
1531 |
- |
1532 |
- eapply_user |
1533 |
-} |
1534 |
- |
1535 |
-src_configure() { |
1536 |
- case ${CHOST} in |
1537 |
- *-darwin*|*-solaris*) |
1538 |
- use nls && append-libs intl |
1539 |
- ;; |
1540 |
- esac |
1541 |
- |
1542 |
- export LDFLAGS_SL="${LDFLAGS}" |
1543 |
- export LDFLAGS_EX="${LDFLAGS}" |
1544 |
- |
1545 |
- local PO="${EPREFIX%/}" |
1546 |
- |
1547 |
- econf \ |
1548 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1549 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1550 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
1551 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1552 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1553 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1554 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1555 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
1556 |
- $(use_enable threads thread-safety) \ |
1557 |
- $(use_with kerberos gssapi) \ |
1558 |
- $(use_with kerberos krb5) \ |
1559 |
- $(use_with ldap) \ |
1560 |
- $(use_with pam) \ |
1561 |
- $(use_with perl) \ |
1562 |
- $(use_with python) \ |
1563 |
- $(use_with readline) \ |
1564 |
- $(use_with ssl openssl) \ |
1565 |
- $(use_with tcl) \ |
1566 |
- $(use_with uuid ossp-uuid) \ |
1567 |
- $(use_with xml libxml) \ |
1568 |
- $(use_with xml libxslt) \ |
1569 |
- $(use_with zlib) \ |
1570 |
- "$(use_enable nls nls "$(wanted_languages)")" |
1571 |
-} |
1572 |
- |
1573 |
-src_compile() { |
1574 |
- emake |
1575 |
- emake -C contrib |
1576 |
-} |
1577 |
- |
1578 |
-src_install() { |
1579 |
- emake DESTDIR="${D}" install |
1580 |
- emake DESTDIR="${D}" install -C contrib |
1581 |
- |
1582 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1583 |
- |
1584 |
- # man pages are already built, but if we have the target make them, |
1585 |
- # they'll be generated from source before being installed so we |
1586 |
- # manually install man pages. |
1587 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1588 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1589 |
- doins -r doc/src/sgml/man{1,3,7} |
1590 |
- if ! use server; then |
1591 |
- # Remove man pages for non-existent binaries |
1592 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
1593 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1594 |
- done |
1595 |
- fi |
1596 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1597 |
- |
1598 |
- # Create slot specific man pages |
1599 |
- local bn f mansec slotted_name |
1600 |
- for mansec in 1 3 7 ; do |
1601 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
1602 |
- |
1603 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
1604 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
1605 |
- |
1606 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
1607 |
- bn=$(basename "${f}") |
1608 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
1609 |
- case ${bn} in |
1610 |
- TABLE.7|WITH.7) |
1611 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
1612 |
- ;; |
1613 |
- *) |
1614 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
1615 |
- ;; |
1616 |
- esac |
1617 |
- done |
1618 |
- |
1619 |
- popd > /dev/null |
1620 |
- done |
1621 |
- |
1622 |
- insinto /etc/postgresql-${SLOT} |
1623 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1624 |
- |
1625 |
- use static-libs || find "${ED}" -name '*.a' -delete |
1626 |
- |
1627 |
- local f bn |
1628 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
1629 |
- -mindepth 1 -maxdepth 1) |
1630 |
- do |
1631 |
- bn=$(basename "${f}") |
1632 |
- # Temporarily tack on tmp to workaround a file collision |
1633 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
1634 |
- # had this issue. |
1635 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
1636 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
1637 |
- done |
1638 |
- |
1639 |
- if use doc ; then |
1640 |
- docinto html |
1641 |
- dodoc doc/src/sgml/html/* |
1642 |
- |
1643 |
- docinto sgml |
1644 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
1645 |
- fi |
1646 |
- |
1647 |
- if use server; then |
1648 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1649 |
- "${FILESDIR}/${PN}.confd-9.2" | newconfd - ${PN}-${SLOT} |
1650 |
- |
1651 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1652 |
- "${FILESDIR}/${PN}.init-9.2" | newinitd - ${PN}-${SLOT} |
1653 |
- |
1654 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1655 |
- "${FILESDIR}/${PN}.service" | \ |
1656 |
- systemd_newunit - ${PN}-${SLOT}.service |
1657 |
- |
1658 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1659 |
- |
1660 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1661 |
- |
1662 |
- if use prefix ; then |
1663 |
- keepdir /run/postgresql |
1664 |
- fperms 0775 /run/postgresql |
1665 |
- fi |
1666 |
- fi |
1667 |
-} |
1668 |
- |
1669 |
-pkg_preinst() { |
1670 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
1671 |
- # /usr/bin/psql96). They may have been created by the |
1672 |
- # postgresql.eselect module, but they're handled within this ebuild |
1673 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
1674 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
1675 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
1676 |
- # handled in this manner. |
1677 |
- local canonicalise |
1678 |
- if type -p realpath > /dev/null; then |
1679 |
- canonicalise=realpath |
1680 |
- elif type -p readlink > /dev/null; then |
1681 |
- canonicalise='readlink -f' |
1682 |
- else |
1683 |
- # can't die, subshell |
1684 |
- die "No readlink nor realpath found, cannot canonicalise" |
1685 |
- fi |
1686 |
- |
1687 |
- local l |
1688 |
- # First remove any symlinks in /usr/bin that may have been created |
1689 |
- # by the old eselect |
1690 |
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
1691 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
1692 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
1693 |
- fi |
1694 |
- done |
1695 |
- |
1696 |
- # Then move the symlinks created by the ebuild to their proper place. |
1697 |
- for l in "${ED}"/usr/bin/*tmp ; do |
1698 |
- mv "${l}" "${l%tmp}" \ |
1699 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
1700 |
- done |
1701 |
-} |
1702 |
- |
1703 |
-pkg_postinst() { |
1704 |
- postgresql-config update |
1705 |
- |
1706 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1707 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
1708 |
- |
1709 |
- if use server ; then |
1710 |
- elog |
1711 |
- elog "Gentoo specific documentation:" |
1712 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1713 |
- elog |
1714 |
- elog "Official documentation:" |
1715 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
1716 |
- elog |
1717 |
- elog "The default location of the Unix-domain socket is:" |
1718 |
- elog " ${EROOT%/}/run/postgresql/" |
1719 |
- elog |
1720 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1721 |
- elog "so that it contains your preferred locale in:" |
1722 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1723 |
- elog |
1724 |
- elog "Then, execute the following command to setup the initial database" |
1725 |
- elog "environment:" |
1726 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1727 |
- fi |
1728 |
-} |
1729 |
- |
1730 |
-pkg_prerm() { |
1731 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1732 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1733 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1734 |
- |
1735 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1736 |
- sleep 10 |
1737 |
- eend 0 |
1738 |
- fi |
1739 |
-} |
1740 |
- |
1741 |
-pkg_postrm() { |
1742 |
- postgresql-config update |
1743 |
-} |
1744 |
- |
1745 |
-pkg_config() { |
1746 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1747 |
- |
1748 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1749 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1750 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
1751 |
- [[ -z "${DATA_DIR}" ]] \ |
1752 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
1753 |
- |
1754 |
- # environment.bz2 may not contain the same locale as the current system |
1755 |
- # locale. Unset and source from the current system locale. |
1756 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
1757 |
- unset LANG |
1758 |
- unset LC_CTYPE |
1759 |
- unset LC_NUMERIC |
1760 |
- unset LC_TIME |
1761 |
- unset LC_COLLATE |
1762 |
- unset LC_MONETARY |
1763 |
- unset LC_MESSAGES |
1764 |
- unset LC_ALL |
1765 |
- source "${EROOT%/}/etc/env.d/02locale" |
1766 |
- [ -n "${LANG}" ] && export LANG |
1767 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1768 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1769 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1770 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1771 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1772 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1773 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1774 |
- fi |
1775 |
- |
1776 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1777 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1778 |
- einfo |
1779 |
- einfo "Information on options that can be passed to initdb are found at:" |
1780 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1781 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1782 |
- einfo |
1783 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1784 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1785 |
- einfo " (none)" |
1786 |
- else |
1787 |
- einfo " ${PG_INITDB_OPTS}" |
1788 |
- fi |
1789 |
- einfo |
1790 |
- einfo "Configuration files will be installed to:" |
1791 |
- einfo " ${PGDATA}" |
1792 |
- einfo |
1793 |
- einfo "The database cluster will be created in:" |
1794 |
- einfo " ${DATA_DIR}" |
1795 |
- einfo |
1796 |
- |
1797 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
1798 |
- sleep 5 |
1799 |
- eend 0 |
1800 |
- |
1801 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1802 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1803 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1804 |
- die "${DATA_DIR} is not empty." |
1805 |
- fi |
1806 |
- |
1807 |
- einfo "Creating the data directory ..." |
1808 |
- if [[ ${EUID} == 0 ]] ; then |
1809 |
- mkdir -p "${DATA_DIR}" |
1810 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1811 |
- chmod 0700 "${DATA_DIR}" |
1812 |
- fi |
1813 |
- |
1814 |
- einfo "Initializing the database ..." |
1815 |
- |
1816 |
- if [[ ${EUID} == 0 ]] ; then |
1817 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1818 |
- else |
1819 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1820 |
- fi |
1821 |
- |
1822 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1823 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1824 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1825 |
- fi |
1826 |
- |
1827 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
1828 |
- # overridden in the initscript |
1829 |
- sed '/^#unix_socket_directory/d' -i "${PGDATA%/}"/postgresql.conf |
1830 |
- |
1831 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1832 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1833 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1834 |
- # characters in PL/Perl |
1835 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1836 |
- EOF |
1837 |
- |
1838 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1839 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1840 |
- einfo "by default. You can disable it in the cluster's:" |
1841 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1842 |
- einfo |
1843 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1844 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1845 |
- einfo |
1846 |
- if use prefix ; then |
1847 |
- einfo "The location of the configuration files have moved to:" |
1848 |
- einfo " ${PGDATA}" |
1849 |
- einfo "To start the server:" |
1850 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1851 |
- einfo "To stop:" |
1852 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1853 |
- einfo |
1854 |
- einfo "Or move the configuration files back:" |
1855 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1856 |
- else |
1857 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1858 |
- einfo "instead of 'pg_ctl'." |
1859 |
- fi |
1860 |
-} |
1861 |
- |
1862 |
-src_test() { |
1863 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
1864 |
- emake check |
1865 |
- |
1866 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
1867 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
1868 |
- else |
1869 |
- use server || \ |
1870 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
1871 |
- [[ ${UID} -eq 0 ]] || \ |
1872 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
1873 |
- |
1874 |
- ewarn 'Skipping.' |
1875 |
- fi |
1876 |
-} |
1877 |
|
1878 |
diff --git a/dev-db/postgresql/postgresql-9.2.23-r1.ebuild b/dev-db/postgresql/postgresql-9.2.23-r1.ebuild |
1879 |
deleted file mode 100644 |
1880 |
index 9eae7d8feef..00000000000 |
1881 |
--- a/dev-db/postgresql/postgresql-9.2.23-r1.ebuild |
1882 |
+++ /dev/null |
1883 |
@@ -1,445 +0,0 @@ |
1884 |
-# Copyright 1999-2018 Gentoo Foundation |
1885 |
-# Distributed under the terms of the GNU General Public License v2 |
1886 |
- |
1887 |
-EAPI="6" |
1888 |
- |
1889 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
1890 |
- |
1891 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
1892 |
- systemd user versionator |
1893 |
- |
1894 |
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
1895 |
- |
1896 |
-SLOT="$(get_version_component_range 1-2)" |
1897 |
- |
1898 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
1899 |
- |
1900 |
-LICENSE="POSTGRESQL GPL-2" |
1901 |
-DESCRIPTION="PostgreSQL RDBMS" |
1902 |
-HOMEPAGE="http://www.postgresql.org/" |
1903 |
- |
1904 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
1905 |
- +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib" |
1906 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1907 |
- |
1908 |
-wanted_languages() { |
1909 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
1910 |
- sk sl sv tr zh_CN zh_TW" |
1911 |
- local enable_langs lingua |
1912 |
- |
1913 |
- for lingua in ${linguas} ; do |
1914 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
1915 |
- done |
1916 |
- |
1917 |
- echo -n ${enable_langs} |
1918 |
-} |
1919 |
- |
1920 |
-CDEPEND=" |
1921 |
->=app-eselect/eselect-postgresql-2.0 |
1922 |
-sys-apps/less |
1923 |
-virtual/libintl |
1924 |
-kerberos? ( virtual/krb5 ) |
1925 |
-ldap? ( net-nds/openldap ) |
1926 |
-pam? ( virtual/pam ) |
1927 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1928 |
-python? ( ${PYTHON_DEPS} ) |
1929 |
-readline? ( sys-libs/readline:0= ) |
1930 |
-ssl? ( |
1931 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1932 |
- libressl? ( dev-libs/libressl:= ) |
1933 |
-) |
1934 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1935 |
-uuid? ( dev-libs/ossp-uuid ) |
1936 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1937 |
-zlib? ( sys-libs/zlib ) |
1938 |
-" |
1939 |
- |
1940 |
-DEPEND="${CDEPEND} |
1941 |
-!!<sys-apps/sandbox-2.0 |
1942 |
-sys-devel/bison |
1943 |
-sys-devel/flex |
1944 |
-nls? ( sys-devel/gettext ) |
1945 |
-xml? ( virtual/pkgconfig ) |
1946 |
-" |
1947 |
- |
1948 |
-RDEPEND="${CDEPEND} |
1949 |
-!dev-db/postgresql-docs:${SLOT} |
1950 |
-!dev-db/postgresql-base:${SLOT} |
1951 |
-!dev-db/postgresql-server:${SLOT} |
1952 |
-selinux? ( sec-policy/selinux-postgresql ) |
1953 |
-" |
1954 |
- |
1955 |
-pkg_setup() { |
1956 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1957 |
- |
1958 |
- enewgroup postgres 70 |
1959 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
1960 |
- |
1961 |
- use python && python-single-r1_pkg_setup |
1962 |
-} |
1963 |
- |
1964 |
-src_prepare() { |
1965 |
- # Work around PPC{,64} compilation bug where bool is already defined |
1966 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
1967 |
- |
1968 |
- # Set proper run directory |
1969 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1970 |
- -i src/include/pg_config_manual.h || die |
1971 |
- |
1972 |
- use server || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
1973 |
- |
1974 |
- if use pam ; then |
1975 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1976 |
- -i src/backend/libpq/auth.c || \ |
1977 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1978 |
- fi |
1979 |
- |
1980 |
- eapply_user |
1981 |
-} |
1982 |
- |
1983 |
-src_configure() { |
1984 |
- case ${CHOST} in |
1985 |
- *-darwin*|*-solaris*) |
1986 |
- use nls && append-libs intl |
1987 |
- ;; |
1988 |
- esac |
1989 |
- |
1990 |
- export LDFLAGS_SL="${LDFLAGS}" |
1991 |
- export LDFLAGS_EX="${LDFLAGS}" |
1992 |
- |
1993 |
- local PO="${EPREFIX%/}" |
1994 |
- |
1995 |
- econf \ |
1996 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1997 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1998 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
1999 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2000 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2001 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2002 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2003 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
2004 |
- $(use_enable threads thread-safety) \ |
2005 |
- $(use_with kerberos gssapi) \ |
2006 |
- $(use_with kerberos krb5) \ |
2007 |
- $(use_with ldap) \ |
2008 |
- $(use_with pam) \ |
2009 |
- $(use_with perl) \ |
2010 |
- $(use_with python) \ |
2011 |
- $(use_with readline) \ |
2012 |
- $(use_with ssl openssl) \ |
2013 |
- $(use_with tcl) \ |
2014 |
- $(use_with uuid ossp-uuid) \ |
2015 |
- $(use_with xml libxml) \ |
2016 |
- $(use_with xml libxslt) \ |
2017 |
- $(use_with zlib) \ |
2018 |
- "$(use_enable nls nls "$(wanted_languages)")" |
2019 |
-} |
2020 |
- |
2021 |
-src_compile() { |
2022 |
- emake |
2023 |
- emake -C contrib |
2024 |
-} |
2025 |
- |
2026 |
-src_install() { |
2027 |
- emake DESTDIR="${D}" install |
2028 |
- emake DESTDIR="${D}" install -C contrib |
2029 |
- |
2030 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2031 |
- |
2032 |
- # man pages are already built, but if we have the target make them, |
2033 |
- # they'll be generated from source before being installed so we |
2034 |
- # manually install man pages. |
2035 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2036 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2037 |
- doins -r doc/src/sgml/man{1,3,7} |
2038 |
- if ! use server; then |
2039 |
- # Remove man pages for non-existent binaries |
2040 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
2041 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2042 |
- done |
2043 |
- fi |
2044 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2045 |
- |
2046 |
- # Create slot specific man pages |
2047 |
- local bn f mansec slotted_name |
2048 |
- for mansec in 1 3 7 ; do |
2049 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
2050 |
- |
2051 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
2052 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
2053 |
- |
2054 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
2055 |
- bn=$(basename "${f}") |
2056 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
2057 |
- case ${bn} in |
2058 |
- TABLE.7|WITH.7) |
2059 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
2060 |
- ;; |
2061 |
- *) |
2062 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
2063 |
- ;; |
2064 |
- esac |
2065 |
- done |
2066 |
- |
2067 |
- popd > /dev/null |
2068 |
- done |
2069 |
- |
2070 |
- insinto /etc/postgresql-${SLOT} |
2071 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2072 |
- |
2073 |
- use static-libs || find "${ED}" -name '*.a' -delete |
2074 |
- |
2075 |
- local f bn |
2076 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
2077 |
- -mindepth 1 -maxdepth 1) |
2078 |
- do |
2079 |
- bn=$(basename "${f}") |
2080 |
- # Temporarily tack on tmp to workaround a file collision |
2081 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
2082 |
- # had this issue. |
2083 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
2084 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
2085 |
- done |
2086 |
- |
2087 |
- if use doc ; then |
2088 |
- docinto html |
2089 |
- dodoc doc/src/sgml/html/* |
2090 |
- |
2091 |
- docinto sgml |
2092 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
2093 |
- fi |
2094 |
- |
2095 |
- if use server; then |
2096 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2097 |
- "${FILESDIR}/${PN}.confd-9.2" | newconfd - ${PN}-${SLOT} |
2098 |
- |
2099 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2100 |
- "${FILESDIR}/${PN}.init-9.2" | newinitd - ${PN}-${SLOT} |
2101 |
- |
2102 |
- if use systemd; then |
2103 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2104 |
- "${FILESDIR}/${PN}.service-9.2" | \ |
2105 |
- systemd_newunit - ${PN}-${SLOT}.service |
2106 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
2107 |
- fi |
2108 |
- |
2109 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2110 |
- |
2111 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2112 |
- |
2113 |
- if use prefix ; then |
2114 |
- keepdir /run/postgresql |
2115 |
- fperms 1775 /run/postgresql |
2116 |
- fi |
2117 |
- fi |
2118 |
-} |
2119 |
- |
2120 |
-pkg_preinst() { |
2121 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
2122 |
- # /usr/bin/psql96). They may have been created by the |
2123 |
- # postgresql.eselect module, but they're handled within this ebuild |
2124 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
2125 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
2126 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
2127 |
- # handled in this manner. |
2128 |
- local canonicalise |
2129 |
- if type -p realpath > /dev/null; then |
2130 |
- canonicalise=realpath |
2131 |
- elif type -p readlink > /dev/null; then |
2132 |
- canonicalise='readlink -f' |
2133 |
- else |
2134 |
- # can't die, subshell |
2135 |
- die "No readlink nor realpath found, cannot canonicalise" |
2136 |
- fi |
2137 |
- |
2138 |
- local l |
2139 |
- # First remove any symlinks in /usr/bin that may have been created |
2140 |
- # by the old eselect |
2141 |
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
2142 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
2143 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
2144 |
- fi |
2145 |
- done |
2146 |
- |
2147 |
- # Then move the symlinks created by the ebuild to their proper place. |
2148 |
- for l in "${ED}"/usr/bin/*tmp ; do |
2149 |
- mv "${l}" "${l%tmp}" \ |
2150 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
2151 |
- done |
2152 |
-} |
2153 |
- |
2154 |
-pkg_postinst() { |
2155 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
2156 |
- postgresql-config update |
2157 |
- |
2158 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2159 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
2160 |
- |
2161 |
- if use server ; then |
2162 |
- elog |
2163 |
- elog "Gentoo specific documentation:" |
2164 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2165 |
- elog |
2166 |
- elog "Official documentation:" |
2167 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
2168 |
- elog |
2169 |
- elog "The default location of the Unix-domain socket is:" |
2170 |
- elog " ${EROOT%/}/run/postgresql/" |
2171 |
- elog |
2172 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2173 |
- elog "so that it contains your preferred locale in:" |
2174 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2175 |
- elog |
2176 |
- elog "Then, execute the following command to setup the initial database" |
2177 |
- elog "environment:" |
2178 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2179 |
- fi |
2180 |
-} |
2181 |
- |
2182 |
-pkg_prerm() { |
2183 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2184 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2185 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2186 |
- |
2187 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2188 |
- sleep 10 |
2189 |
- eend 0 |
2190 |
- fi |
2191 |
-} |
2192 |
- |
2193 |
-pkg_postrm() { |
2194 |
- postgresql-config update |
2195 |
-} |
2196 |
- |
2197 |
-pkg_config() { |
2198 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2199 |
- |
2200 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2201 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2202 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
2203 |
- [[ -z "${DATA_DIR}" ]] \ |
2204 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
2205 |
- |
2206 |
- # environment.bz2 may not contain the same locale as the current system |
2207 |
- # locale. Unset and source from the current system locale. |
2208 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
2209 |
- unset LANG |
2210 |
- unset LC_CTYPE |
2211 |
- unset LC_NUMERIC |
2212 |
- unset LC_TIME |
2213 |
- unset LC_COLLATE |
2214 |
- unset LC_MONETARY |
2215 |
- unset LC_MESSAGES |
2216 |
- unset LC_ALL |
2217 |
- source "${EROOT%/}/etc/env.d/02locale" |
2218 |
- [ -n "${LANG}" ] && export LANG |
2219 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2220 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2221 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2222 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2223 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2224 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2225 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2226 |
- fi |
2227 |
- |
2228 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2229 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2230 |
- einfo |
2231 |
- einfo "Information on options that can be passed to initdb are found at:" |
2232 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2233 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2234 |
- einfo |
2235 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2236 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2237 |
- einfo " (none)" |
2238 |
- else |
2239 |
- einfo " ${PG_INITDB_OPTS}" |
2240 |
- fi |
2241 |
- einfo |
2242 |
- einfo "Configuration files will be installed to:" |
2243 |
- einfo " ${PGDATA}" |
2244 |
- einfo |
2245 |
- einfo "The database cluster will be created in:" |
2246 |
- einfo " ${DATA_DIR}" |
2247 |
- einfo |
2248 |
- |
2249 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
2250 |
- sleep 5 |
2251 |
- eend 0 |
2252 |
- |
2253 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2254 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2255 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2256 |
- die "${DATA_DIR} is not empty." |
2257 |
- fi |
2258 |
- |
2259 |
- einfo "Creating the data directory ..." |
2260 |
- if [[ ${EUID} == 0 ]] ; then |
2261 |
- mkdir -p "${DATA_DIR}" |
2262 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
2263 |
- chmod 0700 "${DATA_DIR}" |
2264 |
- fi |
2265 |
- |
2266 |
- einfo "Initializing the database ..." |
2267 |
- |
2268 |
- if [[ ${EUID} == 0 ]] ; then |
2269 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2270 |
- else |
2271 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2272 |
- fi |
2273 |
- |
2274 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2275 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2276 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2277 |
- fi |
2278 |
- |
2279 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
2280 |
- # overridden in the initscript |
2281 |
- sed '/^#unix_socket_directory/d' -i "${PGDATA%/}"/postgresql.conf |
2282 |
- |
2283 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2284 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2285 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2286 |
- # characters in PL/Perl |
2287 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2288 |
- EOF |
2289 |
- |
2290 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2291 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2292 |
- einfo "by default. You can disable it in the cluster's:" |
2293 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2294 |
- einfo |
2295 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2296 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2297 |
- einfo |
2298 |
- if use prefix ; then |
2299 |
- einfo "The location of the configuration files have moved to:" |
2300 |
- einfo " ${PGDATA}" |
2301 |
- einfo "To start the server:" |
2302 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2303 |
- einfo "To stop:" |
2304 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2305 |
- einfo |
2306 |
- einfo "Or move the configuration files back:" |
2307 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2308 |
- else |
2309 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2310 |
- einfo "instead of 'pg_ctl'." |
2311 |
- fi |
2312 |
-} |
2313 |
- |
2314 |
-src_test() { |
2315 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2316 |
- emake check |
2317 |
- |
2318 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2319 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2320 |
- else |
2321 |
- use server || \ |
2322 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2323 |
- [[ ${UID} -eq 0 ]] || \ |
2324 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2325 |
- |
2326 |
- ewarn 'Skipping.' |
2327 |
- fi |
2328 |
-} |
2329 |
|
2330 |
diff --git a/dev-db/postgresql/postgresql-9.2.23.ebuild b/dev-db/postgresql/postgresql-9.2.23.ebuild |
2331 |
deleted file mode 100644 |
2332 |
index bc6bfbfbf3d..00000000000 |
2333 |
--- a/dev-db/postgresql/postgresql-9.2.23.ebuild |
2334 |
+++ /dev/null |
2335 |
@@ -1,441 +0,0 @@ |
2336 |
-# Copyright 1999-2018 Gentoo Foundation |
2337 |
-# Distributed under the terms of the GNU General Public License v2 |
2338 |
- |
2339 |
-EAPI="6" |
2340 |
- |
2341 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
2342 |
- |
2343 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
2344 |
- systemd user versionator |
2345 |
- |
2346 |
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
2347 |
- |
2348 |
-SLOT="$(get_version_component_range 1-2)" |
2349 |
- |
2350 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
2351 |
- |
2352 |
-LICENSE="POSTGRESQL GPL-2" |
2353 |
-DESCRIPTION="PostgreSQL RDBMS" |
2354 |
-HOMEPAGE="http://www.postgresql.org/" |
2355 |
- |
2356 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
2357 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
2358 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
2359 |
- |
2360 |
-wanted_languages() { |
2361 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
2362 |
- sk sl sv tr zh_CN zh_TW" |
2363 |
- local enable_langs lingua |
2364 |
- |
2365 |
- for lingua in ${linguas} ; do |
2366 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
2367 |
- done |
2368 |
- |
2369 |
- echo -n ${enable_langs} |
2370 |
-} |
2371 |
- |
2372 |
-CDEPEND=" |
2373 |
->=app-eselect/eselect-postgresql-2.0 |
2374 |
-sys-apps/less |
2375 |
-virtual/libintl |
2376 |
-kerberos? ( virtual/krb5 ) |
2377 |
-ldap? ( net-nds/openldap ) |
2378 |
-pam? ( virtual/pam ) |
2379 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2380 |
-python? ( ${PYTHON_DEPS} ) |
2381 |
-readline? ( sys-libs/readline:0= ) |
2382 |
-ssl? ( |
2383 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2384 |
- libressl? ( dev-libs/libressl:= ) |
2385 |
-) |
2386 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2387 |
-uuid? ( dev-libs/ossp-uuid ) |
2388 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2389 |
-zlib? ( sys-libs/zlib ) |
2390 |
-" |
2391 |
- |
2392 |
-DEPEND="${CDEPEND} |
2393 |
-!!<sys-apps/sandbox-2.0 |
2394 |
-sys-devel/bison |
2395 |
-sys-devel/flex |
2396 |
-nls? ( sys-devel/gettext ) |
2397 |
-xml? ( virtual/pkgconfig ) |
2398 |
-" |
2399 |
- |
2400 |
-RDEPEND="${CDEPEND} |
2401 |
-!dev-db/postgresql-docs:${SLOT} |
2402 |
-!dev-db/postgresql-base:${SLOT} |
2403 |
-!dev-db/postgresql-server:${SLOT} |
2404 |
-selinux? ( sec-policy/selinux-postgresql ) |
2405 |
-" |
2406 |
- |
2407 |
-pkg_setup() { |
2408 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2409 |
- |
2410 |
- enewgroup postgres 70 |
2411 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
2412 |
- |
2413 |
- use python && python-single-r1_pkg_setup |
2414 |
-} |
2415 |
- |
2416 |
-src_prepare() { |
2417 |
- # Work around PPC{,64} compilation bug where bool is already defined |
2418 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
2419 |
- |
2420 |
- # Set proper run directory |
2421 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2422 |
- -i src/include/pg_config_manual.h || die |
2423 |
- |
2424 |
- use server || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
2425 |
- |
2426 |
- if use pam ; then |
2427 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2428 |
- -i src/backend/libpq/auth.c || \ |
2429 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2430 |
- fi |
2431 |
- |
2432 |
- eapply_user |
2433 |
-} |
2434 |
- |
2435 |
-src_configure() { |
2436 |
- case ${CHOST} in |
2437 |
- *-darwin*|*-solaris*) |
2438 |
- use nls && append-libs intl |
2439 |
- ;; |
2440 |
- esac |
2441 |
- |
2442 |
- export LDFLAGS_SL="${LDFLAGS}" |
2443 |
- export LDFLAGS_EX="${LDFLAGS}" |
2444 |
- |
2445 |
- local PO="${EPREFIX%/}" |
2446 |
- |
2447 |
- econf \ |
2448 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2449 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2450 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
2451 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2452 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2453 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2454 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2455 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
2456 |
- $(use_enable threads thread-safety) \ |
2457 |
- $(use_with kerberos gssapi) \ |
2458 |
- $(use_with kerberos krb5) \ |
2459 |
- $(use_with ldap) \ |
2460 |
- $(use_with pam) \ |
2461 |
- $(use_with perl) \ |
2462 |
- $(use_with python) \ |
2463 |
- $(use_with readline) \ |
2464 |
- $(use_with ssl openssl) \ |
2465 |
- $(use_with tcl) \ |
2466 |
- $(use_with uuid ossp-uuid) \ |
2467 |
- $(use_with xml libxml) \ |
2468 |
- $(use_with xml libxslt) \ |
2469 |
- $(use_with zlib) \ |
2470 |
- "$(use_enable nls nls "$(wanted_languages)")" |
2471 |
-} |
2472 |
- |
2473 |
-src_compile() { |
2474 |
- emake |
2475 |
- emake -C contrib |
2476 |
-} |
2477 |
- |
2478 |
-src_install() { |
2479 |
- emake DESTDIR="${D}" install |
2480 |
- emake DESTDIR="${D}" install -C contrib |
2481 |
- |
2482 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2483 |
- |
2484 |
- # man pages are already built, but if we have the target make them, |
2485 |
- # they'll be generated from source before being installed so we |
2486 |
- # manually install man pages. |
2487 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2488 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2489 |
- doins -r doc/src/sgml/man{1,3,7} |
2490 |
- if ! use server; then |
2491 |
- # Remove man pages for non-existent binaries |
2492 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
2493 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2494 |
- done |
2495 |
- fi |
2496 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2497 |
- |
2498 |
- # Create slot specific man pages |
2499 |
- local bn f mansec slotted_name |
2500 |
- for mansec in 1 3 7 ; do |
2501 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
2502 |
- |
2503 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
2504 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
2505 |
- |
2506 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
2507 |
- bn=$(basename "${f}") |
2508 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
2509 |
- case ${bn} in |
2510 |
- TABLE.7|WITH.7) |
2511 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
2512 |
- ;; |
2513 |
- *) |
2514 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
2515 |
- ;; |
2516 |
- esac |
2517 |
- done |
2518 |
- |
2519 |
- popd > /dev/null |
2520 |
- done |
2521 |
- |
2522 |
- insinto /etc/postgresql-${SLOT} |
2523 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2524 |
- |
2525 |
- use static-libs || find "${ED}" -name '*.a' -delete |
2526 |
- |
2527 |
- local f bn |
2528 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
2529 |
- -mindepth 1 -maxdepth 1) |
2530 |
- do |
2531 |
- bn=$(basename "${f}") |
2532 |
- # Temporarily tack on tmp to workaround a file collision |
2533 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
2534 |
- # had this issue. |
2535 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
2536 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
2537 |
- done |
2538 |
- |
2539 |
- if use doc ; then |
2540 |
- docinto html |
2541 |
- dodoc doc/src/sgml/html/* |
2542 |
- |
2543 |
- docinto sgml |
2544 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
2545 |
- fi |
2546 |
- |
2547 |
- if use server; then |
2548 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2549 |
- "${FILESDIR}/${PN}.confd-9.2" | newconfd - ${PN}-${SLOT} |
2550 |
- |
2551 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2552 |
- "${FILESDIR}/${PN}.init-9.2" | newinitd - ${PN}-${SLOT} |
2553 |
- |
2554 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2555 |
- "${FILESDIR}/${PN}.service" | \ |
2556 |
- systemd_newunit - ${PN}-${SLOT}.service |
2557 |
- |
2558 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2559 |
- |
2560 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2561 |
- |
2562 |
- if use prefix ; then |
2563 |
- keepdir /run/postgresql |
2564 |
- fperms 0775 /run/postgresql |
2565 |
- fi |
2566 |
- fi |
2567 |
-} |
2568 |
- |
2569 |
-pkg_preinst() { |
2570 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
2571 |
- # /usr/bin/psql96). They may have been created by the |
2572 |
- # postgresql.eselect module, but they're handled within this ebuild |
2573 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
2574 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
2575 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
2576 |
- # handled in this manner. |
2577 |
- local canonicalise |
2578 |
- if type -p realpath > /dev/null; then |
2579 |
- canonicalise=realpath |
2580 |
- elif type -p readlink > /dev/null; then |
2581 |
- canonicalise='readlink -f' |
2582 |
- else |
2583 |
- # can't die, subshell |
2584 |
- die "No readlink nor realpath found, cannot canonicalise" |
2585 |
- fi |
2586 |
- |
2587 |
- local l |
2588 |
- # First remove any symlinks in /usr/bin that may have been created |
2589 |
- # by the old eselect |
2590 |
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
2591 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
2592 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
2593 |
- fi |
2594 |
- done |
2595 |
- |
2596 |
- # Then move the symlinks created by the ebuild to their proper place. |
2597 |
- for l in "${ED}"/usr/bin/*tmp ; do |
2598 |
- mv "${l}" "${l%tmp}" \ |
2599 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
2600 |
- done |
2601 |
-} |
2602 |
- |
2603 |
-pkg_postinst() { |
2604 |
- postgresql-config update |
2605 |
- |
2606 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2607 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
2608 |
- |
2609 |
- if use server ; then |
2610 |
- elog |
2611 |
- elog "Gentoo specific documentation:" |
2612 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2613 |
- elog |
2614 |
- elog "Official documentation:" |
2615 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
2616 |
- elog |
2617 |
- elog "The default location of the Unix-domain socket is:" |
2618 |
- elog " ${EROOT%/}/run/postgresql/" |
2619 |
- elog |
2620 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2621 |
- elog "so that it contains your preferred locale in:" |
2622 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2623 |
- elog |
2624 |
- elog "Then, execute the following command to setup the initial database" |
2625 |
- elog "environment:" |
2626 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2627 |
- fi |
2628 |
-} |
2629 |
- |
2630 |
-pkg_prerm() { |
2631 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2632 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2633 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2634 |
- |
2635 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2636 |
- sleep 10 |
2637 |
- eend 0 |
2638 |
- fi |
2639 |
-} |
2640 |
- |
2641 |
-pkg_postrm() { |
2642 |
- postgresql-config update |
2643 |
-} |
2644 |
- |
2645 |
-pkg_config() { |
2646 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2647 |
- |
2648 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2649 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2650 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
2651 |
- [[ -z "${DATA_DIR}" ]] \ |
2652 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
2653 |
- |
2654 |
- # environment.bz2 may not contain the same locale as the current system |
2655 |
- # locale. Unset and source from the current system locale. |
2656 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
2657 |
- unset LANG |
2658 |
- unset LC_CTYPE |
2659 |
- unset LC_NUMERIC |
2660 |
- unset LC_TIME |
2661 |
- unset LC_COLLATE |
2662 |
- unset LC_MONETARY |
2663 |
- unset LC_MESSAGES |
2664 |
- unset LC_ALL |
2665 |
- source "${EROOT%/}/etc/env.d/02locale" |
2666 |
- [ -n "${LANG}" ] && export LANG |
2667 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2668 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2669 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2670 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2671 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2672 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2673 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2674 |
- fi |
2675 |
- |
2676 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2677 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2678 |
- einfo |
2679 |
- einfo "Information on options that can be passed to initdb are found at:" |
2680 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2681 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2682 |
- einfo |
2683 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2684 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2685 |
- einfo " (none)" |
2686 |
- else |
2687 |
- einfo " ${PG_INITDB_OPTS}" |
2688 |
- fi |
2689 |
- einfo |
2690 |
- einfo "Configuration files will be installed to:" |
2691 |
- einfo " ${PGDATA}" |
2692 |
- einfo |
2693 |
- einfo "The database cluster will be created in:" |
2694 |
- einfo " ${DATA_DIR}" |
2695 |
- einfo |
2696 |
- |
2697 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
2698 |
- sleep 5 |
2699 |
- eend 0 |
2700 |
- |
2701 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2702 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2703 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2704 |
- die "${DATA_DIR} is not empty." |
2705 |
- fi |
2706 |
- |
2707 |
- einfo "Creating the data directory ..." |
2708 |
- if [[ ${EUID} == 0 ]] ; then |
2709 |
- mkdir -p "${DATA_DIR}" |
2710 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
2711 |
- chmod 0700 "${DATA_DIR}" |
2712 |
- fi |
2713 |
- |
2714 |
- einfo "Initializing the database ..." |
2715 |
- |
2716 |
- if [[ ${EUID} == 0 ]] ; then |
2717 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2718 |
- else |
2719 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2720 |
- fi |
2721 |
- |
2722 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2723 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2724 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2725 |
- fi |
2726 |
- |
2727 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
2728 |
- # overridden in the initscript |
2729 |
- sed '/^#unix_socket_directory/d' -i "${PGDATA%/}"/postgresql.conf |
2730 |
- |
2731 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2732 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2733 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2734 |
- # characters in PL/Perl |
2735 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2736 |
- EOF |
2737 |
- |
2738 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2739 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2740 |
- einfo "by default. You can disable it in the cluster's:" |
2741 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2742 |
- einfo |
2743 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2744 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2745 |
- einfo |
2746 |
- if use prefix ; then |
2747 |
- einfo "The location of the configuration files have moved to:" |
2748 |
- einfo " ${PGDATA}" |
2749 |
- einfo "To start the server:" |
2750 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2751 |
- einfo "To stop:" |
2752 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2753 |
- einfo |
2754 |
- einfo "Or move the configuration files back:" |
2755 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2756 |
- else |
2757 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2758 |
- einfo "instead of 'pg_ctl'." |
2759 |
- fi |
2760 |
-} |
2761 |
- |
2762 |
-src_test() { |
2763 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2764 |
- emake check |
2765 |
- |
2766 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2767 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2768 |
- else |
2769 |
- use server || \ |
2770 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2771 |
- [[ ${UID} -eq 0 ]] || \ |
2772 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2773 |
- |
2774 |
- ewarn 'Skipping.' |
2775 |
- fi |
2776 |
-} |
2777 |
|
2778 |
diff --git a/dev-db/postgresql/postgresql-9.3.15.ebuild b/dev-db/postgresql/postgresql-9.3.15.ebuild |
2779 |
deleted file mode 100644 |
2780 |
index 2a15daf099f..00000000000 |
2781 |
--- a/dev-db/postgresql/postgresql-9.3.15.ebuild |
2782 |
+++ /dev/null |
2783 |
@@ -1,395 +0,0 @@ |
2784 |
-# Copyright 1999-2018 Gentoo Foundation |
2785 |
-# Distributed under the terms of the GNU General Public License v2 |
2786 |
- |
2787 |
-EAPI="5" |
2788 |
- |
2789 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
2790 |
- |
2791 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
2792 |
- systemd user versionator |
2793 |
- |
2794 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
2795 |
- |
2796 |
-SLOT="$(get_version_component_range 1-2)" |
2797 |
- |
2798 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
2799 |
- |
2800 |
-LICENSE="POSTGRESQL GPL-2" |
2801 |
-DESCRIPTION="PostgreSQL RDBMS" |
2802 |
-HOMEPAGE="http://www.postgresql.org/" |
2803 |
- |
2804 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
2805 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
2806 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
2807 |
- |
2808 |
-wanted_languages() { |
2809 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
2810 |
- sk sl sv tr zh_CN zh_TW" |
2811 |
- local enable_langs lingua |
2812 |
- |
2813 |
- for lingua in ${linguas} ; do |
2814 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
2815 |
- done |
2816 |
- |
2817 |
- echo -n ${enable_langs} |
2818 |
-} |
2819 |
- |
2820 |
-CDEPEND=" |
2821 |
->=app-eselect/eselect-postgresql-1.2.0 |
2822 |
-sys-apps/less |
2823 |
-virtual/libintl |
2824 |
-kerberos? ( virtual/krb5 ) |
2825 |
-ldap? ( net-nds/openldap ) |
2826 |
-pam? ( virtual/pam ) |
2827 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2828 |
-python? ( ${PYTHON_DEPS} ) |
2829 |
-readline? ( sys-libs/readline:0= ) |
2830 |
-ssl? ( |
2831 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2832 |
- libressl? ( dev-libs/libressl:= ) |
2833 |
-) |
2834 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2835 |
-uuid? ( dev-libs/ossp-uuid ) |
2836 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2837 |
-zlib? ( sys-libs/zlib ) |
2838 |
-" |
2839 |
- |
2840 |
-DEPEND="${CDEPEND} |
2841 |
-!!<sys-apps/sandbox-2.0 |
2842 |
-sys-devel/bison |
2843 |
-sys-devel/flex |
2844 |
-nls? ( sys-devel/gettext ) |
2845 |
-xml? ( virtual/pkgconfig ) |
2846 |
-" |
2847 |
- |
2848 |
-RDEPEND="${CDEPEND} |
2849 |
-!dev-db/postgresql-docs:${SLOT} |
2850 |
-!dev-db/postgresql-base:${SLOT} |
2851 |
-!dev-db/postgresql-server:${SLOT} |
2852 |
-selinux? ( sec-policy/selinux-postgresql ) |
2853 |
-" |
2854 |
- |
2855 |
-pkg_setup() { |
2856 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2857 |
- |
2858 |
- enewgroup postgres 70 |
2859 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
2860 |
- |
2861 |
- use python && python-single-r1_pkg_setup |
2862 |
-} |
2863 |
- |
2864 |
-src_prepare() { |
2865 |
- # Work around PPC{,64} compilation bug where bool is already defined |
2866 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
2867 |
- |
2868 |
- # Set proper run directory |
2869 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2870 |
- -i src/include/pg_config_manual.h || die |
2871 |
- |
2872 |
- # Rely on $PATH being in the proper order so that the correct |
2873 |
- # install program is used for modules utilizing PGXS in both |
2874 |
- # hardened and non-hardened environments. (Bug #528786) |
2875 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
2876 |
- |
2877 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
2878 |
- |
2879 |
- # Fix bug 486556 where the server would crash at start up because of |
2880 |
- # an infinite loop caused by a self-referencing symlink. |
2881 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
2882 |
- |
2883 |
- if use pam ; then |
2884 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2885 |
- -i src/backend/libpq/auth.c || \ |
2886 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2887 |
- fi |
2888 |
- |
2889 |
- epatch_user |
2890 |
-} |
2891 |
- |
2892 |
-src_configure() { |
2893 |
- case ${CHOST} in |
2894 |
- *-darwin*|*-solaris*) |
2895 |
- use nls && append-libs intl |
2896 |
- ;; |
2897 |
- esac |
2898 |
- |
2899 |
- export LDFLAGS_SL="${LDFLAGS}" |
2900 |
- export LDFLAGS_EX="${LDFLAGS}" |
2901 |
- |
2902 |
- local PO="${EPREFIX%/}" |
2903 |
- |
2904 |
- econf \ |
2905 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2906 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2907 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
2908 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2909 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2910 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2911 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2912 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
2913 |
- $(use_enable threads thread-safety) \ |
2914 |
- $(use_with kerberos gssapi) \ |
2915 |
- $(use_with kerberos krb5) \ |
2916 |
- $(use_with ldap) \ |
2917 |
- $(use_with pam) \ |
2918 |
- $(use_with perl) \ |
2919 |
- $(use_with python) \ |
2920 |
- $(use_with readline) \ |
2921 |
- $(use_with ssl openssl) \ |
2922 |
- $(use_with tcl) \ |
2923 |
- $(use_with uuid ossp-uuid) \ |
2924 |
- $(use_with xml libxml) \ |
2925 |
- $(use_with xml libxslt) \ |
2926 |
- $(use_with zlib) \ |
2927 |
- "$(use_enable nls nls "$(wanted_languages)")" |
2928 |
-} |
2929 |
- |
2930 |
-src_compile() { |
2931 |
- emake |
2932 |
- emake -C contrib |
2933 |
-} |
2934 |
- |
2935 |
-src_install() { |
2936 |
- emake DESTDIR="${D}" install |
2937 |
- emake DESTDIR="${D}" install -C contrib |
2938 |
- |
2939 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2940 |
- |
2941 |
- # man pages are already built, but if we have the target make them, |
2942 |
- # they'll be generated from source before being installed so we |
2943 |
- # manually install man pages. |
2944 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2945 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2946 |
- doins -r doc/src/sgml/man{1,3,7} |
2947 |
- if ! use server; then |
2948 |
- # Remove man pages for non-existent binaries |
2949 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
2950 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2951 |
- done |
2952 |
- fi |
2953 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2954 |
- |
2955 |
- insinto /etc/postgresql-${SLOT} |
2956 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2957 |
- |
2958 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
2959 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
2960 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
2961 |
- |
2962 |
- use static-libs || find "${ED}" -name '*.a' -delete |
2963 |
- |
2964 |
- if use doc ; then |
2965 |
- docinto html |
2966 |
- dodoc doc/src/sgml/html/* |
2967 |
- |
2968 |
- docinto sgml |
2969 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
2970 |
- fi |
2971 |
- |
2972 |
- if use server; then |
2973 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2974 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
2975 |
- |
2976 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2977 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
2978 |
- |
2979 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2980 |
- "${FILESDIR}/${PN}.service" | \ |
2981 |
- systemd_newunit - ${PN}-${SLOT}.service |
2982 |
- |
2983 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2984 |
- |
2985 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2986 |
- |
2987 |
- if use prefix ; then |
2988 |
- keepdir /run/postgresql |
2989 |
- fperms 0775 /run/postgresql |
2990 |
- fi |
2991 |
- fi |
2992 |
-} |
2993 |
- |
2994 |
-pkg_postinst() { |
2995 |
- postgresql-config update |
2996 |
- |
2997 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2998 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
2999 |
- |
3000 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
3001 |
- elog |
3002 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
3003 |
- elog "following command in all active shells to pick up changes to the default" |
3004 |
- elog "environment:" |
3005 |
- elog " source /etc/profile" |
3006 |
- fi |
3007 |
- |
3008 |
- if use server ; then |
3009 |
- elog |
3010 |
- elog "Gentoo specific documentation:" |
3011 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3012 |
- elog |
3013 |
- elog "Official documentation:" |
3014 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
3015 |
- elog |
3016 |
- elog "The default location of the Unix-domain socket is:" |
3017 |
- elog " ${EROOT%/}/run/postgresql/" |
3018 |
- elog |
3019 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3020 |
- elog "so that it contains your preferred locale in:" |
3021 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3022 |
- elog |
3023 |
- elog "Then, execute the following command to setup the initial database" |
3024 |
- elog "environment:" |
3025 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3026 |
- fi |
3027 |
-} |
3028 |
- |
3029 |
-pkg_prerm() { |
3030 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3031 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3032 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3033 |
- |
3034 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3035 |
- sleep 10 |
3036 |
- eend 0 |
3037 |
- fi |
3038 |
-} |
3039 |
- |
3040 |
-pkg_postrm() { |
3041 |
- postgresql-config update |
3042 |
-} |
3043 |
- |
3044 |
-pkg_config() { |
3045 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3046 |
- |
3047 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3048 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3049 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
3050 |
- [[ -z "${DATA_DIR}" ]] \ |
3051 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
3052 |
- |
3053 |
- # environment.bz2 may not contain the same locale as the current system |
3054 |
- # locale. Unset and source from the current system locale. |
3055 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
3056 |
- unset LANG |
3057 |
- unset LC_CTYPE |
3058 |
- unset LC_NUMERIC |
3059 |
- unset LC_TIME |
3060 |
- unset LC_COLLATE |
3061 |
- unset LC_MONETARY |
3062 |
- unset LC_MESSAGES |
3063 |
- unset LC_ALL |
3064 |
- source "${EROOT%/}/etc/env.d/02locale" |
3065 |
- [ -n "${LANG}" ] && export LANG |
3066 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3067 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3068 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3069 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3070 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3071 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3072 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3073 |
- fi |
3074 |
- |
3075 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3076 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3077 |
- einfo |
3078 |
- einfo "Information on options that can be passed to initdb are found at:" |
3079 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3080 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3081 |
- einfo |
3082 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3083 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3084 |
- einfo " (none)" |
3085 |
- else |
3086 |
- einfo " ${PG_INITDB_OPTS}" |
3087 |
- fi |
3088 |
- einfo |
3089 |
- einfo "Configuration files will be installed to:" |
3090 |
- einfo " ${PGDATA}" |
3091 |
- einfo |
3092 |
- einfo "The database cluster will be created in:" |
3093 |
- einfo " ${DATA_DIR}" |
3094 |
- einfo |
3095 |
- while [ "$correct" != "true" ] ; do |
3096 |
- einfo "Are you ready to continue? (y/n)" |
3097 |
- read answer |
3098 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
3099 |
- correct="true" |
3100 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
3101 |
- die "Aborting initialization." |
3102 |
- else |
3103 |
- echo "Answer not recognized" |
3104 |
- fi |
3105 |
- done |
3106 |
- |
3107 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3108 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3109 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3110 |
- die "${DATA_DIR} is not empty." |
3111 |
- fi |
3112 |
- |
3113 |
- einfo "Creating the data directory ..." |
3114 |
- if [[ ${EUID} == 0 ]] ; then |
3115 |
- mkdir -p "${DATA_DIR}" |
3116 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
3117 |
- chmod 0700 "${DATA_DIR}" |
3118 |
- fi |
3119 |
- |
3120 |
- einfo "Initializing the database ..." |
3121 |
- |
3122 |
- if [[ ${EUID} == 0 ]] ; then |
3123 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3124 |
- else |
3125 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3126 |
- fi |
3127 |
- |
3128 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3129 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3130 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3131 |
- fi |
3132 |
- |
3133 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3134 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3135 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3136 |
- # characters in PL/Perl |
3137 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3138 |
- EOF |
3139 |
- |
3140 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3141 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3142 |
- einfo "by default. You can disable it in the cluster's:" |
3143 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3144 |
- einfo |
3145 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3146 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3147 |
- einfo |
3148 |
- if use prefix ; then |
3149 |
- einfo "The location of the configuration files have moved to:" |
3150 |
- einfo " ${PGDATA}" |
3151 |
- einfo "To start the server:" |
3152 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3153 |
- einfo "To stop:" |
3154 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3155 |
- einfo |
3156 |
- einfo "Or move the configuration files back:" |
3157 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3158 |
- else |
3159 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3160 |
- einfo "instead of 'pg_ctl'." |
3161 |
- fi |
3162 |
-} |
3163 |
- |
3164 |
-src_test() { |
3165 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3166 |
- emake check |
3167 |
- |
3168 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3169 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3170 |
- else |
3171 |
- use server || \ |
3172 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3173 |
- [[ ${UID} -eq 0 ]] || \ |
3174 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3175 |
- |
3176 |
- ewarn 'Skipping.' |
3177 |
- fi |
3178 |
-} |
3179 |
|
3180 |
diff --git a/dev-db/postgresql/postgresql-9.3.21.ebuild b/dev-db/postgresql/postgresql-9.3.21.ebuild |
3181 |
deleted file mode 100644 |
3182 |
index 08f19cc0a96..00000000000 |
3183 |
--- a/dev-db/postgresql/postgresql-9.3.21.ebuild |
3184 |
+++ /dev/null |
3185 |
@@ -1,450 +0,0 @@ |
3186 |
-# Copyright 1999-2018 Gentoo Foundation |
3187 |
-# Distributed under the terms of the GNU General Public License v2 |
3188 |
- |
3189 |
-EAPI="6" |
3190 |
- |
3191 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
3192 |
- |
3193 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
3194 |
- systemd user versionator |
3195 |
- |
3196 |
-KEYWORDS="alpha amd64 ~arm ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
3197 |
- |
3198 |
-SLOT="$(get_version_component_range 1-2)" |
3199 |
- |
3200 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
3201 |
- |
3202 |
-LICENSE="POSTGRESQL GPL-2" |
3203 |
-DESCRIPTION="PostgreSQL RDBMS" |
3204 |
-HOMEPAGE="http://www.postgresql.org/" |
3205 |
- |
3206 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
3207 |
- +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib" |
3208 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
3209 |
- |
3210 |
-wanted_languages() { |
3211 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
3212 |
- sk sl sv tr zh_CN zh_TW" |
3213 |
- local enable_langs lingua |
3214 |
- |
3215 |
- for lingua in ${linguas} ; do |
3216 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
3217 |
- done |
3218 |
- |
3219 |
- echo -n ${enable_langs} |
3220 |
-} |
3221 |
- |
3222 |
-CDEPEND=" |
3223 |
->=app-eselect/eselect-postgresql-2.0 |
3224 |
-sys-apps/less |
3225 |
-virtual/libintl |
3226 |
-kerberos? ( virtual/krb5 ) |
3227 |
-ldap? ( net-nds/openldap ) |
3228 |
-pam? ( virtual/pam ) |
3229 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3230 |
-python? ( ${PYTHON_DEPS} ) |
3231 |
-readline? ( sys-libs/readline:0= ) |
3232 |
-ssl? ( |
3233 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3234 |
- libressl? ( dev-libs/libressl:= ) |
3235 |
-) |
3236 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3237 |
-uuid? ( dev-libs/ossp-uuid ) |
3238 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3239 |
-zlib? ( sys-libs/zlib ) |
3240 |
-" |
3241 |
- |
3242 |
-DEPEND="${CDEPEND} |
3243 |
-!!<sys-apps/sandbox-2.0 |
3244 |
-sys-devel/bison |
3245 |
-sys-devel/flex |
3246 |
-nls? ( sys-devel/gettext ) |
3247 |
-xml? ( virtual/pkgconfig ) |
3248 |
-" |
3249 |
- |
3250 |
-RDEPEND="${CDEPEND} |
3251 |
-!dev-db/postgresql-docs:${SLOT} |
3252 |
-!dev-db/postgresql-base:${SLOT} |
3253 |
-!dev-db/postgresql-server:${SLOT} |
3254 |
-selinux? ( sec-policy/selinux-postgresql ) |
3255 |
-" |
3256 |
- |
3257 |
-pkg_setup() { |
3258 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3259 |
- |
3260 |
- enewgroup postgres 70 |
3261 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
3262 |
- |
3263 |
- use python && python-single-r1_pkg_setup |
3264 |
-} |
3265 |
- |
3266 |
-src_prepare() { |
3267 |
- # Work around PPC{,64} compilation bug where bool is already defined |
3268 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
3269 |
- |
3270 |
- # Set proper run directory |
3271 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3272 |
- -i src/include/pg_config_manual.h || die |
3273 |
- |
3274 |
- # Rely on $PATH being in the proper order so that the correct |
3275 |
- # install program is used for modules utilizing PGXS in both |
3276 |
- # hardened and non-hardened environments. (Bug #528786) |
3277 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3278 |
- |
3279 |
- use server || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
3280 |
- |
3281 |
- if use pam ; then |
3282 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3283 |
- -i src/backend/libpq/auth.c || \ |
3284 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3285 |
- fi |
3286 |
- |
3287 |
- eapply_user |
3288 |
-} |
3289 |
- |
3290 |
-src_configure() { |
3291 |
- case ${CHOST} in |
3292 |
- *-darwin*|*-solaris*) |
3293 |
- use nls && append-libs intl |
3294 |
- ;; |
3295 |
- esac |
3296 |
- |
3297 |
- export LDFLAGS_SL="${LDFLAGS}" |
3298 |
- export LDFLAGS_EX="${LDFLAGS}" |
3299 |
- |
3300 |
- local PO="${EPREFIX%/}" |
3301 |
- |
3302 |
- econf \ |
3303 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3304 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3305 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
3306 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3307 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3308 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3309 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3310 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
3311 |
- $(use_enable threads thread-safety) \ |
3312 |
- $(use_with kerberos gssapi) \ |
3313 |
- $(use_with kerberos krb5) \ |
3314 |
- $(use_with ldap) \ |
3315 |
- $(use_with pam) \ |
3316 |
- $(use_with perl) \ |
3317 |
- $(use_with python) \ |
3318 |
- $(use_with readline) \ |
3319 |
- $(use_with ssl openssl) \ |
3320 |
- $(use_with tcl) \ |
3321 |
- $(use_with uuid ossp-uuid) \ |
3322 |
- $(use_with xml libxml) \ |
3323 |
- $(use_with xml libxslt) \ |
3324 |
- $(use_with zlib) \ |
3325 |
- "$(use_enable nls nls "$(wanted_languages)")" |
3326 |
-} |
3327 |
- |
3328 |
-src_compile() { |
3329 |
- emake |
3330 |
- emake -C contrib |
3331 |
-} |
3332 |
- |
3333 |
-src_install() { |
3334 |
- emake DESTDIR="${D}" install |
3335 |
- emake DESTDIR="${D}" install -C contrib |
3336 |
- |
3337 |
- dodoc README HISTORY doc/{TODO,bug.template} |
3338 |
- |
3339 |
- # man pages are already built, but if we have the target make them, |
3340 |
- # they'll be generated from source before being installed so we |
3341 |
- # manually install man pages. |
3342 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3343 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3344 |
- doins -r doc/src/sgml/man{1,3,7} |
3345 |
- if ! use server; then |
3346 |
- # Remove man pages for non-existent binaries |
3347 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
3348 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3349 |
- done |
3350 |
- fi |
3351 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3352 |
- |
3353 |
- # Create slot specific man pages |
3354 |
- local bn f mansec slotted_name |
3355 |
- for mansec in 1 3 7 ; do |
3356 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
3357 |
- |
3358 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
3359 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
3360 |
- |
3361 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
3362 |
- bn=$(basename "${f}") |
3363 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
3364 |
- case ${bn} in |
3365 |
- TABLE.7|WITH.7) |
3366 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
3367 |
- ;; |
3368 |
- *) |
3369 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
3370 |
- ;; |
3371 |
- esac |
3372 |
- done |
3373 |
- |
3374 |
- popd > /dev/null |
3375 |
- done |
3376 |
- |
3377 |
- insinto /etc/postgresql-${SLOT} |
3378 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3379 |
- |
3380 |
- use static-libs || find "${ED}" -name '*.a' -delete |
3381 |
- |
3382 |
- local f bn |
3383 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
3384 |
- -mindepth 1 -maxdepth 1) |
3385 |
- do |
3386 |
- bn=$(basename "${f}") |
3387 |
- # Temporarily tack on tmp to workaround a file collision |
3388 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
3389 |
- # had this issue. |
3390 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
3391 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
3392 |
- done |
3393 |
- |
3394 |
- if use doc ; then |
3395 |
- docinto html |
3396 |
- dodoc doc/src/sgml/html/* |
3397 |
- |
3398 |
- docinto sgml |
3399 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
3400 |
- fi |
3401 |
- |
3402 |
- if use server; then |
3403 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3404 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
3405 |
- |
3406 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3407 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
3408 |
- |
3409 |
- if use systemd; then |
3410 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3411 |
- "${FILESDIR}/${PN}.service-9.2" | \ |
3412 |
- systemd_newunit - ${PN}-${SLOT}.service |
3413 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
3414 |
- fi |
3415 |
- |
3416 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3417 |
- |
3418 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3419 |
- |
3420 |
- if use prefix ; then |
3421 |
- keepdir /run/postgresql |
3422 |
- fperms 1775 /run/postgresql |
3423 |
- fi |
3424 |
- fi |
3425 |
-} |
3426 |
- |
3427 |
-pkg_preinst() { |
3428 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
3429 |
- # /usr/bin/psql96). They may have been created by the |
3430 |
- # postgresql.eselect module, but they're handled within this ebuild |
3431 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
3432 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
3433 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
3434 |
- # handled in this manner. |
3435 |
- local canonicalise |
3436 |
- if type -p realpath > /dev/null; then |
3437 |
- canonicalise=realpath |
3438 |
- elif type -p readlink > /dev/null; then |
3439 |
- canonicalise='readlink -f' |
3440 |
- else |
3441 |
- # can't die, subshell |
3442 |
- die "No readlink nor realpath found, cannot canonicalise" |
3443 |
- fi |
3444 |
- |
3445 |
- local l |
3446 |
- # First remove any symlinks in /usr/bin that may have been created |
3447 |
- # by the old eselect |
3448 |
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
3449 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
3450 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
3451 |
- fi |
3452 |
- done |
3453 |
- |
3454 |
- # Then move the symlinks created by the ebuild to their proper place. |
3455 |
- for l in "${ED}"/usr/bin/*tmp ; do |
3456 |
- mv "${l}" "${l%tmp}" \ |
3457 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
3458 |
- done |
3459 |
-} |
3460 |
- |
3461 |
-pkg_postinst() { |
3462 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
3463 |
- postgresql-config update |
3464 |
- |
3465 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3466 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
3467 |
- |
3468 |
- if use server ; then |
3469 |
- elog |
3470 |
- elog "Gentoo specific documentation:" |
3471 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3472 |
- elog |
3473 |
- elog "Official documentation:" |
3474 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
3475 |
- elog |
3476 |
- elog "The default location of the Unix-domain socket is:" |
3477 |
- elog " ${EROOT%/}/run/postgresql/" |
3478 |
- elog |
3479 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3480 |
- elog "so that it contains your preferred locale in:" |
3481 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3482 |
- elog |
3483 |
- elog "Then, execute the following command to setup the initial database" |
3484 |
- elog "environment:" |
3485 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3486 |
- fi |
3487 |
-} |
3488 |
- |
3489 |
-pkg_prerm() { |
3490 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3491 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3492 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3493 |
- |
3494 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3495 |
- sleep 10 |
3496 |
- eend 0 |
3497 |
- fi |
3498 |
-} |
3499 |
- |
3500 |
-pkg_postrm() { |
3501 |
- postgresql-config update |
3502 |
-} |
3503 |
- |
3504 |
-pkg_config() { |
3505 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3506 |
- |
3507 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3508 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3509 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
3510 |
- [[ -z "${DATA_DIR}" ]] \ |
3511 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
3512 |
- |
3513 |
- # environment.bz2 may not contain the same locale as the current system |
3514 |
- # locale. Unset and source from the current system locale. |
3515 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
3516 |
- unset LANG |
3517 |
- unset LC_CTYPE |
3518 |
- unset LC_NUMERIC |
3519 |
- unset LC_TIME |
3520 |
- unset LC_COLLATE |
3521 |
- unset LC_MONETARY |
3522 |
- unset LC_MESSAGES |
3523 |
- unset LC_ALL |
3524 |
- source "${EROOT%/}/etc/env.d/02locale" |
3525 |
- [ -n "${LANG}" ] && export LANG |
3526 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3527 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3528 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3529 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3530 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3531 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3532 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3533 |
- fi |
3534 |
- |
3535 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3536 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3537 |
- einfo |
3538 |
- einfo "Information on options that can be passed to initdb are found at:" |
3539 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3540 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3541 |
- einfo |
3542 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3543 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3544 |
- einfo " (none)" |
3545 |
- else |
3546 |
- einfo " ${PG_INITDB_OPTS}" |
3547 |
- fi |
3548 |
- einfo |
3549 |
- einfo "Configuration files will be installed to:" |
3550 |
- einfo " ${PGDATA}" |
3551 |
- einfo |
3552 |
- einfo "The database cluster will be created in:" |
3553 |
- einfo " ${DATA_DIR}" |
3554 |
- einfo |
3555 |
- |
3556 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
3557 |
- sleep 5 |
3558 |
- eend 0 |
3559 |
- |
3560 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3561 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3562 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3563 |
- die "${DATA_DIR} is not empty." |
3564 |
- fi |
3565 |
- |
3566 |
- einfo "Creating the data directory ..." |
3567 |
- if [[ ${EUID} == 0 ]] ; then |
3568 |
- mkdir -p "${DATA_DIR}" |
3569 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
3570 |
- chmod 0700 "${DATA_DIR}" |
3571 |
- fi |
3572 |
- |
3573 |
- einfo "Initializing the database ..." |
3574 |
- |
3575 |
- if [[ ${EUID} == 0 ]] ; then |
3576 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3577 |
- else |
3578 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3579 |
- fi |
3580 |
- |
3581 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3582 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3583 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3584 |
- fi |
3585 |
- |
3586 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
3587 |
- # overridden in the initscript |
3588 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
3589 |
- |
3590 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3591 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3592 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3593 |
- # characters in PL/Perl |
3594 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3595 |
- EOF |
3596 |
- |
3597 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3598 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3599 |
- einfo "by default. You can disable it in the cluster's:" |
3600 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3601 |
- einfo |
3602 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3603 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3604 |
- einfo |
3605 |
- if use prefix ; then |
3606 |
- einfo "The location of the configuration files have moved to:" |
3607 |
- einfo " ${PGDATA}" |
3608 |
- einfo "To start the server:" |
3609 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3610 |
- einfo "To stop:" |
3611 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3612 |
- einfo |
3613 |
- einfo "Or move the configuration files back:" |
3614 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3615 |
- else |
3616 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3617 |
- einfo "instead of 'pg_ctl'." |
3618 |
- fi |
3619 |
-} |
3620 |
- |
3621 |
-src_test() { |
3622 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3623 |
- emake check |
3624 |
- |
3625 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3626 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3627 |
- else |
3628 |
- use server || \ |
3629 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3630 |
- [[ ${UID} -eq 0 ]] || \ |
3631 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3632 |
- |
3633 |
- ewarn 'Skipping.' |
3634 |
- fi |
3635 |
-} |
3636 |
|
3637 |
diff --git a/dev-db/postgresql/postgresql-9.4.10.ebuild b/dev-db/postgresql/postgresql-9.4.10.ebuild |
3638 |
deleted file mode 100644 |
3639 |
index 0c0626e267c..00000000000 |
3640 |
--- a/dev-db/postgresql/postgresql-9.4.10.ebuild |
3641 |
+++ /dev/null |
3642 |
@@ -1,427 +0,0 @@ |
3643 |
-# Copyright 1999-2018 Gentoo Foundation |
3644 |
-# Distributed under the terms of the GNU General Public License v2 |
3645 |
- |
3646 |
-EAPI="5" |
3647 |
- |
3648 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
3649 |
- |
3650 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
3651 |
- systemd user versionator |
3652 |
- |
3653 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
3654 |
- |
3655 |
-SLOT="$(get_version_component_range 1-2)" |
3656 |
- |
3657 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
3658 |
- |
3659 |
-LICENSE="POSTGRESQL GPL-2" |
3660 |
-DESCRIPTION="PostgreSQL RDBMS" |
3661 |
-HOMEPAGE="http://www.postgresql.org/" |
3662 |
- |
3663 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
3664 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
3665 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
3666 |
- |
3667 |
-wanted_languages() { |
3668 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
3669 |
- sk sl sv tr zh_CN zh_TW" |
3670 |
- local enable_langs lingua |
3671 |
- |
3672 |
- for lingua in ${linguas} ; do |
3673 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
3674 |
- done |
3675 |
- |
3676 |
- echo -n ${enable_langs} |
3677 |
-} |
3678 |
- |
3679 |
-CDEPEND=" |
3680 |
->=app-eselect/eselect-postgresql-1.2.0 |
3681 |
-sys-apps/less |
3682 |
-virtual/libintl |
3683 |
-kerberos? ( virtual/krb5 ) |
3684 |
-ldap? ( net-nds/openldap ) |
3685 |
-pam? ( virtual/pam ) |
3686 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3687 |
-python? ( ${PYTHON_DEPS} ) |
3688 |
-readline? ( sys-libs/readline:0= ) |
3689 |
-ssl? ( |
3690 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3691 |
- libressl? ( dev-libs/libressl:= ) |
3692 |
-) |
3693 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3694 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3695 |
-zlib? ( sys-libs/zlib ) |
3696 |
-" |
3697 |
- |
3698 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
3699 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
3700 |
-# the libc includes UUID functions. |
3701 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
3702 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
3703 |
- |
3704 |
-nest_usedep() { |
3705 |
- local front back |
3706 |
- while [[ ${#} -gt 1 ]]; do |
3707 |
- front+="${1}? ( " |
3708 |
- back+=" )" |
3709 |
- shift |
3710 |
- done |
3711 |
- echo "${front}${1}${back}" |
3712 |
-} |
3713 |
- |
3714 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
3715 |
-CDEPEND+=" |
3716 |
-uuid? ( |
3717 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
3718 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
3719 |
-)" |
3720 |
- |
3721 |
-DEPEND="${CDEPEND} |
3722 |
-!!<sys-apps/sandbox-2.0 |
3723 |
-sys-devel/bison |
3724 |
-sys-devel/flex |
3725 |
-nls? ( sys-devel/gettext ) |
3726 |
-xml? ( virtual/pkgconfig ) |
3727 |
-" |
3728 |
- |
3729 |
-RDEPEND="${CDEPEND} |
3730 |
-!dev-db/postgresql-docs:${SLOT} |
3731 |
-!dev-db/postgresql-base:${SLOT} |
3732 |
-!dev-db/postgresql-server:${SLOT} |
3733 |
-selinux? ( sec-policy/selinux-postgresql ) |
3734 |
-" |
3735 |
- |
3736 |
-pkg_setup() { |
3737 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3738 |
- |
3739 |
- enewgroup postgres 70 |
3740 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
3741 |
- |
3742 |
- use python && python-single-r1_pkg_setup |
3743 |
-} |
3744 |
- |
3745 |
-src_prepare() { |
3746 |
- # Work around PPC{,64} compilation bug where bool is already defined |
3747 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
3748 |
- |
3749 |
- # Set proper run directory |
3750 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3751 |
- -i src/include/pg_config_manual.h || die |
3752 |
- |
3753 |
- # Rely on $PATH being in the proper order so that the correct |
3754 |
- # install program is used for modules utilizing PGXS in both |
3755 |
- # hardened and non-hardened environments. (Bug #528786) |
3756 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3757 |
- |
3758 |
- use server || epatch "${FILESDIR}/${PN}-9.4.10-no-server.patch" |
3759 |
- |
3760 |
- # Fix bug 486556 where the server would crash at start up because of |
3761 |
- # an infinite loop caused by a self-referencing symlink. |
3762 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
3763 |
- |
3764 |
- if use pam ; then |
3765 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3766 |
- -i src/backend/libpq/auth.c || \ |
3767 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3768 |
- fi |
3769 |
- |
3770 |
- epatch_user |
3771 |
-} |
3772 |
- |
3773 |
-src_configure() { |
3774 |
- case ${CHOST} in |
3775 |
- *-darwin*|*-solaris*) |
3776 |
- use nls && append-libs intl |
3777 |
- ;; |
3778 |
- esac |
3779 |
- |
3780 |
- export LDFLAGS_SL="${LDFLAGS}" |
3781 |
- export LDFLAGS_EX="${LDFLAGS}" |
3782 |
- |
3783 |
- local PO="${EPREFIX%/}" |
3784 |
- |
3785 |
- local i uuid_config="" |
3786 |
- if use uuid; then |
3787 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
3788 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
3789 |
- done |
3790 |
- for i in ${BSD_LIBC[@]}; do |
3791 |
- use ${i} && uuid_config="--with-uuid=bsd" |
3792 |
- done |
3793 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
3794 |
- fi |
3795 |
- |
3796 |
- econf \ |
3797 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3798 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3799 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
3800 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3801 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3802 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3803 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3804 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
3805 |
- $(use_enable threads thread-safety) \ |
3806 |
- $(use_with kerberos gssapi) \ |
3807 |
- $(use_with ldap) \ |
3808 |
- $(use_with pam) \ |
3809 |
- $(use_with perl) \ |
3810 |
- $(use_with python) \ |
3811 |
- $(use_with readline) \ |
3812 |
- $(use_with ssl openssl) \ |
3813 |
- $(use_with tcl) \ |
3814 |
- ${uuid_config} \ |
3815 |
- $(use_with xml libxml) \ |
3816 |
- $(use_with xml libxslt) \ |
3817 |
- $(use_with zlib) \ |
3818 |
- "$(use_enable nls nls "$(wanted_languages)")" |
3819 |
-} |
3820 |
- |
3821 |
-src_compile() { |
3822 |
- emake |
3823 |
- emake -C contrib |
3824 |
-} |
3825 |
- |
3826 |
-src_install() { |
3827 |
- emake DESTDIR="${D}" install |
3828 |
- emake DESTDIR="${D}" install -C contrib |
3829 |
- |
3830 |
- dodoc README HISTORY doc/{TODO,bug.template} |
3831 |
- |
3832 |
- # man pages are already built, but if we have the target make them, |
3833 |
- # they'll be generated from source before being installed so we |
3834 |
- # manually install man pages. |
3835 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3836 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3837 |
- doins -r doc/src/sgml/man{1,3,7} |
3838 |
- if ! use server; then |
3839 |
- # Remove man pages for non-existent binaries |
3840 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
3841 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3842 |
- done |
3843 |
- fi |
3844 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3845 |
- |
3846 |
- insinto /etc/postgresql-${SLOT} |
3847 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3848 |
- |
3849 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
3850 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
3851 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
3852 |
- |
3853 |
- use static-libs || find "${ED}" -name '*.a' -delete |
3854 |
- |
3855 |
- if use doc ; then |
3856 |
- docinto html |
3857 |
- dodoc doc/src/sgml/html/* |
3858 |
- |
3859 |
- docinto sgml |
3860 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
3861 |
- fi |
3862 |
- |
3863 |
- if use server; then |
3864 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3865 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
3866 |
- |
3867 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3868 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
3869 |
- |
3870 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3871 |
- "${FILESDIR}/${PN}.service" | \ |
3872 |
- systemd_newunit - ${PN}-${SLOT}.service |
3873 |
- |
3874 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3875 |
- |
3876 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3877 |
- |
3878 |
- if use prefix ; then |
3879 |
- keepdir /run/postgresql |
3880 |
- fperms 0775 /run/postgresql |
3881 |
- fi |
3882 |
- fi |
3883 |
-} |
3884 |
- |
3885 |
-pkg_postinst() { |
3886 |
- postgresql-config update |
3887 |
- |
3888 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3889 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
3890 |
- |
3891 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
3892 |
- elog |
3893 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
3894 |
- elog "following command in all active shells to pick up changes to the default" |
3895 |
- elog "environment:" |
3896 |
- elog " source /etc/profile" |
3897 |
- fi |
3898 |
- |
3899 |
- if use server ; then |
3900 |
- elog |
3901 |
- elog "Gentoo specific documentation:" |
3902 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3903 |
- elog |
3904 |
- elog "Official documentation:" |
3905 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
3906 |
- elog |
3907 |
- elog "The default location of the Unix-domain socket is:" |
3908 |
- elog " ${EROOT%/}/run/postgresql/" |
3909 |
- elog |
3910 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3911 |
- elog "so that it contains your preferred locale in:" |
3912 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3913 |
- elog |
3914 |
- elog "Then, execute the following command to setup the initial database" |
3915 |
- elog "environment:" |
3916 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3917 |
- fi |
3918 |
-} |
3919 |
- |
3920 |
-pkg_prerm() { |
3921 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3922 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3923 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3924 |
- |
3925 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3926 |
- sleep 10 |
3927 |
- eend 0 |
3928 |
- fi |
3929 |
-} |
3930 |
- |
3931 |
-pkg_postrm() { |
3932 |
- postgresql-config update |
3933 |
-} |
3934 |
- |
3935 |
-pkg_config() { |
3936 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3937 |
- |
3938 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3939 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3940 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
3941 |
- [[ -z "${DATA_DIR}" ]] \ |
3942 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
3943 |
- |
3944 |
- # environment.bz2 may not contain the same locale as the current system |
3945 |
- # locale. Unset and source from the current system locale. |
3946 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
3947 |
- unset LANG |
3948 |
- unset LC_CTYPE |
3949 |
- unset LC_NUMERIC |
3950 |
- unset LC_TIME |
3951 |
- unset LC_COLLATE |
3952 |
- unset LC_MONETARY |
3953 |
- unset LC_MESSAGES |
3954 |
- unset LC_ALL |
3955 |
- source "${EROOT%/}/etc/env.d/02locale" |
3956 |
- [ -n "${LANG}" ] && export LANG |
3957 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3958 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3959 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3960 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3961 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3962 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3963 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3964 |
- fi |
3965 |
- |
3966 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3967 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3968 |
- einfo |
3969 |
- einfo "Information on options that can be passed to initdb are found at:" |
3970 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3971 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3972 |
- einfo |
3973 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3974 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3975 |
- einfo " (none)" |
3976 |
- else |
3977 |
- einfo " ${PG_INITDB_OPTS}" |
3978 |
- fi |
3979 |
- einfo |
3980 |
- einfo "Configuration files will be installed to:" |
3981 |
- einfo " ${PGDATA}" |
3982 |
- einfo |
3983 |
- einfo "The database cluster will be created in:" |
3984 |
- einfo " ${DATA_DIR}" |
3985 |
- einfo |
3986 |
- while [ "$correct" != "true" ] ; do |
3987 |
- einfo "Are you ready to continue? (y/n)" |
3988 |
- read answer |
3989 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
3990 |
- correct="true" |
3991 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
3992 |
- die "Aborting initialization." |
3993 |
- else |
3994 |
- echo "Answer not recognized" |
3995 |
- fi |
3996 |
- done |
3997 |
- |
3998 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3999 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4000 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4001 |
- die "${DATA_DIR} is not empty." |
4002 |
- fi |
4003 |
- |
4004 |
- einfo "Creating the data directory ..." |
4005 |
- if [[ ${EUID} == 0 ]] ; then |
4006 |
- mkdir -p "${DATA_DIR}" |
4007 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
4008 |
- chmod 0700 "${DATA_DIR}" |
4009 |
- fi |
4010 |
- |
4011 |
- einfo "Initializing the database ..." |
4012 |
- |
4013 |
- if [[ ${EUID} == 0 ]] ; then |
4014 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4015 |
- else |
4016 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4017 |
- fi |
4018 |
- |
4019 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4020 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4021 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4022 |
- fi |
4023 |
- |
4024 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4025 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4026 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4027 |
- # characters in PL/Perl |
4028 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4029 |
- EOF |
4030 |
- |
4031 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4032 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4033 |
- einfo "by default. You can disable it in the cluster's:" |
4034 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4035 |
- einfo |
4036 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4037 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4038 |
- einfo |
4039 |
- if use prefix ; then |
4040 |
- einfo "The location of the configuration files have moved to:" |
4041 |
- einfo " ${PGDATA}" |
4042 |
- einfo "To start the server:" |
4043 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4044 |
- einfo "To stop:" |
4045 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4046 |
- einfo |
4047 |
- einfo "Or move the configuration files back:" |
4048 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4049 |
- else |
4050 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4051 |
- einfo "instead of 'pg_ctl'." |
4052 |
- fi |
4053 |
-} |
4054 |
- |
4055 |
-src_test() { |
4056 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4057 |
- emake check |
4058 |
- |
4059 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4060 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4061 |
- else |
4062 |
- use server || \ |
4063 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4064 |
- [[ ${UID} -eq 0 ]] || \ |
4065 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4066 |
- |
4067 |
- ewarn 'Skipping.' |
4068 |
- fi |
4069 |
-} |
4070 |
|
4071 |
diff --git a/dev-db/postgresql/postgresql-9.4.16.ebuild b/dev-db/postgresql/postgresql-9.4.16.ebuild |
4072 |
deleted file mode 100644 |
4073 |
index a1248b747bf..00000000000 |
4074 |
--- a/dev-db/postgresql/postgresql-9.4.16.ebuild |
4075 |
+++ /dev/null |
4076 |
@@ -1,482 +0,0 @@ |
4077 |
-# Copyright 1999-2018 Gentoo Foundation |
4078 |
-# Distributed under the terms of the GNU General Public License v2 |
4079 |
- |
4080 |
-EAPI="6" |
4081 |
- |
4082 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
4083 |
- |
4084 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
4085 |
- systemd user versionator |
4086 |
- |
4087 |
-KEYWORDS="alpha amd64 ~arm ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
4088 |
- |
4089 |
-SLOT="$(get_version_component_range 1-2)" |
4090 |
- |
4091 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
4092 |
- |
4093 |
-LICENSE="POSTGRESQL GPL-2" |
4094 |
-DESCRIPTION="PostgreSQL RDBMS" |
4095 |
-HOMEPAGE="http://www.postgresql.org/" |
4096 |
- |
4097 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
4098 |
- +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib" |
4099 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
4100 |
- |
4101 |
-wanted_languages() { |
4102 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
4103 |
- sk sl sv tr zh_CN zh_TW" |
4104 |
- local enable_langs lingua |
4105 |
- |
4106 |
- for lingua in ${linguas} ; do |
4107 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
4108 |
- done |
4109 |
- |
4110 |
- echo -n ${enable_langs} |
4111 |
-} |
4112 |
- |
4113 |
-CDEPEND=" |
4114 |
->=app-eselect/eselect-postgresql-2.0 |
4115 |
-sys-apps/less |
4116 |
-virtual/libintl |
4117 |
-kerberos? ( virtual/krb5 ) |
4118 |
-ldap? ( net-nds/openldap ) |
4119 |
-pam? ( virtual/pam ) |
4120 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4121 |
-python? ( ${PYTHON_DEPS} ) |
4122 |
-readline? ( sys-libs/readline:0= ) |
4123 |
-ssl? ( |
4124 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4125 |
- libressl? ( dev-libs/libressl:= ) |
4126 |
-) |
4127 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4128 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4129 |
-zlib? ( sys-libs/zlib ) |
4130 |
-" |
4131 |
- |
4132 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4133 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4134 |
-# the libc includes UUID functions. |
4135 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
4136 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
4137 |
- |
4138 |
-nest_usedep() { |
4139 |
- local front back |
4140 |
- while [[ ${#} -gt 1 ]]; do |
4141 |
- front+="${1}? ( " |
4142 |
- back+=" )" |
4143 |
- shift |
4144 |
- done |
4145 |
- echo "${front}${1}${back}" |
4146 |
-} |
4147 |
- |
4148 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
4149 |
-CDEPEND+=" |
4150 |
-uuid? ( |
4151 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4152 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4153 |
-)" |
4154 |
- |
4155 |
-DEPEND="${CDEPEND} |
4156 |
-!!<sys-apps/sandbox-2.0 |
4157 |
-sys-devel/bison |
4158 |
-sys-devel/flex |
4159 |
-nls? ( sys-devel/gettext ) |
4160 |
-xml? ( virtual/pkgconfig ) |
4161 |
-" |
4162 |
- |
4163 |
-RDEPEND="${CDEPEND} |
4164 |
-!dev-db/postgresql-docs:${SLOT} |
4165 |
-!dev-db/postgresql-base:${SLOT} |
4166 |
-!dev-db/postgresql-server:${SLOT} |
4167 |
-selinux? ( sec-policy/selinux-postgresql ) |
4168 |
-" |
4169 |
- |
4170 |
-pkg_setup() { |
4171 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4172 |
- |
4173 |
- enewgroup postgres 70 |
4174 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
4175 |
- |
4176 |
- use python && python-single-r1_pkg_setup |
4177 |
-} |
4178 |
- |
4179 |
-src_prepare() { |
4180 |
- # Work around PPC{,64} compilation bug where bool is already defined |
4181 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
4182 |
- |
4183 |
- # Set proper run directory |
4184 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4185 |
- -i src/include/pg_config_manual.h || die |
4186 |
- |
4187 |
- # Rely on $PATH being in the proper order so that the correct |
4188 |
- # install program is used for modules utilizing PGXS in both |
4189 |
- # hardened and non-hardened environments. (Bug #528786) |
4190 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4191 |
- |
4192 |
- use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch" |
4193 |
- |
4194 |
- if use pam ; then |
4195 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4196 |
- -i src/backend/libpq/auth.c || \ |
4197 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4198 |
- fi |
4199 |
- |
4200 |
- eapply_user |
4201 |
-} |
4202 |
- |
4203 |
-src_configure() { |
4204 |
- case ${CHOST} in |
4205 |
- *-darwin*|*-solaris*) |
4206 |
- use nls && append-libs intl |
4207 |
- ;; |
4208 |
- esac |
4209 |
- |
4210 |
- export LDFLAGS_SL="${LDFLAGS}" |
4211 |
- export LDFLAGS_EX="${LDFLAGS}" |
4212 |
- |
4213 |
- local PO="${EPREFIX%/}" |
4214 |
- |
4215 |
- local i uuid_config="" |
4216 |
- if use uuid; then |
4217 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4218 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4219 |
- done |
4220 |
- for i in ${BSD_LIBC[@]}; do |
4221 |
- use ${i} && uuid_config="--with-uuid=bsd" |
4222 |
- done |
4223 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4224 |
- fi |
4225 |
- |
4226 |
- econf \ |
4227 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4228 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4229 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
4230 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4231 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4232 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4233 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4234 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
4235 |
- $(use_enable threads thread-safety) \ |
4236 |
- $(use_with kerberos gssapi) \ |
4237 |
- $(use_with ldap) \ |
4238 |
- $(use_with pam) \ |
4239 |
- $(use_with perl) \ |
4240 |
- $(use_with python) \ |
4241 |
- $(use_with readline) \ |
4242 |
- $(use_with ssl openssl) \ |
4243 |
- $(use_with tcl) \ |
4244 |
- ${uuid_config} \ |
4245 |
- $(use_with xml libxml) \ |
4246 |
- $(use_with xml libxslt) \ |
4247 |
- $(use_with zlib) \ |
4248 |
- "$(use_enable nls nls "$(wanted_languages)")" |
4249 |
-} |
4250 |
- |
4251 |
-src_compile() { |
4252 |
- emake |
4253 |
- emake -C contrib |
4254 |
-} |
4255 |
- |
4256 |
-src_install() { |
4257 |
- emake DESTDIR="${D}" install |
4258 |
- emake DESTDIR="${D}" install -C contrib |
4259 |
- |
4260 |
- dodoc README HISTORY doc/{TODO,bug.template} |
4261 |
- |
4262 |
- # man pages are already built, but if we have the target make them, |
4263 |
- # they'll be generated from source before being installed so we |
4264 |
- # manually install man pages. |
4265 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4266 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4267 |
- doins -r doc/src/sgml/man{1,3,7} |
4268 |
- if ! use server; then |
4269 |
- # Remove man pages for non-existent binaries |
4270 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
4271 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4272 |
- done |
4273 |
- fi |
4274 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4275 |
- |
4276 |
- # Create slot specific man pages |
4277 |
- local bn f mansec slotted_name |
4278 |
- for mansec in 1 3 7 ; do |
4279 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
4280 |
- |
4281 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
4282 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
4283 |
- |
4284 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
4285 |
- bn=$(basename "${f}") |
4286 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
4287 |
- case ${bn} in |
4288 |
- TABLE.7|WITH.7) |
4289 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
4290 |
- ;; |
4291 |
- *) |
4292 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
4293 |
- ;; |
4294 |
- esac |
4295 |
- done |
4296 |
- |
4297 |
- popd > /dev/null |
4298 |
- done |
4299 |
- |
4300 |
- insinto /etc/postgresql-${SLOT} |
4301 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4302 |
- |
4303 |
- use static-libs || find "${ED}" -name '*.a' -delete |
4304 |
- |
4305 |
- local f bn |
4306 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
4307 |
- -mindepth 1 -maxdepth 1) |
4308 |
- do |
4309 |
- bn=$(basename "${f}") |
4310 |
- # Temporarily tack on tmp to workaround a file collision |
4311 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
4312 |
- # had this issue. |
4313 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
4314 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
4315 |
- done |
4316 |
- |
4317 |
- if use doc ; then |
4318 |
- docinto html |
4319 |
- dodoc doc/src/sgml/html/* |
4320 |
- |
4321 |
- docinto sgml |
4322 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
4323 |
- fi |
4324 |
- |
4325 |
- if use server; then |
4326 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4327 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
4328 |
- |
4329 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4330 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
4331 |
- |
4332 |
- if use systemd; then |
4333 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4334 |
- "${FILESDIR}/${PN}.service-9.2" | \ |
4335 |
- systemd_newunit - ${PN}-${SLOT}.service |
4336 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
4337 |
- fi |
4338 |
- |
4339 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4340 |
- |
4341 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4342 |
- |
4343 |
- if use prefix ; then |
4344 |
- keepdir /run/postgresql |
4345 |
- fperms 1775 /run/postgresql |
4346 |
- fi |
4347 |
- fi |
4348 |
-} |
4349 |
- |
4350 |
-pkg_preinst() { |
4351 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
4352 |
- # /usr/bin/psql96). They may have been created by the |
4353 |
- # postgresql.eselect module, but they're handled within this ebuild |
4354 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
4355 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
4356 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
4357 |
- # handled in this manner. |
4358 |
- local canonicalise |
4359 |
- if type -p realpath > /dev/null; then |
4360 |
- canonicalise=realpath |
4361 |
- elif type -p readlink > /dev/null; then |
4362 |
- canonicalise='readlink -f' |
4363 |
- else |
4364 |
- # can't die, subshell |
4365 |
- die "No readlink nor realpath found, cannot canonicalise" |
4366 |
- fi |
4367 |
- |
4368 |
- local l |
4369 |
- # First remove any symlinks in /usr/bin that may have been created |
4370 |
- # by the old eselect |
4371 |
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
4372 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
4373 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
4374 |
- fi |
4375 |
- done |
4376 |
- |
4377 |
- # Then move the symlinks created by the ebuild to their proper place. |
4378 |
- for l in "${ED}"/usr/bin/*tmp ; do |
4379 |
- mv "${l}" "${l%tmp}" \ |
4380 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
4381 |
- done |
4382 |
-} |
4383 |
- |
4384 |
-pkg_postinst() { |
4385 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
4386 |
- postgresql-config update |
4387 |
- |
4388 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4389 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
4390 |
- |
4391 |
- if use server ; then |
4392 |
- elog |
4393 |
- elog "Gentoo specific documentation:" |
4394 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4395 |
- elog |
4396 |
- elog "Official documentation:" |
4397 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
4398 |
- elog |
4399 |
- elog "The default location of the Unix-domain socket is:" |
4400 |
- elog " ${EROOT%/}/run/postgresql/" |
4401 |
- elog |
4402 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4403 |
- elog "so that it contains your preferred locale in:" |
4404 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4405 |
- elog |
4406 |
- elog "Then, execute the following command to setup the initial database" |
4407 |
- elog "environment:" |
4408 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4409 |
- fi |
4410 |
-} |
4411 |
- |
4412 |
-pkg_prerm() { |
4413 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4414 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4415 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4416 |
- |
4417 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4418 |
- sleep 10 |
4419 |
- eend 0 |
4420 |
- fi |
4421 |
-} |
4422 |
- |
4423 |
-pkg_postrm() { |
4424 |
- postgresql-config update |
4425 |
-} |
4426 |
- |
4427 |
-pkg_config() { |
4428 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4429 |
- |
4430 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4431 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4432 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
4433 |
- [[ -z "${DATA_DIR}" ]] \ |
4434 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
4435 |
- |
4436 |
- # environment.bz2 may not contain the same locale as the current system |
4437 |
- # locale. Unset and source from the current system locale. |
4438 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
4439 |
- unset LANG |
4440 |
- unset LC_CTYPE |
4441 |
- unset LC_NUMERIC |
4442 |
- unset LC_TIME |
4443 |
- unset LC_COLLATE |
4444 |
- unset LC_MONETARY |
4445 |
- unset LC_MESSAGES |
4446 |
- unset LC_ALL |
4447 |
- source "${EROOT%/}/etc/env.d/02locale" |
4448 |
- [ -n "${LANG}" ] && export LANG |
4449 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4450 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4451 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4452 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4453 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4454 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4455 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4456 |
- fi |
4457 |
- |
4458 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4459 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4460 |
- einfo |
4461 |
- einfo "Information on options that can be passed to initdb are found at:" |
4462 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4463 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4464 |
- einfo |
4465 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4466 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4467 |
- einfo " (none)" |
4468 |
- else |
4469 |
- einfo " ${PG_INITDB_OPTS}" |
4470 |
- fi |
4471 |
- einfo |
4472 |
- einfo "Configuration files will be installed to:" |
4473 |
- einfo " ${PGDATA}" |
4474 |
- einfo |
4475 |
- einfo "The database cluster will be created in:" |
4476 |
- einfo " ${DATA_DIR}" |
4477 |
- einfo |
4478 |
- |
4479 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
4480 |
- sleep 5 |
4481 |
- eend 0 |
4482 |
- |
4483 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4484 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4485 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4486 |
- die "${DATA_DIR} is not empty." |
4487 |
- fi |
4488 |
- |
4489 |
- einfo "Creating the data directory ..." |
4490 |
- if [[ ${EUID} == 0 ]] ; then |
4491 |
- mkdir -p "${DATA_DIR}" |
4492 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
4493 |
- chmod 0700 "${DATA_DIR}" |
4494 |
- fi |
4495 |
- |
4496 |
- einfo "Initializing the database ..." |
4497 |
- |
4498 |
- if [[ ${EUID} == 0 ]] ; then |
4499 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4500 |
- else |
4501 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4502 |
- fi |
4503 |
- |
4504 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4505 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4506 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4507 |
- fi |
4508 |
- |
4509 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
4510 |
- # overridden in the initscript |
4511 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
4512 |
- |
4513 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4514 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4515 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4516 |
- # characters in PL/Perl |
4517 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4518 |
- EOF |
4519 |
- |
4520 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4521 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4522 |
- einfo "by default. You can disable it in the cluster's:" |
4523 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4524 |
- einfo |
4525 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4526 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4527 |
- einfo |
4528 |
- if use prefix ; then |
4529 |
- einfo "The location of the configuration files have moved to:" |
4530 |
- einfo " ${PGDATA}" |
4531 |
- einfo "To start the server:" |
4532 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4533 |
- einfo "To stop:" |
4534 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4535 |
- einfo |
4536 |
- einfo "Or move the configuration files back:" |
4537 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4538 |
- else |
4539 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4540 |
- einfo "instead of 'pg_ctl'." |
4541 |
- fi |
4542 |
-} |
4543 |
- |
4544 |
-src_test() { |
4545 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4546 |
- emake check |
4547 |
- |
4548 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4549 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4550 |
- else |
4551 |
- use server || \ |
4552 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4553 |
- [[ ${UID} -eq 0 ]] || \ |
4554 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4555 |
- |
4556 |
- ewarn 'Skipping.' |
4557 |
- fi |
4558 |
-} |
4559 |
|
4560 |
diff --git a/dev-db/postgresql/postgresql-9.5.11.ebuild b/dev-db/postgresql/postgresql-9.5.11.ebuild |
4561 |
deleted file mode 100644 |
4562 |
index b00eaaaff86..00000000000 |
4563 |
--- a/dev-db/postgresql/postgresql-9.5.11.ebuild |
4564 |
+++ /dev/null |
4565 |
@@ -1,488 +0,0 @@ |
4566 |
-# Copyright 1999-2018 Gentoo Foundation |
4567 |
-# Distributed under the terms of the GNU General Public License v2 |
4568 |
- |
4569 |
-EAPI="6" |
4570 |
- |
4571 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
4572 |
- |
4573 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
4574 |
- systemd user versionator |
4575 |
- |
4576 |
-KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
4577 |
- |
4578 |
-SLOT="$(get_version_component_range 1-2)" |
4579 |
- |
4580 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
4581 |
- |
4582 |
-LICENSE="POSTGRESQL GPL-2" |
4583 |
-DESCRIPTION="PostgreSQL RDBMS" |
4584 |
-HOMEPAGE="http://www.postgresql.org/" |
4585 |
- |
4586 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
4587 |
- +readline selinux +server systemd ssl static-libs tcl threads uuid xml zlib" |
4588 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
4589 |
- |
4590 |
-wanted_languages() { |
4591 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
4592 |
- sk sl sv tr zh_CN zh_TW" |
4593 |
- local enable_langs lingua |
4594 |
- |
4595 |
- for lingua in ${linguas} ; do |
4596 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
4597 |
- done |
4598 |
- |
4599 |
- echo -n ${enable_langs} |
4600 |
-} |
4601 |
- |
4602 |
-CDEPEND=" |
4603 |
->=app-eselect/eselect-postgresql-2.0 |
4604 |
-sys-apps/less |
4605 |
-virtual/libintl |
4606 |
-kerberos? ( virtual/krb5 ) |
4607 |
-ldap? ( net-nds/openldap ) |
4608 |
-pam? ( virtual/pam ) |
4609 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4610 |
-python? ( ${PYTHON_DEPS} ) |
4611 |
-readline? ( sys-libs/readline:0= ) |
4612 |
-ssl? ( |
4613 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4614 |
- libressl? ( dev-libs/libressl:= ) |
4615 |
-) |
4616 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4617 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4618 |
-zlib? ( sys-libs/zlib ) |
4619 |
-" |
4620 |
- |
4621 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4622 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4623 |
-# the libc includes UUID functions. |
4624 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
4625 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
4626 |
- |
4627 |
-nest_usedep() { |
4628 |
- local front back |
4629 |
- while [[ ${#} -gt 1 ]]; do |
4630 |
- front+="${1}? ( " |
4631 |
- back+=" )" |
4632 |
- shift |
4633 |
- done |
4634 |
- echo "${front}${1}${back}" |
4635 |
-} |
4636 |
- |
4637 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
4638 |
-CDEPEND+=" |
4639 |
-uuid? ( |
4640 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4641 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4642 |
-)" |
4643 |
- |
4644 |
-DEPEND="${CDEPEND} |
4645 |
-!!<sys-apps/sandbox-2.0 |
4646 |
-sys-devel/bison |
4647 |
-sys-devel/flex |
4648 |
-nls? ( sys-devel/gettext ) |
4649 |
-xml? ( virtual/pkgconfig ) |
4650 |
-" |
4651 |
- |
4652 |
-RDEPEND="${CDEPEND} |
4653 |
-!dev-db/postgresql-docs:${SLOT} |
4654 |
-!dev-db/postgresql-base:${SLOT} |
4655 |
-!dev-db/postgresql-server:${SLOT} |
4656 |
-selinux? ( sec-policy/selinux-postgresql ) |
4657 |
-" |
4658 |
- |
4659 |
-pkg_setup() { |
4660 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4661 |
- |
4662 |
- enewgroup postgres 70 |
4663 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
4664 |
- |
4665 |
- use python && python-single-r1_pkg_setup |
4666 |
-} |
4667 |
- |
4668 |
-src_prepare() { |
4669 |
- # Work around PPC{,64} compilation bug where bool is already defined |
4670 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
4671 |
- |
4672 |
- # Set proper run directory |
4673 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4674 |
- -i src/include/pg_config_manual.h || die |
4675 |
- |
4676 |
- # Rely on $PATH being in the proper order so that the correct |
4677 |
- # install program is used for modules utilizing PGXS in both |
4678 |
- # hardened and non-hardened environments. (Bug #528786) |
4679 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4680 |
- |
4681 |
- use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch" |
4682 |
- |
4683 |
- if use pam ; then |
4684 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4685 |
- -i src/backend/libpq/auth.c || \ |
4686 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4687 |
- fi |
4688 |
- |
4689 |
- eapply_user |
4690 |
-} |
4691 |
- |
4692 |
-src_configure() { |
4693 |
- case ${CHOST} in |
4694 |
- *-darwin*|*-solaris*) |
4695 |
- use nls && append-libs intl |
4696 |
- ;; |
4697 |
- esac |
4698 |
- |
4699 |
- export LDFLAGS_SL="${LDFLAGS}" |
4700 |
- export LDFLAGS_EX="${LDFLAGS}" |
4701 |
- |
4702 |
- local PO="${EPREFIX%/}" |
4703 |
- |
4704 |
- local i uuid_config="" |
4705 |
- if use uuid; then |
4706 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4707 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4708 |
- done |
4709 |
- for i in ${BSD_LIBC[@]}; do |
4710 |
- use ${i} && uuid_config="--with-uuid=bsd" |
4711 |
- done |
4712 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4713 |
- fi |
4714 |
- |
4715 |
- econf \ |
4716 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4717 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4718 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
4719 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4720 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4721 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4722 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4723 |
- $(use_enable !alpha spinlocks) \ |
4724 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
4725 |
- $(use_enable threads thread-safety) \ |
4726 |
- $(use_with kerberos gssapi) \ |
4727 |
- $(use_with ldap) \ |
4728 |
- $(use_with pam) \ |
4729 |
- $(use_with perl) \ |
4730 |
- $(use_with python) \ |
4731 |
- $(use_with readline) \ |
4732 |
- $(use_with ssl openssl) \ |
4733 |
- $(use_with tcl) \ |
4734 |
- ${uuid_config} \ |
4735 |
- $(use_with xml libxml) \ |
4736 |
- $(use_with xml libxslt) \ |
4737 |
- $(use_with zlib) \ |
4738 |
- "$(use_enable nls nls "$(wanted_languages)")" |
4739 |
-} |
4740 |
- |
4741 |
-src_compile() { |
4742 |
- emake |
4743 |
- emake -C contrib |
4744 |
-} |
4745 |
- |
4746 |
-src_install() { |
4747 |
- emake DESTDIR="${D}" install |
4748 |
- emake DESTDIR="${D}" install -C contrib |
4749 |
- |
4750 |
- dodoc README HISTORY doc/{TODO,bug.template} |
4751 |
- |
4752 |
- # man pages are already built, but if we have the target make them, |
4753 |
- # they'll be generated from source before being installed so we |
4754 |
- # manually install man pages. |
4755 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4756 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4757 |
- doins -r doc/src/sgml/man{1,3,7} |
4758 |
- if ! use server; then |
4759 |
- # Remove man pages for non-existent binaries |
4760 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
4761 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4762 |
- done |
4763 |
- fi |
4764 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4765 |
- |
4766 |
- # Create slot specific man pages |
4767 |
- local bn f mansec slotted_name |
4768 |
- for mansec in 1 3 7 ; do |
4769 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
4770 |
- |
4771 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
4772 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
4773 |
- |
4774 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
4775 |
- bn=$(basename "${f}") |
4776 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
4777 |
- case ${bn} in |
4778 |
- TABLE.7|WITH.7) |
4779 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
4780 |
- ;; |
4781 |
- *) |
4782 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
4783 |
- ;; |
4784 |
- esac |
4785 |
- done |
4786 |
- |
4787 |
- popd > /dev/null |
4788 |
- done |
4789 |
- |
4790 |
- insinto /etc/postgresql-${SLOT} |
4791 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4792 |
- |
4793 |
- use static-libs || find "${ED}" -name '*.a' -delete |
4794 |
- |
4795 |
- local f bn |
4796 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
4797 |
- -mindepth 1 -maxdepth 1) |
4798 |
- do |
4799 |
- bn=$(basename "${f}") |
4800 |
- # Temporarily tack on tmp to workaround a file collision |
4801 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
4802 |
- # had this issue. |
4803 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
4804 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
4805 |
- done |
4806 |
- |
4807 |
- if use doc ; then |
4808 |
- docinto html |
4809 |
- dodoc doc/src/sgml/html/* |
4810 |
- |
4811 |
- docinto sgml |
4812 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
4813 |
- fi |
4814 |
- |
4815 |
- if use server; then |
4816 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4817 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
4818 |
- |
4819 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4820 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
4821 |
- |
4822 |
- if use systemd; then |
4823 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4824 |
- "${FILESDIR}/${PN}.service-9.2" | \ |
4825 |
- systemd_newunit - ${PN}-${SLOT}.service |
4826 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
4827 |
- fi |
4828 |
- |
4829 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4830 |
- |
4831 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4832 |
- |
4833 |
- if use prefix ; then |
4834 |
- keepdir /run/postgresql |
4835 |
- fperms 1775 /run/postgresql |
4836 |
- fi |
4837 |
- fi |
4838 |
-} |
4839 |
- |
4840 |
-pkg_preinst() { |
4841 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
4842 |
- # /usr/bin/psql96). They may have been created by the |
4843 |
- # postgresql.eselect module, but they're handled within this ebuild |
4844 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
4845 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
4846 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
4847 |
- # handled in this manner. |
4848 |
- local canonicalise |
4849 |
- if type -p realpath > /dev/null; then |
4850 |
- canonicalise=realpath |
4851 |
- elif type -p readlink > /dev/null; then |
4852 |
- canonicalise='readlink -f' |
4853 |
- else |
4854 |
- # can't die, subshell |
4855 |
- die "No readlink nor realpath found, cannot canonicalise" |
4856 |
- fi |
4857 |
- |
4858 |
- local l |
4859 |
- # First remove any symlinks in /usr/bin that may have been created |
4860 |
- # by the old eselect |
4861 |
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
4862 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
4863 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
4864 |
- fi |
4865 |
- done |
4866 |
- |
4867 |
- # Then move the symlinks created by the ebuild to their proper place. |
4868 |
- for l in "${ED}"/usr/bin/*tmp ; do |
4869 |
- mv "${l}" "${l%tmp}" \ |
4870 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
4871 |
- done |
4872 |
-} |
4873 |
- |
4874 |
-pkg_postinst() { |
4875 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
4876 |
- postgresql-config update |
4877 |
- |
4878 |
- if use alpha && use server ; then |
4879 |
- ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." |
4880 |
- ewarn "As a result, performance will be extremely degraded." |
4881 |
- fi |
4882 |
- |
4883 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4884 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
4885 |
- |
4886 |
- if use server ; then |
4887 |
- elog |
4888 |
- elog "Gentoo specific documentation:" |
4889 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4890 |
- elog |
4891 |
- elog "Official documentation:" |
4892 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
4893 |
- elog |
4894 |
- elog "The default location of the Unix-domain socket is:" |
4895 |
- elog " ${EROOT%/}/run/postgresql/" |
4896 |
- elog |
4897 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4898 |
- elog "so that it contains your preferred locale in:" |
4899 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4900 |
- elog |
4901 |
- elog "Then, execute the following command to setup the initial database" |
4902 |
- elog "environment:" |
4903 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4904 |
- fi |
4905 |
-} |
4906 |
- |
4907 |
-pkg_prerm() { |
4908 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4909 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4910 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4911 |
- |
4912 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4913 |
- sleep 10 |
4914 |
- eend 0 |
4915 |
- fi |
4916 |
-} |
4917 |
- |
4918 |
-pkg_postrm() { |
4919 |
- postgresql-config update |
4920 |
-} |
4921 |
- |
4922 |
-pkg_config() { |
4923 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4924 |
- |
4925 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4926 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4927 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
4928 |
- [[ -z "${DATA_DIR}" ]] \ |
4929 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
4930 |
- |
4931 |
- # environment.bz2 may not contain the same locale as the current system |
4932 |
- # locale. Unset and source from the current system locale. |
4933 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
4934 |
- unset LANG |
4935 |
- unset LC_CTYPE |
4936 |
- unset LC_NUMERIC |
4937 |
- unset LC_TIME |
4938 |
- unset LC_COLLATE |
4939 |
- unset LC_MONETARY |
4940 |
- unset LC_MESSAGES |
4941 |
- unset LC_ALL |
4942 |
- source "${EROOT%/}/etc/env.d/02locale" |
4943 |
- [ -n "${LANG}" ] && export LANG |
4944 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4945 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4946 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4947 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4948 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4949 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4950 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4951 |
- fi |
4952 |
- |
4953 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4954 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4955 |
- einfo |
4956 |
- einfo "Information on options that can be passed to initdb are found at:" |
4957 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4958 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4959 |
- einfo |
4960 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4961 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4962 |
- einfo " (none)" |
4963 |
- else |
4964 |
- einfo " ${PG_INITDB_OPTS}" |
4965 |
- fi |
4966 |
- einfo |
4967 |
- einfo "Configuration files will be installed to:" |
4968 |
- einfo " ${PGDATA}" |
4969 |
- einfo |
4970 |
- einfo "The database cluster will be created in:" |
4971 |
- einfo " ${DATA_DIR}" |
4972 |
- einfo |
4973 |
- |
4974 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
4975 |
- sleep 5 |
4976 |
- eend 0 |
4977 |
- |
4978 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4979 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4980 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4981 |
- die "${DATA_DIR} is not empty." |
4982 |
- fi |
4983 |
- |
4984 |
- einfo "Creating the data directory ..." |
4985 |
- if [[ ${EUID} == 0 ]] ; then |
4986 |
- mkdir -p "${DATA_DIR}" |
4987 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
4988 |
- chmod 0700 "${DATA_DIR}" |
4989 |
- fi |
4990 |
- |
4991 |
- einfo "Initializing the database ..." |
4992 |
- |
4993 |
- if [[ ${EUID} == 0 ]] ; then |
4994 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4995 |
- else |
4996 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4997 |
- fi |
4998 |
- |
4999 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
5000 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
5001 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
5002 |
- fi |
5003 |
- |
5004 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
5005 |
- # overridden in the initscript |
5006 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
5007 |
- |
5008 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
5009 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
5010 |
- # On the off-chance that you might need to work with UTF-8 encoded |
5011 |
- # characters in PL/Perl |
5012 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
5013 |
- EOF |
5014 |
- |
5015 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
5016 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
5017 |
- einfo "by default. You can disable it in the cluster's:" |
5018 |
- einfo " ${PGDATA%/}/postgresql.conf" |
5019 |
- einfo |
5020 |
- einfo "The PostgreSQL server, by default, will log events to:" |
5021 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
5022 |
- einfo |
5023 |
- if use prefix ; then |
5024 |
- einfo "The location of the configuration files have moved to:" |
5025 |
- einfo " ${PGDATA}" |
5026 |
- einfo "To start the server:" |
5027 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
5028 |
- einfo "To stop:" |
5029 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
5030 |
- einfo |
5031 |
- einfo "Or move the configuration files back:" |
5032 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
5033 |
- else |
5034 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
5035 |
- einfo "instead of 'pg_ctl'." |
5036 |
- fi |
5037 |
-} |
5038 |
- |
5039 |
-src_test() { |
5040 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
5041 |
- emake check |
5042 |
- |
5043 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
5044 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
5045 |
- else |
5046 |
- use server || \ |
5047 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
5048 |
- [[ ${UID} -eq 0 ]] || \ |
5049 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
5050 |
- |
5051 |
- ewarn 'Skipping.' |
5052 |
- fi |
5053 |
-} |
5054 |
|
5055 |
diff --git a/dev-db/postgresql/postgresql-9.5.5.ebuild b/dev-db/postgresql/postgresql-9.5.5.ebuild |
5056 |
deleted file mode 100644 |
5057 |
index 18ae5023750..00000000000 |
5058 |
--- a/dev-db/postgresql/postgresql-9.5.5.ebuild |
5059 |
+++ /dev/null |
5060 |
@@ -1,438 +0,0 @@ |
5061 |
-# Copyright 1999-2018 Gentoo Foundation |
5062 |
-# Distributed under the terms of the GNU General Public License v2 |
5063 |
- |
5064 |
-EAPI="5" |
5065 |
- |
5066 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
5067 |
- |
5068 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
5069 |
- systemd user versionator |
5070 |
- |
5071 |
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
5072 |
- |
5073 |
-SLOT="$(get_version_component_range 1-2)" |
5074 |
- |
5075 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
5076 |
- |
5077 |
-LICENSE="POSTGRESQL GPL-2" |
5078 |
-DESCRIPTION="PostgreSQL RDBMS" |
5079 |
-HOMEPAGE="http://www.postgresql.org/" |
5080 |
- |
5081 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
5082 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
5083 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
5084 |
- |
5085 |
-wanted_languages() { |
5086 |
- local linguas="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru |
5087 |
- sk sl sv tr zh_CN zh_TW" |
5088 |
- local enable_langs lingua |
5089 |
- |
5090 |
- for lingua in ${linguas} ; do |
5091 |
- has ${lingua} ${LINGUAS-${lingua}} && enable_langs+="${lingua} " |
5092 |
- done |
5093 |
- |
5094 |
- echo -n ${enable_langs} |
5095 |
-} |
5096 |
- |
5097 |
-CDEPEND=" |
5098 |
->=app-eselect/eselect-postgresql-1.2.0 |
5099 |
-sys-apps/less |
5100 |
-virtual/libintl |
5101 |
-kerberos? ( virtual/krb5 ) |
5102 |
-ldap? ( net-nds/openldap ) |
5103 |
-pam? ( virtual/pam ) |
5104 |
-perl? ( >=dev-lang/perl-5.8:= ) |
5105 |
-python? ( ${PYTHON_DEPS} ) |
5106 |
-readline? ( sys-libs/readline:0= ) |
5107 |
-ssl? ( |
5108 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
5109 |
- libressl? ( dev-libs/libressl:= ) |
5110 |
-) |
5111 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
5112 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
5113 |
-zlib? ( sys-libs/zlib ) |
5114 |
-" |
5115 |
- |
5116 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
5117 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
5118 |
-# the libc includes UUID functions. |
5119 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
5120 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
5121 |
- |
5122 |
-nest_usedep() { |
5123 |
- local front back |
5124 |
- while [[ ${#} -gt 1 ]]; do |
5125 |
- front+="${1}? ( " |
5126 |
- back+=" )" |
5127 |
- shift |
5128 |
- done |
5129 |
- echo "${front}${1}${back}" |
5130 |
-} |
5131 |
- |
5132 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
5133 |
-CDEPEND+=" |
5134 |
-uuid? ( |
5135 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
5136 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
5137 |
-)" |
5138 |
- |
5139 |
-DEPEND="${CDEPEND} |
5140 |
-!!<sys-apps/sandbox-2.0 |
5141 |
-sys-devel/bison |
5142 |
-sys-devel/flex |
5143 |
-nls? ( sys-devel/gettext ) |
5144 |
-xml? ( virtual/pkgconfig ) |
5145 |
-" |
5146 |
- |
5147 |
-RDEPEND="${CDEPEND} |
5148 |
-!dev-db/postgresql-docs:${SLOT} |
5149 |
-!dev-db/postgresql-base:${SLOT} |
5150 |
-!dev-db/postgresql-server:${SLOT} |
5151 |
-selinux? ( sec-policy/selinux-postgresql ) |
5152 |
-" |
5153 |
- |
5154 |
-pkg_setup() { |
5155 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
5156 |
- |
5157 |
- enewgroup postgres 70 |
5158 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
5159 |
- |
5160 |
- use python && python-single-r1_pkg_setup |
5161 |
-} |
5162 |
- |
5163 |
-src_prepare() { |
5164 |
- # Work around PPC{,64} compilation bug where bool is already defined |
5165 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
5166 |
- |
5167 |
- # Set proper run directory |
5168 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
5169 |
- -i src/include/pg_config_manual.h || die |
5170 |
- |
5171 |
- # Rely on $PATH being in the proper order so that the correct |
5172 |
- # install program is used for modules utilizing PGXS in both |
5173 |
- # hardened and non-hardened environments. (Bug #528786) |
5174 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
5175 |
- |
5176 |
- use server || epatch "${FILESDIR}/${PN}-9.5.5-no-server.patch" |
5177 |
- |
5178 |
- # Fix bug 486556 where the server would crash at start up because of |
5179 |
- # an infinite loop caused by a self-referencing symlink. |
5180 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
5181 |
- |
5182 |
- if use pam ; then |
5183 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
5184 |
- -i src/backend/libpq/auth.c || \ |
5185 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
5186 |
- fi |
5187 |
- |
5188 |
- epatch_user |
5189 |
-} |
5190 |
- |
5191 |
-src_configure() { |
5192 |
- case ${CHOST} in |
5193 |
- *-darwin*|*-solaris*) |
5194 |
- use nls && append-libs intl |
5195 |
- ;; |
5196 |
- esac |
5197 |
- |
5198 |
- export LDFLAGS_SL="${LDFLAGS}" |
5199 |
- export LDFLAGS_EX="${LDFLAGS}" |
5200 |
- |
5201 |
- local PO="${EPREFIX%/}" |
5202 |
- |
5203 |
- local i uuid_config="" |
5204 |
- if use uuid; then |
5205 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
5206 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
5207 |
- done |
5208 |
- for i in ${BSD_LIBC[@]}; do |
5209 |
- use ${i} && uuid_config="--with-uuid=bsd" |
5210 |
- done |
5211 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
5212 |
- fi |
5213 |
- |
5214 |
- econf \ |
5215 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
5216 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
5217 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
5218 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
5219 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
5220 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
5221 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
5222 |
- $(use_enable !alpha spinlocks) \ |
5223 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
5224 |
- $(use_enable threads thread-safety) \ |
5225 |
- $(use_with kerberos gssapi) \ |
5226 |
- $(use_with ldap) \ |
5227 |
- $(use_with pam) \ |
5228 |
- $(use_with perl) \ |
5229 |
- $(use_with python) \ |
5230 |
- $(use_with readline) \ |
5231 |
- $(use_with ssl openssl) \ |
5232 |
- $(use_with tcl) \ |
5233 |
- ${uuid_config} \ |
5234 |
- $(use_with xml libxml) \ |
5235 |
- $(use_with xml libxslt) \ |
5236 |
- $(use_with zlib) \ |
5237 |
- "$(use_enable nls nls "$(wanted_languages)")" |
5238 |
-} |
5239 |
- |
5240 |
-src_compile() { |
5241 |
- emake |
5242 |
- emake -C contrib |
5243 |
-} |
5244 |
- |
5245 |
-src_install() { |
5246 |
- emake DESTDIR="${D}" install |
5247 |
- emake DESTDIR="${D}" install -C contrib |
5248 |
- |
5249 |
- dodoc README HISTORY doc/{TODO,bug.template} |
5250 |
- |
5251 |
- # man pages are already built, but if we have the target make them, |
5252 |
- # they'll be generated from source before being installed so we |
5253 |
- # manually install man pages. |
5254 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
5255 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
5256 |
- doins -r doc/src/sgml/man{1,3,7} |
5257 |
- if ! use server; then |
5258 |
- # Remove man pages for non-existent binaries |
5259 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
5260 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
5261 |
- done |
5262 |
- fi |
5263 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
5264 |
- |
5265 |
- insinto /etc/postgresql-${SLOT} |
5266 |
- newins src/bin/psql/psqlrc.sample psqlrc |
5267 |
- |
5268 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
5269 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
5270 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
5271 |
- |
5272 |
- use static-libs || find "${ED}" -name '*.a' -delete |
5273 |
- |
5274 |
- if use doc ; then |
5275 |
- docinto html |
5276 |
- dodoc doc/src/sgml/html/* |
5277 |
- |
5278 |
- docinto sgml |
5279 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
5280 |
- fi |
5281 |
- |
5282 |
- if use server; then |
5283 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5284 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
5285 |
- |
5286 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5287 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
5288 |
- |
5289 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5290 |
- "${FILESDIR}/${PN}.service" | \ |
5291 |
- systemd_newunit - ${PN}-${SLOT}.service |
5292 |
- |
5293 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
5294 |
- |
5295 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
5296 |
- |
5297 |
- if use prefix ; then |
5298 |
- keepdir /run/postgresql |
5299 |
- fperms 0775 /run/postgresql |
5300 |
- fi |
5301 |
- fi |
5302 |
-} |
5303 |
- |
5304 |
-pkg_postinst() { |
5305 |
- postgresql-config update |
5306 |
- |
5307 |
- if use alpha && use server ; then |
5308 |
- ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." |
5309 |
- ewarn "As a result, performance will be extremely degraded." |
5310 |
- fi |
5311 |
- |
5312 |
- elog "If you need a global psqlrc-file, you can place it in:" |
5313 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
5314 |
- |
5315 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
5316 |
- elog |
5317 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
5318 |
- elog "following command in all active shells to pick up changes to the default" |
5319 |
- elog "environment:" |
5320 |
- elog " source /etc/profile" |
5321 |
- fi |
5322 |
- |
5323 |
- if use server ; then |
5324 |
- elog |
5325 |
- elog "Gentoo specific documentation:" |
5326 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
5327 |
- elog |
5328 |
- elog "Official documentation:" |
5329 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
5330 |
- elog |
5331 |
- elog "The default location of the Unix-domain socket is:" |
5332 |
- elog " ${EROOT%/}/run/postgresql/" |
5333 |
- elog |
5334 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
5335 |
- elog "so that it contains your preferred locale in:" |
5336 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5337 |
- elog |
5338 |
- elog "Then, execute the following command to setup the initial database" |
5339 |
- elog "environment:" |
5340 |
- elog " emerge --config =${CATEGORY}/${PF}" |
5341 |
- fi |
5342 |
-} |
5343 |
- |
5344 |
-pkg_prerm() { |
5345 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
5346 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
5347 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
5348 |
- |
5349 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
5350 |
- sleep 10 |
5351 |
- eend 0 |
5352 |
- fi |
5353 |
-} |
5354 |
- |
5355 |
-pkg_postrm() { |
5356 |
- postgresql-config update |
5357 |
-} |
5358 |
- |
5359 |
-pkg_config() { |
5360 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
5361 |
- |
5362 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
5363 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5364 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
5365 |
- [[ -z "${DATA_DIR}" ]] \ |
5366 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
5367 |
- |
5368 |
- # environment.bz2 may not contain the same locale as the current system |
5369 |
- # locale. Unset and source from the current system locale. |
5370 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
5371 |
- unset LANG |
5372 |
- unset LC_CTYPE |
5373 |
- unset LC_NUMERIC |
5374 |
- unset LC_TIME |
5375 |
- unset LC_COLLATE |
5376 |
- unset LC_MONETARY |
5377 |
- unset LC_MESSAGES |
5378 |
- unset LC_ALL |
5379 |
- source "${EROOT%/}/etc/env.d/02locale" |
5380 |
- [ -n "${LANG}" ] && export LANG |
5381 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
5382 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
5383 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
5384 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
5385 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
5386 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
5387 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
5388 |
- fi |
5389 |
- |
5390 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
5391 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5392 |
- einfo |
5393 |
- einfo "Information on options that can be passed to initdb are found at:" |
5394 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
5395 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
5396 |
- einfo |
5397 |
- einfo "PG_INITDB_OPTS is currently set to:" |
5398 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
5399 |
- einfo " (none)" |
5400 |
- else |
5401 |
- einfo " ${PG_INITDB_OPTS}" |
5402 |
- fi |
5403 |
- einfo |
5404 |
- einfo "Configuration files will be installed to:" |
5405 |
- einfo " ${PGDATA}" |
5406 |
- einfo |
5407 |
- einfo "The database cluster will be created in:" |
5408 |
- einfo " ${DATA_DIR}" |
5409 |
- einfo |
5410 |
- |
5411 |
- if [ -z "$PG_AUTOCONFIG" ] ; then |
5412 |
- while [ "$correct" != "true" ] ; do |
5413 |
- einfo "Are you ready to continue? (y/n)" |
5414 |
- read answer |
5415 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
5416 |
- correct="true" |
5417 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
5418 |
- die "Aborting initialization." |
5419 |
- else |
5420 |
- echo "Answer not recognized" |
5421 |
- fi |
5422 |
- done |
5423 |
- else |
5424 |
- einfo "PG_AUTOCONFIG set, not prompting" |
5425 |
- fi |
5426 |
- |
5427 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
5428 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
5429 |
- eerror "Modify DATA_DIR to point to an empty directory." |
5430 |
- die "${DATA_DIR} is not empty." |
5431 |
- fi |
5432 |
- |
5433 |
- einfo "Creating the data directory ..." |
5434 |
- if [[ ${EUID} == 0 ]] ; then |
5435 |
- mkdir -p "${DATA_DIR}" |
5436 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
5437 |
- chmod 0700 "${DATA_DIR}" |
5438 |
- fi |
5439 |
- |
5440 |
- einfo "Initializing the database ..." |
5441 |
- |
5442 |
- if [[ ${EUID} == 0 ]] ; then |
5443 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
5444 |
- else |
5445 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
5446 |
- fi |
5447 |
- |
5448 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
5449 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
5450 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
5451 |
- fi |
5452 |
- |
5453 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
5454 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
5455 |
- # On the off-chance that you might need to work with UTF-8 encoded |
5456 |
- # characters in PL/Perl |
5457 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
5458 |
- EOF |
5459 |
- |
5460 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
5461 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
5462 |
- einfo "by default. You can disable it in the cluster's:" |
5463 |
- einfo " ${PGDATA%/}/postgresql.conf" |
5464 |
- einfo |
5465 |
- einfo "The PostgreSQL server, by default, will log events to:" |
5466 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
5467 |
- einfo |
5468 |
- if use prefix ; then |
5469 |
- einfo "The location of the configuration files have moved to:" |
5470 |
- einfo " ${PGDATA}" |
5471 |
- einfo "To start the server:" |
5472 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
5473 |
- einfo "To stop:" |
5474 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
5475 |
- einfo |
5476 |
- einfo "Or move the configuration files back:" |
5477 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
5478 |
- else |
5479 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
5480 |
- einfo "instead of 'pg_ctl'." |
5481 |
- fi |
5482 |
-} |
5483 |
- |
5484 |
-src_test() { |
5485 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
5486 |
- emake check |
5487 |
- |
5488 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
5489 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
5490 |
- else |
5491 |
- use server || \ |
5492 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
5493 |
- [[ ${UID} -eq 0 ]] || \ |
5494 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
5495 |
- |
5496 |
- ewarn 'Skipping.' |
5497 |
- fi |
5498 |
-} |