Ticket #33922: Portfile.2

File Portfile.2, 4.9 KB (added by bpanulla (Brian Panulla), 12 years ago)

Updated Portfile for PostGIS 2.0.1

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 93205 2012-05-17 19:40:27Z vince@macports.org $
3
4PortSystem          1.0
5PortGroup           archcheck 1.0
6
7name                postgis2
8categories          gis
9license             GPL
10epoch               0
11version             2.0.1
12platforms           darwin
13maintainers         vince openmaintainer
14
15description         PostGIS is the spatial extension to the\
16                    PostGreSQL database.
17
18long_description    PostGIS 2 adds geometrical, geographical and topological\
19                    types, and functions operating thereon, to the PostGreSQL\
20                    database. The 2.0 release also provides raster handling\
21                    and basic 3D geometry capacities (TIN and polyhedra).
22
23homepage            http://postgis.refractions.net/
24master_sites        http://www.postgis.org/download
25distname            postgis-${version}
26worksrcdir          postgis-${version}
27checksums           md5     7af9ce5f7dfb22d81fea7f041e674497 \
28                    sha1    31db797a835f14470f9e1183fe8fd2ba7b99aadf \
29                    rmd160  2c7e27aaf0b6c071254b77b118ab6d4e9b023c1f
30
31
32depends_build       port:autoconf \
33                    port:automake \
34                    port:libtool
35
36depends_lib         port:geos\
37                    port:proj\
38                    port:libiconv\
39                    port:libxml2
40
41archcheck.files     lib/libgeos_c.dylib\
42                    lib/libiconv.dylib\
43                    lib/libproj.dylib\
44                    lib/libxml2.dylib
45
46# PostGIS 2.0 is not compatible with PostGIS 1.5
47
48conflicts           postgis
49
50# Neither is PostGIS 2.0 compatible with PostGreSQL 8
51
52variant postgresql90        description {Builds with postgresql 9.0} \
53                            conflicts postgresql91 {
54    depends_lib-append      port:postgresql90
55    archcheck.files-append  lib/postgresql90/libpq.dylib
56    configure.args-append   --libdir=${prefix}/lib/postgresql90\
57                            --with-pgconfig=${prefix}/lib/postgresql90/bin/pg_config
58    build.args-append       PGSQL_DOCDIR=${destroot}${prefix}/share/doc/postgresql90\
59                            PGSQL_MANDIR=${destroot}${prefix}/share/man
60}
61
62variant postgresql91        description {Builds with postgresql 9.1} \
63                            conflicts postgresql90 {
64    depends_lib-append      port:postgresql91
65    archcheck.files-append  lib/postgresql91/libpq.dylib
66    configure.args-append   --libdir=${prefix}/lib/postgresql91\
67                            --with-pgconfig=${prefix}/lib/postgresql91/bin/pg_config
68    build.args-append       PGSQL_DOCDIR=${destroot}${prefix}/share/doc/postgresql91\
69                            PGSQL_MANDIR=${destroot}${prefix}/share/man
70}
71
72variant raster              description {Build raster support} {
73
74    depends_lib-append      port:gdal
75    configure.args-append   --with-raster
76}
77
78variant topology            description {Build topology support} {
79
80    configure.args-append   --with-topology
81}
82
83variant gui                 description {Build the GUI import tool} {
84
85    depends_lib-append      port:gtk2
86    configure.args-append   --with-gui
87}
88
89variant comments            description {Build comments -- ! broken } {
90
91    ui_warn "The comments variant is currently broken. Use at your own risk."
92   
93    depends_build-append    port:docbook-xsl \
94                            port:libxslt \
95                            port:ImageMagick
96   
97    configure.args-append   --datadir=${prefix}/share/${name} \
98                            --with-projdir=${prefix} \
99                            --with-xsldir=${prefix}/share/xsl/docbook-xsl
100
101    build.target-append     comments
102    destroot.target-append  docs-install comments-install
103}
104
105default_variants            +raster +topology
106
107if {![variant_isset postgresql90] && ![variant_isset postgresql91]} {
108    default_variants        +postgresql91
109}
110
111# Port phases
112
113pre-configure {
114    if {[variant_isset postgresql90]} {
115        set PGVERSION   postgresql90
116    } elseif {[variant_isset postgresql91]} {
117        set PGVERSION   postgresql91
118    }
119   
120    system -W ${worksrcpath} "./autogen.sh"
121}
122
123configure.cflags-append \
124    -Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close \
125    -I${prefix}/include
126
127post-configure {
128    if {[variant_isset universal]} {
129        # We must add universal flags to compile liblwgeom properly
130        file copy ${filespath}/ed_command ${worksrcpath}/ed_command
131        reinplace -E "s#XXX#${configure.universal_cflags}#" \
132                    ${worksrcpath}/ed_command
133        system -W ${worksrcpath}/liblwgeom \
134                "ed Makefile < ${worksrcpath}/ed_command"
135    }
136}
137
138build.args                  ICONV_LDFLAGS='-L${prefix}/lib -liconv'
139use_parallel_build                      no
140
141
142livecheck.type              regex
143livecheck.url               ${master_sites}
144livecheck.regex             ${name}-(\\d+(?:\\.\\d+)*)\\.tar