public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/slrn] epel10: Fix adding a user on Fedora < 42
@ 2026-10-14 13:16 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-10-14 13:16 UTC (permalink / raw)
  To: git-commits

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-14 13:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 13:16 [rpms/slrn] epel10: Fix adding a user on Fedora < 42 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox