# Contributor: Hasse Hagen Johansen <hasse-docker@hagenjohansen.dk>
# Maintainer: Hasse Hagen Johansen <hasse-docker@hagenjohansen.dk>
pkgname=libhdhomerun
pkgver=20161117
pkgrel=1
pkgdesc="Library for Silicon Dust HD HomeRun"
url="http://www.silicondust.com/support/downloads/linux/"
arch="all"
license="LGPL-2.0-or-later"
depends="$pkgname-libs"
depends_dev="$pkgname-libs"
install=""
subpackages="$pkgname-dev $pkgname-libs"
source="http://download.silicondust.com/hdhomerun/${pkgname}_${pkgver}.tgz"

builddir="$srcdir/$pkgname"

build() {
	cd "$builddir"
	make || return 1
}

package() {
	cd "$builddir"
	install -Dm755 hdhomerun_config \
		"$pkgdir"/usr/bin/hdhomerun_config || return 1
	for i in *.h; do
		install -Dm644 $i \
			"$pkgdir"/usr/include/libhdhomerun/$i || return 1
	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 || return 1
}

md5sums="bcbf36db39d8018818336b53a64106b4  libhdhomerun_20161117.tgz"
sha256sums="23a3484723f3744eb38349d19cbe7d25b5bed27adf64929bd174c1669b194a8a  libhdhomerun_20161117.tgz"
sha512sums="932eb52a20706fad04a7ebbf9cdc51d7ba0b5f4e1d8e74d175ded26fcb50a745ff37681b14d28a9ff636b923c0b02b624bf39e3d4bbfbe1e4278bbfc70f21803  libhdhomerun_20161117.tgz"
