Gentoo Archives: gentoo-commits

From: "Patrick Lauer (patrick)" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-db/postgresql-server: postgresql-server-9.4_beta1.ebuild ChangeLog
Date: Thu, 26 Jun 2014 07:21:19
Message-Id: 20140626072116.3A4152004E@flycatcher.gentoo.org
1 patrick 14/06/26 07:21:16
2
3 Modified: ChangeLog
4 Added: postgresql-server-9.4_beta1.ebuild
5 Log:
6 Bump
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, unsigned Manifest commit)
9
10 Revision Changes Path
11 1.296 dev-db/postgresql-server/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.296&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.296&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?r1=1.295&r2=1.296
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v
20 retrieving revision 1.295
21 retrieving revision 1.296
22 diff -u -r1.295 -r1.296
23 --- ChangeLog 26 Jun 2014 06:50:21 -0000 1.295
24 +++ ChangeLog 26 Jun 2014 07:21:16 -0000 1.296
25 @@ -1,6 +1,12 @@
26 # ChangeLog for dev-db/postgresql-server
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.295 2014/06/26 06:50:21 patrick Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.296 2014/06/26 07:21:16 patrick Exp $
30 +
31 +*postgresql-server-9.4_beta1 (26 Jun 2014)
32 +
33 + 26 Jun 2014; Patrick Lauer <patrick@g.o>
34 + +postgresql-server-9.4_beta1.ebuild:
35 + Bump
36
37 26 Jun 2014; Patrick Lauer <patrick@g.o> postgresql-server-9999.ebuild:
38 Bump -9999 ebuild to slot 9.5, fix patches. Tests are currently disabled for
39
40
41
42 1.1 dev-db/postgresql-server/postgresql-server-9.4_beta1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.4_beta1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.4_beta1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: postgresql-server-9.4_beta1.ebuild
48 ===================================================================
49 # Copyright 1999-2014 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.4_beta1.ebuild,v 1.1 2014/06/26 07:21:16 patrick Exp $
52
53 EAPI="5"
54
55 PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} )
56 WANT_AUTOMAKE="none"
57
58 RESTRICT="test"
59
60 inherit autotools eutils flag-o-matic multilib pam prefix python-single-r1 systemd user versionator
61
62 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
63
64 MY_PV=${PV/_/}
65 SLOT="$(get_version_component_range 1-2)"
66 S="${WORKDIR}/postgresql-${MY_PV}"
67 SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2
68 http://dev.gentoo.org/~patrick/postgresql-patches-${SLOT}.tbz2
69 http://dev.gentoo.org/~floppym/dist/postgresql-initscript-2.7.tbz2"
70
71
72
73 LICENSE="POSTGRESQL GPL-2"
74 DESCRIPTION="PostgreSQL server"
75 HOMEPAGE="http://www.postgresql.org/"
76
77 LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW"
78 IUSE="doc kerberos kernel_linux nls pam perl -pg_legacytimestamp python selinux tcl test uuid xml"
79
80 for lingua in ${LINGUAS}; do
81 IUSE+=" linguas_${lingua}"
82 done
83
84 wanted_languages() {
85 local enable_langs
86
87 for lingua in ${LINGUAS} ; do
88 use linguas_${lingua} && enable_langs+="${lingua} "
89 done
90
91 echo -n ${enable_langs}
92 }
93
94 RDEPEND="
95 ~dev-db/postgresql-base-${PV}[kerberos?,pam?,pg_legacytimestamp=,python=,nls=]
96 perl? ( >=dev-lang/perl-5.8 )
97 python? ( ${PYTHON_DEPS} )
98 selinux? ( sec-policy/selinux-postgresql )
99 tcl? ( >=dev-lang/tcl-8 )
100 uuid? ( dev-libs/ossp-uuid )
101 xml? ( dev-libs/libxml2 dev-libs/libxslt )
102 "
103
104 DEPEND="${RDEPEND}
105 sys-devel/flex
106 xml? ( virtual/pkgconfig )
107 "
108
109 PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
110
111 pkg_setup() {
112 enewgroup postgres 70
113 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
114
115 use python && python-single-r1_pkg_setup
116 }
117
118 src_prepare() {
119 epatch "${WORKDIR}/autoconf.patch" \
120 "${WORKDIR}/bool.patch" \
121 "${WORKDIR}/server.patch" \
122 "${WORKDIR}/run-dir.patch"
123
124 eprefixify src/include/pg_config_manual.h
125
126 if use pam ; then
127 sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
128 -i src/backend/libpq/auth.c \
129 || die 'PGSQL_PAM_SERVICE rename failed.'
130 fi
131
132 if use perl ; then
133 sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
134 -i "${S}/src/pl/plperl/GNUmakefile" || die 'sed plperl failed'
135 fi
136
137 if use test ; then
138 sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c \
139 || die 'Failed regress sed'
140 else
141 echo "all install:" > "${S}/src/test/regress/GNUmakefile"
142 fi
143
144 sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
145 -i "${WORKDIR}"/postgresql{.{init,confd,service},-check-db-dir} ||
146 die "SLOT/LIBDIR sed failed"
147
148 eautoconf
149 }
150
151 src_configure() {
152 case ${CHOST} in
153 *-darwin*|*-solaris*)
154 use nls && append-libs intl
155 ;;
156 esac
157
158 local PO="${EPREFIX%/}"
159
160 # eval is needed to get along with pg_config quotation of space-rich entities.
161 eval econf "$(${PO}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
162 $(use_with perl) \
163 $(use_with tcl) \
164 $(use_with xml libxml) \
165 $(use_with xml libxslt) \
166 $(use_with uuid ossp-uuid) \
167 --with-system-tzdata="${PO}/usr/share/zoneinfo" \
168 --with-includes="${PO}/usr/include/postgresql-${SLOT}/" \
169 --with-libraries="${PO}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \
170 "$(use_enable nls nls "$(wanted_languages)")"
171 }
172
173 src_compile() {
174 local bd
175 for bd in . contrib $(use xml && echo contrib/xml2); do
176 PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
177 emake -C $bd || die "emake in $bd failed"
178 done
179 }
180
181 src_install() {
182 local bd
183 for bd in . contrib $(use xml && echo contrib/xml2) ; do
184 PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
185 emake install -C $bd DESTDIR="${D}" || die "emake install in $bd failed"
186 done
187
188 # Avoid file collision with -base.
189 rm "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)/libpgcommon.a"
190
191 dodir /etc/eselect/postgresql/slots/${SLOT}
192 echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
193 "${ED}/etc/eselect/postgresql/slots/${SLOT}/server"
194
195 newconfd "${WORKDIR}/postgresql.confd" postgresql-${SLOT}
196 newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT}
197
198 systemd_newunit "${WORKDIR}"/postgresql.service postgresql-${SLOT}.service
199 systemd_newtmpfilesd "${WORKDIR}"/postgresql.tmpfilesd postgresql-${SLOT}.conf
200
201 insinto /usr/bin/
202 newbin "${WORKDIR}"/postgresql-check-db-dir postgresql-${SLOT}-check-db-dir
203
204 use pam && pamd_mimic system-auth postgresql-${SLOT} auth account session
205
206 if use prefix ; then
207 keepdir /run/postgresql
208 fperms 0775 /run/postgresql
209 fi
210 }
211
212 pkg_postinst() {
213 postgresql-config update
214
215 elog "Gentoo specific documentation:"
216 elog "http://www.gentoo.org/doc/en/postgres-howto.xml"
217 elog
218 elog "Official documentation:"
219 elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
220 elog
221 elog "The default location of the Unix-domain socket is:"
222 elog " ${EROOT%/}/run/postgresql/"
223 elog
224 elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
225 elog "so that it contains your preferred locale in:"
226 elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
227 elog
228 elog "Then, execute the following command to setup the initial database"
229 elog "environment:"
230 elog " emerge --config =${CATEGORY}/${PF}"
231 }
232
233 pkg_prerm() {
234 if [[ -z ${REPLACED_BY_VERSION} ]] ; then
235 ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
236 ewarn "\thttp://www.gentoo.org/doc/en/postgres-howto.xml#doc_chap5"
237
238 ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
239 sleep 10
240 eend 0
241 fi
242 }
243
244 pkg_postrm() {
245 postgresql-config update
246 }
247
248 pkg_config() {
249 [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
250 [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
251 [[ -z "${DATA_DIR}" ]] && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
252
253 # environment.bz2 may not contain the same locale as the current system
254 # locale. Unset and source from the current system locale.
255 if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
256 unset LANG
257 unset LC_CTYPE
258 unset LC_NUMERIC
259 unset LC_TIME
260 unset LC_COLLATE
261 unset LC_MONETARY
262 unset LC_MESSAGES
263 unset LC_ALL
264 source "${EROOT%/}/etc/env.d/02locale"
265 [ -n "${LANG}" ] && export LANG
266 [ -n "${LC_CTYPE}" ] && export LC_CTYPE
267 [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
268 [ -n "${LC_TIME}" ] && export LC_TIME
269 [ -n "${LC_COLLATE}" ] && export LC_COLLATE
270 [ -n "${LC_MONETARY}" ] && export LC_MONETARY
271 [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
272 [ -n "${LC_ALL}" ] && export LC_ALL
273 fi
274
275 einfo "You can modify the paths and options passed to initdb by editing:"
276 einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
277 einfo
278 einfo "Information on options that can be passed to initdb are found at:"
279 einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
280 einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
281 einfo
282 einfo "PG_INITDB_OPTS is currently set to:"
283 if [[ -z "${PG_INITDB_OPTS}" ]] ; then
284 einfo " (none)"
285 else
286 einfo " ${PG_INITDB_OPTS}"
287 fi
288 einfo
289 einfo "Configuration files will be installed to:"
290 einfo " ${PGDATA}"
291 einfo
292 einfo "The database cluster will be created in:"
293 einfo " ${DATA_DIR}"
294 einfo
295 while [ "$correct" != "true" ] ; do
296 einfo "Are you ready to continue? (y/n)"
297 read answer
298 if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
299 correct="true"
300 elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
301 die "Aborting initialization."
302 else
303 echo "Answer not recognized"
304 fi
305 done
306
307 if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
308 eerror "The given directory, '${DATA_DIR}', is not empty."
309 eerror "Modify DATA_DIR to point to an empty directory."
310 die "${DATA_DIR} is not empty."
311 fi
312
313 [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
314 einfo "Checking system parameters..."
315
316 if ! use kernel_linux ; then
317 einfo "Skipped."
318 einfo " Tests not supported on this OS (yet)"
319 else
320 if [ -z ${SKIP_SYSTEM_TESTS} ] ; then
321 einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
322
323 local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
324 local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
325 local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
326 local SHMMAX=$(sysctl -n kernel.shmmax)
327
328 local SEMMSL_MIN=17
329 local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
330 local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
331 local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
332
333 for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
334 if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then
335 eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
336 eerror "You have now several options:"
337 eerror " - Change the mentioned system parameter"
338 eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a"
339 eerror " value lower than ${PG_MAX_CONNECTIONS}"
340 eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
341 eerror "More information can be found here:"
342 eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
343 die "System test failed."
344 fi
345 done
346 einfo "Passed."
347 else
348 ewarn "SKIP_SYSTEM_TESTS set, so skipping."
349 fi
350 fi
351
352 einfo "Creating the data directory ..."
353 if [[ ${EUID} == 0 ]] ; then
354 mkdir -p "${DATA_DIR}"
355 chown -Rf postgres:postgres "${DATA_DIR}"
356 chmod 0700 "${DATA_DIR}"
357 fi
358
359 einfo "Initializing the database ..."
360
361 if [[ ${EUID} == 0 ]] ; then
362 su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
363 else
364 "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
365 fi
366
367 mv "${DATA_DIR%/}"/*.conf "${PGDATA}"
368
369 einfo "The autovacuum function, which was in contrib, has been moved to the main"
370 einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
371 einfo "by default. You can disable it in the cluster's:"
372 einfo " ${PGDATA%/}/postgresql.conf"
373 einfo
374 einfo "The PostgreSQL server, by default, will log events to:"
375 einfo " ${DATA_DIR%/}/postmaster.log"
376 einfo
377 if use prefix ; then
378 einfo "The location of the configuration files have moved to:"
379 einfo " ${PGDATA}"
380 einfo "To start the server:"
381 einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
382 einfo "To stop:"
383 einfo " pg_ctl stop -D ${DATA_DIR}"
384 einfo
385 einfo "Or move the configuration files back:"
386 einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
387 else
388 einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
389 einfo "instead of 'pg_ctl'."
390 fi
391 }
392
393 src_test() {
394 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
395
396 if [ ${UID} -ne 0 ] ; then
397 emake check
398
399 einfo "If you think other tests besides the regression tests are necessary, please"
400 einfo "submit a bug including a patch for this ebuild to enable them."
401 else
402 ewarn "Tests cannot be run as root. Skipping."
403 ewarn "HINT: FEATURES=\"userpriv\""
404 fi
405 }