# -*- 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 73769 2010-11-24 23:05:23Z ryandesign@macports.org $

PortSystem      1.0

name            dineroIV
version         7
categories      science
maintainers     and.damore openmaintainer
platforms       darwin
description     cache simulator for memory reference traces
long_description \
                "Dinero IV is a cache simulator for memory reference traces. It \
                includes the following major changes over Dinero III: \
                subroutine-callable interface in addition to trace-reading \
                program; \
                simulation of multi-level caches; \
                simulation of dissimilar I and D caches; \
                better performance, especially for highly associative caches; \
                classification of compulsory, capacity, and conflict misses; \
                support for multiple input formats; \
                cleaned up and modernized code, improved portability."

homepage        http://pages.cs.wisc.edu/~markhill/DineroIV/
master_sites    ftp://ftp.cs.wisc.edu/markhill/DineroIV

distname        d4-${version}

checksums           md5     69284e64ff7b4040fb898d93401606a8 \
                    sha1    5d332f2b9f8251cd6ed6b4966e640f7001f99354 \
                    rmd160  8b78d08e274cf0da7c434d53f87e0c0fe21589cb

patchfiles      patch-misc_c.diff

post-build      {
    system "cd ${worksrcpath}/testing && ${build.cmd} ${build.pre_args} ${build.target}"
}

destroot {
    xinstall -m 755 ${worksrcpath}/dineroIV ${destroot}${prefix}/bin

    #destrooting docs    
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    eval xinstall -m 644 [glob \
            ${worksrcpath}/CHANGES \
            ${worksrcpath}/NOTES \
            ${worksrcpath}/COPYRIGHT \
            ${worksrcpath}/README \
            ${worksrcpath}/TODO \
        ] ${destroot}${prefix}/share/doc/${name}

    #destrooting examples from /testing
    xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name}
    #binaries
    eval xinstall -m 755 [glob \
        ${worksrcpath}/testing/p2? \
        ${worksrcpath}/testing/testscript] ${destroot}${prefix}/share/examples/${name}
    #readonly files
    eval xinstall -m 644 [glob \
            ${worksrcpath}/testing/README \
            ${worksrcpath}/testing/p2.* \
            ${worksrcpath}/testing/test-* \
            ${worksrcpath}/testing/mm.* \
        ] ${destroot}${prefix}/share/examples/${name}
}
