[buildout]
extends =
  ../autoconf/buildout.cfg
  ../automake/buildout.cfg
  ../git/buildout.cfg
  ../libtool/buildout.cfg
  ../m4/buildout.cfg
  ../openssl/buildout.cfg
  ../patch/buildout.cfg
  ../zlib/buildout.cfg

parts = shellinabox

[shellinabox]
<= shellinabox-2.10

[shellinabox-2.10]
; This version is old, but we patch it for IPv6 support
recipe = slapos.recipe.cmmi
url = http://shellinabox.googlecode.com/files/shellinabox-2.10.tar.gz
md5sum = 0e144910d85d92edc54702ab9c46f032
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
    ${:_profile_base_location_}/0001-Switch-to-IPv6.patch#b61cb099c00e15a5fcaf6c98134fff45
    ${:_profile_base_location_}/0002-Allow-to-run-entire-command-path.patch#a506b4d83021e24c830f767501c1d3fc
environment =
    CFLAGS = -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
    PKG_CONFIG_PATH = ${openssl:location}/lib/pkgconfig/

[shellinabox-git-repository]
; This version has much more features, but does not support IPv6 (support unix domain though)
recipe = slapos.recipe.build:gitclone
repository = https://github.com/shellinabox/shellinabox
revision = b8285748993c4c99e80793775f3d2a0a4e962d5a
git-executable = ${git:location}/bin/git

[shellinabox-github]
recipe = slapos.recipe.cmmi
path = ${shellinabox-git-repository:location}
configure-command =
  ${libtool:location}/bin/libtoolize
  ${autoconf:location}/bin/autoreconf -vif
  ./configure
environment =
  PATH=${autoconf:location}/bin:${automake:location}/bin:${git:location}/bin:${libtool:location}/bin:${m4:location}/bin:%(PATH)s
  CFLAGS = -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
  PKG_CONFIG_PATH = ${openssl:location}/lib/pkgconfig/
