# -*- 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 61028 2009-11-30 07:42:11Z jmr@macports.org $

PortSystem          1.0
PortGroup           python26 1.0

name                relax
version             1.3.4
categories          science python
maintainers         bromo.med.uc.edu:howarth
description         Protein dynamics by NMR relax. data analysis
long_description    The program relax is designed for the study of the \
                    dynamics of proteins or other macromolecules though the \
                    analysis of NMR relaxation data.
homepage            http://www.nmr-relax.com/
platforms           darwin
master_sites        http://download.gna.org/relax/
distfiles           ${name}-${version}.src.tar.bz2
dist_subdir         ${name}
checksums           md5     421d92a998bfd359678d689e2f65fc62 \
                    sha1    fb5a7b1533b10d358c141cfbf0a267deb502affb \
                    rmd160  2ba248402c3e0e0efaf00ac61696965ff316a0d0
use_bzip2           yes
depends_lib         port:scons port:py26-minfx port:py26-scientific
patchfiles          relax.patch sample.patch
post-patch {
    reinplace  "s|@DEST_ROOT@|${destroot}|g" ${worksrcpath}/scons/install.py \
                                             ${worksrcpath}/sconstruct
    reinplace  "s|@PREFIX@|${prefix}|g" ${worksrcpath}/scons/install.py \
                                        ${worksrcpath}/sconstruct \
                                        ${worksrcpath}/relax
}
build.cmd           ${prefix}/bin/scons
build.target
destroot.cmd        ${build.cmd}
destroot.destdir    DESTDIR=${destroot}
post-destroot {
    reinplace  "s|${destroot}${prefix}|${prefix}|g" ${destroot}${prefix}/lib/relax/sconstruct
    ln -sf ${prefix}/lib/relax/relax ${destroot}${prefix}/bin/relax
    file delete -force ${destroot}${prefix}/lib/relax/version.pyc
    eval file delete -force [glob -directory ${destroot}${prefix}/lib/relax/scons/ *.pyc]
    system "${python.bin} -O ${python.libdir}/compileall.py -d ${prefix}/lib/relax ${destroot}${prefix}/lib/relax"
}
