Index: mapserver56/Portfile
===================================================================
--- mapserver56/Portfile	(revision 80925)
+++ mapserver56/Portfile	(working copy)
@@ -2,9 +2,10 @@
 
 PortSystem 1.0
 
-name             mapserver
-version          5.2.0
-maintainers      googlemail.com:mbarchfe
+name             mapserver56
+version          5.6.7
+maintainers      googlemail.com:mbarchfe \
+                 gmail.com:thomas.bonfort
 categories       gis
 platforms        darwin
 
@@ -14,26 +15,103 @@
 
 homepage         http://mapserver.gis.umn.edu/
 master_sites     http://download.osgeo.org/mapserver
+distname         mapserver-${version}
 
-checksums        md5 6c0f210eb6510f0a43b6d5b09df8bb83
+conflicts        mapserver mapserver60
+checksums        md5 5494e6c3de87f4e2b77b20ce79933883
 
 depends_lib      port:gd2 \
-                 port:geos
+                 port:libpng \
+                 port:freetype \
 
 patchfiles       patch-Makefile.in.diff
 
-configure.args   --with-gd=${prefix}
-variant gdalogr description {Add raster formats from gdal (Geospatial Data Abstraction Library) and vector formats from OGR Simple Features Library} {
-    depends_lib-append      port:gdal
-    configure.args-append   --with-gdal=${prefix}/bin/gdal-config \
-                            --with-ogr=${prefix}/bin/gdal-config
+configure.args   --with-gd=${prefix} \
+                 --with-png=${prefix} \
+                 --with-experimental-png \
+                 --with-zlib=${prefix} \
+                 --with-jpeg=${prefix} \
+                 --with-gif=${prefix}
+
+use_parallel_build  no
+
+default_variants +wms +gdal +ogr +proj +wfs +proj \
+                 +geos +postgis +wmsclient +wfsclient \
+                 +wcs +sos +fastcgi
+
+if {[variant_isset postgis]} {
+       #check for most recent version of postgresql installed
+       set HAVE_PGCONFIG [llength [glob -nocomplain -d ${prefix}/lib postgresql*/bin/pg_config]]
+       #if not found, intall the postgresql port
+       if {$HAVE_PGCONFIG == 0} {
+         depends_lib-append port:postgresql90
+       }
 }
 
-variant proj description {Add projection and Web Map Service support} {
-    depends_lib-append      port:proj
-    configure.args-append   --with-proj=${prefix}
+variant postgis description {Add support for postgis sources} {
+       set PGSQL_DIR [lindex [lsort -dec [glob -d ${prefix}/lib postgresql*]] 0]
+       configure.args-append "--with-postgis=${PGSQL_DIR}/bin/pg_config"
 }
 
+variant wms description {Add WMS server support} {
+   default_variants-append    +proj
+}
+
+variant wfs description {Add WFS server support} {
+   depends_lib-append port:libxml2
+   default_variants-append +proj +ogr +geos
+   configure.args-append   --with-wfs
+}
+
+variant sos description {Add SOS server support} {
+   depends_lib-append port:libxml2
+   default_variants-append +proj +ogr
+   configure.args-append   --with-sos
+}
+
+variant wcs description {Add WCS server support} {
+   default_variants-append +proj +gdal
+   configure.args-append   --with-wcs
+}
+
+variant wmsclient description {Add WMS client support} {
+   depends_lib-append port:curl
+   default_variants-append +proj +gdal
+   configure.args-append   --with-wmsclient
+}
+
+variant wfsclient description {Add WFS client support} {
+   depends_lib-append port:libxml2 port:curl
+   default_variants-append    +proj +ogr +geos
+   configure.args-append   --with-wfsclient
+}
+
+variant gdal description {Add GDAL input format support} {
+   depends_lib-append   port:gdal
+   configure.args-append    --with-gdal
+}
+
+variant ogr description {Add OGR input format support} {
+   depends_lib-append   port:gdal
+   configure.args-append    --with-ogr
+}
+
+
+variant proj description {Proj.4 reprojection support} {
+   depends_lib-append   port:proj
+   configure.args-append    --with-proj=${prefix}
+}
+
+variant fastcgi description {FastCGI support} {
+   depends_lib-append   port:fcgi
+   configure.args-append    --with-fastcgi=${prefix}
+}
+
+variant geos description {Add GEOS operations support} {
+   depends_lib-append   port:geos
+   configure.args-append    --with-geos
+}
+
 variant apache conflicts apache2 apache_apple description {Use MacPorts Apache 1} {
 	depends_run-append port:apache
 	global cgi_path
@@ -52,12 +130,13 @@
 }
 
 if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset apache_apple]} {
-	default_variants +apache2
+   #default to the apple apache version if none specified
+   default_variants +apache_apple
 }
 
 destroot.target install-force
 destroot.violate_mtree yes
 post-destroot {
     file mkdir ${destroot}${cgi_path}
-    xinstall -m 755 ${worksrcpath}/mapserv ${destroot}${cgi_path}
+    xinstall -m 755 ${worksrcpath}/mapserv ${destroot}${cgi_path}/mapserv
 }
Index: mapserver/Portfile
===================================================================
--- mapserver/Portfile	(revision 80925)
+++ mapserver/Portfile	(working copy)
@@ -13,51 +13,15 @@
                  building spatially-enabled internet applications.
 
 homepage         http://mapserver.gis.umn.edu/
-master_sites     http://download.osgeo.org/mapserver
 
-checksums        md5 6c0f210eb6510f0a43b6d5b09df8bb83
+replaced_by      mapserver56
+revision         1
+distfiles
 
-depends_lib      port:gd2 \
-                 port:geos
+livecheck.type  none
+conflicts mapserver56 mapserver60
 
-patchfiles       patch-Makefile.in.diff
-
-configure.args   --with-gd=${prefix}
-variant gdalogr description {Add raster formats from gdal (Geospatial Data Abstraction Library) and vector formats from OGR Simple Features Library} {
-    depends_lib-append      port:gdal
-    configure.args-append   --with-gdal=${prefix}/bin/gdal-config \
-                            --with-ogr=${prefix}/bin/gdal-config
+pre-configure {
+   ui_error "Please do not install this port since it has been replaced by 'mapserver56' or 'mapserver60'."
+   return -code error
 }
-
-variant proj description {Add projection and Web Map Service support} {
-    depends_lib-append      port:proj
-    configure.args-append   --with-proj=${prefix}
-}
-
-variant apache conflicts apache2 apache_apple description {Use MacPorts Apache 1} {
-	depends_run-append port:apache
-	global cgi_path
-	set cgi_path "${prefix}/www/cgi-bin/"
-}
-
-variant apache2 conflicts apache apache_apple description {Use MacPorts Apache 2} {
-	depends_run-append port:apache2
-	global cgi_path
-	set cgi_path "${prefix}/apache2/cgi-bin/"
-}
-
-variant apache_apple conflicts apache apache2 description {Use Apple Apache} {
-	global cgi_path
-	set cgi_path "/Library/WebServer/CGI-Executables/"
-}
-
-if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset apache_apple]} {
-	default_variants +apache2
-}
-
-destroot.target install-force
-destroot.violate_mtree yes
-post-destroot {
-    file mkdir ${destroot}${cgi_path}
-    xinstall -m 755 ${worksrcpath}/mapserv ${destroot}${cgi_path}
-}
Index: mapserver60/Portfile
===================================================================
--- mapserver60/Portfile	(revision 80925)
+++ mapserver60/Portfile	(working copy)
@@ -2,9 +2,10 @@
 
 PortSystem 1.0
 
-name             mapserver
-version          5.2.0
-maintainers      googlemail.com:mbarchfe
+name             mapserver60
+version          6.0.1
+maintainers      googlemail.com:mbarchfe \
+                 gmail.com:thomas.bonfort
 categories       gis
 platforms        darwin
 
@@ -14,26 +15,111 @@
 
 homepage         http://mapserver.gis.umn.edu/
 master_sites     http://download.osgeo.org/mapserver
+distname         mapserver-${version}
 
-checksums        md5 6c0f210eb6510f0a43b6d5b09df8bb83
+conflicts        mapserver mapserver56
+checksums        md5 b96287449dcbca9a2fcea3a64905915a
 
 depends_lib      port:gd2 \
-                 port:geos
+                 port:jpeg \
+                 port:libpng \
+                 port:freetype \
+                 port:giflib \
 
 patchfiles       patch-Makefile.in.diff
 
-configure.args   --with-gd=${prefix}
-variant gdalogr description {Add raster formats from gdal (Geospatial Data Abstraction Library) and vector formats from OGR Simple Features Library} {
-    depends_lib-append      port:gdal
-    configure.args-append   --with-gdal=${prefix}/bin/gdal-config \
-                            --with-ogr=${prefix}/bin/gdal-config
+configure.args   --with-gd=${prefix} \
+                 --with-png=${prefix} \
+                 --with-zlib=${prefix} \
+                 --with-jpeg=${prefix} \
+                 --with-gif=${prefix} \
+
+default_variants +wms +gdal +ogr +proj +cairo +wfs +proj \
+                 +geos +postgis +wmsclient +wfsclient \
+                 +wcs +sos +kml +fastcgi
+
+if {[variant_isset postgis]} {
+       #check for most recent version of postgresql installed
+       set HAVE_PGCONFIG [llength [glob -nocomplain -d ${prefix}/lib postgresql*/bin/pg_config]]
+       #if not found, intall the postgresql port
+       if {$HAVE_PGCONFIG == 0} {
+         depends_lib-append port:postgresql90
+       }
 }
 
-variant proj description {Add projection and Web Map Service support} {
-    depends_lib-append      port:proj
-    configure.args-append   --with-proj=${prefix}
+variant postgis description {Add support for postgis sources} {
+       set PGSQL_DIR [lindex [lsort -dec [glob -d ${prefix}/lib postgresql*]] 0]
+       configure.args-append "--with-postgis=${PGSQL_DIR}/bin/pg_config"
 }
 
+variant wms description {Add WMS server support} {
+   default_variants-append    +proj
+}
+
+variant wfs description {Add WFS server support} {
+   depends_lib-append port:libxml2
+   default_variants-append +proj +ogr +geos
+   configure.args-append   --with-wfs
+}
+
+variant sos description {Add SOS server support} {
+   depends_lib-append port:libxml2
+   default_variants-append +proj +ogr
+   configure.args-append   --with-sos
+}
+
+variant wcs description {Add WCS server support} {
+   default_variants-append +proj +gdal
+   configure.args-append   --with-wcs
+}
+
+variant wmsclient description {Add WMS client support} {
+   depends_lib-append port:curl
+   default_variants-append +proj +gdal
+   configure.args-append   --with-wmsclient
+}
+
+variant kml description {Add KML output support} {
+   configure.args-append   --with-kml
+}
+
+variant wfsclient description {Add WFS client support} {
+   depends_lib-append port:libxml2 port:curl
+   default_variants-append    +proj +ogr +geos
+   configure.args-append   --with-wfsclient
+}
+
+variant cairo description {Add SVG and PDF support through cairo} {
+    depends_lib-append      path:lib/pkgconfig/cairo.pc:cairo
+    configure.args-append   --with-cairo
+}
+
+variant gdal description {Add GDAL input format support} {
+   depends_lib-append   port:gdal
+   configure.args-append    --with-gdal
+}
+
+variant ogr description {Add OGR input format support} {
+   depends_lib-append   port:gdal
+   configure.args-append    --with-ogr
+}
+
+
+variant proj description {Proj.4 reprojection support} {
+   depends_lib-append   port:proj
+   configure.args-append    --with-proj=${prefix}
+}
+
+variant fastcgi description {FastCGI support} {
+   depends_lib-append   port:fcgi
+   configure.args-append    --with-fastcgi=${prefix}
+}
+
+variant geos description {Add GEOS operations support} {
+   depends_lib-append   port:geos
+   configure.args-append    --with-geos
+}
+
 variant apache conflicts apache2 apache_apple description {Use MacPorts Apache 1} {
 	depends_run-append port:apache
 	global cgi_path
@@ -52,12 +138,13 @@
 }
 
 if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset apache_apple]} {
-	default_variants +apache2
+   #default to the apple apache version if none specified
+   default_variants +apache_apple
 }
 
 destroot.target install-force
 destroot.violate_mtree yes
 post-destroot {
     file mkdir ${destroot}${cgi_path}
-    xinstall -m 755 ${worksrcpath}/mapserv ${destroot}${cgi_path}
+    xinstall -m 755 ${worksrcpath}/mapserv ${destroot}${cgi_path}/mapserv
 }
