#!/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=at
pkgver=3.2.5
pkgrel=02
pkgdesc='AT and batch delayed command scheduling utility and daemon w/o systemd'
arch=('x86_64')
url='https://salsa.debian.org/debian/at'
depends=('pam' 'flex')
makedepends=('smtp-forwarder' 'git')
backup=('etc/at.deny'
        'etc/pam.d/atd'
        'var/spool/atd/.SEQ')
options=('!makeflags')
source=("http://software.calhariz.com/$pkgname/${pkgname}_${pkgver}.orig.tar.gz"{,.sig}
#        '80-atd.hook'  # systemd restart of atd service
        'pam.conf')

build() {
  cd "$pkgname-$pkgver"

  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --with-jobdir=/var/spool/atd \
    --with-atspool=/var/spool/atd \
    --with-systemdsystemunitdir=no

  CFLAGS="$CFLAGS -w" make
}

package() {
  make -C "$pkgname-$pkgver" IROOT="$pkgdir" docdir=/usr/share/doc install

  install -D -m0644 pam.conf "$pkgdir"/etc/pam.d/atd
#  install -D -m0644 80-atd.hook "$pkgdir"/usr/share/libalpm/hooks/80-atd.hook
}

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

license=('GPL')

validpgpkeys=('464BC7CD439FEE5E8B4098A0348A778D6885EF8F') # Jose M Calhariz (Técnico) <jose.calhariz@tecnico.ulisboa.pt>

sha256sums=(bb066b389d7c9bb9d84a35738032b85c30cba7d949f758192adc72c9477fd3b8 # at_3.2.5.orig.tar.gz
	e3096c67a4c844c67f63802369dbb316aa5288d8eb5d9cdcbc5ad4e0c868e049 # at_3.2.5.orig.tar.gz.sig
#	a7048d6dbd8aa4d881979716829d16053b5007c2d83eb2167edd5221f9e48a33  80-atd.hook
	663cd2f7c5abf56d1ea3f38dfac8d3e64896f1384ca5e97b7ec6d26fd6afafef) # pam.conf
 
 
