]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
clamav-databases: New package
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 14 Feb 2023 08:15:39 +0000 (09:15 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 16 Feb 2023 11:25:38 +0000 (11:25 +0000)
This package just provide a base set of
clamav virus databases to start.

The database may be outdated very soon but
automatically got updated by freshclam.

This package only needs to be touched in case
clamav got a new (incompatible) database file format.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
clamav-databases/clamav-databases.nm [new file with mode: 0644]

diff --git a/clamav-databases/clamav-databases.nm b/clamav-databases/clamav-databases.nm
new file mode 100644 (file)
index 0000000..30a386c
--- /dev/null
@@ -0,0 +1,64 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = clamav-databases
+version    = 1
+release    = 1
+arch       = noarch
+
+groups     = System Environment/Daemons
+url        = https://www.clamav.net
+license    = GPLv2
+summary    = Clamav Virus Databases
+
+description
+       This package contains an initial set of databases used by Clamav.
+end
+
+# Using the clamav server is not permitted, so the files have to be
+# downloaded manually and uploaded to our source server.
+#source_dl  = https://database.clamav.net/
+sources = \
+       main.cvd \
+       daily.cvd
+
+build
+       prepare
+               %{create_users}
+       end
+
+       build = # Nothing to do
+
+       install
+               # Create directory.
+               mkdir -pv %{BUILDROOT}%{sharedstatedir}/clamav
+
+               # Install the databases.
+               cp -avf %{DIR_DL}/*.cvd %{BUILDROOT}%{sharedstatedir}/clamav/
+
+               # Own the database foler and files to this user/group.
+               chown -R clamav:clamav %{BUILDROOT}%{sharedstatedir}/clamav/
+       end
+end
+
+create_users
+       # Create user and group for clamav.
+       getent group clamav >/dev/null || groupadd -g 496 -r clamav || :
+       getent passwd clamav >/dev/null || useradd -u 496 -r -s /sbin/nologin \
+       -d / -M -g clamav clamav || :
+end
+
+packages
+       package %{name}
+               datafiles
+                       %{sharedstatedir}/clamav/daily.cvd
+                       %{sharedstatedir}/clamav/main.cvd
+               end
+
+               script prein
+                       %{create_users}
+               end
+       end
+end