summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2010-02-21 10:43:41 +0000
committerPatrick Lauer <patrick@gentoo.org>2010-02-21 10:43:41 +0000
commit20063dbf56d8241f4b9c0914025fcb60742457ac (patch)
tree1db1eee443c5649e3b93e0f7ca4a7782259948cf /dev-db
parentStable on amd64 wrt bug #305625 (diff)
downloadgentoo-2-20063dbf56d8241f4b9c0914025fcb60742457ac.tar.gz
gentoo-2-20063dbf56d8241f4b9c0914025fcb60742457ac.tar.bz2
gentoo-2-20063dbf56d8241f4b9c0914025fcb60742457ac.zip
Old
(Portage version: 2.2_rc63/cvs/Linux x86_64)
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/postgis/ChangeLog7
-rw-r--r--dev-db/postgis/postgis-1.1.4.ebuild96
-rw-r--r--dev-db/postgis/postgis-1.2.0.ebuild189
-rw-r--r--dev-db/postgis/postgis-1.2.1.ebuild196
-rw-r--r--dev-db/postgis/postgis-1.3.3.ebuild183
-rw-r--r--dev-db/postgis/postgis-1.3.6.ebuild184
6 files changed, 6 insertions, 849 deletions
diff --git a/dev-db/postgis/ChangeLog b/dev-db/postgis/ChangeLog
index eaf6db92cef7..e60e9802da90 100644
--- a/dev-db/postgis/ChangeLog
+++ b/dev-db/postgis/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-db/postgis
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/ChangeLog,v 1.42 2010/02/21 10:21:16 patrick Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/ChangeLog,v 1.43 2010/02/21 10:43:41 patrick Exp $
+
+ 21 Feb 2010; Patrick Lauer <patrick@gentoo.org> -postgis-1.1.4.ebuild,
+ -postgis-1.2.0.ebuild, -postgis-1.2.1.ebuild, -postgis-1.3.3.ebuild,
+ -postgis-1.3.6.ebuild:
+ Old
*postgis-1.5.0 (21 Feb 2010)
diff --git a/dev-db/postgis/postgis-1.1.4.ebuild b/dev-db/postgis/postgis-1.1.4.ebuild
deleted file mode 100644
index ace9758ea92b..000000000000
--- a/dev-db/postgis/postgis-1.1.4.ebuild
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.1.4.ebuild,v 1.6 2009/06/13 20:25:04 djay Exp $
-
-inherit autotools eutils
-
-KEYWORDS="~amd64 ppc x86"
-
-DESCRIPTION="Geographic Objects for PostgreSQL"
-HOMEPAGE="http://postgis.refractions.net"
-SRC_URI="http://www.postgis.org/download/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="geos proj"
-
-DEPEND=">=virtual/postgresql-server-7.4
- app-text/docbook-xsl-stylesheets
- geos? ( sci-libs/geos )
- proj? ( sci-libs/proj )
- sys-devel/autoconf"
-RDEPEND=">=virtual/postgresql-server-7.4
- geos? ( sci-libs/geos )
- proj? ( sci-libs/proj )"
-
-RESTRICT="test"
-
-pkg_setup(){
- tmp="$(portageq match / ${CATEGORY}/${PN})"
- if [ "${tmp}" != "${CATEGORY}/${PF}" ]; then
- ewarn "Don't forget to dump your databases with -Fc options before"
- ewarn "upgrading postgis."
- ewarn "(see http://postgis.refractions.net/docs/ch02.html#upgrading)"
- ebeep 4
- fi
-}
-
-src_unpack(){
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}/${PN}-1.1.1_doc.patch"
-
- local xslv
- xslv="$(ls /usr/share/sgml/docbook/ | grep xsl\-)"
- einfo "doc will be build with template :"
- einfo "${xslv}"
- sed "s:xsl-stylesheets:${xslv}:" -i configure.in || die "xsl-stylesheets pb"
-
- eautoconf
-}
-
-src_compile(){
- econf \
- --enable-autoconf \
- --datadir=/usr/share/postgresql/contrib/ \
- --libdir=/usr/$(get_libdir)/postgresql/ \
- --with-docdir=/usr/share/doc/${PF}/html/ \
- $(use_with geos) \
- $(use_with proj)\
- || die "Error: econf failed"
-
- emake || die "Error: emake failed"
-
- emake docs || die "Unable to build documentation"
- cd topology/
- emake || die "Unable to build topology sql file"
-}
-
-src_install(){
- dodir /usr/$(get_libdir)/postgresql /usr/share/postgresql/contrib/
- emake DESTDIR="${D}" install || die "emake install failed"
- cd "${S}/topology/"
- emake DESTDIR="${D}" install || die "emake install topology failed"
-
- cd "${S}"
- dodoc CHANGES CREDITS README.postgis TODO loader/README.* \
- doc/*txt
-
- docinto topology
- dodoc topology/{TODO,README}
-
- cd "${S}"
- emake DESTDIR="${D}" docs-install || die "emake install docs failed"
-
- dobin ./utils/postgis_restore.pl
-}
-
-pkg_postinst() {
- einfo "To create your first postgis database use the following commands :"
- einfo " # su postgres"
- einfo " # createdb test"
- einfo " # createlang plpgsql test"
- einfo " # psql -d test -f /usr/share/postgresql/contrib/lwpostgis.sql"
- einfo " # psql -d test -f /usr/share/postgresql/contrib/spatial_ref_sys.sql"
- einfo "For more informations see : http://www.postgis.org/documentation.php"
- einfo "(For french user only see http://postgis.fr)"
-}
diff --git a/dev-db/postgis/postgis-1.2.0.ebuild b/dev-db/postgis/postgis-1.2.0.ebuild
deleted file mode 100644
index 46ba3aa1a630..000000000000
--- a/dev-db/postgis/postgis-1.2.0.ebuild
+++ /dev/null
@@ -1,189 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.2.0.ebuild,v 1.7 2009/03/07 06:27:50 zmedico Exp $
-
-inherit autotools eutils versionator
-
-KEYWORDS="~amd64 ~ppc ~x86"
-
-DESCRIPTION="Geographic Objects for PostgreSQL"
-HOMEPAGE="http://postgis.refractions.net"
-SRC_URI="http://www.postgis.org/download/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="geos proj doc"
-
-RDEPEND=">=virtual/postgresql-server-7.4
- geos? ( sci-libs/geos )
- proj? ( sci-libs/proj )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xsl-stylesheets )"
-
-RESTRICT="test"
-
-pkg_setup(){
- local tmp
- tmp="$(portageq match / ${CATEGORY}/${PN} | cut -d'.' -f2)"
- if [ "${tmp}" != "$(get_version_component_range 2)" ]; then
- elog "You must soft upgrade your existing postgis enabled databases"
- elog "using 'emerge --config postgis'."
- require_soft_upgrade="1"
- ebeep 2
- fi
-}
-
-src_unpack(){
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}/${PN}_xsl.patch"
-
- eautoconf
-}
-
-src_compile(){
- local myconf
- if use geos; then
- myconf="--with-geos"
- fi
-
- if use doc;then
- myconf="${myconf} --with-xsl=$(ls /usr/share/sgml/docbook/* | \
- grep xsl\- | cut -d':' -f1)"
- fi
-
- econf --enable-autoconf \
- --datadir=/usr/share/postgresql/contrib/ \
- --libdir=/usr/$(get_libdir)/postgresql/ \
- --with-docdir=/usr/share/doc/${PF}/html/ \
- ${myconf} \
- $(use_with proj) ||\
- die "Error: econf failed"
-
- emake || die "Error: emake failed"
-
- cd topology/
- emake || die "Unable to build topology sql file"
-
- if use doc ; then
- cd "${S}"
- emake docs || die "Unable to build documentation"
- fi
-}
-
-src_install(){
- dodir /usr/$(get_libdir)/postgresql /usr/share/postgresql/contrib/
- emake DESTDIR="${D}" install || die "emake install failed"
- cd "${S}/topology/"
- emake DESTDIR="${D}" install || die "emake install topology failed"
-
- cd "${S}"
- dodoc Changelog CREDITS TODO loader/README.* doc/*txt
-
- docinto topology
- dodoc topology/{TODO,README}
- dobin ./utils/postgis_restore.pl
-
- cd "${S}"
- if use doc; then
- emake DESTDIR="${D}" docs-install || die "emake install docs failed"
- fi
-
- if [ ! -z "${require_soft_upgrade}" ]; then
- grep "'C'" -B 4 "${D}"usr/share/postgresql/contrib/lwpostgis.sql |\
- grep -v "'sql'" > \
- "${D}"usr/share/postgresql/contrib/load_before_upgrade.sql
- fi
-}
-
-pkg_postinst() {
- elog "To create new spatial database use 'emerge --config ${PN}.'"
-}
-
-pkg_config(){
- myuser="${PG_USER:-postgres}"
- mydb="${PGDATABASE:-template_gis}"
-
- is_template=false
- if [ "${mydb:0:8}" == "template" ];then
- is_template=true
- mytype="template database"
- else
- mytype="database"
- fi
-
- einfo "Create or upgrade a spatial template and database."
- einfo "Using the user ${myuser} and the ${mydb} ${mytype}."
- einfo "Please do 'export PG_USER=...' to use another user."
- einfo "Please do 'export PGDATABASE=...' to set another template/database"
- einfo "name (templates name have to be prefixed with 'template')."
-
- logfile=$(mktemp "${ROOT}tmp/error.log.XXXXXX")
- safe_exit(){
- eerror "Removing created ${mydb} ${mytype}"
- dropdb -q -U "${myuser}" "${mydb}" ||\
- (eerror "${1}"
- die "Removing old db failed, you must do it manually")
- eerror "Please read ${logfile} for more information."
- die "${1}"
- }
-
- # if there is not a table or a template existing with the same name, create.
- if [ -z "$(psql -U "${myuser}" -l | grep "${mydb}")" ]; then
- einfo
- einfo "Please hit ENTER if you want to create the ${mydb}"
- einfo "${mytype} as "${myuser}" user, or Control-C to abort now..."
- read
- createdb -q -O ${myuser} -U ${myuser} ${mydb} ||\
- die "Unable to create the ${mydb} ${mytype} as ${myuser}"
- createlang -U ${myuser} plpgsql ${mydb}
- if [ "$?" == 2 ]; then
- safe_exit "Unable to createlang plpgsql ${mydb}."
- fi
- (psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis.sql &&
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/spatial_ref_sys.sql) 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to load sql files."
- fi
- if ${is_template}; then
- psql -q -U ${myuser} ${mydb} -c \
- "UPDATE pg_database SET datistemplate = TRUE
- WHERE datname = '${mydb}';
- GRANT ALL ON table spatial_ref_sys, geometry_columns TO PUBLIC;
- VACUUM FREEZE;" || die "Unable to create ${mydb}"
- fi
- else
- einfo
- einfo "Please hit ENTER if you want to upgrade the ${mydb}"
- einfo "${mytype} as ${myuser} user, or Control-C to abort now..."
- read
- if [ -e "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql ];
- then
- einfo "Updating the dynamic library references"
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql\
- 2> "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to update references."
- fi
- fi
- if [ -e "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql ];
- then
- einfo "Running soft upgrade"
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to run soft upgrade."
- fi
- fi
- fi
-
- if ${is_template}; then
- einfo "You can now create a spatial database using :"
- einfo "'createdb -T ${mydb} test'"
- fi
-}
diff --git a/dev-db/postgis/postgis-1.2.1.ebuild b/dev-db/postgis/postgis-1.2.1.ebuild
deleted file mode 100644
index 5f40120191f6..000000000000
--- a/dev-db/postgis/postgis-1.2.1.ebuild
+++ /dev/null
@@ -1,196 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.2.1.ebuild,v 1.3 2009/03/07 06:27:50 zmedico Exp $
-
-inherit autotools eutils versionator
-
-KEYWORDS="~x86 ~ppc ~amd64"
-
-DESCRIPTION="Geographic Objects for PostgreSQL"
-HOMEPAGE="http://postgis.refractions.net"
-SRC_URI="http://www.postgis.org/download/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="geos proj doc"
-
-RDEPEND=">=virtual/postgresql-server-7.4
- geos? ( sci-libs/geos )
- proj? ( sci-libs/proj )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xsl-stylesheets )"
-
-RESTRICT="test"
-
-pkg_setup(){
- local tmp
- tmp="$(portageq match / ${CATEGORY}/${PN} | cut -d'.' -f2)"
- if [ "${tmp}" != "$(get_version_component_range 2)" ]; then
- elog "You must soft upgrade your existing postgis enabled databases"
- elog "using 'emerge --config postgis'."
- require_soft_upgrade="1"
- ebeep 2
- fi
-}
-
-src_unpack(){
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}/${PN}_xsl.patch"
-
- eautoconf
-}
-
-src_compile(){
- local myconf
- if use geos; then
- myconf="--with-geos"
- fi
-
- if use doc;then
- myconf="${myconf} --with-xsl=$(ls "${ROOT}"usr/share/sgml/docbook/* | \
- grep xsl\- | cut -d':' -f1)"
- fi
-
- econf --enable-autoconf \
- --datadir=/usr/share/postgresql/contrib/ \
- --libdir=/usr/$(get_libdir)/postgresql/ \
- --with-docdir=/usr/share/doc/${PF}/html/ \
- ${myconf} \
- $(use_with proj) ||\
- die "Error: econf failed"
-
- emake || die "Error: emake failed"
-
- cd topology/
- emake || die "Unable to build topology sql file"
-
- if use doc ; then
- cd "${S}"
- emake docs || die "Unable to build documentation"
- fi
-}
-
-src_install(){
- dodir /usr/$(get_libdir)/postgresql /usr/share/postgresql/contrib/
- emake DESTDIR="${D}" install || die "emake install failed"
- cd "${S}/topology/"
- emake DESTDIR="${D}" install || die "emake install topology failed"
-
- cd "${S}"
- dodoc Changelog CREDITS TODO loader/README.* doc/*txt
-
- docinto topology
- dodoc topology/{TODO,README}
- dobin ./utils/postgis_restore.pl
-
- cd "${S}"
- if use doc; then
- emake DESTDIR="${D}" docs-install || die "emake install docs failed"
- fi
-
- if [ ! -z "${require_soft_upgrade}" ]; then
- grep "'C'" -B 4 "${D}"usr/share/postgresql/contrib/lwpostgis.sql |\
- grep -v "'sql'" > \
- "${D}"usr/share/postgresql/contrib/load_before_upgrade.sql
- fi
-}
-
-pkg_postinst() {
- elog "To create new spatial database use 'emerge --config ${PN}.'"
-}
-
-pkg_config(){
- PGUSER="${PGUSER:-postgres}"
- PGDATABASE="${PGDATABASE:-template_postgis}"
-
- is_template=false
- if [ "${PGDATABASE:0:8}" == "template" ];then
- is_template=true
- mytype="template database"
- else
- mytype="database"
- fi
-
- einfo "Create or upgrade a spatial template and database."
- einfo "Using the user ${PGUSER} and the ${PGDATABASE} ${mytype}."
- einfo "Please do 'export PGUSER=...' to use another user."
- einfo "Please do 'export PGDATABASE=...' to set another template/database"
- einfo "name (templates name have to be prefixed with 'template')."
-
- logfile=$(mktemp "${ROOT}tmp/error.log.XXXXXX")
- safe_exit(){
- eerror "Removing created ${mydb} ${mytype}"
- dropdb -q || (eerror "${1}"
- die "Removing old db failed, you must do it manually")
- eerror "Please see ${logfile} for more information."
- die "${1}"
- }
-
- # if there is not a table or a template existing with the same name, create.
- psql -ql 2> ${logfile}
- if [ "$?" == 2 ];then
- die "Unable to access databases server using the ${PGUSER} user"
- fi
- PGDBS="$(psql template1 -Atc \
- 'select 1 from pg_tables where tablename=${PGDATABASE};')"
- if [ "$(psql -l | grep "${PGDATABASE}")" != 1 ]; then
- einfo
- einfo "Please hit ENTER if you want to create the ${PGDATABASE}"
- einfo "${mytype} as "${PGUSER}" user, or Control-C to abort now..."
- read
- einfo "Creating the ${mytype} ${PGDATABASE}."
- createdb -q -O ${PGUSER} ||\
- die "Unable to create the ${mydb} ${mytype} as ${myuser}"
- createlang plpgsql
- if [ "$?" == 2 ]; then
- safe_exit "${myuser} not allowed to createlang plpgsql ${mydb}."
- fi
- einfo "Loading PostGIS files into ${PGDATABASE}."
- (psql -q -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis.sql &&
- psql -q -f \
- "${ROOT}"usr/share/postgresql/contrib/spatial_ref_sys.sql) 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to load the sql files."
- fi
- if ${is_template}; then
- einfo "Configure ${PGDATABASE} as a ${mytype}"
- psql -q -c \
- "UPDATE pg_database SET datistemplate=TRUE, datallowconn=FALSE
- WHERE datname = '${PGDATABASE}';
- VACUUM FREEZE;" || die "Unable to create ${mydb}"
- fi
- else
- einfo
- einfo "Please hit ENTER if you want to upgrade the ${mydb}"
- einfo "${mytype} as ${myuser} user, or Control-C to abort now..."
- read
- if [ -e "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql ];
- then
- einfo "Updating the dynamic library references"
- psql -q -f \
- "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql\
- 2> "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to update references."
- fi
- fi
- if [ -e "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql ];
- then
- einfo "Running soft upgrade"
- psql -q -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to run soft upgrade."
- fi
- fi
- fi
-
- if ${is_template}; then
- einfo "You can now create a spatial database using :"
- einfo "createdb -T ${PGDATABASE} <db_name>"
- fi
-}
diff --git a/dev-db/postgis/postgis-1.3.3.ebuild b/dev-db/postgis/postgis-1.3.3.ebuild
deleted file mode 100644
index 539f113f03b1..000000000000
--- a/dev-db/postgis/postgis-1.3.3.ebuild
+++ /dev/null
@@ -1,183 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.3.3.ebuild,v 1.5 2009/06/13 20:25:04 djay Exp $
-
-inherit eutils versionator
-
-KEYWORDS="~amd64 ~ppc ~x86"
-
-DESCRIPTION="Geographic Objects for PostgreSQL"
-HOMEPAGE="http://postgis.refractions.net"
-SRC_URI="http://www.postgis.org/download/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="geos proj doc"
-
-RDEPEND=">=virtual/postgresql-server-7.4
- geos? ( sci-libs/geos )
- proj? ( sci-libs/proj )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xsl-stylesheets )"
-
-RESTRICT="test"
-
-pkg_setup(){
- local tmp
- tmp="$(portageq match / ${CATEGORY}/${PN} | cut -d'.' -f2)"
- if [ "${tmp}" != "$(get_version_component_range 2)" ]; then
- elog "You must soft upgrade your existing postgis enabled databases"
- elog "using 'emerge --config postgis'."
- require_soft_upgrade="1"
- ebeep 2
- fi
-}
-
-src_compile(){
- local myconf
- if use geos; then
- myconf="--with-geos"
- fi
-
- if use doc;then
- myconf="${myconf} --with-xsl=$(ls "${ROOT}"usr/share/sgml/docbook/* | \
- grep xsl\- | cut -d':' -f1)"
- fi
-
- econf --enable-autoconf \
- --datadir=/usr/share/postgresql/contrib/ \
- --libdir=/usr/$(get_libdir)/postgresql/ \
- --with-docdir=/usr/share/doc/${PF}/html/ \
- ${myconf} \
- $(use_with proj) ||\
- die "Error: econf failed"
-
- emake || die "Error: emake failed"
-
- cd topology/
- emake || die "Unable to build topology sql file"
-
- if use doc ; then
- cd "${S}"
- emake docs || die "Unable to build documentation"
- fi
-}
-
-src_install(){
- dodir /usr/$(get_libdir)/postgresql /usr/share/postgresql/contrib/
- emake DESTDIR="${D}" install || die "emake install failed"
- cd "${S}/topology/"
- emake DESTDIR="${D}" install || die "emake install topology failed"
-
- cd "${S}"
- dodoc Changelog CREDITS TODO loader/README.* doc/*txt
-
- docinto topology
- dodoc topology/{TODO,README}
- dobin ./utils/postgis_restore.pl
-
- cd "${S}"
- if use doc; then
- emake DESTDIR="${D}" docs-install || die "emake install docs failed"
- fi
-
- if [ ! -z "${require_soft_upgrade}" ]; then
- grep "'C'" -B 4 "${D}"usr/share/postgresql/contrib/lwpostgis.sql |\
- grep -v "'sql'" > \
- "${D}"usr/share/postgresql/contrib/load_before_upgrade.sql
- fi
-}
-
-pkg_postinst() {
- elog "To create new spatial database use 'emerge --config ${PN}.'"
-}
-
-pkg_config(){
- myuser="${PG_USER:-postgres}"
- mydb="${PGDATABASE:-template_gis}"
-
- is_template=false
- if [ "${mydb:0:8}" == "template" ];then
- is_template=true
- mytype="template database"
- else
- mytype="database"
- fi
-
- einfo "Create or upgrade a spatial template and database."
- einfo "Using the user ${myuser} and the ${mydb} ${mytype}."
- einfo "Please do 'export PG_USER=...' to use another user."
- einfo "Please do 'export PGDATABASE=...' to set another template/database"
- einfo "name (templates name have to be prefixed with 'template')."
-
- logfile=$(mktemp "${ROOT}tmp/error.log.XXXXXX")
- safe_exit(){
- eerror "Removing created ${mydb} ${mytype}"
- dropdb -q -U "${myuser}" "${mydb}" ||\
- (eerror "${1}"
- die "Removing old db failed, you must do it manually")
- eerror "Please read ${logfile} for more information."
- die "${1}"
- }
-
- # if there is not a table or a template existing with the same name, create.
- if [ -z "$(psql -U "${myuser}" -l | grep "${mydb}")" ]; then
- einfo
- einfo "Please hit ENTER if you want to create the ${mydb}"
- einfo "${mytype} as "${myuser}" user, or Control-C to abort now..."
- read
- createdb -q -O ${myuser} -U ${myuser} ${mydb} ||\
- die "Unable to create the ${mydb} ${mytype} as ${myuser}"
- createlang -U ${myuser} plpgsql ${mydb}
- if [ "$?" == 2 ]; then
- safe_exit "Unable to createlang plpgsql ${mydb}."
- fi
- (psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis.sql &&
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/spatial_ref_sys.sql) 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to load sql files."
- fi
- if ${is_template}; then
- psql -q -U ${myuser} ${mydb} -c \
- "UPDATE pg_database SET datistemplate = TRUE
- WHERE datname = '${mydb}';
- GRANT ALL ON table spatial_ref_sys, geometry_columns TO PUBLIC;"\
- || die "Unable to create ${mydb}"
- psql -q -U ${myuser} ${mydb} "VACUUM FREEZE;" || \
- die "Unable to create ${mydb}"
- fi
- else
- einfo
- einfo "Please hit ENTER if you want to upgrade the ${mydb}"
- einfo "${mytype} as ${myuser} user, or Control-C to abort now..."
- read
- if [ -e "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql ];
- then
- einfo "Updating the dynamic library references"
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql\
- 2> "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to update references."
- fi
- fi
- if [ -e "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql ];
- then
- einfo "Running soft upgrade"
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to run soft upgrade."
- fi
- fi
- fi
-
- if ${is_template}; then
- einfo "You can now create a spatial database using :"
- einfo "'createdb -T ${mydb} test'"
- fi
-}
diff --git a/dev-db/postgis/postgis-1.3.6.ebuild b/dev-db/postgis/postgis-1.3.6.ebuild
deleted file mode 100644
index da821f451ef1..000000000000
--- a/dev-db/postgis/postgis-1.3.6.ebuild
+++ /dev/null
@@ -1,184 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.3.6.ebuild,v 1.1 2009/06/07 19:17:32 nerdboy Exp $
-
-EAPI="1"
-
-inherit eutils versionator
-
-DESCRIPTION="Geographic Objects for PostgreSQL"
-HOMEPAGE="http://postgis.refractions.net"
-SRC_URI="http://postgis.refractions.net/download/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc ~x86"
-IUSE="geos proj doc"
-
-RDEPEND=">=virtual/postgresql-server-8.0
- geos? ( sci-libs/geos )
- proj? ( sci-libs/proj )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xsl-stylesheets )"
-
-RESTRICT="test"
-
-pkg_setup(){
- local tmp
- tmp="$(portageq match / ${CATEGORY}/${PN} | cut -d'.' -f2)"
- if [ "${tmp}" != "$(get_version_component_range 2)" ]; then
- elog "You must soft upgrade your existing postgis enabled databases"
- elog "using 'emerge --config postgis'."
- require_soft_upgrade="1"
- ebeep 2
- fi
-}
-
-src_compile(){
- local myconf
- if use geos; then
- myconf="--with-geos"
- fi
-
- if use doc; then
- myconf="${myconf} --with-xsl=$(ls "${ROOT}"usr/share/sgml/docbook/* | \
- grep xsl\- | cut -d':' -f1)"
- fi
-
- econf --enable-autoconf \
- --datadir=/usr/share/postgresql/contrib/ \
- --libdir=/usr/$(get_libdir)/postgresql/ \
- --with-docdir=/usr/share/doc/${PF}/html/ \
- ${myconf} \
- $(use_with proj) ||\
- die "Error: econf failed"
-
- emake || die "Error: emake failed"
-
- cd topology/
- emake || die "Unable to build topology sql file"
-
- if use doc ; then
- cd "${S}"
- emake docs || die "Unable to build documentation"
- fi
-}
-
-src_install(){
- dodir /usr/$(get_libdir)/postgresql /usr/share/postgresql/contrib/
- emake DESTDIR="${D}" install || die "emake install failed"
- cd "${S}/topology/"
- emake DESTDIR="${D}" install || die "emake install topology failed"
-
- cd "${S}"
- dodoc CREDITS TODO loader/README.* doc/*txt
-
- docinto topology
- dodoc topology/{TODO,README}
- dobin ./utils/postgis_restore.pl
-
- cd "${S}"
- if use doc; then
- emake DESTDIR="${D}" docs-install || die "emake install docs failed"
- fi
-
- if [ ! -z "${require_soft_upgrade}" ]; then
- grep "'C'" -B 4 "${D}"usr/share/postgresql/contrib/lwpostgis.sql | \
- grep -v "'sql'" > \
- "${D}"usr/share/postgresql/contrib/load_before_upgrade.sql
- fi
-}
-
-pkg_postinst() {
- elog "To create new spatial database use 'emerge --config ${PN}.'"
-}
-
-pkg_config(){
- myuser="${PG_USER:-postgres}"
- mydb="${PGDATABASE:-template_gis}"
-
- is_template=false
- if [ "${mydb:0:8}" == "template" ];then
- is_template=true
- mytype="template database"
- else
- mytype="database"
- fi
-
- einfo "Create or upgrade a spatial template and database."
- einfo "Using the user ${myuser} and the ${mydb} ${mytype}."
- einfo "Please do 'export PG_USER=...' to use another user."
- einfo "Please do 'export PGDATABASE=...' to set another template/database"
- einfo "name (templates name have to be prefixed with 'template')."
-
- logfile=$(mktemp "${ROOT}tmp/error.log.XXXXXX")
- safe_exit(){
- eerror "Removing created ${mydb} ${mytype}"
- dropdb -q -U "${myuser}" "${mydb}" ||\
- (eerror "${1}"
- die "Removing old db failed, you must do it manually")
- eerror "Please read ${logfile} for more information."
- die "${1}"
- }
-
- # if there is not a table or a template existing with the same name, create.
- if [ -z "$(psql -U "${myuser}" -l | grep "${mydb}")" ]; then
- einfo
- einfo "Please hit ENTER if you want to create the ${mydb}"
- einfo "${mytype} as "${myuser}" user, or Control-C to abort now..."
- read
- createdb -q -O ${myuser} -U ${myuser} ${mydb} ||\
- die "Unable to create the ${mydb} ${mytype} as ${myuser}"
- createlang -U ${myuser} plpgsql ${mydb}
- if [ "$?" == 2 ]; then
- safe_exit "Unable to createlang plpgsql ${mydb}."
- fi
- (psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis.sql &&
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/spatial_ref_sys.sql) 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to load sql files."
- fi
- if ${is_template}; then
- psql -q -U ${myuser} ${mydb} -c \
- "UPDATE pg_database SET datistemplate = TRUE
- WHERE datname = '${mydb}';
- GRANT ALL ON table spatial_ref_sys, geometry_columns TO PUBLIC;" \
- || die "Unable to create ${mydb}"
- psql -q -U ${myuser} ${mydb} -c \
- "VACUUM FREEZE;" || die "Unable to set VACUUM FREEZE option"
- fi
- else
- einfo
- einfo "Please hit ENTER if you want to upgrade the ${mydb}"
- einfo "${mytype} as ${myuser} user, or Control-C to abort now..."
- read
- if [ -e "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql ];
- then
- einfo "Updating the dynamic library references"
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/load_before_upgrade.sql\
- 2> "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to update references."
- fi
- fi
- if [ -e "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql ];
- then
- einfo "Running soft upgrade"
- psql -q -U ${myuser} ${mydb} -f \
- "${ROOT}"usr/share/postgresql/contrib/lwpostgis_upgrade.sql 2>\
- "${logfile}"
- if [ "$(grep -c ERROR "${logfile}")" \> 0 ]; then
- safe_exit "Unable to run soft upgrade."
- fi
- fi
- fi
-
- if ${is_template}; then
- einfo "You can now create a spatial database using :"
- einfo "'createdb -T ${mydb} test'"
- fi
-}