Index: Portfile
===================================================================
--- Portfile	(revision 36111)
+++ Portfile	(working copy)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
 # $Id$
 
 PortSystem 1.0
@@ -2,84 +3,81 @@
 
-name			openmpi
-version			1.2.6
-categories		science parallel net
-platforms		darwin
-maintainers		mww
-description		A High Performance Message Passing Library
-long_description	Open MPI is a project combining technologies and resources \
-			from several other projects (FT-MPI, LA-MPI, LAM/MPI, and \
-			PACX-MPI) in order to build the best MPI library available. A \
-			completely new MPI-2 compliant implementation, Open MPI offers \
-			advantages for system and software vendors, application developers \
-			and computer science researchers.
+name            openmpi
+version         1.2.6
+categories      science parallel net
+platforms       darwin
+maintainers     mww
+description     A High Performance Message Passing Library
+long_description Open MPI is a project combining technologies and resources \
+                from several other projects (FT-MPI, LA-MPI, LAM/MPI, and \
+                PACX-MPI) in order to build the best MPI library available. A \
+                completely new MPI-2 compliant implementation, Open MPI offers \
+                advantages for system and software vendors, application developers \
+                and computer science researchers.
 
-homepage		http://www.open-mpi.org/
-set subdir		ompi/v1.2/downloads/
-master_sites		http://www.open-mpi.org/software/${subdir} \
-			http://www.open-mpi.de/software/${subdir} \
-			http://icl.cs.utk.edu/open-mpi/${subdir} \
-			freebsd
-checksums		md5 f126793b68e71f5ec4a192c40675af2d \
-			sha1 b2960e2fd7432816cb70302a6b6c2f55fbd62cab
-use_bzip2		yes
+homepage        http://www.open-mpi.org/
+set subdir      ompi/v1.2/downloads/
+master_sites    http://www.open-mpi.org/software/${subdir} \
+                http://www.open-mpi.de/software/${subdir} \
+                http://icl.cs.utk.edu/open-mpi/${subdir} \
+                freebsd
+checksums       md5 f126793b68e71f5ec4a192c40675af2d \
+                sha1 b2960e2fd7432816cb70302a6b6c2f55fbd62cab
+use_bzip2       yes
 
 pre-extract { file mkdir ${workpath}/build }
 
-configure.dir	${workpath}/build
-configure.cmd	${worksrcpath}/configure
-configure.args	--disable-f77 --disable-f90 \
-		--with-xgrid \
-		--sysconfdir=${prefix}/etc/${name} \
-		--includedir=${prefix}/include/${name} \
-		--bindir=${prefix}/lib/${name}/bin \
-		--mandir=${prefix}/share/man
+configure.dir   ${workpath}/build
+configure.cmd   ${worksrcpath}/configure
+configure.args  --disable-f77 --disable-f90 \
+                --with-xgrid \
+                --sysconfdir=${prefix}/etc/${name} \
+                --includedir=${prefix}/include/${name} \
+                --bindir=${prefix}/lib/${name}/bin \
+                --mandir=${prefix}/share/man
 
-build.dir	${configure.dir}
+build.dir       ${configure.dir}
 
-destroot.dir	${build.dir}
-set wrappers	{mpicc mpicxx mpic++}
+destroot.dir    ${build.dir}
+set wrappers    {mpicc mpicxx mpic++}
 post-destroot {
-	foreach bin {mpirun mpiexec} {
-		system "cd ${destroot}${prefix}/bin \
-			&& ln -sf ${prefix}/lib/${name}/bin/orterun open${bin}"
-	}
-	foreach bin ${wrappers} {
-		system "cd ${destroot}${prefix}/bin \
-			&& ln -sf ${prefix}/lib/${name}/bin/opal_wrapper open${bin}"
-		system "cd ${destroot}${prefix}/share/${name} \
-		&& ln -sf ${prefix}/share/${name}/${bin}-wrapper-data.txt \
-			open${bin}-wrapper-data.txt"
-	}
+    foreach bin {mpirun mpiexec} {
+        system "cd ${destroot}${prefix}/bin \
+            && ln -sf ${prefix}/lib/${name}/bin/orterun open${bin}"
+    }
+    foreach bin ${wrappers} {
+        system "cd ${destroot}${prefix}/bin \
+            && ln -sf ${prefix}/lib/${name}/bin/opal_wrapper open${bin}"
+        system "cd ${destroot}${prefix}/share/${name} \
+            && ln -sf ${prefix}/share/${name}/${bin}-wrapper-data.txt \
+            open${bin}-wrapper-data.txt"
+    }
 }
 
-variant gcc42 description {build mpif77 and mpif90 using gcc42} conflicts gcc43 g95 {
-	configure.args-delete --disable-f77 --disable-f90
-	configure.args-append --enable-f77 --enable-f90
-	configure.f77	      ${prefix}/bin/gfortran-mp-4.2
-	configure.fc	      ${prefix}/bin/gfortran-mp-4.2
-	depends_lib-append    port:gcc42
-	lappend wrappers mpif77 mpif90
+variant fortran description {build mpif77 and mpif90} conflicts gcc42 g95 {
+    if { ![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset g95] } {
+        default_variants        +gcc43
+    }
+    configure.args-delete --disable-f77 --disable-f90
+    configure.args-append --enable-f77 --enable-f90
+    lappend wrappers mpif77 mpif90
 }
 
-variant gcc43 description {build mpif77 and mpif90 using gcc43} conflicts gcc42 g95 {
-	configure.args-delete --disable-f77 --disable-f90
-	configure.args-append --enable-f77 --enable-f90
-	configure.f77	      ${prefix}/bin/gfortran-mp-4.3
-	configure.fc	      ${prefix}/bin/gfortran-mp-4.3
-	depends_lib-append    port:gcc43
-	lappend wrappers mpif77 mpif90
+variant gcc42 conflicts gcc43 g95 description {Use gcc42 for compilation of OpenMPI and as base-compiler for wrappers} {
+    depends_lib-append    port:gcc42
+    configure.compiler    macports-gcc-4.2
 }
 
-variant g95 description {build mpif77 and mpif90 using g95} conflicts gcc42 gcc43 {
-	configure.args-delete --disable-f77 --disable-f90
-	configure.args-append --enable-f77 --enable-f90
-	configure.f77	      ${prefix}/bin/g95
-	configure.fc	      ${prefix}/bin/g95
-	depends_lib-append    port:g95
-	lappend wrappers mpif77 mpif90
+variant gcc43 conflicts gcc42 g95 description {Use gcc43 for compilation of OpenMPI and as base-compiler for wrappers} {
+    depends_lib-append    port:gcc43
+    configure.compiler    macports-gcc-4.3
 }
 
-livecheck.check	regex
-livecheck.url	http://www.open-mpi.org/software/
-livecheck.regex	openmpi-(\[0-9\.\]+).tar.bz2
+variant g95 conflicts gcc42 gcc43 description {Use g95 to build fortran variant} {
+    depends_lib-append    port:g95
+    configure.f77         ${prefix}/bin/g95
+    configure.fc          ${prefix}/bin/g95
+}
 
+livecheck.check regex
+livecheck.url   http://www.open-mpi.org/software/
+livecheck.regex openmpi-(\[0-9\.\]+).tar.bz2
