[buildout]


parts =
  consul

[consul]
recipe = slapos.recipe.build

# here, two %s are used, first one is for directory name (eg. x86_64), and second one is for filename (eg. x86-64).
url_x86-64 = https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip
url_x86 = https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_386.zip

# supported architectures md5sums
md5sum_x86 = dfdc0eedd79baab7e6bc56c1582fd02e
md5sum_x86-64 = d6bc0898ea37ae2198370a9e1978d1bb

# script to install.
script =
  location = %(location)r
  self.failIfPathExists(location)
  import sys
  ARCH_DIR_MAP = { 'x86': 'x86', 'x86-64': 'x86_64' }
  WK_SUFIX_MAP = { 'x86': 'i386', 'x86-64': 'amd64' }
  platform = guessPlatform()
  url = self.options['url_' + platform]
  md5sum = self.options['md5sum_' + platform]
  extract_dir = self.extract(self.download(url, md5sum))
  shutil.move(extract_dir, location)
