diff --git a/apache2.changes b/apache2.changes index bd2cfd3..c6adb5f 100644 --- a/apache2.changes +++ b/apache2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 1 06:31:31 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Tue Jun 28 14:39:26 UTC 2022 - Stefan Schubert diff --git a/apache2.spec b/apache2.spec index 48549d1..1973cc2 100644 --- a/apache2.spec +++ b/apache2.spec @@ -955,6 +955,12 @@ exit 0 %if "%{flavor}" == "" %pre %service_add_pre apache2.service apache2.target +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/apache2 ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif exit 0 %post @@ -975,6 +981,12 @@ exit 0 %posttrans %apache_restart_if_needed +%if 0%{?suse_version} > 1500 +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/apache2 ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %verifyscript %verify_permissions -e %{_sbindir}/suexec