diff options
author | Patrick Lauer <patrick@gentoo.org> | 2010-09-28 10:26:05 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2010-09-28 10:26:05 +0000 |
commit | 857d8f6e9ff5ffe78ba8120bcb839a903caefaad (patch) | |
tree | 1a818177c3e4dbadfb7e1329db34b84c386be1ed /dev-db/postgis | |
parent | USE="static-libs" and keep .la files (they are used for loading plugins). Fix... (diff) | |
download | gentoo-2-857d8f6e9ff5ffe78ba8120bcb839a903caefaad.tar.gz gentoo-2-857d8f6e9ff5ffe78ba8120bcb839a903caefaad.tar.bz2 gentoo-2-857d8f6e9ff5ffe78ba8120bcb839a903caefaad.zip |
Bump, fixes most build issues against 9.0
(Portage version: 2.2_rc88/cvs/Linux x86_64)
Diffstat (limited to 'dev-db/postgis')
-rw-r--r-- | dev-db/postgis/ChangeLog | 7 | ||||
-rw-r--r-- | dev-db/postgis/postgis-1.5.0-r1.ebuild | 16 | ||||
-rw-r--r-- | dev-db/postgis/postgis-1.5.2.ebuild | 199 |
3 files changed, 213 insertions, 9 deletions
diff --git a/dev-db/postgis/ChangeLog b/dev-db/postgis/ChangeLog index eaf922ead4f0..fbe9ed1d6f3f 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.45 2010/06/17 19:09:52 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/ChangeLog,v 1.46 2010/09/28 10:26:05 patrick Exp $ + +*postgis-1.5.2 (28 Sep 2010) + + 28 Sep 2010; Patrick Lauer <patrick@gentoo.org> +postgis-1.5.2.ebuild: + Bump, fixes most build issues against 9.0 17 Jun 2010; Patrick Lauer <patrick@gentoo.org> postgis-1.3.1.ebuild, postgis-1.3.6-r1.ebuild, postgis-1.4.0.ebuild, postgis-1.5.0.ebuild, diff --git a/dev-db/postgis/postgis-1.5.0-r1.ebuild b/dev-db/postgis/postgis-1.5.0-r1.ebuild index b8c4a1056b91..52f968c3766d 100644 --- a/dev-db/postgis/postgis-1.5.0-r1.ebuild +++ b/dev-db/postgis/postgis-1.5.0-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.5.0-r1.ebuild,v 1.2 2010/06/17 19:09:52 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.5.0-r1.ebuild,v 1.3 2010/09/28 10:26:05 patrick Exp $ EAPI="2" @@ -54,16 +54,16 @@ src_configure(){ econf --enable-autoconf \ --datadir=/usr/share/postgresql/contrib/ \ --libdir=/usr/$(get_libdir)/postgresql/ \ - --docdir=${D}/usr/share/doc/${PF}/html/ \ + --docdir="${D}/usr/share/doc/${PF}/html/" \ ${myconf} ||\ die "Error: econf failed" - if use doc; then - cd doc - sed -i -e 's:PGSQL_DOCDIR=/:PGSQL_DOCDIR=${D}/:' Makefile || die "Fixing doc install paths failed" - sed -i -e 's:PGSQL_MANDIR=/:PGSQL_MANDIR=${D}/:' Makefile || die "Fixing doc install paths failed" - sed -i -e 's:PGSQL_SHAREDIR=/:PGSQL_SHAREDIR=${D}/:' Makefile || die "Fixing doc install paths failed" - fi + if use doc; then + cd doc + sed -i -e 's:PGSQL_DOCDIR=/:PGSQL_DOCDIR=${D}/:' Makefile || die "Fixing doc install paths failed" + sed -i -e 's:PGSQL_MANDIR=/:PGSQL_MANDIR=${D}/:' Makefile || die "Fixing doc install paths failed" + sed -i -e 's:PGSQL_SHAREDIR=/:PGSQL_SHAREDIR=${D}/:' Makefile || die "Fixing doc install paths failed" + fi } src_compile() { diff --git a/dev-db/postgis/postgis-1.5.2.ebuild b/dev-db/postgis/postgis-1.5.2.ebuild new file mode 100644 index 000000000000..619aeaf4678d --- /dev/null +++ b/dev-db/postgis/postgis-1.5.2.ebuild @@ -0,0 +1,199 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-1.5.2.ebuild,v 1.1 2010/09/28 10:26:05 patrick Exp $ + +EAPI="2" + +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="doc" + +RDEPEND=">=dev-db/postgresql-server-8.3 + >=sci-libs/geos-3.2 + >=sci-libs/proj-4.6.0 + dev-libs/libxml2" + +DEPEND="${RDEPEND} + doc? ( app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + media-gfx/imagemagick )" + +RESTRICT="test" + +pkg_setup(){ + if [ ! -z "${PGUSER}" ]; then + eval unset PGUSER + fi + if [ ! -z "${PGDATABASE}" ]; then + eval unset PGDATABASE + fi + 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 "by adding their names in the ${ROOT}conf.d/postgis_dbs file" + elog "then using 'emerge --config postgis'." + require_soft_upgrade="1" + ebeep 2 + fi +} + +src_configure(){ + local myconf + if use doc; then + myconf="${myconf} --with-xsldir=$(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/ \ + --docdir="${D}/usr/share/doc/${PF}/html/" \ + ${myconf} ||\ + die "Error: econf failed" + + if use doc; then + cd doc + sed -i -e 's:PGSQL_DOCDIR=/:PGSQL_DOCDIR=${D}/:' Makefile || die "Fixing doc install paths failed" + sed -i -e 's:PGSQL_MANDIR=/:PGSQL_MANDIR=${D}/:' Makefile || die "Fixing doc install paths failed" + sed -i -e 's:PGSQL_SHAREDIR=/:PGSQL_SHAREDIR=${D}/:' Makefile || die "Fixing doc install paths failed" + fi +} + +src_compile() { + emake -j1 || die "Error: emake failed" + + cd topology/ + emake -j1 || die "Unable to build topology sql file" + + if use doc ; then + cd "${S}" + emake -j1 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 + + echo "template_gis" > postgis_dbs + doconfd postgis_dbs + + 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 (upgrade) spatial databases add their names in the" + elog "${ROOT}conf.d/postgis_dbs file, then use 'emerge --config postgis'." +} + +pkg_config(){ + einfo "Create or upgrade a spatial templates and databases." + einfo "Please add your databases names into ${ROOT}conf.d/postgis_dbs" + einfo "(templates name have to be prefixed with 'template')." + for i in $(cat "${ROOT}etc/conf.d/postgis_dbs"); do + source "${ROOT}"etc/conf.d/postgresql + PGDATABASE=${i} + eval set PGDATABASE=${i} + myuser="${PGUSER:-postgres}" + mydb="${PGDATABASE:-template_gis}" + eval set PGUSER=${myuser} + + is_template=false + if [ "${mydb:0:8}" == "template" ];then + is_template=true + mytype="template database" + else + mytype="database" + fi + + einfo + einfo "Using the user ${myuser} and the ${mydb} ${mytype}." + + 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 + 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 + 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 -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 + done +} |