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: ChangeLog postgresql-server-9.0_rc1.ebuild
Date: Thu, 02 Sep 2010 12:39:06
Message-Id: 20100902123903.3AEFC20051@flycatcher.gentoo.org
1 patrick 10/09/02 12:39:03
2
3 Modified: ChangeLog
4 Added: postgresql-server-9.0_rc1.ebuild
5 Log:
6 Bump to 9.0_rc1
7
8 (Portage version: 2.2_rc73/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.80 dev-db/postgresql-server/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.80&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.80&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/ChangeLog?r1=1.79&r2=1.80
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v
20 retrieving revision 1.79
21 retrieving revision 1.80
22 diff -u -r1.79 -r1.80
23 --- ChangeLog 2 Sep 2010 11:07:24 -0000 1.79
24 +++ ChangeLog 2 Sep 2010 12:39:03 -0000 1.80
25 @@ -1,6 +1,12 @@
26 # ChangeLog for dev-db/postgresql-server
27 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.79 2010/09/02 11:07:24 patrick Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.80 2010/09/02 12:39:03 patrick Exp $
30 +
31 +*postgresql-server-9.0_rc1 (02 Sep 2010)
32 +
33 + 02 Sep 2010; Patrick Lauer <patrick@g.o>
34 + +postgresql-server-9.0_rc1.ebuild:
35 + Bump to 9.0_rc1
36
37 02 Sep 2010; Patrick Lauer <patrick@g.o>
38 -postgresql-server-8.1.18.ebuild, -postgresql-server-8.1.19.ebuild,
39
40
41
42 1.1 dev-db/postgresql-server/postgresql-server-9.0_rc1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/postgresql-server-9.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.0_rc1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: postgresql-server-9.0_rc1.ebuild
48 ===================================================================
49 # Copyright 1999-2010 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.0_rc1.ebuild,v 1.1 2010/09/02 12:39:03 patrick Exp $
52
53 EAPI="2"
54 PYTHON_DEPEND="python? 2"
55
56 # weird test failures.
57 RESTRICT="test"
58
59 WANT_AUTOMAKE="none"
60 inherit autotools eutils multilib python versionator
61
62 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
63
64 DESCRIPTION="PostgreSQL server"
65 HOMEPAGE="http://www.postgresql.org/"
66
67 MY_PV=${PV/_/}
68 SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
69 S=${WORKDIR}/postgresql-${MY_PV}
70
71 LICENSE="POSTGRESQL"
72 SLOT="$(get_version_component_range 1-2)"
73 IUSE_LINGUAS="
74 linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr
75 linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl
76 linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv
77 linguas_tr linguas_zh_CN linguas_zh_TW"
78 IUSE="pg_legacytimestamp doc perl python selinux tcl uuid xml nls kernel_linux ${IUSE_LINGUAS}"
79
80 wanted_languages() {
81 for u in ${IUSE_LINGUAS} ; do
82 use $u && echo -n "${u#linguas_} "
83 done
84 }
85
86 RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pg_legacytimestamp=]
87 perl? ( >=dev-lang/perl-5.6.1-r2 )
88 python? ( dev-python/egenix-mx-base )
89 selinux? ( sec-policy/selinux-postgresql )
90 tcl? ( >=dev-lang/tcl-8 )
91 uuid? ( dev-libs/ossp-uuid )
92 xml? ( dev-libs/libxml2 dev-libs/libxslt )"
93 DEPEND="${RDEPEND}
94 sys-devel/flex
95 xml? ( dev-util/pkgconfig )"
96 PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
97
98 pkg_setup() {
99 enewgroup postgres 70
100 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
101
102 if use python; then
103 python_set_active_version 2
104 fi
105 }
106
107 src_prepare() {
108 epatch "${FILESDIR}/postgresql-${SLOT}-common.3.patch" \
109 "${FILESDIR}/postgresql-${SLOT}-server.3.patch"
110
111 if use test; then
112 sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
113 else
114 echo "all install:" > "${S}/src/test/regress/GNUmakefile"
115 fi
116
117 eautoconf
118 }
119
120 src_configure() {
121 # TODO: test if PPC really cannot work with other CFLAGS settings
122 # use ppc && CFLAGS="-pipe -fsigned-char"
123
124 # eval is needed to get along with pg_config quotation of space-rich entities.
125 eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
126 --disable-thread-safety \
127 $(use_with perl) \
128 $(use_with python) \
129 $(use_with tcl) \
130 $(use_with xml libxml) \
131 $(use_with xml libxslt) \
132 $(use_with uuid ossp-uuid) \
133 --with-system-tzdata="/usr/share/zoneinfo" \
134 --with-includes="/usr/include/postgresql-${SLOT}/" \
135 --with-libraries="/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" \
136 "$(has_version ~dev-db/postgresql-base-${PV}[nls] && use_enable nls nls "$(wanted_languages)")"
137 }
138
139 src_compile() {
140 local bd
141 for bd in . contrib $(use xml && echo contrib/xml2); do
142 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
143 emake -C $bd -j1 || die "emake in $bd failed"
144 done
145 }
146
147 src_install() {
148 if use perl ; then
149 mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
150 sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
151 "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
152 fi
153
154 for bd in . contrib $(use xml && echo contrib/xml2) ; do
155 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
156 emake install -C $bd -j1 DESTDIR="${D}" || die "emake install in $bd failed"
157 done
158
159 rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" "${D}/usr/share/doc/postgresql-${SLOT}/html"
160 rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1
161
162 dodoc README HISTORY doc/{README.*,TODO,bug.template}
163
164 dodir /etc/eselect/postgresql/slots/${SLOT}
165 cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
166 postgres_ebuilds="\${postgres_ebuilds} ${PF}"
167 postgres_service="postgresql-${SLOT}"
168 __EOF__
169
170 newinitd "${FILESDIR}/postgresql.init-${SLOT}-r1" postgresql-${SLOT} || die "Inserting init.d-file failed"
171 newconfd "${FILESDIR}/postgresql.conf-${SLOT}-r1" postgresql-${SLOT} || die "Inserting conf.d-file failed"
172
173 keepdir /var/run/postgresql
174 fperms 0770 /var/run/postgresql
175 fowners postgres:postgres /var/run/postgresql
176 }
177
178 pkg_postinst() {
179 eselect postgresql update
180 [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
181 [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
182
183 ewarn "Please note that the standard location of the socket has changed from /tmp to"
184 ewarn "/var/run/postgresql and you have to be in the 'postgres' group to access the"
185 ewarn "socket. This can break applications which have the standard location"
186 ewarn "hard-coded. If such an application links against the libpq, please reemerge"
187 ewarn "it. If that doesn't help or the application accesses the socket without using"
188 ewarn "libpq, please file a bug-report."
189 ewarn
190 ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the"
191 ewarn "original location."
192 ewarn
193
194 elog "The PostgreSQL community has called for more testers of the upcoming 9.0"
195 elog "release. This beta version of the PostgreSQL server, while moved to ~arch, will"
196 elog "never be marked stable. As such, you may not want to use this package in an"
197 elog "environment where incompatible changes are unacceptable. Bear in mind, though,"
198 elog "that these packages are slotted and that you may run multiple server instances"
199 elog "simultaneously without conflict."
200 elog
201
202 elog "Before initializing the database, you may want to edit PG_INITDB_OPTS so that it"
203 elog "contains your preferred locale and character encoding in:"
204 elog
205 elog " /etc/conf.d/postgresql-${SLOT}"
206 elog
207 elog "Then, execute the following command to setup the initial database environment:"
208 elog
209 elog " emerge --config =${CATEGORY}/${PF}"
210 elog
211 elog "The autovacuum function, which was in contrib, has been moved to the main"
212 elog "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled by"
213 elog "default. You can disable it in the cluster's postgresql.conf."
214 elog
215 elog "The timestamp format is 64 bit integers now. If you upgrade from older"
216 elog "databases, this may force you to either do a dump and reload or enable"
217 elog "pg_legacytimestamp until you find time to do so. If the database can't start"
218 elog "please try enabling pg_legacytimestamp and rebuild."
219 }
220
221 pkg_postrm() {
222 eselect postgresql update
223 }
224
225 pkg_config() {
226 [[ -f /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT}
227 [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
228
229 # environment.bz2 may not contain the same locale as the current system
230 # locale. Unset and source from the current system locale.
231 if [ -f /etc/env.d/02locale ]; then
232 unset LANG
233 unset LC_CTYPE
234 unset LC_NUMERIC
235 unset LC_TIME
236 unset LC_COLLATE
237 unset LC_MONETARY
238 unset LC_MESSAGES
239 unset LC_ALL
240 source /etc/env.d/02locale
241 [ -n "${LANG}" ] && export LANG
242 [ -n "${LC_CTYPE}" ] && export LC_CTYPE
243 [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
244 [ -n "${LC_TIME}" ] && export LC_TIME
245 [ -n "${LC_COLLATE}" ] && export LC_COLLATE
246 [ -n "${LC_MONETARY}" ] && export LC_MONETARY
247 [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
248 [ -n "${LC_ALL}" ] && export LC_ALL
249 fi
250
251 einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
252 einfo "More information can be found here:"
253 einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
254 einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
255 einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS"
256 einfo "variable."
257 einfo
258 einfo "You can change the directory where the database cluster is being created by"
259 einfo "setting the PGDATA variable."
260 einfo
261 einfo "PG_INITDB_OPTS is currently set to:"
262 einfo " \"${PG_INITDB_OPTS}\""
263 einfo "and the database cluster will be created in:"
264 einfo " \"${PGDATA}\""
265 einfo "Are you ready to continue? (Y/n)"
266 read answer
267 [ -z $answer ] && answer=Y
268 [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
269
270 if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
271 eerror "The given directory \"${PGDATA}\" already contains a database cluster."
272 die "cluster already exists"
273 fi
274
275 [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
276 einfo "Checking system parameters..."
277
278 if ! use kernel_linux ; then
279 SKIP_SYSTEM_TESTS=yes
280 einfo " Tests not supported on this OS (yet)"
281 fi
282
283 if [ -z ${SKIP_SYSTEM_TESTS} ] ; then
284 einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
285
286 local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
287 local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
288 local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
289 local SHMMAX=$(sysctl -n kernel.shmmax)
290
291 local SEMMSL_MIN=17
292 local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
293 local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
294 local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
295
296 for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
297 if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then
298 eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
299 eerror "You have now several options:"
300 eerror " - Change the mentioned system parameter"
301 eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a value lower than ${PG_MAX_CONNECTIONS}"
302 eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
303 eerror "More information can be found here:"
304 eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
305 die "System test failed."
306 fi
307 done
308 einfo "Passed."
309 else
310 einfo "Skipped."
311 fi
312
313 einfo "Creating the data directory ..."
314 mkdir -p "${PGDATA}"
315 chown -Rf postgres:postgres "${PGDATA}"
316 chmod 0700 "${PGDATA}"
317
318 einfo "Initializing the database ..."
319
320 su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
321
322 einfo
323 einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
324 einfo "instead of 'pg_ctl'."
325 einfo
326 }
327
328 src_test() {
329 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
330 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
331 emake -j1 check || die "Make check failed. See above for details."
332
333 einfo "Yes, there are other tests which could be run."
334 einfo "... and no, we don't plan to add/support them."
335 einfo "For now, the main regressions tests will suffice. If you think other tests are"
336 einfo "necessary, please submit a bug including a patch for this ebuild to enable them."
337 }