Provide a sysusers.d file to get user() and group() provides

This commit is contained in:
Daan De Meyer 2023-10-01 21:54:30 +02:00
parent 07cc2a4557
commit 5139815b63
2 changed files with 13 additions and 12 deletions

View File

@ -1,12 +1,12 @@
Name: geoclue2 Name: geoclue2
Version: 2.7.0 Version: 2.7.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: Geolocation service Summary: Geolocation service
License: GPLv2+ License: GPLv2+
URL: http://www.freedesktop.org/wiki/Software/GeoClue/ URL: http://www.freedesktop.org/wiki/Software/GeoClue/
Source0: https://gitlab.freedesktop.org/geoclue/geoclue/-/archive/%{version}/geoclue-%{version}.tar.bz2 Source0: https://gitlab.freedesktop.org/geoclue/geoclue/-/archive/%{version}/geoclue-%{version}.tar.bz2
Source1: geoclue2.sysusers
BuildRequires: avahi-glib-devel BuildRequires: avahi-glib-devel
BuildRequires: gettext BuildRequires: gettext
@ -17,10 +17,10 @@ BuildRequires: json-glib-devel
BuildRequires: libsoup3-devel BuildRequires: libsoup3-devel
BuildRequires: meson BuildRequires: meson
BuildRequires: ModemManager-glib-devel BuildRequires: ModemManager-glib-devel
BuildRequires: systemd BuildRequires: systemd, systemd-rpm-macros
BuildRequires: vala BuildRequires: vala
Requires(pre): shadow-utils
Requires: dbus Requires: dbus
%{?sysusers_requires_compat}
Obsoletes: geoclue2-server < 2.1.8 Obsoletes: geoclue2-server < 2.1.8
@ -77,20 +77,14 @@ The %{name}-demos package contains demo applications that use %{name}.
%install %install
%meson_install %meson_install
install -Dpm 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/geoclue2.conf
# Home directory for the 'geoclue' user # Home directory for the 'geoclue' user
mkdir -p $RPM_BUILD_ROOT/var/lib/geoclue mkdir -p $RPM_BUILD_ROOT/var/lib/geoclue
%pre %pre
# Update the home directory for existing users %sysusers_create_compat %{SOURCE1}
getent passwd geoclue >/dev/null && \
usermod -d /var/lib/geoclue geoclue &>/dev/null
# Create a new user and group if they don't exist
getent group geoclue >/dev/null || groupadd -r geoclue
getent passwd geoclue >/dev/null || \
useradd -r -g geoclue -d /var/lib/geoclue -s /sbin/nologin \
-c "User for geoclue" geoclue
exit 0 exit 0
%post %post
@ -119,6 +113,7 @@ exit 0
%{_mandir}/man5/geoclue.5* %{_mandir}/man5/geoclue.5*
%{_unitdir}/geoclue.service %{_unitdir}/geoclue.service
%{_libexecdir}/geoclue-2.0/demos/agent %{_libexecdir}/geoclue-2.0/demos/agent
%{_sysusersdir}/geoclue2.conf
%attr(755,geoclue,geoclue) %dir /var/lib/geoclue %attr(755,geoclue,geoclue) %dir /var/lib/geoclue
%files libs %files libs
@ -149,6 +144,10 @@ exit 0
%changelog %changelog
* Mon Oct 02 2023 Daan De Meyer <daan.j.demeyer@gmail.com> - 2.7.0-3
- Provide a sysusers.d file to get user() and group() provides
(see https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format).
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2 * Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

2
geoclue2.sysusers Normal file
View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u geoclue - "User for geoclue" /var/lib/geoclue /sbin/nologin