[buildout]
extends =
  buildout.hash.cfg
#apache-php mariadb zilb ...
  ../../stack/lamp/buildout.cfg
# "slapos" stack describes basic things needed for 99.9% of SlapOS Software
  ../../stack/slapos.cfg
  
parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
# in 99,9% of Slapos Software Releases)
  slapos-cookbook
# to create file instance-matomo.cfg in instance of apache-php
  template-matomo-instance
# to create file instance.cfg of all instances
  instance

# download bas
# inherited by modules that need to download files
[matomo-download]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}

# download matomo
# The specific process of downloading and decompressing is defined in stack lamp
[application]
url = https://builds.matomo.org/matomo-4.7.1.zip
md5sum = 8d592676bc2c0d51363ad7b2caf171fe

# give the location of the instance-matomo.cfg fil
# Without it the instance-matomo.cfg file will not be executed
[custom-application-deployment]
path = ${template-matomo-instance:rendered}
part-list = matomo-backup.sh

[template-matomo-instance]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance-matomo.cfg
extensions = jinja2.ext.do
context =
          key gzip_location gzip:location
          key python3_location python3:location
          key php_location apache-php:location
          key matomo_apache_httpd template-apache-httpd:target
          key matomo_backup_sh template-matomo-backup.sh:target

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

# download matomo-backup.sh.in
[template-matomo-backup.sh] 
<= matomo-download


