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(pkgmgr)
34 #BuildRequires: pkgconfig(journal)
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)
46 Requires(post): /usr/bin/vconftool
47 Requires(post): /sbin/ldconfig
48 Requires(postun): /sbin/ldconfig
51 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
52 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
54 %package profile_common
55 Summary: bluetooth-frwk service and conf files for common profile
56 Requires: %{name} = %{version}-%{release}
57 Conflicts: %{name}-profile_mobile
58 Conflicts: %{name}-profile_wearable
59 Conflicts: %{name}-profile_tv
60 Conflicts: %{name}-profile_ivi
61 %description profile_common
62 Bluetooth framework configuration and service files for Tizen common profile
64 %package profile_mobile
65 Summary: bluetooth-frwk service and conf files for mobile profile
66 Requires: %{name} = %{version}-%{release}
67 Conflicts: %{name}-profile_common
68 Conflicts: %{name}-profile_wearable
69 Conflicts: %{name}-profile_tv
70 Conflicts: %{name}-profile_ivi
71 %description profile_mobile
72 Bluetooth framework configuration and service files for Tizen mobile profile
75 %ifarch %{ix86} || %{arm}
76 %package extension-TM1
77 Summary: bluetooth-frwk service and conf files for mobile TM1
78 Requires: %{name}-profile_mobile = %{version}-%{release}
79 %description extension-TM1
80 Bluetooth framework configuration and service files for Tizen mobile TM1
83 %package profile_wearable
84 Summary: bluetooth-frwk service and conf files for wearable profile
85 Requires: %{name} = %{version}-%{release}
86 Conflicts: %{name}-profile_mobile
87 Conflicts: %{name}-profile_common
88 Conflicts: %{name}-profile_tv
89 Conflicts: %{name}-profile_ivi
90 %description profile_wearable
91 Bluetooth framework configuration and service files for Tizen wearable profile
94 Summary: bluetooth-frwk service and conf files for tv profile
95 Requires: %{name} = %{version}-%{release}
96 Conflicts: %{name}-profile_mobile
97 Conflicts: %{name}-profile_wearable
98 Conflicts: %{name}-profile_common
99 Conflicts: %{name}-profile_ivi
100 %description profile_tv
101 Bluetooth framework configuration and service files for Tizen tv profile
104 Summary: bluetooth-frwk service and conf files for ivi profile
105 Requires: %{name} = %{version}-%{release}
106 Conflicts: %{name}-profile_mobile
107 Conflicts: %{name}-profile_wearable
108 Conflicts: %{name}-profile_tv
109 Conflicts: %{name}-profile_common
110 %description profile_ivi
111 Bluetooth framework configuration and service files for Tizen ivi profile
113 %ifarch %{ix86} x86_64
114 %package extension-emulator
115 Summary: bluetooth-frwk service and conf files for emulator
116 Requires: %{name} = %{version}-%{release}
117 %description extension-emulator
118 bluetooth-frwk service and conf files for emulator
119 %endif // ifarch %{ix86} x86_64
122 Summary: Bluetooth framework for BlueZ and Obexd
123 Group: Development/Libraries
124 Requires: %{name} = %{version}-%{release}
127 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
128 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
131 Summary: Bluetooth Service daemon
132 Group: Network & Connectivity/Bluetooth
133 Requires: %{name} = %{version}-%{release}
136 This package is Bluetooth Service daemon to manage BT services.
139 Summary: Bluetooth HTTP Proxy Service daemon
140 Group: Network & Connectivity/Bluetooth
141 Requires: %{name} = %{version}-%{release}
143 %description httpproxy
144 This package is Bluetooth HTTP Proxy Service daemon
147 Summary: Bluetooth OTP Service daemon
148 Group: Network & Connectivity/Bluetooth
149 Requires: %{name} = %{version}-%{release}
152 This package is Bluetooth OTP Service daemon
155 Summary: Bluetooth Core daemon
156 Group: Network & Connectivity/Bluetooth
157 Requires: %{name} = %{version}-%{release}
160 This package is Bluetooth core daemon to manage activation / deactivation.
163 Summary: Bluetooth test application
164 Group: Network & Connectivity/Bluetooth
165 Requires: %{name} = %{version}-%{release}
168 This package is Bluetooth test application.
171 Summary: Bluetooth OAL
172 Group: Network & Connectivity/Bluetooth
173 Requires: %{name} = %{version}-%{release}
176 This package is BT stack common interface.
178 %package plugin-headed
179 Summary: Bluetooth plugin Headed
180 Group: Network & Connectivity/Bluetooth
181 Requires: %{name} = %{version}-%{release}
183 %description plugin-headed
184 This package is Bluetooth plugin to manage UI and syspopup
192 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
193 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_OBEX"
194 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_PAN_NAP"
195 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_IPSP"
196 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
197 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
199 %define _servicefile packaging/bluetooth-frwk-common.service
200 %define _servicedir starter.target.wants
202 %if "%{?profile}" == "mobile"
203 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
204 %if "%{?tizen_target_name}" == "TM1"
205 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
207 %define _servicefile packaging/bluetooth-frwk-mobile.service
209 %define _servicedir multi-user.target.wants
212 %if "%{?profile}" == "wearable"
213 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
214 %define _servicefile packaging/bluetooth-frwk-wearable.service
215 %define _servicedir multi-user.target.wants
218 %if "%{?profile}" == "tv"
219 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
220 %define _servicefile packaging/bluetooth-frwk-tv.service
221 %define _servicedir multi-user.target.wants
224 %if "%{?profile}" == "ivi"
225 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
226 %define _servicefile packaging/bluetooth-frwk-wearable.service
227 %define _servicedir multi-user.target.wants
231 #export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
232 export CFLAGS="$CFLAGS -fpie"
233 export CFLAGS+=" -DARCH64"
234 export CXXFLAGS+=" -DARCH64"
235 export FFLAGS+=" -DARCH64"
237 export CFLAGS="$CFLAGS -fpie"
238 export LDFLAGS="$CFLAGS -pie"
241 %if %{bt_bluez_hal} == ENABLED
242 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT -DTIZEN_BT_HAL"
244 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
246 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
248 %ifarch %{ix86} x86_64
249 export CFLAGS+=" -DTIZEN_TEST_EMUL"
250 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
251 export FFLAGS+=" -DTIZEN_TEST_EMUL"
254 %if %{bt_bluez_hal} == ENABLED
255 export BT_INCLUDE_OAL_BLUEZ=ENABLED
256 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
258 export BT_INCLUDE_OAL_BLUEZ=DISABLED
261 export CFLAGS_DEFAULT="$CFLAGS"
262 export CXXFLAGS_DEFAULT="$CXXFLAGS"
263 export FFLAGS_DEFAULT="$FFLAGS"
266 %ifarch %{ix86} || %{arm}
268 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
269 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
270 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
272 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
273 -DCMAKE_LIB_DIR=%{_libdir} \
274 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
275 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
276 -DLIBNOTIFY_SUPPORT=Off \
277 -DLIBNOTIFICATION_SUPPORT=Off
283 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
287 %ifarch %{ix86} x86_64
288 export CFLAGS="${CFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
289 export CXXFLAGS="${CXXFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
290 export FFLAGS="${FFLAGS} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
292 mkdir -p build_emulator
294 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
295 -DCMAKE_LIB_DIR=%{_libdir} \
296 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
297 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
298 -DLIBNOTIFY_SUPPORT=Off \
299 -DLIBNOTIFICATION_SUPPORT=Off
305 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
306 pushd build_emulator/
307 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
311 # non-extension-TM1 / non-extension-emulator
313 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
314 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
315 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
319 export CFLAGS+=" -DARCH64"
320 export CXXFLAGS+=" -DARCH64"
321 export FFLAGS+=" -DARCH64"
324 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
325 -DCMAKE_LIB_DIR=%{_libdir} \
326 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
327 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
328 -DLIBNOTIFY_SUPPORT=Off \
329 -DLIBNOTIFICATION_SUPPORT=Off
338 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
339 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
340 mkdir -p %{buildroot}/%{_prefix}/lib/udev/rules.d
342 cp packaging/99-bluetooth-rfkill.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/99-bluetooth-rfkill.rules
345 %ifarch %{ix86} x86_64
346 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
347 #mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
350 # Rename the postfix (.mobile, .tv, ..) at post script
352 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
355 %ifarch %{ix86} || %{arm}
356 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
357 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
361 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
362 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
363 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
364 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
367 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
370 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
373 install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
376 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
377 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
380 mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d
381 ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-frwk-core.service
382 ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
385 %postun -p /sbin/ldconfig
388 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
389 /usr/bin/chown 5001:100 %{_varlibdir}/bluetooth/auto-pair-blacklist
392 %manifest %{name}.manifest
394 %defattr(-, root, root)
395 %{_libdir}/libbluetooth-api.so.*
396 %exclude %{_libdir}/libbluetooth-api.so*.emulator
399 %defattr(-, root, root)
400 %{_includedir}/bt-service/bluetooth-api.h
401 %{_includedir}/bt-service/bluetooth-hid-api.h
402 %{_includedir}/bt-service/bluetooth-audio-api.h
403 %{_includedir}/bt-service/bluetooth-telephony-api.h
404 %{_includedir}/bt-service/bluetooth-media-control.h
405 %{_includedir}/bt-service/bluetooth-scmst-api.h
406 %{_includedir}/bt-service/bluetooth-ipsp-api.h
407 %{_includedir}/bt-service/bluetooth-gatt-server-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}/starter.target.wants/bluetooth-frwk.service
491 %{_unitdir}/bluetooth-frwk.service.common
492 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
496 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
498 %preun profile_mobile
500 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
502 %files profile_mobile
504 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
505 %{_unitdir}/bluetooth-frwk.service.mobile
506 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
509 %ifarch %{ix86} || %{arm}
512 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
515 mv bt-core.tm1 bt-core
519 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
522 mv bt-core bt-core.tm1
525 %{_unitdir}/bluetooth-frwk.service.tm1
527 %defattr(-, root, root)
528 %{_bindir}/bt-core.tm1
531 %post profile_wearable
533 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
535 %preun profile_wearable
537 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
539 %files profile_wearable
541 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
542 %{_unitdir}/bluetooth-frwk.service.wearable
543 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
547 mv bluetooth-frwk.service.tv bluetooth-frwk.service
551 mv bluetooth-frwk.service bluetooth-frwk.service.tv
555 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
556 %{_unitdir}/bluetooth-frwk.service.tv
557 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
559 # Note: ivi reuses bluetooth-frwk.service.wearable
562 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
564 pushd %{_datadir}/dbus-1/system-services
565 mv org.projectx.bt.service.ivi org.projectx.bt.service
569 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
571 pushd %{_datadir}/dbus-1/system-services
572 mv org.projectx.bt.service org.projectx.bt.service.ivi
576 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
577 %{_unitdir}/bluetooth-frwk.service.wearable
578 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
581 %manifest %{name}.manifest
582 %{_libdir}/libbt-oal.so*
584 %if %{bt_bluez_hal} == ENABLED
585 %manifest %{name}.manifest
586 %{_libdir}/libbluetooth.default.so*