-rm -f /var/cache/fontconfig/????????????????????????????????.cache-2
-rm -f /var/cache/fontconfig/stamp
-
-chsmack -a System::Shared -t /var/cache/fontconfig
-
+rm -f /var/cache/fontconfig/*
+mkdir -p /opt/var/cache/fontconfig
+mkdir -p /usr/share/fonts
+mkdir -p /usr/share/fallback_fonts
+mkdir -p /usr/share/app_fonts
+chsmack -t /opt/var/cache/fontconfig
+chsmack -a System::Shared /opt/var/cache/fontconfig
+rm -rf /opt/home/app/.cache/fontconfig
+mkdir -p /opt/home/app/.cache/fontconfig
+chmod 755 /opt/home/app/.cache
+chown app:app /opt/home/app/.cache
+chsmack -t /opt/home/app/.cache
+chsmack -a System::Shared /opt/home/app/.cache
+chmod 755 /opt/home/app/.cache/fontconfig
+chown app:app /opt/home/app/.cache/fontconfig
+chsmack -t /opt/home/app/.cache/fontconfig
+chsmack -a System::Shared /opt/home/app/.cache/fontconfig
+
+# remove 49-sansserif.conf to fix bmc #9024
+#rm -rf /usr/%{_sysconfdir}/fonts/conf.d/49-sansserif.conf
+
+# Force regeneration of all fontconfig cache files
+# The check for existance is needed on dual-arch installs (the second
+# copy of fontconfig might install the binary instead of the first)
+# The HOME setting is to avoid problems if HOME hasn't been reset