# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Adam Fontenot <adam.m.fontenot@gmail.com>

pkgname=breezy
pkgver=3.2.0
pkgrel=1
pkgdesc='A decentralized revision control system with support for Bazaar and Git file formats'
arch=(x86_64)
url=https://www.breezy-vcs.org/
license=(GPL2)
depends=(
  python-configobj
  python-patiencediff
  python-six
)
makedepends=(
  cython
  git
  python-dulwich
  python-fastimport
  python-gpgme
  python-paramiko
  python-setuptools
)
checkdepends=(python-testrepository)
optdepends=(
  'python-dulwich: Git support'
  'python-fastimport: Fastimport support'
  'python-gpgme: PGP support'
  'python-paramiko: access branches over SFTP'
)
provides=(bzr)
conflicts=(bzr)
replaces=(bzr)
_tag=c22f9e6520459ca6e85aa55aaea3edb9da8ecd79
source=(git+https://github.com/breezy-team/breezy.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd breezy
  git describe --tags | sed 's/brz-//; s/-/./g'
}

build() {
  cd breezy
  python setup.py build
}

check() {
  cd breezy
  ./brz selftest
}

package() {
  cd breezy
  export PYTHONHASHSEED=0
  python setup.py install --root="${pkgdir}" --install-data=usr/share --optimize=1 --skip-build
  ln -s brz "${pkgdir}"/usr/bin/bzr # backwards compatibility
}

# vim: ts=2 sw=2 et:
