f1641307ba98f9fac9ff8d6aa0bd50a65da931f0
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
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)$
4
5 %bcond_with x
6 %define _dumpdir /opt/etc/dump.d/module.d
7 %define _varlibdir /opt/var/lib
8
9 Name:       bluetooth-frwk
10 Summary:    Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
11 Version:    0.2.158
12 Release:    1
13 Group:      Network & Connectivity/Bluetooth
14 License:    Apache-2.0
15 Source0:    %{name}-%{version}.tar.gz
16 Source1001: bluetooth-frwk.manifest
17
18 %if "%{?profile}" != "mobile"
19 Requires: bluetooth-tools
20 %endif
21 BuildRequires:  pkgconfig(aul)
22 BuildRequires:  pkgconfig(dlog)
23 BuildRequires:  pkgconfig(glib-2.0)
24 BuildRequires:  pkgconfig(gio-2.0)
25 BuildRequires:  pkgconfig(gio-unix-2.0)
26 BuildRequires:  pkgconfig(syspopup-caller)
27 BuildRequires:  pkgconfig(vconf)
28 BuildRequires:  pkgconfig(libxml-2.0)
29 BuildRequires:  pkgconfig(capi-network-connection)
30 BuildRequires:  pkgconfig(alarm-service)
31 BuildRequires:  pkgconfig(capi-content-mime-type)
32 BuildRequires:  pkgconfig(pkgmgr)
33 #BuildRequires:  pkgconfig(journal)
34 BuildRequires:  pkgconfig(eventsystem)
35 BuildRequires:  pkgconfig(libsoup-2.4)
36 BuildRequires:  pkgconfig(capi-network-tethering)
37 BuildRequires:  cmake
38 BuildRequires:  pkgconfig(cynara-client)
39 BuildRequires:  pkgconfig(cynara-creds-gdbus)
40 BuildRequires:  pkgconfig(libtzplatform-config)
41 BuildRequires:  pkgconfig(storage)
42 BuildRequires:  pkgconfig(capi-system-info)
43 BuildRequires:  pkgconfig(capi-appfw-app-control)
44
45 Requires(post): /usr/bin/vconftool
46 Requires(post): /sbin/ldconfig
47 Requires(postun): /sbin/ldconfig
48
49 %description
50 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
51  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
52
53 %package profile_common
54 Summary:    bluetooth-frwk service and conf files for common profile
55 Requires:   %{name} = %{version}-%{release}
56 Conflicts:  %{name}-profile_mobile
57 Conflicts:  %{name}-profile_wearable
58 Conflicts:  %{name}-profile_tv
59 Conflicts:  %{name}-profile_ivi
60 %description profile_common
61 Bluetooth framework configuration and service files for Tizen common profile
62
63 %package profile_mobile
64 Summary:    bluetooth-frwk service and conf files for mobile profile
65 Requires:   %{name} = %{version}-%{release}
66 Conflicts:  %{name}-profile_common
67 Conflicts:  %{name}-profile_wearable
68 Conflicts:  %{name}-profile_tv
69 Conflicts:  %{name}-profile_ivi
70 %description profile_mobile
71 Bluetooth framework configuration and service files for Tizen mobile profile
72
73 # extension-TM1
74 %ifarch %{ix86} || %{arm}
75 %package extension-TM1
76 Summary:    bluetooth-frwk service and conf files for mobile TM1
77 Requires:   %{name}-profile_mobile = %{version}-%{release}
78 %description extension-TM1
79 Bluetooth framework configuration and service files for Tizen mobile TM1
80 %endif
81
82 %package profile_wearable
83 Summary:    bluetooth-frwk service and conf files for wearable profile
84 Requires:   %{name} = %{version}-%{release}
85 Conflicts:  %{name}-profile_mobile
86 Conflicts:  %{name}-profile_common
87 Conflicts:  %{name}-profile_tv
88 Conflicts:  %{name}-profile_ivi
89 %description profile_wearable
90 Bluetooth framework configuration and service files for Tizen wearable profile
91
92 %package profile_tv
93 Summary:    bluetooth-frwk service and conf files for tv profile
94 Requires:   %{name} = %{version}-%{release}
95 Conflicts:  %{name}-profile_mobile
96 Conflicts:  %{name}-profile_wearable
97 Conflicts:  %{name}-profile_common
98 Conflicts:  %{name}-profile_ivi
99 %description profile_tv
100 Bluetooth framework configuration and service files for Tizen tv profile
101
102 %package profile_ivi
103 Summary:    bluetooth-frwk service and conf files for ivi profile
104 Requires:   %{name} = %{version}-%{release}
105 Conflicts:  %{name}-profile_mobile
106 Conflicts:  %{name}-profile_wearable
107 Conflicts:  %{name}-profile_tv
108 Conflicts:  %{name}-profile_common
109 %description profile_ivi
110 Bluetooth framework configuration and service files for Tizen ivi profile
111
112 %ifarch %{ix86} x86_64
113 %package extension-emulator
114 Summary:    bluetooth-frwk service and conf files for emulator
115 Requires:   %{name} = %{version}-%{release}
116 %description extension-emulator
117 bluetooth-frwk service and conf files for emulator
118 %endif // ifarch %{ix86} x86_64
119
120 %package devel
121 Summary:    Bluetooth framework for BlueZ and Obexd
122 Group:      Development/Libraries
123 Requires:   %{name} = %{version}-%{release}
124
125 %description devel
126 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
127 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
128
129 %package service
130 Summary:    Bluetooth Service daemon
131 Group:      Network & Connectivity/Bluetooth
132 Requires:   %{name} = %{version}-%{release}
133
134 %description service
135 This package is Bluetooth Service daemon to manage BT services.
136
137 %package httpproxy
138 Summary:    Bluetooth HTTP Proxy Service daemon
139 Group:      TO_BE/FILLED
140 Requires:   %{name} = %{version}-%{release}
141
142 %description httpproxy
143 This package is Bluetooth HTTP Proxy Service daemon
144
145 %package otp
146 Summary:    Bluetooth OTP Service daemon
147 Group:      Network & Connectivity/Bluetooth
148 Requires:   %{name} = %{version}-%{release}
149
150 %description otp
151 This package is Bluetooth OTP Service daemon
152
153 %package core
154 Summary:    Bluetooth Core daemon
155 Group:      Network & Connectivity/Bluetooth
156 Requires:   %{name} = %{version}-%{release}
157
158 %description core
159 This package is Bluetooth core daemon to manage activation / deactivation.
160
161 %package test
162 Summary:    Bluetooth test application
163 Group:      Network & Connectivity/Bluetooth
164 Requires:   %{name} = %{version}-%{release}
165
166 %description test
167 This package is Bluetooth test application.
168
169 %package plugin-headed
170 Summary:    Bluetooth plugin Headed
171 Group:      Network & Connectivity/Bluetooth
172 Requires:   %{name} = %{version}-%{release}
173
174 %description plugin-headed
175 This package is Bluetooth plugin to manage UI and syspopup
176
177 %prep
178 %setup -q
179 cp %{SOURCE1001} .
180
181
182 %build
183 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
184 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
185 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
186
187 %ifarch x86_64
188 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
189 export CFLAGS+=" -DARCH64"
190 export CXXFLAGS+=" -DARCH64"
191 export FFLAGS+=" -DARCH64"
192 %else
193 export CFLAGS="$CFLAGS -fpie"
194 export LDFLAGS="$CFLAGS -pie"
195 %endif
196
197 %ifarch %{ix86} x86_64
198 export CFLAGS+=" -DTIZEN_TEST_EMUL"
199 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
200 export FFLAGS+=" -DTIZEN_TEST_EMUL"
201 %endif
202
203 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
204 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
205
206 %ifarch aarch64
207 echo arch64
208 export CFLAGS+=" -DARCH64"
209 export CXXFLAGS+=" -DARCH64"
210 export FFLAGS+=" -DARCH64"
211 %endif
212
213 export CFLAGS_DEFAULT="$CFLAGS"
214 export CXXFLAGS_DEFAULT="$CXXFLAGS"
215 export FFLAGS_DEFAULT="$FFLAGS"
216
217 # extension-TM1
218 %ifarch %{ix86} || %{arm}
219 mkdir -p tm1
220 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
221 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
222 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
223
224 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
225 -DCMAKE_LIB_DIR=%{_libdir} \
226 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
227 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
228         -DLIBNOTIFY_SUPPORT=Off \
229         -DLIBNOTIFICATION_SUPPORT=Off
230 make
231
232 %cmake
233
234 %make_install
235 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
236 %endif
237
238 # extension-emulator
239 %ifarch %{ix86} x86_64
240 export CFLAGS="${CFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
241 export CXXFLAGS="${CXXFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
242 export FFLAGS="${FFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
243
244 mkdir -p build_emulator
245
246 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
247 -DCMAKE_LIB_DIR=%{_libdir} \
248 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
249 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
250         -DLIBNOTIFY_SUPPORT=Off \
251         -DLIBNOTIFICATION_SUPPORT=Off
252 make
253
254 %cmake
255
256 %make_install
257 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
258 pushd build_emulator/
259 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
260 popd
261 %endif
262
263 # non-extension-TM1 / non-extension-emulator
264
265 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
266 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
267 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
268
269 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
270 -DCMAKE_LIB_DIR=%{_libdir} \
271 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
272 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
273         -DLIBNOTIFY_SUPPORT=Off \
274         -DLIBNOTIFICATION_SUPPORT=Off
275 make
276
277 %cmake
278
279 %install
280 rm -rf %{buildroot}
281 %make_install
282
283 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
284 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
285
286 # extension-emulator
287 %ifarch %{ix86} x86_64
288 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
289 mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
290 %endif
291
292 # Rename the postfix (.mobile, .tv, ..) at post script
293 # mobile
294 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
295
296 # extension-TM1
297 %ifarch %{ix86} || %{arm}
298 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
299 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
300 %endif
301
302 # wearable / ivi
303 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
304 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
305 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
306 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
307
308 # tv
309 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
310
311 # common
312 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
313
314 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
315 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
316
317 %postun -p /sbin/ldconfig
318
319 %post service
320 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
321 /usr/bin/chown 5001:100 %{_varlibdir}/bluetooth/auto-pair-blacklist
322
323 %files
324 %manifest %{name}.manifest
325 %license LICENSE
326 %defattr(-, root, root)
327 %{_libdir}/libbluetooth-api.so.*
328 %exclude %{_libdir}/libbluetooth-api.so*.emulator
329
330 %files devel
331 %defattr(-, root, root)
332 %{_includedir}/bt-service/bluetooth-api.h
333 %{_includedir}/bt-service/bluetooth-hid-api.h
334 %{_includedir}/bt-service/bluetooth-audio-api.h
335 %{_includedir}/bt-service/bluetooth-telephony-api.h
336 %{_includedir}/bt-service/bluetooth-media-control.h
337 %{_includedir}/bt-service/bluetooth-scmst-api.h
338 %{_includedir}/bt-service/bluetooth-ipsp-api.h
339 %{_libdir}/pkgconfig/bluetooth-api.pc
340 %{_libdir}/libbluetooth-api.so
341
342 # extension-emulator
343 %ifarch %{ix86} x86_64
344 %post extension-emulator
345 pushd %{_libdir}
346 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
347 popd
348 %preun extension-emulator
349 pushd %{_libdir}
350 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
351 popd
352 %files extension-emulator
353 %manifest %{name}.manifest
354 %defattr(-, root, root)
355 %{_libdir}/libbluetooth-api.so.*.emulator
356 %{_libdir}/libbluetooth-api.so.emulator
357 %endif
358
359 %files service
360 %manifest %{name}.manifest
361 %license LICENSE
362 %defattr(-, root, root)
363 %{_bindir}/bt-service
364 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
365 %{_bindir}/bluetooth-frwk-test
366 %{_varlibdir}/bluetooth
367 %{_prefix}/etc/bluetooth
368 %attr(-,owner,users) %{_varlibdir}/bluetooth/auto-pair-blacklist
369
370 %files httpproxy
371 %manifest %{name}.manifest
372 %license LICENSE
373 %defattr(-, root, root)
374 %{_bindir}/bt-httpproxy
375 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
376 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
377
378
379 %files otp
380 %manifest %{name}.manifest
381 %license LICENSE
382 %defattr(-, root, root)
383 %{_bindir}/bt-otp
384 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
385 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
386
387 %files core
388 %manifest %{name}.manifest
389 %license LICENSE
390 %defattr(-, root, root)
391 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
392 %{_bindir}/bt-core
393 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
394
395 %files test
396 %manifest %{name}.manifest
397 %license LICENSE
398 %defattr(-, root, root)
399 %{_bindir}/bluetooth-frwk-test
400 #{_bindir}/bluetooth-gatt-test
401 #{_bindir}/bluetooth-advertising-test
402
403 %files plugin-headed
404 %manifest %{name}.manifest
405 %license LICENSE
406 %defattr(-, root, root)
407 %{_libdir}/bt-plugin-headed.so
408
409 %post profile_common
410 pushd %{_unitdir}
411 mv bluetooth-frwk.service.common bluetooth-frwk.service
412 popd
413 %preun profile_common
414 pushd %{_unitdir}
415 mv bluetooth-frwk.service bluetooth-frwk.service.common
416 popd
417 %files profile_common
418 %license LICENSE
419 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
420 %{_unitdir}/bluetooth-frwk.service.common
421 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
422
423 %post profile_mobile
424 pushd %{_unitdir}
425 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
426 popd
427 %preun profile_mobile
428 pushd %{_unitdir}
429 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
430 popd
431 %files profile_mobile
432 %license LICENSE
433 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
434 %{_unitdir}/bluetooth-frwk.service.mobile
435 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
436
437 # extension-TM1
438 %ifarch %{ix86} || %{arm}
439 %post extension-TM1
440 pushd %{_unitdir}
441 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
442 popd
443 pushd %{_bindir}
444 mv bt-core.tm1 bt-core
445 popd
446 %preun extension-TM1
447 pushd %{_unitdir}
448 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
449 popd
450 pushd %{_bindir}
451 mv bt-core bt-core.tm1
452 popd
453 %files extension-TM1
454 %{_unitdir}/bluetooth-frwk.service.tm1
455 %license LICENSE
456 %defattr(-, root, root)
457 %{_bindir}/bt-core.tm1
458 %endif
459
460 %post profile_wearable
461 pushd %{_unitdir}
462 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
463 popd
464 %preun profile_wearable
465 pushd %{_unitdir}
466 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
467 popd
468 %files profile_wearable
469 %license LICENSE
470 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
471 %{_unitdir}/bluetooth-frwk.service.wearable
472 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
473
474 %post profile_tv
475 pushd %{_unitdir}
476 mv bluetooth-frwk.service.tv bluetooth-frwk.service
477 popd
478 %preun profile_tv
479 pushd %{_unitdir}
480 mv bluetooth-frwk.service bluetooth-frwk.service.tv
481 popd
482 %files profile_tv
483 %license LICENSE
484 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
485 %{_unitdir}/bluetooth-frwk.service.tv
486 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
487
488 # Note: ivi reuses bluetooth-frwk.service.wearable
489 %post profile_ivi
490 pushd %{_unitdir}
491 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
492 popd
493 pushd %{_datadir}/dbus-1/system-services
494 mv org.projectx.bt.service.ivi org.projectx.bt.service
495 popd
496 %preun profile_ivi
497 pushd %{_unitdir}
498 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
499 popd
500 pushd %{_datadir}/dbus-1/system-services
501 mv org.projectx.bt.service org.projectx.bt.service.ivi
502 popd
503 %files profile_ivi
504 %license LICENSE
505 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
506 %{_unitdir}/bluetooth-frwk.service.wearable
507 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
508
509 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
510 # (for PROFILE WEARABLE)
511