[buildout]

extends =
  ../../stack/lamp/buildout.cfg
  ../../component/git/buildout.cfg

parts +=
  pear-modules
  slapos.cookbook-repository
  slapos-cookbook
  check-recipe
  instance


develop =
  ${:parts-directory}/slapos.cookbook-repository


[apache-php]
url = http://fr2.php.net/distributions/php-5.3.23.tar.gz
md5sum = 9cd92b0de2b51dcd372f46fa623984f4


[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = drupal
git-executable = ${git:location}/bin/git

[application-template]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/settings.php.in
md5sum = 0406dfa6a733a541257ccf13c36366f7
download-only = True
filename = template.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}

[application-configuration]
location = sites/default/settings.php


[datapublic-download]
recipe = slapos.recipe.build:download-unpacked
url = http://ftp.drupal.org/files/projects/datapublic-7.x-1.0-beta2.tar.gz
md5sum = fcd038ee4cc4409f21e3f99787b7ed0e

[application]
# replace the download recipe to preprare the make step
recipe = cp.recipe.cmd
dependency = ${datapublic-download:recipe}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
update_cmd = ${:install_cmd}
install_cmd =
    # update drupal itself for security reasons
    sed -i "s|7\.12$|7\.22|g" ${datapublic-download:location}/build-datapublic.make
    sed -i "s|7\.12$|7\.22|g" ${datapublic-download:location}/datapublic.make
    # we won't need to use a github account to download.
    sed -i "s|git@github.com:\(.*\)|https://github.com/\1|g" ${datapublic-download:location}/build-datapublic.make
    sed -i "s|git@github.com:\(.*\)|https://github.com/\1|g" ${datapublic-download:location}/datapublic.make
    rm -rf ${:location}
    ${apache-php:location}/bin/drush make ${datapublic-download:location}/datapublic.make ${:location}



[pear-modules]
recipe = cp.recipe.cmd
pear = ${apache-php:location}/bin/pear
install_cmd =
    ${:pear} channel-info pear.drush.org >/dev/null || ${:pear} channel-discover pear.drush.org
    ${:pear} info drush/drush >/dev/null || ${:pear} install drush/drush-5.8.0
    ${:pear} info Console_Table >/dev/null || ${:pear} install Console_Table

[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command =
  grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link

[versions]
slapos.cookbook =