--- /dev/null
+###############################################################################
+# 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