--- Portfile.orig	2011-07-25 11:00:22.000000000 +1200
+++ Portfile	2011-08-29 11:47:23.000000000 +1200
@@ -5,7 +5,8 @@
 
 name                        gmt
 version                     4.5.6
-revision                    1
+revision                    2
+replaced_by                 gmt4
 categories                  science
 maintainers                 takeshi
 license                     GPLv2
@@ -15,120 +16,16 @@
     producing Encapsulated PostScript File (EPS) illustrations  \
     ranging from simple x-y plots via contour maps to           \
     artificially illuminated surfaces and 3-D perspective views.
+conflicts                   gmt4 \
+                            gmt5
 homepage                    http://gmt.soest.hawaii.edu/
 platforms                   darwin
-master_sites                ftp://ftp.soest.hawaii.edu/gmt          \
-                            ftp://ibis.grdl.noaa.gov/pub/gmt        \
-                            ftp://ftp.iris.washington.edu/pub/gmt   \
-                            ftp://ftp.iag.usp.br/pub/gmt            \
-                            ftp://ftp.geologi.uio.no/pub/gmt        \
-                            ftp://gd.tuwien.ac.at/pub/gmt           \
-                            ftp://ftp.scc.u-tokai.ac.jp/pub/gmt     \
-                            ftp://mirror.geosci.usyd.edu.au/pub/gmt \
-                            ftp://gmt.mirror.ac.za/pub/gmt
-use_bzip2                   yes
-set gshhsversion            2.1.1
-set gmtsrc                  GMT${version}_src.tar.bz2
-set gmtshare                GMT${version}_share.tar.bz2
-set gmtsuppl                GMT${version}_suppl.tar.bz2
-set gshhslow                GSHHS${gshhsversion}_coast.tar.bz2
-distfiles                   ${gmtsrc} ${gmtshare} ${gmtsuppl} ${gshhslow}
-checksums           ${gmtsrc} \
-                    md5     79cdb798b48c0411483d9b1c60944163 \
-                    sha1    21c947e386368118a9c0f88bba2de0267c6357a6 \
-                    rmd160  284f63b66009b411230fe32315dc3c8d4a8e3f4a \
-                    ${gmtshare} \
-                    md5     9b29e35a0c939345ae593dc6487c8b00 \
-                    sha1    e1883826db21b4b04560a751d1aeeab23f51692d \
-                    rmd160  5c6fa2f08ae3c4c202501b4c053e55b41465608b \
-                    ${gmtsuppl} \
-                    md5     1519e3fdfd337a852d53f5ce819ac3cc \
-                    sha1    fc25a9b13d593dbcc51db5b14f42ec4867df0f1d \
-                    rmd160  f3d355c0e2a0db44bcdbf6d5e892f363808d8ff9 \
-                    ${gshhslow} \
-                    md5     68a3f9eb6605c17b3369b6f6f5e94549 \
-                    sha1    f54899ad197136271cdf17e0b0edc68a08718d0c \
-                    rmd160  d75a9dcce2a36fa418054ab77b315f5595423a96
 
-worksrcdir                  GMT${version}
+distfiles
 
-depends_lib                 port:netcdf
-
-configure.args              --mandir=${prefix}/share/man \
-                            --datadir=${prefix}/share/${name} \
-                            --enable-netcdf=${prefix} \
-                            --enable-shared \
-                            --disable-xgrid \
-                            --disable-rpath
-configure.cflags-append     -std=c99
-use_parallel_build          no
-destroot.target             install-all
-destroot.destdir            prefix=${destroot}${prefix}
-configure.ldflags-delete    -L${prefix}/lib
 pre-configure {
-    reinplace "s|-flat_namespace -undefined suppress||" ${worksrcpath}/configure
-}
-
-post-destroot {
-    xinstall -m 755 -d ${destroot}${prefix}/share/${name}
-    eval xinstall -m 644 [glob ${workpath}/share/coast/*] \
-    ${destroot}${prefix}/share/${name}
-}
-
-if {[variant_isset universal]} {
-    configure.universal_args-delete --disable-dependency-tracking
-    patch {
-        reinplace "s|\$(AR) cvur \$@ \$?|if \[ -f \$@ \]; then \$(RM) \$@; fi;\$(AR) cvur \$@ \$?|" ${worksrcpath}/src/Makefile
-        reinplace "s|-dynamiclib|-dynamiclib ${configure.universal_ldflags}|" ${worksrcpath}/configure
-    }
-} else {
-    patch {
-        reinplace "s|-dynamiclib|-dynamiclib ${configure.cc_archflags}|" ${worksrcpath}/configure
-    }
-    configure.ldflags-append    ${configure.cc_archflags}
-}
-
-variant gshhs description {installs high and full resolution GSHHS coast line data} {
-    set gshhshigh GSHHS${gshhsversion}_high.tar.bz2
-    set gshhsfull GSHHS${gshhsversion}_full.tar.bz2
-    distfiles-append        ${gshhshigh} ${gshhsfull}
-    checksums-append \
-                    ${gshhshigh} \
-                    md5     78e23d1444452fa8ddc9b67e2ad89a01 \
-                    sha1    599797908ba0258fc00706f634909e1494a55717 \
-                    rmd160  4a3047276ba25bf20ee0310d0c6dcea8aa5f174c \
-                    ${gshhsfull} \
-                    md5     603c802f4408e33db974508ebc647ef9 \
-                    sha1    95b26d901796d8bf8a6d7be0142d10e7f29473fb \
-                    rmd160  63f779f17bb5ed54518aac73f723304bba0d394e \
-}
-
-variant doc description {installs documentation, examples and tutorial} {
-    set gmtdoc GMT${version}_doc.tar.bz2
-    distfiles-append        ${gmtdoc}
-    checksums-append        ${gmtdoc} \
-                    md5     9a7b78d58311beff31d47b42d0d30bad \
-                    sha1    392546398e17910f1f47153e184eb4d8bbcb51e1 \
-                    rmd160  180f74d1886b1693c416a98a06afe199929cb386 \
-}
-
-variant octave description {compiles Octave interface} {
-    depends_lib-append      path:bin/octave:octave
-    configure.args-append   --enable-octave
-    configure.args-delete   --disable-mex
-}
-
-variant triangle description {use J. Shewchuk's fast, non-GPL triangulation routine} {
-    set gmttri GMT${version}_triangle.tar.bz2
-    distfiles-append        ${gmttri}
-    checksums-append        ${gmttri} \
-                    md5     1812713d2e65edea2cabdc35b5867321 \
-                    sha1    dabb2ab065ed214c1a831fbd84a420cc63360b22 \
-                    rmd160  a8fb547530f857ffa8618c49609666d0a7551ebc
-
-    configure.args-append   --enable-triangle
+    ui_error "Please do not install this port since it has been replaced by 'gmt4'."
+    return -code error
 }
 
-livecheck.type              regex
-livecheck.url               http://gmt.soest.hawaii.edu/gmt/gmt_home.html
-livecheck.regex             {Current version is ([0-9]+.[0-9]+.[0-9]+.)}
+livecheck.type              none
