Skip to content

Commit 15fd29d

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 0e81946 commit 15fd29d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-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: 7 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%{?rhel} && 0%{?rhel} < 10
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%{?rhel} && 0%{?rhel} < 10
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,8 @@ 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+
install -m0644 -D configs/sysusers.d/dist-git.conf %{buildroot}%{_sysusersdir}/dist-git.conf
138+
134139
# ------------------------------------------------------------------------------
135140
# /var/lib/ ...... dynamic persistent files
136141
# ------------------------------------------------------------------------------
@@ -247,6 +252,7 @@ fi
247252
%{_bindir}/remove_unused_sources
248253
%{_bindir}/setup_git_package
249254

255+
%{_sysusersdir}/dist-git.conf
250256

251257
%files selinux
252258
%doc selinux/*

0 commit comments

Comments
 (0)