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"
196 export CFLAGS="$CFLAGS -DTIZEN_GATT_CLIENT"
198 %define _servicefile packaging/bluetooth-frwk-common.service
199 %define _servicedir starter.target.wants
201 %if "%{?profile}" == "mobile"
202 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
203 %if "%{?tizen_target_name}" == "TM1"
204 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
206 %define _servicefile packaging/bluetooth-frwk-mobile.service
208 %define _servicedir multi-user.target.wants
211 %if "%{?profile}" == "wearable"
212 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
213 %define _servicefile packaging/bluetooth-frwk-wearable.service
214 %define _servicedir multi-user.target.wants
217 %if "%{?profile}" == "tv"
218 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
219 %define _servicefile packaging/bluetooth-frwk-tv.service
220 %define _servicedir multi-user.target.wants
223 %if "%{?profile}" == "ivi"
224 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
225 %define _servicefile packaging/bluetooth-frwk-wearable.service
226 %define _servicedir multi-user.target.wants
230 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
231 export CFLAGS="$CFLAGS -fpie"
232 export CFLAGS+=" -DARCH64"
233 export CXXFLAGS+=" -DARCH64"
234 export FFLAGS+=" -DARCH64"
236 export CFLAGS="$CFLAGS -fpie"
237 export LDFLAGS="$CFLAGS -pie"
240 %if %{bt_bluez_hal} == ENABLED
241 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
243 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
245 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
247 %ifarch %{ix86} x86_64
248 export CFLAGS+=" -DTIZEN_TEST_EMUL"
249 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
250 export FFLAGS+=" -DTIZEN_TEST_EMUL"
253 %if %{bt_bluez_hal} == ENABLED
254 export BT_INCLUDE_OAL_BLUEZ=ENABLED
255 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
257 export BT_INCLUDE_OAL_BLUEZ=DISABLED
260 export CFLAGS_DEFAULT="$CFLAGS"
261 export CXXFLAGS_DEFAULT="$CXXFLAGS"
262 export FFLAGS_DEFAULT="$FFLAGS"
265 %ifarch %{ix86} || %{arm}
267 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
268 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
269 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
271 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
272 -DCMAKE_LIB_DIR=%{_libdir} \
273 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
274 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
275 -DLIBNOTIFY_SUPPORT=Off \
276 -DLIBNOTIFICATION_SUPPORT=Off
282 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
286 %ifarch %{ix86} x86_64
287 export CFLAGS="${CFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
288 export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
289 export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
291 mkdir -p build_emulator
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}%{_libdir}/libbluetooth-api.so* build_emulator/
305 pushd build_emulator/
306 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
310 # non-extension-TM1 / non-extension-emulator
312 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
313 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
314 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
318 export CFLAGS+=" -DARCH64"
319 export CXXFLAGS+=" -DARCH64"
320 export FFLAGS+=" -DARCH64"
323 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
324 -DCMAKE_LIB_DIR=%{_libdir} \
325 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
326 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
327 -DLIBNOTIFY_SUPPORT=Off \
328 -DLIBNOTIFICATION_SUPPORT=Off
337 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
338 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
339 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
341 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
344 %ifarch %{ix86} x86_64
345 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
346 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
349 # Rename the postfix (.mobile, .tv, ..) at post script
351 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
354 %ifarch %{ix86} || %{arm}
355 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
356 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
360 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
361 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
362 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
363 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
366 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
369 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
372 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
375 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
376 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
379 mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d
380 ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-frwk-core.service
381 ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
384 %postun -p /sbin/ldconfig
387 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
388 /usr/bin/chown 5001:100 %{_varlibdir}/bluetooth/auto-pair-blacklist
391 %manifest %{name}.manifest
393 %defattr(-, root, root)
394 %{_libdir}/libbluetooth-api.so.*
395 %exclude %{_libdir}/libbluetooth-api.so*.emulator
398 %defattr(-, root, root)
399 %{_includedir}/bt-service/bluetooth-api.h
400 %{_includedir}/bt-service/bluetooth-hid-api.h
401 %{_includedir}/bt-service/bluetooth-audio-api.h
402 %{_includedir}/bt-service/bluetooth-telephony-api.h
403 %{_includedir}/bt-service/bluetooth-media-control.h
404 %{_includedir}/bt-service/bluetooth-scmst-api.h
405 %{_includedir}/bt-service/bluetooth-ipsp-api.h
406 %{_includedir}/bt-service/bluetooth-gatt-server-api.h
407 %{_includedir}/bt-service/bluetooth-gatt-client-api.h
408 %{_libdir}/pkgconfig/bluetooth-api.pc
409 %{_libdir}/libbluetooth-api.so
412 %ifarch %{ix86} x86_64
413 %post extension-emulator
415 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
417 %preun extension-emulator
419 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
421 %files extension-emulator
422 %manifest %{name}.manifest
423 %defattr(-, root, root)
424 %{_libdir}/libbluetooth-api.so.*.emulator
425 %{_libdir}/libbluetooth-api.so.emulator
429 %manifest %{name}.manifest
431 %defattr(-, root, root)
432 %{_bindir}/bt-service
433 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
434 %{_bindir}/bluetooth-frwk-test
435 %{_varlibdir}/bluetooth
436 %{_prefix}/etc/bluetooth
437 %attr(-,owner,users) %{_varlibdir}/bluetooth/auto-pair-blacklist
440 %manifest %{name}.manifest
442 %defattr(-, root, root)
443 %{_bindir}/bt-httpproxy
444 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
445 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
449 %manifest %{name}.manifest
451 %defattr(-, root, root)
453 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
454 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
457 %manifest %{name}.manifest
459 %defattr(-, root, root)
460 %{_unitdir}/bluetooth-frwk-core.service
461 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
463 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
464 %{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
467 %manifest %{name}.manifest
469 %defattr(-, root, root)
470 %{_bindir}/bluetooth-frwk-test
471 #%{_bindir}/bluetooth-gatt-test
472 #%{_bindir}/bluetooth-advertising-test
475 %manifest %{name}.manifest
477 %defattr(-, root, root)
478 %{_libdir}/bt-plugin-headed.so
482 mv bluetooth-frwk.service.common bluetooth-frwk.service
484 %preun profile_common
486 mv bluetooth-frwk.service bluetooth-frwk.service.common
488 %files profile_common
490 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
491 %exclude %{_unitdir}/starter.target.wants/bluetooth-frwk.service
492 %{_unitdir}/bluetooth-frwk.service.common
493 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
497 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
499 %preun profile_mobile
501 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
503 %files profile_mobile
505 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
506 %{_unitdir}/bluetooth-frwk.service.mobile
507 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
510 %ifarch %{ix86} || %{arm}
513 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
516 mv bt-core.tm1 bt-core
520 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
523 mv bt-core bt-core.tm1
526 %{_unitdir}/bluetooth-frwk.service.tm1
528 %defattr(-, root, root)
529 %{_bindir}/bt-core.tm1
532 %post profile_wearable
534 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
536 %preun profile_wearable
538 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
540 %files profile_wearable
542 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
543 %{_unitdir}/bluetooth-frwk.service.wearable
544 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
548 mv bluetooth-frwk.service.tv bluetooth-frwk.service
552 mv bluetooth-frwk.service bluetooth-frwk.service.tv
556 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
557 %{_unitdir}/bluetooth-frwk.service.tv
558 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
560 # Note: ivi reuses bluetooth-frwk.service.wearable
563 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
565 pushd %{_datadir}/dbus-1/system-services
566 mv org.projectx.bt.service.ivi org.projectx.bt.service
570 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
572 pushd %{_datadir}/dbus-1/system-services
573 mv org.projectx.bt.service org.projectx.bt.service.ivi
577 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
578 %{_unitdir}/bluetooth-frwk.service.wearable
579 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
582 %manifest %{name}.manifest
583 %defattr(-, root, root)
584 %{_libdir}/libbt-oal.so*
585 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
587 %if %{bt_bluez_hal} == ENABLED
588 %{_libdir}/libbluetooth.default.so*