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)
47 Requires(post): /usr/bin/vconftool
48 Requires(post): /sbin/ldconfig
49 Requires(postun): /sbin/ldconfig
52 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
53 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
55 %package profile_common
56 Summary: bluetooth-frwk service and conf files for common profile
57 Requires: %{name} = %{version}-%{release}
58 Conflicts: %{name}-profile_mobile
59 Conflicts: %{name}-profile_wearable
60 Conflicts: %{name}-profile_tv
61 Conflicts: %{name}-profile_ivi
62 %description profile_common
63 Bluetooth framework configuration and service files for Tizen common profile
65 %package profile_mobile
66 Summary: bluetooth-frwk service and conf files for mobile profile
67 Requires: %{name} = %{version}-%{release}
68 Conflicts: %{name}-profile_common
69 Conflicts: %{name}-profile_wearable
70 Conflicts: %{name}-profile_tv
71 Conflicts: %{name}-profile_ivi
72 %description profile_mobile
73 Bluetooth framework configuration and service files for Tizen mobile profile
76 %ifarch %{ix86} || %{arm}
77 %package extension-TM1
78 Summary: bluetooth-frwk service and conf files for mobile TM1
79 Requires: %{name}-profile_mobile = %{version}-%{release}
80 %description extension-TM1
81 Bluetooth framework configuration and service files for Tizen mobile TM1
84 %package profile_wearable
85 Summary: bluetooth-frwk service and conf files for wearable profile
86 Requires: %{name} = %{version}-%{release}
87 Conflicts: %{name}-profile_mobile
88 Conflicts: %{name}-profile_common
89 Conflicts: %{name}-profile_tv
90 Conflicts: %{name}-profile_ivi
91 %description profile_wearable
92 Bluetooth framework configuration and service files for Tizen wearable profile
95 Summary: bluetooth-frwk service and conf files for tv profile
96 Requires: %{name} = %{version}-%{release}
97 Conflicts: %{name}-profile_mobile
98 Conflicts: %{name}-profile_wearable
99 Conflicts: %{name}-profile_common
100 Conflicts: %{name}-profile_ivi
101 %description profile_tv
102 Bluetooth framework configuration and service files for Tizen tv profile
105 Summary: bluetooth-frwk service and conf files for ivi profile
106 Requires: %{name} = %{version}-%{release}
107 Conflicts: %{name}-profile_mobile
108 Conflicts: %{name}-profile_wearable
109 Conflicts: %{name}-profile_tv
110 Conflicts: %{name}-profile_common
111 %description profile_ivi
112 Bluetooth framework configuration and service files for Tizen ivi profile
114 %ifarch %{ix86} x86_64
115 %package extension-emulator
116 Summary: bluetooth-frwk service and conf files for emulator
117 Requires: %{name} = %{version}-%{release}
118 %description extension-emulator
119 bluetooth-frwk service and conf files for emulator
120 %endif // ifarch %{ix86} x86_64
123 Summary: Bluetooth framework for BlueZ and Obexd
124 Group: Development/Libraries
125 Requires: %{name} = %{version}-%{release}
128 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
129 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
132 Summary: Bluetooth Service daemon
133 Group: Network & Connectivity/Bluetooth
134 Requires: %{name} = %{version}-%{release}
137 This package is Bluetooth Service daemon to manage BT services.
140 Summary: Bluetooth HTTP Proxy Service daemon
141 Group: Network & Connectivity/Bluetooth
142 Requires: %{name} = %{version}-%{release}
144 %description httpproxy
145 This package is Bluetooth HTTP Proxy Service daemon
148 Summary: Bluetooth OTP Service daemon
149 Group: Network & Connectivity/Bluetooth
150 Requires: %{name} = %{version}-%{release}
153 This package is Bluetooth OTP Service daemon
156 Summary: Bluetooth Core daemon
157 Group: Network & Connectivity/Bluetooth
158 Requires: %{name} = %{version}-%{release}
161 This package is Bluetooth core daemon to manage activation / deactivation.
164 Summary: Bluetooth test application
165 Group: Network & Connectivity/Bluetooth
166 Requires: %{name} = %{version}-%{release}
169 This package is Bluetooth test application.
172 Summary: Bluetooth OAL
173 Group: Network & Connectivity/Bluetooth
174 Requires: %{name} = %{version}-%{release}
177 This package is BT stack common interface.
179 %package plugin-headed
180 Summary: Bluetooth plugin Headed
181 Group: Network & Connectivity/Bluetooth
182 Requires: %{name} = %{version}-%{release}
184 %description plugin-headed
185 This package is Bluetooth plugin to manage UI and syspopup
187 %package -n bluetooth-haltests
188 Summary: HAL Test package for bluetooth OAL
190 Requires: %{name} = %{version}-%{release}
192 %description -n bluetooth-haltests
193 This package is C-API test application.
201 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
202 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
203 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
204 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
205 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
206 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
207 export CFLAGS="$CFLAGS -DTIZEN_GATT_CLIENT"
208 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_ACTD"
210 %define _servicefile packaging/bluetooth-frwk-common.service
211 %define _servicedir starter.target.wants
213 %if "%{?profile}" == "mobile"
214 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
215 %if "%{?tizen_target_name}" == "TM1"
216 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
218 %define _servicefile packaging/bluetooth-frwk-mobile.service
220 %define _servicedir multi-user.target.wants
223 %if "%{?profile}" == "wearable"
224 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
225 %define _servicefile packaging/bluetooth-frwk-wearable.service
226 %define _servicedir multi-user.target.wants
229 %if "%{?profile}" == "tv"
230 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
231 %define _servicefile packaging/bluetooth-frwk-tv.service
232 %define _servicedir multi-user.target.wants
235 %if "%{?profile}" == "ivi"
236 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
237 %define _servicefile packaging/bluetooth-frwk-wearable.service
238 %define _servicedir multi-user.target.wants
242 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
243 export CFLAGS="$CFLAGS -fpie"
244 export CFLAGS+=" -DARCH64"
245 export CXXFLAGS+=" -DARCH64"
246 export FFLAGS+=" -DARCH64"
248 export CFLAGS="$CFLAGS -fpie"
249 export LDFLAGS="$CFLAGS -pie"
252 %if %{bt_bluez_hal} == ENABLED
253 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
255 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
257 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
259 %if %{bt_gatt_client_fd} == DISABLED
260 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
263 %ifarch %{ix86} x86_64
264 export CFLAGS+=" -DTIZEN_TEST_EMUL"
265 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
266 export FFLAGS+=" -DTIZEN_TEST_EMUL"
269 %if %{bt_bluez_hal} == ENABLED
270 export BT_INCLUDE_OAL_BLUEZ=ENABLED
271 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
273 export BT_INCLUDE_OAL_BLUEZ=DISABLED
276 export CFLAGS_DEFAULT="$CFLAGS"
277 export CXXFLAGS_DEFAULT="$CXXFLAGS"
278 export FFLAGS_DEFAULT="$FFLAGS"
281 %ifarch %{ix86} || %{arm}
283 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
284 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
285 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
287 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
288 -DCMAKE_LIB_DIR=%{_libdir} \
289 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
290 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
291 -DLIBNOTIFY_SUPPORT=Off \
292 -DLIBNOTIFICATION_SUPPORT=Off
298 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
302 %ifarch %{ix86} x86_64
303 export CFLAGS="${CFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
304 export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
305 export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
307 mkdir -p build_emulator
309 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
310 -DCMAKE_LIB_DIR=%{_libdir} \
311 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
312 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
313 -DLIBNOTIFY_SUPPORT=Off \
314 -DLIBNOTIFICATION_SUPPORT=Off
320 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
321 pushd build_emulator/
322 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
326 # non-extension-TM1 / non-extension-emulator
328 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
329 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
330 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
334 export CFLAGS+=" -DARCH64"
335 export CXXFLAGS+=" -DARCH64"
336 export FFLAGS+=" -DARCH64"
339 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
340 -DCMAKE_LIB_DIR=%{_libdir} \
341 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
342 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
343 -DLIBNOTIFY_SUPPORT=Off \
344 -DLIBNOTIFICATION_SUPPORT=Off
353 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
354 mkdir -p %{buildroot}%{_unitdir}/delayed.target.wants
355 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
356 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
358 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
361 %ifarch %{ix86} x86_64
362 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
363 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
366 # Rename the postfix (.mobile, .tv, ..) at post script
368 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
371 %ifarch %{ix86} || %{arm}
372 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
373 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
377 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
378 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
379 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
380 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
383 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
386 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
389 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
391 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
392 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
395 mkdir -p %{_libdir}/systemd/system/delayed.target.wants
396 ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_libdir}/systemd/system/delayed.target.wants/bluetooth-frwk-core.service
398 %postun -p /sbin/ldconfig
401 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
402 /usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
405 %manifest %{name}.manifest
407 %defattr(-, root, root)
408 %{_libdir}/libbluetooth-api.so.*
409 %exclude %{_libdir}/libbluetooth-api.so*.emulator
412 %defattr(-, root, root)
413 %{_includedir}/bt-service/bluetooth-api.h
414 %{_includedir}/bt-service/bluetooth-hid-api.h
415 %{_includedir}/bt-service/bluetooth-audio-api.h
416 %{_includedir}/bt-service/bluetooth-telephony-api.h
417 %{_includedir}/bt-service/bluetooth-media-control.h
418 %{_includedir}/bt-service/bluetooth-scmst-api.h
419 %{_includedir}/bt-service/bluetooth-ipsp-api.h
420 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
421 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
422 %{_libdir}/pkgconfig/bluetooth-api.pc
423 %{_libdir}/libbluetooth-api.so
426 %ifarch %{ix86} x86_64
427 %post extension-emulator
429 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
431 %preun extension-emulator
433 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
435 %files extension-emulator
436 %manifest %{name}.manifest
437 %defattr(-, root, root)
438 %{_libdir}/libbluetooth-api.so.*.emulator
439 %{_libdir}/libbluetooth-api.so.emulator
443 %manifest %{name}.manifest
445 %defattr(-, root, root)
446 %{_bindir}/bt-service
447 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
448 %{_bindir}/bluetooth-frwk-test
449 %{_varlibdir}/bluetooth
450 %{_prefix}/etc/bluetooth
451 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
454 %manifest %{name}.manifest
456 %defattr(-, root, root)
457 %{_bindir}/bt-httpproxy
458 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
459 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
463 %manifest %{name}.manifest
465 %defattr(-, root, root)
467 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
468 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
471 %manifest %{name}.manifest
473 %defattr(-, root, root)
474 %{_unitdir}/bluetooth-frwk-core.service
475 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
477 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
478 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
481 %manifest %{name}.manifest
483 %defattr(-, root, root)
484 %{_bindir}/bluetooth-frwk-test
485 #%{_bindir}/bluetooth-gatt-test
486 #%{_bindir}/bluetooth-advertising-test
489 %manifest %{name}.manifest
491 %defattr(-, root, root)
492 %{_libdir}/bt-plugin-headed.so
496 mv bluetooth-frwk.service.common bluetooth-frwk.service
498 %preun profile_common
500 mv bluetooth-frwk.service bluetooth-frwk.service.common
502 %files profile_common
504 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
505 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
506 %{_unitdir}/bluetooth-frwk.service.common
507 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
511 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
513 %preun profile_mobile
515 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
517 %files profile_mobile
519 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
520 %{_unitdir}/bluetooth-frwk.service.mobile
521 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
524 %ifarch %{ix86} || %{arm}
527 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
530 mv bt-core.tm1 bt-core
534 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
537 mv bt-core bt-core.tm1
540 %{_unitdir}/bluetooth-frwk.service.tm1
542 %defattr(-, root, root)
543 %{_bindir}/bt-core.tm1
546 %post profile_wearable
548 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
550 %preun profile_wearable
552 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
554 %files profile_wearable
556 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
557 %{_unitdir}/bluetooth-frwk.service.wearable
558 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
562 mv bluetooth-frwk.service.tv bluetooth-frwk.service
566 mv bluetooth-frwk.service bluetooth-frwk.service.tv
570 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
571 %{_unitdir}/bluetooth-frwk.service.tv
572 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
574 # Note: ivi reuses bluetooth-frwk.service.wearable
577 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
579 pushd %{_datadir}/dbus-1/system-services
580 mv org.projectx.bt.service.ivi org.projectx.bt.service
584 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
586 pushd %{_datadir}/dbus-1/system-services
587 mv org.projectx.bt.service org.projectx.bt.service.ivi
591 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
592 %{_unitdir}/bluetooth-frwk.service.wearable
593 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
596 %manifest %{name}.manifest
597 %defattr(-, root, root)
598 %{_libdir}/libbt-oal.so*
599 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
601 %if %{bt_bluez_hal} == ENABLED
602 %{_libdir}/libbluetooth.default.so*
605 %files -n bluetooth-haltests
606 %manifest %{name}.manifest
607 %{_bindir}/bluetooth-haltests