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
-%else
-# I586
-%define tizen_is_emulator 1
-%endif
-
-%ifarch aarch64
-# 64bit
-%define tizen_is_arm64 1
-%else
-# 32bit
-%define tizen_is_arm64 0
-%endif
-
####################################################################
# Common Profile : artik #
####################################################################
%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_mobile_feature_bluetooth_support 0
-%else
%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_feedback_support 1
%define tizen_mobile_feature_filesystem_support 1
-# FM radio feature
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_fm_radio_support 1
-%else
-%if 0%{?tizen_is_arm64}
+%ifarch aarch64
%define tizen_mobile_feature_fm_radio_support 0
%else
%define tizen_mobile_feature_fm_radio_support 1
%endif
-%endif
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_ham_support 1
-%else
%define tizen_mobile_feature_ham_support 0
-%endif
+
%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_mobile_feature_media_key_support 0
-%else
+
%define tizen_mobile_feature_media_key_support 1
-%endif
+
%define tizen_mobile_feature_message_port_support 1
%define tizen_mobile_feature_messaging_support 1
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_nfc_emulation_support 0
-%define tizen_mobile_feature_nfc_support 1
-%else
%define tizen_mobile_feature_nfc_emulation_support 0
%define tizen_mobile_feature_nfc_support 0
-%endif
+
%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_push_support 1
# secure element feature
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_se_support 0
-%else
-%if 0%{?tizen_is_arm64}
+%ifarch aarch64
%define tizen_mobile_feature_se_support 0
%else
%define tizen_mobile_feature_se_support 1
%endif
-%endif
%define tizen_mobile_feature_sensor_support 1
%define tizen_mobile_feature_sound_support 1
%define tizen_mobile_feature_system_setting_support 1
# telephony feature
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_telephony_support 1
-%else
-%if 0%{?tizen_is_arm64}
+%ifarch aarch64
%define tizen_mobile_feature_telephony_support 0
+%define tizen_mobile_feature_callhistory_support 0
+%define tizen_mobile_feature_nbs_support 0
%else
%define tizen_mobile_feature_telephony_support 1
-%endif
+%define tizen_mobile_feature_callhistory_support 1
+%define tizen_mobile_feature_nbs_support 1
%endif
%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_mobile_feature_wi_fi_support 0
-%else
+
%define tizen_mobile_feature_wi_fi_support 1
-%endif
-%define tizen_mobile_feature_inputdevice_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_mobile_feature_callhistory_support 0
-%define tizen_mobile_feature_nbs_support 0
-%endif
+%define tizen_mobile_feature_inputdevice_support 1
%define tizen_mobile_feature_tvinputdevice_support 0
# Badge API is mandatory in Tizen Wearable Profile.
%define tizen_wearable_feature_badge_support 1
-%if 0%{?tizen_is_emulator}
-%define tizen_wearable_feature_bluetooth_support 0
-%else
%define tizen_wearable_feature_bluetooth_support 1
-%endif
# Bookmark API is optional in Tizen Wearable Profile.
%define tizen_wearable_feature_bookmark_support 0
# 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_wearable_feature_media_key_support 0
-%else
%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_power_support 1
%define tizen_wearable_feature_preference_support 1
%define tizen_wearable_feature_push_support 1
-%if 0%{?tizen_is_emulator}
-%define tizen_wearable_feature_se_support 0
-%else
%define tizen_wearable_feature_se_support 1
-%endif
%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_wearable_feature_telephony_support 1
-%else
+
+#- telephony related APIs
+# CallHistory API is optional in Tizen Wearable Profile.
+# NetworkBearerSelection API is optional in Tizen Wearable Profile.
%define tizen_wearable_feature_telephony_support 0
-%endif
+%define tizen_wearable_feature_callhistory_support 0
+%define tizen_wearable_feature_nbs_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_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_wearable_feature_telephony_support}
-%define tizen_wearable_feature_callhistory_support 1
-%define tizen_wearable_feature_nbs_support 1
-%else
-%define tizen_wearable_feature_callhistory_support 0
-%define tizen_wearable_feature_nbs_support 0
-%endif
-
%define tizen_wearable_feature_convergence_support 1
%define tizen_feature_convergence_support %{expand:%tizen_%{?profile}_feature_convergence_support}
%endif
-
BuildRequires: pkgconfig(security-privilege-manager)
BuildRequires: ninja
BuildRequires: pkgconfig(appcore-common)
%description profile_mobile
Tizen Web API implementation binaries for Tizen mobile profile.
+%ifarch %{ix86} x86_64
+%package mobile-extension-emulator
+Summary: webapi-plugin binaries for mobile emulator
+Requires: %{name}-profile_mobile = %{version}-%{release}
+%description mobile-extension-emulator
+Tizen Web API implementation binaries for Tizen mobile emulator.
+%endif
+
%package profile_wearable
Summary: webapi-plugin binaries for wearable profile
Provides: %{name}-compat = %{version}-%{release}
%description profile_wearable
Tizen Web API implementation binaries for Tizen wearable profile.
+%ifarch %{ix86} x86_64
+%package wearable-extension-emulator
+Summary: webapi-plugin binaries for wearable emulator
+Requires: %{name}-profile_wearable = %{version}-%{release}
+%description wearable-extension-emulator
+Tizen Web API implementation binaries for Tizen wearable emulator.
+%endif
+
%package profile_tv
Summary: webapi-plugin binaries for tv profile
Provides: %{name}-compat = %{version}-%{release}
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}"
mv Default bin_mobile
popd
+# mobile-extension-emulator
+%ifarch %{ix86} x86_64
+
+%define tizen_mobile_feature_bluetooth_support 0
+
+# FM radio feature
+%define tizen_mobile_feature_fm_radio_support 1
+
+%define tizen_mobile_feature_ham_support 1
+%define tizen_mobile_feature_media_key_support 0
+%define tizen_mobile_feature_nfc_emulation_support 0
+%define tizen_mobile_feature_nfc_support 1
+
+# secure element feature
+%define tizen_mobile_feature_se_support 0
+
+# telephony feature
+%define tizen_mobile_feature_telephony_support 1
+%define tizen_mobile_feature_callhistory_support 1
+%define tizen_mobile_feature_nbs_support 1
+
+%define tizen_mobile_feature_wi_fi_support 0
+
+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_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_emulator
+popd
+%endif
+
# 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}"
mv Default bin_wearable
popd
+# wearable-extension-emulator
+%ifarch %{ix86} x86_64
+
+%define tizen_wearable_feature_bluetooth_support 0
+
+# MediayKey API is optional in Tizen Wearable Profile.
+# tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API
+%define tizen_wearable_feature_media_key_support 0
+
+#- telephony related APIs
+# CallHistory API is optional in Tizen Wearable Profile.
+# NetworkBearerSelection API is optional in Tizen Wearable Profile.
+%define tizen_wearable_feature_se_support 0
+%define tizen_wearable_feature_telephony_support 1
+%define tizen_wearable_feature_callhistory_support 1
+%define tizen_wearable_feature_nbs_support 1
+
+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_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_emulator
+popd
+%endif
+
# 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}"
%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}"
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_feature_account_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_feature_alarm_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_feature_app_control_settings_support}"
# temporary plugins description for lazy loading
install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile/plugins.json
-%endif
+
+# mobile-extension-emulator
+%ifarch %{ix86} x86_64
+mkdir -p %{buildroot}%{crosswalk_extensions_path}/mobile_emulator
+install -p -m 644 out/bin_mobile_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/mobile_emulator
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \
+ %{crosswalk_extensions_path}/mobile_emulator \
+ %{buildroot}%{crosswalk_extensions_path}/mobile_emulator > plugins.json
+
+# temporary plugins description for lazy loading
+install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile_emulator/plugins.json
+%endif // mobile-extension-emulator
+
+%endif // mobile
%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable
# temporary plugins description for lazy loading
install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable/plugins.json
-%endif
+
+# wearable-extension-emulator
+%ifarch %{ix86} x86_64
+mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable_emulator
+install -p -m 644 out/bin_wearable_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/wearable_emulator
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \
+ %{crosswalk_extensions_path}/wearable_emulator \
+ %{buildroot}%{crosswalk_extensions_path}/wearable_emulator > plugins.json
+
+# temporary plugins description for lazy loading
+install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable_emulator/plugins.json
+%endif // wearable-extension-emulator
+
+%endif // wearable
%if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
mkdir -p %{buildroot}%{crosswalk_extensions_path}/tv
%{crosswalk_extensions_path}/mobile/libtizen*.so
%{crosswalk_extensions_path}/mobile/plugins.json
%manifest webapi-plugins.manifest
-%endif
+
+# mobile-extension-emulator
+%ifarch %{ix86} x86_64
+%post mobile-extension-emulator
+ln -sf %{crosswalk_extensions_path}/mobile_emulator/* %{crosswalk_extensions_path}
+%preun mobile-extension-emulator
+# This is an un-installation.
+if [ "$1" == "0" ]; then
+ rm %{crosswalk_extensions_path}/libtizen*.so
+ rm %{crosswalk_extensions_path}/plugins.json
+fi
+%files mobile-extension-emulator
+%dir %{crosswalk_extensions_path}/mobile_emulator/
+%{crosswalk_extensions_path}/mobile_emulator/libtizen*.so
+%{crosswalk_extensions_path}/mobile_emulator/plugins.json
+%manifest webapi-plugins.manifest
+%endif // mobile-extension-emulator
+%endif // mobile
%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
%post profile_wearable
%{crosswalk_extensions_path}/wearable/libtizen*.so
%{crosswalk_extensions_path}/wearable/plugins.json
%manifest webapi-plugins.manifest
-%endif
+
+# wearable-extension-emulator
+%ifarch %{ix86} x86_64
+%post wearable-extension-emulator
+ln -sf %{crosswalk_extensions_path}/wearable_emulator/* %{crosswalk_extensions_path}
+%preun wearable-extension-emulator
+# This is an un-installation.
+if [ "$1" == "0" ]; then
+ rm %{crosswalk_extensions_path}/libtizen*.so
+ rm %{crosswalk_extensions_path}/plugins.json
+fi
+%files wearable-extension-emulator
+%dir %{crosswalk_extensions_path}/wearable_emulator/
+%{crosswalk_extensions_path}/wearable_emulator/libtizen*.so
+%{crosswalk_extensions_path}/wearable_emulator/plugins.json
+%manifest webapi-plugins.manifest
+%endif // wearable-extension-emulator
+%endif // wearable
%if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
%post profile_tv