-mkdir -p /var/cache/fontconfig
-# Remove stale caches
-rm -f /var/cache/fontconfig/????????????????????????????????.cache-2
-rm -f /var/cache/fontconfig/stamp
-
-if [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache --version 2>&1 | grep -q %{version} ; then
-HOME=/root /usr/bin/fc-cache -f
-fi
+mkdir -p %{TZ_SYS_RO_SHARE}/fonts
+mkdir -p %{TZ_SYS_RO_SHARE}/fallback_fonts
+mkdir -p %{TZ_SYS_RO_SHARE}/app_fonts
+
+mkdir -p %{TZ_SYS_VAR}/cache/fontconfig
+chown root:root %{TZ_SYS_VAR}/cache/fontconfig
+chmod 755 %{TZ_SYS_VAR}/cache/fontconfig
+chsmack -t %{TZ_SYS_VAR}/cache/fontconfig
+chsmack -a User::App::Shared %{TZ_SYS_VAR}/cache/fontconfig
+
+# Skip making fontconfig cache folder for users. (/opt/home/app/.cache)
+# The path will be changed according to a name of user.
+#rm -rf %{TZ_USER_CACHE}/fontconfig
+#mkdir -p %{TZ_USER_CACHE}/fontconfig
+#chmod 755 %{TZ_USER_CACHE}
+#chown app:app %{TZ_USER_CACHE}
+#chsmack -t %{TZ_USER_CACHE}
+#chsmack -a System::Shared %{TZ_USER_CACHE}
+#chmod 755 %{TZ_USER_CACHE}/fontconfig
+#chown app:app %{TZ_USER_CACHE}/fontconfig
+#chsmack -t %{TZ_USER_CACHE}/fontconfig
+#chsmack -a System::Shared %{TZ_USER_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
+#if [ -x %{TZ_SYS_BIN}/fc-cache ] && %{TZ_SYS_BIN}/fc-cache --version 2>&1 | grep -q %{version} ; then
+#fc-cache -rf --system-only
+#fi