[buildout]
slaposcookbook_recipe_location = ${:parts-directory}/slaposcookbook
develop =
  ${:slaposcookbook_recipe_location}

# Use only quite well working sites.
allow-hosts =
  *.nexedi.org
  *.python.org
  *.sourceforge.net
  dist.repoze.org
  effbot.org
  github.com
  peak.telecommunity.com
  psutil.googlecode.com
  www.dabeaz.com

versions = versions

parts =
  template
  downloadcache-workaround
  apache-php
  mariadb
  eggs
  instance-recipe-egg
  
extends =
  ../../component/mariadb/buildout.cfg
  ../../component/apache/buildout.cfg
  ../../component/apache-php/buildout.cfg
  ../../component/dcron/buildout.cfg
  ../../component/git/buildout.cfg
  ../../component/glib/buildout.cfg
  ../../component/logrotate/buildout.cfg
  ../../component/python-2.7/buildout.cfg
  ../../component/perl/buildout.cfg
  ../../component/sqlite3/buildout.cfg
  ../../component/xtrabackup/buildout.cfg
  ../../component/rdiff-backup/buildout.cfg
  ../../component/lxml-python/buildout.cfg
  ../../component/zlib/buildout.cfg
  
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
#url = https://docs.google.com/a/lnowak.com/uc?id=0B_lVQSQ57Cz7ODc0ZDM1MzctM2M2NC00N2ZmLTg4NTQtYzdmYmEzNmJjNzk5&export=download&hl=en
#md5sum = 2764597a6e4fe243cdf6e37b6535e767
output = ${buildout:directory}/template.cfg
mode = 0644

[application]
recipe = hexagonit.recipe.download
url = http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.10/phpMyAdmin-3.3.10-all-languages.tar.bz2?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Fdownloads.php&ts=1300959842&use_mirror=sunet
#md5sum = Student may put here md5sum of this file, this is good idea
#If provided tarball does not containt top directory this option shall be changed o false
strip-top-level-dir = true

[application-template]
recipe = slapos.recipe.download
#url = https://docs.google.com/a/lnowak.com/uc?id=0B_lVQSQ57Cz7Yzg3MjFiYTgtNmJlYy00YjhhLWE4ZGEtYThlOWM2NzA3YWQ0&export=download&hl=en
url = ${:_profile_base_location_}/phpmyadmin-configuration-template.php.ini
#md5sum = Student may put here md5sum of this file, this is good idea
download-only = True
filename = template.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}

[application-configuration]
location = config.inc.php

[eggs]
recipe = zc.recipe.egg
eggs =
  ${lxml-python:egg}
  
[instance-recipe]
egg = slapos.cookbook
module = osoeslaptraining.simple

[instance-recipe-egg]
# Just so buildout executes [slaposcookbook] before [eggs], as
# - [eggs] references [slaposcookbook]
# - [instance-recipe] needs [slaposcookbook] to be finished
# - we cannot rely on anything else being executed before [instance-recipe]
slaposcookbook_dummy = ${slaposcookbook:location}
recipe = zc.recipe.egg
python = python2.7
eggs = ${instance-recipe:egg}

[downloadcache-workaround]
# workaround irritating problem of hexagonit.recipe.cmmi which automatically
# creates download cache, which in turn switches builout to "semi-offline" mode
recipe = plone.recipe.command
# in hexagonit.recipe.cmmi if there is no ${buildout:download-cache} set it resolves
# to ${buildout:directory}/downloads but this variable is available late, that's
# why it is hardcoded only for required case
download-cache = ${buildout:directory}/downloads
command = [ -d ${:download-cache} ] && rm -fr ${:download-cache}/* || exit 0
update-command = ${:command}
stop-on-error = True

[slaposcookbook]
recipe = plone.recipe.command
branch = phpmyadmin
git_param =--quiet -b ${:branch}
git = ${git:location}/bin/git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true
command = ${:git} clone ${:git_param} http://git.erp5.org/repos/slapos.git ${:location} || exit 1;
update-command = cd ${:location} && ${git:location}/bin/git pull --quiet

[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-004