Index: files/patch-numpy_linalg_setup.py.diff
===================================================================
--- files/patch-numpy_linalg_setup.py.diff	(revision 0)
+++ files/patch-numpy_linalg_setup.py.diff	(revision 0)
@@ -0,0 +1,10 @@
+--- numpy/linalg/setup.py.orig	2010-09-14 11:44:21.000000000 -0400
++++ numpy/linalg/setup.py	2010-09-14 11:45:01.000000000 -0400
+@@ -27,6 +27,7 @@
+                                     'zlapack_lite.c', 'dlapack_lite.c',
+                                     'blas_lite.c', 'dlamch.c',
+                                     'f2c_lite.c','f2c.h'],
++                         extra_link_args=['-undefined dynamic_lookup -bundle'],
+                          extra_info = lapack_info
+                          )
+ 
Index: Portfile
===================================================================
--- Portfile	(revision 72032)
+++ Portfile	(working copy)
@@ -7,6 +7,7 @@
 name                    py26-numpy
 epoch                   20100319
 version                 1.5.0
+revision                1
 categories              python
 platforms               darwin
 maintainers             mcalhoun openmaintainer
@@ -26,60 +27,109 @@
                         patch-fcompiler_g95.diff
 
 depends_lib-append      port:fftw-3 \
-                        port:py26-nose \
-                        port:atlas
+                        port:py26-nose
 
-build.env-append        ATLAS=${prefix}/lib \
+variant atlas \
+description {Use the MacPorts' ATLAS libraries \
+             instead of Apple's Accelerate framework} {
+    build.env-append    ATLAS=${prefix}/lib \
                         LAPACK=${prefix}/lib \
                         BLAS=${prefix}/lib
-
-destroot.env-append     ATLAS=${prefix}/lib \
+    destroot.env-append ATLAS=${prefix}/lib \
                         LAPACK=${prefix}/lib \
                         BLAS=${prefix}/lib
+    depends_lib-append  port:atlas
+}
 
-post-patch {
-    reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" ${worksrcpath}/numpy/f2py/setup.py
+# use ALTAS by default; if MacPorts' ATLAS is not used, numpy will
+# link with that supplied by Apple's Accelerate framework.
+if {![variant_isset atlas]} {
+    default_variants +atlas
 }
 
-variant gcc43 conflicts gcc44 description {Use the gcc43 compiler (enables fortran code)} {
-    depends_lib-append  port:gcc43
-    configure.compiler  macports-gcc-4.3
-    build.env-append    CC="${prefix}/bin/gcc-mp-4.3" \
-                        CXX="${prefix}/bin/g++-mp-4.3"
+# when using ATLAS (whether by default or specified by the user via
+# the +atlas variant) ...
+set gcc_version ""
+if {[variant_isset atlas]} {
+    # see if the user has set -gcc4X to disable using MacPorts'
+    # compiler; if not, either use what the user set (as +gcc4X) or
+    # default to gcc44.
 
-    destroot.env-append CC="${prefix}/bin/gcc-mp-4.3" \
-                        CXX="${prefix}/bin/g++-mp-4.3"
-}
+    variant gcc43 conflicts gcc44 gcc45 \
+    description {Use the gcc43 compiler (enables fortran linking)} {}
 
-variant gcc44 conflicts gcc43 description {Use the gcc44 compiler (enables fortran code)} {
-    depends_lib-append  port:gcc44
-    configure.compiler  macports-gcc-4.4
-    build.env-append    CC="${prefix}/bin/gcc-mp-4.4" \
-                        CXX="${prefix}/bin/g++-mp-4.4"
+    variant gcc44 conflicts gcc43 gcc45 \
+    description {Use the gcc44 compiler (enables fortran linking)} {}
 
-    destroot.env-append CC="${prefix}/bin/gcc-mp-4.4" \
-                        CXX="${prefix}/bin/g++-mp-4.4"
-}
+    variant gcc45 conflicts gcc43 gcc44 \
+    description {Use the gcc45 compiler (enables fortran linking)} {}
 
-if {![variant_isset gcc43]} {
-    default_variants +gcc44
-}
+    if {![variant_isset gcc43] &&
+        ![variant_isset gcc44] &&
+        ![variant_isset gcc45]} {
+        default_variants +gcc44
+    }
+    if {[variant_isset gcc43]} {
+        set gcc_version "4.3"
+    }
+    if {[variant_isset gcc44]} {
+        set gcc_version "4.4"
+    }
+    if {[variant_isset gcc45]} {
+        set gcc_version "4.5"
+    }
 
-variant no_atlas description {Do not use the macports atlas libs} {
-    build.env-delete    ATLAS=${prefix}/lib \
-                        LAPACK=${prefix}/lib \
-                        BLAS=${prefix}/lib
+    if {${gcc_version} != ""} {
+        # when using non-Apple GCC for universal install, it can
+        # create binaries only for the native OS architecture, at
+        # either 32 or 64 bits.  Restrict the supported archs
+        # accordingly.
+        if {[variant_exists universal] && [variant_isset universal]} {
+            if { ${os.arch}=="i386" } {
+                set universal_archs_supported { i386 x86_64 }
+            } else {
+                set universal_archs_supported { ppc  ppc64 }
+            }
+        }
 
-    destroot.env-delete ATLAS=${prefix}/lib \
-                        LAPACK=${prefix}/lib \
-                        BLAS=${prefix}/lib
-    depends_lib-delete  port:atlas
+        # include all the correct GCC4X port
+        depends_lib-append port:gcc[join [split ${gcc_version} "."] ""]
+
+        # set environment variable that's recognized by the setup.py script
+        build.env-append   F90="${prefix}/bin/gfortran-mp-${gcc_version}"
+
+        # force LDFLAGS for correct linking of the linalg module
+        # for non-Apple GCC compilers
+        patchfiles-append  patch-numpy_linalg_setup.py.diff
+
+    } else {
+        # user specified -gcc4X but +atlas (either as default or
+        # explicitly); do not allow since it might lead to
+        # undetermined runtime execution.
+        return -code error \
+"\n\nWhen using the +atlas variant (either as the default or setting
+explicitly), one of the +gcc4X variants must be selected.\n"
+    }
 }
 
 variant universal {
     patchfiles-append   patch-setup.py.diff
 }
 
+post-patch {
+    reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" \
+        ${worksrcpath}/numpy/f2py/setup.py
+
+    # disallow searching for any fortran executable except what is
+    # specified in this Portfile; NOTE: this change only works when
+    # setting the F90 flag above; if this flag is not set (meaning no
+    # +gcc4X variant is set), then F2PY may or not work.
+    if {${gcc_version} != ""} {
+        # set which fortran to use in the f2py Python scripts
+        reinplace "/possible_executables/s|\\\[.*\\\]|\['gfortran-mp-${gcc_version}'\]|g" ${worksrcpath}/numpy/distutils/fcompiler/gnu.py
+    }
+}
+
 livecheck.type  regex
 livecheck.url   http://sourceforge.net/projects/numpy/files/
 livecheck.regex "files\/NumPy\/(\\d+(?:\\.\\d+)*)\/numpy"
