diff --git a/sblim-sfcb.spec b/sblim-sfcb.spec index 14e0462..71cc289 100644 --- a/sblim-sfcb.spec +++ b/sblim-sfcb.spec @@ -8,7 +8,7 @@ Name: sblim-sfcb Summary: Small Footprint CIM Broker URL: http://sblim.wiki.sourceforge.net/ Version: 1.4.9 -Release: 35%{?dist} +Release: 36%{?dist} License: EPL-1.0 Source0: http://downloads.sourceforge.net/sblim/%{name}-%{version}.tar.bz2 Source1: sfcb.service @@ -16,6 +16,8 @@ Source1: sfcb.service Source2: sfcbdump.1.gz Source3: sfcbinst2mof.1.gz Source4: sfcbtrace.1.gz +# /etc/tmpfiles.d configuration file +Source5: sblim-sfcb.tmpfiles # Patch0: changes schema location to the path we use Patch0: sblim-sfcb-1.3.9-sfcbrepos-schema-location.patch # Patch1: Fix provider debugging - variable for stopping wait-for-debugger @@ -87,6 +89,12 @@ Programming Interface (CMPI). %patch -P10 -p1 -b .docdir-license %patch -P11 -p1 -b .post-quantum +# Create a sysusers.d config file +cat >sblim-sfcb.sysusers.conf <> _pkg_list cat _pkg_list -%pre -/usr/bin/getent group sfcb >/dev/null || /usr/sbin/groupadd -r sfcb -/usr/sbin/usermod -a -G sfcb root > /dev/null 2>&1 || : +install -m0644 -D sblim-sfcb.sysusers.conf %{buildroot}%{_sysusersdir}/sblim-sfcb.conf +mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir} +install -p -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/%{_tmpfilesdir}/sblim-sfcb.conf %post %{_datadir}/sfcb/genSslCert.sh %{_sysconfdir}/sfcb &>/dev/null || : /sbin/ldconfig %{_bindir}/sfcbrepos -f > /dev/null 2>&1 %systemd_post sblim-sfcb.service +# copy content of /var/lib/sfcb to temporary place for Image Mode +(mkdir -p /usr/share/factory/var/lib && cp -a /var/lib/sfcb /usr/share/factory/var/lib/sfcb) >/dev/null 2>&1 || :; %preun %systemd_preun sblim-sfcb.service +if [ $1 -eq 0 ]; then + # Package removal, not upgrade + rm -rf /usr/share/factory/var/lib/sfcb +fi %postun /sbin/ldconfig %systemd_postun_with_restart sblim-sfcb.service -if [ $1 -eq 0 ]; then - /usr/sbin/groupdel sfcb > /dev/null 2>&1 || :; -fi; %files -f _pkg_list +%{_sysusersdir}/sblim-sfcb.conf +%{_tmpfilesdir}/sblim-sfcb.conf %changelog +* Mon Sep 29 2025 Vitezslav Crhonek - 1.4.9-36 +- Add sysusers.d config file to allow rpm to create users/groups automatically + and drop attempt to delete group + Related: RHEL-114454 +- Add support for Image Mode + Resolves: RHEL-114454 + * Thu Aug 07 2025 Vitezslav Crhonek - 1.4.9-35 - Support added for post-quantum cryptography Resolves: RHEL-93092 diff --git a/sblim-sfcb.tmpfiles b/sblim-sfcb.tmpfiles new file mode 100644 index 0000000..897304c --- /dev/null +++ b/sblim-sfcb.tmpfiles @@ -0,0 +1,2 @@ +# populate /var/lib/sfcb with content from /usr/share/factory/var/lib/sfcb +C /var/lib/sfcb - - - -