From 715701924bad649c7f04557209e1bebe1847e649 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Tue, 16 Jan 2024 15:16:25 -0500 Subject: [PATCH] Fix issue installing empty database directory The CMake code to install the empty database directory doesn't appear to do anything. Further, it is causing build issues for some users. Instead of running code to make the directory, it appears we can just install a directory directly. Fixes: https://github.com/Cisco-Talos/clamav/issues/1142 --- freshclam/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freshclam/CMakeLists.txt b/freshclam/CMakeLists.txt index ef3616fe32..7f2ae9e1d9 100644 --- a/freshclam/CMakeLists.txt +++ b/freshclam/CMakeLists.txt @@ -47,7 +47,11 @@ else() endif() # Install an empty database directory -INSTALL(CODE "FILE(MAKE_DIRECTORY \${ENV}\${CMAKE_INSTALL_PREFIX}/\${DATABASE_DIRECTORY})" COMPONENT programs) +if(IS_ABSOLUTE ${DATABASE_DIRECTORY}) + INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${DATABASE_DIRECTORY} COMPONENT programs) +else() + INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${DATABASE_DIRECTORY} COMPONENT programs) +endif() # Now we rename freshclam-bin executable to freshclam using target properties set_target_properties( freshclam-bin