# $Id: Portfile,v 1.8 2006/05/11 07:05:06 mww Exp $

PortSystem	1.0
name		sisc
version		1.13.6
categories	lang java scheme
platforms	darwin
maintainers	mvitocruz@gmail.com
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 809db6518a52d77a79646520b55f908b \
		sha1 c9532928cb2bda22efcd4911424279068a13d437
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
}
