[buildout]
extends =
  ../../stack/slapos.cfg
  ../../component/vm-img/debian.cfg
  ../../component/rina-tools/buildout.cfg
parts =
  slapos-cookbook
  template
download-cache = ${:directory}/download-cache

# Required for recent buildout.
extensions -=
  buildout-versions

[template]
recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
template = inline:
  [buildout]
  eggs-directory = ${buildout:eggs-directory}
  develop-eggs-directory = ${buildout:develop-eggs-directory}
  parts = runTestSuite
  [slap-configuration]
  recipe = slapos.cookbook:slapconfiguration.serialised
  computer = $${slap-connection:computer-id}
  partition = $${slap-connection:partition-id}
  url = $${slap-connection:server-url}
  key = $${slap-connection:key-file}
  cert = $${slap-connection:cert-file}
  [directory]
  recipe = slapos.cookbook:mkdirectory
  bin = $${buildout:directory}/bin
  [runTestSuite]
  recipe = slapos.recipe.template:jinja2
  rendered = $${directory:bin}/$${:_buildout_section_name_}
  template = ${:_profile_base_location_}/$${:_buildout_section_name_}.in
  mode = 0755
  context =
  {##} section buildout buildout
  {##} section parameter_dict runTestSuite-parameters
  {##} key slapparameter_dict slap-configuration:configuration
  [runTestSuite-parameters]
  environment = {{dumps(environment)}}
  vm = {{dumps(vm)}}
  download-cache = ${buildout:download-cache}
  runTestSuite_py = ${buildout:bin-directory}/${runTestSuite_py:interpreter}
  profile_base_location = ${:_profile_base_location_}
  irati_stack = ${irati-stack:location}
  slapos_package = ${slapos.package-repository:location}
context =
  section environment vm-run-environment
  section vm vm-debian

[runTestSuite_py]
recipe = zc.recipe.egg
eggs = erp5.util
  zc.buildout
interpreter = ${:_buildout_section_name_}

[irati-stack]
sparse-checkout = /.gitignore

[slapos.package-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/slapos.package.git
git-executable = ${git:location}/bin/git
sparse-checkout = /playbook/roles/rina

[vm-debian]
# building a generic Debian kernel uses a lot of space
size = 16Gi
packages +=
# generic (another SR that build packages automatically would use the same list)
  apt-utils build-essential devscripts equivs lsb-release
# specific
  git ca-certificates python
# biggest and common build-deps for RINA
  dh-autoreconf pkg-config doxygen maven xmlto
# hellorina (shouldn't parts like lxml-python depend on the python of the SR?)
  python-dev

[versions]
setuptools = 30.1.0
zc.buildout = 2.5.2+slapos005
zc.recipe.egg = 2.0.3+slapos002
