-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide users/groups via `/usr/lib/sysusers.d`. This is going to be handled by RPM as described in https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/#_dynamic_allocation and https://lists.fedoraproject.org/archives/list/[email protected]/thread/NEFOV236FJYS2RED2SEOV5YHDFLDX7DK/#KB6KS3U7RO4AYANGSUNVSG7UF5AW52Q2 Relates to fedora-copr/copr#2789
- Loading branch information
Showing
4 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
%bcond_with lint | ||
%bcond_without tests | ||
|
||
# mock group id allocate for Fedora | ||
%global mockgid 135 | ||
|
||
%global __python %{__python3} | ||
%global python_sitelib %{python3_sitelib} | ||
|
||
|
@@ -146,6 +143,9 @@ Mock plugin that preprocesses spec files using rpmautospec. | |
%package filesystem | ||
Summary: Mock filesystem layout | ||
Requires(pre): shadow-utils | ||
BuildRequires: systemd-rpm-macros | ||
|
||
%{?sysusers_requires_compat} | ||
|
||
%description filesystem | ||
Filesystem layout and group for Mock. | ||
|
@@ -169,6 +169,9 @@ done | |
|
||
./precompile-bash-completion "mock.complete" | ||
|
||
# this is what %%sysusers_create_compat will expand to | ||
%{_rpmconfigdir}/sysusers.generate-pre.sh mock.conf > sysusers_script | ||
|
||
%install | ||
#base filesystem | ||
mkdir -p %{buildroot}%{_sysconfdir}/mock/eol/templates | ||
|
@@ -213,13 +216,15 @@ install -d %{buildroot}/var/cache/mock | |
mkdir -p %{buildroot}%{_pkgdocdir} | ||
install -p -m 0644 docs/site-defaults.cfg %{buildroot}%{_pkgdocdir} | ||
|
||
mkdir -p %{buildroot}%{_sysusersdir} | ||
install -p -D -m 0644 %{name}.conf %{buildroot}%{_sysusersdir} | ||
|
||
sed -i 's/^_MOCK_NVR = None$/_MOCK_NVR = "%name-%version-%release"/' \ | ||
%{buildroot}%{_libexecdir}/mock/mock | ||
|
||
%pre filesystem | ||
# check for existence of mock group, create it if not found | ||
getent group mock > /dev/null || groupadd -f -g %mockgid -r mock | ||
exit 0 | ||
|
||
%pre filesystem -f sysusers_script | ||
|
||
|
||
%check | ||
%if %{with lint} | ||
|
@@ -292,6 +297,7 @@ pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || : | |
%dir %{_sysconfdir}/mock/eol/templates | ||
%dir %{_sysconfdir}/mock/templates | ||
%dir %{_datadir}/cheat | ||
%config(noreplace) %{_sysusersdir}/mock.conf | ||
|
||
%changelog | ||
* Tue May 14 2024 Jakub Kadlcik <[email protected]> 5.6-1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
New Mock RPM package provides the systemd-sysusers drop-in configuration file for automatic | ||
`mock 135` group ID allocation. | ||
https://rpm-software-management.github.io/rpm/manual/users_and_groups.html |