Apply "User::App::Shared" smack label to /opt/var/cache/fontconfig 37/70837/1 accepted/tizen/common/20160525.155347 accepted/tizen/ivi/20160524.004722 accepted/tizen/mobile/20160524.004621 accepted/tizen/tv/20160524.004656 accepted/tizen/wearable/20160524.004606 submit/tizen/20160523.040849 submit/tizen/20160523.100314
authorYoungbok Shin <youngb.shin@samsung.com>
Mon, 23 May 2016 03:11:02 +0000 (12:11 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Mon, 23 May 2016 03:11:02 +0000 (12:11 +0900)
The fontconfig cache should be accessible by application.
It fixes an issue from org.tizen.tv-viewer application.

Change-Id: I340e95d977fb5c9817a3c5af6ec20ca2ddd9ef97

packaging/fontconfig.conf [new file with mode: 0644]
packaging/fontconfig.spec

diff --git a/packaging/fontconfig.conf b/packaging/fontconfig.conf
new file mode 100644 (file)
index 0000000..a70402c
--- /dev/null
@@ -0,0 +1,3 @@
+d      /opt/var/cache/fontconfig       1774    display users
+t      /opt/var/cache/fontconfig       -       -       -       -       security.SMACK64="User::App::Shared"
+t      /opt/var/cache/fontconfig       -       -       -       -       security.SMACK64TRANSMUTE="TRUE"
index 289f8a0..bdac6a0 100644 (file)
@@ -8,13 +8,15 @@ Group:          Graphics & UI Framework/Fonts
 License:        MIT
 URL:            http://fontconfig.org
 Source0:        http://fontconfig.org/release/fontconfig-%{version}.tar.gz
-Source1001:     packaging/fontconfig.manifest
+Source100:      fontconfig.conf
+Source1001:     fontconfig.manifest
 BuildRequires:  pkgconfig(freetype2) >= %{freetype_version}
 BuildRequires:  gawk
 BuildRequires:  expat-devel
 BuildRequires:  perl
 BuildRequires:  gperf
 BuildRequires:  python
+BuildRequires:  systemd-devel
 BuildRequires:  pkgconfig(libtzplatform-config)
 Requires(pre):  %{TZ_SYS_BIN}/fc-cache, %{TZ_SYS_BIN}/mkdir %{TZ_SYS_BIN}/rm, %{TZ_SYS_BIN}/grep, %{TZ_SYS_BIN}/chsmack
 Requires(post): /sbin/ldconfig
@@ -69,6 +71,9 @@ rm -rf %{buildroot}
 
 %make_install
 
+mkdir -p %{buildroot}%{_tmpfilesdir}
+install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/fontconfig.conf
+
 # All font packages depend on this package, so we create
 # and own /usr/share/fonts
 mydir=$RPM_BUILD_ROOT%{TZ_SYS_RO_SHARE}/fonts
@@ -85,15 +90,9 @@ cat COPYING > %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}
 
 umask 0022
 
-mkdir -p %{TZ_SYS_VAR}/cache/fontconfig
-# Remove stale caches
-rm -f %{TZ_SYS_VAR}/cache/fontconfig/*
-mkdir -p %{TZ_SYS_VAR}/cache/fontconfig
 mkdir -p %{TZ_SYS_RO_SHARE}/fonts
 mkdir -p %{TZ_SYS_RO_SHARE}/fallback_fonts
 mkdir -p %{TZ_SYS_RO_SHARE}/app_fonts
-chsmack -t %{TZ_SYS_VAR}/cache/fontconfig
-chsmack -a System::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.
@@ -134,8 +133,8 @@ fi
 %doc %{TZ_SYS_RO_ETC}/fonts/conf.d/README
 %config %{TZ_SYS_RO_ETC}/fonts/conf.avail/*.conf
 %config(noreplace) %{TZ_SYS_RO_ETC}/fonts/conf.d/*.conf
-%dir %{TZ_SYS_VAR}/cache/fontconfig
 %{TZ_SYS_RO_SHARE}/license/%{name}
+%{_tmpfilesdir}/fontconfig.conf
 
 %files devel
 %manifest fontconfig.manifest