[56900] trunk/dports/databases/postgis/Portfile

nox at macports.org nox at macports.org
Thu Sep 3 05:11:49 PDT 2009


Revision: 56900
          http://trac.macports.org/changeset/56900
Author:   nox at macports.org
Date:     2009-09-03 05:11:45 -0700 (Thu, 03 Sep 2009)
Log Message:
-----------
postgis:
 * New default variant for postgresql84.
 * Now installs doc.

Modified Paths:
--------------
    trunk/dports/databases/postgis/Portfile

Modified: trunk/dports/databases/postgis/Portfile
===================================================================
--- trunk/dports/databases/postgis/Portfile	2009-09-03 11:17:10 UTC (rev 56899)
+++ trunk/dports/databases/postgis/Portfile	2009-09-03 12:11:45 UTC (rev 56900)
@@ -5,6 +5,7 @@
 
 name            postgis
 version         1.4.0
+revision        1
 categories      databases
 platforms       darwin
 maintainers     nomaintainer
@@ -13,62 +14,90 @@
 long_description \
     PostGIS adds support for geographic objects to the \
     PostgreSQL object-relational database. In effect, PostGIS \
-    "spatially enables" the PostgreSQL server, allowing it to be used \
+    \"spatially enables\" the PostgreSQL server, allowing it to be used \
     as a backend spatial database for geographic information systems \
     (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS \
     follows the OpenGIS Simple Features Specification for SQL and \
     will be submitted for conformance testing at version 1.0.
 
 homepage        http://postgis.refractions.net/
-master_sites    http://distfiles.macports.org/${dist_subdir}/ \
-                http://postgis.refractions.net/download/
+master_sites    ${homepage}download/
 
-checksums       sha1 454d87021c46c9fa4f657819e31a74b8fc75193a
+checksums           md5     bc5b97d5399bd20ca90bfdf784ab6c33 \
+                    sha1    454d87021c46c9fa4f657819e31a74b8fc75193a \
+                    rmd160  e5f6cb7ddc78f7c20954b0aa3a3906e31581a1d7
 
+depends_build \
+    port:docbook-xsl \
+    port:libxslt
+
 depends_lib \
     port:geos \
     port:proj \
     port:libiconv
 
-configure.args  --datadir=${prefix}/share/${name} \
-                --with-geos=${prefix}/bin/geos-config \
-                --with-projdir=${prefix}
+configure.args \
+    --datadir=${prefix}/share/${name} \
+    --with-projdir=${prefix}
 
-build.args      "ICONV_LDFLAGS=\"-L${prefix}/lib -liconv\""
+build.target-append comments
+build.args      ICONV_LDFLAGS='-L${prefix}/lib -liconv'
 
-#
-# Default to PostgreSQL 8.4
-#
-set default_configure       "--libdir=${prefix}/lib/postgresql84/ --with-pgconfig=${prefix}/lib/postgresql84/bin/pg_config"
-set default_depends     port:postgresql84
+destroot.target-append  docs-install comments-install
 
-configure.args-append       ${default_configure}
-depends_lib-append      ${default_depends}
+set pgsql_suffixes {82 83 84}
 
-variant postgresql83 {
-    global default_configure
-    global default_depends
+set pgsql_ports {}
+foreach s ${pgsql_suffixes} {
+    lappend pgsql_ports postgresql${s}
+}
 
-    configure.args-delete $default_configure
-    depends_lib-delete  $default_depends
+foreach s ${pgsql_suffixes} {
+    set p postgresql${s}
+    set v [string index ${s} 0].[string index ${s} 1]
+    set i [lsearch -exact ${pgsql_ports} ${p}]
+    set c [lreplace ${pgsql_ports} ${i} ${i}]
+    eval [subst {
+        variant ${p} description "Build with PostgreSQL ${v}" conflicts ${c} {
+            post-patch {
+                set args {
+                     PGSQL_DOCDIR=${destroot}${prefix}/share/doc/${p}
+                     PGSQL_MANDIR=${destroot}${prefix}/share/man
+                     PGSQL_SHAREDIR=${destroot}${prefix}/share/${p}
+                }
 
-    # Declare the 8.3 dependency
-    depends_lib-append  port:postgresql83
-    configure.args-append --libdir=${prefix}/lib/postgresql83/ \
-                --with-pgsql=${prefix}/lib/postgresql83/bin/pg_config
+                reinplace -E "/doc .*install\\\$/s|\\\$| \[join \${args}\]|" ${worksrcpath}/GNUmakefile
+            }
+            depends_lib-append  port:${p}
+
+            configure.args-append   --libdir=${prefix}/lib/${p} \
+                                    --with-pgconfig=${prefix}/lib/${p}/bin/pg_config
+
+            build.args-append   PGSQL_DOCDIR=${destroot}${prefix}/share/doc/${p} \
+                                PGSQL_MANDIR=${destroot}${prefix}/share/man
+        }
+    }]
 }
 
-# Support for older PostgreSQL versions
-variant postgresql82 {
-    # Remove the default dependency
-    global default_configure
-    global default_depends
+proc has_pgsql_variant {} {
+    global pgsql_ports
+    foreach p ${pgsql_ports} {
+        if {[variant_isset ${p}]} {
+            return 1
+        }
+    }
+    return 0
+}
 
-    configure.args-delete $default_configure
-    depends_lib-delete  $default_depends
+if {![has_pgsql_variant]} {
+    set p [lindex ${pgsql_ports} end]
+    default_variants +${p}
 
-  # Declare the 8.2 dependency
-    depends_lib-append  port:postgresql82
-    configure.args-append --libdir=${prefix}/lib/postgresql82/ \
-                --with-pgsql=${prefix}/lib/postgresql82/bin/pg_config
+    if {![has_pgsql_variant]} {
+        error "One of the following variants must be set: [join ${pgsql_ports}]"
+    }
 }
+
+livecheck.type  regex
+livecheck.url   ${master_sites}
+livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)\\.tar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090903/195cad64/attachment.html>


More information about the macports-changes mailing list