[buildout]
parts = ctl pack

[deployment]
recipe = zc.recipe.deployment
name = ample
user = zope

[ctl]
recipe = zc.recipe.rhrc
deployment = deployment
chkconfig = 345 99 10
parts = main index

[server]
recipe = zc.zodbrecipes:server
deployment = deployment
zeo.conf =
   <zeo>
      address ${:address}
   </zeo>
   %import zc.zlibstorage
   <zlibstorage>
     <filestorage>
        path ${:path}
        pack-gc false
     </filestorage>
   </zlibstorage>

[main]
<= server
address = :8100
path = /var/databases/ample/main.fs

[index]
<= server
address = :8200
path = /var/databases/ample/index.fs

[gc-config]
recipe = zc.recipe.deployment:configuration
deployment = deployment
text =
    <zodb main>
      <zeoclient>
         server ${main:address}
      </zeoclient>
    </zodb>
    <zodb index>
      <zeoclient>
         server ${index:address}
      </zeoclient>
    </zodb>

[pack.sh]
recipe = zc.recipe.deployment:configuration
deployment = deployment
text =
  ${buildout:bin-directory}/zeopack -d3 -t00 ${main:address} ${index:address}

  ${buildout:bin-directory}/multi-zodb-gc -d3 -lERROR ${gc-config:location}

[pack]
recipe = zc.recipe.deployment:crontab
deployment = deployment
times = 1 2 * * 6
command = sh ${pack.sh:location}