aboutsummaryrefslogtreecommitdiffstats
path: root/databases/postgis/Makefile
blob: 9fe5ffa657d5547dc5b0fb31de988321123cb013 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# New ports collection makefile for:    PostGIS
# Date created:     June 09, 2004
# Whom:         Anderson Soares Ferreira <anderson@cnpm.embrapa.br>
#
# $FreeBSD$
#

PORTNAME=   postgis
PORTVERSION=    0.9.1
PORTREVISION=   1
CATEGORIES= databases
MASTER_SITES=   http://postgis.refractions.net/
DISTNAME=   postgis-${PORTVERSION}

MAINTAINER= anderson@cnpm.embrapa.br
COMMENT=    Adds support for geographic objects to PostgreSQL databases

LIB_DEPENDS=    proj.5:${PORTSDIR}/graphics/proj

USE_GMAKE=  yes
USE_PERL5_BUILD=    yes

PKGMESSAGE= pkg-message
WRKSRC=     ${WRKDIR}/postgis-${PORTVERSION}
PGSQL_SRC=  ${WRKDIR}/pgsql/postgresql

INSTALL_TARGET= install
INSTALLS_SHLIB= no

OPTIONS=    GEOS "Include GEOS - the OpenGIS 'Simple Features for SQL'" off \

USE_PGSQL=  YES

.include <bsd.port.pre.mk>

MAKE_ARGS=  PGSQL_SRC="${PGSQL_SRC}" \
        DATADIR="${PREFIX}/share/postgis" \
        BINDIR="${PREFIX}/bin" \
        LIBDIR="${PREFIX}/lib"

PGSQL_PORTDIR=  ${PORTSDIR}/databases/postgresql${PGSQL_VER}-client

.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

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.post.mk>