about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-05-20 14:38:47 +0200
committerGitHub <noreply@github.com>2022-05-20 14:38:47 +0200
commitbee7341dcb14905f93fd780e84d67dbf47fa4ed9 (patch)
tree5bda20d3e895088ca0ec32d5ca85ab6a5d6a23ed /pkgs
parent9abfef3f54a1bae43d09c6df7abf348efad3f8a7 (diff)
parent419e19ca81234ab5bc5b7ed81ce43f5e1bd03f3e (diff)
Merge pull request #173619 from KoviRobi/clamav-fix-config-file-location
clamav: Fix CLI clamav programs not finding configuration files
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/security/clamav/default.nix8
-rw-r--r--pkgs/tools/security/clamav/sample-cofiguration-file-install-location.patch29
2 files changed, 35 insertions, 2 deletions
diff --git a/pkgs/tools/security/clamav/default.nix b/pkgs/tools/security/clamav/default.nix
index 2535162525933..86d729f95d611 100644
--- a/pkgs/tools/security/clamav/default.nix
+++ b/pkgs/tools/security/clamav/default.nix
@@ -13,8 +13,11 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-JwIDpUxFgEnbVPzZNoP/Wy2xkVHzY8SOgs7O/d4rNdQ=";
   };
 
-  # Flaky test, remove this when https://github.com/Cisco-Talos/clamav/issues/343 is fixed
-  patches = [ ./remove-freshclam-test.patch ];
+  patches = [
+    # Flaky test, remove this when https://github.com/Cisco-Talos/clamav/issues/343 is fixed
+    ./remove-freshclam-test.patch
+    ./sample-cofiguration-file-install-location.patch
+  ];
 
   enableParallelBuilding = true;
   nativeBuildInputs = [ cmake pkg-config rustc rust-bindgen rustfmt cargo python3 ];
@@ -25,6 +28,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DSYSTEMD_UNIT_DIR=${placeholder "out"}/lib/systemd"
+    "-DAPP_CONFIG_DIRECTORY=/etc/clamav"
   ];
 
   doCheck = true;
diff --git a/pkgs/tools/security/clamav/sample-cofiguration-file-install-location.patch b/pkgs/tools/security/clamav/sample-cofiguration-file-install-location.patch
new file mode 100644
index 0000000000000..46444627dd38f
--- /dev/null
+++ b/pkgs/tools/security/clamav/sample-cofiguration-file-install-location.patch
@@ -0,0 +1,29 @@
+diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt
+index 826fff1..3cefc34 100644
+--- a/etc/CMakeLists.txt
++++ b/etc/CMakeLists.txt
+@@ -6,14 +6,14 @@ install(
+     FILES
+         ${CMAKE_CURRENT_SOURCE_DIR}/clamd.conf.sample
+     DESTINATION
+-        ${APP_CONFIG_DIRECTORY}
++        ${CMAKE_INSTALL_PREFIX}/${APP_CONFIG_DIRECTORY}
+     COMPONENT programs)
+ 
+ install(
+     FILES
+         ${CMAKE_CURRENT_SOURCE_DIR}/freshclam.conf.sample
+     DESTINATION
+-        ${APP_CONFIG_DIRECTORY}
++        ${CMAKE_INSTALL_PREFIX}/${APP_CONFIG_DIRECTORY}
+     COMPONENT programs)
+ 
+ if(ENABLE_MILTER)
+@@ -21,6 +21,6 @@ if(ENABLE_MILTER)
+         FILES
+             ${CMAKE_CURRENT_SOURCE_DIR}/clamav-milter.conf.sample
+         DESTINATION
+-            ${APP_CONFIG_DIRECTORY}
++            ${CMAKE_INSTALL_PREFIX}/${APP_CONFIG_DIRECTORY}
+         COMPONENT programs)
+ endif()