1 # Do not create provides from emulator .so files because the main package
2 # should anchor any reverse-dependencies
3 %global __provides_exclude_from ^(.*\\.emulator)$
6 %define _dumpdir /opt/etc/dump.d/module.d
7 %define _varlibdir /opt/var/lib
8 %define _meshdir /opt/usr/mesh
11 Summary: Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
14 Group: Network & Connectivity/Bluetooth
16 Source0: %{name}-%{version}.tar.gz
17 Source1001: bluetooth-frwk.manifest
19 %define bt_bluez_hal ENABLED
20 %define bt_gatt_client_fd ENABLED
21 %define bt_permanent_log DISABLED
22 %define bt_http_proxy DISABLED
23 %define bt_factory_mode DISABLED
24 %define bt_vendor_operation DISABLED
26 BuildRequires: pkgconfig(aul)
27 %if %{bt_factory_mode} == ENABLED
28 BuildRequires: pkgconfig(bincfg)
30 BuildRequires: pkgconfig(dlog)
31 BuildRequires: pkgconfig(glib-2.0)
32 BuildRequires: pkgconfig(gio-2.0)
33 BuildRequires: pkgconfig(gio-unix-2.0)
34 BuildRequires: pkgconfig(syspopup-caller)
35 BuildRequires: pkgconfig(vconf)
36 BuildRequires: pkgconfig(libxml-2.0)
37 BuildRequires: pkgconfig(capi-network-connection)
38 BuildRequires: pkgconfig(alarm-service)
39 BuildRequires: pkgconfig(capi-content-mime-type)
40 BuildRequires: pkgconfig(eventsystem)
41 %if %{bt_http_proxy} == ENABLED
42 BuildRequires: pkgconfig(libsoup-2.4)
44 BuildRequires: pkgconfig(capi-network-tethering)
46 BuildRequires: pkgconfig(cynara-client)
47 BuildRequires: pkgconfig(cynara-creds-gdbus)
48 BuildRequires: pkgconfig(libtzplatform-config)
49 BuildRequires: pkgconfig(json-c)
50 BuildRequires: pkgconfig(ell)
51 BuildRequires: pkgconfig(storage)
52 BuildRequires: pkgconfig(capi-system-info)
53 BuildRequires: pkgconfig(capi-appfw-app-control)
54 BuildRequires: pkgconfig(libactd)
55 BuildRequires: pkgconfig(libsystemd)
56 BuildRequires: pkgconfig(hal-api-bluetooth)
58 Requires(post): /usr/bin/vconftool
59 Requires(post): /sbin/ldconfig
60 Requires(postun): /sbin/ldconfig
63 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
64 This package contains API set for BT GAP, BT SDP, BT RFCOMM and BLE Mesh.
66 %package profile_common
67 Summary: bluetooth-frwk service and conf files for common profile
68 Requires: %{name} = %{version}-%{release}
69 Conflicts: %{name}-profile_mobile
70 Conflicts: %{name}-profile_wearable
71 Conflicts: %{name}-profile_tv
72 Conflicts: %{name}-profile_ivi
73 %description profile_common
74 Bluetooth framework configuration and service files for Tizen common profile
76 %package profile_mobile
77 Summary: bluetooth-frwk service and conf files for mobile profile
78 Requires: %{name} = %{version}-%{release}
79 Conflicts: %{name}-profile_common
80 Conflicts: %{name}-profile_wearable
81 Conflicts: %{name}-profile_tv
82 Conflicts: %{name}-profile_ivi
83 %description profile_mobile
84 Bluetooth framework configuration and service files for Tizen mobile profile
87 %ifarch %{ix86} || %{arm}
88 %package extension-TM1
89 Summary: bluetooth-frwk service and conf files for mobile TM1
90 Requires: %{name}-profile_mobile = %{version}-%{release}
91 %description extension-TM1
92 Bluetooth framework configuration and service files for Tizen mobile TM1
95 %package profile_wearable
96 Summary: bluetooth-frwk service and conf files for wearable profile
97 Requires: %{name} = %{version}-%{release}
98 Conflicts: %{name}-profile_mobile
99 Conflicts: %{name}-profile_common
100 Conflicts: %{name}-profile_tv
101 Conflicts: %{name}-profile_ivi
102 %description profile_wearable
103 Bluetooth framework configuration and service files for Tizen wearable profile
106 Summary: bluetooth-frwk service and conf files for tv profile
107 Requires: %{name} = %{version}-%{release}
108 Conflicts: %{name}-profile_mobile
109 Conflicts: %{name}-profile_wearable
110 Conflicts: %{name}-profile_common
111 Conflicts: %{name}-profile_ivi
112 %description profile_tv
113 Bluetooth framework configuration and service files for Tizen tv profile
116 Summary: bluetooth-frwk service and conf files for ivi profile
117 Requires: %{name} = %{version}-%{release}
118 Conflicts: %{name}-profile_mobile
119 Conflicts: %{name}-profile_wearable
120 Conflicts: %{name}-profile_tv
121 Conflicts: %{name}-profile_common
122 %description profile_ivi
123 Bluetooth framework configuration and service files for Tizen ivi profile
125 %ifarch %{ix86} x86_64
126 %package extension-emulator
127 Summary: bluetooth-frwk service and conf files for emulator
128 Requires: %{name} = %{version}-%{release}
129 %description extension-emulator
130 bluetooth-frwk service and conf files for emulator
131 %endif // ifarch %{ix86} x86_64
134 Summary: Bluetooth framework for BlueZ and Obexd
135 Group: Development/Libraries
136 Requires: %{name} = %{version}-%{release}
139 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
140 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
143 Summary: Bluetooth Service daemon
144 Group: Network & Connectivity/Bluetooth
145 Requires: %{name} = %{version}-%{release}
148 This package is Bluetooth Service daemon to manage BT services.
150 %if %{bt_http_proxy} == ENABLED
152 Summary: Bluetooth HTTP Proxy Service daemon
153 Group: Network & Connectivity/Bluetooth
154 Requires: %{name} = %{version}-%{release}
156 %description httpproxy
157 This package is Bluetooth HTTP Proxy Service daemon
161 Summary: Bluetooth OTP Service daemon
162 Group: Network & Connectivity/Bluetooth
163 Requires: %{name} = %{version}-%{release}
166 This package is Bluetooth OTP Service daemon
169 Summary: Bluetooth Core daemon
170 Group: Network & Connectivity/Bluetooth
171 Requires: %{name} = %{version}-%{release}
174 This package is Bluetooth core daemon to manage activation / deactivation.
177 Summary: Bluetooth test application
178 Group: Network & Connectivity/Bluetooth
179 Requires: %{name} = %{version}-%{release}
182 This package is Bluetooth test application.
185 Summary: Bluetooth OAL
186 Group: Network & Connectivity/Bluetooth
187 Requires: %{name} = %{version}-%{release}
190 This package is BT stack common interface.
192 %package plugin-headed
193 Summary: Bluetooth plugin Headed
194 Group: Network & Connectivity/Bluetooth
195 Requires: %{name} = %{version}-%{release}
197 %description plugin-headed
198 This package is Bluetooth plugin to manage UI and syspopup
206 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
207 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
208 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
209 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
210 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_CONTAINER"
211 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
212 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
214 %define _servicefile packaging/bluetooth-frwk-common.service
215 %define _servicedir starter.target.wants
217 %if "%{?profile}" == "mobile"
218 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
219 %if "%{?tizen_target_name}" == "TM1"
220 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
222 %define _servicefile packaging/bluetooth-frwk-mobile.service
224 %define _servicedir multi-user.target.wants
227 %if "%{?profile}" == "wearable"
228 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
229 %define _servicefile packaging/bluetooth-frwk-wearable.service
230 %define _servicedir multi-user.target.wants
233 %if "%{?profile}" == "tv"
234 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
235 %define _servicefile packaging/bluetooth-frwk-tv.service
236 %define _servicedir multi-user.target.wants
239 %if "%{?profile}" == "ivi"
240 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
241 %define _servicefile packaging/bluetooth-frwk-wearable.service
242 %define _servicedir multi-user.target.wants
246 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
247 export CFLAGS="$CFLAGS -fpie"
248 export CFLAGS+=" -DARCH64"
249 export CXXFLAGS+=" -DARCH64"
250 export FFLAGS+=" -DARCH64"
252 export CFLAGS="$CFLAGS -fpie"
253 export LDFLAGS="$CFLAGS -pie"
256 %if %{bt_bluez_hal} == ENABLED
257 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
259 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
261 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
263 %if %{bt_gatt_client_fd} == DISABLED
264 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
267 %if %{bt_permanent_log} == ENABLED
268 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PERMANENT_LOG"
271 %if %{bt_http_proxy} == ENABLED
272 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HTTP_PROXY"
275 %if %{bt_factory_mode} == ENABLED
276 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_FACTORY_MODE"
279 %if %{bt_vendor_operation} == ENABLED
280 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_VENDOR_OPERATION"
283 %if %{bt_bluez_hal} == ENABLED
284 export BT_INCLUDE_OAL_BLUEZ=ENABLED
285 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
287 export BT_INCLUDE_OAL_BLUEZ=DISABLED
290 export CFLAGS_DEFAULT="$CFLAGS"
291 export CXXFLAGS_DEFAULT="$CXXFLAGS"
292 export FFLAGS_DEFAULT="$FFLAGS"
295 %ifarch %{ix86} || %{arm}
297 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
298 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
299 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
301 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
302 -DCMAKE_LIB_DIR=%{_libdir} \
303 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
304 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
305 -DLIBNOTIFY_SUPPORT=Off \
306 -DLIBNOTIFICATION_SUPPORT=Off
312 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
316 %ifarch %{ix86} x86_64
317 export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
318 export CXXFLAGS="${CXXFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
319 export FFLAGS="${FFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
321 mkdir -p build_emulator
323 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
324 -DCMAKE_LIB_DIR=%{_libdir} \
325 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
326 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
327 -DLIBNOTIFY_SUPPORT=Off \
328 -DLIBNOTIFICATION_SUPPORT=Off
334 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
335 pushd build_emulator/
336 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
340 # non-extension-TM1 / non-extension-emulator
342 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
343 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
344 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
348 export CFLAGS+=" -DARCH64"
349 export CXXFLAGS+=" -DARCH64"
350 export FFLAGS+=" -DARCH64"
355 export CFLAGS+=" -DARCH64"
356 export CXXFLAGS+=" -DARCH64"
357 export FFLAGS+=" -DARCH64"
360 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
361 -DCMAKE_LIB_DIR=%{_libdir} \
362 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
363 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
364 -DLIBNOTIFY_SUPPORT=Off \
365 -DLIBNOTIFICATION_SUPPORT=Off
374 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
375 mkdir -p %{buildroot}%{_unitdir}/delayed.target.wants
376 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
377 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
378 mkdir -p %{buildroot}%{_meshdir}
380 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
383 %ifarch %{ix86} x86_64
384 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
385 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
388 # Rename the postfix (.mobile, .tv, ..) at post script
390 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
393 %ifarch %{ix86} || %{arm}
394 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
395 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
399 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
400 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
401 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
402 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
405 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
408 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
411 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
413 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
414 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
416 %postun -p /sbin/ldconfig
419 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blocklist
420 /usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blocklist
421 /usr/bin/chown network_fw:network_fw %{_meshdir}
424 %manifest %{name}.manifest
426 %defattr(-, root, root)
427 %{_libdir}/libbluetooth-api.so.*
428 %exclude %{_libdir}/libbluetooth-api.so*.emulator
431 %defattr(-, root, root)
432 %{_includedir}/bt-service/bluetooth-api.h
433 %{_includedir}/bt-service/bluetooth-hid-api.h
434 %{_includedir}/bt-service/bluetooth-audio-api.h
435 %{_includedir}/bt-service/bluetooth-telephony-api.h
436 %{_includedir}/bt-service/bluetooth-media-control.h
437 %{_includedir}/bt-service/bluetooth-scmst-api.h
438 %{_includedir}/bt-service/bluetooth-ipsp-api.h
439 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
440 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
441 %{_includedir}/bt-service/bluetooth-mesh-api.h
442 %{_libdir}/pkgconfig/bluetooth-api.pc
443 %{_libdir}/libbluetooth-api.so
446 %ifarch %{ix86} x86_64
447 %post extension-emulator
449 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
451 %preun extension-emulator
453 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
455 %files extension-emulator
456 %manifest %{name}.manifest
457 %defattr(-, root, root)
458 %{_libdir}/libbluetooth-api.so.*.emulator
459 %{_libdir}/libbluetooth-api.so.emulator
463 %manifest %{name}.manifest
465 %defattr(-, root, root)
466 %{_bindir}/bt-service
467 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
468 %{_bindir}/bluetooth-frwk-test
469 %{_varlibdir}/bluetooth
470 %{_prefix}/etc/bluetooth
472 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blocklist
474 %if %{bt_http_proxy} == ENABLED
476 %manifest %{name}.manifest
478 %defattr(-, root, root)
479 %{_bindir}/bt-httpproxy
480 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
481 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
485 %manifest %{name}.manifest
487 %defattr(-, root, root)
489 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
490 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
493 %manifest %{name}.manifest
495 %defattr(-, root, root)
496 %{_unitdir}/bluetooth-frwk-core.service
497 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
499 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
500 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
503 %manifest %{name}.manifest
505 %defattr(-, root, root)
506 %{_bindir}/bluetooth-frwk-test
507 #%{_bindir}/bluetooth-gatt-test
508 #%{_bindir}/bluetooth-advertising-test
511 %manifest %{name}.manifest
513 %defattr(-, root, root)
514 %{_libdir}/bt-plugin-headed.so
518 mv bluetooth-frwk.service.common bluetooth-frwk.service
520 %preun profile_common
522 mv bluetooth-frwk.service bluetooth-frwk.service.common
524 %files profile_common
526 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
527 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
528 %{_unitdir}/bluetooth-frwk.service.common
529 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
533 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
535 %preun profile_mobile
537 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
539 %files profile_mobile
541 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
542 %{_unitdir}/bluetooth-frwk.service.mobile
543 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
546 %ifarch %{ix86} || %{arm}
549 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
552 mv bt-core.tm1 bt-core
556 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
559 mv bt-core bt-core.tm1
562 %{_unitdir}/bluetooth-frwk.service.tm1
564 %defattr(-, root, root)
565 %{_bindir}/bt-core.tm1
568 %post profile_wearable
570 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
572 %preun profile_wearable
574 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
576 %files profile_wearable
578 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
579 %{_unitdir}/bluetooth-frwk.service.wearable
580 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
584 mv bluetooth-frwk.service.tv bluetooth-frwk.service
588 mv bluetooth-frwk.service bluetooth-frwk.service.tv
592 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
593 %{_unitdir}/bluetooth-frwk.service.tv
594 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
596 # Note: ivi reuses bluetooth-frwk.service.wearable
599 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
601 pushd %{_datadir}/dbus-1/system-services
602 mv org.projectx.bt.service.ivi org.projectx.bt.service
606 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
608 pushd %{_datadir}/dbus-1/system-services
609 mv org.projectx.bt.service org.projectx.bt.service.ivi
613 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
614 %{_unitdir}/bluetooth-frwk.service.wearable
615 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
618 %manifest %{name}.manifest
619 %defattr(-, root, root)
620 %{_libdir}/libbt-oal.so*
621 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
623 %if %{bt_bluez_hal} == ENABLED
624 %{_libdir}/libbluetooth.default.so*