public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/slrn] epel10: Fix adding a user on Fedora < 42
Date: Wed, 14 Oct 2026 13:16:57 GMT	[thread overview]
Message-ID: <179198381779.1.10299702317987855629.rpms-slrn-0480194d454f@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/slrn
Branch : epel10
Commit : 0480194d454fe036c5df4250aff7d236aa093268
Author : Petr Písař <ppisar@redhat.com>
Date   : 2025-02-13T13:46:49+01:00
Stats  : +14/-2 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/slrn/c/0480194d454fe036c5df4250aff7d236aa093268?branch=epel10

Log:
Fix adding a user on Fedora < 42

---
diff --git a/slrn.spec b/slrn.spec
index 1d3603b..90cbe82 100644
--- a/slrn.spec
+++ b/slrn.spec
@@ -26,8 +26,12 @@ BuildRequires: make
 BuildRequires: inews
 BuildRequires: openssl-devel, gcc
 BuildRequires: slang-devel >= 2.2.3
+BuildRequires: systemd-rpm-macros
 # Some s-lang scripts (smime.sl) use slsh interpreter
 Requires:      slang-slsh
+%if (0%{?fedora} && 0%{?fedora} < 42) || (0%{?rhel} && 0%{?rhel} < 11)
+Requires(pre): shadow-utils
+%endif
 # For source verification with gpgv
 BuildRequires:  gnupg2
 
@@ -65,6 +69,7 @@ done
 chmod 644 doc/slrnpull/* contrib/*
 
 # Create a sysusers.d config file
+# Static UID and GID defined by /usr/share/doc/setup-*/uidgid
 cat >slrn.sysusers.conf <<EOF
 g news 13
 u news 9 'news user' - -
@@ -105,10 +110,17 @@ install -p -m644 %{SOURCE4} doc/slrnpull/README.rpm
 # remove unpackaged files from the buildroot
 rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/slrn
 
-# Static UID and GID defined by /usr/share/doc/setup-*/uidgid
-
 install -m0644 -D slrn.sysusers.conf %{buildroot}%{_sysusersdir}/slrn.conf
 
+%if (0%{?fedora} && 0%{?fedora} < 42) || (0%{?rhel} && 0%{?rhel} < 11)
+# Static UID and GID defined by /usr/share/doc/setup-*/uidgid
+%pre
+getent group news >/dev/null || groupadd -r -g 13 news
+getent passwd news >/dev/null || \
+  useradd -r -u 9 -g news -d / -s /sbin/nologin -c "news user" news
+exit 0
+%endif
+
 %files -f %{name}.lang
 %license COPYING COPYRIGHT
 %doc changes.txt NEWS README

                 reply	other threads:[~2026-10-14 13:16 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=179198381779.1.10299702317987855629.rpms-slrn-0480194d454f@fedoraproject.org \
    --to=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