[buildout]
extends =
  ../librsync/buildout.cfg
  ../python-2.7/buildout.cfg
parts =
  rdiff-backup-1.0.5
  rdiff-backup-1.3.4

[rdiff-backup-common]
recipe = slapos.recipe.cmmi
shared = true
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
configure-command = true
make-binary = true
post-install =
  set %(location)s/lib/python2.7
  %(python)s setup.py build_ext -I${librsync:location}/include -L${librsync:location}/lib -R${librsync:location}/lib build install --prefix=%(location)s --install-lib=$1
  cd %(location)s/bin
  sed -i '/^import\b.*\bsys\b/s,$,\nsys.path[0] = '\"$1\", *
  ./rdiff-backup -V
python = ${python2.7:executable}

[rdiff-backup-common:python27]
python = ${buildout:executable}

[rdiff-backup-1.0.5]
<= rdiff-backup-common
url = https://pkgs.fedoraproject.org/repo/pkgs/rdiff-backup/rdiff-backup-1.0.5.tar.gz/${:md5sum}/rdiff-backup-1.0.5.tar.gz
md5sum = fa2a165fa07a94be52c52e3545bc7758
patches =
  ${:_profile_base_location_}/rdiff-backup-1.2.8-librsync-1.0.0.patch#5e54a67845edd6942fcf7359c921e003

[rdiff-backup-1.3.4]
<= rdiff-backup-common
# use our own version
url = http://www.nexedi.org/static/packages/source/rdiff-backup-1.3.4nxd6.tar.gz
md5sum = 06b8df2099baebca6086a315b031fd53
patches =
  ${:_profile_base_location_}/rdiff-backup-1.3.4-librsync-1.0.0.patch#31fafc8bc4a00f002f52008a9f3b671f
