Use systemd-sysusers

Resolves: RHEL-4901

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
This commit is contained in:
Rafael Guterres Jeffman 2025-01-23 17:23:20 -03:00
parent b28c050483
commit dd5ed19c75
2 changed files with 13 additions and 7 deletions

1
softhsm-sysusers.conf Normal file
View File

@ -0,0 +1 @@
u ods - "opendnssec daemon account"

View File

@ -4,11 +4,12 @@
Summary: Software version of a PKCS#11 Hardware Security Module
Name: softhsm
Version: 2.6.1
Release: %{?prever:0.}14%{?prever:.%{prever}}%{?dist}.1
Release: %{?prever:0.}15%{?prever:.%{prever}}%{?dist}
License: BSD
Url: http://www.opendnssec.org/
Source: http://dist.opendnssec.org/source/%{?prever:testing/}%{name}-%{version}.tar.gz
Source1: http://dist.opendnssec.org/source/%{?prever:testing/}%{name}-%{version}.tar.gz.sig
Source2: softhsm-sysusers.conf
Patch1: softhsm-2.6.1-rh1831086-exit.patch
Patch2: softhsm-openssl3-tests.patch
@ -75,6 +76,8 @@ autoreconf -fiv
rm -rf %{buildroot}
%make_install
install -D %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
rm %{buildroot}/%{_sysconfdir}/softhsm2.conf.sample
rm -f %{buildroot}/%{_libdir}/pkcs11/*a
mkdir -p %{buildroot}%{_includedir}/softhsm
@ -100,17 +103,15 @@ ln -s ../pkcs11/libsofthsm2.so %{buildroot}/%{_libdir}/softhsm/libsofthsm.so
%attr(1770,ods,ods) %dir %{_sharedstatedir}/softhsm/tokens
%doc LICENSE README.md NEWS
%{_mandir}/*/*
%{_sysusersdir}/%{name}.conf
%files devel
%attr(0755,root,root) %dir %{_includedir}/softhsm
%{_includedir}/softhsm/*.h
%pre
getent group ods >/dev/null || groupadd -r ods
getent passwd ods >/dev/null || \
useradd -r -g ods -d %{_sharedstatedir}/softhsm -s /sbin/nologin \
-c "softhsm private keys owner" ods
exit 0
%sysusers_create_package %{name} %{SOURCE2}
%post
@ -120,6 +121,10 @@ if [ -f /var/softhsm/slot0.db ]; then
fi
%changelog
* Thu Jan 23 2025 Rafael Jeffman <rjeffman@redhat.com> - 2.6.1-15
- Use systemd-sysusers
Resolves: RHEL-4901
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2.6.1-14.1
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
@ -377,4 +382,4 @@ fi
- Upgraded to 1.3.0
* Thu Mar 3 2011 Paul Wouters <paul@xelerance.com> - 1.2.0-1
- Initial package for Fedora
- Initial package for Fedora