#Packager: George Vlahavas <vlahavas~at~gmail~dot~com>

pkgname=guvcview
pkgver=2.0.5
pkgrel=1gv
source=("http://downloads.sourceforge.net/project/guvcview/source/guvcview-src-$pkgver.tar.gz" "convert_to_uint8_t.patch")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "about-nls" "todo.tasks")
url=http://guvcview.sourceforge.net/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"guvcview (a simple video capture application)"
"guvcview provides a simple GTK interface for capturing and viewing"
"video from devices supported by the linux UVC driver, although it"
"should also work with any v4l2 compatible device."
)


build() {
	cd $startdir/src/guvcview-src-$pkgver
	
	patch -p1 < $startdir/src/convert_to_uint8_t.patch || exit 1

	./configure --prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-debian-menu \
		--disable-static \
		--build=$arch-slackware-linux

	make || return 1
	make install DESTDIR=$startdir/pkg

	# Fix icon
	sed -i "s/^Icon=.*/Icon=guvcview/" $startdir/pkg/usr/share/applications/guvcview.desktop
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/128x128/apps
	cp $startdir/pkg/usr/share/pixmaps/guvcview/guvcview.png $startdir/pkg/usr/share/icons/hicolor/128x128/apps/

	# Not needed, as they are also put in /usr/doc by slkbuild
	rm -rf $startdir/pkg/usr/share/doc
}