Skip to content

Commit 05b4d96

Browse files
committed
Add sysusers.d config file to allow rpm to create users/groups automatically
forwarded from downstream dist-git with added if-conditions Related: fedora-copr/copr#2789
1 parent 247ab8e commit 05b4d96

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
g packager -

dist-git/dist-git.spec

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Requires: git
2626
Requires: git-daemon
2727
Requires: mod_ssl
2828
Requires: crudini
29+
%if 0%{?fedora} && 0%{?fedora} <= 41
2930
Requires(pre): shadow-utils
31+
%endif
3032

3133
Requires: python3-requests
3234
Recommends: python3-grokmirror
@@ -92,13 +94,14 @@ cd -
9294

9395

9496
%pre
97+
%if 0%{?fedora} && 0%{?fedora} <= 41
9598
# ------------------------------------------------------------------------------
9699
# Users and Groups
97100
# ------------------------------------------------------------------------------
98101
getent group packager > /dev/null || \
99102
groupadd -r packager
100103
exit 0
101-
104+
%endif
102105

103106
%check
104107
%if 0%{?rhel} && 0%{?rhel} <= 8
@@ -131,6 +134,10 @@ cp -a configs/httpd/dist-git.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/
131134
cp -a configs/httpd/dist-git/* %{buildroot}%{_sysconfdir}/httpd/conf.d/dist-git/
132135
cp -a configs/systemd/* %{buildroot}%{_unitdir}/
133136

137+
%if 0%{?fedora} && 0%{?fedora} > 41
138+
install -m0644 -D configs/sysusers.d/dist-git.conf %{buildroot}%{_sysusersdir}/dist-git.conf
139+
%endif
140+
134141
# ------------------------------------------------------------------------------
135142
# /var/lib/ ...... dynamic persistent files
136143
# ------------------------------------------------------------------------------
@@ -247,6 +254,9 @@ fi
247254
%{_bindir}/remove_unused_sources
248255
%{_bindir}/setup_git_package
249256

257+
%if 0%{?fedora} && 0%{?fedora} > 41
258+
%{_sysusersdir}/dist-git.conf
259+
%endif
250260

251261
%files selinux
252262
%doc selinux/*

0 commit comments

Comments
 (0)