[buildout]

ignore-existing = true

parts =
  slapos-cookbook
  apache-php
  php-redis
  php-imagick
  php-apcu
  mariadb
  mroonga-mariadb
  dropbear
  eggs
  instance

  instance-apache-php
  template-mariadb
  instance-lamp

extends =
  buildout.hash.cfg
  ../../component/curl/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/dropbear/buildout.cfg
  ../../component/git/buildout.cfg
  ../../component/glib/buildout.cfg
  ../../component/gzip/buildout.cfg
  ../../component/lxml-python/buildout.cfg
  ../../component/mariadb/buildout.cfg
  ../../component/perl/buildout.cfg
  ../../component/sqlite3/buildout.cfg
  ../../component/stunnel/buildout.cfg
  ../../component/zlib/buildout.cfg
  ../erp5/buildout.cfg
  ../logrotate/buildout.cfg
  ../resilient/buildout.cfg
  ../../component/apache-php/buildout.cfg


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

[application]
recipe = hexagonit.recipe.download
ignore-existing = true
# If the provided tarball does not contain top directory, this option should be changed to false
strip-top-level-dir = true

#----------------
#--
#-- Optional part allowing applications using this stack to run a custom
#-- instance.cfg at the end of Apache/PHP instance deployment.
#-- To use it in your application, just override those two parameters, like:

[custom-application-deployment]
# path = /path/to/instance-custom.cfg
# part-list = part1 part2
# See software/maarch/software.cfg for an example.
path =
part-list =

#----------------
#-- Instance-level buildout profiles.

[instance]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/instance.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 0644
context =
    key application_location application:location
    key application_deployment_part_list custom-application-deployment:part-list
    key apache_location apache:location
    key apache_php_location apache-php:location
    key bash_location bash:location
    key bin_directory buildout:bin-directory
    key coreutils_location coreutils:location
    key buildout_egg_directory buildout:eggs-directory
    key buildout_develop_directory buildout:develop-eggs-directory
    key buildout_directory buildout:directory
    key dash_location dash:location
    key findutils_location findutils:location
    key logrotate_location logrotate:location
    key logrotate_cfg template-logrotate-base:rendered
    key gzip_location gzip:location
    key stunnel_location stunnel:location
    key template_monitor monitor2-template:rendered
    key mariadb_link_binary template-mariadb:link-binary
    key mariadb_location mariadb:location
    key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
    key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
    key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target
    key mroonga_mariadb_install_sql mroonga-mariadb:install-sql
    key mroonga_mariadb_plugin_dir mroonga-mariadb:plugin-dir
    key groonga_plugin_dir groonga:groonga-plugin-dir
    key groonga_mysql_normalizer_plugin_dir groonga-normalizer-mysql:groonga-plugin-dir
    key percona_toolkit_location percona-toolkit:location
    key template_php_ini template-php.ini:output
    key template_apache_conf template-apache.conf:output
    key template_apache_php instance-apache-php:output
    key template_lamp instance-lamp:output
    key template_mariadb template-mariadb:target
    key template_mariadb_initial_setup template-mariadb-initial-setup:target
    key template_mysqld_wrapper template-mysqld-wrapper:rendered
    key template_my_cnf template-my-cnf:target
    key unixodbc_location unixodbc:location
    key openssl_location openssl:location
    key custom_application_template custom-application-deployment:path

[instance-apache-php]
<= template-download-base
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}

[instance-lamp]
<= template-download-base
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}

[template-apache.conf]
<= template-download-base
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}

[template-php.ini]
<= template-download-base
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}

[erp5]
# lamp stack reuses erp5 stack to have mariadb, but we don't need to checkout erp5 here.
recipe = 
location = ${buildout:parts-directory}/${:_buildout_section_name_}


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