1 |
commit: cabc37d4b5bf47047932f2b7b5cc6fa3a8e93f50 |
2 |
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 11 11:07:42 2020 +0000 |
4 |
Commit: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 11 11:08:39 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cabc37d4 |
7 |
|
8 |
dev-db/postgresql: Cleanup |
9 |
|
10 |
Bug:https://bugs.gentoo.org/737032 |
11 |
|
12 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
13 |
Signed-off-by: Aaron W. Swenson <titanofold <AT> gentoo.org> |
14 |
|
15 |
dev-db/postgresql/Manifest | 11 - |
16 |
dev-db/postgresql/postgresql-10.12.ebuild | 465 ------------------------- |
17 |
dev-db/postgresql/postgresql-10.13.ebuild | 456 ------------------------- |
18 |
dev-db/postgresql/postgresql-11.7.ebuild | 467 ------------------------- |
19 |
dev-db/postgresql/postgresql-11.8.ebuild | 458 ------------------------- |
20 |
dev-db/postgresql/postgresql-12.2.ebuild | 467 ------------------------- |
21 |
dev-db/postgresql/postgresql-12.3.ebuild | 458 ------------------------- |
22 |
dev-db/postgresql/postgresql-13_beta2.ebuild | 458 ------------------------- |
23 |
dev-db/postgresql/postgresql-9.5.21.ebuild | 485 -------------------------- |
24 |
dev-db/postgresql/postgresql-9.5.22.ebuild | 476 -------------------------- |
25 |
dev-db/postgresql/postgresql-9.6.17.ebuild | 490 --------------------------- |
26 |
dev-db/postgresql/postgresql-9.6.18.ebuild | 481 -------------------------- |
27 |
12 files changed, 5172 deletions(-) |
28 |
|
29 |
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest |
30 |
index deb4d1fa96f..1ee0420fdd2 100644 |
31 |
--- a/dev-db/postgresql/Manifest |
32 |
+++ b/dev-db/postgresql/Manifest |
33 |
@@ -1,17 +1,6 @@ |
34 |
-DIST postgresql-10.12.tar.bz2 19020488 BLAKE2B 2177e9b63e21a634e1d8ea060b5bd0a7360d81ece64f50dd614e6cdd6b0cf0dcbd3896ef2c11bd1431ce7a964ac8876d24f368d7f7eb309e3d432856d7546f2a SHA512 6accc66cbbae811509095c33e8a8d17ddd11d9e307267312e3d09df90469db4700a5806166d66f25d77769d3ef88653c98dfc7d05dd053f10434b03e0a9e33b7 |
35 |
-DIST postgresql-10.13.tar.bz2 19028339 BLAKE2B 8adb1be902863778ca6a0396f1bc3ffa3e69b9e27bd830523472f4895e225831ba98716c07dc3f8dcab68623d434fc3d2d7b71f753f4105c69ecb05365c94789 SHA512 7b268aa4476ed9b168814891e8b19d182683ab4994d4a9b30e75eec93ffd9c860f8a0979ba1b7408acf8e217437b5cc20037b6ebf6ef01e9cf5ee99f091c8c92 |
36 |
DIST postgresql-10.14.tar.bz2 19042154 BLAKE2B addddf00179190780bd30ed97cf6881670d18fda77062cdb5dc7cc161c64c3d5522db288902d0612db30fc6fcc1b619c7a102887ed438e27739e936bf5659425 SHA512 eecd2aa8df7e4779606ec547b7bf0207ebb2be10a4b332f06c3b72116f0619fe27fb651f2fd4504c73b740ab7f92468919244a615d460bb9c35085174a0dbc78 |
37 |
-DIST postgresql-11.7.tar.bz2 19890063 BLAKE2B 461c372567ff0b4ff4da52889be5d2822b56889e4890b33c9a71f1105ad629b4f5bec95c4fbf5aebbdd4445e0ff451a7d8df04ae7b5bf7cf0075c3226a41b19b SHA512 32c7ace228f9895241ce0d925fbfc60c0cd39f4cd35368fb10dc7db046151ffd59a9895b4c30a529627f0103051e84b4992ed60312cccd292489f3037076ca1e |
38 |
-DIST postgresql-11.8.tar.bz2 19922770 BLAKE2B a646b585bbafc95957fa60c7d119c02b69b727759d2189588508f8a690dc97a0ed1429a3379bc6fd48fb22ee92f3d811dedbf8aa43271361f9b7ac2c8d42a31b SHA512 fc3d0ebd224de60bda3fa71b6832958698238e9088cf46a80c376b8996cc3b2d017fde5dce1c1da1e5e6e23b78054aafad7ee1caa744bfb12c52317ccc8a1922 |
39 |
DIST postgresql-11.9.tar.bz2 19959019 BLAKE2B 655d1c9e6eebde19402a4c220ee674c589641c5b6f4e6298c8c06d3330069178952455f5af58f90b9af196ba9c8fd03db0ccd70b8bc49335e465f0ed537eaf59 SHA512 2c5c2f51aa01f02af4aa0849441767383e30fef69dd52efa442892f39d2456bfa8bf01f633a265e00eca0745e792609d2c1d33f77d8f29a02f5f374c84f2bf6e |
40 |
-DIST postgresql-12.2.tar.bz2 20363545 BLAKE2B 7b0cfe841d46b117ff5dd793be5537e916f92255eb0d000681ed62c497eef34c5d1261126be408f2b7f95274485e2787869cd4063461ab248b650c168b62548d SHA512 0e0ce8e21856e8f43e58b840c10c4e3ffae6d5207e0d778e9176e36f8e20e34633cbb06f0030a7c963c3491bb7e941456d91b55444c561cfc6f283fba76f33ee |
41 |
-DIST postgresql-12.3.tar.bz2 20439892 BLAKE2B f7a44725f235c55a2849acd444de3a9c932314e2ae8c68d7f8e827439263b052bdf0fd5b6cdaa8197c4ce9ad1d4fbb02b5ec1af030365363993a36d8d95a4231 SHA512 68e2d244ae2a9f2138d7569bcadc1cf6f62a410fa56ad1d4ac53206f2adefabb5ae136110b41ca9246df0f8b8cb039918997e0f8a81fc7e6efb7ad10b3a59ba1 |
42 |
DIST postgresql-12.4.tar.bz2 20669776 BLAKE2B fb3f865a8a5e5280e7cc5da43f8658029170cd15dae8cc5fb1e741a122ea1f13418ac7743ec417ab4436976bc0ce12753fc8a301200143c975e8739d59816fa7 SHA512 36daf10878ca153370829178786dd6ee366ab4d4d6dc9c527536740fdb14b688ae4c33f850eb4243a7667d23f87e4bfd1ddee0755447ad4f3996e423e391c2f3 |
43 |
-DIST postgresql-13beta2.tar.bz2 21365208 BLAKE2B db223d769e378af40a41d1bfa8aa2f05a31b325c80e375aad6ee6e30c35f8e3dadc7865ff1b19c685032c1714da34aa2630c4ac190ee5450734ff436575131b2 SHA512 7307b26422e78d3ebf4fead25a8ba7de181406490a5d354decb0324fc2d9216de94cfc19fc4eaba7eef51153f159606fc40d8650eb57131cdbc8e6948299e40f |
44 |
DIST postgresql-13beta3.tar.bz2 21411847 BLAKE2B 6195e246f683c0da8b7fc8bb185474cfec9d556897f8a9f9ebf6138a644760c2e74fd9981de236280879bd78f9aba25c765ed065c84b7789b8ff0776fe9532ae SHA512 62804ab44dbfaad8f3d498eacc687620077023d4ce27fe817185a85ebea3aa55f673f2d83eb5477efbe980e3c536f328369c906b4ba71fc0702393bffb6fe2c0 |
45 |
-DIST postgresql-9.5.21.tar.bz2 17640928 BLAKE2B 8ffcf0befc331317a32d63d3cdfe44f7743f72f18b4bc46bee5ee80f8c489b4b1ef26abc8219f277acc922657fc21e3dc31f3fc9838621f44d95cc9405fca43b SHA512 8527356ee3b4f151c832aef50a8b96e923e0a6c77e5fe6ad597f50527f9d084a8feab7bede8fdbe29aab44383577d3f86e5286fb34e2d2b696cde34bd922e69d |
46 |
-DIST postgresql-9.5.22.tar.bz2 17667386 BLAKE2B 6fe8ccf638af466e57f239c9d7f1a19bb6c33f6019955824f54f2fe63870675d841811318fb28707cc85ab8a9db550e6655773db0d89d801e26459c9d0d01a43 SHA512 489321fa49e17308d3a78353edf73a16295c1377ad429a94636df069d2bf55f538ba6570e3d2991dd28bcca45fee77c6c41fa9bade35ea7f9e581abff4c9a401 |
47 |
DIST postgresql-9.5.23.tar.bz2 17682366 BLAKE2B 74713d6483ae1ad3d2dfc4b1ac9d30a6785ff34f61b735924f2d469861516ad5160cbfda9c09b96adf264237b6f3ad8fd6ddeef60b6af6b5b63d6c1a36fb9354 SHA512 b7a1e936a0043b57b3ece79610855820d2ea6a86e4a4be0c4c8358bf3e1ef8fa88bc60106d6b865d86231d16b5e3c098b4dbd93125a125b3cc5d468ffea64db1 |
48 |
-DIST postgresql-9.6.17.tar.bz2 18812282 BLAKE2B 0bb48445201aae1d6b4f5a77652aefaaa629799a019c3b81a14e554a88167530002931c2b0d658731b26a38bd09487f79a6ef514b0955982d6037b383c021819 SHA512 a76f328523517f664e4fc59a4d27e476bc6300e49370712030caae40aa160acb1e6aecc7cd3b3440125713069932df812eb8d75377a3df63e59c9292419c2aa8 |
49 |
-DIST postgresql-9.6.18.tar.bz2 18836490 BLAKE2B 43f2d8a14e4fcad72af1f2e2814546368f7c2c0bb3c9957527e96df0ae6984d6b05008619855cf74fefeab0f35b13de4f0a437f79fa13c6e3a4ca2c8bc272aab SHA512 78aad7042d22be4486511a9f3b5df2578b65a911b9e969e6196c945d84b9d9a79b40c01a8bdd3859cc67cd9a5d023cca5d83c1360cb14a9bb076ff3b5c1fff70 |
50 |
DIST postgresql-9.6.19.tar.bz2 18880036 BLAKE2B ad9c5684e2c0fb276589560f7dbe01241b5caf763f5a20991244ad7b473397576c9530658eb91e085e8416156b0ac81750f08ed85d5e5a689321891d10b6e114 SHA512 4d8d4a0e4645d71683a5fccb9cd88917e1870ba139f102e0ea82da9c8d1ad669f029e0feb6d409e2016dfd247229ec7daf04f7f2de3ab6c5b4053834ac244a26 |
51 |
|
52 |
diff --git a/dev-db/postgresql/postgresql-10.12.ebuild b/dev-db/postgresql/postgresql-10.12.ebuild |
53 |
deleted file mode 100644 |
54 |
index 3f23e213da8..00000000000 |
55 |
--- a/dev-db/postgresql/postgresql-10.12.ebuild |
56 |
+++ /dev/null |
57 |
@@ -1,465 +0,0 @@ |
58 |
-# Copyright 1999-2020 Gentoo Authors |
59 |
-# Distributed under the terms of the GNU General Public License v2 |
60 |
- |
61 |
-EAPI=7 |
62 |
- |
63 |
-PYTHON_COMPAT=( python3_{6,7} ) |
64 |
- |
65 |
-PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN |
66 |
- zh_TW" |
67 |
- |
68 |
-inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ |
69 |
- systemd user |
70 |
- |
71 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris" |
72 |
- |
73 |
-SLOT=$(ver_cut 1) |
74 |
- |
75 |
-MY_PV=${PV/_/} |
76 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
77 |
- |
78 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
79 |
- |
80 |
-LICENSE="POSTGRESQL GPL-2" |
81 |
-DESCRIPTION="PostgreSQL RDBMS" |
82 |
-HOMEPAGE="https://www.postgresql.org/" |
83 |
- |
84 |
-IUSE="debug doc icu kerberos kernel_linux ldap libressl nls pam perl |
85 |
- python +readline selinux +server systemd ssl static-libs tcl |
86 |
- threads uuid xml zlib" |
87 |
- |
88 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
89 |
- |
90 |
-CDEPEND=" |
91 |
->=app-eselect/eselect-postgresql-2.0 |
92 |
-sys-apps/less |
93 |
-virtual/libintl |
94 |
-icu? ( dev-libs/icu:= ) |
95 |
-kerberos? ( virtual/krb5 ) |
96 |
-ldap? ( net-nds/openldap ) |
97 |
-pam? ( sys-libs/pam ) |
98 |
-perl? ( >=dev-lang/perl-5.8:= ) |
99 |
-python? ( ${PYTHON_DEPS} ) |
100 |
-readline? ( sys-libs/readline:0= ) |
101 |
-server? ( systemd? ( sys-apps/systemd ) ) |
102 |
-ssl? ( |
103 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
104 |
- libressl? ( dev-libs/libressl:= ) |
105 |
-) |
106 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
107 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
108 |
-zlib? ( sys-libs/zlib ) |
109 |
-" |
110 |
- |
111 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
112 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
113 |
-# the libc includes UUID functions. |
114 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
115 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
116 |
- |
117 |
-nest_usedep() { |
118 |
- local front back |
119 |
- while [[ ${#} -gt 1 ]]; do |
120 |
- front+="${1}? ( " |
121 |
- back+=" )" |
122 |
- shift |
123 |
- done |
124 |
- echo "${front}${1}${back}" |
125 |
-} |
126 |
- |
127 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
128 |
-CDEPEND+=" |
129 |
-uuid? ( |
130 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
131 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
132 |
-)" |
133 |
- |
134 |
-DEPEND="${CDEPEND} |
135 |
-!!<sys-apps/sandbox-2.0 |
136 |
-sys-devel/bison |
137 |
-sys-devel/flex |
138 |
-nls? ( sys-devel/gettext ) |
139 |
-xml? ( virtual/pkgconfig ) |
140 |
-" |
141 |
- |
142 |
-RDEPEND="${CDEPEND} |
143 |
-!dev-db/postgresql-docs:${SLOT} |
144 |
-!dev-db/postgresql-base:${SLOT} |
145 |
-!dev-db/postgresql-server:${SLOT} |
146 |
-selinux? ( sec-policy/selinux-postgresql ) |
147 |
-" |
148 |
- |
149 |
-pkg_setup() { |
150 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
151 |
- |
152 |
- enewgroup postgres 70 |
153 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
154 |
- |
155 |
- use python && python-single-r1_pkg_setup |
156 |
-} |
157 |
- |
158 |
-src_prepare() { |
159 |
- # Work around PPC{,64} compilation bug where bool is already defined |
160 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
161 |
- |
162 |
- # Set proper run directory |
163 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
164 |
- -i src/include/pg_config_manual.h || die |
165 |
- |
166 |
- # Rely on $PATH being in the proper order so that the correct |
167 |
- # install program is used for modules utilizing PGXS in both |
168 |
- # hardened and non-hardened environments. (Bug #528786) |
169 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
170 |
- |
171 |
- use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch" |
172 |
- |
173 |
- if use pam ; then |
174 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
175 |
- -i src/backend/libpq/auth.c || \ |
176 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
177 |
- fi |
178 |
- |
179 |
- eapply_user |
180 |
-} |
181 |
- |
182 |
-src_configure() { |
183 |
- case ${CHOST} in |
184 |
- *-darwin*|*-solaris*) |
185 |
- use nls && append-libs intl |
186 |
- ;; |
187 |
- esac |
188 |
- |
189 |
- export LDFLAGS_SL="${LDFLAGS}" |
190 |
- export LDFLAGS_EX="${LDFLAGS}" |
191 |
- |
192 |
- local PO="${EPREFIX}" |
193 |
- |
194 |
- local i uuid_config="" |
195 |
- if use uuid; then |
196 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
197 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
198 |
- done |
199 |
- for i in ${BSD_LIBC[@]}; do |
200 |
- use ${i} && uuid_config="--with-uuid=bsd" |
201 |
- done |
202 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
203 |
- fi |
204 |
- |
205 |
- econf \ |
206 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
207 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
208 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
209 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
210 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
211 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
212 |
- $(use_enable !alpha spinlocks) \ |
213 |
- $(use_enable debug) \ |
214 |
- $(use_enable threads thread-safety) \ |
215 |
- $(use_with icu) \ |
216 |
- $(use_with kerberos gssapi) \ |
217 |
- $(use_with ldap) \ |
218 |
- $(use_with pam) \ |
219 |
- $(use_with perl) \ |
220 |
- $(use_with python) \ |
221 |
- $(use_with readline) \ |
222 |
- $(use_with ssl openssl) \ |
223 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
224 |
- $(use_with tcl) \ |
225 |
- ${uuid_config} \ |
226 |
- $(use_with xml libxml) \ |
227 |
- $(use_with xml libxslt) \ |
228 |
- $(use_with zlib) \ |
229 |
- $(use_enable nls nls "'$(l10n_get_locales)'") |
230 |
-} |
231 |
- |
232 |
-src_compile() { |
233 |
- emake |
234 |
- emake -C contrib |
235 |
-} |
236 |
- |
237 |
-src_install() { |
238 |
- emake DESTDIR="${D}" install |
239 |
- emake DESTDIR="${D}" install -C contrib |
240 |
- |
241 |
- dodoc README HISTORY doc/{TODO,bug.template} |
242 |
- |
243 |
- # man pages are already built, but if we have the target make them, |
244 |
- # they'll be generated from source before being installed so we |
245 |
- # manually install man pages. |
246 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
247 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
248 |
- doins -r doc/src/sgml/man{1,3,7} |
249 |
- if ! use server; then |
250 |
- # Remove man pages for non-existent binaries |
251 |
- serverman=( |
252 |
- initdb |
253 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
254 |
- pg_{test_{fsync,timing},upgrade,waldump} |
255 |
- post{gres,master} |
256 |
- ) |
257 |
- for m in ${serverman[@]} ; do |
258 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
259 |
- done |
260 |
- fi |
261 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
262 |
- |
263 |
- # Create slot specific man pages |
264 |
- local bn f mansec slotted_name |
265 |
- for mansec in 1 3 7 ; do |
266 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
267 |
- |
268 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
269 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
270 |
- |
271 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
272 |
- bn=$(basename "${f}") |
273 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
274 |
- case ${bn} in |
275 |
- TABLE.7|WITH.7) |
276 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
277 |
- ;; |
278 |
- *) |
279 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
280 |
- ;; |
281 |
- esac |
282 |
- done |
283 |
- |
284 |
- popd > /dev/null |
285 |
- done |
286 |
- |
287 |
- insinto /etc/postgresql-${SLOT} |
288 |
- newins src/bin/psql/psqlrc.sample psqlrc |
289 |
- |
290 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
291 |
- # needed by extensions utilizing PGXS. |
292 |
- use static-libs || \ |
293 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
294 |
- -delete |
295 |
- |
296 |
- # Make slot specific links to programs |
297 |
- local f bn |
298 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
299 |
- -mindepth 1 -maxdepth 1) |
300 |
- do |
301 |
- bn=$(basename "${f}") |
302 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
303 |
- "/usr/bin/${bn}${SLOT/.}" |
304 |
- done |
305 |
- |
306 |
- if use doc ; then |
307 |
- docinto html |
308 |
- dodoc doc/src/sgml/html/* |
309 |
- fi |
310 |
- |
311 |
- if use server; then |
312 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
313 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
314 |
- |
315 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
316 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
317 |
- |
318 |
- if use systemd; then |
319 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
320 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
321 |
- systemd_newunit - ${PN}-${SLOT}.service |
322 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
323 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
324 |
- fi |
325 |
- |
326 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
327 |
- |
328 |
- if use prefix ; then |
329 |
- keepdir /run/postgresql |
330 |
- fperms 1775 /run/postgresql |
331 |
- fi |
332 |
- fi |
333 |
-} |
334 |
- |
335 |
-pkg_postinst() { |
336 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
337 |
- postgresql-config update |
338 |
- |
339 |
- elog "If you need a global psqlrc-file, you can place it in:" |
340 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
341 |
- |
342 |
- if use server ; then |
343 |
- elog |
344 |
- elog "Gentoo specific documentation:" |
345 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
346 |
- elog |
347 |
- elog "Official documentation:" |
348 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
349 |
- elog |
350 |
- elog "The default location of the Unix-domain socket is:" |
351 |
- elog " ${EROOT}/run/postgresql/" |
352 |
- elog |
353 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
354 |
- elog "so that it contains your preferred locale in:" |
355 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
356 |
- elog |
357 |
- elog "Then, execute the following command to setup the initial database" |
358 |
- elog "environment:" |
359 |
- elog " emerge --config =${CATEGORY}/${PF}" |
360 |
- |
361 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
362 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
363 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
364 |
- ewarn "the following command after upgrading:" |
365 |
- ewarn |
366 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
367 |
- fi |
368 |
- fi |
369 |
-} |
370 |
- |
371 |
-pkg_prerm() { |
372 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
373 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
374 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
375 |
- |
376 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
377 |
- sleep 10 |
378 |
- eend 0 |
379 |
- fi |
380 |
-} |
381 |
- |
382 |
-pkg_postrm() { |
383 |
- postgresql-config update |
384 |
-} |
385 |
- |
386 |
-pkg_config() { |
387 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
388 |
- |
389 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
390 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
391 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
392 |
- [[ -z "${DATA_DIR}" ]] \ |
393 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
394 |
- |
395 |
- # environment.bz2 may not contain the same locale as the current system |
396 |
- # locale. Unset and source from the current system locale. |
397 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
398 |
- unset LANG |
399 |
- unset LC_CTYPE |
400 |
- unset LC_NUMERIC |
401 |
- unset LC_TIME |
402 |
- unset LC_COLLATE |
403 |
- unset LC_MONETARY |
404 |
- unset LC_MESSAGES |
405 |
- unset LC_ALL |
406 |
- source "${EROOT}/etc/env.d/02locale" |
407 |
- [ -n "${LANG}" ] && export LANG |
408 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
409 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
410 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
411 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
412 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
413 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
414 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
415 |
- fi |
416 |
- |
417 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
418 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
419 |
- einfo |
420 |
- einfo "Information on options that can be passed to initdb are found at:" |
421 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
422 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
423 |
- einfo |
424 |
- einfo "PG_INITDB_OPTS is currently set to:" |
425 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
426 |
- einfo " (none)" |
427 |
- else |
428 |
- einfo " ${PG_INITDB_OPTS}" |
429 |
- fi |
430 |
- einfo |
431 |
- einfo "Configuration files will be installed to:" |
432 |
- einfo " ${PGDATA}" |
433 |
- einfo |
434 |
- einfo "The database cluster will be created in:" |
435 |
- einfo " ${DATA_DIR}" |
436 |
- einfo |
437 |
- |
438 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
439 |
- sleep 5 |
440 |
- eend 0 |
441 |
- |
442 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
443 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
444 |
- eerror "Modify DATA_DIR to point to an empty directory." |
445 |
- die "${DATA_DIR} is not empty." |
446 |
- fi |
447 |
- |
448 |
- einfo "Creating the data directory ..." |
449 |
- if [[ ${EUID} == 0 ]] ; then |
450 |
- mkdir -p "${DATA_DIR}" |
451 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
452 |
- chmod 0700 "${DATA_DIR}" |
453 |
- fi |
454 |
- |
455 |
- einfo "Initializing the database ..." |
456 |
- |
457 |
- if [[ ${EUID} == 0 ]] ; then |
458 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
459 |
- else |
460 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
461 |
- fi |
462 |
- |
463 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
464 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
465 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
466 |
- fi |
467 |
- |
468 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
469 |
- # overridden in the initscript |
470 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
471 |
- |
472 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
473 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
474 |
- # On the off-chance that you might need to work with UTF-8 encoded |
475 |
- # characters in PL/Perl |
476 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
477 |
- EOF |
478 |
- |
479 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
480 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
481 |
- einfo "by default. You can disable it in the cluster's:" |
482 |
- einfo " ${PGDATA%/}/postgresql.conf" |
483 |
- einfo |
484 |
- if ! use systemd; then |
485 |
- einfo "The PostgreSQL server, by default, will log events to:" |
486 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
487 |
- einfo |
488 |
- fi |
489 |
- if use prefix ; then |
490 |
- einfo "The location of the configuration files have moved to:" |
491 |
- einfo " ${PGDATA}" |
492 |
- einfo "To start the server:" |
493 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
494 |
- einfo "To stop:" |
495 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
496 |
- einfo |
497 |
- einfo "Or move the configuration files back:" |
498 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
499 |
- elif use systemd; then |
500 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
501 |
- einfo "instead of 'pg_ctl'." |
502 |
- else |
503 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
504 |
- einfo "instead of 'pg_ctl'." |
505 |
- fi |
506 |
-} |
507 |
- |
508 |
-src_test() { |
509 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
510 |
- emake check |
511 |
- |
512 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
513 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
514 |
- else |
515 |
- use server || \ |
516 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
517 |
- [[ ${UID} -eq 0 ]] || \ |
518 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
519 |
- |
520 |
- ewarn 'Skipping.' |
521 |
- fi |
522 |
-} |
523 |
|
524 |
diff --git a/dev-db/postgresql/postgresql-10.13.ebuild b/dev-db/postgresql/postgresql-10.13.ebuild |
525 |
deleted file mode 100644 |
526 |
index 54610ae9a34..00000000000 |
527 |
--- a/dev-db/postgresql/postgresql-10.13.ebuild |
528 |
+++ /dev/null |
529 |
@@ -1,456 +0,0 @@ |
530 |
-# Copyright 1999-2020 Gentoo Authors |
531 |
-# Distributed under the terms of the GNU General Public License v2 |
532 |
- |
533 |
-EAPI=7 |
534 |
- |
535 |
-PYTHON_COMPAT=( python3_{6,7} ) |
536 |
- |
537 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd |
538 |
- |
539 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris" |
540 |
- |
541 |
-SLOT=$(ver_cut 1) |
542 |
- |
543 |
-MY_PV=${PV/_/} |
544 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
545 |
- |
546 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
547 |
- |
548 |
-LICENSE="POSTGRESQL GPL-2" |
549 |
-DESCRIPTION="PostgreSQL RDBMS" |
550 |
-HOMEPAGE="https://www.postgresql.org/" |
551 |
- |
552 |
-IUSE="debug doc icu kerberos kernel_linux ldap libressl nls pam perl |
553 |
- python +readline selinux +server systemd ssl static-libs tcl |
554 |
- threads uuid xml zlib" |
555 |
- |
556 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
557 |
- |
558 |
-CDEPEND=" |
559 |
->=app-eselect/eselect-postgresql-2.0 |
560 |
-acct-group/postgres |
561 |
-acct-user/postgres |
562 |
-sys-apps/less |
563 |
-virtual/libintl |
564 |
-icu? ( dev-libs/icu:= ) |
565 |
-kerberos? ( virtual/krb5 ) |
566 |
-ldap? ( net-nds/openldap ) |
567 |
-pam? ( sys-libs/pam ) |
568 |
-perl? ( >=dev-lang/perl-5.8:= ) |
569 |
-python? ( ${PYTHON_DEPS} ) |
570 |
-readline? ( sys-libs/readline:0= ) |
571 |
-server? ( systemd? ( sys-apps/systemd ) ) |
572 |
-ssl? ( |
573 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
574 |
- libressl? ( dev-libs/libressl:= ) |
575 |
-) |
576 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
577 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
578 |
-zlib? ( sys-libs/zlib ) |
579 |
-" |
580 |
- |
581 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
582 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
583 |
-# the libc includes UUID functions. |
584 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
585 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
586 |
- |
587 |
-nest_usedep() { |
588 |
- local front back |
589 |
- while [[ ${#} -gt 1 ]]; do |
590 |
- front+="${1}? ( " |
591 |
- back+=" )" |
592 |
- shift |
593 |
- done |
594 |
- echo "${front}${1}${back}" |
595 |
-} |
596 |
- |
597 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
598 |
-CDEPEND+=" |
599 |
-uuid? ( |
600 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
601 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
602 |
-)" |
603 |
- |
604 |
-DEPEND="${CDEPEND} |
605 |
-sys-devel/bison |
606 |
-sys-devel/flex |
607 |
-nls? ( sys-devel/gettext ) |
608 |
-xml? ( virtual/pkgconfig ) |
609 |
-" |
610 |
- |
611 |
-RDEPEND="${CDEPEND} |
612 |
-selinux? ( sec-policy/selinux-postgresql ) |
613 |
-" |
614 |
- |
615 |
-pkg_setup() { |
616 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
617 |
- |
618 |
- use python && python-single-r1_pkg_setup |
619 |
-} |
620 |
- |
621 |
-src_prepare() { |
622 |
- # Work around PPC{,64} compilation bug where bool is already defined |
623 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
624 |
- |
625 |
- # Set proper run directory |
626 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
627 |
- -i src/include/pg_config_manual.h || die |
628 |
- |
629 |
- # Rely on $PATH being in the proper order so that the correct |
630 |
- # install program is used for modules utilizing PGXS in both |
631 |
- # hardened and non-hardened environments. (Bug #528786) |
632 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
633 |
- |
634 |
- use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch" |
635 |
- |
636 |
- if use pam ; then |
637 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
638 |
- -i src/backend/libpq/auth.c || \ |
639 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
640 |
- fi |
641 |
- |
642 |
- eapply_user |
643 |
-} |
644 |
- |
645 |
-src_configure() { |
646 |
- case ${CHOST} in |
647 |
- *-darwin*|*-solaris*) |
648 |
- use nls && append-libs intl |
649 |
- ;; |
650 |
- esac |
651 |
- |
652 |
- export LDFLAGS_SL="${LDFLAGS}" |
653 |
- export LDFLAGS_EX="${LDFLAGS}" |
654 |
- |
655 |
- local PO="${EPREFIX}" |
656 |
- |
657 |
- local i uuid_config="" |
658 |
- if use uuid; then |
659 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
660 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
661 |
- done |
662 |
- for i in ${BSD_LIBC[@]}; do |
663 |
- use ${i} && uuid_config="--with-uuid=bsd" |
664 |
- done |
665 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
666 |
- fi |
667 |
- |
668 |
- econf \ |
669 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
670 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
671 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
672 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
673 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
674 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
675 |
- $(use_enable !alpha spinlocks) \ |
676 |
- $(use_enable debug) \ |
677 |
- $(use_enable threads thread-safety) \ |
678 |
- $(use_with icu) \ |
679 |
- $(use_with kerberos gssapi) \ |
680 |
- $(use_with ldap) \ |
681 |
- $(use_with pam) \ |
682 |
- $(use_with perl) \ |
683 |
- $(use_with python) \ |
684 |
- $(use_with readline) \ |
685 |
- $(use_with ssl openssl) \ |
686 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
687 |
- $(use_with tcl) \ |
688 |
- ${uuid_config} \ |
689 |
- $(use_with xml libxml) \ |
690 |
- $(use_with xml libxslt) \ |
691 |
- $(use_with zlib) \ |
692 |
- $(use_enable nls) |
693 |
-} |
694 |
- |
695 |
-src_compile() { |
696 |
- emake |
697 |
- emake -C contrib |
698 |
-} |
699 |
- |
700 |
-src_install() { |
701 |
- emake DESTDIR="${D}" install |
702 |
- emake DESTDIR="${D}" install -C contrib |
703 |
- |
704 |
- dodoc README HISTORY doc/{TODO,bug.template} |
705 |
- |
706 |
- # man pages are already built, but if we have the target make them, |
707 |
- # they'll be generated from source before being installed so we |
708 |
- # manually install man pages. |
709 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
710 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
711 |
- doins -r doc/src/sgml/man{1,3,7} |
712 |
- if ! use server; then |
713 |
- # Remove man pages for non-existent binaries |
714 |
- serverman=( |
715 |
- initdb |
716 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
717 |
- pg_{test_{fsync,timing},upgrade,waldump} |
718 |
- post{gres,master} |
719 |
- ) |
720 |
- for m in ${serverman[@]} ; do |
721 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
722 |
- done |
723 |
- fi |
724 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
725 |
- |
726 |
- # Create slot specific man pages |
727 |
- local bn f mansec slotted_name |
728 |
- for mansec in 1 3 7 ; do |
729 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
730 |
- |
731 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
732 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
733 |
- |
734 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
735 |
- bn=$(basename "${f}") |
736 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
737 |
- case ${bn} in |
738 |
- TABLE.7|WITH.7) |
739 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
740 |
- ;; |
741 |
- *) |
742 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
743 |
- ;; |
744 |
- esac |
745 |
- done |
746 |
- |
747 |
- popd > /dev/null |
748 |
- done |
749 |
- |
750 |
- insinto /etc/postgresql-${SLOT} |
751 |
- newins src/bin/psql/psqlrc.sample psqlrc |
752 |
- |
753 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
754 |
- # needed by extensions utilizing PGXS. |
755 |
- use static-libs || \ |
756 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
757 |
- -delete |
758 |
- |
759 |
- # Make slot specific links to programs |
760 |
- local f bn |
761 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
762 |
- -mindepth 1 -maxdepth 1) |
763 |
- do |
764 |
- bn=$(basename "${f}") |
765 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
766 |
- "/usr/bin/${bn}${SLOT/.}" |
767 |
- done |
768 |
- |
769 |
- if use doc ; then |
770 |
- docinto html |
771 |
- dodoc doc/src/sgml/html/* |
772 |
- fi |
773 |
- |
774 |
- if use server; then |
775 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
776 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
777 |
- |
778 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
779 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
780 |
- |
781 |
- if use systemd; then |
782 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
783 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
784 |
- systemd_newunit - ${PN}-${SLOT}.service |
785 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
786 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
787 |
- fi |
788 |
- |
789 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
790 |
- |
791 |
- if use prefix ; then |
792 |
- keepdir /run/postgresql |
793 |
- fperms 1775 /run/postgresql |
794 |
- fi |
795 |
- fi |
796 |
-} |
797 |
- |
798 |
-pkg_postinst() { |
799 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
800 |
- postgresql-config update |
801 |
- |
802 |
- elog "If you need a global psqlrc-file, you can place it in:" |
803 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
804 |
- |
805 |
- if use server ; then |
806 |
- elog |
807 |
- elog "Gentoo specific documentation:" |
808 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
809 |
- elog |
810 |
- elog "Official documentation:" |
811 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
812 |
- elog |
813 |
- elog "The default location of the Unix-domain socket is:" |
814 |
- elog " ${EROOT}/run/postgresql/" |
815 |
- elog |
816 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
817 |
- elog "so that it contains your preferred locale in:" |
818 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
819 |
- elog |
820 |
- elog "Then, execute the following command to setup the initial database" |
821 |
- elog "environment:" |
822 |
- elog " emerge --config =${CATEGORY}/${PF}" |
823 |
- |
824 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
825 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
826 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
827 |
- ewarn "the following command after upgrading:" |
828 |
- ewarn |
829 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
830 |
- fi |
831 |
- fi |
832 |
-} |
833 |
- |
834 |
-pkg_prerm() { |
835 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
836 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
837 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
838 |
- |
839 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
840 |
- sleep 10 |
841 |
- eend 0 |
842 |
- fi |
843 |
-} |
844 |
- |
845 |
-pkg_postrm() { |
846 |
- postgresql-config update |
847 |
-} |
848 |
- |
849 |
-pkg_config() { |
850 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
851 |
- |
852 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
853 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
854 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
855 |
- [[ -z "${DATA_DIR}" ]] \ |
856 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
857 |
- |
858 |
- # environment.bz2 may not contain the same locale as the current system |
859 |
- # locale. Unset and source from the current system locale. |
860 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
861 |
- unset LANG |
862 |
- unset LC_CTYPE |
863 |
- unset LC_NUMERIC |
864 |
- unset LC_TIME |
865 |
- unset LC_COLLATE |
866 |
- unset LC_MONETARY |
867 |
- unset LC_MESSAGES |
868 |
- unset LC_ALL |
869 |
- source "${EROOT}/etc/env.d/02locale" |
870 |
- [ -n "${LANG}" ] && export LANG |
871 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
872 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
873 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
874 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
875 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
876 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
877 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
878 |
- fi |
879 |
- |
880 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
881 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
882 |
- einfo |
883 |
- einfo "Information on options that can be passed to initdb are found at:" |
884 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
885 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
886 |
- einfo |
887 |
- einfo "PG_INITDB_OPTS is currently set to:" |
888 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
889 |
- einfo " (none)" |
890 |
- else |
891 |
- einfo " ${PG_INITDB_OPTS}" |
892 |
- fi |
893 |
- einfo |
894 |
- einfo "Configuration files will be installed to:" |
895 |
- einfo " ${PGDATA}" |
896 |
- einfo |
897 |
- einfo "The database cluster will be created in:" |
898 |
- einfo " ${DATA_DIR}" |
899 |
- einfo |
900 |
- |
901 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
902 |
- sleep 5 |
903 |
- eend 0 |
904 |
- |
905 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
906 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
907 |
- eerror "Modify DATA_DIR to point to an empty directory." |
908 |
- die "${DATA_DIR} is not empty." |
909 |
- fi |
910 |
- |
911 |
- einfo "Creating the data directory ..." |
912 |
- if [[ ${EUID} == 0 ]] ; then |
913 |
- mkdir -p "${DATA_DIR}" |
914 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
915 |
- chmod 0700 "${DATA_DIR}" |
916 |
- fi |
917 |
- |
918 |
- einfo "Initializing the database ..." |
919 |
- |
920 |
- if [[ ${EUID} == 0 ]] ; then |
921 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
922 |
- else |
923 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
924 |
- fi |
925 |
- |
926 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
927 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
928 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
929 |
- fi |
930 |
- |
931 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
932 |
- # overridden in the initscript |
933 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
934 |
- |
935 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
936 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
937 |
- # On the off-chance that you might need to work with UTF-8 encoded |
938 |
- # characters in PL/Perl |
939 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
940 |
- EOF |
941 |
- |
942 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
943 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
944 |
- einfo "by default. You can disable it in the cluster's:" |
945 |
- einfo " ${PGDATA%/}/postgresql.conf" |
946 |
- einfo |
947 |
- if ! use systemd; then |
948 |
- einfo "The PostgreSQL server, by default, will log events to:" |
949 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
950 |
- einfo |
951 |
- fi |
952 |
- if use prefix ; then |
953 |
- einfo "The location of the configuration files have moved to:" |
954 |
- einfo " ${PGDATA}" |
955 |
- einfo "To start the server:" |
956 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
957 |
- einfo "To stop:" |
958 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
959 |
- einfo |
960 |
- einfo "Or move the configuration files back:" |
961 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
962 |
- elif use systemd; then |
963 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
964 |
- einfo "instead of 'pg_ctl'." |
965 |
- else |
966 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
967 |
- einfo "instead of 'pg_ctl'." |
968 |
- fi |
969 |
-} |
970 |
- |
971 |
-src_test() { |
972 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
973 |
- emake check |
974 |
- |
975 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
976 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
977 |
- else |
978 |
- use server || \ |
979 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
980 |
- [[ ${UID} -eq 0 ]] || \ |
981 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
982 |
- |
983 |
- ewarn 'Skipping.' |
984 |
- fi |
985 |
-} |
986 |
|
987 |
diff --git a/dev-db/postgresql/postgresql-11.7.ebuild b/dev-db/postgresql/postgresql-11.7.ebuild |
988 |
deleted file mode 100644 |
989 |
index affe9b75b79..00000000000 |
990 |
--- a/dev-db/postgresql/postgresql-11.7.ebuild |
991 |
+++ /dev/null |
992 |
@@ -1,467 +0,0 @@ |
993 |
-# Copyright 1999-2020 Gentoo Authors |
994 |
-# Distributed under the terms of the GNU General Public License v2 |
995 |
- |
996 |
-EAPI=7 |
997 |
- |
998 |
-PYTHON_COMPAT=( python3_{6,7} ) |
999 |
- |
1000 |
-PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN |
1001 |
- zh_TW" |
1002 |
- |
1003 |
-inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ |
1004 |
- systemd user |
1005 |
- |
1006 |
-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" |
1007 |
- |
1008 |
-SLOT=$(ver_cut 1) |
1009 |
- |
1010 |
-MY_PV=${PV/_/} |
1011 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
1012 |
- |
1013 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
1014 |
- |
1015 |
-LICENSE="POSTGRESQL GPL-2" |
1016 |
-DESCRIPTION="PostgreSQL RDBMS" |
1017 |
-HOMEPAGE="https://www.postgresql.org/" |
1018 |
- |
1019 |
-IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam |
1020 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
1021 |
- threads uuid xml zlib" |
1022 |
- |
1023 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1024 |
- |
1025 |
-CDEPEND=" |
1026 |
->=app-eselect/eselect-postgresql-2.0 |
1027 |
-sys-apps/less |
1028 |
-virtual/libintl |
1029 |
-icu? ( dev-libs/icu:= ) |
1030 |
-kerberos? ( virtual/krb5 ) |
1031 |
-ldap? ( net-nds/openldap ) |
1032 |
-llvm? ( |
1033 |
- sys-devel/llvm:= |
1034 |
- sys-devel/clang:= |
1035 |
-) |
1036 |
-pam? ( sys-libs/pam ) |
1037 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1038 |
-python? ( ${PYTHON_DEPS} ) |
1039 |
-readline? ( sys-libs/readline:0= ) |
1040 |
-server? ( systemd? ( sys-apps/systemd ) ) |
1041 |
-ssl? ( |
1042 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1043 |
- libressl? ( dev-libs/libressl:= ) |
1044 |
-) |
1045 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1046 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1047 |
-zlib? ( sys-libs/zlib ) |
1048 |
-" |
1049 |
- |
1050 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
1051 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
1052 |
-# the libc includes UUID functions. |
1053 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
1054 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
1055 |
- |
1056 |
-nest_usedep() { |
1057 |
- local front back |
1058 |
- while [[ ${#} -gt 1 ]]; do |
1059 |
- front+="${1}? ( " |
1060 |
- back+=" )" |
1061 |
- shift |
1062 |
- done |
1063 |
- echo "${front}${1}${back}" |
1064 |
-} |
1065 |
- |
1066 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
1067 |
-CDEPEND+=" |
1068 |
-uuid? ( |
1069 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
1070 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
1071 |
-)" |
1072 |
- |
1073 |
-DEPEND="${CDEPEND} |
1074 |
-!!<sys-apps/sandbox-2.0 |
1075 |
-sys-devel/bison |
1076 |
-sys-devel/flex |
1077 |
-nls? ( sys-devel/gettext ) |
1078 |
-xml? ( virtual/pkgconfig ) |
1079 |
-" |
1080 |
- |
1081 |
-RDEPEND="${CDEPEND} |
1082 |
-!dev-db/postgresql-docs:${SLOT} |
1083 |
-!dev-db/postgresql-base:${SLOT} |
1084 |
-!dev-db/postgresql-server:${SLOT} |
1085 |
-selinux? ( sec-policy/selinux-postgresql ) |
1086 |
-" |
1087 |
- |
1088 |
-pkg_setup() { |
1089 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1090 |
- |
1091 |
- enewgroup postgres 70 |
1092 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
1093 |
- |
1094 |
- use python && python-single-r1_pkg_setup |
1095 |
-} |
1096 |
- |
1097 |
-src_prepare() { |
1098 |
- # Set proper run directory |
1099 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1100 |
- -i src/include/pg_config_manual.h || die |
1101 |
- |
1102 |
- # Rely on $PATH being in the proper order so that the correct |
1103 |
- # install program is used for modules utilizing PGXS in both |
1104 |
- # hardened and non-hardened environments. (Bug #528786) |
1105 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
1106 |
- |
1107 |
- use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch" |
1108 |
- |
1109 |
- if use pam ; then |
1110 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1111 |
- -i src/backend/libpq/auth.c || \ |
1112 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1113 |
- fi |
1114 |
- |
1115 |
- eapply_user |
1116 |
-} |
1117 |
- |
1118 |
-src_configure() { |
1119 |
- case ${CHOST} in |
1120 |
- *-darwin*|*-solaris*) |
1121 |
- use nls && append-libs intl |
1122 |
- ;; |
1123 |
- esac |
1124 |
- |
1125 |
- export LDFLAGS_SL="${LDFLAGS}" |
1126 |
- export LDFLAGS_EX="${LDFLAGS}" |
1127 |
- |
1128 |
- local PO="${EPREFIX}" |
1129 |
- |
1130 |
- local i uuid_config="" |
1131 |
- if use uuid; then |
1132 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
1133 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
1134 |
- done |
1135 |
- for i in ${BSD_LIBC[@]}; do |
1136 |
- use ${i} && uuid_config="--with-uuid=bsd" |
1137 |
- done |
1138 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
1139 |
- fi |
1140 |
- |
1141 |
- econf \ |
1142 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1143 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1144 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1145 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1146 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1147 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1148 |
- $(use_enable !alpha spinlocks) \ |
1149 |
- $(use_enable debug) \ |
1150 |
- $(use_enable threads thread-safety) \ |
1151 |
- $(use_with icu) \ |
1152 |
- $(use_with kerberos gssapi) \ |
1153 |
- $(use_with ldap) \ |
1154 |
- $(use_with llvm) \ |
1155 |
- $(use_with pam) \ |
1156 |
- $(use_with perl) \ |
1157 |
- $(use_with python) \ |
1158 |
- $(use_with readline) \ |
1159 |
- $(use_with ssl openssl) \ |
1160 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
1161 |
- $(use_with tcl) \ |
1162 |
- ${uuid_config} \ |
1163 |
- $(use_with xml libxml) \ |
1164 |
- $(use_with xml libxslt) \ |
1165 |
- $(use_with zlib) \ |
1166 |
- $(use_enable nls nls "'$(l10n_get_locales)'") |
1167 |
-} |
1168 |
- |
1169 |
-src_compile() { |
1170 |
- emake |
1171 |
- emake -C contrib |
1172 |
-} |
1173 |
- |
1174 |
-src_install() { |
1175 |
- emake DESTDIR="${D}" install |
1176 |
- emake DESTDIR="${D}" install -C contrib |
1177 |
- |
1178 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1179 |
- |
1180 |
- # man pages are already built, but if we have the target make them, |
1181 |
- # they'll be generated from source before being installed so we |
1182 |
- # manually install man pages. |
1183 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1184 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1185 |
- doins -r doc/src/sgml/man{1,3,7} |
1186 |
- if ! use server; then |
1187 |
- # Remove man pages for non-existent binaries |
1188 |
- serverman=( |
1189 |
- initdb |
1190 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
1191 |
- pg_{test_{fsync,timing},upgrade,waldump} |
1192 |
- post{gres,master} |
1193 |
- ) |
1194 |
- for m in ${serverman[@]} ; do |
1195 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1196 |
- done |
1197 |
- fi |
1198 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1199 |
- |
1200 |
- # Create slot specific man pages |
1201 |
- local bn f mansec slotted_name |
1202 |
- for mansec in 1 3 7 ; do |
1203 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
1204 |
- |
1205 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
1206 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
1207 |
- |
1208 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
1209 |
- bn=$(basename "${f}") |
1210 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
1211 |
- case ${bn} in |
1212 |
- TABLE.7|WITH.7) |
1213 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
1214 |
- ;; |
1215 |
- *) |
1216 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
1217 |
- ;; |
1218 |
- esac |
1219 |
- done |
1220 |
- |
1221 |
- popd > /dev/null |
1222 |
- done |
1223 |
- |
1224 |
- insinto /etc/postgresql-${SLOT} |
1225 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1226 |
- |
1227 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
1228 |
- # needed by extensions utilizing PGXS. |
1229 |
- use static-libs || \ |
1230 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
1231 |
- -delete |
1232 |
- |
1233 |
- # Make slot specific links to programs |
1234 |
- local f bn |
1235 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
1236 |
- -mindepth 1 -maxdepth 1) |
1237 |
- do |
1238 |
- bn=$(basename "${f}") |
1239 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
1240 |
- "/usr/bin/${bn}${SLOT/.}" |
1241 |
- done |
1242 |
- |
1243 |
- if use doc ; then |
1244 |
- docinto html |
1245 |
- dodoc doc/src/sgml/html/* |
1246 |
- fi |
1247 |
- |
1248 |
- if use server; then |
1249 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1250 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
1251 |
- |
1252 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1253 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
1254 |
- |
1255 |
- if use systemd; then |
1256 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1257 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
1258 |
- systemd_newunit - ${PN}-${SLOT}.service |
1259 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1260 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
1261 |
- fi |
1262 |
- |
1263 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1264 |
- |
1265 |
- if use prefix ; then |
1266 |
- keepdir /run/postgresql |
1267 |
- fperms 1775 /run/postgresql |
1268 |
- fi |
1269 |
- fi |
1270 |
-} |
1271 |
- |
1272 |
-pkg_postinst() { |
1273 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
1274 |
- postgresql-config update |
1275 |
- |
1276 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1277 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
1278 |
- |
1279 |
- if use server ; then |
1280 |
- elog |
1281 |
- elog "Gentoo specific documentation:" |
1282 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1283 |
- elog |
1284 |
- elog "Official documentation:" |
1285 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
1286 |
- elog |
1287 |
- elog "The default location of the Unix-domain socket is:" |
1288 |
- elog " ${EROOT}/run/postgresql/" |
1289 |
- elog |
1290 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1291 |
- elog "so that it contains your preferred locale in:" |
1292 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1293 |
- elog |
1294 |
- elog "Then, execute the following command to setup the initial database" |
1295 |
- elog "environment:" |
1296 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1297 |
- |
1298 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
1299 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
1300 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
1301 |
- ewarn "the following command after upgrading:" |
1302 |
- ewarn |
1303 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
1304 |
- fi |
1305 |
- fi |
1306 |
-} |
1307 |
- |
1308 |
-pkg_prerm() { |
1309 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1310 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1311 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1312 |
- |
1313 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1314 |
- sleep 10 |
1315 |
- eend 0 |
1316 |
- fi |
1317 |
-} |
1318 |
- |
1319 |
-pkg_postrm() { |
1320 |
- postgresql-config update |
1321 |
-} |
1322 |
- |
1323 |
-pkg_config() { |
1324 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1325 |
- |
1326 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1327 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1328 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
1329 |
- [[ -z "${DATA_DIR}" ]] \ |
1330 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
1331 |
- |
1332 |
- # environment.bz2 may not contain the same locale as the current system |
1333 |
- # locale. Unset and source from the current system locale. |
1334 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
1335 |
- unset LANG |
1336 |
- unset LC_CTYPE |
1337 |
- unset LC_NUMERIC |
1338 |
- unset LC_TIME |
1339 |
- unset LC_COLLATE |
1340 |
- unset LC_MONETARY |
1341 |
- unset LC_MESSAGES |
1342 |
- unset LC_ALL |
1343 |
- source "${EROOT}/etc/env.d/02locale" |
1344 |
- [ -n "${LANG}" ] && export LANG |
1345 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1346 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1347 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1348 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1349 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1350 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1351 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1352 |
- fi |
1353 |
- |
1354 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1355 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1356 |
- einfo |
1357 |
- einfo "Information on options that can be passed to initdb are found at:" |
1358 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1359 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1360 |
- einfo |
1361 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1362 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1363 |
- einfo " (none)" |
1364 |
- else |
1365 |
- einfo " ${PG_INITDB_OPTS}" |
1366 |
- fi |
1367 |
- einfo |
1368 |
- einfo "Configuration files will be installed to:" |
1369 |
- einfo " ${PGDATA}" |
1370 |
- einfo |
1371 |
- einfo "The database cluster will be created in:" |
1372 |
- einfo " ${DATA_DIR}" |
1373 |
- einfo |
1374 |
- |
1375 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
1376 |
- sleep 5 |
1377 |
- eend 0 |
1378 |
- |
1379 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1380 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1381 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1382 |
- die "${DATA_DIR} is not empty." |
1383 |
- fi |
1384 |
- |
1385 |
- einfo "Creating the data directory ..." |
1386 |
- if [[ ${EUID} == 0 ]] ; then |
1387 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
1388 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
1389 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
1390 |
- fi |
1391 |
- |
1392 |
- einfo "Initializing the database ..." |
1393 |
- |
1394 |
- if [[ ${EUID} == 0 ]] ; then |
1395 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1396 |
- else |
1397 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1398 |
- fi |
1399 |
- |
1400 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1401 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1402 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1403 |
- fi |
1404 |
- |
1405 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
1406 |
- # overridden in the initscript |
1407 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
1408 |
- |
1409 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1410 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1411 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1412 |
- # characters in PL/Perl |
1413 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1414 |
- EOF |
1415 |
- |
1416 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1417 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1418 |
- einfo "by default. You can disable it in the cluster's:" |
1419 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1420 |
- einfo |
1421 |
- if ! use systemd; then |
1422 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1423 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1424 |
- einfo |
1425 |
- fi |
1426 |
- if use prefix ; then |
1427 |
- einfo "The location of the configuration files have moved to:" |
1428 |
- einfo " ${PGDATA}" |
1429 |
- einfo "To start the server:" |
1430 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1431 |
- einfo "To stop:" |
1432 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1433 |
- einfo |
1434 |
- einfo "Or move the configuration files back:" |
1435 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1436 |
- elif use systemd; then |
1437 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
1438 |
- einfo "instead of 'pg_ctl'." |
1439 |
- else |
1440 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1441 |
- einfo "instead of 'pg_ctl'." |
1442 |
- fi |
1443 |
-} |
1444 |
- |
1445 |
-src_test() { |
1446 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
1447 |
- emake check |
1448 |
- |
1449 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
1450 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
1451 |
- else |
1452 |
- use server || \ |
1453 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
1454 |
- [[ ${UID} -eq 0 ]] || \ |
1455 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
1456 |
- |
1457 |
- ewarn 'Skipping.' |
1458 |
- fi |
1459 |
-} |
1460 |
|
1461 |
diff --git a/dev-db/postgresql/postgresql-11.8.ebuild b/dev-db/postgresql/postgresql-11.8.ebuild |
1462 |
deleted file mode 100644 |
1463 |
index e17cfba0e92..00000000000 |
1464 |
--- a/dev-db/postgresql/postgresql-11.8.ebuild |
1465 |
+++ /dev/null |
1466 |
@@ -1,458 +0,0 @@ |
1467 |
-# Copyright 1999-2020 Gentoo Authors |
1468 |
-# Distributed under the terms of the GNU General Public License v2 |
1469 |
- |
1470 |
-EAPI=7 |
1471 |
- |
1472 |
-PYTHON_COMPAT=( python3_{6,7} ) |
1473 |
- |
1474 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd |
1475 |
- |
1476 |
-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" |
1477 |
- |
1478 |
-SLOT=$(ver_cut 1) |
1479 |
- |
1480 |
-MY_PV=${PV/_/} |
1481 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
1482 |
- |
1483 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
1484 |
- |
1485 |
-LICENSE="POSTGRESQL GPL-2" |
1486 |
-DESCRIPTION="PostgreSQL RDBMS" |
1487 |
-HOMEPAGE="https://www.postgresql.org/" |
1488 |
- |
1489 |
-IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam |
1490 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
1491 |
- threads uuid xml zlib" |
1492 |
- |
1493 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1494 |
- |
1495 |
-CDEPEND=" |
1496 |
->=app-eselect/eselect-postgresql-2.0 |
1497 |
-acct-group/postgres |
1498 |
-acct-user/postgres |
1499 |
-sys-apps/less |
1500 |
-virtual/libintl |
1501 |
-icu? ( dev-libs/icu:= ) |
1502 |
-kerberos? ( virtual/krb5 ) |
1503 |
-ldap? ( net-nds/openldap ) |
1504 |
-llvm? ( |
1505 |
- sys-devel/llvm:= |
1506 |
- sys-devel/clang:= |
1507 |
-) |
1508 |
-pam? ( sys-libs/pam ) |
1509 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1510 |
-python? ( ${PYTHON_DEPS} ) |
1511 |
-readline? ( sys-libs/readline:0= ) |
1512 |
-server? ( systemd? ( sys-apps/systemd ) ) |
1513 |
-ssl? ( |
1514 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1515 |
- libressl? ( dev-libs/libressl:= ) |
1516 |
-) |
1517 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1518 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1519 |
-zlib? ( sys-libs/zlib ) |
1520 |
-" |
1521 |
- |
1522 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
1523 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
1524 |
-# the libc includes UUID functions. |
1525 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
1526 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
1527 |
- |
1528 |
-nest_usedep() { |
1529 |
- local front back |
1530 |
- while [[ ${#} -gt 1 ]]; do |
1531 |
- front+="${1}? ( " |
1532 |
- back+=" )" |
1533 |
- shift |
1534 |
- done |
1535 |
- echo "${front}${1}${back}" |
1536 |
-} |
1537 |
- |
1538 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
1539 |
-CDEPEND+=" |
1540 |
-uuid? ( |
1541 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
1542 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
1543 |
-)" |
1544 |
- |
1545 |
-DEPEND="${CDEPEND} |
1546 |
-sys-devel/bison |
1547 |
-sys-devel/flex |
1548 |
-nls? ( sys-devel/gettext ) |
1549 |
-xml? ( virtual/pkgconfig ) |
1550 |
-" |
1551 |
- |
1552 |
-RDEPEND="${CDEPEND} |
1553 |
-selinux? ( sec-policy/selinux-postgresql ) |
1554 |
-" |
1555 |
- |
1556 |
-pkg_setup() { |
1557 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1558 |
- |
1559 |
- use python && python-single-r1_pkg_setup |
1560 |
-} |
1561 |
- |
1562 |
-src_prepare() { |
1563 |
- # Set proper run directory |
1564 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1565 |
- -i src/include/pg_config_manual.h || die |
1566 |
- |
1567 |
- # Rely on $PATH being in the proper order so that the correct |
1568 |
- # install program is used for modules utilizing PGXS in both |
1569 |
- # hardened and non-hardened environments. (Bug #528786) |
1570 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
1571 |
- |
1572 |
- use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch" |
1573 |
- |
1574 |
- if use pam ; then |
1575 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1576 |
- -i src/backend/libpq/auth.c || \ |
1577 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1578 |
- fi |
1579 |
- |
1580 |
- eapply_user |
1581 |
-} |
1582 |
- |
1583 |
-src_configure() { |
1584 |
- case ${CHOST} in |
1585 |
- *-darwin*|*-solaris*) |
1586 |
- use nls && append-libs intl |
1587 |
- ;; |
1588 |
- esac |
1589 |
- |
1590 |
- export LDFLAGS_SL="${LDFLAGS}" |
1591 |
- export LDFLAGS_EX="${LDFLAGS}" |
1592 |
- |
1593 |
- local PO="${EPREFIX}" |
1594 |
- |
1595 |
- local i uuid_config="" |
1596 |
- if use uuid; then |
1597 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
1598 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
1599 |
- done |
1600 |
- for i in ${BSD_LIBC[@]}; do |
1601 |
- use ${i} && uuid_config="--with-uuid=bsd" |
1602 |
- done |
1603 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
1604 |
- fi |
1605 |
- |
1606 |
- econf \ |
1607 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1608 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1609 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1610 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1611 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1612 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1613 |
- $(use_enable !alpha spinlocks) \ |
1614 |
- $(use_enable debug) \ |
1615 |
- $(use_enable threads thread-safety) \ |
1616 |
- $(use_with icu) \ |
1617 |
- $(use_with kerberos gssapi) \ |
1618 |
- $(use_with ldap) \ |
1619 |
- $(use_with llvm) \ |
1620 |
- $(use_with pam) \ |
1621 |
- $(use_with perl) \ |
1622 |
- $(use_with python) \ |
1623 |
- $(use_with readline) \ |
1624 |
- $(use_with ssl openssl) \ |
1625 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
1626 |
- $(use_with tcl) \ |
1627 |
- ${uuid_config} \ |
1628 |
- $(use_with xml libxml) \ |
1629 |
- $(use_with xml libxslt) \ |
1630 |
- $(use_with zlib) \ |
1631 |
- $(use_enable nls) |
1632 |
-} |
1633 |
- |
1634 |
-src_compile() { |
1635 |
- emake |
1636 |
- emake -C contrib |
1637 |
-} |
1638 |
- |
1639 |
-src_install() { |
1640 |
- emake DESTDIR="${D}" install |
1641 |
- emake DESTDIR="${D}" install -C contrib |
1642 |
- |
1643 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1644 |
- |
1645 |
- # man pages are already built, but if we have the target make them, |
1646 |
- # they'll be generated from source before being installed so we |
1647 |
- # manually install man pages. |
1648 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1649 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1650 |
- doins -r doc/src/sgml/man{1,3,7} |
1651 |
- if ! use server; then |
1652 |
- # Remove man pages for non-existent binaries |
1653 |
- serverman=( |
1654 |
- initdb |
1655 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
1656 |
- pg_{test_{fsync,timing},upgrade,waldump} |
1657 |
- post{gres,master} |
1658 |
- ) |
1659 |
- for m in ${serverman[@]} ; do |
1660 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1661 |
- done |
1662 |
- fi |
1663 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1664 |
- |
1665 |
- # Create slot specific man pages |
1666 |
- local bn f mansec slotted_name |
1667 |
- for mansec in 1 3 7 ; do |
1668 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
1669 |
- |
1670 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
1671 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
1672 |
- |
1673 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
1674 |
- bn=$(basename "${f}") |
1675 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
1676 |
- case ${bn} in |
1677 |
- TABLE.7|WITH.7) |
1678 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
1679 |
- ;; |
1680 |
- *) |
1681 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
1682 |
- ;; |
1683 |
- esac |
1684 |
- done |
1685 |
- |
1686 |
- popd > /dev/null |
1687 |
- done |
1688 |
- |
1689 |
- insinto /etc/postgresql-${SLOT} |
1690 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1691 |
- |
1692 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
1693 |
- # needed by extensions utilizing PGXS. |
1694 |
- use static-libs || \ |
1695 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
1696 |
- -delete |
1697 |
- |
1698 |
- # Make slot specific links to programs |
1699 |
- local f bn |
1700 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
1701 |
- -mindepth 1 -maxdepth 1) |
1702 |
- do |
1703 |
- bn=$(basename "${f}") |
1704 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
1705 |
- "/usr/bin/${bn}${SLOT/.}" |
1706 |
- done |
1707 |
- |
1708 |
- if use doc ; then |
1709 |
- docinto html |
1710 |
- dodoc doc/src/sgml/html/* |
1711 |
- fi |
1712 |
- |
1713 |
- if use server; then |
1714 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1715 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
1716 |
- |
1717 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1718 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
1719 |
- |
1720 |
- if use systemd; then |
1721 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1722 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
1723 |
- systemd_newunit - ${PN}-${SLOT}.service |
1724 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1725 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
1726 |
- fi |
1727 |
- |
1728 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1729 |
- |
1730 |
- if use prefix ; then |
1731 |
- keepdir /run/postgresql |
1732 |
- fperms 1775 /run/postgresql |
1733 |
- fi |
1734 |
- fi |
1735 |
-} |
1736 |
- |
1737 |
-pkg_postinst() { |
1738 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
1739 |
- postgresql-config update |
1740 |
- |
1741 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1742 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
1743 |
- |
1744 |
- if use server ; then |
1745 |
- elog |
1746 |
- elog "Gentoo specific documentation:" |
1747 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1748 |
- elog |
1749 |
- elog "Official documentation:" |
1750 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
1751 |
- elog |
1752 |
- elog "The default location of the Unix-domain socket is:" |
1753 |
- elog " ${EROOT}/run/postgresql/" |
1754 |
- elog |
1755 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1756 |
- elog "so that it contains your preferred locale in:" |
1757 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1758 |
- elog |
1759 |
- elog "Then, execute the following command to setup the initial database" |
1760 |
- elog "environment:" |
1761 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1762 |
- |
1763 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
1764 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
1765 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
1766 |
- ewarn "the following command after upgrading:" |
1767 |
- ewarn |
1768 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
1769 |
- fi |
1770 |
- fi |
1771 |
-} |
1772 |
- |
1773 |
-pkg_prerm() { |
1774 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1775 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1776 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1777 |
- |
1778 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1779 |
- sleep 10 |
1780 |
- eend 0 |
1781 |
- fi |
1782 |
-} |
1783 |
- |
1784 |
-pkg_postrm() { |
1785 |
- postgresql-config update |
1786 |
-} |
1787 |
- |
1788 |
-pkg_config() { |
1789 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1790 |
- |
1791 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1792 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1793 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
1794 |
- [[ -z "${DATA_DIR}" ]] \ |
1795 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
1796 |
- |
1797 |
- # environment.bz2 may not contain the same locale as the current system |
1798 |
- # locale. Unset and source from the current system locale. |
1799 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
1800 |
- unset LANG |
1801 |
- unset LC_CTYPE |
1802 |
- unset LC_NUMERIC |
1803 |
- unset LC_TIME |
1804 |
- unset LC_COLLATE |
1805 |
- unset LC_MONETARY |
1806 |
- unset LC_MESSAGES |
1807 |
- unset LC_ALL |
1808 |
- source "${EROOT}/etc/env.d/02locale" |
1809 |
- [ -n "${LANG}" ] && export LANG |
1810 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1811 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1812 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1813 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1814 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1815 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1816 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1817 |
- fi |
1818 |
- |
1819 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1820 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
1821 |
- einfo |
1822 |
- einfo "Information on options that can be passed to initdb are found at:" |
1823 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1824 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1825 |
- einfo |
1826 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1827 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1828 |
- einfo " (none)" |
1829 |
- else |
1830 |
- einfo " ${PG_INITDB_OPTS}" |
1831 |
- fi |
1832 |
- einfo |
1833 |
- einfo "Configuration files will be installed to:" |
1834 |
- einfo " ${PGDATA}" |
1835 |
- einfo |
1836 |
- einfo "The database cluster will be created in:" |
1837 |
- einfo " ${DATA_DIR}" |
1838 |
- einfo |
1839 |
- |
1840 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
1841 |
- sleep 5 |
1842 |
- eend 0 |
1843 |
- |
1844 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1845 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1846 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1847 |
- die "${DATA_DIR} is not empty." |
1848 |
- fi |
1849 |
- |
1850 |
- einfo "Creating the data directory ..." |
1851 |
- if [[ ${EUID} == 0 ]] ; then |
1852 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
1853 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
1854 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
1855 |
- fi |
1856 |
- |
1857 |
- einfo "Initializing the database ..." |
1858 |
- |
1859 |
- if [[ ${EUID} == 0 ]] ; then |
1860 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1861 |
- else |
1862 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1863 |
- fi |
1864 |
- |
1865 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1866 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1867 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1868 |
- fi |
1869 |
- |
1870 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
1871 |
- # overridden in the initscript |
1872 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
1873 |
- |
1874 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1875 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1876 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1877 |
- # characters in PL/Perl |
1878 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1879 |
- EOF |
1880 |
- |
1881 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1882 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1883 |
- einfo "by default. You can disable it in the cluster's:" |
1884 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1885 |
- einfo |
1886 |
- if ! use systemd; then |
1887 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1888 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1889 |
- einfo |
1890 |
- fi |
1891 |
- if use prefix ; then |
1892 |
- einfo "The location of the configuration files have moved to:" |
1893 |
- einfo " ${PGDATA}" |
1894 |
- einfo "To start the server:" |
1895 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1896 |
- einfo "To stop:" |
1897 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1898 |
- einfo |
1899 |
- einfo "Or move the configuration files back:" |
1900 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1901 |
- elif use systemd; then |
1902 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
1903 |
- einfo "instead of 'pg_ctl'." |
1904 |
- else |
1905 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1906 |
- einfo "instead of 'pg_ctl'." |
1907 |
- fi |
1908 |
-} |
1909 |
- |
1910 |
-src_test() { |
1911 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
1912 |
- emake check |
1913 |
- |
1914 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
1915 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
1916 |
- else |
1917 |
- use server || \ |
1918 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
1919 |
- [[ ${UID} -eq 0 ]] || \ |
1920 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
1921 |
- |
1922 |
- ewarn 'Skipping.' |
1923 |
- fi |
1924 |
-} |
1925 |
|
1926 |
diff --git a/dev-db/postgresql/postgresql-12.2.ebuild b/dev-db/postgresql/postgresql-12.2.ebuild |
1927 |
deleted file mode 100644 |
1928 |
index b6592df117f..00000000000 |
1929 |
--- a/dev-db/postgresql/postgresql-12.2.ebuild |
1930 |
+++ /dev/null |
1931 |
@@ -1,467 +0,0 @@ |
1932 |
-# Copyright 1999-2020 Gentoo Authors |
1933 |
-# Distributed under the terms of the GNU General Public License v2 |
1934 |
- |
1935 |
-EAPI=7 |
1936 |
- |
1937 |
-PYTHON_COMPAT=( python3_{6,7} ) |
1938 |
- |
1939 |
-PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN |
1940 |
- zh_TW" |
1941 |
- |
1942 |
-inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ |
1943 |
- systemd user |
1944 |
- |
1945 |
-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" |
1946 |
- |
1947 |
-SLOT=$(ver_cut 1) |
1948 |
- |
1949 |
-MY_PV=${PV/_/} |
1950 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
1951 |
- |
1952 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
1953 |
- |
1954 |
-LICENSE="POSTGRESQL GPL-2" |
1955 |
-DESCRIPTION="PostgreSQL RDBMS" |
1956 |
-HOMEPAGE="https://www.postgresql.org/" |
1957 |
- |
1958 |
-IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam |
1959 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
1960 |
- threads uuid xml zlib" |
1961 |
- |
1962 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
1963 |
- |
1964 |
-CDEPEND=" |
1965 |
->=app-eselect/eselect-postgresql-2.0 |
1966 |
-sys-apps/less |
1967 |
-virtual/libintl |
1968 |
-icu? ( dev-libs/icu:= ) |
1969 |
-kerberos? ( virtual/krb5 ) |
1970 |
-ldap? ( net-nds/openldap ) |
1971 |
-llvm? ( |
1972 |
- sys-devel/llvm:= |
1973 |
- sys-devel/clang:= |
1974 |
-) |
1975 |
-pam? ( sys-libs/pam ) |
1976 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1977 |
-python? ( ${PYTHON_DEPS} ) |
1978 |
-readline? ( sys-libs/readline:0= ) |
1979 |
-server? ( systemd? ( sys-apps/systemd ) ) |
1980 |
-ssl? ( |
1981 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1982 |
- libressl? ( dev-libs/libressl:= ) |
1983 |
-) |
1984 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1985 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1986 |
-zlib? ( sys-libs/zlib ) |
1987 |
-" |
1988 |
- |
1989 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
1990 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
1991 |
-# the libc includes UUID functions. |
1992 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
1993 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
1994 |
- |
1995 |
-nest_usedep() { |
1996 |
- local front back |
1997 |
- while [[ ${#} -gt 1 ]]; do |
1998 |
- front+="${1}? ( " |
1999 |
- back+=" )" |
2000 |
- shift |
2001 |
- done |
2002 |
- echo "${front}${1}${back}" |
2003 |
-} |
2004 |
- |
2005 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
2006 |
-CDEPEND+=" |
2007 |
-uuid? ( |
2008 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
2009 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
2010 |
-)" |
2011 |
- |
2012 |
-DEPEND="${CDEPEND} |
2013 |
-!!<sys-apps/sandbox-2.0 |
2014 |
-sys-devel/bison |
2015 |
-sys-devel/flex |
2016 |
-nls? ( sys-devel/gettext ) |
2017 |
-xml? ( virtual/pkgconfig ) |
2018 |
-" |
2019 |
- |
2020 |
-RDEPEND="${CDEPEND} |
2021 |
-!dev-db/postgresql-docs:${SLOT} |
2022 |
-!dev-db/postgresql-base:${SLOT} |
2023 |
-!dev-db/postgresql-server:${SLOT} |
2024 |
-selinux? ( sec-policy/selinux-postgresql ) |
2025 |
-" |
2026 |
- |
2027 |
-pkg_setup() { |
2028 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2029 |
- |
2030 |
- enewgroup postgres 70 |
2031 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
2032 |
- |
2033 |
- use python && python-single-r1_pkg_setup |
2034 |
-} |
2035 |
- |
2036 |
-src_prepare() { |
2037 |
- # Set proper run directory |
2038 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2039 |
- -i src/include/pg_config_manual.h || die |
2040 |
- |
2041 |
- # Rely on $PATH being in the proper order so that the correct |
2042 |
- # install program is used for modules utilizing PGXS in both |
2043 |
- # hardened and non-hardened environments. (Bug #528786) |
2044 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
2045 |
- |
2046 |
- use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch" |
2047 |
- |
2048 |
- if use pam ; then |
2049 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2050 |
- -i src/backend/libpq/auth.c || \ |
2051 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2052 |
- fi |
2053 |
- |
2054 |
- eapply_user |
2055 |
-} |
2056 |
- |
2057 |
-src_configure() { |
2058 |
- case ${CHOST} in |
2059 |
- *-darwin*|*-solaris*) |
2060 |
- use nls && append-libs intl |
2061 |
- ;; |
2062 |
- esac |
2063 |
- |
2064 |
- export LDFLAGS_SL="${LDFLAGS}" |
2065 |
- export LDFLAGS_EX="${LDFLAGS}" |
2066 |
- |
2067 |
- local PO="${EPREFIX}" |
2068 |
- |
2069 |
- local i uuid_config="" |
2070 |
- if use uuid; then |
2071 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
2072 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
2073 |
- done |
2074 |
- for i in ${BSD_LIBC[@]}; do |
2075 |
- use ${i} && uuid_config="--with-uuid=bsd" |
2076 |
- done |
2077 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
2078 |
- fi |
2079 |
- |
2080 |
- econf \ |
2081 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2082 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2083 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2084 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2085 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2086 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2087 |
- $(use_enable !alpha spinlocks) \ |
2088 |
- $(use_enable debug) \ |
2089 |
- $(use_enable threads thread-safety) \ |
2090 |
- $(use_with icu) \ |
2091 |
- $(use_with kerberos gssapi) \ |
2092 |
- $(use_with ldap) \ |
2093 |
- $(use_with llvm) \ |
2094 |
- $(use_with pam) \ |
2095 |
- $(use_with perl) \ |
2096 |
- $(use_with python) \ |
2097 |
- $(use_with readline) \ |
2098 |
- $(use_with ssl openssl) \ |
2099 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
2100 |
- $(use_with tcl) \ |
2101 |
- ${uuid_config} \ |
2102 |
- $(use_with xml libxml) \ |
2103 |
- $(use_with xml libxslt) \ |
2104 |
- $(use_with zlib) \ |
2105 |
- $(use_enable nls nls "'$(l10n_get_locales)'") |
2106 |
-} |
2107 |
- |
2108 |
-src_compile() { |
2109 |
- emake |
2110 |
- emake -C contrib |
2111 |
-} |
2112 |
- |
2113 |
-src_install() { |
2114 |
- emake DESTDIR="${D}" install |
2115 |
- emake DESTDIR="${D}" install -C contrib |
2116 |
- |
2117 |
- dodoc README HISTORY |
2118 |
- |
2119 |
- # man pages are already built, but if we have the target make them, |
2120 |
- # they'll be generated from source before being installed so we |
2121 |
- # manually install man pages. |
2122 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2123 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2124 |
- doins -r doc/src/sgml/man{1,3,7} |
2125 |
- if ! use server; then |
2126 |
- # Remove man pages for non-existent binaries |
2127 |
- serverman=( |
2128 |
- initdb |
2129 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
2130 |
- pg_{test_{fsync,timing},upgrade,waldump} |
2131 |
- post{gres,master} |
2132 |
- ) |
2133 |
- for m in ${serverman[@]} ; do |
2134 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2135 |
- done |
2136 |
- fi |
2137 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2138 |
- |
2139 |
- # Create slot specific man pages |
2140 |
- local bn f mansec slotted_name |
2141 |
- for mansec in 1 3 7 ; do |
2142 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
2143 |
- |
2144 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
2145 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
2146 |
- |
2147 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
2148 |
- bn=$(basename "${f}") |
2149 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
2150 |
- case ${bn} in |
2151 |
- TABLE.7|WITH.7) |
2152 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
2153 |
- ;; |
2154 |
- *) |
2155 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
2156 |
- ;; |
2157 |
- esac |
2158 |
- done |
2159 |
- |
2160 |
- popd > /dev/null |
2161 |
- done |
2162 |
- |
2163 |
- insinto /etc/postgresql-${SLOT} |
2164 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2165 |
- |
2166 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
2167 |
- # needed by extensions utilizing PGXS. |
2168 |
- use static-libs || \ |
2169 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
2170 |
- -delete |
2171 |
- |
2172 |
- # Make slot specific links to programs |
2173 |
- local f bn |
2174 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
2175 |
- -mindepth 1 -maxdepth 1) |
2176 |
- do |
2177 |
- bn=$(basename "${f}") |
2178 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
2179 |
- "/usr/bin/${bn}${SLOT/.}" |
2180 |
- done |
2181 |
- |
2182 |
- if use doc ; then |
2183 |
- docinto html |
2184 |
- dodoc doc/src/sgml/html/* |
2185 |
- fi |
2186 |
- |
2187 |
- if use server; then |
2188 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2189 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
2190 |
- |
2191 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2192 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
2193 |
- |
2194 |
- if use systemd; then |
2195 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2196 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
2197 |
- systemd_newunit - ${PN}-${SLOT}.service |
2198 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2199 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
2200 |
- fi |
2201 |
- |
2202 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2203 |
- |
2204 |
- if use prefix ; then |
2205 |
- keepdir /run/postgresql |
2206 |
- fperms 1775 /run/postgresql |
2207 |
- fi |
2208 |
- fi |
2209 |
-} |
2210 |
- |
2211 |
-pkg_postinst() { |
2212 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
2213 |
- postgresql-config update |
2214 |
- |
2215 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2216 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
2217 |
- |
2218 |
- if use server ; then |
2219 |
- elog |
2220 |
- elog "Gentoo specific documentation:" |
2221 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2222 |
- elog |
2223 |
- elog "Official documentation:" |
2224 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
2225 |
- elog |
2226 |
- elog "The default location of the Unix-domain socket is:" |
2227 |
- elog " ${EROOT}/run/postgresql/" |
2228 |
- elog |
2229 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2230 |
- elog "so that it contains your preferred locale in:" |
2231 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2232 |
- elog |
2233 |
- elog "Then, execute the following command to setup the initial database" |
2234 |
- elog "environment:" |
2235 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2236 |
- |
2237 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
2238 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
2239 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
2240 |
- ewarn "the following command after upgrading:" |
2241 |
- ewarn |
2242 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
2243 |
- fi |
2244 |
- fi |
2245 |
-} |
2246 |
- |
2247 |
-pkg_prerm() { |
2248 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2249 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2250 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2251 |
- |
2252 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2253 |
- sleep 10 |
2254 |
- eend 0 |
2255 |
- fi |
2256 |
-} |
2257 |
- |
2258 |
-pkg_postrm() { |
2259 |
- postgresql-config update |
2260 |
-} |
2261 |
- |
2262 |
-pkg_config() { |
2263 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2264 |
- |
2265 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2266 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2267 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
2268 |
- [[ -z "${DATA_DIR}" ]] \ |
2269 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
2270 |
- |
2271 |
- # environment.bz2 may not contain the same locale as the current system |
2272 |
- # locale. Unset and source from the current system locale. |
2273 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
2274 |
- unset LANG |
2275 |
- unset LC_CTYPE |
2276 |
- unset LC_NUMERIC |
2277 |
- unset LC_TIME |
2278 |
- unset LC_COLLATE |
2279 |
- unset LC_MONETARY |
2280 |
- unset LC_MESSAGES |
2281 |
- unset LC_ALL |
2282 |
- source "${EROOT}/etc/env.d/02locale" |
2283 |
- [ -n "${LANG}" ] && export LANG |
2284 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2285 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2286 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2287 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2288 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2289 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2290 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2291 |
- fi |
2292 |
- |
2293 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2294 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2295 |
- einfo |
2296 |
- einfo "Information on options that can be passed to initdb are found at:" |
2297 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2298 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2299 |
- einfo |
2300 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2301 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2302 |
- einfo " (none)" |
2303 |
- else |
2304 |
- einfo " ${PG_INITDB_OPTS}" |
2305 |
- fi |
2306 |
- einfo |
2307 |
- einfo "Configuration files will be installed to:" |
2308 |
- einfo " ${PGDATA}" |
2309 |
- einfo |
2310 |
- einfo "The database cluster will be created in:" |
2311 |
- einfo " ${DATA_DIR}" |
2312 |
- einfo |
2313 |
- |
2314 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
2315 |
- sleep 5 |
2316 |
- eend 0 |
2317 |
- |
2318 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2319 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2320 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2321 |
- die "${DATA_DIR} is not empty." |
2322 |
- fi |
2323 |
- |
2324 |
- einfo "Creating the data directory ..." |
2325 |
- if [[ ${EUID} == 0 ]] ; then |
2326 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
2327 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
2328 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
2329 |
- fi |
2330 |
- |
2331 |
- einfo "Initializing the database ..." |
2332 |
- |
2333 |
- if [[ ${EUID} == 0 ]] ; then |
2334 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2335 |
- else |
2336 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2337 |
- fi |
2338 |
- |
2339 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2340 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2341 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2342 |
- fi |
2343 |
- |
2344 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
2345 |
- # overridden in the initscript |
2346 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
2347 |
- |
2348 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2349 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2350 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2351 |
- # characters in PL/Perl |
2352 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2353 |
- EOF |
2354 |
- |
2355 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2356 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2357 |
- einfo "by default. You can disable it in the cluster's:" |
2358 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2359 |
- einfo |
2360 |
- if ! use systemd; then |
2361 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2362 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2363 |
- einfo |
2364 |
- fi |
2365 |
- if use prefix ; then |
2366 |
- einfo "The location of the configuration files have moved to:" |
2367 |
- einfo " ${PGDATA}" |
2368 |
- einfo "To start the server:" |
2369 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2370 |
- einfo "To stop:" |
2371 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2372 |
- einfo |
2373 |
- einfo "Or move the configuration files back:" |
2374 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2375 |
- elif use systemd; then |
2376 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
2377 |
- einfo "instead of 'pg_ctl'." |
2378 |
- else |
2379 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2380 |
- einfo "instead of 'pg_ctl'." |
2381 |
- fi |
2382 |
-} |
2383 |
- |
2384 |
-src_test() { |
2385 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2386 |
- emake check |
2387 |
- |
2388 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2389 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2390 |
- else |
2391 |
- use server || \ |
2392 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2393 |
- [[ ${UID} -eq 0 ]] || \ |
2394 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2395 |
- |
2396 |
- ewarn 'Skipping.' |
2397 |
- fi |
2398 |
-} |
2399 |
|
2400 |
diff --git a/dev-db/postgresql/postgresql-12.3.ebuild b/dev-db/postgresql/postgresql-12.3.ebuild |
2401 |
deleted file mode 100644 |
2402 |
index cfae19554b2..00000000000 |
2403 |
--- a/dev-db/postgresql/postgresql-12.3.ebuild |
2404 |
+++ /dev/null |
2405 |
@@ -1,458 +0,0 @@ |
2406 |
-# Copyright 1999-2020 Gentoo Authors |
2407 |
-# Distributed under the terms of the GNU General Public License v2 |
2408 |
- |
2409 |
-EAPI=7 |
2410 |
- |
2411 |
-PYTHON_COMPAT=( python3_{6,7} ) |
2412 |
- |
2413 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd |
2414 |
- |
2415 |
-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" |
2416 |
- |
2417 |
-SLOT=$(ver_cut 1) |
2418 |
- |
2419 |
-MY_PV=${PV/_/} |
2420 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
2421 |
- |
2422 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
2423 |
- |
2424 |
-LICENSE="POSTGRESQL GPL-2" |
2425 |
-DESCRIPTION="PostgreSQL RDBMS" |
2426 |
-HOMEPAGE="https://www.postgresql.org/" |
2427 |
- |
2428 |
-IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam |
2429 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
2430 |
- threads uuid xml zlib" |
2431 |
- |
2432 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
2433 |
- |
2434 |
-CDEPEND=" |
2435 |
->=app-eselect/eselect-postgresql-2.0 |
2436 |
-acct-group/postgres |
2437 |
-acct-user/postgres |
2438 |
-sys-apps/less |
2439 |
-virtual/libintl |
2440 |
-icu? ( dev-libs/icu:= ) |
2441 |
-kerberos? ( virtual/krb5 ) |
2442 |
-ldap? ( net-nds/openldap ) |
2443 |
-llvm? ( |
2444 |
- sys-devel/llvm:= |
2445 |
- sys-devel/clang:= |
2446 |
-) |
2447 |
-pam? ( sys-libs/pam ) |
2448 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2449 |
-python? ( ${PYTHON_DEPS} ) |
2450 |
-readline? ( sys-libs/readline:0= ) |
2451 |
-server? ( systemd? ( sys-apps/systemd ) ) |
2452 |
-ssl? ( |
2453 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2454 |
- libressl? ( dev-libs/libressl:= ) |
2455 |
-) |
2456 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2457 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2458 |
-zlib? ( sys-libs/zlib ) |
2459 |
-" |
2460 |
- |
2461 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
2462 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
2463 |
-# the libc includes UUID functions. |
2464 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
2465 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
2466 |
- |
2467 |
-nest_usedep() { |
2468 |
- local front back |
2469 |
- while [[ ${#} -gt 1 ]]; do |
2470 |
- front+="${1}? ( " |
2471 |
- back+=" )" |
2472 |
- shift |
2473 |
- done |
2474 |
- echo "${front}${1}${back}" |
2475 |
-} |
2476 |
- |
2477 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
2478 |
-CDEPEND+=" |
2479 |
-uuid? ( |
2480 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
2481 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
2482 |
-)" |
2483 |
- |
2484 |
-DEPEND="${CDEPEND} |
2485 |
-sys-devel/bison |
2486 |
-sys-devel/flex |
2487 |
-nls? ( sys-devel/gettext ) |
2488 |
-xml? ( virtual/pkgconfig ) |
2489 |
-" |
2490 |
- |
2491 |
-RDEPEND="${CDEPEND} |
2492 |
-selinux? ( sec-policy/selinux-postgresql ) |
2493 |
-" |
2494 |
- |
2495 |
-pkg_setup() { |
2496 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2497 |
- |
2498 |
- use python && python-single-r1_pkg_setup |
2499 |
-} |
2500 |
- |
2501 |
-src_prepare() { |
2502 |
- # Set proper run directory |
2503 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2504 |
- -i src/include/pg_config_manual.h || die |
2505 |
- |
2506 |
- # Rely on $PATH being in the proper order so that the correct |
2507 |
- # install program is used for modules utilizing PGXS in both |
2508 |
- # hardened and non-hardened environments. (Bug #528786) |
2509 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
2510 |
- |
2511 |
- use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch" |
2512 |
- |
2513 |
- if use pam ; then |
2514 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2515 |
- -i src/backend/libpq/auth.c || \ |
2516 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2517 |
- fi |
2518 |
- |
2519 |
- eapply_user |
2520 |
-} |
2521 |
- |
2522 |
-src_configure() { |
2523 |
- case ${CHOST} in |
2524 |
- *-darwin*|*-solaris*) |
2525 |
- use nls && append-libs intl |
2526 |
- ;; |
2527 |
- esac |
2528 |
- |
2529 |
- export LDFLAGS_SL="${LDFLAGS}" |
2530 |
- export LDFLAGS_EX="${LDFLAGS}" |
2531 |
- |
2532 |
- local PO="${EPREFIX}" |
2533 |
- |
2534 |
- local i uuid_config="" |
2535 |
- if use uuid; then |
2536 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
2537 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
2538 |
- done |
2539 |
- for i in ${BSD_LIBC[@]}; do |
2540 |
- use ${i} && uuid_config="--with-uuid=bsd" |
2541 |
- done |
2542 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
2543 |
- fi |
2544 |
- |
2545 |
- econf \ |
2546 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2547 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2548 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2549 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2550 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2551 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2552 |
- $(use_enable !alpha spinlocks) \ |
2553 |
- $(use_enable debug) \ |
2554 |
- $(use_enable threads thread-safety) \ |
2555 |
- $(use_with icu) \ |
2556 |
- $(use_with kerberos gssapi) \ |
2557 |
- $(use_with ldap) \ |
2558 |
- $(use_with llvm) \ |
2559 |
- $(use_with pam) \ |
2560 |
- $(use_with perl) \ |
2561 |
- $(use_with python) \ |
2562 |
- $(use_with readline) \ |
2563 |
- $(use_with ssl openssl) \ |
2564 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
2565 |
- $(use_with tcl) \ |
2566 |
- ${uuid_config} \ |
2567 |
- $(use_with xml libxml) \ |
2568 |
- $(use_with xml libxslt) \ |
2569 |
- $(use_with zlib) \ |
2570 |
- $(use_enable nls) |
2571 |
-} |
2572 |
- |
2573 |
-src_compile() { |
2574 |
- emake |
2575 |
- emake -C contrib |
2576 |
-} |
2577 |
- |
2578 |
-src_install() { |
2579 |
- emake DESTDIR="${D}" install |
2580 |
- emake DESTDIR="${D}" install -C contrib |
2581 |
- |
2582 |
- dodoc README HISTORY |
2583 |
- |
2584 |
- # man pages are already built, but if we have the target make them, |
2585 |
- # they'll be generated from source before being installed so we |
2586 |
- # manually install man pages. |
2587 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2588 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2589 |
- doins -r doc/src/sgml/man{1,3,7} |
2590 |
- if ! use server; then |
2591 |
- # Remove man pages for non-existent binaries |
2592 |
- serverman=( |
2593 |
- initdb |
2594 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
2595 |
- pg_{test_{fsync,timing},upgrade,waldump} |
2596 |
- post{gres,master} |
2597 |
- ) |
2598 |
- for m in ${serverman[@]} ; do |
2599 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2600 |
- done |
2601 |
- fi |
2602 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2603 |
- |
2604 |
- # Create slot specific man pages |
2605 |
- local bn f mansec slotted_name |
2606 |
- for mansec in 1 3 7 ; do |
2607 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
2608 |
- |
2609 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
2610 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
2611 |
- |
2612 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
2613 |
- bn=$(basename "${f}") |
2614 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
2615 |
- case ${bn} in |
2616 |
- TABLE.7|WITH.7) |
2617 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
2618 |
- ;; |
2619 |
- *) |
2620 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
2621 |
- ;; |
2622 |
- esac |
2623 |
- done |
2624 |
- |
2625 |
- popd > /dev/null |
2626 |
- done |
2627 |
- |
2628 |
- insinto /etc/postgresql-${SLOT} |
2629 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2630 |
- |
2631 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
2632 |
- # needed by extensions utilizing PGXS. |
2633 |
- use static-libs || \ |
2634 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
2635 |
- -delete |
2636 |
- |
2637 |
- # Make slot specific links to programs |
2638 |
- local f bn |
2639 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
2640 |
- -mindepth 1 -maxdepth 1) |
2641 |
- do |
2642 |
- bn=$(basename "${f}") |
2643 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
2644 |
- "/usr/bin/${bn}${SLOT/.}" |
2645 |
- done |
2646 |
- |
2647 |
- if use doc ; then |
2648 |
- docinto html |
2649 |
- dodoc doc/src/sgml/html/* |
2650 |
- fi |
2651 |
- |
2652 |
- if use server; then |
2653 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2654 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
2655 |
- |
2656 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2657 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
2658 |
- |
2659 |
- if use systemd; then |
2660 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2661 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
2662 |
- systemd_newunit - ${PN}-${SLOT}.service |
2663 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2664 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
2665 |
- fi |
2666 |
- |
2667 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2668 |
- |
2669 |
- if use prefix ; then |
2670 |
- keepdir /run/postgresql |
2671 |
- fperms 1775 /run/postgresql |
2672 |
- fi |
2673 |
- fi |
2674 |
-} |
2675 |
- |
2676 |
-pkg_postinst() { |
2677 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
2678 |
- postgresql-config update |
2679 |
- |
2680 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2681 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
2682 |
- |
2683 |
- if use server ; then |
2684 |
- elog |
2685 |
- elog "Gentoo specific documentation:" |
2686 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2687 |
- elog |
2688 |
- elog "Official documentation:" |
2689 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
2690 |
- elog |
2691 |
- elog "The default location of the Unix-domain socket is:" |
2692 |
- elog " ${EROOT}/run/postgresql/" |
2693 |
- elog |
2694 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2695 |
- elog "so that it contains your preferred locale in:" |
2696 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2697 |
- elog |
2698 |
- elog "Then, execute the following command to setup the initial database" |
2699 |
- elog "environment:" |
2700 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2701 |
- |
2702 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
2703 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
2704 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
2705 |
- ewarn "the following command after upgrading:" |
2706 |
- ewarn |
2707 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
2708 |
- fi |
2709 |
- fi |
2710 |
-} |
2711 |
- |
2712 |
-pkg_prerm() { |
2713 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2714 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2715 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2716 |
- |
2717 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2718 |
- sleep 10 |
2719 |
- eend 0 |
2720 |
- fi |
2721 |
-} |
2722 |
- |
2723 |
-pkg_postrm() { |
2724 |
- postgresql-config update |
2725 |
-} |
2726 |
- |
2727 |
-pkg_config() { |
2728 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2729 |
- |
2730 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2731 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2732 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
2733 |
- [[ -z "${DATA_DIR}" ]] \ |
2734 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
2735 |
- |
2736 |
- # environment.bz2 may not contain the same locale as the current system |
2737 |
- # locale. Unset and source from the current system locale. |
2738 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
2739 |
- unset LANG |
2740 |
- unset LC_CTYPE |
2741 |
- unset LC_NUMERIC |
2742 |
- unset LC_TIME |
2743 |
- unset LC_COLLATE |
2744 |
- unset LC_MONETARY |
2745 |
- unset LC_MESSAGES |
2746 |
- unset LC_ALL |
2747 |
- source "${EROOT}/etc/env.d/02locale" |
2748 |
- [ -n "${LANG}" ] && export LANG |
2749 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2750 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2751 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2752 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2753 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2754 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2755 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2756 |
- fi |
2757 |
- |
2758 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2759 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
2760 |
- einfo |
2761 |
- einfo "Information on options that can be passed to initdb are found at:" |
2762 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2763 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2764 |
- einfo |
2765 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2766 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2767 |
- einfo " (none)" |
2768 |
- else |
2769 |
- einfo " ${PG_INITDB_OPTS}" |
2770 |
- fi |
2771 |
- einfo |
2772 |
- einfo "Configuration files will be installed to:" |
2773 |
- einfo " ${PGDATA}" |
2774 |
- einfo |
2775 |
- einfo "The database cluster will be created in:" |
2776 |
- einfo " ${DATA_DIR}" |
2777 |
- einfo |
2778 |
- |
2779 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
2780 |
- sleep 5 |
2781 |
- eend 0 |
2782 |
- |
2783 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2784 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2785 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2786 |
- die "${DATA_DIR} is not empty." |
2787 |
- fi |
2788 |
- |
2789 |
- einfo "Creating the data directory ..." |
2790 |
- if [[ ${EUID} == 0 ]] ; then |
2791 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
2792 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
2793 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
2794 |
- fi |
2795 |
- |
2796 |
- einfo "Initializing the database ..." |
2797 |
- |
2798 |
- if [[ ${EUID} == 0 ]] ; then |
2799 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2800 |
- else |
2801 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2802 |
- fi |
2803 |
- |
2804 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2805 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2806 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2807 |
- fi |
2808 |
- |
2809 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
2810 |
- # overridden in the initscript |
2811 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
2812 |
- |
2813 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2814 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2815 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2816 |
- # characters in PL/Perl |
2817 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2818 |
- EOF |
2819 |
- |
2820 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2821 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2822 |
- einfo "by default. You can disable it in the cluster's:" |
2823 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2824 |
- einfo |
2825 |
- if ! use systemd; then |
2826 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2827 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2828 |
- einfo |
2829 |
- fi |
2830 |
- if use prefix ; then |
2831 |
- einfo "The location of the configuration files have moved to:" |
2832 |
- einfo " ${PGDATA}" |
2833 |
- einfo "To start the server:" |
2834 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2835 |
- einfo "To stop:" |
2836 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2837 |
- einfo |
2838 |
- einfo "Or move the configuration files back:" |
2839 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2840 |
- elif use systemd; then |
2841 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
2842 |
- einfo "instead of 'pg_ctl'." |
2843 |
- else |
2844 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2845 |
- einfo "instead of 'pg_ctl'." |
2846 |
- fi |
2847 |
-} |
2848 |
- |
2849 |
-src_test() { |
2850 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2851 |
- emake check |
2852 |
- |
2853 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2854 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2855 |
- else |
2856 |
- use server || \ |
2857 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2858 |
- [[ ${UID} -eq 0 ]] || \ |
2859 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2860 |
- |
2861 |
- ewarn 'Skipping.' |
2862 |
- fi |
2863 |
-} |
2864 |
|
2865 |
diff --git a/dev-db/postgresql/postgresql-13_beta2.ebuild b/dev-db/postgresql/postgresql-13_beta2.ebuild |
2866 |
deleted file mode 100644 |
2867 |
index 000f3085aa8..00000000000 |
2868 |
--- a/dev-db/postgresql/postgresql-13_beta2.ebuild |
2869 |
+++ /dev/null |
2870 |
@@ -1,458 +0,0 @@ |
2871 |
-# Copyright 1999-2020 Gentoo Authors |
2872 |
-# Distributed under the terms of the GNU General Public License v2 |
2873 |
- |
2874 |
-EAPI=7 |
2875 |
- |
2876 |
-PYTHON_COMPAT=( python3_{6,7} ) |
2877 |
- |
2878 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd |
2879 |
- |
2880 |
-KEYWORDS="" |
2881 |
- |
2882 |
-SLOT=$(ver_cut 1) |
2883 |
- |
2884 |
-MY_PV=${PV/_/} |
2885 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
2886 |
- |
2887 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
2888 |
- |
2889 |
-LICENSE="POSTGRESQL GPL-2" |
2890 |
-DESCRIPTION="PostgreSQL RDBMS" |
2891 |
-HOMEPAGE="https://www.postgresql.org/" |
2892 |
- |
2893 |
-IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam |
2894 |
- perl python +readline selinux +server systemd ssl static-libs tcl |
2895 |
- threads uuid xml zlib" |
2896 |
- |
2897 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
2898 |
- |
2899 |
-CDEPEND=" |
2900 |
->=app-eselect/eselect-postgresql-2.0 |
2901 |
-acct-group/postgres |
2902 |
-acct-user/postgres |
2903 |
-sys-apps/less |
2904 |
-virtual/libintl |
2905 |
-icu? ( dev-libs/icu:= ) |
2906 |
-kerberos? ( virtual/krb5 ) |
2907 |
-ldap? ( net-nds/openldap ) |
2908 |
-llvm? ( |
2909 |
- sys-devel/llvm:= |
2910 |
- sys-devel/clang:= |
2911 |
-) |
2912 |
-pam? ( sys-libs/pam ) |
2913 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2914 |
-python? ( ${PYTHON_DEPS} ) |
2915 |
-readline? ( sys-libs/readline:0= ) |
2916 |
-server? ( systemd? ( sys-apps/systemd ) ) |
2917 |
-ssl? ( |
2918 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2919 |
- libressl? ( dev-libs/libressl:= ) |
2920 |
-) |
2921 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2922 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2923 |
-zlib? ( sys-libs/zlib ) |
2924 |
-" |
2925 |
- |
2926 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
2927 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
2928 |
-# the libc includes UUID functions. |
2929 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
2930 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
2931 |
- |
2932 |
-nest_usedep() { |
2933 |
- local front back |
2934 |
- while [[ ${#} -gt 1 ]]; do |
2935 |
- front+="${1}? ( " |
2936 |
- back+=" )" |
2937 |
- shift |
2938 |
- done |
2939 |
- echo "${front}${1}${back}" |
2940 |
-} |
2941 |
- |
2942 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
2943 |
-CDEPEND+=" |
2944 |
-uuid? ( |
2945 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
2946 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
2947 |
-)" |
2948 |
- |
2949 |
-DEPEND="${CDEPEND} |
2950 |
-sys-devel/bison |
2951 |
-sys-devel/flex |
2952 |
-nls? ( sys-devel/gettext ) |
2953 |
-xml? ( virtual/pkgconfig ) |
2954 |
-" |
2955 |
- |
2956 |
-RDEPEND="${CDEPEND} |
2957 |
-selinux? ( sec-policy/selinux-postgresql ) |
2958 |
-" |
2959 |
- |
2960 |
-pkg_setup() { |
2961 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2962 |
- |
2963 |
- use python && python-single-r1_pkg_setup |
2964 |
-} |
2965 |
- |
2966 |
-src_prepare() { |
2967 |
- # Set proper run directory |
2968 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2969 |
- -i src/include/pg_config_manual.h || die |
2970 |
- |
2971 |
- # Rely on $PATH being in the proper order so that the correct |
2972 |
- # install program is used for modules utilizing PGXS in both |
2973 |
- # hardened and non-hardened environments. (Bug #528786) |
2974 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
2975 |
- |
2976 |
- use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch" |
2977 |
- |
2978 |
- if use pam ; then |
2979 |
- sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2980 |
- -i src/backend/libpq/auth.c || \ |
2981 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2982 |
- fi |
2983 |
- |
2984 |
- eapply_user |
2985 |
-} |
2986 |
- |
2987 |
-src_configure() { |
2988 |
- case ${CHOST} in |
2989 |
- *-darwin*|*-solaris*) |
2990 |
- use nls && append-libs intl |
2991 |
- ;; |
2992 |
- esac |
2993 |
- |
2994 |
- export LDFLAGS_SL="${LDFLAGS}" |
2995 |
- export LDFLAGS_EX="${LDFLAGS}" |
2996 |
- |
2997 |
- local PO="${EPREFIX}" |
2998 |
- |
2999 |
- local i uuid_config="" |
3000 |
- if use uuid; then |
3001 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
3002 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
3003 |
- done |
3004 |
- for i in ${BSD_LIBC[@]}; do |
3005 |
- use ${i} && uuid_config="--with-uuid=bsd" |
3006 |
- done |
3007 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
3008 |
- fi |
3009 |
- |
3010 |
- econf \ |
3011 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3012 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3013 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3014 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3015 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3016 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3017 |
- $(use_enable !alpha spinlocks) \ |
3018 |
- $(use_enable debug) \ |
3019 |
- $(use_enable threads thread-safety) \ |
3020 |
- $(use_with icu) \ |
3021 |
- $(use_with kerberos gssapi) \ |
3022 |
- $(use_with ldap) \ |
3023 |
- $(use_with llvm) \ |
3024 |
- $(use_with pam) \ |
3025 |
- $(use_with perl) \ |
3026 |
- $(use_with python) \ |
3027 |
- $(use_with readline) \ |
3028 |
- $(use_with ssl openssl) \ |
3029 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
3030 |
- $(use_with tcl) \ |
3031 |
- ${uuid_config} \ |
3032 |
- $(use_with xml libxml) \ |
3033 |
- $(use_with xml libxslt) \ |
3034 |
- $(use_with zlib) \ |
3035 |
- $(use_enable nls) |
3036 |
-} |
3037 |
- |
3038 |
-src_compile() { |
3039 |
- emake |
3040 |
- emake -C contrib |
3041 |
-} |
3042 |
- |
3043 |
-src_install() { |
3044 |
- emake DESTDIR="${D}" install |
3045 |
- emake DESTDIR="${D}" install -C contrib |
3046 |
- |
3047 |
- dodoc README HISTORY |
3048 |
- |
3049 |
- # man pages are already built, but if we have the target make them, |
3050 |
- # they'll be generated from source before being installed so we |
3051 |
- # manually install man pages. |
3052 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3053 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3054 |
- doins -r doc/src/sgml/man{1,3,7} |
3055 |
- if ! use server; then |
3056 |
- # Remove man pages for non-existent binaries |
3057 |
- serverman=( |
3058 |
- initdb |
3059 |
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby} |
3060 |
- pg_{test_{fsync,timing},upgrade,waldump} |
3061 |
- post{gres,master} |
3062 |
- ) |
3063 |
- for m in ${serverman[@]} ; do |
3064 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3065 |
- done |
3066 |
- fi |
3067 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3068 |
- |
3069 |
- # Create slot specific man pages |
3070 |
- local bn f mansec slotted_name |
3071 |
- for mansec in 1 3 7 ; do |
3072 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
3073 |
- |
3074 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
3075 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
3076 |
- |
3077 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
3078 |
- bn=$(basename "${f}") |
3079 |
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec} |
3080 |
- case ${bn} in |
3081 |
- TABLE.7|WITH.7) |
3082 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
3083 |
- ;; |
3084 |
- *) |
3085 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
3086 |
- ;; |
3087 |
- esac |
3088 |
- done |
3089 |
- |
3090 |
- popd > /dev/null |
3091 |
- done |
3092 |
- |
3093 |
- insinto /etc/postgresql-${SLOT} |
3094 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3095 |
- |
3096 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
3097 |
- # needed by extensions utilizing PGXS. |
3098 |
- use static-libs || \ |
3099 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
3100 |
- -delete |
3101 |
- |
3102 |
- # Make slot specific links to programs |
3103 |
- local f bn |
3104 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
3105 |
- -mindepth 1 -maxdepth 1) |
3106 |
- do |
3107 |
- bn=$(basename "${f}") |
3108 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
3109 |
- "/usr/bin/${bn}${SLOT/.}" |
3110 |
- done |
3111 |
- |
3112 |
- if use doc ; then |
3113 |
- docinto html |
3114 |
- dodoc doc/src/sgml/html/* |
3115 |
- fi |
3116 |
- |
3117 |
- if use server; then |
3118 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3119 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
3120 |
- |
3121 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3122 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
3123 |
- |
3124 |
- if use systemd; then |
3125 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3126 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
3127 |
- systemd_newunit - ${PN}-${SLOT}.service |
3128 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3129 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
3130 |
- fi |
3131 |
- |
3132 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3133 |
- |
3134 |
- if use prefix ; then |
3135 |
- keepdir /run/postgresql |
3136 |
- fperms 1775 /run/postgresql |
3137 |
- fi |
3138 |
- fi |
3139 |
-} |
3140 |
- |
3141 |
-pkg_postinst() { |
3142 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
3143 |
- postgresql-config update |
3144 |
- |
3145 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3146 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
3147 |
- |
3148 |
- if use server ; then |
3149 |
- elog |
3150 |
- elog "Gentoo specific documentation:" |
3151 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3152 |
- elog |
3153 |
- elog "Official documentation:" |
3154 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
3155 |
- elog |
3156 |
- elog "The default location of the Unix-domain socket is:" |
3157 |
- elog " ${EROOT}/run/postgresql/" |
3158 |
- elog |
3159 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3160 |
- elog "so that it contains your preferred locale in:" |
3161 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3162 |
- elog |
3163 |
- elog "Then, execute the following command to setup the initial database" |
3164 |
- elog "environment:" |
3165 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3166 |
- |
3167 |
- if [[ -n ${REPLACING_VERSIONS} ]] ; then |
3168 |
- ewarn "If your system is using 'pg_stat_statements' and you are running a" |
3169 |
- ewarn "version of PostgreSQL ${SLOT}, we advise that you execute" |
3170 |
- ewarn "the following command after upgrading:" |
3171 |
- ewarn |
3172 |
- ewarn "ALTER EXTENSION pg_stat_statements UPDATE;" |
3173 |
- fi |
3174 |
- fi |
3175 |
-} |
3176 |
- |
3177 |
-pkg_prerm() { |
3178 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3179 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3180 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3181 |
- |
3182 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3183 |
- sleep 10 |
3184 |
- eend 0 |
3185 |
- fi |
3186 |
-} |
3187 |
- |
3188 |
-pkg_postrm() { |
3189 |
- postgresql-config update |
3190 |
-} |
3191 |
- |
3192 |
-pkg_config() { |
3193 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3194 |
- |
3195 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3196 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3197 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
3198 |
- [[ -z "${DATA_DIR}" ]] \ |
3199 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
3200 |
- |
3201 |
- # environment.bz2 may not contain the same locale as the current system |
3202 |
- # locale. Unset and source from the current system locale. |
3203 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
3204 |
- unset LANG |
3205 |
- unset LC_CTYPE |
3206 |
- unset LC_NUMERIC |
3207 |
- unset LC_TIME |
3208 |
- unset LC_COLLATE |
3209 |
- unset LC_MONETARY |
3210 |
- unset LC_MESSAGES |
3211 |
- unset LC_ALL |
3212 |
- source "${EROOT}/etc/env.d/02locale" |
3213 |
- [ -n "${LANG}" ] && export LANG |
3214 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3215 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3216 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3217 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3218 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3219 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3220 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3221 |
- fi |
3222 |
- |
3223 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3224 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3225 |
- einfo |
3226 |
- einfo "Information on options that can be passed to initdb are found at:" |
3227 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3228 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3229 |
- einfo |
3230 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3231 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3232 |
- einfo " (none)" |
3233 |
- else |
3234 |
- einfo " ${PG_INITDB_OPTS}" |
3235 |
- fi |
3236 |
- einfo |
3237 |
- einfo "Configuration files will be installed to:" |
3238 |
- einfo " ${PGDATA}" |
3239 |
- einfo |
3240 |
- einfo "The database cluster will be created in:" |
3241 |
- einfo " ${DATA_DIR}" |
3242 |
- einfo |
3243 |
- |
3244 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
3245 |
- sleep 5 |
3246 |
- eend 0 |
3247 |
- |
3248 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3249 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3250 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3251 |
- die "${DATA_DIR} is not empty." |
3252 |
- fi |
3253 |
- |
3254 |
- einfo "Creating the data directory ..." |
3255 |
- if [[ ${EUID} == 0 ]] ; then |
3256 |
- mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs" |
3257 |
- mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR" |
3258 |
- chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown" |
3259 |
- fi |
3260 |
- |
3261 |
- einfo "Initializing the database ..." |
3262 |
- |
3263 |
- if [[ ${EUID} == 0 ]] ; then |
3264 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3265 |
- else |
3266 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3267 |
- fi |
3268 |
- |
3269 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3270 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3271 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3272 |
- fi |
3273 |
- |
3274 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
3275 |
- # overridden in the initscript |
3276 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
3277 |
- |
3278 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3279 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3280 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3281 |
- # characters in PL/Perl |
3282 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3283 |
- EOF |
3284 |
- |
3285 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3286 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3287 |
- einfo "by default. You can disable it in the cluster's:" |
3288 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3289 |
- einfo |
3290 |
- if ! use systemd; then |
3291 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3292 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3293 |
- einfo |
3294 |
- fi |
3295 |
- if use prefix ; then |
3296 |
- einfo "The location of the configuration files have moved to:" |
3297 |
- einfo " ${PGDATA}" |
3298 |
- einfo "To start the server:" |
3299 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3300 |
- einfo "To stop:" |
3301 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3302 |
- einfo |
3303 |
- einfo "Or move the configuration files back:" |
3304 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3305 |
- elif use systemd; then |
3306 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
3307 |
- einfo "instead of 'pg_ctl'." |
3308 |
- else |
3309 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3310 |
- einfo "instead of 'pg_ctl'." |
3311 |
- fi |
3312 |
-} |
3313 |
- |
3314 |
-src_test() { |
3315 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3316 |
- emake check |
3317 |
- |
3318 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3319 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3320 |
- else |
3321 |
- use server || \ |
3322 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3323 |
- [[ ${UID} -eq 0 ]] || \ |
3324 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3325 |
- |
3326 |
- ewarn 'Skipping.' |
3327 |
- fi |
3328 |
-} |
3329 |
|
3330 |
diff --git a/dev-db/postgresql/postgresql-9.5.21.ebuild b/dev-db/postgresql/postgresql-9.5.21.ebuild |
3331 |
deleted file mode 100644 |
3332 |
index 11de5150b26..00000000000 |
3333 |
--- a/dev-db/postgresql/postgresql-9.5.21.ebuild |
3334 |
+++ /dev/null |
3335 |
@@ -1,485 +0,0 @@ |
3336 |
-# Copyright 1999-2020 Gentoo Authors |
3337 |
-# Distributed under the terms of the GNU General Public License v2 |
3338 |
- |
3339 |
-EAPI=7 |
3340 |
- |
3341 |
-PYTHON_COMPAT=( python3_{6,7} ) |
3342 |
- |
3343 |
-PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN |
3344 |
- zh_TW" |
3345 |
- |
3346 |
-inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ |
3347 |
- systemd user |
3348 |
- |
3349 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris" |
3350 |
- |
3351 |
-SLOT=$(ver_cut 1-2) |
3352 |
- |
3353 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2" |
3354 |
- |
3355 |
-LICENSE="POSTGRESQL GPL-2" |
3356 |
-DESCRIPTION="PostgreSQL RDBMS" |
3357 |
-HOMEPAGE="https://www.postgresql.org/" |
3358 |
- |
3359 |
-IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl |
3360 |
- -pg-legacytimestamp python +readline selinux +server systemd ssl |
3361 |
- static-libs tcl threads uuid xml zlib" |
3362 |
- |
3363 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
3364 |
- |
3365 |
-CDEPEND=" |
3366 |
->=app-eselect/eselect-postgresql-2.0 |
3367 |
-sys-apps/less |
3368 |
-virtual/libintl |
3369 |
-kerberos? ( virtual/krb5 ) |
3370 |
-ldap? ( net-nds/openldap ) |
3371 |
-pam? ( sys-libs/pam ) |
3372 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3373 |
-python? ( ${PYTHON_DEPS} ) |
3374 |
-readline? ( sys-libs/readline:0= ) |
3375 |
-ssl? ( |
3376 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3377 |
- libressl? ( dev-libs/libressl:= ) |
3378 |
-) |
3379 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3380 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3381 |
-zlib? ( sys-libs/zlib ) |
3382 |
-" |
3383 |
- |
3384 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
3385 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
3386 |
-# the libc includes UUID functions. |
3387 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
3388 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
3389 |
- |
3390 |
-nest_usedep() { |
3391 |
- local front back |
3392 |
- while [[ ${#} -gt 1 ]]; do |
3393 |
- front+="${1}? ( " |
3394 |
- back+=" )" |
3395 |
- shift |
3396 |
- done |
3397 |
- echo "${front}${1}${back}" |
3398 |
-} |
3399 |
- |
3400 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
3401 |
-CDEPEND+=" |
3402 |
-uuid? ( |
3403 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
3404 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
3405 |
-)" |
3406 |
- |
3407 |
-DEPEND="${CDEPEND} |
3408 |
-!!<sys-apps/sandbox-2.0 |
3409 |
-sys-devel/bison |
3410 |
-sys-devel/flex |
3411 |
-nls? ( sys-devel/gettext ) |
3412 |
-xml? ( virtual/pkgconfig ) |
3413 |
-" |
3414 |
- |
3415 |
-RDEPEND="${CDEPEND} |
3416 |
-!dev-db/postgresql-docs:${SLOT} |
3417 |
-!dev-db/postgresql-base:${SLOT} |
3418 |
-!dev-db/postgresql-server:${SLOT} |
3419 |
-selinux? ( sec-policy/selinux-postgresql ) |
3420 |
-" |
3421 |
- |
3422 |
-pkg_setup() { |
3423 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3424 |
- |
3425 |
- enewgroup postgres 70 |
3426 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
3427 |
- |
3428 |
- use python && python-single-r1_pkg_setup |
3429 |
-} |
3430 |
- |
3431 |
-src_prepare() { |
3432 |
- # Work around PPC{,64} compilation bug where bool is already defined |
3433 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
3434 |
- |
3435 |
- # Set proper run directory |
3436 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3437 |
- -i src/include/pg_config_manual.h || die |
3438 |
- |
3439 |
- # Rely on $PATH being in the proper order so that the correct |
3440 |
- # install program is used for modules utilizing PGXS in both |
3441 |
- # hardened and non-hardened environments. (Bug #528786) |
3442 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3443 |
- |
3444 |
- use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch" |
3445 |
- |
3446 |
- if use pam ; then |
3447 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3448 |
- -i src/backend/libpq/auth.c || \ |
3449 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3450 |
- fi |
3451 |
- |
3452 |
- eapply_user |
3453 |
-} |
3454 |
- |
3455 |
-src_configure() { |
3456 |
- case ${CHOST} in |
3457 |
- *-darwin*|*-solaris*) |
3458 |
- use nls && append-libs intl |
3459 |
- ;; |
3460 |
- esac |
3461 |
- |
3462 |
- export LDFLAGS_SL="${LDFLAGS}" |
3463 |
- export LDFLAGS_EX="${LDFLAGS}" |
3464 |
- |
3465 |
- local PO="${EPREFIX}" |
3466 |
- |
3467 |
- local i uuid_config="" |
3468 |
- if use uuid; then |
3469 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
3470 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
3471 |
- done |
3472 |
- for i in ${BSD_LIBC[@]}; do |
3473 |
- use ${i} && uuid_config="--with-uuid=bsd" |
3474 |
- done |
3475 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
3476 |
- fi |
3477 |
- |
3478 |
- econf \ |
3479 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3480 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3481 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3482 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3483 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3484 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3485 |
- $(use_enable !alpha spinlocks) \ |
3486 |
- $(use_enable !pg-legacytimestamp integer-datetimes) \ |
3487 |
- $(use_enable debug) \ |
3488 |
- $(use_enable threads thread-safety) \ |
3489 |
- $(use_with kerberos gssapi) \ |
3490 |
- $(use_with ldap) \ |
3491 |
- $(use_with pam) \ |
3492 |
- $(use_with perl) \ |
3493 |
- $(use_with python) \ |
3494 |
- $(use_with readline) \ |
3495 |
- $(use_with ssl openssl) \ |
3496 |
- $(use_with tcl) \ |
3497 |
- ${uuid_config} \ |
3498 |
- $(use_with xml libxml) \ |
3499 |
- $(use_with xml libxslt) \ |
3500 |
- $(use_with zlib) \ |
3501 |
- $(use_enable nls nls "'$(l10n_get_locales)'") |
3502 |
-} |
3503 |
- |
3504 |
-src_compile() { |
3505 |
- emake |
3506 |
- emake -C contrib |
3507 |
-} |
3508 |
- |
3509 |
-src_install() { |
3510 |
- emake DESTDIR="${D}" install |
3511 |
- emake DESTDIR="${D}" install -C contrib |
3512 |
- |
3513 |
- dodoc README HISTORY doc/{TODO,bug.template} |
3514 |
- |
3515 |
- # man pages are already built, but if we have the target make them, |
3516 |
- # they'll be generated from source before being installed so we |
3517 |
- # manually install man pages. |
3518 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3519 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3520 |
- doins -r doc/src/sgml/man{1,3,7} |
3521 |
- if ! use server; then |
3522 |
- # Remove man pages for non-existent binaries |
3523 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
3524 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3525 |
- done |
3526 |
- fi |
3527 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3528 |
- |
3529 |
- # Create slot specific man pages |
3530 |
- local bn f mansec slotted_name |
3531 |
- for mansec in 1 3 7 ; do |
3532 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
3533 |
- |
3534 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
3535 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
3536 |
- |
3537 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
3538 |
- bn=$(basename "${f}") |
3539 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
3540 |
- case ${bn} in |
3541 |
- TABLE.7|WITH.7) |
3542 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
3543 |
- ;; |
3544 |
- *) |
3545 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
3546 |
- ;; |
3547 |
- esac |
3548 |
- done |
3549 |
- |
3550 |
- popd > /dev/null |
3551 |
- done |
3552 |
- |
3553 |
- insinto /etc/postgresql-${SLOT} |
3554 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3555 |
- |
3556 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
3557 |
- # needed by extensions utilizing PGXS. |
3558 |
- use static-libs || \ |
3559 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
3560 |
- -delete |
3561 |
- |
3562 |
- local f bn |
3563 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
3564 |
- -mindepth 1 -maxdepth 1) |
3565 |
- do |
3566 |
- bn=$(basename "${f}") |
3567 |
- # Temporarily tack on tmp to workaround a file collision |
3568 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
3569 |
- # had this issue. |
3570 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
3571 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
3572 |
- done |
3573 |
- |
3574 |
- if use doc ; then |
3575 |
- docinto html |
3576 |
- dodoc doc/src/sgml/html/* |
3577 |
- |
3578 |
- docinto sgml |
3579 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
3580 |
- fi |
3581 |
- |
3582 |
- if use server; then |
3583 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3584 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
3585 |
- |
3586 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3587 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
3588 |
- |
3589 |
- if use systemd; then |
3590 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3591 |
- "${FILESDIR}/${PN}.service-9.2" | \ |
3592 |
- systemd_newunit - ${PN}-${SLOT}.service |
3593 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
3594 |
- fi |
3595 |
- |
3596 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3597 |
- |
3598 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3599 |
- |
3600 |
- if use prefix ; then |
3601 |
- keepdir /run/postgresql |
3602 |
- fperms 1775 /run/postgresql |
3603 |
- fi |
3604 |
- fi |
3605 |
-} |
3606 |
- |
3607 |
-pkg_preinst() { |
3608 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
3609 |
- # /usr/bin/psql96). They may have been created by the |
3610 |
- # postgresql.eselect module, but they're handled within this ebuild |
3611 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
3612 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
3613 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
3614 |
- # handled in this manner. |
3615 |
- local canonicalise |
3616 |
- if type -p realpath > /dev/null; then |
3617 |
- canonicalise=realpath |
3618 |
- elif type -p readlink > /dev/null; then |
3619 |
- canonicalise='readlink -f' |
3620 |
- else |
3621 |
- # can't die, subshell |
3622 |
- die "No readlink nor realpath found, cannot canonicalise" |
3623 |
- fi |
3624 |
- |
3625 |
- local l |
3626 |
- # First remove any symlinks in /usr/bin that may have been created |
3627 |
- # by the old eselect |
3628 |
- for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
3629 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
3630 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
3631 |
- fi |
3632 |
- done |
3633 |
- |
3634 |
- # Then move the symlinks created by the ebuild to their proper place. |
3635 |
- for l in "${ED}"/usr/bin/*tmp ; do |
3636 |
- mv "${l}" "${l%tmp}" \ |
3637 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
3638 |
- done |
3639 |
-} |
3640 |
- |
3641 |
-pkg_postinst() { |
3642 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
3643 |
- postgresql-config update |
3644 |
- |
3645 |
- if use alpha && use server ; then |
3646 |
- ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." |
3647 |
- ewarn "As a result, performance will be extremely degraded." |
3648 |
- fi |
3649 |
- |
3650 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3651 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
3652 |
- |
3653 |
- if use server ; then |
3654 |
- elog |
3655 |
- elog "Gentoo specific documentation:" |
3656 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3657 |
- elog |
3658 |
- elog "Official documentation:" |
3659 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
3660 |
- elog |
3661 |
- elog "The default location of the Unix-domain socket is:" |
3662 |
- elog " ${EROOT}/run/postgresql/" |
3663 |
- elog |
3664 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3665 |
- elog "so that it contains your preferred locale in:" |
3666 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3667 |
- elog |
3668 |
- elog "Then, execute the following command to setup the initial database" |
3669 |
- elog "environment:" |
3670 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3671 |
- fi |
3672 |
-} |
3673 |
- |
3674 |
-pkg_prerm() { |
3675 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3676 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3677 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3678 |
- |
3679 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3680 |
- sleep 10 |
3681 |
- eend 0 |
3682 |
- fi |
3683 |
-} |
3684 |
- |
3685 |
-pkg_postrm() { |
3686 |
- postgresql-config update |
3687 |
-} |
3688 |
- |
3689 |
-pkg_config() { |
3690 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3691 |
- |
3692 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3693 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3694 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
3695 |
- [[ -z "${DATA_DIR}" ]] \ |
3696 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
3697 |
- |
3698 |
- # environment.bz2 may not contain the same locale as the current system |
3699 |
- # locale. Unset and source from the current system locale. |
3700 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
3701 |
- unset LANG |
3702 |
- unset LC_CTYPE |
3703 |
- unset LC_NUMERIC |
3704 |
- unset LC_TIME |
3705 |
- unset LC_COLLATE |
3706 |
- unset LC_MONETARY |
3707 |
- unset LC_MESSAGES |
3708 |
- unset LC_ALL |
3709 |
- source "${EROOT}/etc/env.d/02locale" |
3710 |
- [ -n "${LANG}" ] && export LANG |
3711 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3712 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3713 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3714 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3715 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3716 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3717 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3718 |
- fi |
3719 |
- |
3720 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3721 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
3722 |
- einfo |
3723 |
- einfo "Information on options that can be passed to initdb are found at:" |
3724 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3725 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3726 |
- einfo |
3727 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3728 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3729 |
- einfo " (none)" |
3730 |
- else |
3731 |
- einfo " ${PG_INITDB_OPTS}" |
3732 |
- fi |
3733 |
- einfo |
3734 |
- einfo "Configuration files will be installed to:" |
3735 |
- einfo " ${PGDATA}" |
3736 |
- einfo |
3737 |
- einfo "The database cluster will be created in:" |
3738 |
- einfo " ${DATA_DIR}" |
3739 |
- einfo |
3740 |
- |
3741 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
3742 |
- sleep 5 |
3743 |
- eend 0 |
3744 |
- |
3745 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3746 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3747 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3748 |
- die "${DATA_DIR} is not empty." |
3749 |
- fi |
3750 |
- |
3751 |
- einfo "Creating the data directory ..." |
3752 |
- if [[ ${EUID} == 0 ]] ; then |
3753 |
- mkdir -p "${DATA_DIR}" |
3754 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
3755 |
- chmod 0700 "${DATA_DIR}" |
3756 |
- fi |
3757 |
- |
3758 |
- einfo "Initializing the database ..." |
3759 |
- |
3760 |
- if [[ ${EUID} == 0 ]] ; then |
3761 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3762 |
- else |
3763 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3764 |
- fi |
3765 |
- |
3766 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3767 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3768 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3769 |
- fi |
3770 |
- |
3771 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
3772 |
- # overridden in the initscript |
3773 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
3774 |
- |
3775 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3776 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3777 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3778 |
- # characters in PL/Perl |
3779 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3780 |
- EOF |
3781 |
- |
3782 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3783 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3784 |
- einfo "by default. You can disable it in the cluster's:" |
3785 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3786 |
- einfo |
3787 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3788 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3789 |
- einfo |
3790 |
- if use prefix ; then |
3791 |
- einfo "The location of the configuration files have moved to:" |
3792 |
- einfo " ${PGDATA}" |
3793 |
- einfo "To start the server:" |
3794 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3795 |
- einfo "To stop:" |
3796 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3797 |
- einfo |
3798 |
- einfo "Or move the configuration files back:" |
3799 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3800 |
- else |
3801 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3802 |
- einfo "instead of 'pg_ctl'." |
3803 |
- fi |
3804 |
-} |
3805 |
- |
3806 |
-src_test() { |
3807 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3808 |
- emake check |
3809 |
- |
3810 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3811 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3812 |
- else |
3813 |
- use server || \ |
3814 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3815 |
- [[ ${UID} -eq 0 ]] || \ |
3816 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3817 |
- |
3818 |
- ewarn 'Skipping.' |
3819 |
- fi |
3820 |
-} |
3821 |
|
3822 |
diff --git a/dev-db/postgresql/postgresql-9.5.22.ebuild b/dev-db/postgresql/postgresql-9.5.22.ebuild |
3823 |
deleted file mode 100644 |
3824 |
index 7d999e9628a..00000000000 |
3825 |
--- a/dev-db/postgresql/postgresql-9.5.22.ebuild |
3826 |
+++ /dev/null |
3827 |
@@ -1,476 +0,0 @@ |
3828 |
-# Copyright 1999-2020 Gentoo Authors |
3829 |
-# Distributed under the terms of the GNU General Public License v2 |
3830 |
- |
3831 |
-EAPI=7 |
3832 |
- |
3833 |
-PYTHON_COMPAT=( python3_{6,7} ) |
3834 |
- |
3835 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd |
3836 |
- |
3837 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos ~x86-solaris" |
3838 |
- |
3839 |
-SLOT=$(ver_cut 1-2) |
3840 |
- |
3841 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2" |
3842 |
- |
3843 |
-LICENSE="POSTGRESQL GPL-2" |
3844 |
-DESCRIPTION="PostgreSQL RDBMS" |
3845 |
-HOMEPAGE="https://www.postgresql.org/" |
3846 |
- |
3847 |
-IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl |
3848 |
- -pg-legacytimestamp python +readline selinux +server systemd ssl |
3849 |
- static-libs tcl threads uuid xml zlib" |
3850 |
- |
3851 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
3852 |
- |
3853 |
-CDEPEND=" |
3854 |
->=app-eselect/eselect-postgresql-2.0 |
3855 |
-acct-group/postgres |
3856 |
-acct-user/postgres |
3857 |
-sys-apps/less |
3858 |
-virtual/libintl |
3859 |
-kerberos? ( virtual/krb5 ) |
3860 |
-ldap? ( net-nds/openldap ) |
3861 |
-pam? ( sys-libs/pam ) |
3862 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3863 |
-python? ( ${PYTHON_DEPS} ) |
3864 |
-readline? ( sys-libs/readline:0= ) |
3865 |
-ssl? ( |
3866 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3867 |
- libressl? ( dev-libs/libressl:= ) |
3868 |
-) |
3869 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3870 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3871 |
-zlib? ( sys-libs/zlib ) |
3872 |
-" |
3873 |
- |
3874 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
3875 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
3876 |
-# the libc includes UUID functions. |
3877 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
3878 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
3879 |
- |
3880 |
-nest_usedep() { |
3881 |
- local front back |
3882 |
- while [[ ${#} -gt 1 ]]; do |
3883 |
- front+="${1}? ( " |
3884 |
- back+=" )" |
3885 |
- shift |
3886 |
- done |
3887 |
- echo "${front}${1}${back}" |
3888 |
-} |
3889 |
- |
3890 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
3891 |
-CDEPEND+=" |
3892 |
-uuid? ( |
3893 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
3894 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
3895 |
-)" |
3896 |
- |
3897 |
-DEPEND="${CDEPEND} |
3898 |
-sys-devel/bison |
3899 |
-sys-devel/flex |
3900 |
-nls? ( sys-devel/gettext ) |
3901 |
-xml? ( virtual/pkgconfig ) |
3902 |
-" |
3903 |
- |
3904 |
-RDEPEND="${CDEPEND} |
3905 |
-selinux? ( sec-policy/selinux-postgresql ) |
3906 |
-" |
3907 |
- |
3908 |
-pkg_setup() { |
3909 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3910 |
- |
3911 |
- use python && python-single-r1_pkg_setup |
3912 |
-} |
3913 |
- |
3914 |
-src_prepare() { |
3915 |
- # Work around PPC{,64} compilation bug where bool is already defined |
3916 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
3917 |
- |
3918 |
- # Set proper run directory |
3919 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3920 |
- -i src/include/pg_config_manual.h || die |
3921 |
- |
3922 |
- # Rely on $PATH being in the proper order so that the correct |
3923 |
- # install program is used for modules utilizing PGXS in both |
3924 |
- # hardened and non-hardened environments. (Bug #528786) |
3925 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3926 |
- |
3927 |
- use server || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch" |
3928 |
- |
3929 |
- if use pam ; then |
3930 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3931 |
- -i src/backend/libpq/auth.c || \ |
3932 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3933 |
- fi |
3934 |
- |
3935 |
- eapply_user |
3936 |
-} |
3937 |
- |
3938 |
-src_configure() { |
3939 |
- case ${CHOST} in |
3940 |
- *-darwin*|*-solaris*) |
3941 |
- use nls && append-libs intl |
3942 |
- ;; |
3943 |
- esac |
3944 |
- |
3945 |
- export LDFLAGS_SL="${LDFLAGS}" |
3946 |
- export LDFLAGS_EX="${LDFLAGS}" |
3947 |
- |
3948 |
- local PO="${EPREFIX}" |
3949 |
- |
3950 |
- local i uuid_config="" |
3951 |
- if use uuid; then |
3952 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
3953 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
3954 |
- done |
3955 |
- for i in ${BSD_LIBC[@]}; do |
3956 |
- use ${i} && uuid_config="--with-uuid=bsd" |
3957 |
- done |
3958 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
3959 |
- fi |
3960 |
- |
3961 |
- econf \ |
3962 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3963 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3964 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3965 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3966 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3967 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3968 |
- $(use_enable !alpha spinlocks) \ |
3969 |
- $(use_enable !pg-legacytimestamp integer-datetimes) \ |
3970 |
- $(use_enable debug) \ |
3971 |
- $(use_enable threads thread-safety) \ |
3972 |
- $(use_with kerberos gssapi) \ |
3973 |
- $(use_with ldap) \ |
3974 |
- $(use_with pam) \ |
3975 |
- $(use_with perl) \ |
3976 |
- $(use_with python) \ |
3977 |
- $(use_with readline) \ |
3978 |
- $(use_with ssl openssl) \ |
3979 |
- $(use_with tcl) \ |
3980 |
- ${uuid_config} \ |
3981 |
- $(use_with xml libxml) \ |
3982 |
- $(use_with xml libxslt) \ |
3983 |
- $(use_with zlib) \ |
3984 |
- $(use_enable nls) |
3985 |
-} |
3986 |
- |
3987 |
-src_compile() { |
3988 |
- emake |
3989 |
- emake -C contrib |
3990 |
-} |
3991 |
- |
3992 |
-src_install() { |
3993 |
- emake DESTDIR="${D}" install |
3994 |
- emake DESTDIR="${D}" install -C contrib |
3995 |
- |
3996 |
- dodoc README HISTORY doc/{TODO,bug.template} |
3997 |
- |
3998 |
- # man pages are already built, but if we have the target make them, |
3999 |
- # they'll be generated from source before being installed so we |
4000 |
- # manually install man pages. |
4001 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4002 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4003 |
- doins -r doc/src/sgml/man{1,3,7} |
4004 |
- if ! use server; then |
4005 |
- # Remove man pages for non-existent binaries |
4006 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
4007 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4008 |
- done |
4009 |
- fi |
4010 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4011 |
- |
4012 |
- # Create slot specific man pages |
4013 |
- local bn f mansec slotted_name |
4014 |
- for mansec in 1 3 7 ; do |
4015 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
4016 |
- |
4017 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
4018 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
4019 |
- |
4020 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
4021 |
- bn=$(basename "${f}") |
4022 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
4023 |
- case ${bn} in |
4024 |
- TABLE.7|WITH.7) |
4025 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
4026 |
- ;; |
4027 |
- *) |
4028 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
4029 |
- ;; |
4030 |
- esac |
4031 |
- done |
4032 |
- |
4033 |
- popd > /dev/null |
4034 |
- done |
4035 |
- |
4036 |
- insinto /etc/postgresql-${SLOT} |
4037 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4038 |
- |
4039 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
4040 |
- # needed by extensions utilizing PGXS. |
4041 |
- use static-libs || \ |
4042 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
4043 |
- -delete |
4044 |
- |
4045 |
- local f bn |
4046 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
4047 |
- -mindepth 1 -maxdepth 1) |
4048 |
- do |
4049 |
- bn=$(basename "${f}") |
4050 |
- # Temporarily tack on tmp to workaround a file collision |
4051 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
4052 |
- # had this issue. |
4053 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
4054 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
4055 |
- done |
4056 |
- |
4057 |
- if use doc ; then |
4058 |
- docinto html |
4059 |
- dodoc doc/src/sgml/html/* |
4060 |
- |
4061 |
- docinto sgml |
4062 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
4063 |
- fi |
4064 |
- |
4065 |
- if use server; then |
4066 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4067 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
4068 |
- |
4069 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4070 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
4071 |
- |
4072 |
- if use systemd; then |
4073 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4074 |
- "${FILESDIR}/${PN}.service-9.2" | \ |
4075 |
- systemd_newunit - ${PN}-${SLOT}.service |
4076 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
4077 |
- fi |
4078 |
- |
4079 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4080 |
- |
4081 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4082 |
- |
4083 |
- if use prefix ; then |
4084 |
- keepdir /run/postgresql |
4085 |
- fperms 1775 /run/postgresql |
4086 |
- fi |
4087 |
- fi |
4088 |
-} |
4089 |
- |
4090 |
-pkg_preinst() { |
4091 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
4092 |
- # /usr/bin/psql96). They may have been created by the |
4093 |
- # postgresql.eselect module, but they're handled within this ebuild |
4094 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
4095 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
4096 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
4097 |
- # handled in this manner. |
4098 |
- local canonicalise |
4099 |
- if type -p realpath > /dev/null; then |
4100 |
- canonicalise=realpath |
4101 |
- elif type -p readlink > /dev/null; then |
4102 |
- canonicalise='readlink -f' |
4103 |
- else |
4104 |
- # can't die, subshell |
4105 |
- die "No readlink nor realpath found, cannot canonicalise" |
4106 |
- fi |
4107 |
- |
4108 |
- local l |
4109 |
- # First remove any symlinks in /usr/bin that may have been created |
4110 |
- # by the old eselect |
4111 |
- for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
4112 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
4113 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
4114 |
- fi |
4115 |
- done |
4116 |
- |
4117 |
- # Then move the symlinks created by the ebuild to their proper place. |
4118 |
- for l in "${ED}"/usr/bin/*tmp ; do |
4119 |
- mv "${l}" "${l%tmp}" \ |
4120 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
4121 |
- done |
4122 |
-} |
4123 |
- |
4124 |
-pkg_postinst() { |
4125 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
4126 |
- postgresql-config update |
4127 |
- |
4128 |
- if use alpha && use server ; then |
4129 |
- ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." |
4130 |
- ewarn "As a result, performance will be extremely degraded." |
4131 |
- fi |
4132 |
- |
4133 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4134 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
4135 |
- |
4136 |
- if use server ; then |
4137 |
- elog |
4138 |
- elog "Gentoo specific documentation:" |
4139 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4140 |
- elog |
4141 |
- elog "Official documentation:" |
4142 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
4143 |
- elog |
4144 |
- elog "The default location of the Unix-domain socket is:" |
4145 |
- elog " ${EROOT}/run/postgresql/" |
4146 |
- elog |
4147 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4148 |
- elog "so that it contains your preferred locale in:" |
4149 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4150 |
- elog |
4151 |
- elog "Then, execute the following command to setup the initial database" |
4152 |
- elog "environment:" |
4153 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4154 |
- fi |
4155 |
-} |
4156 |
- |
4157 |
-pkg_prerm() { |
4158 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4159 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4160 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4161 |
- |
4162 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4163 |
- sleep 10 |
4164 |
- eend 0 |
4165 |
- fi |
4166 |
-} |
4167 |
- |
4168 |
-pkg_postrm() { |
4169 |
- postgresql-config update |
4170 |
-} |
4171 |
- |
4172 |
-pkg_config() { |
4173 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4174 |
- |
4175 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4176 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4177 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
4178 |
- [[ -z "${DATA_DIR}" ]] \ |
4179 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
4180 |
- |
4181 |
- # environment.bz2 may not contain the same locale as the current system |
4182 |
- # locale. Unset and source from the current system locale. |
4183 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
4184 |
- unset LANG |
4185 |
- unset LC_CTYPE |
4186 |
- unset LC_NUMERIC |
4187 |
- unset LC_TIME |
4188 |
- unset LC_COLLATE |
4189 |
- unset LC_MONETARY |
4190 |
- unset LC_MESSAGES |
4191 |
- unset LC_ALL |
4192 |
- source "${EROOT}/etc/env.d/02locale" |
4193 |
- [ -n "${LANG}" ] && export LANG |
4194 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4195 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4196 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4197 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4198 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4199 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4200 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4201 |
- fi |
4202 |
- |
4203 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4204 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4205 |
- einfo |
4206 |
- einfo "Information on options that can be passed to initdb are found at:" |
4207 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4208 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4209 |
- einfo |
4210 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4211 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4212 |
- einfo " (none)" |
4213 |
- else |
4214 |
- einfo " ${PG_INITDB_OPTS}" |
4215 |
- fi |
4216 |
- einfo |
4217 |
- einfo "Configuration files will be installed to:" |
4218 |
- einfo " ${PGDATA}" |
4219 |
- einfo |
4220 |
- einfo "The database cluster will be created in:" |
4221 |
- einfo " ${DATA_DIR}" |
4222 |
- einfo |
4223 |
- |
4224 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
4225 |
- sleep 5 |
4226 |
- eend 0 |
4227 |
- |
4228 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4229 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4230 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4231 |
- die "${DATA_DIR} is not empty." |
4232 |
- fi |
4233 |
- |
4234 |
- einfo "Creating the data directory ..." |
4235 |
- if [[ ${EUID} == 0 ]] ; then |
4236 |
- mkdir -p "${DATA_DIR}" |
4237 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
4238 |
- chmod 0700 "${DATA_DIR}" |
4239 |
- fi |
4240 |
- |
4241 |
- einfo "Initializing the database ..." |
4242 |
- |
4243 |
- if [[ ${EUID} == 0 ]] ; then |
4244 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4245 |
- else |
4246 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4247 |
- fi |
4248 |
- |
4249 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4250 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4251 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4252 |
- fi |
4253 |
- |
4254 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
4255 |
- # overridden in the initscript |
4256 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
4257 |
- |
4258 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4259 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4260 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4261 |
- # characters in PL/Perl |
4262 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4263 |
- EOF |
4264 |
- |
4265 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4266 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4267 |
- einfo "by default. You can disable it in the cluster's:" |
4268 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4269 |
- einfo |
4270 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4271 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4272 |
- einfo |
4273 |
- if use prefix ; then |
4274 |
- einfo "The location of the configuration files have moved to:" |
4275 |
- einfo " ${PGDATA}" |
4276 |
- einfo "To start the server:" |
4277 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4278 |
- einfo "To stop:" |
4279 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4280 |
- einfo |
4281 |
- einfo "Or move the configuration files back:" |
4282 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4283 |
- else |
4284 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4285 |
- einfo "instead of 'pg_ctl'." |
4286 |
- fi |
4287 |
-} |
4288 |
- |
4289 |
-src_test() { |
4290 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4291 |
- emake check |
4292 |
- |
4293 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4294 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4295 |
- else |
4296 |
- use server || \ |
4297 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4298 |
- [[ ${UID} -eq 0 ]] || \ |
4299 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4300 |
- |
4301 |
- ewarn 'Skipping.' |
4302 |
- fi |
4303 |
-} |
4304 |
|
4305 |
diff --git a/dev-db/postgresql/postgresql-9.6.17.ebuild b/dev-db/postgresql/postgresql-9.6.17.ebuild |
4306 |
deleted file mode 100644 |
4307 |
index cc62ab8a0c1..00000000000 |
4308 |
--- a/dev-db/postgresql/postgresql-9.6.17.ebuild |
4309 |
+++ /dev/null |
4310 |
@@ -1,490 +0,0 @@ |
4311 |
-# Copyright 1999-2020 Gentoo Authors |
4312 |
-# Distributed under the terms of the GNU General Public License v2 |
4313 |
- |
4314 |
-EAPI=7 |
4315 |
- |
4316 |
-PYTHON_COMPAT=( python3_{6,7} ) |
4317 |
- |
4318 |
-PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN |
4319 |
- zh_TW" |
4320 |
- |
4321 |
-inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \ |
4322 |
- systemd user |
4323 |
- |
4324 |
-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" |
4325 |
- |
4326 |
-SLOT=$(ver_cut 1-2) |
4327 |
- |
4328 |
-MY_PV=${PV/_/} |
4329 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
4330 |
- |
4331 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
4332 |
- |
4333 |
-LICENSE="POSTGRESQL GPL-2" |
4334 |
-DESCRIPTION="PostgreSQL RDBMS" |
4335 |
-HOMEPAGE="https://www.postgresql.org/" |
4336 |
- |
4337 |
-IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl |
4338 |
- -pg-legacytimestamp python +readline selinux +server systemd ssl |
4339 |
- static-libs tcl threads uuid xml zlib" |
4340 |
- |
4341 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
4342 |
- |
4343 |
-CDEPEND=" |
4344 |
->=app-eselect/eselect-postgresql-2.0 |
4345 |
-sys-apps/less |
4346 |
-virtual/libintl |
4347 |
-kerberos? ( virtual/krb5 ) |
4348 |
-ldap? ( net-nds/openldap ) |
4349 |
-pam? ( sys-libs/pam ) |
4350 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4351 |
-python? ( ${PYTHON_DEPS} ) |
4352 |
-readline? ( sys-libs/readline:0= ) |
4353 |
-ssl? ( |
4354 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4355 |
- libressl? ( dev-libs/libressl:= ) |
4356 |
-) |
4357 |
-server? ( systemd? ( sys-apps/systemd ) ) |
4358 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4359 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4360 |
-zlib? ( sys-libs/zlib ) |
4361 |
-" |
4362 |
- |
4363 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4364 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4365 |
-# the libc includes UUID functions. |
4366 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
4367 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
4368 |
- |
4369 |
-nest_usedep() { |
4370 |
- local front back |
4371 |
- while [[ ${#} -gt 1 ]]; do |
4372 |
- front+="${1}? ( " |
4373 |
- back+=" )" |
4374 |
- shift |
4375 |
- done |
4376 |
- echo "${front}${1}${back}" |
4377 |
-} |
4378 |
- |
4379 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
4380 |
-CDEPEND+=" |
4381 |
-uuid? ( |
4382 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4383 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4384 |
-)" |
4385 |
- |
4386 |
-DEPEND="${CDEPEND} |
4387 |
-!!<sys-apps/sandbox-2.0 |
4388 |
-sys-devel/bison |
4389 |
-sys-devel/flex |
4390 |
-nls? ( sys-devel/gettext ) |
4391 |
-xml? ( virtual/pkgconfig ) |
4392 |
-" |
4393 |
- |
4394 |
-RDEPEND="${CDEPEND} |
4395 |
-!dev-db/postgresql-docs:${SLOT} |
4396 |
-!dev-db/postgresql-base:${SLOT} |
4397 |
-!dev-db/postgresql-server:${SLOT} |
4398 |
-selinux? ( sec-policy/selinux-postgresql ) |
4399 |
-" |
4400 |
- |
4401 |
-pkg_setup() { |
4402 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4403 |
- |
4404 |
- enewgroup postgres 70 |
4405 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
4406 |
- |
4407 |
- use python && python-single-r1_pkg_setup |
4408 |
-} |
4409 |
- |
4410 |
-src_prepare() { |
4411 |
- # Work around PPC{,64} compilation bug where bool is already defined |
4412 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
4413 |
- |
4414 |
- # Set proper run directory |
4415 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4416 |
- -i src/include/pg_config_manual.h || die |
4417 |
- |
4418 |
- # Rely on $PATH being in the proper order so that the correct |
4419 |
- # install program is used for modules utilizing PGXS in both |
4420 |
- # hardened and non-hardened environments. (Bug #528786) |
4421 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4422 |
- |
4423 |
- use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch" |
4424 |
- |
4425 |
- if use pam ; then |
4426 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4427 |
- -i src/backend/libpq/auth.c || \ |
4428 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4429 |
- fi |
4430 |
- |
4431 |
- eapply_user |
4432 |
-} |
4433 |
- |
4434 |
-src_configure() { |
4435 |
- case ${CHOST} in |
4436 |
- *-darwin*|*-solaris*) |
4437 |
- use nls && append-libs intl |
4438 |
- ;; |
4439 |
- esac |
4440 |
- |
4441 |
- export LDFLAGS_SL="${LDFLAGS}" |
4442 |
- export LDFLAGS_EX="${LDFLAGS}" |
4443 |
- |
4444 |
- local PO="${EPREFIX}" |
4445 |
- |
4446 |
- local i uuid_config="" |
4447 |
- if use uuid; then |
4448 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4449 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4450 |
- done |
4451 |
- for i in ${BSD_LIBC[@]}; do |
4452 |
- use ${i} && uuid_config="--with-uuid=bsd" |
4453 |
- done |
4454 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4455 |
- fi |
4456 |
- |
4457 |
- econf \ |
4458 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4459 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4460 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4461 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4462 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4463 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4464 |
- $(use_enable !alpha spinlocks) \ |
4465 |
- $(use_enable !pg-legacytimestamp integer-datetimes) \ |
4466 |
- $(use_enable debug) \ |
4467 |
- $(use_enable threads thread-safety) \ |
4468 |
- $(use_with kerberos gssapi) \ |
4469 |
- $(use_with ldap) \ |
4470 |
- $(use_with pam) \ |
4471 |
- $(use_with perl) \ |
4472 |
- $(use_with python) \ |
4473 |
- $(use_with readline) \ |
4474 |
- $(use_with ssl openssl) \ |
4475 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
4476 |
- $(use_with tcl) \ |
4477 |
- ${uuid_config} \ |
4478 |
- $(use_with xml libxml) \ |
4479 |
- $(use_with xml libxslt) \ |
4480 |
- $(use_with zlib) \ |
4481 |
- $(use_enable nls nls "'$(l10n_get_locales)'") |
4482 |
-} |
4483 |
- |
4484 |
-src_compile() { |
4485 |
- emake |
4486 |
- emake -C contrib |
4487 |
-} |
4488 |
- |
4489 |
-src_install() { |
4490 |
- emake DESTDIR="${D}" install |
4491 |
- emake DESTDIR="${D}" install -C contrib |
4492 |
- |
4493 |
- dodoc README HISTORY doc/{TODO,bug.template} |
4494 |
- |
4495 |
- # man pages are already built, but if we have the target make them, |
4496 |
- # they'll be generated from source before being installed so we |
4497 |
- # manually install man pages. |
4498 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4499 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4500 |
- doins -r doc/src/sgml/man{1,3,7} |
4501 |
- if ! use server; then |
4502 |
- # Remove man pages for non-existent binaries |
4503 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
4504 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4505 |
- done |
4506 |
- fi |
4507 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4508 |
- |
4509 |
- # Create slot specific man pages |
4510 |
- local bn f mansec slotted_name |
4511 |
- for mansec in 1 3 7 ; do |
4512 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
4513 |
- |
4514 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
4515 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
4516 |
- |
4517 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
4518 |
- bn=$(basename "${f}") |
4519 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
4520 |
- case ${bn} in |
4521 |
- TABLE.7|WITH.7) |
4522 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
4523 |
- ;; |
4524 |
- *) |
4525 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
4526 |
- ;; |
4527 |
- esac |
4528 |
- done |
4529 |
- |
4530 |
- popd > /dev/null |
4531 |
- done |
4532 |
- |
4533 |
- insinto /etc/postgresql-${SLOT} |
4534 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4535 |
- |
4536 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
4537 |
- # needed by extensions utilizing PGXS. |
4538 |
- use static-libs || \ |
4539 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
4540 |
- -delete |
4541 |
- |
4542 |
- local f bn |
4543 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
4544 |
- -mindepth 1 -maxdepth 1) |
4545 |
- do |
4546 |
- bn=$(basename "${f}") |
4547 |
- # Temporarily tack on tmp to workaround a file collision |
4548 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
4549 |
- # had this issue. |
4550 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
4551 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
4552 |
- done |
4553 |
- |
4554 |
- if use doc ; then |
4555 |
- docinto html |
4556 |
- dodoc doc/src/sgml/html/* |
4557 |
- |
4558 |
- docinto sgml |
4559 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
4560 |
- fi |
4561 |
- |
4562 |
- if use server; then |
4563 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4564 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
4565 |
- |
4566 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4567 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
4568 |
- |
4569 |
- if use systemd; then |
4570 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4571 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
4572 |
- systemd_newunit - ${PN}-${SLOT}.service |
4573 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
4574 |
- fi |
4575 |
- |
4576 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4577 |
- |
4578 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4579 |
- |
4580 |
- if use prefix ; then |
4581 |
- keepdir /run/postgresql |
4582 |
- fperms 1775 /run/postgresql |
4583 |
- fi |
4584 |
- fi |
4585 |
-} |
4586 |
- |
4587 |
-pkg_preinst() { |
4588 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
4589 |
- # /usr/bin/psql96). They may have been created by the |
4590 |
- # postgresql.eselect module, but they're handled within this ebuild |
4591 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
4592 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
4593 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
4594 |
- # handled in this manner. |
4595 |
- local canonicalise |
4596 |
- if type -p realpath > /dev/null; then |
4597 |
- canonicalise=realpath |
4598 |
- elif type -p readlink > /dev/null; then |
4599 |
- canonicalise='readlink -f' |
4600 |
- else |
4601 |
- # can't die, subshell |
4602 |
- die "No readlink nor realpath found, cannot canonicalise" |
4603 |
- fi |
4604 |
- |
4605 |
- local l |
4606 |
- # First remove any symlinks in /usr/bin that may have been created |
4607 |
- # by the old eselect |
4608 |
- for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
4609 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
4610 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
4611 |
- fi |
4612 |
- done |
4613 |
- |
4614 |
- # Then move the symlinks created by the ebuild to their proper place. |
4615 |
- for l in "${ED}"/usr/bin/*tmp ; do |
4616 |
- mv "${l}" "${l%tmp}" \ |
4617 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
4618 |
- done |
4619 |
-} |
4620 |
- |
4621 |
-pkg_postinst() { |
4622 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
4623 |
- postgresql-config update |
4624 |
- |
4625 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4626 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
4627 |
- |
4628 |
- if use server ; then |
4629 |
- elog |
4630 |
- elog "Gentoo specific documentation:" |
4631 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4632 |
- elog |
4633 |
- elog "Official documentation:" |
4634 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
4635 |
- elog |
4636 |
- elog "The default location of the Unix-domain socket is:" |
4637 |
- elog " ${EROOT}/run/postgresql/" |
4638 |
- elog |
4639 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4640 |
- elog "so that it contains your preferred locale in:" |
4641 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4642 |
- elog |
4643 |
- elog "Then, execute the following command to setup the initial database" |
4644 |
- elog "environment:" |
4645 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4646 |
- fi |
4647 |
-} |
4648 |
- |
4649 |
-pkg_prerm() { |
4650 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4651 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4652 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4653 |
- |
4654 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4655 |
- sleep 10 |
4656 |
- eend 0 |
4657 |
- fi |
4658 |
-} |
4659 |
- |
4660 |
-pkg_postrm() { |
4661 |
- postgresql-config update |
4662 |
-} |
4663 |
- |
4664 |
-pkg_config() { |
4665 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4666 |
- |
4667 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4668 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4669 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
4670 |
- [[ -z "${DATA_DIR}" ]] \ |
4671 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
4672 |
- |
4673 |
- # environment.bz2 may not contain the same locale as the current system |
4674 |
- # locale. Unset and source from the current system locale. |
4675 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
4676 |
- unset LANG |
4677 |
- unset LC_CTYPE |
4678 |
- unset LC_NUMERIC |
4679 |
- unset LC_TIME |
4680 |
- unset LC_COLLATE |
4681 |
- unset LC_MONETARY |
4682 |
- unset LC_MESSAGES |
4683 |
- unset LC_ALL |
4684 |
- source "${EROOT}/etc/env.d/02locale" |
4685 |
- [ -n "${LANG}" ] && export LANG |
4686 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4687 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4688 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4689 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4690 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4691 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4692 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4693 |
- fi |
4694 |
- |
4695 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4696 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
4697 |
- einfo |
4698 |
- einfo "Information on options that can be passed to initdb are found at:" |
4699 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4700 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4701 |
- einfo |
4702 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4703 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4704 |
- einfo " (none)" |
4705 |
- else |
4706 |
- einfo " ${PG_INITDB_OPTS}" |
4707 |
- fi |
4708 |
- einfo |
4709 |
- einfo "Configuration files will be installed to:" |
4710 |
- einfo " ${PGDATA}" |
4711 |
- einfo |
4712 |
- einfo "The database cluster will be created in:" |
4713 |
- einfo " ${DATA_DIR}" |
4714 |
- einfo |
4715 |
- |
4716 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
4717 |
- sleep 5 |
4718 |
- eend 0 |
4719 |
- |
4720 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4721 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4722 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4723 |
- die "${DATA_DIR} is not empty." |
4724 |
- fi |
4725 |
- |
4726 |
- einfo "Creating the data directory ..." |
4727 |
- if [[ ${EUID} == 0 ]] ; then |
4728 |
- mkdir -p "${DATA_DIR}" |
4729 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
4730 |
- chmod 0700 "${DATA_DIR}" |
4731 |
- fi |
4732 |
- |
4733 |
- einfo "Initializing the database ..." |
4734 |
- |
4735 |
- if [[ ${EUID} == 0 ]] ; then |
4736 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4737 |
- else |
4738 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4739 |
- fi |
4740 |
- |
4741 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4742 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4743 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4744 |
- fi |
4745 |
- |
4746 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
4747 |
- # overridden in the initscript |
4748 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
4749 |
- |
4750 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4751 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4752 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4753 |
- # characters in PL/Perl |
4754 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4755 |
- EOF |
4756 |
- |
4757 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4758 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4759 |
- einfo "by default. You can disable it in the cluster's:" |
4760 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4761 |
- einfo |
4762 |
- if ! use systemd; then |
4763 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4764 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4765 |
- einfo |
4766 |
- fi |
4767 |
- if use prefix ; then |
4768 |
- einfo "The location of the configuration files have moved to:" |
4769 |
- einfo " ${PGDATA}" |
4770 |
- einfo "To start the server:" |
4771 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4772 |
- einfo "To stop:" |
4773 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4774 |
- einfo |
4775 |
- einfo "Or move the configuration files back:" |
4776 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4777 |
- elif use systemd; then |
4778 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
4779 |
- einfo "instead of 'pg_ctl'." |
4780 |
- else |
4781 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4782 |
- einfo "instead of 'pg_ctl'." |
4783 |
- fi |
4784 |
-} |
4785 |
- |
4786 |
-src_test() { |
4787 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4788 |
- emake check |
4789 |
- |
4790 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4791 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4792 |
- else |
4793 |
- use server || \ |
4794 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4795 |
- [[ ${UID} -eq 0 ]] || \ |
4796 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4797 |
- |
4798 |
- ewarn 'Skipping.' |
4799 |
- fi |
4800 |
-} |
4801 |
|
4802 |
diff --git a/dev-db/postgresql/postgresql-9.6.18.ebuild b/dev-db/postgresql/postgresql-9.6.18.ebuild |
4803 |
deleted file mode 100644 |
4804 |
index 52f63bca1fb..00000000000 |
4805 |
--- a/dev-db/postgresql/postgresql-9.6.18.ebuild |
4806 |
+++ /dev/null |
4807 |
@@ -1,481 +0,0 @@ |
4808 |
-# Copyright 1999-2020 Gentoo Authors |
4809 |
-# Distributed under the terms of the GNU General Public License v2 |
4810 |
- |
4811 |
-EAPI=7 |
4812 |
- |
4813 |
-PYTHON_COMPAT=( python3_{6,7} ) |
4814 |
- |
4815 |
-inherit flag-o-matic linux-info multilib pam prefix python-single-r1 systemd |
4816 |
- |
4817 |
-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" |
4818 |
- |
4819 |
-SLOT=$(ver_cut 1-2) |
4820 |
- |
4821 |
-MY_PV=${PV/_/} |
4822 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
4823 |
- |
4824 |
-SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2" |
4825 |
- |
4826 |
-LICENSE="POSTGRESQL GPL-2" |
4827 |
-DESCRIPTION="PostgreSQL RDBMS" |
4828 |
-HOMEPAGE="https://www.postgresql.org/" |
4829 |
- |
4830 |
-IUSE="debug doc kerberos kernel_linux ldap libressl nls pam perl |
4831 |
- -pg-legacytimestamp python +readline selinux +server systemd ssl |
4832 |
- static-libs tcl threads uuid xml zlib" |
4833 |
- |
4834 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
4835 |
- |
4836 |
-CDEPEND=" |
4837 |
->=app-eselect/eselect-postgresql-2.0 |
4838 |
-acct-group/postgres |
4839 |
-acct-user/postgres |
4840 |
-sys-apps/less |
4841 |
-virtual/libintl |
4842 |
-kerberos? ( virtual/krb5 ) |
4843 |
-ldap? ( net-nds/openldap ) |
4844 |
-pam? ( sys-libs/pam ) |
4845 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4846 |
-python? ( ${PYTHON_DEPS} ) |
4847 |
-readline? ( sys-libs/readline:0= ) |
4848 |
-ssl? ( |
4849 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4850 |
- libressl? ( dev-libs/libressl:= ) |
4851 |
-) |
4852 |
-server? ( systemd? ( sys-apps/systemd ) ) |
4853 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4854 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4855 |
-zlib? ( sys-libs/zlib ) |
4856 |
-" |
4857 |
- |
4858 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4859 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4860 |
-# the libc includes UUID functions. |
4861 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
4862 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
4863 |
- |
4864 |
-nest_usedep() { |
4865 |
- local front back |
4866 |
- while [[ ${#} -gt 1 ]]; do |
4867 |
- front+="${1}? ( " |
4868 |
- back+=" )" |
4869 |
- shift |
4870 |
- done |
4871 |
- echo "${front}${1}${back}" |
4872 |
-} |
4873 |
- |
4874 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
4875 |
-CDEPEND+=" |
4876 |
-uuid? ( |
4877 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4878 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4879 |
-)" |
4880 |
- |
4881 |
-DEPEND="${CDEPEND} |
4882 |
-sys-devel/bison |
4883 |
-sys-devel/flex |
4884 |
-nls? ( sys-devel/gettext ) |
4885 |
-xml? ( virtual/pkgconfig ) |
4886 |
-" |
4887 |
- |
4888 |
-RDEPEND="${CDEPEND} |
4889 |
-selinux? ( sec-policy/selinux-postgresql ) |
4890 |
-" |
4891 |
- |
4892 |
-pkg_setup() { |
4893 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4894 |
- |
4895 |
- use python && python-single-r1_pkg_setup |
4896 |
-} |
4897 |
- |
4898 |
-src_prepare() { |
4899 |
- # Work around PPC{,64} compilation bug where bool is already defined |
4900 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
4901 |
- |
4902 |
- # Set proper run directory |
4903 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4904 |
- -i src/include/pg_config_manual.h || die |
4905 |
- |
4906 |
- # Rely on $PATH being in the proper order so that the correct |
4907 |
- # install program is used for modules utilizing PGXS in both |
4908 |
- # hardened and non-hardened environments. (Bug #528786) |
4909 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4910 |
- |
4911 |
- use server || eapply "${FILESDIR}/${PN}-${SLOT}.3-no-server.patch" |
4912 |
- |
4913 |
- if use pam ; then |
4914 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4915 |
- -i src/backend/libpq/auth.c || \ |
4916 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4917 |
- fi |
4918 |
- |
4919 |
- eapply_user |
4920 |
-} |
4921 |
- |
4922 |
-src_configure() { |
4923 |
- case ${CHOST} in |
4924 |
- *-darwin*|*-solaris*) |
4925 |
- use nls && append-libs intl |
4926 |
- ;; |
4927 |
- esac |
4928 |
- |
4929 |
- export LDFLAGS_SL="${LDFLAGS}" |
4930 |
- export LDFLAGS_EX="${LDFLAGS}" |
4931 |
- |
4932 |
- local PO="${EPREFIX}" |
4933 |
- |
4934 |
- local i uuid_config="" |
4935 |
- if use uuid; then |
4936 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4937 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4938 |
- done |
4939 |
- for i in ${BSD_LIBC[@]}; do |
4940 |
- use ${i} && uuid_config="--with-uuid=bsd" |
4941 |
- done |
4942 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4943 |
- fi |
4944 |
- |
4945 |
- econf \ |
4946 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4947 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4948 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4949 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4950 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4951 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4952 |
- $(use_enable !alpha spinlocks) \ |
4953 |
- $(use_enable !pg-legacytimestamp integer-datetimes) \ |
4954 |
- $(use_enable debug) \ |
4955 |
- $(use_enable threads thread-safety) \ |
4956 |
- $(use_with kerberos gssapi) \ |
4957 |
- $(use_with ldap) \ |
4958 |
- $(use_with pam) \ |
4959 |
- $(use_with perl) \ |
4960 |
- $(use_with python) \ |
4961 |
- $(use_with readline) \ |
4962 |
- $(use_with ssl openssl) \ |
4963 |
- $(usex server "$(use_with systemd)" '--without-systemd') \ |
4964 |
- $(use_with tcl) \ |
4965 |
- ${uuid_config} \ |
4966 |
- $(use_with xml libxml) \ |
4967 |
- $(use_with xml libxslt) \ |
4968 |
- $(use_with zlib) \ |
4969 |
- $(use_enable nls) |
4970 |
-} |
4971 |
- |
4972 |
-src_compile() { |
4973 |
- emake |
4974 |
- emake -C contrib |
4975 |
-} |
4976 |
- |
4977 |
-src_install() { |
4978 |
- emake DESTDIR="${D}" install |
4979 |
- emake DESTDIR="${D}" install -C contrib |
4980 |
- |
4981 |
- dodoc README HISTORY doc/{TODO,bug.template} |
4982 |
- |
4983 |
- # man pages are already built, but if we have the target make them, |
4984 |
- # they'll be generated from source before being installed so we |
4985 |
- # manually install man pages. |
4986 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4987 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4988 |
- doins -r doc/src/sgml/man{1,3,7} |
4989 |
- if ! use server; then |
4990 |
- # Remove man pages for non-existent binaries |
4991 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
4992 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4993 |
- done |
4994 |
- fi |
4995 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4996 |
- |
4997 |
- # Create slot specific man pages |
4998 |
- local bn f mansec slotted_name |
4999 |
- for mansec in 1 3 7 ; do |
5000 |
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}" |
5001 |
- |
5002 |
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir" |
5003 |
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed" |
5004 |
- |
5005 |
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do |
5006 |
- bn=$(basename "${f}") |
5007 |
- slotted_name=${bn%.${mansec}}${SLOT/.}.${mansec} |
5008 |
- case ${bn} in |
5009 |
- TABLE.7|WITH.7) |
5010 |
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name} |
5011 |
- ;; |
5012 |
- *) |
5013 |
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name} |
5014 |
- ;; |
5015 |
- esac |
5016 |
- done |
5017 |
- |
5018 |
- popd > /dev/null |
5019 |
- done |
5020 |
- |
5021 |
- insinto /etc/postgresql-${SLOT} |
5022 |
- newins src/bin/psql/psqlrc.sample psqlrc |
5023 |
- |
5024 |
- # Don't delete libpg{port,common}.a (Bug #571046). They're always |
5025 |
- # needed by extensions utilizing PGXS. |
5026 |
- use static-libs || \ |
5027 |
- find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \ |
5028 |
- -delete |
5029 |
- |
5030 |
- local f bn |
5031 |
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ |
5032 |
- -mindepth 1 -maxdepth 1) |
5033 |
- do |
5034 |
- bn=$(basename "${f}") |
5035 |
- # Temporarily tack on tmp to workaround a file collision |
5036 |
- # issue. This is only necessary for 9.7 and earlier. 10 never |
5037 |
- # had this issue. |
5038 |
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ |
5039 |
- "/usr/bin/${bn}${SLOT/.}tmp" |
5040 |
- done |
5041 |
- |
5042 |
- if use doc ; then |
5043 |
- docinto html |
5044 |
- dodoc doc/src/sgml/html/* |
5045 |
- |
5046 |
- docinto sgml |
5047 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
5048 |
- fi |
5049 |
- |
5050 |
- if use server; then |
5051 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5052 |
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT} |
5053 |
- |
5054 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5055 |
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT} |
5056 |
- |
5057 |
- if use systemd; then |
5058 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5059 |
- "${FILESDIR}/${PN}.service-9.6-r1" | \ |
5060 |
- systemd_newunit - ${PN}-${SLOT}.service |
5061 |
- systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf |
5062 |
- fi |
5063 |
- |
5064 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
5065 |
- |
5066 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
5067 |
- |
5068 |
- if use prefix ; then |
5069 |
- keepdir /run/postgresql |
5070 |
- fperms 1775 /run/postgresql |
5071 |
- fi |
5072 |
- fi |
5073 |
-} |
5074 |
- |
5075 |
-pkg_preinst() { |
5076 |
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., |
5077 |
- # /usr/bin/psql96). They may have been created by the |
5078 |
- # postgresql.eselect module, but they're handled within this ebuild |
5079 |
- # now. It's alright if we momentarily delete /usr/bin/psql as it |
5080 |
- # will be recreated by the eselect module in pkg_ppostinst(). This |
5081 |
- # is only necessary for 9.7 and earlier. 10 and later were never |
5082 |
- # handled in this manner. |
5083 |
- local canonicalise |
5084 |
- if type -p realpath > /dev/null; then |
5085 |
- canonicalise=realpath |
5086 |
- elif type -p readlink > /dev/null; then |
5087 |
- canonicalise='readlink -f' |
5088 |
- else |
5089 |
- # can't die, subshell |
5090 |
- die "No readlink nor realpath found, cannot canonicalise" |
5091 |
- fi |
5092 |
- |
5093 |
- local l |
5094 |
- # First remove any symlinks in /usr/bin that may have been created |
5095 |
- # by the old eselect |
5096 |
- for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do |
5097 |
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then |
5098 |
- rm "${l}" || ewarn "Couldn't remove ${l}" |
5099 |
- fi |
5100 |
- done |
5101 |
- |
5102 |
- # Then move the symlinks created by the ebuild to their proper place. |
5103 |
- for l in "${ED}"/usr/bin/*tmp ; do |
5104 |
- mv "${l}" "${l%tmp}" \ |
5105 |
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" |
5106 |
- done |
5107 |
-} |
5108 |
- |
5109 |
-pkg_postinst() { |
5110 |
- use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf |
5111 |
- postgresql-config update |
5112 |
- |
5113 |
- elog "If you need a global psqlrc-file, you can place it in:" |
5114 |
- elog " ${EROOT}/etc/postgresql-${SLOT}/" |
5115 |
- |
5116 |
- if use server ; then |
5117 |
- elog |
5118 |
- elog "Gentoo specific documentation:" |
5119 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
5120 |
- elog |
5121 |
- elog "Official documentation:" |
5122 |
- elog "https://www.postgresql.org/docs/${SLOT}/static/index.html" |
5123 |
- elog |
5124 |
- elog "The default location of the Unix-domain socket is:" |
5125 |
- elog " ${EROOT}/run/postgresql/" |
5126 |
- elog |
5127 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
5128 |
- elog "so that it contains your preferred locale in:" |
5129 |
- elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5130 |
- elog |
5131 |
- elog "Then, execute the following command to setup the initial database" |
5132 |
- elog "environment:" |
5133 |
- elog " emerge --config =${CATEGORY}/${PF}" |
5134 |
- fi |
5135 |
-} |
5136 |
- |
5137 |
-pkg_prerm() { |
5138 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
5139 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
5140 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
5141 |
- |
5142 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
5143 |
- sleep 10 |
5144 |
- eend 0 |
5145 |
- fi |
5146 |
-} |
5147 |
- |
5148 |
-pkg_postrm() { |
5149 |
- postgresql-config update |
5150 |
-} |
5151 |
- |
5152 |
-pkg_config() { |
5153 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
5154 |
- |
5155 |
- [[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \ |
5156 |
- && source "${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5157 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/" |
5158 |
- [[ -z "${DATA_DIR}" ]] \ |
5159 |
- && DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data" |
5160 |
- |
5161 |
- # environment.bz2 may not contain the same locale as the current system |
5162 |
- # locale. Unset and source from the current system locale. |
5163 |
- if [ -f "${EROOT}/etc/env.d/02locale" ]; then |
5164 |
- unset LANG |
5165 |
- unset LC_CTYPE |
5166 |
- unset LC_NUMERIC |
5167 |
- unset LC_TIME |
5168 |
- unset LC_COLLATE |
5169 |
- unset LC_MONETARY |
5170 |
- unset LC_MESSAGES |
5171 |
- unset LC_ALL |
5172 |
- source "${EROOT}/etc/env.d/02locale" |
5173 |
- [ -n "${LANG}" ] && export LANG |
5174 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
5175 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
5176 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
5177 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
5178 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
5179 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
5180 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
5181 |
- fi |
5182 |
- |
5183 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
5184 |
- einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}" |
5185 |
- einfo |
5186 |
- einfo "Information on options that can be passed to initdb are found at:" |
5187 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
5188 |
- einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
5189 |
- einfo |
5190 |
- einfo "PG_INITDB_OPTS is currently set to:" |
5191 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
5192 |
- einfo " (none)" |
5193 |
- else |
5194 |
- einfo " ${PG_INITDB_OPTS}" |
5195 |
- fi |
5196 |
- einfo |
5197 |
- einfo "Configuration files will be installed to:" |
5198 |
- einfo " ${PGDATA}" |
5199 |
- einfo |
5200 |
- einfo "The database cluster will be created in:" |
5201 |
- einfo " ${DATA_DIR}" |
5202 |
- einfo |
5203 |
- |
5204 |
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)" |
5205 |
- sleep 5 |
5206 |
- eend 0 |
5207 |
- |
5208 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
5209 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
5210 |
- eerror "Modify DATA_DIR to point to an empty directory." |
5211 |
- die "${DATA_DIR} is not empty." |
5212 |
- fi |
5213 |
- |
5214 |
- einfo "Creating the data directory ..." |
5215 |
- if [[ ${EUID} == 0 ]] ; then |
5216 |
- mkdir -p "${DATA_DIR}" |
5217 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
5218 |
- chmod 0700 "${DATA_DIR}" |
5219 |
- fi |
5220 |
- |
5221 |
- einfo "Initializing the database ..." |
5222 |
- |
5223 |
- if [[ ${EUID} == 0 ]] ; then |
5224 |
- su postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
5225 |
- else |
5226 |
- "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
5227 |
- fi |
5228 |
- |
5229 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
5230 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
5231 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
5232 |
- fi |
5233 |
- |
5234 |
- # unix_socket_directory has no effect in postgresql.conf as it's |
5235 |
- # overridden in the initscript |
5236 |
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf |
5237 |
- |
5238 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
5239 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
5240 |
- # On the off-chance that you might need to work with UTF-8 encoded |
5241 |
- # characters in PL/Perl |
5242 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
5243 |
- EOF |
5244 |
- |
5245 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
5246 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
5247 |
- einfo "by default. You can disable it in the cluster's:" |
5248 |
- einfo " ${PGDATA%/}/postgresql.conf" |
5249 |
- einfo |
5250 |
- if ! use systemd; then |
5251 |
- einfo "The PostgreSQL server, by default, will log events to:" |
5252 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
5253 |
- einfo |
5254 |
- fi |
5255 |
- if use prefix ; then |
5256 |
- einfo "The location of the configuration files have moved to:" |
5257 |
- einfo " ${PGDATA}" |
5258 |
- einfo "To start the server:" |
5259 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
5260 |
- einfo "To stop:" |
5261 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
5262 |
- einfo |
5263 |
- einfo "Or move the configuration files back:" |
5264 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
5265 |
- elif use systemd; then |
5266 |
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL" |
5267 |
- einfo "instead of 'pg_ctl'." |
5268 |
- else |
5269 |
- einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
5270 |
- einfo "instead of 'pg_ctl'." |
5271 |
- fi |
5272 |
-} |
5273 |
- |
5274 |
-src_test() { |
5275 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
5276 |
- emake check |
5277 |
- |
5278 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
5279 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
5280 |
- else |
5281 |
- use server || \ |
5282 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
5283 |
- [[ ${UID} -eq 0 ]] || \ |
5284 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
5285 |
- |
5286 |
- ewarn 'Skipping.' |
5287 |
- fi |
5288 |
-} |