diff options
author | 2013-06-26 10:59:36 +0000 | |
---|---|---|
committer | 2013-06-26 10:59:36 +0000 | |
commit | dc178b7f31958ce41fb72972a7a7cc4357fcd552 (patch) | |
tree | 50992e9a74011c30321bbc9aba39ba32280df935 /dev-db/postgis | |
parent | Apply upstream patch for fixing infinite loop wrt #474716 by Marien Zwart <ma... (diff) | |
download | historical-dc178b7f31958ce41fb72972a7a7cc4357fcd552.tar.gz historical-dc178b7f31958ce41fb72972a7a7cc4357fcd552.tar.bz2 historical-dc178b7f31958ce41fb72972a7a7cc4357fcd552.zip |
Version bump. Fixes bug 470050.
Package-Manager: portage-2.1.11.62/cvs/Linux x86_64
Manifest-Sign-Key: 0xD1BBFDA0
Diffstat (limited to 'dev-db/postgis')
-rw-r--r-- | dev-db/postgis/ChangeLog | 8 | ||||
-rw-r--r-- | dev-db/postgis/Manifest | 11 | ||||
-rw-r--r-- | dev-db/postgis/files/postgis-2.1-pkgconfig-json.patch | 122 | ||||
-rw-r--r-- | dev-db/postgis/postgis-2.1.0_beta3.ebuild | 312 |
4 files changed, 448 insertions, 5 deletions
diff --git a/dev-db/postgis/ChangeLog b/dev-db/postgis/ChangeLog index d91a36ee6f0d..0e4722e125f0 100644 --- a/dev-db/postgis/ChangeLog +++ b/dev-db/postgis/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-db/postgis # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/ChangeLog,v 1.82 2013/04/28 13:09:21 titanofold Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/ChangeLog,v 1.83 2013/06/26 10:59:19 titanofold Exp $ + +*postgis-2.1.0_beta3 (26 Jun 2013) + + 26 Jun 2013; Aaron W. Swenson <titanofold@gentoo.org> + +postgis-2.1.0_beta3.ebuild, +files/postgis-2.1-pkgconfig-json.patch: + Version bump. Fixes bug 470050. 28 Apr 2013; Aaron W. Swenson <titanofold@gentoo.org> -postgis-1.3.6-r1.ebuild, -postgis-1.4.2-r1.ebuild, -postgis-1.5.3-r1.ebuild, diff --git a/dev-db/postgis/Manifest b/dev-db/postgis/Manifest index f851d67c7582..427495d44db5 100644 --- a/dev-db/postgis/Manifest +++ b/dev-db/postgis/Manifest @@ -4,22 +4,25 @@ Hash: SHA256 AUX postgis-1.5-ldflags.patch 1379 SHA256 dd06c5a6dbf085cee2f4d08bae1c6440511596d21876f955f6b6d2e133c97559 SHA512 47164ecf5a875267d545504f2dec6b52d34161cd9598968d323bc8949d9bdcfd911d20519faca1a1cf3ce67d6dd0a9bc201c6afc0df7881752368c70bd3cb69b WHIRLPOOL 8c9fb2945c696b1208ba047e51869f11ceabccabd34d0cc0f2d345bb17d1d1c27421e5536882488eb64460e1e703823e5d3e6392eed1667448313b0fd7330601 AUX postgis-2.0-ldflags.patch 1355 SHA256 8fd78bcee5d20e8735b4b8d034ca762af0d56d42586449e78207fcad2d52d308 SHA512 5e53f5812d8e4f0be72e92632f881ee8520a9fc0a73ae68a9abc494296075fdc82df51573f7a7d68ea4bf6d691d8de4496bb02f7fa78bf7cf73dcc202af6ae71 WHIRLPOOL 606cbb6a229000f18378f2e3a5e6e0e61d767b2c183df0b28927d4ba9b51488cce2ae36adbfa32386f3c2f5bade3ec6bc92d18bf107de1f9a46c0bd320220af8 AUX postgis-2.0-pkgconfig-json.patch 3517 SHA256 b2658bc9b679b19ec0c04f12de04e7eb02f6669da01929734c4852735cd577c1 SHA512 c57bbd386983857be3808e7b1267fd491758b84f7c5795947ae039fea40cd8a9f0836d585dc6f3204edab17848e7826b7812aa90638c3d3b4c22aa916ddd925d WHIRLPOOL 2c1c990916db26d5e5fbe21c582912a2d64bc3af40f5a6bd37161df692aa78093a5d3644df5bb2b49b70819b91491076bc5905c99a2bbf5d07860f97aaf29f1f +AUX postgis-2.1-pkgconfig-json.patch 4620 SHA256 67cda2c32bbf689d5a9f9bb0953c71dfd20bd038397c9d02f421517648604c57 SHA512 4d52e96f9ff431c4695d0bf121ec0bb4f99a4a03adb7a68dcc02a5a560428a03467207d235f755f3451af128b523a61c74a707d46ac15a56b7b77025f48af698 WHIRLPOOL 9810ab0c968989a2e460d169afc2665ffc2eacc11695cc75ef74befed673bd58e8f4b201427828bd5e70a69943beddaf6501607ec9d63593e3b4f67435056fcc AUX postgis_dbs 2096 SHA256 dafde4a1d1d95e18facb3287baddab3c1c116933498c310438c91dbd736833ec SHA512 5a11a3ce0153461f363d1b9a393dd10392e123c7b18b20610a5e26f2c7c6ed258a1517082a244c6ab5de40d439bc8a370848a0177c3c2ffcffc67a24fca8e66a WHIRLPOOL 8e4c34ac428c5ac887b414334fe80424b09845585596be1affaf69a9205af7dd183198eed44fa0406074ad1bcc133db8a9a13acd4a0882945b32ec8e0a480b61 AUX postgis_dbs-1.4 2096 SHA256 287224c16cbd286c75098e786235ad07226217fbcf76071279081e6cb1d1add1 SHA512 520711a6165dbb08c7ce86001f885340b5dbc54efc2a863726b09d93db9e0d888c21fa5b466506456cacadd55db8531284c5b85f484c599d313f4d9aac56c1ef WHIRLPOOL 1b87d8edf109dd76a54a8c7819731a843e7ec139bcaef4b69605304a336eb3d558e656c1adf06ca487f1c5624c542634be7b885dd888e5ef4ec89e2970d38195 DIST postgis-1.3.6.tar.gz 2227317 SHA256 d3b04d4a3439596a1f6368b0627f21762347cef1e0694d5471ef17c6a3b7d144 SHA512 0e98aeaf8c3c3ca1c51c617a6f50f066a69129b63721507708f02c69b5ff8e75c4b7b076f5075263ceedaf10904eaf950784b2c2f9f27ba3bb982f871b68fd4b WHIRLPOOL c45c611a992b044f63be3259c046f01e34b0772f2f95bf7fb7b71b54adef1c72aa3c86141bff8d305751e4598ee18a40e1ebc5439501b76e6c430c19c988d316 DIST postgis-1.4.2.tar.gz 3276515 SHA256 5ce49b83b4c8f62eccb7080157f05299ff0e49c6ba06c3e1fa1ecfa2682c4d4b SHA512 3c27e8ed9eeb0e884190cdd5e4731989f9752e2ba449cdfe45d09cd638bd5b600d5cef16140e072d5e328cac035b2ffcc18392651c7306dcc4b5401429efc73e WHIRLPOOL 34a92d15018c5c414f93bf16c7cccb53af0943564b378bf2ca49d1692ebe51b9935214a5b2e2bddee716734954be7aabe0b4ce8b9c6b7d9cfbb801fa177bf5c4 DIST postgis-1.5.8.tar.gz 3948219 SHA256 4896fdae2f814b88c3ca458b7d01d7eca7e9aca021599c817919f131a1b0d804 SHA512 30167c56083dcd2aa764ee82b5b124992bfca2ab4eb8753a80f0fe624b310a060411f0714a8e56a1aebc277c3fdf8e1157d13d91560d5a8ffbc64917e9f3c727 WHIRLPOOL c889546679f69bbfc6d015c245721323c39fc18b6da2cfc28e24c7c736be112274f5c43d7d2ce61ea11a49011123d66d1a8f3c79ec3356227c48325945bff72a DIST postgis-2.0.3.tar.gz 5581619 SHA256 7f865a6fdf19afed7d2f3e7178cd504f7254a9e96f2ce6a07d0ea19edc1668a0 SHA512 e49232a0aebd202a053e2f6cb741551e932e49a8c535fadd22fe15c654e3823c2f43a4c78dc0340cddbbc7f9298651dc16e1737be3bfe0779cc4feede032facc WHIRLPOOL 9c7985ab6d50a4a8ffa4e8fa5ea69c7e365aae8d90a3ea70c978149e5a9efe4a29a29d11db5d2a6b5c830dcd5ba458a3263288f32a5af54665f5d1cab3357415 +DIST postgis-2.1.0beta3.tar.gz 6514183 SHA256 00bf610724a7100cd3585b17e9eeb9700c76acc4a73a647e81bbd6fcc6e2f07f SHA512 11fc8e8ebba124551f290998ac05949eaedce2e937d1d41801df54247f67106edb3f3806a7e7df81c2b782325c9cd0a235cbc7b556f68b7188c497dec48fbcac WHIRLPOOL 3ee2808c880e618230c4bcefe30449999a965743e52d0082b7f673649af9a84b1a807f7e14e7a6a278210c7118291d86a4147665543655e1ba1e5134654d2d6b EBUILD postgis-1.3.6-r2.ebuild 6017 SHA256 af5177091e4ff0133ab6ad1320da6a7e77975e3cb1972853e705591be54c059f SHA512 58a3a87c8187534c57f5bb7e250e144ad32883a565bc5bda9a035d4bf382860e21485b8f2bc2e5d16235a4b0b5e97b3847aa3b0480a9d552c22a51742bfb535e WHIRLPOOL 1d8c0bc8f29b7bfb73ae56bf5d10f804bdea5342fcb5861f8358295219ef1fcaa62f142d2ea4b952214352e0ba8e10e11e3ba82fa6fe29fa8c5d5cd51f545bfc EBUILD postgis-1.4.2-r2.ebuild 6683 SHA256 86e7e7a070bc058d621658961c8e9baf1eb16a109b973a1dab3e4e9305bb90b2 SHA512 07ec50fc31a5ef2adbe067fc2049a5fc987ed1bf84cb06b3e1ac80075df79f9ff4a17b54d94b1d613ad322aa1497a66271279983f14a5e184450463c20737c24 WHIRLPOOL 7a1a670f9a0c12f55e8d2cd611f5381e24d6fd6dec2c10d0bb8d7121358918545cfddfd3ff582b26ee56a76f3a5ca0c900863331864311f62b32c28948cf2d41 EBUILD postgis-1.5.8.ebuild 6704 SHA256 3faab2cd45dc34a6db623e46c9f62575cc566fe8ebf49ec3d5a634d987e34fb9 SHA512 452941afbd1d2d4789440910aaf02e297f62162c02dad712b8acfca4c4739c760561fe67835abd1dc02c20729e562c001b6fbeabf7df274efbb9266f0f6587eb WHIRLPOOL 89084aced98180bb1f0b60765f0d17b1740ab2f92c53586c780763c295f65e7d7f739e57cf03e35b26930e53af1812bc46dc7359c0fb45e29485335c3132cb35 EBUILD postgis-2.0.3.ebuild 7173 SHA256 23a8a46795272d037cce3c13d24661437d868bc619728db03c54ce5dcd2da455 SHA512 f86a22ee0dc79d68446733988ca4945bd4c0f6164d13e9719b049b774098709a9c40af71f487c90f4e45af09261920e24aa44c745c463c2bad1c7a43ffff3f1e WHIRLPOOL 8d970567789cf660c7496fa04e8287c28e6ceb4bfea782cb6c7d275307e9a6cdc370874ed4c1e4cbee9ec17ffc8e58443935046bef39e40c13733f0416a1b87e -MISC ChangeLog 11840 SHA256 60f444ff3a75025e94d13de510280e457127065a1ead15fef65de8a5320c0af4 SHA512 9f5efdc97d79cd48e96355ceeb85c753465c5b0d11a983b00da715f4f8d8342ed0e443ac6d338f151e66a7d7812bc7c4d497839b2c2d32c1ef71da936ae7ba44 WHIRLPOOL d9748cbb6c2ecc5205568025ab3c32230bc10782e0b0ba8322551f42f016a4d05ce010d35a2752535f94d9632679d2c18b7c88657e84f7426e5ce350600dd8a1 +EBUILD postgis-2.1.0_beta3.ebuild 8568 SHA256 8bb8d682a0e22c27e2999bf2375c3eb6179e0e143945d7e09ded11a29c89baed SHA512 a756a1ae64b6d2a1ecc49be4617251db343a4008b5af323a36c28b56a7e109450a119c9a58f4a628066ea6a9be7115dc6a546b1b382ddb8d5b6e39c92be5854c WHIRLPOOL 04551086084035f10f4cd552a501445dfc9b796633d2762c29dc99dd1cecb8a1e5c0997fd4c5cfc7efc2d4ea22dbe346a64c6facccee0ce79076fd3733af59f0 +MISC ChangeLog 12039 SHA256 7a9291164e9aade1d8174d65b2bf39f12dba13e0d6986757af0e7b6a40c058ee SHA512 12117d3e03aaeb9846dd1ed73331a656d34e011fbb1913102747f402a8d35f1530b113956b03782db22a95a85f7310e139ac8cd439f997e586f98a3ba86c2226 WHIRLPOOL fee3e4237118919a40befe9ee804ee279079a5acc1a6111a48821abcbb8b03e76752cd33c603da6dd3e30140523a0ed771e19a292a92ee1f27b9e36b8ddce1db MISC metadata.xml 481 SHA256 d0ab8dbe26001259f36c968e1d48ad5fda768227d99319cf4302af804a08d5ef SHA512 5299745d72d13ccc71d5f6eee5d343268a59f57ac208621c81643e7f2160b66382c3dd0bf07c97f4cefaebfbbbfc5e11e6b84318f5fc536877f123be2fd7743e WHIRLPOOL 257b7f00ffcd56df202c0e1cd75383bf7ed9b0c854cadb9371a281bbd200b8686c70d3d28cadd06756510f9d6536ee64c636a12f5170ce5c608e82d1148ba9fe -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iF4EAREIAAYFAlF9H4YACgkQVxOqA9G7/aCVZQEAm4cbGyNsd5+DhSb2VOT477lw -b5DR2sVPJri3iiDky/gA/22Fta6L3InmxTes8oA7JEaIzcX3ULUjpaaiDZVrYCR5 -=qhVe +iF4EAREIAAYFAlHKyY4ACgkQVxOqA9G7/aB01QEAiBJgEtupJYa/Acxe8DL3JSDc +j6fcrRuic3fb01S4Y/oA/Rios6z9CI1lICkfe87+nfcx2o5n4hCzxtj+F4uML9Sg +=LY0F -----END PGP SIGNATURE----- diff --git a/dev-db/postgis/files/postgis-2.1-pkgconfig-json.patch b/dev-db/postgis/files/postgis-2.1-pkgconfig-json.patch new file mode 100644 index 000000000000..fcef149646e9 --- /dev/null +++ b/dev-db/postgis/files/postgis-2.1-pkgconfig-json.patch @@ -0,0 +1,122 @@ +diff -Naurw postgis-2.1.0beta3.orig/configure.ac postgis-2.1.0beta3/configure.ac +--- postgis-2.1.0beta3.orig/configure.ac 2013-06-21 15:45:40.000000000 +0000 ++++ postgis-2.1.0beta3/configure.ac 2013-06-23 22:47:31.914947086 +0000 +@@ -743,65 +743,14 @@ + dnl Detect if json-c installed + dnl =========================================================================== + +-CHECK_JSON=yes +-HAVE_JSON=no +-AC_SUBST([HAVE_JSON]) +- +-AC_ARG_WITH([json], +- [AS_HELP_STRING([--without-json], [build without json-c support])], +- [CHECK_JSON="$withval"], []) +- +-if test "$CHECK_JSON" != "no"; then dnl { +- +-AC_ARG_WITH([jsondir], +- [AS_HELP_STRING([--with-jsondir=PATH], [specify the json-c installation directory])], +- [JSONDIR="$withval"], [JSONDIR=]) +- +-if test ! "x$JSONDIR" = "x"; then +- dnl Make sure that the directory exists +- if test "x$JSONDIR" = "xyes"; then +- AC_MSG_ERROR([you must specify a parameter to --with-jsondir, e.g. --with-jsondir=/path/to]) +- else +- dnl We need (libjson.so OR libjson.a OR libjson.dll) AND json/json.h +- if test ! -e "${JSONDIR}/include/json/json.h" -o \ +- ! \( -e "${JSONDIR}/lib/libjson.so" -o \ +- -e "${JSONDIR}/lib/libjson.dll" -o \ +- -e "${JSONDIR}/lib/libjson.dylib" -o \ +- -e "${JSONDIR}/bin/libjson.dll" -o \ +- -e "${JSONDIR}/lib/libjson.a" \) +- then +- AC_MSG_ERROR([Cannot find json dev files in "$JSONDIR"]) +- fi +- AC_MSG_RESULT([Using user-specified json-c directory: $JSONDIR]) +- +- dnl Add the include directory to JSON_CPPFLAGS +- JSON_CPPFLAGS="-I$JSONDIR/include" +- JSON_LDFLAGS="-L$JSONDIR/lib" +- fi +-fi +- +-dnl Check that we can find the json/json.h header file +-CPPFLAGS_SAVE="$CPPFLAGS" +-CPPFLAGS="$JSON_CPPFLAGS" +-AC_CHECK_HEADER([json/json.h], [HAVE_JSON=yes], []) +-CPPFLAGS="$CPPFLAGS_SAVE" +- +-dnl Ensure we can link against libjson +-LIBS_SAVE="$LIBS" +-LIBS="$JSON_LDFLAGS" +-AC_CHECK_LIB([json-c], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson-c"], [ +- AC_CHECK_LIB([json], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson"], [], []) +-], []) +-LIBS="$LIBS_SAVE" +- +-if test "$HAVE_JSON" = "yes"; then ++PKG_CHECK_MODULES([JSON], [json], ++ [ ++ HAVE_JSON=yes + AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is present]) +-fi ++ ], ++ [HAVE_JSON=no]) + +-AC_SUBST([JSON_CPPFLAGS]) +-AC_SUBST([JSON_LDFLAGS]) +- +-fi dnl } ++AC_SUBST([HAVE_JSON]) + + dnl =========================================================================== + dnl Detect GTK+2.0 for GUI +@@ -892,10 +841,10 @@ + AC_DEFINE_UNQUOTED([POSTGIS_USE_STATS], [1], [Enable use of ANALYZE statistics]) + + +-CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS" ++CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $JSON_CFLAGS" + dnl AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS]) + +-SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $SFCGAL_LDFLAGS" ++SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LIBS $XML2_LDFLAGS $SFCGAL_LDFLAGS" + AC_SUBST([SHLIB_LINK]) + dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK]) + +diff -Naurw postgis-2.1.0beta3.orig/liblwgeom/lwin_geojson.c postgis-2.1.0beta3/liblwgeom/lwin_geojson.c +--- postgis-2.1.0beta3.orig/liblwgeom/lwin_geojson.c 2013-02-28 17:42:49.000000000 +0000 ++++ postgis-2.1.0beta3/liblwgeom/lwin_geojson.c 2013-06-23 22:49:06.427947772 +0000 +@@ -17,8 +17,8 @@ + + #ifdef HAVE_LIBJSON + +-#include <json/json.h> +-#include <json/json_object_private.h> ++#include <json.h> ++#include <json_object_private.h> + #include <string.h> + + static void geojson_lwerror(char *msg, int error_code) +@@ -551,5 +551,3 @@ + return lwgeom; + #endif /* HAVE_LIBJSON */ + } +- +- +diff -Naurw postgis-2.1.0beta3.orig/liblwgeom/Makefile.in postgis-2.1.0beta3/liblwgeom/Makefile.in +--- postgis-2.1.0beta3.orig/liblwgeom/Makefile.in 2013-05-09 19:38:17.000000000 +0000 ++++ postgis-2.1.0beta3/liblwgeom/Makefile.in 2013-06-23 22:53:56.715076184 +0000 +@@ -11,8 +11,8 @@ + # ********************************************************************** + + CC = @CC@ +-CFLAGS = @CFLAGS@ @PICFLAGS@ @WARNFLAGS@ @GEOS_CPPFLAGS@ @PROJ_CPPFLAGS@ @JSON_CPPFLAGS@ +-LDFLAGS = @LDFLAGS@ @GEOS_LDFLAGS@ -lgeos_c @PROJ_LDFLAGS@ -lproj @JSON_LDFLAGS@ ++CFLAGS = @CFLAGS@ @PICFLAGS@ @WARNFLAGS@ @GEOS_CPPFLAGS@ @PROJ_CPPFLAGS@ @JSON_CFLAGS@ ++LDFLAGS = @LDFLAGS@ @GEOS_LDFLAGS@ -lgeos_c @PROJ_LDFLAGS@ -lproj @JSON_LIBS@ + NUMERICFLAGS = @NUMERICFLAGS@ + top_builddir = @top_builddir@ + prefix = @prefix@ diff --git a/dev-db/postgis/postgis-2.1.0_beta3.ebuild b/dev-db/postgis/postgis-2.1.0_beta3.ebuild new file mode 100644 index 000000000000..0af2f9a80fdf --- /dev/null +++ b/dev-db/postgis/postgis-2.1.0_beta3.ebuild @@ -0,0 +1,312 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgis/postgis-2.1.0_beta3.ebuild,v 1.1 2013/06/26 10:59:19 titanofold Exp $ + +EAPI="4" + +PG_SLOT_MIN="9.0" + +inherit autotools eutils versionator + +MY_PV=$(replace_version_separator 3 '') +MY_P="${PN}-${MY_PV}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Geographic Objects for PostgreSQL" +HOMEPAGE="http://postgis.net" +SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" +IUSE="doc gtk static-libs" + +RDEPEND=" + || ( + dev-db/postgresql-server:9.3 + dev-db/postgresql-server:9.2 + dev-db/postgresql-server:9.1 + dev-db/postgresql-server:9.0 + ) + dev-libs/json-c + dev-libs/libxml2:2 + >=sci-libs/geos-3.3.8 + >=sci-libs/proj-4.6.0 + >=sci-libs/gdal-1.10.0 + gtk? ( x11-libs/gtk+:2 ) +" + +DEPEND="${RDEPEND} + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + dev-libs/libxslt + || ( + media-gfx/imagemagick[png] + media-gfx/graphicsmagick[imagemagick,png] + ) + ) + virtual/pkgconfig +" + +PGIS="$(get_version_component_range 1-2)" + +RESTRICT="test" + +# These modules are built using the same *FLAGS that were used to build +# dev-db/postgresql. The right thing to do is to ignore the current +# *FLAGS settings. +QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" + +# Because developers have been fooled into thinking recursive make is a +# good thing. +MAKEOPTS="-j1" + +postgres_check_slot() { + local pg_slot="$(postgresql-config show) 2> /dev/null" + + # If app-admin/eselect-postgresql is not installed, or the slot + # hasn't been set before pkg_pretend is called, skip the rest of + # this function. + if [[ -z ${pg_slot} || "${pg_slot}" = "(none)" ]] ; then + if [[ "$EBUILD_PHASE" = "pretend" ]] ; then + return 1 + else + if [[ "${pg_slot}" = "(none)" ]] ; then + die "Please set a default slot with postgresql-config" + elif [[ -z ${pg_slot} ]] ; then + die "This isn't supposed to happen." + fi + fi + fi + + if [[ -n $PG_SLOT_MIN && $PG_SLOT_MIN != -1 ]] ; then + if [[ ${pg_slot//.} < ${PG_SLOT_MIN//.} ]] ; then + eerror "You must build ${CATEGORY}/${PN} against PostgreSQL ${PG_SLOT_MIN} or higher." + eerror "Set an appropriate slot with postgresql-config." + die + fi + fi + + if [[ -n $PG_SLOT_MAX && $PG_SLOT_MAX != -1 ]] ; then + if [[ ${pg_slot//.} > ${PG_SLOT_MAX//.} ]] ; then + eerror "You must build ${CATEGORY}/${PN} against PostgreSQL ${PG_SLOT_MAX} or lower." + eerror "Set an appropriate slot with postgresql-config." + fi + fi + + if [[ -n $PG_SLOT_SOFT_MAX ]] ; then + if [[ ${pg_slot//.} > ${PG_SLOT_SOFT_MAX//.} ]] ; then + ewarn "You are building ${CATEGORY}/${PN} against a version of PostgreSQL greater than ${PG_SLOT_SOFT_MAX}." + ewarn "This is not supported here." + ewarn "Any bugs you encounter should be reported upstream." + fi + fi +} + +pkg_pretend() { + postgres_check_slot +} +pkg_setup() { + postgres_check_slot + export PGSLOT="$(postgresql-config show)" +} + +src_prepare() { + epatch "${FILESDIR}/${PN}-2.0-ldflags.patch" \ + "${FILESDIR}/${PN}-2.0-arflags.patch" \ + "${FILESDIR}/${PN}-2.1-pkgconfig-json.patch" + + local AT_M4DIR="macros" + eautoreconf +} + +src_configure() { + local myargs="" + use gtk && myargs+=" --with-gui" + econf ${myargs} +} + +src_compile() { + # Occasionally, builds fail because of out of order compilation. + # Otherwise, it'd be fine. + emake + emake -C topology + + if use doc ; then + emake comments + emake cheatsheets + emake -C doc html + fi +} + +src_install() { + emake DESTDIR="${D}" install + use doc && emake DESTDIR="${D}" comments-install + emake -C topology DESTDIR="${D}" install + dobin ./utils/postgis_restore.pl + + dodoc CREDITS TODO loader/README.* doc/*txt + + use doc && dohtml -r doc/html/* + + docinto topology + dodoc topology/{TODO,README} + + insinto /etc + doins "${FILESDIR}/postgis_dbs" +} + +pkg_postinst() { + postgresql-config update + + elog "To finish installing or updating PostGIS edit:" + elog " ${EROOT%/}/etc/postgis_dbs" + elog + elog "Then, run:" + elog " emerge --config =${CATEGORY}/${PF}" +} + +pkg_config(){ + source "${EROOT%/}/etc/conf.d/postgresql-${PGSLOT}" + source "${EROOT%/}/etc/postgis_dbs" + local postgis_path="${EROOT%/}/usr/share/postgresql-${PGSLOT}/contrib/postgis-${PGIS}" + + if [[ -n ${configured} ]] ; then + einfon "Password for PostgreSQL user '${pguser}': " + read -s PGPASSWORD + export PGPASSWORD + echo + else + eerror "You must edit:" + eerror " ${EROOT%/}/etc/postgis_dbs" + eerror "Before running 'emerge --config =${CATEGORY}/${PF}'" + eerror + die "Edit postgis_dbs" + fi + + # The server we work with must be the same slot we built against. + local server_version + server_version=$(psql -U ${pguser} -d postgres -p ${PGPORT} \ + -Aqwtc 'SELECT version()' 2> /dev/null) + if [[ $? = 0 ]] ; then + server_version=$(echo ${server_version} | cut -d " " -f 2 | \ + cut -d "." -f -2 | tr -d .) + if [[ $server_version != ${PGSLOT//.} ]] ; then + unset PGPASSWORD + eerror "Server version must be ${PGSLOT}.x" + die "Server version isn't ${PGSLOT}.x" + fi + else + unset PGPASSWORD + eerror "Is the server running?" + die "Couldn't connect to server." + fi + + local retval + safe_exit() { + unset PGPASSWORD + sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" + eend $retval + eerror "All actions could not be performed." + eerror "Read above to see what failed." + eerror "Once you fix the issue, you'll need to edit:" + eerror " ${EROOT%/}/etc/postgis_dbs" + eerror "As some things may have succeeded." + eerror + die "All actions could not be performed" + } + + local db + for db in ${databases[@]} ; do + ebegin "Performing CREATE LANGUAGE on ${db}" + createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} + retval=$? + # In this case, only error code 1 is fatal + [[ $retval == 1 ]] && safe_exit || eend 0 + + ebegin "Enabling PostGIS on ${db}" + psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ + -f "${postgis_path}/postgis.sql" + retval=$? + [[ $retval == 0 ]] && eend 0 || safe_exit + done + + for db in ${templates[@]} ; do + ebegin "Creating template database '${db}'" + createdb -p ${PGPORT} -U ${pguser} -O ${pguser} -T ${from_template} \ + ${db} "PostGIS Template" + retval=$? + [[ $retval != 0 ]] && safe_exit + + psql -q -U ${pguser} -p ${PGPORT} -c \ + "UPDATE pg_database \ + SET datistemplate = TRUE, datallowconn = TRUE \ + WHERE datname = '${db}'" + retval=$? + [[ $retval != 0 ]] && safe_exit + + createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} + retval=$? + # In this case, only error code 1 is fatal + [[ $retval == 1 ]] && safe_exit + + psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ + -f "${postgis_path}/postgis.sql" + retval=$? + [[ $retval == 0 ]] && eend 0 || safe_exit + done + + for db in ${epsg_databases[@]} ; do + ebegin "Adding EPSG to ${db}" + psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ + -f "${postgis_path}/spatial_ref_sys.sql" + retval=$? + [[ $retval == 0 ]] && eend 0 || safe_exit + done + + for db in ${comment_databases[@]} ; do + ebegin "Adding comments on ${db}" + local comment_file + for comment_file in "${postgis_path}"/*_comments.sql ; do + psql -q -U ${pguser} -p ${PGPORT} -d ${db} -f "${comment_file}" + retval=$? + [[ $retval == 0 ]] && continue || safe_exit + done + eend 0 + done + + for db in ${upgrade_from_1_3[@]} ; do + ebegin "Upgrading from PostGIS 1.3 to ${PGIS} on ${db}" + psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ + -f "${postgis_path}/postgis_upgrade_13_to_${PGIS//.}.sql" + retval=$? + [[ $retval == 0 ]] && eend 0 || safe_exit + done + + for db in ${upgrade_from_1_4[@]} ; do + ebegin "Upgrading from PostGIS 1.4 to ${PGIS} on ${db}" + psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ + -f "${postgis_path}/postgis_upgrade_14_to_${PGIS//.}.sql" + retval=$? + [[ $retval == 0 ]] && eend 0 || safe_exit + done + + for db in ${upgrade_from_1_5[@]} ; do + ebegin "Minor upgrade for PostGIS ${PGIS} on ${db}" + psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ + -f "${postgis_path}/postgis_upgrade_${PGIS//.}_minor.sql" + retval=$? + [[ $retval == 0 ]] && eend 0 || safe_exit + done + + # Clean up and make it so the user has to edit postgis_dbs again that + # way this script won't step on any toes due to user error. + unset PGPASSWORD + sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" + einfo "PostgreSQL ${PGSLOT} is now PostGIS enabled." + einfo + einfo "To enable other databases, change the default slot:" + einfo " postgresql-config set <slot>" + einfo "Then, emerge this package again:" + einfo " emerge -av =${CATEGORY}/${PF}" +} |