Launch bluetooth-frwk service after multi-user.target in TM1
[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.151
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 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
14 Source1002: bt-icon.png
15 %endif
16
17 Requires: dbus
18 Requires: syspopup
19 %if "%{?profile}" != "mobile"
20 Requires: bluetooth-tools
21 %endif
22 BuildRequires:  pkgconfig(aul)
23 BuildRequires:  pkgconfig(dbus-glib-1)
24 BuildRequires:  pkgconfig(dlog)
25 BuildRequires:  pkgconfig(glib-2.0)
26 BuildRequires:  pkgconfig(gio-2.0)
27 BuildRequires:  pkgconfig(gio-unix-2.0)
28 %if %{with bluetooth_frwk_libnotify}
29 BuildRequires:  pkgconfig(libnotify)
30 BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
31 BuildRequires:  pkgconfig(gtk+-3.0)
32 %elif %{without bluetooth_frwk_libnotification}
33 BuildRequires:  pkgconfig(syspopup-caller)
34 Requires:       syspopup
35 %else
36 BuildRequires:  pkgconfig(syspopup-caller)
37 %endif
38 BuildRequires:  pkgconfig(vconf)
39 BuildRequires:  pkgconfig(libxml-2.0)
40 BuildRequires:  pkgconfig(dbus-1)
41 %if %{with x}
42 BuildRequires:  pkgconfig(utilX)
43 %endif
44 BuildRequires:  pkgconfig(capi-network-connection)
45 BuildRequires:  pkgconfig(alarm-service)
46 BuildRequires:  pkgconfig(capi-content-mime-type)
47 BuildRequires:  pkgconfig(appcore-efl)
48 BuildRequires:  pkgconfig(pkgmgr)
49 #BuildRequires:  pkgconfig(journal)
50 BuildRequires:  pkgconfig(eventsystem)
51 BuildRequires:  pkgconfig(libsoup-2.4)
52 %if "%{?profile}" == "mobile"
53 BuildRequires:  pkgconfig(capi-network-tethering)
54 %endif
55 BuildRequires:  cmake
56 BuildRequires:  pkgconfig(cynara-client)
57 BuildRequires:  pkgconfig(cynara-creds-gdbus)
58 BuildRequires:  pkgconfig(libtzplatform-config)
59
60 Requires(post): /usr/bin/vconftool
61 Requires(post): /sbin/ldconfig
62 Requires(postun): /sbin/ldconfig
63 Requires: psmisc
64
65 %description
66 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
67  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
68
69
70 %package devel
71 Summary:    Bluetooth framework for BlueZ and Obexd
72 Group:      Development/Libraries
73 Requires:   %{name} = %{version}-%{release}
74
75 %description devel
76 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
77 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
78
79 %package service
80 Summary:    Bluetooth Service daemon
81 Group:      Network & Connectivity/Bluetooth
82 Requires:   %{name} = %{version}-%{release}
83
84 %description service
85 This package is Bluetooth Service daemon to manage BT services.
86
87 %package httpproxy
88 Summary:    Bluetooth HTTP Proxy Service daemon
89 Group:      TO_BE/FILLED
90 Requires:   %{name} = %{version}-%{release}
91
92 %description httpproxy
93 This package is Bluetooth HTTP Proxy Service daemon
94
95 %package core
96 Summary:    Bluetooth Core daemon
97 Group:      Network & Connectivity/Bluetooth
98 Requires:   %{name} = %{version}-%{release}
99
100 %description core
101 This package is Bluetooth core daemon to manage activation / deactivation.
102
103 %package test
104 Summary:    Bluetooth test application
105 Group:      Network & Connectivity/Bluetooth
106 Requires:   %{name} = %{version}-%{release}
107
108 %description test
109 This package is Bluetooth test application.
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_NETWORK_TETHERING_ENABLE -DTIZEN_BT_FLIGHTMODE_ENABLED -DTIZEN_MOBILE -DTIZEN_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_WEARABLE"
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-mobile.service
143 %define _servicedir multi-user.target.wants
144 %endif
145
146 %ifarch x86_64
147 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
148 %else
149 export CFLAGS="$CFLAGS -fpie"
150 export LDFLAGS="$CFLAGS -pie"
151 %endif
152
153 export CFLAGS="$CFLAGS -DRFCOMM_DIRECT"
154 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
155
156 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
157 -DCMAKE_LIB_DIR=%{_libdir} \
158 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
159 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
160 %if %{with bluetooth_frwk_libnotify}
161         -DLIBNOTIFY_SUPPORT=On \
162 %else
163         -DLIBNOTIFY_SUPPORT=Off \
164 %endif
165 %if %{with bluetooth_frwk_libnotification}
166         -DLIBNOTIFICATION_SUPPORT=On
167 %else
168         -DLIBNOTIFICATION_SUPPORT=Off
169 %endif
170
171 make
172
173 %cmake \
174 %if "%{?profile}" == "wearable"
175         -DTIZEN_WEARABLE=YES \
176 %else
177         -DTIZEN_WEARABLE=NO \
178 %endif
179 %if "%{?profile}" == "common"
180         -DTIZEN_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 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
199 mkdir -p %{buildroot}%{_datadir}/icons/default
200 install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
201 %endif
202
203 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
204 %if "%{profile}"=="ivi"
205 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
206 %endif
207
208
209 #%post
210 #/sbin/ldconfig
211 #%if "%{?profile}" == "wearable"
212 #vconftool set -f -t int db/bluetooth/status "1" -g 6520
213 #%endif
214 #%if "%{?profile}" == "mobile"
215 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
216 #%endif
217 #%if "%{?profile}" == "common"
218 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
219 #%endif
220
221 #vconftool set -f -t int db/bluetooth/status "0" -s User
222 #vconftool set -f -t int db/bluetooth/lestatus "0" -s User
223 #vconftool set -f -t int file/private/bt-core/flight_mode_deactivated "0" -s User
224 #vconftool set -f -t int file/private/bt-core/powersaving_mode_deactivated "0" -s User
225 #vconftool set -f -t int file/private/bt-service/bt_off_due_to_timeout "0" -s User
226 #vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
227 #vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
228 #vconftool set -f -t bool memory/bluetooth/btsco "0" -g 6520 -i
229 #vconftool set -f -t bool memory/bluetooth/dutmode "0" -g 6520 -i
230
231
232 #%post service
233 #mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
234 #ln -sf %{_libdir}/systemd/user/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
235
236 %postun -p /sbin/ldconfig
237
238 %files
239 %manifest %{name}.manifest
240 %defattr(-, root, root)
241 %{_libdir}/libbluetooth-api.so.*
242 %{_datadir}/license/bluetooth-frwk
243 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
244 %{_unitdir}/bluetooth-frwk.service
245
246 %files devel
247 %defattr(-, root, root)
248 %{_includedir}/bt-service/bluetooth-api.h
249 %{_includedir}/bt-service/bluetooth-hid-api.h
250 %{_includedir}/bt-service/bluetooth-audio-api.h
251 %{_includedir}/bt-service/bluetooth-telephony-api.h
252 %{_includedir}/bt-service/bluetooth-media-control.h
253 %{_includedir}/bt-service/bluetooth-scmst-api.h
254 %{_includedir}/bt-service/bluetooth-ipsp-api.h
255 %{_libdir}/pkgconfig/bluetooth-api.pc
256 %{_libdir}/libbluetooth-api.so
257 %{_datadir}/license/bluetooth-frwk-devel
258
259 %files service
260 %manifest %{name}.manifest
261 %defattr(-, root, root)
262 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
263 %{_bindir}/bt-service
264 #%{_libdir}/systemd/user/bluetooth-frwk-tv.service
265 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
266 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
267 %{_bindir}/bluetooth-frwk-test
268 #%{_bindir}/bluetooth-gatt-test
269 #%{_bindir}/bluetooth-advertising-test
270 %{_varlibdir}/bluetooth
271 %{_prefix}/etc/bluetooth
272 #%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
273 #%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
274 #%{_dumpdir}/bluetooth_log_dump.sh
275 %{_datadir}/license/bluetooth-frwk-service
276 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
277 %{_datadir}/icons/default/bt-icon.png
278 %endif
279
280 %files httpproxy
281 %manifest %{name}.manifest
282 %defattr(-, root, root)
283 %{_bindir}/bt-httpproxy
284 %{_datadir}/license/bluetooth-frwk-httpproxy
285 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
286
287 %files core
288 %manifest %{name}.manifest
289 %defattr(-, root, root)
290 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
291 %{_bindir}/bt-core
292 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
293
294 %files test
295 %manifest %{name}.manifest
296 %defattr(-, root, root)
297 %{_bindir}/bluetooth-frwk-test
298 %{_bindir}/bluetooth-gatt-test
299 %{_bindir}/bluetooth-advertising-test