Index: Mk/Uses/postgis.mk =================================================================== --- Mk/Uses/postgis.mk (nonexistent) +++ Mk/Uses/postgis.mk (working copy) @@ -0,0 +1,144 @@ +# $FreeBSD$ +# +# Provide support for Postgis +# +# Feature: postgis +# Usage: USES= postgis[:version] +# +# Maintainer can set version required. Minimum and maximum +# versions can be specified; e.g. 2.1-, 2.2+ +# +# If no version is given (by the maintainer via the port or +# by the user via defined variable), try to find the +# currently installed version. Fall back to default if +# necessary. +# +# MAINTAINER: pgsql@FreeBSD.org + +.if !defined(_INCLUDE_USES_POSTGIS_MK) + +_INCLUDE_USES_POSTGIS_MK= yes + +# Variables set by postgis.mk: +# +# POSTGIS_VER +# Detected PostgreSQL version. Do *not* use this +# to add dependencies; use WANT_POSTGIS as explained above +# + +# When adding a version, please keep the comment in +# Mk/bsd.default-versions.mk in sync. +VALID_POSTGIS_VER= 2.0 2.1 2.2 + +# Versions of PostgreSQL supported by which versions of PostGIS +# https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS +VALID_PGSQL_VER_GIS20= 9.1 9.2 +VALID_PGSQL_VER_GIS21= 9.1 9.2 9.3 9.4 +VALID_PGSQL_VER_GIS22= 9.1 9.2 9.3 9.4 9.5 + +PREFERED_PGSQL_VER_GIS20= 9.2 +PREFERED_PGSQL_VER_GIS21= 9.3 # Use default PGSQL +PREFERED_PGSQL_VER_GIS22= 9.3 # Use default PGSQL + +# Override non-default LIBVERS like this: +#POSTGIS2_LIBVER=2 + +POSTGIS_LIBVER= 2 +.for v in ${VALID_POSTGIS_VER:S,.,,} +POSTGIS$v_LIBVER?= ${POSTGIS_LIBVER} +.endfor + +.include "${PORTSDIR}/Mk/Uses/pgsql.mk" +.include "${PORTSDIR}/Mk/bsd.default-versions.mk" + +.for v in ${POSTGIS_DEFAULT} +. if ! ${VALID_POSTGIS_VER:M$v} +IGNORE= Invalid POSTGIS default version ${POSTGIS_DEFAULT}; valid versions are ${VALID_POSTGIS_VER} +. endif +.endfor + +. for w in WITH DEFAULT +. ifdef $w_POSTGIS_VER +WARNING+= "$w_POSTGIS_VER is defined, consider using DEFAULT_VERSIONS=postgis=${$w_POSTGIS_VER:C,^.,&.,} instead" +POSTGIS_DEFAULT?= ${$w_POSTGIS_VER:C,^.,&.,} +. endif +. endfor + +. ifdef DEFAULT_POSTGIS_VER && WITH_POSTGIS_VER +IGNORE= will not allow setting both DEFAULT_POSTGIS_VER and WITH_POSTGIS_VER. Use DEFAULT_VERSIONS=postgis=2.2 instead +. endif + +# Handle the + and - version stuff +. if !empty(postgis_ARGS) +. if ${postgis_ARGS:M*+} +. for version in ${VALID_POSTGIS_VER} +. if ${postgis_ARGS:S/+//} <= ${version} +_WANT_POSTGIS_VER+=${version} +. endif +. endfor +. elif ${postgis_ARGS:M*-} +. for version in ${VALID_POSTGIS_VER} +. if ${postgis_ARGS:S/-//} >= ${version} +_WANT_POSTGIS_VER+=${version} +. endif +. endfor +. endif +_WANT_POSTGIS_VER?= ${postgis_ARGS} +. endif + +# For simplify next iterations +.if empty(_WANT_POSTGIS_VER) +_WANT_POSTGIS_VER= ${POSTGIS_DEFAULT} +.endif + +# Finding a present version of PostGIS +.for v in ${VALID_POSTGIS_VER} +_POSTGIS_LIB=${LOCALBASE}/lib/postgresql/postgis-$v.so +. if exists(${_POSTGIS_LIB}) +_POSTGIS_VER= $v +. endif +.endfor + +.if !empty(_POSTGIS_VER) +WARNING+= "PostGis ${_POSTGIS_VER} Found" + +# Verify that wanted or default postgis version(s) is/are compatible with postgis version installed +_COMPAT?= ${_WANT_POSTGIS_VER:M${_POSTGIS_VER}} + +WARNING+= ${_COMPAT} + +. if empty(_COMPAT) +IGNORE+= "the port wants PostGIS version ${_WANT_POSTGIS_VER} and you have version ${_POSTGIS_VER} installed" +. else +POSTGIS_VER= ${_POSTGIS_VER} +. endif +.else +.if empty(PGSQL_VER) # PostgreSQL not installed +. for v in ${_WANT_POSTGIS_VER} +last_want_ver= $v +. if ${POSTGIS_DEFAULT} == $v # Nice +POSTGIS_VER=$v +. endif +. endfor +. if empty(POSTGIS_VER) +POSTGIS_VER=${last_want_ver} +USES+= pgsql:${PREFERED_PGSQL_VER_GIS${POSTGIS_VER}} +. endif +. else # Check Compatibilty between PostGis and PostgreSQL +. for pgis_want in ${_WANT_POSTGIS_VER} +. for psql_v_ver in ${VALID_PGSQL_VER_GIS${pgis_want:S,.,,}} +. if ${psql_v_ver} == ${PGSQL_VER} +POSTGIS_VER= ${pgis_want} +. endif +. endfor +. endfor +. if empty(POSTGIS_VER) +IGNORE= "Can't find a compatible version for PostGis ${_WANT_POSTGIS_VER} with PostgreSQL ${PGSQL_VER}" +. endif +. endif +.endif + +RUN_DEPENDS+= ${LOCALBASE}/lib/postgresql/postgis-${POSTGIS_VER}.so:databases/postgis${POSTGIS_VER:S,.,,} +WARNING+= "Use PostGIS ${POSTGIS_VER} for PostgreSQL ${PGSQL_VER}" + +.endif # !defined(_INCLUDE_USES_POSTGIS_MK) Property changes on: Mk/Uses/postgis.mk ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: Mk/bsd.default-versions.mk =================================================================== --- Mk/bsd.default-versions.mk (revision 421383) +++ Mk/bsd.default-versions.mk (working copy) @@ -55,6 +55,8 @@ PGSQL_DEFAULT?= 9.3 # Possible values: 5.5, 5.6, 7.0 PHP_DEFAULT?= 5.6 +# PostGis default must be compatible with PGSQL_DEFAULT +POSTGIS_DEFAULT?= 2.2 # Possible values: 2.7, 3.3, 3.4, 3.5 PYTHON_DEFAULT?= 2.7 # Possible values: 2.7 Index: databases/pgrouting/Makefile =================================================================== --- databases/pgrouting/Makefile (revision 421383) +++ databases/pgrouting/Makefile (working copy) @@ -1,4 +1,4 @@ -# Created by: lbartoletti +# Created by: lbartoletti # $FreeBSD$ PORTNAME= pgrouting @@ -14,9 +14,8 @@ LIB_DEPENDS= libboost_system.so:devel/boost-libs\ libCGAL.so:math/cgal \ libgmp.so:math/gmp -RUN_DEPENDS= ${LOCALBASE}/share/postgresql/contrib/postgis-2.1/postgis.sql:databases/postgis21 -USES= compiler:c++11-lib cmake localbase pgsql:9.1+ pkgconfig +USES= compiler:c++11-lib cmake localbase pgsql:9.1+ pkgconfig postgis:2.1+ USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= pgRouting Index: databases/postgis20/Makefile =================================================================== --- databases/postgis20/Makefile (revision 421383) +++ databases/postgis20/Makefile (working copy) @@ -17,7 +17,7 @@ libjson-c.so:devel/json-c \ libproj.so:graphics/proj -CONFLICTS_INSTALL= postgis-2.1.* postgis22-* +CONFLICTS_INSTALL= postgis21-* postgis22-* OPTIONS_DEFINE= LOADERGUI NLS RASTER TOPOLOGY OPTIONS_DEFAULT=TOPOLOGY @@ -36,7 +36,7 @@ USE_GNOME= libxml2 USE_LDCONFIG= yes USE_PERL5= build -USES= gmake iconv:wchar_t libtool perl5 pgsql pkgconfig shebangfix +USES= gmake iconv:wchar_t libtool perl5 pgsql:9.2- pkgconfig shebangfix WANT_PGSQL= server PLIST_SUB= PORTVERSION=${PORTVERSION} Index: databases/postgis21/Makefile =================================================================== --- databases/postgis21/Makefile (revision 421383) +++ databases/postgis21/Makefile (working copy) @@ -5,6 +5,7 @@ PORTREVISION= 2 CATEGORIES= databases geography MASTER_SITES= http://download.osgeo.org/postgis/source/ +PKGNAMESUFFIX= 21 MAINTAINER= harrison.grundy@astrodoggroup.com COMMENT= Geographic objects support for PostgreSQL databases @@ -17,11 +18,11 @@ libjson-c.so:devel/json-c RUN_DEPENDS= postmaster:databases/postgresql${PGSQL_VER_NODOT}-server -CONFLICTS= postgis20-2.0.* postgis22-* +CONFLICTS= postgis20-* postgis22-* GNU_CONFIGURE= yes CONFIGURE_ARGS= ${ICONV_CONFIGURE_BASE} -USES= gmake iconv:wchar_t libtool:keepla perl5 pgsql pkgconfig shebangfix +USES= gmake iconv:wchar_t libtool:keepla perl5 pgsql:9.1+ pgsql:9.4- pkgconfig shebangfix SHEBANG_FILES= utils/postgis_restore.pl.in USE_GNOME= libxml2 USE_LDCONFIG= yes Index: databases/postgis22/Makefile =================================================================== --- databases/postgis22/Makefile (revision 421383) +++ databases/postgis22/Makefile (working copy) @@ -17,7 +17,7 @@ libjson-c.so:devel/json-c RUN_DEPENDS= postmaster:databases/postgresql${PGSQL_VER_NODOT}-server -CONFLICTS= postgis20-2.0.* postgis-2.1.* +CONFLICTS= postgis20-* postgis21-* USES= gettext gmake iconv:wchar_t libtool:keepla perl5 pgsql pkgconfig shebangfix GNU_CONFIGURE= yes Index: graphics/qgis/Makefile =================================================================== --- graphics/qgis/Makefile (revision 421383) +++ graphics/qgis/Makefile (working copy) @@ -68,8 +68,7 @@ GRASS_CMAKE_OFF= -DWITH_GRASS:BOOL=FALSE GRASS_FORCE_MAKE_JOBS= NO -POSTGIS_USES= pgsql -POSTGIS_LIB_DEPENDS= liblwgeom.so:databases/postgis21 +POSTGIS_USES= pgsql postgis POSTGIS_CMAKE_ON= -DWITH_POSTGRESQL:BOOL=TRUE POSTGIS_CMAKE_OFF= -DWITH_POSTGRESQL:BOOL=FALSE