[buildout]
extends =
  ../autoconf/buildout.cfg
  ../automake/buildout.cfg
  ../libtool/buildout.cfg
  ../git/buildout.cfg
  ../openssl/buildout.cfg
  ../util-linux/buildout.cfg

parts = accords

[accords-source]
recipe = slapos.recipe.build:gitclone
repository = http://git.gitorious.ow2.org/ow2-compatibleone/accords-platform.git

[accords]
# Part of Compatible One project
# http://gitorious.ow2.org/ow2-compatibleone/accords-platform
recipe = hexagonit.recipe.cmmi
#url = http://gitorious.ow2.org/ow2-compatibleone/accords-platform/archive-tarball/master
path = ${accords-source:location}/
#md5sum = 
# Replaces autogen.sh
configure-command =
  ./clean
  libtoolize -c -f
  aclocal -I ${libtool:location}/share/aclocal
  automake -c -a -f --add-missing
  autoreconf --install
  ./configure
configure-options =
  --with-ssl=${openssl:location}
  --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
environment =
  CPPFLAGS =-I${libuuid:location}/include -I${openssl:location}/include
  LDFLAGS =-Wl,-rpath=${openssl:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib
  LIBTOOL=libtool
  PATH=${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:%(PATH)s

# Accords makefile does not install necessary scripts. Let's copy it
[accords-scripts]
recipe = plone.recipe.command
requires = ${accords:location}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
origin = ${accords-source:location}/scripts
destination = ${:location}
command = ([ -e ${:origin}/co-broker ] && [ ! -e ${:destination}/co-broker ] && mkdir ${:destination} && cp -r ${:origin} ${:destination})
