Adopt systemd-sysusers format

Resolves: rhbz#2095474

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
This commit is contained in:
Sergio Arroutbi 2022-08-17 13:54:58 +02:00
parent 52c73264ad
commit a2fd32d756
2 changed files with 11 additions and 5 deletions

View File

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

1
tang.sysusers Normal file
View File

@ -0,0 +1 @@
u tang - "Tang Network Presence Daemon user" /var/cache/tang -