Support i586 unified build
[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.157
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(appcore-efl)
33 BuildRequires:  pkgconfig(pkgmgr)
34 #BuildRequires:  pkgconfig(journal)
35 BuildRequires:  pkgconfig(eventsystem)
36 BuildRequires:  pkgconfig(libsoup-2.4)
37 BuildRequires:  pkgconfig(capi-network-tethering)
38 BuildRequires:  cmake
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
45 Requires(post): /usr/bin/vconftool
46 Requires(post): /sbin/ldconfig
47 Requires(postun): /sbin/ldconfig
48 Requires: psmisc
49
50 %description
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.
53
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
63
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
73
74 # extension-TM1
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
81 %endif
82
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
92
93 %package profile_tv
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
102
103 %package profile_ivi
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
112
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
120
121 %package devel
122 Summary:    Bluetooth framework for BlueZ and Obexd
123 Group:      Development/Libraries
124 Requires:   %{name} = %{version}-%{release}
125
126 %description devel
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.
129
130 %package service
131 Summary:    Bluetooth Service daemon
132 Group:      Network & Connectivity/Bluetooth
133 Requires:   %{name} = %{version}-%{release}
134
135 %description service
136 This package is Bluetooth Service daemon to manage BT services.
137
138 %package httpproxy
139 Summary:    Bluetooth HTTP Proxy Service daemon
140 Group:      TO_BE/FILLED
141 Requires:   %{name} = %{version}-%{release}
142
143 %description httpproxy
144 This package is Bluetooth HTTP Proxy Service daemon
145
146 %package core
147 Summary:    Bluetooth Core daemon
148 Group:      Network & Connectivity/Bluetooth
149 Requires:   %{name} = %{version}-%{release}
150
151 %description core
152 This package is Bluetooth core daemon to manage activation / deactivation.
153
154 %package test
155 Summary:    Bluetooth test application
156 Group:      Network & Connectivity/Bluetooth
157 Requires:   %{name} = %{version}-%{release}
158
159 %description test
160 This package is Bluetooth test application.
161
162 %package plugin-headed
163 Summary:    Bluetooth plugin Headed
164 Group:      Network & Connectivity/Bluetooth
165 Requires:   %{name} = %{version}-%{release}
166
167 %description plugin-headed
168 This package is Bluetooth plugin to manage UI and syspopup
169
170 %prep
171 %setup -q
172 cp %{SOURCE1001} .
173
174
175 %build
176 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
177 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
178 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
179
180 %ifarch x86_64
181 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
182 export CFLAGS+=" -DARCH64"
183 export CXXFLAGS+=" -DARCH64"
184 export FFLAGS+=" -DARCH64"
185 %else
186 export CFLAGS="$CFLAGS -fpie"
187 export LDFLAGS="$CFLAGS -pie"
188 %endif
189
190 %ifarch %{ix86} x86_64
191 export CFLAGS+=" -DTIZEN_TEST_EMUL"
192 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"
193 export FFLAGS+=" -DTIZEN_TEST_EMUL"
194 %endif
195
196 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
197 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
198
199 %ifarch aarch64
200 echo arch64
201 export CFLAGS+=" -DARCH64"
202 export CXXFLAGS+=" -DARCH64"
203 export FFLAGS+=" -DARCH64"
204 %endif
205
206 export CFLAGS_DEFAULT="$CFLAGS"
207 export CXXFLAGS_DEFAULT="$CXXFLAGS"
208 export FFLAGS_DEFAULT="$FFLAGS"
209
210 # extension-TM1
211 %ifarch %{ix86} || %{arm}
212 mkdir -p tm1
213 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
214 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
215 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
216
217 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
218 -DCMAKE_LIB_DIR=%{_libdir} \
219 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
220 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
221         -DLIBNOTIFY_SUPPORT=Off \
222         -DLIBNOTIFICATION_SUPPORT=Off
223 make
224
225 %cmake
226
227 %make_install
228 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
229 %endif
230
231 # extension-emulator
232 %ifarch %{ix86} x86_64
233 export CFLAGS="${CFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
234 export CXXFLAGS="${CXXFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
235 export FFLAGS="${FFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
236
237 mkdir -p build_emulator
238
239 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
240 -DCMAKE_LIB_DIR=%{_libdir} \
241 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
242 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
243         -DLIBNOTIFY_SUPPORT=Off \
244         -DLIBNOTIFICATION_SUPPORT=Off
245 make
246
247 %cmake
248
249 %make_install
250 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
251 pushd build_emulator/
252 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
253 popd
254 %endif
255
256 # non-extension-TM1 / non-extension-emulator
257
258 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
259 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
260 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
261
262 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
263 -DCMAKE_LIB_DIR=%{_libdir} \
264 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
265 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
266         -DLIBNOTIFY_SUPPORT=Off \
267         -DLIBNOTIFICATION_SUPPORT=Off
268 make
269
270 %cmake
271
272 %install
273 rm -rf %{buildroot}
274 %make_install
275
276 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
277 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
278
279 # extension-emulator
280 %ifarch %{ix86} x86_64
281 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
282 mv %{buildroot}/%{_bindir}/bt-service-emul %{buildroot}/%{_bindir}/bt-service
283 %endif
284
285 # Rename the postfix (.mobile, .tv, ..) at post script
286 # mobile
287 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
288
289 # extension-TM1
290 %ifarch %{ix86} || %{arm}
291 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
292 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
293 %endif
294
295 # wearable / ivi
296 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
297 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
298 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
299 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
300
301 # tv
302 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
303
304 # common
305 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
306
307 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
308 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
309
310 %postun -p /sbin/ldconfig
311
312 %files
313 %manifest %{name}.manifest
314 %license LICENSE
315 %defattr(-, root, root)
316 %{_libdir}/libbluetooth-api.so.*
317 %exclude %{_libdir}/libbluetooth-api.so*.emulator
318
319 %files devel
320 %defattr(-, root, root)
321 %{_includedir}/bt-service/bluetooth-api.h
322 %{_includedir}/bt-service/bluetooth-hid-api.h
323 %{_includedir}/bt-service/bluetooth-audio-api.h
324 %{_includedir}/bt-service/bluetooth-telephony-api.h
325 %{_includedir}/bt-service/bluetooth-media-control.h
326 %{_includedir}/bt-service/bluetooth-scmst-api.h
327 %{_includedir}/bt-service/bluetooth-ipsp-api.h
328 %{_libdir}/pkgconfig/bluetooth-api.pc
329 %{_libdir}/libbluetooth-api.so
330
331 # extension-emulator
332 %ifarch %{ix86} x86_64
333 %post extension-emulator
334 pushd %{_libdir}
335 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
336 popd
337 %preun extension-emulator
338 pushd %{_libdir}
339 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
340 popd
341 %files extension-emulator
342 %manifest %{name}.manifest
343 %defattr(-, root, root)
344 %{_libdir}/libbluetooth-api.so.*.emulator
345 %{_libdir}/libbluetooth-api.so.emulator
346 %endif
347
348 %files service
349 %manifest %{name}.manifest
350 %license LICENSE
351 %defattr(-, root, root)
352 %{_bindir}/bt-service
353 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
354 %{_bindir}/bluetooth-frwk-test
355 %{_varlibdir}/bluetooth
356 %{_prefix}/etc/bluetooth
357
358 %files httpproxy
359 %manifest %{name}.manifest
360 %license LICENSE
361 %defattr(-, root, root)
362 %{_bindir}/bt-httpproxy
363 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
364 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
365
366 %files core
367 %manifest %{name}.manifest
368 %license LICENSE
369 %defattr(-, root, root)
370 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
371 %{_bindir}/bt-core
372 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
373
374 %files test
375 %manifest %{name}.manifest
376 %license LICENSE
377 %defattr(-, root, root)
378 %{_bindir}/bluetooth-frwk-test
379 #{_bindir}/bluetooth-gatt-test
380 #{_bindir}/bluetooth-advertising-test
381
382 %files plugin-headed
383 %manifest %{name}.manifest
384 %license LICENSE
385 %defattr(-, root, root)
386 %{_libdir}/bt-plugin-headed.so
387
388 %post profile_common
389 pushd %{_unitdir}
390 mv bluetooth-frwk.service.common bluetooth-frwk.service
391 popd
392 %preun profile_common
393 pushd %{_unitdir}
394 mv bluetooth-frwk.service bluetooth-frwk.service.common
395 popd
396 %files profile_common
397 %license LICENSE
398 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
399 %{_unitdir}/bluetooth-frwk.service.common
400 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
401
402 %post profile_mobile
403 pushd %{_unitdir}
404 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
405 popd
406 %preun profile_mobile
407 pushd %{_unitdir}
408 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
409 popd
410 %files profile_mobile
411 %license LICENSE
412 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
413 %{_unitdir}/bluetooth-frwk.service.mobile
414 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
415
416 # extension-TM1
417 %ifarch %{ix86} || %{arm}
418 %post extension-TM1
419 pushd %{_unitdir}
420 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
421 popd
422 pushd %{_bindir}
423 mv bt-core.tm1 bt-core
424 popd
425 %preun extension-TM1
426 pushd %{_unitdir}
427 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
428 popd
429 pushd %{_bindir}
430 mv bt-core bt-core.tm1
431 popd
432 %files extension-TM1
433 %{_unitdir}/bluetooth-frwk.service.tm1
434 %license LICENSE
435 %defattr(-, root, root)
436 %{_bindir}/bt-core.tm1
437 %endif
438
439 %post profile_wearable
440 pushd %{_unitdir}
441 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
442 popd
443 %preun profile_wearable
444 pushd %{_unitdir}
445 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
446 popd
447 %files profile_wearable
448 %license LICENSE
449 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
450 %{_unitdir}/bluetooth-frwk.service.wearable
451 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
452
453 %post profile_tv
454 pushd %{_unitdir}
455 mv bluetooth-frwk.service.tv bluetooth-frwk.service
456 popd
457 %preun profile_tv
458 pushd %{_unitdir}
459 mv bluetooth-frwk.service bluetooth-frwk.service.tv
460 popd
461 %files profile_tv
462 %license LICENSE
463 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
464 %{_unitdir}/bluetooth-frwk.service.tv
465 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
466
467 # Note: ivi reuses bluetooth-frwk.service.wearable
468 %post profile_ivi
469 pushd %{_unitdir}
470 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
471 popd
472 pushd %{_datadir}/dbus-1/system-services
473 mv org.projectx.bt.service.ivi org.projectx.bt.service
474 popd
475 %preun profile_ivi
476 pushd %{_unitdir}
477 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
478 popd
479 pushd %{_datadir}/dbus-1/system-services
480 mv org.projectx.bt.service org.projectx.bt.service.ivi
481 popd
482 %files profile_ivi
483 %license LICENSE
484 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
485 %{_unitdir}/bluetooth-frwk.service.wearable
486 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
487
488 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
489 # (for PROFILE WEARABLE)
490