# -*- 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 75217 2011-01-18 08:53:40Z ryandesign@macports.org $

PortSystem                  1.0

name                        Drizzle
version                     29
categories                  devel
platforms                   darwin
maintainers                 ryandesign
license                     GPL-3+
supported_archs             noarch

description                 tools related to the Myst game franchise

long_description            ${name} is a collection of ${description}. \
                            Most notably, it can transform MOUL / Myst 5 / \
                            Crowthistle datafiles into POTS datafiles. \
                            It also allows you to download and install all \
                            the fan-created ages.

homepage                    http://dusty.homeunix.net/wiki/Drizzle
master_sites                sourceforge:drizzle
distname                    ${name}${version}
extract.suffix              .jar
extract.only

checksums                   sha1    e7416af2fa987b75323865bf680849fa98913b88 \
                            rmd160  2eca2f13d89daa00b1983e907530bd639835b65d

extract.mkdir               yes

post-extract {
    copy ${distpath}/${distfiles} ${worksrcpath}
    copy ${filespath}/drizzle.in ${worksrcpath}/drizzle
    copy ${filespath}/drizzleapp.in ${worksrcpath}/drizzleapp
}

use_configure               no

build {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/drizzle ${worksrcpath}/drizzleapp
}

destroot {
    set javadir ${destroot}${prefix}/share/java/
    xinstall -d ${javadir}
    xinstall ${worksrcpath}/${distfiles} ${javadir}drizzle.jar
    
    xinstall ${worksrcpath}/drizzle ${destroot}${prefix}/bin/
    
    set appdir ${destroot}${applications_dir}/${name}.app/Contents/MacOS
    xinstall -d ${appdir}
    xinstall ${worksrcpath}/drizzleapp ${appdir}/${name}
}

livecheck.type              regex
livecheck.url               http://sourceforge.net/projects/drizzle/files/
livecheck.regex             /${name}(\[0-9.\]+)${extract.suffix}
