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.
100 %package profile_common
101 Summary: Modified bluez for mobile/common profile
102 Provides: %{name}-compat = %{version}-%{release}
103 Provides: %{name}-profile_mobile = %{version}-%{release}
104 Provides: %{name}-profile_ivi = %{version}-%{release}
105 Conflicts: %{name}-profile_wearable
106 Conflicts: %{name}-profile_tv
107 %description profile_common
108 Bluez default service script for Tizen (mobile/common profile)
110 %package profile_wearable
111 Summary: Modified bluez for wearable profile
112 Provides: %{name}-compat = %{version}-%{release}
113 Conflicts: %{name}-profile_common
114 Conflicts: %{name}-profile_tv
115 %description profile_wearable
116 Bluez modified service script for Tizen wearable
119 Summary: Modified bluez for wearable profile
120 Provides: %{name}-compat = %{version}-%{release}
121 Conflicts: %{name}-profile_common
122 Conflicts: %{name}-profile_wearable
123 %description profile_tv
124 Bluez modified service script for Tizen TV
126 %package plugin-headless
127 Summary: Bluez headless plugin
128 Requires: %{name}-compat = %{version}-%{release}
129 %description plugin-headless
130 This package is Bluez plugin to manager headless device
132 %package plugin-keyboard
133 Summary: Bluez keyboard plugin
134 Requires: %{name}-compat = %{version}-%{release}
135 %description plugin-keyboard
136 This package is Bluez plugin to manager keyboard device
138 %package plugin-robot
139 Summary: Bluez robot plugin
140 Requires: %{name}-compat = %{version}-%{release}
141 %description plugin-robot
142 This package is Bluez plugin to manager robot device
145 Summary: Bluez plugin for Digital Appliance
146 Requires: %{name}-compat = %{version}-%{release}
147 %description plugin-da
148 This package is Bluez plugin to manager Digital Appliance devices
151 Summary: contains binaries for bluetooth mesh
152 Requires: %{name}-compat = %{version}-%{release}
155 Contains bluetooth mesh daemon
165 #if "{?profile}" == "ivi"
166 # TIZEN_FEATURE_BLUEZ_BRCM_CHIP: only in tools/hciattach.c ==> RUNTIME! (profile.h)
169 #if "{?profile}" == "wearable"
170 # TIZEN_FEATURE_BLUEZ_SMS_ONLY: only in obexd/plugins/messages-tizen.c ==> RUNTIME! (profile.h)
171 # TIZEN_FEATURE_BLUEZ_BRCM_QOS: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
172 # TIZEN_FEATURE_BLUEZ_ROLE_CHANGE: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
173 # TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY: only in src/device.c ==> RUNTIME! (profile.h)
179 export CFLAGS_DEFAULT="$CFLAGS"
181 %if %{unified} == true
183 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
185 export LDFLAGS=" -lncurses -Wl,--as-needed "
186 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"
190 export CFLAGS+=" -DARCH64"
195 export CFLAGS+=" -DARCH64"
198 %reconfigure --disable-static \
199 --sysconfdir=%{_sysconfdir} \
200 --localstatedir=%{_localstatedir} \
201 --with-systemdsystemunitdir=%{_libpath}/systemd/system \
202 --with-systemduserunitdir=%{_libpath}/systemd/user \
203 --libexecdir=%{_libexecdir} \
210 --enable-hid2hci=yes \
212 --enable-gstreamer=no \
215 --enable-proximity=yes \
220 --with-telephony=tizen \
225 --enable-experimental \
226 --enable-autopyypair=no \
227 --enable-tizenunusedplugin=no \
228 --disable-crypto-tests \
229 --enable-external-ell
231 make %{?_smp_mflags} all V=1
236 cp -a %{buildroot}%{_libexecdir}/bluetooth/bluetoothd le/
244 export CFLAGS="$CFLAGS_DEFAULT"
247 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
249 export LDFLAGS=" -lncurses -Wl,--as-needed "
250 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"
254 export CFLAGS+=" -DARCH64"
259 export CFLAGS+=" -DARCH64"
262 %reconfigure --disable-static \
263 --sysconfdir=%{_sysconfdir} \
264 --localstatedir=%{_localstatedir} \
265 --with-systemdsystemunitdir=%{_libpath}/systemd/system \
266 --with-systemduserunitdir=%{_libpath}/systemd/user \
267 --libexecdir=%{_libexecdir} \
276 --enable-hid2hci=yes \
278 --enable-gstreamer=no \
281 --enable-health=yes \
285 --with-telephony=tizen \
289 --enable-experimental \
290 --enable-autopair=no \
293 --enable-tizenunusedplugin=no \
294 --disable-crypto-tests \
295 --enable-external-ell
297 make %{?_smp_mflags} all V=1
302 cp -a %{buildroot}%{_libexecdir}/bluetooth/bluetoothd bredr/
310 export CFLAGS="$CFLAGS_DEFAULT"
313 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
315 export LDFLAGS=" -lncurses -Wl,--as-needed "
316 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"
320 export CFLAGS+=" -DARCH64"
325 export CFLAGS+=" -DARCH64"
328 %reconfigure --disable-static \
329 --sysconfdir=%{_sysconfdir} \
330 --localstatedir=%{_localstatedir} \
331 --with-systemdsystemunitdir=%{_libpath}/systemd/system \
332 --with-systemduserunitdir=%{_libpath}/systemd/user \
333 --libexecdir=%{_libexecdir} \
342 --enable-hid2hci=yes \
344 --enable-gstreamer=no \
347 --enable-health=yes \
348 --enable-proximity=yes \
352 --with-telephony=tizen \
358 --enable-experimental \
359 --enable-autopair=no \
362 --enable-tizenunusedplugin=no \
363 --disable-crypto-tests \
364 --enable-external-ell
366 make %{?_smp_mflags} all V=1
374 %if %{unified} == true
376 for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.bredr"; done
380 for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.le"; done
385 rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
386 #install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
387 %if %{unified} == true
388 install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluetooth.conf
391 # no idea why this is suddenly necessary...
392 install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
394 install -D -m 0644 src/main_w.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.wearable
395 install -D -m 0644 src/main_m.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf
396 install -D -m 0644 src/main_headless.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.headless
397 install -D -m 0644 src/main_keyboard.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.keyboard
398 install -D -m 0644 src/main_robot.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.robot
399 install -D -m 0644 src/main_da.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.da
401 #install -D -m 0644 src/org.bluez.service %{buildroot}%{_datadir}/dbus-1/system-services/org.bluez.service
403 install -D -m 0644 src/bluetooth.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth.conf
404 install -D -m 0644 src/bluetooth_robot.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth_robot.conf
405 #install -D -m 0644 profiles/audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/audio.conf
406 #install -D -m 0644 profiles/network/network.conf %{buildroot}%{_sysconfdir}/bluetooth/network.conf
408 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/bluez
409 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth3
410 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth-devel
412 #install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup
413 #install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
414 #install -D -m 0755 %SOURCE103 %{buildroot}%{_bindir}/obex.sh
415 install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT/%{_bindir}/
416 install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT/%{_bindir}/
417 #install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT/%{_bindir}/
418 install -D -m 0755 tools/btmgmt $RPM_BUILD_ROOT/%{_bindir}/
419 install -D -m 0755 tools/scotest $RPM_BUILD_ROOT/%{_bindir}/
420 install -D -m 0755 tools/bluemoon $RPM_BUILD_ROOT/%{_bindir}/
421 install -D -m 0755 attrib/gatttool $RPM_BUILD_ROOT/%{_bindir}/
422 install -D -m 0755 tools/meshctl $RPM_BUILD_ROOT/%{_bindir}/
423 install -D -m 0755 tools/mesh-cfgclient $RPM_BUILD_ROOT/%{_bindir}/
426 install -D -m 0644 mesh/mesh-main.conf %{buildroot}%{_sysconfdir}/bluetooth/mesh-main.conf
428 install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl
430 install -D -m 0644 obexd/src/obex.service %{buildroot}%{_libpath}/systemd/system/
432 install -D -m 0644 src/bluetooth.service %{buildroot}%{_libpath}/systemd/system/bluez-start.service
434 %if %{unified} == true
435 %post -n bluez-extension-bredr
436 pushd %{_libexecdir}/bluetooth
437 for FILE in bluetoothd.bredr; do mv "$FILE" "${FILE%.bredr}"; done
441 %post -n bluez-extension-le
442 pushd %{_libexecdir}/bluetooth
443 for FILE in bluetoothd.le; do mv "$FILE" "${FILE%.le}"; done
449 %manifest %{name}.manifest
450 %defattr(-, root, root)
452 #%{_sysconfdir}/bluetooth/audio.conf
453 #%{_sysconfdir}/bluetooth/network.conf
454 #%{_sysconfdir}/bluetooth/rfcomm.conf
456 %attr(750, network_fw, network_fw)%{_bindir}/hcitool
461 %{_bindir}/mpris-proxy
467 %attr(750, network_fw, network_fw)%{_bindir}/btattach
468 %attr(750, network_fw, network_fw)%{_bindir}/hciattach
469 %attr(750, network_fw, network_fw)%{_bindir}/hciconfig
470 %attr(755, network_fw, network_fw)%{_libexecdir}/bluetooth/bluetoothd
471 %exclude %{_libexecdir}/bluetooth/bluetoothd.bredr
472 %exclude %{_libexecdir}/bluetooth/bluetoothd.le
473 %exclude %{_includedir}/bluetooth/*
474 %exclude %{_libdir}/pkgconfig/bluez.pc
479 %{_unitdir}/bluez-start.service
480 %exclude %{_unitdir}/bluetooth.service
482 %if %{unified} == true
483 %files -n bluez-extension-bredr
484 %manifest %{name}.manifest
485 %defattr(-, root, root)
486 %{_libexecdir}/bluetooth/bluetoothd.bredr
488 %files -n bluez-extension-le
489 %manifest %{name}.manifest
490 %defattr(-, root, root)
491 %{_libexecdir}/bluetooth/bluetoothd.le
492 %config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
493 %dir /var/lib/bluetooth
494 %dir %{_sysconfdir}/modprobe.d
495 %config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
499 %manifest %{name}.manifest
500 %defattr(-, root, root)
502 %{_sysconfdir}/dbus-1/system.d/bluetooth-mesh.conf
503 %attr(755, network_fw, network_fw)%{_libexecdir}/bluetooth/bluetooth-meshd
504 %{_libpath}/systemd/system/bluetooth-mesh.service
505 %exclude %{_datadir}/dbus-1/system-services/org.bluez.mesh.service
506 %exclude /usr/lib/debug/*
507 %{_sysconfdir}/bluetooth/mesh-main.conf
510 %manifest %{name}.manifest
511 %defattr(-,root,root,-)
512 %{_libexecdir}/bluetooth/obexd
513 %{_libpath}/systemd/system/obex.service
514 %{_datadir}/dbus-1/system-services/org.bluez.obex.service
515 #%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
516 #%{_bindir}/obex-root-setup
521 %manifest %{name}.manifest
522 %defattr(-,root,root)
523 %{_libdir}/bluez/test/*
526 %{_bindir}/bluetoothctl
528 %{_bindir}/mesh-cfgclient
530 #%{_bindir}/mpris-player
531 %{_bindir}/bluetooth-player
539 %exclude /usr/lib/debug/*
540 %{_libdir}/libbluetooth.so*
544 %post profile_wearable
545 ln -sf main.conf.wearable %{_sysconfdir}/bluetooth/main.conf
546 %preun profile_wearable
547 rm %{_sysconfdir}/bluetooth/main.conf
548 %files profile_wearable
549 %manifest %{name}.manifest
550 %{_sysconfdir}/bluetooth/main.conf.wearable
551 %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
554 %manifest %{name}.manifest
555 %{_sysconfdir}/bluetooth/main.conf
556 %exclude %{_datadir}/dbus-1/system-services/org.bluez.service
557 %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
559 %files profile_common
560 %manifest %{name}.manifest
561 %{_sysconfdir}/bluetooth/main.conf
562 %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
564 %post plugin-headless
565 ln -sf main.conf.headless %{_sysconfdir}/bluetooth/main.conf
566 %preun plugin-headless
567 rm %{_sysconfdir}/bluetooth/main.conf
568 %files plugin-headless
569 %manifest %{name}.manifest
570 %{_sysconfdir}/bluetooth/main.conf.headless
572 %post plugin-keyboard
573 ln -sf main.conf.keyboard %{_sysconfdir}/bluetooth/main.conf
574 %preun plugin-keyboard
575 rm %{_sysconfdir}/bluetooth/main.conf
576 %files plugin-keyboard
577 %manifest %{name}.manifest
578 %{_sysconfdir}/bluetooth/main.conf.keyboard
581 ln -sf main.conf.robot %{_sysconfdir}/bluetooth/main.conf
582 mv %{_sysconfdir}/dbus-1/system.d/bluetooth_robot.conf %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
584 rm %{_sysconfdir}/bluetooth/main.conf
586 %manifest %{name}.manifest
587 %{_sysconfdir}/bluetooth/main.conf.robot
588 %{_sysconfdir}/dbus-1/system.d/bluetooth_robot.conf
591 ln -sf main.conf.da %{_sysconfdir}/bluetooth/main.conf
593 rm %{_sysconfdir}/bluetooth/main.conf
595 %manifest %{name}.manifest
596 %{_sysconfdir}/bluetooth/main.conf.da