Merge branch 'tizen_3.0' into tizen 63/115963/1 accepted/tizen/ivi/20170222.095200 accepted/tizen/mobile/20170222.095112 accepted/tizen/tv/20170222.095128 accepted/tizen/wearable/20170222.095144 submit/tizen/20170222.074243
authorPiotr Kosko <p.kosko@samsung.com>
Wed, 22 Feb 2017 07:16:57 +0000 (08:16 +0100)
committerPiotr Kosko <p.kosko@samsung.com>
Wed, 22 Feb 2017 07:20:29 +0000 (08:20 +0100)
Change-Id: Id2f36ff4263f23f3d81bdfd95ad0e271505cb643
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
14 files changed:
packaging/webapi-plugins.spec
src/alarm/alarm.gyp
src/application/application.gyp
src/bluetooth/bluetooth.gyp
src/common/common.gyp
src/convergence/convergence_instance.cc
src/convergence/convergence_remote_app_control_service.cc
src/convergence/convergence_utils.cc
src/nfc/nfc.gyp
src/notification/notification.gyp
src/notification/status_notification.cc
src/notification/status_notification.h
src/preference/preference.gyp
src/push/push.gyp

index 4be9038..5cd9b0c 100644 (file)
@@ -1,7 +1,5 @@
 %bcond_with wayland
 
-%{!?profile:%define profile tv}
-
 %define _manifestdir %{TZ_SYS_RW_PACKAGES}
 %define _desktop_icondir %{TZ_SYS_SHARE}/icons/default/small
 
@@ -17,6 +15,7 @@ Group:      Development/Libraries
 Summary:    Tizen Web APIs implemented
 Source0:    %{name}-%{version}.tar.gz
 
+# TODO: x86/x64 may be non-emulator. please fix it. (and arm emulator may exist)
 %ifarch %{arm} aarch64
 # ARM
 %define tizen_is_emulator           0
@@ -25,7 +24,7 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_is_emulator           1
 %endif
 
-%if "%{_repository}" == "arm64-wayland"
+%ifarch aarch64
 # 64bit
 %define tizen_is_arm64           1
 %else
@@ -36,340 +35,393 @@ Source0:    %{name}-%{version}.tar.gz
 ####################################################################
 #       Common Profile : artik                                     #
 ####################################################################
-%if "%{?profile}" == "common"
-
-%define tizen_privilege_engine                        CYNARA
-
-%define tizen_feature_account_support                 0
-%define tizen_feature_alarm_support                   1
-%define tizen_feature_app_control_settings_support    1
-%define tizen_feature_application_support             1
-%define tizen_feature_archive_support                 0
-%define tizen_feature_badge_support                   0
-%define tizen_feature_bluetooth_support               1
-%define tizen_feature_bookmark_support                0
-%define tizen_feature_calendar_support                0
-%define tizen_feature_contact_support                 0
-%define tizen_feature_content_support                 1
-%define tizen_feature_datacontrol_support             0
-%define tizen_feature_datasync_support                0
-%define tizen_feature_download_support                1
-%define tizen_feature_exif_support                    1
-%define tizen_feature_feedback_support                0
-%define tizen_feature_filesystem_support              1
-%define tizen_feature_fm_radio_support                0
-%define tizen_feature_ham_support                     0
-%define tizen_feature_iotcon_support                  0
-%define tizen_feature_location_batch                  0
-%define tizen_feature_key_manager_support             0
-%define tizen_feature_media_controller_support        0
-%define tizen_feature_media_key_support               0
-%define tizen_feature_message_port_support            1
-%define tizen_feature_messaging_support               0
-%define tizen_feature_nfc_emulation_support           0
-%define tizen_feature_nfc_support                     0
-%define tizen_feature_notification_support            0
-%define tizen_feature_package_support                 1
-%define tizen_feature_player_util_support             0
-%define tizen_feature_power_support                   0
-%define tizen_feature_preference_support              0
-%define tizen_feature_push_support                    0
-%define tizen_feature_se_support                      0
-%define tizen_feature_sensor_support                  0
-%define tizen_feature_sound_support                   1
-%define tizen_feature_system_info_support             1
-%define tizen_feature_system_setting_support          0
-%define tizen_feature_telephony_support               0
-%define tizen_feature_time_support                    1
-%define tizen_feature_web_setting_support             0
-%define tizen_feature_widget_service_support          0
-%define tizen_feature_wi_fi_support                   1
-%define tizen_feature_inputdevice_support             0
-%define tizen_feature_callhistory_support             0
-%define tizen_feature_nbs_support                     0
-%define tizen_feature_tvinputdevice_support           0
-
-%endif # tizen_profile_common
+
+%define tizen_common_privilege_engine                        CYNARA
+
+%define tizen_common_feature_account_support                 0
+%define tizen_common_feature_alarm_support                   1
+%define tizen_common_feature_app_control_settings_support    1
+%define tizen_common_feature_application_support             1
+%define tizen_common_feature_archive_support                 0
+%define tizen_common_feature_badge_support                   0
+%define tizen_common_feature_bluetooth_support               1
+%define tizen_common_feature_bookmark_support                0
+%define tizen_common_feature_calendar_support                0
+%define tizen_common_feature_contact_support                 0
+%define tizen_common_feature_content_support                 1
+%define tizen_common_feature_datacontrol_support             0
+%define tizen_common_feature_datasync_support                0
+%define tizen_common_feature_download_support                1
+%define tizen_common_feature_exif_support                    1
+%define tizen_common_feature_feedback_support                0
+%define tizen_common_feature_filesystem_support              1
+%define tizen_common_feature_fm_radio_support                0
+%define tizen_common_feature_ham_support                     0
+%define tizen_common_feature_iotcon_support                  0
+%define tizen_common_feature_location_batch                  0
+%define tizen_common_feature_key_manager_support             0
+%define tizen_common_feature_media_controller_support        0
+%define tizen_common_feature_media_key_support               0
+%define tizen_common_feature_message_port_support            1
+%define tizen_common_feature_messaging_support               0
+%define tizen_common_feature_nfc_emulation_support           0
+%define tizen_common_feature_nfc_support                     0
+%define tizen_common_feature_notification_support            0
+%define tizen_common_feature_package_support                 1
+%define tizen_common_feature_player_util_support             0
+%define tizen_common_feature_power_support                   0
+%define tizen_common_feature_preference_support              0
+%define tizen_common_feature_push_support                    0
+%define tizen_common_feature_se_support                      0
+%define tizen_common_feature_sensor_support                  0
+%define tizen_common_feature_sound_support                   1
+%define tizen_common_feature_system_info_support             1
+%define tizen_common_feature_system_setting_support          0
+%define tizen_common_feature_telephony_support               0
+%define tizen_common_feature_time_support                    1
+%define tizen_common_feature_web_setting_support             0
+%define tizen_common_feature_widget_service_support          0
+%define tizen_common_feature_wi_fi_support                   1
+%define tizen_common_feature_inputdevice_support             0
+%define tizen_common_feature_callhistory_support             0
+%define tizen_common_feature_nbs_support                     0
+%define tizen_common_feature_tvinputdevice_support           0
+
 
 ####################################################################
 #       Mobile Profile :  TM1(32bit), Redwood(SM-Z910F), KIRAN(Z130H)          #
 #                         TM2(64bit)
 ####################################################################
-%if "%{?profile}" == "mobile"
 
-%define tizen_privilege_engine                        CYNARA
+%define tizen_mobile_privilege_engine                        CYNARA
 
-%define tizen_feature_account_support                 1
-%define tizen_feature_alarm_support                   1
-%define tizen_feature_app_control_settings_support    1
-%define tizen_feature_application_support             1
-%define tizen_feature_archive_support                 1
-%define tizen_feature_badge_support                   1
+%define tizen_mobile_feature_account_support                 1
+%define tizen_mobile_feature_alarm_support                   1
+%define tizen_mobile_feature_app_control_settings_support    1
+%define tizen_mobile_feature_application_support             1
+%define tizen_mobile_feature_archive_support                 1
+%define tizen_mobile_feature_badge_support                   1
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_bluetooth_support               0
+%define tizen_mobile_feature_bluetooth_support               0
 %else
-%define tizen_feature_bluetooth_support               1
-%endif
-%define tizen_feature_bookmark_support                1
-%define tizen_feature_calendar_support                1
-%define tizen_feature_contact_support                 1
-%define tizen_feature_content_support                 1
-%define tizen_feature_datacontrol_support             1
-%define tizen_feature_datasync_support                0
-%define tizen_feature_download_support                1
-%define tizen_feature_exif_support                    1
-%define tizen_feature_feedback_support                1
-%define tizen_feature_filesystem_support              1
+%define tizen_mobile_feature_bluetooth_support               1
+%endif
+%define tizen_mobile_feature_bookmark_support                1
+%define tizen_mobile_feature_calendar_support                1
+%define tizen_mobile_feature_contact_support                 1
+%define tizen_mobile_feature_content_support                 1
+%define tizen_mobile_feature_datacontrol_support             1
+%define tizen_mobile_feature_datasync_support                0
+%define tizen_mobile_feature_download_support                1
+%define tizen_mobile_feature_exif_support                    1
+%define tizen_mobile_feature_feedback_support                1
+%define tizen_mobile_feature_filesystem_support              1
 
 # FM radio feature
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_fm_radio_support                1
+%define tizen_mobile_feature_fm_radio_support                1
 %else
 %if 0%{?tizen_is_arm64}
-%define tizen_feature_fm_radio_support                0
+%define tizen_mobile_feature_fm_radio_support                0
 %else
-%define tizen_feature_fm_radio_support                1
+%define tizen_mobile_feature_fm_radio_support                1
 %endif
 %endif
 
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_ham_support                     1
+%define tizen_mobile_feature_ham_support                     1
 %else
-%define tizen_feature_ham_support                     0
+%define tizen_mobile_feature_ham_support                     0
 %endif
-%define tizen_feature_iotcon_support                  1
-%define tizen_feature_location_batch                  0
-%define tizen_feature_key_manager_support             1
-%define tizen_feature_media_controller_support        1
+%define tizen_mobile_feature_iotcon_support                  1
+%define tizen_mobile_feature_location_batch                  0
+%define tizen_mobile_feature_key_manager_support             1
+%define tizen_mobile_feature_media_controller_support        1
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_media_key_support               0
+%define tizen_mobile_feature_media_key_support               0
 %else
-%define tizen_feature_media_key_support               1
+%define tizen_mobile_feature_media_key_support               1
 %endif
-%define tizen_feature_message_port_support            1
-%define tizen_feature_messaging_support               1
+%define tizen_mobile_feature_message_port_support            1
+%define tizen_mobile_feature_messaging_support               1
 
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_nfc_emulation_support           0
-%define tizen_feature_nfc_support                     1
+%define tizen_mobile_feature_nfc_emulation_support           0
+%define tizen_mobile_feature_nfc_support                     1
 %else
-%define tizen_feature_nfc_emulation_support           0
-%define tizen_feature_nfc_support                     0
+%define tizen_mobile_feature_nfc_emulation_support           0
+%define tizen_mobile_feature_nfc_support                     0
 %endif
-%define tizen_feature_notification_support            1
-%define tizen_feature_package_support                 1
-%define tizen_feature_player_util_support             1
-%define tizen_feature_power_support                   1
-%define tizen_feature_preference_support              1
-%define tizen_feature_push_support                    1
+%define tizen_mobile_feature_notification_support            1
+%define tizen_mobile_feature_package_support                 1
+%define tizen_mobile_feature_player_util_support             1
+%define tizen_mobile_feature_power_support                   1
+%define tizen_mobile_feature_preference_support              1
+%define tizen_mobile_feature_push_support                    1
 
 # secure element feature
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_se_support                      0
+%define tizen_mobile_feature_se_support                      0
 %else
 %if 0%{?tizen_is_arm64}
-%define tizen_feature_se_support                      0
+%define tizen_mobile_feature_se_support                      0
 %else
-%define tizen_feature_se_support                      1
+%define tizen_mobile_feature_se_support                      1
 %endif
 %endif
 
-%define tizen_feature_sensor_support                  1
-%define tizen_feature_sound_support                   1
-%define tizen_feature_system_info_support             1
-%define tizen_feature_system_setting_support          1
+%define tizen_mobile_feature_sensor_support                  1
+%define tizen_mobile_feature_sound_support                   1
+%define tizen_mobile_feature_system_info_support             1
+%define tizen_mobile_feature_system_setting_support          1
 
 # telephony feature
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_telephony_support               1
+%define tizen_mobile_feature_telephony_support               1
 %else
 %if 0%{?tizen_is_arm64}
-%define tizen_feature_telephony_support               0
+%define tizen_mobile_feature_telephony_support               0
 %else
-%define tizen_feature_telephony_support               1
+%define tizen_mobile_feature_telephony_support               1
 %endif
 %endif
 
-%define tizen_feature_time_support                    1
-%define tizen_feature_web_setting_support             1
-%define tizen_feature_widget_service_support          1
+%define tizen_mobile_feature_time_support                    1
+%define tizen_mobile_feature_web_setting_support             1
+%define tizen_mobile_feature_widget_service_support          1
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_wi_fi_support                   0
+%define tizen_mobile_feature_wi_fi_support                   0
 %else
-%define tizen_feature_wi_fi_support                   1
+%define tizen_mobile_feature_wi_fi_support                   1
 %endif
-%define tizen_feature_inputdevice_support             1
+%define tizen_mobile_feature_inputdevice_support             1
 
-%if 0%{?tizen_feature_telephony_support}
-%define tizen_feature_callhistory_support             1
-%define tizen_feature_nbs_support                     1
+%if 0%{?tizen_mobile_feature_telephony_support}
+%define tizen_mobile_feature_callhistory_support             1
+%define tizen_mobile_feature_nbs_support                     1
 %else
-%define tizen_feature_callhistory_support             0
-%define tizen_feature_nbs_support                     0
+%define tizen_mobile_feature_callhistory_support             0
+%define tizen_mobile_feature_nbs_support                     0
 %endif
 
-%define tizen_feature_tvinputdevice_support           0
+%define tizen_mobile_feature_tvinputdevice_support           0
 
-%define tizen_feature_convergence_support             1
+%define tizen_mobile_feature_convergence_support             1
 
-%endif # tizen_profile_mobile
 
 ####################################################################
 #       Wearable Profile :  B2 / TW1                      #
 ####################################################################
-%if "%{?profile}" == "wearable"
 
-%define tizen_privilege_engine                        CYNARA
+%define tizen_wearable_privilege_engine                        CYNARA
 
 # Account API is optional in Tizen Wearable Profile.
-%define tizen_feature_account_support                 0
+%define tizen_wearable_feature_account_support                 0
 
-%define tizen_feature_alarm_support                   1
-%define tizen_feature_app_control_settings_support    1
-%define tizen_feature_application_support             1
+%define tizen_wearable_feature_alarm_support                   1
+%define tizen_wearable_feature_app_control_settings_support    1
+%define tizen_wearable_feature_application_support             1
 
 # Archive API is optional in Tizen Wearable Profile.
-%define tizen_feature_archive_support                 1
+%define tizen_wearable_feature_archive_support                 1
 
 # Badge API is mandatory in Tizen Wearable Profile.
-%define tizen_feature_badge_support                   1
+%define tizen_wearable_feature_badge_support                   1
 
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_bluetooth_support               0
+%define tizen_wearable_feature_bluetooth_support               0
 %else
-%define tizen_feature_bluetooth_support               1
+%define tizen_wearable_feature_bluetooth_support               1
 %endif
 
 # Bookmark API is optional in Tizen Wearable Profile.
-%define tizen_feature_bookmark_support                0
+%define tizen_wearable_feature_bookmark_support                0
 
 # Calendar API is mandatory in Tizen Wearable Profile.
-%define tizen_feature_calendar_support                0
-%define tizen_feature_contact_support                 0
-%define tizen_feature_content_support                 1
-%define tizen_feature_datacontrol_support             1
-%define tizen_feature_datasync_support                0
-%define tizen_feature_download_support                1
-%define tizen_feature_exif_support                    1
-%define tizen_feature_feedback_support                1
-%define tizen_feature_filesystem_support              1
-%define tizen_feature_fm_radio_support                0
-%define tizen_feature_ham_support                     1
-%define tizen_feature_iotcon_support                  1
-%define tizen_feature_location_batch                  0
-%define tizen_feature_media_controller_support        1
+%define tizen_wearable_feature_calendar_support                0
+%define tizen_wearable_feature_contact_support                 0
+%define tizen_wearable_feature_content_support                 1
+%define tizen_wearable_feature_datacontrol_support             1
+%define tizen_wearable_feature_datasync_support                0
+%define tizen_wearable_feature_download_support                1
+%define tizen_wearable_feature_exif_support                    1
+%define tizen_wearable_feature_feedback_support                1
+%define tizen_wearable_feature_filesystem_support              1
+%define tizen_wearable_feature_fm_radio_support                0
+%define tizen_wearable_feature_ham_support                     1
+%define tizen_wearable_feature_iotcon_support                  1
+%define tizen_wearable_feature_location_batch                  0
+%define tizen_wearable_feature_media_controller_support        1
 
 # MediayKey API is optional in Tizen Wearable Profile.
 # tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_media_key_support               0
+%define tizen_wearable_feature_media_key_support               0
 %else
-%define tizen_feature_media_key_support               1
-%endif
-%define tizen_feature_key_manager_support             1
-%define tizen_feature_message_port_support            1
-%define tizen_feature_messaging_support               0
-%define tizen_feature_nfc_emulation_support           0
-%define tizen_feature_nfc_support                     1
-%define tizen_feature_notification_support            1
-%define tizen_feature_package_support                 1
-%define tizen_feature_player_util_support             1
-%define tizen_feature_power_support                   1
-%define tizen_feature_preference_support              1
-%define tizen_feature_push_support                    1
+%define tizen_wearable_feature_media_key_support               1
+%endif
+%define tizen_wearable_feature_key_manager_support             1
+%define tizen_wearable_feature_message_port_support            1
+%define tizen_wearable_feature_messaging_support               0
+%define tizen_wearable_feature_nfc_emulation_support           0
+%define tizen_wearable_feature_nfc_support                     1
+%define tizen_wearable_feature_notification_support            1
+%define tizen_wearable_feature_package_support                 1
+%define tizen_wearable_feature_player_util_support             1
+%define tizen_wearable_feature_power_support                   1
+%define tizen_wearable_feature_preference_support              1
+%define tizen_wearable_feature_push_support                    1
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_se_support                      0
+%define tizen_wearable_feature_se_support                      0
 %else
-%define tizen_feature_se_support                      1
+%define tizen_wearable_feature_se_support                      1
 %endif
-%define tizen_feature_sensor_support                  1
-%define tizen_feature_sound_support                   1
-%define tizen_feature_system_info_support             1
-%define tizen_feature_system_setting_support          1
+%define tizen_wearable_feature_sensor_support                  1
+%define tizen_wearable_feature_sound_support                   1
+%define tizen_wearable_feature_system_info_support             1
+%define tizen_wearable_feature_system_setting_support          1
 %if 0%{?tizen_is_emulator}
-%define tizen_feature_telephony_support               1
+%define tizen_wearable_feature_telephony_support               1
 %else
-%define tizen_feature_telephony_support               0
+%define tizen_wearable_feature_telephony_support               0
 %endif
-%define tizen_feature_time_support                    1
-%define tizen_feature_web_setting_support             0
-%define tizen_feature_widget_service_support          1
-%define tizen_feature_wi_fi_support                   1
-%define tizen_feature_inputdevice_support             1
-%define tizen_feature_tvinputdevice_support           0
+%define tizen_wearable_feature_time_support                    1
+%define tizen_wearable_feature_web_setting_support             0
+%define tizen_wearable_feature_widget_service_support          1
+%define tizen_wearable_feature_wi_fi_support                   1
+%define tizen_wearable_feature_inputdevice_support             1
+%define tizen_wearable_feature_tvinputdevice_support           0
 
 #- telephony related APIs
 # CallHistory API is optional in Tizen Wearable Profile.
 # NetworkBearerSelection API is optional in Tizen Wearable Profile.
-%if 0%{?tizen_feature_telephony_support}
-%define    tizen_feature_callhistory_support          1
-%define    tizen_feature_nbs_support                  1
+%if 0%{?tizen_wearable_feature_telephony_support}
+%define    tizen_wearable_feature_callhistory_support          1
+%define    tizen_wearable_feature_nbs_support                  1
 %else
-%define    tizen_feature_callhistory_support          0
-%define    tizen_feature_nbs_support                  0
+%define    tizen_wearable_feature_callhistory_support          0
+%define    tizen_wearable_feature_nbs_support                  0
 %endif
 
-%define tizen_feature_convergence_support             1
+%define tizen_wearable_feature_convergence_support             1
 
-%endif # tizen_profile_wearable
 
 ####################################################################
 #       TV Profile                                                 #
 ####################################################################
-%if "%{?profile}" == "tv"
-
-%define tizen_privilege_engine                        CYNARA
-
-%define tizen_feature_account_support                 0
-%define tizen_feature_alarm_support                   1
-%define tizen_feature_app_control_settings_support    0
-%define tizen_feature_application_support             1
-%define tizen_feature_archive_support                 1
-%define tizen_feature_badge_support                   0
-%define tizen_feature_bluetooth_support               0
-%define tizen_feature_bookmark_support                0
-%define tizen_feature_calendar_support                0
-%define tizen_feature_callhistory_support             0
-%define tizen_feature_contact_support                 0
-%define tizen_feature_content_support                 1
-%define tizen_feature_datacontrol_support             1
-%define tizen_feature_datasync_support                0
-%define tizen_feature_download_support                1
-%define tizen_feature_exif_support                    1
-%define tizen_feature_feedback_support                0
-%define tizen_feature_filesystem_support              1
-%define tizen_feature_fm_radio_support                0
-%define tizen_feature_ham_support                     0
-%define tizen_feature_iotcon_support                  1
-%define tizen_feature_key_manager_support             1
-%define tizen_feature_media_controller_support        0
-%define tizen_feature_media_key_support               1
-%define tizen_feature_message_port_support            1
-%define tizen_feature_messaging_support               0
-%define tizen_feature_nbs_support                     0
-%define tizen_feature_nfc_emulation_support           0
-%define tizen_feature_nfc_support                     0
-%define tizen_feature_notification_support            0
-%define tizen_feature_package_support                 1
-%define tizen_feature_player_util_support             0
-%define tizen_feature_power_support                   0
-%define tizen_feature_preference_support              0
-%define tizen_feature_push_support                    1
-%define tizen_feature_se_support                      0
-%define tizen_feature_sensor_support                  0
-%define tizen_feature_sound_support                   0
-%define tizen_feature_system_info_support             1
-%define tizen_feature_system_setting_support          0
-%define tizen_feature_telephony_support               0
-%define tizen_feature_time_support                    1
-%define tizen_feature_web_setting_support             1
-%define tizen_feature_widget_service_support          0
-%define tizen_feature_wi_fi_support                   1
-%define tizen_feature_inputdevice_support             0
-%define tizen_feature_tvinputdevice_support           1
-%define tizen_feature_convergence_support             1
-
-%endif # tizen_profile_tv
+
+%define tizen_tv_privilege_engine                        CYNARA
+
+%define tizen_tv_feature_account_support                 0
+%define tizen_tv_feature_alarm_support                   1
+%define tizen_tv_feature_app_control_settings_support    0
+%define tizen_tv_feature_application_support             1
+%define tizen_tv_feature_archive_support                 1
+%define tizen_tv_feature_badge_support                   0
+%define tizen_tv_feature_bluetooth_support               0
+%define tizen_tv_feature_bookmark_support                0
+%define tizen_tv_feature_calendar_support                0
+%define tizen_tv_feature_callhistory_support             0
+%define tizen_tv_feature_contact_support                 0
+%define tizen_tv_feature_content_support                 1
+%define tizen_tv_feature_datacontrol_support             1
+%define tizen_tv_feature_datasync_support                0
+%define tizen_tv_feature_download_support                1
+%define tizen_tv_feature_exif_support                    1
+%define tizen_tv_feature_feedback_support                0
+%define tizen_tv_feature_filesystem_support              1
+%define tizen_tv_feature_fm_radio_support                0
+%define tizen_tv_feature_ham_support                     0
+%define tizen_tv_feature_iotcon_support                  1
+%define tizen_tv_feature_key_manager_support             1
+%define tizen_tv_feature_media_controller_support        0
+%define tizen_tv_feature_media_key_support               1
+%define tizen_tv_feature_message_port_support            1
+%define tizen_tv_feature_messaging_support               0
+%define tizen_tv_feature_nbs_support                     0
+%define tizen_tv_feature_nfc_emulation_support           0
+%define tizen_tv_feature_nfc_support                     0
+%define tizen_tv_feature_notification_support            0
+%define tizen_tv_feature_package_support                 1
+%define tizen_tv_feature_player_util_support             0
+%define tizen_tv_feature_power_support                   0
+%define tizen_tv_feature_preference_support              0
+%define tizen_tv_feature_push_support                    1
+%define tizen_tv_feature_se_support                      0
+%define tizen_tv_feature_sensor_support                  0
+%define tizen_tv_feature_sound_support                   0
+%define tizen_tv_feature_system_info_support             1
+%define tizen_tv_feature_system_setting_support          0
+%define tizen_tv_feature_telephony_support               0
+%define tizen_tv_feature_time_support                    1
+%define tizen_tv_feature_web_setting_support             1
+%define tizen_tv_feature_widget_service_support          0
+%define tizen_tv_feature_wi_fi_support                   1
+%define tizen_tv_feature_inputdevice_support             0
+%define tizen_tv_feature_tvinputdevice_support           1
+%define tizen_tv_feature_convergence_support             1
+
+# common, or "unified (undefined)"
+%define unified_build   1
+# GBM Product Build Optimization. Not for 4.0 Public Unified Build.
+%if "%{?profile}" == "tv" || "%{?profile}" == "mobile" || "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
+%define unified_build  0
+%endif
+
+# GBM Product Build Optimization. Not for 4.0 Public Unified Build.
+%if "%{?profile}" == "tv" || "%{?profile}" == "mobile" || "%{?profile}" == "wearable" || "%{?profile}" == "common"
+%define tizen_privilege_engine                        tizen_%{?profile}_privilege_engine
+
+%define tizen_feature_account_support                 tizen_%{?profile}_feature_account_support
+%define tizen_feature_alarm_support                   tizen_%{?profile}_feature_alarm_support
+%define tizen_feature_app_control_settings_support    tizen_%{?profile}_feature_app_control_settings_support
+%define tizen_feature_application_support             tizen_%{?profile}_feature_application_support
+%define tizen_feature_archive_support                 tizen_%{?profile}_feature_archive_support
+%define tizen_feature_badge_support                   tizen_%{?profile}_feature_badge_support
+%define tizen_feature_bluetooth_support               tizen_%{?profile}_feature_bluetooth_support
+%define tizen_feature_bookmark_support                tizen_%{?profile}_feature_bookmark_support
+%define tizen_feature_calendar_support                tizen_%{?profile}_feature_calendar_support
+%define tizen_feature_contact_support                 tizen_%{?profile}_feature_contact_support
+%define tizen_feature_content_support                 tizen_%{?profile}_feature_content_support
+%define tizen_feature_datacontrol_support             tizen_%{?profile}_feature_datacontrol_support
+%define tizen_feature_datasync_support                tizen_%{?profile}_feature_datasync_support
+%define tizen_feature_download_support                tizen_%{?profile}_feature_download_support
+%define tizen_feature_exif_support                    tizen_%{?profile}_feature_exif_support
+%define tizen_feature_feedback_support                tizen_%{?profile}_feature_feedback_support
+%define tizen_feature_filesystem_support              tizen_%{?profile}_feature_filesystem_support
+%define tizen_feature_fm_radio_support                tizen_%{?profile}_feature_fm_radio_support
+%define tizen_feature_ham_support                     tizen_%{?profile}_feature_ham_support
+%define tizen_feature_iotcon_support                  tizen_%{?profile}_feature_iotcon_support
+%define tizen_feature_location_batch                  tizen_%{?profile}_feature_location_bat
+%define tizen_feature_key_manager_support             tizen_%{?profile}_feature_key_manager_support
+%define tizen_feature_media_controller_support        tizen_%{?profile}_feature_media_controller_support
+%define tizen_feature_media_key_support               tizen_%{?profile}_feature_media_key_support
+%define tizen_feature_message_port_support            tizen_%{?profile}_feature_message_port_support
+%define tizen_feature_messaging_support               tizen_%{?profile}_feature_messaging_support
+%define tizen_feature_nfc_emulation_support           tizen_%{?profile}_feature_nfc_emulation_support
+%define tizen_feature_nfc_support                     tizen_%{?profile}_feature_nfc_support
+%define tizen_feature_notification_support            tizen_%{?profile}_feature_notification_support
+%define tizen_feature_package_support                 tizen_%{?profile}_feature_package_support
+%define tizen_feature_player_util_support             tizen_%{?profile}_feature_player_util_support
+%define tizen_feature_power_support                   tizen_%{?profile}_feature_power_support
+%define tizen_feature_preference_support              tizen_%{?profile}_feature_preference_support
+%define tizen_feature_push_support                    tizen_%{?profile}_feature_push_support
+%define tizen_feature_se_support                      tizen_%{?profile}_feature_se_support
+%define tizen_feature_sensor_support                  tizen_%{?profile}_feature_sensor_support
+%define tizen_feature_sound_support                   tizen_%{?profile}_feature_sound_support
+%define tizen_feature_system_info_support             tizen_%{?profile}_feature_system_info_support
+%define tizen_feature_system_setting_support          tizen_%{?profile}_feature_system_setting_support
+%define tizen_feature_telephony_support               tizen_%{?profile}_feature_telephony_support
+%define tizen_feature_time_support                    tizen_%{?profile}_feature_time_support
+%define tizen_feature_web_setting_support             tizen_%{?profile}_feature_web_setting_support
+%define tizen_feature_widget_service_support          tizen_%{?profile}_feature_widget_service_support
+%define tizen_feature_wi_fi_support                   tizen_%{?profile}_feature_wi_fi_support
+%define tizen_feature_inputdevice_support             tizen_%{?profile}_feature_inputdevice_support
+%define tizen_feature_callhistory_support             tizen_%{?profile}_feature_callhistory_support
+%define tizen_feature_nbs_support                     tizen_%{?profile}_feature_nbs_support
+%define tizen_feature_tvinputdevice_support           tizen_%{?profile}_feature_tvinputdevice_support
+%endif
+
 
 BuildRequires: pkgconfig(security-privilege-manager)
 BuildRequires: ninja
@@ -401,7 +453,7 @@ BuildRequires: pkgconfig(capi-network-bluetooth)
 BuildRequires: pkgconfig(capi-network-wifi-manager)
 BuildRequires: pkgconfig(tapi)
 BuildRequires: pkgconfig(libpcrecpp)
-BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-appfw-app-common)
 BuildRequires: pkgconfig(capi-appfw-app-manager)
 BuildRequires: pkgconfig(capi-appfw-package-manager)
 BuildRequires: pkgconfig(capi-content-media-content)
@@ -422,142 +474,215 @@ BuildRequires: pkgconfig(wayland-client)
 BuildRequires: pkgconfig(security-privilege-checker)
 %endif
 
-%if "%{?tizen_privilege_engine}" == "CYNARA"
+%if "%{?tizen_privilege_engine}" == "CYNARA" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(cynara-client)
 BuildRequires: pkgconfig(libsmack)
 %endif
 
-%if 0%{?tizen_feature_account_support}
+%if "%{?tizen_feature_account_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(accounts-svc)
 %endif
 
-%if 0%{?tizen_feature_alarm_support}
+%if "%{?tizen_feature_alarm_support}" == "1" || "%{?unified_build}" == "1"
+BuildRequires: pkgconfig(capi-appfw-app-control)
+BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(capi-appfw-alarm)
 BuildRequires: pkgconfig(alarm-service)
 %endif
 
-%if 0%{?tizen_feature_bookmark_support}
+%if "%{?tizen_feature_application_support}" == "1" || "%{?unified_build}" == "1"
+BuildRequires: pkgconfig(capi-appfw-app-control)
+BuildRequires: pkgconfig(capi-appfw-event)
+%endif
+
+%if "%{?tizen_feature_bluetooth_support}" == "1" || "%{?unified_build}" == "1"
+BuildRequires: pkgconfig(capi-appfw-app-control)
+%endif
+
+%if "%{?tizen_feature_bookmark_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-web-bookmark)
 BuildRequires: pkgconfig(bookmark-adaptor)
 %endif
 
-%if 0%{?tizen_feature_datacontrol_support}
+%if "%{?tizen_feature_datacontrol_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-data-control)
 %endif
 
-%if 0%{?tizen_feature_download_support}
+%if "%{?tizen_feature_download_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-web-url-download)
 %endif
 
-%if 0%{?tizen_feature_ham_support}
+%if "%{?tizen_feature_ham_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(motion)
 BuildRequires: pkgconfig(capi-system-sensor)
 BuildRequires: pkgconfig(capi-location-manager)
 BuildRequires: pkgconfig(sensor)
 %endif
 
-%if 0%{?tizen_feature_iotcon_support}
+%if "%{?tizen_feature_iotcon_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(iotcon)
 %endif
 
-%if 0%{?tizen_feature_player_util_support}
+%if "%{?tizen_feature_player_util_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(chromium-efl)
 %endif
 
-%if 0%{?tizen_feature_power_support}
+%if "%{?tizen_feature_power_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(deviced)
 %endif
 
-%if 0%{?tizen_feature_power_support}
+%if "%{?tizen_feature_power_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-appfw-application)
 %endif
 
-%if 0%{?tizen_feature_push_support}
+%if "%{?tizen_feature_push_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(push)
+BuildRequires: pkgconfig(capi-appfw-app-control)
 %endif
 
-%if 0%{?tizen_feature_key_manager_support}
+%if "%{?tizen_feature_key_manager_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(key-manager)
 %endif
 
-%if 0%{?tizen_feature_media_controller_support}
+%if "%{?tizen_feature_media_controller_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-media-controller)
 %endif
 
-%if 0%{?tizen_feature_messaging_support}
+%if "%{?tizen_feature_messaging_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(ecore-file)
 BuildRequires:  pkgconfig(email-service)
 BuildRequires:  pkgconfig(msg-service)
 BuildRequires:  pkgconfig(db-util)
 %endif
 
-%if 0%{?tizen_feature_badge_support}
+%if "%{?tizen_feature_badge_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(badge)
 %endif
 
-%if 0%{?tizen_feature_calendar_support}
+%if "%{?tizen_feature_calendar_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(calendar-service2)
 %endif
 
-%if 0%{?tizen_feature_contact_support}
+%if "%{?tizen_feature_contact_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(contacts-service2)
 %endif
 
-%if 0%{?tizen_feature_callhistory_support}
+%if "%{?tizen_feature_callhistory_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(contacts-service2)
 %endif
 
-%if 0%{?tizen_feature_exif_support}
+%if "%{?tizen_feature_exif_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(libexif)
 %endif
 
-%if 0%{?tizen_feature_nfc_support}
+%if "%{?tizen_feature_nfc_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(capi-network-nfc)
+BuildRequires:  pkgconfig(capi-appfw-app-control)
 %endif
 
-%if 0%{?tizen_feature_fm_radio_support}
+%if "%{?tizen_feature_fm_radio_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-media-radio)
 %endif
 
-%if 0%{?tizen_feature_feedback_support}
+%if "%{?tizen_feature_feedback_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(feedback)
 %endif
 
-%if 0%{?tizen_feature_se_support}
+%if "%{?tizen_feature_se_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(capi-network-smartcard)
 %endif
 
-%if 0%{?tizen_feature_message_port_support}
+%if "%{?tizen_feature_message_port_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-message-port)
 %endif
 
-%if 0%{?tizen_feature_notification_support}
+%if "%{?tizen_feature_notification_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(capi-appfw-app-control)
 %endif
 
-%if 0%{?tizen_feature_sound_support}
+%if "%{?tizen_feature_preference_support}" == "1" || "%{?unified_build}" == "1"
+BuildRequires: pkgconfig(capi-appfw-preference)
+%endif
+
+%if "%{?tizen_feature_sound_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(capi-media-sound-manager)
 %endif
 
-%if 0%{?tizen_feature_sensor_support}
+%if "%{?tizen_feature_sensor_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(capi-system-sensor)
 %endif
 
-%if 0%{?tizen_feature_media_key_support}
+%if "%{?tizen_feature_media_key_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(capi-system-media-key)
 %endif
 
-%if 0%{?tizen_feature_convergence_support}
+%if "%{?tizen_feature_convergence_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(d2d-conv-manager)
 %endif
 
-%if 0%{?tizen_feature_widget_service_support}
+%if "%{?tizen_feature_widget_service_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires: pkgconfig(widget_service)
 %endif
 
+Requires:      %{name}-compat = %{version}-%{release}
+%if "%{?unified_build}" == "1"
+Recommends:    %{name}-profile_common = %{version}-%{release}
+%endif
+
 %description
 Tizen Web APIs implemented.
 
+%package profile_common
+Summary:       webapi-plugin binaries for common profile
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_mobile
+Conflicts:     %{name}-profile_wearable
+Conflicts:     %{name}-profile_tv
+Conflicts:     %{name}-profile_ivi
+%description profile_common
+Tizen Web API implementation binaries for Tizen common profile.
+
+%package profile_mobile
+Summary:       webapi-plugin binaries for mobile profile
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_common
+Conflicts:     %{name}-profile_wearable
+Conflicts:     %{name}-profile_tv
+Conflicts:     %{name}-profile_ivi
+%description profile_mobile
+Tizen Web API implementation binaries for Tizen mobile profile.
+
+%package profile_wearable
+Summary:       webapi-plugin binaries for wearable profile
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_mobile
+Conflicts:     %{name}-profile_common
+Conflicts:     %{name}-profile_tv
+Conflicts:     %{name}-profile_ivi
+%description profile_wearable
+Tizen Web API implementation binaries for Tizen wearable profile.
+
+%package profile_tv
+Summary:       webapi-plugin binaries for tv profile
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_mobile
+Conflicts:     %{name}-profile_wearable
+Conflicts:     %{name}-profile_common
+Conflicts:     %{name}-profile_ivi
+%description profile_tv
+Tizen Web API implementation binaries for Tizen tv profile.
+
+%package profile_ivi
+Summary:       webapi-plugin binaries for ivi profile
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_mobile
+Conflicts:     %{name}-profile_wearable
+Conflicts:     %{name}-profile_tv
+Conflicts:     %{name}-profile_common
+%description profile_ivi
+Tizen Web API implementation binaries for Tizen ivi profile.
+
 %package devel
 Summary:    webapi-plugins development headers
 Group:      Development/Libraries
@@ -572,7 +697,214 @@ webapi-plugins development headers
 %build
 
 export GYP_GENERATORS='ninja'
+
+%if "%{?unified_build}" == "1"
+# Build All Profiles
+
+# Mobile
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=mobile -Dprivilege_engine=%{tizen_mobile_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_mobile_feature_account_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_mobile_feature_alarm_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_mobile_feature_app_control_settings_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_mobile_feature_application_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_mobile_feature_archive_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_mobile_feature_badge_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_mobile_feature_bluetooth_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_mobile_feature_bookmark_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_mobile_feature_calendar_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_mobile_feature_callhistory_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_mobile_feature_contact_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_mobile_feature_content_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_mobile_feature_datacontrol_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_mobile_feature_datasync_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_mobile_feature_download_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_mobile_feature_exif_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_mobile_feature_feedback_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_mobile_feature_filesystem_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_mobile_feature_fm_radio_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_mobile_feature_ham_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_mobile_feature_iotcon_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_mobile_feature_location_batch}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_mobile_feature_key_manager_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobile_feature_media_controller_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_feature_notification_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_mobile_feature_sensor_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_mobile_feature_se_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_mobile_feature_sound_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_mobile_feature_system_info_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_mobile_feature_system_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_mobile_feature_telephony_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_mobile_feature_time_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_mobile_feature_inputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_mobile_feature_web_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile_feature_widget_service_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_mobile_feature_convergence_support}"
+
+./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
+
+ninja -C out/Default %{?_smp_mflags}
+pushd out
+mv Default bin_mobile
+popd
+
+# WEARABLE
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=wearable -Dprivilege_engine=%{tizen_wearable_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_wearable_feature_account_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_wearable_feature_alarm_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_wearable_feature_app_control_settings_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_wearable_feature_application_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_wearable_feature_archive_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_wearable_feature_badge_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_wearable_feature_bluetooth_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_wearable_feature_bookmark_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_wearable_feature_calendar_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_wearable_feature_callhistory_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_wearable_feature_contact_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_wearable_feature_content_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_wearable_feature_datacontrol_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_wearable_feature_datasync_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_wearable_feature_download_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_wearable_feature_exif_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_wearable_feature_feedback_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_wearable_feature_filesystem_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_wearable_feature_fm_radio_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_wearable_feature_ham_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_wearable_feature_iotcon_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_wearable_feature_location_batch}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_wearable_feature_key_manager_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wearable_feature_media_controller_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable_feature_notification_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_wearable_feature_sensor_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_wearable_feature_se_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_wearable_feature_sound_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_wearable_feature_system_info_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_wearable_feature_system_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_wearable_feature_telephony_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_wearable_feature_time_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_wearable_feature_inputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_wearable_feature_web_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearable_feature_widget_service_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_wearable_feature_convergence_support}"
+
+./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
+
+ninja -C out/Default %{?_smp_mflags}
+pushd out
+mv Default bin_wearable
+popd
+
+# TV
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=tv -Dprivilege_engine=%{tizen_tv_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_tv_feature_account_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_tv_feature_alarm_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_tv_feature_app_control_settings_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_tv_feature_application_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_tv_feature_archive_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_tv_feature_badge_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_tv_feature_bluetooth_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_tv_feature_bookmark_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_tv_feature_calendar_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_tv_feature_callhistory_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_tv_feature_contact_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_tv_feature_content_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_tv_feature_datacontrol_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_tv_feature_datasync_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_tv_feature_download_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_tv_feature_exif_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_tv_feature_feedback_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_tv_feature_filesystem_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_tv_feature_fm_radio_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_tv_feature_ham_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_tv_feature_iotcon_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_tv_feature_location_batch}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_tv_feature_key_manager_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_tv_feature_media_controller_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_tv_feature_media_key_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_tv_feature_message_port_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_tv_feature_messaging_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_tv_feature_nbs_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_tv_feature_nfc_emulation_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_tv_feature_nfc_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_tv_feature_notification_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_tv_feature_package_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_tv_feature_player_util_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_tv_feature_power_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_tv_feature_preference_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_tv_feature_push_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_tv_feature_sap_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_tv_feature_sensor_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_tv_feature_se_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_tv_feature_sound_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_tv_feature_system_info_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_tv_feature_system_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_tv_feature_telephony_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_tv_feature_time_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_tv_feature_inputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_tv_feature_web_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_tv_feature_widget_service_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_tv_feature_wi_fi_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_tv_feature_tvinputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_tv_feature_convergence_support}"
+
+./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
+
+ninja -C out/Default %{?_smp_mflags}
+pushd out
+mv Default bin_tv
+popd
+
+%endif
+
+
+# Unified: common/ Others: its own profile
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=common -Dprivilege_engine=%{tizen_privilege_engine}"
+%else
 GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}"
+%endif
 GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
 GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
 
@@ -631,7 +963,24 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_feature_c
 
 ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
 
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
 ninja -C out/Default %{?_smp_mflags}
+pushd out
+mv Default bin_common
+ln -sf bin_common Default
+
+# IVI does not have independent configurations, yet.
+# Copying the whole result in order to support ivi subpacakge
+cp -R bin_common bin_ivi
+
+popd
+%else
+ninja -C out/Default %{?_smp_mflags}
+pushd out
+mv Default bin_%{?profile}
+ln -sf bin_%{?profile} Default
+popd
+%endif
 
 %install
 mkdir -p %{buildroot}/usr/share/license
@@ -641,7 +990,41 @@ cat LICENSE.MIT >> %{buildroot}/usr/share/license/%{name}
 
 # Extensions.
 mkdir -p %{buildroot}%{crosswalk_extensions_path}
-install -p -m 644 out/Default/libtizen*.so %{buildroot}%{crosswalk_extensions_path}
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "common"
+pushd out/bin_common
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.common"; done
+popd
+install -p -m 644 out/bin_common/libtizen*.so.common %{buildroot}%{crosswalk_extensions_path}
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile"
+pushd out/bin_mobile
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.mobile"; done
+popd
+install -p -m 644 out/bin_mobile/libtizen*.so.mobile %{buildroot}%{crosswalk_extensions_path}
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
+pushd out/bin_wearable
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.wearable"; done
+popd
+install -p -m 644 out/bin_wearable/libtizen*.so.wearable %{buildroot}%{crosswalk_extensions_path}
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
+pushd out/bin_tv
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.tv"; done
+popd
+install -p -m 644 out/bin_tv/libtizen*.so.tv %{buildroot}%{crosswalk_extensions_path}
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "ivi"
+pushd out/bin_ivi
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.ivi"; done
+popd
+install -p -m 644 out/bin_ivi/libtizen*.so.ivi %{buildroot}%{crosswalk_extensions_path}
+%endif
 
 # devel files
 mkdir -p %{buildroot}%{_libdir}/pkgconfig
@@ -672,11 +1055,75 @@ install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/plugins.
 
 
 %files
-%{crosswalk_extensions_path}/libtizen*.so
 %{crosswalk_extensions_path}/plugins.json
 %{_datadir}/license/%{name}
 %manifest webapi-plugins.manifest
 
+%if "%{?unified_build}" == "1" || "%{?profile}" == "common"
+%post profile_common
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so.common; do mv "${FILE}" "${FILE%.common}"; done
+popd
+%preun profile_common
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.common"; done
+popd
+%files profile_common
+%{crosswalk_extensions_path}/libtizen*.so.common
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile"
+%post profile_mobile
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so.mobile; do mv "${FILE}" "${FILE%.mobile}"; done
+popd
+%preun profile_mobile
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.mobile"; done
+popd
+%files profile_mobile
+%{crosswalk_extensions_path}/libtizen*.so.mobile
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
+%post profile_wearable
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so.wearable; do mv "${FILE}" "${FILE%.wearable}"; done
+popd
+%preun profile_wearable
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.wearable"; done
+popd
+%files profile_wearable
+%{crosswalk_extensions_path}/libtizen*.so.wearable
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
+%post profile_tv
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so.tv; do mv "${FILE}" "${FILE%.tv}"; done
+popd
+%preun profile_tv
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.tv"; done
+popd
+%files profile_tv
+%{crosswalk_extensions_path}/libtizen*.so.tv
+%endif
+
+%if "%{?unified_build}" == "1" || "%{?profile}" == "ivi"
+%post profile_ivi
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so.ivi; do mv "${FILE}" "${FILE%.ivi}"; done
+popd
+%preun profile_ivi
+pushd %{crosswalk_extensions_path}
+for FILE in libtizen*.so; do mv "${FILE}" "${FILE}.ivi"; done
+popd
+%files profile_ivi
+%{crosswalk_extensions_path}/libtizen*.so.ivi
+%endif
+
 %files devel
 %{_includedir}/*
 %{_libdir}/pkgconfig/*
index dc1135a..66eb77b 100644 (file)
@@ -25,6 +25,8 @@
           'variables': {
             'packages': [
               'capi-appfw-alarm',
+              'capi-appfw-app-control',
+              'capi-appfw-application',
             ]
           },
         }],
index 40b614f..7a222ba 100644 (file)
@@ -33,7 +33,8 @@
             'packages': [
               'aul',
               'capi-appfw-app-manager',
-              'capi-appfw-application',
+              'capi-appfw-app-control',
+              'capi-appfw-event',
               'capi-appfw-package-manager',
               'pkgmgr',
               'pkgmgr-info',
index 72eb206..8981306 100644 (file)
@@ -50,6 +50,7 @@
          'variables': {
             'packages': [
               'capi-network-bluetooth',
+              'capi-appfw-app-control',
               'capi-system-info',
               'libpcrecpp',
             ]
index 7f4e78e..64404f8 100644 (file)
@@ -68,7 +68,7 @@
           'variables': {
             'packages': [
               'capi-appfw-app-manager',
-              'capi-appfw-application',
+              'capi-appfw-app-common',
               'capi-appfw-package-manager',
               'storage',
               'security-privilege-manager',
index 4ad3807..c00109b 100644 (file)
@@ -412,7 +412,11 @@ common::TizenResult ConvergenceInstance::RemoteAppControlServiceLaunchAppControl
                                          static_cast<int>(ConvergenceUtils::GetArg(args, kJSCurrentListenerId).get<double>()));
     }
 
-    this->Post(token, result);
+    //only in case of failure call callback
+    //other cases are handled by conv_service_listener_cb()
+    if (!result) {
+      this->Post(token, result);
+    }
   };
 
   std::thread(launch_app_control, token).detach();
index cdd1716..23bb6b6 100644 (file)
@@ -128,6 +128,7 @@ TizenResult ConvergenceRemoteAppControlService::Disconnect() {
   }
 
   int error = conv_service_disconnect(service);
+
   if (CONV_ERROR_NONE != error) {
     return LogAndCreateTizenError(AbortError, "conv_service_disconnect [Fail]");
   } else {
index bbe9a7c..f14cac2 100644 (file)
@@ -97,6 +97,7 @@ common::TizenResult ConvergenceUtils::ConvertConvergenceError(int error) {
   }
 
   return common::TizenSuccess();
+
 }
 
 } // namespace convergence
index 25b02f9..79597cd 100644 (file)
@@ -34,7 +34,7 @@
             'packages': [
                 'capi-system-info',
                 'capi-network-nfc',
-                'capi-appfw-application'
+                'capi-appfw-app-control',
             ]
           },
         }],
index 9c219a8..35fc135 100755 (executable)
@@ -26,6 +26,7 @@
             'packages': [
               'notification',
               'capi-system-device',
+              'capi-appfw-app-control',
             ]
           },
         }],
index 13fe62c..c6d7bf3 100644 (file)
@@ -1144,9 +1144,9 @@ PlatformResult StatusNotification::ToJson(int id,
   return PlatformResult(ErrorCode::NO_ERROR);
 }
 
-PlatformResult StatusNotification::FromJson(const picojson::object& args,
-                                            bool is_update,
-                                            picojson::object* out_ptr) {
+PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& args,
+                                       bool is_update,
+                                       notification_h *noti_handle){
   LoggerD("Enter");
   picojson::object noti_obj =
       common::FromJson<picojson::object>(args, "notification");
@@ -1160,32 +1160,29 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
     return status;
 
   int id = NOTIFICATION_PRIV_ID_NONE;
-  int ret;
 
-  notification_h noti_handle = nullptr;
-  app_control_h app_control = NULL;
+  app_control_h app_control = nullptr;
 
   SCOPE_EXIT {
     if (app_control) {
       app_control_destroy(app_control);
     }
-    notification_free(noti_handle);
   };
 
   if (is_update) {
     id = std::stoi(common::FromJson<std::string>(noti_obj, "id"));
 
-    PlatformResult status = GetNotiHandle(id, &noti_handle);
+    PlatformResult status = GetNotiHandle(id, noti_handle);
     if (status.IsError())
       return status;
 
   } else {
-    status = Create(noti_type, &noti_handle);
+    status = Create(noti_type, noti_handle);
     if (status.IsError())
       return status;
   }
 
-  status = SetLayout(noti_handle, status_type);
+  status = SetLayout(*noti_handle, status_type);
   if (status.IsError()) {
     return status;
   }
@@ -1195,7 +1192,7 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
     const std::string& value_str = common::FromJson<std::string>(noti_obj, "iconPath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_ICON, real_path);
+    status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_ICON, real_path);
     if (status.IsError()) {
       return status;
     }
@@ -1206,7 +1203,7 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
         common::FromJson<std::string>(noti_obj, "subIconPath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_ICON_SUB, real_path);
+    status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_ICON_SUB, real_path);
     if (status.IsError()) {
       return status;
     }
@@ -1214,7 +1211,7 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
 
   if (val.contains("number") && !IsNull(noti_obj, "number")) {
     long number = (long)common::FromJson<double>(noti_obj, "number");
-    status = SetText(noti_handle, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, std::to_string(number));
+    status = SetText(*noti_handle, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, std::to_string(number));
     if (status.IsError()) {
       return status;
     }
@@ -1222,28 +1219,28 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
 
   if (val.contains("detailInfo") && !IsNull(noti_obj, "detailInfo")) {
     status = SetDetailInfos(
-        noti_handle, common::FromJson<picojson::array>(noti_obj, "detailInfo"));
+        *noti_handle, common::FromJson<picojson::array>(noti_obj, "detailInfo"));
     if (status.IsError()) {
       return status;
     }
   }
 
   if (val.contains("ledColor") && !IsNull(noti_obj, "ledColor")) {
-    status = SetLedColor(noti_handle,
+    status = SetLedColor(*noti_handle,
                          common::FromJson<std::string>(noti_obj, "ledColor"));
     if (status.IsError()) {
       return status;
     }
   }
 
-  status = SetLedOnPeriod(noti_handle,
+  status = SetLedOnPeriod(*noti_handle,
                           static_cast<unsigned long>(common::FromJson<double>(
                               noti_obj, "ledOnPeriod")));
   if (status.IsError()) {
     return status;
   }
 
-  status = SetLedOffPeriod(noti_handle,
+  status = SetLedOffPeriod(*noti_handle,
                            static_cast<unsigned long>(common::FromJson<double>(
                                noti_obj, "ledOffPeriod")));
   if (status.IsError()) {
@@ -1255,7 +1252,7 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
     const std::string& value_str = common::FromJson<std::string>(noti_obj, "backgroundImagePath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_BACKGROUND, real_path);
+    status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_BACKGROUND, real_path);
     if (status.IsError()) {
       return status;
     }
@@ -1263,7 +1260,7 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
 
   if (val.contains("thumbnails") && !IsNull(noti_obj, "thumbnails")) {
     status = SetThumbnails(
-        noti_handle, common::FromJson<picojson::array>(noti_obj, "thumbnails"));
+        *noti_handle, common::FromJson<picojson::array>(noti_obj, "thumbnails"));
     if (status.IsError()) {
       return status;
     }
@@ -1273,14 +1270,14 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
     const std::string& value_str = common::FromJson<std::string>(noti_obj, "soundPath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetSoundPath(noti_handle, real_path);
+    status = SetSoundPath(*noti_handle, real_path);
     if (status.IsError()) {
       return status;
     }
   }
 
   status =
-      SetVibration(noti_handle, common::FromJson<bool>(noti_obj, "vibration"));
+      SetVibration(*noti_handle, common::FromJson<bool>(noti_obj, "vibration"));
   if (status.IsError()) {
     return status;
   }
@@ -1309,14 +1306,14 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
 
   const std::string& progress_type =
       common::FromJson<std::string>(noti_obj, "progressType");
-  status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_LIST_5, progress_type);
+  status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_LIST_5, progress_type);
   if (status.IsError()) {
     return status;
   }
 
   if (val.contains("progressValue") && !IsNull(noti_obj, "progressValue")) {
     double progressValue = common::FromJson<double>(noti_obj, "progressValue");
-    status = SetProgressValue(noti_handle, progress_type, progressValue,
+    status = SetProgressValue(*noti_handle, progress_type, progressValue,
         is_update);
 
     if (status.IsError()) {
@@ -1324,7 +1321,7 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
     }
   }
 
-  status = SetText(noti_handle,
+  status = SetText(*noti_handle,
                    NOTIFICATION_TEXT_TYPE_TITLE,
                    common::FromJson<std::string>(noti_obj, "title"));
   if (status.IsError()) {
@@ -1332,7 +1329,7 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
   }
 
   if (val.contains("content") && !IsNull(noti_obj, "content")) {
-    status = SetText(noti_handle,
+    status = SetText(*noti_handle,
                      NOTIFICATION_TEXT_TYPE_CONTENT,
                      common::FromJson<std::string>(noti_obj, "content"));
     if (status.IsError()) {
@@ -1340,11 +1337,31 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
     }
   }
 
-  status = SetAppControl(noti_handle, app_control);
+  status = SetAppControl(*noti_handle, app_control);
+
+  return PlatformResult(ErrorCode::NO_ERROR);
+}
+
+PlatformResult StatusNotification::FromJson(const picojson::object& args,
+                                            bool is_update,
+                                            picojson::object* out_ptr) {
+  LoggerD("Enter");
+  notification_h noti_handle = nullptr;
+  int ret;
+  int id = NOTIFICATION_PRIV_ID_NONE;
+
+  SCOPE_EXIT {
+    notification_free(noti_handle);
+  };
+
+  PlatformResult status = GetNotiHandleFromJson(args, is_update, &noti_handle);
+
+  if (status.IsError()){
+    return status;
+  }
 
   if (is_update) {
     ret = notification_update(noti_handle);
-
   } else {
     ret = notification_insert(noti_handle, &id);
     if (NOTIFICATION_ERROR_NONE != ret) {
index ae50e8d..51aab91 100644 (file)
@@ -35,6 +35,9 @@ class StatusNotification {
                                        notification_h noti_handle,
                                        app_control_h app_handle,
                                        picojson::object* out_ptr);
+  static common::PlatformResult GetNotiHandleFromJson(const picojson::object& args,
+                                         bool is_update,
+                                         notification_h *noti_handle);
   static common::PlatformResult FromJson(const picojson::object& args,
                                          bool is_update,
                                          picojson::object* out_ptr);
index 0b5161b..eedd0f4 100644 (file)
@@ -22,7 +22,7 @@
         ['tizen == 1', {
           'variables': {
             'packages': [
-              'capi-appfw-application',
+              'capi-appfw-preference',
             ]
           },
         }],
index 5cdb2ad..6028465 100644 (file)
@@ -28,7 +28,7 @@
           'variables': {
             'packages': [
               'push',
-              'capi-appfw-application',
+              'capi-appfw-app-control',
               'libpcrecpp',
             ]
           },