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