# Contributor: Hasse Hagen Johansen <hasse-docker@hagenjohansen.dk>
# Maintainer: Hasse Hagen Johansen <hasse-docker@hagenjohansen.dk>
pkgname=libhdhomerun
pkgver=20200225
pkgrel=1
pkgdesc="Library for Silicon Dust HD HomeRun"
options="!check" # No testsuite
url="https://github.com/Silicondust/libhdhomerun"
arch="all"
license="LGPL-2.1-or-later"
depends="$pkgname-libs"
depends_dev="$pkgname-libs"
subpackages="$pkgname-dev $pkgname-libs"
source="http://download.silicondust.com/hdhomerun/libhdhomerun_$pkgver.tgz"

builddir="$srcdir/$pkgname"

build() {
	make
}

package() {
	install -Dm755 hdhomerun_config \
		"$pkgdir"/usr/bin/hdhomerun_config
	for i in *.h; do
		install -Dm644 $i \
			"$pkgdir"/usr/include/libhdhomerun/$i
	done
}

# libhdhomerun does not provide versioned libs so we cannot
# use abuilds libs split function, so we make our own.
libs() {
	pkgdesc="$pkgname (libraries)"
	depends=
	install -Dm755 "$builddir"/libhdhomerun.so \
		"$subpkgdir"/usr/lib/libhdhomerun.so
}

sha512sums="75ebb5fe47563f149baa76bfb15cfd42ff9e0fb92c7137ed500f570a3bc1faeeadc7e3a4745adf83e29c47eb0eba8ff7ee0df484bb4e55c188b45c6a7411c24e  libhdhomerun_20200225.tgz"
