[buildout]
extends =
  buildout.hash.cfg
  ../../component/redis/buildout.cfg
  ../../component/ffmpeg/buildout.cfg
  ../../stack/lamp/buildout.cfg

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

[application]
url = https://download.nextcloud.com/server/releases/nextcloud-27.1.2.tar.bz2
md5sum = a23afb146993d7449b78395739f27742

[template-nextcloud-install.sh]
<= nc-download

[template-nextcloud-config.json]
<= nc-download

[template-nextcloud-instance]
recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance-nextcloud.cfg
extensions = jinja2.ext.do
context =
          key gzip_location          gzip:location
          key python3_location       python3:location
          key news_updater_location  news-updater:location
          key php_location           apache-php:location
          key ffmpeg_location        ffmpeg:location
          raw redis_bin              ${redis:location}/bin/redis-server
          raw redis_cli              ${redis:location}/bin/redis-cli
          key nextcloud_install_sh   template-nextcloud-install.sh:target
          key nextcloud_parameter_json template-nextcloud-config.json:target
          section nextcloud_apps     nextcloud-apps

[custom-application-deployment]
path = ${template-nextcloud-instance:output}
part-list = nextcloud-install.sh
db-name = nextcloud
db-user = nextcloud

[nc-download-unpacked]
recipe = slapos.recipe.build:download-unpacked

[news-updater]
<= nc-download-unpacked
url = https://github.com/nextcloud/news-updater/archive/11.0.0.tar.gz
md5sum = 1e75222638cab49d3f66b7c76394f104

[nextcloud-app-spreed]
<= nc-download-unpacked
url = https://github.com/nextcloud-releases/spreed/releases/download/v17.1.1/spreed-v17.1.1.tar.gz
md5sum = 24e6be17fb232a3c18de5e9c0a03c7c3

[nextcloud-app-richdocuments]
<= nc-download-unpacked
url = https://github.com/nextcloud/richdocuments/releases/download/v8.2.0/richdocuments.tar.gz
md5sum = 1e9176b0f08670996488572aea081996

[nextcloud-app-calendar]
<= nc-download-unpacked
url = https://github.com/nextcloud-releases/calendar/releases/download/v4.5.2/calendar-v4.5.2.tar.gz
md5sum = 88adcbc34ef7e461f515ba96b82365d9

[nextcloud-app-snappymail]
<= nc-download-unpacked
url = https://snappymail.eu/repository/nextcloud/snappymail-2.29.4-nextcloud.tar.gz
md5sum = 676bf0fa3b9f0fb9f0208304cf302a26

[nextcloud-app-news]
<= nc-download-unpacked
url = https://github.com/nextcloud/news/releases/download/24.0.0/news.tar.gz
md5sum = 8e1a7e3e49e6dbd754bc1b9ff2f85371

[nextcloud-apps]
spreed = ${nextcloud-app-spreed:location}
richdocuments = ${nextcloud-app-richdocuments:location}
calendar = ${nextcloud-app-calendar:location}
snappymail = ${nextcloud-app-snappymail:location}
news = ${nextcloud-app-news:location}
