Gentoo Archives: gentoo-commits

From: "Aaron W. Swenson" <titanofold@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/postgresql/
Date: Wed, 13 May 2020 11:37:43
Message-Id: 1589369848.2b5e26ac55a72ac909ee2d830e520d7604c3097e.titanofold@gentoo
1 commit: 2b5e26ac55a72ac909ee2d830e520d7604c3097e
2 Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 13 11:37:11 2020 +0000
4 Commit: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
5 CommitDate: Wed May 13 11:37:28 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b5e26ac
7
8 dev-db/postgresql: Cleanup old, insecure
9
10 Bug: https://bugs.gentoo.org/709708
11 Package-Manager: Portage-2.3.89, Repoman-2.3.20
12 Signed-off-by: Aaron W. Swenson <titanofold <AT> gentoo.org>
13
14 dev-db/postgresql/Manifest | 20 --
15 dev-db/postgresql/postgresql-10.10.ebuild | 465 ------------------------
16 dev-db/postgresql/postgresql-10.11.ebuild | 465 ------------------------
17 dev-db/postgresql/postgresql-10.9.ebuild | 465 ------------------------
18 dev-db/postgresql/postgresql-11.4.ebuild | 467 ------------------------
19 dev-db/postgresql/postgresql-11.5.ebuild | 467 ------------------------
20 dev-db/postgresql/postgresql-11.6.ebuild | 467 ------------------------
21 dev-db/postgresql/postgresql-12.0.ebuild | 467 ------------------------
22 dev-db/postgresql/postgresql-12.1.ebuild | 467 ------------------------
23 dev-db/postgresql/postgresql-9.4.22-r1.ebuild | 479 -------------------------
24 dev-db/postgresql/postgresql-9.4.22.ebuild | 474 -------------------------
25 dev-db/postgresql/postgresql-9.4.23.ebuild | 479 -------------------------
26 dev-db/postgresql/postgresql-9.4.24.ebuild | 479 -------------------------
27 dev-db/postgresql/postgresql-9.4.25.ebuild | 479 -------------------------
28 dev-db/postgresql/postgresql-9.5.17-r1.ebuild | 485 -------------------------
29 dev-db/postgresql/postgresql-9.5.17.ebuild | 480 -------------------------
30 dev-db/postgresql/postgresql-9.5.18.ebuild | 485 -------------------------
31 dev-db/postgresql/postgresql-9.5.19.ebuild | 485 -------------------------
32 dev-db/postgresql/postgresql-9.5.20.ebuild | 485 -------------------------
33 dev-db/postgresql/postgresql-9.6.13-r1.ebuild | 490 --------------------------
34 dev-db/postgresql/postgresql-9.6.13.ebuild | 485 -------------------------
35 dev-db/postgresql/postgresql-9.6.14.ebuild | 490 --------------------------
36 dev-db/postgresql/postgresql-9.6.15.ebuild | 490 --------------------------
37 dev-db/postgresql/postgresql-9.6.16.ebuild | 490 --------------------------
38 24 files changed, 11005 deletions(-)
39
40 diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
41 index afa06285713..c9a978cfe57 100644
42 --- a/dev-db/postgresql/Manifest
43 +++ b/dev-db/postgresql/Manifest
44 @@ -1,26 +1,6 @@
45 -DIST postgresql-10.10.tar.bz2 19012049 BLAKE2B 44ed5cfe2dc57ff3533faa1e921c981e0e437fe19adccc2ad87b939ec0c1bd5772ed8b0d6a7815dfc70c15149725250cb9431d58388fd3331a2bc2623b9959fb SHA512 60cafe4b27a194949aff482dcce4fa096a9916f37205868437a32afb8964df71934b619a0b891fe85eb7c7f9b11775cffbbedca589e78feb6c4184eb224b48bc
46 -DIST postgresql-10.11.tar.bz2 19017947 BLAKE2B 952d0fc76b665545eb512e0a6df6d2dafe0eaec4bdc774968d0a49dd6f6873b35a317ca6fd2bd74f36864d10f5a61e1920440e066522f982d0a7f1ce285143a9 SHA512 ce90b34e74d423b6db1f0e840b8e09579965c020fa2cfe3e567b604d3354d91e00a4347d559876be829aa89db44f84736e154495708ba9908f1d850446a1fc7b
47 DIST postgresql-10.12.tar.bz2 19020488 BLAKE2B 2177e9b63e21a634e1d8ea060b5bd0a7360d81ece64f50dd614e6cdd6b0cf0dcbd3896ef2c11bd1431ce7a964ac8876d24f368d7f7eb309e3d432856d7546f2a SHA512 6accc66cbbae811509095c33e8a8d17ddd11d9e307267312e3d09df90469db4700a5806166d66f25d77769d3ef88653c98dfc7d05dd053f10434b03e0a9e33b7
48 -DIST postgresql-10.9.tar.bz2 18981395 BLAKE2B ef2ac003b393ea7cbf24c45fac6b3dc69df2a8694a9e891d5a68f7310d63fb816649d16a7351d03b63a4eb2256703efcab616a0146324478335267c39f3b9829 SHA512 4e2f30a0fd262f2e3ce5fc836425be635326600cd6cd4e117c57f59ea7ab2e9ea463a8d357fe7adb8c0dd0094e43d08efc2a137f8f9975715a5908e35920f98e
49 -DIST postgresql-11.4.tar.bz2 19759635 BLAKE2B a3f35df40d31dce52073eeacf4e16bc7ccb487dc0a6e15b84d087f04fd130b66b1168ece3edc63927c377ca1044b54ccb3db5fb9b4a5c86a5b0e179a6678c73c SHA512 159fb84134e05ddc58e40a879ca52ed4d58ced7bcd1e7310d59bda84f9055339a31a92cfaab2c063a88685f7417b9a828534394bf9a2477fc33d1fb6cd26186b
50 -DIST postgresql-11.5.tar.bz2 19773087 BLAKE2B 32dca67ddfe2f6a6801a5d82a25fe7df0cc2dd89c35eee87a57ebe6391b8d7d4bccc59d6cac3e821ad76731ab319e3303f2fcbce9ee8cda1cfef13b2185c0ab1 SHA512 537148079dc6c33cfb9bf9722171e524707b42ef01369deb968d0d6e8fa9b7f16f6ce67139d9dc45fb7385defbf56aa2c0affe5ee9d76e996f31e47486192141
51 -DIST postgresql-11.6.tar.bz2 19843202 BLAKE2B 379953e0a0abb5a5abb109370cf2b95979321524031fe754c0a5a2cde636b2fdafa1da9c9ee84638a884cec3a312607f8ac7da6b1817c3b700a44c3025fd1944 SHA512 de6833c0df8dbac7bc498ac573dc4c3645070d9bbdd6b5d89db3ef41e86e7fc19d5e6450aa46ee2a1392d86c33acf6b9364b2863caac49f45351a46647feecbd
52 DIST postgresql-11.7.tar.bz2 19890063 BLAKE2B 461c372567ff0b4ff4da52889be5d2822b56889e4890b33c9a71f1105ad629b4f5bec95c4fbf5aebbdd4445e0ff451a7d8df04ae7b5bf7cf0075c3226a41b19b SHA512 32c7ace228f9895241ce0d925fbfc60c0cd39f4cd35368fb10dc7db046151ffd59a9895b4c30a529627f0103051e84b4992ed60312cccd292489f3037076ca1e
53 -DIST postgresql-12.0.tar.bz2 20177458 BLAKE2B 614222e43519a83044587981cb04ab7e437357d5b2784068d425aaeb67df54f44aef4aaaf780bd3f83f012c0fc8f41723bc83b6e44e7bf2707857c491b8d129b SHA512 231a0b5c181c33cb01c3f39de1802319b79eceec6997935ab8605dea1f4583a52d0d16e5a70fcdeea313462f062503361d543433ee03d858ba332c72a665f696
54 -DIST postgresql-12.1.tar.bz2 20213711 BLAKE2B 670e33c23a14527aedb694647ff2d2670df159352ef10c11e5895aafffaa752bd49ee7b1991262f4c7548dc8c617e06f651c6098a676b4462ed06e3982d0f5fa SHA512 f45b1762fd60b6f7419305d108b7fc521e3a7afa833d3aacccba814465baf40d19f57ff9bf2909d726c4c94a1cd99a39f1aa8e45fd0364cdedbcbed36ff48caf
55 DIST postgresql-12.2.tar.bz2 20363545 BLAKE2B 7b0cfe841d46b117ff5dd793be5537e916f92255eb0d000681ed62c497eef34c5d1261126be408f2b7f95274485e2787869cd4063461ab248b650c168b62548d SHA512 0e0ce8e21856e8f43e58b840c10c4e3ffae6d5207e0d778e9176e36f8e20e34633cbb06f0030a7c963c3491bb7e941456d91b55444c561cfc6f283fba76f33ee
56 -DIST postgresql-9.4.22.tar.bz2 16848787 BLAKE2B 5c2aaef13ef0cf33c421e6839877a8e4e1fc5dbe41d9cabefddd369925869f92f6c6b8a124b5778f9b25359103f0a7ada1eddcaf4bac498709f563928f25e7e3 SHA512 f11623a89b2320616fd53eda52da544bdfcb63bff08cb78fccde134ef628eee7ee90b3de6952f4e08c10297d356624faabf0e5b181b0105f51797796cd04efef
57 -DIST postgresql-9.4.23.tar.bz2 16848808 BLAKE2B fd747fb3f6f540190ecbd53116ef7b8b812d05f5968e32c9d09c5902239eaf073281262dba9836514344303a3c894f48c617e050ce713be7c09f53ee49c7b3cd SHA512 b1eb392b939ac8369c76e4ecc142c78f380afc498b60ec0ea97acb16c21ffa5c11a24c2c46463032865955b7c531492c08feb6ef1efc46a549369f026594ea61
58 -DIST postgresql-9.4.24.tar.bz2 16842941 BLAKE2B 999a33addd493d1169ba3222a269fea827f4ed866453727bf9545d6a8873943d56b8e71773daf0f116150dc557afaf2e80dc570e8f351ba64b196ae8bcd8fbc9 SHA512 8e7b4da8a5cf48cf4d98cce117614f7ab594087d0002f996c1fedc2a38af6eaa663ad3ce67ced6d6b0fd6d0b00aee932025bf50a4314933ba535716577e9393f
59 -DIST postgresql-9.4.25.tar.bz2 16849015 BLAKE2B 1d843fe29cdb122515f2bded8a04489772f7c40aa54774a454fe0815cc1c6306b42ff3115e1dfb7dc93b483d62611f1e773436c1370462326678f78bc25f3827 SHA512 be45c47a17788be40a2beca058b5dcbf1ded985838d1c85229fbece174fca222d5ac07025c764d40c92f823d6bf784975a25b79a545b903434be8bcd24efb9a0
60 DIST postgresql-9.4.26.tar.bz2 16871195 BLAKE2B f26fd335293669a815a51ceb994b66e154c66f96f91e4c68d7df3490ad25f4b0366ebf7bfe2b209ff34965ea27a08562ace050f40d49cec94eb576d7a1becd1c SHA512 7d379d139c7b2bdac1df38743cbb46a1790a8d5174e8cf1141b7b4febcbc8f612e347bf4d355684eef24dfc73bb2796f85fc532908f26ba7195c685f198cbb72
61 -DIST postgresql-9.5.17.tar.bz2 17563469 BLAKE2B d40b7f95d03db594144b4882f36bbe22f348faab0b8d67eda3f946448bb0e09188eccdeb4d1c92742fb29a920b30ede55e536a863b22d2009283eab66679122d SHA512 bb468528b1f18166cda0be136f31a632859ffe6e6800233b1cb0e91ce11d2d00d3dc108a74580b5552a4d30b9f1b6849c91576cd497beac788c429815c66eac5
62 -DIST postgresql-9.5.18.tar.bz2 17570161 BLAKE2B aee7e4570f2571e507fd972e86d3a6a9243d8fd33c356305998a8dce461bc9b06b45e1ff4267a9eb47f58a793c0b70bce0babfc0dce939cb34b1436a55a5d9fd SHA512 0487ac2891c800de045135d4b153659ec10c28750a09e0b87343f8e7145a11f1783ed0b6ca60829776faae1430c8050cc7661c780f171f1b2621f1673a32e6d1
63 -DIST postgresql-9.5.19.tar.bz2 17571998 BLAKE2B 24bd617ecef4d0add443d20ea3528eb8d48d83f31a3eaf726213c98211418efd2f35d846964049284332c9d20228308c7441cb3e8ee35f0188d060fc75239788 SHA512 46de40e49910311bf5291e1ece421ab9628641b18bf84cd1cb8093a584dd0358e3b6d2b086f82e9b06ce699a6e38018c3515ea591355078392e8d3d2fe4a7c64
64 -DIST postgresql-9.5.20.tar.bz2 17610134 BLAKE2B 26400eb8906186c3d1bb2ee1a16248540ed11d61445caf9d657dd47faabc2df8116ffa02727152d37bf88ac10f935887dc449bc421c605fa107bd5a24f38c3d5 SHA512 75558d05f6bee6fad65ad0b4dcb428b50bcf003c4fbd878747010988958464d7119dd8121a8817c3cad83c20bcae6cd550fc01fbca39f54e670d93fc70688bea
65 DIST postgresql-9.5.21.tar.bz2 17640928 BLAKE2B 8ffcf0befc331317a32d63d3cdfe44f7743f72f18b4bc46bee5ee80f8c489b4b1ef26abc8219f277acc922657fc21e3dc31f3fc9838621f44d95cc9405fca43b SHA512 8527356ee3b4f151c832aef50a8b96e923e0a6c77e5fe6ad597f50527f9d084a8feab7bede8fdbe29aab44383577d3f86e5286fb34e2d2b696cde34bd922e69d
66 -DIST postgresql-9.6.13.tar.bz2 18767279 BLAKE2B c1ec780a7f938f878425cbd6556145e60a613135129daaacc52e9a699cc448a22481b01fac20d0c09373ea6a026f39bc58234aae4f1126333b94f621981a8135 SHA512 65cc70410ad4a1a738b92855b92eecdbb9efbbca0eb9a45a138d47b696c8f9c9cd19073fbfdf5c80eea7633d0be29b4ed8acbadd38724acf8f18c90bb30f9b26
67 -DIST postgresql-9.6.14.tar.bz2 18787744 BLAKE2B be5a0d90fe1cd5ea682d8446e512271175f705bc49514215535d7aa4b631669846c0bd6167f985028c07dc5d6d394a1ea809028c5a5e15a5f010e85c2bede8cf SHA512 dccc183a6992ef4ece4ef5c638339708ab484e571ecd66ed993c9071cd55f250b4277fd3367f9a5ee545aa83e29dc5f7a239200e200e3314d5acc847f35e790c
68 -DIST postgresql-9.6.15.tar.bz2 18799121 BLAKE2B 5dee0fac7592cecf4412deaef54cedbd86eb6081fc268b6ef8a5f01c31af930747749fb54a77d766e1d6ef705bab5d550a7bace25c86d201f25ed69163d920fc SHA512 cc35a059bf59ea3487c17a8432b791ca2a19afaa24b07403a8d33904b3a97ebe601e3036ca8ec766c54cb87a7def7d4618a425a4446e6832391185d7c71117db
69 -DIST postgresql-9.6.16.tar.bz2 18806372 BLAKE2B f5d7287264b05ab6bd157adf05d78597c7e7281ef40d4616ad66f2434a686c68845ad21883bcc97f6ea299a785109e1541d6c75e40ba383d80e9703331d9c624 SHA512 7083d670883b203946f68bcf1216dd1cbd904220b4c95e25855f9a8904334fd7e87509c905f589398ad7b165869b75288c2e4f49b14263ce4891347ecd4485b4
70 DIST postgresql-9.6.17.tar.bz2 18812282 BLAKE2B 0bb48445201aae1d6b4f5a77652aefaaa629799a019c3b81a14e554a88167530002931c2b0d658731b26a38bd09487f79a6ef514b0955982d6037b383c021819 SHA512 a76f328523517f664e4fc59a4d27e476bc6300e49370712030caae40aa160acb1e6aecc7cd3b3440125713069932df812eb8d75377a3df63e59c9292419c2aa8
71
72 diff --git a/dev-db/postgresql/postgresql-10.10.ebuild b/dev-db/postgresql/postgresql-10.10.ebuild
73 deleted file mode 100644
74 index 2153cb49c70..00000000000
75 --- a/dev-db/postgresql/postgresql-10.10.ebuild
76 +++ /dev/null
77 @@ -1,465 +0,0 @@
78 -# Copyright 1999-2020 Gentoo Authors
79 -# Distributed under the terms of the GNU General Public License v2
80 -
81 -EAPI=7
82 -
83 -PYTHON_COMPAT=( python3_{6,7} )
84 -
85 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
86 - zh_TW"
87 -
88 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
89 - systemd user
90 -
91 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris"
92 -
93 -SLOT=$(ver_cut 1)
94 -
95 -MY_PV=${PV/_/}
96 -S="${WORKDIR}/${PN}-${MY_PV}"
97 -
98 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
99 -
100 -LICENSE="POSTGRESQL GPL-2"
101 -DESCRIPTION="PostgreSQL RDBMS"
102 -HOMEPAGE="https://www.postgresql.org/"
103 -
104 -IUSE="debug doc icu kerberos kernel_linux ldap libressl nls pam perl
105 - python +readline selinux +server systemd ssl static-libs tcl
106 - threads uuid xml zlib"
107 -
108 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
109 -
110 -CDEPEND="
111 ->=app-eselect/eselect-postgresql-2.0
112 -sys-apps/less
113 -virtual/libintl
114 -icu? ( dev-libs/icu:= )
115 -kerberos? ( virtual/krb5 )
116 -ldap? ( net-nds/openldap )
117 -pam? ( sys-libs/pam )
118 -perl? ( >=dev-lang/perl-5.8:= )
119 -python? ( ${PYTHON_DEPS} )
120 -readline? ( sys-libs/readline:0= )
121 -server? ( systemd? ( sys-apps/systemd ) )
122 -ssl? (
123 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
124 - libressl? ( dev-libs/libressl:= )
125 -)
126 -tcl? ( >=dev-lang/tcl-8:0= )
127 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
128 -zlib? ( sys-libs/zlib )
129 -"
130 -
131 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
132 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
133 -# the libc includes UUID functions.
134 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
135 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
136 -
137 -nest_usedep() {
138 - local front back
139 - while [[ ${#} -gt 1 ]]; do
140 - front+="${1}? ( "
141 - back+=" )"
142 - shift
143 - done
144 - echo "${front}${1}${back}"
145 -}
146 -
147 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
148 -CDEPEND+="
149 -uuid? (
150 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
151 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
152 -)"
153 -
154 -DEPEND="${CDEPEND}
155 -!!<sys-apps/sandbox-2.0
156 -sys-devel/bison
157 -sys-devel/flex
158 -nls? ( sys-devel/gettext )
159 -xml? ( virtual/pkgconfig )
160 -"
161 -
162 -RDEPEND="${CDEPEND}
163 -!dev-db/postgresql-docs:${SLOT}
164 -!dev-db/postgresql-base:${SLOT}
165 -!dev-db/postgresql-server:${SLOT}
166 -selinux? ( sec-policy/selinux-postgresql )
167 -"
168 -
169 -pkg_setup() {
170 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
171 -
172 - enewgroup postgres 70
173 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
174 -
175 - use python && python-single-r1_pkg_setup
176 -}
177 -
178 -src_prepare() {
179 - # Work around PPC{,64} compilation bug where bool is already defined
180 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
181 -
182 - # Set proper run directory
183 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
184 - -i src/include/pg_config_manual.h || die
185 -
186 - # Rely on $PATH being in the proper order so that the correct
187 - # install program is used for modules utilizing PGXS in both
188 - # hardened and non-hardened environments. (Bug #528786)
189 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
190 -
191 - use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch"
192 -
193 - if use pam ; then
194 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
195 - -i src/backend/libpq/auth.c || \
196 - die 'PGSQL_PAM_SERVICE rename failed.'
197 - fi
198 -
199 - eapply_user
200 -}
201 -
202 -src_configure() {
203 - case ${CHOST} in
204 - *-darwin*|*-solaris*)
205 - use nls && append-libs intl
206 - ;;
207 - esac
208 -
209 - export LDFLAGS_SL="${LDFLAGS}"
210 - export LDFLAGS_EX="${LDFLAGS}"
211 -
212 - local PO="${EPREFIX}"
213 -
214 - local i uuid_config=""
215 - if use uuid; then
216 - for i in ${UTIL_LINUX_LIBC[@]}; do
217 - use ${i} && uuid_config="--with-uuid=e2fs"
218 - done
219 - for i in ${BSD_LIBC[@]}; do
220 - use ${i} && uuid_config="--with-uuid=bsd"
221 - done
222 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
223 - fi
224 -
225 - econf \
226 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
227 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
228 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
229 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
230 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
231 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
232 - $(use_enable !alpha spinlocks) \
233 - $(use_enable debug) \
234 - $(use_enable threads thread-safety) \
235 - $(use_with icu) \
236 - $(use_with kerberos gssapi) \
237 - $(use_with ldap) \
238 - $(use_with pam) \
239 - $(use_with perl) \
240 - $(use_with python) \
241 - $(use_with readline) \
242 - $(use_with ssl openssl) \
243 - $(usex server "$(use_with systemd)" '--without-systemd') \
244 - $(use_with tcl) \
245 - ${uuid_config} \
246 - $(use_with xml libxml) \
247 - $(use_with xml libxslt) \
248 - $(use_with zlib) \
249 - $(use_enable nls nls "'$(l10n_get_locales)'")
250 -}
251 -
252 -src_compile() {
253 - emake
254 - emake -C contrib
255 -}
256 -
257 -src_install() {
258 - emake DESTDIR="${D}" install
259 - emake DESTDIR="${D}" install -C contrib
260 -
261 - dodoc README HISTORY doc/{TODO,bug.template}
262 -
263 - # man pages are already built, but if we have the target make them,
264 - # they'll be generated from source before being installed so we
265 - # manually install man pages.
266 - # We use ${SLOT} instead of doman for postgresql.eselect
267 - insinto /usr/share/postgresql-${SLOT}/man/
268 - doins -r doc/src/sgml/man{1,3,7}
269 - if ! use server; then
270 - # Remove man pages for non-existent binaries
271 - serverman=(
272 - initdb
273 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
274 - pg_{test_{fsync,timing},upgrade,waldump}
275 - post{gres,master}
276 - )
277 - for m in ${serverman[@]} ; do
278 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
279 - done
280 - fi
281 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
282 -
283 - # Create slot specific man pages
284 - local bn f mansec slotted_name
285 - for mansec in 1 3 7 ; do
286 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
287 -
288 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
289 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
290 -
291 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
292 - bn=$(basename "${f}")
293 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
294 - case ${bn} in
295 - TABLE.7|WITH.7)
296 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
297 - ;;
298 - *)
299 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
300 - ;;
301 - esac
302 - done
303 -
304 - popd > /dev/null
305 - done
306 -
307 - insinto /etc/postgresql-${SLOT}
308 - newins src/bin/psql/psqlrc.sample psqlrc
309 -
310 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
311 - # needed by extensions utilizing PGXS.
312 - use static-libs || \
313 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
314 - -delete
315 -
316 - # Make slot specific links to programs
317 - local f bn
318 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
319 - -mindepth 1 -maxdepth 1)
320 - do
321 - bn=$(basename "${f}")
322 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
323 - "/usr/bin/${bn}${SLOT/.}"
324 - done
325 -
326 - if use doc ; then
327 - docinto html
328 - dodoc doc/src/sgml/html/*
329 - fi
330 -
331 - if use server; then
332 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
333 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
334 -
335 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
336 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
337 -
338 - if use systemd; then
339 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
340 - "${FILESDIR}/${PN}.service-9.6-r1" | \
341 - systemd_newunit - ${PN}-${SLOT}.service
342 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
343 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
344 - fi
345 -
346 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
347 -
348 - if use prefix ; then
349 - keepdir /run/postgresql
350 - fperms 1775 /run/postgresql
351 - fi
352 - fi
353 -}
354 -
355 -pkg_postinst() {
356 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
357 - postgresql-config update
358 -
359 - elog "If you need a global psqlrc-file, you can place it in:"
360 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
361 -
362 - if use server ; then
363 - elog
364 - elog "Gentoo specific documentation:"
365 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
366 - elog
367 - elog "Official documentation:"
368 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
369 - elog
370 - elog "The default location of the Unix-domain socket is:"
371 - elog " ${EROOT}/run/postgresql/"
372 - elog
373 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
374 - elog "so that it contains your preferred locale in:"
375 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
376 - elog
377 - elog "Then, execute the following command to setup the initial database"
378 - elog "environment:"
379 - elog " emerge --config =${CATEGORY}/${PF}"
380 -
381 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
382 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
383 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
384 - ewarn "the following command after upgrading:"
385 - ewarn
386 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
387 - fi
388 - fi
389 -}
390 -
391 -pkg_prerm() {
392 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
393 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
394 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
395 -
396 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
397 - sleep 10
398 - eend 0
399 - fi
400 -}
401 -
402 -pkg_postrm() {
403 - postgresql-config update
404 -}
405 -
406 -pkg_config() {
407 - use server || die "USE flag 'server' not enabled. Nothing to configure."
408 -
409 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
410 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
411 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
412 - [[ -z "${DATA_DIR}" ]] \
413 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
414 -
415 - # environment.bz2 may not contain the same locale as the current system
416 - # locale. Unset and source from the current system locale.
417 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
418 - unset LANG
419 - unset LC_CTYPE
420 - unset LC_NUMERIC
421 - unset LC_TIME
422 - unset LC_COLLATE
423 - unset LC_MONETARY
424 - unset LC_MESSAGES
425 - unset LC_ALL
426 - source "${EROOT}/etc/env.d/02locale"
427 - [ -n "${LANG}" ] && export LANG
428 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
429 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
430 - [ -n "${LC_TIME}" ] && export LC_TIME
431 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
432 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
433 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
434 - [ -n "${LC_ALL}" ] && export LC_ALL
435 - fi
436 -
437 - einfo "You can modify the paths and options passed to initdb by editing:"
438 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
439 - einfo
440 - einfo "Information on options that can be passed to initdb are found at:"
441 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
442 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
443 - einfo
444 - einfo "PG_INITDB_OPTS is currently set to:"
445 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
446 - einfo " (none)"
447 - else
448 - einfo " ${PG_INITDB_OPTS}"
449 - fi
450 - einfo
451 - einfo "Configuration files will be installed to:"
452 - einfo " ${PGDATA}"
453 - einfo
454 - einfo "The database cluster will be created in:"
455 - einfo " ${DATA_DIR}"
456 - einfo
457 -
458 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
459 - sleep 5
460 - eend 0
461 -
462 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
463 - eerror "The given directory, '${DATA_DIR}', is not empty."
464 - eerror "Modify DATA_DIR to point to an empty directory."
465 - die "${DATA_DIR} is not empty."
466 - fi
467 -
468 - einfo "Creating the data directory ..."
469 - if [[ ${EUID} == 0 ]] ; then
470 - mkdir -p "${DATA_DIR}"
471 - chown -Rf postgres:postgres "${DATA_DIR}"
472 - chmod 0700 "${DATA_DIR}"
473 - fi
474 -
475 - einfo "Initializing the database ..."
476 -
477 - if [[ ${EUID} == 0 ]] ; then
478 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
479 - else
480 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
481 - fi
482 -
483 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
484 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
485 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
486 - fi
487 -
488 - # unix_socket_directory has no effect in postgresql.conf as it's
489 - # overridden in the initscript
490 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
491 -
492 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
493 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
494 - # On the off-chance that you might need to work with UTF-8 encoded
495 - # characters in PL/Perl
496 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
497 - EOF
498 -
499 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
500 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
501 - einfo "by default. You can disable it in the cluster's:"
502 - einfo " ${PGDATA%/}/postgresql.conf"
503 - einfo
504 - if ! use systemd; then
505 - einfo "The PostgreSQL server, by default, will log events to:"
506 - einfo " ${DATA_DIR%/}/postmaster.log"
507 - einfo
508 - fi
509 - if use prefix ; then
510 - einfo "The location of the configuration files have moved to:"
511 - einfo " ${PGDATA}"
512 - einfo "To start the server:"
513 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
514 - einfo "To stop:"
515 - einfo " pg_ctl stop -D ${DATA_DIR}"
516 - einfo
517 - einfo "Or move the configuration files back:"
518 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
519 - elif use systemd; then
520 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
521 - einfo "instead of 'pg_ctl'."
522 - else
523 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
524 - einfo "instead of 'pg_ctl'."
525 - fi
526 -}
527 -
528 -src_test() {
529 - if use server && [[ ${UID} -ne 0 ]] ; then
530 - emake check
531 -
532 - einfo "If you think other tests besides the regression tests are necessary, please"
533 - einfo "submit a bug including a patch for this ebuild to enable them."
534 - else
535 - use server || \
536 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
537 - [[ ${UID} -eq 0 ]] || \
538 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
539 -
540 - ewarn 'Skipping.'
541 - fi
542 -}
543
544 diff --git a/dev-db/postgresql/postgresql-10.11.ebuild b/dev-db/postgresql/postgresql-10.11.ebuild
545 deleted file mode 100644
546 index 3f23e213da8..00000000000
547 --- a/dev-db/postgresql/postgresql-10.11.ebuild
548 +++ /dev/null
549 @@ -1,465 +0,0 @@
550 -# Copyright 1999-2020 Gentoo Authors
551 -# Distributed under the terms of the GNU General Public License v2
552 -
553 -EAPI=7
554 -
555 -PYTHON_COMPAT=( python3_{6,7} )
556 -
557 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
558 - zh_TW"
559 -
560 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
561 - systemd user
562 -
563 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
564 -
565 -SLOT=$(ver_cut 1)
566 -
567 -MY_PV=${PV/_/}
568 -S="${WORKDIR}/${PN}-${MY_PV}"
569 -
570 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
571 -
572 -LICENSE="POSTGRESQL GPL-2"
573 -DESCRIPTION="PostgreSQL RDBMS"
574 -HOMEPAGE="https://www.postgresql.org/"
575 -
576 -IUSE="debug doc icu kerberos kernel_linux ldap libressl nls pam perl
577 - python +readline selinux +server systemd ssl static-libs tcl
578 - threads uuid xml zlib"
579 -
580 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
581 -
582 -CDEPEND="
583 ->=app-eselect/eselect-postgresql-2.0
584 -sys-apps/less
585 -virtual/libintl
586 -icu? ( dev-libs/icu:= )
587 -kerberos? ( virtual/krb5 )
588 -ldap? ( net-nds/openldap )
589 -pam? ( sys-libs/pam )
590 -perl? ( >=dev-lang/perl-5.8:= )
591 -python? ( ${PYTHON_DEPS} )
592 -readline? ( sys-libs/readline:0= )
593 -server? ( systemd? ( sys-apps/systemd ) )
594 -ssl? (
595 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
596 - libressl? ( dev-libs/libressl:= )
597 -)
598 -tcl? ( >=dev-lang/tcl-8:0= )
599 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
600 -zlib? ( sys-libs/zlib )
601 -"
602 -
603 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
604 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
605 -# the libc includes UUID functions.
606 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
607 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
608 -
609 -nest_usedep() {
610 - local front back
611 - while [[ ${#} -gt 1 ]]; do
612 - front+="${1}? ( "
613 - back+=" )"
614 - shift
615 - done
616 - echo "${front}${1}${back}"
617 -}
618 -
619 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
620 -CDEPEND+="
621 -uuid? (
622 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
623 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
624 -)"
625 -
626 -DEPEND="${CDEPEND}
627 -!!<sys-apps/sandbox-2.0
628 -sys-devel/bison
629 -sys-devel/flex
630 -nls? ( sys-devel/gettext )
631 -xml? ( virtual/pkgconfig )
632 -"
633 -
634 -RDEPEND="${CDEPEND}
635 -!dev-db/postgresql-docs:${SLOT}
636 -!dev-db/postgresql-base:${SLOT}
637 -!dev-db/postgresql-server:${SLOT}
638 -selinux? ( sec-policy/selinux-postgresql )
639 -"
640 -
641 -pkg_setup() {
642 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
643 -
644 - enewgroup postgres 70
645 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
646 -
647 - use python && python-single-r1_pkg_setup
648 -}
649 -
650 -src_prepare() {
651 - # Work around PPC{,64} compilation bug where bool is already defined
652 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
653 -
654 - # Set proper run directory
655 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
656 - -i src/include/pg_config_manual.h || die
657 -
658 - # Rely on $PATH being in the proper order so that the correct
659 - # install program is used for modules utilizing PGXS in both
660 - # hardened and non-hardened environments. (Bug #528786)
661 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
662 -
663 - use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch"
664 -
665 - if use pam ; then
666 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
667 - -i src/backend/libpq/auth.c || \
668 - die 'PGSQL_PAM_SERVICE rename failed.'
669 - fi
670 -
671 - eapply_user
672 -}
673 -
674 -src_configure() {
675 - case ${CHOST} in
676 - *-darwin*|*-solaris*)
677 - use nls && append-libs intl
678 - ;;
679 - esac
680 -
681 - export LDFLAGS_SL="${LDFLAGS}"
682 - export LDFLAGS_EX="${LDFLAGS}"
683 -
684 - local PO="${EPREFIX}"
685 -
686 - local i uuid_config=""
687 - if use uuid; then
688 - for i in ${UTIL_LINUX_LIBC[@]}; do
689 - use ${i} && uuid_config="--with-uuid=e2fs"
690 - done
691 - for i in ${BSD_LIBC[@]}; do
692 - use ${i} && uuid_config="--with-uuid=bsd"
693 - done
694 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
695 - fi
696 -
697 - econf \
698 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
699 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
700 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
701 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
702 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
703 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
704 - $(use_enable !alpha spinlocks) \
705 - $(use_enable debug) \
706 - $(use_enable threads thread-safety) \
707 - $(use_with icu) \
708 - $(use_with kerberos gssapi) \
709 - $(use_with ldap) \
710 - $(use_with pam) \
711 - $(use_with perl) \
712 - $(use_with python) \
713 - $(use_with readline) \
714 - $(use_with ssl openssl) \
715 - $(usex server "$(use_with systemd)" '--without-systemd') \
716 - $(use_with tcl) \
717 - ${uuid_config} \
718 - $(use_with xml libxml) \
719 - $(use_with xml libxslt) \
720 - $(use_with zlib) \
721 - $(use_enable nls nls "'$(l10n_get_locales)'")
722 -}
723 -
724 -src_compile() {
725 - emake
726 - emake -C contrib
727 -}
728 -
729 -src_install() {
730 - emake DESTDIR="${D}" install
731 - emake DESTDIR="${D}" install -C contrib
732 -
733 - dodoc README HISTORY doc/{TODO,bug.template}
734 -
735 - # man pages are already built, but if we have the target make them,
736 - # they'll be generated from source before being installed so we
737 - # manually install man pages.
738 - # We use ${SLOT} instead of doman for postgresql.eselect
739 - insinto /usr/share/postgresql-${SLOT}/man/
740 - doins -r doc/src/sgml/man{1,3,7}
741 - if ! use server; then
742 - # Remove man pages for non-existent binaries
743 - serverman=(
744 - initdb
745 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
746 - pg_{test_{fsync,timing},upgrade,waldump}
747 - post{gres,master}
748 - )
749 - for m in ${serverman[@]} ; do
750 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
751 - done
752 - fi
753 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
754 -
755 - # Create slot specific man pages
756 - local bn f mansec slotted_name
757 - for mansec in 1 3 7 ; do
758 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
759 -
760 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
761 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
762 -
763 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
764 - bn=$(basename "${f}")
765 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
766 - case ${bn} in
767 - TABLE.7|WITH.7)
768 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
769 - ;;
770 - *)
771 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
772 - ;;
773 - esac
774 - done
775 -
776 - popd > /dev/null
777 - done
778 -
779 - insinto /etc/postgresql-${SLOT}
780 - newins src/bin/psql/psqlrc.sample psqlrc
781 -
782 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
783 - # needed by extensions utilizing PGXS.
784 - use static-libs || \
785 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
786 - -delete
787 -
788 - # Make slot specific links to programs
789 - local f bn
790 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
791 - -mindepth 1 -maxdepth 1)
792 - do
793 - bn=$(basename "${f}")
794 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
795 - "/usr/bin/${bn}${SLOT/.}"
796 - done
797 -
798 - if use doc ; then
799 - docinto html
800 - dodoc doc/src/sgml/html/*
801 - fi
802 -
803 - if use server; then
804 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
805 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
806 -
807 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
808 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
809 -
810 - if use systemd; then
811 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
812 - "${FILESDIR}/${PN}.service-9.6-r1" | \
813 - systemd_newunit - ${PN}-${SLOT}.service
814 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
815 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
816 - fi
817 -
818 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
819 -
820 - if use prefix ; then
821 - keepdir /run/postgresql
822 - fperms 1775 /run/postgresql
823 - fi
824 - fi
825 -}
826 -
827 -pkg_postinst() {
828 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
829 - postgresql-config update
830 -
831 - elog "If you need a global psqlrc-file, you can place it in:"
832 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
833 -
834 - if use server ; then
835 - elog
836 - elog "Gentoo specific documentation:"
837 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
838 - elog
839 - elog "Official documentation:"
840 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
841 - elog
842 - elog "The default location of the Unix-domain socket is:"
843 - elog " ${EROOT}/run/postgresql/"
844 - elog
845 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
846 - elog "so that it contains your preferred locale in:"
847 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
848 - elog
849 - elog "Then, execute the following command to setup the initial database"
850 - elog "environment:"
851 - elog " emerge --config =${CATEGORY}/${PF}"
852 -
853 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
854 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
855 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
856 - ewarn "the following command after upgrading:"
857 - ewarn
858 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
859 - fi
860 - fi
861 -}
862 -
863 -pkg_prerm() {
864 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
865 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
866 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
867 -
868 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
869 - sleep 10
870 - eend 0
871 - fi
872 -}
873 -
874 -pkg_postrm() {
875 - postgresql-config update
876 -}
877 -
878 -pkg_config() {
879 - use server || die "USE flag 'server' not enabled. Nothing to configure."
880 -
881 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
882 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
883 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
884 - [[ -z "${DATA_DIR}" ]] \
885 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
886 -
887 - # environment.bz2 may not contain the same locale as the current system
888 - # locale. Unset and source from the current system locale.
889 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
890 - unset LANG
891 - unset LC_CTYPE
892 - unset LC_NUMERIC
893 - unset LC_TIME
894 - unset LC_COLLATE
895 - unset LC_MONETARY
896 - unset LC_MESSAGES
897 - unset LC_ALL
898 - source "${EROOT}/etc/env.d/02locale"
899 - [ -n "${LANG}" ] && export LANG
900 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
901 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
902 - [ -n "${LC_TIME}" ] && export LC_TIME
903 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
904 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
905 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
906 - [ -n "${LC_ALL}" ] && export LC_ALL
907 - fi
908 -
909 - einfo "You can modify the paths and options passed to initdb by editing:"
910 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
911 - einfo
912 - einfo "Information on options that can be passed to initdb are found at:"
913 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
914 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
915 - einfo
916 - einfo "PG_INITDB_OPTS is currently set to:"
917 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
918 - einfo " (none)"
919 - else
920 - einfo " ${PG_INITDB_OPTS}"
921 - fi
922 - einfo
923 - einfo "Configuration files will be installed to:"
924 - einfo " ${PGDATA}"
925 - einfo
926 - einfo "The database cluster will be created in:"
927 - einfo " ${DATA_DIR}"
928 - einfo
929 -
930 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
931 - sleep 5
932 - eend 0
933 -
934 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
935 - eerror "The given directory, '${DATA_DIR}', is not empty."
936 - eerror "Modify DATA_DIR to point to an empty directory."
937 - die "${DATA_DIR} is not empty."
938 - fi
939 -
940 - einfo "Creating the data directory ..."
941 - if [[ ${EUID} == 0 ]] ; then
942 - mkdir -p "${DATA_DIR}"
943 - chown -Rf postgres:postgres "${DATA_DIR}"
944 - chmod 0700 "${DATA_DIR}"
945 - fi
946 -
947 - einfo "Initializing the database ..."
948 -
949 - if [[ ${EUID} == 0 ]] ; then
950 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
951 - else
952 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
953 - fi
954 -
955 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
956 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
957 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
958 - fi
959 -
960 - # unix_socket_directory has no effect in postgresql.conf as it's
961 - # overridden in the initscript
962 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
963 -
964 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
965 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
966 - # On the off-chance that you might need to work with UTF-8 encoded
967 - # characters in PL/Perl
968 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
969 - EOF
970 -
971 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
972 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
973 - einfo "by default. You can disable it in the cluster's:"
974 - einfo " ${PGDATA%/}/postgresql.conf"
975 - einfo
976 - if ! use systemd; then
977 - einfo "The PostgreSQL server, by default, will log events to:"
978 - einfo " ${DATA_DIR%/}/postmaster.log"
979 - einfo
980 - fi
981 - if use prefix ; then
982 - einfo "The location of the configuration files have moved to:"
983 - einfo " ${PGDATA}"
984 - einfo "To start the server:"
985 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
986 - einfo "To stop:"
987 - einfo " pg_ctl stop -D ${DATA_DIR}"
988 - einfo
989 - einfo "Or move the configuration files back:"
990 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
991 - elif use systemd; then
992 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
993 - einfo "instead of 'pg_ctl'."
994 - else
995 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
996 - einfo "instead of 'pg_ctl'."
997 - fi
998 -}
999 -
1000 -src_test() {
1001 - if use server && [[ ${UID} -ne 0 ]] ; then
1002 - emake check
1003 -
1004 - einfo "If you think other tests besides the regression tests are necessary, please"
1005 - einfo "submit a bug including a patch for this ebuild to enable them."
1006 - else
1007 - use server || \
1008 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
1009 - [[ ${UID} -eq 0 ]] || \
1010 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
1011 -
1012 - ewarn 'Skipping.'
1013 - fi
1014 -}
1015
1016 diff --git a/dev-db/postgresql/postgresql-10.9.ebuild b/dev-db/postgresql/postgresql-10.9.ebuild
1017 deleted file mode 100644
1018 index 444c162dfcb..00000000000
1019 --- a/dev-db/postgresql/postgresql-10.9.ebuild
1020 +++ /dev/null
1021 @@ -1,465 +0,0 @@
1022 -# Copyright 1999-2020 Gentoo Authors
1023 -# Distributed under the terms of the GNU General Public License v2
1024 -
1025 -EAPI=7
1026 -
1027 -PYTHON_COMPAT=( python3_{6,7} )
1028 -
1029 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
1030 - zh_TW"
1031 -
1032 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
1033 - systemd user
1034 -
1035 -KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
1036 -
1037 -SLOT=$(ver_cut 1)
1038 -
1039 -MY_PV=${PV/_/}
1040 -S="${WORKDIR}/${PN}-${MY_PV}"
1041 -
1042 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
1043 -
1044 -LICENSE="POSTGRESQL GPL-2"
1045 -DESCRIPTION="PostgreSQL RDBMS"
1046 -HOMEPAGE="https://www.postgresql.org/"
1047 -
1048 -IUSE="debug doc icu kerberos kernel_linux ldap libressl nls pam perl
1049 - python +readline selinux +server systemd ssl static-libs tcl
1050 - threads uuid xml zlib"
1051 -
1052 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
1053 -
1054 -CDEPEND="
1055 ->=app-eselect/eselect-postgresql-2.0
1056 -sys-apps/less
1057 -virtual/libintl
1058 -icu? ( dev-libs/icu:= )
1059 -kerberos? ( virtual/krb5 )
1060 -ldap? ( net-nds/openldap )
1061 -pam? ( sys-libs/pam )
1062 -perl? ( >=dev-lang/perl-5.8:= )
1063 -python? ( ${PYTHON_DEPS} )
1064 -readline? ( sys-libs/readline:0= )
1065 -server? ( systemd? ( sys-apps/systemd ) )
1066 -ssl? (
1067 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
1068 - libressl? ( dev-libs/libressl:= )
1069 -)
1070 -tcl? ( >=dev-lang/tcl-8:0= )
1071 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
1072 -zlib? ( sys-libs/zlib )
1073 -"
1074 -
1075 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
1076 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
1077 -# the libc includes UUID functions.
1078 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
1079 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
1080 -
1081 -nest_usedep() {
1082 - local front back
1083 - while [[ ${#} -gt 1 ]]; do
1084 - front+="${1}? ( "
1085 - back+=" )"
1086 - shift
1087 - done
1088 - echo "${front}${1}${back}"
1089 -}
1090 -
1091 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
1092 -CDEPEND+="
1093 -uuid? (
1094 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
1095 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
1096 -)"
1097 -
1098 -DEPEND="${CDEPEND}
1099 -!!<sys-apps/sandbox-2.0
1100 -sys-devel/bison
1101 -sys-devel/flex
1102 -nls? ( sys-devel/gettext )
1103 -xml? ( virtual/pkgconfig )
1104 -"
1105 -
1106 -RDEPEND="${CDEPEND}
1107 -!dev-db/postgresql-docs:${SLOT}
1108 -!dev-db/postgresql-base:${SLOT}
1109 -!dev-db/postgresql-server:${SLOT}
1110 -selinux? ( sec-policy/selinux-postgresql )
1111 -"
1112 -
1113 -pkg_setup() {
1114 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
1115 -
1116 - enewgroup postgres 70
1117 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
1118 -
1119 - use python && python-single-r1_pkg_setup
1120 -}
1121 -
1122 -src_prepare() {
1123 - # Work around PPC{,64} compilation bug where bool is already defined
1124 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
1125 -
1126 - # Set proper run directory
1127 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
1128 - -i src/include/pg_config_manual.h || die
1129 -
1130 - # Rely on $PATH being in the proper order so that the correct
1131 - # install program is used for modules utilizing PGXS in both
1132 - # hardened and non-hardened environments. (Bug #528786)
1133 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
1134 -
1135 - use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch"
1136 -
1137 - if use pam ; then
1138 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
1139 - -i src/backend/libpq/auth.c || \
1140 - die 'PGSQL_PAM_SERVICE rename failed.'
1141 - fi
1142 -
1143 - eapply_user
1144 -}
1145 -
1146 -src_configure() {
1147 - case ${CHOST} in
1148 - *-darwin*|*-solaris*)
1149 - use nls && append-libs intl
1150 - ;;
1151 - esac
1152 -
1153 - export LDFLAGS_SL="${LDFLAGS}"
1154 - export LDFLAGS_EX="${LDFLAGS}"
1155 -
1156 - local PO="${EPREFIX}"
1157 -
1158 - local i uuid_config=""
1159 - if use uuid; then
1160 - for i in ${UTIL_LINUX_LIBC[@]}; do
1161 - use ${i} && uuid_config="--with-uuid=e2fs"
1162 - done
1163 - for i in ${BSD_LIBC[@]}; do
1164 - use ${i} && uuid_config="--with-uuid=bsd"
1165 - done
1166 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
1167 - fi
1168 -
1169 - econf \
1170 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
1171 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
1172 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
1173 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
1174 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
1175 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
1176 - $(use_enable !alpha spinlocks) \
1177 - $(use_enable debug) \
1178 - $(use_enable threads thread-safety) \
1179 - $(use_with icu) \
1180 - $(use_with kerberos gssapi) \
1181 - $(use_with ldap) \
1182 - $(use_with pam) \
1183 - $(use_with perl) \
1184 - $(use_with python) \
1185 - $(use_with readline) \
1186 - $(use_with ssl openssl) \
1187 - $(usex server "$(use_with systemd)" '--without-systemd') \
1188 - $(use_with tcl) \
1189 - ${uuid_config} \
1190 - $(use_with xml libxml) \
1191 - $(use_with xml libxslt) \
1192 - $(use_with zlib) \
1193 - $(use_enable nls nls "'$(l10n_get_locales)'")
1194 -}
1195 -
1196 -src_compile() {
1197 - emake
1198 - emake -C contrib
1199 -}
1200 -
1201 -src_install() {
1202 - emake DESTDIR="${D}" install
1203 - emake DESTDIR="${D}" install -C contrib
1204 -
1205 - dodoc README HISTORY doc/{TODO,bug.template}
1206 -
1207 - # man pages are already built, but if we have the target make them,
1208 - # they'll be generated from source before being installed so we
1209 - # manually install man pages.
1210 - # We use ${SLOT} instead of doman for postgresql.eselect
1211 - insinto /usr/share/postgresql-${SLOT}/man/
1212 - doins -r doc/src/sgml/man{1,3,7}
1213 - if ! use server; then
1214 - # Remove man pages for non-existent binaries
1215 - serverman=(
1216 - initdb
1217 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
1218 - pg_{test_{fsync,timing},upgrade,waldump}
1219 - post{gres,master}
1220 - )
1221 - for m in ${serverman[@]} ; do
1222 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
1223 - done
1224 - fi
1225 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
1226 -
1227 - # Create slot specific man pages
1228 - local bn f mansec slotted_name
1229 - for mansec in 1 3 7 ; do
1230 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
1231 -
1232 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
1233 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
1234 -
1235 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
1236 - bn=$(basename "${f}")
1237 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
1238 - case ${bn} in
1239 - TABLE.7|WITH.7)
1240 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
1241 - ;;
1242 - *)
1243 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
1244 - ;;
1245 - esac
1246 - done
1247 -
1248 - popd > /dev/null
1249 - done
1250 -
1251 - insinto /etc/postgresql-${SLOT}
1252 - newins src/bin/psql/psqlrc.sample psqlrc
1253 -
1254 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
1255 - # needed by extensions utilizing PGXS.
1256 - use static-libs || \
1257 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
1258 - -delete
1259 -
1260 - # Make slot specific links to programs
1261 - local f bn
1262 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
1263 - -mindepth 1 -maxdepth 1)
1264 - do
1265 - bn=$(basename "${f}")
1266 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
1267 - "/usr/bin/${bn}${SLOT/.}"
1268 - done
1269 -
1270 - if use doc ; then
1271 - docinto html
1272 - dodoc doc/src/sgml/html/*
1273 - fi
1274 -
1275 - if use server; then
1276 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1277 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
1278 -
1279 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1280 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
1281 -
1282 - if use systemd; then
1283 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1284 - "${FILESDIR}/${PN}.service-9.6-r1" | \
1285 - systemd_newunit - ${PN}-${SLOT}.service
1286 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
1287 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
1288 - fi
1289 -
1290 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
1291 -
1292 - if use prefix ; then
1293 - keepdir /run/postgresql
1294 - fperms 1775 /run/postgresql
1295 - fi
1296 - fi
1297 -}
1298 -
1299 -pkg_postinst() {
1300 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
1301 - postgresql-config update
1302 -
1303 - elog "If you need a global psqlrc-file, you can place it in:"
1304 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
1305 -
1306 - if use server ; then
1307 - elog
1308 - elog "Gentoo specific documentation:"
1309 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
1310 - elog
1311 - elog "Official documentation:"
1312 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
1313 - elog
1314 - elog "The default location of the Unix-domain socket is:"
1315 - elog " ${EROOT}/run/postgresql/"
1316 - elog
1317 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
1318 - elog "so that it contains your preferred locale in:"
1319 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
1320 - elog
1321 - elog "Then, execute the following command to setup the initial database"
1322 - elog "environment:"
1323 - elog " emerge --config =${CATEGORY}/${PF}"
1324 -
1325 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
1326 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
1327 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
1328 - ewarn "the following command after upgrading:"
1329 - ewarn
1330 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
1331 - fi
1332 - fi
1333 -}
1334 -
1335 -pkg_prerm() {
1336 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
1337 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
1338 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
1339 -
1340 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
1341 - sleep 10
1342 - eend 0
1343 - fi
1344 -}
1345 -
1346 -pkg_postrm() {
1347 - postgresql-config update
1348 -}
1349 -
1350 -pkg_config() {
1351 - use server || die "USE flag 'server' not enabled. Nothing to configure."
1352 -
1353 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
1354 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
1355 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
1356 - [[ -z "${DATA_DIR}" ]] \
1357 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
1358 -
1359 - # environment.bz2 may not contain the same locale as the current system
1360 - # locale. Unset and source from the current system locale.
1361 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
1362 - unset LANG
1363 - unset LC_CTYPE
1364 - unset LC_NUMERIC
1365 - unset LC_TIME
1366 - unset LC_COLLATE
1367 - unset LC_MONETARY
1368 - unset LC_MESSAGES
1369 - unset LC_ALL
1370 - source "${EROOT}/etc/env.d/02locale"
1371 - [ -n "${LANG}" ] && export LANG
1372 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
1373 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
1374 - [ -n "${LC_TIME}" ] && export LC_TIME
1375 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
1376 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
1377 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
1378 - [ -n "${LC_ALL}" ] && export LC_ALL
1379 - fi
1380 -
1381 - einfo "You can modify the paths and options passed to initdb by editing:"
1382 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
1383 - einfo
1384 - einfo "Information on options that can be passed to initdb are found at:"
1385 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
1386 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
1387 - einfo
1388 - einfo "PG_INITDB_OPTS is currently set to:"
1389 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
1390 - einfo " (none)"
1391 - else
1392 - einfo " ${PG_INITDB_OPTS}"
1393 - fi
1394 - einfo
1395 - einfo "Configuration files will be installed to:"
1396 - einfo " ${PGDATA}"
1397 - einfo
1398 - einfo "The database cluster will be created in:"
1399 - einfo " ${DATA_DIR}"
1400 - einfo
1401 -
1402 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
1403 - sleep 5
1404 - eend 0
1405 -
1406 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
1407 - eerror "The given directory, '${DATA_DIR}', is not empty."
1408 - eerror "Modify DATA_DIR to point to an empty directory."
1409 - die "${DATA_DIR} is not empty."
1410 - fi
1411 -
1412 - einfo "Creating the data directory ..."
1413 - if [[ ${EUID} == 0 ]] ; then
1414 - mkdir -p "${DATA_DIR}"
1415 - chown -Rf postgres:postgres "${DATA_DIR}"
1416 - chmod 0700 "${DATA_DIR}"
1417 - fi
1418 -
1419 - einfo "Initializing the database ..."
1420 -
1421 - if [[ ${EUID} == 0 ]] ; then
1422 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
1423 - else
1424 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
1425 - fi
1426 -
1427 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
1428 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
1429 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
1430 - fi
1431 -
1432 - # unix_socket_directory has no effect in postgresql.conf as it's
1433 - # overridden in the initscript
1434 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
1435 -
1436 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
1437 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
1438 - # On the off-chance that you might need to work with UTF-8 encoded
1439 - # characters in PL/Perl
1440 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
1441 - EOF
1442 -
1443 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
1444 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
1445 - einfo "by default. You can disable it in the cluster's:"
1446 - einfo " ${PGDATA%/}/postgresql.conf"
1447 - einfo
1448 - if ! use systemd; then
1449 - einfo "The PostgreSQL server, by default, will log events to:"
1450 - einfo " ${DATA_DIR%/}/postmaster.log"
1451 - einfo
1452 - fi
1453 - if use prefix ; then
1454 - einfo "The location of the configuration files have moved to:"
1455 - einfo " ${PGDATA}"
1456 - einfo "To start the server:"
1457 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
1458 - einfo "To stop:"
1459 - einfo " pg_ctl stop -D ${DATA_DIR}"
1460 - einfo
1461 - einfo "Or move the configuration files back:"
1462 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
1463 - elif use systemd; then
1464 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
1465 - einfo "instead of 'pg_ctl'."
1466 - else
1467 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
1468 - einfo "instead of 'pg_ctl'."
1469 - fi
1470 -}
1471 -
1472 -src_test() {
1473 - if use server && [[ ${UID} -ne 0 ]] ; then
1474 - emake check
1475 -
1476 - einfo "If you think other tests besides the regression tests are necessary, please"
1477 - einfo "submit a bug including a patch for this ebuild to enable them."
1478 - else
1479 - use server || \
1480 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
1481 - [[ ${UID} -eq 0 ]] || \
1482 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
1483 -
1484 - ewarn 'Skipping.'
1485 - fi
1486 -}
1487
1488 diff --git a/dev-db/postgresql/postgresql-11.4.ebuild b/dev-db/postgresql/postgresql-11.4.ebuild
1489 deleted file mode 100644
1490 index 22f96c8c241..00000000000
1491 --- a/dev-db/postgresql/postgresql-11.4.ebuild
1492 +++ /dev/null
1493 @@ -1,467 +0,0 @@
1494 -# Copyright 1999-2020 Gentoo Authors
1495 -# Distributed under the terms of the GNU General Public License v2
1496 -
1497 -EAPI=7
1498 -
1499 -PYTHON_COMPAT=( python3_{6,7} )
1500 -
1501 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
1502 - zh_TW"
1503 -
1504 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
1505 - systemd user
1506 -
1507 -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1508 -
1509 -SLOT=$(ver_cut 1)
1510 -
1511 -MY_PV=${PV/_/}
1512 -S="${WORKDIR}/${PN}-${MY_PV}"
1513 -
1514 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
1515 -
1516 -LICENSE="POSTGRESQL GPL-2"
1517 -DESCRIPTION="PostgreSQL RDBMS"
1518 -HOMEPAGE="http://www.postgresql.org/"
1519 -
1520 -IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam
1521 - perl python +readline selinux +server systemd ssl static-libs tcl
1522 - threads uuid xml zlib"
1523 -
1524 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
1525 -
1526 -CDEPEND="
1527 ->=app-eselect/eselect-postgresql-2.0
1528 -sys-apps/less
1529 -virtual/libintl
1530 -icu? ( dev-libs/icu:= )
1531 -kerberos? ( virtual/krb5 )
1532 -ldap? ( net-nds/openldap )
1533 -llvm? (
1534 - sys-devel/llvm:=
1535 - sys-devel/clang:=
1536 -)
1537 -pam? ( sys-libs/pam )
1538 -perl? ( >=dev-lang/perl-5.8:= )
1539 -python? ( ${PYTHON_DEPS} )
1540 -readline? ( sys-libs/readline:0= )
1541 -server? ( systemd? ( sys-apps/systemd ) )
1542 -ssl? (
1543 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
1544 - libressl? ( dev-libs/libressl:= )
1545 -)
1546 -tcl? ( >=dev-lang/tcl-8:0= )
1547 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
1548 -zlib? ( sys-libs/zlib )
1549 -"
1550 -
1551 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
1552 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
1553 -# the libc includes UUID functions.
1554 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
1555 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
1556 -
1557 -nest_usedep() {
1558 - local front back
1559 - while [[ ${#} -gt 1 ]]; do
1560 - front+="${1}? ( "
1561 - back+=" )"
1562 - shift
1563 - done
1564 - echo "${front}${1}${back}"
1565 -}
1566 -
1567 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
1568 -CDEPEND+="
1569 -uuid? (
1570 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
1571 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
1572 -)"
1573 -
1574 -DEPEND="${CDEPEND}
1575 -!!<sys-apps/sandbox-2.0
1576 -sys-devel/bison
1577 -sys-devel/flex
1578 -nls? ( sys-devel/gettext )
1579 -xml? ( virtual/pkgconfig )
1580 -"
1581 -
1582 -RDEPEND="${CDEPEND}
1583 -!dev-db/postgresql-docs:${SLOT}
1584 -!dev-db/postgresql-base:${SLOT}
1585 -!dev-db/postgresql-server:${SLOT}
1586 -selinux? ( sec-policy/selinux-postgresql )
1587 -"
1588 -
1589 -pkg_setup() {
1590 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
1591 -
1592 - enewgroup postgres 70
1593 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
1594 -
1595 - use python && python-single-r1_pkg_setup
1596 -}
1597 -
1598 -src_prepare() {
1599 - # Set proper run directory
1600 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
1601 - -i src/include/pg_config_manual.h || die
1602 -
1603 - # Rely on $PATH being in the proper order so that the correct
1604 - # install program is used for modules utilizing PGXS in both
1605 - # hardened and non-hardened environments. (Bug #528786)
1606 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
1607 -
1608 - use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
1609 -
1610 - if use pam ; then
1611 - sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
1612 - -i src/backend/libpq/auth.c || \
1613 - die 'PGSQL_PAM_SERVICE rename failed.'
1614 - fi
1615 -
1616 - eapply_user
1617 -}
1618 -
1619 -src_configure() {
1620 - case ${CHOST} in
1621 - *-darwin*|*-solaris*)
1622 - use nls && append-libs intl
1623 - ;;
1624 - esac
1625 -
1626 - export LDFLAGS_SL="${LDFLAGS}"
1627 - export LDFLAGS_EX="${LDFLAGS}"
1628 -
1629 - local PO="${EPREFIX}"
1630 -
1631 - local i uuid_config=""
1632 - if use uuid; then
1633 - for i in ${UTIL_LINUX_LIBC[@]}; do
1634 - use ${i} && uuid_config="--with-uuid=e2fs"
1635 - done
1636 - for i in ${BSD_LIBC[@]}; do
1637 - use ${i} && uuid_config="--with-uuid=bsd"
1638 - done
1639 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
1640 - fi
1641 -
1642 - econf \
1643 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
1644 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
1645 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
1646 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
1647 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
1648 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
1649 - $(use_enable !alpha spinlocks) \
1650 - $(use_enable debug) \
1651 - $(use_enable threads thread-safety) \
1652 - $(use_with icu) \
1653 - $(use_with kerberos gssapi) \
1654 - $(use_with ldap) \
1655 - $(use_with llvm) \
1656 - $(use_with pam) \
1657 - $(use_with perl) \
1658 - $(use_with python) \
1659 - $(use_with readline) \
1660 - $(use_with ssl openssl) \
1661 - $(usex server "$(use_with systemd)" '--without-systemd') \
1662 - $(use_with tcl) \
1663 - ${uuid_config} \
1664 - $(use_with xml libxml) \
1665 - $(use_with xml libxslt) \
1666 - $(use_with zlib) \
1667 - $(use_enable nls nls "'$(l10n_get_locales)'")
1668 -}
1669 -
1670 -src_compile() {
1671 - emake
1672 - emake -C contrib
1673 -}
1674 -
1675 -src_install() {
1676 - emake DESTDIR="${D}" install
1677 - emake DESTDIR="${D}" install -C contrib
1678 -
1679 - dodoc README HISTORY doc/{TODO,bug.template}
1680 -
1681 - # man pages are already built, but if we have the target make them,
1682 - # they'll be generated from source before being installed so we
1683 - # manually install man pages.
1684 - # We use ${SLOT} instead of doman for postgresql.eselect
1685 - insinto /usr/share/postgresql-${SLOT}/man/
1686 - doins -r doc/src/sgml/man{1,3,7}
1687 - if ! use server; then
1688 - # Remove man pages for non-existent binaries
1689 - serverman=(
1690 - initdb
1691 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
1692 - pg_{test_{fsync,timing},upgrade,waldump}
1693 - post{gres,master}
1694 - )
1695 - for m in ${serverman[@]} ; do
1696 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
1697 - done
1698 - fi
1699 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
1700 -
1701 - # Create slot specific man pages
1702 - local bn f mansec slotted_name
1703 - for mansec in 1 3 7 ; do
1704 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
1705 -
1706 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
1707 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
1708 -
1709 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
1710 - bn=$(basename "${f}")
1711 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
1712 - case ${bn} in
1713 - TABLE.7|WITH.7)
1714 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
1715 - ;;
1716 - *)
1717 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
1718 - ;;
1719 - esac
1720 - done
1721 -
1722 - popd > /dev/null
1723 - done
1724 -
1725 - insinto /etc/postgresql-${SLOT}
1726 - newins src/bin/psql/psqlrc.sample psqlrc
1727 -
1728 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
1729 - # needed by extensions utilizing PGXS.
1730 - use static-libs || \
1731 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
1732 - -delete
1733 -
1734 - # Make slot specific links to programs
1735 - local f bn
1736 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
1737 - -mindepth 1 -maxdepth 1)
1738 - do
1739 - bn=$(basename "${f}")
1740 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
1741 - "/usr/bin/${bn}${SLOT/.}"
1742 - done
1743 -
1744 - if use doc ; then
1745 - docinto html
1746 - dodoc doc/src/sgml/html/*
1747 - fi
1748 -
1749 - if use server; then
1750 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1751 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
1752 -
1753 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1754 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
1755 -
1756 - if use systemd; then
1757 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1758 - "${FILESDIR}/${PN}.service-9.6-r1" | \
1759 - systemd_newunit - ${PN}-${SLOT}.service
1760 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
1761 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
1762 - fi
1763 -
1764 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
1765 -
1766 - if use prefix ; then
1767 - keepdir /run/postgresql
1768 - fperms 1775 /run/postgresql
1769 - fi
1770 - fi
1771 -}
1772 -
1773 -pkg_postinst() {
1774 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
1775 - postgresql-config update
1776 -
1777 - elog "If you need a global psqlrc-file, you can place it in:"
1778 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
1779 -
1780 - if use server ; then
1781 - elog
1782 - elog "Gentoo specific documentation:"
1783 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
1784 - elog
1785 - elog "Official documentation:"
1786 - elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
1787 - elog
1788 - elog "The default location of the Unix-domain socket is:"
1789 - elog " ${EROOT}/run/postgresql/"
1790 - elog
1791 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
1792 - elog "so that it contains your preferred locale in:"
1793 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
1794 - elog
1795 - elog "Then, execute the following command to setup the initial database"
1796 - elog "environment:"
1797 - elog " emerge --config =${CATEGORY}/${PF}"
1798 -
1799 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
1800 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
1801 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
1802 - ewarn "the following command after upgrading:"
1803 - ewarn
1804 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
1805 - fi
1806 - fi
1807 -}
1808 -
1809 -pkg_prerm() {
1810 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
1811 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
1812 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
1813 -
1814 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
1815 - sleep 10
1816 - eend 0
1817 - fi
1818 -}
1819 -
1820 -pkg_postrm() {
1821 - postgresql-config update
1822 -}
1823 -
1824 -pkg_config() {
1825 - use server || die "USE flag 'server' not enabled. Nothing to configure."
1826 -
1827 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
1828 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
1829 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
1830 - [[ -z "${DATA_DIR}" ]] \
1831 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
1832 -
1833 - # environment.bz2 may not contain the same locale as the current system
1834 - # locale. Unset and source from the current system locale.
1835 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
1836 - unset LANG
1837 - unset LC_CTYPE
1838 - unset LC_NUMERIC
1839 - unset LC_TIME
1840 - unset LC_COLLATE
1841 - unset LC_MONETARY
1842 - unset LC_MESSAGES
1843 - unset LC_ALL
1844 - source "${EROOT}/etc/env.d/02locale"
1845 - [ -n "${LANG}" ] && export LANG
1846 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
1847 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
1848 - [ -n "${LC_TIME}" ] && export LC_TIME
1849 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
1850 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
1851 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
1852 - [ -n "${LC_ALL}" ] && export LC_ALL
1853 - fi
1854 -
1855 - einfo "You can modify the paths and options passed to initdb by editing:"
1856 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
1857 - einfo
1858 - einfo "Information on options that can be passed to initdb are found at:"
1859 - einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
1860 - einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
1861 - einfo
1862 - einfo "PG_INITDB_OPTS is currently set to:"
1863 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
1864 - einfo " (none)"
1865 - else
1866 - einfo " ${PG_INITDB_OPTS}"
1867 - fi
1868 - einfo
1869 - einfo "Configuration files will be installed to:"
1870 - einfo " ${PGDATA}"
1871 - einfo
1872 - einfo "The database cluster will be created in:"
1873 - einfo " ${DATA_DIR}"
1874 - einfo
1875 -
1876 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
1877 - sleep 5
1878 - eend 0
1879 -
1880 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
1881 - eerror "The given directory, '${DATA_DIR}', is not empty."
1882 - eerror "Modify DATA_DIR to point to an empty directory."
1883 - die "${DATA_DIR} is not empty."
1884 - fi
1885 -
1886 - einfo "Creating the data directory ..."
1887 - if [[ ${EUID} == 0 ]] ; then
1888 - mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
1889 - mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
1890 - chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
1891 - fi
1892 -
1893 - einfo "Initializing the database ..."
1894 -
1895 - if [[ ${EUID} == 0 ]] ; then
1896 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
1897 - else
1898 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
1899 - fi
1900 -
1901 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
1902 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
1903 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
1904 - fi
1905 -
1906 - # unix_socket_directory has no effect in postgresql.conf as it's
1907 - # overridden in the initscript
1908 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
1909 -
1910 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
1911 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
1912 - # On the off-chance that you might need to work with UTF-8 encoded
1913 - # characters in PL/Perl
1914 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
1915 - EOF
1916 -
1917 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
1918 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
1919 - einfo "by default. You can disable it in the cluster's:"
1920 - einfo " ${PGDATA%/}/postgresql.conf"
1921 - einfo
1922 - if ! use systemd; then
1923 - einfo "The PostgreSQL server, by default, will log events to:"
1924 - einfo " ${DATA_DIR%/}/postmaster.log"
1925 - einfo
1926 - fi
1927 - if use prefix ; then
1928 - einfo "The location of the configuration files have moved to:"
1929 - einfo " ${PGDATA}"
1930 - einfo "To start the server:"
1931 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
1932 - einfo "To stop:"
1933 - einfo " pg_ctl stop -D ${DATA_DIR}"
1934 - einfo
1935 - einfo "Or move the configuration files back:"
1936 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
1937 - elif use systemd; then
1938 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
1939 - einfo "instead of 'pg_ctl'."
1940 - else
1941 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
1942 - einfo "instead of 'pg_ctl'."
1943 - fi
1944 -}
1945 -
1946 -src_test() {
1947 - if use server && [[ ${UID} -ne 0 ]] ; then
1948 - emake check
1949 -
1950 - einfo "If you think other tests besides the regression tests are necessary, please"
1951 - einfo "submit a bug including a patch for this ebuild to enable them."
1952 - else
1953 - use server || \
1954 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
1955 - [[ ${UID} -eq 0 ]] || \
1956 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
1957 -
1958 - ewarn 'Skipping.'
1959 - fi
1960 -}
1961
1962 diff --git a/dev-db/postgresql/postgresql-11.5.ebuild b/dev-db/postgresql/postgresql-11.5.ebuild
1963 deleted file mode 100644
1964 index 7ecfb7bea1f..00000000000
1965 --- a/dev-db/postgresql/postgresql-11.5.ebuild
1966 +++ /dev/null
1967 @@ -1,467 +0,0 @@
1968 -# Copyright 1999-2020 Gentoo Authors
1969 -# Distributed under the terms of the GNU General Public License v2
1970 -
1971 -EAPI=7
1972 -
1973 -PYTHON_COMPAT=( python3_{6,7} )
1974 -
1975 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
1976 - zh_TW"
1977 -
1978 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
1979 - systemd user
1980 -
1981 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1982 -
1983 -SLOT=$(ver_cut 1)
1984 -
1985 -MY_PV=${PV/_/}
1986 -S="${WORKDIR}/${PN}-${MY_PV}"
1987 -
1988 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
1989 -
1990 -LICENSE="POSTGRESQL GPL-2"
1991 -DESCRIPTION="PostgreSQL RDBMS"
1992 -HOMEPAGE="http://www.postgresql.org/"
1993 -
1994 -IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam
1995 - perl python +readline selinux +server systemd ssl static-libs tcl
1996 - threads uuid xml zlib"
1997 -
1998 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
1999 -
2000 -CDEPEND="
2001 ->=app-eselect/eselect-postgresql-2.0
2002 -sys-apps/less
2003 -virtual/libintl
2004 -icu? ( dev-libs/icu:= )
2005 -kerberos? ( virtual/krb5 )
2006 -ldap? ( net-nds/openldap )
2007 -llvm? (
2008 - sys-devel/llvm:=
2009 - sys-devel/clang:=
2010 -)
2011 -pam? ( sys-libs/pam )
2012 -perl? ( >=dev-lang/perl-5.8:= )
2013 -python? ( ${PYTHON_DEPS} )
2014 -readline? ( sys-libs/readline:0= )
2015 -server? ( systemd? ( sys-apps/systemd ) )
2016 -ssl? (
2017 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
2018 - libressl? ( dev-libs/libressl:= )
2019 -)
2020 -tcl? ( >=dev-lang/tcl-8:0= )
2021 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
2022 -zlib? ( sys-libs/zlib )
2023 -"
2024 -
2025 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
2026 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
2027 -# the libc includes UUID functions.
2028 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
2029 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
2030 -
2031 -nest_usedep() {
2032 - local front back
2033 - while [[ ${#} -gt 1 ]]; do
2034 - front+="${1}? ( "
2035 - back+=" )"
2036 - shift
2037 - done
2038 - echo "${front}${1}${back}"
2039 -}
2040 -
2041 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
2042 -CDEPEND+="
2043 -uuid? (
2044 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
2045 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
2046 -)"
2047 -
2048 -DEPEND="${CDEPEND}
2049 -!!<sys-apps/sandbox-2.0
2050 -sys-devel/bison
2051 -sys-devel/flex
2052 -nls? ( sys-devel/gettext )
2053 -xml? ( virtual/pkgconfig )
2054 -"
2055 -
2056 -RDEPEND="${CDEPEND}
2057 -!dev-db/postgresql-docs:${SLOT}
2058 -!dev-db/postgresql-base:${SLOT}
2059 -!dev-db/postgresql-server:${SLOT}
2060 -selinux? ( sec-policy/selinux-postgresql )
2061 -"
2062 -
2063 -pkg_setup() {
2064 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
2065 -
2066 - enewgroup postgres 70
2067 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
2068 -
2069 - use python && python-single-r1_pkg_setup
2070 -}
2071 -
2072 -src_prepare() {
2073 - # Set proper run directory
2074 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
2075 - -i src/include/pg_config_manual.h || die
2076 -
2077 - # Rely on $PATH being in the proper order so that the correct
2078 - # install program is used for modules utilizing PGXS in both
2079 - # hardened and non-hardened environments. (Bug #528786)
2080 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
2081 -
2082 - use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
2083 -
2084 - if use pam ; then
2085 - sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
2086 - -i src/backend/libpq/auth.c || \
2087 - die 'PGSQL_PAM_SERVICE rename failed.'
2088 - fi
2089 -
2090 - eapply_user
2091 -}
2092 -
2093 -src_configure() {
2094 - case ${CHOST} in
2095 - *-darwin*|*-solaris*)
2096 - use nls && append-libs intl
2097 - ;;
2098 - esac
2099 -
2100 - export LDFLAGS_SL="${LDFLAGS}"
2101 - export LDFLAGS_EX="${LDFLAGS}"
2102 -
2103 - local PO="${EPREFIX}"
2104 -
2105 - local i uuid_config=""
2106 - if use uuid; then
2107 - for i in ${UTIL_LINUX_LIBC[@]}; do
2108 - use ${i} && uuid_config="--with-uuid=e2fs"
2109 - done
2110 - for i in ${BSD_LIBC[@]}; do
2111 - use ${i} && uuid_config="--with-uuid=bsd"
2112 - done
2113 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
2114 - fi
2115 -
2116 - econf \
2117 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
2118 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
2119 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
2120 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
2121 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
2122 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
2123 - $(use_enable !alpha spinlocks) \
2124 - $(use_enable debug) \
2125 - $(use_enable threads thread-safety) \
2126 - $(use_with icu) \
2127 - $(use_with kerberos gssapi) \
2128 - $(use_with ldap) \
2129 - $(use_with llvm) \
2130 - $(use_with pam) \
2131 - $(use_with perl) \
2132 - $(use_with python) \
2133 - $(use_with readline) \
2134 - $(use_with ssl openssl) \
2135 - $(usex server "$(use_with systemd)" '--without-systemd') \
2136 - $(use_with tcl) \
2137 - ${uuid_config} \
2138 - $(use_with xml libxml) \
2139 - $(use_with xml libxslt) \
2140 - $(use_with zlib) \
2141 - $(use_enable nls nls "'$(l10n_get_locales)'")
2142 -}
2143 -
2144 -src_compile() {
2145 - emake
2146 - emake -C contrib
2147 -}
2148 -
2149 -src_install() {
2150 - emake DESTDIR="${D}" install
2151 - emake DESTDIR="${D}" install -C contrib
2152 -
2153 - dodoc README HISTORY doc/{TODO,bug.template}
2154 -
2155 - # man pages are already built, but if we have the target make them,
2156 - # they'll be generated from source before being installed so we
2157 - # manually install man pages.
2158 - # We use ${SLOT} instead of doman for postgresql.eselect
2159 - insinto /usr/share/postgresql-${SLOT}/man/
2160 - doins -r doc/src/sgml/man{1,3,7}
2161 - if ! use server; then
2162 - # Remove man pages for non-existent binaries
2163 - serverman=(
2164 - initdb
2165 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
2166 - pg_{test_{fsync,timing},upgrade,waldump}
2167 - post{gres,master}
2168 - )
2169 - for m in ${serverman[@]} ; do
2170 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
2171 - done
2172 - fi
2173 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
2174 -
2175 - # Create slot specific man pages
2176 - local bn f mansec slotted_name
2177 - for mansec in 1 3 7 ; do
2178 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
2179 -
2180 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
2181 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
2182 -
2183 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
2184 - bn=$(basename "${f}")
2185 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
2186 - case ${bn} in
2187 - TABLE.7|WITH.7)
2188 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
2189 - ;;
2190 - *)
2191 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
2192 - ;;
2193 - esac
2194 - done
2195 -
2196 - popd > /dev/null
2197 - done
2198 -
2199 - insinto /etc/postgresql-${SLOT}
2200 - newins src/bin/psql/psqlrc.sample psqlrc
2201 -
2202 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
2203 - # needed by extensions utilizing PGXS.
2204 - use static-libs || \
2205 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
2206 - -delete
2207 -
2208 - # Make slot specific links to programs
2209 - local f bn
2210 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
2211 - -mindepth 1 -maxdepth 1)
2212 - do
2213 - bn=$(basename "${f}")
2214 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
2215 - "/usr/bin/${bn}${SLOT/.}"
2216 - done
2217 -
2218 - if use doc ; then
2219 - docinto html
2220 - dodoc doc/src/sgml/html/*
2221 - fi
2222 -
2223 - if use server; then
2224 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
2225 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
2226 -
2227 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
2228 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
2229 -
2230 - if use systemd; then
2231 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
2232 - "${FILESDIR}/${PN}.service-9.6-r1" | \
2233 - systemd_newunit - ${PN}-${SLOT}.service
2234 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
2235 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
2236 - fi
2237 -
2238 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
2239 -
2240 - if use prefix ; then
2241 - keepdir /run/postgresql
2242 - fperms 1775 /run/postgresql
2243 - fi
2244 - fi
2245 -}
2246 -
2247 -pkg_postinst() {
2248 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
2249 - postgresql-config update
2250 -
2251 - elog "If you need a global psqlrc-file, you can place it in:"
2252 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
2253 -
2254 - if use server ; then
2255 - elog
2256 - elog "Gentoo specific documentation:"
2257 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
2258 - elog
2259 - elog "Official documentation:"
2260 - elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
2261 - elog
2262 - elog "The default location of the Unix-domain socket is:"
2263 - elog " ${EROOT}/run/postgresql/"
2264 - elog
2265 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
2266 - elog "so that it contains your preferred locale in:"
2267 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
2268 - elog
2269 - elog "Then, execute the following command to setup the initial database"
2270 - elog "environment:"
2271 - elog " emerge --config =${CATEGORY}/${PF}"
2272 -
2273 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
2274 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
2275 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
2276 - ewarn "the following command after upgrading:"
2277 - ewarn
2278 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
2279 - fi
2280 - fi
2281 -}
2282 -
2283 -pkg_prerm() {
2284 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
2285 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
2286 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
2287 -
2288 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
2289 - sleep 10
2290 - eend 0
2291 - fi
2292 -}
2293 -
2294 -pkg_postrm() {
2295 - postgresql-config update
2296 -}
2297 -
2298 -pkg_config() {
2299 - use server || die "USE flag 'server' not enabled. Nothing to configure."
2300 -
2301 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
2302 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
2303 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
2304 - [[ -z "${DATA_DIR}" ]] \
2305 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
2306 -
2307 - # environment.bz2 may not contain the same locale as the current system
2308 - # locale. Unset and source from the current system locale.
2309 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
2310 - unset LANG
2311 - unset LC_CTYPE
2312 - unset LC_NUMERIC
2313 - unset LC_TIME
2314 - unset LC_COLLATE
2315 - unset LC_MONETARY
2316 - unset LC_MESSAGES
2317 - unset LC_ALL
2318 - source "${EROOT}/etc/env.d/02locale"
2319 - [ -n "${LANG}" ] && export LANG
2320 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
2321 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
2322 - [ -n "${LC_TIME}" ] && export LC_TIME
2323 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
2324 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
2325 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
2326 - [ -n "${LC_ALL}" ] && export LC_ALL
2327 - fi
2328 -
2329 - einfo "You can modify the paths and options passed to initdb by editing:"
2330 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
2331 - einfo
2332 - einfo "Information on options that can be passed to initdb are found at:"
2333 - einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
2334 - einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
2335 - einfo
2336 - einfo "PG_INITDB_OPTS is currently set to:"
2337 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
2338 - einfo " (none)"
2339 - else
2340 - einfo " ${PG_INITDB_OPTS}"
2341 - fi
2342 - einfo
2343 - einfo "Configuration files will be installed to:"
2344 - einfo " ${PGDATA}"
2345 - einfo
2346 - einfo "The database cluster will be created in:"
2347 - einfo " ${DATA_DIR}"
2348 - einfo
2349 -
2350 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
2351 - sleep 5
2352 - eend 0
2353 -
2354 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
2355 - eerror "The given directory, '${DATA_DIR}', is not empty."
2356 - eerror "Modify DATA_DIR to point to an empty directory."
2357 - die "${DATA_DIR} is not empty."
2358 - fi
2359 -
2360 - einfo "Creating the data directory ..."
2361 - if [[ ${EUID} == 0 ]] ; then
2362 - mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
2363 - mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
2364 - chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
2365 - fi
2366 -
2367 - einfo "Initializing the database ..."
2368 -
2369 - if [[ ${EUID} == 0 ]] ; then
2370 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
2371 - else
2372 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
2373 - fi
2374 -
2375 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
2376 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
2377 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
2378 - fi
2379 -
2380 - # unix_socket_directory has no effect in postgresql.conf as it's
2381 - # overridden in the initscript
2382 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
2383 -
2384 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
2385 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
2386 - # On the off-chance that you might need to work with UTF-8 encoded
2387 - # characters in PL/Perl
2388 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
2389 - EOF
2390 -
2391 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
2392 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
2393 - einfo "by default. You can disable it in the cluster's:"
2394 - einfo " ${PGDATA%/}/postgresql.conf"
2395 - einfo
2396 - if ! use systemd; then
2397 - einfo "The PostgreSQL server, by default, will log events to:"
2398 - einfo " ${DATA_DIR%/}/postmaster.log"
2399 - einfo
2400 - fi
2401 - if use prefix ; then
2402 - einfo "The location of the configuration files have moved to:"
2403 - einfo " ${PGDATA}"
2404 - einfo "To start the server:"
2405 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
2406 - einfo "To stop:"
2407 - einfo " pg_ctl stop -D ${DATA_DIR}"
2408 - einfo
2409 - einfo "Or move the configuration files back:"
2410 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
2411 - elif use systemd; then
2412 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
2413 - einfo "instead of 'pg_ctl'."
2414 - else
2415 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
2416 - einfo "instead of 'pg_ctl'."
2417 - fi
2418 -}
2419 -
2420 -src_test() {
2421 - if use server && [[ ${UID} -ne 0 ]] ; then
2422 - emake check
2423 -
2424 - einfo "If you think other tests besides the regression tests are necessary, please"
2425 - einfo "submit a bug including a patch for this ebuild to enable them."
2426 - else
2427 - use server || \
2428 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
2429 - [[ ${UID} -eq 0 ]] || \
2430 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
2431 -
2432 - ewarn 'Skipping.'
2433 - fi
2434 -}
2435
2436 diff --git a/dev-db/postgresql/postgresql-11.6.ebuild b/dev-db/postgresql/postgresql-11.6.ebuild
2437 deleted file mode 100644
2438 index 372964685b5..00000000000
2439 --- a/dev-db/postgresql/postgresql-11.6.ebuild
2440 +++ /dev/null
2441 @@ -1,467 +0,0 @@
2442 -# Copyright 1999-2020 Gentoo Authors
2443 -# Distributed under the terms of the GNU General Public License v2
2444 -
2445 -EAPI=7
2446 -
2447 -PYTHON_COMPAT=( python3_{6,7} )
2448 -
2449 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
2450 - zh_TW"
2451 -
2452 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
2453 - systemd user
2454 -
2455 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
2456 -
2457 -SLOT=$(ver_cut 1)
2458 -
2459 -MY_PV=${PV/_/}
2460 -S="${WORKDIR}/${PN}-${MY_PV}"
2461 -
2462 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
2463 -
2464 -LICENSE="POSTGRESQL GPL-2"
2465 -DESCRIPTION="PostgreSQL RDBMS"
2466 -HOMEPAGE="http://www.postgresql.org/"
2467 -
2468 -IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam
2469 - perl python +readline selinux +server systemd ssl static-libs tcl
2470 - threads uuid xml zlib"
2471 -
2472 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
2473 -
2474 -CDEPEND="
2475 ->=app-eselect/eselect-postgresql-2.0
2476 -sys-apps/less
2477 -virtual/libintl
2478 -icu? ( dev-libs/icu:= )
2479 -kerberos? ( virtual/krb5 )
2480 -ldap? ( net-nds/openldap )
2481 -llvm? (
2482 - sys-devel/llvm:=
2483 - sys-devel/clang:=
2484 -)
2485 -pam? ( sys-libs/pam )
2486 -perl? ( >=dev-lang/perl-5.8:= )
2487 -python? ( ${PYTHON_DEPS} )
2488 -readline? ( sys-libs/readline:0= )
2489 -server? ( systemd? ( sys-apps/systemd ) )
2490 -ssl? (
2491 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
2492 - libressl? ( dev-libs/libressl:= )
2493 -)
2494 -tcl? ( >=dev-lang/tcl-8:0= )
2495 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
2496 -zlib? ( sys-libs/zlib )
2497 -"
2498 -
2499 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
2500 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
2501 -# the libc includes UUID functions.
2502 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
2503 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
2504 -
2505 -nest_usedep() {
2506 - local front back
2507 - while [[ ${#} -gt 1 ]]; do
2508 - front+="${1}? ( "
2509 - back+=" )"
2510 - shift
2511 - done
2512 - echo "${front}${1}${back}"
2513 -}
2514 -
2515 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
2516 -CDEPEND+="
2517 -uuid? (
2518 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
2519 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
2520 -)"
2521 -
2522 -DEPEND="${CDEPEND}
2523 -!!<sys-apps/sandbox-2.0
2524 -sys-devel/bison
2525 -sys-devel/flex
2526 -nls? ( sys-devel/gettext )
2527 -xml? ( virtual/pkgconfig )
2528 -"
2529 -
2530 -RDEPEND="${CDEPEND}
2531 -!dev-db/postgresql-docs:${SLOT}
2532 -!dev-db/postgresql-base:${SLOT}
2533 -!dev-db/postgresql-server:${SLOT}
2534 -selinux? ( sec-policy/selinux-postgresql )
2535 -"
2536 -
2537 -pkg_setup() {
2538 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
2539 -
2540 - enewgroup postgres 70
2541 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
2542 -
2543 - use python && python-single-r1_pkg_setup
2544 -}
2545 -
2546 -src_prepare() {
2547 - # Set proper run directory
2548 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
2549 - -i src/include/pg_config_manual.h || die
2550 -
2551 - # Rely on $PATH being in the proper order so that the correct
2552 - # install program is used for modules utilizing PGXS in both
2553 - # hardened and non-hardened environments. (Bug #528786)
2554 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
2555 -
2556 - use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
2557 -
2558 - if use pam ; then
2559 - sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
2560 - -i src/backend/libpq/auth.c || \
2561 - die 'PGSQL_PAM_SERVICE rename failed.'
2562 - fi
2563 -
2564 - eapply_user
2565 -}
2566 -
2567 -src_configure() {
2568 - case ${CHOST} in
2569 - *-darwin*|*-solaris*)
2570 - use nls && append-libs intl
2571 - ;;
2572 - esac
2573 -
2574 - export LDFLAGS_SL="${LDFLAGS}"
2575 - export LDFLAGS_EX="${LDFLAGS}"
2576 -
2577 - local PO="${EPREFIX}"
2578 -
2579 - local i uuid_config=""
2580 - if use uuid; then
2581 - for i in ${UTIL_LINUX_LIBC[@]}; do
2582 - use ${i} && uuid_config="--with-uuid=e2fs"
2583 - done
2584 - for i in ${BSD_LIBC[@]}; do
2585 - use ${i} && uuid_config="--with-uuid=bsd"
2586 - done
2587 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
2588 - fi
2589 -
2590 - econf \
2591 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
2592 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
2593 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
2594 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
2595 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
2596 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
2597 - $(use_enable !alpha spinlocks) \
2598 - $(use_enable debug) \
2599 - $(use_enable threads thread-safety) \
2600 - $(use_with icu) \
2601 - $(use_with kerberos gssapi) \
2602 - $(use_with ldap) \
2603 - $(use_with llvm) \
2604 - $(use_with pam) \
2605 - $(use_with perl) \
2606 - $(use_with python) \
2607 - $(use_with readline) \
2608 - $(use_with ssl openssl) \
2609 - $(usex server "$(use_with systemd)" '--without-systemd') \
2610 - $(use_with tcl) \
2611 - ${uuid_config} \
2612 - $(use_with xml libxml) \
2613 - $(use_with xml libxslt) \
2614 - $(use_with zlib) \
2615 - $(use_enable nls nls "'$(l10n_get_locales)'")
2616 -}
2617 -
2618 -src_compile() {
2619 - emake
2620 - emake -C contrib
2621 -}
2622 -
2623 -src_install() {
2624 - emake DESTDIR="${D}" install
2625 - emake DESTDIR="${D}" install -C contrib
2626 -
2627 - dodoc README HISTORY doc/{TODO,bug.template}
2628 -
2629 - # man pages are already built, but if we have the target make them,
2630 - # they'll be generated from source before being installed so we
2631 - # manually install man pages.
2632 - # We use ${SLOT} instead of doman for postgresql.eselect
2633 - insinto /usr/share/postgresql-${SLOT}/man/
2634 - doins -r doc/src/sgml/man{1,3,7}
2635 - if ! use server; then
2636 - # Remove man pages for non-existent binaries
2637 - serverman=(
2638 - initdb
2639 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
2640 - pg_{test_{fsync,timing},upgrade,waldump}
2641 - post{gres,master}
2642 - )
2643 - for m in ${serverman[@]} ; do
2644 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
2645 - done
2646 - fi
2647 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
2648 -
2649 - # Create slot specific man pages
2650 - local bn f mansec slotted_name
2651 - for mansec in 1 3 7 ; do
2652 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
2653 -
2654 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
2655 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
2656 -
2657 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
2658 - bn=$(basename "${f}")
2659 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
2660 - case ${bn} in
2661 - TABLE.7|WITH.7)
2662 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
2663 - ;;
2664 - *)
2665 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
2666 - ;;
2667 - esac
2668 - done
2669 -
2670 - popd > /dev/null
2671 - done
2672 -
2673 - insinto /etc/postgresql-${SLOT}
2674 - newins src/bin/psql/psqlrc.sample psqlrc
2675 -
2676 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
2677 - # needed by extensions utilizing PGXS.
2678 - use static-libs || \
2679 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
2680 - -delete
2681 -
2682 - # Make slot specific links to programs
2683 - local f bn
2684 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
2685 - -mindepth 1 -maxdepth 1)
2686 - do
2687 - bn=$(basename "${f}")
2688 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
2689 - "/usr/bin/${bn}${SLOT/.}"
2690 - done
2691 -
2692 - if use doc ; then
2693 - docinto html
2694 - dodoc doc/src/sgml/html/*
2695 - fi
2696 -
2697 - if use server; then
2698 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
2699 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
2700 -
2701 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
2702 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
2703 -
2704 - if use systemd; then
2705 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
2706 - "${FILESDIR}/${PN}.service-9.6-r1" | \
2707 - systemd_newunit - ${PN}-${SLOT}.service
2708 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
2709 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
2710 - fi
2711 -
2712 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
2713 -
2714 - if use prefix ; then
2715 - keepdir /run/postgresql
2716 - fperms 1775 /run/postgresql
2717 - fi
2718 - fi
2719 -}
2720 -
2721 -pkg_postinst() {
2722 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
2723 - postgresql-config update
2724 -
2725 - elog "If you need a global psqlrc-file, you can place it in:"
2726 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
2727 -
2728 - if use server ; then
2729 - elog
2730 - elog "Gentoo specific documentation:"
2731 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
2732 - elog
2733 - elog "Official documentation:"
2734 - elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
2735 - elog
2736 - elog "The default location of the Unix-domain socket is:"
2737 - elog " ${EROOT}/run/postgresql/"
2738 - elog
2739 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
2740 - elog "so that it contains your preferred locale in:"
2741 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
2742 - elog
2743 - elog "Then, execute the following command to setup the initial database"
2744 - elog "environment:"
2745 - elog " emerge --config =${CATEGORY}/${PF}"
2746 -
2747 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
2748 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
2749 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
2750 - ewarn "the following command after upgrading:"
2751 - ewarn
2752 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
2753 - fi
2754 - fi
2755 -}
2756 -
2757 -pkg_prerm() {
2758 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
2759 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
2760 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
2761 -
2762 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
2763 - sleep 10
2764 - eend 0
2765 - fi
2766 -}
2767 -
2768 -pkg_postrm() {
2769 - postgresql-config update
2770 -}
2771 -
2772 -pkg_config() {
2773 - use server || die "USE flag 'server' not enabled. Nothing to configure."
2774 -
2775 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
2776 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
2777 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
2778 - [[ -z "${DATA_DIR}" ]] \
2779 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
2780 -
2781 - # environment.bz2 may not contain the same locale as the current system
2782 - # locale. Unset and source from the current system locale.
2783 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
2784 - unset LANG
2785 - unset LC_CTYPE
2786 - unset LC_NUMERIC
2787 - unset LC_TIME
2788 - unset LC_COLLATE
2789 - unset LC_MONETARY
2790 - unset LC_MESSAGES
2791 - unset LC_ALL
2792 - source "${EROOT}/etc/env.d/02locale"
2793 - [ -n "${LANG}" ] && export LANG
2794 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
2795 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
2796 - [ -n "${LC_TIME}" ] && export LC_TIME
2797 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
2798 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
2799 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
2800 - [ -n "${LC_ALL}" ] && export LC_ALL
2801 - fi
2802 -
2803 - einfo "You can modify the paths and options passed to initdb by editing:"
2804 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
2805 - einfo
2806 - einfo "Information on options that can be passed to initdb are found at:"
2807 - einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
2808 - einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
2809 - einfo
2810 - einfo "PG_INITDB_OPTS is currently set to:"
2811 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
2812 - einfo " (none)"
2813 - else
2814 - einfo " ${PG_INITDB_OPTS}"
2815 - fi
2816 - einfo
2817 - einfo "Configuration files will be installed to:"
2818 - einfo " ${PGDATA}"
2819 - einfo
2820 - einfo "The database cluster will be created in:"
2821 - einfo " ${DATA_DIR}"
2822 - einfo
2823 -
2824 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
2825 - sleep 5
2826 - eend 0
2827 -
2828 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
2829 - eerror "The given directory, '${DATA_DIR}', is not empty."
2830 - eerror "Modify DATA_DIR to point to an empty directory."
2831 - die "${DATA_DIR} is not empty."
2832 - fi
2833 -
2834 - einfo "Creating the data directory ..."
2835 - if [[ ${EUID} == 0 ]] ; then
2836 - mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
2837 - mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
2838 - chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
2839 - fi
2840 -
2841 - einfo "Initializing the database ..."
2842 -
2843 - if [[ ${EUID} == 0 ]] ; then
2844 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
2845 - else
2846 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
2847 - fi
2848 -
2849 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
2850 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
2851 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
2852 - fi
2853 -
2854 - # unix_socket_directory has no effect in postgresql.conf as it's
2855 - # overridden in the initscript
2856 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
2857 -
2858 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
2859 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
2860 - # On the off-chance that you might need to work with UTF-8 encoded
2861 - # characters in PL/Perl
2862 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
2863 - EOF
2864 -
2865 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
2866 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
2867 - einfo "by default. You can disable it in the cluster's:"
2868 - einfo " ${PGDATA%/}/postgresql.conf"
2869 - einfo
2870 - if ! use systemd; then
2871 - einfo "The PostgreSQL server, by default, will log events to:"
2872 - einfo " ${DATA_DIR%/}/postmaster.log"
2873 - einfo
2874 - fi
2875 - if use prefix ; then
2876 - einfo "The location of the configuration files have moved to:"
2877 - einfo " ${PGDATA}"
2878 - einfo "To start the server:"
2879 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
2880 - einfo "To stop:"
2881 - einfo " pg_ctl stop -D ${DATA_DIR}"
2882 - einfo
2883 - einfo "Or move the configuration files back:"
2884 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
2885 - elif use systemd; then
2886 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
2887 - einfo "instead of 'pg_ctl'."
2888 - else
2889 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
2890 - einfo "instead of 'pg_ctl'."
2891 - fi
2892 -}
2893 -
2894 -src_test() {
2895 - if use server && [[ ${UID} -ne 0 ]] ; then
2896 - emake check
2897 -
2898 - einfo "If you think other tests besides the regression tests are necessary, please"
2899 - einfo "submit a bug including a patch for this ebuild to enable them."
2900 - else
2901 - use server || \
2902 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
2903 - [[ ${UID} -eq 0 ]] || \
2904 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
2905 -
2906 - ewarn 'Skipping.'
2907 - fi
2908 -}
2909
2910 diff --git a/dev-db/postgresql/postgresql-12.0.ebuild b/dev-db/postgresql/postgresql-12.0.ebuild
2911 deleted file mode 100644
2912 index 49dd313ec7e..00000000000
2913 --- a/dev-db/postgresql/postgresql-12.0.ebuild
2914 +++ /dev/null
2915 @@ -1,467 +0,0 @@
2916 -# Copyright 1999-2020 Gentoo Authors
2917 -# Distributed under the terms of the GNU General Public License v2
2918 -
2919 -EAPI=7
2920 -
2921 -PYTHON_COMPAT=( python3_{6,7} )
2922 -
2923 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
2924 - zh_TW"
2925 -
2926 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
2927 - systemd user
2928 -
2929 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
2930 -
2931 -SLOT=$(ver_cut 1)
2932 -
2933 -MY_PV=${PV/_/}
2934 -S="${WORKDIR}/${PN}-${MY_PV}"
2935 -
2936 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
2937 -
2938 -LICENSE="POSTGRESQL GPL-2"
2939 -DESCRIPTION="PostgreSQL RDBMS"
2940 -HOMEPAGE="http://www.postgresql.org/"
2941 -
2942 -IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam
2943 - perl python +readline selinux +server systemd ssl static-libs tcl
2944 - threads uuid xml zlib"
2945 -
2946 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
2947 -
2948 -CDEPEND="
2949 ->=app-eselect/eselect-postgresql-2.0
2950 -sys-apps/less
2951 -virtual/libintl
2952 -icu? ( dev-libs/icu:= )
2953 -kerberos? ( virtual/krb5 )
2954 -ldap? ( net-nds/openldap )
2955 -llvm? (
2956 - sys-devel/llvm:=
2957 - sys-devel/clang:=
2958 -)
2959 -pam? ( sys-libs/pam )
2960 -perl? ( >=dev-lang/perl-5.8:= )
2961 -python? ( ${PYTHON_DEPS} )
2962 -readline? ( sys-libs/readline:0= )
2963 -server? ( systemd? ( sys-apps/systemd ) )
2964 -ssl? (
2965 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
2966 - libressl? ( dev-libs/libressl:= )
2967 -)
2968 -tcl? ( >=dev-lang/tcl-8:0= )
2969 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
2970 -zlib? ( sys-libs/zlib )
2971 -"
2972 -
2973 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
2974 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
2975 -# the libc includes UUID functions.
2976 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
2977 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
2978 -
2979 -nest_usedep() {
2980 - local front back
2981 - while [[ ${#} -gt 1 ]]; do
2982 - front+="${1}? ( "
2983 - back+=" )"
2984 - shift
2985 - done
2986 - echo "${front}${1}${back}"
2987 -}
2988 -
2989 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
2990 -CDEPEND+="
2991 -uuid? (
2992 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
2993 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
2994 -)"
2995 -
2996 -DEPEND="${CDEPEND}
2997 -!!<sys-apps/sandbox-2.0
2998 -sys-devel/bison
2999 -sys-devel/flex
3000 -nls? ( sys-devel/gettext )
3001 -xml? ( virtual/pkgconfig )
3002 -"
3003 -
3004 -RDEPEND="${CDEPEND}
3005 -!dev-db/postgresql-docs:${SLOT}
3006 -!dev-db/postgresql-base:${SLOT}
3007 -!dev-db/postgresql-server:${SLOT}
3008 -selinux? ( sec-policy/selinux-postgresql )
3009 -"
3010 -
3011 -pkg_setup() {
3012 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
3013 -
3014 - enewgroup postgres 70
3015 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
3016 -
3017 - use python && python-single-r1_pkg_setup
3018 -}
3019 -
3020 -src_prepare() {
3021 - # Set proper run directory
3022 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
3023 - -i src/include/pg_config_manual.h || die
3024 -
3025 - # Rely on $PATH being in the proper order so that the correct
3026 - # install program is used for modules utilizing PGXS in both
3027 - # hardened and non-hardened environments. (Bug #528786)
3028 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
3029 -
3030 - use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
3031 -
3032 - if use pam ; then
3033 - sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
3034 - -i src/backend/libpq/auth.c || \
3035 - die 'PGSQL_PAM_SERVICE rename failed.'
3036 - fi
3037 -
3038 - eapply_user
3039 -}
3040 -
3041 -src_configure() {
3042 - case ${CHOST} in
3043 - *-darwin*|*-solaris*)
3044 - use nls && append-libs intl
3045 - ;;
3046 - esac
3047 -
3048 - export LDFLAGS_SL="${LDFLAGS}"
3049 - export LDFLAGS_EX="${LDFLAGS}"
3050 -
3051 - local PO="${EPREFIX}"
3052 -
3053 - local i uuid_config=""
3054 - if use uuid; then
3055 - for i in ${UTIL_LINUX_LIBC[@]}; do
3056 - use ${i} && uuid_config="--with-uuid=e2fs"
3057 - done
3058 - for i in ${BSD_LIBC[@]}; do
3059 - use ${i} && uuid_config="--with-uuid=bsd"
3060 - done
3061 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
3062 - fi
3063 -
3064 - econf \
3065 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
3066 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
3067 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
3068 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
3069 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
3070 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
3071 - $(use_enable !alpha spinlocks) \
3072 - $(use_enable debug) \
3073 - $(use_enable threads thread-safety) \
3074 - $(use_with icu) \
3075 - $(use_with kerberos gssapi) \
3076 - $(use_with ldap) \
3077 - $(use_with llvm) \
3078 - $(use_with pam) \
3079 - $(use_with perl) \
3080 - $(use_with python) \
3081 - $(use_with readline) \
3082 - $(use_with ssl openssl) \
3083 - $(usex server "$(use_with systemd)" '--without-systemd') \
3084 - $(use_with tcl) \
3085 - ${uuid_config} \
3086 - $(use_with xml libxml) \
3087 - $(use_with xml libxslt) \
3088 - $(use_with zlib) \
3089 - $(use_enable nls nls "'$(l10n_get_locales)'")
3090 -}
3091 -
3092 -src_compile() {
3093 - emake
3094 - emake -C contrib
3095 -}
3096 -
3097 -src_install() {
3098 - emake DESTDIR="${D}" install
3099 - emake DESTDIR="${D}" install -C contrib
3100 -
3101 - dodoc README HISTORY
3102 -
3103 - # man pages are already built, but if we have the target make them,
3104 - # they'll be generated from source before being installed so we
3105 - # manually install man pages.
3106 - # We use ${SLOT} instead of doman for postgresql.eselect
3107 - insinto /usr/share/postgresql-${SLOT}/man/
3108 - doins -r doc/src/sgml/man{1,3,7}
3109 - if ! use server; then
3110 - # Remove man pages for non-existent binaries
3111 - serverman=(
3112 - initdb
3113 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
3114 - pg_{test_{fsync,timing},upgrade,waldump}
3115 - post{gres,master}
3116 - )
3117 - for m in ${serverman[@]} ; do
3118 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
3119 - done
3120 - fi
3121 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
3122 -
3123 - # Create slot specific man pages
3124 - local bn f mansec slotted_name
3125 - for mansec in 1 3 7 ; do
3126 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
3127 -
3128 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
3129 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
3130 -
3131 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
3132 - bn=$(basename "${f}")
3133 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
3134 - case ${bn} in
3135 - TABLE.7|WITH.7)
3136 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
3137 - ;;
3138 - *)
3139 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
3140 - ;;
3141 - esac
3142 - done
3143 -
3144 - popd > /dev/null
3145 - done
3146 -
3147 - insinto /etc/postgresql-${SLOT}
3148 - newins src/bin/psql/psqlrc.sample psqlrc
3149 -
3150 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
3151 - # needed by extensions utilizing PGXS.
3152 - use static-libs || \
3153 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
3154 - -delete
3155 -
3156 - # Make slot specific links to programs
3157 - local f bn
3158 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
3159 - -mindepth 1 -maxdepth 1)
3160 - do
3161 - bn=$(basename "${f}")
3162 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
3163 - "/usr/bin/${bn}${SLOT/.}"
3164 - done
3165 -
3166 - if use doc ; then
3167 - docinto html
3168 - dodoc doc/src/sgml/html/*
3169 - fi
3170 -
3171 - if use server; then
3172 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
3173 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
3174 -
3175 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
3176 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
3177 -
3178 - if use systemd; then
3179 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
3180 - "${FILESDIR}/${PN}.service-9.6-r1" | \
3181 - systemd_newunit - ${PN}-${SLOT}.service
3182 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
3183 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
3184 - fi
3185 -
3186 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
3187 -
3188 - if use prefix ; then
3189 - keepdir /run/postgresql
3190 - fperms 1775 /run/postgresql
3191 - fi
3192 - fi
3193 -}
3194 -
3195 -pkg_postinst() {
3196 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
3197 - postgresql-config update
3198 -
3199 - elog "If you need a global psqlrc-file, you can place it in:"
3200 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
3201 -
3202 - if use server ; then
3203 - elog
3204 - elog "Gentoo specific documentation:"
3205 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
3206 - elog
3207 - elog "Official documentation:"
3208 - elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
3209 - elog
3210 - elog "The default location of the Unix-domain socket is:"
3211 - elog " ${EROOT}/run/postgresql/"
3212 - elog
3213 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
3214 - elog "so that it contains your preferred locale in:"
3215 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
3216 - elog
3217 - elog "Then, execute the following command to setup the initial database"
3218 - elog "environment:"
3219 - elog " emerge --config =${CATEGORY}/${PF}"
3220 -
3221 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
3222 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
3223 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
3224 - ewarn "the following command after upgrading:"
3225 - ewarn
3226 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
3227 - fi
3228 - fi
3229 -}
3230 -
3231 -pkg_prerm() {
3232 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
3233 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
3234 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
3235 -
3236 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
3237 - sleep 10
3238 - eend 0
3239 - fi
3240 -}
3241 -
3242 -pkg_postrm() {
3243 - postgresql-config update
3244 -}
3245 -
3246 -pkg_config() {
3247 - use server || die "USE flag 'server' not enabled. Nothing to configure."
3248 -
3249 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
3250 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
3251 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
3252 - [[ -z "${DATA_DIR}" ]] \
3253 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
3254 -
3255 - # environment.bz2 may not contain the same locale as the current system
3256 - # locale. Unset and source from the current system locale.
3257 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
3258 - unset LANG
3259 - unset LC_CTYPE
3260 - unset LC_NUMERIC
3261 - unset LC_TIME
3262 - unset LC_COLLATE
3263 - unset LC_MONETARY
3264 - unset LC_MESSAGES
3265 - unset LC_ALL
3266 - source "${EROOT}/etc/env.d/02locale"
3267 - [ -n "${LANG}" ] && export LANG
3268 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
3269 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
3270 - [ -n "${LC_TIME}" ] && export LC_TIME
3271 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
3272 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
3273 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
3274 - [ -n "${LC_ALL}" ] && export LC_ALL
3275 - fi
3276 -
3277 - einfo "You can modify the paths and options passed to initdb by editing:"
3278 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
3279 - einfo
3280 - einfo "Information on options that can be passed to initdb are found at:"
3281 - einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
3282 - einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
3283 - einfo
3284 - einfo "PG_INITDB_OPTS is currently set to:"
3285 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
3286 - einfo " (none)"
3287 - else
3288 - einfo " ${PG_INITDB_OPTS}"
3289 - fi
3290 - einfo
3291 - einfo "Configuration files will be installed to:"
3292 - einfo " ${PGDATA}"
3293 - einfo
3294 - einfo "The database cluster will be created in:"
3295 - einfo " ${DATA_DIR}"
3296 - einfo
3297 -
3298 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
3299 - sleep 5
3300 - eend 0
3301 -
3302 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
3303 - eerror "The given directory, '${DATA_DIR}', is not empty."
3304 - eerror "Modify DATA_DIR to point to an empty directory."
3305 - die "${DATA_DIR} is not empty."
3306 - fi
3307 -
3308 - einfo "Creating the data directory ..."
3309 - if [[ ${EUID} == 0 ]] ; then
3310 - mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
3311 - mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
3312 - chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
3313 - fi
3314 -
3315 - einfo "Initializing the database ..."
3316 -
3317 - if [[ ${EUID} == 0 ]] ; then
3318 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
3319 - else
3320 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
3321 - fi
3322 -
3323 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
3324 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
3325 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
3326 - fi
3327 -
3328 - # unix_socket_directory has no effect in postgresql.conf as it's
3329 - # overridden in the initscript
3330 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
3331 -
3332 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
3333 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
3334 - # On the off-chance that you might need to work with UTF-8 encoded
3335 - # characters in PL/Perl
3336 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
3337 - EOF
3338 -
3339 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
3340 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
3341 - einfo "by default. You can disable it in the cluster's:"
3342 - einfo " ${PGDATA%/}/postgresql.conf"
3343 - einfo
3344 - if ! use systemd; then
3345 - einfo "The PostgreSQL server, by default, will log events to:"
3346 - einfo " ${DATA_DIR%/}/postmaster.log"
3347 - einfo
3348 - fi
3349 - if use prefix ; then
3350 - einfo "The location of the configuration files have moved to:"
3351 - einfo " ${PGDATA}"
3352 - einfo "To start the server:"
3353 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
3354 - einfo "To stop:"
3355 - einfo " pg_ctl stop -D ${DATA_DIR}"
3356 - einfo
3357 - einfo "Or move the configuration files back:"
3358 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
3359 - elif use systemd; then
3360 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
3361 - einfo "instead of 'pg_ctl'."
3362 - else
3363 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
3364 - einfo "instead of 'pg_ctl'."
3365 - fi
3366 -}
3367 -
3368 -src_test() {
3369 - if use server && [[ ${UID} -ne 0 ]] ; then
3370 - emake check
3371 -
3372 - einfo "If you think other tests besides the regression tests are necessary, please"
3373 - einfo "submit a bug including a patch for this ebuild to enable them."
3374 - else
3375 - use server || \
3376 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
3377 - [[ ${UID} -eq 0 ]] || \
3378 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
3379 -
3380 - ewarn 'Skipping.'
3381 - fi
3382 -}
3383
3384 diff --git a/dev-db/postgresql/postgresql-12.1.ebuild b/dev-db/postgresql/postgresql-12.1.ebuild
3385 deleted file mode 100644
3386 index 57f10573d89..00000000000
3387 --- a/dev-db/postgresql/postgresql-12.1.ebuild
3388 +++ /dev/null
3389 @@ -1,467 +0,0 @@
3390 -# Copyright 1999-2020 Gentoo Authors
3391 -# Distributed under the terms of the GNU General Public License v2
3392 -
3393 -EAPI=7
3394 -
3395 -PYTHON_COMPAT=( python3_{6,7} )
3396 -
3397 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
3398 - zh_TW"
3399 -
3400 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
3401 - systemd user
3402 -
3403 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
3404 -
3405 -SLOT=$(ver_cut 1)
3406 -
3407 -MY_PV=${PV/_/}
3408 -S="${WORKDIR}/${PN}-${MY_PV}"
3409 -
3410 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
3411 -
3412 -LICENSE="POSTGRESQL GPL-2"
3413 -DESCRIPTION="PostgreSQL RDBMS"
3414 -HOMEPAGE="http://www.postgresql.org/"
3415 -
3416 -IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam
3417 - perl python +readline selinux +server systemd ssl static-libs tcl
3418 - threads uuid xml zlib"
3419 -
3420 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
3421 -
3422 -CDEPEND="
3423 ->=app-eselect/eselect-postgresql-2.0
3424 -sys-apps/less
3425 -virtual/libintl
3426 -icu? ( dev-libs/icu:= )
3427 -kerberos? ( virtual/krb5 )
3428 -ldap? ( net-nds/openldap )
3429 -llvm? (
3430 - sys-devel/llvm:=
3431 - sys-devel/clang:=
3432 -)
3433 -pam? ( sys-libs/pam )
3434 -perl? ( >=dev-lang/perl-5.8:= )
3435 -python? ( ${PYTHON_DEPS} )
3436 -readline? ( sys-libs/readline:0= )
3437 -server? ( systemd? ( sys-apps/systemd ) )
3438 -ssl? (
3439 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
3440 - libressl? ( dev-libs/libressl:= )
3441 -)
3442 -tcl? ( >=dev-lang/tcl-8:0= )
3443 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
3444 -zlib? ( sys-libs/zlib )
3445 -"
3446 -
3447 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
3448 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
3449 -# the libc includes UUID functions.
3450 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
3451 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
3452 -
3453 -nest_usedep() {
3454 - local front back
3455 - while [[ ${#} -gt 1 ]]; do
3456 - front+="${1}? ( "
3457 - back+=" )"
3458 - shift
3459 - done
3460 - echo "${front}${1}${back}"
3461 -}
3462 -
3463 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
3464 -CDEPEND+="
3465 -uuid? (
3466 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
3467 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
3468 -)"
3469 -
3470 -DEPEND="${CDEPEND}
3471 -!!<sys-apps/sandbox-2.0
3472 -sys-devel/bison
3473 -sys-devel/flex
3474 -nls? ( sys-devel/gettext )
3475 -xml? ( virtual/pkgconfig )
3476 -"
3477 -
3478 -RDEPEND="${CDEPEND}
3479 -!dev-db/postgresql-docs:${SLOT}
3480 -!dev-db/postgresql-base:${SLOT}
3481 -!dev-db/postgresql-server:${SLOT}
3482 -selinux? ( sec-policy/selinux-postgresql )
3483 -"
3484 -
3485 -pkg_setup() {
3486 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
3487 -
3488 - enewgroup postgres 70
3489 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
3490 -
3491 - use python && python-single-r1_pkg_setup
3492 -}
3493 -
3494 -src_prepare() {
3495 - # Set proper run directory
3496 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
3497 - -i src/include/pg_config_manual.h || die
3498 -
3499 - # Rely on $PATH being in the proper order so that the correct
3500 - # install program is used for modules utilizing PGXS in both
3501 - # hardened and non-hardened environments. (Bug #528786)
3502 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
3503 -
3504 - use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch"
3505 -
3506 - if use pam ; then
3507 - sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
3508 - -i src/backend/libpq/auth.c || \
3509 - die 'PGSQL_PAM_SERVICE rename failed.'
3510 - fi
3511 -
3512 - eapply_user
3513 -}
3514 -
3515 -src_configure() {
3516 - case ${CHOST} in
3517 - *-darwin*|*-solaris*)
3518 - use nls && append-libs intl
3519 - ;;
3520 - esac
3521 -
3522 - export LDFLAGS_SL="${LDFLAGS}"
3523 - export LDFLAGS_EX="${LDFLAGS}"
3524 -
3525 - local PO="${EPREFIX}"
3526 -
3527 - local i uuid_config=""
3528 - if use uuid; then
3529 - for i in ${UTIL_LINUX_LIBC[@]}; do
3530 - use ${i} && uuid_config="--with-uuid=e2fs"
3531 - done
3532 - for i in ${BSD_LIBC[@]}; do
3533 - use ${i} && uuid_config="--with-uuid=bsd"
3534 - done
3535 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
3536 - fi
3537 -
3538 - econf \
3539 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
3540 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
3541 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
3542 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
3543 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
3544 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
3545 - $(use_enable !alpha spinlocks) \
3546 - $(use_enable debug) \
3547 - $(use_enable threads thread-safety) \
3548 - $(use_with icu) \
3549 - $(use_with kerberos gssapi) \
3550 - $(use_with ldap) \
3551 - $(use_with llvm) \
3552 - $(use_with pam) \
3553 - $(use_with perl) \
3554 - $(use_with python) \
3555 - $(use_with readline) \
3556 - $(use_with ssl openssl) \
3557 - $(usex server "$(use_with systemd)" '--without-systemd') \
3558 - $(use_with tcl) \
3559 - ${uuid_config} \
3560 - $(use_with xml libxml) \
3561 - $(use_with xml libxslt) \
3562 - $(use_with zlib) \
3563 - $(use_enable nls nls "'$(l10n_get_locales)'")
3564 -}
3565 -
3566 -src_compile() {
3567 - emake
3568 - emake -C contrib
3569 -}
3570 -
3571 -src_install() {
3572 - emake DESTDIR="${D}" install
3573 - emake DESTDIR="${D}" install -C contrib
3574 -
3575 - dodoc README HISTORY
3576 -
3577 - # man pages are already built, but if we have the target make them,
3578 - # they'll be generated from source before being installed so we
3579 - # manually install man pages.
3580 - # We use ${SLOT} instead of doman for postgresql.eselect
3581 - insinto /usr/share/postgresql-${SLOT}/man/
3582 - doins -r doc/src/sgml/man{1,3,7}
3583 - if ! use server; then
3584 - # Remove man pages for non-existent binaries
3585 - serverman=(
3586 - initdb
3587 - pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
3588 - pg_{test_{fsync,timing},upgrade,waldump}
3589 - post{gres,master}
3590 - )
3591 - for m in ${serverman[@]} ; do
3592 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
3593 - done
3594 - fi
3595 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
3596 -
3597 - # Create slot specific man pages
3598 - local bn f mansec slotted_name
3599 - for mansec in 1 3 7 ; do
3600 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
3601 -
3602 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
3603 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
3604 -
3605 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
3606 - bn=$(basename "${f}")
3607 - slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
3608 - case ${bn} in
3609 - TABLE.7|WITH.7)
3610 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
3611 - ;;
3612 - *)
3613 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
3614 - ;;
3615 - esac
3616 - done
3617 -
3618 - popd > /dev/null
3619 - done
3620 -
3621 - insinto /etc/postgresql-${SLOT}
3622 - newins src/bin/psql/psqlrc.sample psqlrc
3623 -
3624 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
3625 - # needed by extensions utilizing PGXS.
3626 - use static-libs || \
3627 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
3628 - -delete
3629 -
3630 - # Make slot specific links to programs
3631 - local f bn
3632 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
3633 - -mindepth 1 -maxdepth 1)
3634 - do
3635 - bn=$(basename "${f}")
3636 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
3637 - "/usr/bin/${bn}${SLOT/.}"
3638 - done
3639 -
3640 - if use doc ; then
3641 - docinto html
3642 - dodoc doc/src/sgml/html/*
3643 - fi
3644 -
3645 - if use server; then
3646 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
3647 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
3648 -
3649 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
3650 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
3651 -
3652 - if use systemd; then
3653 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
3654 - "${FILESDIR}/${PN}.service-9.6-r1" | \
3655 - systemd_newunit - ${PN}-${SLOT}.service
3656 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
3657 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
3658 - fi
3659 -
3660 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
3661 -
3662 - if use prefix ; then
3663 - keepdir /run/postgresql
3664 - fperms 1775 /run/postgresql
3665 - fi
3666 - fi
3667 -}
3668 -
3669 -pkg_postinst() {
3670 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
3671 - postgresql-config update
3672 -
3673 - elog "If you need a global psqlrc-file, you can place it in:"
3674 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
3675 -
3676 - if use server ; then
3677 - elog
3678 - elog "Gentoo specific documentation:"
3679 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
3680 - elog
3681 - elog "Official documentation:"
3682 - elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
3683 - elog
3684 - elog "The default location of the Unix-domain socket is:"
3685 - elog " ${EROOT}/run/postgresql/"
3686 - elog
3687 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
3688 - elog "so that it contains your preferred locale in:"
3689 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
3690 - elog
3691 - elog "Then, execute the following command to setup the initial database"
3692 - elog "environment:"
3693 - elog " emerge --config =${CATEGORY}/${PF}"
3694 -
3695 - if [[ -n ${REPLACING_VERSIONS} ]] ; then
3696 - ewarn "If your system is using 'pg_stat_statements' and you are running a"
3697 - ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
3698 - ewarn "the following command after upgrading:"
3699 - ewarn
3700 - ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
3701 - fi
3702 - fi
3703 -}
3704 -
3705 -pkg_prerm() {
3706 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
3707 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
3708 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
3709 -
3710 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
3711 - sleep 10
3712 - eend 0
3713 - fi
3714 -}
3715 -
3716 -pkg_postrm() {
3717 - postgresql-config update
3718 -}
3719 -
3720 -pkg_config() {
3721 - use server || die "USE flag 'server' not enabled. Nothing to configure."
3722 -
3723 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
3724 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
3725 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
3726 - [[ -z "${DATA_DIR}" ]] \
3727 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
3728 -
3729 - # environment.bz2 may not contain the same locale as the current system
3730 - # locale. Unset and source from the current system locale.
3731 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
3732 - unset LANG
3733 - unset LC_CTYPE
3734 - unset LC_NUMERIC
3735 - unset LC_TIME
3736 - unset LC_COLLATE
3737 - unset LC_MONETARY
3738 - unset LC_MESSAGES
3739 - unset LC_ALL
3740 - source "${EROOT}/etc/env.d/02locale"
3741 - [ -n "${LANG}" ] && export LANG
3742 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
3743 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
3744 - [ -n "${LC_TIME}" ] && export LC_TIME
3745 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
3746 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
3747 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
3748 - [ -n "${LC_ALL}" ] && export LC_ALL
3749 - fi
3750 -
3751 - einfo "You can modify the paths and options passed to initdb by editing:"
3752 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
3753 - einfo
3754 - einfo "Information on options that can be passed to initdb are found at:"
3755 - einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
3756 - einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
3757 - einfo
3758 - einfo "PG_INITDB_OPTS is currently set to:"
3759 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
3760 - einfo " (none)"
3761 - else
3762 - einfo " ${PG_INITDB_OPTS}"
3763 - fi
3764 - einfo
3765 - einfo "Configuration files will be installed to:"
3766 - einfo " ${PGDATA}"
3767 - einfo
3768 - einfo "The database cluster will be created in:"
3769 - einfo " ${DATA_DIR}"
3770 - einfo
3771 -
3772 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
3773 - sleep 5
3774 - eend 0
3775 -
3776 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
3777 - eerror "The given directory, '${DATA_DIR}', is not empty."
3778 - eerror "Modify DATA_DIR to point to an empty directory."
3779 - die "${DATA_DIR} is not empty."
3780 - fi
3781 -
3782 - einfo "Creating the data directory ..."
3783 - if [[ ${EUID} == 0 ]] ; then
3784 - mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
3785 - mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
3786 - chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
3787 - fi
3788 -
3789 - einfo "Initializing the database ..."
3790 -
3791 - if [[ ${EUID} == 0 ]] ; then
3792 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
3793 - else
3794 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
3795 - fi
3796 -
3797 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
3798 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
3799 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
3800 - fi
3801 -
3802 - # unix_socket_directory has no effect in postgresql.conf as it's
3803 - # overridden in the initscript
3804 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
3805 -
3806 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
3807 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
3808 - # On the off-chance that you might need to work with UTF-8 encoded
3809 - # characters in PL/Perl
3810 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
3811 - EOF
3812 -
3813 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
3814 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
3815 - einfo "by default. You can disable it in the cluster's:"
3816 - einfo " ${PGDATA%/}/postgresql.conf"
3817 - einfo
3818 - if ! use systemd; then
3819 - einfo "The PostgreSQL server, by default, will log events to:"
3820 - einfo " ${DATA_DIR%/}/postmaster.log"
3821 - einfo
3822 - fi
3823 - if use prefix ; then
3824 - einfo "The location of the configuration files have moved to:"
3825 - einfo " ${PGDATA}"
3826 - einfo "To start the server:"
3827 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
3828 - einfo "To stop:"
3829 - einfo " pg_ctl stop -D ${DATA_DIR}"
3830 - einfo
3831 - einfo "Or move the configuration files back:"
3832 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
3833 - elif use systemd; then
3834 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
3835 - einfo "instead of 'pg_ctl'."
3836 - else
3837 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
3838 - einfo "instead of 'pg_ctl'."
3839 - fi
3840 -}
3841 -
3842 -src_test() {
3843 - if use server && [[ ${UID} -ne 0 ]] ; then
3844 - emake check
3845 -
3846 - einfo "If you think other tests besides the regression tests are necessary, please"
3847 - einfo "submit a bug including a patch for this ebuild to enable them."
3848 - else
3849 - use server || \
3850 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
3851 - [[ ${UID} -eq 0 ]] || \
3852 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
3853 -
3854 - ewarn 'Skipping.'
3855 - fi
3856 -}
3857
3858 diff --git a/dev-db/postgresql/postgresql-9.4.22-r1.ebuild b/dev-db/postgresql/postgresql-9.4.22-r1.ebuild
3859 deleted file mode 100644
3860 index 2f5d0dd70e4..00000000000
3861 --- a/dev-db/postgresql/postgresql-9.4.22-r1.ebuild
3862 +++ /dev/null
3863 @@ -1,479 +0,0 @@
3864 -# Copyright 1999-2020 Gentoo Authors
3865 -# Distributed under the terms of the GNU General Public License v2
3866 -
3867 -EAPI=7
3868 -
3869 -PYTHON_COMPAT=( python3_{6,7} )
3870 -
3871 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
3872 - zh_TW"
3873 -
3874 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
3875 - systemd user
3876 -
3877 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris"
3878 -
3879 -SLOT=$(ver_cut 1-2)
3880 -
3881 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
3882 -
3883 -LICENSE="POSTGRESQL GPL-2"
3884 -DESCRIPTION="PostgreSQL RDBMS"
3885 -HOMEPAGE="https://www.postgresql.org/"
3886 -
3887 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
3888 - -pg_legacytimestamp python +readline selinux +server systemd ssl
3889 - static-libs tcl threads uuid xml zlib"
3890 -
3891 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
3892 -
3893 -CDEPEND="
3894 ->=app-eselect/eselect-postgresql-2.0
3895 -sys-apps/less
3896 -virtual/libintl
3897 -kerberos? ( virtual/krb5 )
3898 -ldap? ( net-nds/openldap )
3899 -pam? ( sys-libs/pam )
3900 -perl? ( >=dev-lang/perl-5.8:= )
3901 -python? ( ${PYTHON_DEPS} )
3902 -readline? ( sys-libs/readline:0= )
3903 -ssl? (
3904 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
3905 - libressl? ( dev-libs/libressl:= )
3906 -)
3907 -tcl? ( >=dev-lang/tcl-8:0= )
3908 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
3909 -zlib? ( sys-libs/zlib )
3910 -"
3911 -
3912 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
3913 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
3914 -# the libc includes UUID functions.
3915 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
3916 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
3917 -
3918 -nest_usedep() {
3919 - local front back
3920 - while [[ ${#} -gt 1 ]]; do
3921 - front+="${1}? ( "
3922 - back+=" )"
3923 - shift
3924 - done
3925 - echo "${front}${1}${back}"
3926 -}
3927 -
3928 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
3929 -CDEPEND+="
3930 -uuid? (
3931 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
3932 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
3933 -)"
3934 -
3935 -DEPEND="${CDEPEND}
3936 -!!<sys-apps/sandbox-2.0
3937 -sys-devel/bison
3938 -sys-devel/flex
3939 -nls? ( sys-devel/gettext )
3940 -xml? ( virtual/pkgconfig )
3941 -"
3942 -
3943 -RDEPEND="${CDEPEND}
3944 -!dev-db/postgresql-docs:${SLOT}
3945 -!dev-db/postgresql-base:${SLOT}
3946 -!dev-db/postgresql-server:${SLOT}
3947 -selinux? ( sec-policy/selinux-postgresql )
3948 -"
3949 -
3950 -pkg_setup() {
3951 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
3952 -
3953 - enewgroup postgres 70
3954 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
3955 -
3956 - use python && python-single-r1_pkg_setup
3957 -}
3958 -
3959 -src_prepare() {
3960 - # Work around PPC{,64} compilation bug where bool is already defined
3961 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
3962 -
3963 - # Set proper run directory
3964 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
3965 - -i src/include/pg_config_manual.h || die
3966 -
3967 - # Rely on $PATH being in the proper order so that the correct
3968 - # install program is used for modules utilizing PGXS in both
3969 - # hardened and non-hardened environments. (Bug #528786)
3970 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
3971 -
3972 - use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
3973 -
3974 - if use pam ; then
3975 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
3976 - -i src/backend/libpq/auth.c || \
3977 - die 'PGSQL_PAM_SERVICE rename failed.'
3978 - fi
3979 -
3980 - eapply_user
3981 -}
3982 -
3983 -src_configure() {
3984 - case ${CHOST} in
3985 - *-darwin*|*-solaris*)
3986 - use nls && append-libs intl
3987 - ;;
3988 - esac
3989 -
3990 - export LDFLAGS_SL="${LDFLAGS}"
3991 - export LDFLAGS_EX="${LDFLAGS}"
3992 -
3993 - local PO="${EPREFIX}"
3994 -
3995 - local i uuid_config=""
3996 - if use uuid; then
3997 - for i in ${UTIL_LINUX_LIBC[@]}; do
3998 - use ${i} && uuid_config="--with-uuid=e2fs"
3999 - done
4000 - for i in ${BSD_LIBC[@]}; do
4001 - use ${i} && uuid_config="--with-uuid=bsd"
4002 - done
4003 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
4004 - fi
4005 -
4006 - econf \
4007 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
4008 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
4009 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
4010 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
4011 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
4012 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
4013 - $(use_enable !pg_legacytimestamp integer-datetimes) \
4014 - $(use_enable debug) \
4015 - $(use_enable threads thread-safety) \
4016 - $(use_with kerberos gssapi) \
4017 - $(use_with ldap) \
4018 - $(use_with pam) \
4019 - $(use_with perl) \
4020 - $(use_with python) \
4021 - $(use_with readline) \
4022 - $(use_with ssl openssl) \
4023 - $(use_with tcl) \
4024 - ${uuid_config} \
4025 - $(use_with xml libxml) \
4026 - $(use_with xml libxslt) \
4027 - $(use_with zlib) \
4028 - $(use_enable nls nls "'$(l10n_get_locales)'")
4029 -}
4030 -
4031 -src_compile() {
4032 - emake
4033 - emake -C contrib
4034 -}
4035 -
4036 -src_install() {
4037 - emake DESTDIR="${D}" install
4038 - emake DESTDIR="${D}" install -C contrib
4039 -
4040 - dodoc README HISTORY doc/{TODO,bug.template}
4041 -
4042 - # man pages are already built, but if we have the target make them,
4043 - # they'll be generated from source before being installed so we
4044 - # manually install man pages.
4045 - # We use ${SLOT} instead of doman for postgresql.eselect
4046 - insinto /usr/share/postgresql-${SLOT}/man/
4047 - doins -r doc/src/sgml/man{1,3,7}
4048 - if ! use server; then
4049 - # Remove man pages for non-existent binaries
4050 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
4051 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
4052 - done
4053 - fi
4054 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
4055 -
4056 - # Create slot specific man pages
4057 - local bn f mansec slotted_name
4058 - for mansec in 1 3 7 ; do
4059 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
4060 -
4061 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
4062 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
4063 -
4064 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
4065 - bn=$(basename "${f}")
4066 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
4067 - case ${bn} in
4068 - TABLE.7|WITH.7)
4069 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
4070 - ;;
4071 - *)
4072 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
4073 - ;;
4074 - esac
4075 - done
4076 -
4077 - popd > /dev/null
4078 - done
4079 -
4080 - insinto /etc/postgresql-${SLOT}
4081 - newins src/bin/psql/psqlrc.sample psqlrc
4082 -
4083 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
4084 - # needed by extensions utilizing PGXS.
4085 - use static-libs || \
4086 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
4087 - -delete
4088 -
4089 - local f bn
4090 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
4091 - -mindepth 1 -maxdepth 1)
4092 - do
4093 - bn=$(basename "${f}")
4094 - # Temporarily tack on tmp to workaround a file collision
4095 - # issue. This is only necessary for 9.7 and earlier. 10 never
4096 - # had this issue.
4097 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
4098 - "/usr/bin/${bn}${SLOT/.}tmp"
4099 - done
4100 -
4101 - if use doc ; then
4102 - docinto html
4103 - dodoc doc/src/sgml/html/*
4104 -
4105 - docinto sgml
4106 - dodoc doc/src/sgml/*.{sgml,dsl}
4107 - fi
4108 -
4109 - if use server; then
4110 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
4111 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
4112 -
4113 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
4114 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
4115 -
4116 - if use systemd; then
4117 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
4118 - "${FILESDIR}/${PN}.service-9.2" | \
4119 - systemd_newunit - ${PN}-${SLOT}.service
4120 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
4121 - fi
4122 -
4123 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
4124 -
4125 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
4126 -
4127 - if use prefix ; then
4128 - keepdir /run/postgresql
4129 - fperms 1775 /run/postgresql
4130 - fi
4131 - fi
4132 -}
4133 -
4134 -pkg_preinst() {
4135 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
4136 - # /usr/bin/psql96). They may have been created by the
4137 - # postgresql.eselect module, but they're handled within this ebuild
4138 - # now. It's alright if we momentarily delete /usr/bin/psql as it
4139 - # will be recreated by the eselect module in pkg_ppostinst(). This
4140 - # is only necessary for 9.7 and earlier. 10 and later were never
4141 - # handled in this manner.
4142 - local canonicalise
4143 - if type -p realpath > /dev/null; then
4144 - canonicalise=realpath
4145 - elif type -p readlink > /dev/null; then
4146 - canonicalise='readlink -f'
4147 - else
4148 - # can't die, subshell
4149 - die "No readlink nor realpath found, cannot canonicalise"
4150 - fi
4151 -
4152 - local l
4153 - # First remove any symlinks in /usr/bin that may have been created
4154 - # by the old eselect
4155 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
4156 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
4157 - rm "${l}" || ewarn "Couldn't remove ${l}"
4158 - fi
4159 - done
4160 -
4161 - # Then move the symlinks created by the ebuild to their proper place.
4162 - for l in "${ED}"/usr/bin/*tmp ; do
4163 - mv "${l}" "${l%tmp}" \
4164 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
4165 - done
4166 -}
4167 -
4168 -pkg_postinst() {
4169 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
4170 - postgresql-config update
4171 -
4172 - elog "If you need a global psqlrc-file, you can place it in:"
4173 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
4174 -
4175 - if use server ; then
4176 - elog
4177 - elog "Gentoo specific documentation:"
4178 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
4179 - elog
4180 - elog "Official documentation:"
4181 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
4182 - elog
4183 - elog "The default location of the Unix-domain socket is:"
4184 - elog " ${EROOT}/run/postgresql/"
4185 - elog
4186 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
4187 - elog "so that it contains your preferred locale in:"
4188 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
4189 - elog
4190 - elog "Then, execute the following command to setup the initial database"
4191 - elog "environment:"
4192 - elog " emerge --config =${CATEGORY}/${PF}"
4193 - fi
4194 -}
4195 -
4196 -pkg_prerm() {
4197 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
4198 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
4199 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
4200 -
4201 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
4202 - sleep 10
4203 - eend 0
4204 - fi
4205 -}
4206 -
4207 -pkg_postrm() {
4208 - postgresql-config update
4209 -}
4210 -
4211 -pkg_config() {
4212 - use server || die "USE flag 'server' not enabled. Nothing to configure."
4213 -
4214 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
4215 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
4216 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
4217 - [[ -z "${DATA_DIR}" ]] \
4218 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
4219 -
4220 - # environment.bz2 may not contain the same locale as the current system
4221 - # locale. Unset and source from the current system locale.
4222 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
4223 - unset LANG
4224 - unset LC_CTYPE
4225 - unset LC_NUMERIC
4226 - unset LC_TIME
4227 - unset LC_COLLATE
4228 - unset LC_MONETARY
4229 - unset LC_MESSAGES
4230 - unset LC_ALL
4231 - source "${EROOT}/etc/env.d/02locale"
4232 - [ -n "${LANG}" ] && export LANG
4233 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
4234 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
4235 - [ -n "${LC_TIME}" ] && export LC_TIME
4236 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
4237 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
4238 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
4239 - [ -n "${LC_ALL}" ] && export LC_ALL
4240 - fi
4241 -
4242 - einfo "You can modify the paths and options passed to initdb by editing:"
4243 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
4244 - einfo
4245 - einfo "Information on options that can be passed to initdb are found at:"
4246 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
4247 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
4248 - einfo
4249 - einfo "PG_INITDB_OPTS is currently set to:"
4250 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
4251 - einfo " (none)"
4252 - else
4253 - einfo " ${PG_INITDB_OPTS}"
4254 - fi
4255 - einfo
4256 - einfo "Configuration files will be installed to:"
4257 - einfo " ${PGDATA}"
4258 - einfo
4259 - einfo "The database cluster will be created in:"
4260 - einfo " ${DATA_DIR}"
4261 - einfo
4262 -
4263 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
4264 - sleep 5
4265 - eend 0
4266 -
4267 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
4268 - eerror "The given directory, '${DATA_DIR}', is not empty."
4269 - eerror "Modify DATA_DIR to point to an empty directory."
4270 - die "${DATA_DIR} is not empty."
4271 - fi
4272 -
4273 - einfo "Creating the data directory ..."
4274 - if [[ ${EUID} == 0 ]] ; then
4275 - mkdir -p "${DATA_DIR}"
4276 - chown -Rf postgres:postgres "${DATA_DIR}"
4277 - chmod 0700 "${DATA_DIR}"
4278 - fi
4279 -
4280 - einfo "Initializing the database ..."
4281 -
4282 - if [[ ${EUID} == 0 ]] ; then
4283 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
4284 - else
4285 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
4286 - fi
4287 -
4288 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
4289 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
4290 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
4291 - fi
4292 -
4293 - # unix_socket_directory has no effect in postgresql.conf as it's
4294 - # overridden in the initscript
4295 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
4296 -
4297 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
4298 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
4299 - # On the off-chance that you might need to work with UTF-8 encoded
4300 - # characters in PL/Perl
4301 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
4302 - EOF
4303 -
4304 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
4305 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
4306 - einfo "by default. You can disable it in the cluster's:"
4307 - einfo " ${PGDATA%/}/postgresql.conf"
4308 - einfo
4309 - einfo "The PostgreSQL server, by default, will log events to:"
4310 - einfo " ${DATA_DIR%/}/postmaster.log"
4311 - einfo
4312 - if use prefix ; then
4313 - einfo "The location of the configuration files have moved to:"
4314 - einfo " ${PGDATA}"
4315 - einfo "To start the server:"
4316 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
4317 - einfo "To stop:"
4318 - einfo " pg_ctl stop -D ${DATA_DIR}"
4319 - einfo
4320 - einfo "Or move the configuration files back:"
4321 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
4322 - else
4323 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
4324 - einfo "instead of 'pg_ctl'."
4325 - fi
4326 -}
4327 -
4328 -src_test() {
4329 - if use server && [[ ${UID} -ne 0 ]] ; then
4330 - emake check
4331 -
4332 - einfo "If you think other tests besides the regression tests are necessary, please"
4333 - einfo "submit a bug including a patch for this ebuild to enable them."
4334 - else
4335 - use server || \
4336 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
4337 - [[ ${UID} -eq 0 ]] || \
4338 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
4339 -
4340 - ewarn 'Skipping.'
4341 - fi
4342 -}
4343
4344 diff --git a/dev-db/postgresql/postgresql-9.4.22.ebuild b/dev-db/postgresql/postgresql-9.4.22.ebuild
4345 deleted file mode 100644
4346 index fe382d533a6..00000000000
4347 --- a/dev-db/postgresql/postgresql-9.4.22.ebuild
4348 +++ /dev/null
4349 @@ -1,474 +0,0 @@
4350 -# Copyright 1999-2020 Gentoo Authors
4351 -# Distributed under the terms of the GNU General Public License v2
4352 -
4353 -EAPI="6"
4354 -
4355 -PYTHON_COMPAT=( python3_6 )
4356 -
4357 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
4358 - zh_TW"
4359 -
4360 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
4361 - systemd user versionator
4362 -
4363 -KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
4364 -
4365 -SLOT="$(get_version_component_range 1-2)"
4366 -
4367 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
4368 -
4369 -LICENSE="POSTGRESQL GPL-2"
4370 -DESCRIPTION="PostgreSQL RDBMS"
4371 -HOMEPAGE="https://www.postgresql.org/"
4372 -
4373 -IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp
4374 - python +readline selinux +server systemd ssl static-libs tcl threads uuid
4375 - xml zlib"
4376 -
4377 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
4378 -
4379 -CDEPEND="
4380 ->=app-eselect/eselect-postgresql-2.0
4381 -sys-apps/less
4382 -virtual/libintl
4383 -kerberos? ( virtual/krb5 )
4384 -ldap? ( net-nds/openldap )
4385 -pam? ( sys-libs/pam )
4386 -perl? ( >=dev-lang/perl-5.8:= )
4387 -python? ( ${PYTHON_DEPS} )
4388 -readline? ( sys-libs/readline:0= )
4389 -ssl? (
4390 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
4391 - libressl? ( dev-libs/libressl:= )
4392 -)
4393 -tcl? ( >=dev-lang/tcl-8:0= )
4394 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
4395 -zlib? ( sys-libs/zlib )
4396 -"
4397 -
4398 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
4399 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
4400 -# the libc includes UUID functions.
4401 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
4402 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
4403 -
4404 -nest_usedep() {
4405 - local front back
4406 - while [[ ${#} -gt 1 ]]; do
4407 - front+="${1}? ( "
4408 - back+=" )"
4409 - shift
4410 - done
4411 - echo "${front}${1}${back}"
4412 -}
4413 -
4414 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
4415 -CDEPEND+="
4416 -uuid? (
4417 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
4418 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
4419 -)"
4420 -
4421 -DEPEND="${CDEPEND}
4422 -!!<sys-apps/sandbox-2.0
4423 -sys-devel/bison
4424 -sys-devel/flex
4425 -nls? ( sys-devel/gettext )
4426 -xml? ( virtual/pkgconfig )
4427 -"
4428 -
4429 -RDEPEND="${CDEPEND}
4430 -!dev-db/postgresql-docs:${SLOT}
4431 -!dev-db/postgresql-base:${SLOT}
4432 -!dev-db/postgresql-server:${SLOT}
4433 -selinux? ( sec-policy/selinux-postgresql )
4434 -"
4435 -
4436 -pkg_setup() {
4437 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
4438 -
4439 - enewgroup postgres 70
4440 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
4441 -
4442 - use python && python-single-r1_pkg_setup
4443 -}
4444 -
4445 -src_prepare() {
4446 - # Work around PPC{,64} compilation bug where bool is already defined
4447 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
4448 -
4449 - # Set proper run directory
4450 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
4451 - -i src/include/pg_config_manual.h || die
4452 -
4453 - # Rely on $PATH being in the proper order so that the correct
4454 - # install program is used for modules utilizing PGXS in both
4455 - # hardened and non-hardened environments. (Bug #528786)
4456 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
4457 -
4458 - use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
4459 -
4460 - if use pam ; then
4461 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
4462 - -i src/backend/libpq/auth.c || \
4463 - die 'PGSQL_PAM_SERVICE rename failed.'
4464 - fi
4465 -
4466 - eapply_user
4467 -}
4468 -
4469 -src_configure() {
4470 - case ${CHOST} in
4471 - *-darwin*|*-solaris*)
4472 - use nls && append-libs intl
4473 - ;;
4474 - esac
4475 -
4476 - export LDFLAGS_SL="${LDFLAGS}"
4477 - export LDFLAGS_EX="${LDFLAGS}"
4478 -
4479 - local PO="${EPREFIX}"
4480 -
4481 - local i uuid_config=""
4482 - if use uuid; then
4483 - for i in ${UTIL_LINUX_LIBC[@]}; do
4484 - use ${i} && uuid_config="--with-uuid=e2fs"
4485 - done
4486 - for i in ${BSD_LIBC[@]}; do
4487 - use ${i} && uuid_config="--with-uuid=bsd"
4488 - done
4489 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
4490 - fi
4491 -
4492 - econf \
4493 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
4494 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
4495 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
4496 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
4497 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
4498 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
4499 - $(use_enable !pg_legacytimestamp integer-datetimes) \
4500 - $(use_enable threads thread-safety) \
4501 - $(use_with kerberos gssapi) \
4502 - $(use_with ldap) \
4503 - $(use_with pam) \
4504 - $(use_with perl) \
4505 - $(use_with python) \
4506 - $(use_with readline) \
4507 - $(use_with ssl openssl) \
4508 - $(use_with tcl) \
4509 - ${uuid_config} \
4510 - $(use_with xml libxml) \
4511 - $(use_with xml libxslt) \
4512 - $(use_with zlib) \
4513 - $(use_enable nls nls "'$(l10n_get_locales)'")
4514 -}
4515 -
4516 -src_compile() {
4517 - emake
4518 - emake -C contrib
4519 -}
4520 -
4521 -src_install() {
4522 - emake DESTDIR="${D}" install
4523 - emake DESTDIR="${D}" install -C contrib
4524 -
4525 - dodoc README HISTORY doc/{TODO,bug.template}
4526 -
4527 - # man pages are already built, but if we have the target make them,
4528 - # they'll be generated from source before being installed so we
4529 - # manually install man pages.
4530 - # We use ${SLOT} instead of doman for postgresql.eselect
4531 - insinto /usr/share/postgresql-${SLOT}/man/
4532 - doins -r doc/src/sgml/man{1,3,7}
4533 - if ! use server; then
4534 - # Remove man pages for non-existent binaries
4535 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
4536 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
4537 - done
4538 - fi
4539 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
4540 -
4541 - # Create slot specific man pages
4542 - local bn f mansec slotted_name
4543 - for mansec in 1 3 7 ; do
4544 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
4545 -
4546 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
4547 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
4548 -
4549 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
4550 - bn=$(basename "${f}")
4551 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
4552 - case ${bn} in
4553 - TABLE.7|WITH.7)
4554 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
4555 - ;;
4556 - *)
4557 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
4558 - ;;
4559 - esac
4560 - done
4561 -
4562 - popd > /dev/null
4563 - done
4564 -
4565 - insinto /etc/postgresql-${SLOT}
4566 - newins src/bin/psql/psqlrc.sample psqlrc
4567 -
4568 - use static-libs || find "${ED}" -name '*.a' -delete
4569 -
4570 - local f bn
4571 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
4572 - -mindepth 1 -maxdepth 1)
4573 - do
4574 - bn=$(basename "${f}")
4575 - # Temporarily tack on tmp to workaround a file collision
4576 - # issue. This is only necessary for 9.7 and earlier. 10 never
4577 - # had this issue.
4578 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
4579 - "/usr/bin/${bn}${SLOT/.}tmp"
4580 - done
4581 -
4582 - if use doc ; then
4583 - docinto html
4584 - dodoc doc/src/sgml/html/*
4585 -
4586 - docinto sgml
4587 - dodoc doc/src/sgml/*.{sgml,dsl}
4588 - fi
4589 -
4590 - if use server; then
4591 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
4592 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
4593 -
4594 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
4595 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
4596 -
4597 - if use systemd; then
4598 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
4599 - "${FILESDIR}/${PN}.service-9.2" | \
4600 - systemd_newunit - ${PN}-${SLOT}.service
4601 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
4602 - fi
4603 -
4604 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
4605 -
4606 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
4607 -
4608 - if use prefix ; then
4609 - keepdir /run/postgresql
4610 - fperms 1775 /run/postgresql
4611 - fi
4612 - fi
4613 -}
4614 -
4615 -pkg_preinst() {
4616 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
4617 - # /usr/bin/psql96). They may have been created by the
4618 - # postgresql.eselect module, but they're handled within this ebuild
4619 - # now. It's alright if we momentarily delete /usr/bin/psql as it
4620 - # will be recreated by the eselect module in pkg_ppostinst(). This
4621 - # is only necessary for 9.7 and earlier. 10 and later were never
4622 - # handled in this manner.
4623 - local canonicalise
4624 - if type -p realpath > /dev/null; then
4625 - canonicalise=realpath
4626 - elif type -p readlink > /dev/null; then
4627 - canonicalise='readlink -f'
4628 - else
4629 - # can't die, subshell
4630 - die "No readlink nor realpath found, cannot canonicalise"
4631 - fi
4632 -
4633 - local l
4634 - # First remove any symlinks in /usr/bin that may have been created
4635 - # by the old eselect
4636 - for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
4637 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
4638 - rm "${l}" || ewarn "Couldn't remove ${l}"
4639 - fi
4640 - done
4641 -
4642 - # Then move the symlinks created by the ebuild to their proper place.
4643 - for l in "${ED}"/usr/bin/*tmp ; do
4644 - mv "${l}" "${l%tmp}" \
4645 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
4646 - done
4647 -}
4648 -
4649 -pkg_postinst() {
4650 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
4651 - postgresql-config update
4652 -
4653 - elog "If you need a global psqlrc-file, you can place it in:"
4654 - elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
4655 -
4656 - if use server ; then
4657 - elog
4658 - elog "Gentoo specific documentation:"
4659 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
4660 - elog
4661 - elog "Official documentation:"
4662 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
4663 - elog
4664 - elog "The default location of the Unix-domain socket is:"
4665 - elog " ${EROOT%/}/run/postgresql/"
4666 - elog
4667 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
4668 - elog "so that it contains your preferred locale in:"
4669 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
4670 - elog
4671 - elog "Then, execute the following command to setup the initial database"
4672 - elog "environment:"
4673 - elog " emerge --config =${CATEGORY}/${PF}"
4674 - fi
4675 -}
4676 -
4677 -pkg_prerm() {
4678 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
4679 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
4680 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
4681 -
4682 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
4683 - sleep 10
4684 - eend 0
4685 - fi
4686 -}
4687 -
4688 -pkg_postrm() {
4689 - postgresql-config update
4690 -}
4691 -
4692 -pkg_config() {
4693 - use server || die "USE flag 'server' not enabled. Nothing to configure."
4694 -
4695 - [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
4696 - && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
4697 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
4698 - [[ -z "${DATA_DIR}" ]] \
4699 - && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
4700 -
4701 - # environment.bz2 may not contain the same locale as the current system
4702 - # locale. Unset and source from the current system locale.
4703 - if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
4704 - unset LANG
4705 - unset LC_CTYPE
4706 - unset LC_NUMERIC
4707 - unset LC_TIME
4708 - unset LC_COLLATE
4709 - unset LC_MONETARY
4710 - unset LC_MESSAGES
4711 - unset LC_ALL
4712 - source "${EROOT%/}/etc/env.d/02locale"
4713 - [ -n "${LANG}" ] && export LANG
4714 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
4715 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
4716 - [ -n "${LC_TIME}" ] && export LC_TIME
4717 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
4718 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
4719 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
4720 - [ -n "${LC_ALL}" ] && export LC_ALL
4721 - fi
4722 -
4723 - einfo "You can modify the paths and options passed to initdb by editing:"
4724 - einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
4725 - einfo
4726 - einfo "Information on options that can be passed to initdb are found at:"
4727 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
4728 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
4729 - einfo
4730 - einfo "PG_INITDB_OPTS is currently set to:"
4731 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
4732 - einfo " (none)"
4733 - else
4734 - einfo " ${PG_INITDB_OPTS}"
4735 - fi
4736 - einfo
4737 - einfo "Configuration files will be installed to:"
4738 - einfo " ${PGDATA}"
4739 - einfo
4740 - einfo "The database cluster will be created in:"
4741 - einfo " ${DATA_DIR}"
4742 - einfo
4743 -
4744 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
4745 - sleep 5
4746 - eend 0
4747 -
4748 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
4749 - eerror "The given directory, '${DATA_DIR}', is not empty."
4750 - eerror "Modify DATA_DIR to point to an empty directory."
4751 - die "${DATA_DIR} is not empty."
4752 - fi
4753 -
4754 - einfo "Creating the data directory ..."
4755 - if [[ ${EUID} == 0 ]] ; then
4756 - mkdir -p "${DATA_DIR}"
4757 - chown -Rf postgres:postgres "${DATA_DIR}"
4758 - chmod 0700 "${DATA_DIR}"
4759 - fi
4760 -
4761 - einfo "Initializing the database ..."
4762 -
4763 - if [[ ${EUID} == 0 ]] ; then
4764 - su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
4765 - else
4766 - "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
4767 - fi
4768 -
4769 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
4770 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
4771 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
4772 - fi
4773 -
4774 - # unix_socket_directory has no effect in postgresql.conf as it's
4775 - # overridden in the initscript
4776 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
4777 -
4778 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
4779 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
4780 - # On the off-chance that you might need to work with UTF-8 encoded
4781 - # characters in PL/Perl
4782 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
4783 - EOF
4784 -
4785 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
4786 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
4787 - einfo "by default. You can disable it in the cluster's:"
4788 - einfo " ${PGDATA%/}/postgresql.conf"
4789 - einfo
4790 - einfo "The PostgreSQL server, by default, will log events to:"
4791 - einfo " ${DATA_DIR%/}/postmaster.log"
4792 - einfo
4793 - if use prefix ; then
4794 - einfo "The location of the configuration files have moved to:"
4795 - einfo " ${PGDATA}"
4796 - einfo "To start the server:"
4797 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
4798 - einfo "To stop:"
4799 - einfo " pg_ctl stop -D ${DATA_DIR}"
4800 - einfo
4801 - einfo "Or move the configuration files back:"
4802 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
4803 - else
4804 - einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
4805 - einfo "instead of 'pg_ctl'."
4806 - fi
4807 -}
4808 -
4809 -src_test() {
4810 - if use server && [[ ${UID} -ne 0 ]] ; then
4811 - emake check
4812 -
4813 - einfo "If you think other tests besides the regression tests are necessary, please"
4814 - einfo "submit a bug including a patch for this ebuild to enable them."
4815 - else
4816 - use server || \
4817 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
4818 - [[ ${UID} -eq 0 ]] || \
4819 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
4820 -
4821 - ewarn 'Skipping.'
4822 - fi
4823 -}
4824
4825 diff --git a/dev-db/postgresql/postgresql-9.4.23.ebuild b/dev-db/postgresql/postgresql-9.4.23.ebuild
4826 deleted file mode 100644
4827 index c0f771cbb87..00000000000
4828 --- a/dev-db/postgresql/postgresql-9.4.23.ebuild
4829 +++ /dev/null
4830 @@ -1,479 +0,0 @@
4831 -# Copyright 1999-2020 Gentoo Authors
4832 -# Distributed under the terms of the GNU General Public License v2
4833 -
4834 -EAPI=7
4835 -
4836 -PYTHON_COMPAT=( python3_{6,7} )
4837 -
4838 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
4839 - zh_TW"
4840 -
4841 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
4842 - systemd user
4843 -
4844 -KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
4845 -
4846 -SLOT=$(ver_cut 1-2)
4847 -
4848 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
4849 -
4850 -LICENSE="POSTGRESQL GPL-2"
4851 -DESCRIPTION="PostgreSQL RDBMS"
4852 -HOMEPAGE="https://www.postgresql.org/"
4853 -
4854 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
4855 - -pg_legacytimestamp python +readline selinux +server systemd ssl
4856 - static-libs tcl threads uuid xml zlib"
4857 -
4858 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
4859 -
4860 -CDEPEND="
4861 ->=app-eselect/eselect-postgresql-2.0
4862 -sys-apps/less
4863 -virtual/libintl
4864 -kerberos? ( virtual/krb5 )
4865 -ldap? ( net-nds/openldap )
4866 -pam? ( sys-libs/pam )
4867 -perl? ( >=dev-lang/perl-5.8:= )
4868 -python? ( ${PYTHON_DEPS} )
4869 -readline? ( sys-libs/readline:0= )
4870 -ssl? (
4871 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
4872 - libressl? ( dev-libs/libressl:= )
4873 -)
4874 -tcl? ( >=dev-lang/tcl-8:0= )
4875 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
4876 -zlib? ( sys-libs/zlib )
4877 -"
4878 -
4879 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
4880 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
4881 -# the libc includes UUID functions.
4882 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
4883 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
4884 -
4885 -nest_usedep() {
4886 - local front back
4887 - while [[ ${#} -gt 1 ]]; do
4888 - front+="${1}? ( "
4889 - back+=" )"
4890 - shift
4891 - done
4892 - echo "${front}${1}${back}"
4893 -}
4894 -
4895 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
4896 -CDEPEND+="
4897 -uuid? (
4898 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
4899 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
4900 -)"
4901 -
4902 -DEPEND="${CDEPEND}
4903 -!!<sys-apps/sandbox-2.0
4904 -sys-devel/bison
4905 -sys-devel/flex
4906 -nls? ( sys-devel/gettext )
4907 -xml? ( virtual/pkgconfig )
4908 -"
4909 -
4910 -RDEPEND="${CDEPEND}
4911 -!dev-db/postgresql-docs:${SLOT}
4912 -!dev-db/postgresql-base:${SLOT}
4913 -!dev-db/postgresql-server:${SLOT}
4914 -selinux? ( sec-policy/selinux-postgresql )
4915 -"
4916 -
4917 -pkg_setup() {
4918 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
4919 -
4920 - enewgroup postgres 70
4921 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
4922 -
4923 - use python && python-single-r1_pkg_setup
4924 -}
4925 -
4926 -src_prepare() {
4927 - # Work around PPC{,64} compilation bug where bool is already defined
4928 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
4929 -
4930 - # Set proper run directory
4931 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
4932 - -i src/include/pg_config_manual.h || die
4933 -
4934 - # Rely on $PATH being in the proper order so that the correct
4935 - # install program is used for modules utilizing PGXS in both
4936 - # hardened and non-hardened environments. (Bug #528786)
4937 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
4938 -
4939 - use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
4940 -
4941 - if use pam ; then
4942 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
4943 - -i src/backend/libpq/auth.c || \
4944 - die 'PGSQL_PAM_SERVICE rename failed.'
4945 - fi
4946 -
4947 - eapply_user
4948 -}
4949 -
4950 -src_configure() {
4951 - case ${CHOST} in
4952 - *-darwin*|*-solaris*)
4953 - use nls && append-libs intl
4954 - ;;
4955 - esac
4956 -
4957 - export LDFLAGS_SL="${LDFLAGS}"
4958 - export LDFLAGS_EX="${LDFLAGS}"
4959 -
4960 - local PO="${EPREFIX}"
4961 -
4962 - local i uuid_config=""
4963 - if use uuid; then
4964 - for i in ${UTIL_LINUX_LIBC[@]}; do
4965 - use ${i} && uuid_config="--with-uuid=e2fs"
4966 - done
4967 - for i in ${BSD_LIBC[@]}; do
4968 - use ${i} && uuid_config="--with-uuid=bsd"
4969 - done
4970 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
4971 - fi
4972 -
4973 - econf \
4974 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
4975 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
4976 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
4977 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
4978 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
4979 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
4980 - $(use_enable !pg_legacytimestamp integer-datetimes) \
4981 - $(use_enable debug) \
4982 - $(use_enable threads thread-safety) \
4983 - $(use_with kerberos gssapi) \
4984 - $(use_with ldap) \
4985 - $(use_with pam) \
4986 - $(use_with perl) \
4987 - $(use_with python) \
4988 - $(use_with readline) \
4989 - $(use_with ssl openssl) \
4990 - $(use_with tcl) \
4991 - ${uuid_config} \
4992 - $(use_with xml libxml) \
4993 - $(use_with xml libxslt) \
4994 - $(use_with zlib) \
4995 - $(use_enable nls nls "'$(l10n_get_locales)'")
4996 -}
4997 -
4998 -src_compile() {
4999 - emake
5000 - emake -C contrib
5001 -}
5002 -
5003 -src_install() {
5004 - emake DESTDIR="${D}" install
5005 - emake DESTDIR="${D}" install -C contrib
5006 -
5007 - dodoc README HISTORY doc/{TODO,bug.template}
5008 -
5009 - # man pages are already built, but if we have the target make them,
5010 - # they'll be generated from source before being installed so we
5011 - # manually install man pages.
5012 - # We use ${SLOT} instead of doman for postgresql.eselect
5013 - insinto /usr/share/postgresql-${SLOT}/man/
5014 - doins -r doc/src/sgml/man{1,3,7}
5015 - if ! use server; then
5016 - # Remove man pages for non-existent binaries
5017 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
5018 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
5019 - done
5020 - fi
5021 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
5022 -
5023 - # Create slot specific man pages
5024 - local bn f mansec slotted_name
5025 - for mansec in 1 3 7 ; do
5026 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
5027 -
5028 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
5029 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
5030 -
5031 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
5032 - bn=$(basename "${f}")
5033 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
5034 - case ${bn} in
5035 - TABLE.7|WITH.7)
5036 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
5037 - ;;
5038 - *)
5039 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
5040 - ;;
5041 - esac
5042 - done
5043 -
5044 - popd > /dev/null
5045 - done
5046 -
5047 - insinto /etc/postgresql-${SLOT}
5048 - newins src/bin/psql/psqlrc.sample psqlrc
5049 -
5050 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
5051 - # needed by extensions utilizing PGXS.
5052 - use static-libs || \
5053 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
5054 - -delete
5055 -
5056 - local f bn
5057 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
5058 - -mindepth 1 -maxdepth 1)
5059 - do
5060 - bn=$(basename "${f}")
5061 - # Temporarily tack on tmp to workaround a file collision
5062 - # issue. This is only necessary for 9.7 and earlier. 10 never
5063 - # had this issue.
5064 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
5065 - "/usr/bin/${bn}${SLOT/.}tmp"
5066 - done
5067 -
5068 - if use doc ; then
5069 - docinto html
5070 - dodoc doc/src/sgml/html/*
5071 -
5072 - docinto sgml
5073 - dodoc doc/src/sgml/*.{sgml,dsl}
5074 - fi
5075 -
5076 - if use server; then
5077 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
5078 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
5079 -
5080 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
5081 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
5082 -
5083 - if use systemd; then
5084 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
5085 - "${FILESDIR}/${PN}.service-9.2" | \
5086 - systemd_newunit - ${PN}-${SLOT}.service
5087 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
5088 - fi
5089 -
5090 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
5091 -
5092 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
5093 -
5094 - if use prefix ; then
5095 - keepdir /run/postgresql
5096 - fperms 1775 /run/postgresql
5097 - fi
5098 - fi
5099 -}
5100 -
5101 -pkg_preinst() {
5102 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
5103 - # /usr/bin/psql96). They may have been created by the
5104 - # postgresql.eselect module, but they're handled within this ebuild
5105 - # now. It's alright if we momentarily delete /usr/bin/psql as it
5106 - # will be recreated by the eselect module in pkg_ppostinst(). This
5107 - # is only necessary for 9.7 and earlier. 10 and later were never
5108 - # handled in this manner.
5109 - local canonicalise
5110 - if type -p realpath > /dev/null; then
5111 - canonicalise=realpath
5112 - elif type -p readlink > /dev/null; then
5113 - canonicalise='readlink -f'
5114 - else
5115 - # can't die, subshell
5116 - die "No readlink nor realpath found, cannot canonicalise"
5117 - fi
5118 -
5119 - local l
5120 - # First remove any symlinks in /usr/bin that may have been created
5121 - # by the old eselect
5122 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
5123 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
5124 - rm "${l}" || ewarn "Couldn't remove ${l}"
5125 - fi
5126 - done
5127 -
5128 - # Then move the symlinks created by the ebuild to their proper place.
5129 - for l in "${ED}"/usr/bin/*tmp ; do
5130 - mv "${l}" "${l%tmp}" \
5131 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
5132 - done
5133 -}
5134 -
5135 -pkg_postinst() {
5136 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
5137 - postgresql-config update
5138 -
5139 - elog "If you need a global psqlrc-file, you can place it in:"
5140 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
5141 -
5142 - if use server ; then
5143 - elog
5144 - elog "Gentoo specific documentation:"
5145 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
5146 - elog
5147 - elog "Official documentation:"
5148 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
5149 - elog
5150 - elog "The default location of the Unix-domain socket is:"
5151 - elog " ${EROOT}/run/postgresql/"
5152 - elog
5153 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
5154 - elog "so that it contains your preferred locale in:"
5155 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
5156 - elog
5157 - elog "Then, execute the following command to setup the initial database"
5158 - elog "environment:"
5159 - elog " emerge --config =${CATEGORY}/${PF}"
5160 - fi
5161 -}
5162 -
5163 -pkg_prerm() {
5164 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
5165 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
5166 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
5167 -
5168 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
5169 - sleep 10
5170 - eend 0
5171 - fi
5172 -}
5173 -
5174 -pkg_postrm() {
5175 - postgresql-config update
5176 -}
5177 -
5178 -pkg_config() {
5179 - use server || die "USE flag 'server' not enabled. Nothing to configure."
5180 -
5181 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
5182 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
5183 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
5184 - [[ -z "${DATA_DIR}" ]] \
5185 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
5186 -
5187 - # environment.bz2 may not contain the same locale as the current system
5188 - # locale. Unset and source from the current system locale.
5189 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
5190 - unset LANG
5191 - unset LC_CTYPE
5192 - unset LC_NUMERIC
5193 - unset LC_TIME
5194 - unset LC_COLLATE
5195 - unset LC_MONETARY
5196 - unset LC_MESSAGES
5197 - unset LC_ALL
5198 - source "${EROOT}/etc/env.d/02locale"
5199 - [ -n "${LANG}" ] && export LANG
5200 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
5201 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
5202 - [ -n "${LC_TIME}" ] && export LC_TIME
5203 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
5204 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
5205 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
5206 - [ -n "${LC_ALL}" ] && export LC_ALL
5207 - fi
5208 -
5209 - einfo "You can modify the paths and options passed to initdb by editing:"
5210 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
5211 - einfo
5212 - einfo "Information on options that can be passed to initdb are found at:"
5213 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
5214 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
5215 - einfo
5216 - einfo "PG_INITDB_OPTS is currently set to:"
5217 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
5218 - einfo " (none)"
5219 - else
5220 - einfo " ${PG_INITDB_OPTS}"
5221 - fi
5222 - einfo
5223 - einfo "Configuration files will be installed to:"
5224 - einfo " ${PGDATA}"
5225 - einfo
5226 - einfo "The database cluster will be created in:"
5227 - einfo " ${DATA_DIR}"
5228 - einfo
5229 -
5230 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
5231 - sleep 5
5232 - eend 0
5233 -
5234 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
5235 - eerror "The given directory, '${DATA_DIR}', is not empty."
5236 - eerror "Modify DATA_DIR to point to an empty directory."
5237 - die "${DATA_DIR} is not empty."
5238 - fi
5239 -
5240 - einfo "Creating the data directory ..."
5241 - if [[ ${EUID} == 0 ]] ; then
5242 - mkdir -p "${DATA_DIR}"
5243 - chown -Rf postgres:postgres "${DATA_DIR}"
5244 - chmod 0700 "${DATA_DIR}"
5245 - fi
5246 -
5247 - einfo "Initializing the database ..."
5248 -
5249 - if [[ ${EUID} == 0 ]] ; then
5250 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
5251 - else
5252 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
5253 - fi
5254 -
5255 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
5256 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
5257 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
5258 - fi
5259 -
5260 - # unix_socket_directory has no effect in postgresql.conf as it's
5261 - # overridden in the initscript
5262 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
5263 -
5264 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
5265 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
5266 - # On the off-chance that you might need to work with UTF-8 encoded
5267 - # characters in PL/Perl
5268 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
5269 - EOF
5270 -
5271 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
5272 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
5273 - einfo "by default. You can disable it in the cluster's:"
5274 - einfo " ${PGDATA%/}/postgresql.conf"
5275 - einfo
5276 - einfo "The PostgreSQL server, by default, will log events to:"
5277 - einfo " ${DATA_DIR%/}/postmaster.log"
5278 - einfo
5279 - if use prefix ; then
5280 - einfo "The location of the configuration files have moved to:"
5281 - einfo " ${PGDATA}"
5282 - einfo "To start the server:"
5283 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
5284 - einfo "To stop:"
5285 - einfo " pg_ctl stop -D ${DATA_DIR}"
5286 - einfo
5287 - einfo "Or move the configuration files back:"
5288 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
5289 - else
5290 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
5291 - einfo "instead of 'pg_ctl'."
5292 - fi
5293 -}
5294 -
5295 -src_test() {
5296 - if use server && [[ ${UID} -ne 0 ]] ; then
5297 - emake check
5298 -
5299 - einfo "If you think other tests besides the regression tests are necessary, please"
5300 - einfo "submit a bug including a patch for this ebuild to enable them."
5301 - else
5302 - use server || \
5303 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
5304 - [[ ${UID} -eq 0 ]] || \
5305 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
5306 -
5307 - ewarn 'Skipping.'
5308 - fi
5309 -}
5310
5311 diff --git a/dev-db/postgresql/postgresql-9.4.24.ebuild b/dev-db/postgresql/postgresql-9.4.24.ebuild
5312 deleted file mode 100644
5313 index 2f5d0dd70e4..00000000000
5314 --- a/dev-db/postgresql/postgresql-9.4.24.ebuild
5315 +++ /dev/null
5316 @@ -1,479 +0,0 @@
5317 -# Copyright 1999-2020 Gentoo Authors
5318 -# Distributed under the terms of the GNU General Public License v2
5319 -
5320 -EAPI=7
5321 -
5322 -PYTHON_COMPAT=( python3_{6,7} )
5323 -
5324 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
5325 - zh_TW"
5326 -
5327 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
5328 - systemd user
5329 -
5330 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris"
5331 -
5332 -SLOT=$(ver_cut 1-2)
5333 -
5334 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
5335 -
5336 -LICENSE="POSTGRESQL GPL-2"
5337 -DESCRIPTION="PostgreSQL RDBMS"
5338 -HOMEPAGE="https://www.postgresql.org/"
5339 -
5340 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
5341 - -pg_legacytimestamp python +readline selinux +server systemd ssl
5342 - static-libs tcl threads uuid xml zlib"
5343 -
5344 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
5345 -
5346 -CDEPEND="
5347 ->=app-eselect/eselect-postgresql-2.0
5348 -sys-apps/less
5349 -virtual/libintl
5350 -kerberos? ( virtual/krb5 )
5351 -ldap? ( net-nds/openldap )
5352 -pam? ( sys-libs/pam )
5353 -perl? ( >=dev-lang/perl-5.8:= )
5354 -python? ( ${PYTHON_DEPS} )
5355 -readline? ( sys-libs/readline:0= )
5356 -ssl? (
5357 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
5358 - libressl? ( dev-libs/libressl:= )
5359 -)
5360 -tcl? ( >=dev-lang/tcl-8:0= )
5361 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
5362 -zlib? ( sys-libs/zlib )
5363 -"
5364 -
5365 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
5366 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
5367 -# the libc includes UUID functions.
5368 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
5369 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
5370 -
5371 -nest_usedep() {
5372 - local front back
5373 - while [[ ${#} -gt 1 ]]; do
5374 - front+="${1}? ( "
5375 - back+=" )"
5376 - shift
5377 - done
5378 - echo "${front}${1}${back}"
5379 -}
5380 -
5381 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
5382 -CDEPEND+="
5383 -uuid? (
5384 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
5385 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
5386 -)"
5387 -
5388 -DEPEND="${CDEPEND}
5389 -!!<sys-apps/sandbox-2.0
5390 -sys-devel/bison
5391 -sys-devel/flex
5392 -nls? ( sys-devel/gettext )
5393 -xml? ( virtual/pkgconfig )
5394 -"
5395 -
5396 -RDEPEND="${CDEPEND}
5397 -!dev-db/postgresql-docs:${SLOT}
5398 -!dev-db/postgresql-base:${SLOT}
5399 -!dev-db/postgresql-server:${SLOT}
5400 -selinux? ( sec-policy/selinux-postgresql )
5401 -"
5402 -
5403 -pkg_setup() {
5404 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
5405 -
5406 - enewgroup postgres 70
5407 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
5408 -
5409 - use python && python-single-r1_pkg_setup
5410 -}
5411 -
5412 -src_prepare() {
5413 - # Work around PPC{,64} compilation bug where bool is already defined
5414 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
5415 -
5416 - # Set proper run directory
5417 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
5418 - -i src/include/pg_config_manual.h || die
5419 -
5420 - # Rely on $PATH being in the proper order so that the correct
5421 - # install program is used for modules utilizing PGXS in both
5422 - # hardened and non-hardened environments. (Bug #528786)
5423 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
5424 -
5425 - use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
5426 -
5427 - if use pam ; then
5428 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
5429 - -i src/backend/libpq/auth.c || \
5430 - die 'PGSQL_PAM_SERVICE rename failed.'
5431 - fi
5432 -
5433 - eapply_user
5434 -}
5435 -
5436 -src_configure() {
5437 - case ${CHOST} in
5438 - *-darwin*|*-solaris*)
5439 - use nls && append-libs intl
5440 - ;;
5441 - esac
5442 -
5443 - export LDFLAGS_SL="${LDFLAGS}"
5444 - export LDFLAGS_EX="${LDFLAGS}"
5445 -
5446 - local PO="${EPREFIX}"
5447 -
5448 - local i uuid_config=""
5449 - if use uuid; then
5450 - for i in ${UTIL_LINUX_LIBC[@]}; do
5451 - use ${i} && uuid_config="--with-uuid=e2fs"
5452 - done
5453 - for i in ${BSD_LIBC[@]}; do
5454 - use ${i} && uuid_config="--with-uuid=bsd"
5455 - done
5456 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
5457 - fi
5458 -
5459 - econf \
5460 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
5461 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
5462 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
5463 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
5464 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
5465 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
5466 - $(use_enable !pg_legacytimestamp integer-datetimes) \
5467 - $(use_enable debug) \
5468 - $(use_enable threads thread-safety) \
5469 - $(use_with kerberos gssapi) \
5470 - $(use_with ldap) \
5471 - $(use_with pam) \
5472 - $(use_with perl) \
5473 - $(use_with python) \
5474 - $(use_with readline) \
5475 - $(use_with ssl openssl) \
5476 - $(use_with tcl) \
5477 - ${uuid_config} \
5478 - $(use_with xml libxml) \
5479 - $(use_with xml libxslt) \
5480 - $(use_with zlib) \
5481 - $(use_enable nls nls "'$(l10n_get_locales)'")
5482 -}
5483 -
5484 -src_compile() {
5485 - emake
5486 - emake -C contrib
5487 -}
5488 -
5489 -src_install() {
5490 - emake DESTDIR="${D}" install
5491 - emake DESTDIR="${D}" install -C contrib
5492 -
5493 - dodoc README HISTORY doc/{TODO,bug.template}
5494 -
5495 - # man pages are already built, but if we have the target make them,
5496 - # they'll be generated from source before being installed so we
5497 - # manually install man pages.
5498 - # We use ${SLOT} instead of doman for postgresql.eselect
5499 - insinto /usr/share/postgresql-${SLOT}/man/
5500 - doins -r doc/src/sgml/man{1,3,7}
5501 - if ! use server; then
5502 - # Remove man pages for non-existent binaries
5503 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
5504 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
5505 - done
5506 - fi
5507 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
5508 -
5509 - # Create slot specific man pages
5510 - local bn f mansec slotted_name
5511 - for mansec in 1 3 7 ; do
5512 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
5513 -
5514 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
5515 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
5516 -
5517 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
5518 - bn=$(basename "${f}")
5519 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
5520 - case ${bn} in
5521 - TABLE.7|WITH.7)
5522 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
5523 - ;;
5524 - *)
5525 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
5526 - ;;
5527 - esac
5528 - done
5529 -
5530 - popd > /dev/null
5531 - done
5532 -
5533 - insinto /etc/postgresql-${SLOT}
5534 - newins src/bin/psql/psqlrc.sample psqlrc
5535 -
5536 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
5537 - # needed by extensions utilizing PGXS.
5538 - use static-libs || \
5539 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
5540 - -delete
5541 -
5542 - local f bn
5543 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
5544 - -mindepth 1 -maxdepth 1)
5545 - do
5546 - bn=$(basename "${f}")
5547 - # Temporarily tack on tmp to workaround a file collision
5548 - # issue. This is only necessary for 9.7 and earlier. 10 never
5549 - # had this issue.
5550 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
5551 - "/usr/bin/${bn}${SLOT/.}tmp"
5552 - done
5553 -
5554 - if use doc ; then
5555 - docinto html
5556 - dodoc doc/src/sgml/html/*
5557 -
5558 - docinto sgml
5559 - dodoc doc/src/sgml/*.{sgml,dsl}
5560 - fi
5561 -
5562 - if use server; then
5563 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
5564 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
5565 -
5566 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
5567 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
5568 -
5569 - if use systemd; then
5570 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
5571 - "${FILESDIR}/${PN}.service-9.2" | \
5572 - systemd_newunit - ${PN}-${SLOT}.service
5573 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
5574 - fi
5575 -
5576 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
5577 -
5578 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
5579 -
5580 - if use prefix ; then
5581 - keepdir /run/postgresql
5582 - fperms 1775 /run/postgresql
5583 - fi
5584 - fi
5585 -}
5586 -
5587 -pkg_preinst() {
5588 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
5589 - # /usr/bin/psql96). They may have been created by the
5590 - # postgresql.eselect module, but they're handled within this ebuild
5591 - # now. It's alright if we momentarily delete /usr/bin/psql as it
5592 - # will be recreated by the eselect module in pkg_ppostinst(). This
5593 - # is only necessary for 9.7 and earlier. 10 and later were never
5594 - # handled in this manner.
5595 - local canonicalise
5596 - if type -p realpath > /dev/null; then
5597 - canonicalise=realpath
5598 - elif type -p readlink > /dev/null; then
5599 - canonicalise='readlink -f'
5600 - else
5601 - # can't die, subshell
5602 - die "No readlink nor realpath found, cannot canonicalise"
5603 - fi
5604 -
5605 - local l
5606 - # First remove any symlinks in /usr/bin that may have been created
5607 - # by the old eselect
5608 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
5609 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
5610 - rm "${l}" || ewarn "Couldn't remove ${l}"
5611 - fi
5612 - done
5613 -
5614 - # Then move the symlinks created by the ebuild to their proper place.
5615 - for l in "${ED}"/usr/bin/*tmp ; do
5616 - mv "${l}" "${l%tmp}" \
5617 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
5618 - done
5619 -}
5620 -
5621 -pkg_postinst() {
5622 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
5623 - postgresql-config update
5624 -
5625 - elog "If you need a global psqlrc-file, you can place it in:"
5626 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
5627 -
5628 - if use server ; then
5629 - elog
5630 - elog "Gentoo specific documentation:"
5631 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
5632 - elog
5633 - elog "Official documentation:"
5634 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
5635 - elog
5636 - elog "The default location of the Unix-domain socket is:"
5637 - elog " ${EROOT}/run/postgresql/"
5638 - elog
5639 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
5640 - elog "so that it contains your preferred locale in:"
5641 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
5642 - elog
5643 - elog "Then, execute the following command to setup the initial database"
5644 - elog "environment:"
5645 - elog " emerge --config =${CATEGORY}/${PF}"
5646 - fi
5647 -}
5648 -
5649 -pkg_prerm() {
5650 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
5651 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
5652 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
5653 -
5654 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
5655 - sleep 10
5656 - eend 0
5657 - fi
5658 -}
5659 -
5660 -pkg_postrm() {
5661 - postgresql-config update
5662 -}
5663 -
5664 -pkg_config() {
5665 - use server || die "USE flag 'server' not enabled. Nothing to configure."
5666 -
5667 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
5668 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
5669 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
5670 - [[ -z "${DATA_DIR}" ]] \
5671 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
5672 -
5673 - # environment.bz2 may not contain the same locale as the current system
5674 - # locale. Unset and source from the current system locale.
5675 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
5676 - unset LANG
5677 - unset LC_CTYPE
5678 - unset LC_NUMERIC
5679 - unset LC_TIME
5680 - unset LC_COLLATE
5681 - unset LC_MONETARY
5682 - unset LC_MESSAGES
5683 - unset LC_ALL
5684 - source "${EROOT}/etc/env.d/02locale"
5685 - [ -n "${LANG}" ] && export LANG
5686 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
5687 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
5688 - [ -n "${LC_TIME}" ] && export LC_TIME
5689 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
5690 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
5691 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
5692 - [ -n "${LC_ALL}" ] && export LC_ALL
5693 - fi
5694 -
5695 - einfo "You can modify the paths and options passed to initdb by editing:"
5696 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
5697 - einfo
5698 - einfo "Information on options that can be passed to initdb are found at:"
5699 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
5700 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
5701 - einfo
5702 - einfo "PG_INITDB_OPTS is currently set to:"
5703 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
5704 - einfo " (none)"
5705 - else
5706 - einfo " ${PG_INITDB_OPTS}"
5707 - fi
5708 - einfo
5709 - einfo "Configuration files will be installed to:"
5710 - einfo " ${PGDATA}"
5711 - einfo
5712 - einfo "The database cluster will be created in:"
5713 - einfo " ${DATA_DIR}"
5714 - einfo
5715 -
5716 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
5717 - sleep 5
5718 - eend 0
5719 -
5720 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
5721 - eerror "The given directory, '${DATA_DIR}', is not empty."
5722 - eerror "Modify DATA_DIR to point to an empty directory."
5723 - die "${DATA_DIR} is not empty."
5724 - fi
5725 -
5726 - einfo "Creating the data directory ..."
5727 - if [[ ${EUID} == 0 ]] ; then
5728 - mkdir -p "${DATA_DIR}"
5729 - chown -Rf postgres:postgres "${DATA_DIR}"
5730 - chmod 0700 "${DATA_DIR}"
5731 - fi
5732 -
5733 - einfo "Initializing the database ..."
5734 -
5735 - if [[ ${EUID} == 0 ]] ; then
5736 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
5737 - else
5738 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
5739 - fi
5740 -
5741 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
5742 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
5743 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
5744 - fi
5745 -
5746 - # unix_socket_directory has no effect in postgresql.conf as it's
5747 - # overridden in the initscript
5748 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
5749 -
5750 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
5751 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
5752 - # On the off-chance that you might need to work with UTF-8 encoded
5753 - # characters in PL/Perl
5754 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
5755 - EOF
5756 -
5757 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
5758 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
5759 - einfo "by default. You can disable it in the cluster's:"
5760 - einfo " ${PGDATA%/}/postgresql.conf"
5761 - einfo
5762 - einfo "The PostgreSQL server, by default, will log events to:"
5763 - einfo " ${DATA_DIR%/}/postmaster.log"
5764 - einfo
5765 - if use prefix ; then
5766 - einfo "The location of the configuration files have moved to:"
5767 - einfo " ${PGDATA}"
5768 - einfo "To start the server:"
5769 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
5770 - einfo "To stop:"
5771 - einfo " pg_ctl stop -D ${DATA_DIR}"
5772 - einfo
5773 - einfo "Or move the configuration files back:"
5774 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
5775 - else
5776 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
5777 - einfo "instead of 'pg_ctl'."
5778 - fi
5779 -}
5780 -
5781 -src_test() {
5782 - if use server && [[ ${UID} -ne 0 ]] ; then
5783 - emake check
5784 -
5785 - einfo "If you think other tests besides the regression tests are necessary, please"
5786 - einfo "submit a bug including a patch for this ebuild to enable them."
5787 - else
5788 - use server || \
5789 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
5790 - [[ ${UID} -eq 0 ]] || \
5791 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
5792 -
5793 - ewarn 'Skipping.'
5794 - fi
5795 -}
5796
5797 diff --git a/dev-db/postgresql/postgresql-9.4.25.ebuild b/dev-db/postgresql/postgresql-9.4.25.ebuild
5798 deleted file mode 100644
5799 index 32bc19186d1..00000000000
5800 --- a/dev-db/postgresql/postgresql-9.4.25.ebuild
5801 +++ /dev/null
5802 @@ -1,479 +0,0 @@
5803 -# Copyright 1999-2020 Gentoo Authors
5804 -# Distributed under the terms of the GNU General Public License v2
5805 -
5806 -EAPI=7
5807 -
5808 -PYTHON_COMPAT=( python3_{6,7} )
5809 -
5810 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
5811 - zh_TW"
5812 -
5813 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
5814 - systemd user
5815 -
5816 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
5817 -
5818 -SLOT=$(ver_cut 1-2)
5819 -
5820 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
5821 -
5822 -LICENSE="POSTGRESQL GPL-2"
5823 -DESCRIPTION="PostgreSQL RDBMS"
5824 -HOMEPAGE="https://www.postgresql.org/"
5825 -
5826 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
5827 - -pg_legacytimestamp python +readline selinux +server systemd ssl
5828 - static-libs tcl threads uuid xml zlib"
5829 -
5830 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
5831 -
5832 -CDEPEND="
5833 ->=app-eselect/eselect-postgresql-2.0
5834 -sys-apps/less
5835 -virtual/libintl
5836 -kerberos? ( virtual/krb5 )
5837 -ldap? ( net-nds/openldap )
5838 -pam? ( sys-libs/pam )
5839 -perl? ( >=dev-lang/perl-5.8:= )
5840 -python? ( ${PYTHON_DEPS} )
5841 -readline? ( sys-libs/readline:0= )
5842 -ssl? (
5843 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
5844 - libressl? ( dev-libs/libressl:= )
5845 -)
5846 -tcl? ( >=dev-lang/tcl-8:0= )
5847 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
5848 -zlib? ( sys-libs/zlib )
5849 -"
5850 -
5851 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
5852 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
5853 -# the libc includes UUID functions.
5854 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
5855 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
5856 -
5857 -nest_usedep() {
5858 - local front back
5859 - while [[ ${#} -gt 1 ]]; do
5860 - front+="${1}? ( "
5861 - back+=" )"
5862 - shift
5863 - done
5864 - echo "${front}${1}${back}"
5865 -}
5866 -
5867 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
5868 -CDEPEND+="
5869 -uuid? (
5870 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
5871 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
5872 -)"
5873 -
5874 -DEPEND="${CDEPEND}
5875 -!!<sys-apps/sandbox-2.0
5876 -sys-devel/bison
5877 -sys-devel/flex
5878 -nls? ( sys-devel/gettext )
5879 -xml? ( virtual/pkgconfig )
5880 -"
5881 -
5882 -RDEPEND="${CDEPEND}
5883 -!dev-db/postgresql-docs:${SLOT}
5884 -!dev-db/postgresql-base:${SLOT}
5885 -!dev-db/postgresql-server:${SLOT}
5886 -selinux? ( sec-policy/selinux-postgresql )
5887 -"
5888 -
5889 -pkg_setup() {
5890 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
5891 -
5892 - enewgroup postgres 70
5893 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
5894 -
5895 - use python && python-single-r1_pkg_setup
5896 -}
5897 -
5898 -src_prepare() {
5899 - # Work around PPC{,64} compilation bug where bool is already defined
5900 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
5901 -
5902 - # Set proper run directory
5903 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
5904 - -i src/include/pg_config_manual.h || die
5905 -
5906 - # Rely on $PATH being in the proper order so that the correct
5907 - # install program is used for modules utilizing PGXS in both
5908 - # hardened and non-hardened environments. (Bug #528786)
5909 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
5910 -
5911 - use server || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
5912 -
5913 - if use pam ; then
5914 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
5915 - -i src/backend/libpq/auth.c || \
5916 - die 'PGSQL_PAM_SERVICE rename failed.'
5917 - fi
5918 -
5919 - eapply_user
5920 -}
5921 -
5922 -src_configure() {
5923 - case ${CHOST} in
5924 - *-darwin*|*-solaris*)
5925 - use nls && append-libs intl
5926 - ;;
5927 - esac
5928 -
5929 - export LDFLAGS_SL="${LDFLAGS}"
5930 - export LDFLAGS_EX="${LDFLAGS}"
5931 -
5932 - local PO="${EPREFIX}"
5933 -
5934 - local i uuid_config=""
5935 - if use uuid; then
5936 - for i in ${UTIL_LINUX_LIBC[@]}; do
5937 - use ${i} && uuid_config="--with-uuid=e2fs"
5938 - done
5939 - for i in ${BSD_LIBC[@]}; do
5940 - use ${i} && uuid_config="--with-uuid=bsd"
5941 - done
5942 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
5943 - fi
5944 -
5945 - econf \
5946 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
5947 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
5948 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
5949 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
5950 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
5951 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
5952 - $(use_enable !pg_legacytimestamp integer-datetimes) \
5953 - $(use_enable debug) \
5954 - $(use_enable threads thread-safety) \
5955 - $(use_with kerberos gssapi) \
5956 - $(use_with ldap) \
5957 - $(use_with pam) \
5958 - $(use_with perl) \
5959 - $(use_with python) \
5960 - $(use_with readline) \
5961 - $(use_with ssl openssl) \
5962 - $(use_with tcl) \
5963 - ${uuid_config} \
5964 - $(use_with xml libxml) \
5965 - $(use_with xml libxslt) \
5966 - $(use_with zlib) \
5967 - $(use_enable nls nls "'$(l10n_get_locales)'")
5968 -}
5969 -
5970 -src_compile() {
5971 - emake
5972 - emake -C contrib
5973 -}
5974 -
5975 -src_install() {
5976 - emake DESTDIR="${D}" install
5977 - emake DESTDIR="${D}" install -C contrib
5978 -
5979 - dodoc README HISTORY doc/{TODO,bug.template}
5980 -
5981 - # man pages are already built, but if we have the target make them,
5982 - # they'll be generated from source before being installed so we
5983 - # manually install man pages.
5984 - # We use ${SLOT} instead of doman for postgresql.eselect
5985 - insinto /usr/share/postgresql-${SLOT}/man/
5986 - doins -r doc/src/sgml/man{1,3,7}
5987 - if ! use server; then
5988 - # Remove man pages for non-existent binaries
5989 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
5990 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
5991 - done
5992 - fi
5993 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
5994 -
5995 - # Create slot specific man pages
5996 - local bn f mansec slotted_name
5997 - for mansec in 1 3 7 ; do
5998 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
5999 -
6000 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
6001 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
6002 -
6003 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
6004 - bn=$(basename "${f}")
6005 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
6006 - case ${bn} in
6007 - TABLE.7|WITH.7)
6008 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
6009 - ;;
6010 - *)
6011 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
6012 - ;;
6013 - esac
6014 - done
6015 -
6016 - popd > /dev/null
6017 - done
6018 -
6019 - insinto /etc/postgresql-${SLOT}
6020 - newins src/bin/psql/psqlrc.sample psqlrc
6021 -
6022 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
6023 - # needed by extensions utilizing PGXS.
6024 - use static-libs || \
6025 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
6026 - -delete
6027 -
6028 - local f bn
6029 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
6030 - -mindepth 1 -maxdepth 1)
6031 - do
6032 - bn=$(basename "${f}")
6033 - # Temporarily tack on tmp to workaround a file collision
6034 - # issue. This is only necessary for 9.7 and earlier. 10 never
6035 - # had this issue.
6036 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
6037 - "/usr/bin/${bn}${SLOT/.}tmp"
6038 - done
6039 -
6040 - if use doc ; then
6041 - docinto html
6042 - dodoc doc/src/sgml/html/*
6043 -
6044 - docinto sgml
6045 - dodoc doc/src/sgml/*.{sgml,dsl}
6046 - fi
6047 -
6048 - if use server; then
6049 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
6050 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
6051 -
6052 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
6053 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
6054 -
6055 - if use systemd; then
6056 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
6057 - "${FILESDIR}/${PN}.service-9.2" | \
6058 - systemd_newunit - ${PN}-${SLOT}.service
6059 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
6060 - fi
6061 -
6062 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
6063 -
6064 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
6065 -
6066 - if use prefix ; then
6067 - keepdir /run/postgresql
6068 - fperms 1775 /run/postgresql
6069 - fi
6070 - fi
6071 -}
6072 -
6073 -pkg_preinst() {
6074 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
6075 - # /usr/bin/psql96). They may have been created by the
6076 - # postgresql.eselect module, but they're handled within this ebuild
6077 - # now. It's alright if we momentarily delete /usr/bin/psql as it
6078 - # will be recreated by the eselect module in pkg_ppostinst(). This
6079 - # is only necessary for 9.7 and earlier. 10 and later were never
6080 - # handled in this manner.
6081 - local canonicalise
6082 - if type -p realpath > /dev/null; then
6083 - canonicalise=realpath
6084 - elif type -p readlink > /dev/null; then
6085 - canonicalise='readlink -f'
6086 - else
6087 - # can't die, subshell
6088 - die "No readlink nor realpath found, cannot canonicalise"
6089 - fi
6090 -
6091 - local l
6092 - # First remove any symlinks in /usr/bin that may have been created
6093 - # by the old eselect
6094 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
6095 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
6096 - rm "${l}" || ewarn "Couldn't remove ${l}"
6097 - fi
6098 - done
6099 -
6100 - # Then move the symlinks created by the ebuild to their proper place.
6101 - for l in "${ED}"/usr/bin/*tmp ; do
6102 - mv "${l}" "${l%tmp}" \
6103 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
6104 - done
6105 -}
6106 -
6107 -pkg_postinst() {
6108 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
6109 - postgresql-config update
6110 -
6111 - elog "If you need a global psqlrc-file, you can place it in:"
6112 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
6113 -
6114 - if use server ; then
6115 - elog
6116 - elog "Gentoo specific documentation:"
6117 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
6118 - elog
6119 - elog "Official documentation:"
6120 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
6121 - elog
6122 - elog "The default location of the Unix-domain socket is:"
6123 - elog " ${EROOT}/run/postgresql/"
6124 - elog
6125 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
6126 - elog "so that it contains your preferred locale in:"
6127 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
6128 - elog
6129 - elog "Then, execute the following command to setup the initial database"
6130 - elog "environment:"
6131 - elog " emerge --config =${CATEGORY}/${PF}"
6132 - fi
6133 -}
6134 -
6135 -pkg_prerm() {
6136 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
6137 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
6138 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
6139 -
6140 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
6141 - sleep 10
6142 - eend 0
6143 - fi
6144 -}
6145 -
6146 -pkg_postrm() {
6147 - postgresql-config update
6148 -}
6149 -
6150 -pkg_config() {
6151 - use server || die "USE flag 'server' not enabled. Nothing to configure."
6152 -
6153 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
6154 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
6155 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
6156 - [[ -z "${DATA_DIR}" ]] \
6157 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
6158 -
6159 - # environment.bz2 may not contain the same locale as the current system
6160 - # locale. Unset and source from the current system locale.
6161 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
6162 - unset LANG
6163 - unset LC_CTYPE
6164 - unset LC_NUMERIC
6165 - unset LC_TIME
6166 - unset LC_COLLATE
6167 - unset LC_MONETARY
6168 - unset LC_MESSAGES
6169 - unset LC_ALL
6170 - source "${EROOT}/etc/env.d/02locale"
6171 - [ -n "${LANG}" ] && export LANG
6172 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
6173 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
6174 - [ -n "${LC_TIME}" ] && export LC_TIME
6175 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
6176 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
6177 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
6178 - [ -n "${LC_ALL}" ] && export LC_ALL
6179 - fi
6180 -
6181 - einfo "You can modify the paths and options passed to initdb by editing:"
6182 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
6183 - einfo
6184 - einfo "Information on options that can be passed to initdb are found at:"
6185 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
6186 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
6187 - einfo
6188 - einfo "PG_INITDB_OPTS is currently set to:"
6189 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
6190 - einfo " (none)"
6191 - else
6192 - einfo " ${PG_INITDB_OPTS}"
6193 - fi
6194 - einfo
6195 - einfo "Configuration files will be installed to:"
6196 - einfo " ${PGDATA}"
6197 - einfo
6198 - einfo "The database cluster will be created in:"
6199 - einfo " ${DATA_DIR}"
6200 - einfo
6201 -
6202 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
6203 - sleep 5
6204 - eend 0
6205 -
6206 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
6207 - eerror "The given directory, '${DATA_DIR}', is not empty."
6208 - eerror "Modify DATA_DIR to point to an empty directory."
6209 - die "${DATA_DIR} is not empty."
6210 - fi
6211 -
6212 - einfo "Creating the data directory ..."
6213 - if [[ ${EUID} == 0 ]] ; then
6214 - mkdir -p "${DATA_DIR}"
6215 - chown -Rf postgres:postgres "${DATA_DIR}"
6216 - chmod 0700 "${DATA_DIR}"
6217 - fi
6218 -
6219 - einfo "Initializing the database ..."
6220 -
6221 - if [[ ${EUID} == 0 ]] ; then
6222 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
6223 - else
6224 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
6225 - fi
6226 -
6227 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
6228 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
6229 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
6230 - fi
6231 -
6232 - # unix_socket_directory has no effect in postgresql.conf as it's
6233 - # overridden in the initscript
6234 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
6235 -
6236 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
6237 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
6238 - # On the off-chance that you might need to work with UTF-8 encoded
6239 - # characters in PL/Perl
6240 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
6241 - EOF
6242 -
6243 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
6244 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
6245 - einfo "by default. You can disable it in the cluster's:"
6246 - einfo " ${PGDATA%/}/postgresql.conf"
6247 - einfo
6248 - einfo "The PostgreSQL server, by default, will log events to:"
6249 - einfo " ${DATA_DIR%/}/postmaster.log"
6250 - einfo
6251 - if use prefix ; then
6252 - einfo "The location of the configuration files have moved to:"
6253 - einfo " ${PGDATA}"
6254 - einfo "To start the server:"
6255 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
6256 - einfo "To stop:"
6257 - einfo " pg_ctl stop -D ${DATA_DIR}"
6258 - einfo
6259 - einfo "Or move the configuration files back:"
6260 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
6261 - else
6262 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
6263 - einfo "instead of 'pg_ctl'."
6264 - fi
6265 -}
6266 -
6267 -src_test() {
6268 - if use server && [[ ${UID} -ne 0 ]] ; then
6269 - emake check
6270 -
6271 - einfo "If you think other tests besides the regression tests are necessary, please"
6272 - einfo "submit a bug including a patch for this ebuild to enable them."
6273 - else
6274 - use server || \
6275 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
6276 - [[ ${UID} -eq 0 ]] || \
6277 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
6278 -
6279 - ewarn 'Skipping.'
6280 - fi
6281 -}
6282
6283 diff --git a/dev-db/postgresql/postgresql-9.5.17-r1.ebuild b/dev-db/postgresql/postgresql-9.5.17-r1.ebuild
6284 deleted file mode 100644
6285 index 2616c4614cc..00000000000
6286 --- a/dev-db/postgresql/postgresql-9.5.17-r1.ebuild
6287 +++ /dev/null
6288 @@ -1,485 +0,0 @@
6289 -# Copyright 1999-2020 Gentoo Authors
6290 -# Distributed under the terms of the GNU General Public License v2
6291 -
6292 -EAPI=7
6293 -
6294 -PYTHON_COMPAT=( python3_{6,7} )
6295 -
6296 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
6297 - zh_TW"
6298 -
6299 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
6300 - systemd user
6301 -
6302 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris"
6303 -
6304 -SLOT=$(ver_cut 1-2)
6305 -
6306 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
6307 -
6308 -LICENSE="POSTGRESQL GPL-2"
6309 -DESCRIPTION="PostgreSQL RDBMS"
6310 -HOMEPAGE="https://www.postgresql.org/"
6311 -
6312 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
6313 - -pg_legacytimestamp python +readline selinux +server systemd ssl
6314 - static-libs tcl threads uuid xml zlib"
6315 -
6316 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
6317 -
6318 -CDEPEND="
6319 ->=app-eselect/eselect-postgresql-2.0
6320 -sys-apps/less
6321 -virtual/libintl
6322 -kerberos? ( virtual/krb5 )
6323 -ldap? ( net-nds/openldap )
6324 -pam? ( sys-libs/pam )
6325 -perl? ( >=dev-lang/perl-5.8:= )
6326 -python? ( ${PYTHON_DEPS} )
6327 -readline? ( sys-libs/readline:0= )
6328 -ssl? (
6329 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
6330 - libressl? ( dev-libs/libressl:= )
6331 -)
6332 -tcl? ( >=dev-lang/tcl-8:0= )
6333 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
6334 -zlib? ( sys-libs/zlib )
6335 -"
6336 -
6337 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
6338 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
6339 -# the libc includes UUID functions.
6340 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
6341 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
6342 -
6343 -nest_usedep() {
6344 - local front back
6345 - while [[ ${#} -gt 1 ]]; do
6346 - front+="${1}? ( "
6347 - back+=" )"
6348 - shift
6349 - done
6350 - echo "${front}${1}${back}"
6351 -}
6352 -
6353 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
6354 -CDEPEND+="
6355 -uuid? (
6356 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
6357 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
6358 -)"
6359 -
6360 -DEPEND="${CDEPEND}
6361 -!!<sys-apps/sandbox-2.0
6362 -sys-devel/bison
6363 -sys-devel/flex
6364 -nls? ( sys-devel/gettext )
6365 -xml? ( virtual/pkgconfig )
6366 -"
6367 -
6368 -RDEPEND="${CDEPEND}
6369 -!dev-db/postgresql-docs:${SLOT}
6370 -!dev-db/postgresql-base:${SLOT}
6371 -!dev-db/postgresql-server:${SLOT}
6372 -selinux? ( sec-policy/selinux-postgresql )
6373 -"
6374 -
6375 -pkg_setup() {
6376 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
6377 -
6378 - enewgroup postgres 70
6379 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
6380 -
6381 - use python && python-single-r1_pkg_setup
6382 -}
6383 -
6384 -src_prepare() {
6385 - # Work around PPC{,64} compilation bug where bool is already defined
6386 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
6387 -
6388 - # Set proper run directory
6389 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
6390 - -i src/include/pg_config_manual.h || die
6391 -
6392 - # Rely on $PATH being in the proper order so that the correct
6393 - # install program is used for modules utilizing PGXS in both
6394 - # hardened and non-hardened environments. (Bug #528786)
6395 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
6396 -
6397 - use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
6398 -
6399 - if use pam ; then
6400 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
6401 - -i src/backend/libpq/auth.c || \
6402 - die 'PGSQL_PAM_SERVICE rename failed.'
6403 - fi
6404 -
6405 - eapply_user
6406 -}
6407 -
6408 -src_configure() {
6409 - case ${CHOST} in
6410 - *-darwin*|*-solaris*)
6411 - use nls && append-libs intl
6412 - ;;
6413 - esac
6414 -
6415 - export LDFLAGS_SL="${LDFLAGS}"
6416 - export LDFLAGS_EX="${LDFLAGS}"
6417 -
6418 - local PO="${EPREFIX}"
6419 -
6420 - local i uuid_config=""
6421 - if use uuid; then
6422 - for i in ${UTIL_LINUX_LIBC[@]}; do
6423 - use ${i} && uuid_config="--with-uuid=e2fs"
6424 - done
6425 - for i in ${BSD_LIBC[@]}; do
6426 - use ${i} && uuid_config="--with-uuid=bsd"
6427 - done
6428 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
6429 - fi
6430 -
6431 - econf \
6432 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
6433 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
6434 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
6435 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
6436 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
6437 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
6438 - $(use_enable !alpha spinlocks) \
6439 - $(use_enable !pg_legacytimestamp integer-datetimes) \
6440 - $(use_enable debug) \
6441 - $(use_enable threads thread-safety) \
6442 - $(use_with kerberos gssapi) \
6443 - $(use_with ldap) \
6444 - $(use_with pam) \
6445 - $(use_with perl) \
6446 - $(use_with python) \
6447 - $(use_with readline) \
6448 - $(use_with ssl openssl) \
6449 - $(use_with tcl) \
6450 - ${uuid_config} \
6451 - $(use_with xml libxml) \
6452 - $(use_with xml libxslt) \
6453 - $(use_with zlib) \
6454 - $(use_enable nls nls "'$(l10n_get_locales)'")
6455 -}
6456 -
6457 -src_compile() {
6458 - emake
6459 - emake -C contrib
6460 -}
6461 -
6462 -src_install() {
6463 - emake DESTDIR="${D}" install
6464 - emake DESTDIR="${D}" install -C contrib
6465 -
6466 - dodoc README HISTORY doc/{TODO,bug.template}
6467 -
6468 - # man pages are already built, but if we have the target make them,
6469 - # they'll be generated from source before being installed so we
6470 - # manually install man pages.
6471 - # We use ${SLOT} instead of doman for postgresql.eselect
6472 - insinto /usr/share/postgresql-${SLOT}/man/
6473 - doins -r doc/src/sgml/man{1,3,7}
6474 - if ! use server; then
6475 - # Remove man pages for non-existent binaries
6476 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
6477 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
6478 - done
6479 - fi
6480 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
6481 -
6482 - # Create slot specific man pages
6483 - local bn f mansec slotted_name
6484 - for mansec in 1 3 7 ; do
6485 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
6486 -
6487 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
6488 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
6489 -
6490 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
6491 - bn=$(basename "${f}")
6492 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
6493 - case ${bn} in
6494 - TABLE.7|WITH.7)
6495 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
6496 - ;;
6497 - *)
6498 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
6499 - ;;
6500 - esac
6501 - done
6502 -
6503 - popd > /dev/null
6504 - done
6505 -
6506 - insinto /etc/postgresql-${SLOT}
6507 - newins src/bin/psql/psqlrc.sample psqlrc
6508 -
6509 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
6510 - # needed by extensions utilizing PGXS.
6511 - use static-libs || \
6512 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
6513 - -delete
6514 -
6515 - local f bn
6516 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
6517 - -mindepth 1 -maxdepth 1)
6518 - do
6519 - bn=$(basename "${f}")
6520 - # Temporarily tack on tmp to workaround a file collision
6521 - # issue. This is only necessary for 9.7 and earlier. 10 never
6522 - # had this issue.
6523 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
6524 - "/usr/bin/${bn}${SLOT/.}tmp"
6525 - done
6526 -
6527 - if use doc ; then
6528 - docinto html
6529 - dodoc doc/src/sgml/html/*
6530 -
6531 - docinto sgml
6532 - dodoc doc/src/sgml/*.{sgml,dsl}
6533 - fi
6534 -
6535 - if use server; then
6536 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
6537 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
6538 -
6539 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
6540 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
6541 -
6542 - if use systemd; then
6543 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
6544 - "${FILESDIR}/${PN}.service-9.2" | \
6545 - systemd_newunit - ${PN}-${SLOT}.service
6546 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
6547 - fi
6548 -
6549 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
6550 -
6551 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
6552 -
6553 - if use prefix ; then
6554 - keepdir /run/postgresql
6555 - fperms 1775 /run/postgresql
6556 - fi
6557 - fi
6558 -}
6559 -
6560 -pkg_preinst() {
6561 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
6562 - # /usr/bin/psql96). They may have been created by the
6563 - # postgresql.eselect module, but they're handled within this ebuild
6564 - # now. It's alright if we momentarily delete /usr/bin/psql as it
6565 - # will be recreated by the eselect module in pkg_ppostinst(). This
6566 - # is only necessary for 9.7 and earlier. 10 and later were never
6567 - # handled in this manner.
6568 - local canonicalise
6569 - if type -p realpath > /dev/null; then
6570 - canonicalise=realpath
6571 - elif type -p readlink > /dev/null; then
6572 - canonicalise='readlink -f'
6573 - else
6574 - # can't die, subshell
6575 - die "No readlink nor realpath found, cannot canonicalise"
6576 - fi
6577 -
6578 - local l
6579 - # First remove any symlinks in /usr/bin that may have been created
6580 - # by the old eselect
6581 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
6582 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
6583 - rm "${l}" || ewarn "Couldn't remove ${l}"
6584 - fi
6585 - done
6586 -
6587 - # Then move the symlinks created by the ebuild to their proper place.
6588 - for l in "${ED}"/usr/bin/*tmp ; do
6589 - mv "${l}" "${l%tmp}" \
6590 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
6591 - done
6592 -}
6593 -
6594 -pkg_postinst() {
6595 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
6596 - postgresql-config update
6597 -
6598 - if use alpha && use server ; then
6599 - ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
6600 - ewarn "As a result, performance will be extremely degraded."
6601 - fi
6602 -
6603 - elog "If you need a global psqlrc-file, you can place it in:"
6604 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
6605 -
6606 - if use server ; then
6607 - elog
6608 - elog "Gentoo specific documentation:"
6609 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
6610 - elog
6611 - elog "Official documentation:"
6612 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
6613 - elog
6614 - elog "The default location of the Unix-domain socket is:"
6615 - elog " ${EROOT}/run/postgresql/"
6616 - elog
6617 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
6618 - elog "so that it contains your preferred locale in:"
6619 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
6620 - elog
6621 - elog "Then, execute the following command to setup the initial database"
6622 - elog "environment:"
6623 - elog " emerge --config =${CATEGORY}/${PF}"
6624 - fi
6625 -}
6626 -
6627 -pkg_prerm() {
6628 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
6629 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
6630 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
6631 -
6632 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
6633 - sleep 10
6634 - eend 0
6635 - fi
6636 -}
6637 -
6638 -pkg_postrm() {
6639 - postgresql-config update
6640 -}
6641 -
6642 -pkg_config() {
6643 - use server || die "USE flag 'server' not enabled. Nothing to configure."
6644 -
6645 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
6646 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
6647 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
6648 - [[ -z "${DATA_DIR}" ]] \
6649 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
6650 -
6651 - # environment.bz2 may not contain the same locale as the current system
6652 - # locale. Unset and source from the current system locale.
6653 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
6654 - unset LANG
6655 - unset LC_CTYPE
6656 - unset LC_NUMERIC
6657 - unset LC_TIME
6658 - unset LC_COLLATE
6659 - unset LC_MONETARY
6660 - unset LC_MESSAGES
6661 - unset LC_ALL
6662 - source "${EROOT}/etc/env.d/02locale"
6663 - [ -n "${LANG}" ] && export LANG
6664 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
6665 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
6666 - [ -n "${LC_TIME}" ] && export LC_TIME
6667 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
6668 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
6669 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
6670 - [ -n "${LC_ALL}" ] && export LC_ALL
6671 - fi
6672 -
6673 - einfo "You can modify the paths and options passed to initdb by editing:"
6674 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
6675 - einfo
6676 - einfo "Information on options that can be passed to initdb are found at:"
6677 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
6678 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
6679 - einfo
6680 - einfo "PG_INITDB_OPTS is currently set to:"
6681 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
6682 - einfo " (none)"
6683 - else
6684 - einfo " ${PG_INITDB_OPTS}"
6685 - fi
6686 - einfo
6687 - einfo "Configuration files will be installed to:"
6688 - einfo " ${PGDATA}"
6689 - einfo
6690 - einfo "The database cluster will be created in:"
6691 - einfo " ${DATA_DIR}"
6692 - einfo
6693 -
6694 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
6695 - sleep 5
6696 - eend 0
6697 -
6698 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
6699 - eerror "The given directory, '${DATA_DIR}', is not empty."
6700 - eerror "Modify DATA_DIR to point to an empty directory."
6701 - die "${DATA_DIR} is not empty."
6702 - fi
6703 -
6704 - einfo "Creating the data directory ..."
6705 - if [[ ${EUID} == 0 ]] ; then
6706 - mkdir -p "${DATA_DIR}"
6707 - chown -Rf postgres:postgres "${DATA_DIR}"
6708 - chmod 0700 "${DATA_DIR}"
6709 - fi
6710 -
6711 - einfo "Initializing the database ..."
6712 -
6713 - if [[ ${EUID} == 0 ]] ; then
6714 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
6715 - else
6716 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
6717 - fi
6718 -
6719 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
6720 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
6721 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
6722 - fi
6723 -
6724 - # unix_socket_directory has no effect in postgresql.conf as it's
6725 - # overridden in the initscript
6726 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
6727 -
6728 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
6729 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
6730 - # On the off-chance that you might need to work with UTF-8 encoded
6731 - # characters in PL/Perl
6732 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
6733 - EOF
6734 -
6735 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
6736 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
6737 - einfo "by default. You can disable it in the cluster's:"
6738 - einfo " ${PGDATA%/}/postgresql.conf"
6739 - einfo
6740 - einfo "The PostgreSQL server, by default, will log events to:"
6741 - einfo " ${DATA_DIR%/}/postmaster.log"
6742 - einfo
6743 - if use prefix ; then
6744 - einfo "The location of the configuration files have moved to:"
6745 - einfo " ${PGDATA}"
6746 - einfo "To start the server:"
6747 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
6748 - einfo "To stop:"
6749 - einfo " pg_ctl stop -D ${DATA_DIR}"
6750 - einfo
6751 - einfo "Or move the configuration files back:"
6752 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
6753 - else
6754 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
6755 - einfo "instead of 'pg_ctl'."
6756 - fi
6757 -}
6758 -
6759 -src_test() {
6760 - if use server && [[ ${UID} -ne 0 ]] ; then
6761 - emake check
6762 -
6763 - einfo "If you think other tests besides the regression tests are necessary, please"
6764 - einfo "submit a bug including a patch for this ebuild to enable them."
6765 - else
6766 - use server || \
6767 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
6768 - [[ ${UID} -eq 0 ]] || \
6769 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
6770 -
6771 - ewarn 'Skipping.'
6772 - fi
6773 -}
6774
6775 diff --git a/dev-db/postgresql/postgresql-9.5.17.ebuild b/dev-db/postgresql/postgresql-9.5.17.ebuild
6776 deleted file mode 100644
6777 index a9941bde026..00000000000
6778 --- a/dev-db/postgresql/postgresql-9.5.17.ebuild
6779 +++ /dev/null
6780 @@ -1,480 +0,0 @@
6781 -# Copyright 1999-2020 Gentoo Authors
6782 -# Distributed under the terms of the GNU General Public License v2
6783 -
6784 -EAPI="6"
6785 -
6786 -PYTHON_COMPAT=( python3_6 )
6787 -
6788 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
6789 - zh_TW"
6790 -
6791 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
6792 - systemd user versionator
6793 -
6794 -KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
6795 -
6796 -SLOT="$(get_version_component_range 1-2)"
6797 -
6798 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
6799 -
6800 -LICENSE="POSTGRESQL GPL-2"
6801 -DESCRIPTION="PostgreSQL RDBMS"
6802 -HOMEPAGE="https://www.postgresql.org/"
6803 -
6804 -IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp
6805 - python +readline selinux +server systemd ssl static-libs tcl threads uuid
6806 - xml zlib"
6807 -
6808 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
6809 -
6810 -CDEPEND="
6811 ->=app-eselect/eselect-postgresql-2.0
6812 -sys-apps/less
6813 -virtual/libintl
6814 -kerberos? ( virtual/krb5 )
6815 -ldap? ( net-nds/openldap )
6816 -pam? ( sys-libs/pam )
6817 -perl? ( >=dev-lang/perl-5.8:= )
6818 -python? ( ${PYTHON_DEPS} )
6819 -readline? ( sys-libs/readline:0= )
6820 -ssl? (
6821 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
6822 - libressl? ( dev-libs/libressl:= )
6823 -)
6824 -tcl? ( >=dev-lang/tcl-8:0= )
6825 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
6826 -zlib? ( sys-libs/zlib )
6827 -"
6828 -
6829 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
6830 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
6831 -# the libc includes UUID functions.
6832 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
6833 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
6834 -
6835 -nest_usedep() {
6836 - local front back
6837 - while [[ ${#} -gt 1 ]]; do
6838 - front+="${1}? ( "
6839 - back+=" )"
6840 - shift
6841 - done
6842 - echo "${front}${1}${back}"
6843 -}
6844 -
6845 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
6846 -CDEPEND+="
6847 -uuid? (
6848 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
6849 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
6850 -)"
6851 -
6852 -DEPEND="${CDEPEND}
6853 -!!<sys-apps/sandbox-2.0
6854 -sys-devel/bison
6855 -sys-devel/flex
6856 -nls? ( sys-devel/gettext )
6857 -xml? ( virtual/pkgconfig )
6858 -"
6859 -
6860 -RDEPEND="${CDEPEND}
6861 -!dev-db/postgresql-docs:${SLOT}
6862 -!dev-db/postgresql-base:${SLOT}
6863 -!dev-db/postgresql-server:${SLOT}
6864 -selinux? ( sec-policy/selinux-postgresql )
6865 -"
6866 -
6867 -pkg_setup() {
6868 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
6869 -
6870 - enewgroup postgres 70
6871 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
6872 -
6873 - use python && python-single-r1_pkg_setup
6874 -}
6875 -
6876 -src_prepare() {
6877 - # Work around PPC{,64} compilation bug where bool is already defined
6878 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
6879 -
6880 - # Set proper run directory
6881 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
6882 - -i src/include/pg_config_manual.h || die
6883 -
6884 - # Rely on $PATH being in the proper order so that the correct
6885 - # install program is used for modules utilizing PGXS in both
6886 - # hardened and non-hardened environments. (Bug #528786)
6887 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
6888 -
6889 - use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
6890 -
6891 - if use pam ; then
6892 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
6893 - -i src/backend/libpq/auth.c || \
6894 - die 'PGSQL_PAM_SERVICE rename failed.'
6895 - fi
6896 -
6897 - eapply_user
6898 -}
6899 -
6900 -src_configure() {
6901 - case ${CHOST} in
6902 - *-darwin*|*-solaris*)
6903 - use nls && append-libs intl
6904 - ;;
6905 - esac
6906 -
6907 - export LDFLAGS_SL="${LDFLAGS}"
6908 - export LDFLAGS_EX="${LDFLAGS}"
6909 -
6910 - local PO="${EPREFIX}"
6911 -
6912 - local i uuid_config=""
6913 - if use uuid; then
6914 - for i in ${UTIL_LINUX_LIBC[@]}; do
6915 - use ${i} && uuid_config="--with-uuid=e2fs"
6916 - done
6917 - for i in ${BSD_LIBC[@]}; do
6918 - use ${i} && uuid_config="--with-uuid=bsd"
6919 - done
6920 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
6921 - fi
6922 -
6923 - econf \
6924 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
6925 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
6926 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
6927 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
6928 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
6929 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
6930 - $(use_enable !alpha spinlocks) \
6931 - $(use_enable !pg_legacytimestamp integer-datetimes) \
6932 - $(use_enable threads thread-safety) \
6933 - $(use_with kerberos gssapi) \
6934 - $(use_with ldap) \
6935 - $(use_with pam) \
6936 - $(use_with perl) \
6937 - $(use_with python) \
6938 - $(use_with readline) \
6939 - $(use_with ssl openssl) \
6940 - $(use_with tcl) \
6941 - ${uuid_config} \
6942 - $(use_with xml libxml) \
6943 - $(use_with xml libxslt) \
6944 - $(use_with zlib) \
6945 - $(use_enable nls nls "'$(l10n_get_locales)'")
6946 -}
6947 -
6948 -src_compile() {
6949 - emake
6950 - emake -C contrib
6951 -}
6952 -
6953 -src_install() {
6954 - emake DESTDIR="${D}" install
6955 - emake DESTDIR="${D}" install -C contrib
6956 -
6957 - dodoc README HISTORY doc/{TODO,bug.template}
6958 -
6959 - # man pages are already built, but if we have the target make them,
6960 - # they'll be generated from source before being installed so we
6961 - # manually install man pages.
6962 - # We use ${SLOT} instead of doman for postgresql.eselect
6963 - insinto /usr/share/postgresql-${SLOT}/man/
6964 - doins -r doc/src/sgml/man{1,3,7}
6965 - if ! use server; then
6966 - # Remove man pages for non-existent binaries
6967 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
6968 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
6969 - done
6970 - fi
6971 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
6972 -
6973 - # Create slot specific man pages
6974 - local bn f mansec slotted_name
6975 - for mansec in 1 3 7 ; do
6976 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
6977 -
6978 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
6979 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
6980 -
6981 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
6982 - bn=$(basename "${f}")
6983 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
6984 - case ${bn} in
6985 - TABLE.7|WITH.7)
6986 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
6987 - ;;
6988 - *)
6989 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
6990 - ;;
6991 - esac
6992 - done
6993 -
6994 - popd > /dev/null
6995 - done
6996 -
6997 - insinto /etc/postgresql-${SLOT}
6998 - newins src/bin/psql/psqlrc.sample psqlrc
6999 -
7000 - use static-libs || find "${ED}" -name '*.a' -delete
7001 -
7002 - local f bn
7003 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
7004 - -mindepth 1 -maxdepth 1)
7005 - do
7006 - bn=$(basename "${f}")
7007 - # Temporarily tack on tmp to workaround a file collision
7008 - # issue. This is only necessary for 9.7 and earlier. 10 never
7009 - # had this issue.
7010 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
7011 - "/usr/bin/${bn}${SLOT/.}tmp"
7012 - done
7013 -
7014 - if use doc ; then
7015 - docinto html
7016 - dodoc doc/src/sgml/html/*
7017 -
7018 - docinto sgml
7019 - dodoc doc/src/sgml/*.{sgml,dsl}
7020 - fi
7021 -
7022 - if use server; then
7023 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
7024 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
7025 -
7026 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
7027 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
7028 -
7029 - if use systemd; then
7030 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
7031 - "${FILESDIR}/${PN}.service-9.2" | \
7032 - systemd_newunit - ${PN}-${SLOT}.service
7033 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
7034 - fi
7035 -
7036 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
7037 -
7038 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
7039 -
7040 - if use prefix ; then
7041 - keepdir /run/postgresql
7042 - fperms 1775 /run/postgresql
7043 - fi
7044 - fi
7045 -}
7046 -
7047 -pkg_preinst() {
7048 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
7049 - # /usr/bin/psql96). They may have been created by the
7050 - # postgresql.eselect module, but they're handled within this ebuild
7051 - # now. It's alright if we momentarily delete /usr/bin/psql as it
7052 - # will be recreated by the eselect module in pkg_ppostinst(). This
7053 - # is only necessary for 9.7 and earlier. 10 and later were never
7054 - # handled in this manner.
7055 - local canonicalise
7056 - if type -p realpath > /dev/null; then
7057 - canonicalise=realpath
7058 - elif type -p readlink > /dev/null; then
7059 - canonicalise='readlink -f'
7060 - else
7061 - # can't die, subshell
7062 - die "No readlink nor realpath found, cannot canonicalise"
7063 - fi
7064 -
7065 - local l
7066 - # First remove any symlinks in /usr/bin that may have been created
7067 - # by the old eselect
7068 - for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
7069 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
7070 - rm "${l}" || ewarn "Couldn't remove ${l}"
7071 - fi
7072 - done
7073 -
7074 - # Then move the symlinks created by the ebuild to their proper place.
7075 - for l in "${ED}"/usr/bin/*tmp ; do
7076 - mv "${l}" "${l%tmp}" \
7077 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
7078 - done
7079 -}
7080 -
7081 -pkg_postinst() {
7082 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
7083 - postgresql-config update
7084 -
7085 - if use alpha && use server ; then
7086 - ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
7087 - ewarn "As a result, performance will be extremely degraded."
7088 - fi
7089 -
7090 - elog "If you need a global psqlrc-file, you can place it in:"
7091 - elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
7092 -
7093 - if use server ; then
7094 - elog
7095 - elog "Gentoo specific documentation:"
7096 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
7097 - elog
7098 - elog "Official documentation:"
7099 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
7100 - elog
7101 - elog "The default location of the Unix-domain socket is:"
7102 - elog " ${EROOT%/}/run/postgresql/"
7103 - elog
7104 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
7105 - elog "so that it contains your preferred locale in:"
7106 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
7107 - elog
7108 - elog "Then, execute the following command to setup the initial database"
7109 - elog "environment:"
7110 - elog " emerge --config =${CATEGORY}/${PF}"
7111 - fi
7112 -}
7113 -
7114 -pkg_prerm() {
7115 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
7116 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
7117 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
7118 -
7119 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
7120 - sleep 10
7121 - eend 0
7122 - fi
7123 -}
7124 -
7125 -pkg_postrm() {
7126 - postgresql-config update
7127 -}
7128 -
7129 -pkg_config() {
7130 - use server || die "USE flag 'server' not enabled. Nothing to configure."
7131 -
7132 - [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
7133 - && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
7134 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
7135 - [[ -z "${DATA_DIR}" ]] \
7136 - && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
7137 -
7138 - # environment.bz2 may not contain the same locale as the current system
7139 - # locale. Unset and source from the current system locale.
7140 - if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
7141 - unset LANG
7142 - unset LC_CTYPE
7143 - unset LC_NUMERIC
7144 - unset LC_TIME
7145 - unset LC_COLLATE
7146 - unset LC_MONETARY
7147 - unset LC_MESSAGES
7148 - unset LC_ALL
7149 - source "${EROOT%/}/etc/env.d/02locale"
7150 - [ -n "${LANG}" ] && export LANG
7151 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
7152 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
7153 - [ -n "${LC_TIME}" ] && export LC_TIME
7154 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
7155 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
7156 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
7157 - [ -n "${LC_ALL}" ] && export LC_ALL
7158 - fi
7159 -
7160 - einfo "You can modify the paths and options passed to initdb by editing:"
7161 - einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
7162 - einfo
7163 - einfo "Information on options that can be passed to initdb are found at:"
7164 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
7165 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
7166 - einfo
7167 - einfo "PG_INITDB_OPTS is currently set to:"
7168 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
7169 - einfo " (none)"
7170 - else
7171 - einfo " ${PG_INITDB_OPTS}"
7172 - fi
7173 - einfo
7174 - einfo "Configuration files will be installed to:"
7175 - einfo " ${PGDATA}"
7176 - einfo
7177 - einfo "The database cluster will be created in:"
7178 - einfo " ${DATA_DIR}"
7179 - einfo
7180 -
7181 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
7182 - sleep 5
7183 - eend 0
7184 -
7185 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
7186 - eerror "The given directory, '${DATA_DIR}', is not empty."
7187 - eerror "Modify DATA_DIR to point to an empty directory."
7188 - die "${DATA_DIR} is not empty."
7189 - fi
7190 -
7191 - einfo "Creating the data directory ..."
7192 - if [[ ${EUID} == 0 ]] ; then
7193 - mkdir -p "${DATA_DIR}"
7194 - chown -Rf postgres:postgres "${DATA_DIR}"
7195 - chmod 0700 "${DATA_DIR}"
7196 - fi
7197 -
7198 - einfo "Initializing the database ..."
7199 -
7200 - if [[ ${EUID} == 0 ]] ; then
7201 - su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
7202 - else
7203 - "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
7204 - fi
7205 -
7206 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
7207 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
7208 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
7209 - fi
7210 -
7211 - # unix_socket_directory has no effect in postgresql.conf as it's
7212 - # overridden in the initscript
7213 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
7214 -
7215 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
7216 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
7217 - # On the off-chance that you might need to work with UTF-8 encoded
7218 - # characters in PL/Perl
7219 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
7220 - EOF
7221 -
7222 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
7223 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
7224 - einfo "by default. You can disable it in the cluster's:"
7225 - einfo " ${PGDATA%/}/postgresql.conf"
7226 - einfo
7227 - einfo "The PostgreSQL server, by default, will log events to:"
7228 - einfo " ${DATA_DIR%/}/postmaster.log"
7229 - einfo
7230 - if use prefix ; then
7231 - einfo "The location of the configuration files have moved to:"
7232 - einfo " ${PGDATA}"
7233 - einfo "To start the server:"
7234 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
7235 - einfo "To stop:"
7236 - einfo " pg_ctl stop -D ${DATA_DIR}"
7237 - einfo
7238 - einfo "Or move the configuration files back:"
7239 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
7240 - else
7241 - einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
7242 - einfo "instead of 'pg_ctl'."
7243 - fi
7244 -}
7245 -
7246 -src_test() {
7247 - if use server && [[ ${UID} -ne 0 ]] ; then
7248 - emake check
7249 -
7250 - einfo "If you think other tests besides the regression tests are necessary, please"
7251 - einfo "submit a bug including a patch for this ebuild to enable them."
7252 - else
7253 - use server || \
7254 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
7255 - [[ ${UID} -eq 0 ]] || \
7256 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
7257 -
7258 - ewarn 'Skipping.'
7259 - fi
7260 -}
7261
7262 diff --git a/dev-db/postgresql/postgresql-9.5.18.ebuild b/dev-db/postgresql/postgresql-9.5.18.ebuild
7263 deleted file mode 100644
7264 index 0c24bf6a2e3..00000000000
7265 --- a/dev-db/postgresql/postgresql-9.5.18.ebuild
7266 +++ /dev/null
7267 @@ -1,485 +0,0 @@
7268 -# Copyright 1999-2020 Gentoo Authors
7269 -# Distributed under the terms of the GNU General Public License v2
7270 -
7271 -EAPI=7
7272 -
7273 -PYTHON_COMPAT=( python3_{6,7} )
7274 -
7275 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
7276 - zh_TW"
7277 -
7278 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
7279 - systemd user
7280 -
7281 -KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
7282 -
7283 -SLOT=$(ver_cut 1-2)
7284 -
7285 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
7286 -
7287 -LICENSE="POSTGRESQL GPL-2"
7288 -DESCRIPTION="PostgreSQL RDBMS"
7289 -HOMEPAGE="https://www.postgresql.org/"
7290 -
7291 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
7292 - -pg_legacytimestamp python +readline selinux +server systemd ssl
7293 - static-libs tcl threads uuid xml zlib"
7294 -
7295 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
7296 -
7297 -CDEPEND="
7298 ->=app-eselect/eselect-postgresql-2.0
7299 -sys-apps/less
7300 -virtual/libintl
7301 -kerberos? ( virtual/krb5 )
7302 -ldap? ( net-nds/openldap )
7303 -pam? ( sys-libs/pam )
7304 -perl? ( >=dev-lang/perl-5.8:= )
7305 -python? ( ${PYTHON_DEPS} )
7306 -readline? ( sys-libs/readline:0= )
7307 -ssl? (
7308 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
7309 - libressl? ( dev-libs/libressl:= )
7310 -)
7311 -tcl? ( >=dev-lang/tcl-8:0= )
7312 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
7313 -zlib? ( sys-libs/zlib )
7314 -"
7315 -
7316 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
7317 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
7318 -# the libc includes UUID functions.
7319 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
7320 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
7321 -
7322 -nest_usedep() {
7323 - local front back
7324 - while [[ ${#} -gt 1 ]]; do
7325 - front+="${1}? ( "
7326 - back+=" )"
7327 - shift
7328 - done
7329 - echo "${front}${1}${back}"
7330 -}
7331 -
7332 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
7333 -CDEPEND+="
7334 -uuid? (
7335 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
7336 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
7337 -)"
7338 -
7339 -DEPEND="${CDEPEND}
7340 -!!<sys-apps/sandbox-2.0
7341 -sys-devel/bison
7342 -sys-devel/flex
7343 -nls? ( sys-devel/gettext )
7344 -xml? ( virtual/pkgconfig )
7345 -"
7346 -
7347 -RDEPEND="${CDEPEND}
7348 -!dev-db/postgresql-docs:${SLOT}
7349 -!dev-db/postgresql-base:${SLOT}
7350 -!dev-db/postgresql-server:${SLOT}
7351 -selinux? ( sec-policy/selinux-postgresql )
7352 -"
7353 -
7354 -pkg_setup() {
7355 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
7356 -
7357 - enewgroup postgres 70
7358 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
7359 -
7360 - use python && python-single-r1_pkg_setup
7361 -}
7362 -
7363 -src_prepare() {
7364 - # Work around PPC{,64} compilation bug where bool is already defined
7365 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
7366 -
7367 - # Set proper run directory
7368 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
7369 - -i src/include/pg_config_manual.h || die
7370 -
7371 - # Rely on $PATH being in the proper order so that the correct
7372 - # install program is used for modules utilizing PGXS in both
7373 - # hardened and non-hardened environments. (Bug #528786)
7374 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
7375 -
7376 - use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
7377 -
7378 - if use pam ; then
7379 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
7380 - -i src/backend/libpq/auth.c || \
7381 - die 'PGSQL_PAM_SERVICE rename failed.'
7382 - fi
7383 -
7384 - eapply_user
7385 -}
7386 -
7387 -src_configure() {
7388 - case ${CHOST} in
7389 - *-darwin*|*-solaris*)
7390 - use nls && append-libs intl
7391 - ;;
7392 - esac
7393 -
7394 - export LDFLAGS_SL="${LDFLAGS}"
7395 - export LDFLAGS_EX="${LDFLAGS}"
7396 -
7397 - local PO="${EPREFIX}"
7398 -
7399 - local i uuid_config=""
7400 - if use uuid; then
7401 - for i in ${UTIL_LINUX_LIBC[@]}; do
7402 - use ${i} && uuid_config="--with-uuid=e2fs"
7403 - done
7404 - for i in ${BSD_LIBC[@]}; do
7405 - use ${i} && uuid_config="--with-uuid=bsd"
7406 - done
7407 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
7408 - fi
7409 -
7410 - econf \
7411 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
7412 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
7413 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
7414 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
7415 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
7416 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
7417 - $(use_enable !alpha spinlocks) \
7418 - $(use_enable !pg_legacytimestamp integer-datetimes) \
7419 - $(use_enable debug) \
7420 - $(use_enable threads thread-safety) \
7421 - $(use_with kerberos gssapi) \
7422 - $(use_with ldap) \
7423 - $(use_with pam) \
7424 - $(use_with perl) \
7425 - $(use_with python) \
7426 - $(use_with readline) \
7427 - $(use_with ssl openssl) \
7428 - $(use_with tcl) \
7429 - ${uuid_config} \
7430 - $(use_with xml libxml) \
7431 - $(use_with xml libxslt) \
7432 - $(use_with zlib) \
7433 - $(use_enable nls nls "'$(l10n_get_locales)'")
7434 -}
7435 -
7436 -src_compile() {
7437 - emake
7438 - emake -C contrib
7439 -}
7440 -
7441 -src_install() {
7442 - emake DESTDIR="${D}" install
7443 - emake DESTDIR="${D}" install -C contrib
7444 -
7445 - dodoc README HISTORY doc/{TODO,bug.template}
7446 -
7447 - # man pages are already built, but if we have the target make them,
7448 - # they'll be generated from source before being installed so we
7449 - # manually install man pages.
7450 - # We use ${SLOT} instead of doman for postgresql.eselect
7451 - insinto /usr/share/postgresql-${SLOT}/man/
7452 - doins -r doc/src/sgml/man{1,3,7}
7453 - if ! use server; then
7454 - # Remove man pages for non-existent binaries
7455 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
7456 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
7457 - done
7458 - fi
7459 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
7460 -
7461 - # Create slot specific man pages
7462 - local bn f mansec slotted_name
7463 - for mansec in 1 3 7 ; do
7464 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
7465 -
7466 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
7467 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
7468 -
7469 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
7470 - bn=$(basename "${f}")
7471 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
7472 - case ${bn} in
7473 - TABLE.7|WITH.7)
7474 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
7475 - ;;
7476 - *)
7477 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
7478 - ;;
7479 - esac
7480 - done
7481 -
7482 - popd > /dev/null
7483 - done
7484 -
7485 - insinto /etc/postgresql-${SLOT}
7486 - newins src/bin/psql/psqlrc.sample psqlrc
7487 -
7488 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
7489 - # needed by extensions utilizing PGXS.
7490 - use static-libs || \
7491 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
7492 - -delete
7493 -
7494 - local f bn
7495 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
7496 - -mindepth 1 -maxdepth 1)
7497 - do
7498 - bn=$(basename "${f}")
7499 - # Temporarily tack on tmp to workaround a file collision
7500 - # issue. This is only necessary for 9.7 and earlier. 10 never
7501 - # had this issue.
7502 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
7503 - "/usr/bin/${bn}${SLOT/.}tmp"
7504 - done
7505 -
7506 - if use doc ; then
7507 - docinto html
7508 - dodoc doc/src/sgml/html/*
7509 -
7510 - docinto sgml
7511 - dodoc doc/src/sgml/*.{sgml,dsl}
7512 - fi
7513 -
7514 - if use server; then
7515 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
7516 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
7517 -
7518 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
7519 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
7520 -
7521 - if use systemd; then
7522 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
7523 - "${FILESDIR}/${PN}.service-9.2" | \
7524 - systemd_newunit - ${PN}-${SLOT}.service
7525 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
7526 - fi
7527 -
7528 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
7529 -
7530 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
7531 -
7532 - if use prefix ; then
7533 - keepdir /run/postgresql
7534 - fperms 1775 /run/postgresql
7535 - fi
7536 - fi
7537 -}
7538 -
7539 -pkg_preinst() {
7540 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
7541 - # /usr/bin/psql96). They may have been created by the
7542 - # postgresql.eselect module, but they're handled within this ebuild
7543 - # now. It's alright if we momentarily delete /usr/bin/psql as it
7544 - # will be recreated by the eselect module in pkg_ppostinst(). This
7545 - # is only necessary for 9.7 and earlier. 10 and later were never
7546 - # handled in this manner.
7547 - local canonicalise
7548 - if type -p realpath > /dev/null; then
7549 - canonicalise=realpath
7550 - elif type -p readlink > /dev/null; then
7551 - canonicalise='readlink -f'
7552 - else
7553 - # can't die, subshell
7554 - die "No readlink nor realpath found, cannot canonicalise"
7555 - fi
7556 -
7557 - local l
7558 - # First remove any symlinks in /usr/bin that may have been created
7559 - # by the old eselect
7560 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
7561 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
7562 - rm "${l}" || ewarn "Couldn't remove ${l}"
7563 - fi
7564 - done
7565 -
7566 - # Then move the symlinks created by the ebuild to their proper place.
7567 - for l in "${ED}"/usr/bin/*tmp ; do
7568 - mv "${l}" "${l%tmp}" \
7569 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
7570 - done
7571 -}
7572 -
7573 -pkg_postinst() {
7574 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
7575 - postgresql-config update
7576 -
7577 - if use alpha && use server ; then
7578 - ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
7579 - ewarn "As a result, performance will be extremely degraded."
7580 - fi
7581 -
7582 - elog "If you need a global psqlrc-file, you can place it in:"
7583 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
7584 -
7585 - if use server ; then
7586 - elog
7587 - elog "Gentoo specific documentation:"
7588 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
7589 - elog
7590 - elog "Official documentation:"
7591 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
7592 - elog
7593 - elog "The default location of the Unix-domain socket is:"
7594 - elog " ${EROOT}/run/postgresql/"
7595 - elog
7596 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
7597 - elog "so that it contains your preferred locale in:"
7598 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
7599 - elog
7600 - elog "Then, execute the following command to setup the initial database"
7601 - elog "environment:"
7602 - elog " emerge --config =${CATEGORY}/${PF}"
7603 - fi
7604 -}
7605 -
7606 -pkg_prerm() {
7607 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
7608 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
7609 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
7610 -
7611 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
7612 - sleep 10
7613 - eend 0
7614 - fi
7615 -}
7616 -
7617 -pkg_postrm() {
7618 - postgresql-config update
7619 -}
7620 -
7621 -pkg_config() {
7622 - use server || die "USE flag 'server' not enabled. Nothing to configure."
7623 -
7624 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
7625 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
7626 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
7627 - [[ -z "${DATA_DIR}" ]] \
7628 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
7629 -
7630 - # environment.bz2 may not contain the same locale as the current system
7631 - # locale. Unset and source from the current system locale.
7632 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
7633 - unset LANG
7634 - unset LC_CTYPE
7635 - unset LC_NUMERIC
7636 - unset LC_TIME
7637 - unset LC_COLLATE
7638 - unset LC_MONETARY
7639 - unset LC_MESSAGES
7640 - unset LC_ALL
7641 - source "${EROOT}/etc/env.d/02locale"
7642 - [ -n "${LANG}" ] && export LANG
7643 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
7644 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
7645 - [ -n "${LC_TIME}" ] && export LC_TIME
7646 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
7647 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
7648 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
7649 - [ -n "${LC_ALL}" ] && export LC_ALL
7650 - fi
7651 -
7652 - einfo "You can modify the paths and options passed to initdb by editing:"
7653 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
7654 - einfo
7655 - einfo "Information on options that can be passed to initdb are found at:"
7656 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
7657 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
7658 - einfo
7659 - einfo "PG_INITDB_OPTS is currently set to:"
7660 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
7661 - einfo " (none)"
7662 - else
7663 - einfo " ${PG_INITDB_OPTS}"
7664 - fi
7665 - einfo
7666 - einfo "Configuration files will be installed to:"
7667 - einfo " ${PGDATA}"
7668 - einfo
7669 - einfo "The database cluster will be created in:"
7670 - einfo " ${DATA_DIR}"
7671 - einfo
7672 -
7673 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
7674 - sleep 5
7675 - eend 0
7676 -
7677 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
7678 - eerror "The given directory, '${DATA_DIR}', is not empty."
7679 - eerror "Modify DATA_DIR to point to an empty directory."
7680 - die "${DATA_DIR} is not empty."
7681 - fi
7682 -
7683 - einfo "Creating the data directory ..."
7684 - if [[ ${EUID} == 0 ]] ; then
7685 - mkdir -p "${DATA_DIR}"
7686 - chown -Rf postgres:postgres "${DATA_DIR}"
7687 - chmod 0700 "${DATA_DIR}"
7688 - fi
7689 -
7690 - einfo "Initializing the database ..."
7691 -
7692 - if [[ ${EUID} == 0 ]] ; then
7693 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
7694 - else
7695 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
7696 - fi
7697 -
7698 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
7699 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
7700 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
7701 - fi
7702 -
7703 - # unix_socket_directory has no effect in postgresql.conf as it's
7704 - # overridden in the initscript
7705 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
7706 -
7707 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
7708 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
7709 - # On the off-chance that you might need to work with UTF-8 encoded
7710 - # characters in PL/Perl
7711 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
7712 - EOF
7713 -
7714 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
7715 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
7716 - einfo "by default. You can disable it in the cluster's:"
7717 - einfo " ${PGDATA%/}/postgresql.conf"
7718 - einfo
7719 - einfo "The PostgreSQL server, by default, will log events to:"
7720 - einfo " ${DATA_DIR%/}/postmaster.log"
7721 - einfo
7722 - if use prefix ; then
7723 - einfo "The location of the configuration files have moved to:"
7724 - einfo " ${PGDATA}"
7725 - einfo "To start the server:"
7726 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
7727 - einfo "To stop:"
7728 - einfo " pg_ctl stop -D ${DATA_DIR}"
7729 - einfo
7730 - einfo "Or move the configuration files back:"
7731 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
7732 - else
7733 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
7734 - einfo "instead of 'pg_ctl'."
7735 - fi
7736 -}
7737 -
7738 -src_test() {
7739 - if use server && [[ ${UID} -ne 0 ]] ; then
7740 - emake check
7741 -
7742 - einfo "If you think other tests besides the regression tests are necessary, please"
7743 - einfo "submit a bug including a patch for this ebuild to enable them."
7744 - else
7745 - use server || \
7746 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
7747 - [[ ${UID} -eq 0 ]] || \
7748 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
7749 -
7750 - ewarn 'Skipping.'
7751 - fi
7752 -}
7753
7754 diff --git a/dev-db/postgresql/postgresql-9.5.19.ebuild b/dev-db/postgresql/postgresql-9.5.19.ebuild
7755 deleted file mode 100644
7756 index 2616c4614cc..00000000000
7757 --- a/dev-db/postgresql/postgresql-9.5.19.ebuild
7758 +++ /dev/null
7759 @@ -1,485 +0,0 @@
7760 -# Copyright 1999-2020 Gentoo Authors
7761 -# Distributed under the terms of the GNU General Public License v2
7762 -
7763 -EAPI=7
7764 -
7765 -PYTHON_COMPAT=( python3_{6,7} )
7766 -
7767 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
7768 - zh_TW"
7769 -
7770 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
7771 - systemd user
7772 -
7773 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris"
7774 -
7775 -SLOT=$(ver_cut 1-2)
7776 -
7777 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
7778 -
7779 -LICENSE="POSTGRESQL GPL-2"
7780 -DESCRIPTION="PostgreSQL RDBMS"
7781 -HOMEPAGE="https://www.postgresql.org/"
7782 -
7783 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
7784 - -pg_legacytimestamp python +readline selinux +server systemd ssl
7785 - static-libs tcl threads uuid xml zlib"
7786 -
7787 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
7788 -
7789 -CDEPEND="
7790 ->=app-eselect/eselect-postgresql-2.0
7791 -sys-apps/less
7792 -virtual/libintl
7793 -kerberos? ( virtual/krb5 )
7794 -ldap? ( net-nds/openldap )
7795 -pam? ( sys-libs/pam )
7796 -perl? ( >=dev-lang/perl-5.8:= )
7797 -python? ( ${PYTHON_DEPS} )
7798 -readline? ( sys-libs/readline:0= )
7799 -ssl? (
7800 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
7801 - libressl? ( dev-libs/libressl:= )
7802 -)
7803 -tcl? ( >=dev-lang/tcl-8:0= )
7804 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
7805 -zlib? ( sys-libs/zlib )
7806 -"
7807 -
7808 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
7809 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
7810 -# the libc includes UUID functions.
7811 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
7812 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
7813 -
7814 -nest_usedep() {
7815 - local front back
7816 - while [[ ${#} -gt 1 ]]; do
7817 - front+="${1}? ( "
7818 - back+=" )"
7819 - shift
7820 - done
7821 - echo "${front}${1}${back}"
7822 -}
7823 -
7824 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
7825 -CDEPEND+="
7826 -uuid? (
7827 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
7828 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
7829 -)"
7830 -
7831 -DEPEND="${CDEPEND}
7832 -!!<sys-apps/sandbox-2.0
7833 -sys-devel/bison
7834 -sys-devel/flex
7835 -nls? ( sys-devel/gettext )
7836 -xml? ( virtual/pkgconfig )
7837 -"
7838 -
7839 -RDEPEND="${CDEPEND}
7840 -!dev-db/postgresql-docs:${SLOT}
7841 -!dev-db/postgresql-base:${SLOT}
7842 -!dev-db/postgresql-server:${SLOT}
7843 -selinux? ( sec-policy/selinux-postgresql )
7844 -"
7845 -
7846 -pkg_setup() {
7847 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
7848 -
7849 - enewgroup postgres 70
7850 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
7851 -
7852 - use python && python-single-r1_pkg_setup
7853 -}
7854 -
7855 -src_prepare() {
7856 - # Work around PPC{,64} compilation bug where bool is already defined
7857 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
7858 -
7859 - # Set proper run directory
7860 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
7861 - -i src/include/pg_config_manual.h || die
7862 -
7863 - # Rely on $PATH being in the proper order so that the correct
7864 - # install program is used for modules utilizing PGXS in both
7865 - # hardened and non-hardened environments. (Bug #528786)
7866 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
7867 -
7868 - use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
7869 -
7870 - if use pam ; then
7871 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
7872 - -i src/backend/libpq/auth.c || \
7873 - die 'PGSQL_PAM_SERVICE rename failed.'
7874 - fi
7875 -
7876 - eapply_user
7877 -}
7878 -
7879 -src_configure() {
7880 - case ${CHOST} in
7881 - *-darwin*|*-solaris*)
7882 - use nls && append-libs intl
7883 - ;;
7884 - esac
7885 -
7886 - export LDFLAGS_SL="${LDFLAGS}"
7887 - export LDFLAGS_EX="${LDFLAGS}"
7888 -
7889 - local PO="${EPREFIX}"
7890 -
7891 - local i uuid_config=""
7892 - if use uuid; then
7893 - for i in ${UTIL_LINUX_LIBC[@]}; do
7894 - use ${i} && uuid_config="--with-uuid=e2fs"
7895 - done
7896 - for i in ${BSD_LIBC[@]}; do
7897 - use ${i} && uuid_config="--with-uuid=bsd"
7898 - done
7899 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
7900 - fi
7901 -
7902 - econf \
7903 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
7904 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
7905 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
7906 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
7907 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
7908 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
7909 - $(use_enable !alpha spinlocks) \
7910 - $(use_enable !pg_legacytimestamp integer-datetimes) \
7911 - $(use_enable debug) \
7912 - $(use_enable threads thread-safety) \
7913 - $(use_with kerberos gssapi) \
7914 - $(use_with ldap) \
7915 - $(use_with pam) \
7916 - $(use_with perl) \
7917 - $(use_with python) \
7918 - $(use_with readline) \
7919 - $(use_with ssl openssl) \
7920 - $(use_with tcl) \
7921 - ${uuid_config} \
7922 - $(use_with xml libxml) \
7923 - $(use_with xml libxslt) \
7924 - $(use_with zlib) \
7925 - $(use_enable nls nls "'$(l10n_get_locales)'")
7926 -}
7927 -
7928 -src_compile() {
7929 - emake
7930 - emake -C contrib
7931 -}
7932 -
7933 -src_install() {
7934 - emake DESTDIR="${D}" install
7935 - emake DESTDIR="${D}" install -C contrib
7936 -
7937 - dodoc README HISTORY doc/{TODO,bug.template}
7938 -
7939 - # man pages are already built, but if we have the target make them,
7940 - # they'll be generated from source before being installed so we
7941 - # manually install man pages.
7942 - # We use ${SLOT} instead of doman for postgresql.eselect
7943 - insinto /usr/share/postgresql-${SLOT}/man/
7944 - doins -r doc/src/sgml/man{1,3,7}
7945 - if ! use server; then
7946 - # Remove man pages for non-existent binaries
7947 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
7948 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
7949 - done
7950 - fi
7951 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
7952 -
7953 - # Create slot specific man pages
7954 - local bn f mansec slotted_name
7955 - for mansec in 1 3 7 ; do
7956 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
7957 -
7958 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
7959 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
7960 -
7961 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
7962 - bn=$(basename "${f}")
7963 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
7964 - case ${bn} in
7965 - TABLE.7|WITH.7)
7966 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
7967 - ;;
7968 - *)
7969 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
7970 - ;;
7971 - esac
7972 - done
7973 -
7974 - popd > /dev/null
7975 - done
7976 -
7977 - insinto /etc/postgresql-${SLOT}
7978 - newins src/bin/psql/psqlrc.sample psqlrc
7979 -
7980 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
7981 - # needed by extensions utilizing PGXS.
7982 - use static-libs || \
7983 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
7984 - -delete
7985 -
7986 - local f bn
7987 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
7988 - -mindepth 1 -maxdepth 1)
7989 - do
7990 - bn=$(basename "${f}")
7991 - # Temporarily tack on tmp to workaround a file collision
7992 - # issue. This is only necessary for 9.7 and earlier. 10 never
7993 - # had this issue.
7994 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
7995 - "/usr/bin/${bn}${SLOT/.}tmp"
7996 - done
7997 -
7998 - if use doc ; then
7999 - docinto html
8000 - dodoc doc/src/sgml/html/*
8001 -
8002 - docinto sgml
8003 - dodoc doc/src/sgml/*.{sgml,dsl}
8004 - fi
8005 -
8006 - if use server; then
8007 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
8008 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
8009 -
8010 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
8011 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
8012 -
8013 - if use systemd; then
8014 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
8015 - "${FILESDIR}/${PN}.service-9.2" | \
8016 - systemd_newunit - ${PN}-${SLOT}.service
8017 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
8018 - fi
8019 -
8020 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
8021 -
8022 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
8023 -
8024 - if use prefix ; then
8025 - keepdir /run/postgresql
8026 - fperms 1775 /run/postgresql
8027 - fi
8028 - fi
8029 -}
8030 -
8031 -pkg_preinst() {
8032 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
8033 - # /usr/bin/psql96). They may have been created by the
8034 - # postgresql.eselect module, but they're handled within this ebuild
8035 - # now. It's alright if we momentarily delete /usr/bin/psql as it
8036 - # will be recreated by the eselect module in pkg_ppostinst(). This
8037 - # is only necessary for 9.7 and earlier. 10 and later were never
8038 - # handled in this manner.
8039 - local canonicalise
8040 - if type -p realpath > /dev/null; then
8041 - canonicalise=realpath
8042 - elif type -p readlink > /dev/null; then
8043 - canonicalise='readlink -f'
8044 - else
8045 - # can't die, subshell
8046 - die "No readlink nor realpath found, cannot canonicalise"
8047 - fi
8048 -
8049 - local l
8050 - # First remove any symlinks in /usr/bin that may have been created
8051 - # by the old eselect
8052 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
8053 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
8054 - rm "${l}" || ewarn "Couldn't remove ${l}"
8055 - fi
8056 - done
8057 -
8058 - # Then move the symlinks created by the ebuild to their proper place.
8059 - for l in "${ED}"/usr/bin/*tmp ; do
8060 - mv "${l}" "${l%tmp}" \
8061 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
8062 - done
8063 -}
8064 -
8065 -pkg_postinst() {
8066 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
8067 - postgresql-config update
8068 -
8069 - if use alpha && use server ; then
8070 - ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
8071 - ewarn "As a result, performance will be extremely degraded."
8072 - fi
8073 -
8074 - elog "If you need a global psqlrc-file, you can place it in:"
8075 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
8076 -
8077 - if use server ; then
8078 - elog
8079 - elog "Gentoo specific documentation:"
8080 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
8081 - elog
8082 - elog "Official documentation:"
8083 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
8084 - elog
8085 - elog "The default location of the Unix-domain socket is:"
8086 - elog " ${EROOT}/run/postgresql/"
8087 - elog
8088 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
8089 - elog "so that it contains your preferred locale in:"
8090 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
8091 - elog
8092 - elog "Then, execute the following command to setup the initial database"
8093 - elog "environment:"
8094 - elog " emerge --config =${CATEGORY}/${PF}"
8095 - fi
8096 -}
8097 -
8098 -pkg_prerm() {
8099 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
8100 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
8101 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
8102 -
8103 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
8104 - sleep 10
8105 - eend 0
8106 - fi
8107 -}
8108 -
8109 -pkg_postrm() {
8110 - postgresql-config update
8111 -}
8112 -
8113 -pkg_config() {
8114 - use server || die "USE flag 'server' not enabled. Nothing to configure."
8115 -
8116 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
8117 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
8118 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
8119 - [[ -z "${DATA_DIR}" ]] \
8120 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
8121 -
8122 - # environment.bz2 may not contain the same locale as the current system
8123 - # locale. Unset and source from the current system locale.
8124 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
8125 - unset LANG
8126 - unset LC_CTYPE
8127 - unset LC_NUMERIC
8128 - unset LC_TIME
8129 - unset LC_COLLATE
8130 - unset LC_MONETARY
8131 - unset LC_MESSAGES
8132 - unset LC_ALL
8133 - source "${EROOT}/etc/env.d/02locale"
8134 - [ -n "${LANG}" ] && export LANG
8135 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
8136 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
8137 - [ -n "${LC_TIME}" ] && export LC_TIME
8138 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
8139 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
8140 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
8141 - [ -n "${LC_ALL}" ] && export LC_ALL
8142 - fi
8143 -
8144 - einfo "You can modify the paths and options passed to initdb by editing:"
8145 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
8146 - einfo
8147 - einfo "Information on options that can be passed to initdb are found at:"
8148 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
8149 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
8150 - einfo
8151 - einfo "PG_INITDB_OPTS is currently set to:"
8152 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
8153 - einfo " (none)"
8154 - else
8155 - einfo " ${PG_INITDB_OPTS}"
8156 - fi
8157 - einfo
8158 - einfo "Configuration files will be installed to:"
8159 - einfo " ${PGDATA}"
8160 - einfo
8161 - einfo "The database cluster will be created in:"
8162 - einfo " ${DATA_DIR}"
8163 - einfo
8164 -
8165 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
8166 - sleep 5
8167 - eend 0
8168 -
8169 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
8170 - eerror "The given directory, '${DATA_DIR}', is not empty."
8171 - eerror "Modify DATA_DIR to point to an empty directory."
8172 - die "${DATA_DIR} is not empty."
8173 - fi
8174 -
8175 - einfo "Creating the data directory ..."
8176 - if [[ ${EUID} == 0 ]] ; then
8177 - mkdir -p "${DATA_DIR}"
8178 - chown -Rf postgres:postgres "${DATA_DIR}"
8179 - chmod 0700 "${DATA_DIR}"
8180 - fi
8181 -
8182 - einfo "Initializing the database ..."
8183 -
8184 - if [[ ${EUID} == 0 ]] ; then
8185 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
8186 - else
8187 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
8188 - fi
8189 -
8190 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
8191 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
8192 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
8193 - fi
8194 -
8195 - # unix_socket_directory has no effect in postgresql.conf as it's
8196 - # overridden in the initscript
8197 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
8198 -
8199 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
8200 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
8201 - # On the off-chance that you might need to work with UTF-8 encoded
8202 - # characters in PL/Perl
8203 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
8204 - EOF
8205 -
8206 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
8207 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
8208 - einfo "by default. You can disable it in the cluster's:"
8209 - einfo " ${PGDATA%/}/postgresql.conf"
8210 - einfo
8211 - einfo "The PostgreSQL server, by default, will log events to:"
8212 - einfo " ${DATA_DIR%/}/postmaster.log"
8213 - einfo
8214 - if use prefix ; then
8215 - einfo "The location of the configuration files have moved to:"
8216 - einfo " ${PGDATA}"
8217 - einfo "To start the server:"
8218 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
8219 - einfo "To stop:"
8220 - einfo " pg_ctl stop -D ${DATA_DIR}"
8221 - einfo
8222 - einfo "Or move the configuration files back:"
8223 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
8224 - else
8225 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
8226 - einfo "instead of 'pg_ctl'."
8227 - fi
8228 -}
8229 -
8230 -src_test() {
8231 - if use server && [[ ${UID} -ne 0 ]] ; then
8232 - emake check
8233 -
8234 - einfo "If you think other tests besides the regression tests are necessary, please"
8235 - einfo "submit a bug including a patch for this ebuild to enable them."
8236 - else
8237 - use server || \
8238 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
8239 - [[ ${UID} -eq 0 ]] || \
8240 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
8241 -
8242 - ewarn 'Skipping.'
8243 - fi
8244 -}
8245
8246 diff --git a/dev-db/postgresql/postgresql-9.5.20.ebuild b/dev-db/postgresql/postgresql-9.5.20.ebuild
8247 deleted file mode 100644
8248 index 00537608230..00000000000
8249 --- a/dev-db/postgresql/postgresql-9.5.20.ebuild
8250 +++ /dev/null
8251 @@ -1,485 +0,0 @@
8252 -# Copyright 1999-2020 Gentoo Authors
8253 -# Distributed under the terms of the GNU General Public License v2
8254 -
8255 -EAPI=7
8256 -
8257 -PYTHON_COMPAT=( python3_{6,7} )
8258 -
8259 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
8260 - zh_TW"
8261 -
8262 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
8263 - systemd user
8264 -
8265 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
8266 -
8267 -SLOT=$(ver_cut 1-2)
8268 -
8269 -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2"
8270 -
8271 -LICENSE="POSTGRESQL GPL-2"
8272 -DESCRIPTION="PostgreSQL RDBMS"
8273 -HOMEPAGE="https://www.postgresql.org/"
8274 -
8275 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
8276 - -pg_legacytimestamp python +readline selinux +server systemd ssl
8277 - static-libs tcl threads uuid xml zlib"
8278 -
8279 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
8280 -
8281 -CDEPEND="
8282 ->=app-eselect/eselect-postgresql-2.0
8283 -sys-apps/less
8284 -virtual/libintl
8285 -kerberos? ( virtual/krb5 )
8286 -ldap? ( net-nds/openldap )
8287 -pam? ( sys-libs/pam )
8288 -perl? ( >=dev-lang/perl-5.8:= )
8289 -python? ( ${PYTHON_DEPS} )
8290 -readline? ( sys-libs/readline:0= )
8291 -ssl? (
8292 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
8293 - libressl? ( dev-libs/libressl:= )
8294 -)
8295 -tcl? ( >=dev-lang/tcl-8:0= )
8296 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
8297 -zlib? ( sys-libs/zlib )
8298 -"
8299 -
8300 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
8301 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
8302 -# the libc includes UUID functions.
8303 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
8304 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
8305 -
8306 -nest_usedep() {
8307 - local front back
8308 - while [[ ${#} -gt 1 ]]; do
8309 - front+="${1}? ( "
8310 - back+=" )"
8311 - shift
8312 - done
8313 - echo "${front}${1}${back}"
8314 -}
8315 -
8316 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
8317 -CDEPEND+="
8318 -uuid? (
8319 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
8320 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
8321 -)"
8322 -
8323 -DEPEND="${CDEPEND}
8324 -!!<sys-apps/sandbox-2.0
8325 -sys-devel/bison
8326 -sys-devel/flex
8327 -nls? ( sys-devel/gettext )
8328 -xml? ( virtual/pkgconfig )
8329 -"
8330 -
8331 -RDEPEND="${CDEPEND}
8332 -!dev-db/postgresql-docs:${SLOT}
8333 -!dev-db/postgresql-base:${SLOT}
8334 -!dev-db/postgresql-server:${SLOT}
8335 -selinux? ( sec-policy/selinux-postgresql )
8336 -"
8337 -
8338 -pkg_setup() {
8339 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
8340 -
8341 - enewgroup postgres 70
8342 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
8343 -
8344 - use python && python-single-r1_pkg_setup
8345 -}
8346 -
8347 -src_prepare() {
8348 - # Work around PPC{,64} compilation bug where bool is already defined
8349 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
8350 -
8351 - # Set proper run directory
8352 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
8353 - -i src/include/pg_config_manual.h || die
8354 -
8355 - # Rely on $PATH being in the proper order so that the correct
8356 - # install program is used for modules utilizing PGXS in both
8357 - # hardened and non-hardened environments. (Bug #528786)
8358 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
8359 -
8360 - use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
8361 -
8362 - if use pam ; then
8363 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
8364 - -i src/backend/libpq/auth.c || \
8365 - die 'PGSQL_PAM_SERVICE rename failed.'
8366 - fi
8367 -
8368 - eapply_user
8369 -}
8370 -
8371 -src_configure() {
8372 - case ${CHOST} in
8373 - *-darwin*|*-solaris*)
8374 - use nls && append-libs intl
8375 - ;;
8376 - esac
8377 -
8378 - export LDFLAGS_SL="${LDFLAGS}"
8379 - export LDFLAGS_EX="${LDFLAGS}"
8380 -
8381 - local PO="${EPREFIX}"
8382 -
8383 - local i uuid_config=""
8384 - if use uuid; then
8385 - for i in ${UTIL_LINUX_LIBC[@]}; do
8386 - use ${i} && uuid_config="--with-uuid=e2fs"
8387 - done
8388 - for i in ${BSD_LIBC[@]}; do
8389 - use ${i} && uuid_config="--with-uuid=bsd"
8390 - done
8391 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
8392 - fi
8393 -
8394 - econf \
8395 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
8396 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
8397 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
8398 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
8399 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
8400 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
8401 - $(use_enable !alpha spinlocks) \
8402 - $(use_enable !pg_legacytimestamp integer-datetimes) \
8403 - $(use_enable debug) \
8404 - $(use_enable threads thread-safety) \
8405 - $(use_with kerberos gssapi) \
8406 - $(use_with ldap) \
8407 - $(use_with pam) \
8408 - $(use_with perl) \
8409 - $(use_with python) \
8410 - $(use_with readline) \
8411 - $(use_with ssl openssl) \
8412 - $(use_with tcl) \
8413 - ${uuid_config} \
8414 - $(use_with xml libxml) \
8415 - $(use_with xml libxslt) \
8416 - $(use_with zlib) \
8417 - $(use_enable nls nls "'$(l10n_get_locales)'")
8418 -}
8419 -
8420 -src_compile() {
8421 - emake
8422 - emake -C contrib
8423 -}
8424 -
8425 -src_install() {
8426 - emake DESTDIR="${D}" install
8427 - emake DESTDIR="${D}" install -C contrib
8428 -
8429 - dodoc README HISTORY doc/{TODO,bug.template}
8430 -
8431 - # man pages are already built, but if we have the target make them,
8432 - # they'll be generated from source before being installed so we
8433 - # manually install man pages.
8434 - # We use ${SLOT} instead of doman for postgresql.eselect
8435 - insinto /usr/share/postgresql-${SLOT}/man/
8436 - doins -r doc/src/sgml/man{1,3,7}
8437 - if ! use server; then
8438 - # Remove man pages for non-existent binaries
8439 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
8440 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
8441 - done
8442 - fi
8443 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
8444 -
8445 - # Create slot specific man pages
8446 - local bn f mansec slotted_name
8447 - for mansec in 1 3 7 ; do
8448 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
8449 -
8450 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
8451 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
8452 -
8453 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
8454 - bn=$(basename "${f}")
8455 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
8456 - case ${bn} in
8457 - TABLE.7|WITH.7)
8458 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
8459 - ;;
8460 - *)
8461 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
8462 - ;;
8463 - esac
8464 - done
8465 -
8466 - popd > /dev/null
8467 - done
8468 -
8469 - insinto /etc/postgresql-${SLOT}
8470 - newins src/bin/psql/psqlrc.sample psqlrc
8471 -
8472 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
8473 - # needed by extensions utilizing PGXS.
8474 - use static-libs || \
8475 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
8476 - -delete
8477 -
8478 - local f bn
8479 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
8480 - -mindepth 1 -maxdepth 1)
8481 - do
8482 - bn=$(basename "${f}")
8483 - # Temporarily tack on tmp to workaround a file collision
8484 - # issue. This is only necessary for 9.7 and earlier. 10 never
8485 - # had this issue.
8486 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
8487 - "/usr/bin/${bn}${SLOT/.}tmp"
8488 - done
8489 -
8490 - if use doc ; then
8491 - docinto html
8492 - dodoc doc/src/sgml/html/*
8493 -
8494 - docinto sgml
8495 - dodoc doc/src/sgml/*.{sgml,dsl}
8496 - fi
8497 -
8498 - if use server; then
8499 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
8500 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
8501 -
8502 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
8503 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
8504 -
8505 - if use systemd; then
8506 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
8507 - "${FILESDIR}/${PN}.service-9.2" | \
8508 - systemd_newunit - ${PN}-${SLOT}.service
8509 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
8510 - fi
8511 -
8512 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
8513 -
8514 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
8515 -
8516 - if use prefix ; then
8517 - keepdir /run/postgresql
8518 - fperms 1775 /run/postgresql
8519 - fi
8520 - fi
8521 -}
8522 -
8523 -pkg_preinst() {
8524 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
8525 - # /usr/bin/psql96). They may have been created by the
8526 - # postgresql.eselect module, but they're handled within this ebuild
8527 - # now. It's alright if we momentarily delete /usr/bin/psql as it
8528 - # will be recreated by the eselect module in pkg_ppostinst(). This
8529 - # is only necessary for 9.7 and earlier. 10 and later were never
8530 - # handled in this manner.
8531 - local canonicalise
8532 - if type -p realpath > /dev/null; then
8533 - canonicalise=realpath
8534 - elif type -p readlink > /dev/null; then
8535 - canonicalise='readlink -f'
8536 - else
8537 - # can't die, subshell
8538 - die "No readlink nor realpath found, cannot canonicalise"
8539 - fi
8540 -
8541 - local l
8542 - # First remove any symlinks in /usr/bin that may have been created
8543 - # by the old eselect
8544 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
8545 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
8546 - rm "${l}" || ewarn "Couldn't remove ${l}"
8547 - fi
8548 - done
8549 -
8550 - # Then move the symlinks created by the ebuild to their proper place.
8551 - for l in "${ED}"/usr/bin/*tmp ; do
8552 - mv "${l}" "${l%tmp}" \
8553 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
8554 - done
8555 -}
8556 -
8557 -pkg_postinst() {
8558 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
8559 - postgresql-config update
8560 -
8561 - if use alpha && use server ; then
8562 - ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
8563 - ewarn "As a result, performance will be extremely degraded."
8564 - fi
8565 -
8566 - elog "If you need a global psqlrc-file, you can place it in:"
8567 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
8568 -
8569 - if use server ; then
8570 - elog
8571 - elog "Gentoo specific documentation:"
8572 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
8573 - elog
8574 - elog "Official documentation:"
8575 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
8576 - elog
8577 - elog "The default location of the Unix-domain socket is:"
8578 - elog " ${EROOT}/run/postgresql/"
8579 - elog
8580 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
8581 - elog "so that it contains your preferred locale in:"
8582 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
8583 - elog
8584 - elog "Then, execute the following command to setup the initial database"
8585 - elog "environment:"
8586 - elog " emerge --config =${CATEGORY}/${PF}"
8587 - fi
8588 -}
8589 -
8590 -pkg_prerm() {
8591 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
8592 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
8593 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
8594 -
8595 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
8596 - sleep 10
8597 - eend 0
8598 - fi
8599 -}
8600 -
8601 -pkg_postrm() {
8602 - postgresql-config update
8603 -}
8604 -
8605 -pkg_config() {
8606 - use server || die "USE flag 'server' not enabled. Nothing to configure."
8607 -
8608 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
8609 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
8610 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
8611 - [[ -z "${DATA_DIR}" ]] \
8612 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
8613 -
8614 - # environment.bz2 may not contain the same locale as the current system
8615 - # locale. Unset and source from the current system locale.
8616 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
8617 - unset LANG
8618 - unset LC_CTYPE
8619 - unset LC_NUMERIC
8620 - unset LC_TIME
8621 - unset LC_COLLATE
8622 - unset LC_MONETARY
8623 - unset LC_MESSAGES
8624 - unset LC_ALL
8625 - source "${EROOT}/etc/env.d/02locale"
8626 - [ -n "${LANG}" ] && export LANG
8627 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
8628 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
8629 - [ -n "${LC_TIME}" ] && export LC_TIME
8630 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
8631 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
8632 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
8633 - [ -n "${LC_ALL}" ] && export LC_ALL
8634 - fi
8635 -
8636 - einfo "You can modify the paths and options passed to initdb by editing:"
8637 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
8638 - einfo
8639 - einfo "Information on options that can be passed to initdb are found at:"
8640 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
8641 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
8642 - einfo
8643 - einfo "PG_INITDB_OPTS is currently set to:"
8644 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
8645 - einfo " (none)"
8646 - else
8647 - einfo " ${PG_INITDB_OPTS}"
8648 - fi
8649 - einfo
8650 - einfo "Configuration files will be installed to:"
8651 - einfo " ${PGDATA}"
8652 - einfo
8653 - einfo "The database cluster will be created in:"
8654 - einfo " ${DATA_DIR}"
8655 - einfo
8656 -
8657 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
8658 - sleep 5
8659 - eend 0
8660 -
8661 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
8662 - eerror "The given directory, '${DATA_DIR}', is not empty."
8663 - eerror "Modify DATA_DIR to point to an empty directory."
8664 - die "${DATA_DIR} is not empty."
8665 - fi
8666 -
8667 - einfo "Creating the data directory ..."
8668 - if [[ ${EUID} == 0 ]] ; then
8669 - mkdir -p "${DATA_DIR}"
8670 - chown -Rf postgres:postgres "${DATA_DIR}"
8671 - chmod 0700 "${DATA_DIR}"
8672 - fi
8673 -
8674 - einfo "Initializing the database ..."
8675 -
8676 - if [[ ${EUID} == 0 ]] ; then
8677 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
8678 - else
8679 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
8680 - fi
8681 -
8682 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
8683 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
8684 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
8685 - fi
8686 -
8687 - # unix_socket_directory has no effect in postgresql.conf as it's
8688 - # overridden in the initscript
8689 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
8690 -
8691 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
8692 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
8693 - # On the off-chance that you might need to work with UTF-8 encoded
8694 - # characters in PL/Perl
8695 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
8696 - EOF
8697 -
8698 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
8699 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
8700 - einfo "by default. You can disable it in the cluster's:"
8701 - einfo " ${PGDATA%/}/postgresql.conf"
8702 - einfo
8703 - einfo "The PostgreSQL server, by default, will log events to:"
8704 - einfo " ${DATA_DIR%/}/postmaster.log"
8705 - einfo
8706 - if use prefix ; then
8707 - einfo "The location of the configuration files have moved to:"
8708 - einfo " ${PGDATA}"
8709 - einfo "To start the server:"
8710 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
8711 - einfo "To stop:"
8712 - einfo " pg_ctl stop -D ${DATA_DIR}"
8713 - einfo
8714 - einfo "Or move the configuration files back:"
8715 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
8716 - else
8717 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
8718 - einfo "instead of 'pg_ctl'."
8719 - fi
8720 -}
8721 -
8722 -src_test() {
8723 - if use server && [[ ${UID} -ne 0 ]] ; then
8724 - emake check
8725 -
8726 - einfo "If you think other tests besides the regression tests are necessary, please"
8727 - einfo "submit a bug including a patch for this ebuild to enable them."
8728 - else
8729 - use server || \
8730 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
8731 - [[ ${UID} -eq 0 ]] || \
8732 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
8733 -
8734 - ewarn 'Skipping.'
8735 - fi
8736 -}
8737
8738 diff --git a/dev-db/postgresql/postgresql-9.6.13-r1.ebuild b/dev-db/postgresql/postgresql-9.6.13-r1.ebuild
8739 deleted file mode 100644
8740 index 800e0b2727e..00000000000
8741 --- a/dev-db/postgresql/postgresql-9.6.13-r1.ebuild
8742 +++ /dev/null
8743 @@ -1,490 +0,0 @@
8744 -# Copyright 1999-2020 Gentoo Authors
8745 -# Distributed under the terms of the GNU General Public License v2
8746 -
8747 -EAPI=7
8748 -
8749 -PYTHON_COMPAT=( python3_{6,7} )
8750 -
8751 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
8752 - zh_TW"
8753 -
8754 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
8755 - systemd user
8756 -
8757 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
8758 -
8759 -SLOT=$(ver_cut 1-2)
8760 -
8761 -MY_PV=${PV/_/}
8762 -S="${WORKDIR}/${PN}-${MY_PV}"
8763 -
8764 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
8765 -
8766 -LICENSE="POSTGRESQL GPL-2"
8767 -DESCRIPTION="PostgreSQL RDBMS"
8768 -HOMEPAGE="https://www.postgresql.org/"
8769 -
8770 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
8771 - -pg_legacytimestamp python +readline selinux +server systemd ssl
8772 - static-libs tcl threads uuid xml zlib"
8773 -
8774 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
8775 -
8776 -CDEPEND="
8777 ->=app-eselect/eselect-postgresql-2.0
8778 -sys-apps/less
8779 -virtual/libintl
8780 -kerberos? ( virtual/krb5 )
8781 -ldap? ( net-nds/openldap )
8782 -pam? ( sys-libs/pam )
8783 -perl? ( >=dev-lang/perl-5.8:= )
8784 -python? ( ${PYTHON_DEPS} )
8785 -readline? ( sys-libs/readline:0= )
8786 -ssl? (
8787 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
8788 - libressl? ( dev-libs/libressl:= )
8789 -)
8790 -server? ( systemd? ( sys-apps/systemd ) )
8791 -tcl? ( >=dev-lang/tcl-8:0= )
8792 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
8793 -zlib? ( sys-libs/zlib )
8794 -"
8795 -
8796 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
8797 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
8798 -# the libc includes UUID functions.
8799 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
8800 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
8801 -
8802 -nest_usedep() {
8803 - local front back
8804 - while [[ ${#} -gt 1 ]]; do
8805 - front+="${1}? ( "
8806 - back+=" )"
8807 - shift
8808 - done
8809 - echo "${front}${1}${back}"
8810 -}
8811 -
8812 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
8813 -CDEPEND+="
8814 -uuid? (
8815 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
8816 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
8817 -)"
8818 -
8819 -DEPEND="${CDEPEND}
8820 -!!<sys-apps/sandbox-2.0
8821 -sys-devel/bison
8822 -sys-devel/flex
8823 -nls? ( sys-devel/gettext )
8824 -xml? ( virtual/pkgconfig )
8825 -"
8826 -
8827 -RDEPEND="${CDEPEND}
8828 -!dev-db/postgresql-docs:${SLOT}
8829 -!dev-db/postgresql-base:${SLOT}
8830 -!dev-db/postgresql-server:${SLOT}
8831 -selinux? ( sec-policy/selinux-postgresql )
8832 -"
8833 -
8834 -pkg_setup() {
8835 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
8836 -
8837 - enewgroup postgres 70
8838 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
8839 -
8840 - use python && python-single-r1_pkg_setup
8841 -}
8842 -
8843 -src_prepare() {
8844 - # Work around PPC{,64} compilation bug where bool is already defined
8845 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
8846 -
8847 - # Set proper run directory
8848 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
8849 - -i src/include/pg_config_manual.h || die
8850 -
8851 - # Rely on $PATH being in the proper order so that the correct
8852 - # install program is used for modules utilizing PGXS in both
8853 - # hardened and non-hardened environments. (Bug #528786)
8854 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
8855 -
8856 - use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch"
8857 -
8858 - if use pam ; then
8859 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
8860 - -i src/backend/libpq/auth.c || \
8861 - die 'PGSQL_PAM_SERVICE rename failed.'
8862 - fi
8863 -
8864 - eapply_user
8865 -}
8866 -
8867 -src_configure() {
8868 - case ${CHOST} in
8869 - *-darwin*|*-solaris*)
8870 - use nls && append-libs intl
8871 - ;;
8872 - esac
8873 -
8874 - export LDFLAGS_SL="${LDFLAGS}"
8875 - export LDFLAGS_EX="${LDFLAGS}"
8876 -
8877 - local PO="${EPREFIX}"
8878 -
8879 - local i uuid_config=""
8880 - if use uuid; then
8881 - for i in ${UTIL_LINUX_LIBC[@]}; do
8882 - use ${i} && uuid_config="--with-uuid=e2fs"
8883 - done
8884 - for i in ${BSD_LIBC[@]}; do
8885 - use ${i} && uuid_config="--with-uuid=bsd"
8886 - done
8887 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
8888 - fi
8889 -
8890 - econf \
8891 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
8892 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
8893 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
8894 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
8895 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
8896 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
8897 - $(use_enable !alpha spinlocks) \
8898 - $(use_enable !pg_legacytimestamp integer-datetimes) \
8899 - $(use_enable debug) \
8900 - $(use_enable threads thread-safety) \
8901 - $(use_with kerberos gssapi) \
8902 - $(use_with ldap) \
8903 - $(use_with pam) \
8904 - $(use_with perl) \
8905 - $(use_with python) \
8906 - $(use_with readline) \
8907 - $(use_with ssl openssl) \
8908 - $(usex server "$(use_with systemd)" '--without-systemd') \
8909 - $(use_with tcl) \
8910 - ${uuid_config} \
8911 - $(use_with xml libxml) \
8912 - $(use_with xml libxslt) \
8913 - $(use_with zlib) \
8914 - $(use_enable nls nls "'$(l10n_get_locales)'")
8915 -}
8916 -
8917 -src_compile() {
8918 - emake
8919 - emake -C contrib
8920 -}
8921 -
8922 -src_install() {
8923 - emake DESTDIR="${D}" install
8924 - emake DESTDIR="${D}" install -C contrib
8925 -
8926 - dodoc README HISTORY doc/{TODO,bug.template}
8927 -
8928 - # man pages are already built, but if we have the target make them,
8929 - # they'll be generated from source before being installed so we
8930 - # manually install man pages.
8931 - # We use ${SLOT} instead of doman for postgresql.eselect
8932 - insinto /usr/share/postgresql-${SLOT}/man/
8933 - doins -r doc/src/sgml/man{1,3,7}
8934 - if ! use server; then
8935 - # Remove man pages for non-existent binaries
8936 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
8937 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
8938 - done
8939 - fi
8940 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
8941 -
8942 - # Create slot specific man pages
8943 - local bn f mansec slotted_name
8944 - for mansec in 1 3 7 ; do
8945 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
8946 -
8947 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
8948 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
8949 -
8950 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
8951 - bn=$(basename "${f}")
8952 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
8953 - case ${bn} in
8954 - TABLE.7|WITH.7)
8955 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
8956 - ;;
8957 - *)
8958 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
8959 - ;;
8960 - esac
8961 - done
8962 -
8963 - popd > /dev/null
8964 - done
8965 -
8966 - insinto /etc/postgresql-${SLOT}
8967 - newins src/bin/psql/psqlrc.sample psqlrc
8968 -
8969 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
8970 - # needed by extensions utilizing PGXS.
8971 - use static-libs || \
8972 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
8973 - -delete
8974 -
8975 - local f bn
8976 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
8977 - -mindepth 1 -maxdepth 1)
8978 - do
8979 - bn=$(basename "${f}")
8980 - # Temporarily tack on tmp to workaround a file collision
8981 - # issue. This is only necessary for 9.7 and earlier. 10 never
8982 - # had this issue.
8983 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
8984 - "/usr/bin/${bn}${SLOT/.}tmp"
8985 - done
8986 -
8987 - if use doc ; then
8988 - docinto html
8989 - dodoc doc/src/sgml/html/*
8990 -
8991 - docinto sgml
8992 - dodoc doc/src/sgml/*.{sgml,dsl}
8993 - fi
8994 -
8995 - if use server; then
8996 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
8997 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
8998 -
8999 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9000 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
9001 -
9002 - if use systemd; then
9003 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9004 - "${FILESDIR}/${PN}.service-9.6-r1" | \
9005 - systemd_newunit - ${PN}-${SLOT}.service
9006 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
9007 - fi
9008 -
9009 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
9010 -
9011 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
9012 -
9013 - if use prefix ; then
9014 - keepdir /run/postgresql
9015 - fperms 1775 /run/postgresql
9016 - fi
9017 - fi
9018 -}
9019 -
9020 -pkg_preinst() {
9021 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
9022 - # /usr/bin/psql96). They may have been created by the
9023 - # postgresql.eselect module, but they're handled within this ebuild
9024 - # now. It's alright if we momentarily delete /usr/bin/psql as it
9025 - # will be recreated by the eselect module in pkg_ppostinst(). This
9026 - # is only necessary for 9.7 and earlier. 10 and later were never
9027 - # handled in this manner.
9028 - local canonicalise
9029 - if type -p realpath > /dev/null; then
9030 - canonicalise=realpath
9031 - elif type -p readlink > /dev/null; then
9032 - canonicalise='readlink -f'
9033 - else
9034 - # can't die, subshell
9035 - die "No readlink nor realpath found, cannot canonicalise"
9036 - fi
9037 -
9038 - local l
9039 - # First remove any symlinks in /usr/bin that may have been created
9040 - # by the old eselect
9041 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
9042 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
9043 - rm "${l}" || ewarn "Couldn't remove ${l}"
9044 - fi
9045 - done
9046 -
9047 - # Then move the symlinks created by the ebuild to their proper place.
9048 - for l in "${ED}"/usr/bin/*tmp ; do
9049 - mv "${l}" "${l%tmp}" \
9050 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
9051 - done
9052 -}
9053 -
9054 -pkg_postinst() {
9055 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
9056 - postgresql-config update
9057 -
9058 - elog "If you need a global psqlrc-file, you can place it in:"
9059 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
9060 -
9061 - if use server ; then
9062 - elog
9063 - elog "Gentoo specific documentation:"
9064 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
9065 - elog
9066 - elog "Official documentation:"
9067 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
9068 - elog
9069 - elog "The default location of the Unix-domain socket is:"
9070 - elog " ${EROOT}/run/postgresql/"
9071 - elog
9072 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
9073 - elog "so that it contains your preferred locale in:"
9074 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
9075 - elog
9076 - elog "Then, execute the following command to setup the initial database"
9077 - elog "environment:"
9078 - elog " emerge --config =${CATEGORY}/${PF}"
9079 - fi
9080 -}
9081 -
9082 -pkg_prerm() {
9083 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
9084 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
9085 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
9086 -
9087 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
9088 - sleep 10
9089 - eend 0
9090 - fi
9091 -}
9092 -
9093 -pkg_postrm() {
9094 - postgresql-config update
9095 -}
9096 -
9097 -pkg_config() {
9098 - use server || die "USE flag 'server' not enabled. Nothing to configure."
9099 -
9100 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
9101 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
9102 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
9103 - [[ -z "${DATA_DIR}" ]] \
9104 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
9105 -
9106 - # environment.bz2 may not contain the same locale as the current system
9107 - # locale. Unset and source from the current system locale.
9108 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
9109 - unset LANG
9110 - unset LC_CTYPE
9111 - unset LC_NUMERIC
9112 - unset LC_TIME
9113 - unset LC_COLLATE
9114 - unset LC_MONETARY
9115 - unset LC_MESSAGES
9116 - unset LC_ALL
9117 - source "${EROOT}/etc/env.d/02locale"
9118 - [ -n "${LANG}" ] && export LANG
9119 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
9120 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
9121 - [ -n "${LC_TIME}" ] && export LC_TIME
9122 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
9123 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
9124 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
9125 - [ -n "${LC_ALL}" ] && export LC_ALL
9126 - fi
9127 -
9128 - einfo "You can modify the paths and options passed to initdb by editing:"
9129 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
9130 - einfo
9131 - einfo "Information on options that can be passed to initdb are found at:"
9132 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
9133 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
9134 - einfo
9135 - einfo "PG_INITDB_OPTS is currently set to:"
9136 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
9137 - einfo " (none)"
9138 - else
9139 - einfo " ${PG_INITDB_OPTS}"
9140 - fi
9141 - einfo
9142 - einfo "Configuration files will be installed to:"
9143 - einfo " ${PGDATA}"
9144 - einfo
9145 - einfo "The database cluster will be created in:"
9146 - einfo " ${DATA_DIR}"
9147 - einfo
9148 -
9149 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
9150 - sleep 5
9151 - eend 0
9152 -
9153 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
9154 - eerror "The given directory, '${DATA_DIR}', is not empty."
9155 - eerror "Modify DATA_DIR to point to an empty directory."
9156 - die "${DATA_DIR} is not empty."
9157 - fi
9158 -
9159 - einfo "Creating the data directory ..."
9160 - if [[ ${EUID} == 0 ]] ; then
9161 - mkdir -p "${DATA_DIR}"
9162 - chown -Rf postgres:postgres "${DATA_DIR}"
9163 - chmod 0700 "${DATA_DIR}"
9164 - fi
9165 -
9166 - einfo "Initializing the database ..."
9167 -
9168 - if [[ ${EUID} == 0 ]] ; then
9169 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
9170 - else
9171 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
9172 - fi
9173 -
9174 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
9175 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
9176 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
9177 - fi
9178 -
9179 - # unix_socket_directory has no effect in postgresql.conf as it's
9180 - # overridden in the initscript
9181 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
9182 -
9183 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
9184 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
9185 - # On the off-chance that you might need to work with UTF-8 encoded
9186 - # characters in PL/Perl
9187 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
9188 - EOF
9189 -
9190 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
9191 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
9192 - einfo "by default. You can disable it in the cluster's:"
9193 - einfo " ${PGDATA%/}/postgresql.conf"
9194 - einfo
9195 - if ! use systemd; then
9196 - einfo "The PostgreSQL server, by default, will log events to:"
9197 - einfo " ${DATA_DIR%/}/postmaster.log"
9198 - einfo
9199 - fi
9200 - if use prefix ; then
9201 - einfo "The location of the configuration files have moved to:"
9202 - einfo " ${PGDATA}"
9203 - einfo "To start the server:"
9204 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
9205 - einfo "To stop:"
9206 - einfo " pg_ctl stop -D ${DATA_DIR}"
9207 - einfo
9208 - einfo "Or move the configuration files back:"
9209 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
9210 - elif use systemd; then
9211 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
9212 - einfo "instead of 'pg_ctl'."
9213 - else
9214 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
9215 - einfo "instead of 'pg_ctl'."
9216 - fi
9217 -}
9218 -
9219 -src_test() {
9220 - if use server && [[ ${UID} -ne 0 ]] ; then
9221 - emake check
9222 -
9223 - einfo "If you think other tests besides the regression tests are necessary, please"
9224 - einfo "submit a bug including a patch for this ebuild to enable them."
9225 - else
9226 - use server || \
9227 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
9228 - [[ ${UID} -eq 0 ]] || \
9229 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
9230 -
9231 - ewarn 'Skipping.'
9232 - fi
9233 -}
9234
9235 diff --git a/dev-db/postgresql/postgresql-9.6.13.ebuild b/dev-db/postgresql/postgresql-9.6.13.ebuild
9236 deleted file mode 100644
9237 index a47ab55a70b..00000000000
9238 --- a/dev-db/postgresql/postgresql-9.6.13.ebuild
9239 +++ /dev/null
9240 @@ -1,485 +0,0 @@
9241 -# Copyright 1999-2020 Gentoo Authors
9242 -# Distributed under the terms of the GNU General Public License v2
9243 -
9244 -EAPI="6"
9245 -
9246 -PYTHON_COMPAT=( python3_6 )
9247 -
9248 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
9249 - zh_TW"
9250 -
9251 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
9252 - systemd user versionator
9253 -
9254 -KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
9255 -
9256 -SLOT="$(get_version_component_range 1-2)"
9257 -
9258 -MY_PV=${PV/_/}
9259 -S="${WORKDIR}/${PN}-${MY_PV}"
9260 -
9261 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
9262 -
9263 -LICENSE="POSTGRESQL GPL-2"
9264 -DESCRIPTION="PostgreSQL RDBMS"
9265 -HOMEPAGE="https://www.postgresql.org/"
9266 -
9267 -IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp
9268 - python +readline selinux +server systemd ssl static-libs tcl threads uuid
9269 - xml zlib"
9270 -
9271 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
9272 -
9273 -CDEPEND="
9274 ->=app-eselect/eselect-postgresql-2.0
9275 -sys-apps/less
9276 -virtual/libintl
9277 -kerberos? ( virtual/krb5 )
9278 -ldap? ( net-nds/openldap )
9279 -pam? ( sys-libs/pam )
9280 -perl? ( >=dev-lang/perl-5.8:= )
9281 -python? ( ${PYTHON_DEPS} )
9282 -readline? ( sys-libs/readline:0= )
9283 -ssl? (
9284 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
9285 - libressl? ( dev-libs/libressl:= )
9286 -)
9287 -server? ( systemd? ( sys-apps/systemd ) )
9288 -tcl? ( >=dev-lang/tcl-8:0= )
9289 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
9290 -zlib? ( sys-libs/zlib )
9291 -"
9292 -
9293 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
9294 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
9295 -# the libc includes UUID functions.
9296 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
9297 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
9298 -
9299 -nest_usedep() {
9300 - local front back
9301 - while [[ ${#} -gt 1 ]]; do
9302 - front+="${1}? ( "
9303 - back+=" )"
9304 - shift
9305 - done
9306 - echo "${front}${1}${back}"
9307 -}
9308 -
9309 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
9310 -CDEPEND+="
9311 -uuid? (
9312 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
9313 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
9314 -)"
9315 -
9316 -DEPEND="${CDEPEND}
9317 -!!<sys-apps/sandbox-2.0
9318 -sys-devel/bison
9319 -sys-devel/flex
9320 -nls? ( sys-devel/gettext )
9321 -xml? ( virtual/pkgconfig )
9322 -"
9323 -
9324 -RDEPEND="${CDEPEND}
9325 -!dev-db/postgresql-docs:${SLOT}
9326 -!dev-db/postgresql-base:${SLOT}
9327 -!dev-db/postgresql-server:${SLOT}
9328 -selinux? ( sec-policy/selinux-postgresql )
9329 -"
9330 -
9331 -pkg_setup() {
9332 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
9333 -
9334 - enewgroup postgres 70
9335 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
9336 -
9337 - use python && python-single-r1_pkg_setup
9338 -}
9339 -
9340 -src_prepare() {
9341 - # Work around PPC{,64} compilation bug where bool is already defined
9342 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
9343 -
9344 - # Set proper run directory
9345 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
9346 - -i src/include/pg_config_manual.h || die
9347 -
9348 - # Rely on $PATH being in the proper order so that the correct
9349 - # install program is used for modules utilizing PGXS in both
9350 - # hardened and non-hardened environments. (Bug #528786)
9351 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
9352 -
9353 - use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch"
9354 -
9355 - if use pam ; then
9356 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
9357 - -i src/backend/libpq/auth.c || \
9358 - die 'PGSQL_PAM_SERVICE rename failed.'
9359 - fi
9360 -
9361 - eapply_user
9362 -}
9363 -
9364 -src_configure() {
9365 - case ${CHOST} in
9366 - *-darwin*|*-solaris*)
9367 - use nls && append-libs intl
9368 - ;;
9369 - esac
9370 -
9371 - export LDFLAGS_SL="${LDFLAGS}"
9372 - export LDFLAGS_EX="${LDFLAGS}"
9373 -
9374 - local PO="${EPREFIX}"
9375 -
9376 - local i uuid_config=""
9377 - if use uuid; then
9378 - for i in ${UTIL_LINUX_LIBC[@]}; do
9379 - use ${i} && uuid_config="--with-uuid=e2fs"
9380 - done
9381 - for i in ${BSD_LIBC[@]}; do
9382 - use ${i} && uuid_config="--with-uuid=bsd"
9383 - done
9384 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
9385 - fi
9386 -
9387 - econf \
9388 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
9389 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
9390 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
9391 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
9392 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
9393 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
9394 - $(use_enable !alpha spinlocks) \
9395 - $(use_enable !pg_legacytimestamp integer-datetimes) \
9396 - $(use_enable threads thread-safety) \
9397 - $(use_with kerberos gssapi) \
9398 - $(use_with ldap) \
9399 - $(use_with pam) \
9400 - $(use_with perl) \
9401 - $(use_with python) \
9402 - $(use_with readline) \
9403 - $(use_with ssl openssl) \
9404 - $(usex server "$(use_with systemd)" '--without-systemd') \
9405 - $(use_with tcl) \
9406 - ${uuid_config} \
9407 - $(use_with xml libxml) \
9408 - $(use_with xml libxslt) \
9409 - $(use_with zlib) \
9410 - $(use_enable nls nls "'$(l10n_get_locales)'")
9411 -}
9412 -
9413 -src_compile() {
9414 - emake
9415 - emake -C contrib
9416 -}
9417 -
9418 -src_install() {
9419 - emake DESTDIR="${D}" install
9420 - emake DESTDIR="${D}" install -C contrib
9421 -
9422 - dodoc README HISTORY doc/{TODO,bug.template}
9423 -
9424 - # man pages are already built, but if we have the target make them,
9425 - # they'll be generated from source before being installed so we
9426 - # manually install man pages.
9427 - # We use ${SLOT} instead of doman for postgresql.eselect
9428 - insinto /usr/share/postgresql-${SLOT}/man/
9429 - doins -r doc/src/sgml/man{1,3,7}
9430 - if ! use server; then
9431 - # Remove man pages for non-existent binaries
9432 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
9433 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
9434 - done
9435 - fi
9436 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
9437 -
9438 - # Create slot specific man pages
9439 - local bn f mansec slotted_name
9440 - for mansec in 1 3 7 ; do
9441 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
9442 -
9443 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
9444 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
9445 -
9446 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
9447 - bn=$(basename "${f}")
9448 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
9449 - case ${bn} in
9450 - TABLE.7|WITH.7)
9451 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
9452 - ;;
9453 - *)
9454 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
9455 - ;;
9456 - esac
9457 - done
9458 -
9459 - popd > /dev/null
9460 - done
9461 -
9462 - insinto /etc/postgresql-${SLOT}
9463 - newins src/bin/psql/psqlrc.sample psqlrc
9464 -
9465 - use static-libs || find "${ED}" -name '*.a' -delete
9466 -
9467 - local f bn
9468 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
9469 - -mindepth 1 -maxdepth 1)
9470 - do
9471 - bn=$(basename "${f}")
9472 - # Temporarily tack on tmp to workaround a file collision
9473 - # issue. This is only necessary for 9.7 and earlier. 10 never
9474 - # had this issue.
9475 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
9476 - "/usr/bin/${bn}${SLOT/.}tmp"
9477 - done
9478 -
9479 - if use doc ; then
9480 - docinto html
9481 - dodoc doc/src/sgml/html/*
9482 -
9483 - docinto sgml
9484 - dodoc doc/src/sgml/*.{sgml,dsl}
9485 - fi
9486 -
9487 - if use server; then
9488 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9489 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
9490 -
9491 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9492 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
9493 -
9494 - if use systemd; then
9495 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9496 - "${FILESDIR}/${PN}.service-9.6-r1" | \
9497 - systemd_newunit - ${PN}-${SLOT}.service
9498 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
9499 - fi
9500 -
9501 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
9502 -
9503 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
9504 -
9505 - if use prefix ; then
9506 - keepdir /run/postgresql
9507 - fperms 1775 /run/postgresql
9508 - fi
9509 - fi
9510 -}
9511 -
9512 -pkg_preinst() {
9513 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
9514 - # /usr/bin/psql96). They may have been created by the
9515 - # postgresql.eselect module, but they're handled within this ebuild
9516 - # now. It's alright if we momentarily delete /usr/bin/psql as it
9517 - # will be recreated by the eselect module in pkg_ppostinst(). This
9518 - # is only necessary for 9.7 and earlier. 10 and later were never
9519 - # handled in this manner.
9520 - local canonicalise
9521 - if type -p realpath > /dev/null; then
9522 - canonicalise=realpath
9523 - elif type -p readlink > /dev/null; then
9524 - canonicalise='readlink -f'
9525 - else
9526 - # can't die, subshell
9527 - die "No readlink nor realpath found, cannot canonicalise"
9528 - fi
9529 -
9530 - local l
9531 - # First remove any symlinks in /usr/bin that may have been created
9532 - # by the old eselect
9533 - for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
9534 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
9535 - rm "${l}" || ewarn "Couldn't remove ${l}"
9536 - fi
9537 - done
9538 -
9539 - # Then move the symlinks created by the ebuild to their proper place.
9540 - for l in "${ED}"/usr/bin/*tmp ; do
9541 - mv "${l}" "${l%tmp}" \
9542 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
9543 - done
9544 -}
9545 -
9546 -pkg_postinst() {
9547 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
9548 - postgresql-config update
9549 -
9550 - elog "If you need a global psqlrc-file, you can place it in:"
9551 - elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
9552 -
9553 - if use server ; then
9554 - elog
9555 - elog "Gentoo specific documentation:"
9556 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
9557 - elog
9558 - elog "Official documentation:"
9559 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
9560 - elog
9561 - elog "The default location of the Unix-domain socket is:"
9562 - elog " ${EROOT%/}/run/postgresql/"
9563 - elog
9564 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
9565 - elog "so that it contains your preferred locale in:"
9566 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
9567 - elog
9568 - elog "Then, execute the following command to setup the initial database"
9569 - elog "environment:"
9570 - elog " emerge --config =${CATEGORY}/${PF}"
9571 - fi
9572 -}
9573 -
9574 -pkg_prerm() {
9575 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
9576 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
9577 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
9578 -
9579 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
9580 - sleep 10
9581 - eend 0
9582 - fi
9583 -}
9584 -
9585 -pkg_postrm() {
9586 - postgresql-config update
9587 -}
9588 -
9589 -pkg_config() {
9590 - use server || die "USE flag 'server' not enabled. Nothing to configure."
9591 -
9592 - [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
9593 - && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
9594 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
9595 - [[ -z "${DATA_DIR}" ]] \
9596 - && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
9597 -
9598 - # environment.bz2 may not contain the same locale as the current system
9599 - # locale. Unset and source from the current system locale.
9600 - if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
9601 - unset LANG
9602 - unset LC_CTYPE
9603 - unset LC_NUMERIC
9604 - unset LC_TIME
9605 - unset LC_COLLATE
9606 - unset LC_MONETARY
9607 - unset LC_MESSAGES
9608 - unset LC_ALL
9609 - source "${EROOT%/}/etc/env.d/02locale"
9610 - [ -n "${LANG}" ] && export LANG
9611 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
9612 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
9613 - [ -n "${LC_TIME}" ] && export LC_TIME
9614 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
9615 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
9616 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
9617 - [ -n "${LC_ALL}" ] && export LC_ALL
9618 - fi
9619 -
9620 - einfo "You can modify the paths and options passed to initdb by editing:"
9621 - einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
9622 - einfo
9623 - einfo "Information on options that can be passed to initdb are found at:"
9624 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
9625 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
9626 - einfo
9627 - einfo "PG_INITDB_OPTS is currently set to:"
9628 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
9629 - einfo " (none)"
9630 - else
9631 - einfo " ${PG_INITDB_OPTS}"
9632 - fi
9633 - einfo
9634 - einfo "Configuration files will be installed to:"
9635 - einfo " ${PGDATA}"
9636 - einfo
9637 - einfo "The database cluster will be created in:"
9638 - einfo " ${DATA_DIR}"
9639 - einfo
9640 -
9641 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
9642 - sleep 5
9643 - eend 0
9644 -
9645 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
9646 - eerror "The given directory, '${DATA_DIR}', is not empty."
9647 - eerror "Modify DATA_DIR to point to an empty directory."
9648 - die "${DATA_DIR} is not empty."
9649 - fi
9650 -
9651 - einfo "Creating the data directory ..."
9652 - if [[ ${EUID} == 0 ]] ; then
9653 - mkdir -p "${DATA_DIR}"
9654 - chown -Rf postgres:postgres "${DATA_DIR}"
9655 - chmod 0700 "${DATA_DIR}"
9656 - fi
9657 -
9658 - einfo "Initializing the database ..."
9659 -
9660 - if [[ ${EUID} == 0 ]] ; then
9661 - su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
9662 - else
9663 - "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
9664 - fi
9665 -
9666 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
9667 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
9668 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
9669 - fi
9670 -
9671 - # unix_socket_directory has no effect in postgresql.conf as it's
9672 - # overridden in the initscript
9673 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
9674 -
9675 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
9676 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
9677 - # On the off-chance that you might need to work with UTF-8 encoded
9678 - # characters in PL/Perl
9679 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
9680 - EOF
9681 -
9682 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
9683 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
9684 - einfo "by default. You can disable it in the cluster's:"
9685 - einfo " ${PGDATA%/}/postgresql.conf"
9686 - einfo
9687 - if ! use systemd; then
9688 - einfo "The PostgreSQL server, by default, will log events to:"
9689 - einfo " ${DATA_DIR%/}/postmaster.log"
9690 - einfo
9691 - fi
9692 - if use prefix ; then
9693 - einfo "The location of the configuration files have moved to:"
9694 - einfo " ${PGDATA}"
9695 - einfo "To start the server:"
9696 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
9697 - einfo "To stop:"
9698 - einfo " pg_ctl stop -D ${DATA_DIR}"
9699 - einfo
9700 - einfo "Or move the configuration files back:"
9701 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
9702 - elif use systemd; then
9703 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
9704 - einfo "instead of 'pg_ctl'."
9705 - else
9706 - einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
9707 - einfo "instead of 'pg_ctl'."
9708 - fi
9709 -}
9710 -
9711 -src_test() {
9712 - if use server && [[ ${UID} -ne 0 ]] ; then
9713 - emake check
9714 -
9715 - einfo "If you think other tests besides the regression tests are necessary, please"
9716 - einfo "submit a bug including a patch for this ebuild to enable them."
9717 - else
9718 - use server || \
9719 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
9720 - [[ ${UID} -eq 0 ]] || \
9721 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
9722 -
9723 - ewarn 'Skipping.'
9724 - fi
9725 -}
9726
9727 diff --git a/dev-db/postgresql/postgresql-9.6.14.ebuild b/dev-db/postgresql/postgresql-9.6.14.ebuild
9728 deleted file mode 100644
9729 index 6d2db473000..00000000000
9730 --- a/dev-db/postgresql/postgresql-9.6.14.ebuild
9731 +++ /dev/null
9732 @@ -1,490 +0,0 @@
9733 -# Copyright 1999-2020 Gentoo Authors
9734 -# Distributed under the terms of the GNU General Public License v2
9735 -
9736 -EAPI=7
9737 -
9738 -PYTHON_COMPAT=( python3_{6,7} )
9739 -
9740 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
9741 - zh_TW"
9742 -
9743 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
9744 - systemd user
9745 -
9746 -KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
9747 -
9748 -SLOT=$(ver_cut 1-2)
9749 -
9750 -MY_PV=${PV/_/}
9751 -S="${WORKDIR}/${PN}-${MY_PV}"
9752 -
9753 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
9754 -
9755 -LICENSE="POSTGRESQL GPL-2"
9756 -DESCRIPTION="PostgreSQL RDBMS"
9757 -HOMEPAGE="https://www.postgresql.org/"
9758 -
9759 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
9760 - -pg_legacytimestamp python +readline selinux +server systemd ssl
9761 - static-libs tcl threads uuid xml zlib"
9762 -
9763 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
9764 -
9765 -CDEPEND="
9766 ->=app-eselect/eselect-postgresql-2.0
9767 -sys-apps/less
9768 -virtual/libintl
9769 -kerberos? ( virtual/krb5 )
9770 -ldap? ( net-nds/openldap )
9771 -pam? ( sys-libs/pam )
9772 -perl? ( >=dev-lang/perl-5.8:= )
9773 -python? ( ${PYTHON_DEPS} )
9774 -readline? ( sys-libs/readline:0= )
9775 -ssl? (
9776 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
9777 - libressl? ( dev-libs/libressl:= )
9778 -)
9779 -server? ( systemd? ( sys-apps/systemd ) )
9780 -tcl? ( >=dev-lang/tcl-8:0= )
9781 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
9782 -zlib? ( sys-libs/zlib )
9783 -"
9784 -
9785 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
9786 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
9787 -# the libc includes UUID functions.
9788 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
9789 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
9790 -
9791 -nest_usedep() {
9792 - local front back
9793 - while [[ ${#} -gt 1 ]]; do
9794 - front+="${1}? ( "
9795 - back+=" )"
9796 - shift
9797 - done
9798 - echo "${front}${1}${back}"
9799 -}
9800 -
9801 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
9802 -CDEPEND+="
9803 -uuid? (
9804 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
9805 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
9806 -)"
9807 -
9808 -DEPEND="${CDEPEND}
9809 -!!<sys-apps/sandbox-2.0
9810 -sys-devel/bison
9811 -sys-devel/flex
9812 -nls? ( sys-devel/gettext )
9813 -xml? ( virtual/pkgconfig )
9814 -"
9815 -
9816 -RDEPEND="${CDEPEND}
9817 -!dev-db/postgresql-docs:${SLOT}
9818 -!dev-db/postgresql-base:${SLOT}
9819 -!dev-db/postgresql-server:${SLOT}
9820 -selinux? ( sec-policy/selinux-postgresql )
9821 -"
9822 -
9823 -pkg_setup() {
9824 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
9825 -
9826 - enewgroup postgres 70
9827 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
9828 -
9829 - use python && python-single-r1_pkg_setup
9830 -}
9831 -
9832 -src_prepare() {
9833 - # Work around PPC{,64} compilation bug where bool is already defined
9834 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
9835 -
9836 - # Set proper run directory
9837 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
9838 - -i src/include/pg_config_manual.h || die
9839 -
9840 - # Rely on $PATH being in the proper order so that the correct
9841 - # install program is used for modules utilizing PGXS in both
9842 - # hardened and non-hardened environments. (Bug #528786)
9843 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
9844 -
9845 - use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch"
9846 -
9847 - if use pam ; then
9848 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
9849 - -i src/backend/libpq/auth.c || \
9850 - die 'PGSQL_PAM_SERVICE rename failed.'
9851 - fi
9852 -
9853 - eapply_user
9854 -}
9855 -
9856 -src_configure() {
9857 - case ${CHOST} in
9858 - *-darwin*|*-solaris*)
9859 - use nls && append-libs intl
9860 - ;;
9861 - esac
9862 -
9863 - export LDFLAGS_SL="${LDFLAGS}"
9864 - export LDFLAGS_EX="${LDFLAGS}"
9865 -
9866 - local PO="${EPREFIX}"
9867 -
9868 - local i uuid_config=""
9869 - if use uuid; then
9870 - for i in ${UTIL_LINUX_LIBC[@]}; do
9871 - use ${i} && uuid_config="--with-uuid=e2fs"
9872 - done
9873 - for i in ${BSD_LIBC[@]}; do
9874 - use ${i} && uuid_config="--with-uuid=bsd"
9875 - done
9876 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
9877 - fi
9878 -
9879 - econf \
9880 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
9881 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
9882 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
9883 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
9884 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
9885 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
9886 - $(use_enable !alpha spinlocks) \
9887 - $(use_enable !pg_legacytimestamp integer-datetimes) \
9888 - $(use_enable debug) \
9889 - $(use_enable threads thread-safety) \
9890 - $(use_with kerberos gssapi) \
9891 - $(use_with ldap) \
9892 - $(use_with pam) \
9893 - $(use_with perl) \
9894 - $(use_with python) \
9895 - $(use_with readline) \
9896 - $(use_with ssl openssl) \
9897 - $(usex server "$(use_with systemd)" '--without-systemd') \
9898 - $(use_with tcl) \
9899 - ${uuid_config} \
9900 - $(use_with xml libxml) \
9901 - $(use_with xml libxslt) \
9902 - $(use_with zlib) \
9903 - $(use_enable nls nls "'$(l10n_get_locales)'")
9904 -}
9905 -
9906 -src_compile() {
9907 - emake
9908 - emake -C contrib
9909 -}
9910 -
9911 -src_install() {
9912 - emake DESTDIR="${D}" install
9913 - emake DESTDIR="${D}" install -C contrib
9914 -
9915 - dodoc README HISTORY doc/{TODO,bug.template}
9916 -
9917 - # man pages are already built, but if we have the target make them,
9918 - # they'll be generated from source before being installed so we
9919 - # manually install man pages.
9920 - # We use ${SLOT} instead of doman for postgresql.eselect
9921 - insinto /usr/share/postgresql-${SLOT}/man/
9922 - doins -r doc/src/sgml/man{1,3,7}
9923 - if ! use server; then
9924 - # Remove man pages for non-existent binaries
9925 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
9926 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
9927 - done
9928 - fi
9929 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
9930 -
9931 - # Create slot specific man pages
9932 - local bn f mansec slotted_name
9933 - for mansec in 1 3 7 ; do
9934 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
9935 -
9936 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
9937 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
9938 -
9939 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
9940 - bn=$(basename "${f}")
9941 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
9942 - case ${bn} in
9943 - TABLE.7|WITH.7)
9944 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
9945 - ;;
9946 - *)
9947 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
9948 - ;;
9949 - esac
9950 - done
9951 -
9952 - popd > /dev/null
9953 - done
9954 -
9955 - insinto /etc/postgresql-${SLOT}
9956 - newins src/bin/psql/psqlrc.sample psqlrc
9957 -
9958 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
9959 - # needed by extensions utilizing PGXS.
9960 - use static-libs || \
9961 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
9962 - -delete
9963 -
9964 - local f bn
9965 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
9966 - -mindepth 1 -maxdepth 1)
9967 - do
9968 - bn=$(basename "${f}")
9969 - # Temporarily tack on tmp to workaround a file collision
9970 - # issue. This is only necessary for 9.7 and earlier. 10 never
9971 - # had this issue.
9972 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
9973 - "/usr/bin/${bn}${SLOT/.}tmp"
9974 - done
9975 -
9976 - if use doc ; then
9977 - docinto html
9978 - dodoc doc/src/sgml/html/*
9979 -
9980 - docinto sgml
9981 - dodoc doc/src/sgml/*.{sgml,dsl}
9982 - fi
9983 -
9984 - if use server; then
9985 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9986 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
9987 -
9988 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9989 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
9990 -
9991 - if use systemd; then
9992 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
9993 - "${FILESDIR}/${PN}.service-9.6-r1" | \
9994 - systemd_newunit - ${PN}-${SLOT}.service
9995 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
9996 - fi
9997 -
9998 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
9999 -
10000 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
10001 -
10002 - if use prefix ; then
10003 - keepdir /run/postgresql
10004 - fperms 1775 /run/postgresql
10005 - fi
10006 - fi
10007 -}
10008 -
10009 -pkg_preinst() {
10010 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
10011 - # /usr/bin/psql96). They may have been created by the
10012 - # postgresql.eselect module, but they're handled within this ebuild
10013 - # now. It's alright if we momentarily delete /usr/bin/psql as it
10014 - # will be recreated by the eselect module in pkg_ppostinst(). This
10015 - # is only necessary for 9.7 and earlier. 10 and later were never
10016 - # handled in this manner.
10017 - local canonicalise
10018 - if type -p realpath > /dev/null; then
10019 - canonicalise=realpath
10020 - elif type -p readlink > /dev/null; then
10021 - canonicalise='readlink -f'
10022 - else
10023 - # can't die, subshell
10024 - die "No readlink nor realpath found, cannot canonicalise"
10025 - fi
10026 -
10027 - local l
10028 - # First remove any symlinks in /usr/bin that may have been created
10029 - # by the old eselect
10030 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
10031 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
10032 - rm "${l}" || ewarn "Couldn't remove ${l}"
10033 - fi
10034 - done
10035 -
10036 - # Then move the symlinks created by the ebuild to their proper place.
10037 - for l in "${ED}"/usr/bin/*tmp ; do
10038 - mv "${l}" "${l%tmp}" \
10039 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
10040 - done
10041 -}
10042 -
10043 -pkg_postinst() {
10044 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
10045 - postgresql-config update
10046 -
10047 - elog "If you need a global psqlrc-file, you can place it in:"
10048 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
10049 -
10050 - if use server ; then
10051 - elog
10052 - elog "Gentoo specific documentation:"
10053 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
10054 - elog
10055 - elog "Official documentation:"
10056 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
10057 - elog
10058 - elog "The default location of the Unix-domain socket is:"
10059 - elog " ${EROOT}/run/postgresql/"
10060 - elog
10061 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
10062 - elog "so that it contains your preferred locale in:"
10063 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
10064 - elog
10065 - elog "Then, execute the following command to setup the initial database"
10066 - elog "environment:"
10067 - elog " emerge --config =${CATEGORY}/${PF}"
10068 - fi
10069 -}
10070 -
10071 -pkg_prerm() {
10072 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
10073 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
10074 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
10075 -
10076 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
10077 - sleep 10
10078 - eend 0
10079 - fi
10080 -}
10081 -
10082 -pkg_postrm() {
10083 - postgresql-config update
10084 -}
10085 -
10086 -pkg_config() {
10087 - use server || die "USE flag 'server' not enabled. Nothing to configure."
10088 -
10089 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
10090 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
10091 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
10092 - [[ -z "${DATA_DIR}" ]] \
10093 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
10094 -
10095 - # environment.bz2 may not contain the same locale as the current system
10096 - # locale. Unset and source from the current system locale.
10097 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
10098 - unset LANG
10099 - unset LC_CTYPE
10100 - unset LC_NUMERIC
10101 - unset LC_TIME
10102 - unset LC_COLLATE
10103 - unset LC_MONETARY
10104 - unset LC_MESSAGES
10105 - unset LC_ALL
10106 - source "${EROOT}/etc/env.d/02locale"
10107 - [ -n "${LANG}" ] && export LANG
10108 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
10109 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
10110 - [ -n "${LC_TIME}" ] && export LC_TIME
10111 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
10112 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
10113 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
10114 - [ -n "${LC_ALL}" ] && export LC_ALL
10115 - fi
10116 -
10117 - einfo "You can modify the paths and options passed to initdb by editing:"
10118 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
10119 - einfo
10120 - einfo "Information on options that can be passed to initdb are found at:"
10121 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
10122 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
10123 - einfo
10124 - einfo "PG_INITDB_OPTS is currently set to:"
10125 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
10126 - einfo " (none)"
10127 - else
10128 - einfo " ${PG_INITDB_OPTS}"
10129 - fi
10130 - einfo
10131 - einfo "Configuration files will be installed to:"
10132 - einfo " ${PGDATA}"
10133 - einfo
10134 - einfo "The database cluster will be created in:"
10135 - einfo " ${DATA_DIR}"
10136 - einfo
10137 -
10138 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
10139 - sleep 5
10140 - eend 0
10141 -
10142 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
10143 - eerror "The given directory, '${DATA_DIR}', is not empty."
10144 - eerror "Modify DATA_DIR to point to an empty directory."
10145 - die "${DATA_DIR} is not empty."
10146 - fi
10147 -
10148 - einfo "Creating the data directory ..."
10149 - if [[ ${EUID} == 0 ]] ; then
10150 - mkdir -p "${DATA_DIR}"
10151 - chown -Rf postgres:postgres "${DATA_DIR}"
10152 - chmod 0700 "${DATA_DIR}"
10153 - fi
10154 -
10155 - einfo "Initializing the database ..."
10156 -
10157 - if [[ ${EUID} == 0 ]] ; then
10158 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
10159 - else
10160 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
10161 - fi
10162 -
10163 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
10164 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
10165 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
10166 - fi
10167 -
10168 - # unix_socket_directory has no effect in postgresql.conf as it's
10169 - # overridden in the initscript
10170 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
10171 -
10172 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
10173 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
10174 - # On the off-chance that you might need to work with UTF-8 encoded
10175 - # characters in PL/Perl
10176 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
10177 - EOF
10178 -
10179 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
10180 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
10181 - einfo "by default. You can disable it in the cluster's:"
10182 - einfo " ${PGDATA%/}/postgresql.conf"
10183 - einfo
10184 - if ! use systemd; then
10185 - einfo "The PostgreSQL server, by default, will log events to:"
10186 - einfo " ${DATA_DIR%/}/postmaster.log"
10187 - einfo
10188 - fi
10189 - if use prefix ; then
10190 - einfo "The location of the configuration files have moved to:"
10191 - einfo " ${PGDATA}"
10192 - einfo "To start the server:"
10193 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
10194 - einfo "To stop:"
10195 - einfo " pg_ctl stop -D ${DATA_DIR}"
10196 - einfo
10197 - einfo "Or move the configuration files back:"
10198 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
10199 - elif use systemd; then
10200 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
10201 - einfo "instead of 'pg_ctl'."
10202 - else
10203 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
10204 - einfo "instead of 'pg_ctl'."
10205 - fi
10206 -}
10207 -
10208 -src_test() {
10209 - if use server && [[ ${UID} -ne 0 ]] ; then
10210 - emake check
10211 -
10212 - einfo "If you think other tests besides the regression tests are necessary, please"
10213 - einfo "submit a bug including a patch for this ebuild to enable them."
10214 - else
10215 - use server || \
10216 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
10217 - [[ ${UID} -eq 0 ]] || \
10218 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
10219 -
10220 - ewarn 'Skipping.'
10221 - fi
10222 -}
10223
10224 diff --git a/dev-db/postgresql/postgresql-9.6.15.ebuild b/dev-db/postgresql/postgresql-9.6.15.ebuild
10225 deleted file mode 100644
10226 index 800e0b2727e..00000000000
10227 --- a/dev-db/postgresql/postgresql-9.6.15.ebuild
10228 +++ /dev/null
10229 @@ -1,490 +0,0 @@
10230 -# Copyright 1999-2020 Gentoo Authors
10231 -# Distributed under the terms of the GNU General Public License v2
10232 -
10233 -EAPI=7
10234 -
10235 -PYTHON_COMPAT=( python3_{6,7} )
10236 -
10237 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
10238 - zh_TW"
10239 -
10240 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
10241 - systemd user
10242 -
10243 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
10244 -
10245 -SLOT=$(ver_cut 1-2)
10246 -
10247 -MY_PV=${PV/_/}
10248 -S="${WORKDIR}/${PN}-${MY_PV}"
10249 -
10250 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
10251 -
10252 -LICENSE="POSTGRESQL GPL-2"
10253 -DESCRIPTION="PostgreSQL RDBMS"
10254 -HOMEPAGE="https://www.postgresql.org/"
10255 -
10256 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
10257 - -pg_legacytimestamp python +readline selinux +server systemd ssl
10258 - static-libs tcl threads uuid xml zlib"
10259 -
10260 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
10261 -
10262 -CDEPEND="
10263 ->=app-eselect/eselect-postgresql-2.0
10264 -sys-apps/less
10265 -virtual/libintl
10266 -kerberos? ( virtual/krb5 )
10267 -ldap? ( net-nds/openldap )
10268 -pam? ( sys-libs/pam )
10269 -perl? ( >=dev-lang/perl-5.8:= )
10270 -python? ( ${PYTHON_DEPS} )
10271 -readline? ( sys-libs/readline:0= )
10272 -ssl? (
10273 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
10274 - libressl? ( dev-libs/libressl:= )
10275 -)
10276 -server? ( systemd? ( sys-apps/systemd ) )
10277 -tcl? ( >=dev-lang/tcl-8:0= )
10278 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
10279 -zlib? ( sys-libs/zlib )
10280 -"
10281 -
10282 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
10283 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
10284 -# the libc includes UUID functions.
10285 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
10286 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
10287 -
10288 -nest_usedep() {
10289 - local front back
10290 - while [[ ${#} -gt 1 ]]; do
10291 - front+="${1}? ( "
10292 - back+=" )"
10293 - shift
10294 - done
10295 - echo "${front}${1}${back}"
10296 -}
10297 -
10298 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
10299 -CDEPEND+="
10300 -uuid? (
10301 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
10302 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
10303 -)"
10304 -
10305 -DEPEND="${CDEPEND}
10306 -!!<sys-apps/sandbox-2.0
10307 -sys-devel/bison
10308 -sys-devel/flex
10309 -nls? ( sys-devel/gettext )
10310 -xml? ( virtual/pkgconfig )
10311 -"
10312 -
10313 -RDEPEND="${CDEPEND}
10314 -!dev-db/postgresql-docs:${SLOT}
10315 -!dev-db/postgresql-base:${SLOT}
10316 -!dev-db/postgresql-server:${SLOT}
10317 -selinux? ( sec-policy/selinux-postgresql )
10318 -"
10319 -
10320 -pkg_setup() {
10321 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
10322 -
10323 - enewgroup postgres 70
10324 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
10325 -
10326 - use python && python-single-r1_pkg_setup
10327 -}
10328 -
10329 -src_prepare() {
10330 - # Work around PPC{,64} compilation bug where bool is already defined
10331 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
10332 -
10333 - # Set proper run directory
10334 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
10335 - -i src/include/pg_config_manual.h || die
10336 -
10337 - # Rely on $PATH being in the proper order so that the correct
10338 - # install program is used for modules utilizing PGXS in both
10339 - # hardened and non-hardened environments. (Bug #528786)
10340 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
10341 -
10342 - use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch"
10343 -
10344 - if use pam ; then
10345 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
10346 - -i src/backend/libpq/auth.c || \
10347 - die 'PGSQL_PAM_SERVICE rename failed.'
10348 - fi
10349 -
10350 - eapply_user
10351 -}
10352 -
10353 -src_configure() {
10354 - case ${CHOST} in
10355 - *-darwin*|*-solaris*)
10356 - use nls && append-libs intl
10357 - ;;
10358 - esac
10359 -
10360 - export LDFLAGS_SL="${LDFLAGS}"
10361 - export LDFLAGS_EX="${LDFLAGS}"
10362 -
10363 - local PO="${EPREFIX}"
10364 -
10365 - local i uuid_config=""
10366 - if use uuid; then
10367 - for i in ${UTIL_LINUX_LIBC[@]}; do
10368 - use ${i} && uuid_config="--with-uuid=e2fs"
10369 - done
10370 - for i in ${BSD_LIBC[@]}; do
10371 - use ${i} && uuid_config="--with-uuid=bsd"
10372 - done
10373 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
10374 - fi
10375 -
10376 - econf \
10377 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
10378 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
10379 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
10380 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
10381 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
10382 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
10383 - $(use_enable !alpha spinlocks) \
10384 - $(use_enable !pg_legacytimestamp integer-datetimes) \
10385 - $(use_enable debug) \
10386 - $(use_enable threads thread-safety) \
10387 - $(use_with kerberos gssapi) \
10388 - $(use_with ldap) \
10389 - $(use_with pam) \
10390 - $(use_with perl) \
10391 - $(use_with python) \
10392 - $(use_with readline) \
10393 - $(use_with ssl openssl) \
10394 - $(usex server "$(use_with systemd)" '--without-systemd') \
10395 - $(use_with tcl) \
10396 - ${uuid_config} \
10397 - $(use_with xml libxml) \
10398 - $(use_with xml libxslt) \
10399 - $(use_with zlib) \
10400 - $(use_enable nls nls "'$(l10n_get_locales)'")
10401 -}
10402 -
10403 -src_compile() {
10404 - emake
10405 - emake -C contrib
10406 -}
10407 -
10408 -src_install() {
10409 - emake DESTDIR="${D}" install
10410 - emake DESTDIR="${D}" install -C contrib
10411 -
10412 - dodoc README HISTORY doc/{TODO,bug.template}
10413 -
10414 - # man pages are already built, but if we have the target make them,
10415 - # they'll be generated from source before being installed so we
10416 - # manually install man pages.
10417 - # We use ${SLOT} instead of doman for postgresql.eselect
10418 - insinto /usr/share/postgresql-${SLOT}/man/
10419 - doins -r doc/src/sgml/man{1,3,7}
10420 - if ! use server; then
10421 - # Remove man pages for non-existent binaries
10422 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
10423 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
10424 - done
10425 - fi
10426 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
10427 -
10428 - # Create slot specific man pages
10429 - local bn f mansec slotted_name
10430 - for mansec in 1 3 7 ; do
10431 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
10432 -
10433 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
10434 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
10435 -
10436 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
10437 - bn=$(basename "${f}")
10438 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
10439 - case ${bn} in
10440 - TABLE.7|WITH.7)
10441 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
10442 - ;;
10443 - *)
10444 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
10445 - ;;
10446 - esac
10447 - done
10448 -
10449 - popd > /dev/null
10450 - done
10451 -
10452 - insinto /etc/postgresql-${SLOT}
10453 - newins src/bin/psql/psqlrc.sample psqlrc
10454 -
10455 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
10456 - # needed by extensions utilizing PGXS.
10457 - use static-libs || \
10458 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
10459 - -delete
10460 -
10461 - local f bn
10462 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
10463 - -mindepth 1 -maxdepth 1)
10464 - do
10465 - bn=$(basename "${f}")
10466 - # Temporarily tack on tmp to workaround a file collision
10467 - # issue. This is only necessary for 9.7 and earlier. 10 never
10468 - # had this issue.
10469 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
10470 - "/usr/bin/${bn}${SLOT/.}tmp"
10471 - done
10472 -
10473 - if use doc ; then
10474 - docinto html
10475 - dodoc doc/src/sgml/html/*
10476 -
10477 - docinto sgml
10478 - dodoc doc/src/sgml/*.{sgml,dsl}
10479 - fi
10480 -
10481 - if use server; then
10482 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
10483 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
10484 -
10485 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
10486 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
10487 -
10488 - if use systemd; then
10489 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
10490 - "${FILESDIR}/${PN}.service-9.6-r1" | \
10491 - systemd_newunit - ${PN}-${SLOT}.service
10492 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
10493 - fi
10494 -
10495 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
10496 -
10497 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
10498 -
10499 - if use prefix ; then
10500 - keepdir /run/postgresql
10501 - fperms 1775 /run/postgresql
10502 - fi
10503 - fi
10504 -}
10505 -
10506 -pkg_preinst() {
10507 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
10508 - # /usr/bin/psql96). They may have been created by the
10509 - # postgresql.eselect module, but they're handled within this ebuild
10510 - # now. It's alright if we momentarily delete /usr/bin/psql as it
10511 - # will be recreated by the eselect module in pkg_ppostinst(). This
10512 - # is only necessary for 9.7 and earlier. 10 and later were never
10513 - # handled in this manner.
10514 - local canonicalise
10515 - if type -p realpath > /dev/null; then
10516 - canonicalise=realpath
10517 - elif type -p readlink > /dev/null; then
10518 - canonicalise='readlink -f'
10519 - else
10520 - # can't die, subshell
10521 - die "No readlink nor realpath found, cannot canonicalise"
10522 - fi
10523 -
10524 - local l
10525 - # First remove any symlinks in /usr/bin that may have been created
10526 - # by the old eselect
10527 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
10528 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
10529 - rm "${l}" || ewarn "Couldn't remove ${l}"
10530 - fi
10531 - done
10532 -
10533 - # Then move the symlinks created by the ebuild to their proper place.
10534 - for l in "${ED}"/usr/bin/*tmp ; do
10535 - mv "${l}" "${l%tmp}" \
10536 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
10537 - done
10538 -}
10539 -
10540 -pkg_postinst() {
10541 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
10542 - postgresql-config update
10543 -
10544 - elog "If you need a global psqlrc-file, you can place it in:"
10545 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
10546 -
10547 - if use server ; then
10548 - elog
10549 - elog "Gentoo specific documentation:"
10550 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
10551 - elog
10552 - elog "Official documentation:"
10553 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
10554 - elog
10555 - elog "The default location of the Unix-domain socket is:"
10556 - elog " ${EROOT}/run/postgresql/"
10557 - elog
10558 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
10559 - elog "so that it contains your preferred locale in:"
10560 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
10561 - elog
10562 - elog "Then, execute the following command to setup the initial database"
10563 - elog "environment:"
10564 - elog " emerge --config =${CATEGORY}/${PF}"
10565 - fi
10566 -}
10567 -
10568 -pkg_prerm() {
10569 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
10570 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
10571 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
10572 -
10573 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
10574 - sleep 10
10575 - eend 0
10576 - fi
10577 -}
10578 -
10579 -pkg_postrm() {
10580 - postgresql-config update
10581 -}
10582 -
10583 -pkg_config() {
10584 - use server || die "USE flag 'server' not enabled. Nothing to configure."
10585 -
10586 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
10587 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
10588 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
10589 - [[ -z "${DATA_DIR}" ]] \
10590 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
10591 -
10592 - # environment.bz2 may not contain the same locale as the current system
10593 - # locale. Unset and source from the current system locale.
10594 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
10595 - unset LANG
10596 - unset LC_CTYPE
10597 - unset LC_NUMERIC
10598 - unset LC_TIME
10599 - unset LC_COLLATE
10600 - unset LC_MONETARY
10601 - unset LC_MESSAGES
10602 - unset LC_ALL
10603 - source "${EROOT}/etc/env.d/02locale"
10604 - [ -n "${LANG}" ] && export LANG
10605 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
10606 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
10607 - [ -n "${LC_TIME}" ] && export LC_TIME
10608 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
10609 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
10610 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
10611 - [ -n "${LC_ALL}" ] && export LC_ALL
10612 - fi
10613 -
10614 - einfo "You can modify the paths and options passed to initdb by editing:"
10615 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
10616 - einfo
10617 - einfo "Information on options that can be passed to initdb are found at:"
10618 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
10619 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
10620 - einfo
10621 - einfo "PG_INITDB_OPTS is currently set to:"
10622 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
10623 - einfo " (none)"
10624 - else
10625 - einfo " ${PG_INITDB_OPTS}"
10626 - fi
10627 - einfo
10628 - einfo "Configuration files will be installed to:"
10629 - einfo " ${PGDATA}"
10630 - einfo
10631 - einfo "The database cluster will be created in:"
10632 - einfo " ${DATA_DIR}"
10633 - einfo
10634 -
10635 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
10636 - sleep 5
10637 - eend 0
10638 -
10639 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
10640 - eerror "The given directory, '${DATA_DIR}', is not empty."
10641 - eerror "Modify DATA_DIR to point to an empty directory."
10642 - die "${DATA_DIR} is not empty."
10643 - fi
10644 -
10645 - einfo "Creating the data directory ..."
10646 - if [[ ${EUID} == 0 ]] ; then
10647 - mkdir -p "${DATA_DIR}"
10648 - chown -Rf postgres:postgres "${DATA_DIR}"
10649 - chmod 0700 "${DATA_DIR}"
10650 - fi
10651 -
10652 - einfo "Initializing the database ..."
10653 -
10654 - if [[ ${EUID} == 0 ]] ; then
10655 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
10656 - else
10657 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
10658 - fi
10659 -
10660 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
10661 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
10662 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
10663 - fi
10664 -
10665 - # unix_socket_directory has no effect in postgresql.conf as it's
10666 - # overridden in the initscript
10667 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
10668 -
10669 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
10670 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
10671 - # On the off-chance that you might need to work with UTF-8 encoded
10672 - # characters in PL/Perl
10673 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
10674 - EOF
10675 -
10676 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
10677 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
10678 - einfo "by default. You can disable it in the cluster's:"
10679 - einfo " ${PGDATA%/}/postgresql.conf"
10680 - einfo
10681 - if ! use systemd; then
10682 - einfo "The PostgreSQL server, by default, will log events to:"
10683 - einfo " ${DATA_DIR%/}/postmaster.log"
10684 - einfo
10685 - fi
10686 - if use prefix ; then
10687 - einfo "The location of the configuration files have moved to:"
10688 - einfo " ${PGDATA}"
10689 - einfo "To start the server:"
10690 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
10691 - einfo "To stop:"
10692 - einfo " pg_ctl stop -D ${DATA_DIR}"
10693 - einfo
10694 - einfo "Or move the configuration files back:"
10695 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
10696 - elif use systemd; then
10697 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
10698 - einfo "instead of 'pg_ctl'."
10699 - else
10700 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
10701 - einfo "instead of 'pg_ctl'."
10702 - fi
10703 -}
10704 -
10705 -src_test() {
10706 - if use server && [[ ${UID} -ne 0 ]] ; then
10707 - emake check
10708 -
10709 - einfo "If you think other tests besides the regression tests are necessary, please"
10710 - einfo "submit a bug including a patch for this ebuild to enable them."
10711 - else
10712 - use server || \
10713 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
10714 - [[ ${UID} -eq 0 ]] || \
10715 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
10716 -
10717 - ewarn 'Skipping.'
10718 - fi
10719 -}
10720
10721 diff --git a/dev-db/postgresql/postgresql-9.6.16.ebuild b/dev-db/postgresql/postgresql-9.6.16.ebuild
10722 deleted file mode 100644
10723 index db31e5a8233..00000000000
10724 --- a/dev-db/postgresql/postgresql-9.6.16.ebuild
10725 +++ /dev/null
10726 @@ -1,490 +0,0 @@
10727 -# Copyright 1999-2020 Gentoo Authors
10728 -# Distributed under the terms of the GNU General Public License v2
10729 -
10730 -EAPI=7
10731 -
10732 -PYTHON_COMPAT=( python3_{6,7} )
10733 -
10734 -PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
10735 - zh_TW"
10736 -
10737 -inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
10738 - systemd user
10739 -
10740 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
10741 -
10742 -SLOT=$(ver_cut 1-2)
10743 -
10744 -MY_PV=${PV/_/}
10745 -S="${WORKDIR}/${PN}-${MY_PV}"
10746 -
10747 -SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
10748 -
10749 -LICENSE="POSTGRESQL GPL-2"
10750 -DESCRIPTION="PostgreSQL RDBMS"
10751 -HOMEPAGE="https://www.postgresql.org/"
10752 -
10753 -IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl
10754 - -pg_legacytimestamp python +readline selinux +server systemd ssl
10755 - static-libs tcl threads uuid xml zlib"
10756 -
10757 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
10758 -
10759 -CDEPEND="
10760 ->=app-eselect/eselect-postgresql-2.0
10761 -sys-apps/less
10762 -virtual/libintl
10763 -kerberos? ( virtual/krb5 )
10764 -ldap? ( net-nds/openldap )
10765 -pam? ( sys-libs/pam )
10766 -perl? ( >=dev-lang/perl-5.8:= )
10767 -python? ( ${PYTHON_DEPS} )
10768 -readline? ( sys-libs/readline:0= )
10769 -ssl? (
10770 - !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
10771 - libressl? ( dev-libs/libressl:= )
10772 -)
10773 -server? ( systemd? ( sys-apps/systemd ) )
10774 -tcl? ( >=dev-lang/tcl-8:0= )
10775 -xml? ( dev-libs/libxml2 dev-libs/libxslt )
10776 -zlib? ( sys-libs/zlib )
10777 -"
10778 -
10779 -# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
10780 -# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
10781 -# the libc includes UUID functions.
10782 -UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
10783 -BSD_LIBC=( elibc_{Free,Net,Open}BSD )
10784 -
10785 -nest_usedep() {
10786 - local front back
10787 - while [[ ${#} -gt 1 ]]; do
10788 - front+="${1}? ( "
10789 - back+=" )"
10790 - shift
10791 - done
10792 - echo "${front}${1}${back}"
10793 -}
10794 -
10795 -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
10796 -CDEPEND+="
10797 -uuid? (
10798 - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
10799 - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
10800 -)"
10801 -
10802 -DEPEND="${CDEPEND}
10803 -!!<sys-apps/sandbox-2.0
10804 -sys-devel/bison
10805 -sys-devel/flex
10806 -nls? ( sys-devel/gettext )
10807 -xml? ( virtual/pkgconfig )
10808 -"
10809 -
10810 -RDEPEND="${CDEPEND}
10811 -!dev-db/postgresql-docs:${SLOT}
10812 -!dev-db/postgresql-base:${SLOT}
10813 -!dev-db/postgresql-server:${SLOT}
10814 -selinux? ( sec-policy/selinux-postgresql )
10815 -"
10816 -
10817 -pkg_setup() {
10818 - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
10819 -
10820 - enewgroup postgres 70
10821 - enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
10822 -
10823 - use python && python-single-r1_pkg_setup
10824 -}
10825 -
10826 -src_prepare() {
10827 - # Work around PPC{,64} compilation bug where bool is already defined
10828 - sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
10829 -
10830 - # Set proper run directory
10831 - sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
10832 - -i src/include/pg_config_manual.h || die
10833 -
10834 - # Rely on $PATH being in the proper order so that the correct
10835 - # install program is used for modules utilizing PGXS in both
10836 - # hardened and non-hardened environments. (Bug #528786)
10837 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
10838 -
10839 - use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch"
10840 -
10841 - if use pam ; then
10842 - sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
10843 - -i src/backend/libpq/auth.c || \
10844 - die 'PGSQL_PAM_SERVICE rename failed.'
10845 - fi
10846 -
10847 - eapply_user
10848 -}
10849 -
10850 -src_configure() {
10851 - case ${CHOST} in
10852 - *-darwin*|*-solaris*)
10853 - use nls && append-libs intl
10854 - ;;
10855 - esac
10856 -
10857 - export LDFLAGS_SL="${LDFLAGS}"
10858 - export LDFLAGS_EX="${LDFLAGS}"
10859 -
10860 - local PO="${EPREFIX}"
10861 -
10862 - local i uuid_config=""
10863 - if use uuid; then
10864 - for i in ${UTIL_LINUX_LIBC[@]}; do
10865 - use ${i} && uuid_config="--with-uuid=e2fs"
10866 - done
10867 - for i in ${BSD_LIBC[@]}; do
10868 - use ${i} && uuid_config="--with-uuid=bsd"
10869 - done
10870 - [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
10871 - fi
10872 -
10873 - econf \
10874 - --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
10875 - --datadir="${PO}/usr/share/postgresql-${SLOT}" \
10876 - --includedir="${PO}/usr/include/postgresql-${SLOT}" \
10877 - --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
10878 - --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
10879 - --with-system-tzdata="${PO}/usr/share/zoneinfo" \
10880 - $(use_enable !alpha spinlocks) \
10881 - $(use_enable !pg_legacytimestamp integer-datetimes) \
10882 - $(use_enable debug) \
10883 - $(use_enable threads thread-safety) \
10884 - $(use_with kerberos gssapi) \
10885 - $(use_with ldap) \
10886 - $(use_with pam) \
10887 - $(use_with perl) \
10888 - $(use_with python) \
10889 - $(use_with readline) \
10890 - $(use_with ssl openssl) \
10891 - $(usex server "$(use_with systemd)" '--without-systemd') \
10892 - $(use_with tcl) \
10893 - ${uuid_config} \
10894 - $(use_with xml libxml) \
10895 - $(use_with xml libxslt) \
10896 - $(use_with zlib) \
10897 - $(use_enable nls nls "'$(l10n_get_locales)'")
10898 -}
10899 -
10900 -src_compile() {
10901 - emake
10902 - emake -C contrib
10903 -}
10904 -
10905 -src_install() {
10906 - emake DESTDIR="${D}" install
10907 - emake DESTDIR="${D}" install -C contrib
10908 -
10909 - dodoc README HISTORY doc/{TODO,bug.template}
10910 -
10911 - # man pages are already built, but if we have the target make them,
10912 - # they'll be generated from source before being installed so we
10913 - # manually install man pages.
10914 - # We use ${SLOT} instead of doman for postgresql.eselect
10915 - insinto /usr/share/postgresql-${SLOT}/man/
10916 - doins -r doc/src/sgml/man{1,3,7}
10917 - if ! use server; then
10918 - # Remove man pages for non-existent binaries
10919 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
10920 - rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
10921 - done
10922 - fi
10923 - docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
10924 -
10925 - # Create slot specific man pages
10926 - local bn f mansec slotted_name
10927 - for mansec in 1 3 7 ; do
10928 - local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
10929 -
10930 - mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
10931 - pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
10932 -
10933 - for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
10934 - bn=$(basename "${f}")
10935 - slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec}
10936 - case ${bn} in
10937 - TABLE.7|WITH.7)
10938 - echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
10939 - ;;
10940 - *)
10941 - echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
10942 - ;;
10943 - esac
10944 - done
10945 -
10946 - popd > /dev/null
10947 - done
10948 -
10949 - insinto /etc/postgresql-${SLOT}
10950 - newins src/bin/psql/psqlrc.sample psqlrc
10951 -
10952 - # Don't delete libpg{port,common}.a (Bug #571046). They're always
10953 - # needed by extensions utilizing PGXS.
10954 - use static-libs || \
10955 - find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
10956 - -delete
10957 -
10958 - local f bn
10959 - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
10960 - -mindepth 1 -maxdepth 1)
10961 - do
10962 - bn=$(basename "${f}")
10963 - # Temporarily tack on tmp to workaround a file collision
10964 - # issue. This is only necessary for 9.7 and earlier. 10 never
10965 - # had this issue.
10966 - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
10967 - "/usr/bin/${bn}${SLOT/.}tmp"
10968 - done
10969 -
10970 - if use doc ; then
10971 - docinto html
10972 - dodoc doc/src/sgml/html/*
10973 -
10974 - docinto sgml
10975 - dodoc doc/src/sgml/*.{sgml,dsl}
10976 - fi
10977 -
10978 - if use server; then
10979 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
10980 - "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
10981 -
10982 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
10983 - "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
10984 -
10985 - if use systemd; then
10986 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
10987 - "${FILESDIR}/${PN}.service-9.6-r1" | \
10988 - systemd_newunit - ${PN}-${SLOT}.service
10989 - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
10990 - fi
10991 -
10992 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
10993 -
10994 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
10995 -
10996 - if use prefix ; then
10997 - keepdir /run/postgresql
10998 - fperms 1775 /run/postgresql
10999 - fi
11000 - fi
11001 -}
11002 -
11003 -pkg_preinst() {
11004 - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
11005 - # /usr/bin/psql96). They may have been created by the
11006 - # postgresql.eselect module, but they're handled within this ebuild
11007 - # now. It's alright if we momentarily delete /usr/bin/psql as it
11008 - # will be recreated by the eselect module in pkg_ppostinst(). This
11009 - # is only necessary for 9.7 and earlier. 10 and later were never
11010 - # handled in this manner.
11011 - local canonicalise
11012 - if type -p realpath > /dev/null; then
11013 - canonicalise=realpath
11014 - elif type -p readlink > /dev/null; then
11015 - canonicalise='readlink -f'
11016 - else
11017 - # can't die, subshell
11018 - die "No readlink nor realpath found, cannot canonicalise"
11019 - fi
11020 -
11021 - local l
11022 - # First remove any symlinks in /usr/bin that may have been created
11023 - # by the old eselect
11024 - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
11025 - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
11026 - rm "${l}" || ewarn "Couldn't remove ${l}"
11027 - fi
11028 - done
11029 -
11030 - # Then move the symlinks created by the ebuild to their proper place.
11031 - for l in "${ED}"/usr/bin/*tmp ; do
11032 - mv "${l}" "${l%tmp}" \
11033 - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
11034 - done
11035 -}
11036 -
11037 -pkg_postinst() {
11038 - use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
11039 - postgresql-config update
11040 -
11041 - elog "If you need a global psqlrc-file, you can place it in:"
11042 - elog " ${EROOT}/etc/postgresql-${SLOT}/"
11043 -
11044 - if use server ; then
11045 - elog
11046 - elog "Gentoo specific documentation:"
11047 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
11048 - elog
11049 - elog "Official documentation:"
11050 - elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
11051 - elog
11052 - elog "The default location of the Unix-domain socket is:"
11053 - elog " ${EROOT}/run/postgresql/"
11054 - elog
11055 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
11056 - elog "so that it contains your preferred locale in:"
11057 - elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
11058 - elog
11059 - elog "Then, execute the following command to setup the initial database"
11060 - elog "environment:"
11061 - elog " emerge --config =${CATEGORY}/${PF}"
11062 - fi
11063 -}
11064 -
11065 -pkg_prerm() {
11066 - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
11067 - ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
11068 - ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
11069 -
11070 - ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
11071 - sleep 10
11072 - eend 0
11073 - fi
11074 -}
11075 -
11076 -pkg_postrm() {
11077 - postgresql-config update
11078 -}
11079 -
11080 -pkg_config() {
11081 - use server || die "USE flag 'server' not enabled. Nothing to configure."
11082 -
11083 - [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
11084 - && source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
11085 - [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
11086 - [[ -z "${DATA_DIR}" ]] \
11087 - && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
11088 -
11089 - # environment.bz2 may not contain the same locale as the current system
11090 - # locale. Unset and source from the current system locale.
11091 - if [ -f "${EROOT}/etc/env.d/02locale" ]; then
11092 - unset LANG
11093 - unset LC_CTYPE
11094 - unset LC_NUMERIC
11095 - unset LC_TIME
11096 - unset LC_COLLATE
11097 - unset LC_MONETARY
11098 - unset LC_MESSAGES
11099 - unset LC_ALL
11100 - source "${EROOT}/etc/env.d/02locale"
11101 - [ -n "${LANG}" ] && export LANG
11102 - [ -n "${LC_CTYPE}" ] && export LC_CTYPE
11103 - [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
11104 - [ -n "${LC_TIME}" ] && export LC_TIME
11105 - [ -n "${LC_COLLATE}" ] && export LC_COLLATE
11106 - [ -n "${LC_MONETARY}" ] && export LC_MONETARY
11107 - [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
11108 - [ -n "${LC_ALL}" ] && export LC_ALL
11109 - fi
11110 -
11111 - einfo "You can modify the paths and options passed to initdb by editing:"
11112 - einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
11113 - einfo
11114 - einfo "Information on options that can be passed to initdb are found at:"
11115 - einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
11116 - einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
11117 - einfo
11118 - einfo "PG_INITDB_OPTS is currently set to:"
11119 - if [[ -z "${PG_INITDB_OPTS}" ]] ; then
11120 - einfo " (none)"
11121 - else
11122 - einfo " ${PG_INITDB_OPTS}"
11123 - fi
11124 - einfo
11125 - einfo "Configuration files will be installed to:"
11126 - einfo " ${PGDATA}"
11127 - einfo
11128 - einfo "The database cluster will be created in:"
11129 - einfo " ${DATA_DIR}"
11130 - einfo
11131 -
11132 - ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
11133 - sleep 5
11134 - eend 0
11135 -
11136 - if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
11137 - eerror "The given directory, '${DATA_DIR}', is not empty."
11138 - eerror "Modify DATA_DIR to point to an empty directory."
11139 - die "${DATA_DIR} is not empty."
11140 - fi
11141 -
11142 - einfo "Creating the data directory ..."
11143 - if [[ ${EUID} == 0 ]] ; then
11144 - mkdir -p "${DATA_DIR}"
11145 - chown -Rf postgres:postgres "${DATA_DIR}"
11146 - chmod 0700 "${DATA_DIR}"
11147 - fi
11148 -
11149 - einfo "Initializing the database ..."
11150 -
11151 - if [[ ${EUID} == 0 ]] ; then
11152 - su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
11153 - else
11154 - "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
11155 - fi
11156 -
11157 - if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
11158 - mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
11159 - ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
11160 - fi
11161 -
11162 - # unix_socket_directory has no effect in postgresql.conf as it's
11163 - # overridden in the initscript
11164 - sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
11165 -
11166 - cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
11167 - # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
11168 - # On the off-chance that you might need to work with UTF-8 encoded
11169 - # characters in PL/Perl
11170 - plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
11171 - EOF
11172 -
11173 - einfo "The autovacuum function, which was in contrib, has been moved to the main"
11174 - einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
11175 - einfo "by default. You can disable it in the cluster's:"
11176 - einfo " ${PGDATA%/}/postgresql.conf"
11177 - einfo
11178 - if ! use systemd; then
11179 - einfo "The PostgreSQL server, by default, will log events to:"
11180 - einfo " ${DATA_DIR%/}/postmaster.log"
11181 - einfo
11182 - fi
11183 - if use prefix ; then
11184 - einfo "The location of the configuration files have moved to:"
11185 - einfo " ${PGDATA}"
11186 - einfo "To start the server:"
11187 - einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
11188 - einfo "To stop:"
11189 - einfo " pg_ctl stop -D ${DATA_DIR}"
11190 - einfo
11191 - einfo "Or move the configuration files back:"
11192 - einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
11193 - elif use systemd; then
11194 - einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
11195 - einfo "instead of 'pg_ctl'."
11196 - else
11197 - einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
11198 - einfo "instead of 'pg_ctl'."
11199 - fi
11200 -}
11201 -
11202 -src_test() {
11203 - if use server && [[ ${UID} -ne 0 ]] ; then
11204 - emake check
11205 -
11206 - einfo "If you think other tests besides the regression tests are necessary, please"
11207 - einfo "submit a bug including a patch for this ebuild to enable them."
11208 - else
11209 - use server || \
11210 - ewarn 'Tests cannot be run without the "server" use flag enabled.'
11211 - [[ ${UID} -eq 0 ]] || \
11212 - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
11213 -
11214 - ewarn 'Skipping.'
11215 - fi
11216 -}