# 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
#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
# NEO & dependencies
    python2.7
    mariadb
    mysql-python
    neoppod
# NEO instanciation
    template-instance

[slapos-deps-eggs]
recipe = zc.recipe.egg
eggs =
#LXML
    ${lxml-python:egg}
#END LXML

#LXML
[lxml-python]
python = python2.7
#END LXML

[base-template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}.in
rendered = ${buildout:directory}/${:filename}
extensions = jinja2.ext.do
extra-context =
context =
    key eggs_directory buildout:eggs-directory
    key develop_eggs_directory buildout:develop-eggs-directory
    key bin_directory buildout:bin-directory
    ${:extra-context}

[template-neo-master]
< = base-template
filename = instance-neo-master.cfg
md5sum = 8947620b15535b95163c11a0efab546e

[template-neo-storage-mysql]
< = base-template
filename = instance-neo-storage-mysql.cfg
md5sum = 518c8c41ce73f0b608fbb1c3b889ca1b
extra-context =
    key mariadb_location mariadb:location
    key master_cfg template-neo-master:rendered

[template-neo-admin]
< = base-template
filename = instance-neo-admin.cfg
md5sum = 987f69333c563898cab21455509f8024

[template-cluster]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/cluster.cfg.in
md5sum = 7177d129e171b20044bf435ed549af43

[template-instance]
< = base-template
template = ${:_profile_base_location_}/instance.cfg.in
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
md5sum = 17e761b371487b55b39da1c39ebb1bb6
extra-context =
    key neo_master template-neo-master:rendered
    key neo_storage_mysql template-neo-storage-mysql:rendered
    key neo_admin template-neo-admin:rendered
    key cluster template-cluster:target

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