[buildout]
extends =
  ../../component/bash/buildout.cfg
  ../../component/busybox/buildout.cfg
  ../../component/curl/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/dcron/buildout.cfg
  ../../component/git/buildout.cfg
  ../../component/tig/buildout.cfg
  ../../component/logrotate/buildout.cfg
  ../../component/lxml-python/buildout.cfg
  ../../component/nano/buildout.cfg
  ../../component/nginx/buildout.cfg
  ../../component/openssh/buildout.cfg
  ../../component/rsync/buildout.cfg
  ../../component/python-2.7/buildout.cfg
  ../../component/screen/buildout.cfg
  ../../component/shellinabox/buildout.cfg
  ../../component/vim/buildout.cfg
  ../../component/zip/buildout.cfg
  ../../stack/slapos.cfg
  ../../stack/flask.cfg
  ../../stack/resilient/buildout.cfg
  ../../stack/monitor/buildout.cfg

# stacks are listed from most generic to most specific,
# to avoid versioning issues

common-parts =
  template
  eggs
  instance-runner-import
  instance-runner-export
  template-slapos-cfg
# XXX: we have to manually add this for resilience
  rdiff-backup
  pbs-recipe-egg

parts =
  ${:common-parts}

# Use shellinabox from github with AF_UNIX support
[shellinabox]
<= shellinabox-github

[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
md5sum = bb7e0bf9959c4437ff1e23e645315ccf
mode = 0644

[template-runner]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg.in
md5sum = 26a58e69c4c59d30c9e2f50075cdc679
mode = 0644

[template-runner-import-script]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/runner-import.sh.jinja2
download-only = true
md5sum = d3ce78b35cb47dcb647772891a1bf814
filename = runner-import.sh.jinja2
mode = 0644

[instance-runner-import]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-import.cfg.in
output = ${buildout:directory}/instance-runner-import.cfg
md5sum = 5234b94f24d57d43e3cd29ccabb2b119
mode = 0644

[template-runner-export-script]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/runner-export.sh.jinja2
download-only = true
md5sum = d89161fba1dce0de6f4ebbc7eb396ccb
filename = runner-export.sh.jinja2
mode = 0644

[instance-runner-export]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-export.cfg.in
output = ${buildout:directory}/instance-runner-export.cfg
md5sum = a898117fe5b001747ef6a273fd03b42c
mode = 0644

[template-resilient]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-resilient.cfg.jinja2
md5sum = a902b84ac7d1e29a7fdb06cbc7dec150
filename = instance-resilient.cfg.jinja2
mode = 0644

[template-resilient-test]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/instance-resilient-test.cfg.jinja2
download-only = true
md5sum = c31de887459dfb45fe1213f2837cadcb
filename = instance-resilient-test.cfg.jinja2
mode = 0644

[template_nginx_conf]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/nginx_conf.in
download-only = true
md5sum = 2b06f7eb9a1d45d250d4b92a944db925
filename = nginx_conf.in
mode = 0644

[template_httpd_conf]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/httpd_conf.in
download-only = true
md5sum = 2e8440fa4b589be649a72108faec7745
filename = httpd_conf.in
mode = 0644

[template_launcher]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/launcher.in
md5sum = 525e37ea8b2acf6209869999b15071a6
filename = launcher.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}

[template-slapos-cfg]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/${:filename}
md5sum = ef16446d432e1397182b1654fe920ffb
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = slapos.cfg.in
download-only = true
mode = 0644

[template-parameters]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
md5sum = f8446fcf254b4929eb828a9a1d7e5f62
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = parameters.xml.in
download-only = true
mode = 0644

[template-bash-profile]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/${:filename}
md5sum = 1c88cbca0c1e705eeb4b544ef4616097
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = bash_profile.in
download-only = true
mode = 0644

[template-supervisord]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/${:filename}
md5sum = d294d0dafd265048399de6da8c96345f
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = supervisord.conf.in
download-only = true
mode = 0644

[template-listener-slapgrid]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/${:filename}
md5sum = 49d50410cf7467175a841eb7cd0d93d4
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = listener_slapgrid.py.in
download-only = true
mode = 0644

[monitor-check-webrunner-internal-instance]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/${:filename}
download-only = true
#md5sum = 4c44d617d5bfd1db8695200e896480c0
destination = ${buildout:parts-directory}/${:filename}
filename = monitor-check-webrunner-internal-instances.py
mode = 0644

[template-resilient-software-release-information]
recipe = hexagonit.recipe.download
ignore-existing = true
download-only = true
md5sum = 922498a301ab3defe412602f626e02ec
url = ${:_profile_base_location_}/template/${:filename}
filename = resilient_software_release_information.py.in
mode = 0644

[eggs]
recipe = zc.recipe.egg
eggs =
  collective.recipe.environment
  collective.recipe.template
  cns.recipe.symlink
  erp5.util
  lock-file
  plone.recipe.command
  slapos.recipe.build
  slapos.toolbox[flask_auth]
  Gunicorn
  futures
  ${slapos-cookbook:eggs}

[extra-eggs]
recipe = zc.recipe.egg
interpreter = pythonwitheggs
eggs +=
  supervisor