Gentoo Archives: gentoo-commits

From: "Caleb Tennis (caleb)" <caleb@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-db/postgresql: ChangeLog postgresql-8.3.1.ebuild
Date: Wed, 26 Mar 2008 14:01:28
Message-Id: E1JeWBx-0003l4-I1@stork.gentoo.org
1 caleb 08/03/26 14:01:25
2
3 Modified: ChangeLog
4 Added: postgresql-8.3.1.ebuild
5 Log:
6 Version bump, with ebuidls and modifications from 206725
7 (Portage version: 2.1.4.4)
8
9 Revision Changes Path
10 1.375 dev-db/postgresql/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql/ChangeLog?rev=1.375&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql/ChangeLog?rev=1.375&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql/ChangeLog?r1=1.374&r2=1.375
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v
19 retrieving revision 1.374
20 retrieving revision 1.375
21 diff -u -r1.374 -r1.375
22 --- ChangeLog 26 Mar 2008 13:17:58 -0000 1.374
23 +++ ChangeLog 26 Mar 2008 14:01:24 -0000 1.375
24 @@ -1,6 +1,14 @@
25 # ChangeLog for dev-db/postgresql
26 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.374 2008/03/26 13:17:58 caleb Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.375 2008/03/26 14:01:24 caleb Exp $
29 +
30 +*postgresql-8.3.1 (26 Mar 2008)
31 +
32 + 26 Mar 2008; Caleb Tennis <caleb@g.o> +files/postgresql.conf-8.3,
33 + +files/postgresql.init-8.3, +files/postgresql-8.3.1-gentoo.patch,
34 + +files/postgresql-8.3.1-regress_su.patch,
35 + +files/postgresql-8.3.1-sh.patch, +postgresql-8.3.1.ebuild:
36 + Version bump, with ebuilds and modifications from 206725
37
38 *postgresql-8.2.7 (26 Mar 2008)
39
40
41
42
43 1.1 dev-db/postgresql/postgresql-8.3.1.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql/postgresql-8.3.1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql/postgresql-8.3.1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: postgresql-8.3.1.ebuild
49 ===================================================================
50 # Copyright 1999-2008 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.3.1.ebuild,v 1.1 2008/03/26 14:01:24 caleb Exp $
53
54 inherit eutils flag-o-matic multilib toolchain-funcs versionator
55
56 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
57
58 MY_PV="${PV/_rc/RC}"
59 DESCRIPTION="Sophisticated and powerful Object-Relational DBMS."
60 HOMEPAGE="http://www.postgresql.org/"
61 SRC_URI="mirror://postgresql/source/v${MY_PV}/${PN}-${MY_PV}.tar.bz2"
62 LICENSE="POSTGRESQL"
63 SLOT="0"
64 IUSE="debug doc kerberos kernel_linux nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib"
65 RESTRICT="mirror"
66 S="${WORKDIR}/${PN}-${MY_PV}"
67
68 RDEPEND="~dev-db/libpq-${PV}
69 >=sys-libs/ncurses-5.2
70 kerberos? ( virtual/krb5 )
71 pam? ( virtual/pam )
72 perl? ( >=dev-lang/perl-5.6.1-r2 )
73 python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
74 readline? ( >=sys-libs/readline-4.1 )
75 selinux? ( sec-policy/selinux-postgresql )
76 ssl? ( >=dev-libs/openssl-0.9.6-r1 )
77 tcl? ( >=dev-lang/tcl-8 )
78 xml? ( dev-libs/libxml2 dev-libs/libxslt )
79 zlib? ( >=sys-libs/zlib-1.1.3 )"
80 DEPEND="${RDEPEND}
81 sys-devel/autoconf
82 >=sys-devel/bison-1.875
83 nls? ( sys-devel/gettext )
84 xml? ( dev-util/pkgconfig )"
85
86 PG_DIR="/var/lib/postgresql"
87 [[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
88
89 pkg_setup() {
90 if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
91 if [[ $(cat "${PG_DIR}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
92 eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
93 eerror "use pg_dump to export your existing databases to a file, and then"
94 eerror "pg_restore to import them when you have upgraded completely."
95 eerror "You must remove your entire database directory to continue."
96 eerror "(database directory = ${PG_DIR})."
97 die "Remove your database directory to continue"
98 fi
99 fi
100 enewgroup postgres 70
101 enewuser postgres 70 /bin/bash /var/lib postgres
102 }
103
104 src_unpack() {
105 unpack ${A}
106 cd "${S}"
107
108 epatch "${FILESDIR}/${PN}-${PV}-gentoo.patch"
109 epatch "${FILESDIR}/${PN}-${PV}-sh.patch"
110
111 # Prepare package for future tests
112 if use test ; then
113 # Fix sandbox violation; note that we're stripping redundant slashes
114 # from ${S}, because otherwise the test would fail.
115 sed -e "s|/no/such/location|${S/\/\//\/}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
116
117 # We need to run the tests as a non-root user, portage seems the most fitting here,
118 # so if userpriv is enabled, we use it directly. If userpriv is disabled, we need to
119 # su - to a valid user, portage again, so we patch the test-scripts to do that.
120 mkdir -p "${S}/src/test/regress/tmp_check"
121 chown portage "${S}/src/test/regress/tmp_check"
122 einfo "Tests will be run as user portage."
123 if ! hasq userpriv ${FEATURES} ; then
124 mkdir -p "${S}/src/test/regress/results"
125 chown portage "${S}/src/test/regress/results"
126 epatch "${FILESDIR}/${PN}-${PV}-regress_su.patch"
127 fi
128 fi
129 }
130
131 src_compile() {
132 filter-flags -ffast-math -feliminate-dwarf2-dups
133
134 econf --prefix=/usr \
135 --includedir=/usr/include/postgresql/pgsql \
136 --sysconfdir=/etc/postgresql \
137 --mandir=/usr/share/man \
138 --host=${CHOST} \
139 --with-docdir=/usr/share/doc/${PF} \
140 --libdir=/usr/$(get_libdir) \
141 --enable-depend \
142 $(use_enable debug ) \
143 $(use_with kerberos krb5) \
144 $(use_enable nls ) \
145 $(use_with pam) \
146 $(use_with perl) \
147 $(use_enable pg-intdatetime integer-datetimes ) \
148 $(use_with python) \
149 $(use_with readline) \
150 $(use_with ssl openssl) \
151 $(use_with tcl) \
152 $(use_with xml libxml) \
153 $(use_with zlib) \
154 --with-system-tzdata=/usr/share/zoneinfo \
155 || die "configure failed"
156
157 emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "main emake failed"
158 emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" -C contrib all || die "contrib emake failed"
159 }
160
161 src_install() {
162 if use perl ; then
163 mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
164 sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
165 "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
166 fi
167
168 cd "${S}"
169 emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "main emake install failed"
170 emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" -C contrib install || die "contrib emake install failed"
171
172 cd "${S}"
173 dodoc README HISTORY
174
175 cd "${S}/doc"
176 dodoc FAQ* README.* TODO bug.template
177
178 if use doc ; then
179 cd "${S}/doc"
180 docinto FAQ_html
181 dodoc src/FAQ/*
182 docinto sgml
183 dodoc src/sgml/*.{sgml,dsl}
184 docinto sgml/ref
185 dodoc src/sgml/ref/*.sgml
186 docinto TODO.detail
187 dodoc TODO.detail/*
188 fi
189
190 newinitd "${FILESDIR}/postgresql.init-${PV%[._]*}" postgresql || die "Inserting init.d-file failed"
191 newconfd "${FILESDIR}/postgresql.conf-${PV%[._]*}" postgresql || die "Inserting conf.d-file failed"
192 }
193
194 pkg_postinst() {
195 elog "Execute the following command to setup the initial database environment:"
196 elog
197 elog "emerge --config =${PF}"
198 elog
199 elog "The autovacuum function, which was in contrib, has been moved to the main"
200 elog "PostgreSQL functions starting with 8.1."
201 elog "You can enable it in ${ROOT}/etc/postgresql/postgresql.conf."
202 elog
203 elog "If you need a global psqlrc-file, you can place it in '${ROOT}/etc/postgresql/'."
204 }
205
206 pkg_config() {
207 einfo "Creating the data directory ..."
208 mkdir -p "${PG_DIR}/data"
209 chown -Rf postgres:postgres "${PG_DIR}"
210 chmod 0700 "${PG_DIR}/data"
211
212 einfo "Initializing the database ..."
213 if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
214 eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
215 eerror "You must remove your entire database directory to continue."
216 eerror "(database directory = ${PG_DIR})."
217 die "Remove your database directory to continue"
218 else
219 if use kernel_linux ; then
220 local SEM=`sysctl -n kernel.sem | cut -f-3`
221 local SEMMNI=`sysctl -n kernel.sem | cut -f4`
222 local SEMMNI_MIN=`expr \( ${PG_MAX_CONNECTIONS} + 15 \) / 16`
223 local SHMMAX=`sysctl -n kernel.shmmax`
224 local SHMMAX_MIN=`expr 500000 + 30600 \* ${PG_MAX_CONNECTIONS}`
225
226 if [ ${SEMMNI} -lt ${SEMMNI_MIN} ] ; then
227 eerror "The current value of SEMMNI is too low"
228 eerror "for PostgreSQL to run ${PG_MAX_CONNECTIONS} connections!"
229 eerror "Temporary setting this value to ${SEMMNI_MIN} while creating the initial database."
230 echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
231 fi
232
233 su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
234
235 if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
236 echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
237 ewarn "Restoring the SEMMNI value to the previous value."
238 ewarn "Please edit the last value of kernel.sem in /etc/sysctl.conf"
239 ewarn "and set it to at least ${SEMMNI_MIN}:"
240 ewarn
241 ewarn " kernel.sem = ${SEM} ${SEMMNI_MIN}"
242 ewarn
243 fi
244
245 if [ ${SHMMAX} -lt ${SHMMAX_MIN} ] ; then
246 eerror "The current value of SHMMAX is too low for postgresql to run."
247 eerror "Please edit /etc/sysctl.conf and set this value to at least ${SHMMAX_MIN}:"
248 eerror
249 eerror " kernel.shmmax = ${SHMMAX_MIN}"
250 eerror
251 fi
252 else
253 su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
254 fi
255
256 einfo
257 einfo "You can use the '${ROOT}/etc/init.d/postgresql' script to run PostgreSQL instead of 'pg_ctl'."
258 einfo
259 fi
260 }
261
262 src_test() {
263 einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
264 if ! emake -j1 check ; then
265 hasq test ${FEATURES} && die "Make check failed. See above for details."
266 hasq test ${FEATURES} || eerror "Make check failed. See above for details."
267 fi
268
269 einfo "Yes, there are other tests which could be run."
270 einfo "... and no, we don't plan to add/support them."
271 einfo "For now, the main regressions tests will suffice."
272 einfo "If you think other tests are necessary, please submit a"
273 einfo "bug including a patch for this ebuild to enable them."
274 }
275
276
277
278
279 --
280 gentoo-commits@l.g.o mailing list