# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Ronald van Haren <ronald.archlinux.org>
# Contributor: Ondrej Martinak <omartinak@gmail.com>

pkgname=libxdg-basedir
pkgver=1.2.3
pkgrel=2
pkgdesc='An implementation of the XDG Base Directory specification'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://github.com/devnev/libxdg-basedir'
license=('MIT')
depends=('glibc')
makedepends=('git')
_commit='b978568d1b3ee04e8197f23ca4e3abdd372f85e1'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^libxdg-basedir-//'
}

build() {
  cd "$pkgname"

  ./autogen.sh

  ./configure --prefix=/usr

  make
}

check() {
  cd "$pkgname"

  make check
}

package() {
  cd "$pkgname"

  DESTDIR="$pkgdir" make install

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" COPYING
}
