# Maintainer: jelle van der Waa <jelle@vdwaa.nl>
# Contributor: eric <eric@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=bonnie++
pkgver=1.98
pkgrel=1
pkgdesc="Based on the Bonnie hard drive benchmark by Tim Bray"
arch=('x86_64')
url="https://www.coker.com.au/bonnie++/"
license=('GPL')
depends=('perl')
source=(https://www.coker.com.au/$pkgname/$pkgname-$pkgver.tgz)
md5sums=('5bb79f393b4172a0d7014ce4125454cd')
build() {
  cd $srcdir/${pkgname}-${pkgver}

  ./configure --prefix=/usr
  sed -i "s:CFLAGS=-O2  -DNDEBUG \$(WFLAGS) \$(MORECFLAGS):CFLAGS=${CFLAGS}:" Makefile
  make V=1
}

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

  # https://www.archlinux.org/todo/move-files-to-usrbin-if-possible/
  sed -i 's/sbin/bin/' Makefile
  make prefix="${pkgdir}/usr" install

  install -d $pkgdir/usr/share/doc/bonnie++
  install -Dm644 $srcdir/$pkgname-$pkgver/readme.html $pkgdir/usr/share/doc/bonnie++/readme.html
}

