From 743696ac57a35a3268114b8ee6dcb66d1b5229e1 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Fri, 4 Sep 2020 06:03:42 -0700 Subject: [PATCH] fixup! [D2D] Support wgt-in-rpm for d2d server 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 --- packaging/9z6IujVul3.xml.in | 11 +++++++++++ packaging/wrtjs.spec | 36 ++++++++++++++++++++---------------- tizen/build/build_app.sh | 4 ---- 3 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 packaging/9z6IujVul3.xml.in diff --git a/packaging/9z6IujVul3.xml.in b/packaging/9z6IujVul3.xml.in new file mode 100644 index 00000000..107fdc2d --- /dev/null +++ b/packaging/9z6IujVul3.xml.in @@ -0,0 +1,11 @@ + + + + + + + + + http://tizen.org/privilege/appmanager.launch + + diff --git a/packaging/wrtjs.spec b/packaging/wrtjs.spec index 6eb01154..f86a92de 100755 --- a/packaging/wrtjs.spec +++ b/packaging/wrtjs.spec @@ -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 diff --git a/tizen/build/build_app.sh b/tizen/build/build_app.sh index d004068e..950972cd 100755 --- a/tizen/build/build_app.sh +++ b/tizen/build/build_app.sh @@ -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 -- 2.34.1