+# Do not create provides from emulator .so files because the main package
+# should anchor any reverse-dependencies
+%global __provides_exclude_from ^(.*\\.emulator)$
+
%bcond_with x
%define _dumpdir /opt/etc/dump.d/module.d
%define _varlibdir /opt/var/lib
Name: bluetooth-frwk
Summary: Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
-Version: 0.2.157
+Version: 0.2.158
Release: 1
Group: Network & Connectivity/Bluetooth
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: bluetooth-frwk.manifest
-Requires: syspopup
%if "%{?profile}" != "mobile"
Requires: bluetooth-tools
%endif
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(alarm-service)
BuildRequires: pkgconfig(capi-content-mime-type)
-BuildRequires: pkgconfig(appcore-efl)
BuildRequires: pkgconfig(pkgmgr)
#BuildRequires: pkgconfig(journal)
BuildRequires: pkgconfig(eventsystem)
Requires(post): /usr/bin/vconftool
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
-Requires: psmisc
%description
Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
%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
%description httpproxy
This package is Bluetooth HTTP Proxy Service daemon
+%package otp
+Summary: Bluetooth OTP Service daemon
+Group: Network & Connectivity/Bluetooth
+Requires: %{name} = %{version}-%{release}
+
+%description otp
+This package is Bluetooth OTP Service daemon
+
%package core
Summary: Bluetooth Core daemon
Group: Network & Connectivity/Bluetooth
%description test
This package is Bluetooth test application.
+%package plugin-headed
+Summary: Bluetooth plugin Headed
+Group: Network & Connectivity/Bluetooth
+Requires: %{name} = %{version}-%{release}
+
+%description plugin-headed
+This package is Bluetooth plugin to manage UI and syspopup
+
%prep
%setup -q
cp %{SOURCE1001} .
%ifarch x86_64
export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
+export CFLAGS+=" -DARCH64"
+export CXXFLAGS+=" -DARCH64"
+export FFLAGS+=" -DARCH64"
%else
export CFLAGS="$CFLAGS -fpie"
export LDFLAGS="$CFLAGS -pie"
%endif
+%ifarch %{ix86} x86_64
+export CFLAGS+=" -DTIZEN_TEST_EMUL"
+export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
+export FFLAGS+=" -DTIZEN_TEST_EMUL"
+%endif
+
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"
# extension-TM1
%ifarch %{ix86} || %{arm}
mkdir -p tm1
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
-export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
-export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
+export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
cmake . -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_LIB_DIR=%{_libdir} \
cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
%endif
-# non-extension-TM1
-export CFLAGS="$CFLAGS_DEFAULT"
-export CXXFLAGS="$CXXFLAGS_DEFAULT"
-export FFLAGS="$FFLAGS_DEFAULT"
+# extension-emulator
+%ifarch %{ix86} x86_64
+export CFLAGS="${CFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export CXXFLAGS="${CXXFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export FFLAGS="${FFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+
+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 -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
cmake . -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_LIB_DIR=%{_libdir} \
rm -rf %{buildroot}
%make_install
-install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
-install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
-install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-httpproxy
-install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
-
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}/
+mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
+%endif
+
# Rename the postfix (.mobile, .tv, ..) at post script
# mobile
install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
%files
%manifest %{name}.manifest
+%license LICENSE
%defattr(-, root, root)
%{_libdir}/libbluetooth-api.so.*
-%{_datadir}/license/bluetooth-frwk
+%exclude %{_libdir}/libbluetooth-api.so*.emulator
%files devel
%defattr(-, root, root)
%{_includedir}/bt-service/bluetooth-ipsp-api.h
%{_libdir}/pkgconfig/bluetooth-api.pc
%{_libdir}/libbluetooth-api.so
-%{_datadir}/license/bluetooth-frwk-devel
+
+# 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
%defattr(-, root, root)
%{_bindir}/bt-service
%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
%{_bindir}/bluetooth-frwk-test
%{_varlibdir}/bluetooth
%{_prefix}/etc/bluetooth
-%{_datadir}/license/bluetooth-frwk-service
%files httpproxy
%manifest %{name}.manifest
+%license LICENSE
%defattr(-, root, root)
%{_bindir}/bt-httpproxy
-%{_datadir}/license/bluetooth-frwk-httpproxy
%{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
+
+%files otp
+%manifest %{name}.manifest
+%license LICENSE
+%defattr(-, root, root)
+%{_bindir}/bt-otp
+%{_datadir}/dbus-1/system-services/org.projectx.otp.service
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
+
%files core
%manifest %{name}.manifest
+%license LICENSE
%defattr(-, root, root)
%{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
%{_bindir}/bt-core
%files test
%manifest %{name}.manifest
+%license LICENSE
%defattr(-, root, root)
%{_bindir}/bluetooth-frwk-test
#{_bindir}/bluetooth-gatt-test
#{_bindir}/bluetooth-advertising-test
+%files plugin-headed
+%manifest %{name}.manifest
+%license LICENSE
+%defattr(-, root, root)
+%{_libdir}/bt-plugin-headed.so
+
%post profile_common
pushd %{_unitdir}
mv bluetooth-frwk.service.common bluetooth-frwk.service
mv bluetooth-frwk.service bluetooth-frwk.service.common
popd
%files profile_common
+%license LICENSE
%{_unitdir}/starter.target.wants/bluetooth-frwk.service
%{_unitdir}/bluetooth-frwk.service.common
%{_datadir}/dbus-1/system-services/org.projectx.bt.service
mv bluetooth-frwk.service bluetooth-frwk.service.mobile
popd
%files profile_mobile
+%license LICENSE
%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
%{_unitdir}/bluetooth-frwk.service.mobile
%{_datadir}/dbus-1/system-services/org.projectx.bt.service
popd
%files extension-TM1
%{_unitdir}/bluetooth-frwk.service.tm1
+%license LICENSE
%defattr(-, root, root)
%{_bindir}/bt-core.tm1
%endif
mv bluetooth-frwk.service bluetooth-frwk.service.wearable
popd
%files profile_wearable
+%license LICENSE
%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
%{_unitdir}/bluetooth-frwk.service.wearable
%{_datadir}/dbus-1/system-services/org.projectx.bt.service
mv bluetooth-frwk.service bluetooth-frwk.service.tv
popd
%files profile_tv
+%license LICENSE
%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
%{_unitdir}/bluetooth-frwk.service.tv
%{_datadir}/dbus-1/system-services/org.projectx.bt.service
mv org.projectx.bt.service org.projectx.bt.service.ivi
popd
%files profile_ivi
+%license LICENSE
%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
%{_unitdir}/bluetooth-frwk.service.wearable
%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi