Add config option for livebox support 12/3712/1 accepted/tizen/20130603.173548 submit/tizen/20130603.180039 submit/tmp2/20130529.080221
authorRusty Lynch <rusty.lynch@intel.com>
Sat, 25 May 2013 22:10:27 +0000 (15:10 -0700)
committerRusty Lynch <rusty.lynch@intel.com>
Wed, 29 May 2013 08:01:27 +0000 (01:01 -0700)
12 files changed:
packaging/wrt-installer.changes [new file with mode: 0644]
packaging/wrt-installer.spec
src/CMakeLists.txt
src/configuration_parser/widget_parser.cpp
src/jobs/widget_install/manifest.cpp
src/jobs/widget_install/manifest.h
src/jobs/widget_install/task_database.cpp
src/jobs/widget_install/task_database.h
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_prepare_reinstall.cpp
src/jobs/widget_uninstall/task_db_update.cpp
src/misc/widget_location.cpp

diff --git a/packaging/wrt-installer.changes b/packaging/wrt-installer.changes
new file mode 100644 (file)
index 0000000..3c25059
--- /dev/null
@@ -0,0 +1,4 @@
+* Wed May 29 2013 Rusty Lynch <rusty.lynch@intel.com> accepted/tizen/20130520.101714@6638094
+- Add config option for livebox support
+
+
index 9d0ecba..848d4d8 100644 (file)
@@ -1,3 +1,4 @@
+%bcond_with livebox
 Name:       wrt-installer
 Summary:    Installer for tizen Webruntime
 Version:    0.1.58.2
@@ -38,7 +39,9 @@ BuildRequires:  pkgconfig(shortcut)
 BuildRequires:  pkgconfig(dpl-encryption)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
 BuildRequires:  pkgconfig(app2sd)
+%if %{with livebox}
 BuildRequires:  pkgconfig(web-provider)
+%endif
 BuildRequires:  pkgconfig(libprivilege-control)
 BuildRequires:  pkgconfig(osp-appfw)
 BuildRequires:  osp-appfw-internal-devel
@@ -63,7 +66,12 @@ Description: Wrt Installer for Tizen apps and Wac apps
 export LDFLAGS+="-Wl,--rpath=/usr/lib -Wl,--hash-style=both -Wl,--as-needed"
 LDFLAGS="$LDFLAGS"
 
-cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+%cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+%if %{with livebox}
+        -DLIVEBOX_SUPPORT=On \
+%else
+        -DLIVEBOX_SUPPORT=Off \
+%endif
         -DDPL_LOG=ON \
         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
index 8832baf..c823a36 100644 (file)
@@ -21,6 +21,7 @@
 SET(TARGET_INSTALLER "wrt-installer")
 
 OPTION(LB_SUPPORT "lb support" OFF)
+OPTION(LIVEBOX_SUPPORT "Livebox support" ON)
 
 SET(INSTALLER_SRC_DIR
     ${PROJECT_SOURCE_DIR}/src
@@ -124,12 +125,16 @@ PKG_CHECK_MODULES(INSTALLER_STATIC_DEP
     pkgmgr-installer
     pkgmgr-parser
     pkgmgr-info
-    web-provider
     osp-appfw
     libsmack
     REQUIRED
 )
 
+IF(LIVEBOX_SUPPORT)
+PKG_CHECK_MODULES(web-provider)
+ADD_DEFINITIONS("-DLIVEBOX")
+ENDIF(LIVEBOX_SUPPORT)
+
 PKG_CHECK_MODULES(SYS_INSTALLER_STATIC_DEP
     appsvc
     libxml-2.0
index 56127be..ccb1693 100644 (file)
@@ -1876,7 +1876,9 @@ class AppWidgetParser : public ElementParser
     {
         if (m_properNamespace) {
             if (attribute.name == L"id") {
+#ifdef LIVEBOX
                 m_liveboxId = attribute.value;
+#endif
             } else if (attribute.name == L"primary") {
                 m_primary = attribute.value;
             } else if (attribute.name == L"auto-launch") {
@@ -1903,7 +1905,9 @@ class AppWidgetParser : public ElementParser
 
     virtual void Verify()
     {
+#ifdef LIVEBOX
         m_livebox.m_liveboxId = m_liveboxId;
+#endif
         m_livebox.m_primary = m_primary;
         m_livebox.m_autoLaunch = m_autoLaunch;
         m_livebox.m_updatePeriod = m_updatePeriod;
@@ -1938,7 +1942,9 @@ class AppWidgetParser : public ElementParser
   private:
     ConfigParserData& m_data;
     ConfigParserData::LiveboxInfo m_livebox;
+#ifdef LIVEBOX
     DPL::String m_liveboxId;
+#endif
     DPL::String m_primary;
     DPL::String m_autoLaunch;
     DPL::String m_updatePeriod;
index 15f381e..95048d2 100644 (file)
@@ -190,9 +190,11 @@ void Manifest::serialize(xmlTextWriterPtr writer)
             i->serialize(writer);
         }
         //FOREACH(f, this->font) { f->serialize(writer); }
+#ifdef LIVEBOX
         FOREACH(l, this->livebox) {
             l->serialize(writer);
         }
+#endif
         FOREACH(acc, this->account)
         {
             acc->serialize(writer);
@@ -347,6 +349,8 @@ void AppControl::serialize(xmlTextWriterPtr writer)
     endElement(writer);
 }
 
+#ifdef LIVEBOX
+
 void LiveBox::serialize(xmlTextWriterPtr writer)
 {
     startElement(writer, "livebox");
@@ -433,6 +437,7 @@ void LiveBox::serialize(xmlTextWriterPtr writer)
 
     endElement(writer);
 }
+#endif // LIVEBOX
 
 void Account::serialize(xmlTextWriterPtr writer)
 {
index cb7e6d6..fdbd628 100644 (file)
@@ -402,6 +402,8 @@ class UiApplication
 
 typedef UiApplication UiApplicationType;
 
+#ifdef LIVEBOX
+
 /**
  * @brief LiveBox element
  */
@@ -462,6 +464,7 @@ class LiveBox
 };
 
 typedef LiveBox LiveBoxInfo;
+#endif //LIVEBOX
 
 /**
  * @brief manifest element
@@ -519,12 +522,12 @@ class Manifest
         this->imeApplication.push_back(x);
     }
     //    void addFont(const FontType &x) { this->font.push_back(x); }
-
+#ifdef LIVEBOX
     void addLivebox(const LiveBoxInfo &x)
     {
         this->livebox.push_back(x);
     }
-
+#endif //LIVEBOX
     void addAccount(const Account &x)
     {
         this->account.push_back(x);
@@ -563,7 +566,9 @@ class Manifest
     std::list<UiApplicationType> uiApplication;
     std::list<ImeApplicationType> imeApplication;
     //    std::list<FontType> font;
+#ifdef LIVEBOX
     std::list<LiveBoxInfo> livebox;
+#endif
     InstallLocationType installLocation;
     NcnameType package;
     PackageType type;
index e9d1b6c..8b47cfe 100644 (file)
@@ -28,7 +28,9 @@
 #include <widget_install/job_widget_install.h>
 #include <widget_install/widget_install_errors.h>
 #include <widget_install/widget_install_context.h>
+#ifdef LIVEBOX
 #include <web_provider_livebox_info.h>
+#endif
 #include <dpl/wrt-dao-rw/widget_dao.h>
 #include <dpl/wrt-dao-ro/vconf_config.h>
 #include <dpl/foreach.h>
@@ -62,8 +64,9 @@ TaskDatabase::TaskDatabase(InstallerContext& context) :
     AddStep(&TaskDatabase::StepSecurityOriginDBInsert);
     AddStep(&TaskDatabase::StepRemoveExternalFiles);
     AddStep(&TaskDatabase::StepCreateVconf);
+#ifdef LIVEBOX
     AddStep(&TaskDatabase::StepLiveboxDBInsert);
-
+#endif
     AddAbortStep(&TaskDatabase::StepAbortDBInsert);
     AddAbortStep(&TaskDatabase::StepAbortAceDBInsert);
 }
@@ -323,6 +326,7 @@ void TaskDatabase::StepAbortAceDBInsert()
     LogDebug("Ace data inserted");
 }
 
+#ifdef LIVEBOX
 void TaskDatabase::StepLiveboxDBInsert()
 {
     if (m_context.widgetConfig.configInfo.m_livebox.size() <= 0) {
@@ -359,5 +363,6 @@ void TaskDatabase::StepLiveboxDBInsert()
                 autoLaunch, mouseEvent, pdFastOpen);
     }
 }
+#endif // LIVEBOX
 } //namespace WidgetInstall
 } //namespace Jobs
index 88d99e9..0444ca4 100644 (file)
@@ -51,8 +51,9 @@ class TaskDatabase :
     void StepSecurityOriginDBInsert();
     void StepRemoveExternalFiles();
     void StepCreateVconf();
+#ifdef LIVEBOX
     void StepLiveboxDBInsert();
-
+#endif
     void StepAbortDBInsert();
     void StepAbortAceDBInsert();
 
index 19d2ee4..3a4f0cc 100644 (file)
 #include <widget_install/job_widget_install.h>
 #include <widget_install/widget_install_errors.h>
 #include <widget_install/widget_install_context.h>
+#ifdef LIVEBOX
 #include <web_provider_livebox_info.h>
 #include <web_provider_plugin_info.h>
+#endif
 #include <dpl/wrt-dao-ro/global_config.h>
 #include <dpl/log/log.h>
 #include <dpl/file_input.h>
@@ -111,7 +113,9 @@ TaskManifestFile::TaskManifestFile(InstallerContext &inCont) :
         // for widget update.
         AddStep(&TaskManifestFile::stepBackupIconFiles);
         AddStep(&TaskManifestFile::stepCopyIconFiles);
+#ifdef LIVEBOX
         AddStep(&TaskManifestFile::stepCopyLiveboxFiles);
+#endif
         AddStep(&TaskManifestFile::stepCreateExecFile);
         AddStep(&TaskManifestFile::stepGenerateManifest);
         AddStep(&TaskManifestFile::stepParseUpgradedManifest);
@@ -120,7 +124,9 @@ TaskManifestFile::TaskManifestFile(InstallerContext &inCont) :
         AddAbortStep(&TaskManifestFile::stepAbortIconFiles);
     } else {
         AddStep(&TaskManifestFile::stepCopyIconFiles);
+#ifdef LIVEBOX
         AddStep(&TaskManifestFile::stepCopyLiveboxFiles);
+#endif
         AddStep(&TaskManifestFile::stepCreateExecFile);
         AddStep(&TaskManifestFile::stepGenerateManifest);
         AddStep(&TaskManifestFile::stepParseManifest);
@@ -306,6 +312,7 @@ void TaskManifestFile::stepCopyIconFiles()
         "Widget iconfile copy Finished");
 }
 
+#ifdef LIVEBOX
 void TaskManifestFile::stepCopyLiveboxFiles()
 {
     LogDebug("Copy Livebox Files");
@@ -367,6 +374,7 @@ void TaskManifestFile::stepCopyLiveboxFiles()
         InstallerContext::INSTALL_COPY_LIVEBOX_FILES,
         "Livebox files copy Finished");
 }
+#endif // LIVEBOX
 
 void TaskManifestFile::stepBackupIconFiles()
 {
@@ -669,7 +677,9 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
     setWidgetOtherInfo(uiApp);
     setAppCategory(uiApp);
     setMetadata(uiApp);
+#ifdef LIVEBOX
     setLiveBoxInfo(manifest);
+#endif
     setAccount(manifest);
     setPrivilege(manifest);
     manifest.addUiApplication(uiApp);
@@ -709,7 +719,9 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
     setAppControlsInfo(uiApp);
     setAppCategory(uiApp);
     setMetadata(uiApp);
+#ifdef LIVEBOX
     setLiveBoxInfo(manifest);
+#endif
     setAccount(manifest);
     setPrivilege(manifest);
 
@@ -1046,6 +1058,7 @@ void TaskManifestFile::stepAbortParseManifest()
     }
 }
 
+#ifdef LIVEBOX
 void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
 {
     FOREACH(it, m_context.widgetConfig.configInfo.m_livebox) {
@@ -1115,6 +1128,7 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
 
             if (ConfigInfo->m_boxInfo.m_boxMouseEvent == L"true") {
                 std::string boxType;
+
                 if (ConfigInfo->m_type == L"") {
                     // in case of default livebox
                     boxType = web_provider_livebox_get_default_type();
@@ -1173,6 +1187,7 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
         manifest.addLivebox(liveBox);
     }
 }
+#endif // LIVEBOX
 
 void TaskManifestFile::setAccount(Manifest& manifest)
 {
index 20a209c..772375a 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #include <fstream>
+#include <unistd.h>
 
 #include <dpl/task.h>
 #include <dpl/string.h>
index 9047aae..8b55aa9 100644 (file)
@@ -20,7 +20,9 @@
  * @brief   Implementation file for uninstaller task database updating
  */
 
+#ifdef LIVEBOX
 #include <web_provider_livebox_info.h>
+#endif
 #include <widget_uninstall/task_db_update.h>
 #include <widget_uninstall/job_widget_uninstall.h>
 #include <widget_uninstall/widget_uninstall_errors.h>
@@ -38,7 +40,9 @@ TaskDbUpdate::TaskDbUpdate(UninstallerContext& context) :
     m_context(context)
 {
     AddStep(&TaskDbUpdate::StepDbUpdate);
+#ifdef LIVEBOX
     AddStep(&TaskDbUpdate::StepLiveboxDBDelete);
+#endif
 }
 
 TaskDbUpdate::~TaskDbUpdate()
@@ -70,6 +74,7 @@ void TaskDbUpdate::StepDbUpdate()
         "Widget DB Update Finished");
 }
 
+#ifdef LIVEBOX
 void TaskDbUpdate::StepLiveboxDBDelete()
 {
     int ret =
@@ -81,5 +86,6 @@ void TaskDbUpdate::StepLiveboxDBDelete()
         LogInfo("delete box info: " << m_context.tzAppid);
     }
 }
+#endif // LIVEBOX
 } //namespace WidgetUninstall
 } //namespace Jobs
index a2905aa..fce31c0 100644 (file)
@@ -19,6 +19,7 @@
  */
 #include "widget_location.h"
 
+#include <unistd.h>
 #include <dpl/utils/wrt_utility.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 #include <dpl/assert.h>