summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@open.eurogiciel.org>2015-06-04 11:49:09 +0200
committerJosé Bollo <jose.bollo@open.eurogiciel.org>2015-06-04 11:53:06 +0200
commit29dca9d3bfa93d91590214f96222cca13be86e10 (patch)
treeb9a4c28ca4d392304b0d98c7385973cba43c4fb8
parent302961e3cbae5a66c1b9f9d393c9505272921977 (diff)
downloadtizen-platform-config-29dca9d3bfa93d91590214f96222cca13be86e10.tar.gz
tizen-platform-config-29dca9d3bfa93d91590214f96222cca13be86e10.tar.bz2
tizen-platform-config-29dca9d3bfa93d91590214f96222cca13be86e10.zip
This proposal adds the setting of the modes to the created directories. The method of describing the setting is modified to allow a more compact description. Change-Id: I865abfe4271acfab9a4e259cabefabcfc681b29d Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
-rw-r--r--packaging/tizen-platform-config.spec76
1 files changed, 43 insertions, 33 deletions
diff --git a/packaging/tizen-platform-config.spec b/packaging/tizen-platform-config.spec
index faf2e4a..2f33884 100644
--- a/packaging/tizen-platform-config.spec
+++ b/packaging/tizen-platform-config.spec
@@ -63,49 +63,60 @@ cp %{SOURCE1001} .
%post
##############################################
-# BEGIN - creation of the /etc/skel/content
+# BEGIN - setting of predefined directories (also /etc/skel)
##############################################
saveHOME="$HOME"
HOME="%{_sysconfdir}/skel"
. "%{_sysconfdir}/tizen-platform.conf"
cat << ENDOFCAT |
-$TZ_USER_HOME User::Home true
-$TZ_USER_APPROOT User::Home true
-$TZ_USER_CONTENT User::Home true
-$TZ_USER_CAMERA User::App::Shared true
-$TZ_USER_DOCUMENTS User::App::Shared true
-$TZ_USER_DOWNLOADS User::App::Shared true
-$TZ_USER_GAMES User::App::Shared true
-$TZ_USER_IMAGES User::App::Shared true
-$TZ_USER_OTHERS User::App::Shared true
-$TZ_USER_SOUNDS User::App::Shared true
-$TZ_USER_VIDEOS User::App::Shared true
-$TZ_USER_SHARE User::App::Shared true
-$TZ_USER_APP User false
-$TZ_USER_DB User false
-$TZ_USER_DESKTOP User false
-$TZ_USER_ICONS User::Home true
-$TZ_USER_PACKAGES User false
+MODE 777
+SMACK System::Shared true
+$TZ_SYS_STORAGE
+$TZ_SYS_MEDIA
+
+MODE 700
+SMACK User::Home true
+$TZ_USER_HOME
+$TZ_USER_APPROOT
+$TZ_USER_ICONS
+$TZ_USER_CONTENT
+
+SMACK User::App::Shared true
+$TZ_USER_CAMERA
+$TZ_USER_DOCUMENTS
+$TZ_USER_DOWNLOADS
+$TZ_USER_GAMES
+$TZ_USER_IMAGES
+$TZ_USER_OTHERS
+$TZ_USER_SOUNDS
+$TZ_USER_VIDEOS
+$TZ_USER_SHARE
+
+SMACK User false
+$TZ_USER_APP
+$TZ_USER_DB
+$TZ_USER_DESKTOP
+$TZ_USER_PACKAGES
ENDOFCAT
-LANG= sort | while read skelname context transmute; do
- mkdir -p "$skelname"
- chsmack -a "$context" "$skelname"
- [ "$transmute" = true ] && chsmack -t "$skelname"
+awk '
+ BEGIN {mode="700"; context="_"; transmute="false"}
+ $1 == "MODE" {mode=$2 ; next}
+ $1 == "SMACK" {context=$2 ; transmute=$3; next}
+ NF {print $1, mode, context, transmute} ' |
+LANG=C sort |
+while read dirname mode context transmute; do
+ mkdir -p -m "$mode" "$dirname"
+ if [ "$transmute" = true ]; then
+ chsmack -a "$context" "$dirname"
+ else
+ chsmack -t -a "$context" "$dirname"
+ fi >&2
done
-chmod 700 $HOME
HOME="$saveHOME"
##############################################
-# END - creation of the /etc/skel/content
+# END - setting of predefined directories (also /etc/skel)
##############################################
-mkdir -p $TZ_SYS_STORAGE
-chsmack -a 'System::Shared' -t $TZ_SYS_STORAGE
-chmod 777 $TZ_SYS_STORAGE
-
-mkdir -p $TZ_SYS_MEDIA
-chsmack -a 'System::Shared' -t $TZ_SYS_MEDIA
-chmod 777 $TZ_SYS_MEDIA
-
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
@@ -131,4 +142,3 @@ chmod 777 $TZ_SYS_MEDIA
%files -n %{name}-tools
%manifest %{name}.manifest
%{_bindir}/*
-