[buildout]

versions = versions

extends =
  ../../stack/slapos.cfg
  ../../component/gcc/buildout.cfg
  ../../component/openssl/buildout.cfg
  ../../component/curl/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/dcron/buildout.cfg
  ../../component/logrotate/buildout.cfg
  ../../component/lxml-python/buildout.cfg
  ../../component/gzip/buildout.cfg
  ../../component/git/buildout.cfg
  ../../component/nodejs/buildout.cfg
  ../../component/postgresql/buildout.cfg
  ./buildout.hash.cfg

parts =
  postgresql
  nodejs
  etherpad-lite-repository
  install-deps
  template
  lxml-python
  eggs
  instance-recipe-egg

unzip= true

[eggs]
recipe = zc.recipe.egg
eggs =

[instance-recipe]
egg = slapos.cookbook
module = etherpad-lite

[instance-recipe-egg]
recipe = zc.recipe.egg
eggs = ${instance-recipe:egg}

[etherpad-lite-repository]
recipe = slapos.recipe.build:gitclone
repository = http://github.com/ether/etherpad-lite.git
branch = develop
git-executable = ${git:location}/bin/git

[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:_update_hash_filename_}
output = ${buildout:directory}/template.cfg
mode = 0644

[instance-etherpad-lite]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:_update_hash_filename_}
output = ${buildout:directory}/template-etherpad-lite.cfg
mode = 0644

[template-conf]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}

[template-run-script]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}

[template-deps-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:_update_hash_filename_}
etherpad-location = ${etherpad-lite-repository:location}
nodejs-location = ${nodejs:location}
curl-location = ${curl:location}
postgre-location = ${postgresql:location}
mode = 0755
output = ${etherpad-lite-repository:location}/bin/installDeps.sh

[install-deps]
recipe = plone.recipe.command
command = ${template-deps-script:output}
update-command = command