Modify the package name for bluetooth-haltests
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
index 47d7764..4503076 100644 (file)
@@ -8,16 +8,17 @@
 
 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.3.0
 Release:    1
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1001: bluetooth-frwk.manifest
 
-%if "%{?profile}" != "mobile"
 Requires: bluetooth-tools
-%endif
+
+%define bt_bluez_hal ENABLED
+
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
@@ -29,9 +30,6 @@ BuildRequires:  pkgconfig(libxml-2.0)
 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)
 BuildRequires: pkgconfig(libsoup-2.4)
 BuildRequires:  pkgconfig(capi-network-tethering)
@@ -41,11 +39,12 @@ BuildRequires:  pkgconfig(cynara-creds-gdbus)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(storage)
 BuildRequires:  pkgconfig(capi-system-info)
+BuildRequires:  pkgconfig(capi-appfw-app-control)
+BuildRequires:  pkgconfig(gmock)
 
 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.
@@ -137,12 +136,20 @@ This package is Bluetooth Service daemon to manage BT services.
 
 %package httpproxy
 Summary:    Bluetooth HTTP Proxy Service daemon
-Group:      TO_BE/FILLED
+Group:      Network & Connectivity/Bluetooth
 Requires:   %{name} = %{version}-%{release}
 
 %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
@@ -159,6 +166,14 @@ Requires:   %{name} = %{version}-%{release}
 %description test
 This package is Bluetooth test application.
 
+%package oal
+Summary:    Bluetooth OAL
+Group:      Network & Connectivity/Bluetooth
+Requires:   %{name} = %{version}-%{release}
+
+%description oal
+This package is BT stack common interface.
+
 %package plugin-headed
 Summary:    Bluetooth plugin Headed
 Group:      Network & Connectivity/Bluetooth
@@ -167,6 +182,14 @@ Requires:   %{name} = %{version}-%{release}
 %description plugin-headed
 This package is Bluetooth plugin to manage UI and syspopup
 
+%package -n bluetooth-haltests
+Summary: HAL Test package for bluetooth OAL
+Group:   TO_BE/FILLED
+Requires: %{name} = %{version}-%{release}
+
+%description -n bluetooth-haltests
+This package is C-API test application.
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -174,11 +197,47 @@ cp %{SOURCE1001} .
 
 %build
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+export CFLAGS="$CFLAGS -DTIZEN_GATT_CLIENT"
+
+%define _servicefile packaging/bluetooth-frwk-common.service
+%define _servicedir starter.target.wants
+
+%if "%{?profile}" == "mobile"
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
+%if "%{?tizen_target_name}" == "TM1"
+%define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
+%else
+%define _servicefile packaging/bluetooth-frwk-mobile.service
+%endif
+%define _servicedir multi-user.target.wants
+%endif
+
+%if "%{?profile}" == "wearable"
+export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
+%define _servicefile packaging/bluetooth-frwk-wearable.service
+%define _servicedir multi-user.target.wants
+%endif
+
+%if "%{?profile}" == "tv"
+export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
+%define _servicefile packaging/bluetooth-frwk-tv.service
+%define _servicedir multi-user.target.wants
+%endif
+
+%if "%{?profile}" == "ivi"
+export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
+%define _servicefile packaging/bluetooth-frwk-wearable.service
+%define _servicedir multi-user.target.wants
+%endif
 
 %ifarch x86_64
-export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
+#export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
+export CFLAGS="$CFLAGS -fpie"
 export CFLAGS+=" -DARCH64"
 export CXXFLAGS+=" -DARCH64"
 export FFLAGS+=" -DARCH64"
@@ -187,14 +246,24 @@ export CFLAGS="$CFLAGS -fpie"
 export LDFLAGS="$CFLAGS -pie"
 %endif
 
+%if %{bt_bluez_hal} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
+%else
 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+%endif
 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
 
-%ifarch aarch64
-echo arch64
-export CFLAGS+=" -DARCH64"
-export CXXFLAGS+=" -DARCH64"
-export FFLAGS+=" -DARCH64"
+%ifarch %{ix86} x86_64
+export CFLAGS+=" -DTIZEN_TEST_EMUL"
+export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
+export FFLAGS+=" -DTIZEN_TEST_EMUL"
+%endif
+
+%if %{bt_bluez_hal} == ENABLED
+export BT_INCLUDE_OAL_BLUEZ=ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
+%else
+export BT_INCLUDE_OAL_BLUEZ=DISABLED
 %endif
 
 export CFLAGS_DEFAULT="$CFLAGS"
@@ -224,9 +293,9 @@ cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
 
 # 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"
+export CFLAGS="${CFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
 
 mkdir -p build_emulator
 
@@ -253,6 +322,13 @@ 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"
 
+%ifarch aarch64
+echo arch64
+export CFLAGS+=" -DARCH64"
+export CXXFLAGS+=" -DARCH64"
+export FFLAGS+=" -DARCH64"
+%endif
+
 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
 -DCMAKE_LIB_DIR=%{_libdir} \
 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
@@ -269,10 +345,14 @@ rm -rf %{buildroot}
 
 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
+
+cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
 
 # 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
@@ -297,11 +377,25 @@ install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/blue
 # common
 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
 
+# bt-core
+install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
+
+
 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
 
+%post core
+mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d
+ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-frwk-core.service
+ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+
 %postun -p /sbin/ldconfig
 
+%post service
+/usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
+/usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
+
 %files
 %manifest %{name}.manifest
 %license LICENSE
@@ -318,6 +412,8 @@ ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/blu
 %{_includedir}/bt-service/bluetooth-media-control.h
 %{_includedir}/bt-service/bluetooth-scmst-api.h
 %{_includedir}/bt-service/bluetooth-ipsp-api.h
+%{_includedir}/bt-service/bluetooth-gatt-server-api.h
+%{_includedir}/bt-service/bluetooth-gatt-client-api.h
 %{_libdir}/pkgconfig/bluetooth-api.pc
 %{_libdir}/libbluetooth-api.so
 
@@ -347,6 +443,7 @@ popd
 %{_bindir}/bluetooth-frwk-test
 %{_varlibdir}/bluetooth
 %{_prefix}/etc/bluetooth
+%attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
 
 %files httpproxy
 %manifest %{name}.manifest
@@ -356,21 +453,32 @@ popd
 %{_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)
+%{_unitdir}/bluetooth-frwk-core.service
 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
 %{_bindir}/bt-core
 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
+%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
 
 %files test
 %manifest %{name}.manifest
 %license LICENSE
 %defattr(-, root, root)
 %{_bindir}/bluetooth-frwk-test
-#{_bindir}/bluetooth-gatt-test
-#{_bindir}/bluetooth-advertising-test
+#%{_bindir}/bluetooth-gatt-test
+#%{_bindir}/bluetooth-advertising-test
 
 %files plugin-headed
 %manifest %{name}.manifest
@@ -388,7 +496,8 @@ mv bluetooth-frwk.service bluetooth-frwk.service.common
 popd
 %files profile_common
 %license LICENSE
-%{_unitdir}/starter.target.wants/bluetooth-frwk.service
+%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
+%exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
 %{_unitdir}/bluetooth-frwk.service.common
 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
 
@@ -478,6 +587,16 @@ popd
 %{_unitdir}/bluetooth-frwk.service.wearable
 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
 
-### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
-# (for PROFILE WEARABLE)
+%files oal
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_libdir}/libbt-oal.so*
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
 
+%if %{bt_bluez_hal} == ENABLED
+%{_libdir}/libbluetooth.default.so*
+%endif
+
+%files -n bluetooth-haltests
+%manifest %{name}.manifest
+%{_bindir}/bluetooth-haltests