[buildout]
extends =
  ../curl/buildout.cfg
  ../libevent/buildout.cfg
  ../erlang/buildout.cfg

parts =
  membase-source
  membase-memcached
  membase-libmemcached
  membase-libconflate
  membase-libvbucket
  membase-moxi
  membase-bucket_engine
  membase-ep-engine
  membase-membase-cli
  membase-memcachetest
  membase-ns_server
  membase-vbucketmigrator

[membase]
location = ${buildout:parts-directory}/${:_buildout_section_name_}

[membase-source]
<= membase-1.7.0-source

[membase-1.7.0-source]
<= membase-source-common
url = http://files.couchbase.com/source/membase-server_src-1.7.0.tar.gz
md5sum = c933fffea299d00e43b002cb65738663

[membase-source-common]
recipe = hexagonit.recipe.download
ignore-existing = true
strip-top-level-dir = true

[membase-component-common]
recipe = slapos.recipe.cmmi
path = ${membase-source:location}/${:component}
prefix = ${membase:location}
configure-options =
  --prefix=${:prefix}
  ${:component-configure-options}

[membase-libmemcached]
<= membase-component-common
component = libmemcached
component-configure-options =
  --disable-static
  --enable-shared
  --disable-dtrace
  --without-docs
  --disable-sasl
  --with-memcached=${membase:location}/bin/memcached

[membase-memcached]
<= membase-component-common
component = memcached
patches =
configure-command =
  ./configure
component-configure-options =
  --enable-isasl

[membase-libconflate]
<= membase-component-common
component = libconflate
component-configure-options =
  --disable-static
  --enable-shared
  --without-check
  --with-libcurl-prefix=${curl:location}

[membase-libvbucket]
<= membase-component-common
component = libvbucket
component-configure-options =
  --disable-static
  --enable-shared
  --without-docs
  --with-libhashkit-prefix=${membase:location}

[membase-moxi]
<= membase-component-common
component = moxi
component-configure-options =
  --enable-moxi-libvbucket
  --enable-moxi-libmemcached
  --without-check
  --with-libevent-prefix=${libevent:location}
  --with-libmemcached-prefix=${membase:location}
  --with-memcached=${membase:location}/bin/memcached
  --with-libhashkit-prefix=${membase:location}
  --with-libconflate-prefix=${membase:location}
  --with-libvbucket-prefix=${membase:location}

[membase-bucket_engine]
<= membase-component-common
component = bucket_engine
component-configure-options =
  --with-memcached=${membase-source:location}/memcached

[membase-ep-engine]
<= membase-component-common
component = ep-engine
component-configure-options =
  --with-memcached=${membase-source:location}/memcached

[membase-membase-cli]
<= membase-component-common
component = membase-cli
patches =
configure-command =
  ./configure
component-configure-options =

[membase-memcachetest]
<= membase-component-common
component = memcachetest
component-configure-options =
  --with-memcached=${membase:location}/bin/memcached

[membase-ns_server]
<= membase-component-common
component = ns_server
patches =
configure-command =
  ./configure
component-configure-options =
environment =
  PATH=${erlang:location}/bin:%(PATH)s

[membase-vbucketmigrator]
<= membase-component-common
component = vbucketmigrator
component-configure-options =
  --without-sasl
  --with-isasl

