fixup! [D2D] Support wgt-in-rpm for d2d server 16/243316/1 accepted/tizen/unified/20200906.032654 submit/tizen/20200904.131234
authorYoungsoo Choi <kenshin.choi@samsung.com>
Fri, 4 Sep 2020 13:03:42 +0000 (06:03 -0700)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Fri, 4 Sep 2020 13:04:35 +0000 (06:04 -0700)
The d2d server installation wasn't worked since it was installed in
read-write area. The OBS only makes platform image from read-only area.

So, this tries to locate the d2d server sources in read-only area.

Change-Id: Ie4d4e79c90ea5f8d55860b8669213933a7a58f54
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
packaging/9z6IujVul3.xml.in [new file with mode: 0644]
packaging/wrtjs.spec
tizen/build/build_app.sh

diff --git a/packaging/9z6IujVul3.xml.in b/packaging/9z6IujVul3.xml.in
new file mode 100644 (file)
index 0000000..107fdc2
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_ID@" type="wgt" version="@WRTJS_VERSION@" api-version="@TIZEN_VERSION@" nodisplay-setting="false" readonly="true" preload="true">
+  <label>D2DGlobalService</label>
+  <author/>
+  <ui-application appid="@PACKAGE_ID@.Service" exec="/usr/apps/@PACKAGE_ID@/bin/@PACKAGE_ID@.Service" type="capp" taskmanage="false" nodisplay="true" multiple="false">
+    <label>D2DGlobalService</label>
+  </ui-application>
+  <privileges>
+    <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+  </privileges>
+</manifest>
index 6eb0115..f86a92d 100755 (executable)
@@ -9,6 +9,9 @@ License:    Apache-2.0
 URL:        https://www.tizen.org
 Source:     %{name}-%{version}.tar.gz
 
+%define _appdir %TZ_SYS_RO_APP
+%define _bindir %TZ_SYS_BIN
+%define _xmldir %TZ_SYS_RO_PACKAGES
 %define app_dir out/gen/app
 %define crosswalk_extensions_service tizen-extensions-crosswalk-service
 # The d2d is public feature
@@ -97,6 +100,15 @@ absolute_appdir=$PWD/%{app_dir}
       > packaging/tizen-manifest-tpk.xml
 %endif
 
+%if 0%{?_use_d2d}
+  %define _d2d_pkgid 9z6IujVul3
+  sed -e 's#@TIZEN_VERSION@#%{tizen_version_major}.%{tizen_version_minor}#g' \
+      -e 's#@WRTJS_VERSION@#%{version}#g' \
+      -e 's#@PACKAGE_ID@#%{_d2d_pkgid}#g' \
+      packaging/%{_d2d_pkgid}.xml.in \
+      > packaging/%{_d2d_pkgid}.xml
+%endif
+
 %install
 %ifarch armv7l
   %define ARCHITECTURE armv7l
@@ -165,9 +177,12 @@ cp -r %{app_dir}/* %{buildroot}%{_resourcedir}/
 %endif
 
 %if 0%{?_use_d2d}
-  %define _d2d_file_name GlobalDeviceWebServer.wgt
-  tizen/build/build_app.sh %{GENERATED_APP_DIR} d2d_wgt_root %{_d2d_file_name} wgt %{?profile}
-  mv %{GENERATED_APP_DIR}/%{_d2d_file_name} %{buildroot}%{WRTJS_APP_DIR}
+  install -d %{buildroot}%{_xmldir}
+  install -d %{buildroot}%{_appdir}/%{_d2d_pkgid}/res
+  install -d %{buildroot}%{_appdir}/%{_d2d_pkgid}/bin
+  install -m 0644 packaging/%{_d2d_pkgid}.xml %{buildroot}%{_xmldir}/
+  cp -rf d2d_app %{buildroot}%{_appdir}/%{_d2d_pkgid}/res/wgt/
+  ln -sf %{_bindir}/wrt-service-launcher %{buildroot}%{_appdir}/%{_d2d_pkgid}/bin/%{_d2d_pkgid}.Service
 %endif
 
 %pre
@@ -207,20 +222,8 @@ else
 fi
 
 %post
-%if 0%{?_use_d2d}
-  echo "* Install D2D Server..."
-  pkgcmd -i -p %{WRTJS_APP_DIR}/%{_d2d_file_name}
-  rm -f %{WRTJS_APP_DIR}/%{_d2d_file_name}
-%endif
 
 %postun
-%if 0%{?_use_d2d}
-  %define _d2d_pkgid 9z6IujVul3
-  if [[ "$(app_launcher -l | grep %{_d2d_pkgid})" != "" ]]; then
-    echo "* Uninstall D2D Server..."
-    pkgcmd -u -n %{_d2d_pkgid}
-  fi
-%endif
 
 %clean
 rm -fr %{buildroot}
@@ -229,7 +232,8 @@ rm -fr %{buildroot}
 %manifest packaging/wrtjs.manifest
 %license LICENSE
 %if 0%{?_use_d2d}
-  %{WRTJS_APP_DIR}/%{_d2d_file_name}
+  %{_xmldir}/%{_d2d_pkgid}.xml
+  %{_appdir}/%{_d2d_pkgid}
 %endif
 %if "%{?tizen_profile_name}" != "tv"
   %caps(cap_setgid,cap_sys_admin=ei) %{_bindir}/wrt-loader
index d004068..950972c 100755 (executable)
@@ -23,10 +23,6 @@ if [ "${file_extension}" == "tpk" ]; then
   install -m 0644 packaging/tizen-manifest-tpk.xml ${source_path}/tizen-manifest.xml
   install -m 0644 LICENSE ${source_path}/license
   cp -rf out/gen/app ${source_path}/shared/res/wrt/app
-elif [ "${file_extension}" == "wgt" ]; then
-  # D2D Server
-  cp -rf d2d_app ${source_path}
-  rm -rf ${source_path}/.project ${source_path}/.tproject
 else
   echo "Please add proper file extension."
   exit 1