# $Id: PKGBUILD 136093 2015-06-28 21:49:01Z arodseth $
# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Jakob Matthes <jakob.matthes@gmail.com>
# Contributor: Bram Schoenmakers <me@bramschoenmakers.nl>
# Contributor: henning mueller <henning@orgizm.net>
# Contributor: rakoo (AUR)
# Contributor: SanskritFritz (gmail)

pkgname=bup
pkgver=0.27
pkgrel=1
pkgdesc='Highly efficient file backup system based on the git packfile format'
arch=('i686' 'x86_64')
url='https://github.com/bup/bup'
license=('GPL')
depends=('python2-fuse' 'par2cmdline' 'pylibacl' 'python2-pyxattr' 'git')
makedepends=('ruby-ronn' 'git' 'setconf')
checkdepends=('rsync')
optdepends=('python2-tornado: for bup web')
source=("git://github.com/bup/bup.git#tag=$pkgver"
        'avoid-using-pandoc.patch')
sha256sums=('SKIP'
            'd0bfe1e9f21b6552ae46db738ca798c7cef9a655dd8ad899b807d7e4ebaa8a14')

prepare() {
  cd "$pkgname"

  # Use Python 2
  setconf Makefile PYTHON python2
  grep -rl python | xargs sed -i 's:/python:/python2:g'
  grep -rl python | xargs sed -i 's:python -:python2 -:g'
  grep -rl python | xargs sed -i 's:env python:env python2:g'
  sed -i 's:find_prog python:find_prog python2:g' config/configure

  # avoid using pandoc
  patch -p1 -i ../avoid-using-pandoc.patch

  # make test suite happy
  git config --global user.email "john@doe.com"
}

build() {
  make -C "$pkgname"
}

check() {
  make -C "$pkgname" test -j1
}

package() {
  make -C "$pkgname" DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
