diff --git a/openslp.changes b/openslp.changes index 42583c0..421e63e 100644 --- a/openslp.changes +++ b/openslp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 31 14:21:40 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Tue Jun 21 12:38:51 UTC 2022 - Stefan Schubert diff --git a/openslp.spec b/openslp.spec index ae3ca02..1eb2000 100644 --- a/openslp.spec +++ b/openslp.spec @@ -206,6 +206,20 @@ install -D -m 644 %{SOURCE9} %{buildroot}%{_unitdir}/slpd.service %pre server getent passwd openslp >/dev/null || useradd -r -g daemon -d %{_localstatedir}/lib/empty -s /sbin/nologin -c "openslp daemon" openslp %service_add_pre slpd.service +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/openslp-server ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif + +%if 0%{?suse_version} > 1500 +%posttrans server +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/openslp-server ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %post server %service_add_post slpd.service