Add the bluez extension packages for BREDR / LE only mode 14/140114/1 submit/tizen/20170724.025554
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 24 Jul 2017 02:31:55 +0000 (11:31 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 24 Jul 2017 02:31:55 +0000 (11:31 +0900)
Without extension package bluetoothd will be installed for normal
mode. So there is no side effect to the original image.

Change-Id: I2e649c8e170248506dfd0b9547ffe3f6b658bb76
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Makefile.plugins
configure.ac
packaging/bluez.spec

index d0b81d0..d2a9a2a 100755 (executable)
@@ -16,9 +16,11 @@ builtin_modules += policy
 builtin_sources += plugins/policy.c
 
 #ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+if TIZEN_BREDR_PLUGIN
 builtin_modules += dbusoob
 builtin_sources += plugins/dbusoob.c \
                        src/oob.h src/oob.c
+endif
 #endif
 
 if MAINTAINER_MODE
@@ -26,6 +28,7 @@ builtin_modules += gatt_example
 builtin_sources += plugins/gatt-example.c
 endif
 
+if TIZEN_BREDR_PLUGIN
 if EXPERIMENTAL
 if TIZEN_UNUSED_PLUGIN
 builtin_modules += neard
@@ -65,6 +68,7 @@ builtin_sources += profiles/network/manager.c \
                        profiles/network/server.h profiles/network/server.c \
                        profiles/network/connection.h \
                        profiles/network/connection.c
+endif
 
 #if WEARABLE
 #builtin_modules +=
index af589ab..b7b8d0e 100755 (executable)
@@ -291,6 +291,14 @@ AC_ARG_ENABLE(sap, AC_HELP_STRING([--enable-sap],
                        [Enable SAP Plugin]), [enable_sap=${enableval}])
 AM_CONDITIONAL(TIZEN_SAP_PLUGIN, test "${enable_sap}" = "yes")
 
+AC_ARG_ENABLE(bredr, AC_HELP_STRING([--enable-bredr],
+                       [Enable BREDR Plugin]), [enable_bredr=${enableval}])
+AM_CONDITIONAL(TIZEN_BREDR_PLUGIN, test "${enable_bredr}" = "yes")
+
+AC_ARG_ENABLE(le, AC_HELP_STRING([--enable-le],
+                       [Enable LE Plugin]), [enable_le=${enableval}])
+AM_CONDITIONAL(TIZEN_LE_PLUGIN, test "${enable_le}" = "yes")
+
 # End of TIZEN_FEATURE_BLUEZ_MODIFY
 
 AC_ARG_ENABLE(deprecated, AC_HELP_STRING([--enable-deprecated],
index c1575fc..77af7a7 100755 (executable)
@@ -67,6 +67,18 @@ Requires:       libbluetooth = %{version}
 Files needed to develop applications for the BlueZ Bluetooth protocol
 stack.
 
+%package extension-bredr
+Summary:    Bluez extension for BREDR functionality
+Conflicts:  %{name}-extension-le = %{version}-%{release}
+%description extension-bredr
+Bluez extension for BREDR functionality
+
+%package extension-le
+Summary:    Bluez extension for LE functionality
+Conflicts:  %{name}-extension-bredr = %{version}-%{release}
+%description extension-le
+Bluez extension for LE functionality
+
 %package -n libbluetooth
 Summary:        Bluetooth Libraries
 License:        GPL-2.0+
@@ -139,12 +151,105 @@ autoreconf -fiv
 # TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY: only in src/device.c ==> RUNTIME! (profile.h)
 #endif
 
+
+# For LE only
+
 export LDFLAGS=" -lncurses -Wl,--as-needed "
 export CFLAGS+=" -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET"
 export CFLAGS_DEFAULT="$CFLAGS"
 
-# TIZEN_FEATURE_BLUEZ_SPRD_QOS: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
-# TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN: src/adapter.c ==> RUNTIME! (profile.h)
+export CFLAGS="$CFLAGS_DEFAULT"
+
+%reconfigure --disable-static \
+                       --sysconfdir=%{_sysconfdir} \
+                       --localstatedir=%{_localstatedir} \
+                       --with-systemdsystemunitdir=%{_libpath}/systemd/system \
+                       --with-systemduserunitdir=%{_libpath}/systemd/user \
+                       --libexecdir=%{_libexecdir} \
+                       --enable-debug \
+                       --enable-pie \
+                       --enable-serial \
+                       --enable-usb=no \
+                       --enable-tools \
+                       --disable-bccmd \
+                       --enable-pcmcia=no \
+                       --enable-hid2hci=no \
+                       --enable-alsa=no \
+                       --enable-gstreamer=no \
+                       --disable-dfutool \
+                       --disable-cups \
+                       --enable-proximity=yes \
+                       --enable-tds=yes \
+                       --enable-dbusoob \
+                       --enable-test \
+                       --with-telephony=tizen \
+                       --enable-obex \
+                       --enable-library \
+                       --enable-gatt \
+                       --enable-experimental \
+                       --enable-autopair=no \
+                       --enable-tizenunusedplugin=no
+
+make %{?_smp_mflags} all V=1
+
+mkdir -p le
+
+%make_install
+cp -a  %{buildroot}%{_libexecdir}/bluetooth/bluetoothd le/
+
+
+# For BREDR only
+
+export LDFLAGS=" -lncurses -Wl,--as-needed "
+export CFLAGS+=" -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET"
+export CFLAGS_DEFAULT="$CFLAGS"
+
+export CFLAGS="$CFLAGS_DEFAULT"
+
+%reconfigure --disable-static \
+                       --sysconfdir=%{_sysconfdir} \
+                       --localstatedir=%{_localstatedir} \
+                       --with-systemdsystemunitdir=%{_libpath}/systemd/system \
+                       --with-systemduserunitdir=%{_libpath}/systemd/user \
+                       --libexecdir=%{_libexecdir} \
+                       --enable-debug \
+                       --enable-pie \
+                       --enable-serial \
+                       --enable-input \
+                       --enable-usb=no \
+                       --enable-tools \
+                       --disable-bccmd \
+                       --enable-pcmcia=no \
+                       --enable-hid2hci=no \
+                       --enable-alsa=no \
+                       --enable-gstreamer=no \
+                       --disable-dfutool \
+                       --disable-cups \
+                       --enable-health=yes \
+                       --enable-dbusoob \
+                       --enable-test \
+                       --with-telephony=tizen \
+                       --enable-obex \
+                       --enable-library \
+                       --enable-experimental \
+                       --enable-autopair=no \
+                       --enable-hid=yes \
+                       --enable-bredr=yes \
+                       --enable-tizenunusedplugin=no
+
+make %{?_smp_mflags} all V=1
+
+mkdir -p bredr
+
+%make_install
+cp -a  %{buildroot}%{_libexecdir}/bluetooth/bluetoothd bredr/
+
+
+# For BREDR + LE
+
+export LDFLAGS=" -lncurses -Wl,--as-needed "
+export CFLAGS+=" -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET"
+export CFLAGS_DEFAULT="$CFLAGS"
 
 export CFLAGS="$CFLAGS_DEFAULT"
 
@@ -178,17 +283,9 @@ export CFLAGS="$CFLAGS_DEFAULT"
                        --enable-gatt \
                        --enable-experimental \
                        --enable-autopair=no \
-%if "%{?profile}" == "wearable"
-                        --enable-wearable \
-%endif
                        --enable-hid=yes \
+                       --enable-bredr=yes \
                        --enable-tizenunusedplugin=no
-# The if/endif for wearable above if only for PRODUCT optimization
-
-# enable-wearable disables "TIZEN_HID_PLUGIN / TIZEN_UNUSED_PLUGIN" (input / hog)
-# TIZEN_UNUSED_PLUGIN is "no" regardless of enable-wearable.
-# TIZEN_HID_PLUGIN only matters.
-# enable-network is not used in configure.
 
 make %{?_smp_mflags} all V=1
 
@@ -198,6 +295,15 @@ make check
 %install
 %make_install
 
+pushd bredr
+for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.bredr"; done
+popd
+
+pushd le
+for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.le"; done
+popd
+
+
 # bluez-test
 rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
 #install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
@@ -246,6 +352,18 @@ cp -f packaging/500.bluez_upgrade.sh %{buildroot}%{upgrade_script_path}
 
 %postun -n libbluetooth -p /sbin/ldconfig
 
+%post -n bluez-extension-bredr
+pushd %{_libexecdir}/bluetooth
+for FILE in bluetoothd.bredr; do mv "$FILE" "${FILE%.bredr}"; done
+popd
+/sbin/ldconfig
+
+%post -n bluez-extension-le
+pushd %{_libexecdir}/bluetooth
+for FILE in bluetoothd.le; do mv "$FILE" "${FILE%.le}"; done
+popd
+/sbin/ldconfig
+
 %files
 %manifest %{name}.manifest
 %defattr(-, root, root)
@@ -267,12 +385,24 @@ cp -f packaging/500.bluez_upgrade.sh %{buildroot}%{upgrade_script_path}
 %{_bindir}/hciattach
 %{_bindir}/hciconfig
 %{_libexecdir}/bluetooth/bluetoothd
+%exclude %{_libexecdir}/bluetooth/bluetoothd.bredr
+%exclude %{_libexecdir}/bluetooth/bluetoothd.le
 %{_bindir}/bccmd
 #%{_sbindir}/hid2hci
 %dir /usr/lib/udev
 /usr/lib/udev/*
 %{upgrade_script_path}/500.bluez_upgrade.sh
 
+%files -n bluez-extension-bredr
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_libexecdir}/bluetooth/bluetoothd.bredr
+
+%files -n bluez-extension-le
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_libexecdir}/bluetooth/bluetoothd.le
+
 #test -2
 %exclude /%{_libpath}/systemd/system/bluetooth.service
 %exclude %{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service
@@ -283,8 +413,6 @@ cp -f packaging/500.bluez_upgrade.sh %{buildroot}%{upgrade_script_path}
 %config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
 
 
-
-
 %files devel
 %manifest %{name}.manifest
 %defattr(-, root, root)