Portfile

# $Id: Portfile 20456 2006-11-03 15:10:31Z blair@macports.org $
PortSystem 1.0
name afni
version 2006.06.30.1332
revision 2
distfiles afni_src.tgz afni_doc.tgz afni.1 \
TTatlas+tlrc.BRIK.gz TTatlas+tlrc.HEAD CA_EZ_v1.3c-May0806.tgz \
openMotif-2.2.3.tar.gz
categories science
maintainers bacon@smithers.neuro.mcw.edu
description Analysis of Functional Neuro Images
long_description This is a port of AFNI, Advanced Functional Neuro Imaging. AFNI is a tool for analyzing 3 dimensional images, especially functional MRI images used in brain mapping research.
homepage http://afni.nimh.nih.gov/
master_sites http://www.neuro.mcw.edu/~bacon/Ports/distfiles/AFNI/${version}/
checksums afni_src.tgz md5 3b496d379b62c57e2d27a1554da5cf29 \
afni_doc.tgz md5 3b085de85fc46908652ae287d1cceb38 \
afni.1 md5 7678276880116dcab3324dbf43d0ebf6 \
TTatlas+tlrc.BRIK.gz md5 f5a107b049bc426af5342565f4e5beee \
TTatlas+tlrc.HEAD md5 a0ca787a2996d7e66548176808503ac5 \
CA_EZ_v1.3c-May0806.tgz md5 dbb2caab5c030c505b306e1526d19150 \
openMotif-2.2.3.tar.gz md5 94c96a0f94ee0d5e41d3dba2188b263d
extract.only afni_src.tgz afni_doc.tgz CA_EZ_v1.3c-May0806.tgz \
openMotif-2.2.3.tar.gz
use_configure no
depends_lib port:glib2 \
port:glib1
depends_run port:netpbm \
port:jpeg \
port:whirlgif
build.dir ${workpath}/afni_src
build.target vastness

platform powerpc {
post-patch {
cd ${workpath}/afni_src
file copy ${filespath}/Makefile.macosx_PowerPC_darwinports \
Makefile
reinplace "s|openMotif-2.2.3|${workpath}/openMotif-2.2.3|g" ${workpath}/afni_src/Makefile
}
}

platform i386 {
post-patch {
cd ${workpath}/afni_src
file copy ${filespath}/Makefile.macosx_Intel_darwinports \
Makefile
reinplace "s|openMotif-2.2.3|${workpath}/openMotif-2.2.3|g" ${workpath}/afni_src/Makefile
}
}

pre-build {
cd ${workpath}/openMotif-2.2.3
system "./configure --disable-shared --enable-static --disable-demos"
system "make"
}

destroot {
# First, separate files that were all dumped into macosx_bin by the Makefile
cd ${workpath}/afni_src
file mkdir macosx_lib
eval file rename [glob macosx_bin/*.a] macosx_lib
eval file rename [glob macosx_bin/*.so] macosx_lib
file mkdir macosx_include
eval file rename [glob macosx_bin/*.h] macosx_include
file mkdir macosx_share
eval file rename [glob macosx_bin/*.jpg] macosx_share
eval file rename [glob macosx_bin/*.txt] macosx_share

# Delete files that conflict with other ports
eval file delete macosx_bin/cjpeg macosx_bin/djpeg \
macosx_bin/whirlgif

# Install binaries and scripts
xinstall -d -m 755 ${destroot}${prefix}/bin
eval xinstall -m 755 [glob macosx_bin/*] ${destroot}${prefix}/bin
# Install libraries and plugins
xinstall -d -m 755 ${destroot}${prefix}/lib/afni
eval xinstall -m 644 [glob macosx_lib/*] ${destroot}${prefix}/lib/afni
# Install headers
xinstall -d -m 755 ${destroot}${prefix}/include/afni
eval xinstall -m 644 [glob macosx_include/*] ${destroot}${prefix}/include/afni

# Install miscellaneous files
xinstall -d -m 755 ${destroot}${prefix}/share/afni
eval xinstall -m 644 [glob macosx_share/*] ${destroot}${prefix}/share/afni
eval xinstall -m 644 [glob ${distpath}/TTatlas*] ${destroot}${prefix}/share/afni
cd ${workpath}
eval xinstall -m 644 [glob CA_EZ_v1.3c-May0806/*] ${destroot}${prefix}/share/afni

# Install docs
xinstall -d -m 755 ${destroot}${prefix}/share/doc/afni
eval xinstall -m 644 [glob afni_doc/*] ${destroot}${prefix}/share/doc/afni
xinstall -d -m 755 ${destroot}${prefix}/man/man1
eval xinstall -m 644 ${distpath}/afni.1 ${destroot}${prefix}/man/man1
reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/man/man1/afni.1
}

files