[OAL] Add support for GATT Server API's & callbacks
[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.
7 Version:    0.2.152
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: dbus
15 Requires: syspopup
16 %if "%{?profile}" != "mobile"
17 Requires: bluetooth-tools
18 %endif
19
20 %define bt_hal ENABLED
21 %define bt_bluez_hal ENABLED
22
23 BuildRequires:  pkgconfig(aul)
24 BuildRequires:  pkgconfig(dbus-glib-1)
25 BuildRequires:  pkgconfig(dlog)
26 BuildRequires:  pkgconfig(glib-2.0)
27 BuildRequires:  pkgconfig(gio-2.0)
28 BuildRequires:  pkgconfig(gio-unix-2.0)
29 BuildRequires:  pkgconfig(syspopup-caller)
30 BuildRequires:  pkgconfig(vconf)
31 BuildRequires:  pkgconfig(libxml-2.0)
32 BuildRequires:  pkgconfig(dbus-1)
33 BuildRequires:  pkgconfig(capi-network-connection)
34 BuildRequires:  pkgconfig(alarm-service)
35 BuildRequires:  pkgconfig(capi-content-mime-type)
36 BuildRequires:  pkgconfig(appcore-efl)
37 BuildRequires:  pkgconfig(pkgmgr)
38 #BuildRequires:  pkgconfig(journal)
39 BuildRequires:  pkgconfig(eventsystem)
40 BuildRequires:  pkgconfig(libsoup-2.4)
41 %if "%{?profile}" == "mobile"
42 BuildRequires:  pkgconfig(capi-network-tethering)
43 %endif
44 BuildRequires:  cmake
45 BuildRequires:  pkgconfig(cynara-client)
46 BuildRequires:  pkgconfig(cynara-creds-gdbus)
47 BuildRequires:  pkgconfig(libtzplatform-config)
48 BuildRequires:  pkgconfig(storage)
49
50 Requires(post): /usr/bin/vconftool
51 Requires(post): /sbin/ldconfig
52 Requires(postun): /sbin/ldconfig
53 Requires: psmisc
54
55 %description
56 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
57  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
58
59
60 %package devel
61 Summary:    Bluetooth framework for BlueZ and Obexd
62 Group:      Development/Libraries
63 Requires:   %{name} = %{version}-%{release}
64
65 %description devel
66 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
67 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
68
69 %package service
70 Summary:    Bluetooth Service daemon
71 Group:      Network & Connectivity/Bluetooth
72 Requires:   %{name} = %{version}-%{release}
73
74 %description service
75 This package is Bluetooth Service daemon to manage BT services.
76
77 %package httpproxy
78 Summary:    Bluetooth HTTP Proxy Service daemon
79 Group:      Network & Connectivity/Bluetooth
80 Requires:   %{name} = %{version}-%{release}
81
82 %description httpproxy
83 This package is Bluetooth HTTP Proxy Service daemon
84
85 %package core
86 Summary:    Bluetooth Core daemon
87 Group:      Network & Connectivity/Bluetooth
88 Requires:   %{name} = %{version}-%{release}
89
90 %description core
91 This package is Bluetooth core daemon to manage activation / deactivation.
92
93 %package test
94 Summary:    Bluetooth test application
95 Group:      Network & Connectivity/Bluetooth
96 Requires:   %{name} = %{version}-%{release}
97
98 %description test
99 This package is Bluetooth test application.
100
101 %if %{bt_hal} == ENABLED
102 %package oal
103 Summary:    Bluetooth OAL
104 Group:      Network & Connectivity/Bluetooth
105 Requires:   %{name} = %{version}-%{release}
106
107 %description oal
108 This package is BT stack common interface.
109 %endif
110
111 %prep
112 %setup -q
113 cp %{SOURCE1001} .
114
115
116 %build
117 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
118 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
119 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
120
121 %define _servicefile packaging/bluetooth-frwk-common.service
122 %define _servicedir starter.target.wants
123
124 %if "%{?profile}" == "mobile"
125 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_NETWORK_TETHERING_ENABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED -DTIZEN_PROFILE_MOBILE -DTIZEN_FEATURE_TELEPHONY_ENABLED"
126 %if "%{?tizen_target_name}" == "TM1"
127 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
128 %else
129 %define _servicefile packaging/bluetooth-frwk-mobile.service
130 %endif
131 %define _servicedir multi-user.target.wants
132 %endif
133
134 %if "%{?profile}" == "wearable"
135 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE -DTIZEN_FEATURE_FLIGHTMODE_ENABLED"
136 %define _servicefile packaging/bluetooth-frwk-wearable.service
137 %define _servicedir multi-user.target.wants
138 %endif
139
140 %if "%{?profile}" == "tv"
141 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
142 %define _servicefile packaging/bluetooth-frwk-tv.service
143 %define _servicedir multi-user.target.wants
144 %endif
145
146 %if "%{?profile}" == "ivi"
147 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
148 %define _servicefile packaging/bluetooth-frwk-wearable.service
149 %define _servicedir multi-user.target.wants
150 %endif
151
152 %ifarch x86_64
153 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
154 %else
155 export CFLAGS="$CFLAGS -fpie"
156 export LDFLAGS="$CFLAGS -pie"
157 %endif
158
159 %if %{bt_hal} == ENABLED
160 export CFLAGS="$CFLAGS -URFCOMM_DIRECT -DTIZEN_BT_HAL"
161 %else
162 export CFLAGS="$CFLAGS -DRFCOMM_DIRECT"
163 %endif
164 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
165
166 %if "%{?_with_emulator}" == "1"
167 export CFLAGS="$CFLAGS -DTIZEN_TEST_EMUL"
168 export CXXFLAGS="$CXXFLAGS -DTIZEN_TEST_EMUL"
169 export FFLAGS="$FFLAGS -DTIZEN_TEST_EMUL"
170 %endif
171
172 %if "%{?tizen_target_name}" == "TM1"
173 export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_RADIO"
174 export CXXFLAGS="$CXXFLAGS -DTIZEN_FEATURE_RADIO"
175 export FFLAGS="$FFLAGS -DTIZEN_FEATURE_RADIO"
176 %endif
177
178 %if %{bt_hal} == ENABLED
179 export BT_INCLUDE_OAL=ENABLED
180 %if %{bt_bluez_hal} == ENABLED
181 export BT_INCLUDE_OAL_BLUEZ=ENABLED
182 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
183 #export CFLAGS="$CFLAGS -DTIZEN_SYSPOPUP_SUPPORTED"
184 %else
185 export BT_INCLUDE_OAL_BLUEZ=DISABLED
186 %endif
187 %else
188 export BT_INCLUDE_OAL=DISABLED
189 %endif
190
191 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
192 -DCMAKE_LIB_DIR=%{_libdir} \
193 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
194 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
195         -DLIBNOTIFY_SUPPORT=Off \
196         -DLIBNOTIFICATION_SUPPORT=Off
197 make
198
199 %cmake \
200 %if "%{?profile}" == "wearable"
201         -DTIZEN_PROFILE_WEARABLE=YES \
202 %else
203         -DTIZEN_PROFILE_WEARABLE=NO \
204 %endif
205 %if "%{?profile}" == "common"
206         -DTIZEN_PROFILE_WEARABLE=NO \
207 %endif
208
209 %install
210 rm -rf %{buildroot}
211 %make_install
212
213 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
214 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
215 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-httpproxy
216 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
217
218 #mkdir -p %{buildroot}%{_libdir}/systemd/user
219 #install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_libdir}/systemd/user
220 mkdir -p %{buildroot}%{_unitdir}/%{_servicedir}
221 install -m 0644 %{_servicefile} %{buildroot}%{_unitdir}/bluetooth-frwk.service
222 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/%{_servicedir}/bluetooth-frwk.service
223
224 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
225 %if "%{profile}"=="ivi"
226 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
227 %endif
228
229
230 #%post
231 #/sbin/ldconfig
232 #%if "%{?profile}" == "wearable"
233 #vconftool set -f -t int db/bluetooth/status "1" -g 6520
234 #%endif
235 #%if "%{?profile}" == "mobile"
236 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
237 #%endif
238 #%if "%{?profile}" == "common"
239 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
240 #%endif
241
242 #vconftool set -f -t int db/bluetooth/status "0" -s User
243 #vconftool set -f -t int db/bluetooth/lestatus "0" -s User
244 #vconftool set -f -t int file/private/bt-core/flight_mode_deactivated "0" -s User
245 #vconftool set -f -t int file/private/bt-core/powersaving_mode_deactivated "0" -s User
246 #vconftool set -f -t int file/private/bt-service/bt_off_due_to_timeout "0" -s User
247 #vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
248 #vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
249 #vconftool set -f -t bool memory/bluetooth/btsco "0" -g 6520 -i
250 #vconftool set -f -t bool memory/bluetooth/dutmode "0" -g 6520 -i
251
252
253 #%post service
254 #mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
255 #ln -sf %{_libdir}/systemd/user/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
256
257 %postun -p /sbin/ldconfig
258
259 %files
260 %manifest %{name}.manifest
261 %defattr(-, root, root)
262 %{_libdir}/libbluetooth-api.so.*
263 %{_datadir}/license/bluetooth-frwk
264 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
265 %{_unitdir}/bluetooth-frwk.service
266
267 %files devel
268 %defattr(-, root, root)
269 %{_includedir}/bt-service/bluetooth-api.h
270 %{_includedir}/bt-service/bluetooth-hid-api.h
271 %{_includedir}/bt-service/bluetooth-audio-api.h
272 %{_includedir}/bt-service/bluetooth-telephony-api.h
273 %{_includedir}/bt-service/bluetooth-media-control.h
274 %{_includedir}/bt-service/bluetooth-scmst-api.h
275 %{_includedir}/bt-service/bluetooth-ipsp-api.h
276 %{_libdir}/pkgconfig/bluetooth-api.pc
277 %{_libdir}/libbluetooth-api.so
278 %{_datadir}/license/bluetooth-frwk-devel
279
280 %files service
281 %manifest %{name}.manifest
282 %defattr(-, root, root)
283 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
284 %{_bindir}/bt-service
285 #%{_libdir}/systemd/user/bluetooth-frwk-tv.service
286 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
287 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
288 %{_bindir}/bluetooth-frwk-test
289 #%{_bindir}/bluetooth-gatt-test
290 #%{_bindir}/bluetooth-advertising-test
291 %{_varlibdir}/bluetooth
292 %{_prefix}/etc/bluetooth
293 #%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
294 #%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
295 #%{_dumpdir}/bluetooth_log_dump.sh
296 %{_datadir}/license/bluetooth-frwk-service
297
298 %files httpproxy
299 %manifest %{name}.manifest
300 %defattr(-, root, root)
301 %{_bindir}/bt-httpproxy
302 %{_datadir}/license/bluetooth-frwk-httpproxy
303 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
304 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
305
306 %files core
307 %manifest %{name}.manifest
308 %defattr(-, root, root)
309 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
310 %{_bindir}/bt-core
311 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
312
313 %files test
314 %manifest %{name}.manifest
315 %defattr(-, root, root)
316 %{_bindir}/bluetooth-frwk-test
317 %{_bindir}/bluetooth-gatt-test
318 %{_bindir}/bluetooth-advertising-test
319
320 %if %{bt_hal} == ENABLED
321 %files oal
322 %manifest %{name}.manifest
323 %{_libdir}/libbt-oal.so*
324 %{_libdir}/libbluetooth.default.so*
325 %endif