[buildout]

ignore-existing = true

parts =
  slapos-cookbook
  php-redis
  php-imagick
  php-apcu
  dropbear
  eggs
  lamp-instance

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/xz-utils/buildout.cfg
  ../../component/zlib/buildout.cfg
  ../erp5/buildout.cfg
  ../logrotate/buildout.cfg
  ../resilient/buildout.cfg
  ../../component/apache-php/buildout.cfg


[template-download-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}

[application]
recipe = slapos.recipe.build:download-unpacked
# softwares using this stack can extend this section to provide the url of
# an archive containing the application using url and md5sum options.
# The archive will be extracted directly in apache's DocumentRoot folder.
# In case the archive contain multiple files and folders and only a
# specific folder should be used as DocumentRoot, archive-root can be
# set to the relative path of this folder.
archive-root =

#----------------
#--
#-- 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 =
# database information
db-name = lamp
db-user = lamp
db-password = insecure

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

[lamp-instance]
recipe = slapos.recipe.template:jinja2
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
context =
    key application_location application:location
    key application_archive_root application:archive-root
    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:output
    key gzip_location gzip:location
    key xz_utils_location xz-utils:location
    key template_monitor monitor2-template:output
    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:target
    key template_apache_conf template-apache.conf:target
    key template_apache_php instance-apache-php:target
    key template_lamp instance-lamp:target
    key template_mariadb template-mariadb:target
    key template_mariadb_initial_setup template-mariadb-initial-setup:target
    key template_mysqld_wrapper template-mysqld-wrapper:output
    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
    key db_name custom-application-deployment:db-name
    key db_user custom-application-deployment:db-user
    key db_password custom-application-deployment:db-password
    key lamp_apache_httpd template-apache-httpd:target

[instance-apache-php]
<= template-download-base

[instance-lamp]
<= template-download-base

[template-apache.conf]
<= template-download-base

[template-php.ini]
<= template-download-base

# download apache-httpd.conf.in
[template-apache-httpd]
<= template-download-base

[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 =
  ${slapos-toolbox:eggs}