From d5c2abfc93cf77d2d9e5870341609acacaf84786 Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Thu, 9 Oct 2014 13:39:12 -0700 Subject: [PATCH] Use pkgcmd to install SDL Crosswalk app. This set of changes does the following: - reduces hardcoding of SDL Crosswalk package and app IDs - corrects SDL Crosswalk package installation and uninstallation With these changes in place, the sample HMI may once again be launched through the smartDeviceLinkCore program. The sample HMI now also responds to touch input as well. Change-Id: I06883624e71f706d3ef0317383be7dc240538cff Bug-Tizen: TC-244 Signed-off-by: Ossama Othman --- packaging/{config.xml => config.xml.in} | 4 ++-- packaging/smartdevicelink.changes | 4 ++++ packaging/smartdevicelink.spec | 29 ++++++++++++++++------------- 3 files changed, 22 insertions(+), 15 deletions(-) rename packaging/{config.xml => config.xml.in} (92%) diff --git a/packaging/config.xml b/packaging/config.xml.in similarity index 92% rename from packaging/config.xml rename to packaging/config.xml.in index bf45b6a..c7afef4 100644 --- a/packaging/config.xml +++ b/packaging/config.xml.in @@ -2,8 +2,8 @@ - + SmartDeviceLink diff --git a/packaging/smartdevicelink.changes b/packaging/smartdevicelink.changes index f805338..0f1d3b1 100644 --- a/packaging/smartdevicelink.changes +++ b/packaging/smartdevicelink.changes @@ -1,3 +1,7 @@ +* Thu Oct 09 2014 Ossama Othman submit/tizen_ivi/20140918.175344-1-gedd6685 +- Launch SDL HMIs via xwalk-launcher. +- Use pkgcmd to install SDL Crosswalk app. + * Thu Aug 07 2014 Ossama Othman accepted/tizen/ivi/panda/20140403.015744-2-g2948856 - Remove dependency to MiniBrowser - Make SmartDeviceLink work with Crosswalk. diff --git a/packaging/smartdevicelink.spec b/packaging/smartdevicelink.spec index 7e54acf..785ccda 100644 --- a/packaging/smartdevicelink.spec +++ b/packaging/smartdevicelink.spec @@ -1,3 +1,6 @@ +%define SDL_PKGID SDL0000001 +%define SDL_APPID %{SDL_PKGID}.SmartDeviceLink + Name: smartdevicelink Summary: GENIVI mobile device and HMI integration Version: 2.0 @@ -8,7 +11,7 @@ URL: http://projects.genivi.org/smartdevicelink/ Source: %{name}-%{version}.tar.gz Source1: %{name}.xml Source1001: %{name}.manifest -Source2001: config.xml +Source2001: config.xml.in Source2002: manifest.json BuildRequires: cmake BuildRequires: pkgconfig(bluez) @@ -21,7 +24,6 @@ BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: doxygen BuildRequires: zip Requires: crosswalk -Requires(post): /usr/bin/pkg_initdb # Custom SDL-enabled HMIs should "Provide" this virtual package. Requires: smartdevicelink-hmi @@ -91,12 +93,15 @@ install -m 0755 SDL_Core/src/thirdPartyLibs/jsoncpp/libjsoncpp.so %{buildroot}%{ # The SDL HMI will be launched with xwalk-launcher so package it as a # Crosswalk widget. mkdir -p %{buildroot}%{TZ_SYS_APP_PREINSTALL} -cd %{dirname:%SOURCE2001} \ - && zip %{buildroot}%{TZ_SYS_APP_PREINSTALL}/%{name}.wgt config.xml manifest.json \ - && cd - -cd SDL_Core/src/components/HMI \ - && zip -r %{buildroot}%{TZ_SYS_APP_PREINSTALL}/%{name}.wgt . \ - && cd - +pushd %{dirname:%SOURCE2001} +sed -e 's/%%SDL_PKGID%%/%{SDL_PKGID}/' \ + -e 's/%%SDL_APPID%%/%{SDL_APPID}/' %{SOURCE2001} > config.xml +zip %{buildroot}%{TZ_SYS_APP_PREINSTALL}/%{name}.wgt config.xml manifest.json +rm config.xml +popd +pushd SDL_Core/src/components/HMI +zip -r %{buildroot}%{TZ_SYS_APP_PREINSTALL}/%{name}.wgt . +popd # Create the 'hmi_link' file with the location of the sample HMI. # Normally this would be the path to the top-level index.html file for @@ -104,7 +109,7 @@ cd SDL_Core/src/components/HMI \ # since we are using xwalk-laucher to launch the HMI we must instead # provide the SDL Crosswalk application ID, i.s. SmartDeviceLink, # instead. -echo SDL0000001.SmartDeviceLink > %{buildroot}%{_sysconfdir}/%{name}/hmi_link +echo %{SDL_APPID} > %{buildroot}%{_sysconfdir}/%{name}/hmi_link # Install Tizen package metadata for smartdevicelink mkdir -p %{buildroot}%{_datadir}/packages/ @@ -118,14 +123,12 @@ install -m 0644 SDL_Core/src/components/HMI/images/sdl/devices.png \ %post -p /sbin/ldconfig %post sample-hmi -/usr/bin/pkg_initdb -su app -c "xwalkctl -i %{TZ_SYS_APP_PREINSTALL}/%{name}.wgt" +su app -c "pkgcmd -q -i -t wgt -p %{TZ_SYS_APP_PREINSTALL}/%{name}.wgt" %postun -p /sbin/ldconfig %postun sample-hmi -/usr/bin/pkg_initdb -su app -c "xwalkctl -u $(su app -c "xwalkctl list | grep SmartDeviceLink | cut -c 1-32")" +su app -c "pkgcmd -u -n %{SDL_PKGID} -q" %files %manifest %{name}.manifest -- 2.7.4