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

pkgname=opentmpfiles
pkgdesc="Script written in pure POSIX sh to parse and apply tmpfiles.d style file coming from systemd"
pkgver=0.3.1
pkgrel=03
url="https://git.obarun.org/obdev/opentmpfiles.git"
source=(
    "${pkgname}::git+${url}#tag=v$pkgver"
    "opentmpfiles.hook"
)
arch=(x86_64)
makedepends=('git')

path=(--bindir=/usr/bin)

build() {
    cd $pkgname
    ./configure "${path[@]}"
}

package() {
    cd $pkgname
    make DESTDIR="${pkgdir}" install
    install -Dm 0644 ${srcdir}/opentmpfiles.hook ${pkgdir}/usr/share/libalpm/hooks/opentmpfiles.hook
    install -Dm 0644 LICENSE ${pkgdir}/usr/share/${pkgname}/LICENSE
    ln -s /usr/bin/opentmpfiles.sh "${pkgdir}/usr/bin/tmpfiles" # for use by runit-rc
}

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

license=('BSD 2-Clause')

sha256sums=(SKIP
	1319fbe1d6fc8c413fb13252c6bac8ccaa1af31ed3269db7c4a3a7c7ed673639) #  opentmpfiles.hook
