Modify the install path for license file
[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 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
239 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
240
241 # Rename the postfix (.mobile, .tv, ..) at post script
242 # mobile
243 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
244
245 # extension-TM1
246 %ifarch %{ix86} || %{arm}
247 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
248 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
249 %endif
250
251 # wearable / ivi
252 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
253 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
254 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
255 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
256
257 # tv
258 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
259
260 # common
261 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
262
263 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
264 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
265
266 %postun -p /sbin/ldconfig
267
268 %files
269 %manifest %{name}.manifest
270 %license LICENSE
271 %defattr(-, root, root)
272 %{_libdir}/libbluetooth-api.so.*
273
274 %files devel
275 %defattr(-, root, root)
276 %{_includedir}/bt-service/bluetooth-api.h
277 %{_includedir}/bt-service/bluetooth-hid-api.h
278 %{_includedir}/bt-service/bluetooth-audio-api.h
279 %{_includedir}/bt-service/bluetooth-telephony-api.h
280 %{_includedir}/bt-service/bluetooth-media-control.h
281 %{_includedir}/bt-service/bluetooth-scmst-api.h
282 %{_includedir}/bt-service/bluetooth-ipsp-api.h
283 %{_libdir}/pkgconfig/bluetooth-api.pc
284 %{_libdir}/libbluetooth-api.so
285
286 %files service
287 %manifest %{name}.manifest
288 %license LICENSE
289 %defattr(-, root, root)
290 %{_bindir}/bt-service
291 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
292 %{_bindir}/bluetooth-frwk-test
293 %{_varlibdir}/bluetooth
294 %{_prefix}/etc/bluetooth
295
296 %files httpproxy
297 %manifest %{name}.manifest
298 %license LICENSE
299 %defattr(-, root, root)
300 %{_bindir}/bt-httpproxy
301 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
302 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
303
304 %files core
305 %manifest %{name}.manifest
306 %license LICENSE
307 %defattr(-, root, root)
308 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
309 %{_bindir}/bt-core
310 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
311
312 %files test
313 %manifest %{name}.manifest
314 %license LICENSE
315 %defattr(-, root, root)
316 %{_bindir}/bluetooth-frwk-test
317 #{_bindir}/bluetooth-gatt-test
318 #{_bindir}/bluetooth-advertising-test
319
320 %files plugin-headed
321 %manifest %{name}.manifest
322 %license LICENSE
323 %defattr(-, root, root)
324 %{_libdir}/bt-plugin-headed.so
325
326 %post profile_common
327 pushd %{_unitdir}
328 mv bluetooth-frwk.service.common bluetooth-frwk.service
329 popd
330 %preun profile_common
331 pushd %{_unitdir}
332 mv bluetooth-frwk.service bluetooth-frwk.service.common
333 popd
334 %files profile_common
335 %license LICENSE
336 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
337 %{_unitdir}/bluetooth-frwk.service.common
338 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
339
340 %post profile_mobile
341 pushd %{_unitdir}
342 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
343 popd
344 %preun profile_mobile
345 pushd %{_unitdir}
346 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
347 popd
348 %files profile_mobile
349 %license LICENSE
350 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
351 %{_unitdir}/bluetooth-frwk.service.mobile
352 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
353
354 # extension-TM1
355 %ifarch %{ix86} || %{arm}
356 %post extension-TM1
357 pushd %{_unitdir}
358 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
359 popd
360 pushd %{_bindir}
361 mv bt-core.tm1 bt-core
362 popd
363 %preun extension-TM1
364 pushd %{_unitdir}
365 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
366 popd
367 pushd %{_bindir}
368 mv bt-core bt-core.tm1
369 popd
370 %files extension-TM1
371 %{_unitdir}/bluetooth-frwk.service.tm1
372 %license LICENSE
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 %license LICENSE
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 %license LICENSE
401 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
402 %{_unitdir}/bluetooth-frwk.service.tv
403 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
404
405 # Note: ivi reuses bluetooth-frwk.service.wearable
406 %post profile_ivi
407 pushd %{_unitdir}
408 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
409 popd
410 pushd %{_datadir}/dbus-1/system-services
411 mv org.projectx.bt.service.ivi org.projectx.bt.service
412 popd
413 %preun profile_ivi
414 pushd %{_unitdir}
415 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
416 popd
417 pushd %{_datadir}/dbus-1/system-services
418 mv org.projectx.bt.service org.projectx.bt.service.ivi
419 popd
420 %files profile_ivi
421 %license LICENSE
422 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
423 %{_unitdir}/bluetooth-frwk.service.wearable
424 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
425
426 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
427 # (for PROFILE WEARABLE)
428