# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem	1.0
name		sisc
version		1.16.6
categories	lang java scheme
platforms	darwin
maintainers	gmail.com:mvitocruz
description	Second Interpreter of Scheme Code
long_description	SISC is a Java based interpreter of Scheme.
homepage	http://sisc.sourceforge.net/
master_sites	sourceforge
distfiles	${name}-${version}.jar
checksums	md5 dda7b8bc5d998f1c37ef221c15ed0836 \
		sha1 3301ede761cbb8841f457c50ea5ffccf02014777
worksrcdir	${name}
use_zip		yes
use_configure	no
depends_build	bin:ant:apache-ant path:${prefix}/share/xsl:docbook-xsl
pre-build	{
	reinplace "s|/usr/share/xml/docbook/stylesheet/nwalsh/html|${prefix}/share/xsl/docbook-xsl/html|" ${worksrcpath}/build.xml
}
build.cmd	ant
build.target	full-dist
destroot	{
	set siscdir ${worksrcpath}/dist/full/sisc-${version}
	xinstall -m 755 ${siscdir}/sisc ${destroot}${prefix}/bin/sisc
	reinplace "s|/usr/lib/sisc|\"${prefix}/share/java/sisc\"|" \
		${destroot}${prefix}/bin/sisc

	xinstall -m 755 ${siscdir}/install-srfi22.sh \
		${destroot}${prefix}/bin/install-srfi22.sh
	reinplace "s|/usr/local/bin|${prefix}/bin|" \
		${destroot}${prefix}/bin/install-srfi22.sh
	reinplace "s|scheme-src|${prefix}/share/java/sisc/scheme-src|" \
		${destroot}${prefix}/bin/install-srfi22.sh

	set javadir ${destroot}${prefix}/share/java/sisc
	xinstall -d ${javadir}
	file copy ${siscdir}/scheme-src ${javadir}
	file copy ${siscdir}/sisc-lib.jar ${javadir}
	file copy ${siscdir}/sisc-opt.jar ${javadir}
	file copy ${siscdir}/sisc.jar ${javadir}
	file copy ${siscdir}/sisc.shp ${javadir}

	set docdir ${destroot}${prefix}/share/doc/sisc
	xinstall -d ${docdir}
	file copy ${siscdir}/ChangeLog ${docdir}
	file copy ${siscdir}/COPYING ${docdir}
	file copy ${siscdir}/GOALS ${docdir}
	file copy ${siscdir}/README ${docdir}
	file copy ${siscdir}/TODO ${docdir}
	file copy ${siscdir}/doc ${docdir}

	#put man page into place
	file rename ${destroot}${prefix}/share/doc/sisc/doc/man/sisc.1 \
		${destroot}${prefix}/share/man/man1/sisc.1
}
