# -*- 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 88757 2012-01-10 20:32:08Z easieste@macports.org $

PortSystem 1.0

name			    abcl
version			    1.0.1
revision            0
categories		    lang java
maintainers		    easieste
description		    A Common Lisp implementation that runs on the JVM
long_description	\
    Armed Bear Common Lisp is conforming, contemporary \
    implementation of ANSI Common Lisp running on the Java \
    Virtual Machine.  Containing both an interpreted mode and a \
    compiler that produces JVM bytecode, it features extensions \
    that faciliate the use of Java from Lisp enabling the rapid \
    integration of arbitrary Java libraries into Common Lisp \
    code.  ABCL fully supports the JSR-233 (Java scripting API), \
    so it can be a utilized as a scripting engine in any Java \
    application.
    
homepage            http://common-lisp.net/project/armedbear 
platforms           darwin
master_sites        googlecode:abcl-dynamic-install
distname            abcl-src-${version}
checksums           md5     0744835442e15683da0ba273fda3dbaa \
                    sha1    476a3d93f8be9e58cacae650230248edb44190e5 \
                    rmd160  6927789abdb2ceb77e41427c717ba637160bcac6

depends_build       port:apache-ant

use_configure       no

build.cmd           ant
build.target        abcl.wrapper

#patchfiles           abcl-contrib.patch

post-build {
    reinplace "s|${worksrcpath}/dist/abcl.jar|${prefix}/share/java/abcl/abcl.jar|g" \
        ${worksrcpath}/abcl
}

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/java/abcl  
    xinstall -m 644 \
        ${worksrcpath}/dist/abcl.jar \
        ${destroot}${prefix}/share/java/abcl
    xinstall -m 644 \
        ${worksrcpath}/dist/abcl-contrib.jar \
        ${destroot}${prefix}/share/java/abcl
    xinstall -m 755 \
        ${worksrcpath}/abcl \
        ${destroot}${prefix}/share/java/abcl
	system "ln -fs ${prefix}/share/java/abcl/abcl \
		${destroot}${prefix}/bin/abcl"
}
