[buildout]

extends =
  ../../component/apache/buildout.cfg
  ../../component/curl/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/dcron/buildout.cfg
  ../../component/openssl/buildout.cfg
  ../../component/logrotate/buildout.cfg
  ../../component/gzip/buildout.cfg

parts =
  slapos-cookbook
  monitor-eggs
  extra-eggs
  monitor2-template

[monitor-download-base]
recipe = hexagonit.recipe.download
ignore-existing = true
download-only = true
url = ${:_profile_base_location_}/${:filename}
mode = 0644

[monitor-template-base]
<= monitor-download-base
url = ${:_profile_base_location_}/templates/${:filename}

[monitor-template-script]
<= monitor-download-base
url = ${:_profile_base_location_}/scripts/${:filename}
destination = ${buildout:parts-directory}/monitor-scripts
on-update = true


[monitor-eggs]
recipe = zc.recipe.egg
eggs =
  plone.recipe.command
  collective.recipe.template
  cns.recipe.symlink
  slapos.toolbox

[extra-eggs]
<= monitor-eggs
interpreter = pythonwitheggs
eggs =
  psutil
  PyRSS2Gen
  Jinja2


# Monitor templates files
[monitor-httpd-conf]
<= monitor-template-base
md5sum = 40dc51fc156f1ad7eb94be7f3cbf08b4
filename = monitor-httpd.conf.in

[monitor-template-wrapper]
<= monitor-template-base
filename = wrapper.in
md5sum = 1695c9a06a2b11ccfe893d7a224e489d

[monitor-conf]
<= monitor-template-base
filename = monitor.conf.in
md5sum = c8f024d741c6494d7c9ba01601d0b917

[monitor-instance-info]
<= monitor-template-base
filename = instance-info.conf.in
md5sum = 1bdb4e05c6be04f4e5766c64467fbcec

[monitor-httpd-cors]
<= monitor-template-base
filename = httpd-cors.cfg.in
md5sum = 5afad2bb6e088e080e907f1d837effbb
# End templates files

# XXX keep compatibility (with software/ipython_notebook/software.cfg )
[monitor-template]
rendered = ${monitor2-template:rendered}
output = ${monitor2-template:rendered}

[monitor2-template]
recipe = slapos.recipe.template:jinja2
filename = template-monitor.cfg
template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
rendered = ${buildout:directory}/template-monitor.cfg
md5sum = 84998b1ca3c29445dca70b495515c35b
context =
    key apache_location apache:location
    key gzip_location gzip:location
    raw monitor_bin ${buildout:directory}/bin/monitor.bootstrap
    raw monitor_collect ${buildout:directory}/bin/monitor.collect
    raw monitor_runpromise ${buildout:directory}/bin/monitor.runpromise
    raw monitor_genstatus ${buildout:directory}/bin/monitor.genstatus
    raw monitor_genrss ${buildout:directory}/bin/monitor.genrss
    raw monitor_configwrite ${buildout:directory}/bin/monitor.configwrite
    raw monitor_conf_template ${monitor-conf:location}/${monitor-conf:filename}
    raw monitor_https_cors ${monitor-httpd-cors:location}/${monitor-httpd-cors:filename}
    raw monitor_instance_info ${monitor-instance-info:location}/${monitor-instance-info:filename}
    raw curl_executable_location ${curl:location}/bin/curl
    raw dash_executable_location ${dash:location}/bin/dash
    raw dcron_executable_location ${dcron:location}/sbin/crond
    raw logrotate_executable_location ${logrotate:location}/usr/sbin/logrotate
    raw monitor_httpd_template ${monitor-httpd-conf:location}/${monitor-httpd-conf:filename}
    raw openssl_executable_location ${openssl:location}/bin/openssl
    raw python_executable ${buildout:executable}
    raw python_with_eggs ${buildout:directory}/bin/${extra-eggs:interpreter}
    raw template_wrapper ${monitor-template-wrapper:location}/${monitor-template-wrapper:filename}
depends = 
  ${monitor-eggs:eggs}

[versions]
PyRSS2Gen = 1.1
cns.recipe.symlink = 0.2.3
slapos.toolbox = 0.58