1 |
commit: 41cce08f487fd7bba7e12ea942c3c770a379f41c |
2 |
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 13 11:19:22 2018 +0000 |
4 |
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 13 11:19:22 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41cce08f |
7 |
|
8 |
dev-db/postgresql: Add 11 beta 1 |
9 |
|
10 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
11 |
|
12 |
dev-db/postgresql/Manifest | 1 + |
13 |
.../files/postgresql-11_beta1-no-server.patch | 148 +++++++ |
14 |
dev-db/postgresql/postgresql-11_beta1.ebuild | 449 +++++++++++++++++++++ |
15 |
3 files changed, 598 insertions(+) |
16 |
|
17 |
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest |
18 |
index 734bfe706ad..22930870b63 100644 |
19 |
--- a/dev-db/postgresql/Manifest |
20 |
+++ b/dev-db/postgresql/Manifest |
21 |
@@ -1,5 +1,6 @@ |
22 |
DIST postgresql-10.3.tar.bz2 19959653 BLAKE2B ba3b05f53b0f879b18d6d0649bf819697c77a066b49d941a96d13a4741854b01aeb0c8b868d6550a08ad52572c9463c968660aa83c16cbaa5b4bf7a89387a524 SHA512 05cf82d3483bdf38734e6ff0fef6b80e7f8fd3cb5ea6792ffe222a599d97d1a29638970bf28ebf5bd1f877e8dcd9986d88f5c5e5379e74fe79ce83e20d2babba |
23 |
DIST postgresql-10.4.tar.bz2 20201838 BLAKE2B 6d1cdc44547740c8f9fbc2e989364640409c6d2a365568b75731277dd0fba473ce07e2ee27e8ebfad507a6ce0ab3d3a44156c0e3a069d96d320771d8a97ba82f SHA512 b7c0d2fdc724e2eb1cda9fc1eb01b47352bbe6ba6357b3e898b7f5990fd78499c8c68dcb3aa9bde7821d71b5882d8856131384e899f8055d89d51cdfdbc9e663 |
24 |
+DIST postgresql-11beta1.tar.bz2 20945387 BLAKE2B a99aff17a656da2250309f2652237c8df3a3aeed088250be6114964c103dec40d0c4cc60b048b2ffa1e9733aed8e9df2597d57cab58482512c42f25139dc3499 SHA512 fa4e9cf8293fecf384d98d3a5bbed208eda2e4dd8bf05a9922a74355daba74dde4dbe0cd42bea1de155f4fea3cdcd0d7621d7e315c1d5f49ce5ee794b01b9f6d |
25 |
DIST postgresql-9.3.22.tar.bz2 17022938 BLAKE2B 198705e438717d0d9e12c73e0c0e3eff0ba89ea50a1b183de70f065e13c153c164890fe56bc6ec13b0cb9617df4f66894c122eeddaf9303b9a02b8e08b19b085 SHA512 667ff496172626d2fe35c6795935fb07f4f7967a3b0631dd3b96278f8dc00b3d08794f091a5ab060a45d6f2a861e0f10f0e9660f9e343ab34eeabd693104c47f |
26 |
DIST postgresql-9.3.23.tar.bz2 17033683 BLAKE2B f02ad25f6b8755a9a57c3a6dcb63b78672e29473b061ad1616be2fb97fbfd83fe0dc9fc9fda66ac0231fb30fb13f9ef8975ba5a9701d83f33495bcf2c2651b4a SHA512 bb2d54312de728aa0379ea5bc6385036bbe69d3b7f85bbd78c210840eed19ace29840849caf38d0689e21130a0c94818a362b3927805d8eded53b68e240a52b0 |
27 |
DIST postgresql-9.4.17.tar.bz2 17807762 BLAKE2B 7640c29a71c6aeff47d9b43dd1e4f52edac4295b646b34da3a0ed9c26a8a826061bfd892e9907b62f31b7f01ee3aaf437c88d79b84d1d786d608dcd088309ecf SHA512 9ac03d460e521dcd142ac463dd5bb0f3e3f47333367bf8d61499ec7e8d0129d338c6f111667d0006df0c8ced9ae8a337d4c1b40eb5f55e6bc8dd5a24dfd376f0 |
28 |
|
29 |
diff --git a/dev-db/postgresql/files/postgresql-11_beta1-no-server.patch b/dev-db/postgresql/files/postgresql-11_beta1-no-server.patch |
30 |
new file mode 100644 |
31 |
index 00000000000..005a550f3cd |
32 |
--- /dev/null |
33 |
+++ b/dev-db/postgresql/files/postgresql-11_beta1-no-server.patch |
34 |
@@ -0,0 +1,148 @@ |
35 |
+diff -Naruw a/contrib/Makefile b/contrib/Makefile |
36 |
+--- a/contrib/Makefile |
37 |
++++ b/contrib/Makefile |
38 |
+@@ -5,56 +5,9 @@ |
39 |
+ include $(top_builddir)/src/Makefile.global |
40 |
+ |
41 |
+ SUBDIRS = \ |
42 |
+- adminpack \ |
43 |
+- amcheck \ |
44 |
+- auth_delay \ |
45 |
+- auto_explain \ |
46 |
+- bloom \ |
47 |
+- btree_gin \ |
48 |
+- btree_gist \ |
49 |
+- citext \ |
50 |
+- cube \ |
51 |
+- dblink \ |
52 |
+- dict_int \ |
53 |
+- dict_xsyn \ |
54 |
+- earthdistance \ |
55 |
+- file_fdw \ |
56 |
+- fuzzystrmatch \ |
57 |
+- hstore \ |
58 |
+- intagg \ |
59 |
+- intarray \ |
60 |
+- isn \ |
61 |
+- lo \ |
62 |
+- ltree \ |
63 |
+ oid2name \ |
64 |
+- pageinspect \ |
65 |
+- passwordcheck \ |
66 |
+- pg_buffercache \ |
67 |
+- pg_freespacemap \ |
68 |
+- pg_prewarm \ |
69 |
+- pg_standby \ |
70 |
+- pg_stat_statements \ |
71 |
+- pg_trgm \ |
72 |
+- pgcrypto \ |
73 |
+- pgrowlocks \ |
74 |
+- pgstattuple \ |
75 |
+- pg_visibility \ |
76 |
+- postgres_fdw \ |
77 |
+- seg \ |
78 |
+- spi \ |
79 |
+- tablefunc \ |
80 |
+- tcn \ |
81 |
+- test_decoding \ |
82 |
+- tsm_system_rows \ |
83 |
+- tsm_system_time \ |
84 |
+- unaccent \ |
85 |
+ vacuumlo |
86 |
+ |
87 |
+-ifeq ($(with_openssl),yes) |
88 |
+-SUBDIRS += sslinfo |
89 |
+-else |
90 |
+-ALWAYS_SUBDIRS += sslinfo |
91 |
+-endif |
92 |
+ |
93 |
+ ifneq ($(with_uuid),no) |
94 |
+ SUBDIRS += uuid-ossp |
95 |
+diff -Naruw a/src/backend/Makefile b/src/backend/Makefile |
96 |
+--- a/src/backend/Makefile |
97 |
++++ b/src/backend/Makefile |
98 |
+@@ -53,7 +53,7 @@ |
99 |
+ |
100 |
+ ########################################################################## |
101 |
+ |
102 |
+-all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP) |
103 |
++all: generated-headers |
104 |
+ |
105 |
+ ifneq ($(PORTNAME), cygwin) |
106 |
+ ifneq ($(PORTNAME), win32) |
107 |
+@@ -192,24 +192,7 @@ |
108 |
+ |
109 |
+ ########################################################################## |
110 |
+ |
111 |
+-install: all installdirs install-bin |
112 |
+-ifeq ($(PORTNAME), cygwin) |
113 |
+-ifeq ($(MAKE_DLL), true) |
114 |
+- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
115 |
+-endif |
116 |
+-endif |
117 |
+-ifeq ($(PORTNAME), win32) |
118 |
+-ifeq ($(MAKE_DLL), true) |
119 |
+- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' |
120 |
+-endif |
121 |
+-endif |
122 |
+- $(MAKE) -C catalog install-data |
123 |
+- $(MAKE) -C tsearch install-data |
124 |
+- $(MAKE) -C utils install-data |
125 |
+- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' |
126 |
+- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' |
127 |
+- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' |
128 |
+- $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample' |
129 |
++install: |
130 |
+ |
131 |
+ ifeq ($(with_llvm), yes) |
132 |
+ install-bin: install-postgres-bitcode |
133 |
+diff -Naruw a/src/bin/Makefile b/src/bin/Makefile |
134 |
+--- a/src/bin/Makefile |
135 |
++++ b/src/bin/Makefile |
136 |
+@@ -14,20 +14,8 @@ |
137 |
+ include $(top_builddir)/src/Makefile.global |
138 |
+ |
139 |
+ SUBDIRS = \ |
140 |
+- initdb \ |
141 |
+- pg_archivecleanup \ |
142 |
+- pg_basebackup \ |
143 |
+ pg_config \ |
144 |
+- pg_controldata \ |
145 |
+- pg_ctl \ |
146 |
+ pg_dump \ |
147 |
+- pg_resetwal \ |
148 |
+- pg_rewind \ |
149 |
+- pg_test_fsync \ |
150 |
+- pg_test_timing \ |
151 |
+- pg_upgrade \ |
152 |
+- pg_verify_checksums \ |
153 |
+- pg_waldump \ |
154 |
+ pgbench \ |
155 |
+ psql \ |
156 |
+ scripts |
157 |
+diff -Naruw a/src/Makefile b/src/Makefile |
158 |
+--- a/src/Makefile |
159 |
++++ b/src/Makefile |
160 |
+@@ -15,21 +15,12 @@ |
161 |
+ SUBDIRS = \ |
162 |
+ common \ |
163 |
+ port \ |
164 |
+- timezone \ |
165 |
+ backend \ |
166 |
+- backend/utils/mb/conversion_procs \ |
167 |
+- backend/snowball \ |
168 |
+ include \ |
169 |
+ interfaces \ |
170 |
+- backend/replication/libpqwalreceiver \ |
171 |
+- backend/replication/pgoutput \ |
172 |
+ fe_utils \ |
173 |
+ bin \ |
174 |
+- pl \ |
175 |
+- makefiles \ |
176 |
+- test/regress \ |
177 |
+- test/isolation \ |
178 |
+- test/perl |
179 |
++ makefiles |
180 |
+ |
181 |
+ ifeq ($(with_llvm), yes) |
182 |
+ SUBDIRS += backend/jit/llvm |
183 |
|
184 |
diff --git a/dev-db/postgresql/postgresql-11_beta1.ebuild b/dev-db/postgresql/postgresql-11_beta1.ebuild |
185 |
new file mode 100644 |
186 |
index 00000000000..8c9760a046d |
187 |
--- /dev/null |
188 |
+++ b/dev-db/postgresql/postgresql-11_beta1.ebuild |
189 |
@@ -0,0 +1,449 @@ |
190 |
+# Copyright 1999-2018 Gentoo Foundation |
191 |
+# Distributed under the terms of the GNU General Public License v2 |
192 |
+ |
193 |
+EAPI="6" |
194 |
+ |
195 |
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
196 |
+ |
197 |
+PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN |
198 |
+ zh_TW" |
199 |
+ |
200 |
+inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ |
201 |
+ systemd user versionator |
202 |
+ |
203 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
204 |
+ |
205 |
+SLOT=$(get_major_version) |
206 |
+ |
207 |
+MY_PV=${PV/_/} |
208 |
+S="${WORKDIR}/${PN}-${MY_PV}" |
209 |
+ |
210 |
+SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
211 |
+ |
212 |
+LICENSE="POSTGRESQL GPL-2" |
213 |
+DESCRIPTION="PostgreSQL RDBMS" |
214 |
+HOMEPAGE="http://www.postgresql.org/" |
215 |
+ |
216 |
+IUSE="doc kerberos kernel_linux ldap libressl nls pam perl python +readline |
217 |
+ selinux +server systemd ssl static-libs tcl threads uuid xml zlib" |
218 |
+ |
219 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
220 |
+ |
221 |
+CDEPEND=" |
222 |
+>=app-eselect/eselect-postgresql-2.0 |
223 |
+sys-apps/less |
224 |
+virtual/libintl |
225 |
+kerberos? ( virtual/krb5 ) |
226 |
+ldap? ( net-nds/openldap ) |
227 |
+pam? ( virtual/pam ) |
228 |
+perl? ( >=dev-lang/perl-5.8:= ) |
229 |
+python? ( ${PYTHON_DEPS} ) |
230 |
+readline? ( sys-libs/readline:0= ) |
231 |
+server? ( systemd? ( sys-apps/systemd ) ) |
232 |
+ssl? ( |
233 |
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
234 |
+ libressl? ( dev-libs/libressl:= ) |
235 |
+) |
236 |
+tcl? ( >=dev-lang/tcl-8:0= ) |
237 |
+xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
238 |
+zlib? ( sys-libs/zlib ) |
239 |
+" |
240 |
+ |
241 |
+# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
242 |
+# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
243 |
+# the libc includes UUID functions. |
244 |
+UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
245 |
+BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
246 |
+ |
247 |
+nest_usedep() { |
248 |
+ local front back |
249 |
+ while [[ ${#} -gt 1 ]]; do |
250 |
+ front+="${1}? ( " |
251 |
+ back+=" )" |
252 |
+ shift |
253 |
+ done |
254 |
+ echo "${front}${1}${back}" |
255 |
+} |
256 |
+ |
257 |
+IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
258 |
+CDEPEND+=" |
259 |
+uuid? ( |
260 |
+ ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
261 |
+ $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
262 |
+)" |
263 |
+ |
264 |
+DEPEND="${CDEPEND} |
265 |
+!!<sys-apps/sandbox-2.0 |
266 |
+sys-devel/bison |
267 |
+sys-devel/flex |
268 |
+nls? ( sys-devel/gettext ) |
269 |
+xml? ( virtual/pkgconfig ) |
270 |
+" |
271 |
+ |
272 |
+RDEPEND="${CDEPEND} |
273 |
+!dev-db/postgresql-docs:${SLOT} |
274 |
+!dev-db/postgresql-base:${SLOT} |
275 |
+!dev-db/postgresql-server:${SLOT} |
276 |
+selinux? ( sec-policy/selinux-postgresql ) |
277 |
+" |
278 |
+ |
279 |
+pkg_setup() { |
280 |
+ use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
281 |
+ |
282 |
+ enewgroup postgres 70 |
283 |
+ enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
284 |
+ |
285 |
+ use python && python-single-r1_pkg_setup |
286 |
+} |
287 |
+ |
288 |
+src_prepare() { |
289 |
+ # Set proper run directory |
290 |
+ sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
291 |
+ -i src/include/pg_config_manual.h || die |
292 |
+ |
293 |
+ # Rely on $PATH being in the proper order so that the correct |
294 |
+ # install program is used for modules utilizing PGXS in both |
295 |
+ # hardened and non-hardened environments. (Bug #528786) |
296 |
+ sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
297 |
+ |
298 |
+ use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch" |
299 |
+ |
300 |
+ if use pam ; then |
301 |
+ sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
302 |
+ -i src/backend/libpq/auth.c || \ |
303 |
+ die 'PGSQL_PAM_SERVICE rename failed.' |
304 |
+ fi |
305 |
+ |
306 |
+ eapply_user |
307 |
+} |
308 |
+ |
309 |
+src_configure() { |
310 |
+ case ${CHOST} in |
311 |
+ *-darwin*|*-solaris*) |
312 |
+ use nls && append-libs intl |
313 |
+ ;; |
314 |
+ esac |
315 |
+ |
316 |
+ export LDFLAGS_SL="${LDFLAGS}" |
317 |
+ export LDFLAGS_EX="${LDFLAGS}" |
318 |
+ |
319 |
+ local PO="${EPREFIX%/}" |
320 |
+ |
321 |
+ local i uuid_config="" |
322 |
+ if use uuid; then |
323 |
+ for i in ${UTIL_LINUX_LIBC[@]}; do |
324 |
+ use ${i} && uuid_config="--with-uuid=e2fs" |
325 |
+ done |
326 |
+ for i in ${BSD_LIBC[@]}; do |
327 |
+ use ${i} && uuid_config="--with-uuid=bsd" |
328 |
+ done |
329 |
+ [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
330 |
+ fi |
331 |
+ |
332 |
+ econf \ |
333 |
+ --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
334 |
+ --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
335 |
+ --docdir="${PO}/usr/share/doc/${PF}" \ |
336 |
+ --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
337 |
+ --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
338 |
+ --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
339 |
+ --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
340 |
+ $(use_enable !alpha spinlocks) \ |
341 |
+ $(use_enable threads thread-safety) \ |
342 |
+ $(use_with kerberos gssapi) \ |
343 |
+ $(use_with ldap) \ |
344 |
+ $(use_with pam) \ |
345 |
+ $(use_with perl) \ |
346 |
+ $(use_with python) \ |
347 |
+ $(use_with readline) \ |
348 |
+ $(use_with ssl openssl) \ |
349 |
+ $(usex server "$(use_with systemd)" '--without-systemd') \ |
350 |
+ $(use_with tcl) \ |
351 |
+ ${uuid_config} \ |
352 |
+ $(use_with xml libxml) \ |
353 |
+ $(use_with xml libxslt) \ |
354 |
+ $(use_with zlib) \ |
355 |
+ $(use_enable nls nls "'$(l10n_get_locales)'") |
356 |
+} |
357 |
+ |
358 |
+src_compile() { |
359 |
+ emake |
360 |
+ emake -C contrib |
361 |
+} |
362 |
+ |
363 |
+src_install() { |
364 |
+ emake DESTDIR="${D}" install |
365 |
+ emake DESTDIR="${D}" install -C contrib |
366 |
+ |
367 |
+ dodoc README HISTORY doc/{TODO,bug.template} |
368 |
+ |
369 |
+ # man pages are already built, but if we have the target make them, |
370 |
+ # they'll be generated from source before being installed so we |
371 |
+ # manually install man pages. |
372 |
+ # We use ${SLOT} instead of doman for postgresql.eselect |
373 |
+ insinto /usr/share/postgresql-${SLOT}/man/ |
374 |
+ doins -r doc/src/sgml/man{1,3,7} |
375 |
+ if ! use server; then |
376 |
+ # Remove man pages for non-existent binaries |
377 |
+ serverman=( |
378 |
+ initdb |
379 |
+ pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
380 |
+ pg_{test_{fsync,timing},upgrade,waldump} |
381 |
+ post{gres,master} |
382 |
+ ) |
383 |
+ for m in ${serverman[@]} ; do |
384 |
+ rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
385 |
+ done |
386 |
+ fi |
387 |
+ docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
388 |
+ |
389 |
+ # Create slot specific man pages |
390 |
+ local bn f mansec slotted_name |
391 |
+ for mansec in 1 3 7 ; do |
392 |
+ local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
393 |
+ |
394 |
+ mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
395 |
+ pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
396 |
+ |
397 |
+ for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
398 |
+ bn=$(basename "${f}") |
399 |
+ slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
400 |
+ case ${bn} in |
401 |
+ TABLE.7|WITH.7) |
402 |
+ echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
403 |
+ ;; |
404 |
+ *) |
405 |
+ echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
406 |
+ ;; |
407 |
+ esac |
408 |
+ done |
409 |
+ |
410 |
+ popd > /dev/null |
411 |
+ done |
412 |
+ |
413 |
+ insinto /etc/postgresql-${SLOT} |
414 |
+ newins src/bin/psql/psqlrc.sample psqlrc |
415 |
+ |
416 |
+ use static-libs || find "${ED}" -name '*.a' -delete |
417 |
+ |
418 |
+ local f bn |
419 |
+ for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
420 |
+ -mindepth 1 -maxdepth 1) |
421 |
+ do |
422 |
+ bn=$(basename "${f}") |
423 |
+ # Temporarily tack on tmp to workaround a file collision |
424 |
+ # issue. This is only necessary for 9.7 and earlier. 10 never |
425 |
+ # had this issue. |
426 |
+ dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
427 |
+ "/usr/bin/${bn}${SLOT/.}" |
428 |
+ done |
429 |
+ |
430 |
+ if use doc ; then |
431 |
+ docinto html |
432 |
+ dodoc doc/src/sgml/html/* |
433 |
+ fi |
434 |
+ |
435 |
+ if use server; then |
436 |
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
437 |
+ "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
438 |
+ |
439 |
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
440 |
+ "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
441 |
+ |
442 |
+ if use systemd; then |
443 |
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
444 |
+ "${FILESDIR}/${PN}.service-9.6-r1" | \ |
445 |
+ systemd_newunit - ${PN}-${SLOT}.service |
446 |
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
447 |
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
448 |
+ fi |
449 |
+ |
450 |
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
451 |
+ |
452 |
+ if use prefix ; then |
453 |
+ keepdir /run/postgresql |
454 |
+ fperms 1775 /run/postgresql |
455 |
+ fi |
456 |
+ fi |
457 |
+} |
458 |
+ |
459 |
+pkg_postinst() { |
460 |
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
461 |
+ postgresql-config update |
462 |
+ |
463 |
+ elog "If you need a global psqlrc-file, you can place it in:" |
464 |
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
465 |
+ |
466 |
+ if use server ; then |
467 |
+ elog |
468 |
+ elog "Gentoo specific documentation:" |
469 |
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
470 |
+ elog |
471 |
+ elog "Official documentation:" |
472 |
+ elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
473 |
+ elog |
474 |
+ elog "The default location of the Unix-domain socket is:" |
475 |
+ elog " ${EROOT%/}/run/postgresql/" |
476 |
+ elog |
477 |
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
478 |
+ elog "so that it contains your preferred locale in:" |
479 |
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
480 |
+ elog |
481 |
+ elog "Then, execute the following command to setup the initial database" |
482 |
+ elog "environment:" |
483 |
+ elog " emerge --config =${CATEGORY}/${PF}" |
484 |
+ fi |
485 |
+} |
486 |
+ |
487 |
+pkg_prerm() { |
488 |
+ if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
489 |
+ ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
490 |
+ ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
491 |
+ |
492 |
+ ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
493 |
+ sleep 10 |
494 |
+ eend 0 |
495 |
+ fi |
496 |
+} |
497 |
+ |
498 |
+pkg_postrm() { |
499 |
+ postgresql-config update |
500 |
+} |
501 |
+ |
502 |
+pkg_config() { |
503 |
+ use server || die "USE flag 'server' not enabled. Nothing to configure." |
504 |
+ |
505 |
+ [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
506 |
+ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
507 |
+ [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
508 |
+ [[ -z "${DATA_DIR}" ]] \ |
509 |
+ && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
510 |
+ |
511 |
+ # environment.bz2 may not contain the same locale as the current system |
512 |
+ # locale. Unset and source from the current system locale. |
513 |
+ if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
514 |
+ unset LANG |
515 |
+ unset LC_CTYPE |
516 |
+ unset LC_NUMERIC |
517 |
+ unset LC_TIME |
518 |
+ unset LC_COLLATE |
519 |
+ unset LC_MONETARY |
520 |
+ unset LC_MESSAGES |
521 |
+ unset LC_ALL |
522 |
+ source "${EROOT%/}/etc/env.d/02locale" |
523 |
+ [ -n "${LANG}" ] && export LANG |
524 |
+ [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
525 |
+ [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
526 |
+ [ -n "${LC_TIME}" ] && export LC_TIME |
527 |
+ [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
528 |
+ [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
529 |
+ [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
530 |
+ [ -n "${LC_ALL}" ] && export LC_ALL |
531 |
+ fi |
532 |
+ |
533 |
+ einfo "You can modify the paths and options passed to initdb by editing:" |
534 |
+ einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
535 |
+ einfo |
536 |
+ einfo "Information on options that can be passed to initdb are found at:" |
537 |
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
538 |
+ einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
539 |
+ einfo |
540 |
+ einfo "PG_INITDB_OPTS is currently set to:" |
541 |
+ if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
542 |
+ einfo " (none)" |
543 |
+ else |
544 |
+ einfo " ${PG_INITDB_OPTS}" |
545 |
+ fi |
546 |
+ einfo |
547 |
+ einfo "Configuration files will be installed to:" |
548 |
+ einfo " ${PGDATA}" |
549 |
+ einfo |
550 |
+ einfo "The database cluster will be created in:" |
551 |
+ einfo " ${DATA_DIR}" |
552 |
+ einfo |
553 |
+ |
554 |
+ ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
555 |
+ sleep 5 |
556 |
+ eend 0 |
557 |
+ |
558 |
+ if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
559 |
+ eerror "The given directory, '${DATA_DIR}', is not empty." |
560 |
+ eerror "Modify DATA_DIR to point to an empty directory." |
561 |
+ die "${DATA_DIR} is not empty." |
562 |
+ fi |
563 |
+ |
564 |
+ einfo "Creating the data directory ..." |
565 |
+ if [[ ${EUID} == 0 ]] ; then |
566 |
+ mkdir -p "${DATA_DIR}" |
567 |
+ chown -Rf postgres:postgres "${DATA_DIR}" |
568 |
+ chmod 0700 "${DATA_DIR}" |
569 |
+ fi |
570 |
+ |
571 |
+ einfo "Initializing the database ..." |
572 |
+ |
573 |
+ if [[ ${EUID} == 0 ]] ; then |
574 |
+ su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
575 |
+ else |
576 |
+ "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
577 |
+ fi |
578 |
+ |
579 |
+ if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
580 |
+ mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
581 |
+ ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
582 |
+ fi |
583 |
+ |
584 |
+ # unix_socket_directory has no effect in postgresql.conf as it's |
585 |
+ # overridden in the initscript |
586 |
+ sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
587 |
+ |
588 |
+ cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
589 |
+ # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
590 |
+ # On the off-chance that you might need to work with UTF-8 encoded |
591 |
+ # characters in PL/Perl |
592 |
+ plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
593 |
+ EOF |
594 |
+ |
595 |
+ einfo "The autovacuum function, which was in contrib, has been moved to the main" |
596 |
+ einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
597 |
+ einfo "by default. You can disable it in the cluster's:" |
598 |
+ einfo " ${PGDATA%/}/postgresql.conf" |
599 |
+ einfo |
600 |
+ if ! use systemd; then |
601 |
+ einfo "The PostgreSQL server, by default, will log events to:" |
602 |
+ einfo " ${DATA_DIR%/}/postmaster.log" |
603 |
+ einfo |
604 |
+ fi |
605 |
+ if use prefix ; then |
606 |
+ einfo "The location of the configuration files have moved to:" |
607 |
+ einfo " ${PGDATA}" |
608 |
+ einfo "To start the server:" |
609 |
+ einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
610 |
+ einfo "To stop:" |
611 |
+ einfo " pg_ctl stop -D ${DATA_DIR}" |
612 |
+ einfo |
613 |
+ einfo "Or move the configuration files back:" |
614 |
+ einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
615 |
+ elif use systemd; then |
616 |
+ einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
617 |
+ einfo "instead of 'pg_ctl'." |
618 |
+ else |
619 |
+ einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
620 |
+ einfo "instead of 'pg_ctl'." |
621 |
+ fi |
622 |
+} |
623 |
+ |
624 |
+src_test() { |
625 |
+ if use server && [[ ${UID} -ne 0 ]] ; then |
626 |
+ emake check |
627 |
+ |
628 |
+ einfo "If you think other tests besides the regression tests are necessary, please" |
629 |
+ einfo "submit a bug including a patch for this ebuild to enable them." |
630 |
+ else |
631 |
+ use server || \ |
632 |
+ ewarn 'Tests cannot be run without the "server" use flag enabled.' |
633 |
+ [[ ${UID} -eq 0 ]] || \ |
634 |
+ ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
635 |
+ |
636 |
+ ewarn 'Skipping.' |
637 |
+ fi |
638 |
+} |