[slrn/f17] Create news user and group on installation

Petr Pisar ppisar at fedoraproject.org
Mon Feb 11 13:04:20 UTC 2013


commit 9234b073af4af7a16b038afed2e0522a2c201f62
Author: Petr Písař <ppisar at redhat.com>
Date:   Mon Feb 11 11:06:07 2013 +0100

    Create news user and group on installation

 slrn.spec |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/slrn.spec b/slrn.spec
index 3cbb235..45dd7cd 100644
--- a/slrn.spec
+++ b/slrn.spec
@@ -16,6 +16,7 @@ BuildRequires: nss-devel nss_compat_ossl-devel slang-devel
 BuildRequires: inews
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 URL: http://slrn.sourceforge.net/
+Requires(pre): shadow-utils
 
 %description
 SLRN is a threaded Internet news reader. SLRN is highly customizable
@@ -80,6 +81,13 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/slrn
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+# 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
+
 %files -f %{name}.lang
 %defattr(-,root,root)
 %doc COPYING COPYRIGHT changes.txt README
@@ -104,6 +112,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Mon Feb 11 2013 Petr Pisar <ppisar at redhat.com> - 0.9.9p1-7
 - Improve README.rpm-slrnpull spelling
+- Create news user and group on installation
 
 * Tue Jan 08 2013 Petr Pisar <ppisar at redhat.com> - 0.9.9p1-6
 - Fix NULL pointer dereference in rline_update call-backs (bug #847706)


More information about the scm-commits mailing list