[buildout]
extends =
  ../pcre/buildout.cfg
  ../zlib/buildout.cfg
  ../openssl/buildout.cfg
  ../coreutils/buildout.cfg
  ../git/buildout.cfg

parts = nginx-output

[nginx]
recipe = slapos.recipe.cmmi
url = http://nginx.org/download/nginx-1.7.2.tar.gz
md5sum = 68949a7a0bad4615e9b737fc4e6047f2
configure-options=
  --with-ipv6
  --with-http_ssl_module
  --with-mail
  --with-mail_ssl_module
  --with-ld-opt="-L ${zlib:location}/lib -L ${openssl:location}/lib -L ${pcre:location}/lib  -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib"
  --with-cc-opt="-I ${pcre:location}/include -I ${openssl:location}/include -I ${zlib:location}/include"

[webdav-module]
recipe = hexagonit.recipe.download
url = https://github.com/arut/nginx-dav-ext-module/archive/master.zip
strip-top-level-dir = true
#md5sum =
mode = 0644

[nginx-webdav]
recipe = slapos.recipe.cmmi
url = http://nginx.org/download/nginx-1.5.3.tar.gz
md5sum = 1e735dd6a6ade2b5c20e924b67c3d355
configure-options =
  --with-ipv6
  --with-http_ssl_module
  --with-mail
  --with-mail_ssl_module
  --with-ld-opt="-L ${zlib:location}/lib -L ${openssl:location}/lib -L ${pcre:location}/lib  -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib -L ${libexpat:location}/lib"
  --with-cc-opt="-I ${pcre:location}/include -I ${openssl:location}/include -I ${zlib:location}/include -I ${libexpat:location}/include"
  --with-http_dav_module 
  --add-module='${webdav-module:location}'

[nginx-output]
# Shared binary location to ease migration
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = ${coreutils-output:test} -x ${:nginx} -a -f ${:mime}
nginx = ${nginx:location}/sbin/nginx
mime = ${nginx:location}/conf/mime.types


[nginx-unstable]
<= nginx
url = http://nginx.org/download/nginx-1.3.15.tar.gz
md5sum = ded252047393c79a31b0862e9166a065

[hexaglobe-nginx-module]
recipe = hexagonit.recipe.download
url = http://easicloud-p.cdn.hexaglobe.net/nginx-easicloud.tar.gz
md5sum = 57fe2ceb09740f22b5b1023f29889e0e
strip-top-level-dir = true

[nginx-enable-sub]
# Used by Hexaglobe for watermarking
<= nginx
configure-options=
  --with-ipv6
  --with-http_ssl_module
  --with-ld-opt="-L ${zlib:location}/lib -L ${openssl:location}/lib -L ${pcre:location}/lib  -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib"
  --with-cc-opt="-I ${pcre:location}/include -I ${openssl:location}/include -I ${zlib:location}/include"
  --add-module=${hexaglobe-nginx-module:location}/sub_module
# --add-module=${hexaglobe-nginx-module:location}/nginx-upstream-fair

[nginx-push-stream-module]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/wandenberg/nginx-push-stream-module.git
revision = 3d3a204177d3a7ab8a2858e04e792a6d11bf133f
git-executable = ${git:location}/bin/git

[nginx-push-stream]
<= nginx
configure-options=
  --with-ipv6
  --with-http_ssl_module
  --with-ld-opt="-L ${zlib:location}/lib -L ${openssl:location}/lib -L ${pcre:location}/lib  -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib"
  --with-cc-opt="-I ${pcre:location}/include -I ${openssl:location}/include -I ${zlib:location}/include"
  --add-module=${nginx-push-stream-module:location}

[nginx-push-stream-output]
<= nginx-output
nginx = ${nginx-push-stream:location}/sbin/nginx
mime = ${nginx-push-stream:location}/conf/mime.types
