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 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup archcheck 1.0 |
---|
6 | |
---|
7 | name postgis2 |
---|
8 | categories gis |
---|
9 | license GPL |
---|
10 | epoch 0 |
---|
11 | version 2.0.0 |
---|
12 | platforms darwin |
---|
13 | maintainers vince openmaintainer |
---|
14 | |
---|
15 | description PostGIS is the spatial extension to the\ |
---|
16 | PostGreSQL database. |
---|
17 | |
---|
18 | long_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 | |
---|
23 | homepage http://postgis.refractions.net/ |
---|
24 | master_sites http://www.postgis.org/download |
---|
25 | distname postgis-${version} |
---|
26 | worksrcdir postgis-${version} |
---|
27 | checksums md5 639d2b5d6a7dc94ea2e60d6942a615bc \ |
---|
28 | sha1 ff8c8ee9f35120a0312016297055bbfde1f45069 \ |
---|
29 | rmd160 7100818bcf4f230d4367777b236a2c0c511b69f7 |
---|
30 | |
---|
31 | |
---|
32 | depends_build port:autoconf \ |
---|
33 | port:automake \ |
---|
34 | port:libtool |
---|
35 | |
---|
36 | depends_lib port:geos\ |
---|
37 | port:proj\ |
---|
38 | port:libiconv\ |
---|
39 | port:libxml2 |
---|
40 | |
---|
41 | archcheck.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 | |
---|
48 | conflicts postgis |
---|
49 | |
---|
50 | # Neither is PostGIS 2.0 compatible with PostGreSQL 8 |
---|
51 | |
---|
52 | variant 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 | |
---|
62 | variant 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 | |
---|
72 | variant raster description {Build raster support} { |
---|
73 | |
---|
74 | depends_lib-append port:gdal |
---|
75 | configure.args-append --with-raster |
---|
76 | } |
---|
77 | |
---|
78 | variant topology description {Build topology support} { |
---|
79 | |
---|
80 | configure.args-append --with-topology |
---|
81 | } |
---|
82 | |
---|
83 | variant gui description {Build the GUI import tool} { |
---|
84 | |
---|
85 | depends_lib-append port:gtk2 |
---|
86 | configure.args-append --with-gui |
---|
87 | } |
---|
88 | |
---|
89 | variant 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 | |
---|
105 | default_variants +raster +topology |
---|
106 | |
---|
107 | if {![variant_isset postgresql90] && ![variant_isset postgresql91]} { |
---|
108 | default_variants +postgresql91 |
---|
109 | } |
---|
110 | |
---|
111 | # Port phases |
---|
112 | |
---|
113 | pre-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 | |
---|
123 | configure.cflags-append \ |
---|
124 | -Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close \ |
---|
125 | -I${prefix}/include |
---|
126 | |
---|
127 | post-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 | |
---|
138 | build.args ICONV_LDFLAGS='-L${prefix}/lib -liconv' |
---|
139 | use_parallel_build no |
---|
140 | |
---|
141 | |
---|
142 | livecheck.type regex |
---|
143 | livecheck.url ${master_sites} |
---|
144 | livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)\\.tar |
---|