# Contributor: Ed Robinson <ed@reevoo.com>
# Maintainer: Ed Robinson <ed@reevoo.com>
pkgname=sbt
pkgver=0.13.15
pkgrel=0
pkgdesc="The interactive build tool, sbt is a build tool for Scala, Java, and more."
url="http://www.scala-sbt.org/"
arch="noarch"
license="BSD-3-Clause"
depends="openjdk8-jre bash"
source="https://dl.bintray.com/$pkgname/native-packages/$pkgname/$pkgver/$pkgname-$pkgver.tgz
global-sbtopts.patch"

builddir="$srcdir/$pkgname"
_basedir="/usr/share/java/$pkgname"

package() {
	local destdir="$pkgdir/$_basedir"
	local confdir="$pkgdir/etc/$pkgname"
	cd "$builddir"

	install -dm755 "$destdir"/bin || return 1
	install -m755 -t "$destdir"/bin bin/* || return 1

	install -dm755 "$confdir" || return 1
	install -m644 -t "$confdir" conf/* || return 1

	mkdir -p "$pkgdir"/usr/bin
	ln -s "$_basedir/bin/sbt" "$pkgdir/usr/bin/sbt" || return 1

	# Remove windows specific files
	rm $destdir/bin/sbt.bat
	rm $confdir/sbtconfig.txt
}
sha512sums="9e8a4f92970b96ddb93c0f6d9bfb394bc10648511e65d2f3e7637c580877c91acfa0e5f73fc11b9992dab6b5c142ead314609f47c2aac3eb6da11d879f3da8a8  sbt-0.13.15.tgz
a7f4eedf389024d6c10a523a3456f57dd901b43b9234e12e35c4131a13a95ceac9fe3614b0266193f8700712c26ca45554444d9dd2433ed79069ae2b5ee1d58e  global-sbtopts.patch"
