#Maintainer: Thorsten Muehlfelder <thenktor@gmx.de>

#Mandatory
pkgname=tvtime
pkgver=1.0.2
pkgrel=1tm
arch=i686
source=("http://heanet.dl.sourceforge.net/sourceforge/tvtime/$pkgname-$pkgver.tar.gz" "dscaler.patch" "videodev.patch")
sourcetemplate=http://thenktor.dyndns.org/packages/$pkgname/
url="http://tvtime.sourceforge.net"
docs=('AUTHORS' 'README' 'COPYING' 'COPYING.LGPL' 'NEWS')
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname - A high quality TV application"
"tvtime is a high quality television application for use with video"
"capture cards on Linux systems. tvtime processes the input from a"
"capture card and displays it on a computer monitor or projector."
)

build() {
	cd $startdir/src
	mv *.patch ${pkgname}-${pkgver}
	cd $startdir/src/${pkgname}-${pkgver}
	patch -p1 < dscaler.patch || return 1
	patch -p1 < videodev.patch || return 1
	sed -i 's#OPT_CFLAGS="\$OPT_CFLAGS\ -O3"#OPT_CFLAGS="$OPT_CFLAGS -O2"#' configure || return 1
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc \
		--disable-static || return 1
	LANG=en_US make -j3 || return 1
	make DESTDIR=$startdir/pkg install || return 1
	mkdir -p -m 755 $startdir/pkg/usr/doc/${pkgname}-${pkgver} || return 1
	cp -a docs/html $startdir/pkg/usr/doc/${pkgname}-${pkgver} || return 1
	rm -R $startdir/pkg/usr/share/pixmaps
}