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

pkgname=libvpx
pkgver=0.9.6
pkgrel=2gv
source=("http://webm.googlecode.com/files/libvpx-v$pkgver.tar.bz2")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "patents")
url=http://code.google.com/p/webm/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"libvpx (VP8 video codec)"
"VP8 is an open video codec, originally developed by On2 and released"
"as open source by Google Inc. It is the successor of the VP3 codec, on"
"which the Theora codec was based."
)


build() {
	if [ "$arch" = "i486" ]; then
	  ARCHOPTS="--target=x86-linux-gcc"
	elif [ "$arch" = "i686" ]; then
	  ARCHOPTS="--target=x86-linux-gcc"
	elif [ "$arch" = "x86_64" ]; then
	  ARCHOPTS="--target=x86_64-linux-gcc --enable-pic"
	else
	  ARCHOPTS="--target=${arch}-linux-gcc"
	fi

	cd $startdir/src/${pkgname}-v${pkgver}
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --disable-examples --disable-debug-libs --disable-debug --enable-postproc --enable-vp8 --enable-shared $ARCHOPTS
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg

	# no static lib
	rm $startdir/pkg/usr/lib${LIBDIRSUFFIX}/*.a

	# fix ownerships/permissions
	chowm root:root $startdir/pkg/usr/include/vpx/*
	chmod 644 $startdir/pkg/usr/include/vpx/*
}