From 16dd30cb7b9c86bc5744ff170f45683d5c76ac0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20THIERRY?= Date: Thu, 13 Feb 2014 14:24:16 +0100 Subject: Add multi-user support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug-Tizen: PTREL-271 Change-Id: I65b0d09ba91e9d072358d50950f31bd31c22c143 Signed-off-by: Kévin THIERRY --- CMakeLists.txt | 3 + include/common/common_define_internal.h | 7 +- oma-ds-agent.manifest | 8 -- oma-ds-agent.manifest.in | 8 ++ oma-ds-agent.service | 3 +- oma-ds-cfg/omads_fw_config.xml | 133 -------------------------------- oma-ds-cfg/omads_fw_config.xml.in | 133 ++++++++++++++++++++++++++++++++ packaging/oma-ds-agent.spec | 68 ++++++++-------- src/agent/CMakeLists.txt | 1 + 9 files changed, 185 insertions(+), 179 deletions(-) delete mode 100755 oma-ds-agent.manifest create mode 100644 oma-ds-agent.manifest.in delete mode 100644 oma-ds-cfg/omads_fw_config.xml create mode 100644 oma-ds-cfg/omads_fw_config.xml.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a247e15..2839847 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}\"") diff --git a/include/common/common_define_internal.h b/include/common/common_define_internal.h index 7187d27..e07e9d1 100755 --- a/include/common/common_define_internal.h +++ b/include/common/common_define_internal.h @@ -29,6 +29,9 @@ #include #include +/* For multi-user support */ +#include + /* #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" diff --git a/oma-ds-agent.manifest b/oma-ds-agent.manifest deleted file mode 100755 index 2a338a6..0000000 --- a/oma-ds-agent.manifest +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/oma-ds-agent.manifest.in b/oma-ds-agent.manifest.in new file mode 100644 index 0000000..df241e2 --- /dev/null +++ b/oma-ds-agent.manifest.in @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/oma-ds-agent.service b/oma-ds-agent.service index fe86da5..34d0387 100644 --- a/oma-ds-agent.service +++ b/oma-ds-agent.service @@ -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] diff --git a/oma-ds-cfg/omads_fw_config.xml b/oma-ds-cfg/omads_fw_config.xml deleted file mode 100644 index 96efbba..0000000 --- a/oma-ds-cfg/omads_fw_config.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - omads - 1 - - omads - /usr/share/oma-ds-cfg/eventconfig_omads - 1 - - - omads - /usr/share/oma-ds-cfg/noticonfig_omads - - - 5 - - - /opt/dbspace/.omasyncagent.db - - - 1 - 4000000000 - 5 - - - - - 0 - /usr/lib/sync-agent/common-public/libplugin-da-contact.so - SLP Contact Access PlugIn - 1 - 1 - 1 - - - 1 - /usr/lib/sync-agent/common-public/libplugin-da-calendar.so - SLP Calendar Access PlugIn - 2 - 1 - 1 - - - 2 - /usr/lib/sync-agent/common-public/libplugin-da-memo.so - SLP Memo Access PlugIn - 3 - 1 - 1 - - - 3 - /usr/lib/sync-agent/common-public/libplugin-da-call-log.so - SLP Calllog Access PlugIn - 4 - 0 - 0 - - - - - 1 - /usr/lib/sync-agent/ds-public/libplugin-dc-vcard.so - SLP Contact Converter - - - 2 - /usr/lib/sync-agent/common-public/libplugin-dc-vcalendar.so - SLP Calendar Converter - - - 3 - /usr/lib/sync-agent/ds-public/libplugin-dc-plain-text.so - SLP Memo Converter - - - 4 - /usr/lib/sync-agent/ds-public/libplugin-dc-xcalllog.so - SLP Calllog Converter - - - - - 1 - /usr/lib/sync-agent/common-public/libplugin-account.so - SLP Account Accessor - - - - - 1 - /usr/lib/sync-agent/common-public/libplugin-na-http.so - Http Protocol - 1 - - - - - 1 - /usr/lib/sync-agent/common-public/libplugin-di-slp-device.so - SLP Device Accessor - - - - - 1 - /usr/lib/sync-agent/common-public/libplugin-pm-slp-sysnoti-alarm.so - monitoring Alarm Event from SLP Platform - 1 - - - oma-ds-agent - - - - - - - 2 - /usr/lib/sync-agent/common-public/libplugin-pm-slp-sysnoti-network-connection.so - monitoring Network Connection Event from SLP Platform - 1 - - - - - 3 - /usr/lib/sync-agent/common-public/libplugin-pm-slp-sysnoti-wap-push.so - monitoring WAP Push Event from SLP Platform - 1 - - - - - - diff --git a/oma-ds-cfg/omads_fw_config.xml.in b/oma-ds-cfg/omads_fw_config.xml.in new file mode 100644 index 0000000..a60ff17 --- /dev/null +++ b/oma-ds-cfg/omads_fw_config.xml.in @@ -0,0 +1,133 @@ + + + omads + 1 + + omads + /usr/share/oma-ds-cfg/eventconfig_omads + 1 + + + omads + /usr/share/oma-ds-cfg/noticonfig_omads + + + 5 + + + @TZ_SYS_DB@/.omasyncagent.db + + + 1 + 4000000000 + 5 + + + + + 0 + /usr/lib/sync-agent/common-public/libplugin-da-contact.so + SLP Contact Access PlugIn + 1 + 1 + 1 + + + 1 + /usr/lib/sync-agent/common-public/libplugin-da-calendar.so + SLP Calendar Access PlugIn + 2 + 1 + 1 + + + 2 + /usr/lib/sync-agent/common-public/libplugin-da-memo.so + SLP Memo Access PlugIn + 3 + 1 + 1 + + + 3 + /usr/lib/sync-agent/common-public/libplugin-da-call-log.so + SLP Calllog Access PlugIn + 4 + 0 + 0 + + + + + 1 + /usr/lib/sync-agent/ds-public/libplugin-dc-vcard.so + SLP Contact Converter + + + 2 + /usr/lib/sync-agent/common-public/libplugin-dc-vcalendar.so + SLP Calendar Converter + + + 3 + /usr/lib/sync-agent/ds-public/libplugin-dc-plain-text.so + SLP Memo Converter + + + 4 + /usr/lib/sync-agent/ds-public/libplugin-dc-xcalllog.so + SLP Calllog Converter + + + + + 1 + /usr/lib/sync-agent/common-public/libplugin-account.so + SLP Account Accessor + + + + + 1 + /usr/lib/sync-agent/common-public/libplugin-na-http.so + Http Protocol + 1 + + + + + 1 + /usr/lib/sync-agent/common-public/libplugin-di-slp-device.so + SLP Device Accessor + + + + + 1 + /usr/lib/sync-agent/common-public/libplugin-pm-slp-sysnoti-alarm.so + monitoring Alarm Event from SLP Platform + 1 + + + oma-ds-agent + - + + + + + 2 + /usr/lib/sync-agent/common-public/libplugin-pm-slp-sysnoti-network-connection.so + monitoring Network Connection Event from SLP Platform + 1 + - + + + 3 + /usr/lib/sync-agent/common-public/libplugin-pm-slp-sysnoti-wap-push.so + monitoring WAP Push Event from SLP Platform + 1 + - + + + + diff --git a/packaging/oma-ds-agent.spec b/packaging/oma-ds-agent.spec index 9cf9177..7531831 100755 --- a/packaging/oma-ds-agent.spec +++ b/packaging/oma-ds-agent.spec @@ -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 diff --git a/src/agent/CMakeLists.txt b/src/agent/CMakeLists.txt index ee1ea32..6b20644 100755 --- a/src/agent/CMakeLists.txt +++ b/src/agent/CMakeLists.txt @@ -24,6 +24,7 @@ pkg_check_modules(LPKGS REQUIRED dlog aul dbus-glib-1 + libtzplatform-config ) ############################################# -- cgit v1.2.3