Gentoo Archives: gentoo-commits

From: Aaron Swenson <titanofold@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/postgresql/
Date: Thu, 31 Mar 2016 14:03:53
Message-Id: 1459432755.b2d0a204703f79a7f320e4cf9be6a09904fe91d6.titanofold@gentoo
1 commit: b2d0a204703f79a7f320e4cf9be6a09904fe91d6
2 Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 31 13:58:16 2016 +0000
4 Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 31 13:59:15 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2d0a204
7
8 dev-db/postgresql: Security Update
9
10 Fixes security bug 578680.
11
12 See http://www.postgresql.org/about/news/1656/ for complete release
13 announcement.
14
15 Closes security hole CVE-2016-2193, where a query plan might get reused for more than one ROLE in the same session.
16
17 Fixes CVE-2016-3065, a server crash bug triggered by using pageinspect with BRIN index pages.
18
19 Additionally, support for Python 3.5 was added for PostgreSQL 9.5.
20
21 Bug: 578680, 574646
22
23 Package-Manager: portage-2.2.26
24
25 dev-db/postgresql/Manifest | 5 +
26 ...gresql-9999.ebuild => postgresql-9.1.21.ebuild} | 164 +++++++++---------
27 ...gresql-9999.ebuild => postgresql-9.2.16.ebuild} | 150 +++++++++--------
28 ...gresql-9999.ebuild => postgresql-9.3.12.ebuild} | 147 ++++++++--------
29 ...tgresql-9999.ebuild => postgresql-9.4.7.ebuild} | 183 ++++++++++++--------
30 ...tgresql-9999.ebuild => postgresql-9.5.2.ebuild} | 185 +++++++++++++--------
31 dev-db/postgresql/postgresql-9999.ebuild | 4 +-
32 7 files changed, 485 insertions(+), 353 deletions(-)
33
34 diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
35 index 7ca6a8b..afa033f 100644
36 --- a/dev-db/postgresql/Manifest
37 +++ b/dev-db/postgresql/Manifest
38 @@ -1,10 +1,15 @@
39 DIST postgresql-9.0.23.tar.bz2 15045569 SHA256 3dbcbe19c814139a3f4be8bc6b49db804753cbc49979f345083e835c52b4d7de SHA512 db8fe64a5a5a1caae97e792ee5b8bcc375c6d6e10ef9c35f1003f174745568854dc5a7a58dbaf46794dcd35dee5a13f6eb1ba356f9618134b601b7759c753c9f WHIRLPOOL 5177facff628271a0d57d1f2925cfc04796020492c4102f0b0c6fa34149da9ddd9ccb0a38629e320521fe82163bdd4aa56f74af3a887ff4389cd9f62e921c53a
40 DIST postgresql-9.1.19.tar.bz2 15843978 SHA256 cbd5057451147dd63a1e764176a4e17a7795773be1e4266ea9faa951064c0ec6 SHA512 23dd4108556edcc667f599c5663356a1106bc239a1c5337d153c13a1e1871d52316825b84802bbc1d79612dfa4c9c77f4c4b96d59d23d7338988bdf370e956d4 WHIRLPOOL 6845fd8071032e987ab65a642ca04adbc8b464332bac8c346f01e011411947aa4341ea596fd910342124fcbae4cc25410c25ab695894b0b68d20441df5424722
41 DIST postgresql-9.1.20.tar.bz2 15844360 SHA256 6d1e6c4334c265a85f0f96407b7a9aafff0f26cb62db2d8d03a32ba0c2872937 SHA512 ebec6aae593058276dda2404812d89f3df637ceac24d96de1a774da03cf58ea9ce44819e18549040b6f6d811f2c8203462e13788df7158d45a0fe9dfb72d0fd9 WHIRLPOOL de990c029949c8ef372d3440c4cbb870739bf5b83c438ba2b012004cabcb077bab1258b2115ceb239eafefe73f282ea729384085e3f682240cb40ed662f350e5
42 +DIST postgresql-9.1.21.tar.bz2 15850128 SHA256 d66ee9076f3149a4cab4be3c6f47e13bc047138d17dfcb531ad01f78cfdeb393 SHA512 75a96ce2c080b2e657b6f591e18c4778635a9f8c74870bbe7c99cb82bf1dfaad124942214ab6e3079b565c41b7fc77af1a4a49672e7ddba075374402c8832a5b WHIRLPOOL 4de012763b985d1fa675e151d68988f4dd4de4ae8860d67fab3818666b3e135849465a0a41bc1f073eb4d679415fb18871f8156c99376c7860c51258e607771e
43 DIST postgresql-9.2.14.tar.bz2 16451398 SHA256 54c20b3f320a48c38487f2711e98b2fa3f9ce4305905a294ad0449e8b4fb292e SHA512 268015d9e397ee62eebbbc9abf1ee25d0d4aa6bf5943b404009b3aab31f485b8523353c679beed34cc00304b9d4c7aca9de0ba841d9841dbf885d05d1a5692a1 WHIRLPOOL 4f6d5d6989a67d14082ddb215411b55d0dc0be29772e6a593b4df133489ff4a7e6c265d0830adba64d4c6be47e17a949cbc21d6570dceb9362399649af2be88e
44 DIST postgresql-9.2.15.tar.bz2 16480973 SHA256 7ced4807589899e83c64dd0803cf1f9782b6a20077ab545c66e868ef26543e60 SHA512 4a0e52beaffc9f0b004c761a5ca107a019d6265877d36cd7be46912807da6fa6824ce469c8d59fb24092440646d3f0872b8aa62941b4b3ba657edc2f5678b2b1 WHIRLPOOL 58607fcd1adc474f6a78741527b4192e30ac8e87d83a80fa71b6660ac1665a9ab5ee062ae19c919b288df607854ab55866e00e0228ffc6bd1b71dd59c18d83bd
45 +DIST postgresql-9.2.16.tar.bz2 16490199 SHA256 d2164cb8706bf828161871c195299841c5be1fbd9bc85d7866704e54f0741b11 SHA512 0f0b317473b4b42ae4261993c704a7c6cd28c7e6bd83e77a81850695655baa473d7d52e97441ee5500d646d405c84145a54f42b9bae89a0ddfebb0418d608820 WHIRLPOOL 8dfdca52555889d20e857ecc01ee75a14fd18bb7fa1ac50f5d54415a423d62223d0d389d43b143ae927446946aaff06b68cbf8214e26e2f432c39a50c0296b08
46 DIST postgresql-9.3.10.tar.bz2 16995860 SHA256 e5444f0f76aff98a251400b7c28bc361d65e3d72d8d6cb9bb5d8361a69541531 SHA512 6b048fd1d0b38f72bab6ea70e40f10e7b805b94fc4c6fd865e0ec5e86da3c54043f20059dbf716d29eb4ca787dc50da561b1c7b48ab9f3096ebc651300855672 WHIRLPOOL b8ea15a04d18535662832d444b556aedffaa8c954b52dcd42d548f53f93b8a9dbfbe9298f63c26d44c8b757e8c10d76711c303cd83c84d9c86bf23c2837e74ce
47 DIST postgresql-9.3.11.tar.bz2 17047707 SHA256 3d222a90c941d3a6c02c7c749fc9eb54ff20a1166570459d09c5476743496a21 SHA512 8da91e11e0a6502c185931b6e47ba8e583d3360009f26ad703552be9a216b2c37a688894d4ea867c529c4135b6c36da26e9d7ef52a411b0c68ad50a53ff3cdb3 WHIRLPOOL cc1251553ec902dc1998c2bad11460206064c0d55140601b96293d98774f9622d38fa49f758e2f69ed6cb27ee14dd0a20f6ec41f655a4793b255168dfd430815
48 +DIST postgresql-9.3.12.tar.bz2 17052755 SHA256 f3339ea23f86d07f3730adc878b2e5d433087ff44aad65a5ec9c22c32b112e67 SHA512 d88cb167ca78bd8588e3ff9b3f13b77f661e3ddec7e5b726cc0a46512db2584b15ce5f691fe7e4ab84855f102cb88014245921a38f5da41ad19e762a88968883 WHIRLPOOL 8738e18f8534f70ddbfa7c0c0ae1ab585330cb9df2d2da3a3e5f5c15a2e5070aebd38124b7295214e0105c482a79011d00c8cbe2a9061edc90bfd5ed07000dcb
49 DIST postgresql-9.4.5.tar.bz2 17660960 SHA256 b87c50c66b6ea42a9712b5f6284794fabad0616e6ae420cf0f10523be6d94a39 SHA512 01ad4b5a097efa70f74a9e96b764c32953a9df57d6bf81b893a1e552475f6aba0381580dcd1f27b2c443ce89fecc429eeeb0219af60a0b2f84798f76eb1757f5 WHIRLPOOL 8ea0e9a40cefa53568071f2137bac996898f9bd486cfb5cfcf8bb49590816833f37878f10caabffb9d3127e047f00c916b8830594a485ebe16fb9fe6fc834c95
50 DIST postgresql-9.4.6.tar.bz2 17734946 SHA256 cbce1f4d01a6142c5d8bebe125623c5198ec04f363da7dd3d3b3a4100b4140a6 SHA512 03e2c68ec7fb40b4886885136692e96ed5d7e50ead8ebd094ede402eeb8ed94a791357e8eff2776a2e4a537ced3d900e032779a33c1fbd920588d89f8b6705ee WHIRLPOOL d25073985dc9974064175bf8b90f7a18368882c8d62fdb403183121452624bfb50c10c181bdc4b6a076d515dc29e081cf913793653f04ced98a48640dab9b3ff
51 +DIST postgresql-9.4.7.tar.bz2 17746987 SHA256 cc795e6c35b30e697e5891e3056376af685f848a4e67fab1702e74a2385f81e0 SHA512 e61d74a4a9caeb7d4a3fb9509b37aaeb5bd563d61d20739edd777ec990c92011286a7485f275178f9f8c1ebb8c84a98290e2b5351b11e0f9a1baa781f323e374 WHIRLPOOL 2ae25affc35e12fd250161585bc5cf318930d9864c9fccbf44c9bd697933aa75860467256b811501947c0fad8c6cdc0622889e9991904a4db9fda2d19efa2b37
52 DIST postgresql-9.5.1.tar.bz2 18441638 SHA256 6b309d8506a39773a752ff074f47656e5424576ea090b04a24fe1725958c5bd2 SHA512 fcb2b3bde51c4152b3a72764de1f9b4e607cb591571ed5bc1187b2c6938c33e21bdd512694a969a03c046e4889a129bb0e75fa676d55a1a1e77142da1e984192 WHIRLPOOL 2fdbae2c58ce4255b514055ada220b25269a01719c202e1d1ae86d408fd56b523f1a4e16ef5abd675b0fbf0675c1eabca7d0f5f2e8fdb9cdc3a3d98e7b755aeb
53 +DIST postgresql-9.5.2.tar.bz2 18446616 SHA256 f8d132e464506b551ef498719f18cfe9d777709c7a1589dc360afc0b20e47c41 SHA512 ba31dddee8a960a4b1a97394eae5ea7efaa5e74e21c755882efcef90404676c6052dff55f40b585932e4f752cbcda5ceac0e29d601ea6651cfbab7a49190381a WHIRLPOOL 0b9abe3a5b3933485e5d0b2c08daa20d421e5920ae5b4640b36971463915d7e7b2767575564d80bb5dfa3a353c646c9c4ca8e483dfd64df39370774e76fa1cee
54
55 diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9.1.21.ebuild
56 similarity index 71%
57 copy from dev-db/postgresql/postgresql-9999.ebuild
58 copy to dev-db/postgresql/postgresql-9.1.21.ebuild
59 index 0f52d99..8b01b60 100644
60 --- a/dev-db/postgresql/postgresql-9999.ebuild
61 +++ b/dev-db/postgresql/postgresql-9.1.21.ebuild
62 @@ -1,20 +1,23 @@
63 -# Copyright 1999-2015 Gentoo Foundation
64 +# Copyright 1999-2016 Gentoo Foundation
65 # Distributed under the terms of the GNU General Public License v2
66 # $Id$
67
68 EAPI="5"
69
70 +# Testing within Portage's environment is broken, and the patch no
71 +# longer applies cleanly.
72 +RESTRICT="test"
73 +
74 PYTHON_COMPAT=( python{2_7,3_4} )
75
76 -inherit base eutils flag-o-matic git-2 linux-info multilib pam prefix \
77 - python-single-r1 systemd user versionator
78 +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
79 + systemd user versionator
80
81 -KEYWORDS=""
82 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
83
84 -# Fix if needed
85 -SLOT="9.6"
86 +SLOT="$(get_version_component_range 1-2)"
87
88 -EGIT_REPO_URI="git://git.postgresql.org/git/postgresql.git"
89 +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
90
91 LICENSE="POSTGRESQL GPL-2"
92 DESCRIPTION="PostgreSQL RDBMS"
93 @@ -22,7 +25,7 @@ HOMEPAGE="http://www.postgresql.org/"
94
95 LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
96 zh_CN zh_TW"
97 -IUSE="kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
98 +IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
99 +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
100
101 for lingua in ${LINGUAS}; do
102 @@ -61,23 +64,11 @@ zlib? ( sys-libs/zlib )
103
104 DEPEND="${CDEPEND}
105 !!<sys-apps/sandbox-2.0
106 ->=dev-lang/perl-5.8
107 -app-text/docbook-dsssl-stylesheets
108 -app-text/docbook-sgml-dtd:4.2
109 -app-text/docbook-xml-dtd:4.2
110 -app-text/docbook-xsl-stylesheets
111 -app-text/openjade
112 -dev-libs/libxml2
113 -dev-libs/libxslt
114 sys-devel/bison
115 sys-devel/flex
116 nls? ( sys-devel/gettext )
117 xml? ( virtual/pkgconfig )
118 "
119 -src_unpack() {
120 - base_src_unpack
121 - git-2_src_unpack
122 -}
123
124 RDEPEND="${CDEPEND}
125 !dev-db/postgresql-docs:${SLOT}
126 @@ -86,17 +77,8 @@ RDEPEND="${CDEPEND}
127 selinux? ( sec-policy/selinux-postgresql )
128 "
129
130 -pkg_pretend() {
131 - ewarn "You are using a live ebuild that uses the current source code as it is"
132 - ewarn "available from PostgreSQL's Git repository at emerge time. Given such,"
133 - ewarn "the GNU Makefiles may be altered by upstream without notice and the"
134 - ewarn "documentation for this live version is not readily available"
135 - ewarn "online. Ergo, the ebuild maintainers will not support building a"
136 - ewarn "client-only and/or document-free version."
137 -}
138 -
139 pkg_setup() {
140 - CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
141 + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
142
143 enewgroup postgres 70
144 enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
145 @@ -112,10 +94,13 @@ src_prepare() {
146 sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
147 -i src/include/pg_config_manual.h || die
148
149 - # Rely on $PATH being in the proper order so that the correct
150 - # install program is used for modules utilizing PGXS in both
151 - # hardened and non-hardened environments. (Bug #528786)
152 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
153 + epatch "${FILESDIR}/pg_ctl-exit-status.patch"
154 +
155 + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
156 +
157 + # Fix bug 486556 where the server would crash at start up because of
158 + # an infinite loop caused by a self-referencing symlink.
159 + epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch"
160
161 if use pam ; then
162 sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
163 @@ -149,6 +134,7 @@ src_configure() {
164 $(use_enable !pg_legacytimestamp integer-datetimes) \
165 $(use_enable threads thread-safety) \
166 $(use_with kerberos gssapi) \
167 + $(use_with kerberos krb5) \
168 $(use_with ldap) \
169 $(use_with pam) \
170 $(use_with perl) \
171 @@ -164,14 +150,30 @@ src_configure() {
172 }
173
174 src_compile() {
175 - emake world
176 + emake
177 + emake -C contrib
178 }
179
180 src_install() {
181 - emake DESTDIR="${D}" install-world
182 + emake DESTDIR="${D}" install
183 + emake DESTDIR="${D}" install -C contrib
184
185 dodoc README HISTORY doc/{TODO,bug.template}
186
187 + # man pages are already built, but if we have the target make them,
188 + # they'll be generated from source before being installed so we
189 + # manually install man pages.
190 + # We use ${SLOT} instead of doman for postgresql.eselect
191 + insinto /usr/share/postgresql-${SLOT}/man/
192 + doins -r doc/src/sgml/man{1,3,7}
193 + if ! use server; then
194 + # Remove man pages for non-existent binaries
195 + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
196 + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
197 + done
198 + fi
199 + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
200 +
201 insinto /etc/postgresql-${SLOT}
202 newins src/bin/psql/psqlrc.sample psqlrc
203
204 @@ -181,23 +183,33 @@ src_install() {
205
206 use static-libs || find "${ED}" -name '*.a' -delete
207
208 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
209 - "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
210 + if use doc ; then
211 + docinto html
212 + dodoc doc/src/sgml/html/*
213 +
214 + docinto sgml
215 + dodoc doc/src/sgml/*.{sgml,dsl}
216 + fi
217
218 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
219 - "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
220 + if use server; then
221 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
222 + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
223
224 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
225 - "${FILESDIR}/${PN}.service" | \
226 - systemd_newunit - ${PN}-${SLOT}.service
227 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
228 + "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT}
229
230 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
231 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
232 + "${FILESDIR}/${PN}.service" | \
233 + systemd_newunit - ${PN}-${SLOT}.service
234
235 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
236 + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
237
238 - if use prefix ; then
239 - keepdir /run/postgresql
240 - fperms 0775 /run/postgresql
241 + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
242 +
243 + if use prefix ; then
244 + keepdir /run/postgresql
245 + fperms 0775 /run/postgresql
246 + fi
247 fi
248 }
249
250 @@ -215,27 +227,29 @@ pkg_postinst() {
251 elog " source /etc/profile"
252 fi
253
254 - elog
255 - elog "Gentoo specific documentation:"
256 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
257 - elog
258 - elog "Official documentation:"
259 - elog "${EROOT%/}/usr/share/doc/${PF}/html"
260 - elog
261 - elog "The default location of the Unix-domain socket is:"
262 - elog " ${EROOT%/}/run/postgresql/"
263 - elog
264 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
265 - elog "so that it contains your preferred locale, and other options, in:"
266 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
267 - elog
268 - elog "Then, execute the following command to setup the initial database"
269 - elog "environment:"
270 - elog " emerge --config =${CATEGORY}/${PF}"
271 + if use server ; then
272 + elog
273 + elog "Gentoo specific documentation:"
274 + elog "https://wiki.gentoo.org/wiki/PostgreSQL"
275 + elog
276 + elog "Official documentation:"
277 + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
278 + elog
279 + elog "The default location of the Unix-domain socket is:"
280 + elog " ${EROOT%/}/run/postgresql/"
281 + elog
282 + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
283 + elog "so that it contains your preferred locale in:"
284 + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
285 + elog
286 + elog "Then, execute the following command to setup the initial database"
287 + elog "environment:"
288 + elog " emerge --config =${CATEGORY}/${PF}"
289 + fi
290 }
291
292 pkg_prerm() {
293 - if [[ -z ${REPLACED_BY_VERSION} ]] ; then
294 + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
295 ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
296 ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
297
298 @@ -250,6 +264,8 @@ pkg_postrm() {
299 }
300
301 pkg_config() {
302 + use server || die "USE flag 'server' not enabled. Nothing to configure."
303 +
304 [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
305 && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
306 [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
307 @@ -366,19 +382,3 @@ pkg_config() {
308 einfo "instead of 'pg_ctl'."
309 fi
310 }
311 -
312 -src_test() {
313 - einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
314 -
315 - if [[ ${UID} -ne 0 ]] ; then
316 - emake check
317 -
318 - einfo "If you think other tests besides the regression tests are necessary, please"
319 - einfo "submit a bug including a patch for this ebuild to enable them."
320 - else
321 - [[ ${UID} -eq 0 ]] || \
322 - ewarn "Tests cannot be run as root. Enable 'userpriv' in FEATURES."
323 -
324 - ewarn "Skipping."
325 - fi
326 -}
327
328 diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9.2.16.ebuild
329 similarity index 72%
330 copy from dev-db/postgresql/postgresql-9999.ebuild
331 copy to dev-db/postgresql/postgresql-9.2.16.ebuild
332 index 0f52d99..0b35b47 100644
333 --- a/dev-db/postgresql/postgresql-9999.ebuild
334 +++ b/dev-db/postgresql/postgresql-9.2.16.ebuild
335 @@ -1,4 +1,4 @@
336 -# Copyright 1999-2015 Gentoo Foundation
337 +# Copyright 1999-2016 Gentoo Foundation
338 # Distributed under the terms of the GNU General Public License v2
339 # $Id$
340
341 @@ -6,15 +6,14 @@ EAPI="5"
342
343 PYTHON_COMPAT=( python{2_7,3_4} )
344
345 -inherit base eutils flag-o-matic git-2 linux-info multilib pam prefix \
346 - python-single-r1 systemd user versionator
347 +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
348 + systemd user versionator
349
350 -KEYWORDS=""
351 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
352
353 -# Fix if needed
354 -SLOT="9.6"
355 +SLOT="$(get_version_component_range 1-2)"
356
357 -EGIT_REPO_URI="git://git.postgresql.org/git/postgresql.git"
358 +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
359
360 LICENSE="POSTGRESQL GPL-2"
361 DESCRIPTION="PostgreSQL RDBMS"
362 @@ -22,7 +21,7 @@ HOMEPAGE="http://www.postgresql.org/"
363
364 LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
365 zh_CN zh_TW"
366 -IUSE="kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
367 +IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
368 +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
369
370 for lingua in ${LINGUAS}; do
371 @@ -61,23 +60,11 @@ zlib? ( sys-libs/zlib )
372
373 DEPEND="${CDEPEND}
374 !!<sys-apps/sandbox-2.0
375 ->=dev-lang/perl-5.8
376 -app-text/docbook-dsssl-stylesheets
377 -app-text/docbook-sgml-dtd:4.2
378 -app-text/docbook-xml-dtd:4.2
379 -app-text/docbook-xsl-stylesheets
380 -app-text/openjade
381 -dev-libs/libxml2
382 -dev-libs/libxslt
383 sys-devel/bison
384 sys-devel/flex
385 nls? ( sys-devel/gettext )
386 xml? ( virtual/pkgconfig )
387 "
388 -src_unpack() {
389 - base_src_unpack
390 - git-2_src_unpack
391 -}
392
393 RDEPEND="${CDEPEND}
394 !dev-db/postgresql-docs:${SLOT}
395 @@ -86,17 +73,8 @@ RDEPEND="${CDEPEND}
396 selinux? ( sec-policy/selinux-postgresql )
397 "
398
399 -pkg_pretend() {
400 - ewarn "You are using a live ebuild that uses the current source code as it is"
401 - ewarn "available from PostgreSQL's Git repository at emerge time. Given such,"
402 - ewarn "the GNU Makefiles may be altered by upstream without notice and the"
403 - ewarn "documentation for this live version is not readily available"
404 - ewarn "online. Ergo, the ebuild maintainers will not support building a"
405 - ewarn "client-only and/or document-free version."
406 -}
407 -
408 pkg_setup() {
409 - CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
410 + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
411
412 enewgroup postgres 70
413 enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
414 @@ -112,10 +90,11 @@ src_prepare() {
415 sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
416 -i src/include/pg_config_manual.h || die
417
418 - # Rely on $PATH being in the proper order so that the correct
419 - # install program is used for modules utilizing PGXS in both
420 - # hardened and non-hardened environments. (Bug #528786)
421 - sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
422 + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
423 +
424 + # Fix bug 486556 where the server would crash at start up because of
425 + # an infinite loop caused by a self-referencing symlink.
426 + epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
427
428 if use pam ; then
429 sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
430 @@ -149,6 +128,7 @@ src_configure() {
431 $(use_enable !pg_legacytimestamp integer-datetimes) \
432 $(use_enable threads thread-safety) \
433 $(use_with kerberos gssapi) \
434 + $(use_with kerberos krb5) \
435 $(use_with ldap) \
436 $(use_with pam) \
437 $(use_with perl) \
438 @@ -164,14 +144,30 @@ src_configure() {
439 }
440
441 src_compile() {
442 - emake world
443 + emake
444 + emake -C contrib
445 }
446
447 src_install() {
448 - emake DESTDIR="${D}" install-world
449 + emake DESTDIR="${D}" install
450 + emake DESTDIR="${D}" install -C contrib
451
452 dodoc README HISTORY doc/{TODO,bug.template}
453
454 + # man pages are already built, but if we have the target make them,
455 + # they'll be generated from source before being installed so we
456 + # manually install man pages.
457 + # We use ${SLOT} instead of doman for postgresql.eselect
458 + insinto /usr/share/postgresql-${SLOT}/man/
459 + doins -r doc/src/sgml/man{1,3,7}
460 + if ! use server; then
461 + # Remove man pages for non-existent binaries
462 + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
463 + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
464 + done
465 + fi
466 + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
467 +
468 insinto /etc/postgresql-${SLOT}
469 newins src/bin/psql/psqlrc.sample psqlrc
470
471 @@ -181,23 +177,33 @@ src_install() {
472
473 use static-libs || find "${ED}" -name '*.a' -delete
474
475 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
476 - "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
477 + if use doc ; then
478 + docinto html
479 + dodoc doc/src/sgml/html/*
480
481 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
482 - "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
483 + docinto sgml
484 + dodoc doc/src/sgml/*.{sgml,dsl}
485 + fi
486
487 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
488 - "${FILESDIR}/${PN}.service" | \
489 - systemd_newunit - ${PN}-${SLOT}.service
490 + if use server; then
491 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
492 + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
493
494 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
495 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
496 + "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
497
498 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
499 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
500 + "${FILESDIR}/${PN}.service" | \
501 + systemd_newunit - ${PN}-${SLOT}.service
502
503 - if use prefix ; then
504 - keepdir /run/postgresql
505 - fperms 0775 /run/postgresql
506 + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
507 +
508 + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
509 +
510 + if use prefix ; then
511 + keepdir /run/postgresql
512 + fperms 0775 /run/postgresql
513 + fi
514 fi
515 }
516
517 @@ -215,27 +221,29 @@ pkg_postinst() {
518 elog " source /etc/profile"
519 fi
520
521 - elog
522 - elog "Gentoo specific documentation:"
523 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
524 - elog
525 - elog "Official documentation:"
526 - elog "${EROOT%/}/usr/share/doc/${PF}/html"
527 - elog
528 - elog "The default location of the Unix-domain socket is:"
529 - elog " ${EROOT%/}/run/postgresql/"
530 - elog
531 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
532 - elog "so that it contains your preferred locale, and other options, in:"
533 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
534 - elog
535 - elog "Then, execute the following command to setup the initial database"
536 - elog "environment:"
537 - elog " emerge --config =${CATEGORY}/${PF}"
538 + if use server ; then
539 + elog
540 + elog "Gentoo specific documentation:"
541 + elog "https://wiki.gentoo.org/wiki/PostgreSQL"
542 + elog
543 + elog "Official documentation:"
544 + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
545 + elog
546 + elog "The default location of the Unix-domain socket is:"
547 + elog " ${EROOT%/}/run/postgresql/"
548 + elog
549 + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
550 + elog "so that it contains your preferred locale in:"
551 + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
552 + elog
553 + elog "Then, execute the following command to setup the initial database"
554 + elog "environment:"
555 + elog " emerge --config =${CATEGORY}/${PF}"
556 + fi
557 }
558
559 pkg_prerm() {
560 - if [[ -z ${REPLACED_BY_VERSION} ]] ; then
561 + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
562 ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
563 ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
564
565 @@ -250,6 +258,8 @@ pkg_postrm() {
566 }
567
568 pkg_config() {
569 + use server || die "USE flag 'server' not enabled. Nothing to configure."
570 +
571 [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
572 && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
573 [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
574 @@ -370,15 +380,17 @@ pkg_config() {
575 src_test() {
576 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
577
578 - if [[ ${UID} -ne 0 ]] ; then
579 + if use server && [[ ${UID} -ne 0 ]] ; then
580 emake check
581
582 einfo "If you think other tests besides the regression tests are necessary, please"
583 einfo "submit a bug including a patch for this ebuild to enable them."
584 else
585 + use server || \
586 + ewarn 'Tests cannot be run without the "server" use flag enabled.'
587 [[ ${UID} -eq 0 ]] || \
588 - ewarn "Tests cannot be run as root. Enable 'userpriv' in FEATURES."
589 + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
590
591 - ewarn "Skipping."
592 + ewarn 'Skipping.'
593 fi
594 }
595
596 diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9.3.12.ebuild
597 similarity index 72%
598 copy from dev-db/postgresql/postgresql-9999.ebuild
599 copy to dev-db/postgresql/postgresql-9.3.12.ebuild
600 index 0f52d99..e06f2d5 100644
601 --- a/dev-db/postgresql/postgresql-9999.ebuild
602 +++ b/dev-db/postgresql/postgresql-9.3.12.ebuild
603 @@ -1,4 +1,4 @@
604 -# Copyright 1999-2015 Gentoo Foundation
605 +# Copyright 1999-2016 Gentoo Foundation
606 # Distributed under the terms of the GNU General Public License v2
607 # $Id$
608
609 @@ -6,15 +6,14 @@ EAPI="5"
610
611 PYTHON_COMPAT=( python{2_7,3_4} )
612
613 -inherit base eutils flag-o-matic git-2 linux-info multilib pam prefix \
614 - python-single-r1 systemd user versionator
615 +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
616 + systemd user versionator
617
618 -KEYWORDS=""
619 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
620
621 -# Fix if needed
622 -SLOT="9.6"
623 +SLOT="$(get_version_component_range 1-2)"
624
625 -EGIT_REPO_URI="git://git.postgresql.org/git/postgresql.git"
626 +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
627
628 LICENSE="POSTGRESQL GPL-2"
629 DESCRIPTION="PostgreSQL RDBMS"
630 @@ -22,7 +21,7 @@ HOMEPAGE="http://www.postgresql.org/"
631
632 LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
633 zh_CN zh_TW"
634 -IUSE="kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
635 +IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
636 +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
637
638 for lingua in ${LINGUAS}; do
639 @@ -61,23 +60,11 @@ zlib? ( sys-libs/zlib )
640
641 DEPEND="${CDEPEND}
642 !!<sys-apps/sandbox-2.0
643 ->=dev-lang/perl-5.8
644 -app-text/docbook-dsssl-stylesheets
645 -app-text/docbook-sgml-dtd:4.2
646 -app-text/docbook-xml-dtd:4.2
647 -app-text/docbook-xsl-stylesheets
648 -app-text/openjade
649 -dev-libs/libxml2
650 -dev-libs/libxslt
651 sys-devel/bison
652 sys-devel/flex
653 nls? ( sys-devel/gettext )
654 xml? ( virtual/pkgconfig )
655 "
656 -src_unpack() {
657 - base_src_unpack
658 - git-2_src_unpack
659 -}
660
661 RDEPEND="${CDEPEND}
662 !dev-db/postgresql-docs:${SLOT}
663 @@ -86,17 +73,8 @@ RDEPEND="${CDEPEND}
664 selinux? ( sec-policy/selinux-postgresql )
665 "
666
667 -pkg_pretend() {
668 - ewarn "You are using a live ebuild that uses the current source code as it is"
669 - ewarn "available from PostgreSQL's Git repository at emerge time. Given such,"
670 - ewarn "the GNU Makefiles may be altered by upstream without notice and the"
671 - ewarn "documentation for this live version is not readily available"
672 - ewarn "online. Ergo, the ebuild maintainers will not support building a"
673 - ewarn "client-only and/or document-free version."
674 -}
675 -
676 pkg_setup() {
677 - CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
678 + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
679
680 enewgroup postgres 70
681 enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
682 @@ -117,6 +95,12 @@ src_prepare() {
683 # hardened and non-hardened environments. (Bug #528786)
684 sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
685
686 + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
687 +
688 + # Fix bug 486556 where the server would crash at start up because of
689 + # an infinite loop caused by a self-referencing symlink.
690 + epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
691 +
692 if use pam ; then
693 sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
694 -i src/backend/libpq/auth.c || \
695 @@ -149,6 +133,7 @@ src_configure() {
696 $(use_enable !pg_legacytimestamp integer-datetimes) \
697 $(use_enable threads thread-safety) \
698 $(use_with kerberos gssapi) \
699 + $(use_with kerberos krb5) \
700 $(use_with ldap) \
701 $(use_with pam) \
702 $(use_with perl) \
703 @@ -164,14 +149,30 @@ src_configure() {
704 }
705
706 src_compile() {
707 - emake world
708 + emake
709 + emake -C contrib
710 }
711
712 src_install() {
713 - emake DESTDIR="${D}" install-world
714 + emake DESTDIR="${D}" install
715 + emake DESTDIR="${D}" install -C contrib
716
717 dodoc README HISTORY doc/{TODO,bug.template}
718
719 + # man pages are already built, but if we have the target make them,
720 + # they'll be generated from source before being installed so we
721 + # manually install man pages.
722 + # We use ${SLOT} instead of doman for postgresql.eselect
723 + insinto /usr/share/postgresql-${SLOT}/man/
724 + doins -r doc/src/sgml/man{1,3,7}
725 + if ! use server; then
726 + # Remove man pages for non-existent binaries
727 + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
728 + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
729 + done
730 + fi
731 + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
732 +
733 insinto /etc/postgresql-${SLOT}
734 newins src/bin/psql/psqlrc.sample psqlrc
735
736 @@ -181,23 +182,33 @@ src_install() {
737
738 use static-libs || find "${ED}" -name '*.a' -delete
739
740 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
741 - "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
742 + if use doc ; then
743 + docinto html
744 + dodoc doc/src/sgml/html/*
745
746 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
747 - "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
748 + docinto sgml
749 + dodoc doc/src/sgml/*.{sgml,dsl}
750 + fi
751
752 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
753 - "${FILESDIR}/${PN}.service" | \
754 - systemd_newunit - ${PN}-${SLOT}.service
755 + if use server; then
756 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
757 + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
758
759 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
760 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
761 + "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
762
763 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
764 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
765 + "${FILESDIR}/${PN}.service" | \
766 + systemd_newunit - ${PN}-${SLOT}.service
767
768 - if use prefix ; then
769 - keepdir /run/postgresql
770 - fperms 0775 /run/postgresql
771 + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
772 +
773 + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
774 +
775 + if use prefix ; then
776 + keepdir /run/postgresql
777 + fperms 0775 /run/postgresql
778 + fi
779 fi
780 }
781
782 @@ -215,27 +226,29 @@ pkg_postinst() {
783 elog " source /etc/profile"
784 fi
785
786 - elog
787 - elog "Gentoo specific documentation:"
788 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
789 - elog
790 - elog "Official documentation:"
791 - elog "${EROOT%/}/usr/share/doc/${PF}/html"
792 - elog
793 - elog "The default location of the Unix-domain socket is:"
794 - elog " ${EROOT%/}/run/postgresql/"
795 - elog
796 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
797 - elog "so that it contains your preferred locale, and other options, in:"
798 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
799 - elog
800 - elog "Then, execute the following command to setup the initial database"
801 - elog "environment:"
802 - elog " emerge --config =${CATEGORY}/${PF}"
803 + if use server ; then
804 + elog
805 + elog "Gentoo specific documentation:"
806 + elog "https://wiki.gentoo.org/wiki/PostgreSQL"
807 + elog
808 + elog "Official documentation:"
809 + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
810 + elog
811 + elog "The default location of the Unix-domain socket is:"
812 + elog " ${EROOT%/}/run/postgresql/"
813 + elog
814 + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
815 + elog "so that it contains your preferred locale in:"
816 + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
817 + elog
818 + elog "Then, execute the following command to setup the initial database"
819 + elog "environment:"
820 + elog " emerge --config =${CATEGORY}/${PF}"
821 + fi
822 }
823
824 pkg_prerm() {
825 - if [[ -z ${REPLACED_BY_VERSION} ]] ; then
826 + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
827 ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
828 ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
829
830 @@ -250,6 +263,8 @@ pkg_postrm() {
831 }
832
833 pkg_config() {
834 + use server || die "USE flag 'server' not enabled. Nothing to configure."
835 +
836 [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
837 && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
838 [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
839 @@ -370,15 +385,17 @@ pkg_config() {
840 src_test() {
841 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
842
843 - if [[ ${UID} -ne 0 ]] ; then
844 + if use server && [[ ${UID} -ne 0 ]] ; then
845 emake check
846
847 einfo "If you think other tests besides the regression tests are necessary, please"
848 einfo "submit a bug including a patch for this ebuild to enable them."
849 else
850 + use server || \
851 + ewarn 'Tests cannot be run without the "server" use flag enabled.'
852 [[ ${UID} -eq 0 ]] || \
853 - ewarn "Tests cannot be run as root. Enable 'userpriv' in FEATURES."
854 + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
855
856 - ewarn "Skipping."
857 + ewarn 'Skipping.'
858 fi
859 }
860
861 diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9.4.7.ebuild
862 similarity index 67%
863 copy from dev-db/postgresql/postgresql-9999.ebuild
864 copy to dev-db/postgresql/postgresql-9.4.7.ebuild
865 index 0f52d99..6c0ee16 100644
866 --- a/dev-db/postgresql/postgresql-9999.ebuild
867 +++ b/dev-db/postgresql/postgresql-9.4.7.ebuild
868 @@ -1,4 +1,4 @@
869 -# Copyright 1999-2015 Gentoo Foundation
870 +# Copyright 1999-2016 Gentoo Foundation
871 # Distributed under the terms of the GNU General Public License v2
872 # $Id$
873
874 @@ -6,15 +6,14 @@ EAPI="5"
875
876 PYTHON_COMPAT=( python{2_7,3_4} )
877
878 -inherit base eutils flag-o-matic git-2 linux-info multilib pam prefix \
879 - python-single-r1 systemd user versionator
880 +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
881 + systemd user versionator
882
883 -KEYWORDS=""
884 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
885
886 -# Fix if needed
887 -SLOT="9.6"
888 +SLOT="$(get_version_component_range 1-2)"
889
890 -EGIT_REPO_URI="git://git.postgresql.org/git/postgresql.git"
891 +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
892
893 LICENSE="POSTGRESQL GPL-2"
894 DESCRIPTION="PostgreSQL RDBMS"
895 @@ -22,7 +21,7 @@ HOMEPAGE="http://www.postgresql.org/"
896
897 LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
898 zh_CN zh_TW"
899 -IUSE="kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
900 +IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
901 +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
902
903 for lingua in ${LINGUAS}; do
904 @@ -54,30 +53,40 @@ ssl? (
905 libressl? ( dev-libs/libressl:= )
906 )
907 tcl? ( >=dev-lang/tcl-8:0= )
908 -uuid? ( dev-libs/ossp-uuid )
909 xml? ( dev-libs/libxml2 dev-libs/libxslt )
910 zlib? ( sys-libs/zlib )
911 "
912
913 +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
914 +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
915 +# the libc includes UUID functions.
916 +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
917 +BSD_LIBC=( elibc_{Free,Net,Open}BSD )
918 +
919 +nest_usedep() {
920 + local front back
921 + while [[ ${#} -gt 1 ]]; do
922 + front+="${1}? ( "
923 + back+=" )"
924 + shift
925 + done
926 + echo "${front}${1}${back}"
927 +}
928 +
929 +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
930 +CDEPEND+="
931 +uuid? (
932 + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
933 + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
934 +)"
935 +
936 DEPEND="${CDEPEND}
937 !!<sys-apps/sandbox-2.0
938 ->=dev-lang/perl-5.8
939 -app-text/docbook-dsssl-stylesheets
940 -app-text/docbook-sgml-dtd:4.2
941 -app-text/docbook-xml-dtd:4.2
942 -app-text/docbook-xsl-stylesheets
943 -app-text/openjade
944 -dev-libs/libxml2
945 -dev-libs/libxslt
946 sys-devel/bison
947 sys-devel/flex
948 nls? ( sys-devel/gettext )
949 xml? ( virtual/pkgconfig )
950 "
951 -src_unpack() {
952 - base_src_unpack
953 - git-2_src_unpack
954 -}
955
956 RDEPEND="${CDEPEND}
957 !dev-db/postgresql-docs:${SLOT}
958 @@ -86,17 +95,8 @@ RDEPEND="${CDEPEND}
959 selinux? ( sec-policy/selinux-postgresql )
960 "
961
962 -pkg_pretend() {
963 - ewarn "You are using a live ebuild that uses the current source code as it is"
964 - ewarn "available from PostgreSQL's Git repository at emerge time. Given such,"
965 - ewarn "the GNU Makefiles may be altered by upstream without notice and the"
966 - ewarn "documentation for this live version is not readily available"
967 - ewarn "online. Ergo, the ebuild maintainers will not support building a"
968 - ewarn "client-only and/or document-free version."
969 -}
970 -
971 pkg_setup() {
972 - CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
973 + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
974
975 enewgroup postgres 70
976 enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
977 @@ -117,6 +117,12 @@ src_prepare() {
978 # hardened and non-hardened environments. (Bug #528786)
979 sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
980
981 + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
982 +
983 + # Fix bug 486556 where the server would crash at start up because of
984 + # an infinite loop caused by a self-referencing symlink.
985 + epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
986 +
987 if use pam ; then
988 sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
989 -i src/backend/libpq/auth.c || \
990 @@ -138,6 +144,17 @@ src_configure() {
991
992 local PO="${EPREFIX%/}"
993
994 + local i uuid_config=""
995 + if use uuid; then
996 + for i in ${UTIL_LINUX_LIBC[@]}; do
997 + use ${i} && uuid_config="--with-uuid=e2fs"
998 + done
999 + for i in ${BSD_LIBC[@]}; do
1000 + use ${i} && uuid_config="--with-uuid=bsd"
1001 + done
1002 + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
1003 + fi
1004 +
1005 econf \
1006 --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
1007 --datadir="${PO}/usr/share/postgresql-${SLOT}" \
1008 @@ -156,7 +173,7 @@ src_configure() {
1009 $(use_with readline) \
1010 $(use_with ssl openssl) \
1011 $(use_with tcl) \
1012 - $(use_with uuid ossp-uuid) \
1013 + ${uuid_config} \
1014 $(use_with xml libxml) \
1015 $(use_with xml libxslt) \
1016 $(use_with zlib) \
1017 @@ -164,14 +181,30 @@ src_configure() {
1018 }
1019
1020 src_compile() {
1021 - emake world
1022 + emake
1023 + emake -C contrib
1024 }
1025
1026 src_install() {
1027 - emake DESTDIR="${D}" install-world
1028 + emake DESTDIR="${D}" install
1029 + emake DESTDIR="${D}" install -C contrib
1030
1031 dodoc README HISTORY doc/{TODO,bug.template}
1032
1033 + # man pages are already built, but if we have the target make them,
1034 + # they'll be generated from source before being installed so we
1035 + # manually install man pages.
1036 + # We use ${SLOT} instead of doman for postgresql.eselect
1037 + insinto /usr/share/postgresql-${SLOT}/man/
1038 + doins -r doc/src/sgml/man{1,3,7}
1039 + if ! use server; then
1040 + # Remove man pages for non-existent binaries
1041 + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
1042 + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
1043 + done
1044 + fi
1045 + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
1046 +
1047 insinto /etc/postgresql-${SLOT}
1048 newins src/bin/psql/psqlrc.sample psqlrc
1049
1050 @@ -181,23 +214,33 @@ src_install() {
1051
1052 use static-libs || find "${ED}" -name '*.a' -delete
1053
1054 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1055 - "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
1056 + if use doc ; then
1057 + docinto html
1058 + dodoc doc/src/sgml/html/*
1059
1060 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1061 - "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
1062 + docinto sgml
1063 + dodoc doc/src/sgml/*.{sgml,dsl}
1064 + fi
1065
1066 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1067 - "${FILESDIR}/${PN}.service" | \
1068 - systemd_newunit - ${PN}-${SLOT}.service
1069 + if use server; then
1070 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1071 + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
1072
1073 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
1074 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1075 + "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
1076
1077 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
1078 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1079 + "${FILESDIR}/${PN}.service" | \
1080 + systemd_newunit - ${PN}-${SLOT}.service
1081
1082 - if use prefix ; then
1083 - keepdir /run/postgresql
1084 - fperms 0775 /run/postgresql
1085 + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
1086 +
1087 + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
1088 +
1089 + if use prefix ; then
1090 + keepdir /run/postgresql
1091 + fperms 0775 /run/postgresql
1092 + fi
1093 fi
1094 }
1095
1096 @@ -215,27 +258,29 @@ pkg_postinst() {
1097 elog " source /etc/profile"
1098 fi
1099
1100 - elog
1101 - elog "Gentoo specific documentation:"
1102 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
1103 - elog
1104 - elog "Official documentation:"
1105 - elog "${EROOT%/}/usr/share/doc/${PF}/html"
1106 - elog
1107 - elog "The default location of the Unix-domain socket is:"
1108 - elog " ${EROOT%/}/run/postgresql/"
1109 - elog
1110 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
1111 - elog "so that it contains your preferred locale, and other options, in:"
1112 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
1113 - elog
1114 - elog "Then, execute the following command to setup the initial database"
1115 - elog "environment:"
1116 - elog " emerge --config =${CATEGORY}/${PF}"
1117 + if use server ; then
1118 + elog
1119 + elog "Gentoo specific documentation:"
1120 + elog "https://wiki.gentoo.org/wiki/PostgreSQL"
1121 + elog
1122 + elog "Official documentation:"
1123 + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
1124 + elog
1125 + elog "The default location of the Unix-domain socket is:"
1126 + elog " ${EROOT%/}/run/postgresql/"
1127 + elog
1128 + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
1129 + elog "so that it contains your preferred locale in:"
1130 + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
1131 + elog
1132 + elog "Then, execute the following command to setup the initial database"
1133 + elog "environment:"
1134 + elog " emerge --config =${CATEGORY}/${PF}"
1135 + fi
1136 }
1137
1138 pkg_prerm() {
1139 - if [[ -z ${REPLACED_BY_VERSION} ]] ; then
1140 + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
1141 ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
1142 ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
1143
1144 @@ -250,6 +295,8 @@ pkg_postrm() {
1145 }
1146
1147 pkg_config() {
1148 + use server || die "USE flag 'server' not enabled. Nothing to configure."
1149 +
1150 [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
1151 && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
1152 [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
1153 @@ -370,15 +417,17 @@ pkg_config() {
1154 src_test() {
1155 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
1156
1157 - if [[ ${UID} -ne 0 ]] ; then
1158 + if use server && [[ ${UID} -ne 0 ]] ; then
1159 emake check
1160
1161 einfo "If you think other tests besides the regression tests are necessary, please"
1162 einfo "submit a bug including a patch for this ebuild to enable them."
1163 else
1164 + use server || \
1165 + ewarn 'Tests cannot be run without the "server" use flag enabled.'
1166 [[ ${UID} -eq 0 ]] || \
1167 - ewarn "Tests cannot be run as root. Enable 'userpriv' in FEATURES."
1168 + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
1169
1170 - ewarn "Skipping."
1171 + ewarn 'Skipping.'
1172 fi
1173 }
1174
1175 diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9.5.2.ebuild
1176 similarity index 67%
1177 copy from dev-db/postgresql/postgresql-9999.ebuild
1178 copy to dev-db/postgresql/postgresql-9.5.2.ebuild
1179 index 0f52d99..8c244db 100644
1180 --- a/dev-db/postgresql/postgresql-9999.ebuild
1181 +++ b/dev-db/postgresql/postgresql-9.5.2.ebuild
1182 @@ -1,20 +1,19 @@
1183 -# Copyright 1999-2015 Gentoo Foundation
1184 +# Copyright 1999-2016 Gentoo Foundation
1185 # Distributed under the terms of the GNU General Public License v2
1186 # $Id$
1187
1188 EAPI="5"
1189
1190 -PYTHON_COMPAT=( python{2_7,3_4} )
1191 +PYTHON_COMPAT=( python{2_7,3_4,3_5} )
1192
1193 -inherit base eutils flag-o-matic git-2 linux-info multilib pam prefix \
1194 - python-single-r1 systemd user versionator
1195 +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
1196 + systemd user versionator
1197
1198 -KEYWORDS=""
1199 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
1200
1201 -# Fix if needed
1202 -SLOT="9.6"
1203 +SLOT="$(get_version_component_range 1-2)"
1204
1205 -EGIT_REPO_URI="git://git.postgresql.org/git/postgresql.git"
1206 +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
1207
1208 LICENSE="POSTGRESQL GPL-2"
1209 DESCRIPTION="PostgreSQL RDBMS"
1210 @@ -22,7 +21,7 @@ HOMEPAGE="http://www.postgresql.org/"
1211
1212 LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
1213 zh_CN zh_TW"
1214 -IUSE="kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
1215 +IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
1216 +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
1217
1218 for lingua in ${LINGUAS}; do
1219 @@ -54,30 +53,40 @@ ssl? (
1220 libressl? ( dev-libs/libressl:= )
1221 )
1222 tcl? ( >=dev-lang/tcl-8:0= )
1223 -uuid? ( dev-libs/ossp-uuid )
1224 xml? ( dev-libs/libxml2 dev-libs/libxslt )
1225 zlib? ( sys-libs/zlib )
1226 "
1227
1228 +# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
1229 +# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
1230 +# the libc includes UUID functions.
1231 +UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
1232 +BSD_LIBC=( elibc_{Free,Net,Open}BSD )
1233 +
1234 +nest_usedep() {
1235 + local front back
1236 + while [[ ${#} -gt 1 ]]; do
1237 + front+="${1}? ( "
1238 + back+=" )"
1239 + shift
1240 + done
1241 + echo "${front}${1}${back}"
1242 +}
1243 +
1244 +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
1245 +CDEPEND+="
1246 +uuid? (
1247 + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
1248 + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
1249 +)"
1250 +
1251 DEPEND="${CDEPEND}
1252 !!<sys-apps/sandbox-2.0
1253 ->=dev-lang/perl-5.8
1254 -app-text/docbook-dsssl-stylesheets
1255 -app-text/docbook-sgml-dtd:4.2
1256 -app-text/docbook-xml-dtd:4.2
1257 -app-text/docbook-xsl-stylesheets
1258 -app-text/openjade
1259 -dev-libs/libxml2
1260 -dev-libs/libxslt
1261 sys-devel/bison
1262 sys-devel/flex
1263 nls? ( sys-devel/gettext )
1264 xml? ( virtual/pkgconfig )
1265 "
1266 -src_unpack() {
1267 - base_src_unpack
1268 - git-2_src_unpack
1269 -}
1270
1271 RDEPEND="${CDEPEND}
1272 !dev-db/postgresql-docs:${SLOT}
1273 @@ -86,17 +95,8 @@ RDEPEND="${CDEPEND}
1274 selinux? ( sec-policy/selinux-postgresql )
1275 "
1276
1277 -pkg_pretend() {
1278 - ewarn "You are using a live ebuild that uses the current source code as it is"
1279 - ewarn "available from PostgreSQL's Git repository at emerge time. Given such,"
1280 - ewarn "the GNU Makefiles may be altered by upstream without notice and the"
1281 - ewarn "documentation for this live version is not readily available"
1282 - ewarn "online. Ergo, the ebuild maintainers will not support building a"
1283 - ewarn "client-only and/or document-free version."
1284 -}
1285 -
1286 pkg_setup() {
1287 - CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
1288 + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
1289
1290 enewgroup postgres 70
1291 enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
1292 @@ -117,6 +117,12 @@ src_prepare() {
1293 # hardened and non-hardened environments. (Bug #528786)
1294 sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
1295
1296 + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
1297 +
1298 + # Fix bug 486556 where the server would crash at start up because of
1299 + # an infinite loop caused by a self-referencing symlink.
1300 + epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
1301 +
1302 if use pam ; then
1303 sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
1304 -i src/backend/libpq/auth.c || \
1305 @@ -138,6 +144,17 @@ src_configure() {
1306
1307 local PO="${EPREFIX%/}"
1308
1309 + local i uuid_config=""
1310 + if use uuid; then
1311 + for i in ${UTIL_LINUX_LIBC[@]}; do
1312 + use ${i} && uuid_config="--with-uuid=e2fs"
1313 + done
1314 + for i in ${BSD_LIBC[@]}; do
1315 + use ${i} && uuid_config="--with-uuid=bsd"
1316 + done
1317 + [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
1318 + fi
1319 +
1320 econf \
1321 --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
1322 --datadir="${PO}/usr/share/postgresql-${SLOT}" \
1323 @@ -156,7 +173,7 @@ src_configure() {
1324 $(use_with readline) \
1325 $(use_with ssl openssl) \
1326 $(use_with tcl) \
1327 - $(use_with uuid ossp-uuid) \
1328 + ${uuid_config} \
1329 $(use_with xml libxml) \
1330 $(use_with xml libxslt) \
1331 $(use_with zlib) \
1332 @@ -164,14 +181,30 @@ src_configure() {
1333 }
1334
1335 src_compile() {
1336 - emake world
1337 + emake
1338 + emake -C contrib
1339 }
1340
1341 src_install() {
1342 - emake DESTDIR="${D}" install-world
1343 + emake DESTDIR="${D}" install
1344 + emake DESTDIR="${D}" install -C contrib
1345
1346 dodoc README HISTORY doc/{TODO,bug.template}
1347
1348 + # man pages are already built, but if we have the target make them,
1349 + # they'll be generated from source before being installed so we
1350 + # manually install man pages.
1351 + # We use ${SLOT} instead of doman for postgresql.eselect
1352 + insinto /usr/share/postgresql-${SLOT}/man/
1353 + doins -r doc/src/sgml/man{1,3,7}
1354 + if ! use server; then
1355 + # Remove man pages for non-existent binaries
1356 + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
1357 + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
1358 + done
1359 + fi
1360 + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
1361 +
1362 insinto /etc/postgresql-${SLOT}
1363 newins src/bin/psql/psqlrc.sample psqlrc
1364
1365 @@ -181,23 +214,33 @@ src_install() {
1366
1367 use static-libs || find "${ED}" -name '*.a' -delete
1368
1369 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1370 - "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
1371 + if use doc ; then
1372 + docinto html
1373 + dodoc doc/src/sgml/html/*
1374
1375 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1376 - "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
1377 + docinto sgml
1378 + dodoc doc/src/sgml/*.{sgml,dsl}
1379 + fi
1380
1381 - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1382 - "${FILESDIR}/${PN}.service" | \
1383 - systemd_newunit - ${PN}-${SLOT}.service
1384 + if use server; then
1385 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1386 + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
1387
1388 - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
1389 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1390 + "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
1391
1392 - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
1393 + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
1394 + "${FILESDIR}/${PN}.service" | \
1395 + systemd_newunit - ${PN}-${SLOT}.service
1396
1397 - if use prefix ; then
1398 - keepdir /run/postgresql
1399 - fperms 0775 /run/postgresql
1400 + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
1401 +
1402 + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
1403 +
1404 + if use prefix ; then
1405 + keepdir /run/postgresql
1406 + fperms 0775 /run/postgresql
1407 + fi
1408 fi
1409 }
1410
1411 @@ -215,27 +258,29 @@ pkg_postinst() {
1412 elog " source /etc/profile"
1413 fi
1414
1415 - elog
1416 - elog "Gentoo specific documentation:"
1417 - elog "https://wiki.gentoo.org/wiki/PostgreSQL"
1418 - elog
1419 - elog "Official documentation:"
1420 - elog "${EROOT%/}/usr/share/doc/${PF}/html"
1421 - elog
1422 - elog "The default location of the Unix-domain socket is:"
1423 - elog " ${EROOT%/}/run/postgresql/"
1424 - elog
1425 - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
1426 - elog "so that it contains your preferred locale, and other options, in:"
1427 - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
1428 - elog
1429 - elog "Then, execute the following command to setup the initial database"
1430 - elog "environment:"
1431 - elog " emerge --config =${CATEGORY}/${PF}"
1432 + if use server ; then
1433 + elog
1434 + elog "Gentoo specific documentation:"
1435 + elog "https://wiki.gentoo.org/wiki/PostgreSQL"
1436 + elog
1437 + elog "Official documentation:"
1438 + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
1439 + elog
1440 + elog "The default location of the Unix-domain socket is:"
1441 + elog " ${EROOT%/}/run/postgresql/"
1442 + elog
1443 + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
1444 + elog "so that it contains your preferred locale in:"
1445 + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
1446 + elog
1447 + elog "Then, execute the following command to setup the initial database"
1448 + elog "environment:"
1449 + elog " emerge --config =${CATEGORY}/${PF}"
1450 + fi
1451 }
1452
1453 pkg_prerm() {
1454 - if [[ -z ${REPLACED_BY_VERSION} ]] ; then
1455 + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
1456 ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
1457 ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
1458
1459 @@ -250,6 +295,8 @@ pkg_postrm() {
1460 }
1461
1462 pkg_config() {
1463 + use server || die "USE flag 'server' not enabled. Nothing to configure."
1464 +
1465 [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
1466 && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
1467 [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
1468 @@ -370,15 +417,17 @@ pkg_config() {
1469 src_test() {
1470 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
1471
1472 - if [[ ${UID} -ne 0 ]] ; then
1473 + if use server && [[ ${UID} -ne 0 ]] ; then
1474 emake check
1475
1476 einfo "If you think other tests besides the regression tests are necessary, please"
1477 einfo "submit a bug including a patch for this ebuild to enable them."
1478 else
1479 + use server || \
1480 + ewarn 'Tests cannot be run without the "server" use flag enabled.'
1481 [[ ${UID} -eq 0 ]] || \
1482 - ewarn "Tests cannot be run as root. Enable 'userpriv' in FEATURES."
1483 + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
1484
1485 - ewarn "Skipping."
1486 + ewarn 'Skipping.'
1487 fi
1488 }
1489
1490 diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9999.ebuild
1491 index 0f52d99..f3ff28e 100644
1492 --- a/dev-db/postgresql/postgresql-9999.ebuild
1493 +++ b/dev-db/postgresql/postgresql-9999.ebuild
1494 @@ -1,10 +1,10 @@
1495 -# Copyright 1999-2015 Gentoo Foundation
1496 +# Copyright 1999-2016 Gentoo Foundation
1497 # Distributed under the terms of the GNU General Public License v2
1498 # $Id$
1499
1500 EAPI="5"
1501
1502 -PYTHON_COMPAT=( python{2_7,3_4} )
1503 +PYTHON_COMPAT=( python{2_7,3_4,3_5} )
1504
1505 inherit base eutils flag-o-matic git-2 linux-info multilib pam prefix \
1506 python-single-r1 systemd user versionator