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-8.5_alpha3.ebuild ChangeLog
Date: Tue, 26 Jan 2010 19:26:35
Message-Id: E1NZr3Z-0007FR-Et@stork.gentoo.org
1 patrick 10/01/26 19:26:33
2
3 Modified: ChangeLog
4 Added: postgresql-server-8.5_alpha3.ebuild
5 Log:
6 Adding 8.5 alpha
7 (Portage version: 2.2_rc61/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.51 dev-db/postgresql-server/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.51&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.51&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/ChangeLog?r1=1.50&r2=1.51
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v
19 retrieving revision 1.50
20 retrieving revision 1.51
21 diff -u -r1.50 -r1.51
22 --- ChangeLog 9 Jan 2010 19:04:31 -0000 1.50
23 +++ ChangeLog 26 Jan 2010 19:26:32 -0000 1.51
24 @@ -1,6 +1,14 @@
25 # ChangeLog for dev-db/postgresql-server
26 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.50 2010/01/09 19:04:31 patrick Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.51 2010/01/26 19:26:32 patrick Exp $
29 +
30 +*postgresql-server-8.5_alpha3 (26 Jan 2010)
31 +
32 + 26 Jan 2010; Patrick Lauer <patrick@g.o>
33 + +postgresql-server-8.5_alpha3.ebuild, +files/postgresql.conf-8.5,
34 + +files/postgresql.init-8.5, +files/postgresql-8.5-common.patch,
35 + +files/postgresql-8.5-makefile.patch, +files/postgresql-8.5-server.patch:
36 + Adding 8.5_alpha
37
38 09 Jan 2010; Patrick Lauer <patrick@g.o>
39 postgresql-server-8.4.2-r1.ebuild:
40
41
42
43 1.1 dev-db/postgresql-server/postgresql-server-8.5_alpha3.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.5_alpha3.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.5_alpha3.ebuild?rev=1.1&content-type=text/plain
47
48 Index: postgresql-server-8.5_alpha3.ebuild
49 ===================================================================
50 # Copyright 1999-2010 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.5_alpha3.ebuild,v 1.1 2010/01/26 19:26:32 patrick Exp $
53
54 EAPI="2"
55
56 # weird test failures.
57 RESTRICT="test"
58
59 WANT_AUTOCONF="latest"
60 WANT_AUTOMAKE="none"
61 inherit eutils multilib toolchain-funcs versionator autotools
62
63 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
64
65 DESCRIPTION="PostgreSQL server"
66 HOMEPAGE="http://www.postgresql.org/"
67
68 MY_PV=${PV/_/}
69 SRC_URI="mirror://postgresql/source/${MY_PV}/postgresql-${MY_PV}.tar.bz2"
70 S=${WORKDIR}/postgresql-${MY_PV}
71
72 LICENSE="POSTGRESQL"
73 SLOT="$(get_version_component_range 1-2)"
74 IUSE_LINGUAS="
75 linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr
76 linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl
77 linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv
78 linguas_tr linguas_zh_CN linguas_zh_TW"
79 IUSE="pg_legacytimestamp doc perl python selinux tcl uuid xml nls kernel_linux ${IUSE_LINGUAS}"
80
81 wanted_languages() {
82 for u in ${IUSE_LINGUAS} ; do
83 use $u && echo -n "${u#linguas_} "
84 done
85 }
86
87 RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}[pg_legacytimestamp=]
88 perl? ( >=dev-lang/perl-5.6.1-r2 )
89 python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
90 selinux? ( sec-policy/selinux-postgresql )
91 tcl? ( >=dev-lang/tcl-8 )
92 uuid? ( dev-libs/ossp-uuid )
93 xml? ( dev-libs/libxml2 dev-libs/libxslt )"
94 DEPEND="${RDEPEND}
95 sys-devel/flex
96 xml? ( dev-util/pkgconfig )"
97 PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
98
99
100 pkg_setup() {
101 enewgroup postgres 70
102 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
103 }
104
105 src_prepare() {
106 epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \
107 "${FILESDIR}/postgresql-${SLOT}-server.patch" \
108 "${FILESDIR}/postgresql-${SLOT}-makefile.patch"
109
110
111 if hasq test ${FEATURES}; 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_compile() {
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 "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
137 || die "configure failed"
138
139 for bd in . contrib $(use xml && echo contrib/xml2); do
140 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
141 emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake in $bd failed"
142 done
143 }
144
145 src_install() {
146 if use perl ; then
147 mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
148 sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
149 "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
150 fi
151
152 for bd in . contrib $(use xml && echo contrib/xml2) ; do
153 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
154 emake install -C $bd -j1 DESTDIR="${D}" || die "emake install in $bd failed"
155 done
156
157 rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" "${D}/usr/share/doc/postgresql-${SLOT}/html"
158 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
159
160 dodoc README HISTORY doc/{README.*,TODO,bug.template}
161
162 dodir /etc/eselect/postgresql/slots/${SLOT}
163 cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
164 postgres_ebuilds="\${postgres_ebuilds} ${PF}"
165 postgres_service="postgresql-${SLOT}"
166 __EOF__
167
168 newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
169 newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
170
171 keepdir /var/run/postgresql
172 fperms 0770 /var/run/postgresql
173 fowners postgres:postgres /var/run/postgresql
174 }
175
176 pkg_postinst() {
177 eselect postgresql update
178 [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
179 [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
180
181 ewarn "Please note that the standard location of the socket has changed from /tmp"
182 ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
183 ewarn "the socket."
184 ewarn "This can break applications which have the standard location hard-coded."
185 ewarn "If such an application links against the libpq, please re-emerge it,"
186 ewarn "if that doesn't help or the application accesses the socket without using libpq,"
187 ewarn "please file a bug-report."
188 ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
189
190 elog "Execute the following command to setup the initial database environment:"
191 elog
192 elog "emerge --config =${CATEGORY}/${PF}"
193 elog
194 elog "The autovacuum function, which was in contrib, has been moved to the main"
195 elog "PostgreSQL functions starting with 8.1 and starting with 8.4 is now"
196 elog "enabled by default. You can disable it in the cluster's postgresql.conf."
197 elog
198 elog "The timestamp format is 64bit integers now. If you upgrade from older databases"
199 elog "this may force you to either do a dump and reload or enable pg_legacytimestamp"
200 elog "until you find time to do so. If the database can't start please try enabling"
201 elog "pg_legacytimestamp and rebuild."
202 }
203
204 pkg_postrm() {
205 eselect postgresql update
206 }
207
208 pkg_config() {
209 [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
210
211 einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
212 einfo "More information can be found here:"
213 einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
214 einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
215 einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
216 einfo
217 einfo "You can change the directory where the database cluster is being created by setting"
218 einfo "the PGDATA variable."
219 einfo
220 einfo "PG_INITDB_OPTS is currently set to:"
221 einfo " \"${PG_INITDB_OPTS}\""
222 einfo "and the database cluster will be created in:"
223 einfo " \"${PGDATA}\""
224 einfo "Are you ready to continue? (Y/n)"
225 read answer
226 [ -z $answer ] && answer=Y
227 [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
228
229 if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
230 eerror "The given directory \"${PGDATA}\" already contains a database cluster."
231 die "cluster already exists"
232 fi
233
234 [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
235 einfo "Checking system parameters..."
236
237 if ! use kernel_linux ; then
238 SKIP_SYSTEM_TESTS=yes
239 einfo " Tests not supported on this OS (yet)"
240 fi
241
242 if [ -z ${SKIP_SYSTEM_TESTS} ] ; then
243 einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
244
245 local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
246 local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
247 local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
248 local SHMMAX=$(sysctl -n kernel.shmmax)
249
250 local SEMMSL_MIN=17
251 local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
252 local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
253 local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
254
255 for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
256 if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then
257 eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
258 eerror "You have now several options:"
259 eerror " - Change the mentioned system parameter"
260 eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a value lower than ${PG_MAX_CONNECTIONS}"
261 eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
262 eerror "More information can be found here:"
263 eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
264 die "system test failed"
265 fi
266 done
267 einfo "Passed."
268 else
269 einfo "Skipped."
270 fi
271
272 einfo "Creating the data directory ..."
273 mkdir -p "${PGDATA}"
274 chown -Rf postgres:postgres "${PGDATA}"
275 chmod 0700 "${PGDATA}"
276
277 einfo "Initializing the database ..."
278
279 su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
280
281 einfo
282 einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
283 einfo
284
285 if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
286 ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
287 ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
288 fi
289 }
290
291 src_test() {
292 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
293 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
294 emake -j1 check || die "Make check failed. See above for details."
295
296 einfo "Yes, there are other tests which could be run."
297 einfo "... and no, we don't plan to add/support them."
298 einfo "For now, the main regressions tests will suffice."
299 einfo "If you think other tests are necessary, please submit a"
300 einfo "bug including a patch for this ebuild to enable them."
301 }