<commit_before>cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
project(api-umbrella)

# Installation prefix
set(CMAKE_INSTALL_PREFIX /opt/api-umbrella)
set(INSTALL_PREFIX_EMBEDDED ${CMAKE_INSTALL_PREFIX}/embedded)

# Where to install cmake ExternalProjects.
set_directory_properties(PROPERTIES EP_PREFIX build/cmake)

# Where to stage installations during "make" phase.
set(STAGE_DIR ${CMAKE_SOURCE_DIR}/${EP_PREFIX}/stage)
set(STAGE_PREFIX_DIR ${STAGE_DIR}${CMAKE_INSTALL_PREFIX})
set(STAGE_EMBEDDED_DIR ${STAGE_DIR}${INSTALL_PREFIX_EMBEDDED})

# Where to install app-level vendor dependencies.
set(VENDOR_DIR ${STAGE_EMBEDDED_DIR}/apps/core/shared/vendor)
set(VENDOR_LUA_DIR ${VENDOR_DIR}/share/lua/5.1)
set(VENDOR_LUA_DIR ${VENDOR_DIR}/share/lua/5.1)
set(LUAROCKS_CMD env LUA_PATH='${STAGE_EMBEDDED_DIR}/openresty/luajit/share/lua/5.1/?.lua;${STAGE_EMBEDDED_DIR}/openresty/luajit/share/lua/5.1/?/init.lua;;' ${STAGE_EMBEDDED_DIR}/bin/luarocks)

# Define a timestamped release name for our app installations.
execute_process(COMMAND date -u +%Y%m%d%H%M%S OUTPUT_VARIABLE RELEASE_TIMESTAMP OUTPUT_STRIP_TRAILING_WHITESPACE)

include(ExternalProject)

# Define the versions of the various dependencies to build.
set(API_UMBRELLA_STATIC_SITE_VERSION 265714dbee04efa14f4d83e1f78f06ec492d9c6e)
set(API_UMBRELLA_STATIC_SITE_HASH 500d14f7417bee84169b2591f2d7722f)
set(BUNDLER_VERSION 1.11.2)
set(ELASTICSEARCH_VERSION 1.7.5)
set(ELASTICSEARCH_HASH 23353fcfdf4897997eb36624afa0af62562f9b3c)
set(GLIDE_VERSION 0.9.3)
set(GLIDE_HASH 220deb37963873d92dca4d21d450e8b0)
set(GOLANG_VERSION 1.5.3)
set(GOLANG_HASH 43afe0c5017e502630b1aea4d44b8a7f059bf60d7f29dfd58db454d4e4e0ae53)
set(LIBCIDR_VERSION 1.2.3)
set(LIBCIDR_HASH c5efcc7ae114fdaa5583f58dacecd9de)
set(LIBGEOIP_VERSION 1.6.9)
set(LIBGEOIP_HASH 7475942dc8155046dddb4846f587a7e6)
set(LIBRDKAFKA_VERSION 0.8.6)
set(LIBRDKAFKA_HASH 1b77543f9be82d3f700c0ef98f494990)
set(LUAROCKS_VERSION 2.3.0)
set(LUAROCKS_HASH a38126684cf42b7d0e7a3c7cf485defb)
set(LUAROCK_ARGPARSE_VERSION 0.4.1-1)
set(LUAROCK_CMSGPACK_VERSION 0.4.0-0)
set(LUAROCK_ICONV_VERSION 7-1)
set(LUAROCK_INSPECT_VERSION 3.0-4)
set(LUAROCK_LIBCIDR_VERSION 0.1.0-1)
set(LUAROCK_LUACHECK_VERSION 0.14.0-1)
set(LUAROCK_LUAPOSIX_VERSION 33.4.0-1)
set(LUAROCK_LUASOCKET_VERSION 2.0.2-6)
set(LUAROCK_LUATZ_VERSION 0.3-1)
set(LUAROCK_LUSTACHE_VERSION 1.3.1-0)
set(LUAROCK_LYAML_VERSION 6.0-1)
set(LUAROCK_PENLIGHT_VERSION 1.3.2-2)
set(LUAROCK_RESTY_HTTP_VERSION 0.07-0)
set(LUAROCK_RESTY_UUID_VERSION 1.0-1)
set(LUA_RESTY_DNS_CACHE_VERSION 691613739a32f8405e56e56547270b9f72e77c34)
set(LUA_RESTY_DNS_CACHE_HASH c7304c1f434ac251246904db51423d5e)
set(LUA_RESTY_LOGGER_SOCKET_VERSION d435ea6052c0d252cf7f89fe4b7cb9c69306de93)
set(LUA_RESTY_LOGGER_SOCKET_HASH 6d7273438100ddcdfa57bdbf1a8c3a01)
set(LUA_RESTY_SHCACHE_VERSION fb2e275c2cdca08eaa34a7b73375e41ac3eff200)
set(LUA_RESTY_SHCACHE_HASH 5d3cbcf8fbad1954cdcb3826afa41afe)
set(MONGODB_VERSION 3.0.10)
set(MONGODB_HASH 11bbde5690a4bf8ecab11983d0c65159)
set(MORA_VERSION fea22d544a961ef5cd66dde405cf452b1ae33d2c)
set(MORA_HASH 1e9c63acbbb0795ed00820a59c6cdcbc)
set(NGX_DYUPS_VERSION df1301c7458752fdbc21b9bfa913e13dc56cd855)
set(NGX_DYUPS_HASH 723ca4835a9557b92d50710b706e6caa)
set(NGX_TXID_VERSION f1c197cb9c42e364a87fbb28d5508e486592ca42)
set(NGX_TXID_HASH 408ee86eb6e42e27a51514f711c41d6b)
set(OPENRESTY_VERSION 1.9.7.4)
set(OPENRESTY_HASH 6e2d4a39c530524111ea50e3de67043a)
set(PCRE_VERSION 8.38)
set(PCRE_HASH 00aabbfe56d5a48b270f999b508c5ad2)
set(PERP_VERSION 2.07)
set(PERP_HASH a2acc7425d556d9635a25addcee9edb5)
set(RUBY_VERSION 2.2.4)
set(RUBY_HASH 31203696adbfdda6f2874a2de31f7c5a1f3bcb6628f4d1a241de21b158cd5c76)
set(RSYSLOG_VERSION 8.14.0)
set(RSYSLOG_HASH 443b5b1d2b84f5cd429d06d230af7fb2352336fa6449cb6484dbd4418a7ae7c2)
set(RUNIT_VERSION 2.1.2)
set(RUNIT_HASH 6c985fbfe3a34608eb3c53dc719172c4)
set(TRAFFICSERVER_VERSION 5.3.2)
set(TRAFFICSERVER_HASH c8e5f3e81da643ea79cba0494ed37d45)
set(UNBOUND_VERSION 1.5.8)
set(UNBOUND_HASH 33567a20f73e288f8daa4ec021fbb30fe1824b346b34f12677ad77899ecd09be)

function(require_program name)
  find_program(${name} ${name})
  if(NOT ${name})
    MESSAGE(FATAL_ERROR "Could not find ${name}")
  endif()
endfunction(require_program)

find_package(LibXml2 REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(LIBUUID REQUIRED uuid)
pkg_search_module(LIBFFI REQUIRED libffi)
require_program(rsync)

function(luarocks_install package version)
  ExternalProject_Add(
    luarock_${package}
    DEPENDS luarocks ${ARGV3}
    DOWNLOAD_COMMAND cd <SOURCE_DIR> && curl -OL https://luarocks.org/${package}-${version}.rockspec
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ${STAGE_EMBEDDED_DIR}/bin/luarocks --tree=${VENDOR_DIR} install ${package} ${version} ${ARGV2}
  )
endfunction(luarocks_install)<commit_msg>Document why we've kept some packages back from more recent versions.<commit_after>cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
project(api-umbrella)

# Installation prefix
set(CMAKE_INSTALL_PREFIX /opt/api-umbrella)
set(INSTALL_PREFIX_EMBEDDED ${CMAKE_INSTALL_PREFIX}/embedded)

# Where to install cmake ExternalProjects.
set_directory_properties(PROPERTIES EP_PREFIX build/cmake)

# Where to stage installations during "make" phase.
set(STAGE_DIR ${CMAKE_SOURCE_DIR}/${EP_PREFIX}/stage)
set(STAGE_PREFIX_DIR ${STAGE_DIR}${CMAKE_INSTALL_PREFIX})
set(STAGE_EMBEDDED_DIR ${STAGE_DIR}${INSTALL_PREFIX_EMBEDDED})

# Where to install app-level vendor dependencies.
set(VENDOR_DIR ${STAGE_EMBEDDED_DIR}/apps/core/shared/vendor)
set(VENDOR_LUA_DIR ${VENDOR_DIR}/share/lua/5.1)
set(VENDOR_LUA_DIR ${VENDOR_DIR}/share/lua/5.1)
set(LUAROCKS_CMD env LUA_PATH='${STAGE_EMBEDDED_DIR}/openresty/luajit/share/lua/5.1/?.lua;${STAGE_EMBEDDED_DIR}/openresty/luajit/share/lua/5.1/?/init.lua;;' ${STAGE_EMBEDDED_DIR}/bin/luarocks)

# Define a timestamped release name for our app installations.
execute_process(COMMAND date -u +%Y%m%d%H%M%S OUTPUT_VARIABLE RELEASE_TIMESTAMP OUTPUT_STRIP_TRAILING_WHITESPACE)

include(ExternalProject)

# Define the versions of the various dependencies to build.
set(API_UMBRELLA_STATIC_SITE_VERSION 265714dbee04efa14f4d83e1f78f06ec492d9c6e)
set(API_UMBRELLA_STATIC_SITE_HASH 500d14f7417bee84169b2591f2d7722f)
set(BUNDLER_VERSION 1.11.2)
set(ELASTICSEARCH_VERSION 1.7.5)
set(ELASTICSEARCH_HASH 23353fcfdf4897997eb36624afa0af62562f9b3c)
set(GLIDE_VERSION 0.9.3)
set(GLIDE_HASH 220deb37963873d92dca4d21d450e8b0)
set(GOLANG_VERSION 1.5.3)
set(GOLANG_HASH 43afe0c5017e502630b1aea4d44b8a7f059bf60d7f29dfd58db454d4e4e0ae53)
set(LIBCIDR_VERSION 1.2.3)
set(LIBCIDR_HASH c5efcc7ae114fdaa5583f58dacecd9de)
set(LIBGEOIP_VERSION 1.6.9)
set(LIBGEOIP_HASH 7475942dc8155046dddb4846f587a7e6)
# Hold at 0.8 - 0.9 doesn't seem to be compatible with rsyslog.
set(LIBRDKAFKA_VERSION 0.8.6)
set(LIBRDKAFKA_HASH 1b77543f9be82d3f700c0ef98f494990)
set(LUAROCKS_VERSION 2.3.0)
set(LUAROCKS_HASH a38126684cf42b7d0e7a3c7cf485defb)
set(LUAROCK_ARGPARSE_VERSION 0.4.1-1)
set(LUAROCK_CMSGPACK_VERSION 0.4.0-0)
set(LUAROCK_ICONV_VERSION 7-1)
set(LUAROCK_INSPECT_VERSION 3.0-4)
set(LUAROCK_LIBCIDR_VERSION 0.1.0-1)
set(LUAROCK_LUACHECK_VERSION 0.14.0-1)
set(LUAROCK_LUAPOSIX_VERSION 33.4.0-1)
set(LUAROCK_LUASOCKET_VERSION 2.0.2-6)
set(LUAROCK_LUATZ_VERSION 0.3-1)
set(LUAROCK_LUSTACHE_VERSION 1.3.1-0)
set(LUAROCK_LYAML_VERSION 6.0-1)
set(LUAROCK_PENLIGHT_VERSION 1.3.2-2)
set(LUAROCK_RESTY_HTTP_VERSION 0.07-0)
set(LUAROCK_RESTY_UUID_VERSION 1.0-1)
set(LUA_RESTY_DNS_CACHE_VERSION 691613739a32f8405e56e56547270b9f72e77c34)
set(LUA_RESTY_DNS_CACHE_HASH c7304c1f434ac251246904db51423d5e)
set(LUA_RESTY_LOGGER_SOCKET_VERSION d435ea6052c0d252cf7f89fe4b7cb9c69306de93)
set(LUA_RESTY_LOGGER_SOCKET_HASH 6d7273438100ddcdfa57bdbf1a8c3a01)
set(LUA_RESTY_SHCACHE_VERSION fb2e275c2cdca08eaa34a7b73375e41ac3eff200)
set(LUA_RESTY_SHCACHE_HASH 5d3cbcf8fbad1954cdcb3826afa41afe)
set(MONGODB_VERSION 3.0.10)
set(MONGODB_HASH 11bbde5690a4bf8ecab11983d0c65159)
set(MORA_VERSION fea22d544a961ef5cd66dde405cf452b1ae33d2c)
set(MORA_HASH 1e9c63acbbb0795ed00820a59c6cdcbc)
set(NGX_DYUPS_VERSION df1301c7458752fdbc21b9bfa913e13dc56cd855)
set(NGX_DYUPS_HASH 723ca4835a9557b92d50710b706e6caa)
set(NGX_TXID_VERSION f1c197cb9c42e364a87fbb28d5508e486592ca42)
set(NGX_TXID_HASH 408ee86eb6e42e27a51514f711c41d6b)
set(OPENRESTY_VERSION 1.9.7.4)
set(OPENRESTY_HASH 6e2d4a39c530524111ea50e3de67043a)
set(PCRE_VERSION 8.38)
set(PCRE_HASH 00aabbfe56d5a48b270f999b508c5ad2)
set(PERP_VERSION 2.07)
set(PERP_HASH a2acc7425d556d9635a25addcee9edb5)
set(RUBY_VERSION 2.2.4)
set(RUBY_HASH 31203696adbfdda6f2874a2de31f7c5a1f3bcb6628f4d1a241de21b158cd5c76)
# Hold at rsyslog 8.14.0 until ElasticSearch issues are fixed (hopefully 8.18):
# https://github.com/rsyslog/rsyslog/issues/748
set(RSYSLOG_VERSION 8.14.0)
set(RSYSLOG_HASH 443b5b1d2b84f5cd429d06d230af7fb2352336fa6449cb6484dbd4418a7ae7c2)
set(RUNIT_VERSION 2.1.2)
set(RUNIT_HASH 6c985fbfe3a34608eb3c53dc719172c4)
# Don't move to TrafficServer 6 until we can verify keepalive behavior:
# https://issues.apache.org/jira/browse/TS-3959
set(TRAFFICSERVER_VERSION 5.3.2)
set(TRAFFICSERVER_HASH c8e5f3e81da643ea79cba0494ed37d45)
set(UNBOUND_VERSION 1.5.8)
set(UNBOUND_HASH 33567a20f73e288f8daa4ec021fbb30fe1824b346b34f12677ad77899ecd09be)

function(require_program name)
  find_program(${name} ${name})
  if(NOT ${name})
    MESSAGE(FATAL_ERROR "Could not find ${name}")
  endif()
endfunction(require_program)

find_package(LibXml2 REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(LIBUUID REQUIRED uuid)
pkg_search_module(LIBFFI REQUIRED libffi)
require_program(rsync)

function(luarocks_install package version)
  ExternalProject_Add(
    luarock_${package}
    DEPENDS luarocks ${ARGV3}
    DOWNLOAD_COMMAND cd <SOURCE_DIR> && curl -OL https://luarocks.org/${package}-${version}.rockspec
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ${STAGE_EMBEDDED_DIR}/bin/luarocks --tree=${VENDOR_DIR} install ${package} ${version} ${ARGV2}
  )
endfunction(luarocks_install)
{'fraction_non_alphanumeric': 0.08777711204313961, 'fraction_numerical': 0.16486918314359897, 'mean_word_length': 9.780409041980624, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4066527', 'n_tokens_mistral': 5654, 'n_tokens_neox': 4726, 'n_words': 530}