Update editors/lazarus-lcl-units to version 1.8.0
[dports.git] / databases / postgis23 / Makefile
1 # Created by: Loïc BARTOLETTI <lbartoletti@tuxfamily.org>
2 # $FreeBSD$
3
4 PORTNAME=       postgis
5 PORTVERSION=    2.3.6
6 CATEGORIES=     databases geography
7 MASTER_SITES=   http://download.osgeo.org/postgis/source/
8 PKGNAMESUFFIX=  23
9
10 MAINTAINER=     lbartoletti@tuxfamily.org
11 COMMENT=        Geographic objects support for PostgreSQL databases
12
13 LICENSE=        GPLv2
14 LICENSE_FILE=   ${WRKSRC}/COPYING
15
16 LIB_DEPENDS=    libproj.so:graphics/proj \
17                 libgeos.so:graphics/geos \
18                 libjson-c.so:devel/json-c
19
20 CONFLICTS=      postgis20  postgis21 postgis22 postgis24 postgis
21
22 USES=           gettext gmake iconv:wchar_t libtool:keepla perl5 pgsql pkgconfig shebangfix
23 GNU_CONFIGURE=  yes
24 CONFIGURE_ARGS= ${ICONV_CONFIGURE_BASE}
25 SHEBANG_FILES=  extensions/address_standardizer/*.pl raster/test/regress/*.pl \
26                 raster/test/regress/loader/*.pl regress/run_test.pl \
27                 utils/postgis_restore.pl.in utils/*.pl
28 USE_GNOME=      libxml2
29 USE_LDCONFIG=   yes
30 USE_PERL5=      build
31 WANT_PGSQL=     lib server
32
33 OPTIONS_DEFINE=         LOADERGUI RASTER TOPOLOGY SFCGAL ADDRSTD
34 OPTIONS_DEFAULT=        TOPOLOGY ADDRSTD SFCGAL
35 NO_OPTIONS_SORT=        yes
36 OPTIONS_SUB=            yes
37
38 PLIST_SUB+=     PORTVERSION=${PORTVERSION}
39
40 LOADERGUI_DESC= Enable shp2pgsql-gui
41 RASTER_DESC=    Raster support
42 TOPOLOGY_DESC=  Topology support
43 SFCGAL_DESC=    Enable sfcgal
44 ADDRSTD_DESC=   Enable address standardizer
45
46 LOADERGUI_CONFIGURE_WITH=       gui
47 LOADERGUI_USE=  GNOME=gtk20
48 RASTER_USES=    alias
49 RASTER_CONFIGURE_WITH=  raster
50 RASTER_LIB_DEPENDS=             libgdal.so:graphics/gdal
51 RASTER_CONFIGURE_ON=    --with-gdalconfig=${LOCALBASE}/bin/gdal-config
52 TOPOLOGY_CONFIGURE_WITH=        topology
53 SFCGAL_LIB_DEPENDS=     libSFCGAL.so:databases/sfcgal
54 SFCGAL_CONFIGURE_ON=    --with-sfcgal=${LOCALBASE}/bin/sfcgal-config
55 SFCGAL_CONFIGURE_OFF=   --without-sfcgal
56 SFCGAL_IMPLIES=         RASTER
57 ADDRSTD_CONFIGURE_WITH= address-standardizer
58 ADDRSTD_IMPLIES=        RASTER
59 ADDRSTD_LIB_DEPENDS=    libpcre.so:devel/pcre
60 ADDRSTD_VARS=           WANT_PGSQL+=contrib
61
62 CFLAGS+=        -I${LOCALBASE}/include
63 LDFLAGS+=       -L${LOCALBASE}/lib
64
65 .include <bsd.port.pre.mk>
66
67 post-patch:
68         @${GREP} -lR 'bin/bash' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e "s|/bin/bash|/bin/sh|"
69         @${GREP} -lR '/usr/bin/psql' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \
70                 -e "s|/usr/bin/psql|${LOCALBASE}/bin/pgsql|"
71         @${GREP} -lR '/usr/lib/postgresql/9.4/bin/psql' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \
72                 -e "s|/usr/lib/postgresql/9.4/bin/psql|${LOCALBASE}/bin/pgsql|"
73         @${GREP} -lR '/usr/share/postgresql/contrib' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \
74                 -e "s|/usr/share/postgresql/contrib|${LOCALBASE}/share/postgresql/contrib|"
75         @${GREP} -lR '/usr/share/postgresql/9.4/contrib' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \
76                 -e "s|/usr/share/postgresql/9.4/contrib|${LOCALBASE}/share/postgresql/contrib/postgis-2.3|"
77
78 pre-configure:
79         @${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
80
81 post-install:
82         ${MKDIR} ${STAGEDIR}${DATADIR}/tiger_geocoder
83         (cd ${WRKSRC}/extras/tiger_geocoder && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/tiger_geocoder/ "! ( -name *\.orig -o -name *\.bak )" )
84         ${MKDIR} ${STAGEDIR}${DATADIR}/utils
85         (cd ${WRKSRC}/utils/ && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/utils/ "! ( -name *\.orig -o -name *\.bak -o -name Makefile -o -name *\.in -o -name uninstall_script )" )
86         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/shp2pgsql
87         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pgsql2shp
88 .if ${PORT_OPTIONS:MLOADERGUI}
89         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/shp2pgsql-gui
90 .else
91         ${RM} ${STAGEDIR}${PREFIX}/bin/shp2pgsql-gui
92 .endif
93         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblwgeom-2.3.so.0.0.0
94         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/postgresql/postgis-2.3.so
95 .if ${PORT_OPTIONS:MTOPOLOGY}
96         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/postgresql/postgis_topology-2.3.so
97 .endif
98 .if ${PORT_OPTIONS:MRASTER}
99         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/raster2pgsql
100         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/postgresql/rtpostgis-2.3.so
101 .endif
102 .if ${PORT_OPTIONS:MADDRSTD}
103         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/postgresql/address_standardizer-2.3.so
104 .endif
105
106 .include <bsd.port.post.mk>