[4.0] Remove Target_Name Dependency
[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 %prep
152 %setup -q
153 cp %{SOURCE1001} .
154
155
156 %build
157 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
158 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
159 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
160
161 %ifarch x86_64
162 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
163 %else
164 export CFLAGS="$CFLAGS -fpie"
165 export LDFLAGS="$CFLAGS -pie"
166 %endif
167
168 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
169 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
170
171 %if "%{?_with_emulator}" == "1"
172 export CFLAGS="$CFLAGS -DTIZEN_TEST_EMUL"
173 export CXXFLAGS="$CXXFLAGS -DTIZEN_TEST_EMUL"
174 export FFLAGS="$FFLAGS -DTIZEN_TEST_EMUL"
175 %endif
176
177 %ifarch aarch64
178 echo arch64
179 export CFLAGS+=" -DARCH64"
180 export CXXFLAGS+=" -DARCH64"
181 export FFLAGS+=" -DARCH64"
182 %endif
183
184 export CFLAGS_DEFAULT="$CFLAGS"
185 export CXXFLAGS_DEFAULT="$CXXFLAGS"
186 export FFLAGS_DEFAULT="$FFLAGS"
187
188 # extension-TM1
189 %ifarch %{ix86} || %{arm}
190 mkdir -p tm1
191 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
192 export CXXFLAGS="$CXXFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
193 export FFLAGS="$FFLAGS_DEFAULT -DTIZEN_FEATURE_RADIO"
194
195 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
196 -DCMAKE_LIB_DIR=%{_libdir} \
197 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
198 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
199         -DLIBNOTIFY_SUPPORT=Off \
200         -DLIBNOTIFICATION_SUPPORT=Off
201 make
202
203 %cmake
204
205 %make_install
206 cp %{buildroot}%{_bindir}/bt-core tm1/bt-core.tm1
207 %endif
208
209 # non-extension-TM1
210 export CFLAGS="$CFLAGS_DEFAULT"
211 export CXXFLAGS="$CXXFLAGS_DEFAULT"
212 export FFLAGS="$FFLAGS_DEFAULT"
213
214 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
215 -DCMAKE_LIB_DIR=%{_libdir} \
216 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
217 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
218         -DLIBNOTIFY_SUPPORT=Off \
219         -DLIBNOTIFICATION_SUPPORT=Off
220 make
221
222 %cmake
223
224 %install
225 rm -rf %{buildroot}
226 %make_install
227
228 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
229 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
230 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-httpproxy
231 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
232
233 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
234 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
235
236 # Rename the postfix (.mobile, .tv, ..) at post script
237 # mobile
238 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
239
240 # extension-TM1
241 %ifarch %{ix86} || %{arm}
242 cp tm1/bt-core.tm1 %{buildroot}%{_bindir}/
243 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tm1
244 %endif
245
246 # wearable / ivi
247 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
248 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
249 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
250 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
251
252 # tv
253 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
254
255 # common
256 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
257
258 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
259 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
260
261 %postun -p /sbin/ldconfig
262
263 %files
264 %manifest %{name}.manifest
265 %defattr(-, root, root)
266 %{_libdir}/libbluetooth-api.so.*
267 %{_datadir}/license/bluetooth-frwk
268
269 %files devel
270 %defattr(-, root, root)
271 %{_includedir}/bt-service/bluetooth-api.h
272 %{_includedir}/bt-service/bluetooth-hid-api.h
273 %{_includedir}/bt-service/bluetooth-audio-api.h
274 %{_includedir}/bt-service/bluetooth-telephony-api.h
275 %{_includedir}/bt-service/bluetooth-media-control.h
276 %{_includedir}/bt-service/bluetooth-scmst-api.h
277 %{_includedir}/bt-service/bluetooth-ipsp-api.h
278 %{_libdir}/pkgconfig/bluetooth-api.pc
279 %{_libdir}/libbluetooth-api.so
280 %{_datadir}/license/bluetooth-frwk-devel
281
282 %files service
283 %manifest %{name}.manifest
284 %defattr(-, root, root)
285 %{_bindir}/bt-service
286 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
287 %{_bindir}/bluetooth-frwk-test
288 %{_varlibdir}/bluetooth
289 %{_prefix}/etc/bluetooth
290 %{_datadir}/license/bluetooth-frwk-service
291
292 %files httpproxy
293 %manifest %{name}.manifest
294 %defattr(-, root, root)
295 %{_bindir}/bt-httpproxy
296 %{_datadir}/license/bluetooth-frwk-httpproxy
297 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
298 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
299
300 %files core
301 %manifest %{name}.manifest
302 %defattr(-, root, root)
303 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
304 %{_bindir}/bt-core
305 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
306
307 %files test
308 %manifest %{name}.manifest
309 %defattr(-, root, root)
310 %{_bindir}/bluetooth-frwk-test
311 #{_bindir}/bluetooth-gatt-test
312 #{_bindir}/bluetooth-advertising-test
313
314 %post profile_common
315 pushd %{_unitdir}
316 mv bluetooth-frwk.service.common bluetooth-frwk.service
317 popd
318 %preun profile_common
319 pushd %{_unitdir}
320 mv bluetooth-frwk.service bluetooth-frwk.service.common
321 popd
322 %files profile_common
323 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
324 %{_unitdir}/bluetooth-frwk.service.common
325 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
326
327 %post profile_mobile
328 pushd %{_unitdir}
329 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
330 popd
331 %preun profile_mobile
332 pushd %{_unitdir}
333 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
334 popd
335 %files profile_mobile
336 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
337 %{_unitdir}/bluetooth-frwk.service.mobile
338 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
339
340 # extension-TM1
341 %ifarch %{ix86} || %{arm}
342 %post extension-TM1
343 pushd %{_unitdir}
344 mv bluetooth-frwk.service.tm1 bluetooth-frwk.service
345 popd
346 pushd %{_bindir}
347 mv bt-core.tm1 bt-core
348 popd
349 %preun extension-TM1
350 pushd %{_unitdir}
351 mv bluetooth-frwk.service bluetooth-frwk.service.tm1
352 popd
353 pushd %{_bindir}
354 mv bt-core bt-core.tm1
355 popd
356 %files extension-TM1
357 %{_unitdir}/bluetooth-frwk.service.tm1
358 %defattr(-, root, root)
359 %{_bindir}/bt-core.tm1
360 %endif
361
362 %post profile_wearable
363 pushd %{_unitdir}
364 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
365 popd
366 %preun profile_wearable
367 pushd %{_unitdir}
368 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
369 popd
370 %files profile_wearable
371 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
372 %{_unitdir}/bluetooth-frwk.service.wearable
373 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
374
375 %post profile_tv
376 pushd %{_unitdir}
377 mv bluetooth-frwk.service.tv bluetooth-frwk.service
378 popd
379 %preun profile_tv
380 pushd %{_unitdir}
381 mv bluetooth-frwk.service bluetooth-frwk.service.tv
382 popd
383 %files profile_tv
384 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
385 %{_unitdir}/bluetooth-frwk.service.tv
386 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
387
388 # Note: ivi reuses bluetooth-frwk.service.wearable
389 %post profile_ivi
390 pushd %{_unitdir}
391 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
392 popd
393 pushd %{_datadir}/dbus-1/system-services
394 mv org.projectx.bt.service.ivi org.projectx.bt.service
395 popd
396 %preun profile_ivi
397 pushd %{_unitdir}
398 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
399 popd
400 pushd %{_datadir}/dbus-1/system-services
401 mv org.projectx.bt.service org.projectx.bt.service.ivi
402 popd
403 %files profile_ivi
404 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
405 %{_unitdir}/bluetooth-frwk.service.wearable
406 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
407
408 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
409 # (for PROFILE WEARABLE)
410