# $Id: PKGBUILD 235925 2015-04-09 18:47:32Z heftig $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=totem
pkgver=3.16.0
pkgrel=1
pkgdesc="GNOME3 movie player based on GStreamer"
url="http://www.gnome.org"
arch=(i686 x86_64)
license=(GPL2 custom)
depends=(totem-plparser desktop-file-utils iso-codes libpeas clutter-gtk clutter-gst grilo
         hicolor-icon-theme gsettings-desktop-schemas dconf
         python-gobject python-xdg
         gst-plugins-base gst-plugins-good gst-plugins-bad gnome-desktop)
makedepends=(intltool libnautilus-extension lirc vala zeitgeist
             itstool docbook-xsl python-pylint gobject-introspection)
optdepends=('gst-plugins-ugly: Extra media codecs'
            'gst-libav: Extra media codecs'
            'lirc-utils: Infrared Remote Control plugin'
            'grilo-plugins: Media discovery'
            'zeitgeist: Zeitgeist plugin'
            'python-dbus: MPRIS plugin')
groups=(gnome)
options=('!emptydirs')
install=totem.install
conflicts=(totem-plugin)
replaces=(totem-plugin)
source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz)
sha256sums=('69b109533b592683eecf0274262f8247219f0e44134b395a6ed36403d8d166e3')

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --libexecdir=/usr/lib/totem \
    --localstatedir=/var \
    --disable-static \
    --enable-python \
    --enable-nautilus

  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="${pkgdir}" install

  install -Dm644 COPYING "$pkgdir/usr/share/licenses/totem/COPYING"
}
