[buildout]
extends =
  ../../stack/slapos.cfg
  ../git/buildout.cfg
  ../babeld/buildout.cfg
  ../openvpn/buildout.cfg

develop = 
  re6stnet-repository

parts = 
  babeld
  re6stnet-develop
  re6stnet

[re6stnet-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/re6stnet.git
branch = master
git-executable = ${git:location}/bin/git

[re6stnet-develop]
recipe = zc.recipe.egg:develop
setup = ${re6stnet-hack:dir}

[re6stnet-hack]
recipe = plone.recipe.command
stop-on-error = true
dir = ${re6stnet-repository:location}
command =
  rm -f "${:dir}/re6stconf.py" && ln -s re6st-conf "${:dir}/re6stconf.py"
  rm -f "${:dir}/re6stregistry.py" && ln -s re6st-registry "${:dir}/re6stregistry.py"
  rm -f "${:dir}/re6stnet.py" && ln -s re6stnet "${:dir}/re6stnet.py"
  sed -i 's#("git",)#("${git:location}/bin/git",)#' ${:dir}/re6st/version.py

update-command = ${:command}

[environment]
# Note: For now original PATH is appended to the end, as not all tools are
#       provided by SlapOS
PATH=${openvpn:location}/sbin:${babeld:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python2.7:location}/bin:${readline:location}/bin:${sqlite3:location}/bin::${buildout:bin-directory}:${xz-utils:location}/bin:$PATH

[re6stnet]
recipe = zc.recipe.egg
eggs =
  ${lxml-python:egg}
  ${python-cffi:egg}
  ${python-cryptography:egg}
  pyOpenSSL
  re6stnet

script =
  re6stnet
  re6st-conf
  re6st-registry

initialization =
  import os
  os.environ['PATH'] = os.path.expandvars('${environment:PATH}')

entry-points =
  re6stnet=re6stnet:main
  re6st-conf=re6stconf:main
  re6st-registry=re6stregistry:main