Apply Cynara API
[platform/core/messaging/msg-service.git] / packaging / msg-service.spec
index 74016e3..0eb2a36 100755 (executable)
@@ -1,49 +1,70 @@
 Name:           msg-service
-Version:        0.8.7
-Release:        5
-License:        Flora Software License
-Summary:        Messaging Framework Library 
+Version:        1.0.1
+Release:        1
+License:        Apache-2.0
+Summary:        Messaging Framework Library
 Group:          System/Libraries
-Source0:       %{name}-%{version}.tar.gz
+Source0:        %{name}-%{version}.tar.gz
+Source1:        msg-server.service
+Source2:        msg-server.socket
+
+#%if "%{?tizen_profile_name}" == "wearable"
+#ExcludeArch: %{arm} %ix86 x86_64
+#%endif
 
 Requires(post): /usr/bin/sqlite3
 Requires(post): /usr/bin/vconftool
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
+Requires(post): systemd
+Requires(postun): systemd
 BuildRequires: cmake
 BuildRequires: pkgconfig(alarm-service)
-BuildRequires: pkgconfig(contacts-service)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(badge)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-network-connection)
+BuildRequires: pkgconfig(capi-system-info)
+#BuildRequires: pkgconfig(capi-telephony)
+BuildRequires: pkgconfig(contacts-service2)
+BuildRequires: pkgconfig(cynara-client)
+BuildRequires: pkgconfig(cynara-creds-commons)
+BuildRequires: pkgconfig(cynara-creds-socket)
+BuildRequires: pkgconfig(cynara-session)
 BuildRequires: pkgconfig(db-util)
-BuildRequires: pkgconfig(devman_haptic)
+BuildRequires: pkgconfig(dbus-glib-1)
+BuildRequires: pkgconfig(deviced)
 BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(drm-client)
-BuildRequires: pkgconfig(drm-trusted)
-BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(feedback)
+BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(gobject-2.0)
+BuildRequires: pkgconfig(iniparser)
+BuildRequires: pkgconfig(json-glib-1.0)
+BuildRequires: pkgconfig(lbs-dbus)
 BuildRequires: pkgconfig(libcurl)
+BuildRequires: pkgconfig(libsystemd-daemon)
 BuildRequires: pkgconfig(libxml-2.0)
 BuildRequires: pkgconfig(libwbxml2)
 BuildRequires: pkgconfig(media-thumbnail)
 BuildRequires: pkgconfig(mm-fileinfo)
 BuildRequires: pkgconfig(mm-player)
 BuildRequires: pkgconfig(mm-session)
-BuildRequires: pkgconfig(network)
-BuildRequires: pkgconfig(notification)
-BuildRequires: pkgconfig(pmapi)
+BuildRequires: pkgconfig(mm-sound)
 BuildRequires: pkgconfig(mmutil-imgp)
 BuildRequires: pkgconfig(mmutil-jpeg)
-BuildRequires: pkgconfig(security-server)
+BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(privacy-manager-client)
 BuildRequires: pkgconfig(sensor)
-BuildRequires: pkgconfig(svi)
+BuildRequires: pkgconfig(storage)
 BuildRequires: pkgconfig(tapi)
 BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(capi-appfw-application)
 
-%description 
-Description: Messaging Framework Library 
+%description
+Description: Messaging Framework Library
 
 
 %package devel
-License:        Flora Software License
+License:        Apache-2.0
 Summary:        Messaging Framework Library (development)
 Requires:       %{name} = %{version}-%{release}
 Group:          Development/Libraries
@@ -53,7 +74,7 @@ Description: Messaging Framework Library (development)
 
 
 %package tools
-License:        Flora Software License
+License:        Apache-2.0
 Summary:        Messaging server application
 Requires:       %{name} = %{version}-%{release}
 Group:          TO_BU / FILL_IN
@@ -67,241 +88,317 @@ Description:  Messaging server application
 
 
 %package -n sms-plugin
-License:        Flora Software License
-Summary:        SMS plugin library 
+License:        Apache-2.0
+Summary:        SMS plugin library
 Requires:       %{name} = %{version}-%{release}
 Group:          System/Libraries
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
 %description -n sms-plugin
-Description: SMS plugin library  
+Description: SMS plugin library
 
 %package -n mms-plugin
-License:        Flora Software License
-Summary:        MMS plugin library 
+License:        Apache-2.0
+Summary:        MMS plugin library
 Requires:       %{name} = %{version}-%{release}
 Group:          System/Libraries
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
 %description -n mms-plugin
-Description: MMS plugin library  
+Description: MMS plugin library
 
 %prep
 %setup -q
 
-
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+        -DLIB_INSTALL_DIR=%{_libdir} \
+%ifarch i586
+-D_TIZEN_I586_ENABLED:BOOL=ON \
+%else
+-D_TIZEN_I586_ENABLED:BOOL=OFF \
+%endif
+%if 0%{?sec_product_feature_container_enable} == 1
+-D_FEATURE_CONTAINER_ENABLE:BOOL=ON \
+%endif
+%if "%{?tizen_profile_name}" == "wearable"
+-D_MSG_WEARABLE_PROFILE:BOOL=ON
+%else
+-D_MSG_WEARABLE_PROFILE:BOOL=OFF
+%endif
+
 make %{?jobs:-j%jobs}
 
 %install
-
 rm -rf %{buildroot}
+mkdir -p %{buildroot}/usr/share/license
+mkdir -p %{buildroot}/etc/config
+
 %make_install
 
-mkdir -p  %{buildroot}%{_sysconfdir}/rc.d/rc3.d
-ln -s %{_sysconfdir}/rc.d/init.d/msg-server  %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S70msg-server
-mkdir -p  %{buildroot}%{_sysconfdir}/rc.d/rc5.d
-ln -s %{_sysconfdir}/rc.d/init.d/msg-server  %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S70msg-server
+mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
+install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/msg-server.service
+ln -s ../msg-server.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/msg-server.service
+
+mkdir -p %{buildroot}%{_libdir}/systemd/system/sockets.target.wants
+install -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/msg-server.socket
+ln -s ../msg-server.socket %{buildroot}%{_libdir}/systemd/system/sockets.target.wants/msg-server.socket
+
+mkdir -p %{buildroot}/opt/usr/dbspace
+sqlite3 %{buildroot}/opt/usr/dbspace/.msg_service.db "PRAGMA journal_mode = PERSIST;"
+sqlite3 %{buildroot}/opt/usr/dbspace/.msg_service.db < %{buildroot}/usr/share/msg-service/msg-service-db.sql
+
+rm %{buildroot}/usr/share/msg-service/msg-service-db.sql
+
+%post tools
+/sbin/ldconfig
 
+chown 200:5000 /opt/usr/dbspace/.msg_service.db
+chown 200:5000 /opt/usr/dbspace/.msg_service.db-journal
+chown 200:200 %{_libdir}/systemd/system/msg-server.socket
 
+chmod 660 /opt/usr/dbspace/.msg_service.db
+chmod 660 /opt/usr/dbspace/.msg_service.db-journal
 
-mkdir -p %{buildroot}/opt/data/msg-service
+if [ -f %{_libdir}/rpm-plugins/msm.so ]
+then
+       chsmack -a 'msg-service::db' /opt/usr/dbspace/.msg_service.db*
+fi
 
-%post tools -p /sbin/ldconfig
 %post -n sms-plugin -p /sbin/ldconfig
 %post -n mms-plugin -p /sbin/ldconfig
 
-%post 
+%post
 /sbin/ldconfig
 
-if [ ! -f /opt/dbspace/.msg_service.db ]
-then
-        sqlite3 /opt/dbspace/.msg_service.db "PRAGMA journal_mode = PERSIST;
-
-        CREATE TABLE MSG_ADDRESS_TABLE(ADDRESS_ID INTEGER PRIMARY KEY, ADDRESS_TYPE INTEGER, RECIPIENT_TYPE INTEGER, ADDRESS_VAL TEXT, CONTACT_ID INTEGER, DISPLAY_NAME TEXT, FIRST_NAME TEXT, LAST_NAME TEXT, IMAGE_PATH TEXT, SYNC_TIME DATETIME, UNREAD_CNT INTEGER DEFAULT 0, SMS_CNT INTEGER DEFAULT 0, MMS_CNT INTEGER DEFAULT 0, MAIN_TYPE INTEGER NOT NULL, SUB_TYPE INTEGER NOT NULL, MSG_DIRECTION INTEGER NOT NULL, MSG_TIME DATETIME, MSG_TEXT TEXT);
-        CREATE TABLE MSG_FOLDER_TABLE(FOLDER_ID INTEGER PRIMARY KEY, FOLDER_NAME TEXT NOT NULL, FOLDER_TYPE INTEGER DEFAULT 0);
-        CREATE TABLE MSG_MESSAGE_TABLE(MSG_ID INTEGER PRIMARY KEY, ADDRESS_ID INTEGER, FOLDER_ID INTEGER, REFERENCE_ID INTEGER, STORAGE_ID INTEGER NOT NULL, MAIN_TYPE INTEGER NOT NULL, SUB_TYPE INTEGER NOT NULL, DISPLAY_TIME DATETIME, DATA_SIZE INTEGER DEFAULT 0, NETWORK_STATUS INTEGER DEFAULT 0, READ_STATUS INTEGER DEFAULT 0, PROTECTED INTEGER DEFAULT 0, PRIORITY INTEGER DEFAULT 0, MSG_DIRECTION INTEGER NOT NULL, SCHEDULED_TIME DATETIME, BACKUP INTEGER DEFAULT 0, SUBJECT TEXT, MSG_DATA TEXT, THUMB_PATH TEXT, MSG_TEXT TEXT, DELIVERY_REPORT_STATUS INTEGER DEFAULT 0, DELIVERY_REPORT_TIME DATETIME, READ_REPORT_STATUS INTEGER DEFAULT 0, READ_REPORT_TIME DATETIME, ATTACHMENT_COUNT INTEGER DEFAULT 0, FOREIGN KEY(ADDRESS_ID) REFERENCES MSG_ADDRESS_TABLE(ADDRESS_ID), FOREIGN KEY(FOLDER_ID) REFERENCES MSG_FOLDER_TABLE(FOLDER_ID));
-        CREATE TABLE MSG_SIM_TABLE(MSG_ID INTEGER, SIM_ID INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_PUSH_TABLE(MSG_ID INTEGER, ACTION INTEGER, CREATED INTEGER, EXPIRES INTEGER, ID TEXT, HREF TEXT, CONTENT TEXT, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_CBMSG_TABLE(MSG_ID INTEGER, CB_MSG_ID INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_SYNCML_TABLE(MSG_ID INTEGER, EXT_ID INTEGER NOT NULL, PINCODE INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_SCHEDULED_TABLE(MSG_ID INTEGER, ALARM_ID INTEGER NOT NULL, LISTENER_FD INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_SMS_SENDOPT_TABLE(MSG_ID INTEGER, DELREP_REQ INTEGER NOT NULL, KEEP_COPY INTEGER NOT NULL, REPLY_PATH INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_FILTER_TABLE(FILTER_ID INTEGER PRIMARY KEY, FILTER_TYPE INTEGER NOT NULL, FILTER_VALUE TEXT NOT NULL);
-        CREATE TABLE MSG_MMS_MESSAGE_TABLE(REFERENCE_ID INTEGER, TRANSACTION_ID TEXT, MESSAGE_ID TEXT, FWD_MESSAGE_ID TEXT, CONTENTS_LOCATION TEXT, FILE_PATH TEXT, FOREIGN KEY(REFERENCE_ID) REFERENCES MSG_MESSAGE_TABLE(REFERENCE_ID));
-        CREATE TABLE MSG_MMS_ATTR_TABLE(REFERENCE_ID INTEGER, VERSION INTEGER NOT NULL, DATA_TYPE INTEGER DEFAULT -1, DATE DATETIME, HIDE_ADDRESS INTEGER DEFAULT 0, ASK_DELIVERY_REPORT INTEGER DEFAULT 0, REPORT_ALLOWED INTEGER DEFAULT 0, READ_REPORT_ALLOWED_TYPE INTEGER DEFAULT 0, ASK_READ_REPLY INTEGER DEFAULT 0, READ INTEGER DEFAULT 0, READ_REPORT_SEND_STATUS INTEGER DEFAULT 0, READ_REPORT_SENT INTEGER DEFAULT 0, PRIORITY INTEGER DEFAULT 0, KEEP_COPY INTEGER DEFAULT 0, MSG_SIZE INTEGER NOT NULL, MSG_CLASS INTEGER DEFAULT -1, EXPIRY_TIME DATETIME, CUSTOM_DELIVERY_TIME INTEGER DEFAULT 0, DELIVERY_TIME DATETIME, MSG_STATUS INTEGER DEFAULT -1, FOREIGN KEY(REFERENCE_ID) REFERENCES MSG_MESSAGE_TABLE(REFERENCE_ID));
-
-        CREATE INDEX MSG_ADDRESS_INDEX ON MSG_ADDRESS_TABLE(ADDRESS_ID);
-        CREATE INDEX MSG_FOLDER_INDEX ON MSG_FOLDER_TABLE(FOLDER_ID);
-        CREATE INDEX MSG_MESSAGE_INDEX ON MSG_MESSAGE_TABLE(MSG_ID, ADDRESS_ID, FOLDER_ID);
-
-        INSERT INTO MSG_FOLDER_TABLE VALUES (1, 'INBOX', 1);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (2, 'OUTBOX', 2);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (3, 'SENTBOX', 2);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (4, 'DRAFT', 3);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (5, 'CBMSGBOX', 1);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (6, 'SPAMBOX', 4);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (7, 'SMS TEMPLATE', 5);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (8, 'MMS TEMPLATE', 5);
-
-        INSERT INTO MSG_ADDRESS_TABLE VALUES (0, 0, 0, '', 0, '', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '');"
-fi
+mkdir -p /opt/usr/data/msg-service
+chgrp db_msg_service /opt/usr/data/msg-service
 
-chown :6011 /opt/dbspace/.msg_service.db
-chown :6011 /opt/dbspace/.msg_service.db-journal
 
+########## Setting Config Value (Internal keys) ##########
+# Message Server Status
+vconftool set -t bool memory/msg/ready 0 -i -u 200 -g 5000 -s system::vconf_inhouse
 
-chmod 660 /opt/dbspace/.msg_service.db
-chmod 660 /opt/dbspace/.msg_service.db-journal
+# SMS Send Options
+vconftool set -t int db/msg/network_mode 2 -u 200 -g 5000 -s system::vconf_inhouse
 
+# New Message Count
+vconftool set -t int db/msg/recv_sms 0 -u 200 -g 5000 -s system::vconf_inhouse
+vconftool set -t int db/msg/recv_mms 0 -u 200 -g 5000 -s system::vconf_inhouse
 
-########## Setting Config Value ##########
+########## Setting Config Value (Private keys) ##########
 # General Options
-vconftool set -t bool db/msg/general/keep_copy 1
-vconftool set -t int db/msg/general/alert_tone 0
-vconftool set -t bool db/msg/general/auto_erase 0
-vconftool set -t bool db/msg/general/block_msg 0
+vconftool set -t bool db/private/msg-service/general/keep_copy 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/general/auto_erase 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/general/block_msg 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/contact_sync_time 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/alert_rep_type 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/search_tags 31 -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t int db/private/msg-service/general/page_limit 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/sms_mms_threshold 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/max_recipient 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/sms_storage 0 -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t bool db/private/msg-service/general/block_unknown_msg 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/sms_limit 1000 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/mms_limit 100 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/general/notification 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/general/vibration 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/general/preview 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/general/ringtone_type 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string db/private/msg-service/general/ringtone_path "" -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t string db/private/msg-service/general/ua_profile "" -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t int db/private/msg-service/general/msg_id_counter 0 -s msg-service::vconf -u 200 -g 5000
 
 # SMS Send Options
-vconftool set -t int db/msg/sms_send/dcs 3
-vconftool set -t int db/msg/network_mode 2
-vconftool set -t bool db/msg/sms_send/reply_path 0
-vconftool set -t bool db/msg/sms_send/delivery_report 0
-vconftool set -t int db/msg/sms_send/save_storage 1
+vconftool set -t int db/private/msg-service/sms_send/dcs 3 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/sms_send/reply_path 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/sms_send/delivery_report 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sms_send/save_storage 1 -s msg-service::vconf -u 200 -g 5000
 
 # MMS Send Options
-vconftool set -t int db/msg/mms_send/msg_class 0
-vconftool set -t int db/msg/mms_send/priority 1
-vconftool set -t int db/msg/mms_send/expiry_time 0
-vconftool set -t int db/msg/mms_send/custom_delivery 0
-vconftool set -t bool db/msg/mms_send/sender_visibility 0
-vconftool set -t bool db/msg/mms_send/delivery_report 1
-vconftool set -t bool db/msg/mms_send/read_reply 1
-vconftool set -t bool db/msg/mms_send/keep_copy 0
-vconftool set -t bool db/msg/mms_send/body_replying 0
-vconftool set -t bool db/msg/mms_send/hide_recipients 0
-vconftool set -t bool db/msg/mms_send/report_allowed 1
-vconftool set -t int db/msg/mms_send/reply_charging 0
-vconftool set -t int db/msg/mms_send/reply_charging_deadline 0
-vconftool set -t int db/msg/mms_send/reply_charging_size 0
-vconftool set -t int db/msg/mms_send/delivery_time 0
-vconftool set -t int db/msg/mms_send/creation_mode 2
-
-# MMS Receive Options
-vconftool set -t int db/msg/mms_recv/home_network 0
-vconftool set -t int db/msg/mms_recv/abroad_network 0
-vconftool set -t bool db/msg/mms_recv/read_receipt 1
-vconftool set -t bool db/msg/mms_recv/delivery_receipt 1
-vconftool set -t bool db/msg/mms_recv/reject_unknown 0
-vconftool set -t bool db/msg/mms_recv/reject_advertisement 0
+vconftool set -t int db/private/msg-service/mms_send/msg_class 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/priority 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/expiry_time 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/custom_delivery 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_send/sender_visibility 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_send/delivery_report 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_send/read_reply 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_send/keep_copy 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_send/body_replying 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_send/hide_recipients 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_send/report_allowed 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/reply_charging 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/reply_charging_deadline 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/reply_charging_size 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/delivery_time 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_send/creation_mode 2 -s msg-service::vconf -u 200 -g 5000
 
 # MMS Receive Options
-vconftool set -t int db/msg/mms_style/font_size 30
-vconftool set -t bool db/msg/mms_style/font_style/bold 0
-vconftool set -t bool db/msg/mms_style/font_style/italic 0
-vconftool set -t bool db/msg/mms_style/font_style/underline 0
-vconftool set -t int db/msg/mms_style/font_color/red 0
-vconftool set -t int db/msg/mms_style/font_color/green 0
-vconftool set -t int db/msg/mms_style/font_color/blue 0
-vconftool set -t int db/msg/mms_style/font_color/hue 255
-vconftool set -t int db/msg/mms_style/bg_color/red 255
-vconftool set -t int db/msg/mms_style/bg_color/green 255
-vconftool set -t int db/msg/mms_style/bg_color/blue 255
-vconftool set -t int db/msg/mms_style/bg_color/hue 255
-vconftool set -t int db/msg/mms_style/page_dur 2
-vconftool set -t int db/msg/mms_style/page_custom_dur 0
-vconftool set -t int db/msg/mms_style/page_dur_manual 0
+vconftool set -t int db/private/msg-service/mms_recv/home_network 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_recv/abroad_network 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_recv/read_receipt 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_recv/delivery_receipt 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_recv/reject_unknown 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_recv/reject_advertisement 0 -s msg-service::vconf -u 200 -g 5000
+
+# MMS Style Options
+vconftool set -t int db/private/msg-service/mms_style/font_size 30 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_style/font_style/bold 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_style/font_style/italic 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/mms_style/font_style/underline 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/font_color/red 255 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/font_color/green 255 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/font_color/blue 255 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/font_color/hue 255 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/bg_color/red 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/bg_color/green 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/bg_color/blue 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/bg_color/hue 255 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/page_dur 2 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/page_custom_dur 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/mms_style/page_dur_manual 0 -s msg-service::vconf -u 200 -g 5000
 
 # Push Msg Options
-vconftool set -t bool db/msg/push_msg/recv_option 1
-vconftool set -t int db/msg/push_msg/service_load 1
+vconftool set -t bool db/private/msg-service/push_msg/recv_option 1 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/push_msg/service_load 1 -s msg-service::vconf -u 200 -g 5000
 
 # CB Msg Options
-vconftool set -t bool db/msg/cb_msg/receive 0
-vconftool set -t bool db/msg/cb_msg/all_channel 0
-vconftool set -t int db/msg/cb_msg/max_sim_count 0
-vconftool set -t int db/msg/cb_msg/channel_count 0
-vconftool set -t bool db/msg/cb_msg/language/0 0
-vconftool set -t bool db/msg/cb_msg/language/1 0
-vconftool set -t bool db/msg/cb_msg/language/2 0
-vconftool set -t bool db/msg/cb_msg/language/3 0
-vconftool set -t bool db/msg/cb_msg/language/4 0
-vconftool set -t bool db/msg/cb_msg/language/5 0
-vconftool set -t bool db/msg/cb_msg/language/6 0
-vconftool set -t bool db/msg/cb_msg/language/7 0
-vconftool set -t bool db/msg/cb_msg/language/8 0
-vconftool set -t bool db/msg/cb_msg/language/9 0
-
-# SOS Msg Options
-vconftool set -t bool db/msg/sos_msg/send_option 0
-vconftool set -t int db/msg/sos_msg/recipient_count 0
-vconftool set -t int db/msg/sos_msg/repeat_count 0
-vconftool set -t string db/msg/sos_msg/msg_text ""
-vconftool set -t int db/msg/sos_msg/alert_type 0
+vconftool set -t bool db/private/msg-service/cb_msg/receive/1 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/receive/2 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/save 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/cb_msg/max_sim_count/1 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/cb_msg/max_sim_count/2 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/cb_msg/max_sim_count/3 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/0 1 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/1 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/2 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/3 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/4 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/5 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/6 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/7 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/8 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool db/private/msg-service/cb_msg/language/9 0 -s msg-service::vconf -u 200 -g 5000
 
 # Voice Mail Options
-vconftool set -t string db/msg/voice_mail/voice_mail_number "12345678"
+vconftool set -t string db/private/msg-service/voice_mail/voice_mail_number/1 "" -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/voice_mail/voice_mail_count/1 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string db/private/msg-service/voice_mail/voice_mail_alphaid/1 "" -f -s msg-service::vconf -u 200 -g 5000
 
-# MMS Size Options
-vconftool set -t int db/msg/size_opt/msg_size 300
+vconftool set -t string db/private/msg-service/voice_mail/voice_mail_number/2 "" -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/voice_mail/voice_mail_count/2 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string db/private/msg-service/voice_mail/voice_mail_alphaid/2 "" -f -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t string db/private/msg-service/voice_mail/voice_mail_number/3 "" -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/voice_mail/voice_mail_count/3 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string db/private/msg-service/voice_mail/voice_mail_alphaid/3 "" -f -s msg-service::vconf -u 200 -g 5000
 
-vconftool set -t int db/badge/org.tizen.message 0
+# MMS Size Options
+vconftool set -t int db/private/msg-service/size_opt/msg_size 300 -s msg-service::vconf -u 200 -g 5000
+
+# SIM message count
+vconftool set -t int db/private/msg-service/sim_count/used_cnt/1 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sim_count/total_cnt/1 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sim_count/used_cnt/2 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sim_count/total_cnt/2 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sim_count/used_cnt/3 0 -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sim_count/total_cnt/3 0 -f -s msg-service::vconf -u 200 -g 5000
+
+# SIM information
+vconftool set -t int memory/private/msg-service/sim_changed/1 0 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/sim_subs_id/1 "" -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool memory/private/msg-service/national_sim/1 0 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/msisdn/1 "" -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/iccid/1 "" -i -f -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t int memory/private/msg-service/sim_changed/2 0 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/sim_subs_id/2 "" -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool memory/private/msg-service/national_sim/2 0 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/msisdn/2 "" -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/iccid/2 "" -i -f -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t int memory/private/msg-service/sim_changed/3 0 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/sim_subs_id/3 "" -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool memory/private/msg-service/national_sim/3 0 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/msisdn/3 "" -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t string memory/private/msg-service/iccid/3 "" -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int  memory/private/msg-service/default_network_sim 0 -i -f -s msg-service::vconf -u 200 -g 5000
+
+# SST information
+vconftool set -t bool memory/private/msg-service/sim_st/1 1 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool memory/private/msg-service/sim_mo_ctrl/1 0 -i -f -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t bool memory/private/msg-service/sim_st/2 1 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool memory/private/msg-service/sim_mo_ctrl/2 0 -i -f -s msg-service::vconf -u 200 -g 5000
+
+vconftool set -t bool memory/private/msg-service/sim_st/3 1 -i -f -s msg-service::vconf -u 200 -g 5000
+vconftool set -t bool memory/private/msg-service/sim_mo_ctrl/3 0 -i -f -s msg-service::vconf -u 200 -g 5000
+
+# Notification
+vconftool set -t int db/private/msg-service/notification_priv_id 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/voice_noti_id1 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/voice_noti_id2 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/cb_noti_priv_id 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sim_msg_noti_priv_id 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/emergency_noti_id 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sentfail_noti_id 0 -s msg-service::vconf -u 200 -g 5000
+vconftool set -t int db/private/msg-service/sim_full_noti_id 0 -s msg-service::vconf -u 200 -g 5000
 
-# Msg Count
-vconftool set -t int db/msg/recv_sms 0 -u 0
-vconftool set -t int db/msg/recv_mms 0 -u 0
 
 %postun -p /sbin/ldconfig
 
 %postun tools -p /sbin/ldconfig
-
 %postun -n sms-plugin -p /sbin/ldconfig
-
 %postun -n mms-plugin -p /sbin/ldconfig
 
 %files
-%defattr(-,root,root,-)
-%dir /opt/data/msg-service
+%manifest msg-service.manifest
+%defattr(-,system,system,-)
 %{_libdir}/libmsg_plugin_manager.so
 %{_libdir}/libmsg_mapi.so.*
 %{_libdir}/libmsg_framework_handler.so
 %{_libdir}/libmsg_transaction_manager.so
 %{_libdir}/libmsg_utils.so
+%{_libdir}/libmsg_externals.so
 %{_libdir}/libmsg_transaction_proxy.so
-%{_sysconfdir}/rc.d/init.d/msg-server
-%{_sysconfdir}/rc.d/rc3.d/S70msg-server
-%{_sysconfdir}/rc.d/rc5.d/S70msg-server
+%{_libdir}/libmsg_vobject.so
+/usr/share/license/msg-service/LICENSE.APLv2
 
 %files devel
-%defattr(-,root,root,-)
+%defattr(-,system,system,-)
 %{_libdir}/libmsg_mapi.so
 %{_libdir}/pkgconfig/msg-service.pc
 %{_includedir}/msg-service/*
 
-
 %files tools
-%defattr(-,root,root,-)
-%{_bindir}/msg-helper
-%{_bindir}/msg-test-app
+%manifest msg-service-tools.manifest
+%defattr(-,system,system,-)
 %{_bindir}/msg-server
-%{_datadir}/media/Sherbet.wav
-%attr(0644,root,root)/usr/share/msg-service/plugin.cfg
-%attr(0644,root,root)/opt/etc/msg-service/Temp0_2.txt
-%attr(0644,root,root)/opt/etc/msg-service/Temp1_0.txt
-%attr(0644,root,root)/opt/etc/msg-service/audio.amr
-%attr(0644,root,root)/opt/etc/msg-service/P091120_104633.jpg
-%attr(0644,root,root)/opt/etc/msg-service/A.smi
-%attr(0644,root,root)/opt/etc/msg-service/V091120_104905.3gp
-%attr(0644,root,root)/opt/etc/msg-service/alert_on_call.mp3
+%config(noreplace) /opt/usr/dbspace/.msg_service.db*
+%{_libdir}/systemd/system/msg-server.service
+%{_libdir}/systemd/system/multi-user.target.wants/msg-server.service
+%{_libdir}/systemd/system/sockets.target.wants/msg-server.socket
+%{_libdir}/systemd/system/msg-server.socket
+/usr/share/license/msg-service/LICENSE.APLv2
+/etc/smack/accesses.d/msg-service.rule
+/etc/config/*
 
 %files -n sms-plugin
-%defattr(-,root,root,-)
+%manifest sms-plugin.manifest
+%defattr(-,system,system,-)
 %{_libdir}/libmsg_sms_plugin.so
+/usr/share/license/msg-service/LICENSE.APLv2
 
 %files -n mms-plugin
-%defattr(-,root,root,-)
+%manifest mms-plugin.manifest
+%defattr(-,system,system,-)
 %{_libdir}/libmsg_mms_plugin.so
-%{_libdir}/libmsg_mms_language_pack.so
+/usr/share/license/msg-service/LICENSE.APLv2
+
+%changelog