#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=xdg-user-dirs
pkgver=0.18
pkgrel=01
pkgdesc="Manage user directories like ~/Desktop and ~/Music w/o systemd"
url="https://www.freedesktop.org/wiki/Software/xdg-user-dirs"
arch=(x86_64)
depends=(sh)
makedepends=(docbook-xsl git)
backup=(etc/xdg/user-dirs.conf etc/xdg/user-dirs.defaults)
#install=xdg-user-dirs.install  ##  was meant for installing the service file properly for systemd
#options=(!emptydirs debug)  ####  uncomment this line to have the debug pkg produced
options=(!emptydirs)
_commit=52e71ff04416f2ca3adaf6d73193de4b8b83de46  # tags/0.18^0
source=("git+https://gitlab.freedesktop.org/xdg/$pkgname.git#commit=$_commit")
#        xdg-user-dirs-update.service)

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

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

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

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

#  # We use a service
#  rm "$pkgdir/etc/xdg/autostart/xdg-user-dirs.desktop"
#  install -Dt "$pkgdir/usr/lib/systemd/user" -m644 ../xdg-user-dirs-update.service
}

#---- license gpg-key sha256sums ----

license=(GPL)

sha256sums=(SKIP)
