fontconfig: skip creation cache files at the package installation
[platform/upstream/fontconfig.git] / packaging / fontconfig.spec
index bdac6a0..3590781 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:           fontconfig
 Summary:        Font configuration and customization library
-Version:        2.11.93
+Version:        2.12.1
 Release:        1
 Group:          Graphics & UI Framework/Fonts
 License:        MIT
@@ -22,6 +22,8 @@ Requires(pre):  %{TZ_SYS_BIN}/fc-cache, %{TZ_SYS_BIN}/mkdir %{TZ_SYS_BIN}/rm, %{
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
+%define upgrade_script_path /usr/share/upgrade/scripts
+
 %description
 Fontconfig is designed to locate fonts within the
 system and select them according to requirements specified by
@@ -55,7 +57,7 @@ export HASDOCBOOK=no
     --with-expat-include=%{_includedir} \
     --with-expat-lib=%{_libdir} \
     --with-freetype-config=%{TZ_SYS_BIN}/freetype-config \
-    --with-add-fonts=%{TZ_SYS_RO_SHARE}/fonts,%{TZ_SYS_RO_SHARE}/app_fonts,%{TZ_SYS_RO_SHARE}/fallback_fonts \
+    --with-add-fonts=%{TZ_SYS_RO_SHARE}/fonts,%{TZ_SYS_RO_SHARE}/app_fonts,%{TZ_SYS_RO_SHARE}/fallback_fonts,%{TZ_SYS_SHARE}/fonts \
     --with-cache-dir=%{TZ_SYS_VAR}/cache/fontconfig \
     --with-baseconfigdir=%{TZ_SYS_RO_ETC}/fonts \
     --with-configdir=%{TZ_SYS_RO_ETC}/fonts/conf.d \
@@ -68,6 +70,8 @@ make %{?jobs:-j%jobs}
 #make check
 %install
 rm -rf %{buildroot}
+mkdir -p %{buildroot}%{upgrade_script_path}
+cp -f scripts/fontconfig_upgrade.sh %{buildroot}%{upgrade_script_path}
 
 %make_install
 
@@ -94,6 +98,12 @@ 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
@@ -114,9 +124,9 @@ mkdir -p %{TZ_SYS_RO_SHARE}/app_fonts
 # 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
+#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
 
 %postun -p /sbin/ldconfig
 
@@ -135,6 +145,7 @@ fi
 %config(noreplace) %{TZ_SYS_RO_ETC}/fonts/conf.d/*.conf
 %{TZ_SYS_RO_SHARE}/license/%{name}
 %{_tmpfilesdir}/fontconfig.conf
+%{upgrade_script_path}/fontconfig_upgrade.sh
 
 %files devel
 %manifest fontconfig.manifest