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-7.4.27.ebuild
Date: Thu, 07 Jan 2010 00:50:26
Message-Id: E1NSga0-0005tZ-DK@stork.gentoo.org
1 patrick 10/01/07 00:50:24
2
3 Modified: ChangeLog
4 Added: postgresql-server-7.4.27.ebuild
5 Log:
6 Bump
7 (Portage version: 2.2_rc61/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.38 dev-db/postgresql-server/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.38&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/ChangeLog?rev=1.38&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/ChangeLog?r1=1.37&r2=1.38
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v
19 retrieving revision 1.37
20 retrieving revision 1.38
21 diff -u -r1.37 -r1.38
22 --- ChangeLog 7 Jan 2010 00:28:12 -0000 1.37
23 +++ ChangeLog 7 Jan 2010 00:50:23 -0000 1.38
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.37 2010/01/07 00:28:12 patrick Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.38 2010/01/07 00:50:23 patrick Exp $
29 +
30 +*postgresql-server-7.4.27 (07 Jan 2010)
31 +
32 + 07 Jan 2010; Patrick Lauer <patrick@g.o>
33 + +postgresql-server-7.4.27.ebuild, +files/postgresql-7.4.27-autoconf.patch:
34 + Bump
35
36 *postgresql-server-8.4.2-r1 (07 Jan 2010)
37
38
39
40
41 1.1 dev-db/postgresql-server/postgresql-server-7.4.27.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/postgresql-server-7.4.27.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/postgresql-server-7.4.27.ebuild?rev=1.1&content-type=text/plain
45
46 Index: postgresql-server-7.4.27.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-7.4.27.ebuild,v 1.1 2010/01/07 00:50:23 patrick Exp $
51
52 EAPI="1"
53
54 WANT_AUTOCONF="latest"
55 WANT_AUTOMAKE="none"
56 inherit eutils multilib toolchain-funcs versionator autotools
57
58 KEYWORDS="~amd64 ~hppa ~ppc ~x86"
59
60 DESCRIPTION="PostgreSQL server"
61 HOMEPAGE="http://www.postgresql.org/"
62 SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
63 LICENSE="POSTGRESQL"
64 SLOT="$(get_version_component_range 1-2)"
65 IUSE_LINGUAS="
66 linguas_cs linguas_de linguas_es linguas_fr linguas_hr linguas_hu
67 linguas_it linguas_nb linguas_pt_BR linguas_ru linguas_sl linguas_sv
68 linguas_tr linguas_zh_CN linguas_zh_TW"
69 IUSE="doc perl python selinux tcl xml nls kernel_linux ${IUSE_LINGUAS}"
70
71 wanted_languages() {
72 for u in ${IUSE_LINGUAS} ; do
73 use $u && echo -n "${u#linguas_} "
74 done
75 }
76
77 RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT}
78 perl? ( >=dev-lang/perl-5.6.1-r2 )
79 python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
80 selinux? ( sec-policy/selinux-postgresql )
81 tcl? ( >=dev-lang/tcl-8 )
82 xml? ( dev-libs/libxml2 dev-libs/libxslt )"
83 DEPEND="${RDEPEND}
84 sys-devel/flex
85 xml? ( dev-util/pkgconfig )"
86 PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
87
88 S="${WORKDIR}/postgresql-${PV}"
89
90 pkg_setup() {
91 enewgroup postgres 70
92 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
93 }
94
95 src_unpack() {
96 unpack ${A}
97 cd "${S}"
98
99 epatch "${FILESDIR}/postgresql-${PV}-autoconf.patch" \
100 "${FILESDIR}/postgresql-${SLOT}-vacuum-delay.patch" \
101 "${FILESDIR}/postgresql-${SLOT}-server.patch" \
102 "${FILESDIR}/postgresql-${SLOT}-hppa.patch" \
103 "${FILESDIR}/postgresql-${SLOT}-com_err.patch"
104
105 if hasq test ${FEATURES}; then
106 epatch "${FILESDIR}/postgresql-${SLOT}-regress.patch"
107 fi
108
109 eautoreconf
110 }
111
112 src_compile() {
113
114 # eval is needed to get along with pg_config quotation of space-rich entities.
115 eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \
116 $(use_with perl) \
117 $(use_with python) \
118 $(use_with tcl) \
119 --with-includes="/usr/include/postgresql-${SLOT}/" \
120 --with-libs="/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)/" \
121 "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \
122 "CFLAGS='${CFLAGS} $(use xml && pkg-config --cflags libxml-2.0)'" \
123 "LIBS='${LIBS} -lpq $(use xml && pkg-config --libs libxml-2.0) -L/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)'" \
124 || die "configure failed"
125
126 for bd in . contrib $(use xml && echo contrib/xml) ; do
127 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
128 emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \
129 docdir=/usr/share/doc/${PF} SLOT=${SLOT} || die "emake in $bd failed"
130 done
131 }
132
133 src_install() {
134 if use perl ; then
135 mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
136 sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
137 "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
138 fi
139
140 for bd in . contrib $(use xml && echo contrib/xml) ; do
141 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
142 emake install -C $bd -j1 DESTDIR="${D}" \
143 docdir=/usr/share/doc/${PF} SLOT=${SLOT} || die "emake install in $bd failed"
144 done
145
146 rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" "${D}/usr/share/doc/${PF}/html"
147 rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,vacuumdb,pgtksh,pgtclsh}.1
148
149 dodoc README HISTORY doc/{README.*,TODO,bug.template}
150
151 dodir /etc/eselect/postgresql/slots/${SLOT}
152 cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__
153 postgres_ebuilds="\${postgres_ebuilds} ${PF}"
154 postgres_service="postgresql-${SLOT}"
155 __EOF__
156
157 newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed"
158 newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed"
159
160 keepdir /var/run/postgresql
161 fperms 0770 /var/run/postgresql
162 fowners postgres:postgres /var/run/postgresql
163 }
164
165 pkg_postinst() {
166 eselect postgresql update
167 [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
168 [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT}
169
170 ewarn "Please note that the standard location of the socket has changed from /tmp"
171 ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access"
172 ewarn "the socket."
173 ewarn "This can break applications which have the standard location hard-coded."
174 ewarn "If such an application links against the libpq, please re-emerge it,"
175 ewarn "if that doesn't help or the application accesses the socket without using libpq,"
176 ewarn "please file a bug-report."
177 ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
178
179 elog "Execute the following command to setup the initial database environment:"
180 elog
181 elog "emerge --config =${CATEGORY}/${PF}"
182 elog
183 }
184
185 pkg_postrm() {
186 eselect postgresql update
187 }
188
189 pkg_config() {
190 [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data"
191
192 einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable."
193 einfo "More information can be found here:"
194 einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
195 einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
196 einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable."
197 einfo
198 einfo "You can change the directory where the database cluster is being created by setting"
199 einfo "the PGDATA variable."
200 einfo
201 einfo "PG_INITDB_OPTS is currently set to:"
202 einfo " \"${PG_INITDB_OPTS}\""
203 einfo "and the database cluster will be created in:"
204 einfo " \"${PGDATA}\""
205 einfo "Are you ready to continue? (Y/n)"
206 read answer
207 [ -z $answer ] && answer=Y
208 [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted"
209
210 if [[ -f "${PGDATA}/PG_VERSION" ]] ; then
211 eerror "The given directory \"${PGDATA}\" already contains a database cluster."
212 die "cluster already exists"
213 fi
214
215 [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128"
216 einfo "Checking system parameters..."
217
218 if ! use kernel_linux ; then
219 SKIP_SYSTEM_TESTS=yes
220 einfo " Tests not supported on this OS (yet)"
221 fi
222
223 if [ -z ${SKIP_SYSTEM_TESTS} ] ; then
224 einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..."
225
226 local SEMMSL=$(sysctl -n kernel.sem | cut -f1)
227 local SEMMNS=$(sysctl -n kernel.sem | cut -f2)
228 local SEMMNI=$(sysctl -n kernel.sem | cut -f4)
229 local SHMMAX=$(sysctl -n kernel.shmmax)
230
231 local SEMMSL_MIN=17
232 local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 ))
233 local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 ))
234 local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) ))
235
236 for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do
237 if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then
238 eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)"
239 eerror "You have now several options:"
240 eerror " - Change the mentioned system parameter"
241 eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a value lower than ${PG_MAX_CONNECTIONS}"
242 eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely"
243 eerror "More information can be found here:"
244 eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html"
245 die "system test failed"
246 fi
247 done
248 einfo "Passed."
249 else
250 einfo "Skipped."
251 fi
252
253 einfo "Creating the data directory ..."
254 mkdir -p "${PGDATA}"
255 chown -Rf postgres:postgres "${PGDATA}"
256 chmod 0700 "${PGDATA}"
257
258 einfo "Initializing the database ..."
259
260 su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}"
261
262 einfo
263 einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'."
264 einfo
265
266 if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then
267 ewarn "You didn't install the database cluster in the standard location, please make sure that you set"
268 ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})"
269 fi
270 }
271
272 src_test() {
273 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
274 PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \
275 emake -j1 check \
276 PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \
277 NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details."
278
279 einfo "Yes, there are other tests which could be run."
280 einfo "... and no, we don't plan to add/support them."
281 einfo "For now, the main regressions tests will suffice."
282 einfo "If you think other tests are necessary, please submit a"
283 einfo "bug including a patch for this ebuild to enable them."
284 }