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
23 BuildRequires: pkgconfig(aul)
24 BuildRequires: pkgconfig(dlog)
25 BuildRequires: pkgconfig(glib-2.0)
26 BuildRequires: pkgconfig(gio-2.0)
27 BuildRequires: pkgconfig(gio-unix-2.0)
28 BuildRequires: pkgconfig(syspopup-caller)
29 BuildRequires: pkgconfig(vconf)
30 BuildRequires: pkgconfig(libxml-2.0)
31 BuildRequires: pkgconfig(capi-network-connection)
32 BuildRequires: pkgconfig(alarm-service)
33 BuildRequires: pkgconfig(capi-content-mime-type)
34 BuildRequires: pkgconfig(eventsystem)
35 BuildRequires: pkgconfig(libsoup-2.4)
36 BuildRequires: pkgconfig(capi-network-tethering)
38 BuildRequires: pkgconfig(cynara-client)
39 BuildRequires: pkgconfig(cynara-creds-gdbus)
40 BuildRequires: pkgconfig(libtzplatform-config)
41 BuildRequires: pkgconfig(storage)
42 BuildRequires: pkgconfig(capi-system-info)
43 BuildRequires: pkgconfig(capi-appfw-app-control)
44 BuildRequires: pkgconfig(gmock)
45 BuildRequires: pkgconfig(libactd)
46 BuildRequires: pkgconfig(libsystemd-daemon)
48 Requires(post): /usr/bin/vconftool
49 Requires(post): /sbin/ldconfig
50 Requires(postun): /sbin/ldconfig
53 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
54 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
56 %package profile_common
57 Summary: bluetooth-frwk service and conf files for common profile
58 Requires: %{name} = %{version}-%{release}
59 Conflicts: %{name}-profile_mobile
60 Conflicts: %{name}-profile_wearable
61 Conflicts: %{name}-profile_tv
62 Conflicts: %{name}-profile_ivi
63 %description profile_common
64 Bluetooth framework configuration and service files for Tizen common profile
66 %package profile_mobile
67 Summary: bluetooth-frwk service and conf files for mobile profile
68 Requires: %{name} = %{version}-%{release}
69 Conflicts: %{name}-profile_common
70 Conflicts: %{name}-profile_wearable
71 Conflicts: %{name}-profile_tv
72 Conflicts: %{name}-profile_ivi
73 %description profile_mobile
74 Bluetooth framework configuration and service files for Tizen mobile profile
77 %ifarch %{ix86} || %{arm}
78 %package extension-TM1
79 Summary: bluetooth-frwk service and conf files for mobile TM1
80 Requires: %{name}-profile_mobile = %{version}-%{release}
81 %description extension-TM1
82 Bluetooth framework configuration and service files for Tizen mobile TM1
85 %package profile_wearable
86 Summary: bluetooth-frwk service and conf files for wearable profile
87 Requires: %{name} = %{version}-%{release}
88 Conflicts: %{name}-profile_mobile
89 Conflicts: %{name}-profile_common
90 Conflicts: %{name}-profile_tv
91 Conflicts: %{name}-profile_ivi
92 %description profile_wearable
93 Bluetooth framework configuration and service files for Tizen wearable profile
96 Summary: bluetooth-frwk service and conf files for tv profile
97 Requires: %{name} = %{version}-%{release}
98 Conflicts: %{name}-profile_mobile
99 Conflicts: %{name}-profile_wearable
100 Conflicts: %{name}-profile_common
101 Conflicts: %{name}-profile_ivi
102 %description profile_tv
103 Bluetooth framework configuration and service files for Tizen tv profile
106 Summary: bluetooth-frwk service and conf files for ivi profile
107 Requires: %{name} = %{version}-%{release}
108 Conflicts: %{name}-profile_mobile
109 Conflicts: %{name}-profile_wearable
110 Conflicts: %{name}-profile_tv
111 Conflicts: %{name}-profile_common
112 %description profile_ivi
113 Bluetooth framework configuration and service files for Tizen ivi profile
115 %ifarch %{ix86} x86_64
116 %package extension-emulator
117 Summary: bluetooth-frwk service and conf files for emulator
118 Requires: %{name} = %{version}-%{release}
119 %description extension-emulator
120 bluetooth-frwk service and conf files for emulator
121 %endif // ifarch %{ix86} x86_64
124 Summary: Bluetooth framework for BlueZ and Obexd
125 Group: Development/Libraries
126 Requires: %{name} = %{version}-%{release}
129 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
130 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
133 Summary: Bluetooth Service daemon
134 Group: Network & Connectivity/Bluetooth
135 Requires: %{name} = %{version}-%{release}
138 This package is Bluetooth Service daemon to manage BT services.
141 Summary: Bluetooth HTTP Proxy Service daemon
142 Group: Network & Connectivity/Bluetooth
143 Requires: %{name} = %{version}-%{release}
145 %description httpproxy
146 This package is Bluetooth HTTP Proxy Service daemon
149 Summary: Bluetooth OTP Service daemon
150 Group: Network & Connectivity/Bluetooth
151 Requires: %{name} = %{version}-%{release}
154 This package is Bluetooth OTP Service daemon
157 Summary: Bluetooth Core daemon
158 Group: Network & Connectivity/Bluetooth
159 Requires: %{name} = %{version}-%{release}
162 This package is Bluetooth core daemon to manage activation / deactivation.
165 Summary: Bluetooth test application
166 Group: Network & Connectivity/Bluetooth
167 Requires: %{name} = %{version}-%{release}
170 This package is Bluetooth test application.
173 Summary: Bluetooth OAL
174 Group: Network & Connectivity/Bluetooth
175 Requires: %{name} = %{version}-%{release}
178 This package is BT stack common interface.
180 %package plugin-headed
181 Summary: Bluetooth plugin Headed
182 Group: Network & Connectivity/Bluetooth
183 Requires: %{name} = %{version}-%{release}
185 %description plugin-headed
186 This package is Bluetooth plugin to manage UI and syspopup
188 %package -n bluetooth-haltests
189 Summary: HAL Test package for bluetooth OAL
191 Requires: %{name} = %{version}-%{release}
193 %description -n bluetooth-haltests
194 This package is C-API test application.
202 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
203 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
204 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
205 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
206 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
207 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
208 export CFLAGS="$CFLAGS -DTIZEN_GATT_CLIENT"
209 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_ACTD"
211 %define _servicefile packaging/bluetooth-frwk-common.service
212 %define _servicedir starter.target.wants
214 %if "%{?profile}" == "mobile"
215 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
216 %if "%{?tizen_target_name}" == "TM1"
217 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
219 %define _servicefile packaging/bluetooth-frwk-mobile.service
221 %define _servicedir multi-user.target.wants
224 %if "%{?profile}" == "wearable"
225 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
226 %define _servicefile packaging/bluetooth-frwk-wearable.service
227 %define _servicedir multi-user.target.wants
230 %if "%{?profile}" == "tv"
231 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
232 %define _servicefile packaging/bluetooth-frwk-tv.service
233 %define _servicedir multi-user.target.wants
236 %if "%{?profile}" == "ivi"
237 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
238 %define _servicefile packaging/bluetooth-frwk-wearable.service
239 %define _servicedir multi-user.target.wants
243 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
244 export CFLAGS="$CFLAGS -fpie"
245 export CFLAGS+=" -DARCH64"
246 export CXXFLAGS+=" -DARCH64"
247 export FFLAGS+=" -DARCH64"
249 export CFLAGS="$CFLAGS -fpie"
250 export LDFLAGS="$CFLAGS -pie"
253 %if %{bt_bluez_hal} == ENABLED
254 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
256 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
258 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
260 %if %{bt_gatt_client_fd} == DISABLED
261 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
264 %ifarch %{ix86} x86_64
265 export CFLAGS+=" -DTIZEN_TEST_EMUL"
266 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
267 export FFLAGS+=" -DTIZEN_TEST_EMUL"
270 %if %{bt_bluez_hal} == ENABLED
271 export BT_INCLUDE_OAL_BLUEZ=ENABLED
272 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
274 export BT_INCLUDE_OAL_BLUEZ=DISABLED
277 export CFLAGS_DEFAULT="$CFLAGS"
278 export CXXFLAGS_DEFAULT="$CXXFLAGS"
279 export FFLAGS_DEFAULT="$FFLAGS"
282 %ifarch %{ix86} || %{arm}
284 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
285 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
286 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
288 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
289 -DCMAKE_LIB_DIR=%{_libdir} \
290 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
291 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
292 -DLIBNOTIFY_SUPPORT=Off \
293 -DLIBNOTIFICATION_SUPPORT=Off
299 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
303 %ifarch %{ix86} x86_64
304 export CFLAGS="${CFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
305 export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
306 export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
308 mkdir -p build_emulator
310 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
311 -DCMAKE_LIB_DIR=%{_libdir} \
312 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
313 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
314 -DLIBNOTIFY_SUPPORT=Off \
315 -DLIBNOTIFICATION_SUPPORT=Off
321 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
322 pushd build_emulator/
323 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
327 # non-extension-TM1 / non-extension-emulator
329 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
330 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
331 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
335 export CFLAGS+=" -DARCH64"
336 export CXXFLAGS+=" -DARCH64"
337 export FFLAGS+=" -DARCH64"
340 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
341 -DCMAKE_LIB_DIR=%{_libdir} \
342 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
343 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
344 -DLIBNOTIFY_SUPPORT=Off \
345 -DLIBNOTIFICATION_SUPPORT=Off
354 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
355 mkdir -p %{buildroot}%{_unitdir}/delayed.target.wants
356 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
357 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
359 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
362 %ifarch %{ix86} x86_64
363 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
364 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
367 # Rename the postfix (.mobile, .tv, ..) at post script
369 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
372 %ifarch %{ix86} || %{arm}
373 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
374 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
378 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
379 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
380 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
381 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
384 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
387 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
390 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
392 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
393 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
395 %postun -p /sbin/ldconfig
398 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
399 /usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
402 %manifest %{name}.manifest
404 %defattr(-, root, root)
405 %{_libdir}/libbluetooth-api.so.*
406 %exclude %{_libdir}/libbluetooth-api.so*.emulator
409 %defattr(-, root, root)
410 %{_includedir}/bt-service/bluetooth-api.h
411 %{_includedir}/bt-service/bluetooth-hid-api.h
412 %{_includedir}/bt-service/bluetooth-audio-api.h
413 %{_includedir}/bt-service/bluetooth-telephony-api.h
414 %{_includedir}/bt-service/bluetooth-media-control.h
415 %{_includedir}/bt-service/bluetooth-scmst-api.h
416 %{_includedir}/bt-service/bluetooth-ipsp-api.h
417 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
418 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
419 %{_libdir}/pkgconfig/bluetooth-api.pc
420 %{_libdir}/libbluetooth-api.so
423 %ifarch %{ix86} x86_64
424 %post extension-emulator
426 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
428 %preun extension-emulator
430 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
432 %files extension-emulator
433 %manifest %{name}.manifest
434 %defattr(-, root, root)
435 %{_libdir}/libbluetooth-api.so.*.emulator
436 %{_libdir}/libbluetooth-api.so.emulator
440 %manifest %{name}.manifest
442 %defattr(-, root, root)
443 %{_bindir}/bt-service
444 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
445 %{_bindir}/bluetooth-frwk-test
446 %{_varlibdir}/bluetooth
447 %{_prefix}/etc/bluetooth
448 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
451 %manifest %{name}.manifest
453 %defattr(-, root, root)
454 %{_bindir}/bt-httpproxy
455 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
456 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
460 %manifest %{name}.manifest
462 %defattr(-, root, root)
464 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
465 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
468 %manifest %{name}.manifest
470 %defattr(-, root, root)
471 %{_unitdir}/bluetooth-frwk-core.service
472 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
474 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
475 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
478 %manifest %{name}.manifest
480 %defattr(-, root, root)
481 %{_bindir}/bluetooth-frwk-test
482 #%{_bindir}/bluetooth-gatt-test
483 #%{_bindir}/bluetooth-advertising-test
486 %manifest %{name}.manifest
488 %defattr(-, root, root)
489 %{_libdir}/bt-plugin-headed.so
493 mv bluetooth-frwk.service.common bluetooth-frwk.service
495 %preun profile_common
497 mv bluetooth-frwk.service bluetooth-frwk.service.common
499 %files profile_common
501 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
502 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
503 %{_unitdir}/bluetooth-frwk.service.common
504 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
508 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
510 %preun profile_mobile
512 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
514 %files profile_mobile
516 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
517 %{_unitdir}/bluetooth-frwk.service.mobile
518 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
521 %ifarch %{ix86} || %{arm}
524 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
527 mv bt-core.tm1 bt-core
531 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
534 mv bt-core bt-core.tm1
537 %{_unitdir}/bluetooth-frwk.service.tm1
539 %defattr(-, root, root)
540 %{_bindir}/bt-core.tm1
543 %post profile_wearable
545 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
547 %preun profile_wearable
549 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
551 %files profile_wearable
553 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
554 %{_unitdir}/bluetooth-frwk.service.wearable
555 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
559 mv bluetooth-frwk.service.tv bluetooth-frwk.service
563 mv bluetooth-frwk.service bluetooth-frwk.service.tv
567 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
568 %{_unitdir}/bluetooth-frwk.service.tv
569 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
571 # Note: ivi reuses bluetooth-frwk.service.wearable
574 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
576 pushd %{_datadir}/dbus-1/system-services
577 mv org.projectx.bt.service.ivi org.projectx.bt.service
581 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
583 pushd %{_datadir}/dbus-1/system-services
584 mv org.projectx.bt.service org.projectx.bt.service.ivi
588 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
589 %{_unitdir}/bluetooth-frwk.service.wearable
590 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
593 %manifest %{name}.manifest
594 %defattr(-, root, root)
595 %{_libdir}/libbt-oal.so*
596 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
598 %if %{bt_bluez_hal} == ENABLED
599 %{_libdir}/libbluetooth.default.so*
602 %files -n bluetooth-haltests
603 %manifest %{name}.manifest
604 %{_bindir}/bluetooth-haltests