diff options
author | Patrick Lauer <patrick@gentoo.org> | 2010-02-23 14:40:20 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2010-02-23 14:40:20 +0000 |
commit | 91a25a7256a32587117d243489769db8cc39e0d4 (patch) | |
tree | b39f3ba94a65182061d0aef0febab3331b3a5389 /dev-db | |
parent | stable x86, bug 301306 (diff) | |
download | historical-91a25a7256a32587117d243489769db8cc39e0d4.tar.gz historical-91a25a7256a32587117d243489769db8cc39e0d4.tar.bz2 historical-91a25a7256a32587117d243489769db8cc39e0d4.zip |
Fixing doc installation. Slightly hacky, sorry :)
Package-Manager: portage-2.2_rc63/cvs/Linux x86_64
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/postgis/ChangeLog | 7 | ||||
-rw-r--r-- | dev-db/postgis/Manifest | 3 | ||||
-rw-r--r-- | dev-db/postgis/postgis-1.5.0-r1.ebuild | 199 |
3 files changed, 207 insertions, 2 deletions
diff --git a/dev-db/postgis/ChangeLog b/dev-db/postgis/ChangeLog index e60e9802da90..1379c5c26f69 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.43 2010/02/21 10:43:41 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/ChangeLog,v 1.44 2010/02/23 14:40:20 patrick Exp $ + +*postgis-1.5.0-r1 (23 Feb 2010) + + 23 Feb 2010; Patrick Lauer <patrick@gentoo.org> +postgis-1.5.0-r1.ebuild: + Fixing doc installation. Slightly hacky, sorry :) 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, diff --git a/dev-db/postgis/Manifest b/dev-db/postgis/Manifest index 430ab3c75b8a..d1e7ec532a0d 100644 --- a/dev-db/postgis/Manifest +++ b/dev-db/postgis/Manifest @@ -7,6 +7,7 @@ DIST postgis-1.5.0.tar.gz 3752211 RMD160 815c445d7ab628254130d2277648913e945b2af EBUILD postgis-1.3.1.ebuild 5292 RMD160 fc0b526f61d26082e4918606a89ec320ed773ef7 SHA1 284181900e238b3a1fe61d150d08c3bb9a91ddf1 SHA256 c00e11c8389c85d43096b768085917701720626a977cfe6734f8d8855b616a3f EBUILD postgis-1.3.6-r1.ebuild 5584 RMD160 5b9ed4739e6e3b9c99adc54b32814649552594f2 SHA1 c569daa1826b774d5397634a005593243c35ce74 SHA256 ec0c917b3ef58e775e666bdaeb6a2597b1042337b83952fc2ef4c3a6ae2b5b64 EBUILD postgis-1.4.0.ebuild 5538 RMD160 bb8524cb5471bc9fb2a18e50e029f79606cbb62c SHA1 c8579cf79e70254768b3855e814b4dde231534db SHA256 4651a6d479f6e8fba64da16e1d65815493b16bd91efb15caf43953df0c0a86cb +EBUILD postgis-1.5.0-r1.ebuild 6019 RMD160 ac7fd18f24df3ec535dfea9c5db52a6f401cad4e SHA1 97d85f434c85d675039b1b45936bcc5db6f4f9ff SHA256 2f213ed628896a9a4db2bf890bd6ffbc52a9d3ccbf2058c9d00e3141c8ceb490 EBUILD postgis-1.5.0.ebuild 5558 RMD160 7eddc542103109db4728b5c764c8dfdbdda69151 SHA1 a247272051cea22968b79f7ba26332de2549252d SHA256 af3123bc8e930b130273b8635f4c95554f282febcfbfbd296b6e1c8ef33c0b0f -MISC ChangeLog 5697 RMD160 a8ed44e8067f7fab2f464f4653fcf63d770c51af SHA1 2fc86222aaaafd1e00114dc7eda310d29d00869c SHA256 2a94d220965a0ca3977d1133a5531912efc7b1724933227bc514e24a7630e8de +MISC ChangeLog 5859 RMD160 9209e236e577c080c04e35ad942fba421385e2b7 SHA1 987ef2c01e59d5b95a2bf2a6d9760bd2c5638d71 SHA256 aebf14cd91661b4f92ed9bbe98bc7abb1ee4ad459bbb2463d120fe925d289c51 MISC metadata.xml 403 RMD160 5fbeb16f0092761ac18838b12324116f2e6b916a SHA1 126e862a730f1bc58923a92b19ae81bb29fe6f99 SHA256 7cfb1f265694d5c7614ab20a0f456a251d361a95f8dea002e686e0df62038cfc diff --git a/dev-db/postgis/postgis-1.5.0-r1.ebuild b/dev-db/postgis/postgis-1.5.0-r1.ebuild new file mode 100644 index 000000000000..191e0a6ac8af --- /dev/null +++ b/dev-db/postgis/postgis-1.5.0-r1.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.0-r1.ebuild,v 1.1 2010/02/23 14:40:20 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=">=virtual/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 +} |