[buildout]
extends =
  ../defaults.cfg
  ../libtool/buildout.cfg
  ../libxml2/buildout.cfg
  ../luajit/buildout.cfg
  ../make/buildout.cfg
  ../ncurses/buildout.cfg
  ../openssl/buildout.cfg
  ../patch/buildout.cfg
  ../pcre/buildout.cfg
  ../perl/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../tcl/buildout.cfg
  ../zlib/buildout.cfg

parts =
  trafficserver

[gcc]
# For ATS v8.0.0 and later, a compiler with support for C++17 is required.
# https://cwiki.apache.org/confluence/display/TS/Building
min_version = 8

[trafficserver]
recipe = slapos.recipe.cmmi
url = https://dlcdn.apache.org/trafficserver/trafficserver-9.2.0.tar.bz2
md5sum = 3188d53f0a2eb618fb9399e098161691
shared = true
patch-options = -p1
configure-options =
  --with-openssl=${openssl:location}
  --with-pcre=${pcre:location}
  --with-ncurses=${ncurses:location}
  --with-tcl=${tcl:location}/lib/
  --with-luajit=${luajit:location}
  --with-lzma=${xz-utils:location}
  --with-zlib=${zlib:location}
  --disable-curl
  --disable-hwloc
  --enable-experimental-plugins
  --disable-posix-cap
patch-options = -p1
# https://github.com/apache/trafficserver/pull/8545 + https://github.com/apache/trafficserver/pull/8617
# (see https://github.com/apache/trafficserver/issues/8539 for the detail)
patches =
  ${:_profile_base_location_}/trafficserver-9.1.1-TSHttpTxnCacheLookupStatusGet-fix.patch#d8ed3db3a48e97eb72aaaf7d7598a2d2
  ${:_profile_base_location_}/trafficserver-9.1.1-via-string-rapid-cdn.patch#8c39243d7525222385d5964485734f99
environment =
  PATH=${libtool:location}/bin:${make:location}/bin:${patch:location}/bin:${perl:location}/bin:${pkgconfig:location}/bin:%(PATH)s
  LDFLAGS =-L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${tcl:location}/lib -Wl,-rpath=${tcl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${luajit:location}/lib  -lm

make-target =
  check
  install
