# Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>

pkgname=dateutils
pkgver=0.4.11
pkgrel=3
pkgdesc='nifty command line date and time utilities; fast date calculations and conversion in the shell'
url='https://www.fresse.org/dateutils/'
arch=('x86_64' 'aarch64')
license=('BSD')
makedepends=('git' 'gperf')
depends=('glibc')
source=("git+https://github.com/hroptatyr/dateutils.git?signed#tag=v${pkgver}")
sha512sums=('4fdf3ed23928145086f78077db3ec16364bdf1d7aba73bd360057a3026c0f3b5e968496c3a177c8f5cbe2483892c5a28f1459bdbecf4805d4b4b6979a911ec44')
validpgpkeys=('6CB0D61E23A4275CC2CFA16194C9A1AC82C9390E')

prepare() {
    cd $pkgname
    autoreconf -fiv
}

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

check() {
    cd $pkgname
    make check
}

package() {
    cd $pkgname
    make DESTDIR="$pkgdir" install
    install -Dm0644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}
