public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Orion Poplawski <orion@nwra.com>
To: git-commits@fedoraproject.org
Subject: [rpms/clamav] epel9: Use sysusers_create_compat for EL9 compatibility (rhbz#2499753)
Date: Fri, 17 Jul 2026 16:02:17 GMT	[thread overview]
Message-ID: <178430413736.1.16849983513548124461.rpms-clamav-0255ccaf9521@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/clamav
Branch : epel9
Commit : 0255ccaf952154b6e5743282d1a487a2481697d1
Author : Orion Poplawski <orion@nwra.com>
Date   : 2026-07-17T09:55:14-06:00
Stats  : +29/-20 in 4 file(s)
URL    : https://src.fedoraproject.org/rpms/clamav/c/0255ccaf952154b6e5743282d1a487a2481697d1?branch=epel9

Log:
Use sysusers_create_compat for EL9 compatibility (rhbz#2499753)

---
diff --git a/clamav-milter.sysusers.conf b/clamav-milter.sysusers.conf
new file mode 100644
index 0000000..ed7f822
--- /dev/null
+++ b/clamav-milter.sysusers.conf
@@ -0,0 +1,3 @@
+u clamilt - 'Clamav milter user' /run/clamav-milter -
+m clamilt virusgroup
+m clamilt clamscan

diff --git a/clamav.spec b/clamav.spec
index a6de251..8f4eceb 100644
--- a/clamav.spec
+++ b/clamav.spec
@@ -26,7 +26,7 @@
 Summary:    End-user tools for the Clam Antivirus scanner
 Name:       clamav
 Version:    1.4.5
-Release:    1%{?dist}
+Release:    2%{?dist}
 License:    %{?with_unrar:proprietary}%{!?with_unrar:GPL-2.0-only}
 URL:        https://www.clamav.net/
 %if %{with unrar}
@@ -43,6 +43,11 @@ Source1:    clamav-types.h
 #for server
 Source3:    clamd.logrotate
 Source5:    clamd-README
+# sysusers
+Source6:    clamav.sysusers.conf
+Source7:    clamd.sysusers.conf
+Source8:    clamav-milter.sysusers.conf
+
 # To download the *.cvd, go to https://www.clamav.net and use the links
 # there (I renamed the files to add the -version suffix for verifying).
 # Check the first line of the file for version or run file *cvd
@@ -139,6 +144,7 @@ BuildRequires:  nc
 BuildRequires:  systemd
 BuildRequires:  systemd-devel
 BuildRequires:  systemd-rpm-macros
+%{?sysusers_requires_compat}
 #for milter
 BuildRequires:  sendmail-devel
 %ifarch %{valgrind_arches}
@@ -354,22 +360,6 @@ install -p -m0644 %{SOURCE300} clamav-milter/
 mkdir -p libclamunrar{,_iface}
 %{!?with_unrar:touch libclamunrar/{Makefile.in,all,install}}
 
-# Create sysusers.d config files
-cat >clamav.sysusers.conf <<EOF
-g virusgroup -
-u clamupdate - 'Clamav database update user' %{homedir} -
-m clamupdate virusgroup
-EOF
-cat >clamd.sysusers.conf <<EOF
-u clamscan - 'Clamav scanner user' - -
-m clamscan virusgroup
-EOF
-cat >clamav-milter.sysusers.conf <<EOF
-u clamilt - 'Clamav milter user' %{_rundir}/clamav-milter -
-m clamilt virusgroup
-m clamilt clamscan
-EOF
-
 %if 0%{?fedora} || 0%{?rhel} >= 9
 %generate_buildrequires
 # The generate_buildrequires stage doesn't exist prior to EL9, so this
@@ -494,9 +484,9 @@ install -m 0644 %SOURCE1 %{buildroot}%{_includedir}/clamav-types.h
 # TODO: Evaluate using upstream's unit with clamav-daemon.socket
 rm %{buildroot}%{_unitdir}/clamav-daemon.*
 
-install -m0644 -D clamav.sysusers.conf %{buildroot}%{_sysusersdir}/clamav.conf
-install -m0644 -D clamd.sysusers.conf %{buildroot}%{_sysusersdir}/clamd.conf
-install -m0644 -D clamav-milter.sysusers.conf %{buildroot}%{_sysusersdir}/clamav-milter.conf
+install -m0644 -D %{SOURCE6} %{buildroot}%{_sysusersdir}/clamav.conf
+install -m0644 -D %{SOURCE7} %{buildroot}%{_sysusersdir}/clamd.conf
+install -m0644 -D %{SOURCE8} %{buildroot}%{_sysusersdir}/clamav-milter.conf
 
 
 %check
@@ -520,6 +510,8 @@ install -m0644 -D clamav-milter.sysusers.conf %{buildroot}%{_sysusersdir}/clamav
 %postun
 %systemd_postun_with_restart clamav-clamonacc.service
 
+%pre filesystem
+%sysusers_create_compat %{SOURCE6}
 
 %post data
 # nullglob. If set, Bash allows filename patterns which match no files to expand to a null string, rather than themselves
@@ -531,6 +523,9 @@ do
     [ -f $f -a $f -nt $cvd ] && rm -f $cvd || :
 done
 
+%pre -n clamd
+%sysusers_create_compat %{SOURCE7}
+
 %post -n clamd
 # Point to the new service unit
 [ -L /etc/systemd/system/multi-user.target.wants/clamd@scan.service ] &&
@@ -543,6 +538,9 @@ done
 %postun -n clamd
 %systemd_postun_with_restart clamd@scan.service
 
+%pre milter
+%sysusers_create_compat %{SOURCE8}
+
 %post milter
 %systemd_post clamav-milter.service
 
@@ -664,6 +662,9 @@ done
 
 
 %changelog
+* Fri Jul 17 2026 Orion Poplawski <orion@nwra.com> - 1.4.5-2
+- Use sysusers_create_compat for EL9 compatibility (rhbz#2499753)
+
 * Thu Jul 02 2026 Gwyn Ciesla <gwync@protonmail.com> - 1.4.5-1
 - Update to 1.4.5
 

diff --git a/clamav.sysusers.conf b/clamav.sysusers.conf
new file mode 100644
index 0000000..ce610ff
--- /dev/null
+++ b/clamav.sysusers.conf
@@ -0,0 +1,3 @@
+g virusgroup -
+u clamupdate - 'Clamav database update user' /var/lib/clamav -
+m clamupdate virusgroup

diff --git a/clamd.sysusers.conf b/clamd.sysusers.conf
new file mode 100644
index 0000000..2783802
--- /dev/null
+++ b/clamd.sysusers.conf
@@ -0,0 +1,2 @@
+u clamscan - 'Clamav scanner user' - -
+m clamscan virusgroup

                 reply	other threads:[~2026-07-17 16:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=178430413736.1.16849983513548124461.rpms-clamav-0255ccaf9521@fedoraproject.org \
    --to=orion@nwra.com \
    --cc=git-commits@fedoraproject.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