################################################################
# 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 = b2db2a83caf66a208bb78d6d287cdaa3
url = http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz
patch-binary = ${patch:location}/bin/patch
#patch-options = -p1
patches =
  ${:_profile_base_location_}/no_create_privsep_path.patch#d5b61a2442fffa457cebe4ad1dc68f4e
environment = 
  CPPFLAGS=-I${zlib:location}/include -I${openssl:location}/include
  LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl: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