Ticket #28276: Portfile.5.diff

File Portfile.5.diff, 4.1 KB (added by matt.cottrell@…, 14 years ago)

Don't clobber the config file -> post-activate

  • Portfile

    old new  
    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
    2 # $Id$
     2# $Id: Portfile 76365 2011-02-21 04:47:56Z ryandesign@macports.org $
    33
    44PortSystem              1.0
    55
     
    9393                        GPP=${configure.cxx} \
    9494                        CPPreal=${configure.cpp}
    9595
    96 destroot.keepdirs       ${destroot}${prefix}/share/arb/lib/pts
     96pre-destroot            {
     97                        # Give the default settings a recognizable name ending in .default
     98                        file rename ${worksrcpath}/lib/arb_tcp.dat ${worksrcpath}/lib/arb_tcp.dat.default
     99                        file rename ${worksrcpath}/lib/macros ${worksrcpath}/lib/macros.default
     100}
    97101
    98102destroot                {
    99103                        eval xinstall -m 0755 [glob ${worksrcpath}/bin/*] ${destroot}${prefix}/bin
     
    105109                        file copy ${worksrcpath}/PERL_SCRIPTS ${destroot}${prefix}/share/arb/PERL_SCRIPTS
    106110                        file copy ${worksrcpath}/SH ${destroot}${prefix}/share/arb/SH
    107111                        file copy ${worksrcpath}/demo.arb ${destroot}${prefix}/share/arb
    108                         file attributes ${destroot}${prefix}/share/arb/lib/arb_tcp.dat -permissions a+w
    109                         file attributes ${destroot}${prefix}/share/arb/lib/pts -permissions a+w
    110                         file attributes ${destroot}${prefix}/share/arb/lib/macros -permissions a+w
    111112                        ln -s ${prefix}/bin/arb_pt_server ${destroot}${prefix}/share/arb/bin/arb_pt_server
    112113                        ln -s ${prefix}/bin/arb_name_server ${destroot}${prefix}/share/arb/bin/arb_name_server
    113114}
     
    117118
    118119post-activate           {
    119120                        system "rm -rf `find ${prefix}/share/arb -type d -name .svn`"
     121                       
     122                        # Presere the user's pt_server config file and macros; otherwise set default values
     123                        foreach f { arb_tcp.dat macros } {
     124                            if {![file exists ${prefix}/share/arb/lib/${f}]} {
     125                                  file copy ${worksrcpath}/lib/${f}.default \
     126                                       ${prefix}/share/arb/lib/${f}
     127                                  file attributes ${prefix}/share/arb/lib/${f} -permissions a+w
     128                            }
     129                        }
     130                       
     131                        # Preserve the directory where the user's pt_servers are saved; otherwise create it
     132                         foreach f { pts } {
     133                            if {![file exists ${prefix}/share/arb/lib/${f}]} {
     134                                  file mkdir ${prefix}/share/arb/lib/${f}
     135                                  file attributes ${prefix}/share/arb/lib/${f} -permissions a+w
     136                            }
     137                        }
    120138}
    121139
    122140notes "
     
    132150       
    133151B) Follow the steps below:
    134152
    135 1a)
     1531)
    136154bash users add the following lines to your ~/.profile or to your ~/.bashrc
    137155
    138156      ARBHOME=${prefix}/share/arb;export ARBHOME
     
    141159
    142160      enter the following command:
    143161      . ~/.profile
    144 1b)
     1622)
    145163tcsh users add the following lines to your ~/.cshrc
     164     
    146165      setenv ARBHOME ${prefix}/share/arb
    147166      setenv PATH ${prefix}/share/arb\:\$PATH
    148167
    149168      enter the following command:
    150169      source ~/.cshrc
    151 2)
     170C)
    152171type arb to start ARB
    153172
    154173A demo data base is located at ${prefix}/share/arb/demo.arb
    155174
     175************************************************************************
     176User generated macros, arb_tcp.dat and pt_servers have been preserved,
     177but you should keep backups of these just in case.  They are located at:
     178
     179${prefix}/share/arb/lib/macros/
     180${prefix}/share/arb/lib/arb_tcp.dat
     181${prefix}/share/arb/lib/pts/
     182
     183Default settings are maintained at:
     184
     185${prefix}/share/arb/lib/macros.default/
     186${prefix}/share/arb/lib/arb_tcp.dat.default
     187
    156188Please cite: Wolfgang Ludwig, et al. (2004) ARB: a software environment for sequence data. Nucleic Acids Research. 32:1363-1371
    157189"