diff --git a/eclipse.spec b/eclipse.spec index 6c39754..02991c9 100644 --- a/eclipse.spec +++ b/eclipse.spec @@ -294,6 +294,37 @@ sed -i "s/@PDEBUILDVERSION@/$PDEBUILDVERSION/g" \ # by running the reconciler in %post platform rm -rf %{_libdir}/%{name}/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/* +%preun platform +# Because of our use of the reconciler there are files which are created +# during installation which rpm does not know about. These files must +# be removed here. + +# Remove all configuration files created by the reconciler so that we +# can have a clean uninstall. +rm -rf %{_libdir}/%{name}/p2/org.eclipse.equinox.p2.core/cache +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.equinox.app +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.core.runtime +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.osgi/bundles/*/data +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.equinox.source/ +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.update/ + +# Remove .bundledata* .lazy* .manager .state* +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.osgi/.bundledata* +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.osgi/.lazy* +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.osgi/.manager +rm -rf %{_libdir}/%{name}/configuration/org.eclipse.osgi/.state* + +# Delete all empty bundle directories. +find %{_libdir}/%{name}/configuration/org.eclipse.osgi/bundles/ -depth -type d -empty -delete + +# Delete orphaned profile files +find %{_libdir}/%{name}/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/* | while read file +do + rpm -qf "$file" >/dev/null + if [ $? != 0 ]; then rm -f $file; fi +done + + %post platform touch --no-create %{_datadir}/icons/hicolor if [ -x /usr/bin/gtk-update-icon-cache ]; then @@ -558,6 +589,10 @@ rm -rf %{_bindir}/efj/ %{_libdir}/%{name}/dropins/sdk %changelog +* Mon Oct 3 2011 Sami Wagiaalla 1:3.7.0-5 +- Remove all metadata files created by the reconciler before + uninstallation. + * Mon Oct 3 2011 Sami Wagiaalla 1:3.7.0-5 - Install .so extraction file. - Extract .so files when the reconciler is run with -clean