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