# $Id: Portfile,v 1.1 2005/08/01 06:22:56 ben Exp $

PortSystem       1.0
name             afni
version          20050731
categories       science
maintainers      ben@opendarwin.org
description      AFNI MRI data analysis
long_description AFNI is a set of C programs for processing, analyzing, \
                 and displaying functional MRI (FMRI) data - a technique \
                 for mapping human brain activity.
homepage         http://afni.nimh.nih.gov
platforms        darwin
master_sites     http://www.opendarwin.org/~ben/
distfiles        afni_src.tgz
checksums        md5 56dc5285e00fd64a2454ffd43c854a46
depends_lib      port:glib2 \
                 port:openmotif
set worksrcdir   afni_src

platform darwin 7 {
post-patch      {
                cd ${worksrcpath}
                file copy Makefile.macosx_10.3_darwinports Makefile
                reinplace "s|./macosx_10.3_darwinports|./macosx_bin|g" Makefile
}
}

platform darwin 8 {
post-patch      {
                cd ${worksrcpath}
                file copy Makefile.macosx_10.4 Makefile
                reinplace "s|/sw/|${prefix}/|g" Makefile
                reinplace "s|./macosx_10.4|./macosx_bin|g" Makefile
}
}

use_configure   no

build.target    all install

destroot {
                cd ${worksrcpath}
                file mkdir macosx_lib
                eval file rename [glob macosx_bin/*.a] macosx_lib
                xinstall -d -m 755 ${destroot}${prefix}/bin/afni
                eval xinstall -m 755 [glob macosx_bin/*] ${destroot}${prefix}/bin/afni
                eval xinstall -m 644 [glob macosx_lib/*] ${destroot}${prefix}/lib
                xinstall -d -m 755 ${destroot}${prefix}/share/doc/afni
                eval xinstall -m 444 [glob README.*] ${destroot}${prefix}/share/doc/afni
}
