# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=time
pkgver=1.9
pkgrel=4
pkgdesc="Utility for monitoring a program's use of system resources"
url='https://www.gnu.org/directory/time.html'
msys2_references=(
  "anitya: 4971"
)
license=('GPL')
arch=('i686' 'x86_64')
makedepends=('autotools' 'gcc')
source=(https://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('fbacf0c81e62429df3e33bda4cee38756604f18e01d977338e23306a3e3b521e')

prepare() {
  cd "${pkgname}-${pkgver}"

  autoreconf -fisv
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  
  CFLAGS+=" -std=gnu17"

  ./configure \
    --prefix=/usr \
    --infodir=/usr/share/info \
    --build=${CHOST}
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make exec_prefix="${pkgdir}/usr" infodir="${pkgdir}/usr/share/info" install
}
