[buildout]
parts = switch-softwaretype

eggs-directory = {{ buildout_egg_directory }}
develop-eggs-directory = {{ buildout_develop_directory }}

[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default  = template-{{ instance_template_type }}:output
RootSoftwareInstance = ${:default}
test = template-beremiz-test:output

[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}

[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
output = ${buildout:directory}/${:filename}
extensions = jinja2.ext.do
extra-context =
context =
  key develop_eggs_directory   buildout:develop-eggs-directory
  key buildout_directory       buildout:directory
  key eggs_directory           buildout:eggs-directory
  key ipv4                     slap-configuration:ipv4
  key ipv6                     slap-configuration:ipv6
  key global_ipv4_prefix       network-information:global-ipv4-network
  key slapparameter_dict       slap-configuration:configuration
  key computer_id              slap-configuration:computer
  raw bin_directory            {{ bin_directory }}
  raw template_monitor         {{ template_monitor_cfg }}
  raw template_logrotate       {{ logrotate_cfg }}
  raw logrotate_cfg            {{ logrotate_cfg }}
  raw python_bin               {{ python_bin }}
  ${:extra-context}

[template-beremiz]
<= jinja2-template-base
url = {{ template_instance_beremiz }}
filename = instance-beremiz.cfg
extra-context =
  raw autoconf_bin       {{ autoconf_location }}/bin
  raw automake_bin       {{ automake_location }}/bin
  raw bash_bin           {{ bash_location }}/bin/bash
  raw beremiz_location   {{ beremiz_location }}
  raw bison_location     {{ bison_location }}
  raw flex_location      {{ flex_location }}
  raw fluxbox_location   {{ fluxbox_location }}
  raw fluxbox_menu       {{ template_fluxbox_menu }}
  raw font_config_loc    {{ fontconfig_location }}
  raw font_config_tmplt  {{ template_fonts_conf_target }}
  raw font_dejavu        {{ font_dejavu }}
  raw font_liberation    {{ font_liberation }}
  raw gcc_location       {{ gcc_location }}
  raw git_bin_dir        {{ git_location }}
  raw gtk3_location      {{ gtk3_location }}
  raw matiec_location    {{ matiec_location }}
  raw mesa_location      {{ mesa_location }}
  raw novnc_location     {{ novnc_location }}
  raw openssl_bin        {{ openssl_location }}/bin/openssl
  raw websockify_bin     {{ bin_directory }}/websockify
  raw x11vnc_bin         {{ x11vnc_location }}/bin/x11vnc
  raw xvfb_bin           {{ xserver_location }}/bin/Xvfb
  raw xterm_bin          {{ xterm_location }}/bin/xterm

[template-beremiz-test]
<= jinja2-template-base
url = {{ template_instance_beremiz_test }}
filename = instance-beremiz-test.cfg
extra-context =
  key instance_beremiz   template-beremiz:output
  raw beremiz_location   {{ beremiz_location }}
  raw sikulix_bin        {{ sikulix_bin }}
  raw xvfb_bin           {{ xserver_location }}/bin/Xvfb
  raw wmctrl_bin         {{ wmctrl_location }}/bin/wmctrl
  raw instance_nxdtest   {{ nxdtest_template }}
  raw xdotool_bin        {{ xdotool_location }}/bin/xdotool
  raw opencv_location    {{ opencv_location }}
  raw nxdtest_dir        {{ buildout_directory }}
