SUMMARY="A lightweight scripting language"
DESCRIPTION="
A scripting language that provides a lightweight platform for distributed \
computing and communication. It is mainly designed for network communications, \
providing effective solutions to modern network distributed applications.
"
HOMEPAGE="http://www.rebol.com/"
SRC_URI="https://github.com/rebol/r3/archive/4d9840f8e661e7067472e828ee6ad8dd3008b247.zip"
CHECKSUM_SHA256="9ad2601d5e18f070a442aed554b118ee4d2e06bdfe85413dc65613eb61c38d35"
SRC_FILENAME="rebol-r3-$portVersion.zip"
SRC_URI_2="http://ports-space.haiku-files.org/dev-lang/rebol/r3-make.zip"
CHECKSUM_SHA256_2="2a6dda70211787fcca4249c922378e891ca287c8c110affb386b5cc939ba4798"
SRC_FILENAME_2="rebol-r3-make-$portVersion.zip"
SRC_URI_3="https://github.com/rebolsource/rebol-test/archive/502075cc3a4116c1785081e602eb8e28efd3247f.zip"
CHECKSUM_SHA256_3="7d8415f467fbc87bfd77f21cf3fc2af5dfc6f129941a3a2daf1ed27ec2d194e1"
SRC_FILENAME_3="rebol-test-$portVersion.zip"
LICENSE="Apache v2"
COPYRIGHT="2014 REBOL Technologies"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 !x86_64"

PROVIDES="
	rebol = $portVersion
	cmd:r3 = $portVersion
	"

REQUIRES="
	haiku >= $haikuVersion
	"

BUILD_REQUIRES="
	haiku_devel >= $haikuVersion
	"
BUILD_PREREQUIRES="
	cmd:gcc
	cmd:make
	cmd:nm
	cmd:strip
	"

SOURCE_DIR="rebol-4d9840f8e661e7067472e828ee6ad8dd3008b247"

BUILD()
{
	cd make
	cp $sourceDir2/r3-make-$targetArchitecture r3-make
	chmod +x r3-make
	make make OS_ID=0.5.75
	make prep
	make
}

INSTALL()
{
	mkdir -p $binDir
	cp make/r3 $binDir
}

TEST()
{
	[ -d tests ] && rm -rf tests
	mkdir tests
	cd tests
	../make/r3 $sourceDir3/rebol-test-502075cc3a4116c1785081e602eb8e28efd3247f/run-recover.r
}
