public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Stefan Schantl <stefan.schantl@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 4/5] clamav-databases: New package
Date: Tue, 14 Feb 2023 09:15:39 +0100	[thread overview]
Message-ID: <20230214081540.125883-4-stefan.schantl@ipfire.org> (raw)
In-Reply-To: <20230214081540.125883-1-stefan.schantl@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 2448 bytes --]

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(a)ipfire.org>
---
 clamav-databases/clamav-databases.nm | 64 ++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 clamav-databases/clamav-databases.nm

diff --git a/clamav-databases/clamav-databases.nm b/clamav-databases/clamav-databases.nm
new file mode 100644
index 000000000..30a386c37
--- /dev/null
+++ b/clamav-databases/clamav-databases.nm
@@ -0,0 +1,64 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info(a)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
-- 
2.30.2


  parent reply	other threads:[~2023-02-14  8:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  8:15 [PATCH 1/5] clamav: Change user/group to clamav Stefan Schantl
2023-02-14  8:15 ` [PATCH 2/5] clamav: Add config files for clamd and freshclam Stefan Schantl
2023-02-14  8:15 ` [PATCH 3/5] clamav: Drop clamav-databse subpackage Stefan Schantl
2023-02-14  8:15 ` Stefan Schantl [this message]
2023-02-14  8:15 ` [PATCH 5/5] clamav: Silence output during user creation Stefan Schantl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230214081540.125883-4-stefan.schantl@ipfire.org \
    --to=stefan.schantl@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox