databases/postgis21: Upgrade version 2.1.0 => 2.1.3

This unbreaks the port after the json-c dependency update.
While here, using modern options framework

PR:		192840
Submitted by;	Luca Corti
Patch by:	Muhammad Rahman
This commit is contained in:
John Marino 2014-08-20 06:23:20 +00:00
parent efc161dffd
commit 0cc734c4ab
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=365432
4 changed files with 41 additions and 37 deletions

View file

@ -1,8 +1,7 @@
# $FreeBSD$
PORTNAME= postgis
PORTVERSION= 2.1.0
PORTREVISION= 6
PORTVERSION= 2.1.3
CATEGORIES= databases geography
MASTER_SITES= http://download.osgeo.org/postgis/source/
@ -13,7 +12,7 @@ LICENSE= GPLv2
LIB_DEPENDS= libproj.so:${PORTSDIR}/graphics/proj \
libgeos.so:${PORTSDIR}/graphics/geos \
libjson.so:${PORTSDIR}/devel/json-c
libjson-c.so:${PORTSDIR}/devel/json-c
RUN_DEPENDS= postmaster:${PORTSDIR}/databases/postgresql${PGSQL_VER_NODOT}-server
CONFLICTS= postgis-1.* postgis-2.0.*
@ -27,6 +26,7 @@ USE_PERL5= build
OPTIONS_DEFINE= LOADERGUI RASTER TOPOLOGY SFCGAL
OPTIONS_DEFAULT= TOPOLOGY
OPTIONS_SUB= yes
PLIST_SUB+= PORTVERSION=${PORTVERSION}
@ -34,45 +34,22 @@ LOADERGUI_DESC= Enable shp2pgsql-gui
RASTER_DESC= Raster support
TOPOLOGY_DESC= Topology support
SFCGAL_DESC= Enable sfcgal
LOADERGUI_CONFIGURE_WITH= gui
LOADERGUI_USE= GNOME=gtk20
RASTER_CONFIGURE_WITH= raster
RASTER_LIB_DEPENDS= libgdal.so:${PORTSDIR}/graphics/gdal
RASTER_CONFIGURE_ON= --with-gdalconfig=${LOCALBASE}/bin/gdal-config
TOPOLOGY_CONFIGURE_WITH= topology
SFCGAL_LIB_DEPENDS= libSFCGAL.so:${PORTSDIR}/databases/sfcgal
SFCGAL_CONFIGURE_ON= --with-sfcgal=${LOCALBASE}/bin/sfcgal-config
SFCGAL_CONFIGURE_OFF= --without-sfcgal
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MLOADERGUI}
USE_GNOME+= gtk20
CONFIGURE_ARGS+= --with-gui
PLIST_SUB+= LOADERGUI=""
.else
CONFIGURE_ARGS+= --without-gui
PLIST_SUB+= LOADERGUI="@comment "
.endif
.if ${PORT_OPTIONS:MRASTER}
.if ${OSVERSION} < 900033
BROKEN= Raster suppport is broken on FreeBSD < 9.x
.endif
LIB_DEPENDS+= libgdal.so:${PORTSDIR}/graphics/gdal
CONFIGURE_ARGS+= --with-raster --with-gdalconfig=${LOCALBASE}/bin/gdal-config
PLIST_SUB+= RASTER=""
.else
CONFIGURE_ARGS+= --without-raster
PLIST_SUB+= RASTER="@comment "
.endif
.if ${PORT_OPTIONS:MTOPOLOGY}
CONFIGURE_ARGS+= --with-topology
PLIST_SUB+= TOPOLOGY=""
.else
CONFIGURE_ARGS+= --without-topology
PLIST_SUB+= TOPOLOGY="@comment "
.endif
.if ${PORT_OPTIONS:MSFCGAL}
LIB_DEPENDS+= libSFCGAL.so:${PORTSDIR}/databases/sfcgal
CONFIGURE_ARGS+= --with-sfcgal=${LOCALBASE}/bin/sfcgal-config
PLIST_SUB+= SFCGAL=""
.else
CONFIGURE_ARGS+= --without-sfcgal
PLIST_SUB+= SFCGAL="@comment "
.endif
CFLAGS+= -I${LOCALBASE}/include
@ -89,5 +66,9 @@ post-install: .SILENT
(cd ${WRKSRC}/extras/tiger_geocoder/tiger_2011/ && ${COPYTREE_SHARE} \* ${STAGEDIR}/${DATADIR}/tiger_2011/ "! ( -name *\.orig -o -name *\.bak )" )
${MKDIR} ${STAGEDIR}/${DATADIR}/utils
(cd ${WRKSRC}/utils/ && ${COPYTREE_SHARE} \* ${STAGEDIR}/${DATADIR}/utils/ "! ( -name *\.orig -o -name *\.bak )" )
${STRIP_CMD} ${STAGEDIR}/${PREFIX}/bin/shp2pgsql
${STRIP_CMD} ${STAGEDIR}/${PREFIX}/bin/pgsql2shp
${STRIP_CMD} ${STAGEDIR}/${PREFIX}/lib/liblwgeom-2.1.3.so
${STRIP_CMD} ${STAGEDIR}/${PREFIX}/lib/postgresql/postgis-2.1.so
.include <bsd.port.mk>

View file

@ -1,2 +1,2 @@
SHA256 (postgis-2.1.0.tar.gz) = fc00481aec904661f3eb11da4305b1666f2040c28b0651de7eac6c22f217b26c
SIZE (postgis-2.1.0.tar.gz) = 6518378
SHA256 (postgis-2.1.3.tar.gz) = c17812aa4bb86ed561dfc65cb42ab45176b94e0620de183a4bbd773d6d876ec1
SIZE (postgis-2.1.3.tar.gz) = 6881881

View file

@ -0,0 +1,22 @@
--- liblwgeom/lwin_geojson.c.orig 2014-08-20 10:32:15.721407424 +0600
+++ liblwgeom/lwin_geojson.c 2014-08-20 10:32:44.823412267 +0600
@@ -17,8 +17,8 @@
#ifdef HAVE_LIBJSON
-#include <json/json.h>
-#include <json/json_object_private.h>
+#include <json-c/json.h>
+#include <json-c/json_object_private.h>
#include <string.h>
static void geojson_lwerror(char *msg, int error_code)
@@ -510,7 +510,7 @@
if( jstok->err != json_tokener_success)
{
char err[256];
- snprintf(err, 256, "%s (at offset %d)", json_tokener_errors[jstok->err], jstok->char_offset);
+ snprintf(err, 256, "%s (at offset %d)", json_tokener_error_desc(jstok->err), jstok->char_offset);
json_tokener_free(jstok);
json_object_put(poObj);
geojson_lwerror(err, 1);

View file

@ -50,6 +50,7 @@ lib/liblwgeom.so
%%DATADIR%%/tiger_2011/tables/lookup_tables_2011.sql
%%DATADIR%%/tiger_2011/tiger_loader_2011.sql
%%DATADIR%%/tiger_2011/tiger_loader_2012.sql
%%DATADIR%%/tiger_2011/tiger_loader_2013.sql
%%DATADIR%%/tiger_2011/topology/README
%%DATADIR%%/tiger_2011/topology/tiger_topology_loader.sql
%%DATADIR%%/tiger_2011/upgrade_geocode.sql