# Contributor: Curt Tilmes <Curt.Tilmes@nasa.gov>
# Maintainer: Curt Tilmes <Curt.Tilmes@nasa.gov>
pkgname=liquibase
pkgver=3.5.3
pkgrel=0
pkgdesc="Source Control for your Database"
url="http://www.liquibase.org/"
arch="all"
license="Apache-2.0"
depends="openjdk8-jre bash"
makedepends=""
install=""
subpackages="$pkgname-doc"
source="https://github.com/liquibase/liquibase/releases/download/liquibase-parent-3.5.3/liquibase-3.5.3-bin.tar.gz"
builddir="$srcdir"

check() {
	cd "$builddir"
	./liquibase --version
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"/usr/share/"$pkgname"
	for file in lib liquibase liquibase.jar sdk; do
		cp -r $file "$pkgdir"/usr/share/"$pkgname"
	done
	mkdir -p "$pkgdir"/usr/bin
	ln -s /usr/share/liquibase/liquibase "$pkgdir"/usr/bin/liquibase
}

doc() {
	cd "$builddir"
	mkdir -p "$subpkgdir"/usr/share/doc/"$pkgname"
	for file in LICENSE.txt README.txt; do
		cp -r $file "$subpkgdir"/usr/share/doc/"$pkgname"
	done
}

sha512sums="c2da11f7b9f16a2047a0604ae7829dccfe9a486a69ab793a8f562663e5b3bb91a287439d9e91b3c17f0c98928174954b15e18637b5982d3eebd2b2af8948fcdb  liquibase-3.5.3-bin.tar.gz"
