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
22 BuildRequires: pkgconfig(aul)
23 BuildRequires: pkgconfig(dlog)
24 BuildRequires: pkgconfig(glib-2.0)
25 BuildRequires: pkgconfig(gio-2.0)
26 BuildRequires: pkgconfig(gio-unix-2.0)
27 BuildRequires: pkgconfig(syspopup-caller)
28 BuildRequires: pkgconfig(vconf)
29 BuildRequires: pkgconfig(libxml-2.0)
30 BuildRequires: pkgconfig(capi-network-connection)
31 BuildRequires: pkgconfig(alarm-service)
32 BuildRequires: pkgconfig(capi-content-mime-type)
33 BuildRequires: pkgconfig(eventsystem)
34 BuildRequires: pkgconfig(libsoup-2.4)
35 BuildRequires: pkgconfig(capi-network-tethering)
37 BuildRequires: pkgconfig(cynara-client)
38 BuildRequires: pkgconfig(cynara-creds-gdbus)
39 BuildRequires: pkgconfig(libtzplatform-config)
40 BuildRequires: pkgconfig(storage)
41 BuildRequires: pkgconfig(capi-system-info)
42 BuildRequires: pkgconfig(capi-appfw-app-control)
44 Requires(post): /usr/bin/vconftool
45 Requires(post): /sbin/ldconfig
46 Requires(postun): /sbin/ldconfig
49 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
50 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
52 %package profile_common
53 Summary: bluetooth-frwk service and conf files for common profile
54 Requires: %{name} = %{version}-%{release}
55 Conflicts: %{name}-profile_mobile
56 Conflicts: %{name}-profile_wearable
57 Conflicts: %{name}-profile_tv
58 Conflicts: %{name}-profile_ivi
59 %description profile_common
60 Bluetooth framework configuration and service files for Tizen common profile
62 %package profile_mobile
63 Summary: bluetooth-frwk service and conf files for mobile profile
64 Requires: %{name} = %{version}-%{release}
65 Conflicts: %{name}-profile_common
66 Conflicts: %{name}-profile_wearable
67 Conflicts: %{name}-profile_tv
68 Conflicts: %{name}-profile_ivi
69 %description profile_mobile
70 Bluetooth framework configuration and service files for Tizen mobile profile
73 %ifarch %{ix86} || %{arm}
74 %package extension-TM1
75 Summary: bluetooth-frwk service and conf files for mobile TM1
76 Requires: %{name}-profile_mobile = %{version}-%{release}
77 %description extension-TM1
78 Bluetooth framework configuration and service files for Tizen mobile TM1
81 %package profile_wearable
82 Summary: bluetooth-frwk service and conf files for wearable profile
83 Requires: %{name} = %{version}-%{release}
84 Conflicts: %{name}-profile_mobile
85 Conflicts: %{name}-profile_common
86 Conflicts: %{name}-profile_tv
87 Conflicts: %{name}-profile_ivi
88 %description profile_wearable
89 Bluetooth framework configuration and service files for Tizen wearable profile
92 Summary: bluetooth-frwk service and conf files for tv profile
93 Requires: %{name} = %{version}-%{release}
94 Conflicts: %{name}-profile_mobile
95 Conflicts: %{name}-profile_wearable
96 Conflicts: %{name}-profile_common
97 Conflicts: %{name}-profile_ivi
98 %description profile_tv
99 Bluetooth framework configuration and service files for Tizen tv profile
102 Summary: bluetooth-frwk service and conf files for ivi profile
103 Requires: %{name} = %{version}-%{release}
104 Conflicts: %{name}-profile_mobile
105 Conflicts: %{name}-profile_wearable
106 Conflicts: %{name}-profile_tv
107 Conflicts: %{name}-profile_common
108 %description profile_ivi
109 Bluetooth framework configuration and service files for Tizen ivi profile
111 %ifarch %{ix86} x86_64
112 %package extension-emulator
113 Summary: bluetooth-frwk service and conf files for emulator
114 Requires: %{name} = %{version}-%{release}
115 %description extension-emulator
116 bluetooth-frwk service and conf files for emulator
117 %endif // ifarch %{ix86} x86_64
120 Summary: Bluetooth framework for BlueZ and Obexd
121 Group: Development/Libraries
122 Requires: %{name} = %{version}-%{release}
125 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
126 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
129 Summary: Bluetooth Service daemon
130 Group: Network & Connectivity/Bluetooth
131 Requires: %{name} = %{version}-%{release}
134 This package is Bluetooth Service daemon to manage BT services.
137 Summary: Bluetooth HTTP Proxy Service daemon
138 Group: Network & Connectivity/Bluetooth
139 Requires: %{name} = %{version}-%{release}
141 %description httpproxy
142 This package is Bluetooth HTTP Proxy Service daemon
145 Summary: Bluetooth OTP Service daemon
146 Group: Network & Connectivity/Bluetooth
147 Requires: %{name} = %{version}-%{release}
150 This package is Bluetooth OTP Service daemon
153 Summary: Bluetooth Core daemon
154 Group: Network & Connectivity/Bluetooth
155 Requires: %{name} = %{version}-%{release}
158 This package is Bluetooth core daemon to manage activation / deactivation.
161 Summary: Bluetooth test application
162 Group: Network & Connectivity/Bluetooth
163 Requires: %{name} = %{version}-%{release}
166 This package is Bluetooth test application.
169 Summary: Bluetooth OAL
170 Group: Network & Connectivity/Bluetooth
171 Requires: %{name} = %{version}-%{release}
174 This package is BT stack common interface.
176 %package plugin-headed
177 Summary: Bluetooth plugin Headed
178 Group: Network & Connectivity/Bluetooth
179 Requires: %{name} = %{version}-%{release}
181 %description plugin-headed
182 This package is Bluetooth plugin to manage UI and syspopup
190 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
191 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
192 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
193 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
194 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
195 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
197 %define _servicefile packaging/bluetooth-frwk-common.service
198 %define _servicedir starter.target.wants
200 %if "%{?profile}" == "mobile"
201 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
202 %if "%{?tizen_target_name}" == "TM1"
203 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
205 %define _servicefile packaging/bluetooth-frwk-mobile.service
207 %define _servicedir multi-user.target.wants
210 %if "%{?profile}" == "wearable"
211 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
212 %define _servicefile packaging/bluetooth-frwk-wearable.service
213 %define _servicedir multi-user.target.wants
216 %if "%{?profile}" == "tv"
217 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
218 %define _servicefile packaging/bluetooth-frwk-tv.service
219 %define _servicedir multi-user.target.wants
222 %if "%{?profile}" == "ivi"
223 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
224 %define _servicefile packaging/bluetooth-frwk-wearable.service
225 %define _servicedir multi-user.target.wants
229 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
230 export CFLAGS="$CFLAGS -fpie"
231 export CFLAGS+=" -DARCH64"
232 export CXXFLAGS+=" -DARCH64"
233 export FFLAGS+=" -DARCH64"
235 export CFLAGS="$CFLAGS -fpie"
236 export LDFLAGS="$CFLAGS -pie"
239 %if %{bt_bluez_hal} == ENABLED
240 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
242 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
244 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
246 %ifarch %{ix86} x86_64
247 export CFLAGS+=" -DTIZEN_TEST_EMUL"
248 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
249 export FFLAGS+=" -DTIZEN_TEST_EMUL"
252 %if %{bt_bluez_hal} == ENABLED
253 export BT_INCLUDE_OAL_BLUEZ=ENABLED
254 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
256 export BT_INCLUDE_OAL_BLUEZ=DISABLED
259 export CFLAGS_DEFAULT="$CFLAGS"
260 export CXXFLAGS_DEFAULT="$CXXFLAGS"
261 export FFLAGS_DEFAULT="$FFLAGS"
264 %ifarch %{ix86} || %{arm}
266 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
267 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
268 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
270 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
271 -DCMAKE_LIB_DIR=%{_libdir} \
272 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
273 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
274 -DLIBNOTIFY_SUPPORT=Off \
275 -DLIBNOTIFICATION_SUPPORT=Off
281 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
285 %ifarch %{ix86} x86_64
286 export CFLAGS="${CFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
287 export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
288 export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
290 mkdir -p build_emulator
292 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
293 -DCMAKE_LIB_DIR=%{_libdir} \
294 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
295 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
296 -DLIBNOTIFY_SUPPORT=Off \
297 -DLIBNOTIFICATION_SUPPORT=Off
303 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
304 pushd build_emulator/
305 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
309 # non-extension-TM1 / non-extension-emulator
311 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
312 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
313 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
317 export CFLAGS+=" -DARCH64"
318 export CXXFLAGS+=" -DARCH64"
319 export FFLAGS+=" -DARCH64"
322 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
323 -DCMAKE_LIB_DIR=%{_libdir} \
324 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
325 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
326 -DLIBNOTIFY_SUPPORT=Off \
327 -DLIBNOTIFICATION_SUPPORT=Off
336 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
337 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
338 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
340 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
343 %ifarch %{ix86} x86_64
344 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
345 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
348 # Rename the postfix (.mobile, .tv, ..) at post script
350 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
353 %ifarch %{ix86} || %{arm}
354 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
355 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
359 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
360 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
361 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
362 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
365 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
368 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
371 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
374 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
375 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
378 mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d
379 ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-frwk-core.service
380 ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
383 %postun -p /sbin/ldconfig
386 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
387 /usr/bin/chown 5001:100 %{_varlibdir}/bluetooth/auto-pair-blacklist
390 %manifest %{name}.manifest
392 %defattr(-, root, root)
393 %{_libdir}/libbluetooth-api.so.*
394 %exclude %{_libdir}/libbluetooth-api.so*.emulator
397 %defattr(-, root, root)
398 %{_includedir}/bt-service/bluetooth-api.h
399 %{_includedir}/bt-service/bluetooth-hid-api.h
400 %{_includedir}/bt-service/bluetooth-audio-api.h
401 %{_includedir}/bt-service/bluetooth-telephony-api.h
402 %{_includedir}/bt-service/bluetooth-media-control.h
403 %{_includedir}/bt-service/bluetooth-scmst-api.h
404 %{_includedir}/bt-service/bluetooth-ipsp-api.h
405 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
406 %{_libdir}/pkgconfig/bluetooth-api.pc
407 %{_libdir}/libbluetooth-api.so
410 %ifarch %{ix86} x86_64
411 %post extension-emulator
413 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
415 %preun extension-emulator
417 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
419 %files extension-emulator
420 %manifest %{name}.manifest
421 %defattr(-, root, root)
422 %{_libdir}/libbluetooth-api.so.*.emulator
423 %{_libdir}/libbluetooth-api.so.emulator
427 %manifest %{name}.manifest
429 %defattr(-, root, root)
430 %{_bindir}/bt-service
431 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
432 %{_bindir}/bluetooth-frwk-test
433 %{_varlibdir}/bluetooth
434 %{_prefix}/etc/bluetooth
435 %attr(-,owner,users) %{_varlibdir}/bluetooth/auto-pair-blacklist
438 %manifest %{name}.manifest
440 %defattr(-, root, root)
441 %{_bindir}/bt-httpproxy
442 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
443 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
447 %manifest %{name}.manifest
449 %defattr(-, root, root)
451 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
452 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
455 %manifest %{name}.manifest
457 %defattr(-, root, root)
458 %{_unitdir}/bluetooth-frwk-core.service
459 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
461 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
462 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
465 %manifest %{name}.manifest
467 %defattr(-, root, root)
468 %{_bindir}/bluetooth-frwk-test
469 #%{_bindir}/bluetooth-gatt-test
470 #%{_bindir}/bluetooth-advertising-test
473 %manifest %{name}.manifest
475 %defattr(-, root, root)
476 %{_libdir}/bt-plugin-headed.so
480 mv bluetooth-frwk.service.common bluetooth-frwk.service
482 %preun profile_common
484 mv bluetooth-frwk.service bluetooth-frwk.service.common
486 %files profile_common
488 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
489 %{_unitdir}/bluetooth-frwk.service.common
490 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
494 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
496 %preun profile_mobile
498 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
500 %files profile_mobile
502 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
503 %{_unitdir}/bluetooth-frwk.service.mobile
504 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
507 %ifarch %{ix86} || %{arm}
510 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
513 mv bt-core.tm1 bt-core
517 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
520 mv bt-core bt-core.tm1
523 %{_unitdir}/bluetooth-frwk.service.tm1
525 %defattr(-, root, root)
526 %{_bindir}/bt-core.tm1
529 %post profile_wearable
531 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
533 %preun profile_wearable
535 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
537 %files profile_wearable
539 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
540 %{_unitdir}/bluetooth-frwk.service.wearable
541 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
545 mv bluetooth-frwk.service.tv bluetooth-frwk.service
549 mv bluetooth-frwk.service bluetooth-frwk.service.tv
553 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
554 %{_unitdir}/bluetooth-frwk.service.tv
555 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
557 # Note: ivi reuses bluetooth-frwk.service.wearable
560 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
562 pushd %{_datadir}/dbus-1/system-services
563 mv org.projectx.bt.service.ivi org.projectx.bt.service
567 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
569 pushd %{_datadir}/dbus-1/system-services
570 mv org.projectx.bt.service org.projectx.bt.service.ivi
574 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
575 %{_unitdir}/bluetooth-frwk.service.wearable
576 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
579 %manifest %{name}.manifest
580 %{_libdir}/libbt-oal.so*
581 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
583 %if %{bt_bluez_hal} == ENABLED
584 %manifest %{name}.manifest
585 %{_libdir}/libbluetooth.default.so*