[buildout]
extends =
  ../patch/buildout.cfg

parts = busybox

[busybox]
recipe = slapos.recipe.build
url = http://git.busybox.net/busybox/snapshot/busybox-1_20_2.tar.gz
md5sum = 025acebb48040ef62dd635d416d317e8
patches =
    ${:_profile_base_location_}/busybox-1_20_2.patch#292498db86c46e101bb14bf2c74c36f0
install =
    env = self.environ
    extract_dir = self.extract(self.download(options['url'], options['md5sum']))
    workdir = guessworkdir(extract_dir)
    self.applyPatchList(options.get('patches'), '-p1', cwd=workdir)
    self.logger.info("Creating default configuration")
    call(['make', 'defconfig'], cwd=workdir, env=env)
    self.logger.info("Building")
    call(['make'], cwd=workdir, env=env)
    self.logger.info("Installing")
    call(['make', 'CONFIG_PREFIX=' + location, 'install'], cwd=workdir, env=env)
    self.logger.info("Installation finished")
environment =
  PATH=${patch:location}/bin:%(PATH)s
