# XXX refactor parts shared with erp5.cfg into a common file
[buildout]
extends =
  mysql-tritonn-5.0.cfg
  python-2.6.cfg
  lxml-python.cfg
  mysql-python.cfg
  python-ldap-python.cfg
  pysvn-python.cfg
  subversion.cfg
  git.cfg
  glib.cfg

parts =
  itools-build
  mysql-python
  products-other
  products-deps
  products-erp5

# ugly itools building sections until itools and setuptools learn to get
# along:

[itools-download]
recipe = hexagonit.recipe.download
strip-top-level-dir = true
url = http://download.hforge.org/itools/0.50/${itools:pkgname}.tar.gz
md5sum = 12704cc354e2201e0921a832bf6b1556
destination = ${itools:source}

[itools-build]
recipe = plone.recipe.command
# reference itools-download:destination instead of itools:source to trigger its
# execution
command =
    cd ${itools-download:destination} &&
    ${python2.6:executable} setup.py build_ext -L ${glib:location}/lib -I ${glib:location}/include/glib-2.0:${glib:location}/lib/glib-2.0/include -R ${glib:location}/lib &&
    ${python2.6:executable} setup.py install_lib -d ${itools:lib}

update-command = ${:command}
location = ${itools:location}
stop-on-error = true

[products-deps]
# Recipe minitage.recipe.fetch is disabled, as it uses PATH variable, but it
# is not possible to change its environment to use localy delivered subversion
# nor git. plone.recipe.command can do same job, but it is controllable which
# binary will be used
recipe = plone.recipe.command
svn_param =--trust-server-cert --non-interactive --quiet
location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true
command =
  ${subversion:location}/bin/svn checkout ${:svn_param} https://svn.plone.org/svn/collective/ExtFile/trunk ${:location}/ExtFile &&
  ${git:location}/bin/git clone --quiet git://git.hforge.org/Localizer.git ${:location}/Localizer
update-command =
  ${subversion:location}/bin/svn checkout ${:svn_param} https://svn.plone.org/svn/collective/ExtFile/trunk ${:location}/ExtFile &&
  cd ${:location}/Localizer &&
  ${git:location}/bin/git pull --quiet

[products]
recipe = plone.recipe.command
paths =
	${products-deps:location}
command =
  echo "Product folders: ${:paths}"
update-command = ${:command}

[eggs]
recipe = zc.recipe.egg
eggs =
  ${mysql-python:egg}
  ${lxml-python:egg}
  ${python-ldap-python:egg}
  ${pysvn-python:egg}
  PyXML
  SOAPpy
  cElementTree
  chardet
  elementtree
  erp5diff
  ipdb
  mechanize
  numpy
  ordereddict
  paramiko
  ply
  python-memcached
  pytz
  simplejson
  threadframe
  timerserver
  urlnorm
  uuid
  xml_marshaller
  xupdate_processor
  feedparser

# Zope 2.12 with patched acquisition
  Zope2
  Acquisition

# Other Zope 2 packages
  Products.PluggableAuthService
  Products.PluginRegistry

# CMF 2.2
  Products.CMFActionIcons
  Products.CMFCalendar
  Products.CMFCore
  Products.CMFDefault
  Products.CMFTopic
  Products.CMFUid
  Products.DCWorkflow
  Products.GenericSetup
  five.localsitemanager

# Other products
    Products.DCWorkflowGraph
    Products.MimetypesRegistry
    Products.ExternalEditor
    Products.Zelenium

# Currently forked in our repository
#    Products.PortalTransforms
# Dependency for our fork of PortalTransforms
    StructuredText

extra-paths =
  ${itools:lib}

dependent-scripts = true
# XXX getting python from [buildout] for the benefit of instance recipes
# which should not attempt to compile python again
#python = python2.6

# parameterizing the version of the generated python interpreter name by the
# python section version causes dependency between this egg section and the
# installation of python, which we don't want on an instance
interpreter = python2.6
scripts =
	python=${:interpreter}
	ipython=i${:interpreter}

[precache-eggs]
# recipe to populate the egg cache during software-home build, so instances can
# run in offline mode. Hence, no scripts
recipe = zc.recipe.egg
scripts =
eggs =
  collective.recipe.supervisor
  collective.recipe.template
  erp5.recipe.mysqlserver
  erp5.recipe.ooodinstance
  erp5.recipe.standaloneinstance
  erp5.recipe.testrunner
  plone.recipe.command
  plone.recipe.zope2instance
  supervisor

[omelette]
# XXX don't use this part until this omelette bug is fixed:
# https://bugs.launchpad.net/collective.buildout/+bug/553005
recipe = collective.recipe.omelette
eggs = ${eggs:eggs}
packages =
      ${itools:lib} .
products =
    ${products:paths}