# $Id: PKGBUILD 82896 2010-06-18 18:30:20Z ibiru $
# Maintainer: Jan "heftig" Steffens <jan.steffens@gmail.com>

pkgbase=gnash
pkgname=(gnash-common gnash-gtk)
pkgver=0.8.8
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gnash/"
license=(GPL3)
makedepends=(curl giflib boost-libs libldap sdl agg libjpeg libpng libtool
             speex fontconfig libva ffmpeg libxinerama
             gstreamer0.10-base gstreamer0.10-ffmpeg
             gtk2 libldap
             pkgconfig boost)
options=(!libtool !emptydirs)
source=(http://ftp.gnu.org/gnu/gnash/${pkgver}/gnash-${pkgver}.tar.bz2)
md5sums=('ce57f66e222f7eb1adf7f7b4a1274612')

build() {
  cd "$srcdir/gnash-$pkgver"

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --with-plugins-install=system \
    --with-npapi-plugindir=/usr/lib/mozilla/plugins \
    --enable-gui=sdl,gtk \
    --enable-renderer=agg \
    --enable-media=gst,ffmpeg \
    --enable-hwaccel=vaapi

  make
}

package_gnash-common() {
  pkgdesc="A GNU Flash movie player"
  depends=(curl giflib boost-libs libldap ffmpeg sdl agg libjpeg libpng
           speex fontconfig libva libxinerama
           gstreamer0.10-base gstreamer0.10-ffmpeg)
  backup=(etc/gnashrc etc/gnashpluginrc)

  cd "$srcdir/gnash-$pkgver"

  make DESTDIR="$pkgdir" install

  mv "$pkgdir/usr/bin/gtk-gnash" "$srcdir"
}

package_gnash-gtk() {
  pkgdesc="A GNU Flash movie player"
  depends=("gnash-common=$pkgver" gtk2 libldap)

  cd "$srcdir/gnash-$pkgver"

  make DESTDIR="$pkgdir" install-plugin

  install -D "$srcdir/gtk-gnash" "$pkgdir/usr/bin/gtk-gnash"
}