# $Id: Portfile 53178 2009-06-30 20:48:11Z mww@macports.org $

PortSystem 1.0

name			4th
version			3.5d2
categories		lang
platforms		darwin
maintainers		mww
description		very small Forth compiler
long_description	4tH is a very small Forth compiler that can create \
					bytecode, C-embeddable bytecode, standalone executables, \
					but also works fine as a scripting language. It supports \
					over 85% of the ANS Forth CORE wordset and features \
					conditional compilation, pipes, files, assertions, forward \
					declarations, recursion, include files, etc.

homepage		http://www.xs4all.nl/~thebeez/4tH/foldtree.html
master_sites	http://www.xs4all.nl/~thebeez/4tH/
distname		${distname}-unix
checksums           md5     42eef2c534f81e21d12a92e5ada843c8 \
                    sha1    411cbe3b948d1dfec5793aaa4447f34067424a20 \
                    rmd160  2c637d05942292918c8a5398db783f48d9e8d71a
patchfiles	patch-Makefile.OSX.diff

worksrcdir		${worksrcdir}/sources

post-extract { xinstall -m 755 ${filespath}/configure ${worksrcpath} }

configure.env-append	PREFIX=${prefix}
build.args		-f Makefile.OSX
destroot.args		-f Makefile.OSX

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/doc
	file copy ${worksrcpath}/../documentation ${destroot}${prefix}/share/doc/${name}
	file copy ${worksrcpath}/../examples ${destroot}${prefix}/share/doc/${name}/
	file rename ${destroot}${prefix}/share/doc/4th/4th.1 \
		${destroot}${prefix}/share/man/man1/4th.1
	file copy ${worksrcpath}/../lib ${destroot}${prefix}/share/${name}
}

livecheck.check	regex
livecheck.url	http://www.xs4all.nl/~thebeez/4tH/download.html
livecheck.regex	4th-(\[a-z0-9\\.\]+)-unix.tar.gz

