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 BuildRequires: pkgconfig(aul)
19 BuildRequires: pkgconfig(dlog)
20 BuildRequires: pkgconfig(glib-2.0)
21 BuildRequires: pkgconfig(gio-2.0)
22 BuildRequires: pkgconfig(gio-unix-2.0)
23 BuildRequires: pkgconfig(syspopup-caller)
24 BuildRequires: pkgconfig(vconf)
25 BuildRequires: pkgconfig(libxml-2.0)
26 BuildRequires: pkgconfig(capi-network-connection)
27 BuildRequires: pkgconfig(alarm-service)
28 BuildRequires: pkgconfig(capi-content-mime-type)
29 BuildRequires: pkgconfig(pkgmgr)
30 #BuildRequires: pkgconfig(journal)
31 BuildRequires: pkgconfig(eventsystem)
32 BuildRequires: pkgconfig(libsoup-2.4)
33 BuildRequires: pkgconfig(capi-network-tethering)
35 BuildRequires: pkgconfig(cynara-client)
36 BuildRequires: pkgconfig(cynara-creds-gdbus)
37 BuildRequires: pkgconfig(libtzplatform-config)
38 BuildRequires: pkgconfig(storage)
39 BuildRequires: pkgconfig(capi-system-info)
40 BuildRequires: pkgconfig(capi-appfw-app-control)
42 Requires(post): /usr/bin/vconftool
43 Requires(post): /sbin/ldconfig
44 Requires(postun): /sbin/ldconfig
47 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
48 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
50 %package profile_common
51 Summary: bluetooth-frwk service and conf files for common profile
52 Requires: %{name} = %{version}-%{release}
53 Conflicts: %{name}-profile_mobile
54 Conflicts: %{name}-profile_wearable
55 Conflicts: %{name}-profile_tv
56 Conflicts: %{name}-profile_ivi
57 %description profile_common
58 Bluetooth framework configuration and service files for Tizen common profile
60 %package profile_mobile
61 Summary: bluetooth-frwk service and conf files for mobile profile
62 Requires: %{name} = %{version}-%{release}
63 Conflicts: %{name}-profile_common
64 Conflicts: %{name}-profile_wearable
65 Conflicts: %{name}-profile_tv
66 Conflicts: %{name}-profile_ivi
67 %description profile_mobile
68 Bluetooth framework configuration and service files for Tizen mobile profile
71 %ifarch %{ix86} || %{arm}
72 %package extension-TM1
73 Summary: bluetooth-frwk service and conf files for mobile TM1
74 Requires: %{name}-profile_mobile = %{version}-%{release}
75 %description extension-TM1
76 Bluetooth framework configuration and service files for Tizen mobile TM1
79 %package profile_wearable
80 Summary: bluetooth-frwk service and conf files for wearable profile
81 Requires: %{name} = %{version}-%{release}
82 Conflicts: %{name}-profile_mobile
83 Conflicts: %{name}-profile_common
84 Conflicts: %{name}-profile_tv
85 Conflicts: %{name}-profile_ivi
86 %description profile_wearable
87 Bluetooth framework configuration and service files for Tizen wearable profile
90 Summary: bluetooth-frwk service and conf files for tv profile
91 Requires: %{name} = %{version}-%{release}
92 Conflicts: %{name}-profile_mobile
93 Conflicts: %{name}-profile_wearable
94 Conflicts: %{name}-profile_common
95 Conflicts: %{name}-profile_ivi
96 %description profile_tv
97 Bluetooth framework configuration and service files for Tizen tv profile
100 Summary: bluetooth-frwk service and conf files for ivi profile
101 Requires: %{name} = %{version}-%{release}
102 Conflicts: %{name}-profile_mobile
103 Conflicts: %{name}-profile_wearable
104 Conflicts: %{name}-profile_tv
105 Conflicts: %{name}-profile_common
106 %description profile_ivi
107 Bluetooth framework configuration and service files for Tizen ivi profile
109 %ifarch %{ix86} x86_64
110 %package extension-emulator
111 Summary: bluetooth-frwk service and conf files for emulator
112 Requires: %{name} = %{version}-%{release}
113 %description extension-emulator
114 bluetooth-frwk service and conf files for emulator
115 %endif // ifarch %{ix86} x86_64
118 Summary: Bluetooth framework for BlueZ and Obexd
119 Group: Development/Libraries
120 Requires: %{name} = %{version}-%{release}
123 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
124 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
127 Summary: Bluetooth Service daemon
128 Group: Network & Connectivity/Bluetooth
129 Requires: %{name} = %{version}-%{release}
132 This package is Bluetooth Service daemon to manage BT services.
135 Summary: Bluetooth HTTP Proxy Service daemon
137 Requires: %{name} = %{version}-%{release}
139 %description httpproxy
140 This package is Bluetooth HTTP Proxy Service daemon
143 Summary: Bluetooth OTP Service daemon
144 Group: Network & Connectivity/Bluetooth
145 Requires: %{name} = %{version}-%{release}
148 This package is Bluetooth OTP Service daemon
151 Summary: Bluetooth Core daemon
152 Group: Network & Connectivity/Bluetooth
153 Requires: %{name} = %{version}-%{release}
156 This package is Bluetooth core daemon to manage activation / deactivation.
159 Summary: Bluetooth test application
160 Group: Network & Connectivity/Bluetooth
161 Requires: %{name} = %{version}-%{release}
164 This package is Bluetooth test application.
166 %package plugin-headed
167 Summary: Bluetooth plugin Headed
168 Group: Network & Connectivity/Bluetooth
169 Requires: %{name} = %{version}-%{release}
171 %description plugin-headed
172 This package is Bluetooth plugin to manage UI and syspopup
180 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
181 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
182 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
185 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
186 export CFLAGS+=" -DARCH64"
187 export CXXFLAGS+=" -DARCH64"
188 export FFLAGS+=" -DARCH64"
190 export CFLAGS="$CFLAGS -fpie"
191 export LDFLAGS="$CFLAGS -pie"
194 %ifarch %{ix86} x86_64
195 export CFLAGS+=" -DTIZEN_TEST_EMUL"
196 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
197 export FFLAGS+=" -DTIZEN_TEST_EMUL"
200 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
201 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
205 export CFLAGS+=" -DARCH64"
206 export CXXFLAGS+=" -DARCH64"
207 export FFLAGS+=" -DARCH64"
210 export CFLAGS_DEFAULT="$CFLAGS"
211 export CXXFLAGS_DEFAULT="$CXXFLAGS"
212 export FFLAGS_DEFAULT="$FFLAGS"
215 %ifarch %{ix86} || %{arm}
217 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
218 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
219 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
221 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
222 -DCMAKE_LIB_DIR=%{_libdir} \
223 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
224 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
225 -DLIBNOTIFY_SUPPORT=Off \
226 -DLIBNOTIFICATION_SUPPORT=Off
232 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
236 %ifarch %{ix86} x86_64
237 export CFLAGS="${CFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
238 export CXXFLAGS="${CXXFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
239 export FFLAGS="${FFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
241 mkdir -p build_emulator
243 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
244 -DCMAKE_LIB_DIR=%{_libdir} \
245 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
246 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
247 -DLIBNOTIFY_SUPPORT=Off \
248 -DLIBNOTIFICATION_SUPPORT=Off
254 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
255 pushd build_emulator/
256 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
260 # non-extension-TM1 / non-extension-emulator
262 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
263 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
264 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
266 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
267 -DCMAKE_LIB_DIR=%{_libdir} \
268 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
269 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
270 -DLIBNOTIFY_SUPPORT=Off \
271 -DLIBNOTIFICATION_SUPPORT=Off
280 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
281 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
284 %ifarch %{ix86} x86_64
285 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
286 mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
289 # Rename the postfix (.mobile, .tv, ..) at post script
291 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
294 %ifarch %{ix86} || %{arm}
295 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
296 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
300 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
301 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
302 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
303 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
306 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
309 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
311 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
312 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
314 %postun -p /sbin/ldconfig
317 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
318 /usr/bin/chown 5001:100 %{_varlibdir}/bluetooth/auto-pair-blacklist
321 %manifest %{name}.manifest
323 %defattr(-, root, root)
324 %{_libdir}/libbluetooth-api.so.*
325 %exclude %{_libdir}/libbluetooth-api.so*.emulator
328 %defattr(-, root, root)
329 %{_includedir}/bt-service/bluetooth-api.h
330 %{_includedir}/bt-service/bluetooth-hid-api.h
331 %{_includedir}/bt-service/bluetooth-audio-api.h
332 %{_includedir}/bt-service/bluetooth-telephony-api.h
333 %{_includedir}/bt-service/bluetooth-media-control.h
334 %{_includedir}/bt-service/bluetooth-scmst-api.h
335 %{_includedir}/bt-service/bluetooth-ipsp-api.h
336 %{_libdir}/pkgconfig/bluetooth-api.pc
337 %{_libdir}/libbluetooth-api.so
340 %ifarch %{ix86} x86_64
341 %post extension-emulator
343 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
345 %preun extension-emulator
347 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
349 %files extension-emulator
350 %manifest %{name}.manifest
351 %defattr(-, root, root)
352 %{_libdir}/libbluetooth-api.so.*.emulator
353 %{_libdir}/libbluetooth-api.so.emulator
357 %manifest %{name}.manifest
359 %defattr(-, root, root)
360 %{_bindir}/bt-service
361 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
362 %{_bindir}/bluetooth-frwk-test
363 %{_varlibdir}/bluetooth
364 %{_prefix}/etc/bluetooth
365 %attr(-,owner,users) %{_varlibdir}/bluetooth/auto-pair-blacklist
368 %manifest %{name}.manifest
370 %defattr(-, root, root)
371 %{_bindir}/bt-httpproxy
372 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
373 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
377 %manifest %{name}.manifest
379 %defattr(-, root, root)
381 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
382 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
385 %manifest %{name}.manifest
387 %defattr(-, root, root)
388 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
390 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
393 %manifest %{name}.manifest
395 %defattr(-, root, root)
396 %{_bindir}/bluetooth-frwk-test
397 #{_bindir}/bluetooth-gatt-test
398 #{_bindir}/bluetooth-advertising-test
401 %manifest %{name}.manifest
403 %defattr(-, root, root)
404 %{_libdir}/bt-plugin-headed.so
408 mv bluetooth-frwk.service.common bluetooth-frwk.service
410 %preun profile_common
412 mv bluetooth-frwk.service bluetooth-frwk.service.common
414 %files profile_common
416 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
417 %{_unitdir}/bluetooth-frwk.service.common
418 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
422 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
424 %preun profile_mobile
426 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
428 %files profile_mobile
430 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
431 %{_unitdir}/bluetooth-frwk.service.mobile
432 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
435 %ifarch %{ix86} || %{arm}
438 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
441 mv bt-core.tm1 bt-core
445 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
448 mv bt-core bt-core.tm1
451 %{_unitdir}/bluetooth-frwk.service.tm1
453 %defattr(-, root, root)
454 %{_bindir}/bt-core.tm1
457 %post profile_wearable
459 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
461 %preun profile_wearable
463 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
465 %files profile_wearable
467 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
468 %{_unitdir}/bluetooth-frwk.service.wearable
469 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
473 mv bluetooth-frwk.service.tv bluetooth-frwk.service
477 mv bluetooth-frwk.service bluetooth-frwk.service.tv
481 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
482 %{_unitdir}/bluetooth-frwk.service.tv
483 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
485 # Note: ivi reuses bluetooth-frwk.service.wearable
488 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
490 pushd %{_datadir}/dbus-1/system-services
491 mv org.projectx.bt.service.ivi org.projectx.bt.service
495 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
497 pushd %{_datadir}/dbus-1/system-services
498 mv org.projectx.bt.service org.projectx.bt.service.ivi
502 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
503 %{_unitdir}/bluetooth-frwk.service.wearable
504 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
506 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
507 # (for PROFILE WEARABLE)