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