Remove the obex unregister function
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
index b3b7c9c..2480195 100644 (file)
@@ -5,10 +5,11 @@
 %bcond_with x
 %define _dumpdir /opt/etc/dump.d/module.d
 %define _varlibdir /opt/var/lib
+%define _meshdir /opt/usr/mesh
 
 Name:       bluetooth-frwk
 Summary:    Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
-Version:    0.3.0
+Version:    0.6.0
 Release:    1
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
@@ -18,8 +19,16 @@ Source1001: bluetooth-frwk.manifest
 Requires: bluetooth-tools
 
 %define bt_bluez_hal ENABLED
+%define bt_gatt_client_fd ENABLED
+%define bt_permanent_log DISABLED
+%define bt_http_proxy DISABLED
+%define bt_factory_mode DISABLED
+%define bt_vendor_operation DISABLED
 
 BuildRequires:  pkgconfig(aul)
+%if %{bt_factory_mode} == ENABLED
+BuildRequires:  pkgconfig(bincfg)
+%endif
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(gio-2.0)
@@ -30,18 +39,23 @@ BuildRequires:  pkgconfig(libxml-2.0)
 BuildRequires:  pkgconfig(capi-network-connection)
 BuildRequires:  pkgconfig(alarm-service)
 BuildRequires:  pkgconfig(capi-content-mime-type)
-BuildRequires:  pkgconfig(pkgmgr)
-#BuildRequires:  pkgconfig(journal)
 BuildRequires:  pkgconfig(eventsystem)
+%if %{bt_http_proxy} == ENABLED
 BuildRequires: pkgconfig(libsoup-2.4)
+%endif
 BuildRequires:  pkgconfig(capi-network-tethering)
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-creds-gdbus)
 BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(json-c)
+BuildRequires:  pkgconfig(ell)
 BuildRequires:  pkgconfig(storage)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(capi-appfw-app-control)
+BuildRequires:  pkgconfig(gmock)
+BuildRequires:  pkgconfig(libactd)
+BuildRequires:  pkgconfig(libsystemd-daemon)
 
 Requires(post): /usr/bin/vconftool
 Requires(post): /sbin/ldconfig
@@ -49,7 +63,7 @@ Requires(postun): /sbin/ldconfig
 
 %description
 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
- This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
+This package contains API set for BT GAP, BT SDP, BT RFCOMM and BLE Mesh.
 
 %package profile_common
 Summary:    bluetooth-frwk service and conf files for common profile
@@ -135,6 +149,7 @@ Requires:   %{name} = %{version}-%{release}
 %description service
 This package is Bluetooth Service daemon to manage BT services.
 
+%if %{bt_http_proxy} == ENABLED
 %package httpproxy
 Summary:    Bluetooth HTTP Proxy Service daemon
 Group:      Network & Connectivity/Bluetooth
@@ -142,6 +157,7 @@ Requires:   %{name} = %{version}-%{release}
 
 %description httpproxy
 This package is Bluetooth HTTP Proxy Service daemon
+%endif
 
 %package otp
 Summary:    Bluetooth OTP Service daemon
@@ -183,6 +199,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} .
@@ -245,10 +269,24 @@ 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 %{ix86} x86_64
-export CFLAGS+=" -DTIZEN_TEST_EMUL"
-export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
-export FFLAGS+=" -DTIZEN_TEST_EMUL"
+%if %{bt_gatt_client_fd} == DISABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
+%endif
+
+%if %{bt_permanent_log} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PERMANENT_LOG"
+%endif
+
+%if %{bt_http_proxy} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HTTP_PROXY"
+%endif
+
+%if %{bt_factory_mode} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_FACTORY_MODE"
+%endif
+
+%if %{bt_vendor_operation} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_VENDOR_OPERATION"
 %endif
 
 %if %{bt_bluez_hal} == ENABLED
@@ -265,9 +303,9 @@ export FFLAGS_DEFAULT="$FFLAGS"
 # extension-TM1
 %ifarch %{ix86} || %{arm}
 mkdir -p tm1
-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"
+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} \
@@ -275,7 +313,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr \
 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
        -DLIBNOTIFY_SUPPORT=Off \
        -DLIBNOTIFICATION_SUPPORT=Off
-make
+make %{?_smp_mflags}
 
 %cmake
 
@@ -285,9 +323,9 @@ cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
 
 # extension-emulator
 %ifarch %{ix86} x86_64
-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"
+export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export CXXFLAGS="${CXXFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
+export FFLAGS="${FFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
 
 mkdir -p build_emulator
 
@@ -297,7 +335,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr \
 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
        -DLIBNOTIFY_SUPPORT=Off \
        -DLIBNOTIFICATION_SUPPORT=Off
-make
+make %{?_smp_mflags}
 
 %cmake
 
@@ -327,7 +365,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr \
 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
        -DLIBNOTIFY_SUPPORT=Off \
        -DLIBNOTIFICATION_SUPPORT=Off
-make
+make %{?_smp_mflags}
 
 %cmake
 
@@ -336,7 +374,12 @@ rm -rf %{buildroot}
 %make_install
 
 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
+mkdir -p %{buildroot}%{_unitdir}/delayed.target.wants
 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
+mkdir -p %{buildroot}%{_meshdir}
+
+cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
 
 # extension-emulator
 %ifarch %{ix86} x86_64
@@ -369,21 +412,15 @@ install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/
 # 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 5001:100 %{_varlibdir}/bluetooth/auto-pair-blacklist
+/usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
+/usr/bin/chown network_fw:network_fw %{_meshdir}
 
 %files
 %manifest %{name}.manifest
@@ -402,6 +439,8 @@ ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_sysconfdir}/syst
 %{_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
+%{_includedir}/bt-service/bluetooth-mesh-api.h
 %{_libdir}/pkgconfig/bluetooth-api.pc
 %{_libdir}/libbluetooth-api.so
 
@@ -431,8 +470,10 @@ popd
 %{_bindir}/bluetooth-frwk-test
 %{_varlibdir}/bluetooth
 %{_prefix}/etc/bluetooth
-%attr(-,owner,users) %{_varlibdir}/bluetooth/auto-pair-blacklist
+%{_meshdir}
+%attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
 
+%if %{bt_http_proxy} == ENABLED
 %files httpproxy
 %manifest %{name}.manifest
 %license LICENSE
@@ -440,7 +481,7 @@ popd
 %{_bindir}/bt-httpproxy
 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
-
+%endif
 
 %files otp
 %manifest %{name}.manifest
@@ -458,6 +499,7 @@ popd
 %{_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
@@ -483,7 +525,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
 
@@ -575,9 +618,14 @@ popd
 
 %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
-%manifest %{name}.manifest
 %{_libdir}/libbluetooth.default.so*
 %endif
+
+%files -n bluetooth-haltests
+%manifest %{name}.manifest
+%{_bindir}/bluetooth-haltests