[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/python-2.7/buildout.cfg
  ../../component/gzip/buildout.cfg
  ../../component/git/buildout.cfg
  ../../component/nodejs/buildout.cfg
  ../../component/postgresql/buildout.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
python = python2.7
eggs = ${instance-recipe:egg}

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

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

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

[template-conf]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644
filename = settings.json.in
md5sum = f9baee09003676fc1141f9bf4481f6a3
location = ${buildout:parts-directory}/${:_buildout_section_name_}

[template-run-script]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644
filename = run.sh.in
md5sum = eac870b5f30e735e109a48913af2fae3
location = ${buildout:parts-directory}/${:_buildout_section_name_}

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

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

[lxml-python]
python = python2.7