# Based on http://wiki.freepbx.org/display/HTGS/Installing+FreePBX+on+Debian+Wheezy
[buildout]
extends =
  ../../component/dash/buildout.cfg
  ../../component/dcron/buildout.cfg
  ../../component/logrotate/buildout.cfg
  ../../component/asterisk/buildout.cfg
  ../../component/apache-php/buildout.cfg
  ../../component/freepbx/buildout.cfg
  ../../stack/slapos.cfg

parts =
  asterisk
  apache-php
  freepbx
  php-db
  template
  template-freepbx

[networkcache]
# signature certificates of the following uploaders.
#   Romain Courteaud
#   Test Agent
signature-certificate-list =
  -----BEGIN CERTIFICATE-----
  MIIB4DCCAUkCADANBgkqhkiG9w0BAQsFADA5MQswCQYDVQQGEwJGUjEZMBcGA1UE
  CBMQRGVmYXVsdCBQcm92aW5jZTEPMA0GA1UEChMGTmV4ZWRpMB4XDTExMDkxNTA5
  MDAwMloXDTEyMDkxNTA5MDAwMlowOTELMAkGA1UEBhMCRlIxGTAXBgNVBAgTEERl
  ZmF1bHQgUHJvdmluY2UxDzANBgNVBAoTBk5leGVkaTCBnzANBgkqhkiG9w0BAQEF
  AAOBjQAwgYkCgYEApYZv6OstoqNzxG1KI6iE5U4Ts2Xx9lgLeUGAMyfJLyMmRLhw
  boKOyJ9Xke4dncoBAyNPokUR6iWOcnPHtMvNOsBFZ2f7VA28em3+E1JRYdeNUEtX
  Z0s3HjcouaNAnPfjFTXHYj4um1wOw2cURSPuU5dpzKBbV+/QCb5DLheynisCAwEA
  ATANBgkqhkiG9w0BAQsFAAOBgQBCZLbTVdrw3RZlVVMFezSHrhBYKAukTwZrNmJX
  mHqi2tN8tNo6FX+wmxUUAf3e8R2Ymbdbn2bfbPpcKQ2fG7PuKGvhwMG3BlF9paEC
  q7jdfWO18Zp/BG7tagz0jmmC4y/8akzHsVlruo2+2du2freE8dK746uoMlXlP93g
  QUUGLQ==
  -----END CERTIFICATE-----
  -----BEGIN CERTIFICATE-----
  MIIB9jCCAV+gAwIBAgIJAKRvzcy7OH0UMA0GCSqGSIb3DQEBBQUAMBMxETAPBgNV
  BAMMCENPTVAtNzcyMCAXDTEyMDgxMDE1NDI1MVoYDzIxMTIwNzE3MTU0MjUxWjAT
  MREwDwYDVQQDDAhDT01QLTc3MjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
  o7aipd6MbnuGDeR1UJUjuMLQUariAyQ2l2ZDS6TfOwjHiPw/mhzkielgk73kqN7A
  sUREx41eTcYCXzTq3WP3xCLE4LxLg1eIhd4nwNHj8H18xR9aP0AGjo4UFl5BOMa1
  mwoyBt3VtfGtUmb8whpeJgHhqrPPxLoON+i6fIbXDaUCAwEAAaNQME4wHQYDVR0O
  BBYEFEfjy3OopT2lOksKmKBNHTJE2hFlMB8GA1UdIwQYMBaAFEfjy3OopT2lOksK
  mKBNHTJE2hFlMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAaNRx6YN2
  M/p3R8/xS6zvH1EqJ3FFD7XeAQ52WuQnKSREzuw0dsw12ClxjcHiQEFioyTiTtjs
  5pW18Ry5Ie7iFK4cQMerZwWPxBodEbAteYlRsI6kePV7Gf735Y1RpuN8qZ2sYL6e
  x2IMeSwJ82BpdEI5niXxB+iT0HxhmR+XaMI=
  -----END CERTIFICATE-----

[directory]
recipe = slapos.cookbook:mkdirectory
template = ${buildout:directory}/template

##########################################################
# Service startup scripts and configuration files
##########################################################
[template-asterisk-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-asterisk.conf.in
md5sum = a7f239be1f3fc47c96946a00e926a75e
output = ${directory:template}/template-asterisk.conf.in
mode = 0644

[template-asterisk-cdr-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-asterisk.cdr_mysql.conf.in
md5sum = c6348ff0136cff90b74252d292fbaf0a
output = ${directory:template}/template-asterisk.cdr_mysql.conf.in
mode = 0644

[template-asterisk-manager-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-asterisk.manager.conf.in
md5sum = 2c4eb1aab29b8387c32bba73d7c22e90
output = ${directory:template}/template-asterisk.manager.conf.in
mode = 0644

[template-asterisk-version]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = ${asterisk:location}/sbin/asterisk -V > ${:output}
output = ${directory:template}/template-asterisk.version

[template-asterisk-service]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-asterisk-service.sh.in
md5sum = 88cb162c57bfe71d29d0a6da9870b60e
output = ${directory:template}/template-asterisk-service.sh.in
mode = 0644

[template-mariadb-create-database]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-mariadb-create-database.sh.in
md5sum = b4ed05d296dc99ae31755a173185b5cb
output = ${directory:template}/template-mariadb-create-database.sh.in
mode = 0644

[template-mariadb-create-database-sql]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-mariadb-create-database.sql.in
md5sum = 338eeb0ae7256a077ec4bc84938d760c
output = ${directory:template}/template-mariadb-create-database.sql.in
mode = 0644

[template-mariadb-init-database]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-mariadb-init-database.sh.in
md5sum = b82dfc91706cbfd2f80fe388f6eea79e
output = ${directory:template}/template-mariadb-init-database.sh.in
mode = 0644

[template-mariadb-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-mariadb.cnf.in
md5sum = 1cca66ad506d9ca9764908e439b96776
output = ${directory:template}/template-mariadb.cnf.in
mode = 0644

[template-mariadb-service]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-mariadb-service.sh.in
md5sum = ffdab23da2d2a3aa78fe26ed9d407609
output = ${directory:template}/template-mariadb-service.sh.in
mode = 0644

[template-apache-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-apache.conf.in
md5sum = d586c448c97f1259f9de0a22a67b8223
output = ${directory:template}/template-apache.conf.in
mode = 0644

[template-apache-service]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-apache-service.sh.in
md5sum = 88b77bd408cd2206c9a8c63c02673b48
output = ${directory:template}/template-apache-service.sh.in
mode = 0644

[template-freepbx-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-amportal.conf.in
md5sum = eb5264421261c192bc20d6b42bda0e2b
output = ${directory:template}/template-amportal.conf.in
mode = 0644

[template-freepbx-php-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-freepbx-configuration.in
md5sum = e21ed8993199ec20d96283887832e4ce
output = ${directory:template}/template-freepbx-configuration.in
mode = 0644

[template-freepbx-copy-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-freepbx-copy-configuration.sh.in
md5sum = 7fa1d0b588414d83a8a77f1dc8834b9d
output = ${directory:template}/template-freepbx-copy-configuration.sh.in
mode = 0644

##########################################################
# Buildout instance.cfg templates
##########################################################
[template-freepbx]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-freepbx.cfg.in
md5sum = e21751f2853fbc5f981d4cbc724d302c
output = ${directory:template}/template-freepbx.cfg
mode = 0644

[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
md5sum = 3008b6064d88cd3e3b5e4deeb0d231e9
output = ${buildout:directory}/template.cfg
mode = 0644

[versions]