########################################################
# Dropbear - a secure shell client and server for *nix #
#                                                      #
# http://matt.ucc.asn.au/dropbear/dropbear.html        #
########################################################

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

parts =
  dropbear-output

[dropbear]
recipe = slapos.recipe.cmmi
md5sum = 0284ea239083f04c8b874e08e1aca243
# XXX: We still use an old version of dropbear instead of the last one
#      in order have all patches working.
url = https://matt.ucc.asn.au/dropbear/releases/dropbear-0.53.1.tar.bz2

configure-options =
  --with-zlib=${zlib:location}
  CFLAGS="-DENABLE_SINGLEUSER -D__DIRTY_NO_SHELL_CHECKING"

environment =
  CPPFLAGS =-I${zlib:location}/include
  LDFLAGS =-Wl,-rpath=${zlib:location}/lib -L${zlib:location}/lib
  PATH=${patch:location}/bin:%(PATH)s

patches=
  ${:_profile_base_location_}/userspace.patch#3d934c2c90e8c57536a4fa2cf8ad216d
  ${:_profile_base_location_}/ipv6-support.patch#b30dd58d68829a80eee69188134382ef
  ${:_profile_base_location_}/no-shell-checking.patch#bb2ac410bd4cb2b07c23bfcc712e45f7
  ${:_profile_base_location_}/dropbear-0.53.1-static_build_fix.patch#6e0ccc1949dfa31b4bc3951b9bb6472e

patch-options=
  -p1

[dropbear-output]
# Shared binary location to ease migration
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = ${coreutils-output:test} -x ${:ssh} -a -x ${:keygen}
ssh = ${dropbear:location}/bin/dbclient
keygen = ${dropbear:location}/bin/dropbearkey
