Creation of the skeleton of user's directories 88/34988/5 accepted/tizen/3.0.2014.q4/common/20150211.135309 accepted/tizen/common/20150206.174043 submit/tizen_3.0.2014.q4_common/20150211.134338 submit/tizen_common/20150206.173857
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Thu, 5 Feb 2015 11:35:18 +0000 (12:35 +0100)
committerJosé Bollo <jose.bollo@open.eurogiciel.org>
Fri, 6 Feb 2015 12:46:34 +0000 (04:46 -0800)
The platform config is the place where platform configuration occurs.
At this point, the common directories of users are defined by the
file tizen-platform.meta/conf.

Here is the right place for creating the skeleton of the user's directories.

Change-Id: I15f7898dfa786648c64c8dfc90d05fef19c02685
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
packaging/tizen-platform-config.spec

index e611555..c205893 100644 (file)
@@ -12,6 +12,7 @@ Source0:        %{name}-%{version}.tar.gz
 Source1:        %{name}-rpmlintrc
 Source1001:     %{name}.manifest
 BuildRequires:  tizen-platform-wrapper >= 2
+Requires(post): smack
 
 # the main package only contains a config file but other dependent packages
 # will contain binary. So, we can't build a noarch package and have to avoid
@@ -59,6 +60,41 @@ cp %{SOURCE1001} .
 %install
 %make_install
 
+%post
+##############################################
+# BEGIN - creation of the /etc/skel/content
+##############################################
+saveHOME="$HOME"
+HOME="%{_sysconfdir}/skel"
+. "%{_sysconfdir}/tizen-platform.conf"
+cat << ENDOFCAT |
+$TZ_USER_HOME        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
+ENDOFCAT
+LANG= sort | while read skelname context transmute; do
+       mkdir -p "$skelname"
+       chsmack -a "$context" "$skelname"
+       [ "$transmute" = true ] && chsmack -t "$skelname"
+done
+HOME="$saveHOME"
+##############################################
+# END - creation of the /etc/skel/content
+##############################################
+
 %post -n %{libname} -p /sbin/ldconfig
 
 %postun -n %{libname} -p /sbin/ldconfig