annotate dev-db/postgresql/postgresql-8.3.1.ebuild @ 3:e15b399580ab

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