# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=w_scan
pkgver=20170107
pkgrel=0
pkgdesc="Universal ATSC and DVB blind scanner"
url="http://wirbel.htpc-forum.de/w_scan/index_en.html"
arch="all"
license="GPL"
makedepends="linux-headers"
subpackages="$pkgname-doc"
source="http://wirbel.htpc-forum.de/$pkgname/$pkgname-$pkgver.tar.bz2
	musl-build-time-h-fix.patch"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare
	sed 's/uint/unsigned int/' -i "$builddir"/version.h
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="c8e163b5e4897e2bc48596a1104974c79807432c423a3dd172e85c6ed6d4f9a4a471150ae7fe1b78fe570987e9fdee666a491700368c8499b03e9b13aa5cde6a  w_scan-20170107.tar.bz2
5514dd105c51b23728ea4d5d0e04604b2674e0686645b1434197a9cdaa98bf7cac3946baad6357478160ce1feb5d1a3a74b8c1897f846cfb04c0bb58d9ac8b1b  musl-build-time-h-fix.patch"
