fix widgets install in multiuser mode 57/19457/1
authorStephane Desneux <stephane.desneux@open.eurogiciel.org>
Fri, 11 Apr 2014 14:53:46 +0000 (16:53 +0200)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Fri, 11 Apr 2014 14:53:46 +0000 (16:53 +0200)
Change-Id: I95b2a246750b1eca603775c5be09a70ba3291fb8
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
install_widgets.sh
packaging/wrt-widgets.spec

index 91f9fc5..42beb02 100755 (executable)
@@ -25,10 +25,11 @@ do
        fi
 done
 
-repo=${TZ_USER_APP}/
-chmod -R a+rw ${TZ_SYS_DB}/
+[[ "$(id -u)" == "0" ]] && chmod -R a+rw ${TZ_SYS_DB}/
 
 if [ -x /usr/bin/wrt-launcher ]; then
+       repo=${TZ_USER_APP}/
+
        wrt-launcher --list |
        awk 'NR>2{print $2, $5, $6}' |
        while read name packid appid
index fbe246b..e8f6b8a 100644 (file)
@@ -6,6 +6,8 @@ Group:      Web Framework/Web Run Time
 License:    Apache-2.0
 BuildArch:  noarch
 Source0:    %{name}-%{version}.tar.gz
+BuildRequires: pkgconfig(libtzplatform-config)
+Requires:   libtzplatform-config
 
 %description
 Wrt-widgets prepare a suitable pc oriented environment to install Web apps
@@ -22,16 +24,12 @@ mkdir -p %{buildroot}/%{_bindir}
 cp install_widgets.sh %{buildroot}/%{_bindir}
 cp prepare_widgets.sh %{buildroot}/%{_bindir}
 
-if [ ! -d %{buildroot}/%{_datadir}/widget_demo ]
-then
-    mkdir -p  %{buildroot}/%{_datadir}/widget_demo
-fi
-
-cp -r *.wgt %{buildroot}/%{_datadir}/widget_demo/
+mkdir -p  %{buildroot}/%{TZ_SYS_SHARE}/widget_demo
+cp -r *.wgt %{buildroot}/%{TZ_SYS_SHARE}/widget_demo/
 
 %post
 
 %files
-%{_datadir}/widget_demo/*.wgt
+%{TZ_SYS_SHARE}/widget_demo/*.wgt
 %attr(755,root,root) %{_bindir}/install_widgets.sh
 %attr(755,root,root) %{_bindir}/prepare_widgets.sh