Fix the build error for unified x86_64 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 -DTIZEN_TEST_EMUL"
183 export CXXFLAGS+=" -DARCH64 -DTIZEN_TEST_EMUL"
184 export FFLAGS+=" -DARCH64 -DTIZEN_TEST_EMUL"
185 %else
186 export CFLAGS="$CFLAGS -fpie"
187 export LDFLAGS="$CFLAGS -pie"
188 %endif
189
190 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
191 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
192
193 %ifarch aarch64
194 echo arch64
195 export CFLAGS+=" -DARCH64"
196 export CXXFLAGS+=" -DARCH64"
197 export FFLAGS+=" -DARCH64"
198 %endif
199
200 export CFLAGS_DEFAULT="$CFLAGS"
201 export CXXFLAGS_DEFAULT="$CXXFLAGS"
202 export FFLAGS_DEFAULT="$FFLAGS"
203
204 # extension-TM1
205 %ifarch %{ix86} || %{arm}
206 mkdir -p tm1
207 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
208 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
209 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
210
211 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
212 -DCMAKE_LIB_DIR=%{_libdir} \
213 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
214 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
215         -DLIBNOTIFY_SUPPORT=Off \
216         -DLIBNOTIFICATION_SUPPORT=Off
217 make
218
219 %cmake
220
221 %make_install
222 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
223 %endif
224
225 # extension-emulator
226 %ifarch %{ix86} x86_64
227 export CFLAGS="${CFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
228 export CXXFLAGS="${CXXFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
229 export FFLAGS="${FFLAGS_BASE} -DTIZEN_TEST_EMUL -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
230
231 mkdir -p build_emulator
232
233 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
234 -DCMAKE_LIB_DIR=%{_libdir} \
235 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
236 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
237         -DLIBNOTIFY_SUPPORT=Off \
238         -DLIBNOTIFICATION_SUPPORT=Off
239 make
240
241 %cmake
242
243 %make_install
244 cp %{buildroot}%{_libdir}/libbluetooth-api.so* build_emulator/
245 pushd build_emulator/
246 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
247 popd
248 %endif
249
250 # non-extension-TM1 / non-extension-emulator
251
252 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
253 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
254 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
255
256 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
257 -DCMAKE_LIB_DIR=%{_libdir} \
258 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
259 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
260         -DLIBNOTIFY_SUPPORT=Off \
261         -DLIBNOTIFICATION_SUPPORT=Off
262 make
263
264 %cmake
265
266 %install
267 rm -rf %{buildroot}
268 %make_install
269
270 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
271 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
272
273 # extension-emulator
274 %ifarch %{ix86} x86_64
275 cp build_emulator/libbluetooth-api.so*.emulator %{buildroot}%{_libdir}/
276 %endif
277
278 # Rename the postfix (.mobile, .tv, ..) at post script
279 # mobile
280 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
281
282 # extension-TM1
283 %ifarch %{ix86} || %{arm}
284 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
285 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
286 %endif
287
288 # wearable / ivi
289 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
290 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
291 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
292 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
293
294 # tv
295 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
296
297 # common
298 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
299
300 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
301 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
302
303 %postun -p /sbin/ldconfig
304
305 %files
306 %manifest %{name}.manifest
307 %license LICENSE
308 %defattr(-, root, root)
309 %{_libdir}/libbluetooth-api.so.*
310 %exclude %{_libdir}/libbluetooth-api.so*.emulator
311
312 %files devel
313 %defattr(-, root, root)
314 %{_includedir}/bt-service/bluetooth-api.h
315 %{_includedir}/bt-service/bluetooth-hid-api.h
316 %{_includedir}/bt-service/bluetooth-audio-api.h
317 %{_includedir}/bt-service/bluetooth-telephony-api.h
318 %{_includedir}/bt-service/bluetooth-media-control.h
319 %{_includedir}/bt-service/bluetooth-scmst-api.h
320 %{_includedir}/bt-service/bluetooth-ipsp-api.h
321 %{_libdir}/pkgconfig/bluetooth-api.pc
322 %{_libdir}/libbluetooth-api.so
323
324 # extension-emulator
325 %ifarch %{ix86} x86_64
326 %post extension-emulator
327 pushd %{_libdir}
328 for FILE in libbluetooth-api.so*.emulator; do mv "${FILE}" "${FILE%.emulator}"; done
329 popd
330 %preun extension-emulator
331 pushd %{_libdir}
332 for FILE in libbluetooth-api.so*; do mv "${FILE}" "${FILE}.emulator"; done
333 popd
334 %files extension-emulator
335 %manifest %{name}.manifest
336 %defattr(-, root, root)
337 %{_libdir}/libbluetooth-api.so.*.emulator
338 %{_libdir}/libbluetooth-api.so.emulator
339 %endif
340
341 %files service
342 %manifest %{name}.manifest
343 %license LICENSE
344 %defattr(-, root, root)
345 %{_bindir}/bt-service
346 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
347 %{_bindir}/bluetooth-frwk-test
348 %{_varlibdir}/bluetooth
349 %{_prefix}/etc/bluetooth
350
351 %files httpproxy
352 %manifest %{name}.manifest
353 %license LICENSE
354 %defattr(-, root, root)
355 %{_bindir}/bt-httpproxy
356 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
357 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
358
359 %files core
360 %manifest %{name}.manifest
361 %license LICENSE
362 %defattr(-, root, root)
363 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
364 %{_bindir}/bt-core
365 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
366
367 %files test
368 %manifest %{name}.manifest
369 %license LICENSE
370 %defattr(-, root, root)
371 %{_bindir}/bluetooth-frwk-test
372 #{_bindir}/bluetooth-gatt-test
373 #{_bindir}/bluetooth-advertising-test
374
375 %files plugin-headed
376 %manifest %{name}.manifest
377 %license LICENSE
378 %defattr(-, root, root)
379 %{_libdir}/bt-plugin-headed.so
380
381 %post profile_common
382 pushd %{_unitdir}
383 mv bluetooth-frwk.service.common bluetooth-frwk.service
384 popd
385 %preun profile_common
386 pushd %{_unitdir}
387 mv bluetooth-frwk.service bluetooth-frwk.service.common
388 popd
389 %files profile_common
390 %license LICENSE
391 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
392 %{_unitdir}/bluetooth-frwk.service.common
393 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
394
395 %post profile_mobile
396 pushd %{_unitdir}
397 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
398 popd
399 %preun profile_mobile
400 pushd %{_unitdir}
401 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
402 popd
403 %files profile_mobile
404 %license LICENSE
405 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
406 %{_unitdir}/bluetooth-frwk.service.mobile
407 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
408
409 # extension-TM1
410 %ifarch %{ix86} || %{arm}
411 %post extension-TM1
412 pushd %{_unitdir}
413 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
414 popd
415 pushd %{_bindir}
416 mv bt-core.tm1 bt-core
417 popd
418 %preun extension-TM1
419 pushd %{_unitdir}
420 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
421 popd
422 pushd %{_bindir}
423 mv bt-core bt-core.tm1
424 popd
425 %files extension-TM1
426 %{_unitdir}/bluetooth-frwk.service.tm1
427 %license LICENSE
428 %defattr(-, root, root)
429 %{_bindir}/bt-core.tm1
430 %endif
431
432 %post profile_wearable
433 pushd %{_unitdir}
434 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
435 popd
436 %preun profile_wearable
437 pushd %{_unitdir}
438 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
439 popd
440 %files profile_wearable
441 %license LICENSE
442 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
443 %{_unitdir}/bluetooth-frwk.service.wearable
444 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
445
446 %post profile_tv
447 pushd %{_unitdir}
448 mv bluetooth-frwk.service.tv bluetooth-frwk.service
449 popd
450 %preun profile_tv
451 pushd %{_unitdir}
452 mv bluetooth-frwk.service bluetooth-frwk.service.tv
453 popd
454 %files profile_tv
455 %license LICENSE
456 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
457 %{_unitdir}/bluetooth-frwk.service.tv
458 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
459
460 # Note: ivi reuses bluetooth-frwk.service.wearable
461 %post profile_ivi
462 pushd %{_unitdir}
463 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
464 popd
465 pushd %{_datadir}/dbus-1/system-services
466 mv org.projectx.bt.service.ivi org.projectx.bt.service
467 popd
468 %preun profile_ivi
469 pushd %{_unitdir}
470 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
471 popd
472 pushd %{_datadir}/dbus-1/system-services
473 mv org.projectx.bt.service org.projectx.bt.service.ivi
474 popd
475 %files profile_ivi
476 %license LICENSE
477 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
478 %{_unitdir}/bluetooth-frwk.service.wearable
479 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
480
481 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
482 # (for PROFILE WEARABLE)
483