--- Portfile.orig	2009-10-09 23:30:39.000000000 -0400
+++ Portfile	2011-02-13 18:29:23.000000000 -0500
@@ -1,11 +1,11 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# $Id: Portfile 59128 2009-10-10 03:15:21Z macsforever2000@macports.org $
+# $Id$
 
 PortSystem              1.0
 
 name                    arb
-version                 5.1
 epoch                   1
+version                 5.2
 categories              science
 maintainers             me.com:matt.cottrell 
 platforms               darwin
@@ -18,77 +18,98 @@
                         nucleotide and amino acid sequences.  Features include routines for designing fluorescence in situ \
                         hybridization (FISH) probes and PCR and sequencing primers.  Phylogenetic trees can be generated and \
                         sequences can be added to existing trees.  ARB maintains links between the phylogenetic trees and sequences \
-                        for data base search and query.  The Silva Comprehensive Ribosomal RNA Database (http://www.arb-silva.de/) \
-                        maintaines up-to-date databases.  64-bit ARB is built on 10.6 in order to work with the largest data bases. \
-                        32-bit ARB is built on 10.5.  An active community of scientists exchange tips on the ARB Yahoo! discussion group \
+                        for database search and query.  The Silva Comprehensive Ribosomal RNA Database (http://www.arb-silva.de/) \
+                        maintains up-to-date databases.  An active community of scientists exchanges tips on the ARB Yahoo! discussion group \
                         (http://tech.groups.yahoo.com/group/arb_users/). Citation: Wolfgang Ludwig, et al. (2004) ARB: a software environment \
                         for sequence data. Nucleic Acids Research. 32:1363-1371.
 
-fetch.type              svn
-svn.url                 http://svn.mikro.biologie.tu-muenchen.de/svn/branches/stable_5.0
-svn.revision            6215
-svn.method              checkout
-#fetch.user             coder              
-#fetch.password         gimmeARBsource
-#work around until ticket #21232 is resolved
-svn.args                --username coder --password gimmeARBsource 
+master_sites            http://download.arb-home.de/release/arb_${version}/
+distname                arbsrc
+extract.suffix          .tgz
+dist_subdir             ${name}/${version}
+worksrcdir              arbsrc_6779
+
+checksums               sha1    4ee493a16ece5231d46ed1071407c06e733d67c8 \
+                        rmd160  d9d99d0ebadaa293091ff93f6ca588b2321bd8b0
+
+depends_build           port:gsed \
+                        port:imake \
+                        port:makedepend
 
 depends_lib             port:openmotif \
                         port:lynx \
-                        port:gsed \
-                        port:imake \
                         port:sablotron \
                         port:mesa \
                         port:glw \
                         port:glew \
-                        port:tiff 
+                        port:tiff \
+                        port:xfig \
+                        port:gv
 
 patchfiles              patch-ARB-config.makefile.diff \
                         patch-ARB-makefile.diff \
                         patch-ARB-RNA3D_GlobalHeader.hxx.diff \
-                        patch-ARB-DARWIN.pl.diff
+                        patch-ARB-DARWIN.pl.diff \
+                        arb_intro.fig.diff \
+                        patch-ARB-glpng.diff
+                       
                        
-worksrcdir              stable_5.0
+platform darwin       {
+                       if {${build_arch} == "ppc" || ${build_arch} == "i386" } {
+                           set is64bit 0
+                           if {${os.platform} == "darwin" && ${os.major} >= 9} {
+                              if {[sysctl hw.cpu64bit_capable] == 1} {
+                                  ui_msg "64-bit capable hardware: Building 32-bit ARB.  Check the setting of build_arch in ${prefix}/etc/macports/macports.conf"
+                               } else {
+                                  ui_msg "not 64-bit capable hardware: Building 32-bit ARB."
+                               }
+                            } else {
+                               ui_msg "unable to determine 64-bit hardware capability: Building 32-bit ARB."
+                            }
+                       } else {
+                          set is64bit 1
+                          ui_msg "64-bit capable hardware: Building 64-bit ARB."
+                       }
+}
+
+configure              {
 
-use_configure           no
-configure.env           ARBHOME=${worksrcpath}  
-configure.env-append    PATH=${worksrcpath}/bin:$env(PATH)
-
-configure               {
-                        reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/PERL2ARB/DARWIN.PL
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/GDEHELP/MENUS/align.menu
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/util/arb_check_build_env.pl
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/arb_install.sh
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/WINDOW/AW_status.cxx
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/SH/example_batch_probe_match.sh
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/GDEHELP/GDEmenus
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/GDEHELP/genhelp.sh
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/GDEHELP/genhelptree.sh
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/SOURCE_TOOLS/make_java_dependencies.sh
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/HELP_SOURCE/Makefile
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/AISC_COM/AISC/Makefile
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/GDEHELP/Makefile
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/HELP_SOURCE/genhelp/Makefile
-                        reinplace "s| sed | gsed |g" ${worksrcpath}/GDEHELP/Makefile.helpfiles
+                        reinplace "s| sed | gsed |g" ${worksrcpath}/GDEHELP/MENUS/align.menu \
+                                                     ${worksrcpath}/util/arb_check_build_env.pl \
+                                                     ${worksrcpath}/arb_install.sh \
+                                                     ${worksrcpath}/WINDOW/AW_status.cxx \
+                                                     ${worksrcpath}/SH/example_batch_probe_match.sh \
+                                                     ${worksrcpath}/GDEHELP/GDEmenus \
+                                                     ${worksrcpath}/GDEHELP/genhelp.sh \
+                                                     ${worksrcpath}/GDEHELP/genhelptree.sh \
+                                                     ${worksrcpath}/SOURCE_TOOLS/make_java_dependencies.sh \
+                                                     ${worksrcpath}/HELP_SOURCE/Makefile \
+                                                     ${worksrcpath}/AISC_COM/AISC/Makefile \
+                                                     ${worksrcpath}/GDEHELP/Makefile \
+                                                     ${worksrcpath}/HELP_SOURCE/genhelp/Makefile \
+                                                     ${worksrcpath}/GDEHELP/Makefile.helpfiles
                         file copy ${worksrcpath}/config.makefile.template ${worksrcpath}/config.makefile
-                        reinplace "s|@@PREFIX@@|${prefix}|g" ${filespath}/arb_macsetup
                         file copy ${filespath}/arb_macsetup ${worksrcpath}/bin
-}
+                        reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/PERL2ARB/DARWIN.PL \
+                                                             ${worksrcpath}/bin/arb_macsetup
 
-platform darwin 9      {
-post-configure         {
-                       reinplace "s|ARB_64 := 1# compile 64bit ARB version|ARB_64 := 0# compile 64bit ARB version|g" ${worksrcpath}/config.makefile
-}
+                        reinplace "s|OSX_SDK:=/Developer/SDKs/MacOSX10.5.sdk|OSX_SDK:=${configure.sdkroot}|g" ${worksrcpath}/Makefile
+
+                        reinplace "s|@@64BIT@@|${is64bit}|g" ${worksrcpath}/config.makefile
 }
 
-build.env-append        ${configure.env}
-build.env-append        PREFIX=${prefix}
+build.env-append        PREFIX=${prefix} \
+                        ARBHOME=${worksrcpath} \
+                        PATH=${worksrcpath}/bin:$env(PATH)
+                        
+build.args              GCC=${configure.cc} \
+                        GPP=${configure.cxx} \
+                        CPPreal=${configure.cpp}
 
 destroot.keepdirs       ${destroot}${prefix}/share/arb/lib/pts
 
 destroot                {
                         eval xinstall -m 0755 [glob ${worksrcpath}/bin/*] ${destroot}${prefix}/bin
-                        file mkdir ${destroot}${prefix}/share/arb
                         file mkdir ${destroot}${prefix}/share/arb/bin
                         file copy ${worksrcpath}/lib ${destroot}${prefix}/share/arb/lib
                         file copy ${worksrcpath}/GDEHELP ${destroot}${prefix}/share/arb/GDEHELP
@@ -97,33 +118,30 @@
                         file copy ${worksrcpath}/PERL_SCRIPTS ${destroot}${prefix}/share/arb/PERL_SCRIPTS
                         file copy ${worksrcpath}/SH ${destroot}${prefix}/share/arb/SH
                         file copy ${worksrcpath}/demo.arb ${destroot}${prefix}/share/arb
-}
-
-post-destroot           {
                         system "chmod a+w ${destroot}${prefix}/share/arb/lib/arb_tcp.dat"
                         system "chmod a+w ${destroot}${prefix}/share/arb/lib/pts"
                         system "chmod a+w ${destroot}${prefix}/share/arb/lib/macros"
-                        system "ln -s ${prefix}/bin/arb_pt_server ${destroot}${prefix}/share/arb/bin/arb_pt_server"
-                        system "ln -s ${prefix}/bin/arb_name_server ${destroot}${prefix}/share/arb/bin/arb_name_server"
+                        ln -s ${prefix}/bin/arb_pt_server ${destroot}${prefix}/share/arb/bin/arb_pt_server
+                        ln -s ${prefix}/bin/arb_name_server ${destroot}${prefix}/share/arb/bin/arb_name_server
+                        system "rm -rf `find ${destroot}${prefix}/share/arb -type d -name .svn`"
 }
-                        
-post-activate           {
-                        system "rm -rf `find ${prefix}/share/arb -type d -name .svn`"
 
-ui_msg "
+universal_variant       no
+
+notes "
 ****************************************************************
 Before running ARB you must set ARBHOME and add ARB to your PATH
 ****************************************************************
 
 You have two options (A is easier, B is more difficult):
 
-A) Open a new terminal window and type arb_macsetup to set up your environment automatically
+A) Easy - open a new terminal window and type arb_macsetup to set the necessary environment variables automatically.  This script also enables keyboard shortcuts used in the sequence editor.
 
 or
 	
-B) Follow the steps below:
+B) More difficult - follow the steps below:
 
-1a)
+1)
 bash users add the following lines to your ~/.profile or to your ~/.bashrc
 
       ARBHOME=${prefix}/share/arb;export ARBHOME
@@ -132,18 +150,31 @@
 
       enter the following command:
       . ~/.profile
-1b)
+2)
 tcsh users add the following lines to your ~/.cshrc
       setenv ARBHOME ${prefix}/share/arb
       setenv PATH ${prefix}/share/arb\:\$PATH
 
       enter the following command:
       source ~/.cshrc
-2)
+3)
+create a text file in your home folder called .xmodmap that contains the text below:
+
+clear Mod1
+clear Mod2
+keycode 63 = Mode_switch
+keycode 66 = Meta_L
+keycode 69 = Meta_R
+add Mod1 = Meta_L Meta_R
+add Mod2 = Mode_switch
+
+C)
+to set up ARB for another user on this computer log into their account and type ${prefix}/bin/arb_macsetup
+
+D)
 type arb to start ARB
 
 A demo data base is located at ${prefix}/share/arb.demo.arb
 
 Please cite: Wolfgang Ludwig, et al. (2004) ARB: a software environment for sequence data. Nucleic Acids Research. 32:1363-1371
 "
-}
\ No newline at end of file
