# Maintainer: trya <tryagainprod@gmail.com>

pkgname=libva-git
pkgver=20111106
pkgrel=1
pkgdesc="VA API library, providing an interface for hardware video decoding and encoding"
arch=('i686' 'x86_64')
license=('MIT')
url="http://www.freedesktop.org/wiki/Software/vaapi"
#makedepends=('git' 'mesa')
makedepends=('git' )
#depends=('libdrm' 'libgl' 'libxfixes')
depends=('libdrm'  'libxfixes')
optdepends=('vdpau-video: vdpau back-end for nvidia'
            'libva-driver-intel: back-end for intel cards')
provides=('libva=1.0.15')
conflicts=('libva' 'libva-sds')
options=(!libtool)
source=()
md5sums=()

_gitroot="git://anongit.freedesktop.org/vaapi/libva"
_gitname="libva"

build() {
  cd "$srcdir"
  
  msg "Connecting to git.freedesktop.org GIT server..."
  if [ -d $_gitname ] ; then
    cd $_gitname && git pull origin
    msg "The local files are updated."
  else
    git clone $_gitroot
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting make..."

  cd "$srcdir"
  rm -rf $_gitname-build
  cp -r $_gitname $_gitname-build
  cd $_gitname-build

  ./autogen.sh
  ./configure --prefix=/usr
  make
}

package() {
  cd "$srcdir/$_gitname-build"
  make DESTDIR="$pkgdir" install
  install -m644 -D COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
