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
10 Summary: Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
13 Group: Network & Connectivity/Bluetooth
15 Source0: %{name}-%{version}.tar.gz
16 Source1001: bluetooth-frwk.manifest
18 Requires: bluetooth-tools
20 %define bt_bluez_hal ENABLED
21 %define bt_gatt_client_fd ENABLED
22 %define bt_permanent_log DISABLED
23 %define bt_http_proxy DISABLED
25 BuildRequires: pkgconfig(aul)
26 BuildRequires: pkgconfig(dlog)
27 BuildRequires: pkgconfig(glib-2.0)
28 BuildRequires: pkgconfig(gio-2.0)
29 BuildRequires: pkgconfig(gio-unix-2.0)
30 BuildRequires: pkgconfig(syspopup-caller)
31 BuildRequires: pkgconfig(vconf)
32 BuildRequires: pkgconfig(libxml-2.0)
33 BuildRequires: pkgconfig(capi-network-connection)
34 BuildRequires: pkgconfig(alarm-service)
35 BuildRequires: pkgconfig(capi-content-mime-type)
36 BuildRequires: pkgconfig(eventsystem)
37 %if %{bt_http_proxy} == ENABLED
38 BuildRequires: pkgconfig(libsoup-2.4)
40 BuildRequires: pkgconfig(capi-network-tethering)
42 BuildRequires: pkgconfig(cynara-client)
43 BuildRequires: pkgconfig(cynara-creds-gdbus)
44 BuildRequires: pkgconfig(libtzplatform-config)
45 BuildRequires: pkgconfig(storage)
46 BuildRequires: pkgconfig(capi-system-info)
47 BuildRequires: pkgconfig(capi-appfw-app-control)
48 BuildRequires: pkgconfig(gmock)
49 BuildRequires: pkgconfig(libactd)
50 BuildRequires: pkgconfig(libsystemd-daemon)
52 Requires(post): /usr/bin/vconftool
53 Requires(post): /sbin/ldconfig
54 Requires(postun): /sbin/ldconfig
57 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
58 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
60 %package profile_common
61 Summary: bluetooth-frwk service and conf files for common profile
62 Requires: %{name} = %{version}-%{release}
63 Conflicts: %{name}-profile_mobile
64 Conflicts: %{name}-profile_wearable
65 Conflicts: %{name}-profile_tv
66 Conflicts: %{name}-profile_ivi
67 %description profile_common
68 Bluetooth framework configuration and service files for Tizen common profile
70 %package profile_mobile
71 Summary: bluetooth-frwk service and conf files for mobile profile
72 Requires: %{name} = %{version}-%{release}
73 Conflicts: %{name}-profile_common
74 Conflicts: %{name}-profile_wearable
75 Conflicts: %{name}-profile_tv
76 Conflicts: %{name}-profile_ivi
77 %description profile_mobile
78 Bluetooth framework configuration and service files for Tizen mobile profile
81 %ifarch %{ix86} || %{arm}
82 %package extension-TM1
83 Summary: bluetooth-frwk service and conf files for mobile TM1
84 Requires: %{name}-profile_mobile = %{version}-%{release}
85 %description extension-TM1
86 Bluetooth framework configuration and service files for Tizen mobile TM1
89 %package profile_wearable
90 Summary: bluetooth-frwk service and conf files for wearable profile
91 Requires: %{name} = %{version}-%{release}
92 Conflicts: %{name}-profile_mobile
93 Conflicts: %{name}-profile_common
94 Conflicts: %{name}-profile_tv
95 Conflicts: %{name}-profile_ivi
96 %description profile_wearable
97 Bluetooth framework configuration and service files for Tizen wearable profile
100 Summary: bluetooth-frwk service and conf files for tv profile
101 Requires: %{name} = %{version}-%{release}
102 Conflicts: %{name}-profile_mobile
103 Conflicts: %{name}-profile_wearable
104 Conflicts: %{name}-profile_common
105 Conflicts: %{name}-profile_ivi
106 %description profile_tv
107 Bluetooth framework configuration and service files for Tizen tv profile
110 Summary: bluetooth-frwk service and conf files for ivi profile
111 Requires: %{name} = %{version}-%{release}
112 Conflicts: %{name}-profile_mobile
113 Conflicts: %{name}-profile_wearable
114 Conflicts: %{name}-profile_tv
115 Conflicts: %{name}-profile_common
116 %description profile_ivi
117 Bluetooth framework configuration and service files for Tizen ivi profile
119 %ifarch %{ix86} x86_64
120 %package extension-emulator
121 Summary: bluetooth-frwk service and conf files for emulator
122 Requires: %{name} = %{version}-%{release}
123 %description extension-emulator
124 bluetooth-frwk service and conf files for emulator
125 %endif // ifarch %{ix86} x86_64
128 Summary: Bluetooth framework for BlueZ and Obexd
129 Group: Development/Libraries
130 Requires: %{name} = %{version}-%{release}
133 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
134 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
137 Summary: Bluetooth Service daemon
138 Group: Network & Connectivity/Bluetooth
139 Requires: %{name} = %{version}-%{release}
142 This package is Bluetooth Service daemon to manage BT services.
144 %if %{bt_http_proxy} == ENABLED
146 Summary: Bluetooth HTTP Proxy Service daemon
147 Group: Network & Connectivity/Bluetooth
148 Requires: %{name} = %{version}-%{release}
150 %description httpproxy
151 This package is Bluetooth HTTP Proxy Service daemon
155 Summary: Bluetooth OTP Service daemon
156 Group: Network & Connectivity/Bluetooth
157 Requires: %{name} = %{version}-%{release}
160 This package is Bluetooth OTP Service daemon
163 Summary: Bluetooth Core daemon
164 Group: Network & Connectivity/Bluetooth
165 Requires: %{name} = %{version}-%{release}
168 This package is Bluetooth core daemon to manage activation / deactivation.
171 Summary: Bluetooth test application
172 Group: Network & Connectivity/Bluetooth
173 Requires: %{name} = %{version}-%{release}
176 This package is Bluetooth test application.
179 Summary: Bluetooth OAL
180 Group: Network & Connectivity/Bluetooth
181 Requires: %{name} = %{version}-%{release}
184 This package is BT stack common interface.
186 %package plugin-headed
187 Summary: Bluetooth plugin Headed
188 Group: Network & Connectivity/Bluetooth
189 Requires: %{name} = %{version}-%{release}
191 %description plugin-headed
192 This package is Bluetooth plugin to manage UI and syspopup
194 %package -n bluetooth-haltests
195 Summary: HAL Test package for bluetooth OAL
197 Requires: %{name} = %{version}-%{release}
199 %description -n bluetooth-haltests
200 This package is C-API test application.
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"
214 export CFLAGS="$CFLAGS -DTIZEN_GATT_CLIENT"
215 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_ACTD"
217 %define _servicefile packaging/bluetooth-frwk-common.service
218 %define _servicedir starter.target.wants
220 %if "%{?profile}" == "mobile"
221 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
222 %if "%{?tizen_target_name}" == "TM1"
223 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
225 %define _servicefile packaging/bluetooth-frwk-mobile.service
227 %define _servicedir multi-user.target.wants
230 %if "%{?profile}" == "wearable"
231 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
232 %define _servicefile packaging/bluetooth-frwk-wearable.service
233 %define _servicedir multi-user.target.wants
236 %if "%{?profile}" == "tv"
237 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
238 %define _servicefile packaging/bluetooth-frwk-tv.service
239 %define _servicedir multi-user.target.wants
242 %if "%{?profile}" == "ivi"
243 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
244 %define _servicefile packaging/bluetooth-frwk-wearable.service
245 %define _servicedir multi-user.target.wants
249 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
250 export CFLAGS="$CFLAGS -fpie"
251 export CFLAGS+=" -DARCH64"
252 export CXXFLAGS+=" -DARCH64"
253 export FFLAGS+=" -DARCH64"
255 export CFLAGS="$CFLAGS -fpie"
256 export LDFLAGS="$CFLAGS -pie"
259 %if %{bt_bluez_hal} == ENABLED
260 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
262 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
264 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
266 %if %{bt_gatt_client_fd} == DISABLED
267 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
270 %if %{bt_permanent_log} == ENABLED
271 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PERMANENT_LOG"
274 %if %{bt_http_proxy} == ENABLED
275 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HTTP_PROXY"
278 %ifarch %{ix86} x86_64
279 export CFLAGS+=" -DTIZEN_TEST_EMUL"
280 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
281 export FFLAGS+=" -DTIZEN_TEST_EMUL"
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_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
299 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
300 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -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_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
319 export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
320 export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -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
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
416 %manifest %{name}.manifest
418 %defattr(-, root, root)
419 %{_libdir}/libbluetooth-api.so.*
420 %exclude %{_libdir}/libbluetooth-api.so*.emulator
423 %defattr(-, root, root)
424 %{_includedir}/bt-service/bluetooth-api.h
425 %{_includedir}/bt-service/bluetooth-hid-api.h
426 %{_includedir}/bt-service/bluetooth-audio-api.h
427 %{_includedir}/bt-service/bluetooth-telephony-api.h
428 %{_includedir}/bt-service/bluetooth-media-control.h
429 %{_includedir}/bt-service/bluetooth-scmst-api.h
430 %{_includedir}/bt-service/bluetooth-ipsp-api.h
431 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
432 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
433 %{_libdir}/pkgconfig/bluetooth-api.pc
434 %{_libdir}/libbluetooth-api.so
437 %ifarch %{ix86} x86_64
438 %post extension-emulator
440 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
442 %preun extension-emulator
444 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
446 %files extension-emulator
447 %manifest %{name}.manifest
448 %defattr(-, root, root)
449 %{_libdir}/libbluetooth-api.so.*.emulator
450 %{_libdir}/libbluetooth-api.so.emulator
454 %manifest %{name}.manifest
456 %defattr(-, root, root)
457 %{_bindir}/bt-service
458 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
459 %{_bindir}/bluetooth-frwk-test
460 %{_varlibdir}/bluetooth
461 %{_prefix}/etc/bluetooth
462 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
464 %if %{bt_http_proxy} == ENABLED
466 %manifest %{name}.manifest
468 %defattr(-, root, root)
469 %{_bindir}/bt-httpproxy
470 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
471 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
475 %manifest %{name}.manifest
477 %defattr(-, root, root)
479 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
480 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
483 %manifest %{name}.manifest
485 %defattr(-, root, root)
486 %{_unitdir}/bluetooth-frwk-core.service
487 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
489 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
490 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
493 %manifest %{name}.manifest
495 %defattr(-, root, root)
496 %{_bindir}/bluetooth-frwk-test
497 #%{_bindir}/bluetooth-gatt-test
498 #%{_bindir}/bluetooth-advertising-test
501 %manifest %{name}.manifest
503 %defattr(-, root, root)
504 %{_libdir}/bt-plugin-headed.so
508 mv bluetooth-frwk.service.common bluetooth-frwk.service
510 %preun profile_common
512 mv bluetooth-frwk.service bluetooth-frwk.service.common
514 %files profile_common
516 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
517 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
518 %{_unitdir}/bluetooth-frwk.service.common
519 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
523 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
525 %preun profile_mobile
527 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
529 %files profile_mobile
531 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
532 %{_unitdir}/bluetooth-frwk.service.mobile
533 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
536 %ifarch %{ix86} || %{arm}
539 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
542 mv bt-core.tm1 bt-core
546 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
549 mv bt-core bt-core.tm1
552 %{_unitdir}/bluetooth-frwk.service.tm1
554 %defattr(-, root, root)
555 %{_bindir}/bt-core.tm1
558 %post profile_wearable
560 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
562 %preun profile_wearable
564 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
566 %files profile_wearable
568 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
569 %{_unitdir}/bluetooth-frwk.service.wearable
570 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
574 mv bluetooth-frwk.service.tv bluetooth-frwk.service
578 mv bluetooth-frwk.service bluetooth-frwk.service.tv
582 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
583 %{_unitdir}/bluetooth-frwk.service.tv
584 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
586 # Note: ivi reuses bluetooth-frwk.service.wearable
589 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
591 pushd %{_datadir}/dbus-1/system-services
592 mv org.projectx.bt.service.ivi org.projectx.bt.service
596 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
598 pushd %{_datadir}/dbus-1/system-services
599 mv org.projectx.bt.service org.projectx.bt.service.ivi
603 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
604 %{_unitdir}/bluetooth-frwk.service.wearable
605 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
608 %manifest %{name}.manifest
609 %defattr(-, root, root)
610 %{_libdir}/libbt-oal.so*
611 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
613 %if %{bt_bluez_hal} == ENABLED
614 %{_libdir}/libbluetooth.default.so*
617 %files -n bluetooth-haltests
618 %manifest %{name}.manifest
619 %{_bindir}/bluetooth-haltests