# -*- 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 63877 2010-02-17 18:29:25Z ryandesign@macports.org $

PortSystem          1.0

name                pynmr
version             0.37f
categories          science
maintainers         bromo.med.uc.edu:howarth

description         NMR plugin for pymol

long_description    PyNMR features loading multiple pdb files, dihedral restraints checks, \
                    NOE restraints checks, and superimposition. PyNMR was written by Leigh Willard.

homepage            http://pelican.rsvs.ulaval.ca/mediawiki/index.php/PyNMR
platforms           darwin
master_sites        http://diablo.ucsc.edu/~wgscott/pymol/
distname            ${name}_${version}_src

checksums           md5  cb4a3906766681ce9230ef5515e1aa1c \
                    sha1 21aa455421ac4742c62ede878c2e42e22f9eca51 \
                    rmd160 53f40a547a5ef0a9c0725491c988b3e8bcb8706c

patchfiles          pynmr.diff

depends_build       port:swig-python
depends_lib         port:meschach port:pymol

use_configure       no
use_parallel_build  no
use_bzip2           yes

build.dir           ${worksrcpath}/pmg_tk/startup/pynmr
build.cmd           ./run.macos
build.target

post-patch {
    reinplace  "s|@PREFIX@|${prefix}|g" ${build.dir}/run.macos \
                                        ${build.dir}/test_data/test.script
}

destroot {
    xinstall -d ${destroot}${prefix}/lib/pymol/modules/pmg_tk/startup/pynmr
    xinstall -m 644 ${worksrcpath}/pmg_tk/startup/plug_nmr.py ${destroot}${prefix}/lib/pymol/modules/pmg_tk/startup
    xinstall -m 644 -W ${build.dir} Crmsd.so BIOPYTHON_LICENSE LICENSE README ${destroot}${prefix}/lib/pymol/modules/pmg_tk/startup/pynmr
    foreach d {help images test_data} {
       copy ${build.dir}/${d} ${destroot}${prefix}/lib/pymol/modules/pmg_tk/startup/pynmr
    }
    eval xinstall -m 644 [glob ${build.dir}/*.py] ${destroot}${prefix}/lib/pymol/modules/pmg_tk/startup/pynmr
}
