%description profile_ivi
Bluetooth framework configuration and service files for Tizen ivi profile
+%ifarch %{ix86} x86_64
+%package extension-emulator
+Summary: bluetooth-frwk service and conf files for emulator
+Requires: %{name} = %{version}-%{release}
+%description extension-emulator
+bluetooth-frwk service and conf files for emulator
+%endif // ifarch %{ix86} x86_64
+
%package devel
Summary: Bluetooth framework for BlueZ and Obexd
Group: Development/Libraries
export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
-%if "%{?_with_emulator}" == "1"
-export CFLAGS="$CFLAGS -DTIZEN_TEST_EMUL"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_TEST_EMUL"
-export FFLAGS="$FFLAGS -DTIZEN_TEST_EMUL"
-%endif
-
%ifarch aarch64
echo arch64
export CFLAGS+=" -DARCH64"
cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
%endif
-# non-extension-TM1
+# extension-emulator
+%ifarch %{ix86} x86_64
+export CFLAGS="${CFLAGS_BASE} -DTIZEN_TEST_EMUL"
+export CXXFLAGS="${CXXFLAGS_BASE} -DTIZEN_TEST_EMUL"
+export FFLAGS="${FFLAGS_BASE} -DTIZEN_TEST_EMUL"
+
+mkdir -p build_emulator
+
+cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+-DCMAKE_LIB_DIR=%{_libdir} \
+-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
+-DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
+ -DLIBNOTIFY_SUPPORT=Off \
+ -DLIBNOTIFICATION_SUPPORT=Off
+make
+
+%cmake
+
+%make_install
+cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
+pushd build_emulator/
+for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
+popd
+%endif
+
+# non-extension-TM1 / non-extension-emulator
+
export CFLAGS="$CFLAGS_DEFAULT"
export CXXFLAGS="$CXXFLAGS_DEFAULT"
export FFLAGS="$FFLAGS_DEFAULT"
mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+# extension-emulator
+%ifarch %{ix86} x86_64
+cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
+%endif
+
# Rename the postfix (.mobile, .tv, ..) at post script
# mobile
install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
%license LICENSE
%defattr(-, root, root)
%{_libdir}/libbluetooth-api.so.*
+%exclude %{_libdir}/libbluetooth-api.so*.emulator
%files devel
%defattr(-, root, root)
%{_libdir}/pkgconfig/bluetooth-api.pc
%{_libdir}/libbluetooth-api.so
+# extension-emulator
+%ifarch %{ix86} x86_64
+%post extension-emulator
+pushd %{_libdir}
+for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
+popd
+%preun extension-emulator
+pushd %{_libdir}
+for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
+popd
+%files extension-emulator
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_libdir}/libbluetooth-api.so.*.emulator
+%{_libdir}/libbluetooth-api.so.emulator
+%endif
+
%files service
%manifest %{name}.manifest
%license LICENSE