Modify the BuildRequire in specfile
[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 %if "%{?profile}" != "mobile"
15 Requires: bluetooth-tools
16 %endif
17 BuildRequires:  pkgconfig(aul)
18 BuildRequires:  pkgconfig(dlog)
19 BuildRequires:  pkgconfig(glib-2.0)
20 BuildRequires:  pkgconfig(gio-2.0)
21 BuildRequires:  pkgconfig(gio-unix-2.0)
22 BuildRequires:  pkgconfig(syspopup-caller)
23 BuildRequires:  pkgconfig(vconf)
24 BuildRequires:  pkgconfig(libxml-2.0)
25 BuildRequires:  pkgconfig(capi-network-connection)
26 BuildRequires:  pkgconfig(alarm-service)
27 BuildRequires:  pkgconfig(capi-content-mime-type)
28 BuildRequires:  pkgconfig(appcore-efl)
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
41 Requires(post): /usr/bin/vconftool
42 Requires(post): /sbin/ldconfig
43 Requires(postun): /sbin/ldconfig
44 Requires: psmisc
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 %package devel
110 Summary:    Bluetooth framework for BlueZ and Obexd
111 Group:      Development/Libraries
112 Requires:   %{name} = %{version}-%{release}
113
114 %description devel
115 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
116 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
117
118 %package service
119 Summary:    Bluetooth Service daemon
120 Group:      Network & Connectivity/Bluetooth
121 Requires:   %{name} = %{version}-%{release}
122
123 %description service
124 This package is Bluetooth Service daemon to manage BT services.
125
126 %package httpproxy
127 Summary:    Bluetooth HTTP Proxy Service daemon
128 Group:      TO_BE/FILLED
129 Requires:   %{name} = %{version}-%{release}
130
131 %description httpproxy
132 This package is Bluetooth HTTP Proxy Service daemon
133
134 %package core
135 Summary:    Bluetooth Core daemon
136 Group:      Network & Connectivity/Bluetooth
137 Requires:   %{name} = %{version}-%{release}
138
139 %description core
140 This package is Bluetooth core daemon to manage activation / deactivation.
141
142 %package test
143 Summary:    Bluetooth test application
144 Group:      Network & Connectivity/Bluetooth
145 Requires:   %{name} = %{version}-%{release}
146
147 %description test
148 This package is Bluetooth test application.
149
150 %package plugin-headed
151 Summary:    Bluetooth plugin Headed
152 Group:      Network & Connectivity/Bluetooth
153 Requires:   %{name} = %{version}-%{release}
154
155 %description plugin-headed
156 This package is Bluetooth plugin to manage UI and syspopup
157
158 %prep
159 %setup -q
160 cp %{SOURCE1001} .
161
162
163 %build
164 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
165 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
166 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
167
168 %ifarch x86_64
169 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
170 export CFLAGS+=" -DARCH64"
171 export CXXFLAGS+=" -DARCH64"
172 export FFLAGS+=" -DARCH64"
173 %else
174 export CFLAGS="$CFLAGS -fpie"
175 export LDFLAGS="$CFLAGS -pie"
176 %endif
177
178 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
179 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
180
181 %if "%{?_with_emulator}" == "1"
182 export CFLAGS="$CFLAGS -DTIZEN_TEST_EMUL"
183 export CXXFLAGS="$CXXFLAGS -DTIZEN_TEST_EMUL"
184 export FFLAGS="$FFLAGS -DTIZEN_TEST_EMUL"
185 %endif
186
187 %ifarch aarch64
188 echo arch64
189 export CFLAGS+=" -DARCH64"
190 export CXXFLAGS+=" -DARCH64"
191 export FFLAGS+=" -DARCH64"
192 %endif
193
194 export CFLAGS_DEFAULT="$CFLAGS"
195 export CXXFLAGS_DEFAULT="$CXXFLAGS"
196 export FFLAGS_DEFAULT="$FFLAGS"
197
198 # extension-TM1
199 %ifarch %{ix86} || %{arm}
200 mkdir -p tm1
201 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
202 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
203 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
204
205 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
206 -DCMAKE_LIB_DIR=%{_libdir} \
207 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
208 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
209         -DLIBNOTIFY_SUPPORT=Off \
210         -DLIBNOTIFICATION_SUPPORT=Off
211 make
212
213 %cmake
214
215 %make_install
216 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
217 %endif
218
219 # non-extension-TM1
220 export CFLAGS="$CFLAGS_DEFAULT"
221 export CXXFLAGS="$CXXFLAGS_DEFAULT"
222 export FFLAGS="$FFLAGS_DEFAULT"
223
224 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
225 -DCMAKE_LIB_DIR=%{_libdir} \
226 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
227 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
228         -DLIBNOTIFY_SUPPORT=Off \
229         -DLIBNOTIFICATION_SUPPORT=Off
230 make
231
232 %cmake
233
234 %install
235 rm -rf %{buildroot}
236 %make_install
237
238 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
239 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
240 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-httpproxy
241 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
242
243 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
244 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
245
246 # Rename the postfix (.mobile, .tv, ..) at post script
247 # mobile
248 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
249
250 # extension-TM1
251 %ifarch %{ix86} || %{arm}
252 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
253 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
254 %endif
255
256 # wearable / ivi
257 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
258 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
259 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
260 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
261
262 # tv
263 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
264
265 # common
266 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
267
268 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
269 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
270
271 %postun -p /sbin/ldconfig
272
273 %files
274 %manifest %{name}.manifest
275 %defattr(-, root, root)
276 %{_libdir}/libbluetooth-api.so.*
277 %{_datadir}/license/bluetooth-frwk
278
279 %files devel
280 %defattr(-, root, root)
281 %{_includedir}/bt-service/bluetooth-api.h
282 %{_includedir}/bt-service/bluetooth-hid-api.h
283 %{_includedir}/bt-service/bluetooth-audio-api.h
284 %{_includedir}/bt-service/bluetooth-telephony-api.h
285 %{_includedir}/bt-service/bluetooth-media-control.h
286 %{_includedir}/bt-service/bluetooth-scmst-api.h
287 %{_includedir}/bt-service/bluetooth-ipsp-api.h
288 %{_libdir}/pkgconfig/bluetooth-api.pc
289 %{_libdir}/libbluetooth-api.so
290 %{_datadir}/license/bluetooth-frwk-devel
291
292 %files service
293 %manifest %{name}.manifest
294 %defattr(-, root, root)
295 %{_bindir}/bt-service
296 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
297 %{_bindir}/bluetooth-frwk-test
298 %{_varlibdir}/bluetooth
299 %{_prefix}/etc/bluetooth
300 %{_datadir}/license/bluetooth-frwk-service
301
302 %files httpproxy
303 %manifest %{name}.manifest
304 %defattr(-, root, root)
305 %{_bindir}/bt-httpproxy
306 %{_datadir}/license/bluetooth-frwk-httpproxy
307 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
308 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
309
310 %files core
311 %manifest %{name}.manifest
312 %defattr(-, root, root)
313 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
314 %{_bindir}/bt-core
315 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
316
317 %files test
318 %manifest %{name}.manifest
319 %defattr(-, root, root)
320 %{_bindir}/bluetooth-frwk-test
321 #{_bindir}/bluetooth-gatt-test
322 #{_bindir}/bluetooth-advertising-test
323
324 %files plugin-headed
325 %manifest %{name}.manifest
326 %defattr(-, root, root)
327 %{_libdir}/bt-plugin-headed.so
328
329 %post profile_common
330 pushd %{_unitdir}
331 mv bluetooth-frwk.service.common bluetooth-frwk.service
332 popd
333 %preun profile_common
334 pushd %{_unitdir}
335 mv bluetooth-frwk.service bluetooth-frwk.service.common
336 popd
337 %files profile_common
338 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
339 %{_unitdir}/bluetooth-frwk.service.common
340 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
341
342 %post profile_mobile
343 pushd %{_unitdir}
344 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
345 popd
346 %preun profile_mobile
347 pushd %{_unitdir}
348 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
349 popd
350 %files profile_mobile
351 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
352 %{_unitdir}/bluetooth-frwk.service.mobile
353 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
354
355 # extension-TM1
356 %ifarch %{ix86} || %{arm}
357 %post extension-TM1
358 pushd %{_unitdir}
359 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
360 popd
361 pushd %{_bindir}
362 mv bt-core.tm1 bt-core
363 popd
364 %preun extension-TM1
365 pushd %{_unitdir}
366 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
367 popd
368 pushd %{_bindir}
369 mv bt-core bt-core.tm1
370 popd
371 %files extension-TM1
372 %{_unitdir}/bluetooth-frwk.service.tm1
373 %defattr(-, root, root)
374 %{_bindir}/bt-core.tm1
375 %endif
376
377 %post profile_wearable
378 pushd %{_unitdir}
379 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
380 popd
381 %preun profile_wearable
382 pushd %{_unitdir}
383 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
384 popd
385 %files profile_wearable
386 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
387 %{_unitdir}/bluetooth-frwk.service.wearable
388 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
389
390 %post profile_tv
391 pushd %{_unitdir}
392 mv bluetooth-frwk.service.tv bluetooth-frwk.service
393 popd
394 %preun profile_tv
395 pushd %{_unitdir}
396 mv bluetooth-frwk.service bluetooth-frwk.service.tv
397 popd
398 %files profile_tv
399 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
400 %{_unitdir}/bluetooth-frwk.service.tv
401 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
402
403 # Note: ivi reuses bluetooth-frwk.service.wearable
404 %post profile_ivi
405 pushd %{_unitdir}
406 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
407 popd
408 pushd %{_datadir}/dbus-1/system-services
409 mv org.projectx.bt.service.ivi org.projectx.bt.service
410 popd
411 %preun profile_ivi
412 pushd %{_unitdir}
413 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
414 popd
415 pushd %{_datadir}/dbus-1/system-services
416 mv org.projectx.bt.service org.projectx.bt.service.ivi
417 popd
418 %files profile_ivi
419 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
420 %{_unitdir}/bluetooth-frwk.service.wearable
421 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
422
423 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
424 # (for PROFILE WEARABLE)
425