Remove bluetooth-tools requires
[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 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)
34 BuildRequires:  cmake
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)
41
42 Requires(post): /usr/bin/vconftool
43 Requires(post): /sbin/ldconfig
44 Requires(postun): /sbin/ldconfig
45
46 %description
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.
49
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
59
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
69
70 # extension-TM1
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
77 %endif
78
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
88
89 %package profile_tv
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
98
99 %package profile_ivi
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
108
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
116
117 %package devel
118 Summary:    Bluetooth framework for BlueZ and Obexd
119 Group:      Development/Libraries
120 Requires:   %{name} = %{version}-%{release}
121
122 %description devel
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.
125
126 %package service
127 Summary:    Bluetooth Service daemon
128 Group:      Network & Connectivity/Bluetooth
129 Requires:   %{name} = %{version}-%{release}
130
131 %description service
132 This package is Bluetooth Service daemon to manage BT services.
133
134 %package httpproxy
135 Summary:    Bluetooth HTTP Proxy Service daemon
136 Group:      TO_BE/FILLED
137 Requires:   %{name} = %{version}-%{release}
138
139 %description httpproxy
140 This package is Bluetooth HTTP Proxy Service daemon
141
142 %package otp
143 Summary:    Bluetooth OTP Service daemon
144 Group:      Network & Connectivity/Bluetooth
145 Requires:   %{name} = %{version}-%{release}
146
147 %description otp
148 This package is Bluetooth OTP Service daemon
149
150 %package core
151 Summary:    Bluetooth Core daemon
152 Group:      Network & Connectivity/Bluetooth
153 Requires:   %{name} = %{version}-%{release}
154
155 %description core
156 This package is Bluetooth core daemon to manage activation / deactivation.
157
158 %package test
159 Summary:    Bluetooth test application
160 Group:      Network & Connectivity/Bluetooth
161 Requires:   %{name} = %{version}-%{release}
162
163 %description test
164 This package is Bluetooth test application.
165
166 %package plugin-headed
167 Summary:    Bluetooth plugin Headed
168 Group:      Network & Connectivity/Bluetooth
169 Requires:   %{name} = %{version}-%{release}
170
171 %description plugin-headed
172 This package is Bluetooth plugin to manage UI and syspopup
173
174 %prep
175 %setup -q
176 cp %{SOURCE1001} .
177
178
179 %build
180 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
181 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
182 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
183
184 %ifarch x86_64
185 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
186 export CFLAGS+=" -DARCH64"
187 export CXXFLAGS+=" -DARCH64"
188 export FFLAGS+=" -DARCH64"
189 %else
190 export CFLAGS="$CFLAGS -fpie"
191 export LDFLAGS="$CFLAGS -pie"
192 %endif
193
194 %ifarch %{ix86} x86_64
195 export CFLAGS+=" -DTIZEN_TEST_EMUL"
196 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
197 export FFLAGS+=" -DTIZEN_TEST_EMUL"
198 %endif
199
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"
202
203 %ifarch aarch64
204 echo arch64
205 export CFLAGS+=" -DARCH64"
206 export CXXFLAGS+=" -DARCH64"
207 export FFLAGS+=" -DARCH64"
208 %endif
209
210 export CFLAGS_DEFAULT="$CFLAGS"
211 export CXXFLAGS_DEFAULT="$CXXFLAGS"
212 export FFLAGS_DEFAULT="$FFLAGS"
213
214 # extension-TM1
215 %ifarch %{ix86} || %{arm}
216 mkdir -p tm1
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"
220
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
227 make
228
229 %cmake
230
231 %make_install
232 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
233 %endif
234
235 # extension-emulator
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"
240
241 mkdir -p build_emulator
242
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
249 make
250
251 %cmake
252
253 %make_install
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
257 popd
258 %endif
259
260 # non-extension-TM1 / non-extension-emulator
261
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"
265
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
272 make
273
274 %cmake
275
276 %install
277 rm -rf %{buildroot}
278 %make_install
279
280 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
281 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
282
283 # extension-emulator
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
287 %endif
288
289 # Rename the postfix (.mobile, .tv, ..) at post script
290 # mobile
291 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
292
293 # extension-TM1
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
297 %endif
298
299 # wearable / ivi
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
304
305 # tv
306 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
307
308 # common
309 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
310
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
313
314 %postun -p /sbin/ldconfig
315
316 %post service
317 /usr/bin/chsmack -a '_' %{_varlibdir}/bluetooth/auto-pair-blacklist
318 /usr/bin/chown 5001:100 %{_varlibdir}/bluetooth/auto-pair-blacklist
319
320 %files
321 %manifest %{name}.manifest
322 %license LICENSE
323 %defattr(-, root, root)
324 %{_libdir}/libbluetooth-api.so.*
325 %exclude %{_libdir}/libbluetooth-api.so*.emulator
326
327 %files devel
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
338
339 # extension-emulator
340 %ifarch %{ix86} x86_64
341 %post extension-emulator
342 pushd %{_libdir}
343 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
344 popd
345 %preun extension-emulator
346 pushd %{_libdir}
347 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
348 popd
349 %files extension-emulator
350 %manifest %{name}.manifest
351 %defattr(-, root, root)
352 %{_libdir}/libbluetooth-api.so.*.emulator
353 %{_libdir}/libbluetooth-api.so.emulator
354 %endif
355
356 %files service
357 %manifest %{name}.manifest
358 %license LICENSE
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
366
367 %files httpproxy
368 %manifest %{name}.manifest
369 %license LICENSE
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
374
375
376 %files otp
377 %manifest %{name}.manifest
378 %license LICENSE
379 %defattr(-, root, root)
380 %{_bindir}/bt-otp
381 %{_datadir}/dbus-1/system-services/org.projectx.otp.service
382 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-otp.conf
383
384 %files core
385 %manifest %{name}.manifest
386 %license LICENSE
387 %defattr(-, root, root)
388 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
389 %{_bindir}/bt-core
390 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
391
392 %files test
393 %manifest %{name}.manifest
394 %license LICENSE
395 %defattr(-, root, root)
396 %{_bindir}/bluetooth-frwk-test
397 #{_bindir}/bluetooth-gatt-test
398 #{_bindir}/bluetooth-advertising-test
399
400 %files plugin-headed
401 %manifest %{name}.manifest
402 %license LICENSE
403 %defattr(-, root, root)
404 %{_libdir}/bt-plugin-headed.so
405
406 %post profile_common
407 pushd %{_unitdir}
408 mv bluetooth-frwk.service.common bluetooth-frwk.service
409 popd
410 %preun profile_common
411 pushd %{_unitdir}
412 mv bluetooth-frwk.service bluetooth-frwk.service.common
413 popd
414 %files profile_common
415 %license LICENSE
416 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
417 %{_unitdir}/bluetooth-frwk.service.common
418 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
419
420 %post profile_mobile
421 pushd %{_unitdir}
422 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
423 popd
424 %preun profile_mobile
425 pushd %{_unitdir}
426 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
427 popd
428 %files profile_mobile
429 %license LICENSE
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
433
434 # extension-TM1
435 %ifarch %{ix86} || %{arm}
436 %post extension-TM1
437 pushd %{_unitdir}
438 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
439 popd
440 pushd %{_bindir}
441 mv bt-core.tm1 bt-core
442 popd
443 %preun extension-TM1
444 pushd %{_unitdir}
445 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
446 popd
447 pushd %{_bindir}
448 mv bt-core bt-core.tm1
449 popd
450 %files extension-TM1
451 %{_unitdir}/bluetooth-frwk.service.tm1
452 %license LICENSE
453 %defattr(-, root, root)
454 %{_bindir}/bt-core.tm1
455 %endif
456
457 %post profile_wearable
458 pushd %{_unitdir}
459 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
460 popd
461 %preun profile_wearable
462 pushd %{_unitdir}
463 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
464 popd
465 %files profile_wearable
466 %license LICENSE
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
470
471 %post profile_tv
472 pushd %{_unitdir}
473 mv bluetooth-frwk.service.tv bluetooth-frwk.service
474 popd
475 %preun profile_tv
476 pushd %{_unitdir}
477 mv bluetooth-frwk.service bluetooth-frwk.service.tv
478 popd
479 %files profile_tv
480 %license LICENSE
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
484
485 # Note: ivi reuses bluetooth-frwk.service.wearable
486 %post profile_ivi
487 pushd %{_unitdir}
488 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
489 popd
490 pushd %{_datadir}/dbus-1/system-services
491 mv org.projectx.bt.service.ivi org.projectx.bt.service
492 popd
493 %preun profile_ivi
494 pushd %{_unitdir}
495 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
496 popd
497 pushd %{_datadir}/dbus-1/system-services
498 mv org.projectx.bt.service org.projectx.bt.service.ivi
499 popd
500 %files profile_ivi
501 %license LICENSE
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
505
506 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
507 # (for PROFILE WEARABLE)
508