# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>

pkgname=airsonic
pkgver=10.6.2
pkgrel=2
pkgdesc="A free, web-based media streamer and jukebox."
arch='noarch'
url="https://github.com/Airsonic/airsonic/"
license='GPL3'
depends="openjdk8-jre flac lame ffmpeg"
source="$pkgname-$pkgver.war::https://github.com/airsonic/airsonic/releases/download/v$pkgver/airsonic.war
	airsonic.conf
	airsonic.initd
	airsonic.sh"
subpackages="$pkgname-openrc"
options="!check"

package() {
	mkdir -p $pkgdir/var/lib/airsonic
	mkdir -p $pkgdir/etc/init.d
	mkdir -p $pkgdir/etc/conf.d
	mkdir -p $pkgdir/etc/airsonic
	mkdir -p $pkgdir/usr/bin

	cp $srcdir/airsonic-$pkgver.war $pkgdir/var/lib/airsonic/airsonic.war
	install -Dm755 $srcdir/airsonic.initd $pkgdir/etc/init.d/airsonic
	cp $srcdir/airsonic.conf $pkgdir/etc/conf.d/airsonic
	ln -s /etc/conf.d/airsonic $pkgdir/etc/airsonic/airsonic.conf
	install -Dm755 $srcdir/airsonic.sh $pkgdir/usr/bin/airsonic
}
sha512sums="171d45592d919c58869cde77eefa117df83bab3c7cfdf6ca5b6f88ad5fc58492fad3529ce9d2fff287c33ebddb594148c2aead6badb537e492a794c0f73a8fae  airsonic-10.6.2.war
0d0c543986a7db15202667461796ed1281e90c0f9c1b5b44bc0df48693f8b1f604b333bef54408c598c23bd9173b8641f102ad7f24ed7abf3316c61d0ca82cb6  airsonic.conf
1f190647bac0b09153de9121c7bb7a4d7ed316a388bbea7087f2a39d2cbe937b3b2f75c4598f887baf9110a4aa2b31745aadf1cade0dfe6a0e4d0f06b00facce  airsonic.initd
cebf02fb303fa2587c35c06b86fa0235033aa991f74492ed14b8a777793ba2d832cc67fb66aab0ea5272513960314fafd217d7be32101fc47acb44ea68e03c4c  airsonic.sh"
