# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Alexander Fehr <pizzapunk gmail com>

pkgname=desktop-file-utils
pkgver=0.24
pkgrel=1
pkgdesc="Command line utilities for working with desktop entries"
arch=(x86_64)
url="https://www.freedesktop.org/wiki/Software/desktop-file-utils"
license=(GPL)
depends=(glib2)
makedepends=(git emacs)
_commit=27d370de9ca5121550c343859455d0f1515e1ec5  # tags/0.24^0
source=("git+https://anongit.freedesktop.org/git/xdg/desktop-file-utils#commit=$_commit"
        update-desktop-database.hook)
sha256sums=('SKIP'
            '2be5efa6c93f89691d106c086ef392e5dbf2839e2de2afc43a7f616f55b2a81d')
validpgpkeys=('C01EDE5BB0D91E26D003662EC76BB9FEEAD12EA7') #Hans Petter Jansson <hpj@suse.com>

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 ../*.hook
}
