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