diff --git a/geoclue2.spec b/geoclue2.spec index 986e5cf..7f2dc86 100644 --- a/geoclue2.spec +++ b/geoclue2.spec @@ -1,12 +1,12 @@ Name: geoclue2 Version: 2.7.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Geolocation service License: GPLv2+ URL: http://www.freedesktop.org/wiki/Software/GeoClue/ Source0: https://gitlab.freedesktop.org/geoclue/geoclue/-/archive/%{version}/geoclue-%{version}.tar.bz2 - +Source1: geoclue2.sysusers BuildRequires: avahi-glib-devel BuildRequires: gettext @@ -17,10 +17,10 @@ BuildRequires: json-glib-devel BuildRequires: libsoup3-devel BuildRequires: meson BuildRequires: ModemManager-glib-devel -BuildRequires: systemd +BuildRequires: systemd, systemd-rpm-macros BuildRequires: vala -Requires(pre): shadow-utils Requires: dbus +%{?sysusers_requires_compat} Obsoletes: geoclue2-server < 2.1.8 @@ -77,20 +77,14 @@ The %{name}-demos package contains demo applications that use %{name}. %install %meson_install +install -Dpm 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/geoclue2.conf # Home directory for the 'geoclue' user mkdir -p $RPM_BUILD_ROOT/var/lib/geoclue %pre -# Update the home directory for existing users -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 +%sysusers_create_compat %{SOURCE1} exit 0 %post @@ -119,6 +113,7 @@ exit 0 %{_mandir}/man5/geoclue.5* %{_unitdir}/geoclue.service %{_libexecdir}/geoclue-2.0/demos/agent +%{_sysusersdir}/geoclue2.conf %attr(755,geoclue,geoclue) %dir /var/lib/geoclue %files libs @@ -149,6 +144,10 @@ exit 0 %changelog +* Mon Oct 02 2023 Daan De Meyer - 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 - 2.7.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/geoclue2.sysusers b/geoclue2.sysusers new file mode 100644 index 0000000..07f415c --- /dev/null +++ b/geoclue2.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u geoclue - "User for geoclue" /var/lib/geoclue /sbin/nologin \ No newline at end of file