# Note on LXML/END LXML: they delimit areas where lxml magic is needed. lxml is
# a slapos.cookbook dependency, so it should be fetched automatically. But when
# automatically fetched, it gets built against system headers/libs, which is
# forbidden in slapos. So we need to fetch lxml explicitly so it is properly
# built.

[buildout]
extends =
    ../../stack/slapos.cfg
    ../../stack/erp5/logrotate-base.cfg
#LXML
    ../../component/lxml-python/buildout.cfg
#END LXML
    ../../component/python-2.7/buildout.cfg
    ../../component/mariadb/buildout.cfg
    ../../component/mysql-python/buildout.cfg

parts =
    slapos-deps-eggs
    slapos-cookbook-develop
    slapos-cookbook
# NEO & dependencies
    python2.7
    mariadb
    mysql-python
    neoppod
# NEO instanciation
    template

[slapos.cookbook-repository]
branch = erp5-cluster

[slapos-deps-eggs]
recipe = zc.recipe.egg
eggs =
  ${lxml-python:egg}
  slapos.toolbox
scripts =
  slapos-kill

[cluster]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in
md5sum = 85e88660335bbdfb13ba9026c24858b0
# XXX: following mode should be the default
mode = 644

[instance-neo-admin]
< = cluster
md5sum = 43eb053841e9dabdbed2a3501a0a3f13

[instance-neo-master]
< = cluster
md5sum = 2cba73dbfa3f6e1a60d54de3bae38fee

[instance-neo-storage-mysql]
< = cluster
md5sum = 70f7dfc268ceb677913c3a318656f834

[template-my-cnf]
< = cluster
url = ${:_profile_base_location_}/my.cnf.in
md5sum = 38b4eb7225f9b7c18875b4d2ab398278

[template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 9eb934d9fc06b253799c661f5dfba179
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
context =
    key eggs_directory buildout:eggs-directory
    key develop_eggs_directory buildout:develop-eggs-directory
    key bin_directory buildout:bin-directory
    key cluster cluster:target
    key neo_admin instance-neo-admin:target
    key neo_master instance-neo-master:target
    key neo_storage_mysql instance-neo-storage-mysql:target
    key mariadb_location mariadb:location
    key template_my_cnf template-my-cnf:target
    key logrotate_base template-logrotate-base:rendered

[neoppod]
recipe = zc.recipe.egg
eggs = neoppod[admin, ctl, master, storage-importer, storage-mysqldb]