# -*- 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 111355 2013-09-19 07:29:32Z ryandesign@macports.org $

PortSystem          1.0

name                dmg2img
version             1.6.5
categories          sysutils
maintainers         puredarwin.org:probono openmaintainer
license             GPL-2
description         Converts Apple DMG files to standard HFS+ images
long_description    DMG2IMG is a tool to convert Apple's compressed dmg \
                    files to standard (hfsplus) disk images. It is derived \
                    from dmg2iso v0.2c by vu1tur.
homepage            http://vu1tur.eu.org/tools/
master_sites        ${homepage}
platforms           darwin

checksums           rmd160  437048d16e5887c79008f2023256dccd176b3192 \
                    sha256  400a16cbe5cb2bf8a9eec4a43ef3546e0329f248bbd2a79f6d9a1ebc0b503308

depends_lib         port:openssl \
                    port:zlib \
                    port:bzip2

patchfiles          patch-Makefile

use_configure       no

variant universal {}

build.env           CC=${configure.cc}
build.args          CFLAGS+="${configure.cflags} [get_canonical_archflags cc]" \
                    LDFLAGS+="${configure.ldflags} [get_canonical_archflags ld]"

destroot {
    xinstall -W ${worksrcpath} dmg2img vfdecrypt ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath} vfdecrypt.1 ${destroot}${prefix}/share/man/man1
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} README COPYING ${docdir}
}

livecheck.type      regex
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
