[DeviceHome] Apply wgt installation 84/261984/13
authorDongHyun Song <dh81.song@samsung.com>
Fri, 30 Jul 2021 04:00:41 +0000 (13:00 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Tue, 3 Aug 2021 04:59:18 +0000 (13:59 +0900)
Apply wgt installation to move the app from RO to RW and easy
wgt installation by rpm.

Change-Id: I8908539eaf4abb0ecd4bd9be65f995f840b263b8
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
packaging/wrtjs.spec
tizen/build/build_devicehome.sh [new file with mode: 0755]

index eb3a4228eef99b4a95e681c6e991267f3d3d1e5b..ad8b24b4e414e0118e743efa5c82976c21f446ff 100755 (executable)
@@ -26,12 +26,10 @@ BuildRequires: ninja
 BuildRequires: pkgconfig(dlog)
 %endif
 
-%if 0%{?_use_tpk}
 %if "%{?profile}" == "tv"
 BuildRequires: app-signer
 %endif
 BuildRequires: hash-signer, zip
-%endif
 BuildRequires: pkgconfig(libtzplatform-config)
 
 %description
@@ -101,13 +99,6 @@ absolute_appdir=$PWD/%{app_dir}
 %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/device_home.xml.in \
-      > packaging/%{_d2d_pkgid}.xml
-
   # Create a self-signed certificates for signaling server
   openssl genrsa -out key.pem 2048
   openssl req -new -x509 -nodes -key key.pem -out cert.pem \
@@ -179,16 +170,14 @@ cp -r %{app_dir}/* %{buildroot}%{_resourcedir}/
 %endif
 
 %if 0%{?_use_d2d}
-  install -d %{buildroot}%{_appdir}/%{_d2d_pkgid}/bin
-  install -d %{buildroot}%{_appdir}/%{_d2d_pkgid}/res
-  install -d %{buildroot}%{_xmldir}
-  install -m 0644 packaging/%{_d2d_pkgid}.xml %{buildroot}%{_xmldir}/
-  cp -rf device_home %{buildroot}%{_appdir}/%{_d2d_pkgid}/res/wgt/
-  ln -sf %{_bindir}/wrt-service-launcher %{buildroot}%{_appdir}/%{_d2d_pkgid}/bin/%{_d2d_pkgid}.DeviceHomeService
-  ln -sf %{_bindir}/wrt-service-launcher %{buildroot}%{_appdir}/%{_d2d_pkgid}/bin/%{_d2d_pkgid}.SignalingService
+  %define _d2d_wgt_file_name device_home.wgt
+  install -m 0644 key.pem device_home/signaling_server/gen/
+  install -m 0644 cert.pem device_home/signaling_server/gen/
+  tizen/build/build_devicehome.sh device_home/ %{buildroot} %{_d2d_wgt_file_name}
 
-  install -m 0644 key.pem %{buildroot}%{_appdir}/%{_d2d_pkgid}/res/wgt/signaling_server/gen/
-  install -m 0644 cert.pem %{buildroot}%{_appdir}/%{_d2d_pkgid}/res/wgt/signaling_server/gen/
+  install -d %{buildroot}%{_appdir}/.preload-rw-wgt/
+  install -m 0644 %{buildroot}/%{_d2d_wgt_file_name} %{buildroot}%{_appdir}/.preload-rw-wgt/
+  rm -f %{buildroot}/%{_d2d_wgt_file_name}
 %endif
 
 %pre
@@ -222,6 +211,11 @@ else
 fi
 
 %post
+%if "%{?_local_build}" == "1"
+%if 0%{?_use_d2d}
+  pkgcmd -i -t wgt -p %{_appdir}/.preload-rw-wgt/%{_d2d_wgt_file_name}
+%endif
+%endif
 
 %postun
 
@@ -232,8 +226,7 @@ rm -fr %{buildroot}
 %manifest packaging/wrtjs.manifest
 %license LICENSE
 %if 0%{?_use_d2d}
-  %{_appdir}/%{_d2d_pkgid}
-  %{_xmldir}/%{_d2d_pkgid}.xml
+  %{_appdir}/.preload-rw-wgt/%{_d2d_wgt_file_name}
 %endif
 %if "%{?tizen_profile_name}" != "tv"
   %caps(cap_setgid,cap_sys_admin=ei) %{_bindir}/wrt-loader
diff --git a/tizen/build/build_devicehome.sh b/tizen/build/build_devicehome.sh
new file mode 100755 (executable)
index 0000000..ef6aa8d
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+device_home_root=$1
+build_root=$2
+wgt_file_name=$3
+
+# This should be 'public' level with hash-signer
+/usr/bin/hash-signer.sh -a -d -b . ${device_home_root}
+
+cd ${device_home_root}
+zip -rq ${build_root}/${wgt_file_name} .