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