From 0cbee96a357c6248fbd0d50c5b1872c184ab9b12 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Mon, 23 May 2016 12:11:02 +0900 Subject: [PATCH] Apply "User::App::Shared" smack label to /opt/var/cache/fontconfig The fontconfig cache should be accessible by application. It fixes an issue from org.tizen.tv-viewer application. Change-Id: I340e95d977fb5c9817a3c5af6ec20ca2ddd9ef97 --- packaging/fontconfig.conf | 3 +++ packaging/fontconfig.spec | 15 +++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 packaging/fontconfig.conf diff --git a/packaging/fontconfig.conf b/packaging/fontconfig.conf new file mode 100644 index 0000000..a70402c --- /dev/null +++ b/packaging/fontconfig.conf @@ -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" diff --git a/packaging/fontconfig.spec b/packaging/fontconfig.spec index 289f8a0..bdac6a0 100644 --- a/packaging/fontconfig.spec +++ b/packaging/fontconfig.spec @@ -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 -- 2.7.4