################################################################
# OpenSSH Portable - a secure shell client and server for *nix #
#                                                              #
# http://www.openssh.com/                                      #
################################################################

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

parts =
  openssh

[openssh]
recipe = slapos.recipe.cmmi
md5sum = 68ba883aff6958297432e5877e9a0fe2
url = https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
  ${:_profile_base_location_}/no_create_privsep_path.patch#f341dc11d73df6f43c7ae1fa47b8c003
environment = 
  CPPFLAGS=-I${zlib:location}/include -I${openssl-1.0:location}/include
  LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${openssl-1.0:location}/lib -Wl,-rpath=${openssl-1.0:location}/lib
configure-options = 
  --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
  --exec-prefix=${buildout:parts-directory}/${:_buildout_section_name_}
  --with-privsep-path=${buildout:parts-directory}/${:_buildout_section_name_}/var/empty

[openssh-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 = ${openssh:location}/bin/ssh
keygen = ${openssh:location}/bin/ssh-keygen