Handle bluetooth-meshd life cycle
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
index 7d2e857..6db9d7e 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.4.0
 Release:    1
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
@@ -18,9 +19,17 @@ Source1001: bluetooth-frwk.manifest
 Requires: bluetooth-tools
 
 %define bt_bluez_hal ENABLED
-%define bt_gatt_client_fd DISABLED
+%define bt_gatt_client_fd ENABLED
+%define bt_permanent_log DISABLED
+%define bt_http_proxy DISABLED
+%define bt_factory_mode DISABLED
+%define bt_avc_target ENABLED
+%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)
@@ -32,16 +41,22 @@ BuildRequires:  pkgconfig(capi-network-connection)
 BuildRequires:  pkgconfig(alarm-service)
 BuildRequires:  pkgconfig(capi-content-mime-type)
 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 +64,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 +150,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 +158,7 @@ Requires:   %{name} = %{version}-%{release}
 
 %description httpproxy
 This package is Bluetooth HTTP Proxy Service daemon
+%endif
 
 %package otp
 Summary:    Bluetooth OTP Service daemon
@@ -204,6 +221,7 @@ 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"
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_ACTD"
 
 %define _servicefile packaging/bluetooth-frwk-common.service
 %define _servicedir starter.target.wants
@@ -258,6 +276,27 @@ export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-
 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_avc_target} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_AVC_TARGET"
+%endif
+
+%if %{bt_vendor_operation} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_VENDOR_OPERATION"
+%endif
+
+
 %ifarch %{ix86} x86_64
 export CFLAGS+=" -DTIZEN_TEST_EMUL"
 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
@@ -288,7 +327,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
 
@@ -310,7 +349,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
 
@@ -340,7 +379,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
 
@@ -349,8 +388,10 @@ 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
 
@@ -385,21 +426,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 network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
+/usr/bin/chown network_fw:network_fw %{_meshdir}
 
 %files
 %manifest %{name}.manifest
@@ -419,6 +454,7 @@ ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_sysconfdir}/syst
 %{_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
 
@@ -448,8 +484,10 @@ popd
 %{_bindir}/bluetooth-frwk-test
 %{_varlibdir}/bluetooth
 %{_prefix}/etc/bluetooth
+%{_meshdir}
 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
 
+%if %{bt_http_proxy} == ENABLED
 %files httpproxy
 %manifest %{name}.manifest
 %license LICENSE
@@ -457,7 +495,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