1 |
commit: e0731adfc82bfd3d1d2793ff182e9273bc23f857 |
2 |
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 21 09:33:38 2022 +0000 |
4 |
Commit: 罗百科 <patrick <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 21 09:36:33 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0731adf |
7 |
|
8 |
dev-db/postgresql: Remove 9.6.24-r1 |
9 |
|
10 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
11 |
Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org> |
12 |
|
13 |
dev-db/postgresql/Manifest | 1 - |
14 |
dev-db/postgresql/metadata.xml | 4 - |
15 |
dev-db/postgresql/postgresql-9.6.24-r1.ebuild | 474 -------------------------- |
16 |
3 files changed, 479 deletions(-) |
17 |
|
18 |
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest |
19 |
index b82618fdf883..0e2edc769220 100644 |
20 |
--- a/dev-db/postgresql/Manifest |
21 |
+++ b/dev-db/postgresql/Manifest |
22 |
@@ -14,4 +14,3 @@ DIST postgresql-14.1.tar.bz2 21887101 BLAKE2B a496dfd513c52339d1b3cb72773f961172 |
23 |
DIST postgresql-14.2.tar.bz2 21964841 BLAKE2B 6460533a40064404f18642147b949cf7c85d036c45ede478fb9af8919895ee7b09dc78b89ed08a292226911f07cfc9e46d7f2d42e0aaea546c5e97a291d599b9 SHA512 19aeb6528605dbcf5df84048b2eed8f54b202576134d3fe3900bb8f073179c4258d2581acd745887e7e6fa86ebdb5f7b159ffaa0a645d601efee7c5f7730456b |
24 |
DIST postgresql-14.3.tar.bz2 22092190 BLAKE2B 8c9124cb758618d770a1084553f9e8f9a3fcb4e17e1aa4a1649e04f4c057f33ce1e5890bba3288bed2257236a4569735a77b3e5ddf989c2a2a4ef60ed494b3cc SHA512 70e6f67b5729a23f80b92b04e3fad2e09596b939660e3ddebf499d06af946459a45a019279e05413673e7b65d09a28a0440ed3c2ae565068466ed37e2d4f6f17 |
25 |
DIST postgresql-15beta1.tar.bz2 23518203 BLAKE2B 54398d2f6972e7640cbb1211b86c642b205b33ca879d6db7a93ef8a39e294e69a7d8bb0bc7ec5df3455e5a01a5aac63815506ad55b78bf5698d2a77e943031bf SHA512 ced71f4dca02803788890c71a192b0516a41b5bc5b8113623e52183eb143905185affa93b5399b27113e112b9669dbca20cb5783f96e31ff1f5ccd2f8ddc55d3 |
26 |
-DIST postgresql-9.6.24.tar.bz2 19047518 BLAKE2B 63b53cfb2c9381fe09ed76ef3cad1ec5014bcd3b4dea388cda5b4ad8b8084abc15a38dcd62e0c3fe0bcc922749e7a4bef4ec39287c4b1ea952b8245bbc72bc2e SHA512 c17ef8e7149bd136f6058e20b28f9a7307625614e37ff837feb7a6fa37b6932dfab6379285120c9bb0198961eb446c9979d5ee1f3e8583b09f981f52bee33505 |
27 |
|
28 |
diff --git a/dev-db/postgresql/metadata.xml b/dev-db/postgresql/metadata.xml |
29 |
index 1f8edafdc948..a7ebd231efc5 100644 |
30 |
--- a/dev-db/postgresql/metadata.xml |
31 |
+++ b/dev-db/postgresql/metadata.xml |
32 |
@@ -9,10 +9,6 @@ |
33 |
<flag name="llvm"> |
34 |
Add support for llvm JIT engine |
35 |
</flag> |
36 |
- <flag name="pg-legacytimestamp"> |
37 |
- Use double precision floating-point numbers instead of |
38 |
- 64-bit integers for timestamp storage. |
39 |
- </flag> |
40 |
<flag name="server"> |
41 |
Disable to build and install the clients and libraries |
42 |
only. |
43 |
|
44 |
diff --git a/dev-db/postgresql/postgresql-9.6.24-r1.ebuild b/dev-db/postgresql/postgresql-9.6.24-r1.ebuild |
45 |
deleted file mode 100644 |
46 |
index bd5c27b6bf08..000000000000 |
47 |
--- a/dev-db/postgresql/postgresql-9.6.24-r1.ebuild |
48 |
+++ /dev/null |
49 |
@@ -1,474 +0,0 @@ |
50 |
-# Copyright 1999-2022 Gentoo Authors |
51 |
-# Distributed under the terms of the GNU General Public License v2 |
52 |
- |
53 |
-EAPI=7 |
54 |
- |
55 |
-PYTHON_COMPAT=( python3_{8,9} ) |
56 |
- |
57 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd tmpfiles |
58 |
- |
59 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
60 |
- |
61 |
-SLOT=$(ver_cut 1-2) |
62 |
- |
63 |
-MY_PV=${PV/_/} |
64 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
65 |
- |
66 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
67 |
- |
68 |
-LICENSE="POSTGRESQL GPL-2" |
69 |
-DESCRIPTION="PostgreSQL RDBMS" |
70 |
-HOMEPAGE="https://www.postgresql.org/" |
71 |
- |
72 |
-IUSE="debug doc kerberos ldap nls pam perl |
73 |
- pg-legacytimestamp python +readline selinux +server systemd ssl |
74 |
- static-libs tcl threads uuid xml zlib" |
75 |
- |
76 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
77 |
- |
78 |
-CDEPEND=" |
79 |
->=app-eselect/eselect-postgresql-2.0 |
80 |
-acct-group/postgres |
81 |
-acct-user/postgres |
82 |
-sys-apps/less |
83 |
-virtual/libcrypt:= |
84 |
-virtual/libintl |
85 |
-kerberos? ( virtual/krb5 ) |
86 |
-ldap? ( net-nds/openldap:= ) |
87 |
-pam? ( sys-libs/pam ) |
88 |
-perl? ( >=dev-lang/perl-5.8:= ) |
89 |
-python? ( ${PYTHON_DEPS} ) |
90 |
-readline? ( sys-libs/readline:0= ) |
91 |
-ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
92 |
-server? ( systemd? ( sys-apps/systemd ) ) |
93 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
94 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
95 |
-zlib? ( sys-libs/zlib ) |
96 |
-" |
97 |
- |
98 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
99 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
100 |
-# the libc includes UUID functions. |
101 |
-UTIL_LINUX_LIBC=( elibc_{glibc,musl} ) |
102 |
- |
103 |
-nest_usedep() { |
104 |
- local front back |
105 |
- while [[ ${#} -gt 1 ]]; do |
106 |
- front+="${1}? ( " |
107 |
- back+=" )" |
108 |
- shift |
109 |
- done |
110 |
- echo "${front}${1}${back}" |
111 |
-} |
112 |
- |
113 |
-CDEPEND+=" |
114 |
-uuid? ( |
115 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
116 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid) |
117 |
-)" |
118 |
- |
119 |
-DEPEND="${CDEPEND} |
120 |
-sys-devel/bison |
121 |
-sys-devel/flex |
122 |
-nls? ( sys-devel/gettext ) |
123 |
-xml? ( virtual/pkgconfig ) |
124 |
-" |
125 |
- |
126 |
-RDEPEND="${CDEPEND} |
127 |
-selinux? ( sec-policy/selinux-postgresql ) |
128 |
-" |
129 |
- |
130 |
-pkg_setup() { |
131 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
132 |
- |
133 |
- use python && python-single-r1_pkg_setup |
134 |
-} |
135 |
- |
136 |
-src_prepare() { |
137 |
- # Work around PPC{,64} compilation bug where bool is already defined |
138 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
139 |
- |
140 |
- # Set proper run directory |
141 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
142 |
- -i src/include/pg_config_manual.h || die |
143 |
- |
144 |
- # Rely on $PATH being in the proper order so that the correct |
145 |
- # install program is used for modules utilizing PGXS in both |
146 |
- # hardened and non-hardened environments. (Bug #528786) |
147 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
148 |
- |
149 |
- use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch" |
150 |
- |
151 |
- if use pam ; then |
152 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
153 |
- -i src/backend/libpq/auth.c || \ |
154 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
155 |
- fi |
156 |
- |
157 |
- eapply_user |
158 |
-} |
159 |
- |
160 |
-src_configure() { |
161 |
- case ${CHOST} in |
162 |
- *-darwin*|*-solaris*) |
163 |
- use nls && append-libs intl |
164 |
- ;; |
165 |
- esac |
166 |
- |
167 |
- export LDFLAGS_SL="${LDFLAGS}" |
168 |
- export LDFLAGS_EX="${LDFLAGS}" |
169 |
- |
170 |
- local PO="${EPREFIX}" |
171 |
- |
172 |
- local i uuid_config="" |
173 |
- if use uuid; then |
174 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
175 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
176 |
- done |
177 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
178 |
- fi |
179 |
- |
180 |
- econf \ |
181 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
182 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
183 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
184 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
185 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
186 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
187 |
- $(use_enable !alpha spinlocks) \ |
188 |
- $(use_enable !pg-legacytimestamp integer-datetimes) \ |
189 |
- $(use_enable debug) \ |
190 |
- $(use_enable threads thread-safety) \ |
191 |
- $(use_with kerberos gssapi) \ |
192 |
- $(use_with ldap) \ |
193 |
- $(use_with pam) \ |
194 |
- $(use_with perl) \ |
195 |
- $(use_with python) \ |
196 |
- $(use_with readline) \ |
197 |
- $(use_with ssl openssl) \ |
198 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
199 |
- $(use_with tcl) \ |
200 |
- ${uuid_config} \ |
201 |
- $(use_with xml libxml) \ |
202 |
- $(use_with xml libxslt) \ |
203 |
- $(use_with zlib) \ |
204 |
- $(use_enable nls) |
205 |
-} |
206 |
- |
207 |
-src_compile() { |
208 |
- emake |
209 |
- emake -C contrib |
210 |
-} |
211 |
- |
212 |
-src_install() { |
213 |
- emake DESTDIR="${D}" install |
214 |
- emake DESTDIR="${D}" install -C contrib |
215 |
- |
216 |
- dodoc README HISTORY doc/{TODO,bug.template} |
217 |
- |
218 |
- # man pages are already built, but if we have the target make them, |
219 |
- # they'll be generated from source before being installed so we |
220 |
- # manually install man pages. |
221 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
222 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
223 |
- doins -r doc/src/sgml/man{1,3,7} |
224 |
- if ! use server; then |
225 |
- # Remove man pages for non-existent binaries |
226 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
227 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
228 |
- done |
229 |
- fi |
230 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
231 |
- |
232 |
- # Create slot specific man pages |
233 |
- local bn f mansec slotted_name |
234 |
- for mansec in 1 3 7 ; do |
235 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
236 |
- |
237 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
238 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
239 |
- |
240 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
241 |
- bn=$(basename "${f}") |
242 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
243 |
- case ${bn} in |
244 |
- TABLE.7|WITH.7) |
245 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
246 |
- ;; |
247 |
- *) |
248 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
249 |
- ;; |
250 |
- esac |
251 |
- done |
252 |
- |
253 |
- popd > /dev/null |
254 |
- done |
255 |
- |
256 |
- insinto /etc/postgresql-${SLOT} |
257 |
- newins src/bin/psql/psqlrc.sample psqlrc |
258 |
- |
259 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
260 |
- # needed by extensions utilizing PGXS. |
261 |
- use static-libs || \ |
262 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
263 |
- -delete |
264 |
- |
265 |
- local f bn |
266 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
267 |
- -mindepth 1 -maxdepth 1) |
268 |
- do |
269 |
- bn=$(basename "${f}") |
270 |
- # Temporarily tack on tmp to workaround a file collision |
271 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
272 |
- # had this issue. |
273 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
274 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
275 |
- done |
276 |
- |
277 |
- if use doc ; then |
278 |
- docinto html |
279 |
- dodoc doc/src/sgml/html/* |
280 |
- |
281 |
- docinto sgml |
282 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
283 |
- fi |
284 |
- |
285 |
- if use server; then |
286 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
287 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
288 |
- |
289 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
290 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
291 |
- |
292 |
- if use systemd; then |
293 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
294 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
295 |
- systemd_newunit - ${PN}-${SLOT}.service |
296 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
297 |
- fi |
298 |
- |
299 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
300 |
- |
301 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
302 |
- |
303 |
- if use prefix ; then |
304 |
- keepdir /run/postgresql |
305 |
- fperms 1775 /run/postgresql |
306 |
- fi |
307 |
- fi |
308 |
-} |
309 |
- |
310 |
-pkg_preinst() { |
311 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
312 |
- # /usr/bin/psql96). They may have been created by the |
313 |
- # postgresql.eselect module, but they're handled within this ebuild |
314 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
315 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
316 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
317 |
- # handled in this manner. |
318 |
- local canonicalise |
319 |
- if type -p realpath > /dev/null; then |
320 |
- canonicalise=realpath |
321 |
- elif type -p readlink > /dev/null; then |
322 |
- canonicalise='readlink -f' |
323 |
- else |
324 |
- # can't die, subshell |
325 |
- die "No readlink nor realpath found, cannot canonicalise" |
326 |
- fi |
327 |
- |
328 |
- local l |
329 |
- # First remove any symlinks in /usr/bin that may have been created |
330 |
- # by the old eselect |
331 |
- for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
332 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
333 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
334 |
- fi |
335 |
- done |
336 |
- |
337 |
- # Then move the symlinks created by the ebuild to their proper place. |
338 |
- for l in "${ED}"/usr/bin/*tmp ; do |
339 |
- mv "${l}" "${l%tmp}" \ |
340 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
341 |
- done |
342 |
-} |
343 |
- |
344 |
-pkg_postinst() { |
345 |
- use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf |
346 |
- postgresql-config update |
347 |
- |
348 |
- elog "If you need a global psqlrc-file, you can place it in:" |
349 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
350 |
- |
351 |
- if use server ; then |
352 |
- elog |
353 |
- elog "Gentoo specific documentation:" |
354 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
355 |
- elog |
356 |
- elog "Official documentation:" |
357 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
358 |
- elog |
359 |
- elog "The default location of the Unix-domain socket is:" |
360 |
- elog " ${EROOT}/run/postgresql/" |
361 |
- elog |
362 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
363 |
- elog "so that it contains your preferred locale in:" |
364 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
365 |
- elog |
366 |
- elog "Then, execute the following command to setup the initial database" |
367 |
- elog "environment:" |
368 |
- elog " emerge --config =${CATEGORY}/${PF}" |
369 |
- fi |
370 |
-} |
371 |
- |
372 |
-pkg_prerm() { |
373 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
374 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
375 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
376 |
- |
377 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
378 |
- sleep 10 |
379 |
- eend 0 |
380 |
- fi |
381 |
-} |
382 |
- |
383 |
-pkg_postrm() { |
384 |
- postgresql-config update |
385 |
-} |
386 |
- |
387 |
-pkg_config() { |
388 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
389 |
- |
390 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
391 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
392 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
393 |
- [[ -z "${DATA_DIR}" ]] \ |
394 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
395 |
- |
396 |
- # environment.bz2 may not contain the same locale as the current system |
397 |
- # locale. Unset and source from the current system locale. |
398 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
399 |
- unset LANG |
400 |
- unset LC_CTYPE |
401 |
- unset LC_NUMERIC |
402 |
- unset LC_TIME |
403 |
- unset LC_COLLATE |
404 |
- unset LC_MONETARY |
405 |
- unset LC_MESSAGES |
406 |
- unset LC_ALL |
407 |
- source "${EROOT}/etc/env.d/02locale" |
408 |
- [ -n "${LANG}" ] && export LANG |
409 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
410 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
411 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
412 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
413 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
414 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
415 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
416 |
- fi |
417 |
- |
418 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
419 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
420 |
- einfo |
421 |
- einfo "Information on options that can be passed to initdb are found at:" |
422 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
423 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
424 |
- einfo |
425 |
- einfo "PG_INITDB_OPTS is currently set to:" |
426 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
427 |
- einfo " (none)" |
428 |
- else |
429 |
- einfo " ${PG_INITDB_OPTS}" |
430 |
- fi |
431 |
- einfo |
432 |
- einfo "Configuration files will be installed to:" |
433 |
- einfo " ${PGDATA}" |
434 |
- einfo |
435 |
- einfo "The database cluster will be created in:" |
436 |
- einfo " ${DATA_DIR}" |
437 |
- einfo |
438 |
- |
439 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
440 |
- sleep 5 |
441 |
- eend 0 |
442 |
- |
443 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
444 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
445 |
- eerror "Modify DATA_DIR to point to an empty directory." |
446 |
- die "${DATA_DIR} is not empty." |
447 |
- fi |
448 |
- |
449 |
- einfo "Creating the data directory ..." |
450 |
- if [[ ${EUID} == 0 ]] ; then |
451 |
- mkdir -p "${DATA_DIR}" |
452 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
453 |
- chmod 0700 "${DATA_DIR}" |
454 |
- fi |
455 |
- |
456 |
- einfo "Initializing the database ..." |
457 |
- |
458 |
- if [[ ${EUID} == 0 ]] ; then |
459 |
- su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
460 |
- else |
461 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
462 |
- fi |
463 |
- |
464 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
465 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
466 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
467 |
- fi |
468 |
- |
469 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
470 |
- # overridden in the initscript |
471 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
472 |
- |
473 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
474 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
475 |
- # On the off-chance that you might need to work with UTF-8 encoded |
476 |
- # characters in PL/Perl |
477 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
478 |
- EOF |
479 |
- |
480 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
481 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
482 |
- einfo "by default. You can disable it in the cluster's:" |
483 |
- einfo " ${PGDATA%/}/postgresql.conf" |
484 |
- einfo |
485 |
- if ! use systemd; then |
486 |
- einfo "The PostgreSQL server, by default, will log events to:" |
487 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
488 |
- einfo |
489 |
- fi |
490 |
- if use prefix ; then |
491 |
- einfo "The location of the configuration files have moved to:" |
492 |
- einfo " ${PGDATA}" |
493 |
- einfo "To start the server:" |
494 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
495 |
- einfo "To stop:" |
496 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
497 |
- einfo |
498 |
- einfo "Or move the configuration files back:" |
499 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
500 |
- elif use systemd; then |
501 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
502 |
- einfo "instead of 'pg_ctl'." |
503 |
- else |
504 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
505 |
- einfo "instead of 'pg_ctl'." |
506 |
- fi |
507 |
-} |
508 |
- |
509 |
-src_test() { |
510 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
511 |
- emake check |
512 |
- |
513 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
514 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
515 |
- else |
516 |
- use server || \ |
517 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
518 |
- [[ ${UID} -eq 0 ]] || \ |
519 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
520 |
- |
521 |
- ewarn 'Skipping.' |
522 |
- fi |
523 |
-} |