aboutsummaryrefslogtreecommitdiffstats
path: root/databases/postgis/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'databases/postgis/Makefile')
-rw-r--r--databases/postgis/Makefile71
1 files changed, 55 insertions, 16 deletions
diff --git a/databases/postgis/Makefile b/databases/postgis/Makefile
index 3b51b28f0fe9..1293fcd0f10e 100644
--- a/databases/postgis/Makefile
+++ b/databases/postgis/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= postgis
-PORTVERSION= 0.9.0
+PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://postgis.refractions.net/
@@ -15,30 +15,69 @@ DISTNAME= postgis-${PORTVERSION}
MAINTAINER= anderson@cnpm.embrapa.br
COMMENT= Adds support for geographic objects to PostgreSQL databases
-BUILD_DEPENDS= ${PGSQL_SRC}/src/Makefile.global:${PORTSDIR}/databases/postgresql7:configure
-LIB_DEPENDS= proj.5:${PORTSDIR}/graphics/proj \
- pq:${PORTSDIR}/databases/postgresql7
+LIB_DEPENDS= proj.5:${PORTSDIR}/graphics/proj
USE_GMAKE= yes
USE_PERL5_BUILD= yes
-MAKE_ARGS= PGSQL_SRC=${PGSQL_SRC}
-OPTIONS= GEOS "Include GEOS - the OpenGIS 'Simple Features for SQL'" off
-
-PGSQL_PORTDIR= ${WRKDIR}/../../../databases/postgresql7
+PKGMESSAGE= pkg-message
WRKSRC= ${WRKDIR}/postgis-${PORTVERSION}
-PGSQL_SRC= ${PGSQL_PORTDIR}/work/postgresql-7.4.6
+PGSQL_SRC= ${WRKDIR}/pgsql/postgresql
+
INSTALL_TARGET= install
+INSTALLS_SHLIB= no
+
+OPTIONS= PGSQL8 "Use PostgreSQL 8 instead of PostgreSQL 7.4" off \
+ GEOS "Include GEOS - the OpenGIS 'Simple Features for SQL'" off \
+
+.include <bsd.port.pre.mk>
+
+MAKE_ARGS= PGSQL_SRC="${PGSQL_SRC}" \
+ DATADIR="${PREFIX}/share/postgis" \
+ BINDIR="${PREFIX}/bin" \
+ LIBDIR="${PREFIX}/lib"
+
+.if defined(WITH_PGSQL8)
+PGSQL_PORTDIR= ${PORTSDIR}/databases/postgresql-devel
+.else
+PGSQL_PORTDIR= ${PORTSDIR}/databases/postgresql7
+.endif
+
+LIB_DEPENDS+= pq.3:${PGSQL_PORTDIR}
+
+.if !defined(NOPORTDOCS)
+BUILD_DEPENDS+= xsltproc:${PORTSDIR}/textproc/libxslt \
+ ${LOCALBASE}/share/xsl/docbook/html/chunk.xsl:${PORTSDIR}/textproc/docbook-xsl
+MAKE_ARGS+= WITH-DOC=yes \
+ DOCSDIR="${DOCSDIR}"
+PORTDOCS= *
+.endif
.if defined(WITH_GEOS)
LIB_DEPENDS+= geos.2:${PORTSDIR}/graphics/geos
+MAKE_ARGS+= USE_GEOS=1
+.else
+MAKE_ARGS+= USE_GEOS=0
.endif
-post-extract:
-.if ! defined(WITH_GEOS)
- @ ${CP} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.orig ; \
- ${CAT} ${WRKSRC}/Makefile.orig | \
- ${SED} "s|USE_GEOS=1|USE_GEOS=0|g" > ${WRKSRC}/Makefile
-.endif
+pre-everything::
+ @${SH} ${PKGINSTALL} ${PORTNAME} MESSAGE
+
+pre-configure:
+ @([ -d ${WRKDIR}/pgsql ] || ${MKDIR} ${WRKDIR}/pgsql) && \
+ cd ${PGSQL_PORTDIR} && \
+ ${MAKE} WRKDIR=${WRKDIR}/pgsql configure && \
+ ${MV} ${WRKDIR}/pgsql/postgresql* ${PGSQL_SRC} \
+
+post-install:
+ @ ${INSTALL_SCRIPT} ${FILESDIR}/updatedb.default ${PREFIX}/share/postgis
+ @ ${INSTALL_SCRIPT} ${FILESDIR}/UPDATE ${PREFIX}/share/postgis
+ @ ${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
+ @ ${CAT} ${PKGMESSAGE}
+
+post-deinstall:
+ @ ${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>