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.2.0_rc1.ebuild ChangeLog
Date: Wed, 29 Aug 2012 07:11:30
Message-Id: 20120829071120.B877820AFE@flycatcher.gentoo.org
1 patrick 12/08/29 07:11:20
2
3 Modified: ChangeLog
4 Added: postgresql-server-9.2.0_rc1.ebuild
5 Log:
6 Bump to 9.2rc1
7
8 (Portage version: 2.2.0_alpha123/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.210 dev-db/postgresql-server/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.210&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.210&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?r1=1.209&r2=1.210
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v
20 retrieving revision 1.209
21 retrieving revision 1.210
22 diff -u -r1.209 -r1.210
23 --- ChangeLog 26 Aug 2012 16:13:04 -0000 1.209
24 +++ ChangeLog 29 Aug 2012 07:11:20 -0000 1.210
25 @@ -1,6 +1,12 @@
26 # ChangeLog for dev-db/postgresql-server
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.209 2012/08/26 16:13:04 armin76 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.210 2012/08/29 07:11:20 patrick Exp $
30 +
31 +*postgresql-server-9.2.0_rc1 (29 Aug 2012)
32 +
33 + 29 Aug 2012; Patrick Lauer <patrick@g.o>
34 + +postgresql-server-9.2.0_rc1.ebuild:
35 + Bump to 9.2rc1
36
37 26 Aug 2012; Raúl Porcel <armin76@g.o>
38 postgresql-server-8.3.20.ebuild, postgresql-server-8.4.13.ebuild,
39
40
41
42 1.1 dev-db/postgresql-server/postgresql-server-9.2.0_rc1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.2.0_rc1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.2.0_rc1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: postgresql-server-9.2.0_rc1.ebuild
48 ===================================================================
49 # Copyright 1999-2012 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.2.0_rc1.ebuild,v 1.1 2012/08/29 07:11:20 patrick Exp $
52
53 EAPI="4"
54 PYTHON_DEPEND="python? 2"
55
56 WANT_AUTOMAKE="none"
57 inherit autotools eutils flag-o-matic multilib pam prefix python user versionator
58
59 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
60
61 SLOT="$(get_version_component_range 1-2)"
62
63 # Comment the following six lines when not a beta or rc.
64 MY_PV="${PV//_}"
65 MY_FILE_PV="${SLOT}$(get_version_component_range 4)"
66 S="${WORKDIR}/postgresql-${MY_FILE_PV}"
67 SRC_URI="mirror://postgresql/source/v${MY_FILE_PV}/postgresql-${MY_FILE_PV}.tar.bz2
68 http://dev.gentoo.org/~titanofold/postgresql-patches-${SLOT}beta3.tbz2
69 http://dev.gentoo.org/~titanofold/postgresql-initscript-2.3.tbz2"
70
71 # Comment the following four lines when a beta or rc.
72 #S="${WORKDIR}/postgresql-${PV}"
73 #SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2
74 # http://dev.gentoo.org/~titanofold/postgresql-patches-${PV}.tbz2
75 # http://dev.gentoo.org/~titanofold/postgresql-initscript-2.1.tbz2"
76
77 LICENSE="POSTGRESQL GPL-2"
78 DESCRIPTION="PostgreSQL server"
79 HOMEPAGE="http://www.postgresql.org/"
80
81 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"
82 IUSE="doc kernel_linux nls pam perl -pg_legacytimestamp python selinux tcl uuid xml"
83
84 for lingua in ${LINGUAS}; do
85 IUSE+=" linguas_${lingua}"
86 done
87
88 wanted_languages() {
89 local enable_langs
90
91 for lingua in ${LINGUAS} ; do
92 use linguas_${lingua} && enable_langs+="${lingua} "
93 done
94
95 echo -n ${enable_langs}
96 }
97
98 RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pam?,pg_legacytimestamp=,nls=]
99 perl? ( >=dev-lang/perl-5.8 )
100 selinux? ( sec-policy/selinux-postgresql )
101 tcl? ( >=dev-lang/tcl-8 )
102 uuid? ( dev-libs/ossp-uuid )
103 xml? ( dev-libs/libxml2 dev-libs/libxslt )"
104 DEPEND="${RDEPEND}
105 sys-devel/flex
106 xml? ( virtual/pkgconfig )"
107 PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
108
109 # Support /var/run or /run for the socket directory
110 [[ ! -d /run ]] && RUNDIR=/var
111
112 pkg_setup() {
113 enewgroup postgres 70
114 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
115
116 use python && python_set_active_version 2
117 }
118
119 src_prepare() {
120 epatch "${WORKDIR}/autoconf.patch" \
121 "${WORKDIR}/bool.patch" \
122 "${WORKDIR}/server.patch"
123
124 eprefixify src/include/pg_config_manual.h
125
126 if use test ; then
127 epatch "${WORKDIR}/regress.patch"
128 sed -e "s|@SOCKETDIR@|${T}|g" -i src/test/regress/pg_regress{,_main}.c
129 # sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" \
130 # -i src/test/regress/{input,output}/tablespace.source
131 else
132 echo "all install:" > "${S}/src/test/regress/GNUmakefile"
133 fi
134
135 sed -e "s|@RUNDIR@|${RUNDIR}|g" \
136 -i src/include/pg_config_manual.h "${WORKDIR}/postgresql.init" || \
137 die "RUNDIR sed failed"
138 sed -e "s|@SLOT@|${SLOT}|g" \
139 -i "${WORKDIR}/postgresql.init" "${WORKDIR}/postgresql.confd" || \
140 die "SLOT sed failed"
141
142 eautoconf
143 }
144
145 src_configure() {
146 case ${CHOST} in
147 *-darwin*|*-solaris*)
148 use nls && append-libs intl
149 ;;
150 esac
151
152 local PO="${EPREFIX%/}"
153
154 # eval is needed to get along with pg_config quotation of space-rich entities.
155 eval econf "$(${PO}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
156 $(use_with perl) \
157 $(use_with python) \
158 $(use_with tcl) \
159 $(use_with xml libxml) \
160 $(use_with xml libxslt) \
161 $(use_with uuid ossp-uuid) \
162 --with-system-tzdata="${PO}/usr/share/zoneinfo" \
163 --with-includes="${PO}/usr/include/postgresql-${SLOT}/" \
164 --with-libraries="${PO}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \
165 "$(use_enable nls nls "$(wanted_languages)")"
166 }
167
168 src_compile() {
169 local bd
170 for bd in . contrib $(use xml && echo contrib/xml2); do
171 PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
172 emake -C $bd || die "emake in $bd failed"
173 done
174 }
175
176 src_install() {
177 if use perl ; then
178 mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
179 sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
180 "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
181 fi
182
183 local bd
184 for bd in . contrib $(use xml && echo contrib/xml2) ; do
185 PATH="${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
186 emake install -C $bd DESTDIR="${D}" || die "emake install in $bd failed"
187 done
188
189 dodoc README HISTORY doc/{TODO,bug.template}
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 die "Inserting conf failed"
197 newinitd "${WORKDIR}/postgresql.init" postgresql-${SLOT} || \
198 die "Inserting conf failed"
199
200 use pam && pamd_mimic system-auth postgresql auth account session
201
202 if use prefix ; then
203 keepdir ${RUNDIR}/run/postgresql
204 fperms 0770 ${RUNDIR}/run/postgresql
205 fi
206 }
207
208 pkg_postinst() {
209 postgresql-config update
210
211 elog "Gentoo specific documentation:"
212 elog "http://www.gentoo.org/doc/en/postgres-howto.xml"
213 elog
214 elog "Official documentation:"
215 elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
216 elog
217 elog "The default location of the Unix-domain socket is:"
218 elog " ${EROOT%/}${RUNDIR}/run/postgresql/"
219 elog
220 elog "If you have users and/or services that you would like to utilize the"
221 elog "socket, you must add them to the 'postgres' system group:"
222 elog " usermod -a -G postgres <user>"
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 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 || die "Make check failed. See above for details."
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 }