# $Id: Portfile 139093 2015-08-01 15:17:24Z khindenburg@macports.org $

PortSystem      1.0

name            ecm
version         1.0
categories      archivers
platforms       darwin
maintainers     nomaintainer
license         GPL-2+
description     CD image file error code modeler

long_description \
    ECM (Error Code Modeler) lets you prepare CD image files - \
    such as BIN, CDI, NRG, CCD, or similar - so that they'll compress \
    far better.

homepage        https://web.archive.org/web/20130502135203/http://www.neillcorlett.com/ecm/
master_sites    http://www.neillcorlett.com/downloads/
distname        ecm100
use_zip         yes

checksums       md5 debcc0772cea7e8b1ae2562a38788fb6 \
                sha1 ec8884b547bebee69fa3d2901dbd076f9a84c2ce \
                rmd160 04110dd50d7609e0337e71ab7587fb3d0d05eefb

extract.dir     ${worksrcpath}

pre-extract {
    file mkdir ${worksrcpath}
}

use_configure   no

build {
    foreach bin {ecm unecm} {
        system "cd ${worksrcpath} && \
            ${configure.cc} ${configure.cflags} [get_canonical_archflags] ${bin}.c -o ${bin}"
    }
}

destroot {
    xinstall -W ${worksrcpath} ecm unecm ${destroot}${prefix}/bin

    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    eval xinstall -m 0644 [glob ${worksrcpath}/*.txt] ${destroot}${docdir}
}

variant universal {}

livecheck.type  none
