Index: /trunk/dports/science/ncarg/Portfile
===================================================================
--- /trunk/dports/science/ncarg/Portfile	(revision 99378)
+++ /trunk/dports/science/ncarg/Portfile	(revision 99379)
@@ -5,8 +5,8 @@
 
 name                        ncarg
-version                     6.0.0
-revision                    10
+version                     6.1.0
 categories                  science
 maintainers                 takeshi
+license                     {UCAR-Unidata public-domain BSD LGPL-3 GPL-3}
 description                 language for scientific data processing and visualization
 long_description \
@@ -26,18 +26,20 @@
 worksrcdir                  ncl_${name}-${version}
 set ncl_src             ${distname}${extract.suffix}
-set g2clib_version      1.2.1
-set g2clib_src          g2clib_with_changes-${g2clib_version}${extract.suffix}
-set g2clib_worksrcdir   g2clib-${g2clib_version}-patches
+set g2clib_version      1.2.3
+set g2clib_src          g2clib-${g2clib_version}-patch${extract.suffix}
+set g2clib_worksrcdir   g2clib-${g2clib_version}-patch
 distfiles           ${ncl_src}:ncl \
                     ${g2clib_src}:g2clib
+checksums           ncl_ncarg-6.1.0.tar.gz \
+                    g2clib-1.2.3-patch.tar.gz \
+
 checksums   ${ncl_src} \
-                    md5     0afca904b8f51abdd3efada4c0dbaa42 \
-                    sha1    949dc8fc823256c1a036aa06a3e68805a4099009 \
-                    rmd160  e5214051eb23e8cc58e0d579a382c80476d570d7 \
+                    md5     e6eaef55ca0288535cf9e4203bb3874b \
+                    sha1    445aa78714434b4979acd1db8ae1dc9d3356a146 \
+                    rmd160  7736c69f21565deaf85e51a67d199c08994afa61 \
             ${g2clib_src} \
-                    md5     253327b963bf054c69f70df227e83cfb \
-                    sha1    a0ae0849da6c2aba427cf4384c88433e67cc8f77 \
-                    rmd160  0bea38746c9fb4eeeedb4546a5cb8b1a3936f7ee
-
+                    md5     43eb24f168300f34e0d4e5a7260aba59 \
+                    sha1    5da7cc7319253b80ee0d9693753212d33f32c2b0 \
+                    rmd160  e67d9430bb03a255716763f72e31eddb6d1d5516
 
 depends_lib                 path:lib/pkgconfig/cairo.pc:cairo \
@@ -69,5 +71,4 @@
 
 patch.dir                   ${workpath}
-patchfiles                  patch-dec_png.c.diff patch-enc_png.c.diff
 if {$build_arch eq "x86_64"} {
     patchfiles-append           patch-config-ymake.diff
@@ -75,8 +76,9 @@
 
 post-patch {
+    reinplace "s|hdf/||" ${worksrcpath}/ni/src/ncl/FileSupport.c
     reinplace "s| -lsz||g" ${worksrcpath}/Configure
     reinplace "s| -lsz||g" ${worksrcpath}/config/Project
     reinplace "s|g\\\\+\\\\+|${configure.cc}|" ${worksrcpath}/ni/src/ncl/yMakefile
-    reinplace "s|INC=-I/usr/include|INC=${configure.cppflags} ${configure.cflags}|" ${workpath}/${g2clib_worksrcdir}/makefile
+    reinplace "s|INC=-I/usr/local/include|INC=${configure.cppflags} ${configure.cflags}|" ${workpath}/${g2clib_worksrcdir}/makefile
     reinplace "s|CC=gcc -fPIC|CC=${configure.cc}|" ${workpath}/${g2clib_worksrcdir}/makefile
     if {$build_arch eq "x86_64" || $build_arch eq "ppc64"} {
@@ -102,9 +104,9 @@
 #define ArchRecLibSearch    -L${prefix}/lib\\
 #define ArchRecIncSearch    -I${prefix}/include\\
-#define CcOptions -fPIC -ansi -D_DARWIN_C_SOURCE -DH5_USE_16_API \\
+#define CcOptions -fPIC -ansi -D_DARWIN_C_SOURCE \\
 #define COptimizeFlag ${configure.cflags}\\
 #define FOptimizeFlag ${configure.fflags}\\
 #define ManRoot ${destroot}${prefix}/share/man\\
-#define NetCDF4lib -lnetcdf\\
+#define NetCDFlib -lnetcdf\\
 #define HDFEOS5lib -lhe5_hdfeos -lGctp -lhdf5|" ${worksrcpath}/config/${f}
     }
@@ -119,4 +121,7 @@
     }
     reinplace "s|\$\(NCARGGKSCAIROLIB\) \$\(NCARGCLIB\)|\$(NCARGGKSCAIROLIB) \$(NCARGGKSLIB) \$(NCARGCLIB)|" ${worksrcpath}/config/Project
+    foreach exlib {sphere3.1_dp fftpack5_dp} {
+        reinplace "s|-l${exlib}|\$(EXTERNALSRC)/${exlib}/lib${exlib}.a|g" ${worksrcpath}/config/Project
+    }
     if {[variant_isset accelerate]} {
         reinplace "s|-llapack_ncl|-framework Accelerate|g" ${worksrcpath}/config/Project
@@ -126,7 +131,15 @@
             reinplace "s|-lblas_ncl|-framework Accelerate|g" ${worksrcpath}/config/Project
         }
+        foreach f {Darwin Darwin_Intel} {
+            reinplace "/LAPACKLIB/d" ${worksrcpath}/config/${f}
+            reinplace "/BLASLIB/d" ${worksrcpath}/config/${f}
+        }
         reinplace "s|-L\$(LAPACKSRC)||" ${worksrcpath}/config/Project
         reinplace "s|-L\$(BLASSRC)||" ${worksrcpath}/config/Project
         reinplace "s|blas lapack ||" ${worksrcpath}/external/yMakefile
+    } else {
+        foreach exlib {lapack blas} {
+            reinplace "s|-l${exlib}_ncl|\$(EXTERNALSRC)/${exlib}/lib${exlib}_ncl.a|g" ${worksrcpath}/config/Project
+        }
     }
 }
@@ -203,4 +216,5 @@
     configure.fc            ${prefix}/bin/g95
     depends_build-append    port:g95
+    configure.fflags-append -fno-second-underscore
 }
 
Index: /trunk/dports/science/ncarg/files/patch-config-ymake.diff
===================================================================
--- /trunk/dports/science/ncarg/files/patch-config-ymake.diff	(revision 99378)
+++ /trunk/dports/science/ncarg/files/patch-config-ymake.diff	(revision 99379)
@@ -1,11 +1,10 @@
---- ncl_ncarg-6.0.0/config/ymake.orig	2009-12-23 17:02:49.000000000 +0900
-+++ ncl_ncarg-6.0.0/config/ymake	2009-12-23 17:12:25.000000000 +0900
-@@ -415,8 +415,9 @@
-             set vendor  = Apple
+--- ncl_ncarg-6.1.0/config/ymake.orig	2012-10-28 11:55:53.000000000 +0900
++++ ncl_ncarg-6.1.0/config/ymake	2012-11-03 16:07:20.000000000 +0900
+@@ -416,8 +416,8 @@
              breaksw
          case    i386:
+         case    x86_64:
 -            set model   = $mach
 -            set arch    = $mach
-+        case  x86_64:
 +            set model   = x86_64
 +            set arch    = x86_64
Index: unk/dports/science/ncarg/files/patch-dec_png.c.diff
===================================================================
--- /trunk/dports/science/ncarg/files/patch-dec_png.c.diff	(revision 99378)
+++ 	(revision )
@@ -1,11 +1,0 @@
---- g2clib-1.2.1-patches/dec_png.c.orig	2011-02-10 07:53:25.000000000 +0900
-+++ g2clib-1.2.1-patches/dec_png.c	2012-09-06 09:30:41.000000000 +0900
-@@ -88,7 +88,7 @@
- 
- /*    Set new custom read function    */
- 
--    png_set_read_fn(png_ptr,(voidp)&read_io_ptr,(png_rw_ptr)user_read_data);
-+    png_set_read_fn(png_ptr,(png_voidp)&read_io_ptr,(png_rw_ptr)user_read_data);
- /*     png_init_io(png_ptr, fptr);   */
- 
- /*     Read and decode PNG stream   */
Index: unk/dports/science/ncarg/files/patch-enc_png.c.diff
===================================================================
--- /trunk/dports/science/ncarg/files/patch-enc_png.c.diff	(revision 99378)
+++ 	(revision )
@@ -1,11 +1,0 @@
---- g2clib-1.2.1-patches/enc_png.c.orig	2011-02-10 07:53:25.000000000 +0900
-+++ g2clib-1.2.1-patches/enc_png.c	2012-09-06 09:31:00.000000000 +0900
-@@ -88,7 +88,7 @@
- 
- /*    Set new custom write functions    */
- 
--    png_set_write_fn(png_ptr,(voidp)&write_io_ptr,(png_rw_ptr)user_write_data,
-+    png_set_write_fn(png_ptr,(png_voidp)&write_io_ptr,(png_rw_ptr)user_write_data,
-                     (png_flush_ptr)user_flush_data);
- /*    png_init_io(png_ptr, fptr);   */
- /*    png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);  */
