Add multi-user support 70/17770/4 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen tizen_3.0.2014.q3_common tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.m14.2_ivi tizen_3.0.m14.3_ivi submit/tizen_common/20140521.163740 submit/tizen_common/20140522.130648 submit/tizen_common/20140522.135644 submit/tizen_ivi/20140618.000000 submit/tizen_ivi/20140618.000001 submit/tizen_ivi/20140619.000000 submit/tizen_ivi/20140622.000000 submit/tizen_ivi/20140623.000000 submit/tizen_ivi/20140624.064036 submit/tizen_ivi/20140626.125712 submit/tizen_ivi/20140626.130032 submit/tizen_ivi/20140626.144348 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.2_ivi_release tizen_3.0.m14.3_ivi_release
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Thu, 13 Feb 2014 13:24:16 +0000 (14:24 +0100)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Fri, 16 May 2014 09:14:43 +0000 (11:14 +0200)
Bug-Tizen: PTREL-271
Change-Id: I65b0d09ba91e9d072358d50950f31bd31c22c143
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
CMakeLists.txt
include/common/common_define_internal.h
oma-ds-agent.manifest.in [moved from oma-ds-agent.manifest with 55% similarity, mode: 0644]
oma-ds-agent.service
oma-ds-cfg/omads_fw_config.xml.in [moved from oma-ds-cfg/omads_fw_config.xml with 96% similarity]
packaging/oma-ds-agent.spec
src/agent/CMakeLists.txt

index a247e15..2839847 100644 (file)
@@ -10,6 +10,9 @@ SET(PLUGINDIR "${PREFIX}/lib/${PROJECT_NAME}")
 SET(VERSION "0.1.66")
 SET(VERSION_MAJOR "0")
 
+CONFIGURE_FILE(oma-ds-cfg/omads_fw_config.xml.in oma-ds-cfg/omads_fw_config.xml)
+CONFIGURE_FILE(oma-ds-agent.manifest.in oma-ds-agent.manifest)
+
 # pass macro defition to source files
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 ADD_DEFINITIONS("-DPLUGINDIR=\"${PLUGINDIR}\"")
index 7187d27..e07e9d1 100755 (executable)
@@ -29,6 +29,9 @@
 #include <glib.h>
 #include <string.h>
 
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 /* #define COMMUNICATION_TYPE SYNC_AGENT_PB_ENCODING_XML */
 #define COMMUNICATION_TYPE SYNC_AGENT_PB_ENCODING_WBXML_12
 
@@ -43,8 +46,8 @@
 #define DEFINE_PLATFORM 1
 #define LOW_BATTERY_LEVEL 10
 
-#define OMA_DS_MSG_PATH "/opt/usr/data/oma-ds/debug_msg"
-#define OMA_DS_CSC_CHECK_PATH "/opt/usr/data/oma-ds/csc_check"
+#define OMA_DS_MSG_PATH tzplatform_mkpath3(TZ_USER_DATA, "oma-ds", "debug_msg")
+#define OMA_DS_CSC_CHECK_PATH tzplatform_mkpath3(TZ_USER_DATA, "oma-ds", "csc_check")
 
 #define ELEMENT_TEXT_VCARD "text/x-vcard"
 #define ELEMENT_TEXT_VCARD_30 "text/vcard"
old mode 100755 (executable)
new mode 100644 (file)
similarity index 55%
rename from oma-ds-agent.manifest
rename to oma-ds-agent.manifest.in
index 2a338a6..df241e2
@@ -3,6 +3,6 @@
                <domain name="_"/>
        </request>
        <assign>
-               <filesystem path="/opt/dbspace/.omasyncagent.db*" label="System" />
+               <filesystem path="@TZ_SYS_DB@/.omasyncagent.db*" label="System" />
        </assign>
 </manifest>
index fe86da5..34d0387 100644 (file)
@@ -4,7 +4,8 @@ After=calendar.service contacts-service.service pushd.service msg-service.servic
 
 [Service]
 #Type=forking
-ConditionPathExists=/opt/usr/data/oma-ds/.oma-ds-agent-enabled
+EnvironmentFile=/etc/tizen-platform.conf
+ConditionPathExists=$TZ_USER_DATA/oma-ds/.oma-ds-agent-enabled
 ExecStart=/usr/bin/oma-ds-agent
 
 [Install]
similarity index 96%
rename from oma-ds-cfg/omads_fw_config.xml
rename to oma-ds-cfg/omads_fw_config.xml.in
index 96efbba..a60ff17 100644 (file)
@@ -15,7 +15,7 @@
                <Max-Thread>5</Max-Thread>\r
        </EngineController>\r
        <FrameworkDB use="1">\r
-               <Path>/opt/dbspace/.omasyncagent.db</Path>\r
+               <Path>@TZ_SYS_DB@/.omasyncagent.db</Path>\r
        </FrameworkDB>\r
        <ID-Provider>\r
                <Code>1</Code>\r
index 9cf9177..7531831 100755 (executable)
@@ -1,25 +1,26 @@
 Name:       oma-ds-agent
 Summary:    OMA-DS Agent Daemon for Data Synchronization
 Version:    0.1.66
-Release:    1
+Release:    0
 Group:      Base/Device Management
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
-Requires(post): /sbin/ldconfig
+Requires(post):   /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
-BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(libsoup-2.4)
-BuildRequires:  pkgconfig(sqlite3)
-BuildRequires:  pkgconfig(sync-agent)
-BuildRequires:  pkgconfig(vconf)
-BuildRequires:  pkgconfig(dbus-glib-1)
-BuildRequires:  pkgconfig(check)
-BuildRequires:  pkgconfig(memo)
-BuildRequires:  pkgconfig(contacts-service2)
-BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(aul)
-BuildRequires:  expat-devel
-BuildRequires:  cmake
+BuildRequires:    pkgconfig(glib-2.0)
+BuildRequires:    pkgconfig(libsoup-2.4)
+BuildRequires:    pkgconfig(sqlite3)
+BuildRequires:    pkgconfig(sync-agent)
+BuildRequires:    pkgconfig(vconf)
+BuildRequires:    pkgconfig(dbus-glib-1)
+BuildRequires:    pkgconfig(check)
+BuildRequires:    pkgconfig(memo)
+BuildRequires:    pkgconfig(contacts-service2)
+BuildRequires:    pkgconfig(dlog)
+BuildRequires:    pkgconfig(aul)
+BuildRequires:    pkgconfig(libtzplatform-config)
+BuildRequires:    expat-devel
+BuildRequires:    cmake
 
 
 %description
@@ -38,19 +39,19 @@ ds public plugins for sync-agent
 
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DTZ_SYS_DB=%TZ_SYS_DB
 make %{?jobs:-j%jobs}
 
 
 %install
 rm -rf %{buildroot}
 
-if [ ! -d %{buildroot}/opt/dbspace ]
+if [ ! -d %{buildroot}%{TZ_SYS_DB} ]
 then
-       mkdir -p %{buildroot}/opt/dbspace
+       mkdir -p %{buildroot}%{TZ_SYS_DB}
 fi
 
-sqlite3 %{buildroot}/opt/dbspace/.omasyncagent.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
+sqlite3 %{buildroot}%{TZ_SYS_DB}/.omasyncagent.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
 
 %make_install
 
@@ -59,44 +60,41 @@ rm -rf %{buildroot}
 
 
 %post
-if [ ! -d /opt/dbspace ]
+if [ ! -d %{TZ_SYS_DB} ]
 then
-       mkdir /opt/dbspace
+       mkdir %{TZ_SYS_DB}
 fi
-if [ ! -d /etc/rc.d/rc3.d ]
+if [ ! -d %{_sysconfdir}/rc.d/rc3.d ]
 then
-       mkdir /etc/rc.d/rc3.d
+       mkdir %{_sysconfdir}/rc.d/rc3.d
 fi
-if [ ! -d /etc/rc.d/rc5.d ]
+if [ ! -d %{_sysconfdir}/rc.d/rc5.d ]
 then
-       mkdir /etc/rc.d/rc5.d
+       mkdir %{_sysconfdir}/rc.d/rc5.d
 fi
 
 
-%preun
-
-
 %postun
 
 rm -f /tmp/agent_fw_event_omads*
 rm -f /tmp/agent_fw_noti_reply_omads*
 
-rm -f /etc/rc.d/rc3.d/S91oma-ds-agent
-rm -f /etc/rc.d/rc5.d/S91oma-ds-agent
+rm -f %{_sysconfdir}/rc.d/rc3.d/S91oma-ds-agent
+rm -f %{_sysconfdir}/rc.d/rc5.d/S91oma-ds-agent
 
-rm -f /opt/dbspace/.omasyncagent.db /opt/dbspace/.omasyncagent.db-journal
+rm -f %{TZ_SYS_DB}/.omasyncagent.db %{TZ_SYS_DB}/.omasyncagent.db-journal
 
 rm -rf /usr/share/oma-ds-cfg
 
 
 %files
-%attr(600,root,root) /opt/dbspace/.omasyncagent.db
-%attr(600,root,root) /opt/dbspace/.omasyncagent.db-journal
+%attr(600,root,root) %{TZ_SYS_DB}/.omasyncagent.db
+%attr(600,root,root) %{TZ_SYS_DB}/.omasyncagent.db-journal
 
 %manifest oma-ds-agent.manifest
 %defattr(-,root,root,-)
 /usr/share/dbus-1/system-services/com.samsung.omadsagent.service
-/usr/bin/oma-ds-agent
+%{_bindir}/oma-ds-agent
 
 /usr/share/oma-ds-cfg/*
 
@@ -104,7 +102,7 @@ rm -rf /usr/share/oma-ds-cfg
 %defattr(644,root,root)
 /usr/lib/systemd/system/oma-ds-agent.service
 /usr/lib/systemd/system/graphical.target.wants/oma-ds-agent.service
-/etc/dbus-1/system.d/com.samsung.omadsagent.conf
+%{_sysconfdir}/dbus-1/system.d/com.samsung.omadsagent.conf
 
 %files -n ds-public-plugins
 %manifest ds-public-plugins.manifest
index ee1ea32..6b20644 100755 (executable)
@@ -24,6 +24,7 @@ pkg_check_modules(LPKGS REQUIRED
                                        dlog
                                        aul
                                        dbus-glib-1
+                                       libtzplatform-config
                                        )
 
 #############################################