# Contributor: sausageandeggs <sausageandeggs@archlinux.us>

pkgname=kupfer-mpris2-plugin
pkgver=20111221
pkgrel=1
pkgdesc="Control mpris compatable media players from Kupfer"
arch=(any)
url="https://github.com/hugosenari/Kupfer-Plugins"
license=('GPL')
depends=('mpris2-git')
makedepends=('git')

_gitroot="git://github.com/hugosenari/Kupfer-Plugins"
_gitname="Kupfer-Plugins"

build() {
  cd "${srcdir}"

  msg "Connecting to GIT server..."

  if [ -d ${_gitname} ] ; then
    cd ${_gitname} && git pull ${_gitname} master
    msg "The local files are updated."
  else
    mkdir ${_gitname}
    cd ${_gitname}
    git init
    git remote add ${_gitname} ${_gitroot}
    git config core.sparsecheckout true
    echo mpris2-player >> .git/info/sparse-checkout
    git pull ${_gitname} master
  fi
  msg "GIT checkout done or server timeout"
}

package(){
  cd "${srcdir}/${_gitname}"
  install -d ${pkgdir}/usr/share/kupfer/kupfer/plugin
  install mpris2-player/* ${pkgdir}/usr/share/kupfer/kupfer/plugin/
} 

