Remove dbus-glib APIs and headers
[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"
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"
137 %else
138 export CFLAGS="$CFLAGS -fpie"
139 export LDFLAGS="$CFLAGS -pie"
140 %endif
141
142 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
143 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
144
145 %if "%{?_with_emulator}" == "1"
146 export CFLAGS="$CFLAGS -DTIZEN_TEST_EMUL"
147 export CXXFLAGS="$CXXFLAGS -DTIZEN_TEST_EMUL"
148 export FFLAGS="$FFLAGS -DTIZEN_TEST_EMUL"
149 %endif
150
151
152 %if "%{?tizen_target_name}" == "TM1"
153 export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_RADIO"
154 export CXXFLAGS="$CXXFLAGS -DTIZEN_FEATURE_RADIO"
155 export FFLAGS="$FFLAGS -DTIZEN_FEATURE_RADIO"
156 %endif
157
158 %ifarch aarch64
159 echo arch64
160 export CFLAGS+=" -DARCH64"
161 export CXXFLAGS+=" -DARCH64"
162 export FFLAGS+=" -DARCH64"
163 %endif
164
165 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
166 -DCMAKE_LIB_DIR=%{_libdir} \
167 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
168 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
169         -DLIBNOTIFY_SUPPORT=Off \
170         -DLIBNOTIFICATION_SUPPORT=Off
171 make
172
173 %cmake \
174 %if "%{?profile}" == "wearable"
175         -DTIZEN_PROFILE_WEARABLE=YES \
176 %else
177         -DTIZEN_PROFILE_WEARABLE=NO \
178 %endif
179 %if "%{?profile}" == "common"
180         -DTIZEN_PROFILE_WEARABLE=NO \
181 %endif
182
183 %install
184 rm -rf %{buildroot}
185 %make_install
186
187 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
188 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
189 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-httpproxy
190 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
191
192 #mkdir -p %{buildroot}%{_libdir}/systemd/user
193 #install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_libdir}/systemd/user
194 mkdir -p %{buildroot}%{_unitdir}/%{_servicedir}
195 install -m 0644 %{_servicefile} %{buildroot}%{_unitdir}/bluetooth-frwk.service
196 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/%{_servicedir}/bluetooth-frwk.service
197
198 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
199 %if "%{profile}"=="ivi"
200 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
201 %endif
202
203
204 #%post
205 #/sbin/ldconfig
206 #%if "%{?profile}" == "wearable"
207 #vconftool set -f -t int db/bluetooth/status "1" -g 6520
208 #%endif
209 #%if "%{?profile}" == "mobile"
210 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
211 #%endif
212 #%if "%{?profile}" == "common"
213 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
214 #%endif
215
216 #vconftool set -f -t int db/bluetooth/status "0" -s User
217 #vconftool set -f -t int db/bluetooth/lestatus "0" -s User
218 #vconftool set -f -t int file/private/bt-core/flight_mode_deactivated "0" -s User
219 #vconftool set -f -t int file/private/bt-core/powersaving_mode_deactivated "0" -s User
220 #vconftool set -f -t int file/private/bt-service/bt_off_due_to_timeout "0" -s User
221 #vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
222 #vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
223 #vconftool set -f -t bool memory/bluetooth/btsco "0" -g 6520 -i
224 #vconftool set -f -t bool memory/bluetooth/dutmode "0" -g 6520 -i
225
226
227 #%post service
228 #mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
229 #ln -sf %{_libdir}/systemd/user/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
230
231 %postun -p /sbin/ldconfig
232
233 %files
234 %manifest %{name}.manifest
235 %defattr(-, root, root)
236 %{_libdir}/libbluetooth-api.so.*
237 %{_datadir}/license/bluetooth-frwk
238 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
239 %{_unitdir}/bluetooth-frwk.service
240
241 %files devel
242 %defattr(-, root, root)
243 %{_includedir}/bt-service/bluetooth-api.h
244 %{_includedir}/bt-service/bluetooth-hid-api.h
245 %{_includedir}/bt-service/bluetooth-audio-api.h
246 %{_includedir}/bt-service/bluetooth-telephony-api.h
247 %{_includedir}/bt-service/bluetooth-media-control.h
248 %{_includedir}/bt-service/bluetooth-scmst-api.h
249 %{_includedir}/bt-service/bluetooth-ipsp-api.h
250 %{_libdir}/pkgconfig/bluetooth-api.pc
251 %{_libdir}/libbluetooth-api.so
252 %{_datadir}/license/bluetooth-frwk-devel
253
254 %files service
255 %manifest %{name}.manifest
256 %defattr(-, root, root)
257 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
258 %{_bindir}/bt-service
259 #%{_libdir}/systemd/user/bluetooth-frwk-tv.service
260 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
261 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
262 %{_bindir}/bluetooth-frwk-test
263 #%{_bindir}/bluetooth-gatt-test
264 #%{_bindir}/bluetooth-advertising-test
265 %{_varlibdir}/bluetooth
266 %{_prefix}/etc/bluetooth
267 #%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
268 #%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
269 #%{_dumpdir}/bluetooth_log_dump.sh
270 %{_datadir}/license/bluetooth-frwk-service
271
272 %files httpproxy
273 %manifest %{name}.manifest
274 %defattr(-, root, root)
275 %{_bindir}/bt-httpproxy
276 %{_datadir}/license/bluetooth-frwk-httpproxy
277 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
278 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
279
280 %files core
281 %manifest %{name}.manifest
282 %defattr(-, root, root)
283 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
284 %{_bindir}/bt-core
285 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
286
287 %files test
288 %manifest %{name}.manifest
289 %defattr(-, root, root)
290 %{_bindir}/bluetooth-frwk-test
291 #%{_bindir}/bluetooth-gatt-test
292 #%{_bindir}/bluetooth-advertising-test