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