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