diff --git a/tang.spec b/tang.spec index 9f9e63d..eb73a3e 100644 --- a/tang.spec +++ b/tang.spec @@ -1,11 +1,12 @@ Name: tang Version: 11 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Network Presence Binding Daemon License: GPLv3+ URL: https://github.com/latchset/%{name} Source0: https://github.com/latchset/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz +Source1: tang.sysusers BuildRequires: gcc BuildRequires: meson @@ -20,6 +21,7 @@ BuildRequires: systemd-devel BuildRequires: pkgconfig BuildRequires: systemd +BuildRequires: systemd-rpm-macros BuildRequires: curl BuildRequires: asciidoc @@ -48,6 +50,7 @@ Tang is a small daemon for binding data to the presence of a third party. %install %meson_install +install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/tang.conf echo "User=%{name}" >> $RPM_BUILD_ROOT/%{_unitdir}/%{name}d@.service %{__mkdir_p} $RPM_BUILD_ROOT/%{_localstatedir}/db/%{name} @@ -55,10 +58,7 @@ echo "User=%{name}" >> $RPM_BUILD_ROOT/%{_unitdir}/%{name}d@.service %meson_test %pre -getent group %{name} >/dev/null || groupadd -r %{name} -getent passwd %{name} >/dev/null || \ - useradd -r -g %{name} -d %{_localstatedir}/cache/%{name} -s /sbin/nologin \ - -c "Tang Network Presence Daemon user" %{name} +%sysusers_create_compat %{SOURCE1} exit 0 %post @@ -96,8 +96,13 @@ fi %{_bindir}/%{name}-show-keys %{_mandir}/man1/tang-show-keys.1* %{_mandir}/man1/tangd-rotate-keys.1.* +%{_sysusersdir}/tang.conf %changelog +* Wed Aug 17 2022 Sergio Arroutbi - 11-2 +- Adopt systemd-sysusers format + Resolves: rhbz#2095474 + * Tue Dec 14 2021 Sergio Correia - 11-1 - New upstream release - v11. Resolves: CVE-2021-4076 diff --git a/tang.sysusers b/tang.sysusers new file mode 100644 index 0000000..98e12f5 --- /dev/null +++ b/tang.sysusers @@ -0,0 +1 @@ +u tang - "Tang Network Presence Daemon user" /var/cache/tang -