[buildout]

extends =
  buildout.hash.cfg
  ../../component/restic/buildout.cfg
  ../../component/replication-manager/buildout.cfg
  ../../component/mariadb/buildout.cfg
  ../../component/nginx/buildout.cfg
  ../../component/haproxy/buildout.cfg
  ../../component/logrotate/buildout.cfg
  ../../component/percona-toolkit/buildout.cfg
  ../../component/gzip/buildout.cfg
  ../../component/sed/buildout.cfg
  ../../component/coreutils/buildout.cfg
  ../../component/grep/buildout.cfg
  ../../component/sysbench/buildout.cfg
  ../../component/proxysql/buildout.cfg
  ../../component/socat/buildout.cfg
  ../../component/rsync/buildout.cfg
  ../../stack/supervisord/buildout.cfg
  ../../stack/monitor/buildout.cfg
  ../neoppod/software-common.cfg

parts =
  slapos-cookbook
  mroonga-mariadb
  instance.cfg
  template-mariadb.cfg
  template-mysqld-wrapper
  gowork
  
[python]
part = python3

[instance.cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/instance.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 0644
context =
    key bash_location bash:location
    key bin_directory buildout:bin-directory
    key config_toml_in config-toml.in:target
    key config_cluster_toml_in config-cluster-toml.in:target
    key coreutils_location coreutils:location
    key curl_location curl:location
    key buildout_egg_directory buildout:eggs-directory
    key buildout_develop_directory buildout:develop-eggs-directory
    key buildout_directory buildout:directory
    key buildout_bin_directory buildout:bin-directory
    key dbjobs_in dbjobs-in:target
    key dash_location dash:location
    key jq_location jq-binary:location
    key logrotate_cfg template-logrotate-base:rendered
    key gowork_bin gowork:bin
    key gzip_location gzip:location
    key haproxy_location haproxy:location
    key template_monitor monitor2-template:rendered
    key mariadb_link_binary template-mariadb.cfg:link-binary
    key mariadb_location mariadb:location
    key mysqld_start_template mysqld-need-start.sh.in: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 nginx_conf_in nginx.conf.in:target
    key nginx_location nginx:location
    key percona_toolkit_location percona-toolkit:location
    key proxy_need_stop_start_template proxy-need-start-stop.sh.in:target
    key repman_src_location git.signal18.io_signal18_repman:location
    key rsync_location rsync:location
    key restic_bin_location restic:location
    key socat_location socat:location
    key supervisord_lib supervisord-library:target
    key supervisord_conf supervisord-conf:target
    key template_repman_manager_sh repman-manager-sh.in:target
    key template_mariadb template-mariadb.cfg:target
    key template_mariadb_initial_setup template-mariadb-initial-setup:target
    key template_monitor_cfg monitor2-template:rendered
    key template_my_cnf template-my-cnf:target
    key template_mysqld_wrapper template-mysqld-wrapper:rendered
    key template_init_root_sql mariadb-init-root-sql:target
    key template_init_root_wrapper init-root-wrapper-in:target
    key template_repman_cfg instance-repman.cfg:target
    key unixodbc_location unixodbc:location
    key sysbench_location sysbench:location
    key proxysql_location proxysql:location


[jq-binary]
recipe = hexagonit.recipe.download
url = https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
md5sum = 1fffde9f3c7944f063265e9a5e67ae4f
filename = jq
mode = 0755
download-only = true

[download-file]
recipe  = slapos.recipe.build:download
url     = ${:_profile_base_location_}/${:_update_hash_filename_}
destination = ${buildout:directory}/${:_buildout_section_name_}

[config-toml.in]
<= download-file

[config-cluster-toml.in]
<= download-file

[instance-repman.cfg]
<= download-file

[repman-manager-sh.in]
<= download-file

[template-mariadb.cfg]
<= download-file
link-binary =
  ${coreutils:location}/bin/basename
  ${coreutils:location}/bin/cat
  ${coreutils:location}/bin/cp
  ${coreutils:location}/bin/ls
  ${coreutils:location}/bin/tr
  ${coreutils:location}/bin/uname
  ${gettext:location}/lib/gettext/hostname
  ${grep:location}/bin/grep
  ${sed:location}/bin/sed
  ${mariadb:location}/bin/mysqlbinlog

[template-mariadb-initial-setup]
<= download-file

[template-my-cnf]
<= download-file

[mariadb-init-root-sql]
<= download-file

[init-root-wrapper-in]
<= download-file

[nginx.conf.in]
<= download-file

[dbjobs-in]
<= download-file

[mysqld-need-start.sh.in]
<= download-file

[proxy-need-start-stop.sh.in]
<= download-file