mkdir -p %{buildroot}%{_libdir}/systemd/user
install -m 644 %{SOURCE100} %{buildroot}%{_libdir}/systemd/user
+
+mkdir -p %{buildroot}/usr/bin
+install -m 755 wrt_preinstall_widgets.sh %{buildroot}/usr/bin
+
mkdir -p %{buildroot}%{_libdir}/systemd/user/tizen-mobile-session.target.wants
ln -s ../wrt-preinstall-widgets.service %{buildroot}%{_libdir}/systemd/user/tizen-mobile-session.target.wants
mkdir -p %{buildroot}/opt/share/packages
+mkdir -p %{buildroot}/opt/usr/apps/.preinstallWidgets
%clean
rm -rf %{buildroot}
%{_datadir}/license/%{name}
%{_libdir}/systemd/user/tizen-mobile-session.target.wants/wrt-preinstall-widgets.service
%{_libdir}/systemd/user/wrt-preinstall-widgets.service
+/usr/bin/wrt_preinstall_widgets.sh
%dir /opt/share/packages
+%dir /opt/usr/apps/.preinstallWidgets
%if %{with_tests}
%attr(755,root,root) %{_bindir}/wrt-installer-tests-*
/opt/share/widget/tests/installer/widgets/*
[Unit]
Description=Installation of pre-installed widgets
-ConditionPathExists=/opt/media/Downloads/.preinstallWidgets
-After=xorg.target e17.service
+ConditionPathExists=!/opt/usr/apps/.preinstallWidgets/preinstallDone
+After=wrt-security-daemon.service
[Service]
Type=oneshot
-ExecStart=/etc/init.d/wrt_preinstall_widgets.sh
+ExecStart=/usr/bin/wrt_preinstall_widgets.sh
--- /dev/null
+#!/bin/sh
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+_working_dir="/opt/usr/apps/.preinstallWidgets"
+
+install_widgets() {
+ _wgt_list=`find $_working_dir -name '*.wgt'`
+ for list in $_wgt_list
+ do
+ echo "Install $list"
+ wrt-installer -i $list
+ done
+
+}
+
+if [ ! -d $_working_dir ]; then
+ echo "There is no preinstall widget directory - $_working_dir"
+ exit 1
+fi
+
+install_widgets
+
+touch /opt/usr/apps/.preinstallWidgets/preinstallDone