[buildout]
extends =
  ../bzip2/buildout.cfg
  ../curl/buildout.cfg
  ../cmake/buildout.cfg
  ../json-c/buildout.cfg
  ../libxml2/buildout.cfg
  ../openssl/buildout.cfg
  ../patch/buildout.cfg
  ../pcre2/buildout.cfg
  ../rust/buildout.cfg
  ../zlib/buildout.cfg

parts =
  clamav

[clamav]
recipe = slapos.recipe.cmmi
shared = true
url = https://www.clamav.net/downloads/production/clamav-1.3.1.tar.gz
md5sum = a2617a04a69433f9f7c86ede5dcc82c6
location = @@LOCATION@@
patch-options = -p1
patches =
  ${:_profile_base_location_}/add_cmake_enable_clamdtop_option.patch#79dad34211b89a37860bdf8388790b6e
configure-command = ${cmake:location}/bin/cmake
configure-options =
  -DCMAKE_INSTALL_PREFIX=${:location}
  -DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}"
  -DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}"
  -DCMAKE_INSTALL_RPATH=${:CMAKE_LIBRARY_PATH}
  -DENABLE_MILTER=OFF
  -DENABLE_CLAMONACC=OFF
  -DENABLE_CLAMDTOP=OFF
  -DENABLE_TESTS=OFF
environment=
  CMAKE_PROGRAM_PATH=${cmake:location}/bin
  CMAKE_INCLUDE_PATH=${openssl:location}/include:${bzip2:location}/include:${zlib:location}/include:${libxml2:location}/include:${pcre2:location}/include:${json-c:location}/include:${curl:location}/include
  CMAKE_LIBRARY_PATH=${:CMAKE_LIBRARY_PATH}
  PATH=${rustc:location}/bin:${patch:location}/bin:%(PATH)s
CMAKE_CFLAGS = -I${openssl:location}/include -I${bzip2:location}/include -I${zlib:location}/include -I${libxml2:location}/include -I${pcre2:location}/include -I${json-c:location}/include -I${curl:location}/include
CMAKE_LIBRARY_PATH = ${:location}/lib:${openssl:location}/lib:${bzip2:location}/lib:${zlib:location}/lib:${libxml2:location}/lib:${pcre2:location}/lib:${json-c:location}/lib:${curl:location}/lib
