[buildout]
extends =
  ../../component/bash/buildout.cfg
  ../../component/cloud9/buildout.cfg
  ../../component/curl/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/dropbear/buildout.cfg
  ../../component/git/buildout.cfg
  ../../component/lxml-python/buildout.cfg
  ../../component/nginx/buildout.cfg
  ../../component/rsync/buildout.cfg
  ../../stack/flask.cfg
  ../../stack/shacache-client.cfg
  ../../stack/resilient/buildout.cfg
  ../../stack/slapos.cfg

parts =
  template
  eggs
  nginx
  simple-proxy
  node-frontend-template
  http-proxy
  npm-modules
  instance-runner-import
  instance-runner-export
  slapos-cookbook
  slapos-cfg-template 

develop =
  /opt/slapos.toolbox/
  /opt/slaprunner/

# XXX: we have to manually add this for resilience
  rdiff-backup
  collective.recipe.template-egg

####################
## Node JS proxy
####################
[simple-proxy]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/simple-proxy.js
location = ${buildout:parts-directory}/${:_buildout_section_name_}
md5sum = 86e2231b3f65587b56d9be63e21a4e05
filename = simple-proxy.js
mode = 0644

[node-frontend-template]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/node-frontend.in
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = node-frontend.in
md5sum = 72904152860dddb30ca936dac5bbf4cd
mode = 0644

[http-proxy]
# https://github.com/nodejitsu/node-http-proxy
recipe = slapos.recipe.build:download-unpacked
#XXX-Cedric : use upstream when merged
url = https://github.com/desaintmartin/node-http-proxy/archive/20120621.zip
md5sum = 621e5fca448cbea137c5d847d780d84d

[npm-modules]
recipe = plone.recipe.command
destination = ${buildout:parts-directory}/${:_buildout_section_name_}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
command =
  export HOME=${:location};
  rm -fr ${:destination} &&
  mkdir -p ${:destination} &&
  cd ${:destination} &&
  ${nodejs:location}/bin/node ${nodejs:location}/bin/npm install colors@0.6.0-1 &&
  ${nodejs:location}/bin/node ${nodejs:location}/bin/npm install socket.io@0.8.7 &&
  ${nodejs:location}/bin/node ${nodejs:location}/bin/npm install socket.io-client@0.8.7 &&
  ${nodejs:location}/bin/node ${nodejs:location}/bin/npm install optimist@0.3.1 &&
  ${nodejs:location}/bin/node ${nodejs:location}/bin/npm install pkginfo@0.2.3


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

[template-runner]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg
md5sum = 8c1f4f58fa8c030317a9a914d0ab63f5
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 = f16cb60bb16632e652bea69cd5cdd9b7
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 = 9ce3482e64a0c957f7a5f25ad0dc03ae
mode = 0644

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

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

[template_nginx_conf]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/nginx_conf.in
md5sum = 09b7677dfc6b23c1f58e67fd06a7625e
filename = nginx_conf.in
mode = 0644

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

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

[eggs]
recipe = z3c.recipe.scripts
eggs =
  ${lxml-python:egg}
  cns.recipe.symlink
  erp5.util
  hexagonit.recipe.download
  inotifyx
  lock-file
  netaddr
  slapos.cookbook
  slapos.libnetworkcache
  slapos.toolbox[flask_auth]
  slapos.core
  xml_marshaller
  pytz
<<<<<<< HEAD

# Add slapos.libnetworkcache to path of slapos.core so that slaprunner can build SRs using cache
[slapos-cookbook]
eggs =
  ${lxml-python:egg}
  slapos.cookbook
  cliff
  hexagonit.recipe.download
  inotifyx
  netaddr
  netifaces
  requests
  slapos.core
  supervisor
  xml_marshaller
  pytz
  slapos.libnetworkcache

=======
  collective.recipe.environment
>>>>>>> 3bf4e1a... slaprunner : is now deployed by buildout