# adapt https://svn.erp5.org/repos/public/experimental/erp5.buildout
[buildout]
parts = zope-instance

[zope-instance]
depends = ${create_mysql_database:command}
recipe = erp5.recipe.standaloneinstance
zope2-location = ${software_definition:zope_software}
user = zope:zope

# modify this to reflect your local mysql configuration
# Format:
#     database[@host[:port]] [user [password [unix_socket]]]
#   e.g "erp5db erp5user somepassword" or "erp5db erp5user"
erp5_sql_connection_string = ${:mysql_database_name}@${configuration:mysql_host}:${configuration:mysql_port} root
eggs = ${eggs:eggs}

zope_conf_template =
  ${buildout:directory}/templates/default-erp5-standalone-zope.conf.in

portal_id = erp5
bt5-path = ${software_definition:bt5-erp5}
bt5 =
force-zodb-update = false
# zope.conf template part BEGIN
# instancehome and http-address have to be defined
# User modifable keys:
products =
  products ${software_definition:cmf15}
  products ${software_definition:products-deps}
  products ${software_definition:products-erp5}
  products ${software_definition:products-other}/Products
environment =
debug-mode = off
ip-address = 0.0.0.0
# Good defaults, which do not have to be touch:
clienthome = ${:instancehome}/var
lib_path = ${:instancehome}/lib/python
effective-user =
enable-product-installation = on
locale =
datetime-format = us
zserver-threads = 4
python-check-interval = 500
zserver-read-only-mode = off
pid-filename = ${:clienthome}/Z2.pid
lock-filename = ${:clienthome}/Z2.lock
mime-types =
structured-text-header-level = 3
rest-input-encoding =
rest-output-encoding =
rest-header-level = 3
rest-language-code = en
cgi-environment =
dns-server =
http-realm = Zope
cgi-maxlen = 0
http-header-max-length = 8192
automatically-quote-dtml-request-data = on
trusted-proxy =
publisher-profile-file =
security-policy-implementation = C
skip-authentication-checking = off
skip-ownership-checking = off
verbose-security = off
maximum-number-of-session-objects = 1000
session-add-notify-script-path =
session-delete-notify-script-path =
session-timeout-minutes = 20
session-resolution-seconds = 20
suppress-all-access-rules = off
suppress-all-site-roots = off
database-quota-size =
read-only-database = off
eventlog-level = info
eventlog-path = ${:instancehome}/log/event.log
access-level = WARN
access-path = ${:instancehome}/log/Z2.log
access-format = %(message)s
warnfilter =
max-listen-sockets = 100
port-base = 0
large-file-threshold =
default-zpublisher-encoding = utf8
http-force-connection-close = off
zodb-path = ${:instancehome}/var/Data.fs
# zope.conf template part ENDS

[create_mysql_database]
# XXX: This have to be converted into recipe
recipe = plone.recipe.command
command =
  echo "CREATE DATABASE IF NOT EXISTS ${zope-instance:mysql_database_name} DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci" | ${buildout:data-bin-directory}/mysql -u root
update-command = ${:command}

[bt5list]
recipe = erp5.recipe.genbt5list
bt5_base = ${bt5-erp5:location}
bt5_urls = ${bt5-erp5:urls}
genbt5list = ${software_definition:products-erp5}/ERP5/bin/genbt5list