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 Requires: bluetooth-tools
21 %define bt_bluez_hal ENABLED
22 %define bt_gatt_client_fd ENABLED
23 %define bt_permanent_log DISABLED
24 %define bt_http_proxy DISABLED
25 %define bt_factory_mode DISABLED
26 %define bt_vendor_operation DISABLED
28 BuildRequires: pkgconfig(aul)
29 %if %{bt_factory_mode} == ENABLED
30 BuildRequires: pkgconfig(bincfg)
32 BuildRequires: pkgconfig(dlog)
33 BuildRequires: pkgconfig(glib-2.0)
34 BuildRequires: pkgconfig(gio-2.0)
35 BuildRequires: pkgconfig(gio-unix-2.0)
36 BuildRequires: pkgconfig(syspopup-caller)
37 BuildRequires: pkgconfig(vconf)
38 BuildRequires: pkgconfig(libxml-2.0)
39 BuildRequires: pkgconfig(capi-network-connection)
40 BuildRequires: pkgconfig(alarm-service)
41 BuildRequires: pkgconfig(capi-content-mime-type)
42 BuildRequires: pkgconfig(eventsystem)
43 %if %{bt_http_proxy} == ENABLED
44 BuildRequires: pkgconfig(libsoup-2.4)
46 BuildRequires: pkgconfig(capi-network-tethering)
48 BuildRequires: pkgconfig(cynara-client)
49 BuildRequires: pkgconfig(cynara-creds-gdbus)
50 BuildRequires: pkgconfig(libtzplatform-config)
51 BuildRequires: pkgconfig(json-c)
52 BuildRequires: pkgconfig(ell)
53 BuildRequires: pkgconfig(storage)
54 BuildRequires: pkgconfig(capi-system-info)
55 BuildRequires: pkgconfig(capi-appfw-app-control)
56 BuildRequires: pkgconfig(libactd)
57 BuildRequires: pkgconfig(libsystemd)
58 BuildRequires: pkgconfig(hal-api-bluetooth)
60 Requires(post): /usr/bin/vconftool
61 Requires(post): /sbin/ldconfig
62 Requires(postun): /sbin/ldconfig
65 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
66 This package contains API set for BT GAP, BT SDP, BT RFCOMM and BLE Mesh.
68 %package profile_common
69 Summary: bluetooth-frwk service and conf files for common profile
70 Requires: %{name} = %{version}-%{release}
71 Conflicts: %{name}-profile_mobile
72 Conflicts: %{name}-profile_wearable
73 Conflicts: %{name}-profile_tv
74 Conflicts: %{name}-profile_ivi
75 %description profile_common
76 Bluetooth framework configuration and service files for Tizen common profile
78 %package profile_mobile
79 Summary: bluetooth-frwk service and conf files for mobile profile
80 Requires: %{name} = %{version}-%{release}
81 Conflicts: %{name}-profile_common
82 Conflicts: %{name}-profile_wearable
83 Conflicts: %{name}-profile_tv
84 Conflicts: %{name}-profile_ivi
85 %description profile_mobile
86 Bluetooth framework configuration and service files for Tizen mobile profile
89 %ifarch %{ix86} || %{arm}
90 %package extension-TM1
91 Summary: bluetooth-frwk service and conf files for mobile TM1
92 Requires: %{name}-profile_mobile = %{version}-%{release}
93 %description extension-TM1
94 Bluetooth framework configuration and service files for Tizen mobile TM1
97 %package profile_wearable
98 Summary: bluetooth-frwk service and conf files for wearable profile
99 Requires: %{name} = %{version}-%{release}
100 Conflicts: %{name}-profile_mobile
101 Conflicts: %{name}-profile_common
102 Conflicts: %{name}-profile_tv
103 Conflicts: %{name}-profile_ivi
104 %description profile_wearable
105 Bluetooth framework configuration and service files for Tizen wearable profile
108 Summary: bluetooth-frwk service and conf files for tv profile
109 Requires: %{name} = %{version}-%{release}
110 Conflicts: %{name}-profile_mobile
111 Conflicts: %{name}-profile_wearable
112 Conflicts: %{name}-profile_common
113 Conflicts: %{name}-profile_ivi
114 %description profile_tv
115 Bluetooth framework configuration and service files for Tizen tv profile
118 Summary: bluetooth-frwk service and conf files for ivi profile
119 Requires: %{name} = %{version}-%{release}
120 Conflicts: %{name}-profile_mobile
121 Conflicts: %{name}-profile_wearable
122 Conflicts: %{name}-profile_tv
123 Conflicts: %{name}-profile_common
124 %description profile_ivi
125 Bluetooth framework configuration and service files for Tizen ivi profile
127 %ifarch %{ix86} x86_64
128 %package extension-emulator
129 Summary: bluetooth-frwk service and conf files for emulator
130 Requires: %{name} = %{version}-%{release}
131 %description extension-emulator
132 bluetooth-frwk service and conf files for emulator
133 %endif // ifarch %{ix86} x86_64
136 Summary: Bluetooth framework for BlueZ and Obexd
137 Group: Development/Libraries
138 Requires: %{name} = %{version}-%{release}
141 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
142 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
145 Summary: Bluetooth Service daemon
146 Group: Network & Connectivity/Bluetooth
147 Requires: %{name} = %{version}-%{release}
150 This package is Bluetooth Service daemon to manage BT services.
152 %if %{bt_http_proxy} == ENABLED
154 Summary: Bluetooth HTTP Proxy Service daemon
155 Group: Network & Connectivity/Bluetooth
156 Requires: %{name} = %{version}-%{release}
158 %description httpproxy
159 This package is Bluetooth HTTP Proxy Service daemon
163 Summary: Bluetooth OTP Service daemon
164 Group: Network & Connectivity/Bluetooth
165 Requires: %{name} = %{version}-%{release}
168 This package is Bluetooth OTP Service daemon
171 Summary: Bluetooth Core daemon
172 Group: Network & Connectivity/Bluetooth
173 Requires: %{name} = %{version}-%{release}
176 This package is Bluetooth core daemon to manage activation / deactivation.
179 Summary: Bluetooth test application
180 Group: Network & Connectivity/Bluetooth
181 Requires: %{name} = %{version}-%{release}
184 This package is Bluetooth test application.
187 Summary: Bluetooth OAL
188 Group: Network & Connectivity/Bluetooth
189 Requires: %{name} = %{version}-%{release}
192 This package is BT stack common interface.
194 %package plugin-headed
195 Summary: Bluetooth plugin Headed
196 Group: Network & Connectivity/Bluetooth
197 Requires: %{name} = %{version}-%{release}
199 %description plugin-headed
200 This package is Bluetooth plugin to manage UI and syspopup
208 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
209 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
210 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
211 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
212 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
213 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
215 %define _servicefile packaging/bluetooth-frwk-common.service
216 %define _servicedir starter.target.wants
218 %if "%{?profile}" == "mobile"
219 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
220 %if "%{?tizen_target_name}" == "TM1"
221 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
223 %define _servicefile packaging/bluetooth-frwk-mobile.service
225 %define _servicedir multi-user.target.wants
228 %if "%{?profile}" == "wearable"
229 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
230 %define _servicefile packaging/bluetooth-frwk-wearable.service
231 %define _servicedir multi-user.target.wants
234 %if "%{?profile}" == "tv"
235 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
236 %define _servicefile packaging/bluetooth-frwk-tv.service
237 %define _servicedir multi-user.target.wants
240 %if "%{?profile}" == "ivi"
241 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
242 %define _servicefile packaging/bluetooth-frwk-wearable.service
243 %define _servicedir multi-user.target.wants
247 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
248 export CFLAGS="$CFLAGS -fpie"
249 export CFLAGS+=" -DARCH64"
250 export CXXFLAGS+=" -DARCH64"
251 export FFLAGS+=" -DARCH64"
253 export CFLAGS="$CFLAGS -fpie"
254 export LDFLAGS="$CFLAGS -pie"
257 %if %{bt_bluez_hal} == ENABLED
258 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
260 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
262 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
264 %if %{bt_gatt_client_fd} == DISABLED
265 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
268 %if %{bt_permanent_log} == ENABLED
269 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PERMANENT_LOG"
272 %if %{bt_http_proxy} == ENABLED
273 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HTTP_PROXY"
276 %if %{bt_factory_mode} == ENABLED
277 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_FACTORY_MODE"
280 %if %{bt_vendor_operation} == ENABLED
281 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_VENDOR_OPERATION"
284 %if %{bt_bluez_hal} == ENABLED
285 export BT_INCLUDE_OAL_BLUEZ=ENABLED
286 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
288 export BT_INCLUDE_OAL_BLUEZ=DISABLED
291 export CFLAGS_DEFAULT="$CFLAGS"
292 export CXXFLAGS_DEFAULT="$CXXFLAGS"
293 export FFLAGS_DEFAULT="$FFLAGS"
296 %ifarch %{ix86} || %{arm}
298 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
299 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
300 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
302 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
303 -DCMAKE_LIB_DIR=%{_libdir} \
304 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
305 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
306 -DLIBNOTIFY_SUPPORT=Off \
307 -DLIBNOTIFICATION_SUPPORT=Off
313 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
317 %ifarch %{ix86} x86_64
318 export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
319 export CXXFLAGS="${CXXFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
320 export FFLAGS="${FFLAGS} -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
322 mkdir -p build_emulator
324 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
325 -DCMAKE_LIB_DIR=%{_libdir} \
326 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
327 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
328 -DLIBNOTIFY_SUPPORT=Off \
329 -DLIBNOTIFICATION_SUPPORT=Off
335 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
336 pushd build_emulator/
337 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
341 # non-extension-TM1 / non-extension-emulator
343 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
344 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
345 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
349 export CFLAGS+=" -DARCH64"
350 export CXXFLAGS+=" -DARCH64"
351 export FFLAGS+=" -DARCH64"
354 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
355 -DCMAKE_LIB_DIR=%{_libdir} \
356 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
357 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
358 -DLIBNOTIFY_SUPPORT=Off \
359 -DLIBNOTIFICATION_SUPPORT=Off
368 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
369 mkdir -p %{buildroot}%{_unitdir}/delayed.target.wants
370 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
371 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
372 mkdir -p %{buildroot}%{_meshdir}
374 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
377 %ifarch %{ix86} x86_64
378 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
379 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
382 # Rename the postfix (.mobile, .tv, ..) at post script
384 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
387 %ifarch %{ix86} || %{arm}
388 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
389 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
393 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
394 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
395 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
396 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
399 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
402 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
405 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
407 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
408 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
410 %postun -p /sbin/ldconfig
413 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
414 /usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
415 /usr/bin/chown network_fw:network_fw %{_meshdir}
418 %manifest %{name}.manifest
420 %defattr(-, root, root)
421 %{_libdir}/libbluetooth-api.so.*
422 %exclude %{_libdir}/libbluetooth-api.so*.emulator
425 %defattr(-, root, root)
426 %{_includedir}/bt-service/bluetooth-api.h
427 %{_includedir}/bt-service/bluetooth-hid-api.h
428 %{_includedir}/bt-service/bluetooth-audio-api.h
429 %{_includedir}/bt-service/bluetooth-telephony-api.h
430 %{_includedir}/bt-service/bluetooth-media-control.h
431 %{_includedir}/bt-service/bluetooth-scmst-api.h
432 %{_includedir}/bt-service/bluetooth-ipsp-api.h
433 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
434 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
435 %{_includedir}/bt-service/bluetooth-mesh-api.h
436 %{_libdir}/pkgconfig/bluetooth-api.pc
437 %{_libdir}/libbluetooth-api.so
440 %ifarch %{ix86} x86_64
441 %post extension-emulator
443 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
445 %preun extension-emulator
447 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
449 %files extension-emulator
450 %manifest %{name}.manifest
451 %defattr(-, root, root)
452 %{_libdir}/libbluetooth-api.so.*.emulator
453 %{_libdir}/libbluetooth-api.so.emulator
457 %manifest %{name}.manifest
459 %defattr(-, root, root)
460 %{_bindir}/bt-service
461 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
462 %{_bindir}/bluetooth-frwk-test
463 %{_varlibdir}/bluetooth
464 %{_prefix}/etc/bluetooth
466 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
468 %if %{bt_http_proxy} == ENABLED
470 %manifest %{name}.manifest
472 %defattr(-, root, root)
473 %{_bindir}/bt-httpproxy
474 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
475 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
479 %manifest %{name}.manifest
481 %defattr(-, root, root)
483 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
484 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
487 %manifest %{name}.manifest
489 %defattr(-, root, root)
490 %{_unitdir}/bluetooth-frwk-core.service
491 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
493 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
494 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
497 %manifest %{name}.manifest
499 %defattr(-, root, root)
500 %{_bindir}/bluetooth-frwk-test
501 #%{_bindir}/bluetooth-gatt-test
502 #%{_bindir}/bluetooth-advertising-test
505 %manifest %{name}.manifest
507 %defattr(-, root, root)
508 %{_libdir}/bt-plugin-headed.so
512 mv bluetooth-frwk.service.common bluetooth-frwk.service
514 %preun profile_common
516 mv bluetooth-frwk.service bluetooth-frwk.service.common
518 %files profile_common
520 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
521 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
522 %{_unitdir}/bluetooth-frwk.service.common
523 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
527 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
529 %preun profile_mobile
531 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
533 %files profile_mobile
535 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
536 %{_unitdir}/bluetooth-frwk.service.mobile
537 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
540 %ifarch %{ix86} || %{arm}
543 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
546 mv bt-core.tm1 bt-core
550 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
553 mv bt-core bt-core.tm1
556 %{_unitdir}/bluetooth-frwk.service.tm1
558 %defattr(-, root, root)
559 %{_bindir}/bt-core.tm1
562 %post profile_wearable
564 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
566 %preun profile_wearable
568 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
570 %files profile_wearable
572 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
573 %{_unitdir}/bluetooth-frwk.service.wearable
574 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
578 mv bluetooth-frwk.service.tv bluetooth-frwk.service
582 mv bluetooth-frwk.service bluetooth-frwk.service.tv
586 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
587 %{_unitdir}/bluetooth-frwk.service.tv
588 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
590 # Note: ivi reuses bluetooth-frwk.service.wearable
593 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
595 pushd %{_datadir}/dbus-1/system-services
596 mv org.projectx.bt.service.ivi org.projectx.bt.service
600 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
602 pushd %{_datadir}/dbus-1/system-services
603 mv org.projectx.bt.service org.projectx.bt.service.ivi
607 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
608 %{_unitdir}/bluetooth-frwk.service.wearable
609 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
612 %manifest %{name}.manifest
613 %defattr(-, root, root)
614 %{_libdir}/libbt-oal.so*
615 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
617 %if %{bt_bluez_hal} == ENABLED
618 %{_libdir}/libbluetooth.default.so*