# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: goetzc
# Contributor: Jonathan Squirawski <sky@sky-co.de>

pkgname=libeatmydata
pkgver=105.r16.g96f8f0e
_commit=96f8f0e8291cbc0131529fcb03d4c7df1fe7792c
pkgrel=2
pkgdesc='Library and utilities designed to disable fsync and friends.'
arch=('i686' 'x86_64')
url='https://github.com/stewartsmith/libeatmydata'
license=('GPL3')
depends=('bash')
makedepends=('git')
source=("git+https://github.com/stewartsmith/${pkgname}/#commit=$_commit")
md5sums=('SKIP')

pkgver() {
  cd libeatmydata
  git describe --tags | sed 's/^libeatmydata-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd libeatmydata
  autoreconf -i
  ./configure --prefix=/usr --libexecdir=/usr/lib/libeatmydata
  make
}

check() {
  cd libeatmydata
  make check || warning "Tests need strace permission to run"
}

package() {
  cd libeatmydata
  make DESTDIR="$pkgdir" install
}
