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"
353 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
354 -DCMAKE_LIB_DIR=%{_libdir} \
355 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
356 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
357 -DLIBNOTIFY_SUPPORT=Off \
358 -DLIBNOTIFICATION_SUPPORT=Off
367 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
368 mkdir -p %{buildroot}%{_unitdir}/delayed.target.wants
369 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
370 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
371 mkdir -p %{buildroot}%{_meshdir}
373 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
376 %ifarch %{ix86} x86_64
377 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
378 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
381 # Rename the postfix (.mobile, .tv, ..) at post script
383 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
386 %ifarch %{ix86} || %{arm}
387 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
388 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
392 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
393 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
394 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
395 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
398 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
401 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
404 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
406 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
407 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
409 %postun -p /sbin/ldconfig
412 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
413 /usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
414 /usr/bin/chown network_fw:network_fw %{_meshdir}
417 %manifest %{name}.manifest
419 %defattr(-, root, root)
420 %{_libdir}/libbluetooth-api.so.*
421 %exclude %{_libdir}/libbluetooth-api.so*.emulator
424 %defattr(-, root, root)
425 %{_includedir}/bt-service/bluetooth-api.h
426 %{_includedir}/bt-service/bluetooth-hid-api.h
427 %{_includedir}/bt-service/bluetooth-audio-api.h
428 %{_includedir}/bt-service/bluetooth-telephony-api.h
429 %{_includedir}/bt-service/bluetooth-media-control.h
430 %{_includedir}/bt-service/bluetooth-scmst-api.h
431 %{_includedir}/bt-service/bluetooth-ipsp-api.h
432 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
433 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
434 %{_includedir}/bt-service/bluetooth-mesh-api.h
435 %{_libdir}/pkgconfig/bluetooth-api.pc
436 %{_libdir}/libbluetooth-api.so
439 %ifarch %{ix86} x86_64
440 %post extension-emulator
442 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
444 %preun extension-emulator
446 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
448 %files extension-emulator
449 %manifest %{name}.manifest
450 %defattr(-, root, root)
451 %{_libdir}/libbluetooth-api.so.*.emulator
452 %{_libdir}/libbluetooth-api.so.emulator
456 %manifest %{name}.manifest
458 %defattr(-, root, root)
459 %{_bindir}/bt-service
460 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
461 %{_bindir}/bluetooth-frwk-test
462 %{_varlibdir}/bluetooth
463 %{_prefix}/etc/bluetooth
465 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
467 %if %{bt_http_proxy} == ENABLED
469 %manifest %{name}.manifest
471 %defattr(-, root, root)
472 %{_bindir}/bt-httpproxy
473 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
474 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
478 %manifest %{name}.manifest
480 %defattr(-, root, root)
482 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
483 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
486 %manifest %{name}.manifest
488 %defattr(-, root, root)
489 %{_unitdir}/bluetooth-frwk-core.service
490 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
492 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
493 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
496 %manifest %{name}.manifest
498 %defattr(-, root, root)
499 %{_bindir}/bluetooth-frwk-test
500 #%{_bindir}/bluetooth-gatt-test
501 #%{_bindir}/bluetooth-advertising-test
504 %manifest %{name}.manifest
506 %defattr(-, root, root)
507 %{_libdir}/bt-plugin-headed.so
511 mv bluetooth-frwk.service.common bluetooth-frwk.service
513 %preun profile_common
515 mv bluetooth-frwk.service bluetooth-frwk.service.common
517 %files profile_common
519 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
520 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
521 %{_unitdir}/bluetooth-frwk.service.common
522 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
526 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
528 %preun profile_mobile
530 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
532 %files profile_mobile
534 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
535 %{_unitdir}/bluetooth-frwk.service.mobile
536 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
539 %ifarch %{ix86} || %{arm}
542 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
545 mv bt-core.tm1 bt-core
549 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
552 mv bt-core bt-core.tm1
555 %{_unitdir}/bluetooth-frwk.service.tm1
557 %defattr(-, root, root)
558 %{_bindir}/bt-core.tm1
561 %post profile_wearable
563 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
565 %preun profile_wearable
567 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
569 %files profile_wearable
571 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
572 %{_unitdir}/bluetooth-frwk.service.wearable
573 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
577 mv bluetooth-frwk.service.tv bluetooth-frwk.service
581 mv bluetooth-frwk.service bluetooth-frwk.service.tv
585 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
586 %{_unitdir}/bluetooth-frwk.service.tv
587 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
589 # Note: ivi reuses bluetooth-frwk.service.wearable
592 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
594 pushd %{_datadir}/dbus-1/system-services
595 mv org.projectx.bt.service.ivi org.projectx.bt.service
599 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
601 pushd %{_datadir}/dbus-1/system-services
602 mv org.projectx.bt.service org.projectx.bt.service.ivi
606 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
607 %{_unitdir}/bluetooth-frwk.service.wearable
608 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
611 %manifest %{name}.manifest
612 %defattr(-, root, root)
613 %{_libdir}/libbt-oal.so*
614 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
616 %if %{bt_bluez_hal} == ENABLED
617 %{_libdir}/libbluetooth.default.so*