summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinstall_widgets.sh5
-rw-r--r--packaging/wrt-widgets.spec12
2 files changed, 8 insertions, 9 deletions
diff --git a/install_widgets.sh b/install_widgets.sh
index 91f9fc5..42beb02 100755
--- a/install_widgets.sh
+++ b/install_widgets.sh
@@ -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
diff --git a/packaging/wrt-widgets.spec b/packaging/wrt-widgets.spec
index fbe246b..e8f6b8a 100644
--- a/packaging/wrt-widgets.spec
+++ b/packaging/wrt-widgets.spec
@@ -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