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
24 BuildRequires: pkgconfig(aul)
25 BuildRequires: pkgconfig(dlog)
26 BuildRequires: pkgconfig(glib-2.0)
27 BuildRequires: pkgconfig(gio-2.0)
28 BuildRequires: pkgconfig(gio-unix-2.0)
29 BuildRequires: pkgconfig(syspopup-caller)
30 BuildRequires: pkgconfig(vconf)
31 BuildRequires: pkgconfig(libxml-2.0)
32 BuildRequires: pkgconfig(capi-network-connection)
33 BuildRequires: pkgconfig(alarm-service)
34 BuildRequires: pkgconfig(capi-content-mime-type)
35 BuildRequires: pkgconfig(eventsystem)
36 BuildRequires: pkgconfig(libsoup-2.4)
37 BuildRequires: pkgconfig(capi-network-tethering)
39 BuildRequires: pkgconfig(cynara-client)
40 BuildRequires: pkgconfig(cynara-creds-gdbus)
41 BuildRequires: pkgconfig(libtzplatform-config)
42 BuildRequires: pkgconfig(storage)
43 BuildRequires: pkgconfig(capi-system-info)
44 BuildRequires: pkgconfig(capi-appfw-app-control)
45 BuildRequires: pkgconfig(gmock)
46 BuildRequires: pkgconfig(libactd)
47 BuildRequires: pkgconfig(libsystemd-daemon)
49 Requires(post): /usr/bin/vconftool
50 Requires(post): /sbin/ldconfig
51 Requires(postun): /sbin/ldconfig
54 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
55 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
57 %package profile_common
58 Summary: bluetooth-frwk service and conf files for common profile
59 Requires: %{name} = %{version}-%{release}
60 Conflicts: %{name}-profile_mobile
61 Conflicts: %{name}-profile_wearable
62 Conflicts: %{name}-profile_tv
63 Conflicts: %{name}-profile_ivi
64 %description profile_common
65 Bluetooth framework configuration and service files for Tizen common profile
67 %package profile_mobile
68 Summary: bluetooth-frwk service and conf files for mobile profile
69 Requires: %{name} = %{version}-%{release}
70 Conflicts: %{name}-profile_common
71 Conflicts: %{name}-profile_wearable
72 Conflicts: %{name}-profile_tv
73 Conflicts: %{name}-profile_ivi
74 %description profile_mobile
75 Bluetooth framework configuration and service files for Tizen mobile profile
78 %ifarch %{ix86} || %{arm}
79 %package extension-TM1
80 Summary: bluetooth-frwk service and conf files for mobile TM1
81 Requires: %{name}-profile_mobile = %{version}-%{release}
82 %description extension-TM1
83 Bluetooth framework configuration and service files for Tizen mobile TM1
86 %package profile_wearable
87 Summary: bluetooth-frwk service and conf files for wearable profile
88 Requires: %{name} = %{version}-%{release}
89 Conflicts: %{name}-profile_mobile
90 Conflicts: %{name}-profile_common
91 Conflicts: %{name}-profile_tv
92 Conflicts: %{name}-profile_ivi
93 %description profile_wearable
94 Bluetooth framework configuration and service files for Tizen wearable profile
97 Summary: bluetooth-frwk service and conf files for tv profile
98 Requires: %{name} = %{version}-%{release}
99 Conflicts: %{name}-profile_mobile
100 Conflicts: %{name}-profile_wearable
101 Conflicts: %{name}-profile_common
102 Conflicts: %{name}-profile_ivi
103 %description profile_tv
104 Bluetooth framework configuration and service files for Tizen tv profile
107 Summary: bluetooth-frwk service and conf files for ivi profile
108 Requires: %{name} = %{version}-%{release}
109 Conflicts: %{name}-profile_mobile
110 Conflicts: %{name}-profile_wearable
111 Conflicts: %{name}-profile_tv
112 Conflicts: %{name}-profile_common
113 %description profile_ivi
114 Bluetooth framework configuration and service files for Tizen ivi profile
116 %ifarch %{ix86} x86_64
117 %package extension-emulator
118 Summary: bluetooth-frwk service and conf files for emulator
119 Requires: %{name} = %{version}-%{release}
120 %description extension-emulator
121 bluetooth-frwk service and conf files for emulator
122 %endif // ifarch %{ix86} x86_64
125 Summary: Bluetooth framework for BlueZ and Obexd
126 Group: Development/Libraries
127 Requires: %{name} = %{version}-%{release}
130 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
131 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
134 Summary: Bluetooth Service daemon
135 Group: Network & Connectivity/Bluetooth
136 Requires: %{name} = %{version}-%{release}
139 This package is Bluetooth Service daemon to manage BT services.
142 Summary: Bluetooth HTTP Proxy Service daemon
143 Group: Network & Connectivity/Bluetooth
144 Requires: %{name} = %{version}-%{release}
146 %description httpproxy
147 This package is Bluetooth HTTP Proxy Service daemon
150 Summary: Bluetooth OTP Service daemon
151 Group: Network & Connectivity/Bluetooth
152 Requires: %{name} = %{version}-%{release}
155 This package is Bluetooth OTP Service daemon
158 Summary: Bluetooth Core daemon
159 Group: Network & Connectivity/Bluetooth
160 Requires: %{name} = %{version}-%{release}
163 This package is Bluetooth core daemon to manage activation / deactivation.
166 Summary: Bluetooth test application
167 Group: Network & Connectivity/Bluetooth
168 Requires: %{name} = %{version}-%{release}
171 This package is Bluetooth test application.
174 Summary: Bluetooth OAL
175 Group: Network & Connectivity/Bluetooth
176 Requires: %{name} = %{version}-%{release}
179 This package is BT stack common interface.
181 %package plugin-headed
182 Summary: Bluetooth plugin Headed
183 Group: Network & Connectivity/Bluetooth
184 Requires: %{name} = %{version}-%{release}
186 %description plugin-headed
187 This package is Bluetooth plugin to manage UI and syspopup
189 %package -n bluetooth-haltests
190 Summary: HAL Test package for bluetooth OAL
192 Requires: %{name} = %{version}-%{release}
194 %description -n bluetooth-haltests
195 This package is C-API test application.
203 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
204 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
205 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
206 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
207 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
208 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
209 export CFLAGS="$CFLAGS -DTIZEN_GATT_CLIENT"
210 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_ACTD"
212 %define _servicefile packaging/bluetooth-frwk-common.service
213 %define _servicedir starter.target.wants
215 %if "%{?profile}" == "mobile"
216 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
217 %if "%{?tizen_target_name}" == "TM1"
218 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
220 %define _servicefile packaging/bluetooth-frwk-mobile.service
222 %define _servicedir multi-user.target.wants
225 %if "%{?profile}" == "wearable"
226 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
227 %define _servicefile packaging/bluetooth-frwk-wearable.service
228 %define _servicedir multi-user.target.wants
231 %if "%{?profile}" == "tv"
232 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
233 %define _servicefile packaging/bluetooth-frwk-tv.service
234 %define _servicedir multi-user.target.wants
237 %if "%{?profile}" == "ivi"
238 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
239 %define _servicefile packaging/bluetooth-frwk-wearable.service
240 %define _servicedir multi-user.target.wants
244 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
245 export CFLAGS="$CFLAGS -fpie"
246 export CFLAGS+=" -DARCH64"
247 export CXXFLAGS+=" -DARCH64"
248 export FFLAGS+=" -DARCH64"
250 export CFLAGS="$CFLAGS -fpie"
251 export LDFLAGS="$CFLAGS -pie"
254 %if %{bt_bluez_hal} == ENABLED
255 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
257 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
259 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
261 %if %{bt_gatt_client_fd} == DISABLED
262 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
265 %if %{bt_permanent_log} == ENABLED
266 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PERMANENT_LOG"
269 %ifarch %{ix86} x86_64
270 export CFLAGS+=" -DTIZEN_TEST_EMUL"
271 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
272 export FFLAGS+=" -DTIZEN_TEST_EMUL"
275 %if %{bt_bluez_hal} == ENABLED
276 export BT_INCLUDE_OAL_BLUEZ=ENABLED
277 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
279 export BT_INCLUDE_OAL_BLUEZ=DISABLED
282 export CFLAGS_DEFAULT="$CFLAGS"
283 export CXXFLAGS_DEFAULT="$CXXFLAGS"
284 export FFLAGS_DEFAULT="$FFLAGS"
287 %ifarch %{ix86} || %{arm}
289 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
290 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
291 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
293 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
294 -DCMAKE_LIB_DIR=%{_libdir} \
295 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
296 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
297 -DLIBNOTIFY_SUPPORT=Off \
298 -DLIBNOTIFICATION_SUPPORT=Off
304 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
308 %ifarch %{ix86} x86_64
309 export CFLAGS="${CFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
310 export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
311 export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
313 mkdir -p build_emulator
315 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
316 -DCMAKE_LIB_DIR=%{_libdir} \
317 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
318 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
319 -DLIBNOTIFY_SUPPORT=Off \
320 -DLIBNOTIFICATION_SUPPORT=Off
326 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
327 pushd build_emulator/
328 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
332 # non-extension-TM1 / non-extension-emulator
334 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
335 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
336 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
340 export CFLAGS+=" -DARCH64"
341 export CXXFLAGS+=" -DARCH64"
342 export FFLAGS+=" -DARCH64"
345 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
346 -DCMAKE_LIB_DIR=%{_libdir} \
347 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
348 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
349 -DLIBNOTIFY_SUPPORT=Off \
350 -DLIBNOTIFICATION_SUPPORT=Off
359 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
360 mkdir -p %{buildroot}%{_unitdir}/delayed.target.wants
361 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
362 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
364 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
367 %ifarch %{ix86} x86_64
368 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
369 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
372 # Rename the postfix (.mobile, .tv, ..) at post script
374 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
377 %ifarch %{ix86} || %{arm}
378 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
379 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
383 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
384 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
385 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
386 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
389 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
392 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
395 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
397 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
398 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
400 %postun -p /sbin/ldconfig
403 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
404 /usr/bin/chown network_fw:network_fw %{_varlibdir}/bluetooth/auto-pair-blacklist
407 %manifest %{name}.manifest
409 %defattr(-, root, root)
410 %{_libdir}/libbluetooth-api.so.*
411 %exclude %{_libdir}/libbluetooth-api.so*.emulator
414 %defattr(-, root, root)
415 %{_includedir}/bt-service/bluetooth-api.h
416 %{_includedir}/bt-service/bluetooth-hid-api.h
417 %{_includedir}/bt-service/bluetooth-audio-api.h
418 %{_includedir}/bt-service/bluetooth-telephony-api.h
419 %{_includedir}/bt-service/bluetooth-media-control.h
420 %{_includedir}/bt-service/bluetooth-scmst-api.h
421 %{_includedir}/bt-service/bluetooth-ipsp-api.h
422 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
423 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
424 %{_libdir}/pkgconfig/bluetooth-api.pc
425 %{_libdir}/libbluetooth-api.so
428 %ifarch %{ix86} x86_64
429 %post extension-emulator
431 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
433 %preun extension-emulator
435 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
437 %files extension-emulator
438 %manifest %{name}.manifest
439 %defattr(-, root, root)
440 %{_libdir}/libbluetooth-api.so.*.emulator
441 %{_libdir}/libbluetooth-api.so.emulator
445 %manifest %{name}.manifest
447 %defattr(-, root, root)
448 %{_bindir}/bt-service
449 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
450 %{_bindir}/bluetooth-frwk-test
451 %{_varlibdir}/bluetooth
452 %{_prefix}/etc/bluetooth
453 %attr(-,network_fw,network_fw) %{_varlibdir}/bluetooth/auto-pair-blacklist
456 %manifest %{name}.manifest
458 %defattr(-, root, root)
459 %{_bindir}/bt-httpproxy
460 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
461 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
465 %manifest %{name}.manifest
467 %defattr(-, root, root)
469 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
470 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
473 %manifest %{name}.manifest
475 %defattr(-, root, root)
476 %{_unitdir}/bluetooth-frwk-core.service
477 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
479 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
480 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
483 %manifest %{name}.manifest
485 %defattr(-, root, root)
486 %{_bindir}/bluetooth-frwk-test
487 #%{_bindir}/bluetooth-gatt-test
488 #%{_bindir}/bluetooth-advertising-test
491 %manifest %{name}.manifest
493 %defattr(-, root, root)
494 %{_libdir}/bt-plugin-headed.so
498 mv bluetooth-frwk.service.common bluetooth-frwk.service
500 %preun profile_common
502 mv bluetooth-frwk.service bluetooth-frwk.service.common
504 %files profile_common
506 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
507 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
508 %{_unitdir}/bluetooth-frwk.service.common
509 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
513 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
515 %preun profile_mobile
517 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
519 %files profile_mobile
521 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
522 %{_unitdir}/bluetooth-frwk.service.mobile
523 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
526 %ifarch %{ix86} || %{arm}
529 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
532 mv bt-core.tm1 bt-core
536 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
539 mv bt-core bt-core.tm1
542 %{_unitdir}/bluetooth-frwk.service.tm1
544 %defattr(-, root, root)
545 %{_bindir}/bt-core.tm1
548 %post profile_wearable
550 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
552 %preun profile_wearable
554 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
556 %files profile_wearable
558 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
559 %{_unitdir}/bluetooth-frwk.service.wearable
560 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
564 mv bluetooth-frwk.service.tv bluetooth-frwk.service
568 mv bluetooth-frwk.service bluetooth-frwk.service.tv
572 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
573 %{_unitdir}/bluetooth-frwk.service.tv
574 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
576 # Note: ivi reuses bluetooth-frwk.service.wearable
579 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
581 pushd %{_datadir}/dbus-1/system-services
582 mv org.projectx.bt.service.ivi org.projectx.bt.service
586 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
588 pushd %{_datadir}/dbus-1/system-services
589 mv org.projectx.bt.service org.projectx.bt.service.ivi
593 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
594 %{_unitdir}/bluetooth-frwk.service.wearable
595 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
598 %manifest %{name}.manifest
599 %defattr(-, root, root)
600 %{_libdir}/libbt-oal.so*
601 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
603 %if %{bt_bluez_hal} == ENABLED
604 %{_libdir}/libbluetooth.default.so*
607 %files -n bluetooth-haltests
608 %manifest %{name}.manifest
609 %{_bindir}/bluetooth-haltests