1 # Do not create provides fro extension-tm1 because the main package
2 # should anchor any reverse-dependencies
3 %global __provides_exclude_from ^(.*\\.tm1)$
5 #%define __spec_check_pre exit 0
8 #%define with_libcapng --enable-capng
9 %define _libpath /usr/lib
11 Summary: Bluetooth Stack for Linux
14 Group: Network & Connectivity/Bluetooth
15 License: GPL-2.0+ and LGPL-2.1+
16 URL: http://www.bluez.org/
17 Source: bluez-%{version}.tar.gz
18 Source2: bluez-coldplug.init
19 Source3: bluetooth.sysconfig
21 Source5: baselibs.conf
22 Source7: bluetooth.modprobe
23 Source101: obex-root-setup
24 Source102: create-symlinks
26 Source1001: bluez.manifest
27 Patch : Use-g_memdup2-for-glib-2.70-upgrade.patch
28 #Patch1 : bluez-ncurses.patch
29 #Patch2 : disable-eir-unittest.patch
30 #Requires: dbus >= 0.60
31 #BuildRequires: pkgconfig(libudev)
32 BuildRequires: pkgconfig(dbus-1)
33 BuildRequires: pkgconfig(iniparser)
34 BuildRequires: pkgconfig(libxml-2.0)
35 BuildRequires: pkgconfig(json-c)
36 BuildRequires: pkgconfig(ell)
37 #BuildRequires: pkgconfig(glib-2.0)
38 #BuildRequires: pkgconfig(ncurses)
41 #BuildRequires: readline-devel
42 #BuildRequires: openssl-devel
44 BuildRequires: libcap-ng-devel
45 BuildRequires: systemd
47 BuildRequires: pkgconfig(alsa)
48 BuildRequires: automake
49 BuildRequires: check-devel
50 BuildRequires: glib2-devel >= 2.16
51 BuildRequires: libsndfile-devel
52 BuildRequires: libtool
53 BuildRequires: libudev-devel
54 BuildRequires: pkg-config
55 BuildRequires: readline-devel
57 BuildRequires: pkgconfig(libtzplatform-config)
58 Requires: %{name}-compat = %{version}-%{release}
59 Requires: security-config
60 Recommends: %{name}-profile_common = %{version}-%{release}
63 The Bluetooth stack for Linux.
65 %if %{unified} == true
66 %package extension-bredr
67 Summary: Bluez extension for BREDR functionality
68 Requires: %{name} = %{version}-%{release}
69 Conflicts: %{name}-extension-le = %{version}-%{release}
70 %description extension-bredr
71 Bluez extension for BREDR functionality
74 Summary: Bluez extension for LE functionality
75 Requires: %{name} = %{version}-%{release}
76 Conflicts: %{name}-extension-bredr = %{version}-%{release}
77 %description extension-le
78 Bluez extension for LE functionality
82 Summary: OBEX Server A basic OBEX server implementation
83 Group: Network & Connectivity/Bluetooth
84 Requires: tizen-platform-config-tools
87 OBEX Server A basic OBEX server implementation.
90 Summary: Tools for testing of various Bluetooth-functions
92 Group: Development/Tools
94 Requires: python-gobject
97 Contains a few tools for testing various bluetooth functions. The
98 BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.
101 Summary: Bluez configuration tools
103 Group: Development/Tools
107 # Using any tool in this package results direct access to bluez stack,
108 # so the result of the tool won't be applied to Tizen system properly.
109 # Recommend to use it cautiously and only in development phase.
110 Bluez tools to manipulate bluetooth devices and configuartion.
112 %package profile_common
113 Summary: Modified bluez for mobile/common profile
114 Provides: %{name}-compat = %{version}-%{release}
115 Provides: %{name}-profile_mobile = %{version}-%{release}
116 Provides: %{name}-profile_ivi = %{version}-%{release}
117 Conflicts: %{name}-profile_wearable
118 Conflicts: %{name}-profile_tv
119 %description profile_common
120 Bluez default service script for Tizen (mobile/common profile)
122 %package profile_wearable
123 Summary: Modified bluez for wearable profile
124 Provides: %{name}-compat = %{version}-%{release}
125 Conflicts: %{name}-profile_common
126 Conflicts: %{name}-profile_tv
127 %description profile_wearable
128 Bluez modified service script for Tizen wearable
131 Summary: Modified bluez for wearable profile
132 Provides: %{name}-compat = %{version}-%{release}
133 Conflicts: %{name}-profile_common
134 Conflicts: %{name}-profile_wearable
135 %description profile_tv
136 Bluez modified service script for Tizen TV
138 %package plugin-headless
139 Summary: Bluez headless plugin
140 Requires: %{name}-compat = %{version}-%{release}
141 %description plugin-headless
142 This package is Bluez plugin to manager headless device
144 %package plugin-keyboard
145 Summary: Bluez keyboard plugin
146 Requires: %{name}-compat = %{version}-%{release}
147 %description plugin-keyboard
148 This package is Bluez plugin to manager keyboard device
150 %package plugin-robot
151 Summary: Bluez robot plugin
152 Requires: %{name}-compat = %{version}-%{release}
153 %description plugin-robot
154 This package is Bluez plugin to manager robot device
157 Summary: Bluez plugin for Digital Appliance
158 Requires: %{name}-compat = %{version}-%{release}
159 %description plugin-da
160 This package is Bluez plugin to manager Digital Appliance devices
163 Summary: contains binaries for bluetooth mesh
164 Requires: %{name}-compat = %{version}-%{release}
167 Contains bluetooth mesh daemon
177 #if "{?profile}" == "ivi"
178 # TIZEN_FEATURE_BLUEZ_BRCM_CHIP: only in tools/hciattach.c ==> RUNTIME! (profile.h)
181 #if "{?profile}" == "wearable"
182 # TIZEN_FEATURE_BLUEZ_SMS_ONLY: only in obexd/plugins/messages-tizen.c ==> RUNTIME! (profile.h)
183 # TIZEN_FEATURE_BLUEZ_BRCM_QOS: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
184 # TIZEN_FEATURE_BLUEZ_ROLE_CHANGE: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
185 # TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY: only in src/device.c ==> RUNTIME! (profile.h)
191 export CFLAGS_DEFAULT="$CFLAGS"
193 %if %{unified} == true
195 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
197 export LDFLAGS=" -lncurses -Wl,--as-needed "
198 export CFLAGS+=" -Werror -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DTIZEN_FEATURE_BLUEZ_AVRCP_CONTROL -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DENABLE_AVRCP_CATEGORY1 -DTIZEN_BT_HID_DEVICE_ENABLE"
202 export CFLAGS+=" -DARCH64"
207 export CFLAGS+=" -DARCH64"
212 export CFLAGS+=" -DARCH64"
215 %reconfigure --disable-static \
216 --sysconfdir=%{_sysconfdir} \
217 --localstatedir=%{_localstatedir} \
218 --with-systemdsystemunitdir=%{_libpath}/systemd/system \
219 --with-systemduserunitdir=%{_libpath}/systemd/user \
220 --libexecdir=%{_libexecdir} \
227 --enable-hid2hci=yes \
229 --enable-gstreamer=no \
232 --enable-proximity=yes \
237 --with-telephony=tizen \
242 --enable-experimental \
243 --enable-autopyypair=no \
244 --enable-tizenunusedplugin=no \
245 --disable-crypto-tests \
246 --enable-external-ell
248 make %{?_smp_mflags} all V=1
253 cp -a %{buildroot}%{_libexecdir}/bluetooth/bluetoothd le/
261 export CFLAGS="$CFLAGS_DEFAULT"
264 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
266 export LDFLAGS=" -lncurses -Wl,--as-needed "
267 export CFLAGS+=" -Werror -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DTIZEN_FEATURE_BLUEZ_AVRCP_CONTROL -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DENABLE_AVRCP_CATEGORY1 -DTIZEN_BT_HID_DEVICE_ENABLE"
271 export CFLAGS+=" -DARCH64"
276 export CFLAGS+=" -DARCH64"
281 export CFLAGS+=" -DARCH64"
284 %reconfigure --disable-static \
285 --sysconfdir=%{_sysconfdir} \
286 --localstatedir=%{_localstatedir} \
287 --with-systemdsystemunitdir=%{_libpath}/systemd/system \
288 --with-systemduserunitdir=%{_libpath}/systemd/user \
289 --libexecdir=%{_libexecdir} \
298 --enable-hid2hci=yes \
300 --enable-gstreamer=no \
303 --enable-health=yes \
307 --with-telephony=tizen \
311 --enable-experimental \
312 --enable-autopair=no \
315 --enable-tizenunusedplugin=no \
316 --disable-crypto-tests \
317 --enable-external-ell
319 make %{?_smp_mflags} all V=1
324 cp -a %{buildroot}%{_libexecdir}/bluetooth/bluetoothd bredr/
332 export CFLAGS="$CFLAGS_DEFAULT"
335 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
337 export LDFLAGS=" -lncurses -Wl,--as-needed "
338 export CFLAGS+=" -Werror -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DTIZEN_FEATURE_BLUEZ_AVRCP_CONTROL -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DENABLE_AVRCP_CATEGORY1 -DTIZEN_BT_HID_DEVICE_ENABLE"
342 export CFLAGS+=" -DARCH64"
347 export CFLAGS+=" -DARCH64"
352 export CFLAGS+=" -DARCH64"
355 %reconfigure --disable-static \
356 --sysconfdir=%{_sysconfdir} \
357 --localstatedir=%{_localstatedir} \
358 --with-systemdsystemunitdir=%{_libpath}/systemd/system \
359 --with-systemduserunitdir=%{_libpath}/systemd/user \
360 --libexecdir=%{_libexecdir} \
369 --enable-hid2hci=yes \
371 --enable-gstreamer=no \
374 --enable-health=yes \
375 --enable-proximity=yes \
379 --with-telephony=tizen \
385 --enable-experimental \
386 --enable-autopair=no \
389 --enable-tizenunusedplugin=no \
390 --disable-crypto-tests \
391 --enable-external-ell
393 make %{?_smp_mflags} all V=1
401 %if %{unified} == true
403 for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.bredr"; done
407 for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.le"; done
412 rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
413 #install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
414 %if %{unified} == true
415 install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluetooth.conf
418 # no idea why this is suddenly necessary...
419 install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
421 install -D -m 0644 src/main_w.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.wearable
422 install -D -m 0644 src/main_m.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf
423 install -D -m 0644 src/main_headless.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.headless
424 install -D -m 0644 src/main_keyboard.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.keyboard
425 install -D -m 0644 src/main_robot.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.robot
426 install -D -m 0644 src/main_da.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.da
428 #install -D -m 0644 src/org.bluez.service %{buildroot}%{_datadir}/dbus-1/system-services/org.bluez.service
430 install -D -m 0644 src/bluetooth.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth.conf
431 install -D -m 0644 src/bluetooth_robot.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth_robot.conf
432 #install -D -m 0644 profiles/audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/audio.conf
433 #install -D -m 0644 profiles/network/network.conf %{buildroot}%{_sysconfdir}/bluetooth/network.conf
435 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/bluez
436 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth3
437 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth-devel
439 #install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup
440 #install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
441 #install -D -m 0755 %SOURCE103 %{buildroot}%{_bindir}/obex.sh
442 install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT/%{_bindir}/
443 install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT/%{_bindir}/
444 #install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT/%{_bindir}/
445 install -D -m 0755 tools/btmgmt $RPM_BUILD_ROOT/%{_bindir}/
446 install -D -m 0755 tools/scotest $RPM_BUILD_ROOT/%{_bindir}/
447 install -D -m 0755 tools/bluemoon $RPM_BUILD_ROOT/%{_bindir}/
448 install -D -m 0755 attrib/gatttool $RPM_BUILD_ROOT/%{_bindir}/
449 install -D -m 0755 tools/meshctl $RPM_BUILD_ROOT/%{_bindir}/
450 install -D -m 0755 tools/mesh-cfgclient $RPM_BUILD_ROOT/%{_bindir}/
453 install -D -m 0644 mesh/mesh-main.conf %{buildroot}%{_sysconfdir}/bluetooth/mesh-main.conf
455 install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl
457 install -D -m 0644 obexd/src/obex.service %{buildroot}%{_libpath}/systemd/system/
459 install -D -m 0644 src/bluetooth.service %{buildroot}%{_libpath}/systemd/system/bluez-start.service
461 %if %{unified} == true
462 %post -n bluez-extension-bredr
463 pushd %{_libexecdir}/bluetooth
464 for FILE in bluetoothd.bredr; do mv "$FILE" "${FILE%.bredr}"; done
468 %post -n bluez-extension-le
469 pushd %{_libexecdir}/bluetooth
470 for FILE in bluetoothd.le; do mv "$FILE" "${FILE%.le}"; done
476 %manifest %{name}.manifest
477 %defattr(-, root, root)
479 #%{_sysconfdir}/bluetooth/audio.conf
480 #%{_sysconfdir}/bluetooth/network.conf
481 #%{_sysconfdir}/bluetooth/rfcomm.conf
483 %attr(750, network_fw, network_fw)%{_bindir}/hcitool
488 %{_bindir}/mpris-proxy
494 %attr(750, network_fw, network_fw)%{_bindir}/btattach
495 %attr(750, network_fw, network_fw)%{_bindir}/hciattach
496 %attr(750, network_fw, network_fw)%{_bindir}/hciconfig
497 %attr(755, network_fw, network_fw)%{_libexecdir}/bluetooth/bluetoothd
498 %exclude %{_libexecdir}/bluetooth/bluetoothd.bredr
499 %exclude %{_libexecdir}/bluetooth/bluetoothd.le
500 %exclude %{_includedir}/bluetooth/*
501 %exclude %{_libdir}/pkgconfig/bluez.pc
506 %{_unitdir}/bluez-start.service
507 %exclude %{_unitdir}/bluetooth.service
509 %if %{unified} == true
510 %files -n bluez-extension-bredr
511 %manifest %{name}.manifest
512 %defattr(-, root, root)
513 %{_libexecdir}/bluetooth/bluetoothd.bredr
515 %files -n bluez-extension-le
516 %manifest %{name}.manifest
517 %defattr(-, root, root)
518 %{_libexecdir}/bluetooth/bluetoothd.le
519 %config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
520 %dir /var/lib/bluetooth
521 %dir %{_sysconfdir}/modprobe.d
522 %config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
526 %manifest %{name}.manifest
527 %defattr(-, root, root)
529 %{_sysconfdir}/dbus-1/system.d/bluetooth-mesh.conf
530 %attr(755, network_fw, network_fw)%{_libexecdir}/bluetooth/bluetooth-meshd
531 %{_libpath}/systemd/system/bluetooth-mesh.service
532 %exclude %{_datadir}/dbus-1/system-services/org.bluez.mesh.service
533 %exclude /usr/lib/debug/*
534 %{_sysconfdir}/bluetooth/mesh-main.conf
537 %manifest %{name}.manifest
538 %defattr(-,root,root,-)
539 %{_libexecdir}/bluetooth/obexd
540 %{_libpath}/systemd/system/obex.service
541 %{_datadir}/dbus-1/system-services/org.bluez.obex.service
542 #%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
543 #%{_bindir}/obex-root-setup
547 %{_bindir}/bluetoothctl
553 %{_bindir}/mesh-cfgclient
554 %{_bindir}/bluetooth-player
557 %manifest %{name}.manifest
558 %defattr(-,root,root)
559 %{_libdir}/bluez/test/*
563 #%{_bindir}/mpris-player
568 %exclude /usr/lib/debug/*
569 %{_libdir}/libbluetooth.so*
573 %post profile_wearable
574 ln -sf main.conf.wearable %{_sysconfdir}/bluetooth/main.conf
575 %preun profile_wearable
576 rm %{_sysconfdir}/bluetooth/main.conf
577 %files profile_wearable
578 %manifest %{name}.manifest
579 %{_sysconfdir}/bluetooth/main.conf.wearable
580 %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
583 %manifest %{name}.manifest
584 %{_sysconfdir}/bluetooth/main.conf
585 %exclude %{_datadir}/dbus-1/system-services/org.bluez.service
586 %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
588 %files profile_common
589 %manifest %{name}.manifest
590 %{_sysconfdir}/bluetooth/main.conf
591 %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
593 %post plugin-headless
594 ln -sf main.conf.headless %{_sysconfdir}/bluetooth/main.conf
595 %preun plugin-headless
596 rm %{_sysconfdir}/bluetooth/main.conf
597 %files plugin-headless
598 %manifest %{name}.manifest
599 %{_sysconfdir}/bluetooth/main.conf.headless
601 %post plugin-keyboard
602 ln -sf main.conf.keyboard %{_sysconfdir}/bluetooth/main.conf
603 %preun plugin-keyboard
604 rm %{_sysconfdir}/bluetooth/main.conf
605 %files plugin-keyboard
606 %manifest %{name}.manifest
607 %{_sysconfdir}/bluetooth/main.conf.keyboard
610 ln -sf main.conf.robot %{_sysconfdir}/bluetooth/main.conf
611 mv %{_sysconfdir}/dbus-1/system.d/bluetooth_robot.conf %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
613 rm %{_sysconfdir}/bluetooth/main.conf
615 %manifest %{name}.manifest
616 %{_sysconfdir}/bluetooth/main.conf.robot
617 %{_sysconfdir}/dbus-1/system.d/bluetooth_robot.conf
620 ln -sf main.conf.da %{_sysconfdir}/bluetooth/main.conf
622 rm %{_sysconfdir}/bluetooth/main.conf
624 %manifest %{name}.manifest
625 %{_sysconfdir}/bluetooth/main.conf.da